stickyflow 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/dist/binding/index.cjs +9 -9
- package/dist/binding/index.d.cts +4 -4
- package/dist/binding/index.d.ts +4 -4
- package/dist/binding/index.js +3 -3
- package/dist/{chunk-XPM3E7NV.cjs → chunk-B3YRZVMR.cjs} +23 -23
- package/dist/chunk-B3YRZVMR.cjs.map +1 -0
- package/dist/{chunk-CZW3ARXQ.js → chunk-BUVUJMWT.js} +5 -5
- package/dist/chunk-BUVUJMWT.js.map +1 -0
- package/dist/{chunk-LFEGZJWC.js → chunk-CM35H45Z.js} +3 -3
- package/dist/{chunk-LFEGZJWC.js.map → chunk-CM35H45Z.js.map} +1 -1
- package/dist/{chunk-GLZVHUSW.js → chunk-D2266VBZ.js} +393 -5
- package/dist/chunk-D2266VBZ.js.map +1 -0
- package/dist/{chunk-MAPNY7MJ.js → chunk-FS6L462E.js} +128 -15
- package/dist/chunk-FS6L462E.js.map +1 -0
- package/dist/{chunk-FQ7GMLCM.cjs → chunk-OUWGWDJ2.cjs} +15 -15
- package/dist/{chunk-FQ7GMLCM.cjs.map → chunk-OUWGWDJ2.cjs.map} +1 -1
- package/dist/{chunk-LNW5VIEA.cjs → chunk-QL7MNEMT.cjs} +393 -4
- package/dist/chunk-QL7MNEMT.cjs.map +1 -0
- package/dist/{chunk-IR2T47NW.cjs → chunk-SQBF2BKT.cjs} +257 -75
- package/dist/chunk-SQBF2BKT.cjs.map +1 -0
- package/dist/{chunk-VOYX6JMW.cjs → chunk-YSXD5IVZ.cjs} +778 -665
- package/dist/chunk-YSXD5IVZ.cjs.map +1 -0
- package/dist/{chunk-EDOPENSE.js → chunk-ZCGZJBAT.js} +228 -46
- package/dist/chunk-ZCGZJBAT.js.map +1 -0
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +232 -230
- package/dist/interaction/index.cjs.map +1 -1
- package/dist/interaction/index.d.cts +2 -2
- package/dist/interaction/index.d.ts +2 -2
- package/dist/interaction/index.js +4 -2
- package/dist/interaction/index.js.map +1 -1
- package/dist/{render-Bp2FLEzv.d.cts → render-DU4lYbRl.d.cts} +19 -11
- package/dist/{render-Bp2FLEzv.d.ts → render-DU4lYbRl.d.ts} +19 -11
- package/dist/{runtime-DIag-XBa.d.cts → runtime-DG8X3Fwf.d.cts} +2 -2
- package/dist/{runtime-CWIGxRcL.d.ts → runtime-kqD1RS17.d.ts} +2 -2
- package/dist/{runtimeTypes-C7sSLfOK.d.ts → runtimeTypes-CvjlBZds.d.cts} +7 -3
- package/dist/{runtimeTypes-BYODuxHk.d.cts → runtimeTypes-vRaHOIHi.d.ts} +7 -3
- package/dist/stickyflow-diagram.global.js +192 -40
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-D2w6D_wG.d.cts → types-B5jrEEcF.d.cts} +1 -1
- package/dist/{types-B9QM_H3R.d.ts → types-B7IkZ0w4.d.ts} +1 -1
- package/dist/viewer/index.cjs +9 -9
- package/dist/viewer/index.d.cts +4 -4
- package/dist/viewer/index.d.ts +4 -4
- package/dist/viewer/index.js +4 -4
- package/dist/web-component/index.cjs +6 -6
- package/dist/web-component/index.d.cts +2 -2
- package/dist/web-component/index.d.ts +2 -2
- package/dist/web-component/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-CZW3ARXQ.js.map +0 -1
- package/dist/chunk-EDOPENSE.js.map +0 -1
- package/dist/chunk-GLZVHUSW.js.map +0 -1
- package/dist/chunk-IR2T47NW.cjs.map +0 -1
- package/dist/chunk-LNW5VIEA.cjs.map +0 -1
- package/dist/chunk-MAPNY7MJ.js.map +0 -1
- package/dist/chunk-VOYX6JMW.cjs.map +0 -1
- package/dist/chunk-XPM3E7NV.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQL7MNEMT_cjs = require('./chunk-QL7MNEMT.cjs');
|
|
4
4
|
|
|
5
5
|
// src/renderInput/styleDecoding/colorToken.ts
|
|
6
6
|
var COLOR_TOKEN_PATTERN = String.raw`rgba?\([^)]*\)|#[0-9a-fA-F]+|[a-zA-Z][\w-]*`;
|
|
@@ -163,6 +163,23 @@ var PATH_TYPES = ["straight", "curved", "orthogonal"];
|
|
|
163
163
|
function optionalOneOf(value, allowed) {
|
|
164
164
|
return value !== void 0 && allowed.includes(value) ? value : void 0;
|
|
165
165
|
}
|
|
166
|
+
var BLEND_MODES = [
|
|
167
|
+
"multiply",
|
|
168
|
+
"screen",
|
|
169
|
+
"overlay",
|
|
170
|
+
"darken",
|
|
171
|
+
"lighten",
|
|
172
|
+
"color-dodge",
|
|
173
|
+
"color-burn",
|
|
174
|
+
"hard-light",
|
|
175
|
+
"soft-light",
|
|
176
|
+
"difference",
|
|
177
|
+
"exclusion",
|
|
178
|
+
"hue",
|
|
179
|
+
"saturation",
|
|
180
|
+
"color",
|
|
181
|
+
"luminosity"
|
|
182
|
+
];
|
|
166
183
|
var SHAPE_STROKE_STYLES = ["solid", "dashed", "dotted", "double"];
|
|
167
184
|
var MARKER_TYPES = [
|
|
168
185
|
"none",
|
|
@@ -643,7 +660,7 @@ function readComponentValue(descriptor, raw) {
|
|
|
643
660
|
return raw;
|
|
644
661
|
}
|
|
645
662
|
function genericComponentObject(canvasObject) {
|
|
646
|
-
const descriptor =
|
|
663
|
+
const descriptor = chunkQL7MNEMT_cjs.getComponentDescriptor(canvasObject.component.type);
|
|
647
664
|
return {
|
|
648
665
|
id: canvasObject.id,
|
|
649
666
|
type: canvasObject.component.type,
|
|
@@ -832,7 +849,7 @@ var BUILT_IN_OBJECTS = {
|
|
|
832
849
|
};
|
|
833
850
|
function componentObject(canvasObject) {
|
|
834
851
|
const type = canvasObject.component.type;
|
|
835
|
-
return
|
|
852
|
+
return chunkQL7MNEMT_cjs.isBuiltInComponentType(type) ? BUILT_IN_OBJECTS[type](canvasObject) : genericComponentObject(canvasObject);
|
|
836
853
|
}
|
|
837
854
|
|
|
838
855
|
// src/renderInput/fromSfl/canvasObjects/connection.ts
|
|
@@ -898,6 +915,7 @@ function frameObject(e) {
|
|
|
898
915
|
showLabel: p.showLabel !== "false",
|
|
899
916
|
labelPosition: oneOf(p.labelPosition, LABEL_POSITIONS, "top"),
|
|
900
917
|
shadow: p.shadow !== "false",
|
|
918
|
+
clip: p.clip === "true" || void 0,
|
|
901
919
|
order: e.order,
|
|
902
920
|
sourceIndex: e.sourceIndex
|
|
903
921
|
};
|
|
@@ -925,6 +943,7 @@ function isometricObject(canvasObject) {
|
|
|
925
943
|
strokeColor: solidColor(presentation.stroke) ?? "#111827",
|
|
926
944
|
strokeWidth: numOf(presentation.strokeWidth) ?? 1,
|
|
927
945
|
cornerRadius: numOf(presentation.cornerRadius) ?? (canvasObject.isometric.footprint ? 0 : 8),
|
|
946
|
+
seams: presentation.seams === "false" ? false : void 0,
|
|
928
947
|
hasShadow: shadowStyle?.enabled ?? false,
|
|
929
948
|
shadowStyle,
|
|
930
949
|
labelOffsetX: numOf(presentation.labelOffsetX) ?? 0,
|
|
@@ -1029,6 +1048,8 @@ function shapeObject(e, shaders) {
|
|
|
1029
1048
|
dash: dashArray(p.dash),
|
|
1030
1049
|
strokeStyle: optionalOneOf(p.strokeStyle, SHAPE_STROKE_STYLES),
|
|
1031
1050
|
opacity: numOf(p.opacity),
|
|
1051
|
+
blur: numOf(p.blur),
|
|
1052
|
+
blend: optionalOneOf(p.blend, BLEND_MODES),
|
|
1032
1053
|
parentFrameId: e.parentFrameId,
|
|
1033
1054
|
order: e.order,
|
|
1034
1055
|
sourceIndex: e.sourceIndex,
|
|
@@ -1073,9 +1094,9 @@ function collectCanvasObjects(state) {
|
|
|
1073
1094
|
shapes: canvasObjects.filter((canvasObject) => canvasObject.objectType === "shape").map((shape) => shapeObject(shape, shaders)),
|
|
1074
1095
|
frames: canvasObjects.filter((canvasObject) => canvasObject.objectType === "frame").map(frameObject),
|
|
1075
1096
|
swimlanes: canvasObjects.filter((canvasObject) => canvasObject.objectType === "swimlane").map(swimlaneObject),
|
|
1076
|
-
isometricObjects: canvasObjects.filter(
|
|
1097
|
+
isometricObjects: canvasObjects.filter(chunkQL7MNEMT_cjs.isIsometricObject).map(isometricObject),
|
|
1077
1098
|
paths: canvasObjects.filter((canvasObject) => canvasObject.objectType === "path").map(pathObject),
|
|
1078
|
-
dimensions: canvasObjects.filter(
|
|
1099
|
+
dimensions: canvasObjects.filter(chunkQL7MNEMT_cjs.isDimensionObject).map(dimensionObject),
|
|
1079
1100
|
charts: canvasObjects.filter((canvasObject) => canvasObject.objectType === "chart").map(chartObject),
|
|
1080
1101
|
components: canvasObjects.filter(
|
|
1081
1102
|
(canvasObject) => canvasObject.objectType === "component" && canvasObject.component !== void 0
|
|
@@ -1102,9 +1123,9 @@ function sidePoint(canvasObject, endpoint) {
|
|
|
1102
1123
|
function namedPortPoint(canvasObject, endpoint) {
|
|
1103
1124
|
const port = canvasObject.symbol?.ports?.find((candidate) => candidate.name === endpoint.port);
|
|
1104
1125
|
if (!port) {
|
|
1105
|
-
return
|
|
1126
|
+
return chunkQL7MNEMT_cjs.elementCenter(canvasObject);
|
|
1106
1127
|
}
|
|
1107
|
-
return
|
|
1128
|
+
return chunkQL7MNEMT_cjs.pointAtNormalizedPort(
|
|
1108
1129
|
{
|
|
1109
1130
|
x: canvasObject.x,
|
|
1110
1131
|
y: canvasObject.y,
|
|
@@ -1150,7 +1171,7 @@ function explicitAnchorPoint(canvasObject, endpoint) {
|
|
|
1150
1171
|
return null;
|
|
1151
1172
|
}
|
|
1152
1173
|
function automaticEndpointPoint(canvasObject, opposite) {
|
|
1153
|
-
return opposite ?
|
|
1174
|
+
return opposite ? chunkQL7MNEMT_cjs.edgePointToward(canvasObject, opposite) : chunkQL7MNEMT_cjs.elementCenter(canvasObject);
|
|
1154
1175
|
}
|
|
1155
1176
|
function findPositionedCanvasObject(canvasObjects, id) {
|
|
1156
1177
|
return canvasObjects.find((candidate) => candidate.id === id);
|
|
@@ -1168,7 +1189,7 @@ function positionedCanvasObjects(canvasObjects) {
|
|
|
1168
1189
|
];
|
|
1169
1190
|
}
|
|
1170
1191
|
function connectionEndpointPoint(object, face) {
|
|
1171
|
-
return object ?
|
|
1192
|
+
return object ? chunkQL7MNEMT_cjs.isometricFaceCenter(object, face) : { x: 0, y: 0 };
|
|
1172
1193
|
}
|
|
1173
1194
|
function isometricStackPosition(isometricObjects, id) {
|
|
1174
1195
|
const index = isometricObjects.findIndex((object2) => object2.id === id);
|
|
@@ -1183,8 +1204,8 @@ function connectionStack(isometricObjects, connection) {
|
|
|
1183
1204
|
return { order: connection.order, sourceIndex: connection.sourceIndex };
|
|
1184
1205
|
}
|
|
1185
1206
|
const behind = [
|
|
1186
|
-
|
|
1187
|
-
|
|
1207
|
+
chunkQL7MNEMT_cjs.VISIBLE_ISOMETRIC_FACES.has(connection.fromFace) ? void 0 : isometricStackPosition(isometricObjects, connection.fromId),
|
|
1208
|
+
chunkQL7MNEMT_cjs.VISIBLE_ISOMETRIC_FACES.has(connection.toFace) ? void 0 : isometricStackPosition(isometricObjects, connection.toId)
|
|
1188
1209
|
].filter((position) => position !== void 0);
|
|
1189
1210
|
if (!behind.length) {
|
|
1190
1211
|
return { sourceIndex: connection.sourceIndex };
|
|
@@ -1226,7 +1247,7 @@ function createRenderInputLinks(canvasObjects) {
|
|
|
1226
1247
|
|
|
1227
1248
|
// src/renderInput/fromSfl/index.ts
|
|
1228
1249
|
function sflToRenderInput(sfl) {
|
|
1229
|
-
const state =
|
|
1250
|
+
const state = chunkQL7MNEMT_cjs.sflToCanvasState(sfl);
|
|
1230
1251
|
const canvasObjects = collectCanvasObjects(state);
|
|
1231
1252
|
return {
|
|
1232
1253
|
shapes: canvasObjects.shapes,
|
|
@@ -1245,13 +1266,13 @@ function sflToRenderInput(sfl) {
|
|
|
1245
1266
|
// src/renderScene/artifacts/component/placeholder.ts
|
|
1246
1267
|
var STROKE = "#94a3b8";
|
|
1247
1268
|
function buildPlaceholder(component, index) {
|
|
1248
|
-
const x =
|
|
1249
|
-
const y =
|
|
1250
|
-
const width = Math.max(0,
|
|
1251
|
-
const height = Math.max(0,
|
|
1252
|
-
const rotation =
|
|
1269
|
+
const x = chunkQL7MNEMT_cjs.finite(component.x, 0);
|
|
1270
|
+
const y = chunkQL7MNEMT_cjs.finite(component.y, 0);
|
|
1271
|
+
const width = Math.max(0, chunkQL7MNEMT_cjs.finite(component.width, 120));
|
|
1272
|
+
const height = Math.max(0, chunkQL7MNEMT_cjs.finite(component.height, 60));
|
|
1273
|
+
const rotation = chunkQL7MNEMT_cjs.finite(component.rotation, 0);
|
|
1253
1274
|
const order = 1e4 + index;
|
|
1254
|
-
const bounds =
|
|
1275
|
+
const bounds = chunkQL7MNEMT_cjs.rotatedBounds({ x, y, width, height }, rotation, 2);
|
|
1255
1276
|
return [
|
|
1256
1277
|
{
|
|
1257
1278
|
id: `widget-${component.id}`,
|
|
@@ -1276,7 +1297,7 @@ function buildPlaceholder(component, index) {
|
|
|
1276
1297
|
width,
|
|
1277
1298
|
height,
|
|
1278
1299
|
lines: [component.type],
|
|
1279
|
-
fontFamily:
|
|
1300
|
+
fontFamily: chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
1280
1301
|
fontSize: 12,
|
|
1281
1302
|
fontWeight: "normal",
|
|
1282
1303
|
color: STROKE,
|
|
@@ -1290,44 +1311,44 @@ function buildPlaceholder(component, index) {
|
|
|
1290
1311
|
|
|
1291
1312
|
// src/renderScene/artifacts/component/builtIn.ts
|
|
1292
1313
|
function buildRollingNumber(component, index) {
|
|
1293
|
-
const x =
|
|
1294
|
-
const y =
|
|
1295
|
-
const width = Math.max(0,
|
|
1296
|
-
const height = Math.max(0,
|
|
1297
|
-
const rotation =
|
|
1314
|
+
const x = chunkQL7MNEMT_cjs.finite(component.x, 0);
|
|
1315
|
+
const y = chunkQL7MNEMT_cjs.finite(component.y, 0);
|
|
1316
|
+
const width = Math.max(0, chunkQL7MNEMT_cjs.finite(component.width, 160));
|
|
1317
|
+
const height = Math.max(0, chunkQL7MNEMT_cjs.finite(component.height, 90));
|
|
1318
|
+
const rotation = chunkQL7MNEMT_cjs.finite(component.rotation, 0);
|
|
1298
1319
|
return [
|
|
1299
1320
|
{
|
|
1300
1321
|
id: `widget-${component.id}`,
|
|
1301
1322
|
type: "rolling-number",
|
|
1302
1323
|
order: 1e4 + index,
|
|
1303
|
-
bounds:
|
|
1324
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x, y, width, height }, rotation, 2),
|
|
1304
1325
|
x,
|
|
1305
1326
|
y,
|
|
1306
1327
|
width,
|
|
1307
1328
|
height,
|
|
1308
1329
|
rotation,
|
|
1309
|
-
value:
|
|
1330
|
+
value: chunkQL7MNEMT_cjs.formatRollingNumber(component.value, component.digits),
|
|
1310
1331
|
digits: component.digits,
|
|
1311
|
-
duration: Math.max(0,
|
|
1332
|
+
duration: Math.max(0, chunkQL7MNEMT_cjs.finite(component.duration, 420)),
|
|
1312
1333
|
label: component.label,
|
|
1313
|
-
componentStyle:
|
|
1334
|
+
componentStyle: chunkQL7MNEMT_cjs.resolveRollingNumberStyle(component.style)
|
|
1314
1335
|
}
|
|
1315
1336
|
];
|
|
1316
1337
|
}
|
|
1317
1338
|
function buildTickScale(component, index) {
|
|
1318
|
-
const x =
|
|
1319
|
-
const y =
|
|
1320
|
-
const width = Math.max(0,
|
|
1321
|
-
const height = Math.max(0,
|
|
1322
|
-
const rotation =
|
|
1323
|
-
const max =
|
|
1324
|
-
const progress = Math.min(1, Math.max(0,
|
|
1339
|
+
const x = chunkQL7MNEMT_cjs.finite(component.x, 0);
|
|
1340
|
+
const y = chunkQL7MNEMT_cjs.finite(component.y, 0);
|
|
1341
|
+
const width = Math.max(0, chunkQL7MNEMT_cjs.finite(component.width, 200));
|
|
1342
|
+
const height = Math.max(0, chunkQL7MNEMT_cjs.finite(component.height, 200));
|
|
1343
|
+
const rotation = chunkQL7MNEMT_cjs.finite(component.rotation, 0);
|
|
1344
|
+
const max = chunkQL7MNEMT_cjs.finite(component.max, 100) || 100;
|
|
1345
|
+
const progress = Math.min(1, Math.max(0, chunkQL7MNEMT_cjs.finite(Number(component.value), 0) / max));
|
|
1325
1346
|
const nodes = [
|
|
1326
1347
|
{
|
|
1327
1348
|
id: `widget-${component.id}`,
|
|
1328
1349
|
type: "shader-surface",
|
|
1329
1350
|
order: 1e4 + index,
|
|
1330
|
-
bounds:
|
|
1351
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x, y, width, height }, rotation, 2),
|
|
1331
1352
|
x,
|
|
1332
1353
|
y,
|
|
1333
1354
|
width,
|
|
@@ -1344,12 +1365,12 @@ function buildTickScale(component, index) {
|
|
|
1344
1365
|
}
|
|
1345
1366
|
function buildTickLabels(component, box) {
|
|
1346
1367
|
const labels = component.labels ?? {};
|
|
1347
|
-
const ticks2 = Math.max(1,
|
|
1348
|
-
const major = Math.max(1,
|
|
1349
|
-
const start =
|
|
1350
|
-
const sweep =
|
|
1351
|
-
const radius =
|
|
1352
|
-
const fontSize =
|
|
1368
|
+
const ticks2 = Math.max(1, chunkQL7MNEMT_cjs.finite(Number(component.parameters.ticks), 48));
|
|
1369
|
+
const major = Math.max(1, chunkQL7MNEMT_cjs.finite(Number(component.parameters.major), 5));
|
|
1370
|
+
const start = chunkQL7MNEMT_cjs.finite(Number(component.parameters.start), 225) * Math.PI / 180;
|
|
1371
|
+
const sweep = chunkQL7MNEMT_cjs.finite(Number(component.parameters.sweep), 270) * Math.PI / 180;
|
|
1372
|
+
const radius = chunkQL7MNEMT_cjs.finite(Number(component.parameters.radius), 0.9) + chunkQL7MNEMT_cjs.finite(labels.offset, 0.08);
|
|
1373
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(labels.size, 12);
|
|
1353
1374
|
const centerX = box.x + box.width / 2;
|
|
1354
1375
|
const centerY = box.y + box.height / 2;
|
|
1355
1376
|
const count = Math.floor(ticks2 / major);
|
|
@@ -1364,10 +1385,10 @@ function buildTickLabels(component, box) {
|
|
|
1364
1385
|
id: `widget-${component.id}-label-${step}`,
|
|
1365
1386
|
type: "text",
|
|
1366
1387
|
order: box.order + 0.1,
|
|
1367
|
-
bounds:
|
|
1388
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(labelBox, 0, 2),
|
|
1368
1389
|
...labelBox,
|
|
1369
1390
|
lines: [String(Math.round(box.max * fraction * 10) / 10)],
|
|
1370
|
-
fontFamily: labels.fontFamily ||
|
|
1391
|
+
fontFamily: labels.fontFamily || chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
1371
1392
|
fontSize,
|
|
1372
1393
|
fontWeight: labels.weight ?? "normal",
|
|
1373
1394
|
color: labels.color || "#8f95c4",
|
|
@@ -1379,20 +1400,20 @@ function buildTickLabels(component, box) {
|
|
|
1379
1400
|
return nodes;
|
|
1380
1401
|
}
|
|
1381
1402
|
function buildRuler(component, index) {
|
|
1382
|
-
const x =
|
|
1383
|
-
const y =
|
|
1384
|
-
const width = Math.max(0,
|
|
1385
|
-
const height = Math.max(0,
|
|
1386
|
-
const rotation =
|
|
1387
|
-
const min =
|
|
1388
|
-
const max =
|
|
1389
|
-
const progress = max === min ? 0 : Math.min(1, Math.max(0, (
|
|
1403
|
+
const x = chunkQL7MNEMT_cjs.finite(component.x, 0);
|
|
1404
|
+
const y = chunkQL7MNEMT_cjs.finite(component.y, 0);
|
|
1405
|
+
const width = Math.max(0, chunkQL7MNEMT_cjs.finite(component.width, 120));
|
|
1406
|
+
const height = Math.max(0, chunkQL7MNEMT_cjs.finite(component.height, 360));
|
|
1407
|
+
const rotation = chunkQL7MNEMT_cjs.finite(component.rotation, 0);
|
|
1408
|
+
const min = chunkQL7MNEMT_cjs.finite(component.min, 0);
|
|
1409
|
+
const max = chunkQL7MNEMT_cjs.finite(component.max, 100);
|
|
1410
|
+
const progress = max === min ? 0 : Math.min(1, Math.max(0, (chunkQL7MNEMT_cjs.finite(Number(component.value), min) - min) / (max - min)));
|
|
1390
1411
|
const nodes = [
|
|
1391
1412
|
{
|
|
1392
1413
|
id: `widget-${component.id}`,
|
|
1393
1414
|
type: "shader-surface",
|
|
1394
1415
|
order: 1e4 + index,
|
|
1395
|
-
bounds:
|
|
1416
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x, y, width, height }, rotation, 2),
|
|
1396
1417
|
x,
|
|
1397
1418
|
y,
|
|
1398
1419
|
width,
|
|
@@ -1410,14 +1431,14 @@ function buildRuler(component, index) {
|
|
|
1410
1431
|
function buildRulerLabels(component, box) {
|
|
1411
1432
|
const labels = component.labels ?? {};
|
|
1412
1433
|
const horizontal = component.parameters.axis === "horizontal";
|
|
1413
|
-
const ticks2 = Math.max(1,
|
|
1414
|
-
const major = Math.max(1,
|
|
1415
|
-
const inset =
|
|
1416
|
-
const line =
|
|
1434
|
+
const ticks2 = Math.max(1, chunkQL7MNEMT_cjs.finite(Number(component.parameters.ticks), 50));
|
|
1435
|
+
const major = Math.max(1, chunkQL7MNEMT_cjs.finite(Number(component.parameters.major), 5));
|
|
1436
|
+
const inset = chunkQL7MNEMT_cjs.finite(Number(component.parameters.inset), 0.05) > 0 ? chunkQL7MNEMT_cjs.finite(Number(component.parameters.inset), 0.05) : 0.05;
|
|
1437
|
+
const line = chunkQL7MNEMT_cjs.finite(Number(component.parameters.line), 0.7) > 0 ? chunkQL7MNEMT_cjs.finite(Number(component.parameters.line), 0.7) : 0.7;
|
|
1417
1438
|
const across = horizontal ? box.height : box.width;
|
|
1418
|
-
const tickLength = (
|
|
1419
|
-
const edge = line * across - 0.12 * across - tickLength -
|
|
1420
|
-
const fontSize =
|
|
1439
|
+
const tickLength = (chunkQL7MNEMT_cjs.finite(Number(component.parameters.length), 0.1) > 0 ? chunkQL7MNEMT_cjs.finite(Number(component.parameters.length), 0.1) : 0.1) * across * 1.9;
|
|
1440
|
+
const edge = line * across - 0.12 * across - tickLength - chunkQL7MNEMT_cjs.finite(labels.offset, 0.04) * across;
|
|
1441
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(labels.size, 12);
|
|
1421
1442
|
const count = Math.floor(ticks2 / major);
|
|
1422
1443
|
const nodes = [];
|
|
1423
1444
|
for (let step = 0; step <= count; step += 1) {
|
|
@@ -1428,10 +1449,10 @@ function buildRulerLabels(component, box) {
|
|
|
1428
1449
|
id: `widget-${component.id}-label-${step}`,
|
|
1429
1450
|
type: "text",
|
|
1430
1451
|
order: box.order + 0.1,
|
|
1431
|
-
bounds:
|
|
1452
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(labelBox, 0, 2),
|
|
1432
1453
|
...labelBox,
|
|
1433
1454
|
lines: [String(Math.round((box.min + (box.max - box.min) * fraction) * 10) / 10)],
|
|
1434
|
-
fontFamily: labels.fontFamily ||
|
|
1455
|
+
fontFamily: labels.fontFamily || chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
1435
1456
|
fontSize,
|
|
1436
1457
|
fontWeight: labels.weight ?? "normal",
|
|
1437
1458
|
color: labels.color || "#8f95c4",
|
|
@@ -1447,10 +1468,10 @@ function buildRulerLabels(component, box) {
|
|
|
1447
1468
|
var DISABLED_INK = "#94a3b8";
|
|
1448
1469
|
function controlBox(component, index, fallback) {
|
|
1449
1470
|
return {
|
|
1450
|
-
x:
|
|
1451
|
-
y:
|
|
1452
|
-
width: Math.max(1,
|
|
1453
|
-
height: Math.max(1,
|
|
1471
|
+
x: chunkQL7MNEMT_cjs.finite(component.x, 0),
|
|
1472
|
+
y: chunkQL7MNEMT_cjs.finite(component.y, 0),
|
|
1473
|
+
width: Math.max(1, chunkQL7MNEMT_cjs.finite(component.width, fallback.width)),
|
|
1474
|
+
height: Math.max(1, chunkQL7MNEMT_cjs.finite(component.height, fallback.height)),
|
|
1454
1475
|
order: 1e4 + index
|
|
1455
1476
|
};
|
|
1456
1477
|
}
|
|
@@ -1468,7 +1489,7 @@ function hitArea(component, box) {
|
|
|
1468
1489
|
id: `widget-${component.id}`,
|
|
1469
1490
|
type: "rect",
|
|
1470
1491
|
order: box.order,
|
|
1471
|
-
bounds:
|
|
1492
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(box, 0, 0),
|
|
1472
1493
|
x: box.x,
|
|
1473
1494
|
y: box.y,
|
|
1474
1495
|
width: box.width,
|
|
@@ -1481,13 +1502,13 @@ function labelText(component, part, area, label, order) {
|
|
|
1481
1502
|
id: `widget-${component.id}-${part}`,
|
|
1482
1503
|
type: "text",
|
|
1483
1504
|
order,
|
|
1484
|
-
bounds:
|
|
1505
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(area, 0, 0),
|
|
1485
1506
|
x: area.x,
|
|
1486
1507
|
y: area.y,
|
|
1487
1508
|
width: area.width,
|
|
1488
1509
|
height: area.height,
|
|
1489
1510
|
lines: [label.text],
|
|
1490
|
-
fontFamily:
|
|
1511
|
+
fontFamily: chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
1491
1512
|
fontSize: label.fontSize,
|
|
1492
1513
|
fontWeight: "600",
|
|
1493
1514
|
color: label.color,
|
|
@@ -1506,7 +1527,7 @@ function buildButton(component, index) {
|
|
|
1506
1527
|
id: `widget-${component.id}-face`,
|
|
1507
1528
|
type: "rect",
|
|
1508
1529
|
order: box.order + 0.1,
|
|
1509
|
-
bounds:
|
|
1530
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(box, 0, 0),
|
|
1510
1531
|
x: box.x,
|
|
1511
1532
|
y: box.y,
|
|
1512
1533
|
width: box.width,
|
|
@@ -1545,7 +1566,7 @@ function boxNode(component, box, square) {
|
|
|
1545
1566
|
id: `widget-${component.id}-box`,
|
|
1546
1567
|
type: "rect",
|
|
1547
1568
|
order: box.order + 0.1,
|
|
1548
|
-
bounds:
|
|
1569
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(square, 0, 2),
|
|
1549
1570
|
...square,
|
|
1550
1571
|
rx: square.width * CORNER_RATIO,
|
|
1551
1572
|
style: fade(component, {
|
|
@@ -1560,7 +1581,7 @@ function checkNode(component, box, square) {
|
|
|
1560
1581
|
id: `widget-${component.id}-check`,
|
|
1561
1582
|
type: "path",
|
|
1562
1583
|
order: box.order + 0.2,
|
|
1563
|
-
bounds:
|
|
1584
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(square, 0, 0),
|
|
1564
1585
|
d: checkPath(square),
|
|
1565
1586
|
style: fade(component, {
|
|
1566
1587
|
fill: { kind: "none" },
|
|
@@ -1624,7 +1645,7 @@ function buildKnob(component, index) {
|
|
|
1624
1645
|
id: `widget-${component.id}-${part}`,
|
|
1625
1646
|
type: "ellipse",
|
|
1626
1647
|
order: box.order + order,
|
|
1627
|
-
bounds:
|
|
1648
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x: cx - radius, y: cy - radius, width: radius * 2, height: radius * 2 }, 0, thickness),
|
|
1628
1649
|
cx,
|
|
1629
1650
|
cy,
|
|
1630
1651
|
rx: radius,
|
|
@@ -1651,7 +1672,7 @@ function buildKnob(component, index) {
|
|
|
1651
1672
|
id: `widget-${component.id}-face`,
|
|
1652
1673
|
type: "ellipse",
|
|
1653
1674
|
order: box.order + 0.3,
|
|
1654
|
-
bounds:
|
|
1675
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(
|
|
1655
1676
|
{ x: cx - faceRadius, y: cy - faceRadius, width: faceRadius * 2, height: faceRadius * 2 },
|
|
1656
1677
|
0,
|
|
1657
1678
|
0
|
|
@@ -1666,7 +1687,7 @@ function buildKnob(component, index) {
|
|
|
1666
1687
|
id: `widget-${component.id}-dot`,
|
|
1667
1688
|
type: "ellipse",
|
|
1668
1689
|
order: box.order + 0.4,
|
|
1669
|
-
bounds:
|
|
1690
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(
|
|
1670
1691
|
{
|
|
1671
1692
|
x: cx + radius * Math.cos(angle) - dotRadius,
|
|
1672
1693
|
y: cy - radius * Math.sin(angle) - dotRadius,
|
|
@@ -1729,7 +1750,7 @@ function buildProgress(component, index) {
|
|
|
1729
1750
|
id: `widget-${component.id}-${part}`,
|
|
1730
1751
|
type: "ellipse",
|
|
1731
1752
|
order: box.order + order,
|
|
1732
|
-
bounds:
|
|
1753
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x: cx - radius, y: cy - radius, width: radius * 2, height: radius * 2 }, 0, thickness),
|
|
1733
1754
|
cx,
|
|
1734
1755
|
cy,
|
|
1735
1756
|
rx: radius,
|
|
@@ -1754,7 +1775,7 @@ function buildProgress(component, index) {
|
|
|
1754
1775
|
id: `widget-${component.id}-${part}`,
|
|
1755
1776
|
type: "rect",
|
|
1756
1777
|
order: box.order + order,
|
|
1757
|
-
bounds:
|
|
1778
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(shape, 0, 0),
|
|
1758
1779
|
...shape,
|
|
1759
1780
|
rx: radius,
|
|
1760
1781
|
style: fade(component, {
|
|
@@ -1797,7 +1818,7 @@ function buildSegmented(component, index) {
|
|
|
1797
1818
|
id: `widget-${component.id}-track`,
|
|
1798
1819
|
type: "rect",
|
|
1799
1820
|
order: box.order + 0.1,
|
|
1800
|
-
bounds:
|
|
1821
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(box, 0, 0),
|
|
1801
1822
|
x: box.x,
|
|
1802
1823
|
y: box.y,
|
|
1803
1824
|
width: box.width,
|
|
@@ -1809,7 +1830,7 @@ function buildSegmented(component, index) {
|
|
|
1809
1830
|
id: `widget-${component.id}-active`,
|
|
1810
1831
|
type: "rect",
|
|
1811
1832
|
order: box.order + 0.2,
|
|
1812
|
-
bounds:
|
|
1833
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x: box.x + inset + active * cellWidth, width: cellWidth, ...cell }, 0, 0),
|
|
1813
1834
|
x: box.x + inset + active * cellWidth,
|
|
1814
1835
|
y: cell.y,
|
|
1815
1836
|
width: cellWidth,
|
|
@@ -1861,7 +1882,7 @@ var rect = (component, box, part, order, shape, color, extra = {}) => ({
|
|
|
1861
1882
|
id: `widget-${component.id}-${part}`,
|
|
1862
1883
|
type: "rect",
|
|
1863
1884
|
order: box.order + order,
|
|
1864
|
-
bounds:
|
|
1885
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(shape, 0, 0),
|
|
1865
1886
|
...shape,
|
|
1866
1887
|
style: fade(component, { fill: solid(color), stroke: { kind: "none" }, ...extra })
|
|
1867
1888
|
});
|
|
@@ -1914,7 +1935,7 @@ function buildLine(component, box, thumbs, vertical) {
|
|
|
1914
1935
|
id: `widget-${component.id}-${part}`,
|
|
1915
1936
|
type: "ellipse",
|
|
1916
1937
|
order: box.order + order,
|
|
1917
|
-
bounds:
|
|
1938
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x: cx - radius, y: cy - radius, width: radius * 2, height: radius * 2 }, 0, 0),
|
|
1918
1939
|
cx,
|
|
1919
1940
|
cy,
|
|
1920
1941
|
rx: radius,
|
|
@@ -2066,7 +2087,7 @@ function buildSwitch(component, index) {
|
|
|
2066
2087
|
id: `widget-${component.id}-track`,
|
|
2067
2088
|
type: "rect",
|
|
2068
2089
|
order: box.order + 0.1,
|
|
2069
|
-
bounds:
|
|
2090
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(box, 0, 0),
|
|
2070
2091
|
x: box.x,
|
|
2071
2092
|
y: box.y,
|
|
2072
2093
|
width: box.width,
|
|
@@ -2081,7 +2102,7 @@ function buildSwitch(component, index) {
|
|
|
2081
2102
|
id: `widget-${component.id}-thumb`,
|
|
2082
2103
|
type: "ellipse",
|
|
2083
2104
|
order: box.order + 0.2,
|
|
2084
|
-
bounds:
|
|
2105
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(thumb, 0, 0),
|
|
2085
2106
|
cx: centerX,
|
|
2086
2107
|
cy: box.y + box.height / 2,
|
|
2087
2108
|
rx: radius,
|
|
@@ -2105,7 +2126,7 @@ function buildToggleButton(component, index) {
|
|
|
2105
2126
|
id: `widget-${component.id}-face`,
|
|
2106
2127
|
type: "rect",
|
|
2107
2128
|
order: box.order + 0.1,
|
|
2108
|
-
bounds:
|
|
2129
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(box, 0, 2),
|
|
2109
2130
|
x: box.x,
|
|
2110
2131
|
y: box.y,
|
|
2111
2132
|
width: box.width,
|
|
@@ -2160,8 +2181,8 @@ function getComponentBuilder(type) {
|
|
|
2160
2181
|
|
|
2161
2182
|
// src/renderScene/artifacts/component/build.ts
|
|
2162
2183
|
function ariaOf(component) {
|
|
2163
|
-
const role =
|
|
2164
|
-
if (!role || !
|
|
2184
|
+
const role = chunkQL7MNEMT_cjs.getComponentDescriptor(component.type)?.role;
|
|
2185
|
+
if (!role || !chunkQL7MNEMT_cjs.isGenericComponent(component)) {
|
|
2165
2186
|
return void 0;
|
|
2166
2187
|
}
|
|
2167
2188
|
const flag = typeof component.value === "boolean" ? component.value : void 0;
|
|
@@ -2172,12 +2193,12 @@ function ariaOf(component) {
|
|
|
2172
2193
|
};
|
|
2173
2194
|
}
|
|
2174
2195
|
function labelOf(component) {
|
|
2175
|
-
return component.label ?? (
|
|
2196
|
+
return component.label ?? (chunkQL7MNEMT_cjs.isGenericComponent(component) ? component.id : String(component.value));
|
|
2176
2197
|
}
|
|
2177
2198
|
function buildComponents(components) {
|
|
2178
2199
|
return components.flatMap((component, index) => {
|
|
2179
2200
|
const build = getComponentBuilder(component.type) ?? buildPlaceholder;
|
|
2180
|
-
const nodes =
|
|
2201
|
+
const nodes = chunkQL7MNEMT_cjs.tag(
|
|
2181
2202
|
build(component, index),
|
|
2182
2203
|
"widget",
|
|
2183
2204
|
component.id,
|
|
@@ -2217,13 +2238,13 @@ function tabBox(input, thickness, length) {
|
|
|
2217
2238
|
y,
|
|
2218
2239
|
width: length,
|
|
2219
2240
|
height: thickness,
|
|
2220
|
-
path:
|
|
2241
|
+
path: chunkQL7MNEMT_cjs.bottomRoundedRectPath(x, y, length, thickness, TAB_RADIUS)
|
|
2221
2242
|
};
|
|
2222
2243
|
}
|
|
2223
2244
|
case "left": {
|
|
2224
2245
|
const x = input.x - thickness;
|
|
2225
2246
|
const y = input.y - inset;
|
|
2226
|
-
return { x, y, width: thickness, height: length, path:
|
|
2247
|
+
return { x, y, width: thickness, height: length, path: chunkQL7MNEMT_cjs.leftRoundedRectPath(x, y, thickness, length, TAB_RADIUS) };
|
|
2227
2248
|
}
|
|
2228
2249
|
case "right": {
|
|
2229
2250
|
const x = input.x + input.width;
|
|
@@ -2233,13 +2254,13 @@ function tabBox(input, thickness, length) {
|
|
|
2233
2254
|
y,
|
|
2234
2255
|
width: thickness,
|
|
2235
2256
|
height: length,
|
|
2236
|
-
path:
|
|
2257
|
+
path: chunkQL7MNEMT_cjs.rightRoundedRectPath(x, y, thickness, length, TAB_RADIUS)
|
|
2237
2258
|
};
|
|
2238
2259
|
}
|
|
2239
2260
|
default: {
|
|
2240
2261
|
const x = input.x - inset;
|
|
2241
2262
|
const y = input.y - thickness;
|
|
2242
|
-
return { x, y, width: length, height: thickness, path:
|
|
2263
|
+
return { x, y, width: length, height: thickness, path: chunkQL7MNEMT_cjs.topRoundedRectPath(x, y, length, thickness, TAB_RADIUS) };
|
|
2243
2264
|
}
|
|
2244
2265
|
}
|
|
2245
2266
|
}
|
|
@@ -2248,7 +2269,7 @@ function renderTitleTab(input) {
|
|
|
2248
2269
|
const padding = 16;
|
|
2249
2270
|
const length = Math.max(120, input.title.length * input.fontSize * 0.62 + padding * 2);
|
|
2250
2271
|
const box = tabBox(input, thickness, length);
|
|
2251
|
-
const bounds =
|
|
2272
|
+
const bounds = chunkQL7MNEMT_cjs.boxBounds(box, 6);
|
|
2252
2273
|
const vertical = input.labelPosition === "left" || input.labelPosition === "right";
|
|
2253
2274
|
return [
|
|
2254
2275
|
{
|
|
@@ -2276,7 +2297,7 @@ function horizontalTitleText(input, box, padding, bounds) {
|
|
|
2276
2297
|
width: Math.max(0, box.width - padding * 2),
|
|
2277
2298
|
height: box.height,
|
|
2278
2299
|
lines: [input.title],
|
|
2279
|
-
fontFamily: input.fontFamily ??
|
|
2300
|
+
fontFamily: input.fontFamily ?? chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
2280
2301
|
fontSize: input.fontSize,
|
|
2281
2302
|
fontWeight: input.fontWeight,
|
|
2282
2303
|
color: input.textColor,
|
|
@@ -2300,7 +2321,7 @@ function verticalTitleText(input, box, padding, bounds) {
|
|
|
2300
2321
|
width: textLength,
|
|
2301
2322
|
height: textThickness,
|
|
2302
2323
|
lines: [input.title],
|
|
2303
|
-
fontFamily: input.fontFamily ??
|
|
2324
|
+
fontFamily: input.fontFamily ?? chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
2304
2325
|
fontSize: input.fontSize,
|
|
2305
2326
|
fontWeight: input.fontWeight,
|
|
2306
2327
|
color: input.textColor,
|
|
@@ -2321,7 +2342,7 @@ var SQUARED_CORNER_BY_LABEL_POSITION = {
|
|
|
2321
2342
|
};
|
|
2322
2343
|
function frameBoundaryNode(frame, order, hasTab) {
|
|
2323
2344
|
const shadow = frame.shadow ?? true;
|
|
2324
|
-
const bounds =
|
|
2345
|
+
const bounds = chunkQL7MNEMT_cjs.boxBounds(
|
|
2325
2346
|
{ x: frame.x, y: frame.y, width: frame.width, height: frame.height },
|
|
2326
2347
|
frame.strokeWidth + (shadow ? 20 : 4)
|
|
2327
2348
|
);
|
|
@@ -2356,7 +2377,7 @@ function frameBoundaryNode(frame, order, hasTab) {
|
|
|
2356
2377
|
id: `frame-${frame.id}`,
|
|
2357
2378
|
order,
|
|
2358
2379
|
bounds,
|
|
2359
|
-
d:
|
|
2380
|
+
d: chunkQL7MNEMT_cjs.cornersRoundedRectPath(frame.x, frame.y, frame.width, frame.height, radii),
|
|
2360
2381
|
detail: { of: "frameBoundary", cornerRadius: frame.cornerRadius, squareCorner: squared },
|
|
2361
2382
|
style
|
|
2362
2383
|
};
|
|
@@ -2445,7 +2466,7 @@ function labelBase(context, lane, index) {
|
|
|
2445
2466
|
id: `swimlane-label-${context.swimlane.id}-${lane.id}`,
|
|
2446
2467
|
order: context.order + 0.5 + index / 100,
|
|
2447
2468
|
lines: [lane.label],
|
|
2448
|
-
fontFamily: context.swimlane.fontFamily ??
|
|
2469
|
+
fontFamily: context.swimlane.fontFamily ?? chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
2449
2470
|
fontSize: context.swimlane.fontSize,
|
|
2450
2471
|
fontWeight: context.swimlane.fontWeight,
|
|
2451
2472
|
color: context.swimlane.textColor,
|
|
@@ -2461,7 +2482,7 @@ function horizontalLabel(context, lane, index) {
|
|
|
2461
2482
|
const y = centerY - thickness / 2;
|
|
2462
2483
|
return {
|
|
2463
2484
|
...labelBase(context, lane, index),
|
|
2464
|
-
bounds:
|
|
2485
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x, y, width, height: thickness }, -90, 12),
|
|
2465
2486
|
x,
|
|
2466
2487
|
y,
|
|
2467
2488
|
width,
|
|
@@ -2513,7 +2534,7 @@ function createSwimlaneRenderContext(swimlane, index) {
|
|
|
2513
2534
|
return {
|
|
2514
2535
|
swimlane,
|
|
2515
2536
|
order: 5e3 + index,
|
|
2516
|
-
bounds:
|
|
2537
|
+
bounds: chunkQL7MNEMT_cjs.boxBounds(
|
|
2517
2538
|
{ x: swimlane.x, y: swimlane.y, width: swimlane.width, height: swimlane.height },
|
|
2518
2539
|
swimlane.strokeWidth + 4
|
|
2519
2540
|
),
|
|
@@ -2552,9 +2573,9 @@ function buildSwimlane(swimlane, index) {
|
|
|
2552
2573
|
function buildContainers(input) {
|
|
2553
2574
|
return [
|
|
2554
2575
|
...input.frames.flatMap(
|
|
2555
|
-
(frame, index) =>
|
|
2576
|
+
(frame, index) => chunkQL7MNEMT_cjs.tag(buildFrame(frame, index), "frame", frame.id, void 0, frame.title ?? void 0)
|
|
2556
2577
|
),
|
|
2557
|
-
...input.swimlanes.flatMap((swimlane, index) =>
|
|
2578
|
+
...input.swimlanes.flatMap((swimlane, index) => chunkQL7MNEMT_cjs.tag(buildSwimlane(swimlane, index), "swimlane", swimlane.id))
|
|
2558
2579
|
];
|
|
2559
2580
|
}
|
|
2560
2581
|
|
|
@@ -2604,7 +2625,7 @@ var DEFAULT_COLOR = "#475569";
|
|
|
2604
2625
|
var CHAR_WIDTH = 0.6;
|
|
2605
2626
|
var pathData = (segments) => segments.map(([from, to]) => `M ${from.x} ${from.y} L ${to.x} ${to.y}`).join(" ");
|
|
2606
2627
|
function pathNode(dimension, name, order, segments) {
|
|
2607
|
-
const strokeWidth = Math.max(0,
|
|
2628
|
+
const strokeWidth = Math.max(0, chunkQL7MNEMT_cjs.finite(dimension.strokeWidth, 1));
|
|
2608
2629
|
const points = segments.flat();
|
|
2609
2630
|
return {
|
|
2610
2631
|
type: "path",
|
|
@@ -2626,7 +2647,7 @@ function pathNode(dimension, name, order, segments) {
|
|
|
2626
2647
|
};
|
|
2627
2648
|
}
|
|
2628
2649
|
function labelNode2(dimension, order, text, center, angle) {
|
|
2629
|
-
const fontSize =
|
|
2650
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(dimension.fontSize, 11);
|
|
2630
2651
|
const width = Math.max(24, text.length * fontSize * CHAR_WIDTH + 8);
|
|
2631
2652
|
const height = fontSize * 1.3;
|
|
2632
2653
|
return {
|
|
@@ -2644,7 +2665,7 @@ function labelNode2(dimension, order, text, center, angle) {
|
|
|
2644
2665
|
width,
|
|
2645
2666
|
height,
|
|
2646
2667
|
lines: [text],
|
|
2647
|
-
fontFamily:
|
|
2668
|
+
fontFamily: chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
2648
2669
|
fontSize,
|
|
2649
2670
|
fontWeight: "normal",
|
|
2650
2671
|
color: dimension.textColor ?? dimension.strokeColor ?? DEFAULT_COLOR,
|
|
@@ -2669,7 +2690,7 @@ function buildDimension(dimension, index) {
|
|
|
2669
2690
|
}
|
|
2670
2691
|
function buildDimensions(dimensions) {
|
|
2671
2692
|
return dimensions.flatMap(
|
|
2672
|
-
(dimension, index) =>
|
|
2693
|
+
(dimension, index) => chunkQL7MNEMT_cjs.tag(
|
|
2673
2694
|
buildDimension(dimension, index),
|
|
2674
2695
|
"dimension",
|
|
2675
2696
|
dimension.id,
|
|
@@ -2683,9 +2704,9 @@ function buildDimensions(dimensions) {
|
|
|
2683
2704
|
// src/renderScene/artifacts/isometric/context.ts
|
|
2684
2705
|
var FILL_PROP = { prop: "style.fill", propKind: "color", propSolidOnly: true };
|
|
2685
2706
|
function isometricContext(object, index) {
|
|
2686
|
-
const strokeWidth = Math.max(0,
|
|
2687
|
-
const rotation =
|
|
2688
|
-
const box =
|
|
2707
|
+
const strokeWidth = Math.max(0, chunkQL7MNEMT_cjs.finite(object.strokeWidth, 1));
|
|
2708
|
+
const rotation = chunkQL7MNEMT_cjs.finite(object.rotation, 0);
|
|
2709
|
+
const box = chunkQL7MNEMT_cjs.isometricBounds(object);
|
|
2689
2710
|
const rotationCenter = { x: box.x + box.width / 2, y: box.y + box.height / 2 };
|
|
2690
2711
|
return {
|
|
2691
2712
|
object,
|
|
@@ -2697,7 +2718,7 @@ function isometricContext(object, index) {
|
|
|
2697
2718
|
strokeWidth,
|
|
2698
2719
|
common: {
|
|
2699
2720
|
type: "path",
|
|
2700
|
-
bounds:
|
|
2721
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(box, rotation, strokeWidth + 2),
|
|
2701
2722
|
rotation,
|
|
2702
2723
|
rotationCenter,
|
|
2703
2724
|
style: {
|
|
@@ -2713,13 +2734,13 @@ function faceNode(context, name, offset, points, style) {
|
|
|
2713
2734
|
...context.common,
|
|
2714
2735
|
id: `isometric-${context.object.id}-${name}`,
|
|
2715
2736
|
order: context.order + offset,
|
|
2716
|
-
d:
|
|
2737
|
+
d: chunkQL7MNEMT_cjs.roundedPolygonPath([...points], 0),
|
|
2717
2738
|
style,
|
|
2718
2739
|
...FILL_PROP
|
|
2719
2740
|
};
|
|
2720
2741
|
}
|
|
2721
2742
|
function silhouette(object) {
|
|
2722
|
-
const faces =
|
|
2743
|
+
const faces = chunkQL7MNEMT_cjs.isometricFaces(object);
|
|
2723
2744
|
return [faces.top[0], faces.top[1], faces.right[2], faces.front[2], faces.front[3], faces.top[3]];
|
|
2724
2745
|
}
|
|
2725
2746
|
function hullNode(context, hullPath, cornerRadius) {
|
|
@@ -2736,15 +2757,15 @@ function hullNode(context, hullPath, cornerRadius) {
|
|
|
2736
2757
|
depth: Math.max(0, object.depth),
|
|
2737
2758
|
cornerRadius,
|
|
2738
2759
|
bounds: box,
|
|
2739
|
-
labelOffsetX:
|
|
2740
|
-
labelOffsetY:
|
|
2760
|
+
labelOffsetX: chunkQL7MNEMT_cjs.finite(object.labelOffsetX, 0),
|
|
2761
|
+
labelOffsetY: chunkQL7MNEMT_cjs.finite(object.labelOffsetY, 0)
|
|
2741
2762
|
},
|
|
2742
2763
|
style: { ...common.style, fill: { kind: "none" } }
|
|
2743
2764
|
};
|
|
2744
2765
|
}
|
|
2745
2766
|
function unseenHullNode(context) {
|
|
2746
2767
|
return {
|
|
2747
|
-
...hullNode(context,
|
|
2768
|
+
...hullNode(context, chunkQL7MNEMT_cjs.roundedPolygonPath(silhouette(context.object), 0), 0),
|
|
2748
2769
|
style: { ...context.common.style, fill: { kind: "none" }, stroke: { kind: "none" } }
|
|
2749
2770
|
};
|
|
2750
2771
|
}
|
|
@@ -2757,9 +2778,9 @@ var LABEL_PADDING_Y = 3;
|
|
|
2757
2778
|
var LABEL_CHAR_WIDTH = 6.5;
|
|
2758
2779
|
function labelPlacement(context) {
|
|
2759
2780
|
const { object } = context;
|
|
2760
|
-
const anchor =
|
|
2761
|
-
const bottomY = anchor.y - LABEL_GAP +
|
|
2762
|
-
return { anchor, centerX: anchor.x +
|
|
2781
|
+
const anchor = chunkQL7MNEMT_cjs.isometricTopFaceCenter(object);
|
|
2782
|
+
const bottomY = anchor.y - LABEL_GAP + chunkQL7MNEMT_cjs.finite(object.labelOffsetY, 0);
|
|
2783
|
+
return { anchor, centerX: anchor.x + chunkQL7MNEMT_cjs.finite(object.labelOffsetX, 0), topY: bottomY - LABEL_HEIGHT, bottomY };
|
|
2763
2784
|
}
|
|
2764
2785
|
function labelTextNode(context, placement, text) {
|
|
2765
2786
|
const { object, order, rotation, rotationCenter, box } = context;
|
|
@@ -2774,7 +2795,7 @@ function labelTextNode(context, placement, text) {
|
|
|
2774
2795
|
width: box.width,
|
|
2775
2796
|
height: LABEL_HEIGHT,
|
|
2776
2797
|
lines: [text],
|
|
2777
|
-
fontFamily:
|
|
2798
|
+
fontFamily: chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
2778
2799
|
fontSize: 12,
|
|
2779
2800
|
fontWeight: "normal",
|
|
2780
2801
|
color: "#111827",
|
|
@@ -2854,7 +2875,7 @@ function groundShadowNode(context, topOutline) {
|
|
|
2854
2875
|
}
|
|
2855
2876
|
const height = Math.max(0, object.height);
|
|
2856
2877
|
const heightFactor = 0.6 + Math.min(1, height / 150) * 0.7;
|
|
2857
|
-
const shadowDrop = height +
|
|
2878
|
+
const shadowDrop = height + chunkQL7MNEMT_cjs.finite(object.shadowStyle?.distance, 0);
|
|
2858
2879
|
const contactFootprint = topOutline.map((point) => ({ x: point.x, y: point.y + shadowDrop }));
|
|
2859
2880
|
const footprintCenter = {
|
|
2860
2881
|
x: contactFootprint.reduce((sum, point) => sum + point.x, 0) / contactFootprint.length,
|
|
@@ -2877,14 +2898,14 @@ function groundShadowNode(context, topOutline) {
|
|
|
2877
2898
|
maxX: Math.max(...footprintXs),
|
|
2878
2899
|
maxY: Math.max(...footprintYs)
|
|
2879
2900
|
},
|
|
2880
|
-
d:
|
|
2901
|
+
d: chunkQL7MNEMT_cjs.roundedPolygonPath(footprint, 0),
|
|
2881
2902
|
rotation,
|
|
2882
2903
|
rotationCenter,
|
|
2883
2904
|
style: {
|
|
2884
2905
|
fill: { kind: "solid", color: object.shadowStyle?.color ?? "#000000" },
|
|
2885
2906
|
stroke: { kind: "none" },
|
|
2886
2907
|
opacity: Math.min(1, (object.shadowStyle?.opacity ?? 0.18) * heightFactor),
|
|
2887
|
-
blur:
|
|
2908
|
+
blur: chunkQL7MNEMT_cjs.finite(object.shadowStyle?.blur, 8),
|
|
2888
2909
|
pointerEvents: "none"
|
|
2889
2910
|
}
|
|
2890
2911
|
};
|
|
@@ -2898,7 +2919,7 @@ function sphereShadowNode(context, radius) {
|
|
|
2898
2919
|
const depth = Math.max(0, object.depth);
|
|
2899
2920
|
const center = {
|
|
2900
2921
|
x: box.x + box.width / 2,
|
|
2901
|
-
y: object.y + Math.max(0, object.height) + (width + depth) *
|
|
2922
|
+
y: object.y + Math.max(0, object.height) + (width + depth) * chunkQL7MNEMT_cjs.AXIS_SIN / 2
|
|
2902
2923
|
};
|
|
2903
2924
|
return {
|
|
2904
2925
|
type: "ellipse",
|
|
@@ -2918,7 +2939,7 @@ function sphereShadowNode(context, radius) {
|
|
|
2918
2939
|
fill: { kind: "solid", color: object.shadowStyle?.color ?? "#000000" },
|
|
2919
2940
|
stroke: { kind: "none" },
|
|
2920
2941
|
opacity: object.shadowStyle?.opacity ?? 0.2,
|
|
2921
|
-
blur:
|
|
2942
|
+
blur: chunkQL7MNEMT_cjs.finite(object.shadowStyle?.blur, 8),
|
|
2922
2943
|
pointerEvents: "none"
|
|
2923
2944
|
}
|
|
2924
2945
|
};
|
|
@@ -2928,7 +2949,7 @@ function sphereShadowNode(context, radius) {
|
|
|
2928
2949
|
function faceNodes(context, faces, hullClip) {
|
|
2929
2950
|
const { object, common } = context;
|
|
2930
2951
|
const noStroke = { ...common.style, stroke: { kind: "none" } };
|
|
2931
|
-
const fills =
|
|
2952
|
+
const fills = chunkQL7MNEMT_cjs.deriveFaceFills(object.fill ?? "#f8fafc");
|
|
2932
2953
|
const face = (name, offset, points, color) => faceNode(context, name, offset, points, { ...noStroke, fill: { kind: "solid", color }, clip: hullClip });
|
|
2933
2954
|
return [
|
|
2934
2955
|
face("top", 0, faces.top, fills.topFill),
|
|
@@ -2954,21 +2975,21 @@ function seamsNode(context, faces, hullClip) {
|
|
|
2954
2975
|
}
|
|
2955
2976
|
function buildBox(object, index) {
|
|
2956
2977
|
const context = isometricContext(object, index);
|
|
2957
|
-
const faces =
|
|
2958
|
-
const cornerRadius = Math.max(0,
|
|
2959
|
-
const hullPath =
|
|
2978
|
+
const faces = chunkQL7MNEMT_cjs.isometricFaces(object);
|
|
2979
|
+
const cornerRadius = Math.max(0, chunkQL7MNEMT_cjs.finite(object.cornerRadius, 8));
|
|
2980
|
+
const hullPath = chunkQL7MNEMT_cjs.roundedPolygonPath(silhouette(object), cornerRadius);
|
|
2960
2981
|
const hullClip = { type: "path", d: hullPath };
|
|
2961
2982
|
const groundShadow = groundShadowNode(context, faces.top);
|
|
2962
|
-
const seams = seamsNode(context, faces, hullClip);
|
|
2983
|
+
const seams = object.seams === false ? void 0 : seamsNode(context, faces, hullClip);
|
|
2963
2984
|
const hull = hullNode(context, hullPath, cornerRadius);
|
|
2964
2985
|
const facesNodes = faceNodes(context, faces, hullClip);
|
|
2965
|
-
const objectNodes = groundShadow ? [hull, ...facesNodes, groundShadow, seams] : [hull, ...facesNodes, seams];
|
|
2986
|
+
const objectNodes = groundShadow ? [hull, ...facesNodes, groundShadow, ...seams ? [seams] : []] : [hull, ...facesNodes, ...seams ? [seams] : []];
|
|
2966
2987
|
return object.text ? [...objectNodes, ...labelNodes(context, object.text)] : objectNodes;
|
|
2967
2988
|
}
|
|
2968
2989
|
|
|
2969
2990
|
// src/renderScene/artifacts/isometric/extruded.ts
|
|
2970
2991
|
function wallNode(context, side, index, fill2) {
|
|
2971
|
-
const color =
|
|
2992
|
+
const color = chunkQL7MNEMT_cjs.shadeFill(fill2, side.light);
|
|
2972
2993
|
return faceNode(context, `side-${index}`, 0.05 + index * 1e-3, side.points, {
|
|
2973
2994
|
...context.common.style,
|
|
2974
2995
|
stroke: { kind: "solid", color },
|
|
@@ -2993,7 +3014,7 @@ function wallEdgesNode(context, side, index) {
|
|
|
2993
3014
|
}
|
|
2994
3015
|
function buildExtruded(object, index, footprint) {
|
|
2995
3016
|
const context = isometricContext(object, index);
|
|
2996
|
-
const { top, sides } =
|
|
3017
|
+
const { top, sides } = chunkQL7MNEMT_cjs.extrudeFootprint(object, footprint, Math.max(0, chunkQL7MNEMT_cjs.finite(object.cornerRadius, 0)));
|
|
2997
3018
|
const fill2 = object.fill ?? "#f8fafc";
|
|
2998
3019
|
const groundShadow = groundShadowNode(context, top);
|
|
2999
3020
|
const topFace = faceNode(context, "top", 0.2, top, { ...context.common.style, fill: { kind: "solid", color: fill2 } });
|
|
@@ -3030,9 +3051,9 @@ function buildSphere(object, index) {
|
|
|
3030
3051
|
kind: "linear-gradient",
|
|
3031
3052
|
angle: 135,
|
|
3032
3053
|
stops: [
|
|
3033
|
-
{ offset: 0, color:
|
|
3054
|
+
{ offset: 0, color: chunkQL7MNEMT_cjs.shadeFill(fill2, 1.22) },
|
|
3034
3055
|
{ offset: 0.5, color: fill2 },
|
|
3035
|
-
{ offset: 1, color:
|
|
3056
|
+
{ offset: 1, color: chunkQL7MNEMT_cjs.shadeFill(fill2, 0.82) }
|
|
3036
3057
|
]
|
|
3037
3058
|
}
|
|
3038
3059
|
},
|
|
@@ -3068,12 +3089,12 @@ function buildIsometricObject(object, index) {
|
|
|
3068
3089
|
if (object.form === "sphere") {
|
|
3069
3090
|
return buildSphere(object, index);
|
|
3070
3091
|
}
|
|
3071
|
-
const footprint =
|
|
3092
|
+
const footprint = chunkQL7MNEMT_cjs.cleanFootprint(object.footprint);
|
|
3072
3093
|
return footprint.length > 0 ? buildExtruded(object, index, footprint) : buildBox(object, index);
|
|
3073
3094
|
}
|
|
3074
3095
|
function buildIsometricObjects(objects) {
|
|
3075
3096
|
return objects.flatMap(
|
|
3076
|
-
(object, index) =>
|
|
3097
|
+
(object, index) => chunkQL7MNEMT_cjs.tag(
|
|
3077
3098
|
buildIsometricObject(object, index),
|
|
3078
3099
|
"isometric",
|
|
3079
3100
|
object.id,
|
|
@@ -3102,7 +3123,7 @@ function renderEndpointLabel(context, end, labelIndex) {
|
|
|
3102
3123
|
if (!label) {
|
|
3103
3124
|
return [];
|
|
3104
3125
|
}
|
|
3105
|
-
const fontSize =
|
|
3126
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(context.link.style?.fontSize, 10);
|
|
3106
3127
|
const position = endpointLabelPosition(context.points, end);
|
|
3107
3128
|
const width = 90;
|
|
3108
3129
|
return [
|
|
@@ -3116,7 +3137,7 @@ function renderEndpointLabel(context, end, labelIndex) {
|
|
|
3116
3137
|
width,
|
|
3117
3138
|
height: fontSize * 2,
|
|
3118
3139
|
lines: [label],
|
|
3119
|
-
fontFamily: context.link.style?.fontFamily ??
|
|
3140
|
+
fontFamily: context.link.style?.fontFamily ?? chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
3120
3141
|
fontSize,
|
|
3121
3142
|
fontWeight: "normal",
|
|
3122
3143
|
color: context.color,
|
|
@@ -3146,7 +3167,7 @@ function renderMainLabel(context) {
|
|
|
3146
3167
|
width: context.label.width,
|
|
3147
3168
|
height: context.label.fontSize * 2,
|
|
3148
3169
|
lines: context.label.lines,
|
|
3149
|
-
fontFamily: context.link.style?.fontFamily ??
|
|
3170
|
+
fontFamily: context.link.style?.fontFamily ?? chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
3150
3171
|
fontSize: context.label.fontSize,
|
|
3151
3172
|
fontWeight: "normal",
|
|
3152
3173
|
color: context.color,
|
|
@@ -3200,10 +3221,10 @@ function linkBounds(points, padding) {
|
|
|
3200
3221
|
}
|
|
3201
3222
|
function labelLayout(link, measureText) {
|
|
3202
3223
|
const visible = Boolean(link.showText && link.text);
|
|
3203
|
-
const fontSize =
|
|
3224
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(link.style?.fontSize, 10);
|
|
3204
3225
|
const width = Math.min(250, Math.max(fontSize * 2, (link.text?.length ?? 0) * fontSize * 0.65 + 10));
|
|
3205
|
-
const metrics = measureText?.(link.style?.fontFamily ??
|
|
3206
|
-
const lines = visible ?
|
|
3226
|
+
const metrics = measureText?.(link.style?.fontFamily ?? chunkQL7MNEMT_cjs.DEFAULT_FONT, fontSize);
|
|
3227
|
+
const lines = visible ? chunkQL7MNEMT_cjs.wrapText(link.text ?? "", width, fontSize, metrics) : [];
|
|
3207
3228
|
return { visible, fontSize, width, height: lines.length * fontSize * 1.4, lines };
|
|
3208
3229
|
}
|
|
3209
3230
|
function linkStyle(item, strokeWidth, color, dash) {
|
|
@@ -3220,26 +3241,26 @@ function linkStyle(item, strokeWidth, color, dash) {
|
|
|
3220
3241
|
dash,
|
|
3221
3242
|
lineCap: "round",
|
|
3222
3243
|
lineJoin: "round",
|
|
3223
|
-
opacity:
|
|
3244
|
+
opacity: chunkQL7MNEMT_cjs.finite(link.style?.opacity, 1),
|
|
3224
3245
|
shadow: resolveShadow(link.style?.shadow)
|
|
3225
3246
|
};
|
|
3226
3247
|
}
|
|
3227
3248
|
function createLinkRenderContext(item, index, measureText) {
|
|
3228
3249
|
const { link, from, to } = item;
|
|
3229
3250
|
const pathType = link.style?.pathType ?? "orthogonal";
|
|
3230
|
-
const { points, segments } =
|
|
3231
|
-
const strokeWidth =
|
|
3251
|
+
const { points, segments } = chunkQL7MNEMT_cjs.calculateLinkRoute(link, from, to, pathType);
|
|
3252
|
+
const strokeWidth = chunkQL7MNEMT_cjs.finite(link.style?.strokeWidth, 2);
|
|
3232
3253
|
const color = getLinkStrokeColor(link.style?.color) || "#64748b";
|
|
3233
3254
|
const label = labelLayout(link, measureText);
|
|
3234
3255
|
const contentDash = getDashArray(strokeWidth, link.style?.strokeStyle ?? "solid");
|
|
3235
|
-
const gap = label.visible && !contentDash ?
|
|
3256
|
+
const gap = label.visible && !contentDash ? chunkQL7MNEMT_cjs.labelGapDash(points, pathType, label.width, label.height) : null;
|
|
3236
3257
|
const dash = gap ? [gap.dashBefore, gap.gapLength, 1e6] : contentDash;
|
|
3237
3258
|
return {
|
|
3238
3259
|
link,
|
|
3239
3260
|
pathType,
|
|
3240
3261
|
points,
|
|
3241
3262
|
segments,
|
|
3242
|
-
midpoint:
|
|
3263
|
+
midpoint: chunkQL7MNEMT_cjs.getLineMidpoint(points, pathType, from, to),
|
|
3243
3264
|
strokeWidth,
|
|
3244
3265
|
bounds: linkBounds(points, strokeWidth + 14),
|
|
3245
3266
|
color,
|
|
@@ -3285,7 +3306,7 @@ function pathData2(points, pathType, segments, strokeWidth) {
|
|
|
3285
3306
|
return `M ${points[0]} ${points[1]} C ${points[2]} ${points[3]} ${points[4]} ${points[5]} ${points[6]} ${points[7]}`;
|
|
3286
3307
|
}
|
|
3287
3308
|
if (pathType === "orthogonal" && segments.length > 0) {
|
|
3288
|
-
return
|
|
3309
|
+
return chunkQL7MNEMT_cjs.roundedOrthogonalPathData(segments, Math.max(16, strokeWidth * 4));
|
|
3289
3310
|
}
|
|
3290
3311
|
return polylinePathData(points);
|
|
3291
3312
|
}
|
|
@@ -3389,7 +3410,7 @@ function buildLink(item, index, measureText) {
|
|
|
3389
3410
|
}
|
|
3390
3411
|
function buildLinks(links, measureText) {
|
|
3391
3412
|
return links.flatMap(
|
|
3392
|
-
(item, index) =>
|
|
3413
|
+
(item, index) => chunkQL7MNEMT_cjs.tag(
|
|
3393
3414
|
buildLink(item, index, measureText),
|
|
3394
3415
|
"link",
|
|
3395
3416
|
item.link.id,
|
|
@@ -3404,7 +3425,7 @@ function buildFreeformPath(path, index) {
|
|
|
3404
3425
|
if (path.isVisible === false || path.points.length < 2) {
|
|
3405
3426
|
return [];
|
|
3406
3427
|
}
|
|
3407
|
-
const strokeWidth =
|
|
3428
|
+
const strokeWidth = chunkQL7MNEMT_cjs.finite(path.strokeWidth, 2);
|
|
3408
3429
|
const extra = strokeWidth + 12;
|
|
3409
3430
|
const bounds = {
|
|
3410
3431
|
minX: Math.min(...path.points.map((point) => point.x)) - extra,
|
|
@@ -3412,7 +3433,7 @@ function buildFreeformPath(path, index) {
|
|
|
3412
3433
|
maxX: Math.max(...path.points.map((point) => point.x)) + extra,
|
|
3413
3434
|
maxY: Math.max(...path.points.map((point) => point.y)) + extra
|
|
3414
3435
|
};
|
|
3415
|
-
const tension =
|
|
3436
|
+
const tension = chunkQL7MNEMT_cjs.finite(path.tension, 0);
|
|
3416
3437
|
const closed = path.closed === true;
|
|
3417
3438
|
return [
|
|
3418
3439
|
{
|
|
@@ -3420,7 +3441,7 @@ function buildFreeformPath(path, index) {
|
|
|
3420
3441
|
id: `path-${path.id}`,
|
|
3421
3442
|
order: 3e4 + index,
|
|
3422
3443
|
bounds,
|
|
3423
|
-
d:
|
|
3444
|
+
d: chunkQL7MNEMT_cjs.freeformPathData({ points: path.points, tension, closed }),
|
|
3424
3445
|
markerStart: path.startMarker,
|
|
3425
3446
|
markerEnd: path.endMarker,
|
|
3426
3447
|
detail: {
|
|
@@ -3436,13 +3457,13 @@ function buildFreeformPath(path, index) {
|
|
|
3436
3457
|
dash: path.dash?.length ? path.dash : void 0,
|
|
3437
3458
|
lineCap: "round",
|
|
3438
3459
|
lineJoin: "round",
|
|
3439
|
-
opacity:
|
|
3460
|
+
opacity: chunkQL7MNEMT_cjs.finite(path.opacity, 1)
|
|
3440
3461
|
}
|
|
3441
3462
|
}
|
|
3442
3463
|
];
|
|
3443
3464
|
}
|
|
3444
3465
|
function buildFreeformPaths(paths) {
|
|
3445
|
-
return paths.flatMap((path, index) =>
|
|
3466
|
+
return paths.flatMap((path, index) => chunkQL7MNEMT_cjs.tag(buildFreeformPath(path, index), "path", path.id, "path", "Path"));
|
|
3446
3467
|
}
|
|
3447
3468
|
|
|
3448
3469
|
// src/renderScene/artifacts/shape/geometry/base.ts
|
|
@@ -3458,7 +3479,7 @@ function shapeNodeBase(context) {
|
|
|
3458
3479
|
|
|
3459
3480
|
// src/renderScene/artifacts/shape/geometry/simple.ts
|
|
3460
3481
|
function renderPath(context) {
|
|
3461
|
-
const path =
|
|
3482
|
+
const path = chunkQL7MNEMT_cjs.localShapePath(context.shape.shapeType, context.x, context.y, context.width, context.height);
|
|
3462
3483
|
if (!path) {
|
|
3463
3484
|
return [];
|
|
3464
3485
|
}
|
|
@@ -3474,7 +3495,7 @@ function renderBoundedPath(context) {
|
|
|
3474
3495
|
}));
|
|
3475
3496
|
}
|
|
3476
3497
|
function renderRectangle(context) {
|
|
3477
|
-
const rx = context.shape.shapeType === "pill" ?
|
|
3498
|
+
const rx = context.shape.shapeType === "pill" ? chunkQL7MNEMT_cjs.pillCornerRadius(context.width, context.height) : context.shape.shapeType === "rounded_rectangle" ? chunkQL7MNEMT_cjs.finite(context.shape.cornerRadius, 8) : 0;
|
|
3478
3499
|
return [
|
|
3479
3500
|
{
|
|
3480
3501
|
...shapeNodeBase(context),
|
|
@@ -3503,7 +3524,7 @@ function renderSymbol(context) {
|
|
|
3503
3524
|
if (!context.shape.symbol || context.shape.symbol.points.length < 2) {
|
|
3504
3525
|
return renderRectangle(context);
|
|
3505
3526
|
}
|
|
3506
|
-
const tension =
|
|
3527
|
+
const tension = chunkQL7MNEMT_cjs.finite(context.shape.symbol.tension, 0);
|
|
3507
3528
|
const points = context.shape.symbol.points.map(([x, y]) => ({
|
|
3508
3529
|
x: context.x + x * context.width,
|
|
3509
3530
|
y: context.y + y * context.height
|
|
@@ -3512,7 +3533,7 @@ function renderSymbol(context) {
|
|
|
3512
3533
|
{
|
|
3513
3534
|
...shapeNodeBase(context),
|
|
3514
3535
|
type: "path",
|
|
3515
|
-
d:
|
|
3536
|
+
d: chunkQL7MNEMT_cjs.freeformPathData({ points, tension, closed: true }),
|
|
3516
3537
|
rotationCenter: context.rotationCenter,
|
|
3517
3538
|
detail: {
|
|
3518
3539
|
of: "symbolGeometry",
|
|
@@ -3555,7 +3576,8 @@ var RECT_PROGRAMS = /* @__PURE__ */ new Set([
|
|
|
3555
3576
|
"ledMatrix",
|
|
3556
3577
|
"lightBand",
|
|
3557
3578
|
"silkFolds",
|
|
3558
|
-
"glowCard"
|
|
3579
|
+
"glowCard",
|
|
3580
|
+
"glassDots"
|
|
3559
3581
|
]);
|
|
3560
3582
|
function shaderMask(context) {
|
|
3561
3583
|
if (context.shape.shapeType === "circle" || context.shape.shapeType === "oval") {
|
|
@@ -3586,7 +3608,7 @@ function renderShapeShaderSurface(context) {
|
|
|
3586
3608
|
id: `${context.id}-shader`,
|
|
3587
3609
|
type: "shader-surface",
|
|
3588
3610
|
order: context.order,
|
|
3589
|
-
bounds:
|
|
3611
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds(surfaceBounds, context.rotation, 0),
|
|
3590
3612
|
...surfaceBounds,
|
|
3591
3613
|
rotation: context.rotation,
|
|
3592
3614
|
shader: context.shape.shader,
|
|
@@ -3656,22 +3678,24 @@ function shapeDash(shape, strokeWidth) {
|
|
|
3656
3678
|
}
|
|
3657
3679
|
function shapeStyle(shape, diagnostics) {
|
|
3658
3680
|
const defaults = shapeDefaults(shape, diagnostics);
|
|
3659
|
-
const strokeWidth =
|
|
3681
|
+
const strokeWidth = chunkQL7MNEMT_cjs.finite(shape.strokeWidth, defaults.strokeWidth);
|
|
3660
3682
|
const shadow = shape.shadowStyle ?? (shape.hasShadow ? { enabled: true, color: "#000000", opacity: 0.25, blur: 10, angle: 45, distance: 5 } : void 0);
|
|
3661
|
-
const angle =
|
|
3683
|
+
const angle = chunkQL7MNEMT_cjs.finite(shadow?.angle, 45) * Math.PI / 180;
|
|
3662
3684
|
return {
|
|
3663
|
-
fill:
|
|
3664
|
-
stroke:
|
|
3685
|
+
fill: chunkQL7MNEMT_cjs.paint(shape.fillColor, diagnostics, shape.id),
|
|
3686
|
+
stroke: chunkQL7MNEMT_cjs.paint(shape.strokeColor, diagnostics, shape.id),
|
|
3665
3687
|
strokeWidth,
|
|
3666
3688
|
dash: shapeDash(shape, strokeWidth),
|
|
3667
3689
|
lineCap: shape.strokeStyle === "dotted" ? "round" : "butt",
|
|
3668
|
-
opacity:
|
|
3690
|
+
opacity: chunkQL7MNEMT_cjs.finite(shape.opacity, defaults.opacity),
|
|
3691
|
+
blur: shape.blur !== void 0 && shape.blur > 0 ? shape.blur : void 0,
|
|
3692
|
+
blend: shape.blend,
|
|
3669
3693
|
shadow: shadow?.enabled ? {
|
|
3670
3694
|
color: shadow.color ?? "#000000",
|
|
3671
|
-
opacity:
|
|
3672
|
-
blur:
|
|
3673
|
-
dx: Math.cos(angle) *
|
|
3674
|
-
dy: Math.sin(angle) *
|
|
3695
|
+
opacity: chunkQL7MNEMT_cjs.finite(shadow.opacity, 0.25),
|
|
3696
|
+
blur: chunkQL7MNEMT_cjs.finite(shadow.blur, 10),
|
|
3697
|
+
dx: Math.cos(angle) * chunkQL7MNEMT_cjs.finite(shadow.distance, 5),
|
|
3698
|
+
dy: Math.sin(angle) * chunkQL7MNEMT_cjs.finite(shadow.distance, 5)
|
|
3675
3699
|
} : void 0
|
|
3676
3700
|
};
|
|
3677
3701
|
}
|
|
@@ -3747,11 +3771,11 @@ function renderShapeText(context, strokeWidth, measureText) {
|
|
|
3747
3771
|
if (!shape.text) {
|
|
3748
3772
|
return null;
|
|
3749
3773
|
}
|
|
3750
|
-
const fontSize =
|
|
3774
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(shape.fontSize, shapeDefaults(shape, []).fontSize);
|
|
3751
3775
|
const padding = shape.isText ? 0 : Math.max(8, strokeWidth * 2);
|
|
3752
|
-
const area = shape.shapeType === "person" ?
|
|
3776
|
+
const area = shape.shapeType === "person" ? chunkQL7MNEMT_cjs.personLabelArea(x, y, width, height) : { x, y, width, height };
|
|
3753
3777
|
const textWidth = Math.max(0, area.width - padding * 2);
|
|
3754
|
-
const fontFamily2 = shape.fontFamily ||
|
|
3778
|
+
const fontFamily2 = shape.fontFamily || chunkQL7MNEMT_cjs.DEFAULT_FONT;
|
|
3755
3779
|
const metrics = measureText?.(fontFamily2, fontSize);
|
|
3756
3780
|
const textNode = {
|
|
3757
3781
|
type: "text",
|
|
@@ -3762,7 +3786,7 @@ function renderShapeText(context, strokeWidth, measureText) {
|
|
|
3762
3786
|
y: area.y + padding,
|
|
3763
3787
|
width: textWidth,
|
|
3764
3788
|
height: Math.max(0, area.height - padding * 2),
|
|
3765
|
-
lines:
|
|
3789
|
+
lines: chunkQL7MNEMT_cjs.wrapText(shape.text, textWidth, fontSize, metrics),
|
|
3766
3790
|
fontFamily: fontFamily2,
|
|
3767
3791
|
fontSize,
|
|
3768
3792
|
fontWeight: shape.fontWeight ?? "normal",
|
|
@@ -3770,12 +3794,12 @@ function renderShapeText(context, strokeWidth, measureText) {
|
|
|
3770
3794
|
color: shape.textColor || "#111827",
|
|
3771
3795
|
align: shape.textAlign ?? "center",
|
|
3772
3796
|
verticalAlign: shape.textVerticalAlign ?? "middle",
|
|
3773
|
-
lineHeight:
|
|
3797
|
+
lineHeight: chunkQL7MNEMT_cjs.finite(shape.lineHeight, 1.3),
|
|
3774
3798
|
rotation,
|
|
3775
3799
|
rotationCenter
|
|
3776
3800
|
};
|
|
3777
3801
|
if (hasBoldMarkup(shape.text)) {
|
|
3778
|
-
const { measure, spaceWidth } = metrics ??
|
|
3802
|
+
const { measure, spaceWidth } = metrics ?? chunkQL7MNEMT_cjs.heuristicRichMeasure(fontSize);
|
|
3779
3803
|
textNode.richLines = wrapRichText(shape.text, textWidth, measure, spaceWidth);
|
|
3780
3804
|
}
|
|
3781
3805
|
return textNode;
|
|
@@ -3814,19 +3838,19 @@ function renderDoubleStroke(context, strokeWidth) {
|
|
|
3814
3838
|
return nodes;
|
|
3815
3839
|
}
|
|
3816
3840
|
function createRenderContext(shape, index, diagnostics) {
|
|
3817
|
-
const x =
|
|
3818
|
-
const y =
|
|
3819
|
-
const width = Math.max(0,
|
|
3820
|
-
const height = Math.max(0,
|
|
3821
|
-
const rotation =
|
|
3822
|
-
const strokeWidth =
|
|
3841
|
+
const x = chunkQL7MNEMT_cjs.finite(shape.x, 0);
|
|
3842
|
+
const y = chunkQL7MNEMT_cjs.finite(shape.y, 0);
|
|
3843
|
+
const width = Math.max(0, chunkQL7MNEMT_cjs.finite(shape.width, 100));
|
|
3844
|
+
const height = Math.max(0, chunkQL7MNEMT_cjs.finite(shape.height, 100));
|
|
3845
|
+
const rotation = chunkQL7MNEMT_cjs.finite(shape.rotation, 0);
|
|
3846
|
+
const strokeWidth = chunkQL7MNEMT_cjs.finite(shape.strokeWidth, 2);
|
|
3823
3847
|
return {
|
|
3824
3848
|
strokeWidth,
|
|
3825
3849
|
context: {
|
|
3826
3850
|
shape,
|
|
3827
3851
|
id: `shape-${shape.id}`,
|
|
3828
3852
|
order: 1e4 + index,
|
|
3829
|
-
bounds:
|
|
3853
|
+
bounds: chunkQL7MNEMT_cjs.rotatedBounds({ x, y, width, height }, rotation, strokeWidth + (shape.hasShadow ? 20 : 2)),
|
|
3830
3854
|
rotation,
|
|
3831
3855
|
rotationCenter: { x: x + width / 2, y: y + height / 2 },
|
|
3832
3856
|
style: shapeStyle(shape, diagnostics),
|
|
@@ -3860,7 +3884,7 @@ function buildShape(shape, index, diagnostics, measureText) {
|
|
|
3860
3884
|
}
|
|
3861
3885
|
function buildShapes(shapes, diagnostics, measureText) {
|
|
3862
3886
|
return shapes.flatMap(
|
|
3863
|
-
(shape, index) =>
|
|
3887
|
+
(shape, index) => chunkQL7MNEMT_cjs.tag(
|
|
3864
3888
|
buildShape(shape, index, diagnostics, measureText),
|
|
3865
3889
|
"shape",
|
|
3866
3890
|
shape.id,
|
|
@@ -3877,7 +3901,7 @@ function buildXAxisLabel(chart, layout, order) {
|
|
|
3877
3901
|
return null;
|
|
3878
3902
|
}
|
|
3879
3903
|
return {
|
|
3880
|
-
...
|
|
3904
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
3881
3905
|
role: "axis",
|
|
3882
3906
|
id: `chart-x-label-${chart.id}`,
|
|
3883
3907
|
order,
|
|
@@ -3887,7 +3911,7 @@ function buildXAxisLabel(chart, layout, order) {
|
|
|
3887
3911
|
chart,
|
|
3888
3912
|
align: "center"
|
|
3889
3913
|
}),
|
|
3890
|
-
prop:
|
|
3914
|
+
prop: chunkQL7MNEMT_cjs.axisLabelProp("x")
|
|
3891
3915
|
};
|
|
3892
3916
|
}
|
|
3893
3917
|
function buildYAxisLabel(chart, layout, order) {
|
|
@@ -3895,7 +3919,7 @@ function buildYAxisLabel(chart, layout, order) {
|
|
|
3895
3919
|
return null;
|
|
3896
3920
|
}
|
|
3897
3921
|
return {
|
|
3898
|
-
...
|
|
3922
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
3899
3923
|
role: "axis",
|
|
3900
3924
|
id: `chart-y-label-${chart.id}`,
|
|
3901
3925
|
order,
|
|
@@ -3911,7 +3935,7 @@ function buildYAxisLabel(chart, layout, order) {
|
|
|
3911
3935
|
align: "center",
|
|
3912
3936
|
rotation: -90
|
|
3913
3937
|
}),
|
|
3914
|
-
prop:
|
|
3938
|
+
prop: chunkQL7MNEMT_cjs.axisLabelProp("y")
|
|
3915
3939
|
};
|
|
3916
3940
|
}
|
|
3917
3941
|
function buildAxisLabels(chart, layout, order) {
|
|
@@ -3934,7 +3958,7 @@ function buildBoxplotSeriesYAxisTicks(chart, layout, order) {
|
|
|
3934
3958
|
return chart.series.map((series, index) => {
|
|
3935
3959
|
const centerY = layout.plot.y + (index + 0.5) * slotWidth;
|
|
3936
3960
|
return {
|
|
3937
|
-
...
|
|
3961
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
3938
3962
|
role: "axis",
|
|
3939
3963
|
id: `chart-y-tick-${chart.id}-${index}`,
|
|
3940
3964
|
order: order + index,
|
|
@@ -3944,7 +3968,7 @@ function buildBoxplotSeriesYAxisTicks(chart, layout, order) {
|
|
|
3944
3968
|
chart,
|
|
3945
3969
|
align: "right"
|
|
3946
3970
|
}),
|
|
3947
|
-
prop:
|
|
3971
|
+
prop: chunkQL7MNEMT_cjs.seriesLabelProp(series.id)
|
|
3948
3972
|
};
|
|
3949
3973
|
});
|
|
3950
3974
|
}
|
|
@@ -3970,7 +3994,7 @@ function isStackedLegendPosition(position) {
|
|
|
3970
3994
|
return position === "bottomLeft" || position === "bottomRight";
|
|
3971
3995
|
}
|
|
3972
3996
|
function legendItemWidths(chart) {
|
|
3973
|
-
return legendSeries(chart).map((item) => Math.max(42, item.label.length *
|
|
3997
|
+
return legendSeries(chart).map((item) => Math.max(42, item.label.length * chunkQL7MNEMT_cjs.finite(chart.fontSize, 12) * 0.58 + 22));
|
|
3974
3998
|
}
|
|
3975
3999
|
function stackedLegendColumnWidth(chart) {
|
|
3976
4000
|
const widths = legendItemWidths(chart);
|
|
@@ -4023,9 +4047,9 @@ function renderLegendItem(render2, item) {
|
|
|
4023
4047
|
}
|
|
4024
4048
|
function createLegendSwatch(render2, item) {
|
|
4025
4049
|
const { chart, bounds, diagnostics } = render2;
|
|
4026
|
-
const fallback =
|
|
4050
|
+
const fallback = chunkQL7MNEMT_cjs.CHART_COLORS[item.seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
4027
4051
|
const solidOnly = chart.chartType === "line";
|
|
4028
|
-
const color = solidOnly ?
|
|
4052
|
+
const color = solidOnly ? chunkQL7MNEMT_cjs.representativeColor(item.series.color, fallback) : item.series.color ?? fallback;
|
|
4029
4053
|
return {
|
|
4030
4054
|
type: "rect",
|
|
4031
4055
|
id: `chart-legend-swatch-${chart.id}-${item.series.id}`,
|
|
@@ -4036,16 +4060,16 @@ function createLegendSwatch(render2, item) {
|
|
|
4036
4060
|
width: 10,
|
|
4037
4061
|
height: 10,
|
|
4038
4062
|
rx: 3,
|
|
4039
|
-
prop:
|
|
4063
|
+
prop: chunkQL7MNEMT_cjs.seriesColorProp(item.series.id),
|
|
4040
4064
|
propKind: "color",
|
|
4041
4065
|
propSolidOnly: solidOnly,
|
|
4042
|
-
style: { fill:
|
|
4066
|
+
style: { fill: chunkQL7MNEMT_cjs.paint(color, diagnostics, chart.id) }
|
|
4043
4067
|
};
|
|
4044
4068
|
}
|
|
4045
4069
|
function createLegendLabel(render2, item) {
|
|
4046
4070
|
const { chart, bounds } = render2;
|
|
4047
4071
|
return {
|
|
4048
|
-
...
|
|
4072
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4049
4073
|
role: "legend",
|
|
4050
4074
|
id: `chart-legend-${chart.id}-${item.series.id}`,
|
|
4051
4075
|
order: item.order + 1,
|
|
@@ -4054,7 +4078,7 @@ function createLegendLabel(render2, item) {
|
|
|
4054
4078
|
text: item.series.label,
|
|
4055
4079
|
chart
|
|
4056
4080
|
}),
|
|
4057
|
-
prop:
|
|
4081
|
+
prop: chunkQL7MNEMT_cjs.seriesLabelProp(item.series.id)
|
|
4058
4082
|
};
|
|
4059
4083
|
}
|
|
4060
4084
|
|
|
@@ -4073,19 +4097,19 @@ function hasCartesianDecorations(chart) {
|
|
|
4073
4097
|
return !CHARTS_WITHOUT_CARTESIAN_DECORATIONS.has(chart.chartType);
|
|
4074
4098
|
}
|
|
4075
4099
|
function tickOffset(chart) {
|
|
4076
|
-
return hasCartesianDecorations(chart) ? Math.max(0,
|
|
4100
|
+
return hasCartesianDecorations(chart) ? Math.max(0, chunkQL7MNEMT_cjs.finite(chart.tickLength, 0)) : 0;
|
|
4077
4101
|
}
|
|
4078
4102
|
function xLabelOffset(chart) {
|
|
4079
|
-
return tickOffset(chart) + (hasCartesianDecorations(chart) ? Math.max(0,
|
|
4103
|
+
return tickOffset(chart) + (hasCartesianDecorations(chart) ? Math.max(0, chunkQL7MNEMT_cjs.finite(chart.xLabelGap, 0)) : 0);
|
|
4080
4104
|
}
|
|
4081
4105
|
function yLabelOffset(chart) {
|
|
4082
|
-
return tickOffset(chart) + (hasCartesianDecorations(chart) ? Math.max(0,
|
|
4106
|
+
return tickOffset(chart) + (hasCartesianDecorations(chart) ? Math.max(0, chunkQL7MNEMT_cjs.finite(chart.yLabelGap, 0)) : 0);
|
|
4083
4107
|
}
|
|
4084
4108
|
function isHorizontalBoxplot(chart) {
|
|
4085
4109
|
return chart.chartType === "boxplot" && chart.config?.orientation === "horizontal";
|
|
4086
4110
|
}
|
|
4087
4111
|
function boxplotCategoryLabelWidth(chart) {
|
|
4088
|
-
const fontSize =
|
|
4112
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(chart.fontSize, 12);
|
|
4089
4113
|
const longest = Math.max(0, ...chart.series.map((series) => (series.label || series.id).length));
|
|
4090
4114
|
return longest * fontSize * 0.58 + 16;
|
|
4091
4115
|
}
|
|
@@ -4097,18 +4121,18 @@ function treemapSideLegendSide(chart, showLegend) {
|
|
|
4097
4121
|
return chart.legendPosition === "left" ? "left" : chart.legendPosition === "right" ? "right" : null;
|
|
4098
4122
|
}
|
|
4099
4123
|
function barCategoryLabelWidth(chart) {
|
|
4100
|
-
const fontSize =
|
|
4124
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(chart.axisFontSize ?? chart.fontSize, 12);
|
|
4101
4125
|
const categories = chart.config?.categories ?? [];
|
|
4102
4126
|
return Math.max(0, ...categories.map((category) => category.length)) * fontSize * 0.58 + 16;
|
|
4103
4127
|
}
|
|
4104
4128
|
function leftLabelWidth(chart) {
|
|
4105
|
-
if (chart.axisLabelSpace && chart.axisLabelSpace > 0 && (isHorizontalBoxplot(chart) ||
|
|
4129
|
+
if (chart.axisLabelSpace && chart.axisLabelSpace > 0 && (isHorizontalBoxplot(chart) || chunkQL7MNEMT_cjs.isHorizontalBar(chart))) {
|
|
4106
4130
|
return chart.axisLabelSpace;
|
|
4107
4131
|
}
|
|
4108
4132
|
if (isHorizontalBoxplot(chart)) {
|
|
4109
4133
|
return boxplotCategoryLabelWidth(chart);
|
|
4110
4134
|
}
|
|
4111
|
-
if (
|
|
4135
|
+
if (chunkQL7MNEMT_cjs.isHorizontalBar(chart)) {
|
|
4112
4136
|
return chart.categoryAlign === "left" || chart.categoryAlign === "inside" ? 20 : barCategoryLabelWidth(chart);
|
|
4113
4137
|
}
|
|
4114
4138
|
if (chart.showValueAxis === false) {
|
|
@@ -4117,12 +4141,12 @@ function leftLabelWidth(chart) {
|
|
|
4117
4141
|
return chart.axisY.label ? 60 : 46;
|
|
4118
4142
|
}
|
|
4119
4143
|
function tiltedBottomRoom(chart) {
|
|
4120
|
-
const tilt =
|
|
4144
|
+
const tilt = chunkQL7MNEMT_cjs.labelTilt(chart);
|
|
4121
4145
|
if (tilt <= 0) {
|
|
4122
4146
|
return 0;
|
|
4123
4147
|
}
|
|
4124
|
-
const labels = chart.chartType === "bar" && !
|
|
4125
|
-
return labels.length > 0 ? Math.max(0,
|
|
4148
|
+
const labels = chart.chartType === "bar" && !chunkQL7MNEMT_cjs.isHorizontalBar(chart) ? chart.config?.categories ?? [] : chart.chartType === "boxplot" && !isHorizontalBoxplot(chart) ? chart.series.map((series) => series.label || series.id) : [];
|
|
4149
|
+
return labels.length > 0 ? Math.max(0, chunkQL7MNEMT_cjs.tiltedLabelRoom(chart, labels, tilt) - 18) : 0;
|
|
4126
4150
|
}
|
|
4127
4151
|
function decorations(chart) {
|
|
4128
4152
|
const showLabels = chart.showAxisLabels !== false;
|
|
@@ -4138,17 +4162,17 @@ function decorations(chart) {
|
|
|
4138
4162
|
const padLeft = tickY + (showLabels ? leftLabelWidth(chart) : 12) + (legendPosition === "bottomLeft" ? sideColumnWidth : 0) + (treemapSide === "left" ? TREEMAP_SIDE_LEGEND_WIDTH : 0);
|
|
4139
4163
|
const padRight = 24 + (legendPosition === "bottomRight" ? sideColumnWidth : 0) + (treemapSide === "right" ? TREEMAP_SIDE_LEGEND_WIDTH : 0);
|
|
4140
4164
|
const valueRow = chart.chartType === "bar" && chart.config?.showBarLabels === true && chart.config.barLabelPosition === "axis";
|
|
4141
|
-
const horizontalValueAxis =
|
|
4142
|
-
const basePadBottom = showLabels ?
|
|
4165
|
+
const horizontalValueAxis = chunkQL7MNEMT_cjs.isHorizontalBar(chart) && chart.showValueAxis !== false;
|
|
4166
|
+
const basePadBottom = showLabels ? chunkQL7MNEMT_cjs.isHorizontalBar(chart) ? horizontalValueAxis ? 34 : 12 : (chart.axisX.label ? 52 : 34) + (valueRow ? 18 : 0) : 12;
|
|
4143
4167
|
const hasColorBar = chart.chartType === "field" && showLegend && Boolean(chart.config?.scale?.stops.length);
|
|
4144
4168
|
const legendAtBottomRow = hasLegendItems && !legendAtTop && !legendStacked;
|
|
4145
4169
|
const padBottom = tickX + basePadBottom + (showLabels ? tiltedBottomRoom(chart) : 0) + (hasColorBar ? 44 : 0) + (legendAtBottomRow ? 16 + LEGEND_ROW_HEIGHT : 0);
|
|
4146
|
-
const titleHeight = chart.title ? Math.max(44, 20 +
|
|
4170
|
+
const titleHeight = chart.title ? Math.max(44, 20 + chunkQL7MNEMT_cjs.finite(chart.titleSize, 14) * 1.6) : 0;
|
|
4147
4171
|
const padTop = titleHeight || (legendAtTop && hasLegendItems ? 44 : 24);
|
|
4148
4172
|
return {
|
|
4149
|
-
bounds:
|
|
4173
|
+
bounds: chunkQL7MNEMT_cjs.boxBounds(
|
|
4150
4174
|
{ x: chart.x, y: chart.y, width: chart.width, height: chart.height },
|
|
4151
|
-
|
|
4175
|
+
chunkQL7MNEMT_cjs.finite(chart.strokeWidth, 1) + 2
|
|
4152
4176
|
),
|
|
4153
4177
|
plot: {
|
|
4154
4178
|
x: chart.x + padLeft,
|
|
@@ -4170,26 +4194,26 @@ function categoryLabels(chart, count) {
|
|
|
4170
4194
|
return Array.from({ length: count }, (_value, index) => String(index + 1));
|
|
4171
4195
|
}
|
|
4172
4196
|
function buildCategoricalXAxisTicks(chart, layout, order) {
|
|
4173
|
-
const count =
|
|
4197
|
+
const count = chunkQL7MNEMT_cjs.barCategoryCount(chart);
|
|
4174
4198
|
const slotWidth = layout.plot.width / count;
|
|
4175
4199
|
const labels = categoryLabels(chart, count);
|
|
4176
4200
|
const editable = Boolean(chart.config?.categories?.length);
|
|
4177
|
-
const tilt =
|
|
4201
|
+
const tilt = chunkQL7MNEMT_cjs.labelTilt(chart);
|
|
4178
4202
|
const left = chart.categoryAlign === "left";
|
|
4179
4203
|
const groupGap = left ? Math.min(
|
|
4180
|
-
Math.max(0,
|
|
4204
|
+
Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.barGroupGap, 8)),
|
|
4181
4205
|
Math.max(0, slotWidth - 1)
|
|
4182
4206
|
) : 0;
|
|
4183
4207
|
return Array.from({ length: count }, (_value, index) => {
|
|
4184
4208
|
const centerX = layout.plot.x + (index + 0.5) * slotWidth;
|
|
4185
4209
|
if (tilt > 0) {
|
|
4186
4210
|
const text = labels[index] ?? String(index + 1);
|
|
4187
|
-
const { frame, rotation } =
|
|
4211
|
+
const { frame, rotation } = chunkQL7MNEMT_cjs.labelBelowFrame(chart, text, tilt, {
|
|
4188
4212
|
x: centerX,
|
|
4189
4213
|
y: layout.plot.y + layout.plot.height + 4 + xLabelOffset(chart)
|
|
4190
4214
|
});
|
|
4191
4215
|
return {
|
|
4192
|
-
...
|
|
4216
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4193
4217
|
role: "axis",
|
|
4194
4218
|
id: `chart-x-tick-${chart.id}-${index}`,
|
|
4195
4219
|
order: order + index,
|
|
@@ -4200,11 +4224,11 @@ function buildCategoricalXAxisTicks(chart, layout, order) {
|
|
|
4200
4224
|
align: "right",
|
|
4201
4225
|
rotation
|
|
4202
4226
|
}),
|
|
4203
|
-
prop: editable ?
|
|
4227
|
+
prop: editable ? chunkQL7MNEMT_cjs.categoryProp(index) : void 0
|
|
4204
4228
|
};
|
|
4205
4229
|
}
|
|
4206
4230
|
return {
|
|
4207
|
-
...
|
|
4231
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4208
4232
|
role: "axis",
|
|
4209
4233
|
id: `chart-x-tick-${chart.id}-${index}`,
|
|
4210
4234
|
order: order + index,
|
|
@@ -4219,24 +4243,24 @@ function buildCategoricalXAxisTicks(chart, layout, order) {
|
|
|
4219
4243
|
chart,
|
|
4220
4244
|
align: left ? "left" : "center"
|
|
4221
4245
|
}),
|
|
4222
|
-
prop: editable ?
|
|
4246
|
+
prop: editable ? chunkQL7MNEMT_cjs.categoryProp(index) : void 0
|
|
4223
4247
|
};
|
|
4224
4248
|
});
|
|
4225
4249
|
}
|
|
4226
4250
|
function buildSeriesXAxisTicks(chart, layout, order) {
|
|
4227
4251
|
const count = Math.max(1, chart.series.length);
|
|
4228
4252
|
const slotWidth = layout.plot.width / count;
|
|
4229
|
-
const tilt =
|
|
4253
|
+
const tilt = chunkQL7MNEMT_cjs.labelTilt(chart);
|
|
4230
4254
|
return chart.series.map((series, index) => {
|
|
4231
4255
|
const centerX = layout.plot.x + (index + 0.5) * slotWidth;
|
|
4232
4256
|
if (tilt > 0) {
|
|
4233
4257
|
const text = series.label || series.id;
|
|
4234
|
-
const { frame, rotation } =
|
|
4258
|
+
const { frame, rotation } = chunkQL7MNEMT_cjs.labelBelowFrame(chart, text, tilt, {
|
|
4235
4259
|
x: centerX,
|
|
4236
4260
|
y: layout.plot.y + layout.plot.height + 4 + xLabelOffset(chart)
|
|
4237
4261
|
});
|
|
4238
4262
|
return {
|
|
4239
|
-
...
|
|
4263
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4240
4264
|
role: "axis",
|
|
4241
4265
|
id: `chart-x-tick-${chart.id}-${index}`,
|
|
4242
4266
|
order: order + index,
|
|
@@ -4247,11 +4271,11 @@ function buildSeriesXAxisTicks(chart, layout, order) {
|
|
|
4247
4271
|
align: "right",
|
|
4248
4272
|
rotation
|
|
4249
4273
|
}),
|
|
4250
|
-
prop:
|
|
4274
|
+
prop: chunkQL7MNEMT_cjs.seriesLabelProp(series.id)
|
|
4251
4275
|
};
|
|
4252
4276
|
}
|
|
4253
4277
|
return {
|
|
4254
|
-
...
|
|
4278
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4255
4279
|
role: "axis",
|
|
4256
4280
|
id: `chart-x-tick-${chart.id}-${index}`,
|
|
4257
4281
|
order: order + index,
|
|
@@ -4266,16 +4290,16 @@ function buildSeriesXAxisTicks(chart, layout, order) {
|
|
|
4266
4290
|
chart,
|
|
4267
4291
|
align: "center"
|
|
4268
4292
|
}),
|
|
4269
|
-
prop:
|
|
4293
|
+
prop: chunkQL7MNEMT_cjs.seriesLabelProp(series.id)
|
|
4270
4294
|
};
|
|
4271
4295
|
});
|
|
4272
4296
|
}
|
|
4273
4297
|
|
|
4274
4298
|
// src/renderScene/charts/decorations/numericXAxis.ts
|
|
4275
4299
|
function buildNumericXAxisTicks(chart, layout, order) {
|
|
4276
|
-
return
|
|
4277
|
-
const x = layout.plot.x +
|
|
4278
|
-
return
|
|
4300
|
+
return chunkQL7MNEMT_cjs.chartTicks(chart.axisX).map((tick, index) => {
|
|
4301
|
+
const x = layout.plot.x + chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisX, layout.plot.width);
|
|
4302
|
+
return chunkQL7MNEMT_cjs.chartText({
|
|
4279
4303
|
role: "axis",
|
|
4280
4304
|
id: `chart-x-tick-${chart.id}-${tick}`,
|
|
4281
4305
|
order: order + index,
|
|
@@ -4290,9 +4314,9 @@ function buildNumericXAxisTicks(chart, layout, order) {
|
|
|
4290
4314
|
|
|
4291
4315
|
// src/renderScene/charts/decorations/numericYAxis.ts
|
|
4292
4316
|
function buildNumericYAxisTicks(chart, layout, order) {
|
|
4293
|
-
return
|
|
4294
|
-
const y = layout.plot.y + layout.plot.height -
|
|
4295
|
-
return
|
|
4317
|
+
return chunkQL7MNEMT_cjs.chartTicks(chart.axisY).map((tick, index) => {
|
|
4318
|
+
const y = layout.plot.y + layout.plot.height - chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisY, layout.plot.height);
|
|
4319
|
+
return chunkQL7MNEMT_cjs.chartText({
|
|
4296
4320
|
role: "axis",
|
|
4297
4321
|
id: `chart-y-tick-${chart.id}-${tick}`,
|
|
4298
4322
|
order: order + index,
|
|
@@ -4327,10 +4351,10 @@ function buildYAxisTicks(chart, layout, order) {
|
|
|
4327
4351
|
function xTickPositions(chart, layout) {
|
|
4328
4352
|
const { plot } = layout;
|
|
4329
4353
|
if (chart.chartType === "bar") {
|
|
4330
|
-
const count =
|
|
4354
|
+
const count = chunkQL7MNEMT_cjs.barCategoryCount(chart);
|
|
4331
4355
|
return Array.from({ length: count }, (_value, index) => plot.x + (index + 0.5) * plot.width / count);
|
|
4332
4356
|
}
|
|
4333
|
-
return
|
|
4357
|
+
return chunkQL7MNEMT_cjs.chartTicks(chart.axisX).map((tick) => plot.x + chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisX, plot.width));
|
|
4334
4358
|
}
|
|
4335
4359
|
function axisLineDash(chart, width) {
|
|
4336
4360
|
if (chart.axisLineStyle === "dashed") {
|
|
@@ -4339,8 +4363,8 @@ function axisLineDash(chart, width) {
|
|
|
4339
4363
|
return chart.axisLineStyle === "dotted" ? { dash: [0.1, width * 3], lineCap: "round" } : {};
|
|
4340
4364
|
}
|
|
4341
4365
|
function buildAxisLines(chart, layout, order) {
|
|
4342
|
-
const lineWidth =
|
|
4343
|
-
const tickLength =
|
|
4366
|
+
const lineWidth = chunkQL7MNEMT_cjs.finite(chart.axisLineWidth, 0);
|
|
4367
|
+
const tickLength = chunkQL7MNEMT_cjs.finite(chart.tickLength, 0);
|
|
4344
4368
|
if (lineWidth <= 0 && tickLength <= 0) {
|
|
4345
4369
|
return [];
|
|
4346
4370
|
}
|
|
@@ -4361,20 +4385,20 @@ function buildAxisLines(chart, layout, order) {
|
|
|
4361
4385
|
}
|
|
4362
4386
|
add("line-x", `M ${plot.x} ${bottom} L ${plot.x + plot.width} ${bottom}`);
|
|
4363
4387
|
}
|
|
4364
|
-
if (tickLength > 0 &&
|
|
4365
|
-
|
|
4366
|
-
const x = plot.x +
|
|
4388
|
+
if (tickLength > 0 && chunkQL7MNEMT_cjs.isHorizontalBar(chart)) {
|
|
4389
|
+
chunkQL7MNEMT_cjs.chartTicks(chart.axisY).forEach((tick) => {
|
|
4390
|
+
const x = plot.x + chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisY, plot.width);
|
|
4367
4391
|
add(`tick-v-${tick}`, `M ${x} ${bottom} L ${x} ${bottom + tickLength}`);
|
|
4368
4392
|
});
|
|
4369
|
-
const rows =
|
|
4393
|
+
const rows = chunkQL7MNEMT_cjs.horizontalRows(chart, plot);
|
|
4370
4394
|
for (let index = 0; index < rows.count; index++) {
|
|
4371
|
-
const y =
|
|
4395
|
+
const y = chunkQL7MNEMT_cjs.rowTop(rows, plot, index) + rows.labelRow + rows.barsHeight / 2;
|
|
4372
4396
|
add(`tick-c-${index}`, `M ${plot.x - tickLength} ${y} L ${plot.x} ${y}`);
|
|
4373
4397
|
}
|
|
4374
4398
|
}
|
|
4375
|
-
if (tickLength > 0 && !isHorizontalBoxplot2(chart) && !
|
|
4376
|
-
|
|
4377
|
-
const y = bottom -
|
|
4399
|
+
if (tickLength > 0 && !isHorizontalBoxplot2(chart) && !chunkQL7MNEMT_cjs.isHorizontalBar(chart)) {
|
|
4400
|
+
chunkQL7MNEMT_cjs.chartTicks(chart.axisY).forEach((tick) => {
|
|
4401
|
+
const y = bottom - chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisY, plot.height);
|
|
4378
4402
|
add(`tick-y-${tick}`, `M ${plot.x - tickLength} ${y} L ${plot.x} ${y}`);
|
|
4379
4403
|
});
|
|
4380
4404
|
xTickPositions(chart, layout).forEach((x, index) => {
|
|
@@ -4389,14 +4413,14 @@ function categoryNames(chart, count) {
|
|
|
4389
4413
|
}
|
|
4390
4414
|
function buildHorizontalBarAxes(chart, layout, order) {
|
|
4391
4415
|
const { plot, bounds } = layout;
|
|
4392
|
-
const rows =
|
|
4416
|
+
const rows = chunkQL7MNEMT_cjs.horizontalRows(chart, plot);
|
|
4393
4417
|
const above = chart.categoryAlign === "left";
|
|
4394
4418
|
const inside = chart.categoryAlign === "inside";
|
|
4395
4419
|
const editable = Boolean(chart.config?.categories?.length);
|
|
4396
4420
|
const nodes = categoryNames(chart, rows.count).map((name, index) => {
|
|
4397
|
-
const top =
|
|
4421
|
+
const top = chunkQL7MNEMT_cjs.rowTop(rows, plot, index);
|
|
4398
4422
|
return {
|
|
4399
|
-
...
|
|
4423
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4400
4424
|
role: "axis",
|
|
4401
4425
|
id: `chart-y-category-${chart.id}-${index}`,
|
|
4402
4426
|
order: order + index,
|
|
@@ -4406,19 +4430,19 @@ function buildHorizontalBarAxes(chart, layout, order) {
|
|
|
4406
4430
|
chart,
|
|
4407
4431
|
align: above || inside ? "left" : "right"
|
|
4408
4432
|
}),
|
|
4409
|
-
prop: editable ?
|
|
4433
|
+
prop: editable ? chunkQL7MNEMT_cjs.categoryProp(index) : void 0
|
|
4410
4434
|
};
|
|
4411
4435
|
});
|
|
4412
4436
|
if (chart.showValueAxis !== false) {
|
|
4413
|
-
|
|
4414
|
-
const x = plot.x +
|
|
4437
|
+
chunkQL7MNEMT_cjs.chartTicks(chart.axisY).forEach((tick, index) => {
|
|
4438
|
+
const x = plot.x + chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisY, plot.width);
|
|
4415
4439
|
nodes.push(
|
|
4416
|
-
|
|
4440
|
+
chunkQL7MNEMT_cjs.chartText({
|
|
4417
4441
|
role: "axis",
|
|
4418
4442
|
id: `chart-x-tick-${chart.id}-${tick}`,
|
|
4419
4443
|
order: order + rows.count + index,
|
|
4420
4444
|
bounds,
|
|
4421
|
-
frame: { x: x - 20, y: plot.y + plot.height + 4 +
|
|
4445
|
+
frame: { x: x - 20, y: plot.y + plot.height + 4 + chunkQL7MNEMT_cjs.finite(chart.tickLength, 0), width: 40, height: 18 },
|
|
4422
4446
|
text: String(tick),
|
|
4423
4447
|
chart,
|
|
4424
4448
|
align: "center"
|
|
@@ -4437,7 +4461,7 @@ function buildChartAxes(chart, layout, order) {
|
|
|
4437
4461
|
return lines;
|
|
4438
4462
|
}
|
|
4439
4463
|
order += lines.length;
|
|
4440
|
-
if (
|
|
4464
|
+
if (chunkQL7MNEMT_cjs.isHorizontalBar(chart)) {
|
|
4441
4465
|
return [...lines, ...buildHorizontalBarAxes(chart, layout, order)];
|
|
4442
4466
|
}
|
|
4443
4467
|
const xTicks = buildXAxisTicks(chart, layout, order);
|
|
@@ -4515,7 +4539,7 @@ function buildCircularChartGrid(chart, plot, bounds, order) {
|
|
|
4515
4539
|
const centerX = plot.x + plot.width / 2;
|
|
4516
4540
|
const centerY = plot.y + plot.height / 2;
|
|
4517
4541
|
const radius = Math.max(0, Math.min(plot.width, plot.height) / 2);
|
|
4518
|
-
const width =
|
|
4542
|
+
const width = chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1);
|
|
4519
4543
|
if (chart.gridLineStyle === "dotted") {
|
|
4520
4544
|
return buildDottedCircularGrid(chart, bounds, order, centerX, centerY, radius, width);
|
|
4521
4545
|
}
|
|
@@ -4526,7 +4550,7 @@ function buildCircularChartGrid(chart, plot, bounds, order) {
|
|
|
4526
4550
|
...gridLineDashStyle(chart, width)
|
|
4527
4551
|
};
|
|
4528
4552
|
const nodes = [];
|
|
4529
|
-
|
|
4553
|
+
chunkQL7MNEMT_cjs.chartTicks(chart.axisY).filter((tick) => tick > chart.axisY.min).forEach((tick) => {
|
|
4530
4554
|
const ringRadius = radius * ringRatio(chart, tick);
|
|
4531
4555
|
nodes.push({
|
|
4532
4556
|
type: "ellipse",
|
|
@@ -4540,8 +4564,8 @@ function buildCircularChartGrid(chart, plot, bounds, order) {
|
|
|
4540
4564
|
style
|
|
4541
4565
|
});
|
|
4542
4566
|
});
|
|
4543
|
-
|
|
4544
|
-
const angle =
|
|
4567
|
+
chunkQL7MNEMT_cjs.chartTicks(chart.axisX).forEach((tick) => {
|
|
4568
|
+
const angle = chunkQL7MNEMT_cjs.angleForAxisValue(chart.axisX.min, chart.axisX.max, tick);
|
|
4545
4569
|
const edgeX = centerX + Math.cos(angle) * radius;
|
|
4546
4570
|
const edgeY = centerY + Math.sin(angle) * radius;
|
|
4547
4571
|
nodes.push({
|
|
@@ -4556,13 +4580,13 @@ function buildCircularChartGrid(chart, plot, bounds, order) {
|
|
|
4556
4580
|
return nodes;
|
|
4557
4581
|
}
|
|
4558
4582
|
function buildDottedCircularGrid(chart, bounds, order, centerX, centerY, radius, width) {
|
|
4559
|
-
const yTicks =
|
|
4560
|
-
const xTicks =
|
|
4583
|
+
const yTicks = chunkQL7MNEMT_cjs.chartTicks(chart.axisY).filter((tick) => tick > chart.axisY.min);
|
|
4584
|
+
const xTicks = chunkQL7MNEMT_cjs.chartTicks(chart.axisX);
|
|
4561
4585
|
const nodes = [];
|
|
4562
4586
|
yTicks.forEach((yTick) => {
|
|
4563
4587
|
const ringRadius = radius * ringRatio(chart, yTick);
|
|
4564
4588
|
xTicks.forEach((xTick) => {
|
|
4565
|
-
const angle =
|
|
4589
|
+
const angle = chunkQL7MNEMT_cjs.angleForAxisValue(chart.axisX.min, chart.axisX.max, xTick);
|
|
4566
4590
|
const x = centerX + Math.cos(angle) * ringRadius;
|
|
4567
4591
|
const y = centerY + Math.sin(angle) * ringRadius;
|
|
4568
4592
|
const id = `chart-grid-dot-${chart.id}-${xTick}-${yTick}`;
|
|
@@ -4584,8 +4608,8 @@ function buildChartGrid(chart, plot, bounds, order) {
|
|
|
4584
4608
|
if (chart.gridShape === "circle" && CIRCULAR_GRID_CHART_TYPES.has(chart.chartType)) {
|
|
4585
4609
|
return buildCircularChartGrid(chart, plot, bounds, order);
|
|
4586
4610
|
}
|
|
4587
|
-
const width =
|
|
4588
|
-
if (
|
|
4611
|
+
const width = chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1);
|
|
4612
|
+
if (chunkQL7MNEMT_cjs.isHorizontalBar(chart)) {
|
|
4589
4613
|
return buildHorizontalBarGrid(chart, plot, bounds, order, width);
|
|
4590
4614
|
}
|
|
4591
4615
|
const clip = chart.chartType === "field" ? fieldSurfaceClip(chart, plot) : void 0;
|
|
@@ -4600,8 +4624,8 @@ function buildChartGrid(chart, plot, bounds, order) {
|
|
|
4600
4624
|
clip
|
|
4601
4625
|
};
|
|
4602
4626
|
const nodes = [];
|
|
4603
|
-
(chart.gridAxes === "y" ? [] :
|
|
4604
|
-
const x = plot.x +
|
|
4627
|
+
(chart.gridAxes === "y" ? [] : chunkQL7MNEMT_cjs.chartTicks(chart.axisX)).forEach((tick) => {
|
|
4628
|
+
const x = plot.x + chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisX, plot.width);
|
|
4605
4629
|
nodes.push({
|
|
4606
4630
|
type: "path",
|
|
4607
4631
|
id: `chart-grid-x-${chart.id}-${tick}`,
|
|
@@ -4611,8 +4635,8 @@ function buildChartGrid(chart, plot, bounds, order) {
|
|
|
4611
4635
|
style
|
|
4612
4636
|
});
|
|
4613
4637
|
});
|
|
4614
|
-
(chart.gridAxes === "x" ? [] :
|
|
4615
|
-
const y = plot.y + plot.height -
|
|
4638
|
+
(chart.gridAxes === "x" ? [] : chunkQL7MNEMT_cjs.chartTicks(chart.axisY)).forEach((tick) => {
|
|
4639
|
+
const y = plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisY, plot.height);
|
|
4616
4640
|
nodes.push({
|
|
4617
4641
|
type: "path",
|
|
4618
4642
|
id: `chart-grid-y-${chart.id}-${tick}`,
|
|
@@ -4634,8 +4658,8 @@ function buildHorizontalBarGrid(chart, plot, bounds, order, width) {
|
|
|
4634
4658
|
strokeWidth: width,
|
|
4635
4659
|
...chart.gridLineStyle === "dotted" ? { dash: [0.1, width * 3], lineCap: "round" } : gridLineDashStyle(chart, width)
|
|
4636
4660
|
};
|
|
4637
|
-
return
|
|
4638
|
-
const x = plot.x +
|
|
4661
|
+
return chunkQL7MNEMT_cjs.chartTicks(chart.axisY).map((tick, index) => {
|
|
4662
|
+
const x = plot.x + chunkQL7MNEMT_cjs.mapChartValue(tick, chart.axisY, plot.width);
|
|
4639
4663
|
return {
|
|
4640
4664
|
type: "path",
|
|
4641
4665
|
id: `chart-grid-x-${chart.id}-${tick}`,
|
|
@@ -4647,13 +4671,13 @@ function buildHorizontalBarGrid(chart, plot, bounds, order, width) {
|
|
|
4647
4671
|
});
|
|
4648
4672
|
}
|
|
4649
4673
|
function buildDottedRectGrid(chart, plot, bounds, order, width, clip) {
|
|
4650
|
-
const xTicks =
|
|
4651
|
-
const yTicks =
|
|
4674
|
+
const xTicks = chunkQL7MNEMT_cjs.chartTicks(chart.axisX);
|
|
4675
|
+
const yTicks = chunkQL7MNEMT_cjs.chartTicks(chart.axisY);
|
|
4652
4676
|
const nodes = [];
|
|
4653
4677
|
xTicks.forEach((xTick) => {
|
|
4654
|
-
const x = plot.x +
|
|
4678
|
+
const x = plot.x + chunkQL7MNEMT_cjs.mapChartValue(xTick, chart.axisX, plot.width);
|
|
4655
4679
|
yTicks.forEach((yTick) => {
|
|
4656
|
-
const y = plot.y + plot.height -
|
|
4680
|
+
const y = plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(yTick, chart.axisY, plot.height);
|
|
4657
4681
|
const id = `chart-grid-dot-${chart.id}-${xTick}-${yTick}`;
|
|
4658
4682
|
nodes.push(createGridDot(chart, id, order + nodes.length, bounds, x, y, width, clip));
|
|
4659
4683
|
});
|
|
@@ -4676,7 +4700,7 @@ function createChartRuleMarks(render2) {
|
|
|
4676
4700
|
return {
|
|
4677
4701
|
rule,
|
|
4678
4702
|
color: rule.color || render2.chart.strokeColor || "#475569",
|
|
4679
|
-
y: render2.plot.y + render2.plot.height -
|
|
4703
|
+
y: render2.plot.y + render2.plot.height - chunkQL7MNEMT_cjs.mapChartValue(rule.at, render2.chart.axisY, render2.plot.height),
|
|
4680
4704
|
lineOrder,
|
|
4681
4705
|
labelOrder
|
|
4682
4706
|
};
|
|
@@ -4696,7 +4720,7 @@ function createChartRuleLine(render2, mark) {
|
|
|
4696
4720
|
order: mark.lineOrder,
|
|
4697
4721
|
bounds: render2.bounds,
|
|
4698
4722
|
d: `M ${render2.plot.x} ${mark.y} L ${render2.plot.x + render2.plot.width} ${mark.y}`,
|
|
4699
|
-
prop:
|
|
4723
|
+
prop: chunkQL7MNEMT_cjs.ruleAtProp(mark.rule.id),
|
|
4700
4724
|
propKind: "value",
|
|
4701
4725
|
style: {
|
|
4702
4726
|
fill: { kind: "none" },
|
|
@@ -4707,9 +4731,9 @@ function createChartRuleLine(render2, mark) {
|
|
|
4707
4731
|
};
|
|
4708
4732
|
}
|
|
4709
4733
|
function createChartRuleLabel(render2, mark) {
|
|
4710
|
-
const fontSize = Math.max(9,
|
|
4734
|
+
const fontSize = Math.max(9, chunkQL7MNEMT_cjs.finite(render2.chart.fontSize, 12) - 2);
|
|
4711
4735
|
return {
|
|
4712
|
-
...
|
|
4736
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4713
4737
|
id: `chart-rule-label-${render2.chart.id}-${mark.rule.id}`,
|
|
4714
4738
|
order: mark.labelOrder ?? mark.lineOrder + 1,
|
|
4715
4739
|
bounds: render2.bounds,
|
|
@@ -4718,19 +4742,19 @@ function createChartRuleLabel(render2, mark) {
|
|
|
4718
4742
|
chart: render2.chart
|
|
4719
4743
|
}),
|
|
4720
4744
|
color: mark.color,
|
|
4721
|
-
prop:
|
|
4745
|
+
prop: chunkQL7MNEMT_cjs.ruleTextProp(mark.rule.id)
|
|
4722
4746
|
};
|
|
4723
4747
|
}
|
|
4724
4748
|
|
|
4725
4749
|
// src/renderScene/charts/chartBackdrop.ts
|
|
4726
4750
|
function chartImageRect(chart) {
|
|
4727
|
-
const inset =
|
|
4751
|
+
const inset = chunkQL7MNEMT_cjs.finite(chart.strokeWidth, 1) / 2;
|
|
4728
4752
|
return {
|
|
4729
4753
|
x: chart.x + inset,
|
|
4730
4754
|
y: chart.y + inset,
|
|
4731
4755
|
width: Math.max(1, chart.width - inset * 2),
|
|
4732
4756
|
height: Math.max(1, chart.height - inset * 2),
|
|
4733
|
-
rx: Math.max(0,
|
|
4757
|
+
rx: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.cornerRadius, 12) - inset)
|
|
4734
4758
|
};
|
|
4735
4759
|
}
|
|
4736
4760
|
function buildChartBackdrop(chart, bounds, order) {
|
|
@@ -4772,7 +4796,7 @@ function buildChartBackdrop(chart, bounds, order) {
|
|
|
4772
4796
|
// src/renderScene/charts/renderers/bar/glass.ts
|
|
4773
4797
|
function createGlassBackdropNodes(context, id, d) {
|
|
4774
4798
|
const { chart, bounds, nextOrder } = context;
|
|
4775
|
-
const blur =
|
|
4799
|
+
const blur = chunkQL7MNEMT_cjs.finite(chart.config?.barGlassBlur, 0);
|
|
4776
4800
|
if (blur <= 0 || !chart.fillImage) {
|
|
4777
4801
|
return [];
|
|
4778
4802
|
}
|
|
@@ -4790,7 +4814,7 @@ function createGlassBackdropNodes(context, id, d) {
|
|
|
4790
4814
|
href: chart.fillImage.url,
|
|
4791
4815
|
style: {
|
|
4792
4816
|
blur,
|
|
4793
|
-
saturate:
|
|
4817
|
+
saturate: chunkQL7MNEMT_cjs.finite(chart.config?.barGlassSaturation, 1),
|
|
4794
4818
|
clip: { type: "path", d },
|
|
4795
4819
|
pointerEvents: "none"
|
|
4796
4820
|
}
|
|
@@ -4841,8 +4865,8 @@ function createBarGlowNode(context, id, d, color, glow, bounds = context.bounds)
|
|
|
4841
4865
|
bounds,
|
|
4842
4866
|
d,
|
|
4843
4867
|
style: {
|
|
4844
|
-
fill:
|
|
4845
|
-
shadow: { color:
|
|
4868
|
+
fill: chunkQL7MNEMT_cjs.paint(color, diagnostics, chart.id),
|
|
4869
|
+
shadow: { color: chunkQL7MNEMT_cjs.representativeColor(color, "#ffffff"), opacity: 0.9, blur: glow, dx: 0, dy: 0 },
|
|
4846
4870
|
pointerEvents: "none"
|
|
4847
4871
|
}
|
|
4848
4872
|
};
|
|
@@ -4853,14 +4877,14 @@ function barLabelsEnabled(context) {
|
|
|
4853
4877
|
return context.chart.config?.showBarLabels === true;
|
|
4854
4878
|
}
|
|
4855
4879
|
function resolvePlacement(target, size) {
|
|
4856
|
-
const fits = target.frame.height >= size.height +
|
|
4880
|
+
const fits = target.frame.height >= size.height + chunkQL7MNEMT_cjs.BAR_LABEL.gap * 2;
|
|
4857
4881
|
return target.placement !== "outside" && !fits ? "outside" : target.placement;
|
|
4858
4882
|
}
|
|
4859
4883
|
function labelTop(placement, frame, height) {
|
|
4860
4884
|
if (placement === "outside") {
|
|
4861
|
-
return frame.y - height -
|
|
4885
|
+
return frame.y - height - chunkQL7MNEMT_cjs.BAR_LABEL.gap;
|
|
4862
4886
|
}
|
|
4863
|
-
return placement === "inside" ? frame.y +
|
|
4887
|
+
return placement === "inside" ? frame.y + chunkQL7MNEMT_cjs.BAR_LABEL.gap : frame.y + frame.height / 2 - height / 2;
|
|
4864
4888
|
}
|
|
4865
4889
|
function createPillNode(context, id, box, color) {
|
|
4866
4890
|
const { chart, bounds, diagnostics, nextOrder } = context;
|
|
@@ -4870,11 +4894,11 @@ function createPillNode(context, id, box, color) {
|
|
|
4870
4894
|
id: `${id}-pill`,
|
|
4871
4895
|
order: nextOrder(),
|
|
4872
4896
|
bounds,
|
|
4873
|
-
d:
|
|
4897
|
+
d: chunkQL7MNEMT_cjs.pillPath(box.left, box.top, box.width, box.height),
|
|
4874
4898
|
style: {
|
|
4875
|
-
fill: config?.barLabelPillColor ?
|
|
4876
|
-
stroke:
|
|
4877
|
-
strokeWidth:
|
|
4899
|
+
fill: config?.barLabelPillColor ? chunkQL7MNEMT_cjs.paint(config.barLabelPillColor, diagnostics, chart.id) : { kind: "none" },
|
|
4900
|
+
stroke: chunkQL7MNEMT_cjs.paint(config?.barLabelBorderColor ?? color, diagnostics, chart.id),
|
|
4901
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(config?.barLabelBorderWidth, 1),
|
|
4878
4902
|
pointerEvents: "none"
|
|
4879
4903
|
}
|
|
4880
4904
|
};
|
|
@@ -4883,7 +4907,7 @@ function createTextNode(context, id, box, text, placement, fontSize, color) {
|
|
|
4883
4907
|
const { chart, bounds, nextOrder } = context;
|
|
4884
4908
|
const config = chart.config;
|
|
4885
4909
|
return {
|
|
4886
|
-
...
|
|
4910
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4887
4911
|
id,
|
|
4888
4912
|
order: nextOrder(),
|
|
4889
4913
|
bounds,
|
|
@@ -4904,7 +4928,7 @@ function createAxisValueNode(context, target, text, fontSize) {
|
|
|
4904
4928
|
const config = chart.config;
|
|
4905
4929
|
const top = plot.y + plot.height + 4 + 16 + Math.max(0, chart.tickLength ?? 0);
|
|
4906
4930
|
return {
|
|
4907
|
-
...
|
|
4931
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
4908
4932
|
id: target.id,
|
|
4909
4933
|
order: nextOrder(),
|
|
4910
4934
|
bounds,
|
|
@@ -4913,7 +4937,7 @@ function createAxisValueNode(context, target, text, fontSize) {
|
|
|
4913
4937
|
y: target.frame.y + target.frame.height / 2 - fontSize * 0.6,
|
|
4914
4938
|
width: plot.width - 14,
|
|
4915
4939
|
height: fontSize * 1.2
|
|
4916
|
-
} : { x: plot.x, y: target.frame.y -
|
|
4940
|
+
} : { x: plot.x, y: target.frame.y - chunkQL7MNEMT_cjs.CATEGORY_LABEL_ROW, width: plot.width, height: fontSize * 1.2 } : { x: target.frame.x, y: top, width: target.frame.width, height: fontSize * 1.2 },
|
|
4917
4941
|
text,
|
|
4918
4942
|
chart,
|
|
4919
4943
|
align: target.horizontal ? "right" : chart.categoryAlign === "left" ? "left" : "center"
|
|
@@ -4927,24 +4951,24 @@ function createAxisValueNode(context, target, text, fontSize) {
|
|
|
4927
4951
|
}
|
|
4928
4952
|
function horizontalPlacement(target, size) {
|
|
4929
4953
|
const requested = target.placement === "axis" ? "outside" : target.placement;
|
|
4930
|
-
const fits = target.frame.width >= size.width +
|
|
4954
|
+
const fits = target.frame.width >= size.width + chunkQL7MNEMT_cjs.BAR_LABEL.gap * 2;
|
|
4931
4955
|
return requested !== "outside" && !fits ? "outside" : requested;
|
|
4932
4956
|
}
|
|
4933
4957
|
function horizontalBox(target, size, placement) {
|
|
4934
4958
|
const { frame } = target;
|
|
4935
|
-
const left = placement === "outside" ? frame.x + frame.width +
|
|
4959
|
+
const left = placement === "outside" ? frame.x + frame.width + chunkQL7MNEMT_cjs.BAR_LABEL.gap : placement === "inside" ? frame.x + frame.width - size.width - chunkQL7MNEMT_cjs.BAR_LABEL.gap : frame.x + frame.width / 2 - size.width / 2;
|
|
4936
4960
|
return { ...size, left, top: frame.y + frame.height / 2 - size.height / 2 };
|
|
4937
4961
|
}
|
|
4938
4962
|
function createBarLabelNodes(context, target) {
|
|
4939
4963
|
const { chart } = context;
|
|
4940
4964
|
const config = chart.config;
|
|
4941
|
-
const fontSize = Math.max(8,
|
|
4942
|
-
const text =
|
|
4965
|
+
const fontSize = Math.max(8, chunkQL7MNEMT_cjs.finite(config?.barLabelFontSize, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12)));
|
|
4966
|
+
const text = chunkQL7MNEMT_cjs.formatBarLabel(target.value, config?.barLabelFormat);
|
|
4943
4967
|
if (target.placement === "axis") {
|
|
4944
4968
|
return [createAxisValueNode(context, target, text, fontSize)];
|
|
4945
4969
|
}
|
|
4946
4970
|
const pill = config?.barLabelPill === true;
|
|
4947
|
-
const size =
|
|
4971
|
+
const size = chunkQL7MNEMT_cjs.barLabelSize(text, fontSize, pill);
|
|
4948
4972
|
const placement = target.horizontal ? horizontalPlacement(target, size) : resolvePlacement(target, size);
|
|
4949
4973
|
const box = target.horizontal ? horizontalBox(target, size, placement) : {
|
|
4950
4974
|
...size,
|
|
@@ -4985,7 +5009,7 @@ function barTrackClip(context, frame) {
|
|
|
4985
5009
|
}
|
|
4986
5010
|
return {
|
|
4987
5011
|
type: "path",
|
|
4988
|
-
d:
|
|
5012
|
+
d: chunkQL7MNEMT_cjs.roundedBarPath(frame.x, frame.y, frame.width, frame.height, context.chart.config?.barCornerRadius ?? 2)
|
|
4989
5013
|
};
|
|
4990
5014
|
}
|
|
4991
5015
|
function barTrackEnabled(context) {
|
|
@@ -4995,8 +5019,8 @@ function createBarTrackNodes(context, id, frame, orientation = "vertical") {
|
|
|
4995
5019
|
const { chart, bounds, diagnostics, nextOrder } = context;
|
|
4996
5020
|
const config = chart.config;
|
|
4997
5021
|
const radius = config?.barCornerRadius ?? 2;
|
|
4998
|
-
const segments =
|
|
4999
|
-
const d = segments > 0 ?
|
|
5022
|
+
const segments = chunkQL7MNEMT_cjs.finite(config?.barSegments, 0);
|
|
5023
|
+
const d = segments > 0 ? chunkQL7MNEMT_cjs.segmentedBarPath(frame, orientation, segments, chunkQL7MNEMT_cjs.finite(config?.barSegmentGap, 4), radius, 1, true) : chunkQL7MNEMT_cjs.roundedBarPath(frame.x, frame.y, frame.width, frame.height, radius);
|
|
5000
5024
|
const nodes = [
|
|
5001
5025
|
{
|
|
5002
5026
|
type: "path",
|
|
@@ -5005,7 +5029,7 @@ function createBarTrackNodes(context, id, frame, orientation = "vertical") {
|
|
|
5005
5029
|
bounds,
|
|
5006
5030
|
d,
|
|
5007
5031
|
style: {
|
|
5008
|
-
fill:
|
|
5032
|
+
fill: chunkQL7MNEMT_cjs.paint(config?.barTrackColor ?? chart.gridColor ?? "#e2e8f0", diagnostics, chart.id),
|
|
5009
5033
|
pointerEvents: "none"
|
|
5010
5034
|
}
|
|
5011
5035
|
}
|
|
@@ -5021,13 +5045,13 @@ function createBarTrackNodes(context, id, frame, orientation = "vertical") {
|
|
|
5021
5045
|
frame.y,
|
|
5022
5046
|
frame.width,
|
|
5023
5047
|
frame.height,
|
|
5024
|
-
|
|
5025
|
-
Math.max(MIN_HATCH_SPACING,
|
|
5048
|
+
chunkQL7MNEMT_cjs.finite(config.barTrackHatchAngle, DEFAULT_HATCH.angle),
|
|
5049
|
+
Math.max(MIN_HATCH_SPACING, chunkQL7MNEMT_cjs.finite(config.barTrackHatchSpacing, DEFAULT_HATCH.spacing))
|
|
5026
5050
|
),
|
|
5027
5051
|
style: {
|
|
5028
5052
|
fill: { kind: "none" },
|
|
5029
|
-
stroke:
|
|
5030
|
-
strokeWidth:
|
|
5053
|
+
stroke: chunkQL7MNEMT_cjs.paint(config.barTrackHatchColor ?? chart.gridColor ?? "#cbd5e1", diagnostics, chart.id),
|
|
5054
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(config.barTrackHatchWidth, DEFAULT_HATCH.width),
|
|
5031
5055
|
pointerEvents: "none",
|
|
5032
5056
|
clip: { type: "path", d }
|
|
5033
5057
|
}
|
|
@@ -5074,23 +5098,23 @@ function groupedShape(context, frame) {
|
|
|
5074
5098
|
const { chart, plot } = context;
|
|
5075
5099
|
const config = chart.config;
|
|
5076
5100
|
const radius = config?.barCornerRadius ?? 2;
|
|
5077
|
-
const segments =
|
|
5101
|
+
const segments = chunkQL7MNEMT_cjs.finite(config?.barSegments, 0);
|
|
5078
5102
|
if (segments > 0) {
|
|
5079
|
-
return
|
|
5103
|
+
return chunkQL7MNEMT_cjs.segmentedBarPath(
|
|
5080
5104
|
{ x: frame.x, y: plot.y, width: frame.width, height: plot.height },
|
|
5081
5105
|
"vertical",
|
|
5082
5106
|
segments,
|
|
5083
|
-
|
|
5107
|
+
chunkQL7MNEMT_cjs.finite(config?.barSegmentGap, 4),
|
|
5084
5108
|
radius,
|
|
5085
5109
|
frame.height / plot.height,
|
|
5086
5110
|
config?.barSegmentSnap !== false
|
|
5087
5111
|
);
|
|
5088
5112
|
}
|
|
5089
|
-
return
|
|
5113
|
+
return chunkQL7MNEMT_cjs.barPath(frame.x, frame.y, frame.width, frame.height, radius, config?.barRoundedBottom === true);
|
|
5090
5114
|
}
|
|
5091
5115
|
function createGroupedGlow(context, mark) {
|
|
5092
5116
|
const { chart } = context;
|
|
5093
|
-
const glow =
|
|
5117
|
+
const glow = chunkQL7MNEMT_cjs.finite(chart.config?.barGlow, 0);
|
|
5094
5118
|
if (glow <= 0 || mark.frame.height <= 0) {
|
|
5095
5119
|
return [];
|
|
5096
5120
|
}
|
|
@@ -5101,10 +5125,10 @@ function createGroupedGlow(context, mark) {
|
|
|
5101
5125
|
}
|
|
5102
5126
|
function createGroupedBarLayout(context) {
|
|
5103
5127
|
const { chart, plot } = context;
|
|
5104
|
-
const valueCount =
|
|
5128
|
+
const valueCount = chunkQL7MNEMT_cjs.barCategoryCount(chart);
|
|
5105
5129
|
const slotWidth = plot.width / valueCount;
|
|
5106
|
-
const groupGap = Math.min(Math.max(0,
|
|
5107
|
-
const barGap = Math.max(0,
|
|
5130
|
+
const groupGap = Math.min(Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.barGroupGap, 8)), Math.max(0, slotWidth - 1));
|
|
5131
|
+
const barGap = Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.barGap, 2));
|
|
5108
5132
|
return {
|
|
5109
5133
|
slotWidth,
|
|
5110
5134
|
seriesWidth: Math.max(1, (slotWidth - groupGap) / Math.max(1, chart.series.length)),
|
|
@@ -5114,10 +5138,10 @@ function createGroupedBarLayout(context) {
|
|
|
5114
5138
|
}
|
|
5115
5139
|
function createSeriesBarMarks(context, layout, series, seriesIndex) {
|
|
5116
5140
|
const { chart, plot } = context;
|
|
5117
|
-
const seriesColor2 = series.color ??
|
|
5141
|
+
const seriesColor2 = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
5118
5142
|
return series.values.map((value, valueIndex) => {
|
|
5119
5143
|
const numericValue = Array.isArray(value) ? value[1] : value;
|
|
5120
|
-
const height = Math.max(0,
|
|
5144
|
+
const height = Math.max(0, chunkQL7MNEMT_cjs.mapChartValue(numericValue, chart.axisY, plot.height));
|
|
5121
5145
|
return {
|
|
5122
5146
|
seriesId: series.id,
|
|
5123
5147
|
valueIndex,
|
|
@@ -5151,10 +5175,10 @@ function createGroupedBarNodes(context, mark) {
|
|
|
5151
5175
|
const radius = chart.config?.barCornerRadius ?? 2;
|
|
5152
5176
|
const { x, width } = mark.frame;
|
|
5153
5177
|
const path = groupedShape(context, mark.frame);
|
|
5154
|
-
const fill2 =
|
|
5155
|
-
const stroke =
|
|
5156
|
-
const strokeWidth =
|
|
5157
|
-
const shadow =
|
|
5178
|
+
const fill2 = chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id);
|
|
5179
|
+
const stroke = chunkQL7MNEMT_cjs.paint(chart.config?.barBorderColor || "#000000", diagnostics, chart.id);
|
|
5180
|
+
const strokeWidth = chunkQL7MNEMT_cjs.finite(chart.config?.barBorderWidth, 0);
|
|
5181
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
5158
5182
|
const shadowCaster = shadow ? {
|
|
5159
5183
|
type: "path",
|
|
5160
5184
|
id: `chart-bar-shadow-${chart.id}-${mark.seriesId}-${mark.valueIndex}`,
|
|
@@ -5184,10 +5208,10 @@ function createGroupedBarNodes(context, mark) {
|
|
|
5184
5208
|
valueIndex: mark.valueIndex,
|
|
5185
5209
|
mark: "bar",
|
|
5186
5210
|
radius,
|
|
5187
|
-
colorProp:
|
|
5211
|
+
colorProp: chunkQL7MNEMT_cjs.seriesValueColorProp(mark.seriesId, mark.valueIndex),
|
|
5188
5212
|
hasColorOverride: mark.hasColorOverride
|
|
5189
5213
|
},
|
|
5190
|
-
prop:
|
|
5214
|
+
prop: chunkQL7MNEMT_cjs.seriesValueProp(mark.seriesId, mark.valueIndex),
|
|
5191
5215
|
style: { fill: fill2, stroke, strokeWidth, innerShadow: shadow }
|
|
5192
5216
|
};
|
|
5193
5217
|
const glass = createGlassBackdropNodes(context, `${mark.seriesId}-${mark.valueIndex}`, path);
|
|
@@ -5198,15 +5222,15 @@ function createGroupedBarError(context, mark) {
|
|
|
5198
5222
|
return null;
|
|
5199
5223
|
}
|
|
5200
5224
|
const { chart, plot, bounds, nextOrder } = context;
|
|
5201
|
-
const [lower, upper] =
|
|
5202
|
-
return
|
|
5225
|
+
const [lower, upper] = chunkQL7MNEMT_cjs.errorBarRange(mark.value, mark.error);
|
|
5226
|
+
return chunkQL7MNEMT_cjs.createVerticalErrorWhiskerNode({
|
|
5203
5227
|
id: `chart-bar-error-${chart.id}-${mark.seriesId}-${mark.valueIndex}`,
|
|
5204
5228
|
order: nextOrder(),
|
|
5205
5229
|
bounds,
|
|
5206
5230
|
geometry: {
|
|
5207
5231
|
centerX: mark.frame.x + mark.frame.width / 2,
|
|
5208
|
-
startY: plot.y + plot.height -
|
|
5209
|
-
endY: plot.y + plot.height -
|
|
5232
|
+
startY: plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(lower, chart.axisY, plot.height),
|
|
5233
|
+
endY: plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(upper, chart.axisY, plot.height)
|
|
5210
5234
|
},
|
|
5211
5235
|
color: chart.textColor ?? "#0f172a",
|
|
5212
5236
|
valueReference: { seriesId: mark.seriesId, valueIndex: mark.valueIndex }
|
|
@@ -5216,9 +5240,9 @@ function createGroupedBarError(context, mark) {
|
|
|
5216
5240
|
// src/renderScene/charts/renderers/bar/horizontal.ts
|
|
5217
5241
|
function barFrame(context, rows, seriesIndex, valueIndex, value) {
|
|
5218
5242
|
const { chart, plot } = context;
|
|
5219
|
-
const top =
|
|
5243
|
+
const top = chunkQL7MNEMT_cjs.rowTop(rows, plot, valueIndex) + rows.labelRow;
|
|
5220
5244
|
if (context.stackedMode) {
|
|
5221
|
-
const segment =
|
|
5245
|
+
const segment = chunkQL7MNEMT_cjs.stackedSegment(chart, context.stackedMode, valueIndex, seriesIndex, plot.width);
|
|
5222
5246
|
const start = Math.min(segment.pixelStart, segment.pixelEnd);
|
|
5223
5247
|
return {
|
|
5224
5248
|
x: plot.x + start,
|
|
@@ -5227,27 +5251,27 @@ function barFrame(context, rows, seriesIndex, valueIndex, value) {
|
|
|
5227
5251
|
height: rows.barsHeight
|
|
5228
5252
|
};
|
|
5229
5253
|
}
|
|
5230
|
-
const barGap = Math.max(0,
|
|
5254
|
+
const barGap = Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.barGap, 2));
|
|
5231
5255
|
const seriesHeight = rows.barsHeight / Math.max(1, chart.series.length);
|
|
5232
|
-
const width = Math.max(0,
|
|
5256
|
+
const width = Math.max(0, chunkQL7MNEMT_cjs.mapChartValue(value, chart.axisY, plot.width));
|
|
5233
5257
|
return { x: plot.x, y: top + seriesIndex * seriesHeight, width, height: Math.max(1, seriesHeight - barGap) };
|
|
5234
5258
|
}
|
|
5235
5259
|
function barPath2(context, frame) {
|
|
5236
5260
|
const { chart, plot } = context;
|
|
5237
5261
|
const config = chart.config;
|
|
5238
|
-
const segments = context.stackedMode && chart.series.length > 1 ? 0 :
|
|
5262
|
+
const segments = context.stackedMode && chart.series.length > 1 ? 0 : chunkQL7MNEMT_cjs.finite(config?.barSegments, 0);
|
|
5239
5263
|
if (segments > 0) {
|
|
5240
|
-
return
|
|
5264
|
+
return chunkQL7MNEMT_cjs.segmentedBarPath(
|
|
5241
5265
|
{ x: plot.x, y: frame.y, width: plot.width, height: frame.height },
|
|
5242
5266
|
"horizontal",
|
|
5243
5267
|
segments,
|
|
5244
|
-
|
|
5268
|
+
chunkQL7MNEMT_cjs.finite(config?.barSegmentGap, 4),
|
|
5245
5269
|
config?.barCornerRadius ?? 2,
|
|
5246
5270
|
frame.width / plot.width,
|
|
5247
5271
|
config?.barSegmentSnap !== false
|
|
5248
5272
|
);
|
|
5249
5273
|
}
|
|
5250
|
-
return
|
|
5274
|
+
return chunkQL7MNEMT_cjs.roundedBarPath(frame.x, frame.y, frame.width, frame.height, config?.barCornerRadius ?? 2);
|
|
5251
5275
|
}
|
|
5252
5276
|
function markOf(context, rows, series, seriesIndex, valueIndex, value) {
|
|
5253
5277
|
const { plot } = context;
|
|
@@ -5267,16 +5291,16 @@ function markOf(context, rows, series, seriesIndex, valueIndex, value) {
|
|
|
5267
5291
|
maxY: frame.y + frame.height
|
|
5268
5292
|
},
|
|
5269
5293
|
path: barPath2(context, frame),
|
|
5270
|
-
color: series.colors?.[valueIndex] ?? series.color ??
|
|
5294
|
+
color: series.colors?.[valueIndex] ?? series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length]
|
|
5271
5295
|
};
|
|
5272
5296
|
}
|
|
5273
5297
|
function barNodes(context, mark) {
|
|
5274
5298
|
const { chart, diagnostics, nextOrder } = context;
|
|
5275
5299
|
const config = chart.config;
|
|
5276
|
-
const stroke =
|
|
5277
|
-
const strokeWidth =
|
|
5278
|
-
const shadow =
|
|
5279
|
-
const fill2 =
|
|
5300
|
+
const stroke = chunkQL7MNEMT_cjs.paint(config?.barBorderColor || "#000000", diagnostics, chart.id);
|
|
5301
|
+
const strokeWidth = chunkQL7MNEMT_cjs.finite(config?.barBorderWidth, 0);
|
|
5302
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
5303
|
+
const fill2 = chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id);
|
|
5280
5304
|
const nodes = [...createGlassBackdropNodes(context, mark.id, mark.path)];
|
|
5281
5305
|
if (shadow) {
|
|
5282
5306
|
nodes.push({
|
|
@@ -5300,7 +5324,7 @@ function barNodes(context, mark) {
|
|
|
5300
5324
|
valueIndex: mark.valueIndex,
|
|
5301
5325
|
mark: "bar",
|
|
5302
5326
|
radius: config?.barCornerRadius ?? 2,
|
|
5303
|
-
colorProp:
|
|
5327
|
+
colorProp: chunkQL7MNEMT_cjs.seriesValueColorProp(mark.series.id, mark.valueIndex),
|
|
5304
5328
|
hasColorOverride: mark.series.colors?.[mark.valueIndex] != null
|
|
5305
5329
|
},
|
|
5306
5330
|
style: { fill: fill2, stroke, strokeWidth, innerShadow: shadow }
|
|
@@ -5330,7 +5354,7 @@ function pushBar(context, rows, layers, series, seriesIndex, valueIndex, value,
|
|
|
5330
5354
|
layers.tracks.push(...createBarTrackNodes(context, mark.id, mark.trackFrame, "horizontal"));
|
|
5331
5355
|
}
|
|
5332
5356
|
layers.bars.push(...barNodes(context, mark));
|
|
5333
|
-
const glow =
|
|
5357
|
+
const glow = chunkQL7MNEMT_cjs.finite(chart.config?.barGlow, 0);
|
|
5334
5358
|
if (glow > 0 && mark.frame.width > 0) {
|
|
5335
5359
|
layers.glows.push(
|
|
5336
5360
|
createBarGlowNode(context, `chart-bar-glow-${chart.id}-${mark.id}`, mark.path, mark.color, glow, mark.bounds)
|
|
@@ -5339,7 +5363,7 @@ function pushBar(context, rows, layers, series, seriesIndex, valueIndex, value,
|
|
|
5339
5363
|
layers.labels.push(...labelNodes2(context, mark, highest));
|
|
5340
5364
|
}
|
|
5341
5365
|
function renderHorizontalBars(context) {
|
|
5342
|
-
const rows =
|
|
5366
|
+
const rows = chunkQL7MNEMT_cjs.horizontalRows(context.chart, context.plot);
|
|
5343
5367
|
const layers = { tracks: [], bars: [], glows: [], labels: [] };
|
|
5344
5368
|
context.chart.series.forEach((series, seriesIndex) => {
|
|
5345
5369
|
const numeric = series.values.map((value) => typeof value === "number" ? value : value[1]);
|
|
@@ -5354,8 +5378,8 @@ function renderHorizontalBars(context) {
|
|
|
5354
5378
|
// src/renderScene/charts/renderers/bar/stacked.ts
|
|
5355
5379
|
function slotOf(context, mode) {
|
|
5356
5380
|
const { chart, plot } = context;
|
|
5357
|
-
const slotWidth = plot.width /
|
|
5358
|
-
const groupGap = Math.min(Math.max(0,
|
|
5381
|
+
const slotWidth = plot.width / chunkQL7MNEMT_cjs.barCategoryCount(chart);
|
|
5382
|
+
const groupGap = Math.min(Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.barGroupGap, 8)), Math.max(0, slotWidth - 1));
|
|
5359
5383
|
return {
|
|
5360
5384
|
slotWidth,
|
|
5361
5385
|
groupGap,
|
|
@@ -5366,19 +5390,19 @@ function slotOf(context, mode) {
|
|
|
5366
5390
|
}
|
|
5367
5391
|
function pathOf(context, x, y, height, slot, radius) {
|
|
5368
5392
|
const { chart, plot } = context;
|
|
5369
|
-
const segments = chart.series.length === 1 ?
|
|
5393
|
+
const segments = chart.series.length === 1 ? chunkQL7MNEMT_cjs.finite(chart.config?.barSegments, 0) : 0;
|
|
5370
5394
|
if (segments > 0) {
|
|
5371
|
-
return
|
|
5395
|
+
return chunkQL7MNEMT_cjs.segmentedBarPath(
|
|
5372
5396
|
{ x, y: plot.y, width: slot.barWidth, height: plot.height },
|
|
5373
5397
|
"vertical",
|
|
5374
5398
|
segments,
|
|
5375
|
-
|
|
5399
|
+
chunkQL7MNEMT_cjs.finite(chart.config?.barSegmentGap, 4),
|
|
5376
5400
|
radius,
|
|
5377
5401
|
height / plot.height,
|
|
5378
5402
|
chart.config?.barSegmentSnap !== false
|
|
5379
5403
|
);
|
|
5380
5404
|
}
|
|
5381
|
-
return
|
|
5405
|
+
return chunkQL7MNEMT_cjs.barPath(x, y, slot.barWidth, height, radius, chart.config?.barRoundedBottom === true);
|
|
5382
5406
|
}
|
|
5383
5407
|
function pushLabel(context, layers, series, seriesIndex, valueIndex, slot, frame) {
|
|
5384
5408
|
const { chart } = context;
|
|
@@ -5400,7 +5424,7 @@ function pushLabel(context, layers, series, seriesIndex, valueIndex, slot, frame
|
|
|
5400
5424
|
}
|
|
5401
5425
|
function markOf2(context, mode, slot, series, seriesIndex, valueIndex) {
|
|
5402
5426
|
const { chart, plot } = context;
|
|
5403
|
-
const segment =
|
|
5427
|
+
const segment = chunkQL7MNEMT_cjs.stackedSegment(chart, mode, valueIndex, seriesIndex, plot.height);
|
|
5404
5428
|
const radius = slot.outerSeriesIndex === null || seriesIndex === slot.outerSeriesIndex ? slot.cornerRadius : 0;
|
|
5405
5429
|
const x = plot.x + valueIndex * slot.slotWidth + slot.groupGap / 2;
|
|
5406
5430
|
const y = plot.y + plot.height - Math.max(segment.pixelStart, segment.pixelEnd);
|
|
@@ -5409,7 +5433,7 @@ function markOf2(context, mode, slot, series, seriesIndex, valueIndex) {
|
|
|
5409
5433
|
series,
|
|
5410
5434
|
valueIndex,
|
|
5411
5435
|
radius,
|
|
5412
|
-
color: series.colors?.[valueIndex] ?? series.color ??
|
|
5436
|
+
color: series.colors?.[valueIndex] ?? series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length],
|
|
5413
5437
|
x,
|
|
5414
5438
|
y,
|
|
5415
5439
|
height,
|
|
@@ -5420,10 +5444,10 @@ function markOf2(context, mode, slot, series, seriesIndex, valueIndex) {
|
|
|
5420
5444
|
function segmentNodes(context, mark) {
|
|
5421
5445
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
5422
5446
|
const { series, valueIndex, path } = mark;
|
|
5423
|
-
const fill2 =
|
|
5424
|
-
const stroke =
|
|
5425
|
-
const strokeWidth =
|
|
5426
|
-
const shadow =
|
|
5447
|
+
const fill2 = chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id);
|
|
5448
|
+
const stroke = chunkQL7MNEMT_cjs.paint(chart.config?.barBorderColor || "#000000", diagnostics, chart.id);
|
|
5449
|
+
const strokeWidth = chunkQL7MNEMT_cjs.finite(chart.config?.barBorderWidth, 0);
|
|
5450
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
5427
5451
|
const nodes = [];
|
|
5428
5452
|
if (shadow) {
|
|
5429
5453
|
const plotClip = `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z`;
|
|
@@ -5455,10 +5479,10 @@ function segmentNodes(context, mark) {
|
|
|
5455
5479
|
valueIndex,
|
|
5456
5480
|
mark: "bar",
|
|
5457
5481
|
radius: mark.radius,
|
|
5458
|
-
colorProp:
|
|
5482
|
+
colorProp: chunkQL7MNEMT_cjs.seriesValueColorProp(series.id, valueIndex),
|
|
5459
5483
|
hasColorOverride: series.colors?.[valueIndex] != null
|
|
5460
5484
|
},
|
|
5461
|
-
prop:
|
|
5485
|
+
prop: chunkQL7MNEMT_cjs.seriesValueProp(series.id, valueIndex),
|
|
5462
5486
|
style: { fill: fill2, stroke, strokeWidth, innerShadow: shadow }
|
|
5463
5487
|
});
|
|
5464
5488
|
return nodes;
|
|
@@ -5472,7 +5496,7 @@ function pushSegment(context, mode, layers, slot, series, seriesIndex, valueInde
|
|
|
5472
5496
|
layers.bars.push(...segmentNodes(context, mark));
|
|
5473
5497
|
const frame = { x: mark.x, y: mark.y, width: slot.barWidth, height: mark.height };
|
|
5474
5498
|
pushLabel(context, layers, series, seriesIndex, valueIndex, slot, frame);
|
|
5475
|
-
const glow =
|
|
5499
|
+
const glow = chunkQL7MNEMT_cjs.finite(chart.config?.barGlow, 0);
|
|
5476
5500
|
if (glow > 0) {
|
|
5477
5501
|
layers.glows.push(
|
|
5478
5502
|
createBarGlowNode(context, `chart-bar-glow-${chart.id}-${series.id}-${valueIndex}`, mark.path, mark.color, glow)
|
|
@@ -5483,7 +5507,7 @@ function renderStackedBars(context, mode) {
|
|
|
5483
5507
|
const { chart } = context;
|
|
5484
5508
|
const layers = { tracks: [], bars: [], glows: [], labels: [] };
|
|
5485
5509
|
const slot = slotOf(context, mode);
|
|
5486
|
-
const valueCount =
|
|
5510
|
+
const valueCount = chunkQL7MNEMT_cjs.barCategoryCount(chart);
|
|
5487
5511
|
for (let valueIndex = 0; valueIndex < valueCount; valueIndex++) {
|
|
5488
5512
|
chart.series.forEach((series, seriesIndex) => {
|
|
5489
5513
|
pushSegment(context, mode, layers, slot, series, seriesIndex, valueIndex);
|
|
@@ -5498,7 +5522,7 @@ function isSeriesMax2(values, index) {
|
|
|
5498
5522
|
|
|
5499
5523
|
// src/renderScene/charts/renderers/bar.ts
|
|
5500
5524
|
function renderBar(context) {
|
|
5501
|
-
if (
|
|
5525
|
+
if (chunkQL7MNEMT_cjs.isHorizontalBar(context.chart)) {
|
|
5502
5526
|
return renderHorizontalBars(context);
|
|
5503
5527
|
}
|
|
5504
5528
|
if (context.stackedMode) {
|
|
@@ -5513,7 +5537,7 @@ function createBoxplotLayout(context) {
|
|
|
5513
5537
|
const orientation = chart.config?.orientation ?? "vertical";
|
|
5514
5538
|
const boxCount = Math.max(1, chart.series.length);
|
|
5515
5539
|
const slotWidth = (orientation === "horizontal" ? plot.height : plot.width) / boxCount;
|
|
5516
|
-
const borderColor =
|
|
5540
|
+
const borderColor = chunkQL7MNEMT_cjs.representativeColor(chart.config?.barBorderColor, "#000000");
|
|
5517
5541
|
const widthFraction = Math.min(1, Math.max(0.05, chart.config?.boxWidth ?? 0.6));
|
|
5518
5542
|
return {
|
|
5519
5543
|
orientation,
|
|
@@ -5522,15 +5546,15 @@ function createBoxplotLayout(context) {
|
|
|
5522
5546
|
cornerRadius: chart.config?.barCornerRadius ?? 2,
|
|
5523
5547
|
showPoints: chart.config?.showBoxplotPoints ?? true,
|
|
5524
5548
|
borderColor,
|
|
5525
|
-
borderWidth:
|
|
5526
|
-
whiskerWidth: Math.max(0,
|
|
5527
|
-
medianWidth: Math.max(0,
|
|
5549
|
+
borderWidth: chunkQL7MNEMT_cjs.finite(chart.config?.barBorderWidth, 1),
|
|
5550
|
+
whiskerWidth: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.boxWhiskerWidth, 1)),
|
|
5551
|
+
medianWidth: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.boxMedianWidth, 2)),
|
|
5528
5552
|
medianColor: chart.config?.boxMedianColor ?? borderColor,
|
|
5529
5553
|
whiskerColor: chart.config?.boxWhiskerColor,
|
|
5530
|
-
capSize: Math.max(0,
|
|
5531
|
-
pointSize: Math.max(0,
|
|
5532
|
-
pointOpacity: Math.min(1, Math.max(0,
|
|
5533
|
-
jitter: Math.max(0,
|
|
5554
|
+
capSize: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.boxCapSize, 0.4)),
|
|
5555
|
+
pointSize: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.boxPointSize, 3)),
|
|
5556
|
+
pointOpacity: Math.min(1, Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.boxPointOpacity, 0.7))),
|
|
5557
|
+
jitter: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.boxJitter, 1))
|
|
5534
5558
|
};
|
|
5535
5559
|
}
|
|
5536
5560
|
|
|
@@ -5541,7 +5565,7 @@ function boxplotPoint(orientation, center, value) {
|
|
|
5541
5565
|
function createBoxplotGeometry(context, layout, seriesIndex, stats) {
|
|
5542
5566
|
const { chart, plot } = context;
|
|
5543
5567
|
const { orientation } = layout;
|
|
5544
|
-
const valueAt = (value) => orientation === "horizontal" ? plot.x +
|
|
5568
|
+
const valueAt = (value) => orientation === "horizontal" ? plot.x + chunkQL7MNEMT_cjs.mapChartValue(value, chart.axisX, plot.width) : plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(value, chart.axisY, plot.height);
|
|
5545
5569
|
const center = plot[orientation === "horizontal" ? "y" : "x"] + seriesIndex * layout.slotWidth + layout.slotWidth / 2;
|
|
5546
5570
|
return {
|
|
5547
5571
|
center,
|
|
@@ -5556,7 +5580,7 @@ function createBoxplotGeometry(context, layout, seriesIndex, stats) {
|
|
|
5556
5580
|
// src/renderScene/charts/renderers/boxplot/points.ts
|
|
5557
5581
|
function renderSamplePoints(context, layout, mark) {
|
|
5558
5582
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
5559
|
-
const valueAt = (value) => layout.orientation === "horizontal" ? plot.x +
|
|
5583
|
+
const valueAt = (value) => layout.orientation === "horizontal" ? plot.x + chunkQL7MNEMT_cjs.mapChartValue(value, chart.axisX, plot.width) : plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(value, chart.axisY, plot.height);
|
|
5560
5584
|
if (layout.pointSize <= 0) {
|
|
5561
5585
|
return [];
|
|
5562
5586
|
}
|
|
@@ -5572,7 +5596,7 @@ function renderSamplePoints(context, layout, mark) {
|
|
|
5572
5596
|
cy: y,
|
|
5573
5597
|
rx: layout.pointSize,
|
|
5574
5598
|
ry: layout.pointSize,
|
|
5575
|
-
style: { fill:
|
|
5599
|
+
style: { fill: chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id), opacity: layout.pointOpacity }
|
|
5576
5600
|
};
|
|
5577
5601
|
});
|
|
5578
5602
|
}
|
|
@@ -5596,7 +5620,7 @@ function renderBoxAndWhiskers(context, layout, mark) {
|
|
|
5596
5620
|
}
|
|
5597
5621
|
function whiskerColor(layout, mark) {
|
|
5598
5622
|
if (layout.whiskerColor === "series") {
|
|
5599
|
-
return
|
|
5623
|
+
return chunkQL7MNEMT_cjs.representativeColor(mark.color, layout.borderColor);
|
|
5600
5624
|
}
|
|
5601
5625
|
return layout.whiskerColor;
|
|
5602
5626
|
}
|
|
@@ -5678,7 +5702,7 @@ function createBoxNode(context, layout, mark) {
|
|
|
5678
5702
|
height,
|
|
5679
5703
|
rx: layout.cornerRadius,
|
|
5680
5704
|
style: {
|
|
5681
|
-
fill:
|
|
5705
|
+
fill: chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id),
|
|
5682
5706
|
stroke: { kind: "solid", color: layout.borderColor },
|
|
5683
5707
|
strokeWidth: layout.borderWidth
|
|
5684
5708
|
}
|
|
@@ -5687,12 +5711,12 @@ function createBoxNode(context, layout, mark) {
|
|
|
5687
5711
|
|
|
5688
5712
|
// src/renderScene/charts/renderers/boxplot/series.ts
|
|
5689
5713
|
function renderBoxplotSeries(context, layout, series, seriesIndex) {
|
|
5690
|
-
const stats =
|
|
5714
|
+
const stats = chunkQL7MNEMT_cjs.computeBoxplotStats(series.values);
|
|
5691
5715
|
if (!stats) {
|
|
5692
5716
|
return [];
|
|
5693
5717
|
}
|
|
5694
5718
|
const geometry = createBoxplotGeometry(context, layout, seriesIndex, stats);
|
|
5695
|
-
const color = series.color ??
|
|
5719
|
+
const color = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
5696
5720
|
const mark = {
|
|
5697
5721
|
id: `${context.chart.id}-${series.id}`,
|
|
5698
5722
|
series,
|
|
@@ -5754,21 +5778,21 @@ function metricComponent(chart, point) {
|
|
|
5754
5778
|
}
|
|
5755
5779
|
function customPointPosition(context, value) {
|
|
5756
5780
|
return {
|
|
5757
|
-
x: context.plot.x +
|
|
5758
|
-
y: context.plot.y + context.plot.height -
|
|
5781
|
+
x: context.plot.x + chunkQL7MNEMT_cjs.mapChartValue(value[0], context.chart.axisX, context.plot.width),
|
|
5782
|
+
y: context.plot.y + context.plot.height - chunkQL7MNEMT_cjs.mapChartValue(value[1], context.chart.axisY, context.plot.height)
|
|
5759
5783
|
};
|
|
5760
5784
|
}
|
|
5761
5785
|
function customSeriesStyle(context, series, seriesIndex) {
|
|
5762
|
-
const color = series.color ??
|
|
5786
|
+
const color = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
5763
5787
|
return {
|
|
5764
|
-
fill:
|
|
5788
|
+
fill: chunkQL7MNEMT_cjs.paint(color, context.diagnostics, context.chart.id),
|
|
5765
5789
|
stroke: series.stroke ? { kind: "solid", color: series.stroke } : void 0,
|
|
5766
|
-
strokeWidth: series.stroke ?
|
|
5790
|
+
strokeWidth: series.stroke ? chunkQL7MNEMT_cjs.finite(series.strokeWidth, 1) : void 0
|
|
5767
5791
|
};
|
|
5768
5792
|
}
|
|
5769
5793
|
function createCustomSymbolMark(context, mark) {
|
|
5770
5794
|
const symbol = mark.series.symbol;
|
|
5771
|
-
const size =
|
|
5795
|
+
const size = chunkQL7MNEMT_cjs.finite(mark.series.size, 3);
|
|
5772
5796
|
const scale = symbol?.normalized ? size * 2 : 1;
|
|
5773
5797
|
const offset = symbol?.normalized ? 0.5 : 0;
|
|
5774
5798
|
const points = (symbol?.points ?? []).map(([x, y]) => ({
|
|
@@ -5780,12 +5804,12 @@ function createCustomSymbolMark(context, mark) {
|
|
|
5780
5804
|
id: customMarkId(context.chart, mark.series, mark.valueIndex),
|
|
5781
5805
|
order: context.nextOrder(),
|
|
5782
5806
|
bounds: context.bounds,
|
|
5783
|
-
d:
|
|
5807
|
+
d: chunkQL7MNEMT_cjs.freeformPathData({ points, tension: chunkQL7MNEMT_cjs.finite(symbol?.tension, 0), closed: true }),
|
|
5784
5808
|
style: mark.style
|
|
5785
5809
|
};
|
|
5786
5810
|
}
|
|
5787
5811
|
function createCustomPointMark(context, mark) {
|
|
5788
|
-
const radius =
|
|
5812
|
+
const radius = chunkQL7MNEMT_cjs.finite(mark.series.size, 3);
|
|
5789
5813
|
return {
|
|
5790
5814
|
type: "ellipse",
|
|
5791
5815
|
id: customMarkId(context.chart, mark.series, mark.valueIndex),
|
|
@@ -5809,7 +5833,7 @@ function renderConnectedPairs(context) {
|
|
|
5809
5833
|
const zones = chart.config?.zones ?? [];
|
|
5810
5834
|
const betterColor = zones[0]?.color ?? "#10b981";
|
|
5811
5835
|
const worseColor = zones[1]?.color ?? "#ec4899";
|
|
5812
|
-
const tieColor = zones[2]?.color ??
|
|
5836
|
+
const tieColor = zones[2]?.color ?? chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL;
|
|
5813
5837
|
const reverse = Boolean(chart.config?.reverseComparison);
|
|
5814
5838
|
const count = Math.min(beforeValues.length, afterValues.length);
|
|
5815
5839
|
const categories = chart.config?.categories ?? [];
|
|
@@ -5824,7 +5848,7 @@ function renderConnectedPairs(context) {
|
|
|
5824
5848
|
const better = reverse ? afterMetric < beforeMetric : afterMetric > beforeMetric;
|
|
5825
5849
|
const worse = reverse ? afterMetric > beforeMetric : afterMetric < beforeMetric;
|
|
5826
5850
|
const comparisonColor = better ? betterColor : worse ? worseColor : tieColor;
|
|
5827
|
-
const radius =
|
|
5851
|
+
const radius = chunkQL7MNEMT_cjs.finite(afterSeries.size, 3);
|
|
5828
5852
|
nodes.push(createConnectorLine(context, index, beforePoint, afterPoint, comparisonColor));
|
|
5829
5853
|
nodes.push(
|
|
5830
5854
|
createCustomPointMark(context, {
|
|
@@ -5832,9 +5856,9 @@ function renderConnectedPairs(context) {
|
|
|
5832
5856
|
valueIndex: index,
|
|
5833
5857
|
point: beforePoint,
|
|
5834
5858
|
style: {
|
|
5835
|
-
fill:
|
|
5859
|
+
fill: chunkQL7MNEMT_cjs.paint(chart.config?.customBeforeFill ?? chart.gridColor ?? "#e2e8f0", context.diagnostics, chart.id),
|
|
5836
5860
|
stroke: { kind: "solid", color: chart.config?.customBeforeStroke ?? HOLLOW_POINT_STROKE },
|
|
5837
|
-
strokeWidth:
|
|
5861
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.config?.customBeforeStrokeWidth, 1.5)
|
|
5838
5862
|
}
|
|
5839
5863
|
})
|
|
5840
5864
|
);
|
|
@@ -5844,7 +5868,7 @@ function renderConnectedPairs(context) {
|
|
|
5844
5868
|
valueIndex: index,
|
|
5845
5869
|
point: afterPoint,
|
|
5846
5870
|
style: {
|
|
5847
|
-
fill:
|
|
5871
|
+
fill: chunkQL7MNEMT_cjs.paint(comparisonColor, context.diagnostics, chart.id),
|
|
5848
5872
|
stroke: void 0,
|
|
5849
5873
|
strokeWidth: void 0
|
|
5850
5874
|
}
|
|
@@ -5871,7 +5895,7 @@ function createConnectorLine(context, index, from, to, color) {
|
|
|
5871
5895
|
style: {
|
|
5872
5896
|
fill: { kind: "none" },
|
|
5873
5897
|
stroke: { kind: "solid", color },
|
|
5874
|
-
strokeWidth:
|
|
5898
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.config?.customConnectorWidth, 2),
|
|
5875
5899
|
opacity: chart.config?.customConnectorOpacity,
|
|
5876
5900
|
dash: connectorDash(chart.config?.customConnectorDash)
|
|
5877
5901
|
}
|
|
@@ -5892,7 +5916,7 @@ function createConnectorLabel(context, index, beforePoint, afterPoint, radius, t
|
|
|
5892
5916
|
height: 16
|
|
5893
5917
|
};
|
|
5894
5918
|
return {
|
|
5895
|
-
...
|
|
5919
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
5896
5920
|
id: `chart-custom-label-${chart.id}-${index}`,
|
|
5897
5921
|
order: nextOrder(),
|
|
5898
5922
|
bounds,
|
|
@@ -5901,7 +5925,7 @@ function createConnectorLabel(context, index, beforePoint, afterPoint, radius, t
|
|
|
5901
5925
|
chart,
|
|
5902
5926
|
align: horizontal ? "left" : "center"
|
|
5903
5927
|
}),
|
|
5904
|
-
fontSize: Math.max(6,
|
|
5928
|
+
fontSize: Math.max(6, chunkQL7MNEMT_cjs.finite(chart.config?.customLabelSize, Math.max(9, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12)) - 2)),
|
|
5905
5929
|
...chart.config?.customLabelColor ? { color: chart.config.customLabelColor } : {}
|
|
5906
5930
|
};
|
|
5907
5931
|
}
|
|
@@ -5913,8 +5937,8 @@ function classifyFieldData(context) {
|
|
|
5913
5937
|
const vectorSeries = chart.series.filter((series) => tupleSize(series.values[0]) === 4);
|
|
5914
5938
|
const scalarSamples = scalarSeries.flatMap(
|
|
5915
5939
|
(series) => series.values.map(([x, y, value]) => ({
|
|
5916
|
-
x:
|
|
5917
|
-
y: plot.height -
|
|
5940
|
+
x: chunkQL7MNEMT_cjs.mapChartValue(x, chart.axisX, plot.width),
|
|
5941
|
+
y: plot.height - chunkQL7MNEMT_cjs.mapChartValue(y, chart.axisY, plot.height),
|
|
5918
5942
|
value
|
|
5919
5943
|
}))
|
|
5920
5944
|
);
|
|
@@ -5978,20 +6002,20 @@ function createLegendLabels(context, minimum, maximum, geometry) {
|
|
|
5978
6002
|
const { chart, bounds, nextOrder } = context;
|
|
5979
6003
|
const y = geometry.y + geometry.height + 3;
|
|
5980
6004
|
return [
|
|
5981
|
-
|
|
6005
|
+
chunkQL7MNEMT_cjs.chartText({
|
|
5982
6006
|
id: `chart-field-colorbar-min-${chart.id}`,
|
|
5983
6007
|
order: nextOrder(),
|
|
5984
6008
|
bounds,
|
|
5985
6009
|
frame: { x: geometry.x, y, width: 80, height: 16 },
|
|
5986
|
-
text:
|
|
6010
|
+
text: chunkQL7MNEMT_cjs.formatFieldValue(minimum),
|
|
5987
6011
|
chart
|
|
5988
6012
|
}),
|
|
5989
|
-
|
|
6013
|
+
chunkQL7MNEMT_cjs.chartText({
|
|
5990
6014
|
id: `chart-field-colorbar-max-${chart.id}`,
|
|
5991
6015
|
order: nextOrder(),
|
|
5992
6016
|
bounds,
|
|
5993
6017
|
frame: { x: geometry.x + geometry.width - 80, y, width: 80, height: 16 },
|
|
5994
|
-
text:
|
|
6018
|
+
text: chunkQL7MNEMT_cjs.formatFieldValue(maximum),
|
|
5995
6019
|
chart,
|
|
5996
6020
|
align: "right"
|
|
5997
6021
|
})
|
|
@@ -6004,7 +6028,7 @@ function colorAtRamp(ramp, value) {
|
|
|
6004
6028
|
if (!ramp?.stops.length) {
|
|
6005
6029
|
return RAMP_FALLBACK_COLOR;
|
|
6006
6030
|
}
|
|
6007
|
-
return
|
|
6031
|
+
return chunkQL7MNEMT_cjs.interpolateHexColorStops(ramp.stops, value);
|
|
6008
6032
|
}
|
|
6009
6033
|
|
|
6010
6034
|
// src/renderScene/charts/field/isolines.ts
|
|
@@ -6214,7 +6238,7 @@ function createIsoline(context, grid, threshold, thresholdIndex) {
|
|
|
6214
6238
|
}
|
|
6215
6239
|
const chains = stitchIsolineSegments(segments);
|
|
6216
6240
|
const path = chains.map(
|
|
6217
|
-
(chain) =>
|
|
6241
|
+
(chain) => chunkQL7MNEMT_cjs.linePathData(
|
|
6218
6242
|
chain.map(([x, y]) => ({ x: plot.x + x, y: plot.y + y })),
|
|
6219
6243
|
ISOLINE_TENSION
|
|
6220
6244
|
)
|
|
@@ -6238,7 +6262,7 @@ function createIsoline(context, grid, threshold, thresholdIndex) {
|
|
|
6238
6262
|
function renderVectorField(context, seriesList) {
|
|
6239
6263
|
const nodes = [];
|
|
6240
6264
|
seriesList.forEach((series, seriesIndex) => {
|
|
6241
|
-
const color = series.color ??
|
|
6265
|
+
const color = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
6242
6266
|
series.values.forEach((vector, vectorIndex) => {
|
|
6243
6267
|
nodes.push(createVectorNode(context, series.id, vector, vectorIndex, color));
|
|
6244
6268
|
});
|
|
@@ -6248,10 +6272,10 @@ function renderVectorField(context, seriesList) {
|
|
|
6248
6272
|
function createVectorNode(context, seriesId, vector, vectorIndex, color) {
|
|
6249
6273
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
6250
6274
|
const [x, y, angle, magnitude] = vector;
|
|
6251
|
-
const startX = plot.x +
|
|
6252
|
-
const startY = plot.y + plot.height -
|
|
6253
|
-
const endX = plot.x +
|
|
6254
|
-
const endY = plot.y + plot.height -
|
|
6275
|
+
const startX = plot.x + chunkQL7MNEMT_cjs.mapChartValue(x, chart.axisX, plot.width);
|
|
6276
|
+
const startY = plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(y, chart.axisY, plot.height);
|
|
6277
|
+
const endX = plot.x + chunkQL7MNEMT_cjs.mapChartValue(x + Math.cos(angle) * magnitude, chart.axisX, plot.width);
|
|
6278
|
+
const endY = plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(y + Math.sin(angle) * magnitude, chart.axisY, plot.height);
|
|
6255
6279
|
return {
|
|
6256
6280
|
type: "path",
|
|
6257
6281
|
id: `chart-field-vector-${chart.id}-${seriesId}-${vectorIndex}`,
|
|
@@ -6261,7 +6285,7 @@ function createVectorNode(context, seriesId, vector, vectorIndex, color) {
|
|
|
6261
6285
|
markerEnd: "filled_arrow",
|
|
6262
6286
|
style: {
|
|
6263
6287
|
fill: { kind: "none" },
|
|
6264
|
-
stroke:
|
|
6288
|
+
stroke: chunkQL7MNEMT_cjs.paint(color, diagnostics, chart.id),
|
|
6265
6289
|
strokeWidth: 2
|
|
6266
6290
|
}
|
|
6267
6291
|
};
|
|
@@ -6308,7 +6332,7 @@ function createHeatmapCell(layout, series, rowIndex, columnIndex) {
|
|
|
6308
6332
|
};
|
|
6309
6333
|
}
|
|
6310
6334
|
function colorForValue(value, layout) {
|
|
6311
|
-
return
|
|
6335
|
+
return chunkQL7MNEMT_cjs.zoneColorAtValue(value, layout.bands, layout.zones);
|
|
6312
6336
|
}
|
|
6313
6337
|
function renderHeatmapCell(context, layout, cell) {
|
|
6314
6338
|
const background = createCellBackground(context, layout, cell);
|
|
@@ -6323,7 +6347,7 @@ function createCellBackground(context, layout, cell) {
|
|
|
6323
6347
|
const style = {
|
|
6324
6348
|
fill: { kind: "solid", color: cell.color },
|
|
6325
6349
|
stroke: { kind: "solid", color: chart.config?.cellStrokeColor ?? chart.gridColor ?? "#e2e8f0" },
|
|
6326
|
-
strokeWidth:
|
|
6350
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.config?.cellStrokeWidth, chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1))
|
|
6327
6351
|
};
|
|
6328
6352
|
if (chart.config?.cellShape === "circle") {
|
|
6329
6353
|
return {
|
|
@@ -6350,9 +6374,9 @@ function createCellBackground(context, layout, cell) {
|
|
|
6350
6374
|
}
|
|
6351
6375
|
function createCellValueLabel(context, layout, cell) {
|
|
6352
6376
|
const { chart, bounds, nextOrder } = context;
|
|
6353
|
-
const size = Math.max(6,
|
|
6377
|
+
const size = Math.max(6, chunkQL7MNEMT_cjs.finite(chart.config?.cellValueSize, layout.fontSize));
|
|
6354
6378
|
return {
|
|
6355
|
-
...
|
|
6379
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
6356
6380
|
id: `chart-heatmap-value-${chart.id}-${cell.seriesId}-${cell.columnIndex}`,
|
|
6357
6381
|
order: nextOrder(),
|
|
6358
6382
|
bounds,
|
|
@@ -6367,7 +6391,7 @@ function createCellValueLabel(context, layout, cell) {
|
|
|
6367
6391
|
align: "center"
|
|
6368
6392
|
}),
|
|
6369
6393
|
...chart.config?.cellValueSize === void 0 ? {} : { fontSize: size },
|
|
6370
|
-
color: chart.config?.cellValueColor ??
|
|
6394
|
+
color: chart.config?.cellValueColor ?? chunkQL7MNEMT_cjs.contrastTextColor(cell.color)
|
|
6371
6395
|
};
|
|
6372
6396
|
}
|
|
6373
6397
|
|
|
@@ -6380,9 +6404,9 @@ function createHeatmapLayout(context) {
|
|
|
6380
6404
|
return {
|
|
6381
6405
|
rows: chart.series,
|
|
6382
6406
|
columns,
|
|
6383
|
-
bands:
|
|
6384
|
-
zones: chart.config?.zones?.length ? chart.config.zones :
|
|
6385
|
-
fontSize: Math.max(9,
|
|
6407
|
+
bands: chunkQL7MNEMT_cjs.axisBands(chart.axisY),
|
|
6408
|
+
zones: chart.config?.zones?.length ? chart.config.zones : chunkQL7MNEMT_cjs.DEFAULT_HEATMAP_ZONES,
|
|
6409
|
+
fontSize: Math.max(9, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12)),
|
|
6386
6410
|
headerFontSize: headerFontSize(chart),
|
|
6387
6411
|
legendGap: legendGap(chart),
|
|
6388
6412
|
sides,
|
|
@@ -6390,10 +6414,10 @@ function createHeatmapLayout(context) {
|
|
|
6390
6414
|
grid: createHeatmapGrid(context, reservedSpace, sides, columns.length)
|
|
6391
6415
|
};
|
|
6392
6416
|
}
|
|
6393
|
-
var headerFontSize = (chart) => Math.max(9,
|
|
6394
|
-
var rowGap = (chart) => Math.min(120, Math.max(0,
|
|
6395
|
-
var columnGap = (chart) => Math.min(120, Math.max(0,
|
|
6396
|
-
var legendGap = (chart) => Math.min(80, Math.max(0,
|
|
6417
|
+
var headerFontSize = (chart) => Math.max(9, chunkQL7MNEMT_cjs.finite(chart.axisFontSize ?? chart.fontSize, 12));
|
|
6418
|
+
var rowGap = (chart) => Math.min(120, Math.max(0, chunkQL7MNEMT_cjs.finite(chart.yLabelGap, 6)));
|
|
6419
|
+
var columnGap = (chart) => Math.min(120, Math.max(0, chunkQL7MNEMT_cjs.finite(chart.xLabelGap, 4)));
|
|
6420
|
+
var legendGap = (chart) => Math.min(80, Math.max(0, chunkQL7MNEMT_cjs.finite(chart.legendGap, 6)));
|
|
6397
6421
|
function heatmapSides(context) {
|
|
6398
6422
|
const { chart } = context;
|
|
6399
6423
|
return {
|
|
@@ -6412,7 +6436,7 @@ function heatmapReservedSpace(context, sides) {
|
|
|
6412
6436
|
const { chart } = context;
|
|
6413
6437
|
const fontSize = headerFontSize(chart);
|
|
6414
6438
|
const longestLabel = chart.series.reduce(
|
|
6415
|
-
(max, series) => Math.max(max,
|
|
6439
|
+
(max, series) => Math.max(max, chunkQL7MNEMT_cjs.estimateTextWidth(series.label ?? "", fontSize, false)),
|
|
6416
6440
|
0
|
|
6417
6441
|
);
|
|
6418
6442
|
const vertical = sides.legend === "left" || sides.legend === "right";
|
|
@@ -6428,8 +6452,8 @@ function heatmapReservedSpace(context, sides) {
|
|
|
6428
6452
|
}
|
|
6429
6453
|
function columnHeaderRoom(context) {
|
|
6430
6454
|
const { chart } = context;
|
|
6431
|
-
const tilt =
|
|
6432
|
-
return tilt > 0 ? Math.min(context.plot.height * 0.4,
|
|
6455
|
+
const tilt = chunkQL7MNEMT_cjs.labelTilt(chart);
|
|
6456
|
+
return tilt > 0 ? Math.min(context.plot.height * 0.4, chunkQL7MNEMT_cjs.tiltedLabelRoom(chart, heatmapColumns(context), tilt) + columnGap(chart) + 4) : headerFontSize(chart) + 2 + columnGap(chart) + 6;
|
|
6433
6457
|
}
|
|
6434
6458
|
function createHeatmapGrid(context, reservedSpace, sides, columnCount) {
|
|
6435
6459
|
const { chart } = context;
|
|
@@ -6440,7 +6464,7 @@ function createHeatmapGrid(context, reservedSpace, sides, columnCount) {
|
|
|
6440
6464
|
const width = Math.max(1, context.plot.width - left - right);
|
|
6441
6465
|
const height = Math.max(1, context.plot.height - top - bottom);
|
|
6442
6466
|
const rowCount = chart.series.length;
|
|
6443
|
-
const cellGap = Math.max(0,
|
|
6467
|
+
const cellGap = Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.cellGap, 0));
|
|
6444
6468
|
let cellWidth = columnCount ? width / columnCount : width;
|
|
6445
6469
|
let cellHeight = rowCount ? height / rowCount : height;
|
|
6446
6470
|
let gridWidth = width;
|
|
@@ -6460,7 +6484,7 @@ function createHeatmapGrid(context, reservedSpace, sides, columnCount) {
|
|
|
6460
6484
|
cellWidth,
|
|
6461
6485
|
cellHeight,
|
|
6462
6486
|
cellGap,
|
|
6463
|
-
cellRadius: Math.max(0,
|
|
6487
|
+
cellRadius: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.barCornerRadius, cellGap))
|
|
6464
6488
|
};
|
|
6465
6489
|
}
|
|
6466
6490
|
|
|
@@ -6479,7 +6503,7 @@ function createRowHeader(context, layout, series, rowIndex) {
|
|
|
6479
6503
|
const room = layout.reservedSpace.rowHeaders;
|
|
6480
6504
|
const gap = rowGap(chart);
|
|
6481
6505
|
const x = layout.sides.rows === "left" ? layout.grid.x - room : layout.grid.x + layout.grid.width + gap;
|
|
6482
|
-
return
|
|
6506
|
+
return chunkQL7MNEMT_cjs.chartText({
|
|
6483
6507
|
id: `chart-heatmap-row-${chart.id}-${series.id}`,
|
|
6484
6508
|
order: nextOrder(),
|
|
6485
6509
|
bounds,
|
|
@@ -6505,12 +6529,12 @@ function createColumnHeader(context, layout, label, columnIndex) {
|
|
|
6505
6529
|
const { chart, bounds, nextOrder } = context;
|
|
6506
6530
|
const above = layout.sides.columns === "top";
|
|
6507
6531
|
const centerX = layout.grid.x + (columnIndex + 0.5) * layout.grid.cellWidth;
|
|
6508
|
-
const tilt =
|
|
6532
|
+
const tilt = chunkQL7MNEMT_cjs.labelTilt(chart);
|
|
6509
6533
|
const gap = columnGap(chart);
|
|
6510
6534
|
const id = `chart-heatmap-col-${chart.id}-${columnIndex}`;
|
|
6511
6535
|
if (tilt > 0) {
|
|
6512
|
-
const { frame, rotation } = above ?
|
|
6513
|
-
return
|
|
6536
|
+
const { frame, rotation } = above ? chunkQL7MNEMT_cjs.labelAboveFrame(chart, label, tilt, { x: centerX, y: layout.grid.y - gap }) : chunkQL7MNEMT_cjs.labelBelowFrame(chart, label, tilt, { x: centerX, y: layout.grid.y + layout.grid.height + gap });
|
|
6537
|
+
return chunkQL7MNEMT_cjs.chartText({
|
|
6514
6538
|
id,
|
|
6515
6539
|
order: nextOrder(),
|
|
6516
6540
|
bounds,
|
|
@@ -6522,7 +6546,7 @@ function createColumnHeader(context, layout, label, columnIndex) {
|
|
|
6522
6546
|
role: "axis"
|
|
6523
6547
|
});
|
|
6524
6548
|
}
|
|
6525
|
-
return
|
|
6549
|
+
return chunkQL7MNEMT_cjs.chartText({
|
|
6526
6550
|
id,
|
|
6527
6551
|
order: nextOrder(),
|
|
6528
6552
|
bounds,
|
|
@@ -6600,7 +6624,7 @@ function renderHeatmapLegend(context, layout) {
|
|
|
6600
6624
|
return [];
|
|
6601
6625
|
}
|
|
6602
6626
|
const place = barPlace(layout);
|
|
6603
|
-
const barBounds =
|
|
6627
|
+
const barBounds = chunkQL7MNEMT_cjs.boxBounds({ x: place.x, y: place.y, width: place.width, height: place.height });
|
|
6604
6628
|
return [createGradientBar(context, layout, place, barBounds), ...createBoundaryTicks(context, layout, place)];
|
|
6605
6629
|
}
|
|
6606
6630
|
function bandRatio(layout, value) {
|
|
@@ -6614,7 +6638,7 @@ function createGradientBar(context, layout, place, barBounds) {
|
|
|
6614
6638
|
const zones = layout.zones.slice(0, bandCount);
|
|
6615
6639
|
const stops = zones.map((zone, index) => ({
|
|
6616
6640
|
offset: bandRatio(layout, layout.bands[index + 1] ?? layout.bands[layout.bands.length - 1]) * 100,
|
|
6617
|
-
color: zone.color ??
|
|
6641
|
+
color: zone.color ?? chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL
|
|
6618
6642
|
}));
|
|
6619
6643
|
return {
|
|
6620
6644
|
type: "rect",
|
|
@@ -6629,7 +6653,7 @@ function createGradientBar(context, layout, place, barBounds) {
|
|
|
6629
6653
|
zoneGradient: { axis: "y", min: chart.axisY.min, max: chart.axisY.max },
|
|
6630
6654
|
style: {
|
|
6631
6655
|
// Across the grid it runs from the lowest value on the left; beside it from the lowest at the bottom.
|
|
6632
|
-
fill: stops.length ? { kind: "linear-gradient", angle: place.vertical ? 270 : 0, stops } : { kind: "solid", color:
|
|
6656
|
+
fill: stops.length ? { kind: "linear-gradient", angle: place.vertical ? 270 : 0, stops } : { kind: "solid", color: chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL },
|
|
6633
6657
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
6634
6658
|
strokeWidth: 1
|
|
6635
6659
|
}
|
|
@@ -6655,12 +6679,12 @@ function createBoundaryTicks(context, layout, place) {
|
|
|
6655
6679
|
strokeWidth: 1
|
|
6656
6680
|
}
|
|
6657
6681
|
};
|
|
6658
|
-
const label =
|
|
6682
|
+
const label = chunkQL7MNEMT_cjs.chartText({
|
|
6659
6683
|
id: `chart-heatmap-legend-tick-label-${chart.id}-${index}`,
|
|
6660
6684
|
order: nextOrder(),
|
|
6661
6685
|
bounds,
|
|
6662
6686
|
...labelAt(place, at, index === 0, index === lastIndex, labelHeight),
|
|
6663
|
-
text:
|
|
6687
|
+
text: chunkQL7MNEMT_cjs.formatFieldValue(value),
|
|
6664
6688
|
chart
|
|
6665
6689
|
});
|
|
6666
6690
|
return [tick, label];
|
|
@@ -7027,22 +7051,22 @@ function renderHexbin(context) {
|
|
|
7027
7051
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
7028
7052
|
const nodes = [];
|
|
7029
7053
|
const config = chart.config;
|
|
7030
|
-
const hexRadius = Math.max(1, config?.hexRadius ??
|
|
7054
|
+
const hexRadius = Math.max(1, config?.hexRadius ?? chunkQL7MNEMT_cjs.DEFAULT_HEX_RADIUS);
|
|
7031
7055
|
const drawRadius = Math.max(0.5, hexRadius - Math.max(0, config?.hexGap ?? 0) * GAP_TO_RADIUS);
|
|
7032
7056
|
const strokeWidth = config?.hexStrokeWidth ?? 0;
|
|
7033
7057
|
const minOpacity = Math.min(1, Math.max(0, config?.hexMinOpacity ?? DEFAULT_MIN_OPACITY));
|
|
7034
|
-
const shadow =
|
|
7058
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
7035
7059
|
const clipPath = shadow ? `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z` : void 0;
|
|
7036
7060
|
chart.series.forEach((series, seriesIndex) => {
|
|
7037
7061
|
const explicit = series.values.length > 0 && Array.isArray(series.values[0]);
|
|
7038
7062
|
const pairs = explicit ? series.values : series.values.map((y, i) => [chart.axisX.min + i * chart.axisX.step, y]);
|
|
7039
7063
|
const pixelPoints2 = pairs.map(([vx, vy]) => ({
|
|
7040
|
-
x:
|
|
7041
|
-
y: plot.height -
|
|
7064
|
+
x: chunkQL7MNEMT_cjs.mapChartValue(vx, chart.axisX, plot.width),
|
|
7065
|
+
y: plot.height - chunkQL7MNEMT_cjs.mapChartValue(vy, chart.axisY, plot.height)
|
|
7042
7066
|
}));
|
|
7043
7067
|
const bins = computeHexBins(pixelPoints2, hexRadius);
|
|
7044
7068
|
const maxCount = Math.max(1, ...bins.map((bin) => bin.count));
|
|
7045
|
-
const color = series.color ??
|
|
7069
|
+
const color = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
7046
7070
|
const ramp = config?.scale;
|
|
7047
7071
|
bins.forEach((bin, i) => {
|
|
7048
7072
|
const share = bin.count / maxCount;
|
|
@@ -7054,8 +7078,8 @@ function renderHexbin(context) {
|
|
|
7054
7078
|
bounds,
|
|
7055
7079
|
d: hexPath(plot.x + bin.cx, plot.y + bin.cy, drawRadius),
|
|
7056
7080
|
style: {
|
|
7057
|
-
fill:
|
|
7058
|
-
stroke: strokeWidth > 0 ?
|
|
7081
|
+
fill: chunkQL7MNEMT_cjs.paint(fill2, diagnostics, chart.id),
|
|
7082
|
+
stroke: strokeWidth > 0 ? chunkQL7MNEMT_cjs.paint(config?.hexStrokeColor ?? fill2, diagnostics, chart.id) : void 0,
|
|
7059
7083
|
strokeWidth: strokeWidth > 0 ? strokeWidth : void 0,
|
|
7060
7084
|
opacity: ramp ? void 0 : Math.max(minOpacity, share),
|
|
7061
7085
|
shadow,
|
|
@@ -7077,8 +7101,8 @@ function seriesValuePairs(chart, series) {
|
|
|
7077
7101
|
function pixelPoints(context, pairs) {
|
|
7078
7102
|
const { chart, plot } = context;
|
|
7079
7103
|
return pairs.map(([x, y]) => ({
|
|
7080
|
-
x: plot.x +
|
|
7081
|
-
y: plot.y + plot.height -
|
|
7104
|
+
x: plot.x + chunkQL7MNEMT_cjs.mapChartValue(x, chart.axisX, plot.width),
|
|
7105
|
+
y: plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(y, chart.axisY, plot.height)
|
|
7082
7106
|
}));
|
|
7083
7107
|
}
|
|
7084
7108
|
|
|
@@ -7088,7 +7112,7 @@ function createLineAreaFill(context, series, points, color, tension, areaOpacity
|
|
|
7088
7112
|
const baselineY = plot.y + plot.height;
|
|
7089
7113
|
const first = points[0];
|
|
7090
7114
|
const last = points[points.length - 1];
|
|
7091
|
-
const d = `${
|
|
7115
|
+
const d = `${chunkQL7MNEMT_cjs.linePathData(points, tension)} L ${last.x} ${baselineY} L ${first.x} ${baselineY} Z`;
|
|
7092
7116
|
const top = Math.min(...points.map((point) => point.y));
|
|
7093
7117
|
const centerX = (Math.min(...points.map((point) => point.x)) + Math.max(...points.map((point) => point.x))) / 2;
|
|
7094
7118
|
const halfHeight = (baselineY - top) / 2;
|
|
@@ -7110,8 +7134,8 @@ function createLineAreaFill(context, series, points, color, tension, areaOpacity
|
|
|
7110
7134
|
kind: "linear-gradient",
|
|
7111
7135
|
angle: 90,
|
|
7112
7136
|
stops: [
|
|
7113
|
-
{ offset: 0, color:
|
|
7114
|
-
{ offset: 100, color:
|
|
7137
|
+
{ offset: 0, color: chunkQL7MNEMT_cjs.colorWithAlpha(color, areaOpacity) },
|
|
7138
|
+
{ offset: 100, color: chunkQL7MNEMT_cjs.colorWithAlpha(color, 0) }
|
|
7115
7139
|
]
|
|
7116
7140
|
},
|
|
7117
7141
|
stroke: { kind: "none" },
|
|
@@ -7134,7 +7158,7 @@ function guideNode(context, mark) {
|
|
|
7134
7158
|
d: `M ${mark.point.x} ${mark.point.y} V ${plot.y + plot.height}`,
|
|
7135
7159
|
style: {
|
|
7136
7160
|
fill: { kind: "none" },
|
|
7137
|
-
stroke:
|
|
7161
|
+
stroke: chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id),
|
|
7138
7162
|
strokeWidth: 1,
|
|
7139
7163
|
dash: [3, 4],
|
|
7140
7164
|
opacity: 0.55,
|
|
@@ -7155,7 +7179,7 @@ function dotNode(context, mark) {
|
|
|
7155
7179
|
rx: mark.radius,
|
|
7156
7180
|
ry: mark.radius,
|
|
7157
7181
|
style: {
|
|
7158
|
-
fill:
|
|
7182
|
+
fill: chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id),
|
|
7159
7183
|
shadow: glow ? { color: mark.color, opacity: 0.9, blur: glow, dx: 0, dy: 0 } : void 0,
|
|
7160
7184
|
pointerEvents: "none"
|
|
7161
7185
|
}
|
|
@@ -7168,7 +7192,7 @@ function labelNode3(context, mark, value) {
|
|
|
7168
7192
|
const text = formatHighlight(config?.highlightLabelFormat, config?.categories?.[mark.index] ?? "", value);
|
|
7169
7193
|
const width = Math.max(48, text.length * fontSize * 0.62);
|
|
7170
7194
|
return {
|
|
7171
|
-
...
|
|
7195
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
7172
7196
|
id: `chart-highlight-label-${mark.key}`,
|
|
7173
7197
|
order: nextOrder(),
|
|
7174
7198
|
bounds,
|
|
@@ -7248,15 +7272,15 @@ function createLineError(context, mark) {
|
|
|
7248
7272
|
return null;
|
|
7249
7273
|
}
|
|
7250
7274
|
const { chart, plot, bounds, nextOrder } = context;
|
|
7251
|
-
const [lower, upper] =
|
|
7252
|
-
return
|
|
7275
|
+
const [lower, upper] = chunkQL7MNEMT_cjs.errorBarRange(mark.value, mark.error);
|
|
7276
|
+
return chunkQL7MNEMT_cjs.createVerticalErrorWhiskerNode({
|
|
7253
7277
|
id: `chart-line-error-${chart.id}-${mark.seriesId}-${mark.valueIndex}`,
|
|
7254
7278
|
order: nextOrder(),
|
|
7255
7279
|
bounds,
|
|
7256
7280
|
geometry: {
|
|
7257
7281
|
centerX: mark.position.x,
|
|
7258
|
-
startY: plot.y + plot.height -
|
|
7259
|
-
endY: plot.y + plot.height -
|
|
7282
|
+
startY: plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(lower, chart.axisY, plot.height),
|
|
7283
|
+
endY: plot.y + plot.height - chunkQL7MNEMT_cjs.mapChartValue(upper, chart.axisY, plot.height)
|
|
7260
7284
|
},
|
|
7261
7285
|
color: mark.color,
|
|
7262
7286
|
valueReference: { seriesId: mark.seriesId, valueIndex: mark.valueIndex }
|
|
@@ -7280,8 +7304,8 @@ function createLinePoint(context, mark) {
|
|
|
7280
7304
|
ry: visible ? radius : 6,
|
|
7281
7305
|
detail: { of: "chartValue", series: mark.seriesId, valueIndex: mark.valueIndex },
|
|
7282
7306
|
style: {
|
|
7283
|
-
fill: visible ?
|
|
7284
|
-
stroke: visible && strokeWidth > 0 ?
|
|
7307
|
+
fill: visible ? chunkQL7MNEMT_cjs.paint(fill2, diagnostics, chart.id) : { kind: "none" },
|
|
7308
|
+
stroke: visible && strokeWidth > 0 ? chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id) : void 0,
|
|
7285
7309
|
strokeWidth: visible && strokeWidth > 0 ? strokeWidth : void 0,
|
|
7286
7310
|
pointerEvents: visible ? void 0 : "all"
|
|
7287
7311
|
}
|
|
@@ -7301,22 +7325,22 @@ function createLinePath(context, series, points, color, tension) {
|
|
|
7301
7325
|
order: nextOrder(),
|
|
7302
7326
|
bounds: gradient ? { minX: plot.x, maxX: plot.x + plot.width, minY: plot.y, maxY: plot.y + plot.height } : bounds,
|
|
7303
7327
|
detail: { of: "chartSeries", series: series.id, lineTension: tension || void 0 },
|
|
7304
|
-
d:
|
|
7328
|
+
d: chunkQL7MNEMT_cjs.linePathData(points, tension),
|
|
7305
7329
|
style: {
|
|
7306
7330
|
fill: { kind: "none" },
|
|
7307
|
-
stroke:
|
|
7331
|
+
stroke: chunkQL7MNEMT_cjs.paint(gradient ?? color, diagnostics, chart.id),
|
|
7308
7332
|
strokeWidth: series.strokeWidth ?? config?.lineWidth ?? 2,
|
|
7309
7333
|
dash: series.dash,
|
|
7310
7334
|
lineCap: config?.lineWidth === void 0 ? void 0 : "round",
|
|
7311
7335
|
lineJoin: "round",
|
|
7312
|
-
shadow: glow ? { color, opacity: 0.9, blur: glow, dx: 0, dy: 0 } :
|
|
7336
|
+
shadow: glow ? { color, opacity: 0.9, blur: glow, dx: 0, dy: 0 } : chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle)
|
|
7313
7337
|
}
|
|
7314
7338
|
};
|
|
7315
7339
|
}
|
|
7316
7340
|
|
|
7317
7341
|
// src/renderScene/charts/renderers/line/series.ts
|
|
7318
7342
|
function seriesColor(series, seriesIndex) {
|
|
7319
|
-
return
|
|
7343
|
+
return chunkQL7MNEMT_cjs.representativeColor(series.color, chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length]);
|
|
7320
7344
|
}
|
|
7321
7345
|
function renderLineSeriesArea(context, series, seriesIndex) {
|
|
7322
7346
|
const areaOpacity = context.chart.config?.areaOpacity;
|
|
@@ -7380,7 +7404,7 @@ function renderGridLines(context, layout) {
|
|
|
7380
7404
|
style: {
|
|
7381
7405
|
fill: { kind: "none" },
|
|
7382
7406
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
7383
|
-
strokeWidth:
|
|
7407
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1)
|
|
7384
7408
|
}
|
|
7385
7409
|
};
|
|
7386
7410
|
});
|
|
@@ -7388,7 +7412,7 @@ function renderGridLines(context, layout) {
|
|
|
7388
7412
|
function renderPercentageLabels(context, layout) {
|
|
7389
7413
|
const { chart, plot, bounds, nextOrder } = context;
|
|
7390
7414
|
return PERCENT_TICKS.map((percent) => ({
|
|
7391
|
-
...
|
|
7415
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
7392
7416
|
id: `chart-mekko-pct-${chart.id}-${percent}`,
|
|
7393
7417
|
order: nextOrder(),
|
|
7394
7418
|
bounds,
|
|
@@ -7420,7 +7444,7 @@ function renderMekkoColumnLabels(context, layout, columnIndex, column) {
|
|
|
7420
7444
|
function createTotalLabel(context, layout, columnIndex, column) {
|
|
7421
7445
|
const { chart, plot, bounds, nextOrder } = context;
|
|
7422
7446
|
return {
|
|
7423
|
-
...
|
|
7447
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
7424
7448
|
id: `chart-mekko-total-${chart.id}-${columnIndex}`,
|
|
7425
7449
|
order: nextOrder(),
|
|
7426
7450
|
bounds,
|
|
@@ -7441,7 +7465,7 @@ function createColumnLabel(context, layout, columnIndex, column) {
|
|
|
7441
7465
|
const { chart, bounds, nextOrder } = context;
|
|
7442
7466
|
const { label, width } = column;
|
|
7443
7467
|
return {
|
|
7444
|
-
...
|
|
7468
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
7445
7469
|
id: `chart-mekko-col-label-${chart.id}-${columnIndex}`,
|
|
7446
7470
|
order: nextOrder(),
|
|
7447
7471
|
bounds,
|
|
@@ -7455,7 +7479,7 @@ function createColumnLabel(context, layout, columnIndex, column) {
|
|
|
7455
7479
|
chart,
|
|
7456
7480
|
align: "center"
|
|
7457
7481
|
}),
|
|
7458
|
-
lines:
|
|
7482
|
+
lines: chunkQL7MNEMT_cjs.wrapText(label, width, layout.smallFontSize),
|
|
7459
7483
|
fontSize: layout.smallFontSize
|
|
7460
7484
|
};
|
|
7461
7485
|
}
|
|
@@ -7465,8 +7489,8 @@ function createMekkoLayout(context) {
|
|
|
7465
7489
|
const labels = mekkoColumnLabels(context);
|
|
7466
7490
|
const labelGutterWidth = context.showLabels ? 30 : 0;
|
|
7467
7491
|
const grid = createMekkoGrid(context, labelGutterWidth);
|
|
7468
|
-
const fontSize = Math.max(9,
|
|
7469
|
-
const columnGap2 = Math.max(0,
|
|
7492
|
+
const fontSize = Math.max(9, chunkQL7MNEMT_cjs.finite(context.chart.fontSize, 12));
|
|
7493
|
+
const columnGap2 = Math.max(0, chunkQL7MNEMT_cjs.finite(context.chart.config?.mekkoColumnGap, 4));
|
|
7470
7494
|
const smallFontSize = Math.max(8, fontSize - 1);
|
|
7471
7495
|
return {
|
|
7472
7496
|
columns: createMekkoColumns(context, grid, labels, columnGap2),
|
|
@@ -7474,8 +7498,8 @@ function createMekkoLayout(context) {
|
|
|
7474
7498
|
smallFontSize,
|
|
7475
7499
|
labelGutterWidth,
|
|
7476
7500
|
columnGap: columnGap2,
|
|
7477
|
-
labelSize: Math.max(6,
|
|
7478
|
-
valueSize: Math.max(6,
|
|
7501
|
+
labelSize: Math.max(6, chunkQL7MNEMT_cjs.finite(context.chart.config?.mekkoLabelSize, smallFontSize)),
|
|
7502
|
+
valueSize: Math.max(6, chunkQL7MNEMT_cjs.finite(context.chart.config?.mekkoValueSize, smallFontSize)),
|
|
7479
7503
|
grid
|
|
7480
7504
|
};
|
|
7481
7505
|
}
|
|
@@ -7532,12 +7556,12 @@ function createColumnBackdrop(context, layout, columnIndex) {
|
|
|
7532
7556
|
id: `chart-mekko-column-backdrop-${chart.id}-${columnIndex}`,
|
|
7533
7557
|
order: nextOrder(),
|
|
7534
7558
|
bounds,
|
|
7535
|
-
d:
|
|
7536
|
-
style: { fill:
|
|
7559
|
+
d: chunkQL7MNEMT_cjs.barShapePath(column.x, layout.grid.y, column.width, layout.grid.height, cornerRadius),
|
|
7560
|
+
style: { fill: chunkQL7MNEMT_cjs.paint(chart.gridColor ?? "#e2e8f0", diagnostics, chart.id), opacity: BACKDROP_OPACITY }
|
|
7537
7561
|
};
|
|
7538
7562
|
}
|
|
7539
7563
|
function mekkoCornerRadius(context) {
|
|
7540
|
-
return Math.max(0,
|
|
7564
|
+
return Math.max(0, chunkQL7MNEMT_cjs.finite(context.chart.config?.barCornerRadius, 2));
|
|
7541
7565
|
}
|
|
7542
7566
|
function calculateColumnSegments(seriesList, layout, columnIndex) {
|
|
7543
7567
|
const segments = [];
|
|
@@ -7548,7 +7572,7 @@ function calculateColumnSegments(seriesList, layout, columnIndex) {
|
|
|
7548
7572
|
const height = (column.total > 0 ? value / column.total : 0) * column.height;
|
|
7549
7573
|
const y = column.y + cumulativeHeight;
|
|
7550
7574
|
cumulativeHeight += height;
|
|
7551
|
-
const color = series.color ??
|
|
7575
|
+
const color = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
7552
7576
|
segments.push({
|
|
7553
7577
|
columnIndex,
|
|
7554
7578
|
seriesId: series.id,
|
|
@@ -7571,12 +7595,12 @@ function renderSegment(context, layout, segment, nextColor) {
|
|
|
7571
7595
|
}
|
|
7572
7596
|
function createSegmentNode(context, segment, nextColor) {
|
|
7573
7597
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
7574
|
-
const shadow =
|
|
7598
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
7575
7599
|
const clipPath = shadow ? `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z` : void 0;
|
|
7576
7600
|
const config = chart.config;
|
|
7577
7601
|
const radius = segment.isTop || config?.mekkoRoundAll ? mekkoCornerRadius(context) : 0;
|
|
7578
7602
|
const { x, y, width, height } = segment.frame;
|
|
7579
|
-
const segmentGap = Math.max(0,
|
|
7603
|
+
const segmentGap = Math.max(0, chunkQL7MNEMT_cjs.finite(config?.mekkoSegmentGap, 0));
|
|
7580
7604
|
const fallback = "#94a3b8";
|
|
7581
7605
|
const gradientBounds = {
|
|
7582
7606
|
minX: x + width / 2 - height / 2,
|
|
@@ -7588,20 +7612,20 @@ function createSegmentNode(context, segment, nextColor) {
|
|
|
7588
7612
|
kind: "linear-gradient",
|
|
7589
7613
|
angle: 90,
|
|
7590
7614
|
stops: [
|
|
7591
|
-
{ offset: 0, color:
|
|
7592
|
-
{ offset: 100, color:
|
|
7615
|
+
{ offset: 0, color: chunkQL7MNEMT_cjs.representativeColor(segment.color, fallback) },
|
|
7616
|
+
{ offset: 100, color: chunkQL7MNEMT_cjs.representativeColor(nextColor, fallback) }
|
|
7593
7617
|
]
|
|
7594
|
-
} :
|
|
7618
|
+
} : chunkQL7MNEMT_cjs.paint(segment.color, diagnostics, chart.id);
|
|
7595
7619
|
return {
|
|
7596
7620
|
type: "path",
|
|
7597
7621
|
id: `chart-mekko-seg-${chart.id}-${segment.columnIndex}-${segment.seriesId}`,
|
|
7598
7622
|
order: nextOrder(),
|
|
7599
7623
|
bounds: nextColor ? gradientBounds : bounds,
|
|
7600
|
-
d:
|
|
7624
|
+
d: chunkQL7MNEMT_cjs.barPath(x, y + segmentGap / 2, width, Math.max(0, height - segmentGap), radius, Boolean(config?.mekkoRoundAll)),
|
|
7601
7625
|
style: {
|
|
7602
7626
|
fill: fill2,
|
|
7603
7627
|
stroke: { kind: "solid", color: config?.mekkoSegmentStrokeColor ?? chart.gridColor ?? "#e2e8f0" },
|
|
7604
|
-
strokeWidth:
|
|
7628
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(config?.mekkoSegmentStrokeWidth, chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1)),
|
|
7605
7629
|
shadow,
|
|
7606
7630
|
clip: clipPath ? { type: "path", d: clipPath } : void 0
|
|
7607
7631
|
}
|
|
@@ -7617,17 +7641,17 @@ function createSegmentLabel(context, layout, segment) {
|
|
|
7617
7641
|
const innerHeight = Math.max(1, height - 6);
|
|
7618
7642
|
const lineHeight = layout.labelSize * 1.2;
|
|
7619
7643
|
const valueHeight = layout.valueSize * 1.2;
|
|
7620
|
-
const labelLines =
|
|
7621
|
-
(line) =>
|
|
7644
|
+
const labelLines = chunkQL7MNEMT_cjs.wrapText(segment.seriesLabel, innerWidth, layout.labelSize).map(
|
|
7645
|
+
(line) => chunkQL7MNEMT_cjs.ellipsizeToWidth(line, innerWidth, layout.labelSize, true)
|
|
7622
7646
|
);
|
|
7623
7647
|
if (labelLines.length * lineHeight + valueHeight > innerHeight) {
|
|
7624
7648
|
return [];
|
|
7625
7649
|
}
|
|
7626
|
-
const textColor = chart.config?.mekkoTextColor ??
|
|
7650
|
+
const textColor = chart.config?.mekkoTextColor ?? chunkQL7MNEMT_cjs.contrastTextColor(chunkQL7MNEMT_cjs.representativeColor(segment.color, "#ffffff"));
|
|
7627
7651
|
const columnTotal = layout.columns[segment.columnIndex]?.total ?? 0;
|
|
7628
7652
|
const valueText = chart.config?.mekkoValueFormat === "percent" ? `${columnTotal > 0 ? Math.round(segment.value / columnTotal * 100) : 0}%` : String(segment.value);
|
|
7629
7653
|
const label = {
|
|
7630
|
-
...
|
|
7654
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
7631
7655
|
id: `chart-mekko-seg-label-${chart.id}-${segment.columnIndex}-${segment.seriesId}`,
|
|
7632
7656
|
order: nextOrder(),
|
|
7633
7657
|
bounds,
|
|
@@ -7641,7 +7665,7 @@ function createSegmentLabel(context, layout, segment) {
|
|
|
7641
7665
|
color: textColor
|
|
7642
7666
|
};
|
|
7643
7667
|
const valueNode = {
|
|
7644
|
-
...
|
|
7668
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
7645
7669
|
id: `chart-mekko-seg-value-${chart.id}-${segment.columnIndex}-${segment.seriesId}`,
|
|
7646
7670
|
order: nextOrder(),
|
|
7647
7671
|
bounds,
|
|
@@ -7674,7 +7698,7 @@ function renderMekko(context) {
|
|
|
7674
7698
|
|
|
7675
7699
|
// src/renderScene/charts/renderers/pie/center.ts
|
|
7676
7700
|
function fill(template, chart) {
|
|
7677
|
-
const values = chart.series.map((series) => Math.max(0,
|
|
7701
|
+
const values = chart.series.map((series) => Math.max(0, chunkQL7MNEMT_cjs.finite(series.values[0], 0)));
|
|
7678
7702
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
7679
7703
|
const first = values[0] ?? 0;
|
|
7680
7704
|
return template.replace(/\{total\}/g, String(Math.round(total * 100) / 100)).replace(/\{percent\}/g, String(total > 0 ? Math.round(first / total * 100) : 0)).replace(/\{label\}/g, chart.series[0]?.label ?? "");
|
|
@@ -7686,7 +7710,7 @@ function renderPieCenter(context, geometry) {
|
|
|
7686
7710
|
return [];
|
|
7687
7711
|
}
|
|
7688
7712
|
const lines = fill(template, chart).split(/\\n|\n/);
|
|
7689
|
-
const fontSize =
|
|
7713
|
+
const fontSize = chunkQL7MNEMT_cjs.finite(chart.config?.pieCenterSize, Math.max(14, Math.min(40, geometry.outerRadius * 0.3)));
|
|
7690
7714
|
const lineHeight = fontSize * 1.2;
|
|
7691
7715
|
const width = Math.max(40, (geometry.innerRadius > 0 ? geometry.innerRadius : geometry.outerRadius * 0.6) * 2);
|
|
7692
7716
|
const text = {
|
|
@@ -7699,7 +7723,7 @@ function renderPieCenter(context, geometry) {
|
|
|
7699
7723
|
width,
|
|
7700
7724
|
height: lineHeight * lines.length,
|
|
7701
7725
|
lines,
|
|
7702
|
-
fontFamily: chart.fontFamily ??
|
|
7726
|
+
fontFamily: chart.fontFamily ?? chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
7703
7727
|
fontSize,
|
|
7704
7728
|
fontWeight: "bold",
|
|
7705
7729
|
align: "center",
|
|
@@ -7719,14 +7743,14 @@ var radians = (degrees) => degrees * Math.PI / 180;
|
|
|
7719
7743
|
function renderPieSlices(context, geometry) {
|
|
7720
7744
|
const config = context.chart.config;
|
|
7721
7745
|
const marks = createPieSliceMarks(context.chart.series, geometry.total, {
|
|
7722
|
-
start: TOP + radians(
|
|
7723
|
-
sweep: Math.min(FULL, Math.max(radians(1), radians(
|
|
7724
|
-
explode: Math.max(0,
|
|
7746
|
+
start: TOP + radians(chunkQL7MNEMT_cjs.finite(config?.pieStartAngle, 0)),
|
|
7747
|
+
sweep: Math.min(FULL, Math.max(radians(1), radians(chunkQL7MNEMT_cjs.finite(config?.pieSweep, 360)))),
|
|
7748
|
+
explode: Math.max(0, chunkQL7MNEMT_cjs.finite(config?.pieExplode, 0))
|
|
7725
7749
|
});
|
|
7726
7750
|
const gapPx = config?.pieSliceGap ?? 0;
|
|
7727
7751
|
return [
|
|
7728
7752
|
...marks.flatMap((mark) => createSliceNodes(context, shiftGeometry(geometry, mark), mark, gapPx)),
|
|
7729
|
-
...
|
|
7753
|
+
...chunkQL7MNEMT_cjs.renderPieLabels(
|
|
7730
7754
|
context,
|
|
7731
7755
|
geometry,
|
|
7732
7756
|
marks.map((mark) => ({
|
|
@@ -7758,20 +7782,20 @@ function createPieSliceMarks(seriesList, total, layout) {
|
|
|
7758
7782
|
const marks = [];
|
|
7759
7783
|
let angle = layout.start;
|
|
7760
7784
|
seriesList.forEach((series, seriesIndex) => {
|
|
7761
|
-
const value = Math.max(0,
|
|
7785
|
+
const value = Math.max(0, chunkQL7MNEMT_cjs.finite(series.values[0], 0));
|
|
7762
7786
|
const sweep = value / total * layout.sweep;
|
|
7763
7787
|
marks.push({
|
|
7764
7788
|
seriesId: series.id,
|
|
7765
7789
|
label: series.label,
|
|
7766
|
-
color: series.color ??
|
|
7790
|
+
color: series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length],
|
|
7767
7791
|
stroke: series.stroke,
|
|
7768
7792
|
strokeWidth: series.strokeWidth,
|
|
7769
7793
|
value,
|
|
7770
7794
|
share: value / total,
|
|
7771
7795
|
angles: { start: angle, end: angle + Math.min(sweep, layout.sweep >= FULL ? MAXIMUM_SWEEP : layout.sweep) },
|
|
7772
|
-
explode: Math.max(0,
|
|
7773
|
-
labelOffsetX:
|
|
7774
|
-
labelOffsetY:
|
|
7796
|
+
explode: Math.max(0, chunkQL7MNEMT_cjs.finite(series.offset, layout.explode)),
|
|
7797
|
+
labelOffsetX: chunkQL7MNEMT_cjs.finite(series.labelOffsetX, 0),
|
|
7798
|
+
labelOffsetY: chunkQL7MNEMT_cjs.finite(series.labelOffsetY, 0)
|
|
7775
7799
|
});
|
|
7776
7800
|
angle += sweep;
|
|
7777
7801
|
});
|
|
@@ -7794,14 +7818,14 @@ function pieOuterShadow(shadow, gapPx) {
|
|
|
7794
7818
|
function sliceCornerRadius(geometry, mark, gapPx) {
|
|
7795
7819
|
const halfGap = Math.max(0, gapPx) / 2;
|
|
7796
7820
|
const rawSweep = mark.angles.end - mark.angles.start;
|
|
7797
|
-
const usesInnerArc =
|
|
7798
|
-
const gapSweep = 2 *
|
|
7821
|
+
const usesInnerArc = chunkQL7MNEMT_cjs.pieUsesInnerArc(geometry, mark.angles, gapPx);
|
|
7822
|
+
const gapSweep = 2 * chunkQL7MNEMT_cjs.gapInsetAngle(halfGap, geometry.outerRadius);
|
|
7799
7823
|
const availableSweep = Math.max(0, rawSweep - gapSweep);
|
|
7800
7824
|
return Math.min(
|
|
7801
7825
|
geometry.cornerRadius,
|
|
7802
|
-
usesInnerArc ?
|
|
7826
|
+
usesInnerArc ? chunkQL7MNEMT_cjs.maxPieCornerRadius(geometry.outerRadius, geometry.innerRadius, availableSweep) : chunkQL7MNEMT_cjs.maxApexCornerRadius(
|
|
7803
7827
|
geometry.outerRadius,
|
|
7804
|
-
|
|
7828
|
+
chunkQL7MNEMT_cjs.pieApexRadius(halfGap, rawSweep, geometry.outerRadius),
|
|
7805
7829
|
availableSweep
|
|
7806
7830
|
)
|
|
7807
7831
|
);
|
|
@@ -7814,14 +7838,14 @@ function sliceStroke(context, mark) {
|
|
|
7814
7838
|
}
|
|
7815
7839
|
return {
|
|
7816
7840
|
stroke: { kind: "solid", color: strokeColor },
|
|
7817
|
-
strokeWidth:
|
|
7841
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(mark.strokeWidth, chunkQL7MNEMT_cjs.finite(config?.pieStrokeWidth, 1))
|
|
7818
7842
|
};
|
|
7819
7843
|
}
|
|
7820
7844
|
function createSliceNodes(context, geometry, mark, gapPx) {
|
|
7821
7845
|
const { chart, bounds, diagnostics, nextOrder } = context;
|
|
7822
|
-
const fill2 =
|
|
7823
|
-
const slicePath =
|
|
7824
|
-
const shadow =
|
|
7846
|
+
const fill2 = chunkQL7MNEMT_cjs.paint(mark.color, diagnostics, chart.id);
|
|
7847
|
+
const slicePath = chunkQL7MNEMT_cjs.createPieSlicePath(geometry, mark.angles, sliceCornerRadius(geometry, mark, gapPx), gapPx);
|
|
7848
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
7825
7849
|
const strokeStyle = sliceStroke(context, mark);
|
|
7826
7850
|
const glow = chart.config?.pieGlow;
|
|
7827
7851
|
const shadowCaster = shadow ? {
|
|
@@ -7852,12 +7876,12 @@ function createSliceNodes(context, geometry, mark, gapPx) {
|
|
|
7852
7876
|
pieEnd: mark.angles.end,
|
|
7853
7877
|
pieValue: mark.value
|
|
7854
7878
|
},
|
|
7855
|
-
prop:
|
|
7879
|
+
prop: chunkQL7MNEMT_cjs.seriesValueProp(mark.seriesId, 0),
|
|
7856
7880
|
style: {
|
|
7857
7881
|
fill: fill2,
|
|
7858
7882
|
...strokeStyle,
|
|
7859
7883
|
innerShadow: shadow,
|
|
7860
|
-
shadow: glow ? { color:
|
|
7884
|
+
shadow: glow ? { color: chunkQL7MNEMT_cjs.representativeColor(mark.color, "#ffffff"), opacity: 0.85, blur: glow, dx: 0, dy: 0 } : void 0
|
|
7861
7885
|
}
|
|
7862
7886
|
};
|
|
7863
7887
|
return shadowCaster ? [shadowCaster, slice] : [slice];
|
|
@@ -7865,7 +7889,7 @@ function createSliceNodes(context, geometry, mark, gapPx) {
|
|
|
7865
7889
|
|
|
7866
7890
|
// src/renderScene/charts/renderers/pie.ts
|
|
7867
7891
|
function renderPie(context) {
|
|
7868
|
-
const geometry =
|
|
7892
|
+
const geometry = chunkQL7MNEMT_cjs.createPieGeometry(context);
|
|
7869
7893
|
return [...renderPieSlices(context, geometry), ...renderPieCenter(context, geometry)];
|
|
7870
7894
|
}
|
|
7871
7895
|
|
|
@@ -7882,18 +7906,18 @@ var OUTSIDE_FALLBACK_COLOR = "#334155";
|
|
|
7882
7906
|
function layoutOf(context) {
|
|
7883
7907
|
const { chart, plot } = context;
|
|
7884
7908
|
const maxRadius = Math.max(1, Math.min(plot.width, plot.height) / 2 - 4);
|
|
7885
|
-
const axisMin =
|
|
7909
|
+
const axisMin = chunkQL7MNEMT_cjs.finite(chart.axisY.min, 0);
|
|
7886
7910
|
return {
|
|
7887
7911
|
centerX: plot.x + plot.width / 2,
|
|
7888
7912
|
centerY: plot.y + plot.height / 2,
|
|
7889
7913
|
maxRadius,
|
|
7890
|
-
innerRadius: Math.max(0, Math.min(
|
|
7891
|
-
cornerRadius: Math.max(0,
|
|
7892
|
-
gapPx: Math.max(0,
|
|
7914
|
+
innerRadius: Math.max(0, Math.min(chunkQL7MNEMT_cjs.finite(chart.config?.innerRadius, 0), maxRadius - 1)),
|
|
7915
|
+
cornerRadius: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.pieCornerRadius, 0)),
|
|
7916
|
+
gapPx: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.pieSliceGap, 0)),
|
|
7893
7917
|
axisMin,
|
|
7894
|
-
range:
|
|
7918
|
+
range: chunkQL7MNEMT_cjs.finite(chart.axisY.max, 100) - axisMin,
|
|
7895
7919
|
sweep: chart.series.length > 0 ? Math.PI * 2 / chart.series.length : 0,
|
|
7896
|
-
start: TOP2 +
|
|
7920
|
+
start: TOP2 + chunkQL7MNEMT_cjs.finite(chart.config?.pieStartAngle, 0) * Math.PI / 180
|
|
7897
7921
|
};
|
|
7898
7922
|
}
|
|
7899
7923
|
function clampedCorner(layout, outerRadius, angles) {
|
|
@@ -7901,19 +7925,19 @@ function clampedCorner(layout, outerRadius, angles) {
|
|
|
7901
7925
|
const geometry = { centerX, centerY, outerRadius, innerRadius };
|
|
7902
7926
|
const halfGap = Math.max(0, gapPx) / 2;
|
|
7903
7927
|
const rawSweep = angles.end - angles.start;
|
|
7904
|
-
const availableSweep = Math.max(0, rawSweep - 2 *
|
|
7905
|
-
if (
|
|
7906
|
-
return Math.min(cornerRadius,
|
|
7928
|
+
const availableSweep = Math.max(0, rawSweep - 2 * chunkQL7MNEMT_cjs.gapInsetAngle(halfGap, outerRadius));
|
|
7929
|
+
if (chunkQL7MNEMT_cjs.pieUsesInnerArc(geometry, angles, gapPx)) {
|
|
7930
|
+
return Math.min(cornerRadius, chunkQL7MNEMT_cjs.maxPieCornerRadius(outerRadius, innerRadius, availableSweep));
|
|
7907
7931
|
}
|
|
7908
|
-
const apexRadius =
|
|
7909
|
-
return Math.min(cornerRadius,
|
|
7932
|
+
const apexRadius = chunkQL7MNEMT_cjs.pieApexRadius(halfGap, rawSweep, outerRadius);
|
|
7933
|
+
return Math.min(cornerRadius, chunkQL7MNEMT_cjs.maxApexCornerRadius(outerRadius, apexRadius, availableSweep));
|
|
7910
7934
|
}
|
|
7911
7935
|
function wedgeNodes(context, layout, series, angles, outerRadius, value, rawColor) {
|
|
7912
7936
|
const { chart, bounds, diagnostics, nextOrder } = context;
|
|
7913
7937
|
const { centerX, centerY, innerRadius, maxRadius, gapPx } = layout;
|
|
7914
|
-
const color =
|
|
7915
|
-
const shadow =
|
|
7916
|
-
const trackPath =
|
|
7938
|
+
const color = chunkQL7MNEMT_cjs.paint(rawColor, diagnostics, chart.id);
|
|
7939
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
7940
|
+
const trackPath = chunkQL7MNEMT_cjs.createPieSlicePath(
|
|
7917
7941
|
{ centerX, centerY, outerRadius: maxRadius, innerRadius },
|
|
7918
7942
|
angles,
|
|
7919
7943
|
clampedCorner(layout, maxRadius, angles),
|
|
@@ -7926,12 +7950,12 @@ function wedgeNodes(context, layout, series, angles, outerRadius, value, rawColo
|
|
|
7926
7950
|
bounds,
|
|
7927
7951
|
d: trackPath,
|
|
7928
7952
|
style: {
|
|
7929
|
-
fill:
|
|
7953
|
+
fill: chunkQL7MNEMT_cjs.paint(chart.gridColor ?? TRACK_COLOR_FALLBACK, diagnostics, chart.id),
|
|
7930
7954
|
opacity: chart.config?.polarTrackOpacity,
|
|
7931
7955
|
...trackStroke(context)
|
|
7932
7956
|
}
|
|
7933
7957
|
};
|
|
7934
|
-
const wedgePath =
|
|
7958
|
+
const wedgePath = chunkQL7MNEMT_cjs.createPieSlicePath(
|
|
7935
7959
|
{ centerX, centerY, outerRadius, innerRadius },
|
|
7936
7960
|
angles,
|
|
7937
7961
|
clampedCorner(layout, outerRadius, angles),
|
|
@@ -7960,7 +7984,7 @@ function wedgeNodes(context, layout, series, angles, outerRadius, value, rawColo
|
|
|
7960
7984
|
pieEnd: angles.end,
|
|
7961
7985
|
pieValue: value
|
|
7962
7986
|
},
|
|
7963
|
-
prop:
|
|
7987
|
+
prop: chunkQL7MNEMT_cjs.seriesValueProp(series.id, 0),
|
|
7964
7988
|
style: { fill: color, innerShadow: shadow, ...wedgeStroke(context) }
|
|
7965
7989
|
};
|
|
7966
7990
|
return shadowCaster ? [track, shadowCaster, wedge] : [track, wedge];
|
|
@@ -7973,7 +7997,7 @@ function trackStroke(context) {
|
|
|
7973
7997
|
const dash = (config.polarTrackDash ?? "").split(/[ ,]+/).map(Number).filter((part) => Number.isFinite(part) && part > 0);
|
|
7974
7998
|
return {
|
|
7975
7999
|
stroke: { kind: "solid", color: config.polarTrackStroke },
|
|
7976
|
-
strokeWidth:
|
|
8000
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(config.polarTrackStrokeWidth, 1),
|
|
7977
8001
|
dash: dash.length > 0 ? dash : void 0
|
|
7978
8002
|
};
|
|
7979
8003
|
}
|
|
@@ -7984,7 +8008,7 @@ function wedgeStroke(context) {
|
|
|
7984
8008
|
}
|
|
7985
8009
|
return {
|
|
7986
8010
|
stroke: { kind: "solid", color: config.pieStroke },
|
|
7987
|
-
strokeWidth:
|
|
8011
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(config.pieStrokeWidth, 1)
|
|
7988
8012
|
};
|
|
7989
8013
|
}
|
|
7990
8014
|
function ringNodes(context, layout) {
|
|
@@ -7992,7 +8016,7 @@ function ringNodes(context, layout) {
|
|
|
7992
8016
|
if (!chart.config?.polarRings || layout.range <= 0) {
|
|
7993
8017
|
return [];
|
|
7994
8018
|
}
|
|
7995
|
-
return
|
|
8019
|
+
return chunkQL7MNEMT_cjs.chartTicks(chart.axisY).filter((tick) => tick > layout.axisMin && tick < layout.axisMin + layout.range).map((tick) => {
|
|
7996
8020
|
const radius = layout.innerRadius + (layout.maxRadius - layout.innerRadius) * (tick - layout.axisMin) / layout.range;
|
|
7997
8021
|
return {
|
|
7998
8022
|
type: "ellipse",
|
|
@@ -8006,7 +8030,7 @@ function ringNodes(context, layout) {
|
|
|
8006
8030
|
style: {
|
|
8007
8031
|
fill: { kind: "none" },
|
|
8008
8032
|
stroke: { kind: "solid", color: chart.textColor ?? "#334155" },
|
|
8009
|
-
strokeWidth:
|
|
8033
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1),
|
|
8010
8034
|
opacity: 0.25
|
|
8011
8035
|
}
|
|
8012
8036
|
};
|
|
@@ -8018,10 +8042,10 @@ function renderPolarArea(context) {
|
|
|
8018
8042
|
const showLabels = context.showLabels && sweep >= MIN_LABEL_SWEEP;
|
|
8019
8043
|
const wedges = context.chart.series.flatMap((series, index) => {
|
|
8020
8044
|
const angles = { start: start + index * sweep, end: start + (index + 1) * sweep };
|
|
8021
|
-
const value = Math.max(0,
|
|
8045
|
+
const value = Math.max(0, chunkQL7MNEMT_cjs.finite(series.values[0], 0));
|
|
8022
8046
|
const fraction = range > 0 ? Math.min(1, Math.max(0, (value - axisMin) / range)) : 0;
|
|
8023
8047
|
const outerRadius = Math.max(innerRadius + 1, innerRadius + (maxRadius - innerRadius) * fraction);
|
|
8024
|
-
const rawColor = series.color ??
|
|
8048
|
+
const rawColor = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[index % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
8025
8049
|
const nodes = wedgeNodes(context, layout, series, angles, outerRadius, value, rawColor);
|
|
8026
8050
|
if (!showLabels) {
|
|
8027
8051
|
return nodes;
|
|
@@ -8032,10 +8056,10 @@ function renderPolarArea(context) {
|
|
|
8032
8056
|
return [...wedges, ...ringNodes(context, layout)];
|
|
8033
8057
|
}
|
|
8034
8058
|
function labelSizes(chart) {
|
|
8035
|
-
const base = Math.max(9,
|
|
8059
|
+
const base = Math.max(9, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12));
|
|
8036
8060
|
return {
|
|
8037
|
-
nameSize: Math.max(6,
|
|
8038
|
-
valueSize: Math.max(6,
|
|
8061
|
+
nameSize: Math.max(6, chunkQL7MNEMT_cjs.finite(chart.config?.polarNameSize, base)),
|
|
8062
|
+
valueSize: Math.max(6, chunkQL7MNEMT_cjs.finite(chart.config?.polarValueSize, base))
|
|
8039
8063
|
};
|
|
8040
8064
|
}
|
|
8041
8065
|
function labelPlacement2(context, geometry, angles, series, fillColor) {
|
|
@@ -8043,8 +8067,8 @@ function labelPlacement2(context, geometry, angles, series, fillColor) {
|
|
|
8043
8067
|
const { nameSize, valueSize } = labelSizes(context.chart);
|
|
8044
8068
|
const lineHeight = (nameSize + valueSize) * 1.2 / 2;
|
|
8045
8069
|
const ringThickness = geometry.outerRadius - geometry.innerRadius;
|
|
8046
|
-
const labelOffsetX =
|
|
8047
|
-
const labelOffsetY =
|
|
8070
|
+
const labelOffsetX = chunkQL7MNEMT_cjs.finite(series.labelOffsetX, 0);
|
|
8071
|
+
const labelOffsetY = chunkQL7MNEMT_cjs.finite(series.labelOffsetY, 0);
|
|
8048
8072
|
const hasManualOffset = labelOffsetX !== 0 || labelOffsetY !== 0;
|
|
8049
8073
|
const tooThin = ringThickness < lineHeight * 2 + 6;
|
|
8050
8074
|
const chordWidth = 2 * geometry.outerRadius * Math.sin(Math.abs(angles.end - angles.start) / 2);
|
|
@@ -8054,11 +8078,11 @@ function labelPlacement2(context, geometry, angles, series, fillColor) {
|
|
|
8054
8078
|
return void 0;
|
|
8055
8079
|
}
|
|
8056
8080
|
const outside = hasManualOffset || !fitsInline;
|
|
8057
|
-
const tickStart =
|
|
8058
|
-
const point = outside ? hasManualOffset ? addOffset(
|
|
8059
|
-
const color = outside ? outsideLabels && context.chart.textColor ? context.chart.textColor :
|
|
8060
|
-
|
|
8061
|
-
|
|
8081
|
+
const tickStart = chunkQL7MNEMT_cjs.pieArcPoint(geometry, mid, geometry.outerRadius + LEADER_INSET);
|
|
8082
|
+
const point = outside ? hasManualOffset ? addOffset(chunkQL7MNEMT_cjs.pieArcPoint(geometry, mid, geometry.outerRadius), labelOffsetX, labelOffsetY) : chunkQL7MNEMT_cjs.pieArcPoint(geometry, mid, geometry.outerRadius + OUTSIDE_GAP) : chunkQL7MNEMT_cjs.pieArcPoint(geometry, mid, geometry.innerRadius + ringThickness * LABEL_RADIUS_FRACTION);
|
|
8083
|
+
const color = outside ? outsideLabels && context.chart.textColor ? context.chart.textColor : chunkQL7MNEMT_cjs.sameHueTint(chunkQL7MNEMT_cjs.representativeColor(fillColor, OUTSIDE_FALLBACK_COLOR), OUTSIDE_TINT_LIGHTNESS) ?? OUTSIDE_FALLBACK_COLOR : chunkQL7MNEMT_cjs.sameHueContrastColor(
|
|
8084
|
+
chunkQL7MNEMT_cjs.representativeColor(fillColor, "#0f172a"),
|
|
8085
|
+
chunkQL7MNEMT_cjs.contrastTextColor(chunkQL7MNEMT_cjs.representativeColor(fillColor, "#0f172a"))
|
|
8062
8086
|
);
|
|
8063
8087
|
return { point, color, outside, mid, tickStart };
|
|
8064
8088
|
}
|
|
@@ -8071,7 +8095,7 @@ function createWedgeLabel(context, geometry, angles, series, value, fillColor) {
|
|
|
8071
8095
|
const { point, color, outside, mid, tickStart } = placement;
|
|
8072
8096
|
const { nameSize, valueSize } = labelSizes(chart);
|
|
8073
8097
|
const lineHeight = Math.max(nameSize, valueSize) * 1.2;
|
|
8074
|
-
const tickEnd = outside ?
|
|
8098
|
+
const tickEnd = outside ? chunkQL7MNEMT_cjs.clipSegmentToRect(tickStart, point, LABEL_WIDTH2 / 2, lineHeight) : tickStart;
|
|
8075
8099
|
const tick = {
|
|
8076
8100
|
type: "path",
|
|
8077
8101
|
id: `chart-polar-area-label-tick-${chart.id}-${series.id}`,
|
|
@@ -8093,7 +8117,7 @@ function createWedgeLabel(context, geometry, angles, series, value, fillColor) {
|
|
|
8093
8117
|
bounds,
|
|
8094
8118
|
x: point.x - LABEL_WIDTH2 / 2,
|
|
8095
8119
|
width: LABEL_WIDTH2,
|
|
8096
|
-
fontFamily: chart.fontFamily ??
|
|
8120
|
+
fontFamily: chart.fontFamily ?? chunkQL7MNEMT_cjs.DEFAULT_FONT,
|
|
8097
8121
|
align: "center",
|
|
8098
8122
|
verticalAlign: "middle",
|
|
8099
8123
|
lineHeight: 1.2,
|
|
@@ -8116,7 +8140,7 @@ function createWedgeLabel(context, geometry, angles, series, value, fillColor) {
|
|
|
8116
8140
|
lines: [series.label],
|
|
8117
8141
|
fontWeight: valueFirst ? "normal" : "bold",
|
|
8118
8142
|
detail,
|
|
8119
|
-
prop:
|
|
8143
|
+
prop: chunkQL7MNEMT_cjs.seriesLabelProp(series.id)
|
|
8120
8144
|
};
|
|
8121
8145
|
const valueText = {
|
|
8122
8146
|
type: "text",
|
|
@@ -8126,10 +8150,10 @@ function createWedgeLabel(context, geometry, angles, series, value, fillColor) {
|
|
|
8126
8150
|
y: valueY,
|
|
8127
8151
|
height: valueSize * 1.2,
|
|
8128
8152
|
fontSize: valueSize,
|
|
8129
|
-
lines: [
|
|
8153
|
+
lines: [chunkQL7MNEMT_cjs.formatFieldValue(value)],
|
|
8130
8154
|
fontWeight: valueFirst ? "bold" : "normal",
|
|
8131
8155
|
detail,
|
|
8132
|
-
prop:
|
|
8156
|
+
prop: chunkQL7MNEMT_cjs.seriesValueProp(series.id, 0),
|
|
8133
8157
|
propKind: "value"
|
|
8134
8158
|
};
|
|
8135
8159
|
return [tick, nameText, valueText];
|
|
@@ -8147,10 +8171,10 @@ function radarFrameFor(context) {
|
|
|
8147
8171
|
return {
|
|
8148
8172
|
centerX: plot.x + plot.width / 2,
|
|
8149
8173
|
centerY: plot.y + plot.height / 2,
|
|
8150
|
-
radius:
|
|
8174
|
+
radius: chunkQL7MNEMT_cjs.radarRadius(plot.width, plot.height, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12), context.showLabels),
|
|
8151
8175
|
min: chart.axisY.min,
|
|
8152
8176
|
max: chart.axisY.max,
|
|
8153
|
-
count:
|
|
8177
|
+
count: chunkQL7MNEMT_cjs.radarCategoryCount(configuredCount, dataCount),
|
|
8154
8178
|
curved: chart.chartType === "radial",
|
|
8155
8179
|
tension: chart.config?.radarTension
|
|
8156
8180
|
};
|
|
@@ -8160,7 +8184,7 @@ function createRadarGeometry(context) {
|
|
|
8160
8184
|
const configuredCategories = chart.config?.categories?.filter(Boolean) ?? [];
|
|
8161
8185
|
const frame = radarFrameFor(context);
|
|
8162
8186
|
const categories = createCategories(configuredCategories, frame.count);
|
|
8163
|
-
const pointAt = (pointRadius, pointIndex) =>
|
|
8187
|
+
const pointAt = (pointRadius, pointIndex) => chunkQL7MNEMT_cjs.radarPointAt(frame, pointIndex, pointRadius);
|
|
8164
8188
|
return {
|
|
8165
8189
|
circular: frame.curved,
|
|
8166
8190
|
areaOpacity: Math.max(0, Math.min(1, chart.config?.areaOpacity ?? 0.16)),
|
|
@@ -8172,9 +8196,9 @@ function createRadarGeometry(context) {
|
|
|
8172
8196
|
centerX: frame.centerX,
|
|
8173
8197
|
centerY: frame.centerY,
|
|
8174
8198
|
radius: frame.radius,
|
|
8175
|
-
radiusForValue: (value) =>
|
|
8199
|
+
radiusForValue: (value) => chunkQL7MNEMT_cjs.radarRadiusForValue(frame, value),
|
|
8176
8200
|
pointAt,
|
|
8177
|
-
polygonPath: (pointRadius) =>
|
|
8201
|
+
polygonPath: (pointRadius) => chunkQL7MNEMT_cjs.radarSeriesPath(
|
|
8178
8202
|
categories.map((_, index) => pointAt(pointRadius, index)),
|
|
8179
8203
|
false
|
|
8180
8204
|
)
|
|
@@ -8195,7 +8219,7 @@ function renderRadarGrid(context, geometry) {
|
|
|
8195
8219
|
return [...renderRings(context, geometry), ...geometry.showSpokes ? renderSpokes(context, geometry) : []];
|
|
8196
8220
|
}
|
|
8197
8221
|
function renderRings(context, geometry) {
|
|
8198
|
-
return
|
|
8222
|
+
return chunkQL7MNEMT_cjs.chartTicks(context.chart.axisY).filter((tick) => tick > context.chart.axisY.min).map((tick) => createRingNode(context, geometry, tick));
|
|
8199
8223
|
}
|
|
8200
8224
|
function createRingNode(context, geometry, tick) {
|
|
8201
8225
|
const { chart, bounds, nextOrder } = context;
|
|
@@ -8203,7 +8227,7 @@ function createRingNode(context, geometry, tick) {
|
|
|
8203
8227
|
const style = {
|
|
8204
8228
|
fill: { kind: "none" },
|
|
8205
8229
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
8206
|
-
strokeWidth:
|
|
8230
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1)
|
|
8207
8231
|
};
|
|
8208
8232
|
if (geometry.circular) {
|
|
8209
8233
|
return {
|
|
@@ -8240,7 +8264,7 @@ function renderSpokes(context, geometry) {
|
|
|
8240
8264
|
style: {
|
|
8241
8265
|
fill: { kind: "none" },
|
|
8242
8266
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
8243
|
-
strokeWidth:
|
|
8267
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1)
|
|
8244
8268
|
}
|
|
8245
8269
|
};
|
|
8246
8270
|
});
|
|
@@ -8260,7 +8284,7 @@ function createCategoryLabel(context, geometry, category, categoryIndex) {
|
|
|
8260
8284
|
const labelPoint = geometry.pointAt(geometry.radius + 10, categoryIndex);
|
|
8261
8285
|
const horizontalOffset = labelPoint.x - geometry.centerX;
|
|
8262
8286
|
const width = Math.max(64, Math.min(120, plot.width / 3));
|
|
8263
|
-
return
|
|
8287
|
+
return chunkQL7MNEMT_cjs.chartText({
|
|
8264
8288
|
id: `chart-radar-label-${chart.id}-${categoryIndex}`,
|
|
8265
8289
|
order: nextOrder(),
|
|
8266
8290
|
bounds,
|
|
@@ -8298,9 +8322,9 @@ function renderRadarSeries(context, geometry) {
|
|
|
8298
8322
|
return nodes;
|
|
8299
8323
|
}
|
|
8300
8324
|
function renderSeries(context, geometry, series, seriesIndex) {
|
|
8301
|
-
const color = series.color ??
|
|
8325
|
+
const color = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
8302
8326
|
const points = seriesPoints(series, context, geometry);
|
|
8303
|
-
const path =
|
|
8327
|
+
const path = chunkQL7MNEMT_cjs.radarSeriesPath(points, geometry.circular, geometry.tension);
|
|
8304
8328
|
return [
|
|
8305
8329
|
createSeriesFill(context, geometry, series, path, color),
|
|
8306
8330
|
...geometry.strokeWidth > 0 ? [createSeriesStroke(context, geometry, series, path, color)] : [],
|
|
@@ -8323,7 +8347,7 @@ function createSeriesFill(context, geometry, series, path, color) {
|
|
|
8323
8347
|
d: path,
|
|
8324
8348
|
detail: { of: "chartSeries", series: series.id },
|
|
8325
8349
|
style: {
|
|
8326
|
-
fill:
|
|
8350
|
+
fill: chunkQL7MNEMT_cjs.paint(color, diagnostics, chart.id),
|
|
8327
8351
|
stroke: { kind: "none" },
|
|
8328
8352
|
opacity: Math.max(0, Math.min(1, series.opacity ?? geometry.areaOpacity))
|
|
8329
8353
|
}
|
|
@@ -8340,10 +8364,10 @@ function createSeriesStroke(context, geometry, series, path, color) {
|
|
|
8340
8364
|
detail: { of: "chartSeries", series: series.id },
|
|
8341
8365
|
style: {
|
|
8342
8366
|
fill: { kind: "none" },
|
|
8343
|
-
stroke:
|
|
8367
|
+
stroke: chunkQL7MNEMT_cjs.paint(color, diagnostics, chart.id),
|
|
8344
8368
|
strokeWidth: geometry.strokeWidth,
|
|
8345
8369
|
lineJoin: "round",
|
|
8346
|
-
shadow:
|
|
8370
|
+
shadow: chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle)
|
|
8347
8371
|
}
|
|
8348
8372
|
};
|
|
8349
8373
|
}
|
|
@@ -8359,8 +8383,8 @@ function createSeriesPoints(context, geometry, series, points, color) {
|
|
|
8359
8383
|
rx: geometry.pointSize,
|
|
8360
8384
|
ry: geometry.pointSize,
|
|
8361
8385
|
detail: { of: "chartValue", series: series.id, valueIndex: pointIndex, mark: "radar-vertex" },
|
|
8362
|
-
prop:
|
|
8363
|
-
style: { fill:
|
|
8386
|
+
prop: chunkQL7MNEMT_cjs.seriesValueProp(series.id, pointIndex),
|
|
8387
|
+
style: { fill: chunkQL7MNEMT_cjs.paint(color, diagnostics, chart.id) }
|
|
8364
8388
|
}));
|
|
8365
8389
|
}
|
|
8366
8390
|
|
|
@@ -8414,25 +8438,25 @@ function ringProgressPath(cx, cy, r, sweep, from) {
|
|
|
8414
8438
|
}
|
|
8415
8439
|
function layoutOf2(context) {
|
|
8416
8440
|
const { chart, plot } = context;
|
|
8417
|
-
const axisMin =
|
|
8441
|
+
const axisMin = chunkQL7MNEMT_cjs.finite(chart.axisY.min, 0);
|
|
8418
8442
|
return {
|
|
8419
8443
|
centerX: plot.x + plot.width / 2,
|
|
8420
8444
|
centerY: plot.y + plot.height / 2,
|
|
8421
8445
|
outerRadius: Math.max(1, Math.min(plot.width, plot.height) / 2 - 4),
|
|
8422
|
-
ringThickness: Math.max(1,
|
|
8423
|
-
ringGap: Math.max(0,
|
|
8446
|
+
ringThickness: Math.max(1, chunkQL7MNEMT_cjs.finite(chart.config?.ringThickness, DEFAULT_RING_THICKNESS)),
|
|
8447
|
+
ringGap: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.ringGap, DEFAULT_RING_GAP)),
|
|
8424
8448
|
axisMin,
|
|
8425
|
-
range:
|
|
8426
|
-
start: TOP3 +
|
|
8427
|
-
total: Math.min(360, Math.max(1,
|
|
8428
|
-
trackOpacity: Math.min(1, Math.max(0,
|
|
8449
|
+
range: chunkQL7MNEMT_cjs.finite(chart.axisY.max, 100) - axisMin,
|
|
8450
|
+
start: TOP3 + chunkQL7MNEMT_cjs.finite(chart.config?.ringStartAngle, 0) * Math.PI / 180,
|
|
8451
|
+
total: Math.min(360, Math.max(1, chunkQL7MNEMT_cjs.finite(chart.config?.ringSweep, 360))) * Math.PI / 180,
|
|
8452
|
+
trackOpacity: Math.min(1, Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.ringTrackOpacity, TRACK_OPACITY))),
|
|
8429
8453
|
cap: chart.config?.ringCap ?? "round"
|
|
8430
8454
|
};
|
|
8431
8455
|
}
|
|
8432
8456
|
function ringEndShadows(context, layout, series, radius, sweep, color) {
|
|
8433
8457
|
const { chart, bounds, nextOrder } = context;
|
|
8434
8458
|
const { centerX, centerY, ringThickness, start } = layout;
|
|
8435
|
-
const shadow =
|
|
8459
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
8436
8460
|
const isFullCircle = sweep >= Math.PI * 2 - FULL_SWEEP_EPSILON;
|
|
8437
8461
|
if (!shadow || isFullCircle) {
|
|
8438
8462
|
return [];
|
|
@@ -8470,8 +8494,8 @@ function ringNodes2(context, layout, series, index) {
|
|
|
8470
8494
|
if (radius <= ringThickness / 2) {
|
|
8471
8495
|
return [];
|
|
8472
8496
|
}
|
|
8473
|
-
const color =
|
|
8474
|
-
const value = Math.max(0,
|
|
8497
|
+
const color = chunkQL7MNEMT_cjs.paint(series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[index % chunkQL7MNEMT_cjs.CHART_COLORS.length], diagnostics, chart.id);
|
|
8498
|
+
const value = Math.max(0, chunkQL7MNEMT_cjs.finite(series.values[0], 0));
|
|
8475
8499
|
const fraction = range > 0 ? Math.min(1, Math.max(0, (value - axisMin) / range)) : 0;
|
|
8476
8500
|
const trackStyle = {
|
|
8477
8501
|
fill: { kind: "none" },
|
|
@@ -8509,7 +8533,7 @@ function ringNodes2(context, layout, series, index) {
|
|
|
8509
8533
|
bounds,
|
|
8510
8534
|
d: ringProgressPath(centerX, centerY, radius, sweep, start),
|
|
8511
8535
|
detail: { of: "chartValue", series: series.id, valueIndex: 0, mark: "radial-bar-ring" },
|
|
8512
|
-
prop:
|
|
8536
|
+
prop: chunkQL7MNEMT_cjs.seriesValueProp(series.id, 0),
|
|
8513
8537
|
style: { fill: { kind: "none" }, stroke: color, strokeWidth: ringThickness, lineCap: cap }
|
|
8514
8538
|
};
|
|
8515
8539
|
return [track, ...casters, progress];
|
|
@@ -8521,7 +8545,7 @@ function renderRadialBar(context) {
|
|
|
8521
8545
|
|
|
8522
8546
|
// src/renderScene/charts/renderers/sankey/links.ts
|
|
8523
8547
|
function renderSankeyLinks(context, data) {
|
|
8524
|
-
const shadow =
|
|
8548
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(context.chart.shadowStyle);
|
|
8525
8549
|
const gradient = Boolean(context.chart.config?.linkGradient);
|
|
8526
8550
|
const { plot } = context;
|
|
8527
8551
|
const clipPath = shadow ? `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z` : void 0;
|
|
@@ -8542,8 +8566,8 @@ function createSankeyLinkRibbon(context, data, link, linkIndex, gradient) {
|
|
|
8542
8566
|
bottom: data.baseY + link.targetY1
|
|
8543
8567
|
};
|
|
8544
8568
|
const config = context.chart.config;
|
|
8545
|
-
const fromColor = link.color || data.nodeColors.get(link.source) ||
|
|
8546
|
-
const toColor = data.nodeColors.get(link.target) ||
|
|
8569
|
+
const fromColor = link.color || data.nodeColors.get(link.source) || chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL;
|
|
8570
|
+
const toColor = data.nodeColors.get(link.target) || chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL;
|
|
8547
8571
|
const fill2 = gradient ? {
|
|
8548
8572
|
kind: "linear-gradient",
|
|
8549
8573
|
angle: 0,
|
|
@@ -8558,9 +8582,9 @@ function createSankeyLinkRibbon(context, data, link, linkIndex, gradient) {
|
|
|
8558
8582
|
toId: link.target,
|
|
8559
8583
|
source,
|
|
8560
8584
|
target,
|
|
8561
|
-
controlX: source.x + (target.x - source.x) * Math.min(1, Math.max(0,
|
|
8585
|
+
controlX: source.x + (target.x - source.x) * Math.min(1, Math.max(0, chunkQL7MNEMT_cjs.finite(config?.sankeyLinkCurve, 0.5))),
|
|
8562
8586
|
fill: fill2,
|
|
8563
|
-
opacity: Math.min(1, Math.max(0,
|
|
8587
|
+
opacity: Math.min(1, Math.max(0, chunkQL7MNEMT_cjs.finite(config?.sankeyLinkOpacity, link.color ? 0.85 : 0.45)))
|
|
8564
8588
|
};
|
|
8565
8589
|
}
|
|
8566
8590
|
function createSankeyRibbonNode(context, ribbon, shadow, clipPath, gradient) {
|
|
@@ -8601,7 +8625,7 @@ function sankeyRibbonPath(ribbon) {
|
|
|
8601
8625
|
var OUTSIDE_LABEL_LIGHTNESS_ON_LIGHT_BG = 0.3;
|
|
8602
8626
|
var OUTSIDE_LABEL_LIGHTNESS_ON_DARK_BG = 0.78;
|
|
8603
8627
|
function renderSankeyNodes(context, data) {
|
|
8604
|
-
const cornerRadius = Math.max(0,
|
|
8628
|
+
const cornerRadius = Math.max(0, chunkQL7MNEMT_cjs.finite(context.chart.config?.barCornerRadius, 0));
|
|
8605
8629
|
const nodes = [];
|
|
8606
8630
|
data.nodes.forEach((node) => {
|
|
8607
8631
|
nodes.push(createNodeRect(context, data, node, cornerRadius));
|
|
@@ -8617,8 +8641,8 @@ function createNodeRect(context, data, node, cornerRadius) {
|
|
|
8617
8641
|
const x = data.baseX + node.x;
|
|
8618
8642
|
const y = data.baseY + node.y;
|
|
8619
8643
|
const style = {
|
|
8620
|
-
fill: { kind: "solid", color: node.color ||
|
|
8621
|
-
shadow:
|
|
8644
|
+
fill: { kind: "solid", color: node.color || chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL },
|
|
8645
|
+
shadow: chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle)
|
|
8622
8646
|
};
|
|
8623
8647
|
const isFirstColumn = node.column === 0;
|
|
8624
8648
|
const isLastColumn = node.column === data.columnCount - 1;
|
|
@@ -8644,7 +8668,7 @@ function createNodeRect(context, data, node, cornerRadius) {
|
|
|
8644
8668
|
id: `chart-sankey-node-${chart.id}-${node.id}`,
|
|
8645
8669
|
order: nextOrder(),
|
|
8646
8670
|
bounds,
|
|
8647
|
-
d:
|
|
8671
|
+
d: chunkQL7MNEMT_cjs.leftRoundedRectPath(x, y, node.width, node.height, cornerRadius),
|
|
8648
8672
|
style,
|
|
8649
8673
|
detail
|
|
8650
8674
|
};
|
|
@@ -8655,7 +8679,7 @@ function createNodeRect(context, data, node, cornerRadius) {
|
|
|
8655
8679
|
id: `chart-sankey-node-${chart.id}-${node.id}`,
|
|
8656
8680
|
order: nextOrder(),
|
|
8657
8681
|
bounds,
|
|
8658
|
-
d:
|
|
8682
|
+
d: chunkQL7MNEMT_cjs.rightRoundedRectPath(x, y, node.width, node.height, cornerRadius),
|
|
8659
8683
|
style,
|
|
8660
8684
|
detail
|
|
8661
8685
|
};
|
|
@@ -8681,9 +8705,9 @@ function createNodeLabel(context, data, node) {
|
|
|
8681
8705
|
return void 0;
|
|
8682
8706
|
}
|
|
8683
8707
|
const fallback = chart.textColor ?? "#0f172a";
|
|
8684
|
-
const defaultColor = position === "inside" ?
|
|
8708
|
+
const defaultColor = position === "inside" ? chunkQL7MNEMT_cjs.contrastTextColor(node.color) : chunkQL7MNEMT_cjs.sameHueTint(
|
|
8685
8709
|
node.color,
|
|
8686
|
-
|
|
8710
|
+
chunkQL7MNEMT_cjs.isLightColor(fallback) ? OUTSIDE_LABEL_LIGHTNESS_ON_DARK_BG : OUTSIDE_LABEL_LIGHTNESS_ON_LIGHT_BG
|
|
8687
8711
|
) ?? fallback;
|
|
8688
8712
|
const color = chart.config?.labelColor ?? defaultColor;
|
|
8689
8713
|
return { ...label, color, detail: { of: "chartSeries", series: node.id, mark: "sankey-node-label" } };
|
|
@@ -8695,7 +8719,7 @@ function createOutsideLabel(context, data, node) {
|
|
|
8695
8719
|
const y = data.baseY + node.y;
|
|
8696
8720
|
const labelX2 = isLastColumn ? x - data.labelGutter + 8 : x + node.width + 6;
|
|
8697
8721
|
return {
|
|
8698
|
-
...
|
|
8722
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
8699
8723
|
id: `chart-sankey-label-${chart.id}-${node.id}`,
|
|
8700
8724
|
order: nextOrder(),
|
|
8701
8725
|
bounds,
|
|
@@ -8720,11 +8744,11 @@ function createInsideLabel(context, data, node, orientation) {
|
|
|
8720
8744
|
if (orientation === "vertical") {
|
|
8721
8745
|
const thickness = fontSize * 1.4;
|
|
8722
8746
|
const width = Math.max(1, node.height - 8);
|
|
8723
|
-
if (
|
|
8747
|
+
if (chunkQL7MNEMT_cjs.estimateTextWidth(node.label, fontSize, false) > width) {
|
|
8724
8748
|
return void 0;
|
|
8725
8749
|
}
|
|
8726
8750
|
return {
|
|
8727
|
-
...
|
|
8751
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
8728
8752
|
id,
|
|
8729
8753
|
order: nextOrder(),
|
|
8730
8754
|
bounds,
|
|
@@ -8741,7 +8765,7 @@ function createInsideLabel(context, data, node, orientation) {
|
|
|
8741
8765
|
};
|
|
8742
8766
|
}
|
|
8743
8767
|
return {
|
|
8744
|
-
...
|
|
8768
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
8745
8769
|
id,
|
|
8746
8770
|
order: nextOrder(),
|
|
8747
8771
|
bounds,
|
|
@@ -8762,18 +8786,18 @@ function createSankeyRenderData(context) {
|
|
|
8762
8786
|
const labelGutter = showLabels ? 92 : 0;
|
|
8763
8787
|
const availableWidth = Math.max(1, plot.width - labelGutter * 2);
|
|
8764
8788
|
const layout = layoutSankey(createNodeInputs(context), createLinkInputs(context), availableWidth, plot.height, {
|
|
8765
|
-
nodeWidth: Math.max(1,
|
|
8766
|
-
nodeGap: Math.max(0,
|
|
8789
|
+
nodeWidth: Math.max(1, chunkQL7MNEMT_cjs.finite(chart.config?.sankeyNodeWidth, 18)),
|
|
8790
|
+
nodeGap: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.sankeyNodeGap, 8))
|
|
8767
8791
|
});
|
|
8768
8792
|
return {
|
|
8769
8793
|
...layout,
|
|
8770
8794
|
baseX: plot.x + labelGutter,
|
|
8771
8795
|
baseY: plot.y,
|
|
8772
8796
|
labelGutter,
|
|
8773
|
-
fontSize: Math.max(9,
|
|
8774
|
-
labelSize: Math.max(6,
|
|
8797
|
+
fontSize: Math.max(9, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12)),
|
|
8798
|
+
labelSize: Math.max(6, chunkQL7MNEMT_cjs.finite(chart.config?.sankeyLabelSize, Math.max(9, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12)) - 2)),
|
|
8775
8799
|
columnCount: Math.max(1, ...layout.nodes.map((node) => node.column + 1)),
|
|
8776
|
-
nodeColors: new Map(layout.nodes.map((node) => [node.id, node.color ||
|
|
8800
|
+
nodeColors: new Map(layout.nodes.map((node) => [node.id, node.color || chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL]))
|
|
8777
8801
|
};
|
|
8778
8802
|
}
|
|
8779
8803
|
function createNodeInputs(context) {
|
|
@@ -8795,7 +8819,7 @@ function createLinkInputs(context) {
|
|
|
8795
8819
|
source: series.source,
|
|
8796
8820
|
target: series.target,
|
|
8797
8821
|
value: series.values[0] ?? 0,
|
|
8798
|
-
color: series.color ?
|
|
8822
|
+
color: series.color ? chunkQL7MNEMT_cjs.representativeColor(series.color, chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL) : void 0
|
|
8799
8823
|
});
|
|
8800
8824
|
});
|
|
8801
8825
|
return inputs;
|
|
@@ -8814,9 +8838,9 @@ function renderSankey(context) {
|
|
|
8814
8838
|
var DEFAULT_POINT_SIZE = 4;
|
|
8815
8839
|
function renderScatter(context) {
|
|
8816
8840
|
const nodes = [];
|
|
8817
|
-
const shadow =
|
|
8841
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(context.chart.shadowStyle);
|
|
8818
8842
|
context.chart.series.forEach((series, seriesIndex) => {
|
|
8819
|
-
const color = series.color ??
|
|
8843
|
+
const color = series.color ?? chunkQL7MNEMT_cjs.CHART_COLORS[seriesIndex % chunkQL7MNEMT_cjs.CHART_COLORS.length];
|
|
8820
8844
|
const points = pixelPoints(context, seriesValuePairs(context.chart, series));
|
|
8821
8845
|
points.forEach((point, pointIndex) => {
|
|
8822
8846
|
nodes.push(createScatterPoint(context, series, point, pointIndex, color, shadow));
|
|
@@ -8840,8 +8864,8 @@ function createScatterPoint(context, series, point, pointIndex, color, shadow) {
|
|
|
8840
8864
|
ry: radius,
|
|
8841
8865
|
detail: { of: "chartValue", series: series.id, valueIndex: pointIndex },
|
|
8842
8866
|
style: {
|
|
8843
|
-
fill:
|
|
8844
|
-
stroke: strokeWidth > 0 ?
|
|
8867
|
+
fill: chunkQL7MNEMT_cjs.paint(color, diagnostics, chart.id),
|
|
8868
|
+
stroke: strokeWidth > 0 ? chunkQL7MNEMT_cjs.paint(config?.pointStrokeColor ?? color, diagnostics, chart.id) : void 0,
|
|
8845
8869
|
strokeWidth: strokeWidth > 0 ? strokeWidth : void 0,
|
|
8846
8870
|
opacity: config?.pointOpacity,
|
|
8847
8871
|
shadow
|
|
@@ -8852,14 +8876,14 @@ function createScatterPoint(context, series, point, pointIndex, color, shadow) {
|
|
|
8852
8876
|
// src/renderScene/charts/renderers/treemap/layout.ts
|
|
8853
8877
|
function createTreemapLayout(context) {
|
|
8854
8878
|
const { chart, plot, showLegend } = context;
|
|
8855
|
-
const fontSize = Math.max(9,
|
|
8879
|
+
const fontSize = Math.max(9, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12));
|
|
8856
8880
|
const legendPosition = chart.legendPosition === "left" ? "left" : chart.legendPosition === "right" ? "right" : "bottom";
|
|
8857
8881
|
const legendHeight = showLegend && legendPosition === "bottom" ? 48 : 0;
|
|
8858
|
-
const cellGap = Math.max(0,
|
|
8882
|
+
const cellGap = Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.cellGap, 0));
|
|
8859
8883
|
return {
|
|
8860
8884
|
leaves: chart.series,
|
|
8861
|
-
bands:
|
|
8862
|
-
zones: chart.config?.zones?.length ? chart.config.zones :
|
|
8885
|
+
bands: chunkQL7MNEMT_cjs.axisBands(chart.axisY),
|
|
8886
|
+
zones: chart.config?.zones?.length ? chart.config.zones : chunkQL7MNEMT_cjs.DEFAULT_HEATMAP_ZONES,
|
|
8863
8887
|
fontSize,
|
|
8864
8888
|
smallFontSize: Math.max(8, fontSize - 1),
|
|
8865
8889
|
legendPosition,
|
|
@@ -8867,18 +8891,18 @@ function createTreemapLayout(context) {
|
|
|
8867
8891
|
gridWidth: Math.max(1, plot.width),
|
|
8868
8892
|
gridHeight: Math.max(1, plot.height - legendHeight),
|
|
8869
8893
|
cellGap,
|
|
8870
|
-
cellRadius: Math.max(0,
|
|
8871
|
-
headerHeight: Math.max(0,
|
|
8872
|
-
labelSize: Math.max(6,
|
|
8873
|
-
valueSize: Math.max(6,
|
|
8874
|
-
labelPadding: Math.max(0,
|
|
8894
|
+
cellRadius: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.barCornerRadius, cellGap)),
|
|
8895
|
+
headerHeight: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.headerHeight, 20)),
|
|
8896
|
+
labelSize: Math.max(6, chunkQL7MNEMT_cjs.finite(chart.config?.tileLabelSize, Math.max(8, fontSize - 1))),
|
|
8897
|
+
valueSize: Math.max(6, chunkQL7MNEMT_cjs.finite(chart.config?.tileValueSize, Math.max(8, fontSize - 1))),
|
|
8898
|
+
labelPadding: Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.tileLabelPadding, 4))
|
|
8875
8899
|
};
|
|
8876
8900
|
}
|
|
8877
8901
|
function treemapLeafValue(leaf) {
|
|
8878
8902
|
return leaf.values[0] ?? 0;
|
|
8879
8903
|
}
|
|
8880
8904
|
function treemapLeafColor(leaf, layout) {
|
|
8881
|
-
return leaf.color ??
|
|
8905
|
+
return leaf.color ?? chunkQL7MNEMT_cjs.zoneColorAtValue(treemapLeafValue(leaf), layout.bands, layout.zones);
|
|
8882
8906
|
}
|
|
8883
8907
|
|
|
8884
8908
|
// src/renderScene/charts/renderers/treemap/legend.ts
|
|
@@ -8903,7 +8927,7 @@ function bandStops(layout) {
|
|
|
8903
8927
|
const zones = layout.zones.slice(0, bandCount);
|
|
8904
8928
|
return zones.map((zone, index) => ({
|
|
8905
8929
|
offset: bandRatio2(layout, layout.bands[index + 1] ?? layout.bands[layout.bands.length - 1]) * 100,
|
|
8906
|
-
color: zone.color ??
|
|
8930
|
+
color: zone.color ?? chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL
|
|
8907
8931
|
}));
|
|
8908
8932
|
}
|
|
8909
8933
|
function renderBottomLegend(context, layout) {
|
|
@@ -8912,7 +8936,7 @@ function renderBottomLegend(context, layout) {
|
|
|
8912
8936
|
const barWidth = layout.gridWidth;
|
|
8913
8937
|
const labelHeight = layout.fontSize + 2;
|
|
8914
8938
|
const barY = plot.y + layout.gridHeight + CHART_GAP;
|
|
8915
|
-
const barBounds =
|
|
8939
|
+
const barBounds = chunkQL7MNEMT_cjs.boxBounds({ x: barX, y: barY, width: barWidth, height: BAR_THICKNESS2 });
|
|
8916
8940
|
const stops = bandStops(layout);
|
|
8917
8941
|
const bar = {
|
|
8918
8942
|
type: "rect",
|
|
@@ -8926,7 +8950,7 @@ function renderBottomLegend(context, layout) {
|
|
|
8926
8950
|
rx: 3,
|
|
8927
8951
|
zoneGradient: { axis: "y", min: chart.axisY.min, max: chart.axisY.max },
|
|
8928
8952
|
style: {
|
|
8929
|
-
fill: stops.length ? { kind: "linear-gradient", angle: 0, stops } : { kind: "solid", color:
|
|
8953
|
+
fill: stops.length ? { kind: "linear-gradient", angle: 0, stops } : { kind: "solid", color: chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL },
|
|
8930
8954
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
8931
8955
|
strokeWidth: 1
|
|
8932
8956
|
}
|
|
@@ -8949,12 +8973,12 @@ function renderBottomLegend(context, layout) {
|
|
|
8949
8973
|
const isLast = index === layout.bands.length - 1;
|
|
8950
8974
|
const align = isFirst ? "left" : isLast ? "right" : "center";
|
|
8951
8975
|
const frameX = isFirst ? x : isLast ? x - LABEL_SIZE : x - LABEL_SIZE / 2;
|
|
8952
|
-
const label =
|
|
8976
|
+
const label = chunkQL7MNEMT_cjs.chartText({
|
|
8953
8977
|
id: `chart-treemap-legend-tick-label-${chart.id}-${index}`,
|
|
8954
8978
|
order: nextOrder(),
|
|
8955
8979
|
bounds,
|
|
8956
8980
|
frame: { x: frameX, y: barY + BAR_THICKNESS2 + TICK_LENGTH3 + ROW_GAP2, width: LABEL_SIZE, height: labelHeight },
|
|
8957
|
-
text:
|
|
8981
|
+
text: chunkQL7MNEMT_cjs.formatFieldValue(value),
|
|
8958
8982
|
chart,
|
|
8959
8983
|
align
|
|
8960
8984
|
});
|
|
@@ -8968,7 +8992,7 @@ function renderSideLegend(context, layout) {
|
|
|
8968
8992
|
const barTop = plot.y;
|
|
8969
8993
|
const barHeight = layout.gridHeight;
|
|
8970
8994
|
const barX = side === "left" ? plot.x - CHART_GAP - BAR_THICKNESS2 : plot.x + layout.gridWidth + CHART_GAP;
|
|
8971
|
-
const barBounds =
|
|
8995
|
+
const barBounds = chunkQL7MNEMT_cjs.boxBounds({ x: barX, y: barTop, width: BAR_THICKNESS2, height: barHeight });
|
|
8972
8996
|
const stops = bandStops(layout);
|
|
8973
8997
|
const bar = {
|
|
8974
8998
|
type: "rect",
|
|
@@ -8982,7 +9006,7 @@ function renderSideLegend(context, layout) {
|
|
|
8982
9006
|
rx: 3,
|
|
8983
9007
|
zoneGradient: { axis: "y", min: chart.axisY.min, max: chart.axisY.max },
|
|
8984
9008
|
style: {
|
|
8985
|
-
fill: stops.length ? { kind: "linear-gradient", angle: 270, stops } : { kind: "solid", color:
|
|
9009
|
+
fill: stops.length ? { kind: "linear-gradient", angle: 270, stops } : { kind: "solid", color: chunkQL7MNEMT_cjs.DEFAULT_ZONE_FILL },
|
|
8986
9010
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
8987
9011
|
strokeWidth: 1
|
|
8988
9012
|
}
|
|
@@ -9004,12 +9028,12 @@ function renderSideLegend(context, layout) {
|
|
|
9004
9028
|
strokeWidth: 1
|
|
9005
9029
|
}
|
|
9006
9030
|
};
|
|
9007
|
-
const label =
|
|
9031
|
+
const label = chunkQL7MNEMT_cjs.chartText({
|
|
9008
9032
|
id: `chart-treemap-legend-tick-label-${chart.id}-${index}`,
|
|
9009
9033
|
order: nextOrder(),
|
|
9010
9034
|
bounds,
|
|
9011
9035
|
frame: { x: labelX2, y: y - layout.fontSize / 2, width: LABEL_SIZE, height: layout.fontSize + 2 },
|
|
9012
|
-
text:
|
|
9036
|
+
text: chunkQL7MNEMT_cjs.formatFieldValue(value),
|
|
9013
9037
|
chart,
|
|
9014
9038
|
align: side === "left" ? "right" : "left"
|
|
9015
9039
|
});
|
|
@@ -9097,7 +9121,7 @@ function renderTreemapHeader(context, layout, header, index) {
|
|
|
9097
9121
|
};
|
|
9098
9122
|
const smallFontSize = Math.max(8, Math.max(9, chart.fontSize ?? 12) - 1);
|
|
9099
9123
|
const label = {
|
|
9100
|
-
...
|
|
9124
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
9101
9125
|
id: `chart-treemap-header-label-${chart.id}-${index}`,
|
|
9102
9126
|
order: nextOrder(),
|
|
9103
9127
|
bounds,
|
|
@@ -9112,7 +9136,7 @@ function renderTreemapHeader(context, layout, header, index) {
|
|
|
9112
9136
|
align: "center"
|
|
9113
9137
|
}),
|
|
9114
9138
|
fontSize: smallFontSize,
|
|
9115
|
-
color:
|
|
9139
|
+
color: chunkQL7MNEMT_cjs.contrastTextColor(fill2)
|
|
9116
9140
|
};
|
|
9117
9141
|
return [background, label];
|
|
9118
9142
|
}
|
|
@@ -9128,7 +9152,7 @@ function renderTile(context, layout, tile, nextTile) {
|
|
|
9128
9152
|
function createTileNode(context, layout, tile, color, nextColor) {
|
|
9129
9153
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
9130
9154
|
const gap = layout.cellGap;
|
|
9131
|
-
const shadow =
|
|
9155
|
+
const shadow = chunkQL7MNEMT_cjs.resolveChartShadow(chart.shadowStyle);
|
|
9132
9156
|
const clipPath = shadow ? `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z` : void 0;
|
|
9133
9157
|
const tileX = plot.x + tile.x + gap / 2;
|
|
9134
9158
|
const tileY = plot.y + tile.y + gap / 2;
|
|
@@ -9145,10 +9169,10 @@ function createTileNode(context, layout, tile, color, nextColor) {
|
|
|
9145
9169
|
kind: "linear-gradient",
|
|
9146
9170
|
angle: 0,
|
|
9147
9171
|
stops: [
|
|
9148
|
-
{ offset: 0, color:
|
|
9149
|
-
{ offset: 100, color:
|
|
9172
|
+
{ offset: 0, color: chunkQL7MNEMT_cjs.representativeColor(color, fallback) },
|
|
9173
|
+
{ offset: 100, color: chunkQL7MNEMT_cjs.representativeColor(nextColor, fallback) }
|
|
9150
9174
|
]
|
|
9151
|
-
} :
|
|
9175
|
+
} : chunkQL7MNEMT_cjs.paint(color, diagnostics, chart.id);
|
|
9152
9176
|
return {
|
|
9153
9177
|
type: "rect",
|
|
9154
9178
|
id: `chart-treemap-tile-${chart.id}-${tile.item.leaf.id}`,
|
|
@@ -9162,7 +9186,7 @@ function createTileNode(context, layout, tile, color, nextColor) {
|
|
|
9162
9186
|
style: {
|
|
9163
9187
|
fill: fill2,
|
|
9164
9188
|
stroke: { kind: "solid", color: chart.config?.tileStrokeColor ?? chart.gridColor ?? "#e2e8f0" },
|
|
9165
|
-
strokeWidth:
|
|
9189
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.config?.tileStrokeWidth, chunkQL7MNEMT_cjs.finite(chart.gridWidth, 1)),
|
|
9166
9190
|
shadow,
|
|
9167
9191
|
clip: clipPath ? { type: "path", d: clipPath } : void 0
|
|
9168
9192
|
}
|
|
@@ -9177,12 +9201,12 @@ function createTileLabel(context, layout, tile, color) {
|
|
|
9177
9201
|
const height = Math.max(1, tile.height - gap - pad * 1.5);
|
|
9178
9202
|
const x = plot.x + tile.x + gap / 2 + pad;
|
|
9179
9203
|
const y = plot.y + tile.y + gap / 2 + pad * 0.75;
|
|
9180
|
-
const textColor = chart.config?.tileTextColor ??
|
|
9204
|
+
const textColor = chart.config?.tileTextColor ?? chunkQL7MNEMT_cjs.contrastTextColor(chunkQL7MNEMT_cjs.representativeColor(color, "#ffffff"));
|
|
9181
9205
|
const lineHeight = layout.labelSize * 1.2;
|
|
9182
9206
|
const maxLines = Math.max(1, Math.floor(height / lineHeight));
|
|
9183
|
-
const labelLines =
|
|
9207
|
+
const labelLines = chunkQL7MNEMT_cjs.wrapText(leaf.label, width, layout.labelSize).slice(0, maxLines).map((line) => chunkQL7MNEMT_cjs.ellipsizeToWidth(line, width, layout.labelSize, true));
|
|
9184
9208
|
const label = {
|
|
9185
|
-
...
|
|
9209
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
9186
9210
|
id: `chart-treemap-label-${chart.id}-${leaf.id}`,
|
|
9187
9211
|
order: nextOrder(),
|
|
9188
9212
|
bounds,
|
|
@@ -9196,12 +9220,12 @@ function createTileLabel(context, layout, tile, color) {
|
|
|
9196
9220
|
color: textColor
|
|
9197
9221
|
};
|
|
9198
9222
|
const valueText = String(value);
|
|
9199
|
-
const valueFits = labelLines.length * lineHeight + layout.valueSize * 1.2 <= height + 2 &&
|
|
9223
|
+
const valueFits = labelLines.length * lineHeight + layout.valueSize * 1.2 <= height + 2 && chunkQL7MNEMT_cjs.estimateTextWidth(valueText, layout.valueSize, false) <= width;
|
|
9200
9224
|
if (chart.config?.showTileValues === false || !valueFits) {
|
|
9201
9225
|
return [label];
|
|
9202
9226
|
}
|
|
9203
9227
|
const valueNode = {
|
|
9204
|
-
...
|
|
9228
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
9205
9229
|
id: `chart-treemap-value-${chart.id}-${leaf.id}`,
|
|
9206
9230
|
order: nextOrder(),
|
|
9207
9231
|
bounds,
|
|
@@ -9278,7 +9302,7 @@ function buildCartesianChart(foundation) {
|
|
|
9278
9302
|
|
|
9279
9303
|
// src/renderScene/charts/chartFrame.ts
|
|
9280
9304
|
function scaleDetail(chart, plot) {
|
|
9281
|
-
const horizontal =
|
|
9305
|
+
const horizontal = chunkQL7MNEMT_cjs.isHorizontalBar(chart);
|
|
9282
9306
|
const range = horizontal ? `${plot.x},${plot.width}` : `${plot.y},${plot.height}`;
|
|
9283
9307
|
return {
|
|
9284
9308
|
of: "chartScale",
|
|
@@ -9286,7 +9310,7 @@ function scaleDetail(chart, plot) {
|
|
|
9286
9310
|
};
|
|
9287
9311
|
}
|
|
9288
9312
|
function pieDetail(chart, plot) {
|
|
9289
|
-
const { outerRadius, innerRadius, cornerRadius } =
|
|
9313
|
+
const { outerRadius, innerRadius, cornerRadius } = chunkQL7MNEMT_cjs.resolvePieRadii(
|
|
9290
9314
|
plot.width,
|
|
9291
9315
|
plot.height,
|
|
9292
9316
|
chart.config?.innerRadius,
|
|
@@ -9299,8 +9323,8 @@ function pieDetail(chart, plot) {
|
|
|
9299
9323
|
}
|
|
9300
9324
|
function polarAreaDetail(chart, plot) {
|
|
9301
9325
|
const maxRadius = Math.max(1, Math.min(plot.width, plot.height) / 2 - 4);
|
|
9302
|
-
const innerRadius = Math.max(0, Math.min(
|
|
9303
|
-
const cornerRadius = Math.max(0,
|
|
9326
|
+
const innerRadius = Math.max(0, Math.min(chunkQL7MNEMT_cjs.finite(chart.config?.innerRadius, 0), maxRadius - 1));
|
|
9327
|
+
const cornerRadius = Math.max(0, chunkQL7MNEMT_cjs.finite(chart.config?.pieCornerRadius, 0));
|
|
9304
9328
|
return {
|
|
9305
9329
|
of: "pieGeometry",
|
|
9306
9330
|
pieGeometry: `${plot.x + plot.width / 2},${plot.y + plot.height / 2},${maxRadius},${innerRadius},${cornerRadius}`
|
|
@@ -9309,8 +9333,8 @@ function polarAreaDetail(chart, plot) {
|
|
|
9309
9333
|
function radarDetail(chart, plot) {
|
|
9310
9334
|
const configuredCount = (chart.config?.categories?.filter(Boolean) ?? []).length;
|
|
9311
9335
|
const dataCount = Math.max(0, ...chart.series.map((series) => series.values.length));
|
|
9312
|
-
const count =
|
|
9313
|
-
const radius =
|
|
9336
|
+
const count = chunkQL7MNEMT_cjs.radarCategoryCount(configuredCount, dataCount);
|
|
9337
|
+
const radius = chunkQL7MNEMT_cjs.radarRadius(plot.width, plot.height, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12), chart.showAxisLabels !== false);
|
|
9314
9338
|
const centerX = plot.x + plot.width / 2;
|
|
9315
9339
|
const centerY = plot.y + plot.height / 2;
|
|
9316
9340
|
const curved = chart.chartType === "radial" ? 1 : 0;
|
|
@@ -9344,9 +9368,9 @@ function buildChartFrame(chart, bounds, plot, order) {
|
|
|
9344
9368
|
height: chart.height,
|
|
9345
9369
|
rx: chart.cornerRadius ?? 12,
|
|
9346
9370
|
style: {
|
|
9347
|
-
fill:
|
|
9371
|
+
fill: chunkQL7MNEMT_cjs.paint(chart.fillColor ?? "#ffffff", [], chart.id),
|
|
9348
9372
|
stroke: { kind: "solid", color: chart.strokeColor ?? "#475569" },
|
|
9349
|
-
strokeWidth:
|
|
9373
|
+
strokeWidth: chunkQL7MNEMT_cjs.finite(chart.strokeWidth, 1)
|
|
9350
9374
|
}
|
|
9351
9375
|
};
|
|
9352
9376
|
const detail = frameDetail(chart, plot);
|
|
@@ -9406,7 +9430,7 @@ function buildChartTitle(chart, bounds, plot, renderOrder) {
|
|
|
9406
9430
|
}
|
|
9407
9431
|
return [
|
|
9408
9432
|
{
|
|
9409
|
-
...
|
|
9433
|
+
...chunkQL7MNEMT_cjs.chartText({
|
|
9410
9434
|
id: `chart-title-${chart.id}`,
|
|
9411
9435
|
order: renderOrder.next(),
|
|
9412
9436
|
bounds,
|
|
@@ -9417,8 +9441,8 @@ function buildChartTitle(chart, bounds, plot, renderOrder) {
|
|
|
9417
9441
|
}),
|
|
9418
9442
|
...chart.titleColor ? { color: chart.titleColor } : {},
|
|
9419
9443
|
fontWeight: chart.titleWeight ?? "bold",
|
|
9420
|
-
fontSize:
|
|
9421
|
-
prop:
|
|
9444
|
+
fontSize: chunkQL7MNEMT_cjs.finite(chart.titleSize, Math.max(10, chunkQL7MNEMT_cjs.finite(chart.fontSize, 12)) + 2),
|
|
9445
|
+
prop: chunkQL7MNEMT_cjs.CHART_TITLE_PROP
|
|
9422
9446
|
}
|
|
9423
9447
|
];
|
|
9424
9448
|
}
|
|
@@ -9471,14 +9495,94 @@ function buildChart(chart, index, diagnostics) {
|
|
|
9471
9495
|
// src/renderScene/charts/artifacts.ts
|
|
9472
9496
|
function buildCharts(charts, diagnostics) {
|
|
9473
9497
|
return charts.flatMap(
|
|
9474
|
-
(chart, index) =>
|
|
9498
|
+
(chart, index) => chunkQL7MNEMT_cjs.tag(buildChart(chart, index, diagnostics), "chart", chart.id, chart.chartType, chart.title ?? "Chart")
|
|
9475
9499
|
);
|
|
9476
9500
|
}
|
|
9477
9501
|
|
|
9502
|
+
// src/renderScene/scene/frameClip.ts
|
|
9503
|
+
var ARC_STEPS = 8;
|
|
9504
|
+
function turnOf(node) {
|
|
9505
|
+
const turned = node;
|
|
9506
|
+
if (!turned.rotation) {
|
|
9507
|
+
return void 0;
|
|
9508
|
+
}
|
|
9509
|
+
if (turned.rotationCenter) {
|
|
9510
|
+
return { angle: turned.rotation, x: turned.rotationCenter.x, y: turned.rotationCenter.y };
|
|
9511
|
+
}
|
|
9512
|
+
if (turned.cx !== void 0 && turned.cy !== void 0) {
|
|
9513
|
+
return { angle: turned.rotation, x: turned.cx, y: turned.cy };
|
|
9514
|
+
}
|
|
9515
|
+
if (turned.x !== void 0 && turned.y !== void 0 && turned.width !== void 0 && turned.height !== void 0) {
|
|
9516
|
+
return { angle: turned.rotation, x: turned.x + turned.width / 2, y: turned.y + turned.height / 2 };
|
|
9517
|
+
}
|
|
9518
|
+
return void 0;
|
|
9519
|
+
}
|
|
9520
|
+
function roundedRectPoints(frame) {
|
|
9521
|
+
const { x, y, width, height } = frame;
|
|
9522
|
+
const r = Math.max(0, Math.min(frame.cornerRadius, width / 2, height / 2));
|
|
9523
|
+
if (r === 0) {
|
|
9524
|
+
return [
|
|
9525
|
+
[x, y],
|
|
9526
|
+
[x + width, y],
|
|
9527
|
+
[x + width, y + height],
|
|
9528
|
+
[x, y + height]
|
|
9529
|
+
];
|
|
9530
|
+
}
|
|
9531
|
+
const corners = [
|
|
9532
|
+
[x + width - r, y + r, -90],
|
|
9533
|
+
[x + width - r, y + height - r, 0],
|
|
9534
|
+
[x + r, y + height - r, 90],
|
|
9535
|
+
[x + r, y + r, 180]
|
|
9536
|
+
];
|
|
9537
|
+
return corners.flatMap(
|
|
9538
|
+
([cx, cy, start]) => Array.from({ length: ARC_STEPS + 1 }, (_, step) => {
|
|
9539
|
+
const angle = (start + 90 * step / ARC_STEPS) * Math.PI / 180;
|
|
9540
|
+
return [cx + r * Math.cos(angle), cy + r * Math.sin(angle)];
|
|
9541
|
+
})
|
|
9542
|
+
);
|
|
9543
|
+
}
|
|
9544
|
+
function clipFor(frame, turn) {
|
|
9545
|
+
if (!turn) {
|
|
9546
|
+
return { type: "rect", x: frame.x, y: frame.y, width: frame.width, height: frame.height, rx: frame.cornerRadius };
|
|
9547
|
+
}
|
|
9548
|
+
const back = -turn.angle * Math.PI / 180;
|
|
9549
|
+
const cos = Math.cos(back);
|
|
9550
|
+
const sin = Math.sin(back);
|
|
9551
|
+
const points = roundedRectPoints(frame).map(([px, py]) => {
|
|
9552
|
+
const dx = px - turn.x;
|
|
9553
|
+
const dy = py - turn.y;
|
|
9554
|
+
return [turn.x + dx * cos - dy * sin, turn.y + dx * sin + dy * cos];
|
|
9555
|
+
});
|
|
9556
|
+
const round2 = (value) => Math.round(value * 100) / 100;
|
|
9557
|
+
return { type: "path", d: `M${points.map(([px, py]) => `${round2(px)} ${round2(py)}`).join("L")}Z` };
|
|
9558
|
+
}
|
|
9559
|
+
function applyFrameClips(nodes, frames) {
|
|
9560
|
+
const clipping = new Map(frames.filter((frame) => frame.clip).map((frame) => [frame.id, frame]));
|
|
9561
|
+
if (clipping.size === 0) {
|
|
9562
|
+
return;
|
|
9563
|
+
}
|
|
9564
|
+
const inside = /* @__PURE__ */ new Map();
|
|
9565
|
+
for (const node of nodes) {
|
|
9566
|
+
const parent = node.identity?.parentFrameId;
|
|
9567
|
+
const frame = parent ? clipping.get(parent) : void 0;
|
|
9568
|
+
if (node.identity && frame) {
|
|
9569
|
+
inside.set(`${node.identity.role}:${node.identity.id}`, frame);
|
|
9570
|
+
}
|
|
9571
|
+
}
|
|
9572
|
+
for (const node of nodes) {
|
|
9573
|
+
const frame = node.identity ? inside.get(`${node.identity.role}:${node.identity.id}`) : void 0;
|
|
9574
|
+
const styled = node;
|
|
9575
|
+
if (frame && styled.style) {
|
|
9576
|
+
const edge = clipFor(frame, turnOf(node));
|
|
9577
|
+
styled.style = { ...styled.style, clip: styled.style.clip ? { ...styled.style.clip, within: edge } : edge };
|
|
9578
|
+
}
|
|
9579
|
+
}
|
|
9580
|
+
}
|
|
9581
|
+
|
|
9478
9582
|
// src/renderScene/scene/build.ts
|
|
9479
9583
|
function sceneBounds(nodes) {
|
|
9480
9584
|
if (!nodes.length) {
|
|
9481
|
-
return
|
|
9585
|
+
return chunkQL7MNEMT_cjs.EMPTY_BOUNDS;
|
|
9482
9586
|
}
|
|
9483
9587
|
return {
|
|
9484
9588
|
minX: Math.min(...nodes.map((n) => n.bounds.minX)),
|
|
@@ -9492,8 +9596,8 @@ function stackingOf(input) {
|
|
|
9492
9596
|
const add = (role, objects, legacyBase) => {
|
|
9493
9597
|
objects.forEach((object, index) => {
|
|
9494
9598
|
stacking.set(`${role}:${object.id}`, {
|
|
9495
|
-
rank:
|
|
9496
|
-
sequence:
|
|
9599
|
+
rank: chunkQL7MNEMT_cjs.stackRank(object),
|
|
9600
|
+
sequence: chunkQL7MNEMT_cjs.stackSequence(object, legacyBase + index)
|
|
9497
9601
|
});
|
|
9498
9602
|
});
|
|
9499
9603
|
};
|
|
@@ -9533,6 +9637,7 @@ function buildRenderScene(input, options = {}) {
|
|
|
9533
9637
|
...buildIsometricObjects(input.isometricObjects ?? []),
|
|
9534
9638
|
...buildDimensions(input.dimensions ?? [])
|
|
9535
9639
|
];
|
|
9640
|
+
applyFrameClips(nodes, input.frames);
|
|
9536
9641
|
stampStacking(nodes, input);
|
|
9537
9642
|
nodes.sort(
|
|
9538
9643
|
(a, b) => (a.rank ?? 0) - (b.rank ?? 0) || (a.sequence ?? 0) - (b.sequence ?? 0) || a.order - b.order || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)
|
|
@@ -9555,17 +9660,17 @@ var SvgClipDefinitions = class {
|
|
|
9555
9660
|
prefix;
|
|
9556
9661
|
ids = /* @__PURE__ */ new Map();
|
|
9557
9662
|
clip(style) {
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
const key = JSON.stringify(
|
|
9663
|
+
return style.clip ? this.define(style.clip) : void 0;
|
|
9664
|
+
}
|
|
9665
|
+
define(clip) {
|
|
9666
|
+
const key = JSON.stringify(clip);
|
|
9562
9667
|
let id = this.ids.get(key);
|
|
9563
9668
|
if (!id) {
|
|
9669
|
+
const outer = clip.within ? this.define(clip.within) : void 0;
|
|
9564
9670
|
id = safeId(`${this.prefix}clip-${this.ids.size}`);
|
|
9565
9671
|
this.ids.set(key, id);
|
|
9566
|
-
const clip = style.clip;
|
|
9567
9672
|
const shape = clip.type === "path" ? `<path clip-rule="evenodd" d="${xml(clip.d)}"/>` : `<rect x="${num(clip.x)}" y="${num(clip.y)}" width="${num(clip.width)}" height="${num(clip.height)}" rx="${num(clip.rx)}"/>`;
|
|
9568
|
-
this.addDefinition(`<clipPath id="${id}">${shape}</clipPath>`);
|
|
9673
|
+
this.addDefinition(`<clipPath id="${id}"${outer ? ` clip-path="url(#${outer})"` : ""}>${shape}</clipPath>`);
|
|
9569
9674
|
}
|
|
9570
9675
|
return id;
|
|
9571
9676
|
}
|
|
@@ -9594,7 +9699,8 @@ var SvgFilterDefinitions = class {
|
|
|
9594
9699
|
);
|
|
9595
9700
|
}
|
|
9596
9701
|
if (style.blur || style.saturate !== void 0) {
|
|
9597
|
-
|
|
9702
|
+
const margin = size && size > 0 && style.blur ? Math.max(0.5, style.blur * 1.5 / size) : 0.5;
|
|
9703
|
+
return this.define(nodeId, { blur: style.blur ?? 0, saturate: style.saturate ?? 1 }, blurPrimitives, margin);
|
|
9598
9704
|
}
|
|
9599
9705
|
return void 0;
|
|
9600
9706
|
}
|
|
@@ -9841,12 +9947,19 @@ function addStrokeAttrs(attrs, style) {
|
|
|
9841
9947
|
if (style.pointerEvents) {
|
|
9842
9948
|
attrs.push(`pointer-events="${style.pointerEvents}"`);
|
|
9843
9949
|
}
|
|
9950
|
+
const css = [];
|
|
9844
9951
|
if (style.transition && style.transition > 0) {
|
|
9845
9952
|
const time = `${num(style.transition)}ms ease`;
|
|
9846
|
-
|
|
9847
|
-
`
|
|
9953
|
+
css.push(
|
|
9954
|
+
`transition: x ${time}, y ${time}, width ${time}, height ${time}, cx ${time}, cy ${time}, rx ${time}, ry ${time}, fill ${time}, stroke ${time}, stroke-width ${time}, stroke-dasharray ${time}, opacity ${time}`
|
|
9848
9955
|
);
|
|
9849
9956
|
}
|
|
9957
|
+
if (style.blend) {
|
|
9958
|
+
css.push(`mix-blend-mode: ${xml(style.blend)}`);
|
|
9959
|
+
}
|
|
9960
|
+
if (css.length > 0) {
|
|
9961
|
+
attrs.push(`style="${css.join("; ")}"`);
|
|
9962
|
+
}
|
|
9850
9963
|
}
|
|
9851
9964
|
function elementSize(node) {
|
|
9852
9965
|
const shape = node;
|
|
@@ -9977,31 +10090,31 @@ function chartSeriesAttrs(detail) {
|
|
|
9977
10090
|
];
|
|
9978
10091
|
}
|
|
9979
10092
|
function frameBoundaryAttrs(detail) {
|
|
9980
|
-
return [`${
|
|
10093
|
+
return [`${chunkQL7MNEMT_cjs.CORNER_RADIUS_ATTR}="${num(detail.cornerRadius)}"`, `${chunkQL7MNEMT_cjs.SQUARE_CORNER_ATTR}="${detail.squareCorner}"`];
|
|
9981
10094
|
}
|
|
9982
10095
|
function declaredBoundsAttr(bounds) {
|
|
9983
|
-
return `${
|
|
10096
|
+
return `${chunkQL7MNEMT_cjs.SYMBOL_BOUNDS_ATTR}="${num(bounds.x)},${num(bounds.y)},${num(bounds.width)},${num(bounds.height)}"`;
|
|
9984
10097
|
}
|
|
9985
10098
|
function symbolGeometryAttrs(detail) {
|
|
9986
10099
|
return [
|
|
9987
|
-
`${
|
|
9988
|
-
`${
|
|
10100
|
+
`${chunkQL7MNEMT_cjs.SYMBOL_POINTS_ATTR}="${xml(JSON.stringify(detail.points))}"`,
|
|
10101
|
+
`${chunkQL7MNEMT_cjs.SYMBOL_TENSION_ATTR}="${num(detail.tension)}"`,
|
|
9989
10102
|
declaredBoundsAttr(detail.declaredBounds)
|
|
9990
10103
|
];
|
|
9991
10104
|
}
|
|
9992
10105
|
function pathGeometryAttrs(detail) {
|
|
9993
10106
|
return [
|
|
9994
|
-
`${
|
|
9995
|
-
`${
|
|
9996
|
-
`${
|
|
10107
|
+
`${chunkQL7MNEMT_cjs.PATH_POINTS_ATTR}="${xml(JSON.stringify(detail.points))}"`,
|
|
10108
|
+
`${chunkQL7MNEMT_cjs.PATH_TENSION_ATTR}="${num(detail.tension)}"`,
|
|
10109
|
+
`${chunkQL7MNEMT_cjs.PATH_CLOSED_ATTR}="${detail.closed}"`
|
|
9997
10110
|
];
|
|
9998
10111
|
}
|
|
9999
10112
|
function isometricGeometryAttrs(detail) {
|
|
10000
10113
|
return [
|
|
10001
|
-
`${
|
|
10002
|
-
`${
|
|
10114
|
+
`${chunkQL7MNEMT_cjs.ISOMETRIC_SIZE_ATTR}="${num(detail.width)},${num(detail.height)},${num(detail.depth)}"`,
|
|
10115
|
+
`${chunkQL7MNEMT_cjs.CORNER_RADIUS_ATTR}="${num(detail.cornerRadius)}"`,
|
|
10003
10116
|
declaredBoundsAttr(detail.bounds),
|
|
10004
|
-
`${
|
|
10117
|
+
`${chunkQL7MNEMT_cjs.ISOMETRIC_LABEL_OFFSET_ATTR}="${num(detail.labelOffsetX)},${num(detail.labelOffsetY)}"`
|
|
10005
10118
|
];
|
|
10006
10119
|
}
|
|
10007
10120
|
function linkDetailAttrs(detail) {
|
|
@@ -10148,7 +10261,7 @@ function renderSvgDocument(scene, options = {}) {
|
|
|
10148
10261
|
const nodes = options.linkHitAreas ? withLinkHitAreas(scene.nodes) : scene.nodes;
|
|
10149
10262
|
const body = nodes.map((node) => nodeSvg(node, defs)).join("\n ");
|
|
10150
10263
|
const declaration = options.includeXmlDeclaration === false ? "" : '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
10151
|
-
const svg = `${declaration}<svg xmlns="http://www.w3.org/2000/svg" width="${num(width)}px" height="${num(height)}px" viewBox="${viewBox}" role="img" data-sf-contract="${
|
|
10264
|
+
const svg = `${declaration}<svg xmlns="http://www.w3.org/2000/svg" width="${num(width)}px" height="${num(height)}px" viewBox="${viewBox}" role="img" data-sf-contract="${chunkQL7MNEMT_cjs.DOM_CONTRACT_VERSION}">
|
|
10152
10265
|
<defs>${defs.entries.join("")}</defs>
|
|
10153
10266
|
${body}
|
|
10154
10267
|
</svg>`;
|
|
@@ -10168,9 +10281,9 @@ function renderCanvas(input, options = {}) {
|
|
|
10168
10281
|
}
|
|
10169
10282
|
var SCENE_CACHE_LIMIT = 50;
|
|
10170
10283
|
var sceneCache = /* @__PURE__ */ new Map();
|
|
10171
|
-
var cachedForRegistry =
|
|
10284
|
+
var cachedForRegistry = chunkQL7MNEMT_cjs.componentRegistryVersion();
|
|
10172
10285
|
function cachedRenderScene(source) {
|
|
10173
|
-
const registry =
|
|
10286
|
+
const registry = chunkQL7MNEMT_cjs.componentRegistryVersion();
|
|
10174
10287
|
if (registry !== cachedForRegistry) {
|
|
10175
10288
|
sceneCache.clear();
|
|
10176
10289
|
cachedForRegistry = registry;
|
|
@@ -10202,7 +10315,7 @@ function render(source, options = {}) {
|
|
|
10202
10315
|
var SCENE_ORDER_BASE = 1e4;
|
|
10203
10316
|
function defineComponent(definition) {
|
|
10204
10317
|
const { scene, ...descriptor } = definition;
|
|
10205
|
-
const unregisterDescriptor =
|
|
10318
|
+
const unregisterDescriptor = chunkQL7MNEMT_cjs.registerComponentDescriptor(descriptor);
|
|
10206
10319
|
const unregisterBuilder = registerComponentBuilder(
|
|
10207
10320
|
descriptor.type,
|
|
10208
10321
|
(component, index) => scene(component, { order: SCENE_ORDER_BASE + index })
|
|
@@ -10221,5 +10334,5 @@ exports.render = render;
|
|
|
10221
10334
|
exports.renderCanvas = renderCanvas;
|
|
10222
10335
|
exports.sflToRenderInput = sflToRenderInput;
|
|
10223
10336
|
exports.sliderReach = sliderReach;
|
|
10224
|
-
//# sourceMappingURL=chunk-
|
|
10225
|
-
//# sourceMappingURL=chunk-
|
|
10337
|
+
//# sourceMappingURL=chunk-YSXD5IVZ.cjs.map
|
|
10338
|
+
//# sourceMappingURL=chunk-YSXD5IVZ.cjs.map
|