stickyflow 0.5.0 → 0.6.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 +16 -0
- 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-IEHE6WVN.js → chunk-4G2R7PEL.js} +319 -45
- package/dist/chunk-4G2R7PEL.js.map +1 -0
- package/dist/{chunk-L3VJXZFD.cjs → chunk-4LENHH6C.cjs} +15 -15
- package/dist/{chunk-L3VJXZFD.cjs.map → chunk-4LENHH6C.cjs.map} +1 -1
- package/dist/{chunk-LTGF5OHP.js → chunk-FVHVOJS2.js} +395 -89
- package/dist/chunk-FVHVOJS2.js.map +1 -0
- package/dist/{chunk-TWDLOXRM.cjs → chunk-JIJMZMGY.cjs} +18 -18
- package/dist/{chunk-TWDLOXRM.cjs.map → chunk-JIJMZMGY.cjs.map} +1 -1
- package/dist/{chunk-VK3T6O5Z.cjs → chunk-KTNCDNDB.cjs} +33 -33
- package/dist/{chunk-VK3T6O5Z.cjs.map → chunk-KTNCDNDB.cjs.map} +1 -1
- package/dist/{chunk-BODZN3ZI.js → chunk-MFNUJA26.js} +4 -4
- package/dist/{chunk-BODZN3ZI.js.map → chunk-MFNUJA26.js.map} +1 -1
- package/dist/{chunk-7VW2XKVB.js → chunk-ULQZ6CZW.js} +3 -3
- package/dist/{chunk-7VW2XKVB.js.map → chunk-ULQZ6CZW.js.map} +1 -1
- package/dist/{chunk-ZMLQIMJK.cjs → chunk-WQRT5PVT.cjs} +993 -687
- package/dist/chunk-WQRT5PVT.cjs.map +1 -0
- package/dist/{chunk-G7NRK5AG.js → chunk-WRDVNMFS.js} +5 -5
- package/dist/{chunk-G7NRK5AG.js.map → chunk-WRDVNMFS.js.map} +1 -1
- package/dist/{chunk-XY2GZUHC.cjs → chunk-XJ4W6TW4.cjs} +326 -44
- package/dist/chunk-XJ4W6TW4.cjs.map +1 -0
- package/dist/index.cjs +49 -29
- package/dist/index.d.cts +52 -7
- package/dist/index.d.ts +52 -7
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +245 -235
- package/dist/interaction/index.cjs.map +1 -1
- package/dist/interaction/index.d.cts +3 -2
- package/dist/interaction/index.d.ts +3 -2
- package/dist/interaction/index.js +17 -7
- package/dist/interaction/index.js.map +1 -1
- package/dist/{render-CgX_y15a.d.ts → render-Db0eSz_s.d.cts} +36 -15
- package/dist/{render-CgX_y15a.d.cts → render-Db0eSz_s.d.ts} +36 -15
- package/dist/{runtime-reWgr7MP.d.cts → runtime-BhivvBeL.d.cts} +2 -2
- package/dist/{runtime-DnUxca3Y.d.ts → runtime-n2yG-_j-.d.ts} +2 -2
- package/dist/{runtimeTypes-D60w6nyF.d.cts → runtimeTypes-CrkMHvVi.d.cts} +2 -2
- package/dist/{runtimeTypes-CEBGueYM.d.ts → runtimeTypes-DnI7mRF5.d.ts} +2 -2
- package/dist/stickyflow-diagram.global.js +35 -35
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-DvhMpqrL.d.cts → types-BHfUKT4s.d.cts} +1 -1
- package/dist/{types-DYLC_lsk.d.ts → types-D4cH4f1a.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-IEHE6WVN.js.map +0 -1
- package/dist/chunk-LTGF5OHP.js.map +0 -1
- package/dist/chunk-XY2GZUHC.cjs.map +0 -1
- package/dist/chunk-ZMLQIMJK.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXJ4W6TW4_cjs = require('./chunk-XJ4W6TW4.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-]*`;
|
|
@@ -633,7 +633,7 @@ function readComponentValue(descriptor, raw) {
|
|
|
633
633
|
return raw;
|
|
634
634
|
}
|
|
635
635
|
function genericComponentObject(canvasObject) {
|
|
636
|
-
const descriptor =
|
|
636
|
+
const descriptor = chunkXJ4W6TW4_cjs.getComponentDescriptor(canvasObject.component.type);
|
|
637
637
|
return {
|
|
638
638
|
id: canvasObject.id,
|
|
639
639
|
type: canvasObject.component.type,
|
|
@@ -822,7 +822,7 @@ var BUILT_IN_OBJECTS = {
|
|
|
822
822
|
};
|
|
823
823
|
function componentObject(canvasObject) {
|
|
824
824
|
const type = canvasObject.component.type;
|
|
825
|
-
return
|
|
825
|
+
return chunkXJ4W6TW4_cjs.isBuiltInComponentType(type) ? BUILT_IN_OBJECTS[type](canvasObject) : genericComponentObject(canvasObject);
|
|
826
826
|
}
|
|
827
827
|
|
|
828
828
|
// src/renderInput/fromSfl/canvasObjects/connection.ts
|
|
@@ -846,6 +846,26 @@ function connectionObject(c) {
|
|
|
846
846
|
};
|
|
847
847
|
}
|
|
848
848
|
|
|
849
|
+
// src/renderInput/fromSfl/canvasObjects/dimension.ts
|
|
850
|
+
function dimensionObject(canvasObject) {
|
|
851
|
+
const presentation = canvasObject.props;
|
|
852
|
+
return {
|
|
853
|
+
id: canvasObject.id,
|
|
854
|
+
start: canvasObject.dimension.start,
|
|
855
|
+
end: canvasObject.dimension.end,
|
|
856
|
+
offset: canvasObject.dimension.offset,
|
|
857
|
+
text: canvasObject.text,
|
|
858
|
+
unit: canvasObject.dimension.unit,
|
|
859
|
+
strokeColor: solidColor(presentation.stroke),
|
|
860
|
+
strokeWidth: numOf(presentation.strokeWidth),
|
|
861
|
+
textColor: solidColor(presentation.textColor),
|
|
862
|
+
fontSize: numOf(presentation.fontSize),
|
|
863
|
+
order: canvasObject.order,
|
|
864
|
+
sourceIndex: canvasObject.sourceIndex,
|
|
865
|
+
parentFrameId: canvasObject.parentFrameId
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
|
|
849
869
|
// src/renderInput/fromSfl/canvasObjects/frame.ts
|
|
850
870
|
function frameObject(e) {
|
|
851
871
|
const p = e.props;
|
|
@@ -884,6 +904,8 @@ function isometricObject(canvasObject) {
|
|
|
884
904
|
width: canvasObject.width,
|
|
885
905
|
height: canvasObject.height,
|
|
886
906
|
depth: canvasObject.isometric.depth,
|
|
907
|
+
footprint: canvasObject.isometric.footprint,
|
|
908
|
+
form: canvasObject.isometric.form,
|
|
887
909
|
rotation: canvasObject.rotation,
|
|
888
910
|
order: canvasObject.order,
|
|
889
911
|
sourceIndex: canvasObject.sourceIndex,
|
|
@@ -892,7 +914,7 @@ function isometricObject(canvasObject) {
|
|
|
892
914
|
fill: solidColor(presentation.fill) ?? "#f8fafc",
|
|
893
915
|
strokeColor: solidColor(presentation.stroke) ?? "#111827",
|
|
894
916
|
strokeWidth: numOf(presentation.strokeWidth) ?? 1,
|
|
895
|
-
cornerRadius: numOf(presentation.cornerRadius) ?? 8,
|
|
917
|
+
cornerRadius: numOf(presentation.cornerRadius) ?? (canvasObject.isometric.footprint ? 0 : 8),
|
|
896
918
|
hasShadow: shadowStyle?.enabled ?? false,
|
|
897
919
|
shadowStyle,
|
|
898
920
|
labelOffsetX: numOf(presentation.labelOffsetX) ?? 0,
|
|
@@ -1041,8 +1063,9 @@ function collectCanvasObjects(state) {
|
|
|
1041
1063
|
shapes: canvasObjects.filter((canvasObject) => canvasObject.objectType === "shape").map((shape) => shapeObject(shape, shaders)),
|
|
1042
1064
|
frames: canvasObjects.filter((canvasObject) => canvasObject.objectType === "frame").map(frameObject),
|
|
1043
1065
|
swimlanes: canvasObjects.filter((canvasObject) => canvasObject.objectType === "swimlane").map(swimlaneObject),
|
|
1044
|
-
isometricObjects: canvasObjects.filter(
|
|
1066
|
+
isometricObjects: canvasObjects.filter(chunkXJ4W6TW4_cjs.isIsometricObject).map(isometricObject),
|
|
1045
1067
|
paths: canvasObjects.filter((canvasObject) => canvasObject.objectType === "path").map(pathObject),
|
|
1068
|
+
dimensions: canvasObjects.filter(chunkXJ4W6TW4_cjs.isDimensionObject).map(dimensionObject),
|
|
1046
1069
|
charts: canvasObjects.filter((canvasObject) => canvasObject.objectType === "chart").map(chartObject),
|
|
1047
1070
|
components: canvasObjects.filter(
|
|
1048
1071
|
(canvasObject) => canvasObject.objectType === "component" && canvasObject.component !== void 0
|
|
@@ -1069,9 +1092,9 @@ function sidePoint(canvasObject, endpoint) {
|
|
|
1069
1092
|
function namedPortPoint(canvasObject, endpoint) {
|
|
1070
1093
|
const port = canvasObject.symbol?.ports?.find((candidate) => candidate.name === endpoint.port);
|
|
1071
1094
|
if (!port) {
|
|
1072
|
-
return
|
|
1095
|
+
return chunkXJ4W6TW4_cjs.elementCenter(canvasObject);
|
|
1073
1096
|
}
|
|
1074
|
-
return
|
|
1097
|
+
return chunkXJ4W6TW4_cjs.pointAtNormalizedPort(
|
|
1075
1098
|
{
|
|
1076
1099
|
x: canvasObject.x,
|
|
1077
1100
|
y: canvasObject.y,
|
|
@@ -1117,7 +1140,7 @@ function explicitAnchorPoint(canvasObject, endpoint) {
|
|
|
1117
1140
|
return null;
|
|
1118
1141
|
}
|
|
1119
1142
|
function automaticEndpointPoint(canvasObject, opposite) {
|
|
1120
|
-
return opposite ?
|
|
1143
|
+
return opposite ? chunkXJ4W6TW4_cjs.edgePointToward(canvasObject, opposite) : chunkXJ4W6TW4_cjs.elementCenter(canvasObject);
|
|
1121
1144
|
}
|
|
1122
1145
|
function findPositionedCanvasObject(canvasObjects, id) {
|
|
1123
1146
|
return canvasObjects.find((candidate) => candidate.id === id);
|
|
@@ -1135,7 +1158,7 @@ function positionedCanvasObjects(canvasObjects) {
|
|
|
1135
1158
|
];
|
|
1136
1159
|
}
|
|
1137
1160
|
function connectionEndpointPoint(object, face) {
|
|
1138
|
-
return object ?
|
|
1161
|
+
return object ? chunkXJ4W6TW4_cjs.isometricFaceCenter(object, face) : { x: 0, y: 0 };
|
|
1139
1162
|
}
|
|
1140
1163
|
function isometricStackPosition(isometricObjects, id) {
|
|
1141
1164
|
const index = isometricObjects.findIndex((object2) => object2.id === id);
|
|
@@ -1150,8 +1173,8 @@ function connectionStack(isometricObjects, connection) {
|
|
|
1150
1173
|
return { order: connection.order, sourceIndex: connection.sourceIndex };
|
|
1151
1174
|
}
|
|
1152
1175
|
const behind = [
|
|
1153
|
-
|
|
1154
|
-
|
|
1176
|
+
chunkXJ4W6TW4_cjs.VISIBLE_ISOMETRIC_FACES.has(connection.fromFace) ? void 0 : isometricStackPosition(isometricObjects, connection.fromId),
|
|
1177
|
+
chunkXJ4W6TW4_cjs.VISIBLE_ISOMETRIC_FACES.has(connection.toFace) ? void 0 : isometricStackPosition(isometricObjects, connection.toId)
|
|
1155
1178
|
].filter((position) => position !== void 0);
|
|
1156
1179
|
if (!behind.length) {
|
|
1157
1180
|
return { sourceIndex: connection.sourceIndex };
|
|
@@ -1193,7 +1216,7 @@ function createRenderInputLinks(canvasObjects) {
|
|
|
1193
1216
|
|
|
1194
1217
|
// src/renderInput/fromSfl/index.ts
|
|
1195
1218
|
function sflToRenderInput(sfl) {
|
|
1196
|
-
const state =
|
|
1219
|
+
const state = chunkXJ4W6TW4_cjs.sflToCanvasState(sfl);
|
|
1197
1220
|
const canvasObjects = collectCanvasObjects(state);
|
|
1198
1221
|
return {
|
|
1199
1222
|
shapes: canvasObjects.shapes,
|
|
@@ -1201,6 +1224,7 @@ function sflToRenderInput(sfl) {
|
|
|
1201
1224
|
swimlanes: canvasObjects.swimlanes,
|
|
1202
1225
|
isometricObjects: canvasObjects.isometricObjects,
|
|
1203
1226
|
paths: canvasObjects.paths,
|
|
1227
|
+
dimensions: canvasObjects.dimensions,
|
|
1204
1228
|
charts: canvasObjects.charts,
|
|
1205
1229
|
components: canvasObjects.components,
|
|
1206
1230
|
links: createRenderInputLinks(canvasObjects),
|
|
@@ -1211,13 +1235,13 @@ function sflToRenderInput(sfl) {
|
|
|
1211
1235
|
// src/renderScene/artifacts/component/placeholder.ts
|
|
1212
1236
|
var STROKE = "#94a3b8";
|
|
1213
1237
|
function buildPlaceholder(component, index) {
|
|
1214
|
-
const x =
|
|
1215
|
-
const y =
|
|
1216
|
-
const width = Math.max(0,
|
|
1217
|
-
const height = Math.max(0,
|
|
1218
|
-
const rotation =
|
|
1238
|
+
const x = chunkXJ4W6TW4_cjs.finite(component.x, 0);
|
|
1239
|
+
const y = chunkXJ4W6TW4_cjs.finite(component.y, 0);
|
|
1240
|
+
const width = Math.max(0, chunkXJ4W6TW4_cjs.finite(component.width, 120));
|
|
1241
|
+
const height = Math.max(0, chunkXJ4W6TW4_cjs.finite(component.height, 60));
|
|
1242
|
+
const rotation = chunkXJ4W6TW4_cjs.finite(component.rotation, 0);
|
|
1219
1243
|
const order = 1e4 + index;
|
|
1220
|
-
const bounds =
|
|
1244
|
+
const bounds = chunkXJ4W6TW4_cjs.rotatedBounds({ x, y, width, height }, rotation, 2);
|
|
1221
1245
|
return [
|
|
1222
1246
|
{
|
|
1223
1247
|
id: `widget-${component.id}`,
|
|
@@ -1242,7 +1266,7 @@ function buildPlaceholder(component, index) {
|
|
|
1242
1266
|
width,
|
|
1243
1267
|
height,
|
|
1244
1268
|
lines: [component.type],
|
|
1245
|
-
fontFamily:
|
|
1269
|
+
fontFamily: chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
1246
1270
|
fontSize: 12,
|
|
1247
1271
|
fontWeight: "normal",
|
|
1248
1272
|
color: STROKE,
|
|
@@ -1256,44 +1280,44 @@ function buildPlaceholder(component, index) {
|
|
|
1256
1280
|
|
|
1257
1281
|
// src/renderScene/artifacts/component/builtIn.ts
|
|
1258
1282
|
function buildRollingNumber(component, index) {
|
|
1259
|
-
const x =
|
|
1260
|
-
const y =
|
|
1261
|
-
const width = Math.max(0,
|
|
1262
|
-
const height = Math.max(0,
|
|
1263
|
-
const rotation =
|
|
1283
|
+
const x = chunkXJ4W6TW4_cjs.finite(component.x, 0);
|
|
1284
|
+
const y = chunkXJ4W6TW4_cjs.finite(component.y, 0);
|
|
1285
|
+
const width = Math.max(0, chunkXJ4W6TW4_cjs.finite(component.width, 160));
|
|
1286
|
+
const height = Math.max(0, chunkXJ4W6TW4_cjs.finite(component.height, 90));
|
|
1287
|
+
const rotation = chunkXJ4W6TW4_cjs.finite(component.rotation, 0);
|
|
1264
1288
|
return [
|
|
1265
1289
|
{
|
|
1266
1290
|
id: `widget-${component.id}`,
|
|
1267
1291
|
type: "rolling-number",
|
|
1268
1292
|
order: 1e4 + index,
|
|
1269
|
-
bounds:
|
|
1293
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds({ x, y, width, height }, rotation, 2),
|
|
1270
1294
|
x,
|
|
1271
1295
|
y,
|
|
1272
1296
|
width,
|
|
1273
1297
|
height,
|
|
1274
1298
|
rotation,
|
|
1275
|
-
value:
|
|
1299
|
+
value: chunkXJ4W6TW4_cjs.formatRollingNumber(component.value, component.digits),
|
|
1276
1300
|
digits: component.digits,
|
|
1277
|
-
duration: Math.max(0,
|
|
1301
|
+
duration: Math.max(0, chunkXJ4W6TW4_cjs.finite(component.duration, 420)),
|
|
1278
1302
|
label: component.label,
|
|
1279
|
-
componentStyle:
|
|
1303
|
+
componentStyle: chunkXJ4W6TW4_cjs.resolveRollingNumberStyle(component.style)
|
|
1280
1304
|
}
|
|
1281
1305
|
];
|
|
1282
1306
|
}
|
|
1283
1307
|
function buildTickScale(component, index) {
|
|
1284
|
-
const x =
|
|
1285
|
-
const y =
|
|
1286
|
-
const width = Math.max(0,
|
|
1287
|
-
const height = Math.max(0,
|
|
1288
|
-
const rotation =
|
|
1289
|
-
const max =
|
|
1290
|
-
const progress = Math.min(1, Math.max(0,
|
|
1308
|
+
const x = chunkXJ4W6TW4_cjs.finite(component.x, 0);
|
|
1309
|
+
const y = chunkXJ4W6TW4_cjs.finite(component.y, 0);
|
|
1310
|
+
const width = Math.max(0, chunkXJ4W6TW4_cjs.finite(component.width, 200));
|
|
1311
|
+
const height = Math.max(0, chunkXJ4W6TW4_cjs.finite(component.height, 200));
|
|
1312
|
+
const rotation = chunkXJ4W6TW4_cjs.finite(component.rotation, 0);
|
|
1313
|
+
const max = chunkXJ4W6TW4_cjs.finite(component.max, 100) || 100;
|
|
1314
|
+
const progress = Math.min(1, Math.max(0, chunkXJ4W6TW4_cjs.finite(Number(component.value), 0) / max));
|
|
1291
1315
|
const nodes = [
|
|
1292
1316
|
{
|
|
1293
1317
|
id: `widget-${component.id}`,
|
|
1294
1318
|
type: "shader-surface",
|
|
1295
1319
|
order: 1e4 + index,
|
|
1296
|
-
bounds:
|
|
1320
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds({ x, y, width, height }, rotation, 2),
|
|
1297
1321
|
x,
|
|
1298
1322
|
y,
|
|
1299
1323
|
width,
|
|
@@ -1310,12 +1334,12 @@ function buildTickScale(component, index) {
|
|
|
1310
1334
|
}
|
|
1311
1335
|
function buildTickLabels(component, box) {
|
|
1312
1336
|
const labels = component.labels ?? {};
|
|
1313
|
-
const ticks = Math.max(1,
|
|
1314
|
-
const major = Math.max(1,
|
|
1315
|
-
const start =
|
|
1316
|
-
const sweep =
|
|
1317
|
-
const radius =
|
|
1318
|
-
const fontSize =
|
|
1337
|
+
const ticks = Math.max(1, chunkXJ4W6TW4_cjs.finite(Number(component.parameters.ticks), 48));
|
|
1338
|
+
const major = Math.max(1, chunkXJ4W6TW4_cjs.finite(Number(component.parameters.major), 5));
|
|
1339
|
+
const start = chunkXJ4W6TW4_cjs.finite(Number(component.parameters.start), 225) * Math.PI / 180;
|
|
1340
|
+
const sweep = chunkXJ4W6TW4_cjs.finite(Number(component.parameters.sweep), 270) * Math.PI / 180;
|
|
1341
|
+
const radius = chunkXJ4W6TW4_cjs.finite(Number(component.parameters.radius), 0.9) + chunkXJ4W6TW4_cjs.finite(labels.offset, 0.08);
|
|
1342
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(labels.size, 12);
|
|
1319
1343
|
const centerX = box.x + box.width / 2;
|
|
1320
1344
|
const centerY = box.y + box.height / 2;
|
|
1321
1345
|
const count = Math.floor(ticks / major);
|
|
@@ -1330,10 +1354,10 @@ function buildTickLabels(component, box) {
|
|
|
1330
1354
|
id: `widget-${component.id}-label-${step}`,
|
|
1331
1355
|
type: "text",
|
|
1332
1356
|
order: box.order + 0.1,
|
|
1333
|
-
bounds:
|
|
1357
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(labelBox, 0, 2),
|
|
1334
1358
|
...labelBox,
|
|
1335
1359
|
lines: [String(Math.round(box.max * fraction * 10) / 10)],
|
|
1336
|
-
fontFamily: labels.fontFamily ||
|
|
1360
|
+
fontFamily: labels.fontFamily || chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
1337
1361
|
fontSize,
|
|
1338
1362
|
fontWeight: labels.weight ?? "normal",
|
|
1339
1363
|
color: labels.color || "#8f95c4",
|
|
@@ -1345,20 +1369,20 @@ function buildTickLabels(component, box) {
|
|
|
1345
1369
|
return nodes;
|
|
1346
1370
|
}
|
|
1347
1371
|
function buildRuler(component, index) {
|
|
1348
|
-
const x =
|
|
1349
|
-
const y =
|
|
1350
|
-
const width = Math.max(0,
|
|
1351
|
-
const height = Math.max(0,
|
|
1352
|
-
const rotation =
|
|
1353
|
-
const min =
|
|
1354
|
-
const max =
|
|
1355
|
-
const progress = max === min ? 0 : Math.min(1, Math.max(0, (
|
|
1372
|
+
const x = chunkXJ4W6TW4_cjs.finite(component.x, 0);
|
|
1373
|
+
const y = chunkXJ4W6TW4_cjs.finite(component.y, 0);
|
|
1374
|
+
const width = Math.max(0, chunkXJ4W6TW4_cjs.finite(component.width, 120));
|
|
1375
|
+
const height = Math.max(0, chunkXJ4W6TW4_cjs.finite(component.height, 360));
|
|
1376
|
+
const rotation = chunkXJ4W6TW4_cjs.finite(component.rotation, 0);
|
|
1377
|
+
const min = chunkXJ4W6TW4_cjs.finite(component.min, 0);
|
|
1378
|
+
const max = chunkXJ4W6TW4_cjs.finite(component.max, 100);
|
|
1379
|
+
const progress = max === min ? 0 : Math.min(1, Math.max(0, (chunkXJ4W6TW4_cjs.finite(Number(component.value), min) - min) / (max - min)));
|
|
1356
1380
|
const nodes = [
|
|
1357
1381
|
{
|
|
1358
1382
|
id: `widget-${component.id}`,
|
|
1359
1383
|
type: "shader-surface",
|
|
1360
1384
|
order: 1e4 + index,
|
|
1361
|
-
bounds:
|
|
1385
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds({ x, y, width, height }, rotation, 2),
|
|
1362
1386
|
x,
|
|
1363
1387
|
y,
|
|
1364
1388
|
width,
|
|
@@ -1376,28 +1400,28 @@ function buildRuler(component, index) {
|
|
|
1376
1400
|
function buildRulerLabels(component, box) {
|
|
1377
1401
|
const labels = component.labels ?? {};
|
|
1378
1402
|
const horizontal = component.parameters.axis === "horizontal";
|
|
1379
|
-
const ticks = Math.max(1,
|
|
1380
|
-
const major = Math.max(1,
|
|
1381
|
-
const inset =
|
|
1382
|
-
const line =
|
|
1403
|
+
const ticks = Math.max(1, chunkXJ4W6TW4_cjs.finite(Number(component.parameters.ticks), 50));
|
|
1404
|
+
const major = Math.max(1, chunkXJ4W6TW4_cjs.finite(Number(component.parameters.major), 5));
|
|
1405
|
+
const inset = chunkXJ4W6TW4_cjs.finite(Number(component.parameters.inset), 0.05) > 0 ? chunkXJ4W6TW4_cjs.finite(Number(component.parameters.inset), 0.05) : 0.05;
|
|
1406
|
+
const line = chunkXJ4W6TW4_cjs.finite(Number(component.parameters.line), 0.7) > 0 ? chunkXJ4W6TW4_cjs.finite(Number(component.parameters.line), 0.7) : 0.7;
|
|
1383
1407
|
const across = horizontal ? box.height : box.width;
|
|
1384
|
-
const tickLength = (
|
|
1385
|
-
const edge = line * across - 0.12 * across - tickLength -
|
|
1386
|
-
const fontSize =
|
|
1408
|
+
const tickLength = (chunkXJ4W6TW4_cjs.finite(Number(component.parameters.length), 0.1) > 0 ? chunkXJ4W6TW4_cjs.finite(Number(component.parameters.length), 0.1) : 0.1) * across * 1.9;
|
|
1409
|
+
const edge = line * across - 0.12 * across - tickLength - chunkXJ4W6TW4_cjs.finite(labels.offset, 0.04) * across;
|
|
1410
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(labels.size, 12);
|
|
1387
1411
|
const count = Math.floor(ticks / major);
|
|
1388
1412
|
const nodes = [];
|
|
1389
1413
|
for (let step = 0; step <= count; step += 1) {
|
|
1390
1414
|
const fraction = step * major / ticks;
|
|
1391
|
-
const
|
|
1392
|
-
const labelBox = horizontal ? { x: box.x + box.width *
|
|
1415
|
+
const along2 = inset + (1 - 2 * inset) * fraction;
|
|
1416
|
+
const labelBox = horizontal ? { x: box.x + box.width * along2 - 24, y: box.y + edge - fontSize * 2, width: 48, height: fontSize * 2 } : { x: box.x + edge - 48, y: box.y + box.height * (1 - along2) - fontSize, width: 48, height: fontSize * 2 };
|
|
1393
1417
|
nodes.push({
|
|
1394
1418
|
id: `widget-${component.id}-label-${step}`,
|
|
1395
1419
|
type: "text",
|
|
1396
1420
|
order: box.order + 0.1,
|
|
1397
|
-
bounds:
|
|
1421
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(labelBox, 0, 2),
|
|
1398
1422
|
...labelBox,
|
|
1399
1423
|
lines: [String(Math.round((box.min + (box.max - box.min) * fraction) * 10) / 10)],
|
|
1400
|
-
fontFamily: labels.fontFamily ||
|
|
1424
|
+
fontFamily: labels.fontFamily || chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
1401
1425
|
fontSize,
|
|
1402
1426
|
fontWeight: labels.weight ?? "normal",
|
|
1403
1427
|
color: labels.color || "#8f95c4",
|
|
@@ -1413,10 +1437,10 @@ function buildRulerLabels(component, box) {
|
|
|
1413
1437
|
var DISABLED_INK = "#94a3b8";
|
|
1414
1438
|
function controlBox(component, index, fallback) {
|
|
1415
1439
|
return {
|
|
1416
|
-
x:
|
|
1417
|
-
y:
|
|
1418
|
-
width: Math.max(1,
|
|
1419
|
-
height: Math.max(1,
|
|
1440
|
+
x: chunkXJ4W6TW4_cjs.finite(component.x, 0),
|
|
1441
|
+
y: chunkXJ4W6TW4_cjs.finite(component.y, 0),
|
|
1442
|
+
width: Math.max(1, chunkXJ4W6TW4_cjs.finite(component.width, fallback.width)),
|
|
1443
|
+
height: Math.max(1, chunkXJ4W6TW4_cjs.finite(component.height, fallback.height)),
|
|
1420
1444
|
order: 1e4 + index
|
|
1421
1445
|
};
|
|
1422
1446
|
}
|
|
@@ -1432,7 +1456,7 @@ function hitArea(component, box) {
|
|
|
1432
1456
|
id: `widget-${component.id}`,
|
|
1433
1457
|
type: "rect",
|
|
1434
1458
|
order: box.order,
|
|
1435
|
-
bounds:
|
|
1459
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(box, 0, 0),
|
|
1436
1460
|
x: box.x,
|
|
1437
1461
|
y: box.y,
|
|
1438
1462
|
width: box.width,
|
|
@@ -1445,13 +1469,13 @@ function labelText(component, part, area, label, order) {
|
|
|
1445
1469
|
id: `widget-${component.id}-${part}`,
|
|
1446
1470
|
type: "text",
|
|
1447
1471
|
order,
|
|
1448
|
-
bounds:
|
|
1472
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(area, 0, 0),
|
|
1449
1473
|
x: area.x,
|
|
1450
1474
|
y: area.y,
|
|
1451
1475
|
width: area.width,
|
|
1452
1476
|
height: area.height,
|
|
1453
1477
|
lines: [label.text],
|
|
1454
|
-
fontFamily:
|
|
1478
|
+
fontFamily: chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
1455
1479
|
fontSize: label.fontSize,
|
|
1456
1480
|
fontWeight: "600",
|
|
1457
1481
|
color: label.color,
|
|
@@ -1470,7 +1494,7 @@ function buildButton(component, index) {
|
|
|
1470
1494
|
id: `widget-${component.id}-face`,
|
|
1471
1495
|
type: "rect",
|
|
1472
1496
|
order: box.order + 0.1,
|
|
1473
|
-
bounds:
|
|
1497
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(box, 0, 0),
|
|
1474
1498
|
x: box.x,
|
|
1475
1499
|
y: box.y,
|
|
1476
1500
|
width: box.width,
|
|
@@ -1509,7 +1533,7 @@ function boxNode(component, box, square) {
|
|
|
1509
1533
|
id: `widget-${component.id}-box`,
|
|
1510
1534
|
type: "rect",
|
|
1511
1535
|
order: box.order + 0.1,
|
|
1512
|
-
bounds:
|
|
1536
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(square, 0, 2),
|
|
1513
1537
|
...square,
|
|
1514
1538
|
rx: square.width * CORNER_RATIO,
|
|
1515
1539
|
style: fade(component, {
|
|
@@ -1524,7 +1548,7 @@ function checkNode(component, box, square) {
|
|
|
1524
1548
|
id: `widget-${component.id}-check`,
|
|
1525
1549
|
type: "path",
|
|
1526
1550
|
order: box.order + 0.2,
|
|
1527
|
-
bounds:
|
|
1551
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(square, 0, 0),
|
|
1528
1552
|
d: checkPath(square),
|
|
1529
1553
|
style: fade(component, {
|
|
1530
1554
|
fill: { kind: "none" },
|
|
@@ -1573,7 +1597,7 @@ function buildSwitch(component, index) {
|
|
|
1573
1597
|
id: `widget-${component.id}-track`,
|
|
1574
1598
|
type: "rect",
|
|
1575
1599
|
order: box.order + 0.1,
|
|
1576
|
-
bounds:
|
|
1600
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(box, 0, 0),
|
|
1577
1601
|
x: box.x,
|
|
1578
1602
|
y: box.y,
|
|
1579
1603
|
width: box.width,
|
|
@@ -1588,7 +1612,7 @@ function buildSwitch(component, index) {
|
|
|
1588
1612
|
id: `widget-${component.id}-thumb`,
|
|
1589
1613
|
type: "ellipse",
|
|
1590
1614
|
order: box.order + 0.2,
|
|
1591
|
-
bounds:
|
|
1615
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(thumb, 0, 0),
|
|
1592
1616
|
cx: centerX,
|
|
1593
1617
|
cy: box.y + box.height / 2,
|
|
1594
1618
|
rx: radius,
|
|
@@ -1612,7 +1636,7 @@ function buildToggleButton(component, index) {
|
|
|
1612
1636
|
id: `widget-${component.id}-face`,
|
|
1613
1637
|
type: "rect",
|
|
1614
1638
|
order: box.order + 0.1,
|
|
1615
|
-
bounds:
|
|
1639
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(box, 0, 2),
|
|
1616
1640
|
x: box.x,
|
|
1617
1641
|
y: box.y,
|
|
1618
1642
|
width: box.width,
|
|
@@ -1662,8 +1686,8 @@ function getComponentBuilder(type) {
|
|
|
1662
1686
|
|
|
1663
1687
|
// src/renderScene/artifacts/component/build.ts
|
|
1664
1688
|
function ariaOf(component) {
|
|
1665
|
-
const role =
|
|
1666
|
-
if (!role || !
|
|
1689
|
+
const role = chunkXJ4W6TW4_cjs.getComponentDescriptor(component.type)?.role;
|
|
1690
|
+
if (!role || !chunkXJ4W6TW4_cjs.isGenericComponent(component)) {
|
|
1667
1691
|
return void 0;
|
|
1668
1692
|
}
|
|
1669
1693
|
const flag = typeof component.value === "boolean" ? component.value : void 0;
|
|
@@ -1674,12 +1698,12 @@ function ariaOf(component) {
|
|
|
1674
1698
|
};
|
|
1675
1699
|
}
|
|
1676
1700
|
function labelOf(component) {
|
|
1677
|
-
return component.label ?? (
|
|
1701
|
+
return component.label ?? (chunkXJ4W6TW4_cjs.isGenericComponent(component) ? component.id : String(component.value));
|
|
1678
1702
|
}
|
|
1679
1703
|
function buildComponents(components) {
|
|
1680
1704
|
return components.flatMap((component, index) => {
|
|
1681
1705
|
const build = getComponentBuilder(component.type) ?? buildPlaceholder;
|
|
1682
|
-
const nodes =
|
|
1706
|
+
const nodes = chunkXJ4W6TW4_cjs.tag(
|
|
1683
1707
|
build(component, index),
|
|
1684
1708
|
"widget",
|
|
1685
1709
|
component.id,
|
|
@@ -1719,13 +1743,13 @@ function tabBox(input, thickness, length) {
|
|
|
1719
1743
|
y,
|
|
1720
1744
|
width: length,
|
|
1721
1745
|
height: thickness,
|
|
1722
|
-
path:
|
|
1746
|
+
path: chunkXJ4W6TW4_cjs.bottomRoundedRectPath(x, y, length, thickness, TAB_RADIUS)
|
|
1723
1747
|
};
|
|
1724
1748
|
}
|
|
1725
1749
|
case "left": {
|
|
1726
1750
|
const x = input.x - thickness;
|
|
1727
1751
|
const y = input.y - inset;
|
|
1728
|
-
return { x, y, width: thickness, height: length, path:
|
|
1752
|
+
return { x, y, width: thickness, height: length, path: chunkXJ4W6TW4_cjs.leftRoundedRectPath(x, y, thickness, length, TAB_RADIUS) };
|
|
1729
1753
|
}
|
|
1730
1754
|
case "right": {
|
|
1731
1755
|
const x = input.x + input.width;
|
|
@@ -1735,13 +1759,13 @@ function tabBox(input, thickness, length) {
|
|
|
1735
1759
|
y,
|
|
1736
1760
|
width: thickness,
|
|
1737
1761
|
height: length,
|
|
1738
|
-
path:
|
|
1762
|
+
path: chunkXJ4W6TW4_cjs.rightRoundedRectPath(x, y, thickness, length, TAB_RADIUS)
|
|
1739
1763
|
};
|
|
1740
1764
|
}
|
|
1741
1765
|
default: {
|
|
1742
1766
|
const x = input.x - inset;
|
|
1743
1767
|
const y = input.y - thickness;
|
|
1744
|
-
return { x, y, width: length, height: thickness, path:
|
|
1768
|
+
return { x, y, width: length, height: thickness, path: chunkXJ4W6TW4_cjs.topRoundedRectPath(x, y, length, thickness, TAB_RADIUS) };
|
|
1745
1769
|
}
|
|
1746
1770
|
}
|
|
1747
1771
|
}
|
|
@@ -1750,7 +1774,7 @@ function renderTitleTab(input) {
|
|
|
1750
1774
|
const padding = 16;
|
|
1751
1775
|
const length = Math.max(120, input.title.length * input.fontSize * 0.62 + padding * 2);
|
|
1752
1776
|
const box = tabBox(input, thickness, length);
|
|
1753
|
-
const bounds =
|
|
1777
|
+
const bounds = chunkXJ4W6TW4_cjs.boxBounds(box, 6);
|
|
1754
1778
|
const vertical = input.labelPosition === "left" || input.labelPosition === "right";
|
|
1755
1779
|
return [
|
|
1756
1780
|
{
|
|
@@ -1778,7 +1802,7 @@ function horizontalTitleText(input, box, padding, bounds) {
|
|
|
1778
1802
|
width: Math.max(0, box.width - padding * 2),
|
|
1779
1803
|
height: box.height,
|
|
1780
1804
|
lines: [input.title],
|
|
1781
|
-
fontFamily: input.fontFamily ??
|
|
1805
|
+
fontFamily: input.fontFamily ?? chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
1782
1806
|
fontSize: input.fontSize,
|
|
1783
1807
|
fontWeight: input.fontWeight,
|
|
1784
1808
|
color: input.textColor,
|
|
@@ -1802,7 +1826,7 @@ function verticalTitleText(input, box, padding, bounds) {
|
|
|
1802
1826
|
width: textLength,
|
|
1803
1827
|
height: textThickness,
|
|
1804
1828
|
lines: [input.title],
|
|
1805
|
-
fontFamily: input.fontFamily ??
|
|
1829
|
+
fontFamily: input.fontFamily ?? chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
1806
1830
|
fontSize: input.fontSize,
|
|
1807
1831
|
fontWeight: input.fontWeight,
|
|
1808
1832
|
color: input.textColor,
|
|
@@ -1823,7 +1847,7 @@ var SQUARED_CORNER_BY_LABEL_POSITION = {
|
|
|
1823
1847
|
};
|
|
1824
1848
|
function frameBoundaryNode(frame, order, hasTab) {
|
|
1825
1849
|
const shadow = frame.shadow ?? true;
|
|
1826
|
-
const bounds =
|
|
1850
|
+
const bounds = chunkXJ4W6TW4_cjs.boxBounds(
|
|
1827
1851
|
{ x: frame.x, y: frame.y, width: frame.width, height: frame.height },
|
|
1828
1852
|
frame.strokeWidth + (shadow ? 20 : 4)
|
|
1829
1853
|
);
|
|
@@ -1858,7 +1882,7 @@ function frameBoundaryNode(frame, order, hasTab) {
|
|
|
1858
1882
|
id: `frame-${frame.id}`,
|
|
1859
1883
|
order,
|
|
1860
1884
|
bounds,
|
|
1861
|
-
d:
|
|
1885
|
+
d: chunkXJ4W6TW4_cjs.cornersRoundedRectPath(frame.x, frame.y, frame.width, frame.height, radii),
|
|
1862
1886
|
detail: { of: "frameBoundary", cornerRadius: frame.cornerRadius, squareCorner: squared },
|
|
1863
1887
|
style
|
|
1864
1888
|
};
|
|
@@ -1947,7 +1971,7 @@ function labelBase(context, lane, index) {
|
|
|
1947
1971
|
id: `swimlane-label-${context.swimlane.id}-${lane.id}`,
|
|
1948
1972
|
order: context.order + 0.5 + index / 100,
|
|
1949
1973
|
lines: [lane.label],
|
|
1950
|
-
fontFamily: context.swimlane.fontFamily ??
|
|
1974
|
+
fontFamily: context.swimlane.fontFamily ?? chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
1951
1975
|
fontSize: context.swimlane.fontSize,
|
|
1952
1976
|
fontWeight: context.swimlane.fontWeight,
|
|
1953
1977
|
color: context.swimlane.textColor,
|
|
@@ -1963,7 +1987,7 @@ function horizontalLabel(context, lane, index) {
|
|
|
1963
1987
|
const y = centerY - thickness / 2;
|
|
1964
1988
|
return {
|
|
1965
1989
|
...labelBase(context, lane, index),
|
|
1966
|
-
bounds:
|
|
1990
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds({ x, y, width, height: thickness }, -90, 12),
|
|
1967
1991
|
x,
|
|
1968
1992
|
y,
|
|
1969
1993
|
width,
|
|
@@ -2015,7 +2039,7 @@ function createSwimlaneRenderContext(swimlane, index) {
|
|
|
2015
2039
|
return {
|
|
2016
2040
|
swimlane,
|
|
2017
2041
|
order: 5e3 + index,
|
|
2018
|
-
bounds:
|
|
2042
|
+
bounds: chunkXJ4W6TW4_cjs.boxBounds(
|
|
2019
2043
|
{ x: swimlane.x, y: swimlane.y, width: swimlane.width, height: swimlane.height },
|
|
2020
2044
|
swimlane.strokeWidth + 4
|
|
2021
2045
|
),
|
|
@@ -2054,17 +2078,140 @@ function buildSwimlane(swimlane, index) {
|
|
|
2054
2078
|
function buildContainers(input) {
|
|
2055
2079
|
return [
|
|
2056
2080
|
...input.frames.flatMap(
|
|
2057
|
-
(frame, index) =>
|
|
2081
|
+
(frame, index) => chunkXJ4W6TW4_cjs.tag(buildFrame(frame, index), "frame", frame.id, void 0, frame.title ?? void 0)
|
|
2058
2082
|
),
|
|
2059
|
-
...input.swimlanes.flatMap((swimlane, index) =>
|
|
2083
|
+
...input.swimlanes.flatMap((swimlane, index) => chunkXJ4W6TW4_cjs.tag(buildSwimlane(swimlane, index), "swimlane", swimlane.id))
|
|
2060
2084
|
];
|
|
2061
2085
|
}
|
|
2062
2086
|
|
|
2063
|
-
// src/
|
|
2087
|
+
// src/model/dimension/geometry.ts
|
|
2088
|
+
var GAP = 4;
|
|
2089
|
+
var OVERSHOOT = 6;
|
|
2090
|
+
var along = (origin, direction, distance) => ({
|
|
2091
|
+
x: origin.x + direction.x * distance,
|
|
2092
|
+
y: origin.y + direction.y * distance
|
|
2093
|
+
});
|
|
2094
|
+
function dimensionLength(dimension) {
|
|
2095
|
+
return Math.hypot(dimension.end.x - dimension.start.x, dimension.end.y - dimension.start.y);
|
|
2096
|
+
}
|
|
2097
|
+
function dimensionText(dimension) {
|
|
2098
|
+
if (dimension.text !== void 0) {
|
|
2099
|
+
return dimension.text;
|
|
2100
|
+
}
|
|
2101
|
+
const length = Math.round(dimensionLength(dimension) * 10) / 10;
|
|
2102
|
+
return `${length}${dimension.unit ? ` ${dimension.unit}` : ""}`;
|
|
2103
|
+
}
|
|
2104
|
+
function dimensionGeometry(dimension) {
|
|
2105
|
+
const length = dimensionLength(dimension);
|
|
2106
|
+
const direction = length === 0 ? { x: 1, y: 0 } : { x: (dimension.end.x - dimension.start.x) / length, y: (dimension.end.y - dimension.start.y) / length };
|
|
2107
|
+
const normal = { x: direction.y, y: -direction.x };
|
|
2108
|
+
const side = dimension.offset < 0 ? -1 : 1;
|
|
2109
|
+
const line = [
|
|
2110
|
+
along(dimension.start, normal, dimension.offset),
|
|
2111
|
+
along(dimension.end, normal, dimension.offset)
|
|
2112
|
+
];
|
|
2113
|
+
const extensions = Math.abs(dimension.offset) <= GAP ? [] : [dimension.start, dimension.end].map((point) => [
|
|
2114
|
+
along(point, normal, GAP * side),
|
|
2115
|
+
along(point, normal, dimension.offset + OVERSHOOT * side)
|
|
2116
|
+
]);
|
|
2117
|
+
const lift = ((dimension.fontSize ?? 11) * 0.75 + 2) * side;
|
|
2118
|
+
const middle = { x: (line[0].x + line[1].x) / 2, y: (line[0].y + line[1].y) / 2 };
|
|
2119
|
+
let angle = Math.atan2(direction.y, direction.x) * 180 / Math.PI;
|
|
2120
|
+
if (angle > 90) {
|
|
2121
|
+
angle -= 180;
|
|
2122
|
+
} else if (angle <= -90) {
|
|
2123
|
+
angle += 180;
|
|
2124
|
+
}
|
|
2125
|
+
return { length, line, extensions, label: { center: along(middle, normal, lift), angle } };
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
// src/renderScene/artifacts/dimension.ts
|
|
2129
|
+
var DEFAULT_COLOR = "#475569";
|
|
2130
|
+
var CHAR_WIDTH = 0.6;
|
|
2131
|
+
var pathData = (segments) => segments.map(([from, to]) => `M ${from.x} ${from.y} L ${to.x} ${to.y}`).join(" ");
|
|
2132
|
+
function pathNode(dimension, name, order, segments) {
|
|
2133
|
+
const strokeWidth = Math.max(0, chunkXJ4W6TW4_cjs.finite(dimension.strokeWidth, 1));
|
|
2134
|
+
const points = segments.flat();
|
|
2135
|
+
return {
|
|
2136
|
+
type: "path",
|
|
2137
|
+
id: `dimension-${dimension.id}-${name}`,
|
|
2138
|
+
order,
|
|
2139
|
+
bounds: {
|
|
2140
|
+
minX: Math.min(...points.map((point) => point.x)) - strokeWidth,
|
|
2141
|
+
minY: Math.min(...points.map((point) => point.y)) - strokeWidth,
|
|
2142
|
+
maxX: Math.max(...points.map((point) => point.x)) + strokeWidth,
|
|
2143
|
+
maxY: Math.max(...points.map((point) => point.y)) + strokeWidth
|
|
2144
|
+
},
|
|
2145
|
+
d: pathData(segments),
|
|
2146
|
+
style: {
|
|
2147
|
+
fill: { kind: "none" },
|
|
2148
|
+
stroke: { kind: "solid", color: dimension.strokeColor ?? DEFAULT_COLOR },
|
|
2149
|
+
strokeWidth,
|
|
2150
|
+
lineCap: "round"
|
|
2151
|
+
}
|
|
2152
|
+
};
|
|
2153
|
+
}
|
|
2154
|
+
function labelNode2(dimension, order, text, center, angle) {
|
|
2155
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(dimension.fontSize, 11);
|
|
2156
|
+
const width = Math.max(24, text.length * fontSize * CHAR_WIDTH + 8);
|
|
2157
|
+
const height = fontSize * 1.3;
|
|
2158
|
+
return {
|
|
2159
|
+
type: "text",
|
|
2160
|
+
id: `dimension-${dimension.id}-label`,
|
|
2161
|
+
order,
|
|
2162
|
+
bounds: {
|
|
2163
|
+
minX: center.x - width / 2,
|
|
2164
|
+
minY: center.y - height / 2,
|
|
2165
|
+
maxX: center.x + width / 2,
|
|
2166
|
+
maxY: center.y + height / 2
|
|
2167
|
+
},
|
|
2168
|
+
x: center.x - width / 2,
|
|
2169
|
+
y: center.y - height / 2,
|
|
2170
|
+
width,
|
|
2171
|
+
height,
|
|
2172
|
+
lines: [text],
|
|
2173
|
+
fontFamily: chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
2174
|
+
fontSize,
|
|
2175
|
+
fontWeight: "normal",
|
|
2176
|
+
color: dimension.textColor ?? dimension.strokeColor ?? DEFAULT_COLOR,
|
|
2177
|
+
align: "center",
|
|
2178
|
+
verticalAlign: "middle",
|
|
2179
|
+
lineHeight: 1.2,
|
|
2180
|
+
rotation: angle,
|
|
2181
|
+
rotationCenter: center
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
function buildDimension(dimension, index) {
|
|
2185
|
+
const geometry = dimensionGeometry(dimension);
|
|
2186
|
+
const order = 31e3 + index;
|
|
2187
|
+
const line = {
|
|
2188
|
+
...pathNode(dimension, "line", order + 0.1, [geometry.line]),
|
|
2189
|
+
markerStart: "filled_arrow",
|
|
2190
|
+
markerEnd: "filled_arrow"
|
|
2191
|
+
};
|
|
2192
|
+
const extensions = geometry.extensions.length > 0 ? [pathNode(dimension, "extensions", order, geometry.extensions)] : [];
|
|
2193
|
+
const text = dimensionText(dimension);
|
|
2194
|
+
return [...extensions, line, labelNode2(dimension, order + 0.2, text, geometry.label.center, geometry.label.angle)];
|
|
2195
|
+
}
|
|
2196
|
+
function buildDimensions(dimensions) {
|
|
2197
|
+
return dimensions.flatMap(
|
|
2198
|
+
(dimension, index) => chunkXJ4W6TW4_cjs.tag(
|
|
2199
|
+
buildDimension(dimension, index),
|
|
2200
|
+
"dimension",
|
|
2201
|
+
dimension.id,
|
|
2202
|
+
"dimension",
|
|
2203
|
+
dimensionText(dimension),
|
|
2204
|
+
dimension.parentFrameId
|
|
2205
|
+
)
|
|
2206
|
+
);
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
// src/renderScene/artifacts/isometric/context.ts
|
|
2210
|
+
var FILL_PROP = { prop: "style.fill", propKind: "color", propSolidOnly: true };
|
|
2064
2211
|
function isometricContext(object, index) {
|
|
2065
|
-
const strokeWidth = Math.max(0,
|
|
2066
|
-
const rotation =
|
|
2067
|
-
const box =
|
|
2212
|
+
const strokeWidth = Math.max(0, chunkXJ4W6TW4_cjs.finite(object.strokeWidth, 1));
|
|
2213
|
+
const rotation = chunkXJ4W6TW4_cjs.finite(object.rotation, 0);
|
|
2214
|
+
const box = chunkXJ4W6TW4_cjs.isometricBounds(object);
|
|
2068
2215
|
const rotationCenter = { x: box.x + box.width / 2, y: box.y + box.height / 2 };
|
|
2069
2216
|
return {
|
|
2070
2217
|
object,
|
|
@@ -2076,7 +2223,7 @@ function isometricContext(object, index) {
|
|
|
2076
2223
|
strokeWidth,
|
|
2077
2224
|
common: {
|
|
2078
2225
|
type: "path",
|
|
2079
|
-
bounds:
|
|
2226
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds(box, rotation, strokeWidth + 2),
|
|
2080
2227
|
rotation,
|
|
2081
2228
|
rotationCenter,
|
|
2082
2229
|
style: {
|
|
@@ -2087,82 +2234,19 @@ function isometricContext(object, index) {
|
|
|
2087
2234
|
}
|
|
2088
2235
|
};
|
|
2089
2236
|
}
|
|
2090
|
-
function
|
|
2091
|
-
const { object, index, rotation, rotationCenter } = context;
|
|
2092
|
-
if (!object.hasShadow) {
|
|
2093
|
-
return void 0;
|
|
2094
|
-
}
|
|
2095
|
-
const height = Math.max(0, object.height);
|
|
2096
|
-
const heightFactor = 0.6 + Math.min(1, height / 150) * 0.7;
|
|
2097
|
-
const shadowDrop = height + chunkXY2GZUHC_cjs.finite(object.shadowStyle?.distance, 0);
|
|
2098
|
-
const contactFootprint = faces.top.map((point) => ({ x: point.x, y: point.y + shadowDrop }));
|
|
2099
|
-
const footprintCenter = {
|
|
2100
|
-
x: contactFootprint.reduce((sum, point) => sum + point.x, 0) / contactFootprint.length,
|
|
2101
|
-
y: contactFootprint.reduce((sum, point) => sum + point.y, 0) / contactFootprint.length
|
|
2102
|
-
};
|
|
2103
|
-
const shadowSpread = 1.3;
|
|
2104
|
-
const footprint = contactFootprint.map((point) => ({
|
|
2105
|
-
x: footprintCenter.x + (point.x - footprintCenter.x) * shadowSpread,
|
|
2106
|
-
y: footprintCenter.y + (point.y - footprintCenter.y) * shadowSpread
|
|
2107
|
-
}));
|
|
2108
|
-
const footprintXs = footprint.map((point) => point.x);
|
|
2109
|
-
const footprintYs = footprint.map((point) => point.y);
|
|
2237
|
+
function faceNode(context, name, offset, points, style) {
|
|
2110
2238
|
return {
|
|
2111
|
-
|
|
2112
|
-
id: `isometric-${object.id}
|
|
2113
|
-
order:
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
maxX: Math.max(...footprintXs),
|
|
2118
|
-
maxY: Math.max(...footprintYs)
|
|
2119
|
-
},
|
|
2120
|
-
d: chunkXY2GZUHC_cjs.roundedPolygonPath(footprint, 0),
|
|
2121
|
-
rotation,
|
|
2122
|
-
rotationCenter,
|
|
2123
|
-
style: {
|
|
2124
|
-
fill: { kind: "solid", color: object.shadowStyle?.color ?? "#000000" },
|
|
2125
|
-
stroke: { kind: "none" },
|
|
2126
|
-
opacity: Math.min(1, (object.shadowStyle?.opacity ?? 0.18) * heightFactor),
|
|
2127
|
-
blur: chunkXY2GZUHC_cjs.finite(object.shadowStyle?.blur, 8),
|
|
2128
|
-
pointerEvents: "none"
|
|
2129
|
-
}
|
|
2239
|
+
...context.common,
|
|
2240
|
+
id: `isometric-${context.object.id}-${name}`,
|
|
2241
|
+
order: context.order + offset,
|
|
2242
|
+
d: chunkXJ4W6TW4_cjs.roundedPolygonPath([...points], 0),
|
|
2243
|
+
style,
|
|
2244
|
+
...FILL_PROP
|
|
2130
2245
|
};
|
|
2131
2246
|
}
|
|
2132
|
-
function
|
|
2133
|
-
const
|
|
2134
|
-
|
|
2135
|
-
const faceFills = chunkXY2GZUHC_cjs.deriveFaceFills(object.fill ?? "#f8fafc");
|
|
2136
|
-
const colorProp = { prop: "style.fill", propKind: "color", propSolidOnly: true };
|
|
2137
|
-
const face = (name, offset, points, color) => ({
|
|
2138
|
-
...common,
|
|
2139
|
-
id: `isometric-${object.id}-${name}`,
|
|
2140
|
-
order: order + offset,
|
|
2141
|
-
d: chunkXY2GZUHC_cjs.roundedPolygonPath(points, 0),
|
|
2142
|
-
style: { ...noStroke, fill: { kind: "solid", color }, clip: hullClip },
|
|
2143
|
-
...colorProp
|
|
2144
|
-
});
|
|
2145
|
-
return [
|
|
2146
|
-
face("top", 0, faces.top, faceFills.topFill),
|
|
2147
|
-
face("front", 0.1, faces.front, faceFills.frontFill),
|
|
2148
|
-
face("side", 0.2, faces.right, faceFills.sideFill)
|
|
2149
|
-
];
|
|
2150
|
-
}
|
|
2151
|
-
function seamsNode(context, faces, hullClip) {
|
|
2152
|
-
const { object, order, common, strokeWidth } = context;
|
|
2153
|
-
return {
|
|
2154
|
-
...common,
|
|
2155
|
-
id: `isometric-${object.id}-seams`,
|
|
2156
|
-
order: order + 0.22,
|
|
2157
|
-
d: `M ${faces.top[3].x} ${faces.top[3].y} L ${faces.top[2].x} ${faces.top[2].y} L ${faces.top[1].x} ${faces.top[1].y} M ${faces.top[2].x} ${faces.top[2].y} L ${faces.front[2].x} ${faces.front[2].y}`,
|
|
2158
|
-
style: {
|
|
2159
|
-
...common.style,
|
|
2160
|
-
fill: { kind: "none" },
|
|
2161
|
-
stroke: { kind: "solid", color: "#cbd5e1" },
|
|
2162
|
-
strokeWidth: Math.min(strokeWidth, 1),
|
|
2163
|
-
clip: hullClip
|
|
2164
|
-
}
|
|
2165
|
-
};
|
|
2247
|
+
function silhouette(object) {
|
|
2248
|
+
const faces = chunkXJ4W6TW4_cjs.isometricFaces(object);
|
|
2249
|
+
return [faces.top[0], faces.top[1], faces.right[2], faces.front[2], faces.front[3], faces.top[3]];
|
|
2166
2250
|
}
|
|
2167
2251
|
function hullNode(context, hullPath, cornerRadius) {
|
|
2168
2252
|
const { object, order, common, box } = context;
|
|
@@ -2178,12 +2262,20 @@ function hullNode(context, hullPath, cornerRadius) {
|
|
|
2178
2262
|
depth: Math.max(0, object.depth),
|
|
2179
2263
|
cornerRadius,
|
|
2180
2264
|
bounds: box,
|
|
2181
|
-
labelOffsetX:
|
|
2182
|
-
labelOffsetY:
|
|
2265
|
+
labelOffsetX: chunkXJ4W6TW4_cjs.finite(object.labelOffsetX, 0),
|
|
2266
|
+
labelOffsetY: chunkXJ4W6TW4_cjs.finite(object.labelOffsetY, 0)
|
|
2183
2267
|
},
|
|
2184
2268
|
style: { ...common.style, fill: { kind: "none" } }
|
|
2185
2269
|
};
|
|
2186
2270
|
}
|
|
2271
|
+
function unseenHullNode(context) {
|
|
2272
|
+
return {
|
|
2273
|
+
...hullNode(context, chunkXJ4W6TW4_cjs.roundedPolygonPath(silhouette(context.object), 0), 0),
|
|
2274
|
+
style: { ...context.common.style, fill: { kind: "none" }, stroke: { kind: "none" } }
|
|
2275
|
+
};
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
// src/renderScene/artifacts/isometric/label.ts
|
|
2187
2279
|
var LABEL_HEIGHT = 20;
|
|
2188
2280
|
var LABEL_GAP = 12;
|
|
2189
2281
|
var LABEL_PADDING_X = 6;
|
|
@@ -2191,9 +2283,9 @@ var LABEL_PADDING_Y = 3;
|
|
|
2191
2283
|
var LABEL_CHAR_WIDTH = 6.5;
|
|
2192
2284
|
function labelPlacement(context) {
|
|
2193
2285
|
const { object } = context;
|
|
2194
|
-
const anchor =
|
|
2195
|
-
const bottomY = anchor.y - LABEL_GAP +
|
|
2196
|
-
return { anchor, centerX: anchor.x +
|
|
2286
|
+
const anchor = chunkXJ4W6TW4_cjs.isometricTopFaceCenter(object);
|
|
2287
|
+
const bottomY = anchor.y - LABEL_GAP + chunkXJ4W6TW4_cjs.finite(object.labelOffsetY, 0);
|
|
2288
|
+
return { anchor, centerX: anchor.x + chunkXJ4W6TW4_cjs.finite(object.labelOffsetX, 0), topY: bottomY - LABEL_HEIGHT, bottomY };
|
|
2197
2289
|
}
|
|
2198
2290
|
function labelTextNode(context, placement, text) {
|
|
2199
2291
|
const { object, order, rotation, rotationCenter, box } = context;
|
|
@@ -2208,7 +2300,7 @@ function labelTextNode(context, placement, text) {
|
|
|
2208
2300
|
width: box.width,
|
|
2209
2301
|
height: LABEL_HEIGHT,
|
|
2210
2302
|
lines: [text],
|
|
2211
|
-
fontFamily:
|
|
2303
|
+
fontFamily: chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
2212
2304
|
fontSize: 12,
|
|
2213
2305
|
fontWeight: "normal",
|
|
2214
2306
|
color: "#111827",
|
|
@@ -2279,23 +2371,235 @@ function labelNodes(context, text) {
|
|
|
2279
2371
|
}
|
|
2280
2372
|
return [guide, labelBackgroundNode(context, placement, text, background), label];
|
|
2281
2373
|
}
|
|
2282
|
-
|
|
2374
|
+
|
|
2375
|
+
// src/renderScene/artifacts/isometric/shadow.ts
|
|
2376
|
+
function groundShadowNode(context, topOutline) {
|
|
2377
|
+
const { object, index, rotation, rotationCenter } = context;
|
|
2378
|
+
if (!object.hasShadow) {
|
|
2379
|
+
return void 0;
|
|
2380
|
+
}
|
|
2381
|
+
const height = Math.max(0, object.height);
|
|
2382
|
+
const heightFactor = 0.6 + Math.min(1, height / 150) * 0.7;
|
|
2383
|
+
const shadowDrop = height + chunkXJ4W6TW4_cjs.finite(object.shadowStyle?.distance, 0);
|
|
2384
|
+
const contactFootprint = topOutline.map((point) => ({ x: point.x, y: point.y + shadowDrop }));
|
|
2385
|
+
const footprintCenter = {
|
|
2386
|
+
x: contactFootprint.reduce((sum, point) => sum + point.x, 0) / contactFootprint.length,
|
|
2387
|
+
y: contactFootprint.reduce((sum, point) => sum + point.y, 0) / contactFootprint.length
|
|
2388
|
+
};
|
|
2389
|
+
const shadowSpread = 1.3;
|
|
2390
|
+
const footprint = contactFootprint.map((point) => ({
|
|
2391
|
+
x: footprintCenter.x + (point.x - footprintCenter.x) * shadowSpread,
|
|
2392
|
+
y: footprintCenter.y + (point.y - footprintCenter.y) * shadowSpread
|
|
2393
|
+
}));
|
|
2394
|
+
const footprintXs = footprint.map((point) => point.x);
|
|
2395
|
+
const footprintYs = footprint.map((point) => point.y);
|
|
2396
|
+
return {
|
|
2397
|
+
type: "path",
|
|
2398
|
+
id: `isometric-${object.id}-ground-shadow`,
|
|
2399
|
+
order: 14e3 + index,
|
|
2400
|
+
bounds: {
|
|
2401
|
+
minX: Math.min(...footprintXs),
|
|
2402
|
+
minY: Math.min(...footprintYs),
|
|
2403
|
+
maxX: Math.max(...footprintXs),
|
|
2404
|
+
maxY: Math.max(...footprintYs)
|
|
2405
|
+
},
|
|
2406
|
+
d: chunkXJ4W6TW4_cjs.roundedPolygonPath(footprint, 0),
|
|
2407
|
+
rotation,
|
|
2408
|
+
rotationCenter,
|
|
2409
|
+
style: {
|
|
2410
|
+
fill: { kind: "solid", color: object.shadowStyle?.color ?? "#000000" },
|
|
2411
|
+
stroke: { kind: "none" },
|
|
2412
|
+
opacity: Math.min(1, (object.shadowStyle?.opacity ?? 0.18) * heightFactor),
|
|
2413
|
+
blur: chunkXJ4W6TW4_cjs.finite(object.shadowStyle?.blur, 8),
|
|
2414
|
+
pointerEvents: "none"
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2417
|
+
}
|
|
2418
|
+
function sphereShadowNode(context, radius) {
|
|
2419
|
+
const { object, index, box } = context;
|
|
2420
|
+
if (!object.hasShadow) {
|
|
2421
|
+
return void 0;
|
|
2422
|
+
}
|
|
2423
|
+
const width = Math.max(0, object.width);
|
|
2424
|
+
const depth = Math.max(0, object.depth);
|
|
2425
|
+
const center = {
|
|
2426
|
+
x: box.x + box.width / 2,
|
|
2427
|
+
y: object.y + Math.max(0, object.height) + (width + depth) * chunkXJ4W6TW4_cjs.AXIS_SIN / 2
|
|
2428
|
+
};
|
|
2429
|
+
return {
|
|
2430
|
+
type: "ellipse",
|
|
2431
|
+
id: `isometric-${object.id}-ground-shadow`,
|
|
2432
|
+
order: 14e3 + index,
|
|
2433
|
+
bounds: {
|
|
2434
|
+
minX: center.x - radius * 1.1,
|
|
2435
|
+
minY: center.y - radius * 0.6,
|
|
2436
|
+
maxX: center.x + radius * 1.1,
|
|
2437
|
+
maxY: center.y + radius * 0.6
|
|
2438
|
+
},
|
|
2439
|
+
cx: center.x,
|
|
2440
|
+
cy: center.y,
|
|
2441
|
+
rx: radius * 1.05,
|
|
2442
|
+
ry: radius * 0.52,
|
|
2443
|
+
style: {
|
|
2444
|
+
fill: { kind: "solid", color: object.shadowStyle?.color ?? "#000000" },
|
|
2445
|
+
stroke: { kind: "none" },
|
|
2446
|
+
opacity: object.shadowStyle?.opacity ?? 0.2,
|
|
2447
|
+
blur: chunkXJ4W6TW4_cjs.finite(object.shadowStyle?.blur, 8),
|
|
2448
|
+
pointerEvents: "none"
|
|
2449
|
+
}
|
|
2450
|
+
};
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
// src/renderScene/artifacts/isometric/box.ts
|
|
2454
|
+
function faceNodes(context, faces, hullClip) {
|
|
2455
|
+
const { object, common } = context;
|
|
2456
|
+
const noStroke = { ...common.style, stroke: { kind: "none" } };
|
|
2457
|
+
const fills = chunkXJ4W6TW4_cjs.deriveFaceFills(object.fill ?? "#f8fafc");
|
|
2458
|
+
const face = (name, offset, points, color) => faceNode(context, name, offset, points, { ...noStroke, fill: { kind: "solid", color }, clip: hullClip });
|
|
2459
|
+
return [
|
|
2460
|
+
face("top", 0, faces.top, fills.topFill),
|
|
2461
|
+
face("front", 0.1, faces.front, fills.frontFill),
|
|
2462
|
+
face("side", 0.2, faces.right, fills.sideFill)
|
|
2463
|
+
];
|
|
2464
|
+
}
|
|
2465
|
+
function seamsNode(context, faces, hullClip) {
|
|
2466
|
+
const { object, order, common, strokeWidth } = context;
|
|
2467
|
+
return {
|
|
2468
|
+
...common,
|
|
2469
|
+
id: `isometric-${object.id}-seams`,
|
|
2470
|
+
order: order + 0.22,
|
|
2471
|
+
d: `M ${faces.top[3].x} ${faces.top[3].y} L ${faces.top[2].x} ${faces.top[2].y} L ${faces.top[1].x} ${faces.top[1].y} M ${faces.top[2].x} ${faces.top[2].y} L ${faces.front[2].x} ${faces.front[2].y}`,
|
|
2472
|
+
style: {
|
|
2473
|
+
...common.style,
|
|
2474
|
+
fill: { kind: "none" },
|
|
2475
|
+
stroke: { kind: "solid", color: "#cbd5e1" },
|
|
2476
|
+
strokeWidth: Math.min(strokeWidth, 1),
|
|
2477
|
+
clip: hullClip
|
|
2478
|
+
}
|
|
2479
|
+
};
|
|
2480
|
+
}
|
|
2481
|
+
function buildBox(object, index) {
|
|
2283
2482
|
const context = isometricContext(object, index);
|
|
2284
|
-
const faces =
|
|
2285
|
-
const cornerRadius = Math.max(0,
|
|
2286
|
-
const
|
|
2287
|
-
const hullPath = chunkXY2GZUHC_cjs.roundedPolygonPath(silhouette, cornerRadius);
|
|
2483
|
+
const faces = chunkXJ4W6TW4_cjs.isometricFaces(object);
|
|
2484
|
+
const cornerRadius = Math.max(0, chunkXJ4W6TW4_cjs.finite(object.cornerRadius, 8));
|
|
2485
|
+
const hullPath = chunkXJ4W6TW4_cjs.roundedPolygonPath(silhouette(object), cornerRadius);
|
|
2288
2486
|
const hullClip = { type: "path", d: hullPath };
|
|
2289
|
-
const groundShadow = groundShadowNode(context, faces);
|
|
2487
|
+
const groundShadow = groundShadowNode(context, faces.top);
|
|
2290
2488
|
const seams = seamsNode(context, faces, hullClip);
|
|
2291
2489
|
const hull = hullNode(context, hullPath, cornerRadius);
|
|
2292
2490
|
const facesNodes = faceNodes(context, faces, hullClip);
|
|
2293
2491
|
const objectNodes = groundShadow ? [hull, ...facesNodes, groundShadow, seams] : [hull, ...facesNodes, seams];
|
|
2294
2492
|
return object.text ? [...objectNodes, ...labelNodes(context, object.text)] : objectNodes;
|
|
2295
2493
|
}
|
|
2494
|
+
|
|
2495
|
+
// src/renderScene/artifacts/isometric/extruded.ts
|
|
2496
|
+
function wallNode(context, side, index, fill2) {
|
|
2497
|
+
const color = chunkXJ4W6TW4_cjs.shadeFill(fill2, side.light);
|
|
2498
|
+
return faceNode(context, `side-${index}`, 0.05 + index * 1e-3, side.points, {
|
|
2499
|
+
...context.common.style,
|
|
2500
|
+
stroke: { kind: "solid", color },
|
|
2501
|
+
strokeWidth: 0.6,
|
|
2502
|
+
fill: { kind: "solid", color }
|
|
2503
|
+
});
|
|
2504
|
+
}
|
|
2505
|
+
function wallEdgesNode(context, side, index) {
|
|
2506
|
+
const [topFrom, topTo, bottomTo, bottomFrom] = side.points;
|
|
2507
|
+
const lines = [
|
|
2508
|
+
`M ${bottomFrom.x} ${bottomFrom.y} L ${bottomTo.x} ${bottomTo.y}`,
|
|
2509
|
+
...side.smoothStart ? [] : [`M ${topFrom.x} ${topFrom.y} L ${bottomFrom.x} ${bottomFrom.y}`],
|
|
2510
|
+
...side.smoothEnd ? [] : [`M ${topTo.x} ${topTo.y} L ${bottomTo.x} ${bottomTo.y}`]
|
|
2511
|
+
];
|
|
2512
|
+
return {
|
|
2513
|
+
...context.common,
|
|
2514
|
+
id: `isometric-${context.object.id}-side-${index}-edges`,
|
|
2515
|
+
order: context.order + 0.0505 + index * 1e-3,
|
|
2516
|
+
d: lines.join(" "),
|
|
2517
|
+
style: { ...context.common.style, fill: { kind: "none" } }
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
function buildExtruded(object, index, footprint) {
|
|
2521
|
+
const context = isometricContext(object, index);
|
|
2522
|
+
const { top, sides } = chunkXJ4W6TW4_cjs.extrudeFootprint(object, footprint, Math.max(0, chunkXJ4W6TW4_cjs.finite(object.cornerRadius, 0)));
|
|
2523
|
+
const fill2 = object.fill ?? "#f8fafc";
|
|
2524
|
+
const groundShadow = groundShadowNode(context, top);
|
|
2525
|
+
const topFace = faceNode(context, "top", 0.2, top, { ...context.common.style, fill: { kind: "solid", color: fill2 } });
|
|
2526
|
+
const nodes = [
|
|
2527
|
+
unseenHullNode(context),
|
|
2528
|
+
...groundShadow ? [groundShadow] : [],
|
|
2529
|
+
...sides.flatMap((side, i) => [wallNode(context, side, i, fill2), wallEdgesNode(context, side, i)]),
|
|
2530
|
+
topFace
|
|
2531
|
+
];
|
|
2532
|
+
return object.text ? [...nodes, ...labelNodes(context, object.text)] : nodes;
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
// src/renderScene/artifacts/isometric/sphere.ts
|
|
2536
|
+
function buildSphere(object, index) {
|
|
2537
|
+
const context = isometricContext(object, index);
|
|
2538
|
+
const { order, common, box } = context;
|
|
2539
|
+
const radius = Math.max(0, Math.min(object.width, object.height, object.depth)) / 2;
|
|
2540
|
+
const cx = box.x + box.width / 2;
|
|
2541
|
+
const cy = box.y + box.height / 2;
|
|
2542
|
+
const fill2 = object.fill ?? "#f8fafc";
|
|
2543
|
+
const bounds = { minX: cx - radius, minY: cy - radius, maxX: cx + radius, maxY: cy + radius };
|
|
2544
|
+
const body = {
|
|
2545
|
+
type: "ellipse",
|
|
2546
|
+
id: `isometric-${object.id}-sphere`,
|
|
2547
|
+
order: order + 0.1,
|
|
2548
|
+
bounds,
|
|
2549
|
+
cx,
|
|
2550
|
+
cy,
|
|
2551
|
+
rx: radius,
|
|
2552
|
+
ry: radius,
|
|
2553
|
+
style: {
|
|
2554
|
+
...common.style,
|
|
2555
|
+
fill: {
|
|
2556
|
+
kind: "linear-gradient",
|
|
2557
|
+
angle: 135,
|
|
2558
|
+
stops: [
|
|
2559
|
+
{ offset: 0, color: chunkXJ4W6TW4_cjs.shadeFill(fill2, 1.22) },
|
|
2560
|
+
{ offset: 0.5, color: fill2 },
|
|
2561
|
+
{ offset: 1, color: chunkXJ4W6TW4_cjs.shadeFill(fill2, 0.82) }
|
|
2562
|
+
]
|
|
2563
|
+
}
|
|
2564
|
+
},
|
|
2565
|
+
prop: "style.fill",
|
|
2566
|
+
propKind: "color",
|
|
2567
|
+
propSolidOnly: true
|
|
2568
|
+
};
|
|
2569
|
+
const highlight = {
|
|
2570
|
+
type: "ellipse",
|
|
2571
|
+
id: `isometric-${object.id}-highlight`,
|
|
2572
|
+
order: order + 0.2,
|
|
2573
|
+
bounds,
|
|
2574
|
+
cx: cx - radius * 0.32,
|
|
2575
|
+
cy: cy - radius * 0.38,
|
|
2576
|
+
rx: radius * 0.26,
|
|
2577
|
+
ry: radius * 0.18,
|
|
2578
|
+
rotation: -35,
|
|
2579
|
+
style: {
|
|
2580
|
+
fill: { kind: "solid", color: "#ffffff" },
|
|
2581
|
+
stroke: { kind: "none" },
|
|
2582
|
+
opacity: 0.45,
|
|
2583
|
+
blur: radius * 0.1,
|
|
2584
|
+
pointerEvents: "none"
|
|
2585
|
+
}
|
|
2586
|
+
};
|
|
2587
|
+
const shadow = sphereShadowNode(context, radius);
|
|
2588
|
+
const nodes = [unseenHullNode(context), ...shadow ? [shadow] : [], body, highlight];
|
|
2589
|
+
return object.text ? [...nodes, ...labelNodes(context, object.text)] : nodes;
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
// src/renderScene/artifacts/isometric/index.ts
|
|
2593
|
+
function buildIsometricObject(object, index) {
|
|
2594
|
+
if (object.form === "sphere") {
|
|
2595
|
+
return buildSphere(object, index);
|
|
2596
|
+
}
|
|
2597
|
+
const footprint = chunkXJ4W6TW4_cjs.cleanFootprint(object.footprint);
|
|
2598
|
+
return footprint.length > 0 ? buildExtruded(object, index, footprint) : buildBox(object, index);
|
|
2599
|
+
}
|
|
2296
2600
|
function buildIsometricObjects(objects) {
|
|
2297
2601
|
return objects.flatMap(
|
|
2298
|
-
(object, index) =>
|
|
2602
|
+
(object, index) => chunkXJ4W6TW4_cjs.tag(
|
|
2299
2603
|
buildIsometricObject(object, index),
|
|
2300
2604
|
"isometric",
|
|
2301
2605
|
object.id,
|
|
@@ -2324,7 +2628,7 @@ function renderEndpointLabel(context, end, labelIndex) {
|
|
|
2324
2628
|
if (!label) {
|
|
2325
2629
|
return [];
|
|
2326
2630
|
}
|
|
2327
|
-
const fontSize =
|
|
2631
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(context.link.style?.fontSize, 10);
|
|
2328
2632
|
const position = endpointLabelPosition(context.points, end);
|
|
2329
2633
|
const width = 90;
|
|
2330
2634
|
return [
|
|
@@ -2338,7 +2642,7 @@ function renderEndpointLabel(context, end, labelIndex) {
|
|
|
2338
2642
|
width,
|
|
2339
2643
|
height: fontSize * 2,
|
|
2340
2644
|
lines: [label],
|
|
2341
|
-
fontFamily: context.link.style?.fontFamily ??
|
|
2645
|
+
fontFamily: context.link.style?.fontFamily ?? chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
2342
2646
|
fontSize,
|
|
2343
2647
|
fontWeight: "normal",
|
|
2344
2648
|
color: context.color,
|
|
@@ -2368,7 +2672,7 @@ function renderMainLabel(context) {
|
|
|
2368
2672
|
width: context.label.width,
|
|
2369
2673
|
height: context.label.fontSize * 2,
|
|
2370
2674
|
lines: context.label.lines,
|
|
2371
|
-
fontFamily: context.link.style?.fontFamily ??
|
|
2675
|
+
fontFamily: context.link.style?.fontFamily ?? chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
2372
2676
|
fontSize: context.label.fontSize,
|
|
2373
2677
|
fontWeight: "normal",
|
|
2374
2678
|
color: context.color,
|
|
@@ -2422,10 +2726,10 @@ function linkBounds(points, padding) {
|
|
|
2422
2726
|
}
|
|
2423
2727
|
function labelLayout(link, measureText) {
|
|
2424
2728
|
const visible = Boolean(link.showText && link.text);
|
|
2425
|
-
const fontSize =
|
|
2729
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(link.style?.fontSize, 10);
|
|
2426
2730
|
const width = Math.min(250, Math.max(fontSize * 2, (link.text?.length ?? 0) * fontSize * 0.65 + 10));
|
|
2427
|
-
const metrics = measureText?.(link.style?.fontFamily ??
|
|
2428
|
-
const lines = visible ?
|
|
2731
|
+
const metrics = measureText?.(link.style?.fontFamily ?? chunkXJ4W6TW4_cjs.DEFAULT_FONT, fontSize);
|
|
2732
|
+
const lines = visible ? chunkXJ4W6TW4_cjs.wrapText(link.text ?? "", width, fontSize, metrics) : [];
|
|
2429
2733
|
return { visible, fontSize, width, height: lines.length * fontSize * 1.4, lines };
|
|
2430
2734
|
}
|
|
2431
2735
|
function linkStyle(item, strokeWidth, color, dash) {
|
|
@@ -2442,26 +2746,26 @@ function linkStyle(item, strokeWidth, color, dash) {
|
|
|
2442
2746
|
dash,
|
|
2443
2747
|
lineCap: "round",
|
|
2444
2748
|
lineJoin: "round",
|
|
2445
|
-
opacity:
|
|
2749
|
+
opacity: chunkXJ4W6TW4_cjs.finite(link.style?.opacity, 1),
|
|
2446
2750
|
shadow: resolveShadow(link.style?.shadow)
|
|
2447
2751
|
};
|
|
2448
2752
|
}
|
|
2449
2753
|
function createLinkRenderContext(item, index, measureText) {
|
|
2450
2754
|
const { link, from, to } = item;
|
|
2451
2755
|
const pathType = link.style?.pathType ?? "orthogonal";
|
|
2452
|
-
const { points, segments } =
|
|
2453
|
-
const strokeWidth =
|
|
2756
|
+
const { points, segments } = chunkXJ4W6TW4_cjs.calculateLinkRoute(link, from, to, pathType);
|
|
2757
|
+
const strokeWidth = chunkXJ4W6TW4_cjs.finite(link.style?.strokeWidth, 2);
|
|
2454
2758
|
const color = getLinkStrokeColor(link.style?.color) || "#64748b";
|
|
2455
2759
|
const label = labelLayout(link, measureText);
|
|
2456
2760
|
const contentDash = getDashArray(strokeWidth, link.style?.strokeStyle ?? "solid");
|
|
2457
|
-
const gap = label.visible && !contentDash ?
|
|
2761
|
+
const gap = label.visible && !contentDash ? chunkXJ4W6TW4_cjs.labelGapDash(points, pathType, label.width, label.height) : null;
|
|
2458
2762
|
const dash = gap ? [gap.dashBefore, gap.gapLength, 1e6] : contentDash;
|
|
2459
2763
|
return {
|
|
2460
2764
|
link,
|
|
2461
2765
|
pathType,
|
|
2462
2766
|
points,
|
|
2463
2767
|
segments,
|
|
2464
|
-
midpoint:
|
|
2768
|
+
midpoint: chunkXJ4W6TW4_cjs.getLineMidpoint(points, pathType, from, to),
|
|
2465
2769
|
strokeWidth,
|
|
2466
2770
|
bounds: linkBounds(points, strokeWidth + 14),
|
|
2467
2771
|
color,
|
|
@@ -2499,7 +2803,7 @@ function polylinePathData(points) {
|
|
|
2499
2803
|
}
|
|
2500
2804
|
return path;
|
|
2501
2805
|
}
|
|
2502
|
-
function
|
|
2806
|
+
function pathData2(points, pathType, segments, strokeWidth) {
|
|
2503
2807
|
if (points.length < 4) {
|
|
2504
2808
|
return "";
|
|
2505
2809
|
}
|
|
@@ -2507,7 +2811,7 @@ function pathData(points, pathType, segments, strokeWidth) {
|
|
|
2507
2811
|
return `M ${points[0]} ${points[1]} C ${points[2]} ${points[3]} ${points[4]} ${points[5]} ${points[6]} ${points[7]}`;
|
|
2508
2812
|
}
|
|
2509
2813
|
if (pathType === "orthogonal" && segments.length > 0) {
|
|
2510
|
-
return
|
|
2814
|
+
return chunkXJ4W6TW4_cjs.roundedOrthogonalPathData(segments, Math.max(16, strokeWidth * 4));
|
|
2511
2815
|
}
|
|
2512
2816
|
return polylinePathData(points);
|
|
2513
2817
|
}
|
|
@@ -2533,7 +2837,7 @@ function renderLinkPath(context) {
|
|
|
2533
2837
|
id: `link-${link.id}`,
|
|
2534
2838
|
order: context.order,
|
|
2535
2839
|
bounds: context.bounds,
|
|
2536
|
-
d:
|
|
2840
|
+
d: pathData2(context.points, context.pathType, context.segments, context.strokeWidth),
|
|
2537
2841
|
style: context.style,
|
|
2538
2842
|
markerStart: markerForEnd(link, "start"),
|
|
2539
2843
|
markerEnd: markerForEnd(link, "end"),
|
|
@@ -2611,7 +2915,7 @@ function buildLink(item, index, measureText) {
|
|
|
2611
2915
|
}
|
|
2612
2916
|
function buildLinks(links, measureText) {
|
|
2613
2917
|
return links.flatMap(
|
|
2614
|
-
(item, index) =>
|
|
2918
|
+
(item, index) => chunkXJ4W6TW4_cjs.tag(
|
|
2615
2919
|
buildLink(item, index, measureText),
|
|
2616
2920
|
"link",
|
|
2617
2921
|
item.link.id,
|
|
@@ -2626,7 +2930,7 @@ function buildFreeformPath(path, index) {
|
|
|
2626
2930
|
if (path.isVisible === false || path.points.length < 2) {
|
|
2627
2931
|
return [];
|
|
2628
2932
|
}
|
|
2629
|
-
const strokeWidth =
|
|
2933
|
+
const strokeWidth = chunkXJ4W6TW4_cjs.finite(path.strokeWidth, 2);
|
|
2630
2934
|
const extra = strokeWidth + 12;
|
|
2631
2935
|
const bounds = {
|
|
2632
2936
|
minX: Math.min(...path.points.map((point) => point.x)) - extra,
|
|
@@ -2634,7 +2938,7 @@ function buildFreeformPath(path, index) {
|
|
|
2634
2938
|
maxX: Math.max(...path.points.map((point) => point.x)) + extra,
|
|
2635
2939
|
maxY: Math.max(...path.points.map((point) => point.y)) + extra
|
|
2636
2940
|
};
|
|
2637
|
-
const tension =
|
|
2941
|
+
const tension = chunkXJ4W6TW4_cjs.finite(path.tension, 0);
|
|
2638
2942
|
const closed = path.closed === true;
|
|
2639
2943
|
return [
|
|
2640
2944
|
{
|
|
@@ -2642,7 +2946,7 @@ function buildFreeformPath(path, index) {
|
|
|
2642
2946
|
id: `path-${path.id}`,
|
|
2643
2947
|
order: 3e4 + index,
|
|
2644
2948
|
bounds,
|
|
2645
|
-
d:
|
|
2949
|
+
d: chunkXJ4W6TW4_cjs.freeformPathData({ points: path.points, tension, closed }),
|
|
2646
2950
|
markerStart: path.startMarker,
|
|
2647
2951
|
markerEnd: path.endMarker,
|
|
2648
2952
|
detail: {
|
|
@@ -2658,13 +2962,13 @@ function buildFreeformPath(path, index) {
|
|
|
2658
2962
|
dash: path.dash?.length ? path.dash : void 0,
|
|
2659
2963
|
lineCap: "round",
|
|
2660
2964
|
lineJoin: "round",
|
|
2661
|
-
opacity:
|
|
2965
|
+
opacity: chunkXJ4W6TW4_cjs.finite(path.opacity, 1)
|
|
2662
2966
|
}
|
|
2663
2967
|
}
|
|
2664
2968
|
];
|
|
2665
2969
|
}
|
|
2666
2970
|
function buildFreeformPaths(paths) {
|
|
2667
|
-
return paths.flatMap((path, index) =>
|
|
2971
|
+
return paths.flatMap((path, index) => chunkXJ4W6TW4_cjs.tag(buildFreeformPath(path, index), "path", path.id, "path", "Path"));
|
|
2668
2972
|
}
|
|
2669
2973
|
|
|
2670
2974
|
// src/renderScene/artifacts/shape/geometry/base.ts
|
|
@@ -2680,7 +2984,7 @@ function shapeNodeBase(context) {
|
|
|
2680
2984
|
|
|
2681
2985
|
// src/renderScene/artifacts/shape/geometry/simple.ts
|
|
2682
2986
|
function renderPath(context) {
|
|
2683
|
-
const path =
|
|
2987
|
+
const path = chunkXJ4W6TW4_cjs.localShapePath(context.shape.shapeType, context.x, context.y, context.width, context.height);
|
|
2684
2988
|
if (!path) {
|
|
2685
2989
|
return [];
|
|
2686
2990
|
}
|
|
@@ -2696,7 +3000,7 @@ function renderBoundedPath(context) {
|
|
|
2696
3000
|
}));
|
|
2697
3001
|
}
|
|
2698
3002
|
function renderRectangle(context) {
|
|
2699
|
-
const rx = context.shape.shapeType === "pill" ?
|
|
3003
|
+
const rx = context.shape.shapeType === "pill" ? chunkXJ4W6TW4_cjs.pillCornerRadius(context.width, context.height) : context.shape.shapeType === "rounded_rectangle" ? chunkXJ4W6TW4_cjs.finite(context.shape.cornerRadius, 8) : 0;
|
|
2700
3004
|
return [
|
|
2701
3005
|
{
|
|
2702
3006
|
...shapeNodeBase(context),
|
|
@@ -2725,7 +3029,7 @@ function renderSymbol(context) {
|
|
|
2725
3029
|
if (!context.shape.symbol || context.shape.symbol.points.length < 2) {
|
|
2726
3030
|
return renderRectangle(context);
|
|
2727
3031
|
}
|
|
2728
|
-
const tension =
|
|
3032
|
+
const tension = chunkXJ4W6TW4_cjs.finite(context.shape.symbol.tension, 0);
|
|
2729
3033
|
const points = context.shape.symbol.points.map(([x, y]) => ({
|
|
2730
3034
|
x: context.x + x * context.width,
|
|
2731
3035
|
y: context.y + y * context.height
|
|
@@ -2734,7 +3038,7 @@ function renderSymbol(context) {
|
|
|
2734
3038
|
{
|
|
2735
3039
|
...shapeNodeBase(context),
|
|
2736
3040
|
type: "path",
|
|
2737
|
-
d:
|
|
3041
|
+
d: chunkXJ4W6TW4_cjs.freeformPathData({ points, tension, closed: true }),
|
|
2738
3042
|
rotationCenter: context.rotationCenter,
|
|
2739
3043
|
detail: {
|
|
2740
3044
|
of: "symbolGeometry",
|
|
@@ -2832,22 +3136,22 @@ function shapeDash(shape, strokeWidth) {
|
|
|
2832
3136
|
}
|
|
2833
3137
|
function shapeStyle(shape, diagnostics) {
|
|
2834
3138
|
const defaults = shapeDefaults(shape, diagnostics);
|
|
2835
|
-
const strokeWidth =
|
|
3139
|
+
const strokeWidth = chunkXJ4W6TW4_cjs.finite(shape.strokeWidth, defaults.strokeWidth);
|
|
2836
3140
|
const shadow = shape.shadowStyle ?? (shape.hasShadow ? { enabled: true, color: "#000000", opacity: 0.25, blur: 10, angle: 45, distance: 5 } : void 0);
|
|
2837
|
-
const angle =
|
|
3141
|
+
const angle = chunkXJ4W6TW4_cjs.finite(shadow?.angle, 45) * Math.PI / 180;
|
|
2838
3142
|
return {
|
|
2839
|
-
fill:
|
|
2840
|
-
stroke:
|
|
3143
|
+
fill: chunkXJ4W6TW4_cjs.paint(shape.fillColor, diagnostics, shape.id),
|
|
3144
|
+
stroke: chunkXJ4W6TW4_cjs.paint(shape.strokeColor, diagnostics, shape.id),
|
|
2841
3145
|
strokeWidth,
|
|
2842
3146
|
dash: shapeDash(shape, strokeWidth),
|
|
2843
3147
|
lineCap: shape.strokeStyle === "dotted" ? "round" : "butt",
|
|
2844
|
-
opacity:
|
|
3148
|
+
opacity: chunkXJ4W6TW4_cjs.finite(shape.opacity, defaults.opacity),
|
|
2845
3149
|
shadow: shadow?.enabled ? {
|
|
2846
3150
|
color: shadow.color ?? "#000000",
|
|
2847
|
-
opacity:
|
|
2848
|
-
blur:
|
|
2849
|
-
dx: Math.cos(angle) *
|
|
2850
|
-
dy: Math.sin(angle) *
|
|
3151
|
+
opacity: chunkXJ4W6TW4_cjs.finite(shadow.opacity, 0.25),
|
|
3152
|
+
blur: chunkXJ4W6TW4_cjs.finite(shadow.blur, 10),
|
|
3153
|
+
dx: Math.cos(angle) * chunkXJ4W6TW4_cjs.finite(shadow.distance, 5),
|
|
3154
|
+
dy: Math.sin(angle) * chunkXJ4W6TW4_cjs.finite(shadow.distance, 5)
|
|
2851
3155
|
} : void 0
|
|
2852
3156
|
};
|
|
2853
3157
|
}
|
|
@@ -2923,11 +3227,11 @@ function renderShapeText(context, strokeWidth, measureText) {
|
|
|
2923
3227
|
if (!shape.text) {
|
|
2924
3228
|
return null;
|
|
2925
3229
|
}
|
|
2926
|
-
const fontSize =
|
|
3230
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(shape.fontSize, shapeDefaults(shape, []).fontSize);
|
|
2927
3231
|
const padding = shape.isText ? 0 : Math.max(8, strokeWidth * 2);
|
|
2928
|
-
const area = shape.shapeType === "person" ?
|
|
3232
|
+
const area = shape.shapeType === "person" ? chunkXJ4W6TW4_cjs.personLabelArea(x, y, width, height) : { x, y, width, height };
|
|
2929
3233
|
const textWidth = Math.max(0, area.width - padding * 2);
|
|
2930
|
-
const fontFamily2 = shape.fontFamily ||
|
|
3234
|
+
const fontFamily2 = shape.fontFamily || chunkXJ4W6TW4_cjs.DEFAULT_FONT;
|
|
2931
3235
|
const metrics = measureText?.(fontFamily2, fontSize);
|
|
2932
3236
|
const textNode = {
|
|
2933
3237
|
type: "text",
|
|
@@ -2938,7 +3242,7 @@ function renderShapeText(context, strokeWidth, measureText) {
|
|
|
2938
3242
|
y: area.y + padding,
|
|
2939
3243
|
width: textWidth,
|
|
2940
3244
|
height: Math.max(0, area.height - padding * 2),
|
|
2941
|
-
lines:
|
|
3245
|
+
lines: chunkXJ4W6TW4_cjs.wrapText(shape.text, textWidth, fontSize, metrics),
|
|
2942
3246
|
fontFamily: fontFamily2,
|
|
2943
3247
|
fontSize,
|
|
2944
3248
|
fontWeight: shape.fontWeight ?? "normal",
|
|
@@ -2946,12 +3250,12 @@ function renderShapeText(context, strokeWidth, measureText) {
|
|
|
2946
3250
|
color: shape.textColor || "#111827",
|
|
2947
3251
|
align: shape.textAlign ?? "center",
|
|
2948
3252
|
verticalAlign: shape.textVerticalAlign ?? "middle",
|
|
2949
|
-
lineHeight:
|
|
3253
|
+
lineHeight: chunkXJ4W6TW4_cjs.finite(shape.lineHeight, 1.3),
|
|
2950
3254
|
rotation,
|
|
2951
3255
|
rotationCenter
|
|
2952
3256
|
};
|
|
2953
3257
|
if (hasBoldMarkup(shape.text)) {
|
|
2954
|
-
const { measure, spaceWidth } = metrics ??
|
|
3258
|
+
const { measure, spaceWidth } = metrics ?? chunkXJ4W6TW4_cjs.heuristicRichMeasure(fontSize);
|
|
2955
3259
|
textNode.richLines = wrapRichText(shape.text, textWidth, measure, spaceWidth);
|
|
2956
3260
|
}
|
|
2957
3261
|
return textNode;
|
|
@@ -2990,19 +3294,19 @@ function renderDoubleStroke(context, strokeWidth) {
|
|
|
2990
3294
|
return nodes;
|
|
2991
3295
|
}
|
|
2992
3296
|
function createRenderContext(shape, index, diagnostics) {
|
|
2993
|
-
const x =
|
|
2994
|
-
const y =
|
|
2995
|
-
const width = Math.max(0,
|
|
2996
|
-
const height = Math.max(0,
|
|
2997
|
-
const rotation =
|
|
2998
|
-
const strokeWidth =
|
|
3297
|
+
const x = chunkXJ4W6TW4_cjs.finite(shape.x, 0);
|
|
3298
|
+
const y = chunkXJ4W6TW4_cjs.finite(shape.y, 0);
|
|
3299
|
+
const width = Math.max(0, chunkXJ4W6TW4_cjs.finite(shape.width, 100));
|
|
3300
|
+
const height = Math.max(0, chunkXJ4W6TW4_cjs.finite(shape.height, 100));
|
|
3301
|
+
const rotation = chunkXJ4W6TW4_cjs.finite(shape.rotation, 0);
|
|
3302
|
+
const strokeWidth = chunkXJ4W6TW4_cjs.finite(shape.strokeWidth, 2);
|
|
2999
3303
|
return {
|
|
3000
3304
|
strokeWidth,
|
|
3001
3305
|
context: {
|
|
3002
3306
|
shape,
|
|
3003
3307
|
id: `shape-${shape.id}`,
|
|
3004
3308
|
order: 1e4 + index,
|
|
3005
|
-
bounds:
|
|
3309
|
+
bounds: chunkXJ4W6TW4_cjs.rotatedBounds({ x, y, width, height }, rotation, strokeWidth + (shape.hasShadow ? 20 : 2)),
|
|
3006
3310
|
rotation,
|
|
3007
3311
|
rotationCenter: { x: x + width / 2, y: y + height / 2 },
|
|
3008
3312
|
style: shapeStyle(shape, diagnostics),
|
|
@@ -3055,7 +3359,7 @@ function buildShape(shape, index, diagnostics, measureText) {
|
|
|
3055
3359
|
}
|
|
3056
3360
|
function buildShapes(shapes, diagnostics, measureText) {
|
|
3057
3361
|
return shapes.flatMap(
|
|
3058
|
-
(shape, index) =>
|
|
3362
|
+
(shape, index) => chunkXJ4W6TW4_cjs.tag(
|
|
3059
3363
|
buildShape(shape, index, diagnostics, measureText),
|
|
3060
3364
|
"shape",
|
|
3061
3365
|
shape.id,
|
|
@@ -3072,7 +3376,7 @@ function buildXAxisLabel(chart, layout, order) {
|
|
|
3072
3376
|
return null;
|
|
3073
3377
|
}
|
|
3074
3378
|
return {
|
|
3075
|
-
...
|
|
3379
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
3076
3380
|
role: "axis",
|
|
3077
3381
|
id: `chart-x-label-${chart.id}`,
|
|
3078
3382
|
order,
|
|
@@ -3082,7 +3386,7 @@ function buildXAxisLabel(chart, layout, order) {
|
|
|
3082
3386
|
chart,
|
|
3083
3387
|
align: "center"
|
|
3084
3388
|
}),
|
|
3085
|
-
prop:
|
|
3389
|
+
prop: chunkXJ4W6TW4_cjs.axisLabelProp("x")
|
|
3086
3390
|
};
|
|
3087
3391
|
}
|
|
3088
3392
|
function buildYAxisLabel(chart, layout, order) {
|
|
@@ -3090,7 +3394,7 @@ function buildYAxisLabel(chart, layout, order) {
|
|
|
3090
3394
|
return null;
|
|
3091
3395
|
}
|
|
3092
3396
|
return {
|
|
3093
|
-
...
|
|
3397
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
3094
3398
|
role: "axis",
|
|
3095
3399
|
id: `chart-y-label-${chart.id}`,
|
|
3096
3400
|
order,
|
|
@@ -3106,7 +3410,7 @@ function buildYAxisLabel(chart, layout, order) {
|
|
|
3106
3410
|
align: "center",
|
|
3107
3411
|
rotation: -90
|
|
3108
3412
|
}),
|
|
3109
|
-
prop:
|
|
3413
|
+
prop: chunkXJ4W6TW4_cjs.axisLabelProp("y")
|
|
3110
3414
|
};
|
|
3111
3415
|
}
|
|
3112
3416
|
function buildAxisLabels(chart, layout, order) {
|
|
@@ -3129,7 +3433,7 @@ function buildBoxplotSeriesYAxisTicks(chart, layout, order) {
|
|
|
3129
3433
|
return chart.series.map((series, index) => {
|
|
3130
3434
|
const centerY = layout.plot.y + (index + 0.5) * slotWidth;
|
|
3131
3435
|
return {
|
|
3132
|
-
...
|
|
3436
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
3133
3437
|
role: "axis",
|
|
3134
3438
|
id: `chart-y-tick-${chart.id}-${index}`,
|
|
3135
3439
|
order: order + index,
|
|
@@ -3139,7 +3443,7 @@ function buildBoxplotSeriesYAxisTicks(chart, layout, order) {
|
|
|
3139
3443
|
chart,
|
|
3140
3444
|
align: "right"
|
|
3141
3445
|
}),
|
|
3142
|
-
prop:
|
|
3446
|
+
prop: chunkXJ4W6TW4_cjs.seriesLabelProp(series.id)
|
|
3143
3447
|
};
|
|
3144
3448
|
});
|
|
3145
3449
|
}
|
|
@@ -3165,7 +3469,7 @@ function isStackedLegendPosition(position) {
|
|
|
3165
3469
|
return position === "bottomLeft" || position === "bottomRight";
|
|
3166
3470
|
}
|
|
3167
3471
|
function legendItemWidths(chart) {
|
|
3168
|
-
return legendSeries(chart).map((item) => Math.max(42, item.label.length *
|
|
3472
|
+
return legendSeries(chart).map((item) => Math.max(42, item.label.length * chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12) * 0.58 + 22));
|
|
3169
3473
|
}
|
|
3170
3474
|
function stackedLegendColumnWidth(chart) {
|
|
3171
3475
|
const widths = legendItemWidths(chart);
|
|
@@ -3218,9 +3522,9 @@ function renderLegendItem(render2, item) {
|
|
|
3218
3522
|
}
|
|
3219
3523
|
function createLegendSwatch(render2, item) {
|
|
3220
3524
|
const { chart, bounds, diagnostics } = render2;
|
|
3221
|
-
const fallback =
|
|
3525
|
+
const fallback = chunkXJ4W6TW4_cjs.CHART_COLORS[item.seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
3222
3526
|
const solidOnly = chart.chartType === "line";
|
|
3223
|
-
const color = solidOnly ?
|
|
3527
|
+
const color = solidOnly ? chunkXJ4W6TW4_cjs.representativeColor(item.series.color, fallback) : item.series.color ?? fallback;
|
|
3224
3528
|
return {
|
|
3225
3529
|
type: "rect",
|
|
3226
3530
|
id: `chart-legend-swatch-${chart.id}-${item.series.id}`,
|
|
@@ -3231,16 +3535,16 @@ function createLegendSwatch(render2, item) {
|
|
|
3231
3535
|
width: 10,
|
|
3232
3536
|
height: 10,
|
|
3233
3537
|
rx: 3,
|
|
3234
|
-
prop:
|
|
3538
|
+
prop: chunkXJ4W6TW4_cjs.seriesColorProp(item.series.id),
|
|
3235
3539
|
propKind: "color",
|
|
3236
3540
|
propSolidOnly: solidOnly,
|
|
3237
|
-
style: { fill:
|
|
3541
|
+
style: { fill: chunkXJ4W6TW4_cjs.paint(color, diagnostics, chart.id) }
|
|
3238
3542
|
};
|
|
3239
3543
|
}
|
|
3240
3544
|
function createLegendLabel(render2, item) {
|
|
3241
3545
|
const { chart, bounds } = render2;
|
|
3242
3546
|
return {
|
|
3243
|
-
...
|
|
3547
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
3244
3548
|
role: "legend",
|
|
3245
3549
|
id: `chart-legend-${chart.id}-${item.series.id}`,
|
|
3246
3550
|
order: item.order + 1,
|
|
@@ -3249,7 +3553,7 @@ function createLegendLabel(render2, item) {
|
|
|
3249
3553
|
text: item.series.label,
|
|
3250
3554
|
chart
|
|
3251
3555
|
}),
|
|
3252
|
-
prop:
|
|
3556
|
+
prop: chunkXJ4W6TW4_cjs.seriesLabelProp(item.series.id)
|
|
3253
3557
|
};
|
|
3254
3558
|
}
|
|
3255
3559
|
|
|
@@ -3268,13 +3572,13 @@ function hasCartesianDecorations(chart) {
|
|
|
3268
3572
|
return !CHARTS_WITHOUT_CARTESIAN_DECORATIONS.has(chart.chartType);
|
|
3269
3573
|
}
|
|
3270
3574
|
function tickOffset(chart) {
|
|
3271
|
-
return hasCartesianDecorations(chart) ? Math.max(0,
|
|
3575
|
+
return hasCartesianDecorations(chart) ? Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.tickLength, 0)) : 0;
|
|
3272
3576
|
}
|
|
3273
3577
|
function isHorizontalBoxplot(chart) {
|
|
3274
3578
|
return chart.chartType === "boxplot" && chart.config?.orientation === "horizontal";
|
|
3275
3579
|
}
|
|
3276
3580
|
function boxplotCategoryLabelWidth(chart) {
|
|
3277
|
-
const fontSize =
|
|
3581
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12);
|
|
3278
3582
|
const longest = Math.max(0, ...chart.series.map((series) => (series.label || series.id).length));
|
|
3279
3583
|
return longest * fontSize * 0.58 + 16;
|
|
3280
3584
|
}
|
|
@@ -3286,7 +3590,7 @@ function treemapSideLegendSide(chart, showLegend) {
|
|
|
3286
3590
|
return chart.legendPosition === "left" ? "left" : chart.legendPosition === "right" ? "right" : null;
|
|
3287
3591
|
}
|
|
3288
3592
|
function barCategoryLabelWidth(chart) {
|
|
3289
|
-
const fontSize =
|
|
3593
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(chart.axisFontSize ?? chart.fontSize, 12);
|
|
3290
3594
|
const categories = chart.config?.categories ?? [];
|
|
3291
3595
|
return Math.max(0, ...categories.map((category) => category.length)) * fontSize * 0.58 + 16;
|
|
3292
3596
|
}
|
|
@@ -3294,7 +3598,7 @@ function leftLabelWidth(chart) {
|
|
|
3294
3598
|
if (isHorizontalBoxplot(chart)) {
|
|
3295
3599
|
return boxplotCategoryLabelWidth(chart);
|
|
3296
3600
|
}
|
|
3297
|
-
if (
|
|
3601
|
+
if (chunkXJ4W6TW4_cjs.isHorizontalBar(chart)) {
|
|
3298
3602
|
return chart.categoryAlign === "left" || chart.categoryAlign === "inside" ? 20 : barCategoryLabelWidth(chart);
|
|
3299
3603
|
}
|
|
3300
3604
|
if (chart.showValueAxis === false) {
|
|
@@ -3315,17 +3619,17 @@ function decorations(chart) {
|
|
|
3315
3619
|
const padLeft = tick + (showLabels ? leftLabelWidth(chart) : 12) + (legendPosition === "bottomLeft" ? sideColumnWidth : 0) + (treemapSide === "left" ? TREEMAP_SIDE_LEGEND_WIDTH : 0);
|
|
3316
3620
|
const padRight = 24 + (legendPosition === "bottomRight" ? sideColumnWidth : 0) + (treemapSide === "right" ? TREEMAP_SIDE_LEGEND_WIDTH : 0);
|
|
3317
3621
|
const valueRow = chart.chartType === "bar" && chart.config?.showBarLabels === true && chart.config.barLabelPosition === "axis";
|
|
3318
|
-
const horizontalValueAxis =
|
|
3319
|
-
const basePadBottom = showLabels ?
|
|
3622
|
+
const horizontalValueAxis = chunkXJ4W6TW4_cjs.isHorizontalBar(chart) && chart.showValueAxis !== false;
|
|
3623
|
+
const basePadBottom = showLabels ? chunkXJ4W6TW4_cjs.isHorizontalBar(chart) ? horizontalValueAxis ? 34 : 12 : (chart.axisX.label ? 52 : 34) + (valueRow ? 18 : 0) : 12;
|
|
3320
3624
|
const hasColorBar = chart.chartType === "field" && showLegend && Boolean(chart.config?.scale?.stops.length);
|
|
3321
3625
|
const legendAtBottomRow = hasLegendItems && !legendAtTop && !legendStacked;
|
|
3322
3626
|
const padBottom = tick + basePadBottom + (hasColorBar ? 44 : 0) + (legendAtBottomRow ? 16 + LEGEND_ROW_HEIGHT : 0);
|
|
3323
|
-
const titleHeight = chart.title ? Math.max(44, 20 +
|
|
3627
|
+
const titleHeight = chart.title ? Math.max(44, 20 + chunkXJ4W6TW4_cjs.finite(chart.titleSize, 14) * 1.6) : 0;
|
|
3324
3628
|
const padTop = titleHeight || (legendAtTop && hasLegendItems ? 44 : 24);
|
|
3325
3629
|
return {
|
|
3326
|
-
bounds:
|
|
3630
|
+
bounds: chunkXJ4W6TW4_cjs.boxBounds(
|
|
3327
3631
|
{ x: chart.x, y: chart.y, width: chart.width, height: chart.height },
|
|
3328
|
-
|
|
3632
|
+
chunkXJ4W6TW4_cjs.finite(chart.strokeWidth, 1) + 2
|
|
3329
3633
|
),
|
|
3330
3634
|
plot: {
|
|
3331
3635
|
x: chart.x + padLeft,
|
|
@@ -3347,19 +3651,19 @@ function categoryLabels(chart, count) {
|
|
|
3347
3651
|
return Array.from({ length: count }, (_value, index) => String(index + 1));
|
|
3348
3652
|
}
|
|
3349
3653
|
function buildCategoricalXAxisTicks(chart, layout, order) {
|
|
3350
|
-
const count =
|
|
3654
|
+
const count = chunkXJ4W6TW4_cjs.barCategoryCount(chart);
|
|
3351
3655
|
const slotWidth = layout.plot.width / count;
|
|
3352
3656
|
const labels = categoryLabels(chart, count);
|
|
3353
3657
|
const editable = Boolean(chart.config?.categories?.length);
|
|
3354
3658
|
const left = chart.categoryAlign === "left";
|
|
3355
3659
|
const groupGap = left ? Math.min(
|
|
3356
|
-
Math.max(0,
|
|
3660
|
+
Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.barGroupGap, 8)),
|
|
3357
3661
|
Math.max(0, slotWidth - 1)
|
|
3358
3662
|
) : 0;
|
|
3359
3663
|
return Array.from({ length: count }, (_value, index) => {
|
|
3360
3664
|
const centerX = layout.plot.x + (index + 0.5) * slotWidth;
|
|
3361
3665
|
return {
|
|
3362
|
-
...
|
|
3666
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
3363
3667
|
role: "axis",
|
|
3364
3668
|
id: `chart-x-tick-${chart.id}-${index}`,
|
|
3365
3669
|
order: order + index,
|
|
@@ -3374,7 +3678,7 @@ function buildCategoricalXAxisTicks(chart, layout, order) {
|
|
|
3374
3678
|
chart,
|
|
3375
3679
|
align: left ? "left" : "center"
|
|
3376
3680
|
}),
|
|
3377
|
-
prop: editable ?
|
|
3681
|
+
prop: editable ? chunkXJ4W6TW4_cjs.categoryProp(index) : void 0
|
|
3378
3682
|
};
|
|
3379
3683
|
});
|
|
3380
3684
|
}
|
|
@@ -3384,7 +3688,7 @@ function buildSeriesXAxisTicks(chart, layout, order) {
|
|
|
3384
3688
|
return chart.series.map((series, index) => {
|
|
3385
3689
|
const centerX = layout.plot.x + (index + 0.5) * slotWidth;
|
|
3386
3690
|
return {
|
|
3387
|
-
...
|
|
3691
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
3388
3692
|
role: "axis",
|
|
3389
3693
|
id: `chart-x-tick-${chart.id}-${index}`,
|
|
3390
3694
|
order: order + index,
|
|
@@ -3399,16 +3703,16 @@ function buildSeriesXAxisTicks(chart, layout, order) {
|
|
|
3399
3703
|
chart,
|
|
3400
3704
|
align: "center"
|
|
3401
3705
|
}),
|
|
3402
|
-
prop:
|
|
3706
|
+
prop: chunkXJ4W6TW4_cjs.seriesLabelProp(series.id)
|
|
3403
3707
|
};
|
|
3404
3708
|
});
|
|
3405
3709
|
}
|
|
3406
3710
|
|
|
3407
3711
|
// src/renderScene/charts/decorations/numericXAxis.ts
|
|
3408
3712
|
function buildNumericXAxisTicks(chart, layout, order) {
|
|
3409
|
-
return
|
|
3410
|
-
const x = layout.plot.x +
|
|
3411
|
-
return
|
|
3713
|
+
return chunkXJ4W6TW4_cjs.chartTicks(chart.axisX).map((tick, index) => {
|
|
3714
|
+
const x = layout.plot.x + chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisX, layout.plot.width);
|
|
3715
|
+
return chunkXJ4W6TW4_cjs.chartText({
|
|
3412
3716
|
role: "axis",
|
|
3413
3717
|
id: `chart-x-tick-${chart.id}-${tick}`,
|
|
3414
3718
|
order: order + index,
|
|
@@ -3423,9 +3727,9 @@ function buildNumericXAxisTicks(chart, layout, order) {
|
|
|
3423
3727
|
|
|
3424
3728
|
// src/renderScene/charts/decorations/numericYAxis.ts
|
|
3425
3729
|
function buildNumericYAxisTicks(chart, layout, order) {
|
|
3426
|
-
return
|
|
3427
|
-
const y = layout.plot.y + layout.plot.height -
|
|
3428
|
-
return
|
|
3730
|
+
return chunkXJ4W6TW4_cjs.chartTicks(chart.axisY).map((tick, index) => {
|
|
3731
|
+
const y = layout.plot.y + layout.plot.height - chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisY, layout.plot.height);
|
|
3732
|
+
return chunkXJ4W6TW4_cjs.chartText({
|
|
3429
3733
|
role: "axis",
|
|
3430
3734
|
id: `chart-y-tick-${chart.id}-${tick}`,
|
|
3431
3735
|
order: order + index,
|
|
@@ -3460,10 +3764,10 @@ function buildYAxisTicks(chart, layout, order) {
|
|
|
3460
3764
|
function xTickPositions(chart, layout) {
|
|
3461
3765
|
const { plot } = layout;
|
|
3462
3766
|
if (chart.chartType === "bar") {
|
|
3463
|
-
const count =
|
|
3767
|
+
const count = chunkXJ4W6TW4_cjs.barCategoryCount(chart);
|
|
3464
3768
|
return Array.from({ length: count }, (_value, index) => plot.x + (index + 0.5) * plot.width / count);
|
|
3465
3769
|
}
|
|
3466
|
-
return
|
|
3770
|
+
return chunkXJ4W6TW4_cjs.chartTicks(chart.axisX).map((tick) => plot.x + chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisX, plot.width));
|
|
3467
3771
|
}
|
|
3468
3772
|
function axisLineDash(chart, width) {
|
|
3469
3773
|
if (chart.axisLineStyle === "dashed") {
|
|
@@ -3472,8 +3776,8 @@ function axisLineDash(chart, width) {
|
|
|
3472
3776
|
return chart.axisLineStyle === "dotted" ? { dash: [0.1, width * 3], lineCap: "round" } : {};
|
|
3473
3777
|
}
|
|
3474
3778
|
function buildAxisLines(chart, layout, order) {
|
|
3475
|
-
const lineWidth =
|
|
3476
|
-
const tickLength =
|
|
3779
|
+
const lineWidth = chunkXJ4W6TW4_cjs.finite(chart.axisLineWidth, 0);
|
|
3780
|
+
const tickLength = chunkXJ4W6TW4_cjs.finite(chart.tickLength, 0);
|
|
3477
3781
|
if (lineWidth <= 0 && tickLength <= 0) {
|
|
3478
3782
|
return [];
|
|
3479
3783
|
}
|
|
@@ -3494,20 +3798,20 @@ function buildAxisLines(chart, layout, order) {
|
|
|
3494
3798
|
}
|
|
3495
3799
|
add("line-x", `M ${plot.x} ${bottom} L ${plot.x + plot.width} ${bottom}`);
|
|
3496
3800
|
}
|
|
3497
|
-
if (tickLength > 0 &&
|
|
3498
|
-
|
|
3499
|
-
const x = plot.x +
|
|
3801
|
+
if (tickLength > 0 && chunkXJ4W6TW4_cjs.isHorizontalBar(chart)) {
|
|
3802
|
+
chunkXJ4W6TW4_cjs.chartTicks(chart.axisY).forEach((tick) => {
|
|
3803
|
+
const x = plot.x + chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisY, plot.width);
|
|
3500
3804
|
add(`tick-v-${tick}`, `M ${x} ${bottom} L ${x} ${bottom + tickLength}`);
|
|
3501
3805
|
});
|
|
3502
|
-
const rows =
|
|
3806
|
+
const rows = chunkXJ4W6TW4_cjs.horizontalRows(chart, plot);
|
|
3503
3807
|
for (let index = 0; index < rows.count; index++) {
|
|
3504
|
-
const y =
|
|
3808
|
+
const y = chunkXJ4W6TW4_cjs.rowTop(rows, plot, index) + rows.labelRow + rows.barsHeight / 2;
|
|
3505
3809
|
add(`tick-c-${index}`, `M ${plot.x - tickLength} ${y} L ${plot.x} ${y}`);
|
|
3506
3810
|
}
|
|
3507
3811
|
}
|
|
3508
|
-
if (tickLength > 0 && !isHorizontalBoxplot2(chart) && !
|
|
3509
|
-
|
|
3510
|
-
const y = bottom -
|
|
3812
|
+
if (tickLength > 0 && !isHorizontalBoxplot2(chart) && !chunkXJ4W6TW4_cjs.isHorizontalBar(chart)) {
|
|
3813
|
+
chunkXJ4W6TW4_cjs.chartTicks(chart.axisY).forEach((tick) => {
|
|
3814
|
+
const y = bottom - chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisY, plot.height);
|
|
3511
3815
|
add(`tick-y-${tick}`, `M ${plot.x - tickLength} ${y} L ${plot.x} ${y}`);
|
|
3512
3816
|
});
|
|
3513
3817
|
xTickPositions(chart, layout).forEach((x, index) => {
|
|
@@ -3522,14 +3826,14 @@ function categoryNames(chart, count) {
|
|
|
3522
3826
|
}
|
|
3523
3827
|
function buildHorizontalBarAxes(chart, layout, order) {
|
|
3524
3828
|
const { plot, bounds } = layout;
|
|
3525
|
-
const rows =
|
|
3829
|
+
const rows = chunkXJ4W6TW4_cjs.horizontalRows(chart, plot);
|
|
3526
3830
|
const above = chart.categoryAlign === "left";
|
|
3527
3831
|
const inside = chart.categoryAlign === "inside";
|
|
3528
3832
|
const editable = Boolean(chart.config?.categories?.length);
|
|
3529
3833
|
const nodes = categoryNames(chart, rows.count).map((name, index) => {
|
|
3530
|
-
const top =
|
|
3834
|
+
const top = chunkXJ4W6TW4_cjs.rowTop(rows, plot, index);
|
|
3531
3835
|
return {
|
|
3532
|
-
...
|
|
3836
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
3533
3837
|
role: "axis",
|
|
3534
3838
|
id: `chart-y-category-${chart.id}-${index}`,
|
|
3535
3839
|
order: order + index,
|
|
@@ -3539,19 +3843,19 @@ function buildHorizontalBarAxes(chart, layout, order) {
|
|
|
3539
3843
|
chart,
|
|
3540
3844
|
align: above || inside ? "left" : "right"
|
|
3541
3845
|
}),
|
|
3542
|
-
prop: editable ?
|
|
3846
|
+
prop: editable ? chunkXJ4W6TW4_cjs.categoryProp(index) : void 0
|
|
3543
3847
|
};
|
|
3544
3848
|
});
|
|
3545
3849
|
if (chart.showValueAxis !== false) {
|
|
3546
|
-
|
|
3547
|
-
const x = plot.x +
|
|
3850
|
+
chunkXJ4W6TW4_cjs.chartTicks(chart.axisY).forEach((tick, index) => {
|
|
3851
|
+
const x = plot.x + chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisY, plot.width);
|
|
3548
3852
|
nodes.push(
|
|
3549
|
-
|
|
3853
|
+
chunkXJ4W6TW4_cjs.chartText({
|
|
3550
3854
|
role: "axis",
|
|
3551
3855
|
id: `chart-x-tick-${chart.id}-${tick}`,
|
|
3552
3856
|
order: order + rows.count + index,
|
|
3553
3857
|
bounds,
|
|
3554
|
-
frame: { x: x - 20, y: plot.y + plot.height + 4 +
|
|
3858
|
+
frame: { x: x - 20, y: plot.y + plot.height + 4 + chunkXJ4W6TW4_cjs.finite(chart.tickLength, 0), width: 40, height: 18 },
|
|
3555
3859
|
text: String(tick),
|
|
3556
3860
|
chart,
|
|
3557
3861
|
align: "center"
|
|
@@ -3570,7 +3874,7 @@ function buildChartAxes(chart, layout, order) {
|
|
|
3570
3874
|
return lines;
|
|
3571
3875
|
}
|
|
3572
3876
|
order += lines.length;
|
|
3573
|
-
if (
|
|
3877
|
+
if (chunkXJ4W6TW4_cjs.isHorizontalBar(chart)) {
|
|
3574
3878
|
return [...lines, ...buildHorizontalBarAxes(chart, layout, order)];
|
|
3575
3879
|
}
|
|
3576
3880
|
const xTicks = buildXAxisTicks(chart, layout, order);
|
|
@@ -3648,7 +3952,7 @@ function buildCircularChartGrid(chart, plot, bounds, order) {
|
|
|
3648
3952
|
const centerX = plot.x + plot.width / 2;
|
|
3649
3953
|
const centerY = plot.y + plot.height / 2;
|
|
3650
3954
|
const radius = Math.max(0, Math.min(plot.width, plot.height) / 2);
|
|
3651
|
-
const width =
|
|
3955
|
+
const width = chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1);
|
|
3652
3956
|
if (chart.gridLineStyle === "dotted") {
|
|
3653
3957
|
return buildDottedCircularGrid(chart, bounds, order, centerX, centerY, radius, width);
|
|
3654
3958
|
}
|
|
@@ -3659,7 +3963,7 @@ function buildCircularChartGrid(chart, plot, bounds, order) {
|
|
|
3659
3963
|
...gridLineDashStyle(chart, width)
|
|
3660
3964
|
};
|
|
3661
3965
|
const nodes = [];
|
|
3662
|
-
|
|
3966
|
+
chunkXJ4W6TW4_cjs.chartTicks(chart.axisY).filter((tick) => tick > chart.axisY.min).forEach((tick) => {
|
|
3663
3967
|
const ringRadius = radius * ringRatio(chart, tick);
|
|
3664
3968
|
nodes.push({
|
|
3665
3969
|
type: "ellipse",
|
|
@@ -3673,8 +3977,8 @@ function buildCircularChartGrid(chart, plot, bounds, order) {
|
|
|
3673
3977
|
style
|
|
3674
3978
|
});
|
|
3675
3979
|
});
|
|
3676
|
-
|
|
3677
|
-
const angle =
|
|
3980
|
+
chunkXJ4W6TW4_cjs.chartTicks(chart.axisX).forEach((tick) => {
|
|
3981
|
+
const angle = chunkXJ4W6TW4_cjs.angleForAxisValue(chart.axisX.min, chart.axisX.max, tick);
|
|
3678
3982
|
const edgeX = centerX + Math.cos(angle) * radius;
|
|
3679
3983
|
const edgeY = centerY + Math.sin(angle) * radius;
|
|
3680
3984
|
nodes.push({
|
|
@@ -3689,13 +3993,13 @@ function buildCircularChartGrid(chart, plot, bounds, order) {
|
|
|
3689
3993
|
return nodes;
|
|
3690
3994
|
}
|
|
3691
3995
|
function buildDottedCircularGrid(chart, bounds, order, centerX, centerY, radius, width) {
|
|
3692
|
-
const yTicks =
|
|
3693
|
-
const xTicks =
|
|
3996
|
+
const yTicks = chunkXJ4W6TW4_cjs.chartTicks(chart.axisY).filter((tick) => tick > chart.axisY.min);
|
|
3997
|
+
const xTicks = chunkXJ4W6TW4_cjs.chartTicks(chart.axisX);
|
|
3694
3998
|
const nodes = [];
|
|
3695
3999
|
yTicks.forEach((yTick) => {
|
|
3696
4000
|
const ringRadius = radius * ringRatio(chart, yTick);
|
|
3697
4001
|
xTicks.forEach((xTick) => {
|
|
3698
|
-
const angle =
|
|
4002
|
+
const angle = chunkXJ4W6TW4_cjs.angleForAxisValue(chart.axisX.min, chart.axisX.max, xTick);
|
|
3699
4003
|
const x = centerX + Math.cos(angle) * ringRadius;
|
|
3700
4004
|
const y = centerY + Math.sin(angle) * ringRadius;
|
|
3701
4005
|
const id = `chart-grid-dot-${chart.id}-${xTick}-${yTick}`;
|
|
@@ -3717,8 +4021,8 @@ function buildChartGrid(chart, plot, bounds, order) {
|
|
|
3717
4021
|
if (chart.gridShape === "circle" && CIRCULAR_GRID_CHART_TYPES.has(chart.chartType)) {
|
|
3718
4022
|
return buildCircularChartGrid(chart, plot, bounds, order);
|
|
3719
4023
|
}
|
|
3720
|
-
const width =
|
|
3721
|
-
if (
|
|
4024
|
+
const width = chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1);
|
|
4025
|
+
if (chunkXJ4W6TW4_cjs.isHorizontalBar(chart)) {
|
|
3722
4026
|
return buildHorizontalBarGrid(chart, plot, bounds, order, width);
|
|
3723
4027
|
}
|
|
3724
4028
|
const clip = chart.chartType === "field" ? fieldSurfaceClip(chart, plot) : void 0;
|
|
@@ -3733,8 +4037,8 @@ function buildChartGrid(chart, plot, bounds, order) {
|
|
|
3733
4037
|
clip
|
|
3734
4038
|
};
|
|
3735
4039
|
const nodes = [];
|
|
3736
|
-
(chart.gridAxes === "y" ? [] :
|
|
3737
|
-
const x = plot.x +
|
|
4040
|
+
(chart.gridAxes === "y" ? [] : chunkXJ4W6TW4_cjs.chartTicks(chart.axisX)).forEach((tick) => {
|
|
4041
|
+
const x = plot.x + chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisX, plot.width);
|
|
3738
4042
|
nodes.push({
|
|
3739
4043
|
type: "path",
|
|
3740
4044
|
id: `chart-grid-x-${chart.id}-${tick}`,
|
|
@@ -3744,8 +4048,8 @@ function buildChartGrid(chart, plot, bounds, order) {
|
|
|
3744
4048
|
style
|
|
3745
4049
|
});
|
|
3746
4050
|
});
|
|
3747
|
-
(chart.gridAxes === "x" ? [] :
|
|
3748
|
-
const y = plot.y + plot.height -
|
|
4051
|
+
(chart.gridAxes === "x" ? [] : chunkXJ4W6TW4_cjs.chartTicks(chart.axisY)).forEach((tick) => {
|
|
4052
|
+
const y = plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisY, plot.height);
|
|
3749
4053
|
nodes.push({
|
|
3750
4054
|
type: "path",
|
|
3751
4055
|
id: `chart-grid-y-${chart.id}-${tick}`,
|
|
@@ -3767,8 +4071,8 @@ function buildHorizontalBarGrid(chart, plot, bounds, order, width) {
|
|
|
3767
4071
|
strokeWidth: width,
|
|
3768
4072
|
...chart.gridLineStyle === "dotted" ? { dash: [0.1, width * 3], lineCap: "round" } : gridLineDashStyle(chart, width)
|
|
3769
4073
|
};
|
|
3770
|
-
return
|
|
3771
|
-
const x = plot.x +
|
|
4074
|
+
return chunkXJ4W6TW4_cjs.chartTicks(chart.axisY).map((tick, index) => {
|
|
4075
|
+
const x = plot.x + chunkXJ4W6TW4_cjs.mapChartValue(tick, chart.axisY, plot.width);
|
|
3772
4076
|
return {
|
|
3773
4077
|
type: "path",
|
|
3774
4078
|
id: `chart-grid-x-${chart.id}-${tick}`,
|
|
@@ -3780,13 +4084,13 @@ function buildHorizontalBarGrid(chart, plot, bounds, order, width) {
|
|
|
3780
4084
|
});
|
|
3781
4085
|
}
|
|
3782
4086
|
function buildDottedRectGrid(chart, plot, bounds, order, width, clip) {
|
|
3783
|
-
const xTicks =
|
|
3784
|
-
const yTicks =
|
|
4087
|
+
const xTicks = chunkXJ4W6TW4_cjs.chartTicks(chart.axisX);
|
|
4088
|
+
const yTicks = chunkXJ4W6TW4_cjs.chartTicks(chart.axisY);
|
|
3785
4089
|
const nodes = [];
|
|
3786
4090
|
xTicks.forEach((xTick) => {
|
|
3787
|
-
const x = plot.x +
|
|
4091
|
+
const x = plot.x + chunkXJ4W6TW4_cjs.mapChartValue(xTick, chart.axisX, plot.width);
|
|
3788
4092
|
yTicks.forEach((yTick) => {
|
|
3789
|
-
const y = plot.y + plot.height -
|
|
4093
|
+
const y = plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(yTick, chart.axisY, plot.height);
|
|
3790
4094
|
const id = `chart-grid-dot-${chart.id}-${xTick}-${yTick}`;
|
|
3791
4095
|
nodes.push(createGridDot(chart, id, order + nodes.length, bounds, x, y, width, clip));
|
|
3792
4096
|
});
|
|
@@ -3809,7 +4113,7 @@ function createChartRuleMarks(render2) {
|
|
|
3809
4113
|
return {
|
|
3810
4114
|
rule,
|
|
3811
4115
|
color: rule.color || render2.chart.strokeColor || "#475569",
|
|
3812
|
-
y: render2.plot.y + render2.plot.height -
|
|
4116
|
+
y: render2.plot.y + render2.plot.height - chunkXJ4W6TW4_cjs.mapChartValue(rule.at, render2.chart.axisY, render2.plot.height),
|
|
3813
4117
|
lineOrder,
|
|
3814
4118
|
labelOrder
|
|
3815
4119
|
};
|
|
@@ -3829,7 +4133,7 @@ function createChartRuleLine(render2, mark) {
|
|
|
3829
4133
|
order: mark.lineOrder,
|
|
3830
4134
|
bounds: render2.bounds,
|
|
3831
4135
|
d: `M ${render2.plot.x} ${mark.y} L ${render2.plot.x + render2.plot.width} ${mark.y}`,
|
|
3832
|
-
prop:
|
|
4136
|
+
prop: chunkXJ4W6TW4_cjs.ruleAtProp(mark.rule.id),
|
|
3833
4137
|
propKind: "value",
|
|
3834
4138
|
style: {
|
|
3835
4139
|
fill: { kind: "none" },
|
|
@@ -3840,9 +4144,9 @@ function createChartRuleLine(render2, mark) {
|
|
|
3840
4144
|
};
|
|
3841
4145
|
}
|
|
3842
4146
|
function createChartRuleLabel(render2, mark) {
|
|
3843
|
-
const fontSize = Math.max(9,
|
|
4147
|
+
const fontSize = Math.max(9, chunkXJ4W6TW4_cjs.finite(render2.chart.fontSize, 12) - 2);
|
|
3844
4148
|
return {
|
|
3845
|
-
...
|
|
4149
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
3846
4150
|
id: `chart-rule-label-${render2.chart.id}-${mark.rule.id}`,
|
|
3847
4151
|
order: mark.labelOrder ?? mark.lineOrder + 1,
|
|
3848
4152
|
bounds: render2.bounds,
|
|
@@ -3851,19 +4155,19 @@ function createChartRuleLabel(render2, mark) {
|
|
|
3851
4155
|
chart: render2.chart
|
|
3852
4156
|
}),
|
|
3853
4157
|
color: mark.color,
|
|
3854
|
-
prop:
|
|
4158
|
+
prop: chunkXJ4W6TW4_cjs.ruleTextProp(mark.rule.id)
|
|
3855
4159
|
};
|
|
3856
4160
|
}
|
|
3857
4161
|
|
|
3858
4162
|
// src/renderScene/charts/chartBackdrop.ts
|
|
3859
4163
|
function chartImageRect(chart) {
|
|
3860
|
-
const inset =
|
|
4164
|
+
const inset = chunkXJ4W6TW4_cjs.finite(chart.strokeWidth, 1) / 2;
|
|
3861
4165
|
return {
|
|
3862
4166
|
x: chart.x + inset,
|
|
3863
4167
|
y: chart.y + inset,
|
|
3864
4168
|
width: Math.max(1, chart.width - inset * 2),
|
|
3865
4169
|
height: Math.max(1, chart.height - inset * 2),
|
|
3866
|
-
rx: Math.max(0,
|
|
4170
|
+
rx: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.cornerRadius, 12) - inset)
|
|
3867
4171
|
};
|
|
3868
4172
|
}
|
|
3869
4173
|
function buildChartBackdrop(chart, bounds, order) {
|
|
@@ -3905,7 +4209,7 @@ function buildChartBackdrop(chart, bounds, order) {
|
|
|
3905
4209
|
// src/renderScene/charts/renderers/bar/glass.ts
|
|
3906
4210
|
function createGlassBackdropNodes(context, id, d) {
|
|
3907
4211
|
const { chart, bounds, nextOrder } = context;
|
|
3908
|
-
const blur =
|
|
4212
|
+
const blur = chunkXJ4W6TW4_cjs.finite(chart.config?.barGlassBlur, 0);
|
|
3909
4213
|
if (blur <= 0 || !chart.fillImage) {
|
|
3910
4214
|
return [];
|
|
3911
4215
|
}
|
|
@@ -3923,7 +4227,7 @@ function createGlassBackdropNodes(context, id, d) {
|
|
|
3923
4227
|
href: chart.fillImage.url,
|
|
3924
4228
|
style: {
|
|
3925
4229
|
blur,
|
|
3926
|
-
saturate:
|
|
4230
|
+
saturate: chunkXJ4W6TW4_cjs.finite(chart.config?.barGlassSaturation, 1),
|
|
3927
4231
|
clip: { type: "path", d },
|
|
3928
4232
|
pointerEvents: "none"
|
|
3929
4233
|
}
|
|
@@ -3974,8 +4278,8 @@ function createBarGlowNode(context, id, d, color, glow, bounds = context.bounds)
|
|
|
3974
4278
|
bounds,
|
|
3975
4279
|
d,
|
|
3976
4280
|
style: {
|
|
3977
|
-
fill:
|
|
3978
|
-
shadow: { color:
|
|
4281
|
+
fill: chunkXJ4W6TW4_cjs.paint(color, diagnostics, chart.id),
|
|
4282
|
+
shadow: { color: chunkXJ4W6TW4_cjs.representativeColor(color, "#ffffff"), opacity: 0.9, blur: glow, dx: 0, dy: 0 },
|
|
3979
4283
|
pointerEvents: "none"
|
|
3980
4284
|
}
|
|
3981
4285
|
};
|
|
@@ -3986,14 +4290,14 @@ function barLabelsEnabled(context) {
|
|
|
3986
4290
|
return context.chart.config?.showBarLabels === true;
|
|
3987
4291
|
}
|
|
3988
4292
|
function resolvePlacement(target, size) {
|
|
3989
|
-
const fits = target.frame.height >= size.height +
|
|
4293
|
+
const fits = target.frame.height >= size.height + chunkXJ4W6TW4_cjs.BAR_LABEL.gap * 2;
|
|
3990
4294
|
return target.placement !== "outside" && !fits ? "outside" : target.placement;
|
|
3991
4295
|
}
|
|
3992
4296
|
function labelTop(placement, frame, height) {
|
|
3993
4297
|
if (placement === "outside") {
|
|
3994
|
-
return frame.y - height -
|
|
4298
|
+
return frame.y - height - chunkXJ4W6TW4_cjs.BAR_LABEL.gap;
|
|
3995
4299
|
}
|
|
3996
|
-
return placement === "inside" ? frame.y +
|
|
4300
|
+
return placement === "inside" ? frame.y + chunkXJ4W6TW4_cjs.BAR_LABEL.gap : frame.y + frame.height / 2 - height / 2;
|
|
3997
4301
|
}
|
|
3998
4302
|
function createPillNode(context, id, box, color) {
|
|
3999
4303
|
const { chart, bounds, diagnostics, nextOrder } = context;
|
|
@@ -4003,11 +4307,11 @@ function createPillNode(context, id, box, color) {
|
|
|
4003
4307
|
id: `${id}-pill`,
|
|
4004
4308
|
order: nextOrder(),
|
|
4005
4309
|
bounds,
|
|
4006
|
-
d:
|
|
4310
|
+
d: chunkXJ4W6TW4_cjs.pillPath(box.left, box.top, box.width, box.height),
|
|
4007
4311
|
style: {
|
|
4008
|
-
fill: config?.barLabelPillColor ?
|
|
4009
|
-
stroke:
|
|
4010
|
-
strokeWidth:
|
|
4312
|
+
fill: config?.barLabelPillColor ? chunkXJ4W6TW4_cjs.paint(config.barLabelPillColor, diagnostics, chart.id) : { kind: "none" },
|
|
4313
|
+
stroke: chunkXJ4W6TW4_cjs.paint(config?.barLabelBorderColor ?? color, diagnostics, chart.id),
|
|
4314
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(config?.barLabelBorderWidth, 1),
|
|
4011
4315
|
pointerEvents: "none"
|
|
4012
4316
|
}
|
|
4013
4317
|
};
|
|
@@ -4016,7 +4320,7 @@ function createTextNode(context, id, box, text, placement, fontSize, color) {
|
|
|
4016
4320
|
const { chart, bounds, nextOrder } = context;
|
|
4017
4321
|
const config = chart.config;
|
|
4018
4322
|
return {
|
|
4019
|
-
...
|
|
4323
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
4020
4324
|
id,
|
|
4021
4325
|
order: nextOrder(),
|
|
4022
4326
|
bounds,
|
|
@@ -4037,7 +4341,7 @@ function createAxisValueNode(context, target, text, fontSize) {
|
|
|
4037
4341
|
const config = chart.config;
|
|
4038
4342
|
const top = plot.y + plot.height + 4 + 16 + Math.max(0, chart.tickLength ?? 0);
|
|
4039
4343
|
return {
|
|
4040
|
-
...
|
|
4344
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
4041
4345
|
id: target.id,
|
|
4042
4346
|
order: nextOrder(),
|
|
4043
4347
|
bounds,
|
|
@@ -4046,7 +4350,7 @@ function createAxisValueNode(context, target, text, fontSize) {
|
|
|
4046
4350
|
y: target.frame.y + target.frame.height / 2 - fontSize * 0.6,
|
|
4047
4351
|
width: plot.width - 14,
|
|
4048
4352
|
height: fontSize * 1.2
|
|
4049
|
-
} : { x: plot.x, y: target.frame.y -
|
|
4353
|
+
} : { x: plot.x, y: target.frame.y - chunkXJ4W6TW4_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 },
|
|
4050
4354
|
text,
|
|
4051
4355
|
chart,
|
|
4052
4356
|
align: target.horizontal ? "right" : chart.categoryAlign === "left" ? "left" : "center"
|
|
@@ -4060,24 +4364,24 @@ function createAxisValueNode(context, target, text, fontSize) {
|
|
|
4060
4364
|
}
|
|
4061
4365
|
function horizontalPlacement(target, size) {
|
|
4062
4366
|
const requested = target.placement === "axis" ? "outside" : target.placement;
|
|
4063
|
-
const fits = target.frame.width >= size.width +
|
|
4367
|
+
const fits = target.frame.width >= size.width + chunkXJ4W6TW4_cjs.BAR_LABEL.gap * 2;
|
|
4064
4368
|
return requested !== "outside" && !fits ? "outside" : requested;
|
|
4065
4369
|
}
|
|
4066
4370
|
function horizontalBox(target, size, placement) {
|
|
4067
4371
|
const { frame } = target;
|
|
4068
|
-
const left = placement === "outside" ? frame.x + frame.width +
|
|
4372
|
+
const left = placement === "outside" ? frame.x + frame.width + chunkXJ4W6TW4_cjs.BAR_LABEL.gap : placement === "inside" ? frame.x + frame.width - size.width - chunkXJ4W6TW4_cjs.BAR_LABEL.gap : frame.x + frame.width / 2 - size.width / 2;
|
|
4069
4373
|
return { ...size, left, top: frame.y + frame.height / 2 - size.height / 2 };
|
|
4070
4374
|
}
|
|
4071
4375
|
function createBarLabelNodes(context, target) {
|
|
4072
4376
|
const { chart } = context;
|
|
4073
4377
|
const config = chart.config;
|
|
4074
|
-
const fontSize = Math.max(8,
|
|
4075
|
-
const text =
|
|
4378
|
+
const fontSize = Math.max(8, chunkXJ4W6TW4_cjs.finite(config?.barLabelFontSize, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12)));
|
|
4379
|
+
const text = chunkXJ4W6TW4_cjs.formatBarLabel(target.value, config?.barLabelFormat);
|
|
4076
4380
|
if (target.placement === "axis") {
|
|
4077
4381
|
return [createAxisValueNode(context, target, text, fontSize)];
|
|
4078
4382
|
}
|
|
4079
4383
|
const pill = config?.barLabelPill === true;
|
|
4080
|
-
const size =
|
|
4384
|
+
const size = chunkXJ4W6TW4_cjs.barLabelSize(text, fontSize, pill);
|
|
4081
4385
|
const placement = target.horizontal ? horizontalPlacement(target, size) : resolvePlacement(target, size);
|
|
4082
4386
|
const box = target.horizontal ? horizontalBox(target, size, placement) : {
|
|
4083
4387
|
...size,
|
|
@@ -4118,7 +4422,7 @@ function barTrackClip(context, frame) {
|
|
|
4118
4422
|
}
|
|
4119
4423
|
return {
|
|
4120
4424
|
type: "path",
|
|
4121
|
-
d:
|
|
4425
|
+
d: chunkXJ4W6TW4_cjs.roundedBarPath(frame.x, frame.y, frame.width, frame.height, context.chart.config?.barCornerRadius ?? 2)
|
|
4122
4426
|
};
|
|
4123
4427
|
}
|
|
4124
4428
|
function barTrackEnabled(context) {
|
|
@@ -4128,8 +4432,8 @@ function createBarTrackNodes(context, id, frame, orientation = "vertical") {
|
|
|
4128
4432
|
const { chart, bounds, diagnostics, nextOrder } = context;
|
|
4129
4433
|
const config = chart.config;
|
|
4130
4434
|
const radius = config?.barCornerRadius ?? 2;
|
|
4131
|
-
const segments =
|
|
4132
|
-
const d = segments > 0 ?
|
|
4435
|
+
const segments = chunkXJ4W6TW4_cjs.finite(config?.barSegments, 0);
|
|
4436
|
+
const d = segments > 0 ? chunkXJ4W6TW4_cjs.segmentedBarPath(frame, orientation, segments, chunkXJ4W6TW4_cjs.finite(config?.barSegmentGap, 4), radius, 1, true) : chunkXJ4W6TW4_cjs.roundedBarPath(frame.x, frame.y, frame.width, frame.height, radius);
|
|
4133
4437
|
const nodes = [
|
|
4134
4438
|
{
|
|
4135
4439
|
type: "path",
|
|
@@ -4138,7 +4442,7 @@ function createBarTrackNodes(context, id, frame, orientation = "vertical") {
|
|
|
4138
4442
|
bounds,
|
|
4139
4443
|
d,
|
|
4140
4444
|
style: {
|
|
4141
|
-
fill:
|
|
4445
|
+
fill: chunkXJ4W6TW4_cjs.paint(config?.barTrackColor ?? chart.gridColor ?? "#e2e8f0", diagnostics, chart.id),
|
|
4142
4446
|
pointerEvents: "none"
|
|
4143
4447
|
}
|
|
4144
4448
|
}
|
|
@@ -4154,13 +4458,13 @@ function createBarTrackNodes(context, id, frame, orientation = "vertical") {
|
|
|
4154
4458
|
frame.y,
|
|
4155
4459
|
frame.width,
|
|
4156
4460
|
frame.height,
|
|
4157
|
-
|
|
4158
|
-
Math.max(MIN_HATCH_SPACING,
|
|
4461
|
+
chunkXJ4W6TW4_cjs.finite(config.barTrackHatchAngle, DEFAULT_HATCH.angle),
|
|
4462
|
+
Math.max(MIN_HATCH_SPACING, chunkXJ4W6TW4_cjs.finite(config.barTrackHatchSpacing, DEFAULT_HATCH.spacing))
|
|
4159
4463
|
),
|
|
4160
4464
|
style: {
|
|
4161
4465
|
fill: { kind: "none" },
|
|
4162
|
-
stroke:
|
|
4163
|
-
strokeWidth:
|
|
4466
|
+
stroke: chunkXJ4W6TW4_cjs.paint(config.barTrackHatchColor ?? chart.gridColor ?? "#cbd5e1", diagnostics, chart.id),
|
|
4467
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(config.barTrackHatchWidth, DEFAULT_HATCH.width),
|
|
4164
4468
|
pointerEvents: "none",
|
|
4165
4469
|
clip: { type: "path", d }
|
|
4166
4470
|
}
|
|
@@ -4207,23 +4511,23 @@ function groupedShape(context, frame) {
|
|
|
4207
4511
|
const { chart, plot } = context;
|
|
4208
4512
|
const config = chart.config;
|
|
4209
4513
|
const radius = config?.barCornerRadius ?? 2;
|
|
4210
|
-
const segments =
|
|
4514
|
+
const segments = chunkXJ4W6TW4_cjs.finite(config?.barSegments, 0);
|
|
4211
4515
|
if (segments > 0) {
|
|
4212
|
-
return
|
|
4516
|
+
return chunkXJ4W6TW4_cjs.segmentedBarPath(
|
|
4213
4517
|
{ x: frame.x, y: plot.y, width: frame.width, height: plot.height },
|
|
4214
4518
|
"vertical",
|
|
4215
4519
|
segments,
|
|
4216
|
-
|
|
4520
|
+
chunkXJ4W6TW4_cjs.finite(config?.barSegmentGap, 4),
|
|
4217
4521
|
radius,
|
|
4218
4522
|
frame.height / plot.height,
|
|
4219
4523
|
config?.barSegmentSnap !== false
|
|
4220
4524
|
);
|
|
4221
4525
|
}
|
|
4222
|
-
return
|
|
4526
|
+
return chunkXJ4W6TW4_cjs.barPath(frame.x, frame.y, frame.width, frame.height, radius, config?.barRoundedBottom === true);
|
|
4223
4527
|
}
|
|
4224
4528
|
function createGroupedGlow(context, mark) {
|
|
4225
4529
|
const { chart } = context;
|
|
4226
|
-
const glow =
|
|
4530
|
+
const glow = chunkXJ4W6TW4_cjs.finite(chart.config?.barGlow, 0);
|
|
4227
4531
|
if (glow <= 0 || mark.frame.height <= 0) {
|
|
4228
4532
|
return [];
|
|
4229
4533
|
}
|
|
@@ -4234,10 +4538,10 @@ function createGroupedGlow(context, mark) {
|
|
|
4234
4538
|
}
|
|
4235
4539
|
function createGroupedBarLayout(context) {
|
|
4236
4540
|
const { chart, plot } = context;
|
|
4237
|
-
const valueCount =
|
|
4541
|
+
const valueCount = chunkXJ4W6TW4_cjs.barCategoryCount(chart);
|
|
4238
4542
|
const slotWidth = plot.width / valueCount;
|
|
4239
|
-
const groupGap = Math.min(Math.max(0,
|
|
4240
|
-
const barGap = Math.max(0,
|
|
4543
|
+
const groupGap = Math.min(Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.barGroupGap, 8)), Math.max(0, slotWidth - 1));
|
|
4544
|
+
const barGap = Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.barGap, 2));
|
|
4241
4545
|
return {
|
|
4242
4546
|
slotWidth,
|
|
4243
4547
|
seriesWidth: Math.max(1, (slotWidth - groupGap) / Math.max(1, chart.series.length)),
|
|
@@ -4247,10 +4551,10 @@ function createGroupedBarLayout(context) {
|
|
|
4247
4551
|
}
|
|
4248
4552
|
function createSeriesBarMarks(context, layout, series, seriesIndex) {
|
|
4249
4553
|
const { chart, plot } = context;
|
|
4250
|
-
const seriesColor2 = series.color ??
|
|
4554
|
+
const seriesColor2 = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
4251
4555
|
return series.values.map((value, valueIndex) => {
|
|
4252
4556
|
const numericValue = Array.isArray(value) ? value[1] : value;
|
|
4253
|
-
const height = Math.max(0,
|
|
4557
|
+
const height = Math.max(0, chunkXJ4W6TW4_cjs.mapChartValue(numericValue, chart.axisY, plot.height));
|
|
4254
4558
|
return {
|
|
4255
4559
|
seriesId: series.id,
|
|
4256
4560
|
valueIndex,
|
|
@@ -4284,10 +4588,10 @@ function createGroupedBarNodes(context, mark) {
|
|
|
4284
4588
|
const radius = chart.config?.barCornerRadius ?? 2;
|
|
4285
4589
|
const { x, width } = mark.frame;
|
|
4286
4590
|
const path = groupedShape(context, mark.frame);
|
|
4287
|
-
const fill2 =
|
|
4288
|
-
const stroke =
|
|
4289
|
-
const strokeWidth =
|
|
4290
|
-
const shadow =
|
|
4591
|
+
const fill2 = chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id);
|
|
4592
|
+
const stroke = chunkXJ4W6TW4_cjs.paint(chart.config?.barBorderColor || "#000000", diagnostics, chart.id);
|
|
4593
|
+
const strokeWidth = chunkXJ4W6TW4_cjs.finite(chart.config?.barBorderWidth, 0);
|
|
4594
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
4291
4595
|
const shadowCaster = shadow ? {
|
|
4292
4596
|
type: "path",
|
|
4293
4597
|
id: `chart-bar-shadow-${chart.id}-${mark.seriesId}-${mark.valueIndex}`,
|
|
@@ -4317,10 +4621,10 @@ function createGroupedBarNodes(context, mark) {
|
|
|
4317
4621
|
valueIndex: mark.valueIndex,
|
|
4318
4622
|
mark: "bar",
|
|
4319
4623
|
radius,
|
|
4320
|
-
colorProp:
|
|
4624
|
+
colorProp: chunkXJ4W6TW4_cjs.seriesValueColorProp(mark.seriesId, mark.valueIndex),
|
|
4321
4625
|
hasColorOverride: mark.hasColorOverride
|
|
4322
4626
|
},
|
|
4323
|
-
prop:
|
|
4627
|
+
prop: chunkXJ4W6TW4_cjs.seriesValueProp(mark.seriesId, mark.valueIndex),
|
|
4324
4628
|
style: { fill: fill2, stroke, strokeWidth, innerShadow: shadow }
|
|
4325
4629
|
};
|
|
4326
4630
|
const glass = createGlassBackdropNodes(context, `${mark.seriesId}-${mark.valueIndex}`, path);
|
|
@@ -4331,15 +4635,15 @@ function createGroupedBarError(context, mark) {
|
|
|
4331
4635
|
return null;
|
|
4332
4636
|
}
|
|
4333
4637
|
const { chart, plot, bounds, nextOrder } = context;
|
|
4334
|
-
const [lower, upper] =
|
|
4335
|
-
return
|
|
4638
|
+
const [lower, upper] = chunkXJ4W6TW4_cjs.errorBarRange(mark.value, mark.error);
|
|
4639
|
+
return chunkXJ4W6TW4_cjs.createVerticalErrorWhiskerNode({
|
|
4336
4640
|
id: `chart-bar-error-${chart.id}-${mark.seriesId}-${mark.valueIndex}`,
|
|
4337
4641
|
order: nextOrder(),
|
|
4338
4642
|
bounds,
|
|
4339
4643
|
geometry: {
|
|
4340
4644
|
centerX: mark.frame.x + mark.frame.width / 2,
|
|
4341
|
-
startY: plot.y + plot.height -
|
|
4342
|
-
endY: plot.y + plot.height -
|
|
4645
|
+
startY: plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(lower, chart.axisY, plot.height),
|
|
4646
|
+
endY: plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(upper, chart.axisY, plot.height)
|
|
4343
4647
|
},
|
|
4344
4648
|
color: chart.textColor ?? "#0f172a",
|
|
4345
4649
|
valueReference: { seriesId: mark.seriesId, valueIndex: mark.valueIndex }
|
|
@@ -4349,9 +4653,9 @@ function createGroupedBarError(context, mark) {
|
|
|
4349
4653
|
// src/renderScene/charts/renderers/bar/horizontal.ts
|
|
4350
4654
|
function barFrame(context, rows, seriesIndex, valueIndex, value) {
|
|
4351
4655
|
const { chart, plot } = context;
|
|
4352
|
-
const top =
|
|
4656
|
+
const top = chunkXJ4W6TW4_cjs.rowTop(rows, plot, valueIndex) + rows.labelRow;
|
|
4353
4657
|
if (context.stackedMode) {
|
|
4354
|
-
const segment =
|
|
4658
|
+
const segment = chunkXJ4W6TW4_cjs.stackedSegment(chart, context.stackedMode, valueIndex, seriesIndex, plot.width);
|
|
4355
4659
|
const start = Math.min(segment.pixelStart, segment.pixelEnd);
|
|
4356
4660
|
return {
|
|
4357
4661
|
x: plot.x + start,
|
|
@@ -4360,27 +4664,27 @@ function barFrame(context, rows, seriesIndex, valueIndex, value) {
|
|
|
4360
4664
|
height: rows.barsHeight
|
|
4361
4665
|
};
|
|
4362
4666
|
}
|
|
4363
|
-
const barGap = Math.max(0,
|
|
4667
|
+
const barGap = Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.barGap, 2));
|
|
4364
4668
|
const seriesHeight = rows.barsHeight / Math.max(1, chart.series.length);
|
|
4365
|
-
const width = Math.max(0,
|
|
4669
|
+
const width = Math.max(0, chunkXJ4W6TW4_cjs.mapChartValue(value, chart.axisY, plot.width));
|
|
4366
4670
|
return { x: plot.x, y: top + seriesIndex * seriesHeight, width, height: Math.max(1, seriesHeight - barGap) };
|
|
4367
4671
|
}
|
|
4368
4672
|
function barPath2(context, frame) {
|
|
4369
4673
|
const { chart, plot } = context;
|
|
4370
4674
|
const config = chart.config;
|
|
4371
|
-
const segments = context.stackedMode && chart.series.length > 1 ? 0 :
|
|
4675
|
+
const segments = context.stackedMode && chart.series.length > 1 ? 0 : chunkXJ4W6TW4_cjs.finite(config?.barSegments, 0);
|
|
4372
4676
|
if (segments > 0) {
|
|
4373
|
-
return
|
|
4677
|
+
return chunkXJ4W6TW4_cjs.segmentedBarPath(
|
|
4374
4678
|
{ x: plot.x, y: frame.y, width: plot.width, height: frame.height },
|
|
4375
4679
|
"horizontal",
|
|
4376
4680
|
segments,
|
|
4377
|
-
|
|
4681
|
+
chunkXJ4W6TW4_cjs.finite(config?.barSegmentGap, 4),
|
|
4378
4682
|
config?.barCornerRadius ?? 2,
|
|
4379
4683
|
frame.width / plot.width,
|
|
4380
4684
|
config?.barSegmentSnap !== false
|
|
4381
4685
|
);
|
|
4382
4686
|
}
|
|
4383
|
-
return
|
|
4687
|
+
return chunkXJ4W6TW4_cjs.roundedBarPath(frame.x, frame.y, frame.width, frame.height, config?.barCornerRadius ?? 2);
|
|
4384
4688
|
}
|
|
4385
4689
|
function markOf(context, rows, series, seriesIndex, valueIndex, value) {
|
|
4386
4690
|
const { plot } = context;
|
|
@@ -4400,16 +4704,16 @@ function markOf(context, rows, series, seriesIndex, valueIndex, value) {
|
|
|
4400
4704
|
maxY: frame.y + frame.height
|
|
4401
4705
|
},
|
|
4402
4706
|
path: barPath2(context, frame),
|
|
4403
|
-
color: series.colors?.[valueIndex] ?? series.color ??
|
|
4707
|
+
color: series.colors?.[valueIndex] ?? series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length]
|
|
4404
4708
|
};
|
|
4405
4709
|
}
|
|
4406
4710
|
function barNodes(context, mark) {
|
|
4407
4711
|
const { chart, diagnostics, nextOrder } = context;
|
|
4408
4712
|
const config = chart.config;
|
|
4409
|
-
const stroke =
|
|
4410
|
-
const strokeWidth =
|
|
4411
|
-
const shadow =
|
|
4412
|
-
const fill2 =
|
|
4713
|
+
const stroke = chunkXJ4W6TW4_cjs.paint(config?.barBorderColor || "#000000", diagnostics, chart.id);
|
|
4714
|
+
const strokeWidth = chunkXJ4W6TW4_cjs.finite(config?.barBorderWidth, 0);
|
|
4715
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
4716
|
+
const fill2 = chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id);
|
|
4413
4717
|
const nodes = [...createGlassBackdropNodes(context, mark.id, mark.path)];
|
|
4414
4718
|
if (shadow) {
|
|
4415
4719
|
nodes.push({
|
|
@@ -4433,7 +4737,7 @@ function barNodes(context, mark) {
|
|
|
4433
4737
|
valueIndex: mark.valueIndex,
|
|
4434
4738
|
mark: "bar",
|
|
4435
4739
|
radius: config?.barCornerRadius ?? 2,
|
|
4436
|
-
colorProp:
|
|
4740
|
+
colorProp: chunkXJ4W6TW4_cjs.seriesValueColorProp(mark.series.id, mark.valueIndex),
|
|
4437
4741
|
hasColorOverride: mark.series.colors?.[mark.valueIndex] != null
|
|
4438
4742
|
},
|
|
4439
4743
|
style: { fill: fill2, stroke, strokeWidth, innerShadow: shadow }
|
|
@@ -4463,7 +4767,7 @@ function pushBar(context, rows, layers, series, seriesIndex, valueIndex, value,
|
|
|
4463
4767
|
layers.tracks.push(...createBarTrackNodes(context, mark.id, mark.trackFrame, "horizontal"));
|
|
4464
4768
|
}
|
|
4465
4769
|
layers.bars.push(...barNodes(context, mark));
|
|
4466
|
-
const glow =
|
|
4770
|
+
const glow = chunkXJ4W6TW4_cjs.finite(chart.config?.barGlow, 0);
|
|
4467
4771
|
if (glow > 0 && mark.frame.width > 0) {
|
|
4468
4772
|
layers.glows.push(
|
|
4469
4773
|
createBarGlowNode(context, `chart-bar-glow-${chart.id}-${mark.id}`, mark.path, mark.color, glow, mark.bounds)
|
|
@@ -4472,7 +4776,7 @@ function pushBar(context, rows, layers, series, seriesIndex, valueIndex, value,
|
|
|
4472
4776
|
layers.labels.push(...labelNodes2(context, mark, highest));
|
|
4473
4777
|
}
|
|
4474
4778
|
function renderHorizontalBars(context) {
|
|
4475
|
-
const rows =
|
|
4779
|
+
const rows = chunkXJ4W6TW4_cjs.horizontalRows(context.chart, context.plot);
|
|
4476
4780
|
const layers = { tracks: [], bars: [], glows: [], labels: [] };
|
|
4477
4781
|
context.chart.series.forEach((series, seriesIndex) => {
|
|
4478
4782
|
const numeric = series.values.map((value) => typeof value === "number" ? value : value[1]);
|
|
@@ -4487,8 +4791,8 @@ function renderHorizontalBars(context) {
|
|
|
4487
4791
|
// src/renderScene/charts/renderers/bar/stacked.ts
|
|
4488
4792
|
function slotOf(context, mode) {
|
|
4489
4793
|
const { chart, plot } = context;
|
|
4490
|
-
const slotWidth = plot.width /
|
|
4491
|
-
const groupGap = Math.min(Math.max(0,
|
|
4794
|
+
const slotWidth = plot.width / chunkXJ4W6TW4_cjs.barCategoryCount(chart);
|
|
4795
|
+
const groupGap = Math.min(Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.barGroupGap, 8)), Math.max(0, slotWidth - 1));
|
|
4492
4796
|
return {
|
|
4493
4797
|
slotWidth,
|
|
4494
4798
|
groupGap,
|
|
@@ -4499,19 +4803,19 @@ function slotOf(context, mode) {
|
|
|
4499
4803
|
}
|
|
4500
4804
|
function pathOf(context, x, y, height, slot, radius) {
|
|
4501
4805
|
const { chart, plot } = context;
|
|
4502
|
-
const segments = chart.series.length === 1 ?
|
|
4806
|
+
const segments = chart.series.length === 1 ? chunkXJ4W6TW4_cjs.finite(chart.config?.barSegments, 0) : 0;
|
|
4503
4807
|
if (segments > 0) {
|
|
4504
|
-
return
|
|
4808
|
+
return chunkXJ4W6TW4_cjs.segmentedBarPath(
|
|
4505
4809
|
{ x, y: plot.y, width: slot.barWidth, height: plot.height },
|
|
4506
4810
|
"vertical",
|
|
4507
4811
|
segments,
|
|
4508
|
-
|
|
4812
|
+
chunkXJ4W6TW4_cjs.finite(chart.config?.barSegmentGap, 4),
|
|
4509
4813
|
radius,
|
|
4510
4814
|
height / plot.height,
|
|
4511
4815
|
chart.config?.barSegmentSnap !== false
|
|
4512
4816
|
);
|
|
4513
4817
|
}
|
|
4514
|
-
return
|
|
4818
|
+
return chunkXJ4W6TW4_cjs.barPath(x, y, slot.barWidth, height, radius, chart.config?.barRoundedBottom === true);
|
|
4515
4819
|
}
|
|
4516
4820
|
function pushLabel(context, layers, series, seriesIndex, valueIndex, slot, frame) {
|
|
4517
4821
|
const { chart } = context;
|
|
@@ -4533,7 +4837,7 @@ function pushLabel(context, layers, series, seriesIndex, valueIndex, slot, frame
|
|
|
4533
4837
|
}
|
|
4534
4838
|
function markOf2(context, mode, slot, series, seriesIndex, valueIndex) {
|
|
4535
4839
|
const { chart, plot } = context;
|
|
4536
|
-
const segment =
|
|
4840
|
+
const segment = chunkXJ4W6TW4_cjs.stackedSegment(chart, mode, valueIndex, seriesIndex, plot.height);
|
|
4537
4841
|
const radius = slot.outerSeriesIndex === null || seriesIndex === slot.outerSeriesIndex ? slot.cornerRadius : 0;
|
|
4538
4842
|
const x = plot.x + valueIndex * slot.slotWidth + slot.groupGap / 2;
|
|
4539
4843
|
const y = plot.y + plot.height - Math.max(segment.pixelStart, segment.pixelEnd);
|
|
@@ -4542,7 +4846,7 @@ function markOf2(context, mode, slot, series, seriesIndex, valueIndex) {
|
|
|
4542
4846
|
series,
|
|
4543
4847
|
valueIndex,
|
|
4544
4848
|
radius,
|
|
4545
|
-
color: series.colors?.[valueIndex] ?? series.color ??
|
|
4849
|
+
color: series.colors?.[valueIndex] ?? series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length],
|
|
4546
4850
|
x,
|
|
4547
4851
|
y,
|
|
4548
4852
|
height,
|
|
@@ -4553,10 +4857,10 @@ function markOf2(context, mode, slot, series, seriesIndex, valueIndex) {
|
|
|
4553
4857
|
function segmentNodes(context, mark) {
|
|
4554
4858
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
4555
4859
|
const { series, valueIndex, path } = mark;
|
|
4556
|
-
const fill2 =
|
|
4557
|
-
const stroke =
|
|
4558
|
-
const strokeWidth =
|
|
4559
|
-
const shadow =
|
|
4860
|
+
const fill2 = chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id);
|
|
4861
|
+
const stroke = chunkXJ4W6TW4_cjs.paint(chart.config?.barBorderColor || "#000000", diagnostics, chart.id);
|
|
4862
|
+
const strokeWidth = chunkXJ4W6TW4_cjs.finite(chart.config?.barBorderWidth, 0);
|
|
4863
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
4560
4864
|
const nodes = [];
|
|
4561
4865
|
if (shadow) {
|
|
4562
4866
|
const plotClip = `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z`;
|
|
@@ -4588,10 +4892,10 @@ function segmentNodes(context, mark) {
|
|
|
4588
4892
|
valueIndex,
|
|
4589
4893
|
mark: "bar",
|
|
4590
4894
|
radius: mark.radius,
|
|
4591
|
-
colorProp:
|
|
4895
|
+
colorProp: chunkXJ4W6TW4_cjs.seriesValueColorProp(series.id, valueIndex),
|
|
4592
4896
|
hasColorOverride: series.colors?.[valueIndex] != null
|
|
4593
4897
|
},
|
|
4594
|
-
prop:
|
|
4898
|
+
prop: chunkXJ4W6TW4_cjs.seriesValueProp(series.id, valueIndex),
|
|
4595
4899
|
style: { fill: fill2, stroke, strokeWidth, innerShadow: shadow }
|
|
4596
4900
|
});
|
|
4597
4901
|
return nodes;
|
|
@@ -4605,7 +4909,7 @@ function pushSegment(context, mode, layers, slot, series, seriesIndex, valueInde
|
|
|
4605
4909
|
layers.bars.push(...segmentNodes(context, mark));
|
|
4606
4910
|
const frame = { x: mark.x, y: mark.y, width: slot.barWidth, height: mark.height };
|
|
4607
4911
|
pushLabel(context, layers, series, seriesIndex, valueIndex, slot, frame);
|
|
4608
|
-
const glow =
|
|
4912
|
+
const glow = chunkXJ4W6TW4_cjs.finite(chart.config?.barGlow, 0);
|
|
4609
4913
|
if (glow > 0) {
|
|
4610
4914
|
layers.glows.push(
|
|
4611
4915
|
createBarGlowNode(context, `chart-bar-glow-${chart.id}-${series.id}-${valueIndex}`, mark.path, mark.color, glow)
|
|
@@ -4616,7 +4920,7 @@ function renderStackedBars(context, mode) {
|
|
|
4616
4920
|
const { chart } = context;
|
|
4617
4921
|
const layers = { tracks: [], bars: [], glows: [], labels: [] };
|
|
4618
4922
|
const slot = slotOf(context, mode);
|
|
4619
|
-
const valueCount =
|
|
4923
|
+
const valueCount = chunkXJ4W6TW4_cjs.barCategoryCount(chart);
|
|
4620
4924
|
for (let valueIndex = 0; valueIndex < valueCount; valueIndex++) {
|
|
4621
4925
|
chart.series.forEach((series, seriesIndex) => {
|
|
4622
4926
|
pushSegment(context, mode, layers, slot, series, seriesIndex, valueIndex);
|
|
@@ -4631,7 +4935,7 @@ function isSeriesMax2(values, index) {
|
|
|
4631
4935
|
|
|
4632
4936
|
// src/renderScene/charts/renderers/bar.ts
|
|
4633
4937
|
function renderBar(context) {
|
|
4634
|
-
if (
|
|
4938
|
+
if (chunkXJ4W6TW4_cjs.isHorizontalBar(context.chart)) {
|
|
4635
4939
|
return renderHorizontalBars(context);
|
|
4636
4940
|
}
|
|
4637
4941
|
if (context.stackedMode) {
|
|
@@ -4646,7 +4950,7 @@ function createBoxplotLayout(context) {
|
|
|
4646
4950
|
const orientation = chart.config?.orientation ?? "vertical";
|
|
4647
4951
|
const boxCount = Math.max(1, chart.series.length);
|
|
4648
4952
|
const slotWidth = (orientation === "horizontal" ? plot.height : plot.width) / boxCount;
|
|
4649
|
-
const borderColor =
|
|
4953
|
+
const borderColor = chunkXJ4W6TW4_cjs.representativeColor(chart.config?.barBorderColor, "#000000");
|
|
4650
4954
|
const widthFraction = Math.min(1, Math.max(0.05, chart.config?.boxWidth ?? 0.6));
|
|
4651
4955
|
return {
|
|
4652
4956
|
orientation,
|
|
@@ -4655,15 +4959,15 @@ function createBoxplotLayout(context) {
|
|
|
4655
4959
|
cornerRadius: chart.config?.barCornerRadius ?? 2,
|
|
4656
4960
|
showPoints: chart.config?.showBoxplotPoints ?? true,
|
|
4657
4961
|
borderColor,
|
|
4658
|
-
borderWidth:
|
|
4659
|
-
whiskerWidth: Math.max(0,
|
|
4660
|
-
medianWidth: Math.max(0,
|
|
4962
|
+
borderWidth: chunkXJ4W6TW4_cjs.finite(chart.config?.barBorderWidth, 1),
|
|
4963
|
+
whiskerWidth: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.boxWhiskerWidth, 1)),
|
|
4964
|
+
medianWidth: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.boxMedianWidth, 2)),
|
|
4661
4965
|
medianColor: chart.config?.boxMedianColor ?? borderColor,
|
|
4662
4966
|
whiskerColor: chart.config?.boxWhiskerColor,
|
|
4663
|
-
capSize: Math.max(0,
|
|
4664
|
-
pointSize: Math.max(0,
|
|
4665
|
-
pointOpacity: Math.min(1, Math.max(0,
|
|
4666
|
-
jitter: Math.max(0,
|
|
4967
|
+
capSize: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.boxCapSize, 0.4)),
|
|
4968
|
+
pointSize: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.boxPointSize, 3)),
|
|
4969
|
+
pointOpacity: Math.min(1, Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.boxPointOpacity, 0.7))),
|
|
4970
|
+
jitter: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.boxJitter, 1))
|
|
4667
4971
|
};
|
|
4668
4972
|
}
|
|
4669
4973
|
|
|
@@ -4674,7 +4978,7 @@ function boxplotPoint(orientation, center, value) {
|
|
|
4674
4978
|
function createBoxplotGeometry(context, layout, seriesIndex, stats) {
|
|
4675
4979
|
const { chart, plot } = context;
|
|
4676
4980
|
const { orientation } = layout;
|
|
4677
|
-
const valueAt = (value) => orientation === "horizontal" ? plot.x +
|
|
4981
|
+
const valueAt = (value) => orientation === "horizontal" ? plot.x + chunkXJ4W6TW4_cjs.mapChartValue(value, chart.axisX, plot.width) : plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(value, chart.axisY, plot.height);
|
|
4678
4982
|
const center = plot[orientation === "horizontal" ? "y" : "x"] + seriesIndex * layout.slotWidth + layout.slotWidth / 2;
|
|
4679
4983
|
return {
|
|
4680
4984
|
center,
|
|
@@ -4689,7 +4993,7 @@ function createBoxplotGeometry(context, layout, seriesIndex, stats) {
|
|
|
4689
4993
|
// src/renderScene/charts/renderers/boxplot/points.ts
|
|
4690
4994
|
function renderSamplePoints(context, layout, mark) {
|
|
4691
4995
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
4692
|
-
const valueAt = (value) => layout.orientation === "horizontal" ? plot.x +
|
|
4996
|
+
const valueAt = (value) => layout.orientation === "horizontal" ? plot.x + chunkXJ4W6TW4_cjs.mapChartValue(value, chart.axisX, plot.width) : plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(value, chart.axisY, plot.height);
|
|
4693
4997
|
if (layout.pointSize <= 0) {
|
|
4694
4998
|
return [];
|
|
4695
4999
|
}
|
|
@@ -4705,7 +5009,7 @@ function renderSamplePoints(context, layout, mark) {
|
|
|
4705
5009
|
cy: y,
|
|
4706
5010
|
rx: layout.pointSize,
|
|
4707
5011
|
ry: layout.pointSize,
|
|
4708
|
-
style: { fill:
|
|
5012
|
+
style: { fill: chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id), opacity: layout.pointOpacity }
|
|
4709
5013
|
};
|
|
4710
5014
|
});
|
|
4711
5015
|
}
|
|
@@ -4729,7 +5033,7 @@ function renderBoxAndWhiskers(context, layout, mark) {
|
|
|
4729
5033
|
}
|
|
4730
5034
|
function whiskerColor(layout, mark) {
|
|
4731
5035
|
if (layout.whiskerColor === "series") {
|
|
4732
|
-
return
|
|
5036
|
+
return chunkXJ4W6TW4_cjs.representativeColor(mark.color, layout.borderColor);
|
|
4733
5037
|
}
|
|
4734
5038
|
return layout.whiskerColor;
|
|
4735
5039
|
}
|
|
@@ -4811,7 +5115,7 @@ function createBoxNode(context, layout, mark) {
|
|
|
4811
5115
|
height,
|
|
4812
5116
|
rx: layout.cornerRadius,
|
|
4813
5117
|
style: {
|
|
4814
|
-
fill:
|
|
5118
|
+
fill: chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id),
|
|
4815
5119
|
stroke: { kind: "solid", color: layout.borderColor },
|
|
4816
5120
|
strokeWidth: layout.borderWidth
|
|
4817
5121
|
}
|
|
@@ -4820,12 +5124,12 @@ function createBoxNode(context, layout, mark) {
|
|
|
4820
5124
|
|
|
4821
5125
|
// src/renderScene/charts/renderers/boxplot/series.ts
|
|
4822
5126
|
function renderBoxplotSeries(context, layout, series, seriesIndex) {
|
|
4823
|
-
const stats =
|
|
5127
|
+
const stats = chunkXJ4W6TW4_cjs.computeBoxplotStats(series.values);
|
|
4824
5128
|
if (!stats) {
|
|
4825
5129
|
return [];
|
|
4826
5130
|
}
|
|
4827
5131
|
const geometry = createBoxplotGeometry(context, layout, seriesIndex, stats);
|
|
4828
|
-
const color = series.color ??
|
|
5132
|
+
const color = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
4829
5133
|
const mark = {
|
|
4830
5134
|
id: `${context.chart.id}-${series.id}`,
|
|
4831
5135
|
series,
|
|
@@ -4887,21 +5191,21 @@ function metricComponent(chart, point) {
|
|
|
4887
5191
|
}
|
|
4888
5192
|
function customPointPosition(context, value) {
|
|
4889
5193
|
return {
|
|
4890
|
-
x: context.plot.x +
|
|
4891
|
-
y: context.plot.y + context.plot.height -
|
|
5194
|
+
x: context.plot.x + chunkXJ4W6TW4_cjs.mapChartValue(value[0], context.chart.axisX, context.plot.width),
|
|
5195
|
+
y: context.plot.y + context.plot.height - chunkXJ4W6TW4_cjs.mapChartValue(value[1], context.chart.axisY, context.plot.height)
|
|
4892
5196
|
};
|
|
4893
5197
|
}
|
|
4894
5198
|
function customSeriesStyle(context, series, seriesIndex) {
|
|
4895
|
-
const color = series.color ??
|
|
5199
|
+
const color = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
4896
5200
|
return {
|
|
4897
|
-
fill:
|
|
5201
|
+
fill: chunkXJ4W6TW4_cjs.paint(color, context.diagnostics, context.chart.id),
|
|
4898
5202
|
stroke: series.stroke ? { kind: "solid", color: series.stroke } : void 0,
|
|
4899
|
-
strokeWidth: series.stroke ?
|
|
5203
|
+
strokeWidth: series.stroke ? chunkXJ4W6TW4_cjs.finite(series.strokeWidth, 1) : void 0
|
|
4900
5204
|
};
|
|
4901
5205
|
}
|
|
4902
5206
|
function createCustomSymbolMark(context, mark) {
|
|
4903
5207
|
const symbol = mark.series.symbol;
|
|
4904
|
-
const size =
|
|
5208
|
+
const size = chunkXJ4W6TW4_cjs.finite(mark.series.size, 3);
|
|
4905
5209
|
const scale = symbol?.normalized ? size * 2 : 1;
|
|
4906
5210
|
const offset = symbol?.normalized ? 0.5 : 0;
|
|
4907
5211
|
const points = (symbol?.points ?? []).map(([x, y]) => ({
|
|
@@ -4913,12 +5217,12 @@ function createCustomSymbolMark(context, mark) {
|
|
|
4913
5217
|
id: customMarkId(context.chart, mark.series, mark.valueIndex),
|
|
4914
5218
|
order: context.nextOrder(),
|
|
4915
5219
|
bounds: context.bounds,
|
|
4916
|
-
d:
|
|
5220
|
+
d: chunkXJ4W6TW4_cjs.freeformPathData({ points, tension: chunkXJ4W6TW4_cjs.finite(symbol?.tension, 0), closed: true }),
|
|
4917
5221
|
style: mark.style
|
|
4918
5222
|
};
|
|
4919
5223
|
}
|
|
4920
5224
|
function createCustomPointMark(context, mark) {
|
|
4921
|
-
const radius =
|
|
5225
|
+
const radius = chunkXJ4W6TW4_cjs.finite(mark.series.size, 3);
|
|
4922
5226
|
return {
|
|
4923
5227
|
type: "ellipse",
|
|
4924
5228
|
id: customMarkId(context.chart, mark.series, mark.valueIndex),
|
|
@@ -4942,7 +5246,7 @@ function renderConnectedPairs(context) {
|
|
|
4942
5246
|
const zones = chart.config?.zones ?? [];
|
|
4943
5247
|
const betterColor = zones[0]?.color ?? "#10b981";
|
|
4944
5248
|
const worseColor = zones[1]?.color ?? "#ec4899";
|
|
4945
|
-
const tieColor = zones[2]?.color ??
|
|
5249
|
+
const tieColor = zones[2]?.color ?? chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL;
|
|
4946
5250
|
const reverse = Boolean(chart.config?.reverseComparison);
|
|
4947
5251
|
const count = Math.min(beforeValues.length, afterValues.length);
|
|
4948
5252
|
const categories = chart.config?.categories ?? [];
|
|
@@ -4957,7 +5261,7 @@ function renderConnectedPairs(context) {
|
|
|
4957
5261
|
const better = reverse ? afterMetric < beforeMetric : afterMetric > beforeMetric;
|
|
4958
5262
|
const worse = reverse ? afterMetric > beforeMetric : afterMetric < beforeMetric;
|
|
4959
5263
|
const comparisonColor = better ? betterColor : worse ? worseColor : tieColor;
|
|
4960
|
-
const radius =
|
|
5264
|
+
const radius = chunkXJ4W6TW4_cjs.finite(afterSeries.size, 3);
|
|
4961
5265
|
nodes.push(createConnectorLine(context, index, beforePoint, afterPoint, comparisonColor));
|
|
4962
5266
|
nodes.push(
|
|
4963
5267
|
createCustomPointMark(context, {
|
|
@@ -4965,9 +5269,9 @@ function renderConnectedPairs(context) {
|
|
|
4965
5269
|
valueIndex: index,
|
|
4966
5270
|
point: beforePoint,
|
|
4967
5271
|
style: {
|
|
4968
|
-
fill:
|
|
5272
|
+
fill: chunkXJ4W6TW4_cjs.paint(chart.config?.customBeforeFill ?? chart.gridColor ?? "#e2e8f0", context.diagnostics, chart.id),
|
|
4969
5273
|
stroke: { kind: "solid", color: chart.config?.customBeforeStroke ?? HOLLOW_POINT_STROKE },
|
|
4970
|
-
strokeWidth:
|
|
5274
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.config?.customBeforeStrokeWidth, 1.5)
|
|
4971
5275
|
}
|
|
4972
5276
|
})
|
|
4973
5277
|
);
|
|
@@ -4977,7 +5281,7 @@ function renderConnectedPairs(context) {
|
|
|
4977
5281
|
valueIndex: index,
|
|
4978
5282
|
point: afterPoint,
|
|
4979
5283
|
style: {
|
|
4980
|
-
fill:
|
|
5284
|
+
fill: chunkXJ4W6TW4_cjs.paint(comparisonColor, context.diagnostics, chart.id),
|
|
4981
5285
|
stroke: void 0,
|
|
4982
5286
|
strokeWidth: void 0
|
|
4983
5287
|
}
|
|
@@ -5004,7 +5308,7 @@ function createConnectorLine(context, index, from, to, color) {
|
|
|
5004
5308
|
style: {
|
|
5005
5309
|
fill: { kind: "none" },
|
|
5006
5310
|
stroke: { kind: "solid", color },
|
|
5007
|
-
strokeWidth:
|
|
5311
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.config?.customConnectorWidth, 2),
|
|
5008
5312
|
opacity: chart.config?.customConnectorOpacity,
|
|
5009
5313
|
dash: connectorDash(chart.config?.customConnectorDash)
|
|
5010
5314
|
}
|
|
@@ -5025,7 +5329,7 @@ function createConnectorLabel(context, index, beforePoint, afterPoint, radius, t
|
|
|
5025
5329
|
height: 16
|
|
5026
5330
|
};
|
|
5027
5331
|
return {
|
|
5028
|
-
...
|
|
5332
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
5029
5333
|
id: `chart-custom-label-${chart.id}-${index}`,
|
|
5030
5334
|
order: nextOrder(),
|
|
5031
5335
|
bounds,
|
|
@@ -5034,7 +5338,7 @@ function createConnectorLabel(context, index, beforePoint, afterPoint, radius, t
|
|
|
5034
5338
|
chart,
|
|
5035
5339
|
align: horizontal ? "left" : "center"
|
|
5036
5340
|
}),
|
|
5037
|
-
fontSize: Math.max(6,
|
|
5341
|
+
fontSize: Math.max(6, chunkXJ4W6TW4_cjs.finite(chart.config?.customLabelSize, Math.max(9, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12)) - 2)),
|
|
5038
5342
|
...chart.config?.customLabelColor ? { color: chart.config.customLabelColor } : {}
|
|
5039
5343
|
};
|
|
5040
5344
|
}
|
|
@@ -5046,8 +5350,8 @@ function classifyFieldData(context) {
|
|
|
5046
5350
|
const vectorSeries = chart.series.filter((series) => tupleSize(series.values[0]) === 4);
|
|
5047
5351
|
const scalarSamples = scalarSeries.flatMap(
|
|
5048
5352
|
(series) => series.values.map(([x, y, value]) => ({
|
|
5049
|
-
x:
|
|
5050
|
-
y: plot.height -
|
|
5353
|
+
x: chunkXJ4W6TW4_cjs.mapChartValue(x, chart.axisX, plot.width),
|
|
5354
|
+
y: plot.height - chunkXJ4W6TW4_cjs.mapChartValue(y, chart.axisY, plot.height),
|
|
5051
5355
|
value
|
|
5052
5356
|
}))
|
|
5053
5357
|
);
|
|
@@ -5111,20 +5415,20 @@ function createLegendLabels(context, minimum, maximum, geometry) {
|
|
|
5111
5415
|
const { chart, bounds, nextOrder } = context;
|
|
5112
5416
|
const y = geometry.y + geometry.height + 3;
|
|
5113
5417
|
return [
|
|
5114
|
-
|
|
5418
|
+
chunkXJ4W6TW4_cjs.chartText({
|
|
5115
5419
|
id: `chart-field-colorbar-min-${chart.id}`,
|
|
5116
5420
|
order: nextOrder(),
|
|
5117
5421
|
bounds,
|
|
5118
5422
|
frame: { x: geometry.x, y, width: 80, height: 16 },
|
|
5119
|
-
text:
|
|
5423
|
+
text: chunkXJ4W6TW4_cjs.formatFieldValue(minimum),
|
|
5120
5424
|
chart
|
|
5121
5425
|
}),
|
|
5122
|
-
|
|
5426
|
+
chunkXJ4W6TW4_cjs.chartText({
|
|
5123
5427
|
id: `chart-field-colorbar-max-${chart.id}`,
|
|
5124
5428
|
order: nextOrder(),
|
|
5125
5429
|
bounds,
|
|
5126
5430
|
frame: { x: geometry.x + geometry.width - 80, y, width: 80, height: 16 },
|
|
5127
|
-
text:
|
|
5431
|
+
text: chunkXJ4W6TW4_cjs.formatFieldValue(maximum),
|
|
5128
5432
|
chart,
|
|
5129
5433
|
align: "right"
|
|
5130
5434
|
})
|
|
@@ -5137,7 +5441,7 @@ function colorAtRamp(ramp, value) {
|
|
|
5137
5441
|
if (!ramp?.stops.length) {
|
|
5138
5442
|
return RAMP_FALLBACK_COLOR;
|
|
5139
5443
|
}
|
|
5140
|
-
return
|
|
5444
|
+
return chunkXJ4W6TW4_cjs.interpolateHexColorStops(ramp.stops, value);
|
|
5141
5445
|
}
|
|
5142
5446
|
|
|
5143
5447
|
// src/renderScene/charts/field/isolines.ts
|
|
@@ -5347,7 +5651,7 @@ function createIsoline(context, grid, threshold, thresholdIndex) {
|
|
|
5347
5651
|
}
|
|
5348
5652
|
const chains = stitchIsolineSegments(segments);
|
|
5349
5653
|
const path = chains.map(
|
|
5350
|
-
(chain) =>
|
|
5654
|
+
(chain) => chunkXJ4W6TW4_cjs.linePathData(
|
|
5351
5655
|
chain.map(([x, y]) => ({ x: plot.x + x, y: plot.y + y })),
|
|
5352
5656
|
ISOLINE_TENSION
|
|
5353
5657
|
)
|
|
@@ -5371,7 +5675,7 @@ function createIsoline(context, grid, threshold, thresholdIndex) {
|
|
|
5371
5675
|
function renderVectorField(context, seriesList) {
|
|
5372
5676
|
const nodes = [];
|
|
5373
5677
|
seriesList.forEach((series, seriesIndex) => {
|
|
5374
|
-
const color = series.color ??
|
|
5678
|
+
const color = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
5375
5679
|
series.values.forEach((vector, vectorIndex) => {
|
|
5376
5680
|
nodes.push(createVectorNode(context, series.id, vector, vectorIndex, color));
|
|
5377
5681
|
});
|
|
@@ -5381,10 +5685,10 @@ function renderVectorField(context, seriesList) {
|
|
|
5381
5685
|
function createVectorNode(context, seriesId, vector, vectorIndex, color) {
|
|
5382
5686
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
5383
5687
|
const [x, y, angle, magnitude] = vector;
|
|
5384
|
-
const startX = plot.x +
|
|
5385
|
-
const startY = plot.y + plot.height -
|
|
5386
|
-
const endX = plot.x +
|
|
5387
|
-
const endY = plot.y + plot.height -
|
|
5688
|
+
const startX = plot.x + chunkXJ4W6TW4_cjs.mapChartValue(x, chart.axisX, plot.width);
|
|
5689
|
+
const startY = plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(y, chart.axisY, plot.height);
|
|
5690
|
+
const endX = plot.x + chunkXJ4W6TW4_cjs.mapChartValue(x + Math.cos(angle) * magnitude, chart.axisX, plot.width);
|
|
5691
|
+
const endY = plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(y + Math.sin(angle) * magnitude, chart.axisY, plot.height);
|
|
5388
5692
|
return {
|
|
5389
5693
|
type: "path",
|
|
5390
5694
|
id: `chart-field-vector-${chart.id}-${seriesId}-${vectorIndex}`,
|
|
@@ -5394,7 +5698,7 @@ function createVectorNode(context, seriesId, vector, vectorIndex, color) {
|
|
|
5394
5698
|
markerEnd: "filled_arrow",
|
|
5395
5699
|
style: {
|
|
5396
5700
|
fill: { kind: "none" },
|
|
5397
|
-
stroke:
|
|
5701
|
+
stroke: chunkXJ4W6TW4_cjs.paint(color, diagnostics, chart.id),
|
|
5398
5702
|
strokeWidth: 2
|
|
5399
5703
|
}
|
|
5400
5704
|
};
|
|
@@ -5441,7 +5745,7 @@ function createHeatmapCell(layout, series, rowIndex, columnIndex) {
|
|
|
5441
5745
|
};
|
|
5442
5746
|
}
|
|
5443
5747
|
function colorForValue(value, layout) {
|
|
5444
|
-
return
|
|
5748
|
+
return chunkXJ4W6TW4_cjs.zoneColorAtValue(value, layout.bands, layout.zones);
|
|
5445
5749
|
}
|
|
5446
5750
|
function renderHeatmapCell(context, layout, cell) {
|
|
5447
5751
|
const background = createCellBackground(context, layout, cell);
|
|
@@ -5456,7 +5760,7 @@ function createCellBackground(context, layout, cell) {
|
|
|
5456
5760
|
const style = {
|
|
5457
5761
|
fill: { kind: "solid", color: cell.color },
|
|
5458
5762
|
stroke: { kind: "solid", color: chart.config?.cellStrokeColor ?? chart.gridColor ?? "#e2e8f0" },
|
|
5459
|
-
strokeWidth:
|
|
5763
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.config?.cellStrokeWidth, chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1))
|
|
5460
5764
|
};
|
|
5461
5765
|
if (chart.config?.cellShape === "circle") {
|
|
5462
5766
|
return {
|
|
@@ -5483,9 +5787,9 @@ function createCellBackground(context, layout, cell) {
|
|
|
5483
5787
|
}
|
|
5484
5788
|
function createCellValueLabel(context, layout, cell) {
|
|
5485
5789
|
const { chart, bounds, nextOrder } = context;
|
|
5486
|
-
const size = Math.max(6,
|
|
5790
|
+
const size = Math.max(6, chunkXJ4W6TW4_cjs.finite(chart.config?.cellValueSize, layout.fontSize));
|
|
5487
5791
|
return {
|
|
5488
|
-
...
|
|
5792
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
5489
5793
|
id: `chart-heatmap-value-${chart.id}-${cell.seriesId}-${cell.columnIndex}`,
|
|
5490
5794
|
order: nextOrder(),
|
|
5491
5795
|
bounds,
|
|
@@ -5500,7 +5804,7 @@ function createCellValueLabel(context, layout, cell) {
|
|
|
5500
5804
|
align: "center"
|
|
5501
5805
|
}),
|
|
5502
5806
|
...chart.config?.cellValueSize === void 0 ? {} : { fontSize: size },
|
|
5503
|
-
color: chart.config?.cellValueColor ??
|
|
5807
|
+
color: chart.config?.cellValueColor ?? chunkXJ4W6TW4_cjs.contrastTextColor(cell.color)
|
|
5504
5808
|
};
|
|
5505
5809
|
}
|
|
5506
5810
|
|
|
@@ -5516,7 +5820,7 @@ function renderRowHeaders(context, layout) {
|
|
|
5516
5820
|
}
|
|
5517
5821
|
function createRowHeader(context, layout, series, rowIndex) {
|
|
5518
5822
|
const { chart, plot, bounds, nextOrder } = context;
|
|
5519
|
-
return
|
|
5823
|
+
return chunkXJ4W6TW4_cjs.chartText({
|
|
5520
5824
|
id: `chart-heatmap-row-${chart.id}-${series.id}`,
|
|
5521
5825
|
order: nextOrder(),
|
|
5522
5826
|
bounds,
|
|
@@ -5538,7 +5842,7 @@ function renderColumnHeaders(context, layout) {
|
|
|
5538
5842
|
}
|
|
5539
5843
|
function createColumnHeader(context, layout, label, columnIndex) {
|
|
5540
5844
|
const { chart, plot, bounds, nextOrder } = context;
|
|
5541
|
-
return
|
|
5845
|
+
return chunkXJ4W6TW4_cjs.chartText({
|
|
5542
5846
|
id: `chart-heatmap-col-${chart.id}-${columnIndex}`,
|
|
5543
5847
|
order: nextOrder(),
|
|
5544
5848
|
bounds,
|
|
@@ -5562,9 +5866,9 @@ function createHeatmapLayout(context) {
|
|
|
5562
5866
|
return {
|
|
5563
5867
|
rows: chart.series,
|
|
5564
5868
|
columns,
|
|
5565
|
-
bands:
|
|
5566
|
-
zones: chart.config?.zones?.length ? chart.config.zones :
|
|
5567
|
-
fontSize: Math.max(9,
|
|
5869
|
+
bands: chunkXJ4W6TW4_cjs.axisBands(chart.axisY),
|
|
5870
|
+
zones: chart.config?.zones?.length ? chart.config.zones : chunkXJ4W6TW4_cjs.DEFAULT_HEATMAP_ZONES,
|
|
5871
|
+
fontSize: Math.max(9, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12)),
|
|
5568
5872
|
reservedSpace,
|
|
5569
5873
|
grid: createHeatmapGrid(context, reservedSpace, columns.length)
|
|
5570
5874
|
};
|
|
@@ -5575,9 +5879,9 @@ function heatmapColumns(context) {
|
|
|
5575
5879
|
}
|
|
5576
5880
|
function heatmapReservedSpace(context) {
|
|
5577
5881
|
const { chart } = context;
|
|
5578
|
-
const fontSize = Math.max(9,
|
|
5882
|
+
const fontSize = Math.max(9, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12));
|
|
5579
5883
|
const longestLabel = chart.series.reduce(
|
|
5580
|
-
(max, series) => Math.max(max,
|
|
5884
|
+
(max, series) => Math.max(max, chunkXJ4W6TW4_cjs.estimateTextWidth(series.label ?? "", fontSize, false)),
|
|
5581
5885
|
0
|
|
5582
5886
|
);
|
|
5583
5887
|
return {
|
|
@@ -5591,7 +5895,7 @@ function createHeatmapGrid(context, reservedSpace, columnCount) {
|
|
|
5591
5895
|
const width = Math.max(1, context.plot.width - reservedSpace.rowHeaders);
|
|
5592
5896
|
const height = Math.max(1, context.plot.height - reservedSpace.columnHeaders - reservedSpace.legend);
|
|
5593
5897
|
const rowCount = chart.series.length;
|
|
5594
|
-
const cellGap = Math.max(0,
|
|
5898
|
+
const cellGap = Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.cellGap, 0));
|
|
5595
5899
|
let cellWidth = columnCount ? width / columnCount : width;
|
|
5596
5900
|
let cellHeight = rowCount ? height / rowCount : height;
|
|
5597
5901
|
let gridWidth = width;
|
|
@@ -5611,7 +5915,7 @@ function createHeatmapGrid(context, reservedSpace, columnCount) {
|
|
|
5611
5915
|
cellWidth,
|
|
5612
5916
|
cellHeight,
|
|
5613
5917
|
cellGap,
|
|
5614
|
-
cellRadius: Math.max(0,
|
|
5918
|
+
cellRadius: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.barCornerRadius, cellGap))
|
|
5615
5919
|
};
|
|
5616
5920
|
}
|
|
5617
5921
|
|
|
@@ -5627,7 +5931,7 @@ function renderHeatmapLegend(context, layout) {
|
|
|
5627
5931
|
const barWidth = layout.grid.width;
|
|
5628
5932
|
const labelHeight = layout.fontSize + 2;
|
|
5629
5933
|
const barY = layout.grid.y + layout.grid.height + 6;
|
|
5630
|
-
const barBounds =
|
|
5934
|
+
const barBounds = chunkXJ4W6TW4_cjs.boxBounds({ x: barX, y: barY, width: barWidth, height: BAR_HEIGHT });
|
|
5631
5935
|
return [
|
|
5632
5936
|
createGradientBar(context, layout, barX, barY, barWidth, barBounds),
|
|
5633
5937
|
...createBoundaryTicks(context, layout, barX, barY, barWidth, labelHeight)
|
|
@@ -5644,7 +5948,7 @@ function createGradientBar(context, layout, barX, barY, barWidth, barBounds) {
|
|
|
5644
5948
|
const zones = layout.zones.slice(0, bandCount);
|
|
5645
5949
|
const stops = zones.map((zone, index) => ({
|
|
5646
5950
|
offset: bandRatio(layout, layout.bands[index + 1] ?? layout.bands[layout.bands.length - 1]) * 100,
|
|
5647
|
-
color: zone.color ??
|
|
5951
|
+
color: zone.color ?? chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL
|
|
5648
5952
|
}));
|
|
5649
5953
|
return {
|
|
5650
5954
|
type: "rect",
|
|
@@ -5658,7 +5962,7 @@ function createGradientBar(context, layout, barX, barY, barWidth, barBounds) {
|
|
|
5658
5962
|
rx: 3,
|
|
5659
5963
|
zoneGradient: { axis: "y", min: chart.axisY.min, max: chart.axisY.max },
|
|
5660
5964
|
style: {
|
|
5661
|
-
fill: stops.length ? { kind: "linear-gradient", angle: 0, stops } : { kind: "solid", color:
|
|
5965
|
+
fill: stops.length ? { kind: "linear-gradient", angle: 0, stops } : { kind: "solid", color: chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL },
|
|
5662
5966
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
5663
5967
|
strokeWidth: 1
|
|
5664
5968
|
}
|
|
@@ -5686,12 +5990,12 @@ function createBoundaryTicks(context, layout, barX, barY, barWidth, labelHeight)
|
|
|
5686
5990
|
const isLast = index === layout.bands.length - 1;
|
|
5687
5991
|
const align = isFirst ? "left" : isLast ? "right" : "center";
|
|
5688
5992
|
const frameX = isFirst ? x : isLast ? x - labelWidth : x - labelWidth / 2;
|
|
5689
|
-
const label =
|
|
5993
|
+
const label = chunkXJ4W6TW4_cjs.chartText({
|
|
5690
5994
|
id: `chart-heatmap-legend-tick-label-${chart.id}-${index}`,
|
|
5691
5995
|
order: nextOrder(),
|
|
5692
5996
|
bounds,
|
|
5693
5997
|
frame: { x: frameX, y: labelY, width: labelWidth, height: labelHeight },
|
|
5694
|
-
text:
|
|
5998
|
+
text: chunkXJ4W6TW4_cjs.formatFieldValue(value),
|
|
5695
5999
|
chart,
|
|
5696
6000
|
align
|
|
5697
6001
|
});
|
|
@@ -6033,22 +6337,22 @@ function renderHexbin(context) {
|
|
|
6033
6337
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
6034
6338
|
const nodes = [];
|
|
6035
6339
|
const config = chart.config;
|
|
6036
|
-
const hexRadius = Math.max(1, config?.hexRadius ??
|
|
6340
|
+
const hexRadius = Math.max(1, config?.hexRadius ?? chunkXJ4W6TW4_cjs.DEFAULT_HEX_RADIUS);
|
|
6037
6341
|
const drawRadius = Math.max(0.5, hexRadius - Math.max(0, config?.hexGap ?? 0) * GAP_TO_RADIUS);
|
|
6038
6342
|
const strokeWidth = config?.hexStrokeWidth ?? 0;
|
|
6039
6343
|
const minOpacity = Math.min(1, Math.max(0, config?.hexMinOpacity ?? DEFAULT_MIN_OPACITY));
|
|
6040
|
-
const shadow =
|
|
6344
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
6041
6345
|
const clipPath = shadow ? `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z` : void 0;
|
|
6042
6346
|
chart.series.forEach((series, seriesIndex) => {
|
|
6043
6347
|
const explicit = series.values.length > 0 && Array.isArray(series.values[0]);
|
|
6044
6348
|
const pairs = explicit ? series.values : series.values.map((y, i) => [chart.axisX.min + i * chart.axisX.step, y]);
|
|
6045
6349
|
const pixelPoints2 = pairs.map(([vx, vy]) => ({
|
|
6046
|
-
x:
|
|
6047
|
-
y: plot.height -
|
|
6350
|
+
x: chunkXJ4W6TW4_cjs.mapChartValue(vx, chart.axisX, plot.width),
|
|
6351
|
+
y: plot.height - chunkXJ4W6TW4_cjs.mapChartValue(vy, chart.axisY, plot.height)
|
|
6048
6352
|
}));
|
|
6049
6353
|
const bins = computeHexBins(pixelPoints2, hexRadius);
|
|
6050
6354
|
const maxCount = Math.max(1, ...bins.map((bin) => bin.count));
|
|
6051
|
-
const color = series.color ??
|
|
6355
|
+
const color = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
6052
6356
|
const ramp = config?.scale;
|
|
6053
6357
|
bins.forEach((bin, i) => {
|
|
6054
6358
|
const share = bin.count / maxCount;
|
|
@@ -6060,8 +6364,8 @@ function renderHexbin(context) {
|
|
|
6060
6364
|
bounds,
|
|
6061
6365
|
d: hexPath(plot.x + bin.cx, plot.y + bin.cy, drawRadius),
|
|
6062
6366
|
style: {
|
|
6063
|
-
fill:
|
|
6064
|
-
stroke: strokeWidth > 0 ?
|
|
6367
|
+
fill: chunkXJ4W6TW4_cjs.paint(fill2, diagnostics, chart.id),
|
|
6368
|
+
stroke: strokeWidth > 0 ? chunkXJ4W6TW4_cjs.paint(config?.hexStrokeColor ?? fill2, diagnostics, chart.id) : void 0,
|
|
6065
6369
|
strokeWidth: strokeWidth > 0 ? strokeWidth : void 0,
|
|
6066
6370
|
opacity: ramp ? void 0 : Math.max(minOpacity, share),
|
|
6067
6371
|
shadow,
|
|
@@ -6083,8 +6387,8 @@ function seriesValuePairs(chart, series) {
|
|
|
6083
6387
|
function pixelPoints(context, pairs) {
|
|
6084
6388
|
const { chart, plot } = context;
|
|
6085
6389
|
return pairs.map(([x, y]) => ({
|
|
6086
|
-
x: plot.x +
|
|
6087
|
-
y: plot.y + plot.height -
|
|
6390
|
+
x: plot.x + chunkXJ4W6TW4_cjs.mapChartValue(x, chart.axisX, plot.width),
|
|
6391
|
+
y: plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(y, chart.axisY, plot.height)
|
|
6088
6392
|
}));
|
|
6089
6393
|
}
|
|
6090
6394
|
|
|
@@ -6094,7 +6398,7 @@ function createLineAreaFill(context, series, points, color, tension, areaOpacity
|
|
|
6094
6398
|
const baselineY = plot.y + plot.height;
|
|
6095
6399
|
const first = points[0];
|
|
6096
6400
|
const last = points[points.length - 1];
|
|
6097
|
-
const d = `${
|
|
6401
|
+
const d = `${chunkXJ4W6TW4_cjs.linePathData(points, tension)} L ${last.x} ${baselineY} L ${first.x} ${baselineY} Z`;
|
|
6098
6402
|
const top = Math.min(...points.map((point) => point.y));
|
|
6099
6403
|
const centerX = (Math.min(...points.map((point) => point.x)) + Math.max(...points.map((point) => point.x))) / 2;
|
|
6100
6404
|
const halfHeight = (baselineY - top) / 2;
|
|
@@ -6116,8 +6420,8 @@ function createLineAreaFill(context, series, points, color, tension, areaOpacity
|
|
|
6116
6420
|
kind: "linear-gradient",
|
|
6117
6421
|
angle: 90,
|
|
6118
6422
|
stops: [
|
|
6119
|
-
{ offset: 0, color:
|
|
6120
|
-
{ offset: 100, color:
|
|
6423
|
+
{ offset: 0, color: chunkXJ4W6TW4_cjs.colorWithAlpha(color, areaOpacity) },
|
|
6424
|
+
{ offset: 100, color: chunkXJ4W6TW4_cjs.colorWithAlpha(color, 0) }
|
|
6121
6425
|
]
|
|
6122
6426
|
},
|
|
6123
6427
|
stroke: { kind: "none" },
|
|
@@ -6140,7 +6444,7 @@ function guideNode(context, mark) {
|
|
|
6140
6444
|
d: `M ${mark.point.x} ${mark.point.y} V ${plot.y + plot.height}`,
|
|
6141
6445
|
style: {
|
|
6142
6446
|
fill: { kind: "none" },
|
|
6143
|
-
stroke:
|
|
6447
|
+
stroke: chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id),
|
|
6144
6448
|
strokeWidth: 1,
|
|
6145
6449
|
dash: [3, 4],
|
|
6146
6450
|
opacity: 0.55,
|
|
@@ -6161,20 +6465,20 @@ function dotNode(context, mark) {
|
|
|
6161
6465
|
rx: mark.radius,
|
|
6162
6466
|
ry: mark.radius,
|
|
6163
6467
|
style: {
|
|
6164
|
-
fill:
|
|
6468
|
+
fill: chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id),
|
|
6165
6469
|
shadow: glow ? { color: mark.color, opacity: 0.9, blur: glow, dx: 0, dy: 0 } : void 0,
|
|
6166
6470
|
pointerEvents: "none"
|
|
6167
6471
|
}
|
|
6168
6472
|
};
|
|
6169
6473
|
}
|
|
6170
|
-
function
|
|
6474
|
+
function labelNode3(context, mark, value) {
|
|
6171
6475
|
const { chart, bounds, nextOrder } = context;
|
|
6172
6476
|
const config = chart.config;
|
|
6173
6477
|
const fontSize = Math.max(9, chart.fontSize ?? 12);
|
|
6174
6478
|
const text = formatHighlight(config?.highlightLabelFormat, config?.categories?.[mark.index] ?? "", value);
|
|
6175
6479
|
const width = Math.max(48, text.length * fontSize * 0.62);
|
|
6176
6480
|
return {
|
|
6177
|
-
...
|
|
6481
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
6178
6482
|
id: `chart-highlight-label-${mark.key}`,
|
|
6179
6483
|
order: nextOrder(),
|
|
6180
6484
|
bounds,
|
|
@@ -6220,7 +6524,7 @@ function renderLineHighlights(context, series, color) {
|
|
|
6220
6524
|
}
|
|
6221
6525
|
nodes.push(dotNode(context, mark));
|
|
6222
6526
|
if (config?.highlightLabels) {
|
|
6223
|
-
nodes.push(
|
|
6527
|
+
nodes.push(labelNode3(context, mark, pairs[index][1]));
|
|
6224
6528
|
}
|
|
6225
6529
|
}
|
|
6226
6530
|
return nodes;
|
|
@@ -6254,15 +6558,15 @@ function createLineError(context, mark) {
|
|
|
6254
6558
|
return null;
|
|
6255
6559
|
}
|
|
6256
6560
|
const { chart, plot, bounds, nextOrder } = context;
|
|
6257
|
-
const [lower, upper] =
|
|
6258
|
-
return
|
|
6561
|
+
const [lower, upper] = chunkXJ4W6TW4_cjs.errorBarRange(mark.value, mark.error);
|
|
6562
|
+
return chunkXJ4W6TW4_cjs.createVerticalErrorWhiskerNode({
|
|
6259
6563
|
id: `chart-line-error-${chart.id}-${mark.seriesId}-${mark.valueIndex}`,
|
|
6260
6564
|
order: nextOrder(),
|
|
6261
6565
|
bounds,
|
|
6262
6566
|
geometry: {
|
|
6263
6567
|
centerX: mark.position.x,
|
|
6264
|
-
startY: plot.y + plot.height -
|
|
6265
|
-
endY: plot.y + plot.height -
|
|
6568
|
+
startY: plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(lower, chart.axisY, plot.height),
|
|
6569
|
+
endY: plot.y + plot.height - chunkXJ4W6TW4_cjs.mapChartValue(upper, chart.axisY, plot.height)
|
|
6266
6570
|
},
|
|
6267
6571
|
color: mark.color,
|
|
6268
6572
|
valueReference: { seriesId: mark.seriesId, valueIndex: mark.valueIndex }
|
|
@@ -6286,8 +6590,8 @@ function createLinePoint(context, mark) {
|
|
|
6286
6590
|
ry: visible ? radius : 6,
|
|
6287
6591
|
detail: { of: "chartValue", series: mark.seriesId, valueIndex: mark.valueIndex },
|
|
6288
6592
|
style: {
|
|
6289
|
-
fill: visible ?
|
|
6290
|
-
stroke: visible && strokeWidth > 0 ?
|
|
6593
|
+
fill: visible ? chunkXJ4W6TW4_cjs.paint(fill2, diagnostics, chart.id) : { kind: "none" },
|
|
6594
|
+
stroke: visible && strokeWidth > 0 ? chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id) : void 0,
|
|
6291
6595
|
strokeWidth: visible && strokeWidth > 0 ? strokeWidth : void 0,
|
|
6292
6596
|
pointerEvents: visible ? void 0 : "all"
|
|
6293
6597
|
}
|
|
@@ -6307,22 +6611,22 @@ function createLinePath(context, series, points, color, tension) {
|
|
|
6307
6611
|
order: nextOrder(),
|
|
6308
6612
|
bounds: gradient ? { minX: plot.x, maxX: plot.x + plot.width, minY: plot.y, maxY: plot.y + plot.height } : bounds,
|
|
6309
6613
|
detail: { of: "chartSeries", series: series.id, lineTension: tension || void 0 },
|
|
6310
|
-
d:
|
|
6614
|
+
d: chunkXJ4W6TW4_cjs.linePathData(points, tension),
|
|
6311
6615
|
style: {
|
|
6312
6616
|
fill: { kind: "none" },
|
|
6313
|
-
stroke:
|
|
6617
|
+
stroke: chunkXJ4W6TW4_cjs.paint(gradient ?? color, diagnostics, chart.id),
|
|
6314
6618
|
strokeWidth: series.strokeWidth ?? config?.lineWidth ?? 2,
|
|
6315
6619
|
dash: series.dash,
|
|
6316
6620
|
lineCap: config?.lineWidth === void 0 ? void 0 : "round",
|
|
6317
6621
|
lineJoin: "round",
|
|
6318
|
-
shadow: glow ? { color, opacity: 0.9, blur: glow, dx: 0, dy: 0 } :
|
|
6622
|
+
shadow: glow ? { color, opacity: 0.9, blur: glow, dx: 0, dy: 0 } : chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle)
|
|
6319
6623
|
}
|
|
6320
6624
|
};
|
|
6321
6625
|
}
|
|
6322
6626
|
|
|
6323
6627
|
// src/renderScene/charts/renderers/line/series.ts
|
|
6324
6628
|
function seriesColor(series, seriesIndex) {
|
|
6325
|
-
return
|
|
6629
|
+
return chunkXJ4W6TW4_cjs.representativeColor(series.color, chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length]);
|
|
6326
6630
|
}
|
|
6327
6631
|
function renderLineSeriesArea(context, series, seriesIndex) {
|
|
6328
6632
|
const areaOpacity = context.chart.config?.areaOpacity;
|
|
@@ -6386,7 +6690,7 @@ function renderGridLines(context, layout) {
|
|
|
6386
6690
|
style: {
|
|
6387
6691
|
fill: { kind: "none" },
|
|
6388
6692
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
6389
|
-
strokeWidth:
|
|
6693
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1)
|
|
6390
6694
|
}
|
|
6391
6695
|
};
|
|
6392
6696
|
});
|
|
@@ -6394,7 +6698,7 @@ function renderGridLines(context, layout) {
|
|
|
6394
6698
|
function renderPercentageLabels(context, layout) {
|
|
6395
6699
|
const { chart, plot, bounds, nextOrder } = context;
|
|
6396
6700
|
return PERCENT_TICKS.map((percent) => ({
|
|
6397
|
-
...
|
|
6701
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
6398
6702
|
id: `chart-mekko-pct-${chart.id}-${percent}`,
|
|
6399
6703
|
order: nextOrder(),
|
|
6400
6704
|
bounds,
|
|
@@ -6426,7 +6730,7 @@ function renderMekkoColumnLabels(context, layout, columnIndex, column) {
|
|
|
6426
6730
|
function createTotalLabel(context, layout, columnIndex, column) {
|
|
6427
6731
|
const { chart, plot, bounds, nextOrder } = context;
|
|
6428
6732
|
return {
|
|
6429
|
-
...
|
|
6733
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
6430
6734
|
id: `chart-mekko-total-${chart.id}-${columnIndex}`,
|
|
6431
6735
|
order: nextOrder(),
|
|
6432
6736
|
bounds,
|
|
@@ -6447,7 +6751,7 @@ function createColumnLabel(context, layout, columnIndex, column) {
|
|
|
6447
6751
|
const { chart, bounds, nextOrder } = context;
|
|
6448
6752
|
const { label, width } = column;
|
|
6449
6753
|
return {
|
|
6450
|
-
...
|
|
6754
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
6451
6755
|
id: `chart-mekko-col-label-${chart.id}-${columnIndex}`,
|
|
6452
6756
|
order: nextOrder(),
|
|
6453
6757
|
bounds,
|
|
@@ -6461,7 +6765,7 @@ function createColumnLabel(context, layout, columnIndex, column) {
|
|
|
6461
6765
|
chart,
|
|
6462
6766
|
align: "center"
|
|
6463
6767
|
}),
|
|
6464
|
-
lines:
|
|
6768
|
+
lines: chunkXJ4W6TW4_cjs.wrapText(label, width, layout.smallFontSize),
|
|
6465
6769
|
fontSize: layout.smallFontSize
|
|
6466
6770
|
};
|
|
6467
6771
|
}
|
|
@@ -6471,8 +6775,8 @@ function createMekkoLayout(context) {
|
|
|
6471
6775
|
const labels = mekkoColumnLabels(context);
|
|
6472
6776
|
const labelGutterWidth = context.showLabels ? 30 : 0;
|
|
6473
6777
|
const grid = createMekkoGrid(context, labelGutterWidth);
|
|
6474
|
-
const fontSize = Math.max(9,
|
|
6475
|
-
const columnGap = Math.max(0,
|
|
6778
|
+
const fontSize = Math.max(9, chunkXJ4W6TW4_cjs.finite(context.chart.fontSize, 12));
|
|
6779
|
+
const columnGap = Math.max(0, chunkXJ4W6TW4_cjs.finite(context.chart.config?.mekkoColumnGap, 4));
|
|
6476
6780
|
const smallFontSize = Math.max(8, fontSize - 1);
|
|
6477
6781
|
return {
|
|
6478
6782
|
columns: createMekkoColumns(context, grid, labels, columnGap),
|
|
@@ -6480,8 +6784,8 @@ function createMekkoLayout(context) {
|
|
|
6480
6784
|
smallFontSize,
|
|
6481
6785
|
labelGutterWidth,
|
|
6482
6786
|
columnGap,
|
|
6483
|
-
labelSize: Math.max(6,
|
|
6484
|
-
valueSize: Math.max(6,
|
|
6787
|
+
labelSize: Math.max(6, chunkXJ4W6TW4_cjs.finite(context.chart.config?.mekkoLabelSize, smallFontSize)),
|
|
6788
|
+
valueSize: Math.max(6, chunkXJ4W6TW4_cjs.finite(context.chart.config?.mekkoValueSize, smallFontSize)),
|
|
6485
6789
|
grid
|
|
6486
6790
|
};
|
|
6487
6791
|
}
|
|
@@ -6538,12 +6842,12 @@ function createColumnBackdrop(context, layout, columnIndex) {
|
|
|
6538
6842
|
id: `chart-mekko-column-backdrop-${chart.id}-${columnIndex}`,
|
|
6539
6843
|
order: nextOrder(),
|
|
6540
6844
|
bounds,
|
|
6541
|
-
d:
|
|
6542
|
-
style: { fill:
|
|
6845
|
+
d: chunkXJ4W6TW4_cjs.barShapePath(column.x, layout.grid.y, column.width, layout.grid.height, cornerRadius),
|
|
6846
|
+
style: { fill: chunkXJ4W6TW4_cjs.paint(chart.gridColor ?? "#e2e8f0", diagnostics, chart.id), opacity: BACKDROP_OPACITY }
|
|
6543
6847
|
};
|
|
6544
6848
|
}
|
|
6545
6849
|
function mekkoCornerRadius(context) {
|
|
6546
|
-
return Math.max(0,
|
|
6850
|
+
return Math.max(0, chunkXJ4W6TW4_cjs.finite(context.chart.config?.barCornerRadius, 2));
|
|
6547
6851
|
}
|
|
6548
6852
|
function calculateColumnSegments(seriesList, layout, columnIndex) {
|
|
6549
6853
|
const segments = [];
|
|
@@ -6554,7 +6858,7 @@ function calculateColumnSegments(seriesList, layout, columnIndex) {
|
|
|
6554
6858
|
const height = (column.total > 0 ? value / column.total : 0) * column.height;
|
|
6555
6859
|
const y = column.y + cumulativeHeight;
|
|
6556
6860
|
cumulativeHeight += height;
|
|
6557
|
-
const color = series.color ??
|
|
6861
|
+
const color = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
6558
6862
|
segments.push({
|
|
6559
6863
|
columnIndex,
|
|
6560
6864
|
seriesId: series.id,
|
|
@@ -6577,12 +6881,12 @@ function renderSegment(context, layout, segment, nextColor) {
|
|
|
6577
6881
|
}
|
|
6578
6882
|
function createSegmentNode(context, segment, nextColor) {
|
|
6579
6883
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
6580
|
-
const shadow =
|
|
6884
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
6581
6885
|
const clipPath = shadow ? `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z` : void 0;
|
|
6582
6886
|
const config = chart.config;
|
|
6583
6887
|
const radius = segment.isTop || config?.mekkoRoundAll ? mekkoCornerRadius(context) : 0;
|
|
6584
6888
|
const { x, y, width, height } = segment.frame;
|
|
6585
|
-
const segmentGap = Math.max(0,
|
|
6889
|
+
const segmentGap = Math.max(0, chunkXJ4W6TW4_cjs.finite(config?.mekkoSegmentGap, 0));
|
|
6586
6890
|
const fallback = "#94a3b8";
|
|
6587
6891
|
const gradientBounds = {
|
|
6588
6892
|
minX: x + width / 2 - height / 2,
|
|
@@ -6594,20 +6898,20 @@ function createSegmentNode(context, segment, nextColor) {
|
|
|
6594
6898
|
kind: "linear-gradient",
|
|
6595
6899
|
angle: 90,
|
|
6596
6900
|
stops: [
|
|
6597
|
-
{ offset: 0, color:
|
|
6598
|
-
{ offset: 100, color:
|
|
6901
|
+
{ offset: 0, color: chunkXJ4W6TW4_cjs.representativeColor(segment.color, fallback) },
|
|
6902
|
+
{ offset: 100, color: chunkXJ4W6TW4_cjs.representativeColor(nextColor, fallback) }
|
|
6599
6903
|
]
|
|
6600
|
-
} :
|
|
6904
|
+
} : chunkXJ4W6TW4_cjs.paint(segment.color, diagnostics, chart.id);
|
|
6601
6905
|
return {
|
|
6602
6906
|
type: "path",
|
|
6603
6907
|
id: `chart-mekko-seg-${chart.id}-${segment.columnIndex}-${segment.seriesId}`,
|
|
6604
6908
|
order: nextOrder(),
|
|
6605
6909
|
bounds: nextColor ? gradientBounds : bounds,
|
|
6606
|
-
d:
|
|
6910
|
+
d: chunkXJ4W6TW4_cjs.barPath(x, y + segmentGap / 2, width, Math.max(0, height - segmentGap), radius, Boolean(config?.mekkoRoundAll)),
|
|
6607
6911
|
style: {
|
|
6608
6912
|
fill: fill2,
|
|
6609
6913
|
stroke: { kind: "solid", color: config?.mekkoSegmentStrokeColor ?? chart.gridColor ?? "#e2e8f0" },
|
|
6610
|
-
strokeWidth:
|
|
6914
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(config?.mekkoSegmentStrokeWidth, chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1)),
|
|
6611
6915
|
shadow,
|
|
6612
6916
|
clip: clipPath ? { type: "path", d: clipPath } : void 0
|
|
6613
6917
|
}
|
|
@@ -6623,17 +6927,17 @@ function createSegmentLabel(context, layout, segment) {
|
|
|
6623
6927
|
const innerHeight = Math.max(1, height - 6);
|
|
6624
6928
|
const lineHeight = layout.labelSize * 1.2;
|
|
6625
6929
|
const valueHeight = layout.valueSize * 1.2;
|
|
6626
|
-
const labelLines =
|
|
6627
|
-
(line) =>
|
|
6930
|
+
const labelLines = chunkXJ4W6TW4_cjs.wrapText(segment.seriesLabel, innerWidth, layout.labelSize).map(
|
|
6931
|
+
(line) => chunkXJ4W6TW4_cjs.ellipsizeToWidth(line, innerWidth, layout.labelSize, true)
|
|
6628
6932
|
);
|
|
6629
6933
|
if (labelLines.length * lineHeight + valueHeight > innerHeight) {
|
|
6630
6934
|
return [];
|
|
6631
6935
|
}
|
|
6632
|
-
const textColor = chart.config?.mekkoTextColor ??
|
|
6936
|
+
const textColor = chart.config?.mekkoTextColor ?? chunkXJ4W6TW4_cjs.contrastTextColor(chunkXJ4W6TW4_cjs.representativeColor(segment.color, "#ffffff"));
|
|
6633
6937
|
const columnTotal = layout.columns[segment.columnIndex]?.total ?? 0;
|
|
6634
6938
|
const valueText = chart.config?.mekkoValueFormat === "percent" ? `${columnTotal > 0 ? Math.round(segment.value / columnTotal * 100) : 0}%` : String(segment.value);
|
|
6635
6939
|
const label = {
|
|
6636
|
-
...
|
|
6940
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
6637
6941
|
id: `chart-mekko-seg-label-${chart.id}-${segment.columnIndex}-${segment.seriesId}`,
|
|
6638
6942
|
order: nextOrder(),
|
|
6639
6943
|
bounds,
|
|
@@ -6647,7 +6951,7 @@ function createSegmentLabel(context, layout, segment) {
|
|
|
6647
6951
|
color: textColor
|
|
6648
6952
|
};
|
|
6649
6953
|
const valueNode = {
|
|
6650
|
-
...
|
|
6954
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
6651
6955
|
id: `chart-mekko-seg-value-${chart.id}-${segment.columnIndex}-${segment.seriesId}`,
|
|
6652
6956
|
order: nextOrder(),
|
|
6653
6957
|
bounds,
|
|
@@ -6680,7 +6984,7 @@ function renderMekko(context) {
|
|
|
6680
6984
|
|
|
6681
6985
|
// src/renderScene/charts/renderers/pie/center.ts
|
|
6682
6986
|
function fill(template, chart) {
|
|
6683
|
-
const values = chart.series.map((series) => Math.max(0,
|
|
6987
|
+
const values = chart.series.map((series) => Math.max(0, chunkXJ4W6TW4_cjs.finite(series.values[0], 0)));
|
|
6684
6988
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
6685
6989
|
const first = values[0] ?? 0;
|
|
6686
6990
|
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 ?? "");
|
|
@@ -6692,7 +6996,7 @@ function renderPieCenter(context, geometry) {
|
|
|
6692
6996
|
return [];
|
|
6693
6997
|
}
|
|
6694
6998
|
const lines = fill(template, chart).split(/\\n|\n/);
|
|
6695
|
-
const fontSize =
|
|
6999
|
+
const fontSize = chunkXJ4W6TW4_cjs.finite(chart.config?.pieCenterSize, Math.max(14, Math.min(40, geometry.outerRadius * 0.3)));
|
|
6696
7000
|
const lineHeight = fontSize * 1.2;
|
|
6697
7001
|
const width = Math.max(40, (geometry.innerRadius > 0 ? geometry.innerRadius : geometry.outerRadius * 0.6) * 2);
|
|
6698
7002
|
const text = {
|
|
@@ -6705,7 +7009,7 @@ function renderPieCenter(context, geometry) {
|
|
|
6705
7009
|
width,
|
|
6706
7010
|
height: lineHeight * lines.length,
|
|
6707
7011
|
lines,
|
|
6708
|
-
fontFamily: chart.fontFamily ??
|
|
7012
|
+
fontFamily: chart.fontFamily ?? chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
6709
7013
|
fontSize,
|
|
6710
7014
|
fontWeight: "bold",
|
|
6711
7015
|
align: "center",
|
|
@@ -6725,14 +7029,14 @@ var radians = (degrees) => degrees * Math.PI / 180;
|
|
|
6725
7029
|
function renderPieSlices(context, geometry) {
|
|
6726
7030
|
const config = context.chart.config;
|
|
6727
7031
|
const marks = createPieSliceMarks(context.chart.series, geometry.total, {
|
|
6728
|
-
start: TOP + radians(
|
|
6729
|
-
sweep: Math.min(FULL, Math.max(radians(1), radians(
|
|
6730
|
-
explode: Math.max(0,
|
|
7032
|
+
start: TOP + radians(chunkXJ4W6TW4_cjs.finite(config?.pieStartAngle, 0)),
|
|
7033
|
+
sweep: Math.min(FULL, Math.max(radians(1), radians(chunkXJ4W6TW4_cjs.finite(config?.pieSweep, 360)))),
|
|
7034
|
+
explode: Math.max(0, chunkXJ4W6TW4_cjs.finite(config?.pieExplode, 0))
|
|
6731
7035
|
});
|
|
6732
7036
|
const gapPx = config?.pieSliceGap ?? 0;
|
|
6733
7037
|
return [
|
|
6734
7038
|
...marks.flatMap((mark) => createSliceNodes(context, shiftGeometry(geometry, mark), mark, gapPx)),
|
|
6735
|
-
...
|
|
7039
|
+
...chunkXJ4W6TW4_cjs.renderPieLabels(
|
|
6736
7040
|
context,
|
|
6737
7041
|
geometry,
|
|
6738
7042
|
marks.map((mark) => ({
|
|
@@ -6764,20 +7068,20 @@ function createPieSliceMarks(seriesList, total, layout) {
|
|
|
6764
7068
|
const marks = [];
|
|
6765
7069
|
let angle = layout.start;
|
|
6766
7070
|
seriesList.forEach((series, seriesIndex) => {
|
|
6767
|
-
const value = Math.max(0,
|
|
7071
|
+
const value = Math.max(0, chunkXJ4W6TW4_cjs.finite(series.values[0], 0));
|
|
6768
7072
|
const sweep = value / total * layout.sweep;
|
|
6769
7073
|
marks.push({
|
|
6770
7074
|
seriesId: series.id,
|
|
6771
7075
|
label: series.label,
|
|
6772
|
-
color: series.color ??
|
|
7076
|
+
color: series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length],
|
|
6773
7077
|
stroke: series.stroke,
|
|
6774
7078
|
strokeWidth: series.strokeWidth,
|
|
6775
7079
|
value,
|
|
6776
7080
|
share: value / total,
|
|
6777
7081
|
angles: { start: angle, end: angle + Math.min(sweep, layout.sweep >= FULL ? MAXIMUM_SWEEP : layout.sweep) },
|
|
6778
|
-
explode: Math.max(0,
|
|
6779
|
-
labelOffsetX:
|
|
6780
|
-
labelOffsetY:
|
|
7082
|
+
explode: Math.max(0, chunkXJ4W6TW4_cjs.finite(series.offset, layout.explode)),
|
|
7083
|
+
labelOffsetX: chunkXJ4W6TW4_cjs.finite(series.labelOffsetX, 0),
|
|
7084
|
+
labelOffsetY: chunkXJ4W6TW4_cjs.finite(series.labelOffsetY, 0)
|
|
6781
7085
|
});
|
|
6782
7086
|
angle += sweep;
|
|
6783
7087
|
});
|
|
@@ -6800,14 +7104,14 @@ function pieOuterShadow(shadow, gapPx) {
|
|
|
6800
7104
|
function sliceCornerRadius(geometry, mark, gapPx) {
|
|
6801
7105
|
const halfGap = Math.max(0, gapPx) / 2;
|
|
6802
7106
|
const rawSweep = mark.angles.end - mark.angles.start;
|
|
6803
|
-
const usesInnerArc =
|
|
6804
|
-
const gapSweep = 2 *
|
|
7107
|
+
const usesInnerArc = chunkXJ4W6TW4_cjs.pieUsesInnerArc(geometry, mark.angles, gapPx);
|
|
7108
|
+
const gapSweep = 2 * chunkXJ4W6TW4_cjs.gapInsetAngle(halfGap, geometry.outerRadius);
|
|
6805
7109
|
const availableSweep = Math.max(0, rawSweep - gapSweep);
|
|
6806
7110
|
return Math.min(
|
|
6807
7111
|
geometry.cornerRadius,
|
|
6808
|
-
usesInnerArc ?
|
|
7112
|
+
usesInnerArc ? chunkXJ4W6TW4_cjs.maxPieCornerRadius(geometry.outerRadius, geometry.innerRadius, availableSweep) : chunkXJ4W6TW4_cjs.maxApexCornerRadius(
|
|
6809
7113
|
geometry.outerRadius,
|
|
6810
|
-
|
|
7114
|
+
chunkXJ4W6TW4_cjs.pieApexRadius(halfGap, rawSweep, geometry.outerRadius),
|
|
6811
7115
|
availableSweep
|
|
6812
7116
|
)
|
|
6813
7117
|
);
|
|
@@ -6820,14 +7124,14 @@ function sliceStroke(context, mark) {
|
|
|
6820
7124
|
}
|
|
6821
7125
|
return {
|
|
6822
7126
|
stroke: { kind: "solid", color: strokeColor },
|
|
6823
|
-
strokeWidth:
|
|
7127
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(mark.strokeWidth, chunkXJ4W6TW4_cjs.finite(config?.pieStrokeWidth, 1))
|
|
6824
7128
|
};
|
|
6825
7129
|
}
|
|
6826
7130
|
function createSliceNodes(context, geometry, mark, gapPx) {
|
|
6827
7131
|
const { chart, bounds, diagnostics, nextOrder } = context;
|
|
6828
|
-
const fill2 =
|
|
6829
|
-
const slicePath =
|
|
6830
|
-
const shadow =
|
|
7132
|
+
const fill2 = chunkXJ4W6TW4_cjs.paint(mark.color, diagnostics, chart.id);
|
|
7133
|
+
const slicePath = chunkXJ4W6TW4_cjs.createPieSlicePath(geometry, mark.angles, sliceCornerRadius(geometry, mark, gapPx), gapPx);
|
|
7134
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
6831
7135
|
const strokeStyle = sliceStroke(context, mark);
|
|
6832
7136
|
const glow = chart.config?.pieGlow;
|
|
6833
7137
|
const shadowCaster = shadow ? {
|
|
@@ -6858,12 +7162,12 @@ function createSliceNodes(context, geometry, mark, gapPx) {
|
|
|
6858
7162
|
pieEnd: mark.angles.end,
|
|
6859
7163
|
pieValue: mark.value
|
|
6860
7164
|
},
|
|
6861
|
-
prop:
|
|
7165
|
+
prop: chunkXJ4W6TW4_cjs.seriesValueProp(mark.seriesId, 0),
|
|
6862
7166
|
style: {
|
|
6863
7167
|
fill: fill2,
|
|
6864
7168
|
...strokeStyle,
|
|
6865
7169
|
innerShadow: shadow,
|
|
6866
|
-
shadow: glow ? { color:
|
|
7170
|
+
shadow: glow ? { color: chunkXJ4W6TW4_cjs.representativeColor(mark.color, "#ffffff"), opacity: 0.85, blur: glow, dx: 0, dy: 0 } : void 0
|
|
6867
7171
|
}
|
|
6868
7172
|
};
|
|
6869
7173
|
return shadowCaster ? [shadowCaster, slice] : [slice];
|
|
@@ -6871,7 +7175,7 @@ function createSliceNodes(context, geometry, mark, gapPx) {
|
|
|
6871
7175
|
|
|
6872
7176
|
// src/renderScene/charts/renderers/pie.ts
|
|
6873
7177
|
function renderPie(context) {
|
|
6874
|
-
const geometry =
|
|
7178
|
+
const geometry = chunkXJ4W6TW4_cjs.createPieGeometry(context);
|
|
6875
7179
|
return [...renderPieSlices(context, geometry), ...renderPieCenter(context, geometry)];
|
|
6876
7180
|
}
|
|
6877
7181
|
|
|
@@ -6888,18 +7192,18 @@ var OUTSIDE_FALLBACK_COLOR = "#334155";
|
|
|
6888
7192
|
function layoutOf(context) {
|
|
6889
7193
|
const { chart, plot } = context;
|
|
6890
7194
|
const maxRadius = Math.max(1, Math.min(plot.width, plot.height) / 2 - 4);
|
|
6891
|
-
const axisMin =
|
|
7195
|
+
const axisMin = chunkXJ4W6TW4_cjs.finite(chart.axisY.min, 0);
|
|
6892
7196
|
return {
|
|
6893
7197
|
centerX: plot.x + plot.width / 2,
|
|
6894
7198
|
centerY: plot.y + plot.height / 2,
|
|
6895
7199
|
maxRadius,
|
|
6896
|
-
innerRadius: Math.max(0, Math.min(
|
|
6897
|
-
cornerRadius: Math.max(0,
|
|
6898
|
-
gapPx: Math.max(0,
|
|
7200
|
+
innerRadius: Math.max(0, Math.min(chunkXJ4W6TW4_cjs.finite(chart.config?.innerRadius, 0), maxRadius - 1)),
|
|
7201
|
+
cornerRadius: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.pieCornerRadius, 0)),
|
|
7202
|
+
gapPx: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.pieSliceGap, 0)),
|
|
6899
7203
|
axisMin,
|
|
6900
|
-
range:
|
|
7204
|
+
range: chunkXJ4W6TW4_cjs.finite(chart.axisY.max, 100) - axisMin,
|
|
6901
7205
|
sweep: chart.series.length > 0 ? Math.PI * 2 / chart.series.length : 0,
|
|
6902
|
-
start: TOP2 +
|
|
7206
|
+
start: TOP2 + chunkXJ4W6TW4_cjs.finite(chart.config?.pieStartAngle, 0) * Math.PI / 180
|
|
6903
7207
|
};
|
|
6904
7208
|
}
|
|
6905
7209
|
function clampedCorner(layout, outerRadius, angles) {
|
|
@@ -6907,19 +7211,19 @@ function clampedCorner(layout, outerRadius, angles) {
|
|
|
6907
7211
|
const geometry = { centerX, centerY, outerRadius, innerRadius };
|
|
6908
7212
|
const halfGap = Math.max(0, gapPx) / 2;
|
|
6909
7213
|
const rawSweep = angles.end - angles.start;
|
|
6910
|
-
const availableSweep = Math.max(0, rawSweep - 2 *
|
|
6911
|
-
if (
|
|
6912
|
-
return Math.min(cornerRadius,
|
|
7214
|
+
const availableSweep = Math.max(0, rawSweep - 2 * chunkXJ4W6TW4_cjs.gapInsetAngle(halfGap, outerRadius));
|
|
7215
|
+
if (chunkXJ4W6TW4_cjs.pieUsesInnerArc(geometry, angles, gapPx)) {
|
|
7216
|
+
return Math.min(cornerRadius, chunkXJ4W6TW4_cjs.maxPieCornerRadius(outerRadius, innerRadius, availableSweep));
|
|
6913
7217
|
}
|
|
6914
|
-
const apexRadius =
|
|
6915
|
-
return Math.min(cornerRadius,
|
|
7218
|
+
const apexRadius = chunkXJ4W6TW4_cjs.pieApexRadius(halfGap, rawSweep, outerRadius);
|
|
7219
|
+
return Math.min(cornerRadius, chunkXJ4W6TW4_cjs.maxApexCornerRadius(outerRadius, apexRadius, availableSweep));
|
|
6916
7220
|
}
|
|
6917
7221
|
function wedgeNodes(context, layout, series, angles, outerRadius, value, rawColor) {
|
|
6918
7222
|
const { chart, bounds, diagnostics, nextOrder } = context;
|
|
6919
7223
|
const { centerX, centerY, innerRadius, maxRadius, gapPx } = layout;
|
|
6920
|
-
const color =
|
|
6921
|
-
const shadow =
|
|
6922
|
-
const trackPath =
|
|
7224
|
+
const color = chunkXJ4W6TW4_cjs.paint(rawColor, diagnostics, chart.id);
|
|
7225
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
7226
|
+
const trackPath = chunkXJ4W6TW4_cjs.createPieSlicePath(
|
|
6923
7227
|
{ centerX, centerY, outerRadius: maxRadius, innerRadius },
|
|
6924
7228
|
angles,
|
|
6925
7229
|
clampedCorner(layout, maxRadius, angles),
|
|
@@ -6932,12 +7236,12 @@ function wedgeNodes(context, layout, series, angles, outerRadius, value, rawColo
|
|
|
6932
7236
|
bounds,
|
|
6933
7237
|
d: trackPath,
|
|
6934
7238
|
style: {
|
|
6935
|
-
fill:
|
|
7239
|
+
fill: chunkXJ4W6TW4_cjs.paint(chart.gridColor ?? TRACK_COLOR_FALLBACK, diagnostics, chart.id),
|
|
6936
7240
|
opacity: chart.config?.polarTrackOpacity,
|
|
6937
7241
|
...trackStroke(context)
|
|
6938
7242
|
}
|
|
6939
7243
|
};
|
|
6940
|
-
const wedgePath =
|
|
7244
|
+
const wedgePath = chunkXJ4W6TW4_cjs.createPieSlicePath(
|
|
6941
7245
|
{ centerX, centerY, outerRadius, innerRadius },
|
|
6942
7246
|
angles,
|
|
6943
7247
|
clampedCorner(layout, outerRadius, angles),
|
|
@@ -6966,7 +7270,7 @@ function wedgeNodes(context, layout, series, angles, outerRadius, value, rawColo
|
|
|
6966
7270
|
pieEnd: angles.end,
|
|
6967
7271
|
pieValue: value
|
|
6968
7272
|
},
|
|
6969
|
-
prop:
|
|
7273
|
+
prop: chunkXJ4W6TW4_cjs.seriesValueProp(series.id, 0),
|
|
6970
7274
|
style: { fill: color, innerShadow: shadow, ...wedgeStroke(context) }
|
|
6971
7275
|
};
|
|
6972
7276
|
return shadowCaster ? [track, shadowCaster, wedge] : [track, wedge];
|
|
@@ -6979,7 +7283,7 @@ function trackStroke(context) {
|
|
|
6979
7283
|
const dash = (config.polarTrackDash ?? "").split(/[ ,]+/).map(Number).filter((part) => Number.isFinite(part) && part > 0);
|
|
6980
7284
|
return {
|
|
6981
7285
|
stroke: { kind: "solid", color: config.polarTrackStroke },
|
|
6982
|
-
strokeWidth:
|
|
7286
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(config.polarTrackStrokeWidth, 1),
|
|
6983
7287
|
dash: dash.length > 0 ? dash : void 0
|
|
6984
7288
|
};
|
|
6985
7289
|
}
|
|
@@ -6990,7 +7294,7 @@ function wedgeStroke(context) {
|
|
|
6990
7294
|
}
|
|
6991
7295
|
return {
|
|
6992
7296
|
stroke: { kind: "solid", color: config.pieStroke },
|
|
6993
|
-
strokeWidth:
|
|
7297
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(config.pieStrokeWidth, 1)
|
|
6994
7298
|
};
|
|
6995
7299
|
}
|
|
6996
7300
|
function ringNodes(context, layout) {
|
|
@@ -6998,7 +7302,7 @@ function ringNodes(context, layout) {
|
|
|
6998
7302
|
if (!chart.config?.polarRings || layout.range <= 0) {
|
|
6999
7303
|
return [];
|
|
7000
7304
|
}
|
|
7001
|
-
return
|
|
7305
|
+
return chunkXJ4W6TW4_cjs.chartTicks(chart.axisY).filter((tick) => tick > layout.axisMin && tick < layout.axisMin + layout.range).map((tick) => {
|
|
7002
7306
|
const radius = layout.innerRadius + (layout.maxRadius - layout.innerRadius) * (tick - layout.axisMin) / layout.range;
|
|
7003
7307
|
return {
|
|
7004
7308
|
type: "ellipse",
|
|
@@ -7012,7 +7316,7 @@ function ringNodes(context, layout) {
|
|
|
7012
7316
|
style: {
|
|
7013
7317
|
fill: { kind: "none" },
|
|
7014
7318
|
stroke: { kind: "solid", color: chart.textColor ?? "#334155" },
|
|
7015
|
-
strokeWidth:
|
|
7319
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1),
|
|
7016
7320
|
opacity: 0.25
|
|
7017
7321
|
}
|
|
7018
7322
|
};
|
|
@@ -7024,10 +7328,10 @@ function renderPolarArea(context) {
|
|
|
7024
7328
|
const showLabels = context.showLabels && sweep >= MIN_LABEL_SWEEP;
|
|
7025
7329
|
const wedges = context.chart.series.flatMap((series, index) => {
|
|
7026
7330
|
const angles = { start: start + index * sweep, end: start + (index + 1) * sweep };
|
|
7027
|
-
const value = Math.max(0,
|
|
7331
|
+
const value = Math.max(0, chunkXJ4W6TW4_cjs.finite(series.values[0], 0));
|
|
7028
7332
|
const fraction = range > 0 ? Math.min(1, Math.max(0, (value - axisMin) / range)) : 0;
|
|
7029
7333
|
const outerRadius = Math.max(innerRadius + 1, innerRadius + (maxRadius - innerRadius) * fraction);
|
|
7030
|
-
const rawColor = series.color ??
|
|
7334
|
+
const rawColor = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[index % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
7031
7335
|
const nodes = wedgeNodes(context, layout, series, angles, outerRadius, value, rawColor);
|
|
7032
7336
|
if (!showLabels) {
|
|
7033
7337
|
return nodes;
|
|
@@ -7038,10 +7342,10 @@ function renderPolarArea(context) {
|
|
|
7038
7342
|
return [...wedges, ...ringNodes(context, layout)];
|
|
7039
7343
|
}
|
|
7040
7344
|
function labelSizes(chart) {
|
|
7041
|
-
const base = Math.max(9,
|
|
7345
|
+
const base = Math.max(9, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12));
|
|
7042
7346
|
return {
|
|
7043
|
-
nameSize: Math.max(6,
|
|
7044
|
-
valueSize: Math.max(6,
|
|
7347
|
+
nameSize: Math.max(6, chunkXJ4W6TW4_cjs.finite(chart.config?.polarNameSize, base)),
|
|
7348
|
+
valueSize: Math.max(6, chunkXJ4W6TW4_cjs.finite(chart.config?.polarValueSize, base))
|
|
7045
7349
|
};
|
|
7046
7350
|
}
|
|
7047
7351
|
function labelPlacement2(context, geometry, angles, series, fillColor) {
|
|
@@ -7049,8 +7353,8 @@ function labelPlacement2(context, geometry, angles, series, fillColor) {
|
|
|
7049
7353
|
const { nameSize, valueSize } = labelSizes(context.chart);
|
|
7050
7354
|
const lineHeight = (nameSize + valueSize) * 1.2 / 2;
|
|
7051
7355
|
const ringThickness = geometry.outerRadius - geometry.innerRadius;
|
|
7052
|
-
const labelOffsetX =
|
|
7053
|
-
const labelOffsetY =
|
|
7356
|
+
const labelOffsetX = chunkXJ4W6TW4_cjs.finite(series.labelOffsetX, 0);
|
|
7357
|
+
const labelOffsetY = chunkXJ4W6TW4_cjs.finite(series.labelOffsetY, 0);
|
|
7054
7358
|
const hasManualOffset = labelOffsetX !== 0 || labelOffsetY !== 0;
|
|
7055
7359
|
const tooThin = ringThickness < lineHeight * 2 + 6;
|
|
7056
7360
|
const chordWidth = 2 * geometry.outerRadius * Math.sin(Math.abs(angles.end - angles.start) / 2);
|
|
@@ -7060,11 +7364,11 @@ function labelPlacement2(context, geometry, angles, series, fillColor) {
|
|
|
7060
7364
|
return void 0;
|
|
7061
7365
|
}
|
|
7062
7366
|
const outside = hasManualOffset || !fitsInline;
|
|
7063
|
-
const tickStart =
|
|
7064
|
-
const point = outside ? hasManualOffset ? addOffset(
|
|
7065
|
-
const color = outside ? outsideLabels && context.chart.textColor ? context.chart.textColor :
|
|
7066
|
-
|
|
7067
|
-
|
|
7367
|
+
const tickStart = chunkXJ4W6TW4_cjs.pieArcPoint(geometry, mid, geometry.outerRadius + LEADER_INSET);
|
|
7368
|
+
const point = outside ? hasManualOffset ? addOffset(chunkXJ4W6TW4_cjs.pieArcPoint(geometry, mid, geometry.outerRadius), labelOffsetX, labelOffsetY) : chunkXJ4W6TW4_cjs.pieArcPoint(geometry, mid, geometry.outerRadius + OUTSIDE_GAP) : chunkXJ4W6TW4_cjs.pieArcPoint(geometry, mid, geometry.innerRadius + ringThickness * LABEL_RADIUS_FRACTION);
|
|
7369
|
+
const color = outside ? outsideLabels && context.chart.textColor ? context.chart.textColor : chunkXJ4W6TW4_cjs.sameHueTint(chunkXJ4W6TW4_cjs.representativeColor(fillColor, OUTSIDE_FALLBACK_COLOR), OUTSIDE_TINT_LIGHTNESS) ?? OUTSIDE_FALLBACK_COLOR : chunkXJ4W6TW4_cjs.sameHueContrastColor(
|
|
7370
|
+
chunkXJ4W6TW4_cjs.representativeColor(fillColor, "#0f172a"),
|
|
7371
|
+
chunkXJ4W6TW4_cjs.contrastTextColor(chunkXJ4W6TW4_cjs.representativeColor(fillColor, "#0f172a"))
|
|
7068
7372
|
);
|
|
7069
7373
|
return { point, color, outside, mid, tickStart };
|
|
7070
7374
|
}
|
|
@@ -7077,7 +7381,7 @@ function createWedgeLabel(context, geometry, angles, series, value, fillColor) {
|
|
|
7077
7381
|
const { point, color, outside, mid, tickStart } = placement;
|
|
7078
7382
|
const { nameSize, valueSize } = labelSizes(chart);
|
|
7079
7383
|
const lineHeight = Math.max(nameSize, valueSize) * 1.2;
|
|
7080
|
-
const tickEnd = outside ?
|
|
7384
|
+
const tickEnd = outside ? chunkXJ4W6TW4_cjs.clipSegmentToRect(tickStart, point, LABEL_WIDTH / 2, lineHeight) : tickStart;
|
|
7081
7385
|
const tick = {
|
|
7082
7386
|
type: "path",
|
|
7083
7387
|
id: `chart-polar-area-label-tick-${chart.id}-${series.id}`,
|
|
@@ -7099,7 +7403,7 @@ function createWedgeLabel(context, geometry, angles, series, value, fillColor) {
|
|
|
7099
7403
|
bounds,
|
|
7100
7404
|
x: point.x - LABEL_WIDTH / 2,
|
|
7101
7405
|
width: LABEL_WIDTH,
|
|
7102
|
-
fontFamily: chart.fontFamily ??
|
|
7406
|
+
fontFamily: chart.fontFamily ?? chunkXJ4W6TW4_cjs.DEFAULT_FONT,
|
|
7103
7407
|
align: "center",
|
|
7104
7408
|
verticalAlign: "middle",
|
|
7105
7409
|
lineHeight: 1.2,
|
|
@@ -7122,7 +7426,7 @@ function createWedgeLabel(context, geometry, angles, series, value, fillColor) {
|
|
|
7122
7426
|
lines: [series.label],
|
|
7123
7427
|
fontWeight: valueFirst ? "normal" : "bold",
|
|
7124
7428
|
detail,
|
|
7125
|
-
prop:
|
|
7429
|
+
prop: chunkXJ4W6TW4_cjs.seriesLabelProp(series.id)
|
|
7126
7430
|
};
|
|
7127
7431
|
const valueText = {
|
|
7128
7432
|
type: "text",
|
|
@@ -7132,10 +7436,10 @@ function createWedgeLabel(context, geometry, angles, series, value, fillColor) {
|
|
|
7132
7436
|
y: valueY,
|
|
7133
7437
|
height: valueSize * 1.2,
|
|
7134
7438
|
fontSize: valueSize,
|
|
7135
|
-
lines: [
|
|
7439
|
+
lines: [chunkXJ4W6TW4_cjs.formatFieldValue(value)],
|
|
7136
7440
|
fontWeight: valueFirst ? "bold" : "normal",
|
|
7137
7441
|
detail,
|
|
7138
|
-
prop:
|
|
7442
|
+
prop: chunkXJ4W6TW4_cjs.seriesValueProp(series.id, 0),
|
|
7139
7443
|
propKind: "value"
|
|
7140
7444
|
};
|
|
7141
7445
|
return [tick, nameText, valueText];
|
|
@@ -7153,10 +7457,10 @@ function radarFrameFor(context) {
|
|
|
7153
7457
|
return {
|
|
7154
7458
|
centerX: plot.x + plot.width / 2,
|
|
7155
7459
|
centerY: plot.y + plot.height / 2,
|
|
7156
|
-
radius:
|
|
7460
|
+
radius: chunkXJ4W6TW4_cjs.radarRadius(plot.width, plot.height, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12), context.showLabels),
|
|
7157
7461
|
min: chart.axisY.min,
|
|
7158
7462
|
max: chart.axisY.max,
|
|
7159
|
-
count:
|
|
7463
|
+
count: chunkXJ4W6TW4_cjs.radarCategoryCount(configuredCount, dataCount),
|
|
7160
7464
|
curved: chart.chartType === "radial",
|
|
7161
7465
|
tension: chart.config?.radarTension
|
|
7162
7466
|
};
|
|
@@ -7166,7 +7470,7 @@ function createRadarGeometry(context) {
|
|
|
7166
7470
|
const configuredCategories = chart.config?.categories?.filter(Boolean) ?? [];
|
|
7167
7471
|
const frame = radarFrameFor(context);
|
|
7168
7472
|
const categories = createCategories(configuredCategories, frame.count);
|
|
7169
|
-
const pointAt = (pointRadius, pointIndex) =>
|
|
7473
|
+
const pointAt = (pointRadius, pointIndex) => chunkXJ4W6TW4_cjs.radarPointAt(frame, pointIndex, pointRadius);
|
|
7170
7474
|
return {
|
|
7171
7475
|
circular: frame.curved,
|
|
7172
7476
|
areaOpacity: Math.max(0, Math.min(1, chart.config?.areaOpacity ?? 0.16)),
|
|
@@ -7178,9 +7482,9 @@ function createRadarGeometry(context) {
|
|
|
7178
7482
|
centerX: frame.centerX,
|
|
7179
7483
|
centerY: frame.centerY,
|
|
7180
7484
|
radius: frame.radius,
|
|
7181
|
-
radiusForValue: (value) =>
|
|
7485
|
+
radiusForValue: (value) => chunkXJ4W6TW4_cjs.radarRadiusForValue(frame, value),
|
|
7182
7486
|
pointAt,
|
|
7183
|
-
polygonPath: (pointRadius) =>
|
|
7487
|
+
polygonPath: (pointRadius) => chunkXJ4W6TW4_cjs.radarSeriesPath(
|
|
7184
7488
|
categories.map((_, index) => pointAt(pointRadius, index)),
|
|
7185
7489
|
false
|
|
7186
7490
|
)
|
|
@@ -7201,7 +7505,7 @@ function renderRadarGrid(context, geometry) {
|
|
|
7201
7505
|
return [...renderRings(context, geometry), ...geometry.showSpokes ? renderSpokes(context, geometry) : []];
|
|
7202
7506
|
}
|
|
7203
7507
|
function renderRings(context, geometry) {
|
|
7204
|
-
return
|
|
7508
|
+
return chunkXJ4W6TW4_cjs.chartTicks(context.chart.axisY).filter((tick) => tick > context.chart.axisY.min).map((tick) => createRingNode(context, geometry, tick));
|
|
7205
7509
|
}
|
|
7206
7510
|
function createRingNode(context, geometry, tick) {
|
|
7207
7511
|
const { chart, bounds, nextOrder } = context;
|
|
@@ -7209,7 +7513,7 @@ function createRingNode(context, geometry, tick) {
|
|
|
7209
7513
|
const style = {
|
|
7210
7514
|
fill: { kind: "none" },
|
|
7211
7515
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
7212
|
-
strokeWidth:
|
|
7516
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1)
|
|
7213
7517
|
};
|
|
7214
7518
|
if (geometry.circular) {
|
|
7215
7519
|
return {
|
|
@@ -7246,7 +7550,7 @@ function renderSpokes(context, geometry) {
|
|
|
7246
7550
|
style: {
|
|
7247
7551
|
fill: { kind: "none" },
|
|
7248
7552
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
7249
|
-
strokeWidth:
|
|
7553
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1)
|
|
7250
7554
|
}
|
|
7251
7555
|
};
|
|
7252
7556
|
});
|
|
@@ -7266,7 +7570,7 @@ function createCategoryLabel(context, geometry, category, categoryIndex) {
|
|
|
7266
7570
|
const labelPoint = geometry.pointAt(geometry.radius + 10, categoryIndex);
|
|
7267
7571
|
const horizontalOffset = labelPoint.x - geometry.centerX;
|
|
7268
7572
|
const width = Math.max(64, Math.min(120, plot.width / 3));
|
|
7269
|
-
return
|
|
7573
|
+
return chunkXJ4W6TW4_cjs.chartText({
|
|
7270
7574
|
id: `chart-radar-label-${chart.id}-${categoryIndex}`,
|
|
7271
7575
|
order: nextOrder(),
|
|
7272
7576
|
bounds,
|
|
@@ -7304,9 +7608,9 @@ function renderRadarSeries(context, geometry) {
|
|
|
7304
7608
|
return nodes;
|
|
7305
7609
|
}
|
|
7306
7610
|
function renderSeries(context, geometry, series, seriesIndex) {
|
|
7307
|
-
const color = series.color ??
|
|
7611
|
+
const color = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
7308
7612
|
const points = seriesPoints(series, context, geometry);
|
|
7309
|
-
const path =
|
|
7613
|
+
const path = chunkXJ4W6TW4_cjs.radarSeriesPath(points, geometry.circular, geometry.tension);
|
|
7310
7614
|
return [
|
|
7311
7615
|
createSeriesFill(context, geometry, series, path, color),
|
|
7312
7616
|
...geometry.strokeWidth > 0 ? [createSeriesStroke(context, geometry, series, path, color)] : [],
|
|
@@ -7329,7 +7633,7 @@ function createSeriesFill(context, geometry, series, path, color) {
|
|
|
7329
7633
|
d: path,
|
|
7330
7634
|
detail: { of: "chartSeries", series: series.id },
|
|
7331
7635
|
style: {
|
|
7332
|
-
fill:
|
|
7636
|
+
fill: chunkXJ4W6TW4_cjs.paint(color, diagnostics, chart.id),
|
|
7333
7637
|
stroke: { kind: "none" },
|
|
7334
7638
|
opacity: Math.max(0, Math.min(1, series.opacity ?? geometry.areaOpacity))
|
|
7335
7639
|
}
|
|
@@ -7346,10 +7650,10 @@ function createSeriesStroke(context, geometry, series, path, color) {
|
|
|
7346
7650
|
detail: { of: "chartSeries", series: series.id },
|
|
7347
7651
|
style: {
|
|
7348
7652
|
fill: { kind: "none" },
|
|
7349
|
-
stroke:
|
|
7653
|
+
stroke: chunkXJ4W6TW4_cjs.paint(color, diagnostics, chart.id),
|
|
7350
7654
|
strokeWidth: geometry.strokeWidth,
|
|
7351
7655
|
lineJoin: "round",
|
|
7352
|
-
shadow:
|
|
7656
|
+
shadow: chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle)
|
|
7353
7657
|
}
|
|
7354
7658
|
};
|
|
7355
7659
|
}
|
|
@@ -7365,8 +7669,8 @@ function createSeriesPoints(context, geometry, series, points, color) {
|
|
|
7365
7669
|
rx: geometry.pointSize,
|
|
7366
7670
|
ry: geometry.pointSize,
|
|
7367
7671
|
detail: { of: "chartValue", series: series.id, valueIndex: pointIndex, mark: "radar-vertex" },
|
|
7368
|
-
prop:
|
|
7369
|
-
style: { fill:
|
|
7672
|
+
prop: chunkXJ4W6TW4_cjs.seriesValueProp(series.id, pointIndex),
|
|
7673
|
+
style: { fill: chunkXJ4W6TW4_cjs.paint(color, diagnostics, chart.id) }
|
|
7370
7674
|
}));
|
|
7371
7675
|
}
|
|
7372
7676
|
|
|
@@ -7420,25 +7724,25 @@ function ringProgressPath(cx, cy, r, sweep, from) {
|
|
|
7420
7724
|
}
|
|
7421
7725
|
function layoutOf2(context) {
|
|
7422
7726
|
const { chart, plot } = context;
|
|
7423
|
-
const axisMin =
|
|
7727
|
+
const axisMin = chunkXJ4W6TW4_cjs.finite(chart.axisY.min, 0);
|
|
7424
7728
|
return {
|
|
7425
7729
|
centerX: plot.x + plot.width / 2,
|
|
7426
7730
|
centerY: plot.y + plot.height / 2,
|
|
7427
7731
|
outerRadius: Math.max(1, Math.min(plot.width, plot.height) / 2 - 4),
|
|
7428
|
-
ringThickness: Math.max(1,
|
|
7429
|
-
ringGap: Math.max(0,
|
|
7732
|
+
ringThickness: Math.max(1, chunkXJ4W6TW4_cjs.finite(chart.config?.ringThickness, DEFAULT_RING_THICKNESS)),
|
|
7733
|
+
ringGap: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.ringGap, DEFAULT_RING_GAP)),
|
|
7430
7734
|
axisMin,
|
|
7431
|
-
range:
|
|
7432
|
-
start: TOP3 +
|
|
7433
|
-
total: Math.min(360, Math.max(1,
|
|
7434
|
-
trackOpacity: Math.min(1, Math.max(0,
|
|
7735
|
+
range: chunkXJ4W6TW4_cjs.finite(chart.axisY.max, 100) - axisMin,
|
|
7736
|
+
start: TOP3 + chunkXJ4W6TW4_cjs.finite(chart.config?.ringStartAngle, 0) * Math.PI / 180,
|
|
7737
|
+
total: Math.min(360, Math.max(1, chunkXJ4W6TW4_cjs.finite(chart.config?.ringSweep, 360))) * Math.PI / 180,
|
|
7738
|
+
trackOpacity: Math.min(1, Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.ringTrackOpacity, TRACK_OPACITY))),
|
|
7435
7739
|
cap: chart.config?.ringCap ?? "round"
|
|
7436
7740
|
};
|
|
7437
7741
|
}
|
|
7438
7742
|
function ringEndShadows(context, layout, series, radius, sweep, color) {
|
|
7439
7743
|
const { chart, bounds, nextOrder } = context;
|
|
7440
7744
|
const { centerX, centerY, ringThickness, start } = layout;
|
|
7441
|
-
const shadow =
|
|
7745
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
7442
7746
|
const isFullCircle = sweep >= Math.PI * 2 - FULL_SWEEP_EPSILON;
|
|
7443
7747
|
if (!shadow || isFullCircle) {
|
|
7444
7748
|
return [];
|
|
@@ -7476,8 +7780,8 @@ function ringNodes2(context, layout, series, index) {
|
|
|
7476
7780
|
if (radius <= ringThickness / 2) {
|
|
7477
7781
|
return [];
|
|
7478
7782
|
}
|
|
7479
|
-
const color =
|
|
7480
|
-
const value = Math.max(0,
|
|
7783
|
+
const color = chunkXJ4W6TW4_cjs.paint(series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[index % chunkXJ4W6TW4_cjs.CHART_COLORS.length], diagnostics, chart.id);
|
|
7784
|
+
const value = Math.max(0, chunkXJ4W6TW4_cjs.finite(series.values[0], 0));
|
|
7481
7785
|
const fraction = range > 0 ? Math.min(1, Math.max(0, (value - axisMin) / range)) : 0;
|
|
7482
7786
|
const trackStyle = {
|
|
7483
7787
|
fill: { kind: "none" },
|
|
@@ -7515,7 +7819,7 @@ function ringNodes2(context, layout, series, index) {
|
|
|
7515
7819
|
bounds,
|
|
7516
7820
|
d: ringProgressPath(centerX, centerY, radius, sweep, start),
|
|
7517
7821
|
detail: { of: "chartValue", series: series.id, valueIndex: 0, mark: "radial-bar-ring" },
|
|
7518
|
-
prop:
|
|
7822
|
+
prop: chunkXJ4W6TW4_cjs.seriesValueProp(series.id, 0),
|
|
7519
7823
|
style: { fill: { kind: "none" }, stroke: color, strokeWidth: ringThickness, lineCap: cap }
|
|
7520
7824
|
};
|
|
7521
7825
|
return [track, ...casters, progress];
|
|
@@ -7527,7 +7831,7 @@ function renderRadialBar(context) {
|
|
|
7527
7831
|
|
|
7528
7832
|
// src/renderScene/charts/renderers/sankey/links.ts
|
|
7529
7833
|
function renderSankeyLinks(context, data) {
|
|
7530
|
-
const shadow =
|
|
7834
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(context.chart.shadowStyle);
|
|
7531
7835
|
const gradient = Boolean(context.chart.config?.linkGradient);
|
|
7532
7836
|
const { plot } = context;
|
|
7533
7837
|
const clipPath = shadow ? `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z` : void 0;
|
|
@@ -7548,8 +7852,8 @@ function createSankeyLinkRibbon(context, data, link, linkIndex, gradient) {
|
|
|
7548
7852
|
bottom: data.baseY + link.targetY1
|
|
7549
7853
|
};
|
|
7550
7854
|
const config = context.chart.config;
|
|
7551
|
-
const fromColor = link.color || data.nodeColors.get(link.source) ||
|
|
7552
|
-
const toColor = data.nodeColors.get(link.target) ||
|
|
7855
|
+
const fromColor = link.color || data.nodeColors.get(link.source) || chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL;
|
|
7856
|
+
const toColor = data.nodeColors.get(link.target) || chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL;
|
|
7553
7857
|
const fill2 = gradient ? {
|
|
7554
7858
|
kind: "linear-gradient",
|
|
7555
7859
|
angle: 0,
|
|
@@ -7564,9 +7868,9 @@ function createSankeyLinkRibbon(context, data, link, linkIndex, gradient) {
|
|
|
7564
7868
|
toId: link.target,
|
|
7565
7869
|
source,
|
|
7566
7870
|
target,
|
|
7567
|
-
controlX: source.x + (target.x - source.x) * Math.min(1, Math.max(0,
|
|
7871
|
+
controlX: source.x + (target.x - source.x) * Math.min(1, Math.max(0, chunkXJ4W6TW4_cjs.finite(config?.sankeyLinkCurve, 0.5))),
|
|
7568
7872
|
fill: fill2,
|
|
7569
|
-
opacity: Math.min(1, Math.max(0,
|
|
7873
|
+
opacity: Math.min(1, Math.max(0, chunkXJ4W6TW4_cjs.finite(config?.sankeyLinkOpacity, link.color ? 0.85 : 0.45)))
|
|
7570
7874
|
};
|
|
7571
7875
|
}
|
|
7572
7876
|
function createSankeyRibbonNode(context, ribbon, shadow, clipPath, gradient) {
|
|
@@ -7607,7 +7911,7 @@ function sankeyRibbonPath(ribbon) {
|
|
|
7607
7911
|
var OUTSIDE_LABEL_LIGHTNESS_ON_LIGHT_BG = 0.3;
|
|
7608
7912
|
var OUTSIDE_LABEL_LIGHTNESS_ON_DARK_BG = 0.78;
|
|
7609
7913
|
function renderSankeyNodes(context, data) {
|
|
7610
|
-
const cornerRadius = Math.max(0,
|
|
7914
|
+
const cornerRadius = Math.max(0, chunkXJ4W6TW4_cjs.finite(context.chart.config?.barCornerRadius, 0));
|
|
7611
7915
|
const nodes = [];
|
|
7612
7916
|
data.nodes.forEach((node) => {
|
|
7613
7917
|
nodes.push(createNodeRect(context, data, node, cornerRadius));
|
|
@@ -7623,8 +7927,8 @@ function createNodeRect(context, data, node, cornerRadius) {
|
|
|
7623
7927
|
const x = data.baseX + node.x;
|
|
7624
7928
|
const y = data.baseY + node.y;
|
|
7625
7929
|
const style = {
|
|
7626
|
-
fill: { kind: "solid", color: node.color ||
|
|
7627
|
-
shadow:
|
|
7930
|
+
fill: { kind: "solid", color: node.color || chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL },
|
|
7931
|
+
shadow: chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle)
|
|
7628
7932
|
};
|
|
7629
7933
|
const isFirstColumn = node.column === 0;
|
|
7630
7934
|
const isLastColumn = node.column === data.columnCount - 1;
|
|
@@ -7650,7 +7954,7 @@ function createNodeRect(context, data, node, cornerRadius) {
|
|
|
7650
7954
|
id: `chart-sankey-node-${chart.id}-${node.id}`,
|
|
7651
7955
|
order: nextOrder(),
|
|
7652
7956
|
bounds,
|
|
7653
|
-
d:
|
|
7957
|
+
d: chunkXJ4W6TW4_cjs.leftRoundedRectPath(x, y, node.width, node.height, cornerRadius),
|
|
7654
7958
|
style,
|
|
7655
7959
|
detail
|
|
7656
7960
|
};
|
|
@@ -7661,7 +7965,7 @@ function createNodeRect(context, data, node, cornerRadius) {
|
|
|
7661
7965
|
id: `chart-sankey-node-${chart.id}-${node.id}`,
|
|
7662
7966
|
order: nextOrder(),
|
|
7663
7967
|
bounds,
|
|
7664
|
-
d:
|
|
7968
|
+
d: chunkXJ4W6TW4_cjs.rightRoundedRectPath(x, y, node.width, node.height, cornerRadius),
|
|
7665
7969
|
style,
|
|
7666
7970
|
detail
|
|
7667
7971
|
};
|
|
@@ -7687,9 +7991,9 @@ function createNodeLabel(context, data, node) {
|
|
|
7687
7991
|
return void 0;
|
|
7688
7992
|
}
|
|
7689
7993
|
const fallback = chart.textColor ?? "#0f172a";
|
|
7690
|
-
const defaultColor = position === "inside" ?
|
|
7994
|
+
const defaultColor = position === "inside" ? chunkXJ4W6TW4_cjs.contrastTextColor(node.color) : chunkXJ4W6TW4_cjs.sameHueTint(
|
|
7691
7995
|
node.color,
|
|
7692
|
-
|
|
7996
|
+
chunkXJ4W6TW4_cjs.isLightColor(fallback) ? OUTSIDE_LABEL_LIGHTNESS_ON_DARK_BG : OUTSIDE_LABEL_LIGHTNESS_ON_LIGHT_BG
|
|
7693
7997
|
) ?? fallback;
|
|
7694
7998
|
const color = chart.config?.labelColor ?? defaultColor;
|
|
7695
7999
|
return { ...label, color, detail: { of: "chartSeries", series: node.id, mark: "sankey-node-label" } };
|
|
@@ -7701,7 +8005,7 @@ function createOutsideLabel(context, data, node) {
|
|
|
7701
8005
|
const y = data.baseY + node.y;
|
|
7702
8006
|
const labelX2 = isLastColumn ? x - data.labelGutter + 8 : x + node.width + 6;
|
|
7703
8007
|
return {
|
|
7704
|
-
...
|
|
8008
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
7705
8009
|
id: `chart-sankey-label-${chart.id}-${node.id}`,
|
|
7706
8010
|
order: nextOrder(),
|
|
7707
8011
|
bounds,
|
|
@@ -7726,11 +8030,11 @@ function createInsideLabel(context, data, node, orientation) {
|
|
|
7726
8030
|
if (orientation === "vertical") {
|
|
7727
8031
|
const thickness = fontSize * 1.4;
|
|
7728
8032
|
const width = Math.max(1, node.height - 8);
|
|
7729
|
-
if (
|
|
8033
|
+
if (chunkXJ4W6TW4_cjs.estimateTextWidth(node.label, fontSize, false) > width) {
|
|
7730
8034
|
return void 0;
|
|
7731
8035
|
}
|
|
7732
8036
|
return {
|
|
7733
|
-
...
|
|
8037
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
7734
8038
|
id,
|
|
7735
8039
|
order: nextOrder(),
|
|
7736
8040
|
bounds,
|
|
@@ -7747,7 +8051,7 @@ function createInsideLabel(context, data, node, orientation) {
|
|
|
7747
8051
|
};
|
|
7748
8052
|
}
|
|
7749
8053
|
return {
|
|
7750
|
-
...
|
|
8054
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
7751
8055
|
id,
|
|
7752
8056
|
order: nextOrder(),
|
|
7753
8057
|
bounds,
|
|
@@ -7768,18 +8072,18 @@ function createSankeyRenderData(context) {
|
|
|
7768
8072
|
const labelGutter = showLabels ? 92 : 0;
|
|
7769
8073
|
const availableWidth = Math.max(1, plot.width - labelGutter * 2);
|
|
7770
8074
|
const layout = layoutSankey(createNodeInputs(context), createLinkInputs(context), availableWidth, plot.height, {
|
|
7771
|
-
nodeWidth: Math.max(1,
|
|
7772
|
-
nodeGap: Math.max(0,
|
|
8075
|
+
nodeWidth: Math.max(1, chunkXJ4W6TW4_cjs.finite(chart.config?.sankeyNodeWidth, 18)),
|
|
8076
|
+
nodeGap: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.sankeyNodeGap, 8))
|
|
7773
8077
|
});
|
|
7774
8078
|
return {
|
|
7775
8079
|
...layout,
|
|
7776
8080
|
baseX: plot.x + labelGutter,
|
|
7777
8081
|
baseY: plot.y,
|
|
7778
8082
|
labelGutter,
|
|
7779
|
-
fontSize: Math.max(9,
|
|
7780
|
-
labelSize: Math.max(6,
|
|
8083
|
+
fontSize: Math.max(9, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12)),
|
|
8084
|
+
labelSize: Math.max(6, chunkXJ4W6TW4_cjs.finite(chart.config?.sankeyLabelSize, Math.max(9, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12)) - 2)),
|
|
7781
8085
|
columnCount: Math.max(1, ...layout.nodes.map((node) => node.column + 1)),
|
|
7782
|
-
nodeColors: new Map(layout.nodes.map((node) => [node.id, node.color ||
|
|
8086
|
+
nodeColors: new Map(layout.nodes.map((node) => [node.id, node.color || chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL]))
|
|
7783
8087
|
};
|
|
7784
8088
|
}
|
|
7785
8089
|
function createNodeInputs(context) {
|
|
@@ -7801,7 +8105,7 @@ function createLinkInputs(context) {
|
|
|
7801
8105
|
source: series.source,
|
|
7802
8106
|
target: series.target,
|
|
7803
8107
|
value: series.values[0] ?? 0,
|
|
7804
|
-
color: series.color ?
|
|
8108
|
+
color: series.color ? chunkXJ4W6TW4_cjs.representativeColor(series.color, chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL) : void 0
|
|
7805
8109
|
});
|
|
7806
8110
|
});
|
|
7807
8111
|
return inputs;
|
|
@@ -7820,9 +8124,9 @@ function renderSankey(context) {
|
|
|
7820
8124
|
var DEFAULT_POINT_SIZE = 4;
|
|
7821
8125
|
function renderScatter(context) {
|
|
7822
8126
|
const nodes = [];
|
|
7823
|
-
const shadow =
|
|
8127
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(context.chart.shadowStyle);
|
|
7824
8128
|
context.chart.series.forEach((series, seriesIndex) => {
|
|
7825
|
-
const color = series.color ??
|
|
8129
|
+
const color = series.color ?? chunkXJ4W6TW4_cjs.CHART_COLORS[seriesIndex % chunkXJ4W6TW4_cjs.CHART_COLORS.length];
|
|
7826
8130
|
const points = pixelPoints(context, seriesValuePairs(context.chart, series));
|
|
7827
8131
|
points.forEach((point, pointIndex) => {
|
|
7828
8132
|
nodes.push(createScatterPoint(context, series, point, pointIndex, color, shadow));
|
|
@@ -7846,8 +8150,8 @@ function createScatterPoint(context, series, point, pointIndex, color, shadow) {
|
|
|
7846
8150
|
ry: radius,
|
|
7847
8151
|
detail: { of: "chartValue", series: series.id, valueIndex: pointIndex },
|
|
7848
8152
|
style: {
|
|
7849
|
-
fill:
|
|
7850
|
-
stroke: strokeWidth > 0 ?
|
|
8153
|
+
fill: chunkXJ4W6TW4_cjs.paint(color, diagnostics, chart.id),
|
|
8154
|
+
stroke: strokeWidth > 0 ? chunkXJ4W6TW4_cjs.paint(config?.pointStrokeColor ?? color, diagnostics, chart.id) : void 0,
|
|
7851
8155
|
strokeWidth: strokeWidth > 0 ? strokeWidth : void 0,
|
|
7852
8156
|
opacity: config?.pointOpacity,
|
|
7853
8157
|
shadow
|
|
@@ -7858,14 +8162,14 @@ function createScatterPoint(context, series, point, pointIndex, color, shadow) {
|
|
|
7858
8162
|
// src/renderScene/charts/renderers/treemap/layout.ts
|
|
7859
8163
|
function createTreemapLayout(context) {
|
|
7860
8164
|
const { chart, plot, showLegend } = context;
|
|
7861
|
-
const fontSize = Math.max(9,
|
|
8165
|
+
const fontSize = Math.max(9, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12));
|
|
7862
8166
|
const legendPosition = chart.legendPosition === "left" ? "left" : chart.legendPosition === "right" ? "right" : "bottom";
|
|
7863
8167
|
const legendHeight = showLegend && legendPosition === "bottom" ? 48 : 0;
|
|
7864
|
-
const cellGap = Math.max(0,
|
|
8168
|
+
const cellGap = Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.cellGap, 0));
|
|
7865
8169
|
return {
|
|
7866
8170
|
leaves: chart.series,
|
|
7867
|
-
bands:
|
|
7868
|
-
zones: chart.config?.zones?.length ? chart.config.zones :
|
|
8171
|
+
bands: chunkXJ4W6TW4_cjs.axisBands(chart.axisY),
|
|
8172
|
+
zones: chart.config?.zones?.length ? chart.config.zones : chunkXJ4W6TW4_cjs.DEFAULT_HEATMAP_ZONES,
|
|
7869
8173
|
fontSize,
|
|
7870
8174
|
smallFontSize: Math.max(8, fontSize - 1),
|
|
7871
8175
|
legendPosition,
|
|
@@ -7873,18 +8177,18 @@ function createTreemapLayout(context) {
|
|
|
7873
8177
|
gridWidth: Math.max(1, plot.width),
|
|
7874
8178
|
gridHeight: Math.max(1, plot.height - legendHeight),
|
|
7875
8179
|
cellGap,
|
|
7876
|
-
cellRadius: Math.max(0,
|
|
7877
|
-
headerHeight: Math.max(0,
|
|
7878
|
-
labelSize: Math.max(6,
|
|
7879
|
-
valueSize: Math.max(6,
|
|
7880
|
-
labelPadding: Math.max(0,
|
|
8180
|
+
cellRadius: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.barCornerRadius, cellGap)),
|
|
8181
|
+
headerHeight: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.headerHeight, 20)),
|
|
8182
|
+
labelSize: Math.max(6, chunkXJ4W6TW4_cjs.finite(chart.config?.tileLabelSize, Math.max(8, fontSize - 1))),
|
|
8183
|
+
valueSize: Math.max(6, chunkXJ4W6TW4_cjs.finite(chart.config?.tileValueSize, Math.max(8, fontSize - 1))),
|
|
8184
|
+
labelPadding: Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.tileLabelPadding, 4))
|
|
7881
8185
|
};
|
|
7882
8186
|
}
|
|
7883
8187
|
function treemapLeafValue(leaf) {
|
|
7884
8188
|
return leaf.values[0] ?? 0;
|
|
7885
8189
|
}
|
|
7886
8190
|
function treemapLeafColor(leaf, layout) {
|
|
7887
|
-
return leaf.color ??
|
|
8191
|
+
return leaf.color ?? chunkXJ4W6TW4_cjs.zoneColorAtValue(treemapLeafValue(leaf), layout.bands, layout.zones);
|
|
7888
8192
|
}
|
|
7889
8193
|
|
|
7890
8194
|
// src/renderScene/charts/renderers/treemap/legend.ts
|
|
@@ -7909,7 +8213,7 @@ function bandStops(layout) {
|
|
|
7909
8213
|
const zones = layout.zones.slice(0, bandCount);
|
|
7910
8214
|
return zones.map((zone, index) => ({
|
|
7911
8215
|
offset: bandRatio2(layout, layout.bands[index + 1] ?? layout.bands[layout.bands.length - 1]) * 100,
|
|
7912
|
-
color: zone.color ??
|
|
8216
|
+
color: zone.color ?? chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL
|
|
7913
8217
|
}));
|
|
7914
8218
|
}
|
|
7915
8219
|
function renderBottomLegend(context, layout) {
|
|
@@ -7918,7 +8222,7 @@ function renderBottomLegend(context, layout) {
|
|
|
7918
8222
|
const barWidth = layout.gridWidth;
|
|
7919
8223
|
const labelHeight = layout.fontSize + 2;
|
|
7920
8224
|
const barY = plot.y + layout.gridHeight + CHART_GAP;
|
|
7921
|
-
const barBounds =
|
|
8225
|
+
const barBounds = chunkXJ4W6TW4_cjs.boxBounds({ x: barX, y: barY, width: barWidth, height: BAR_THICKNESS });
|
|
7922
8226
|
const stops = bandStops(layout);
|
|
7923
8227
|
const bar = {
|
|
7924
8228
|
type: "rect",
|
|
@@ -7932,7 +8236,7 @@ function renderBottomLegend(context, layout) {
|
|
|
7932
8236
|
rx: 3,
|
|
7933
8237
|
zoneGradient: { axis: "y", min: chart.axisY.min, max: chart.axisY.max },
|
|
7934
8238
|
style: {
|
|
7935
|
-
fill: stops.length ? { kind: "linear-gradient", angle: 0, stops } : { kind: "solid", color:
|
|
8239
|
+
fill: stops.length ? { kind: "linear-gradient", angle: 0, stops } : { kind: "solid", color: chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL },
|
|
7936
8240
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
7937
8241
|
strokeWidth: 1
|
|
7938
8242
|
}
|
|
@@ -7955,12 +8259,12 @@ function renderBottomLegend(context, layout) {
|
|
|
7955
8259
|
const isLast = index === layout.bands.length - 1;
|
|
7956
8260
|
const align = isFirst ? "left" : isLast ? "right" : "center";
|
|
7957
8261
|
const frameX = isFirst ? x : isLast ? x - LABEL_SIZE : x - LABEL_SIZE / 2;
|
|
7958
|
-
const label =
|
|
8262
|
+
const label = chunkXJ4W6TW4_cjs.chartText({
|
|
7959
8263
|
id: `chart-treemap-legend-tick-label-${chart.id}-${index}`,
|
|
7960
8264
|
order: nextOrder(),
|
|
7961
8265
|
bounds,
|
|
7962
8266
|
frame: { x: frameX, y: barY + BAR_THICKNESS + TICK_LENGTH + ROW_GAP2, width: LABEL_SIZE, height: labelHeight },
|
|
7963
|
-
text:
|
|
8267
|
+
text: chunkXJ4W6TW4_cjs.formatFieldValue(value),
|
|
7964
8268
|
chart,
|
|
7965
8269
|
align
|
|
7966
8270
|
});
|
|
@@ -7974,7 +8278,7 @@ function renderSideLegend(context, layout) {
|
|
|
7974
8278
|
const barTop = plot.y;
|
|
7975
8279
|
const barHeight = layout.gridHeight;
|
|
7976
8280
|
const barX = side === "left" ? plot.x - CHART_GAP - BAR_THICKNESS : plot.x + layout.gridWidth + CHART_GAP;
|
|
7977
|
-
const barBounds =
|
|
8281
|
+
const barBounds = chunkXJ4W6TW4_cjs.boxBounds({ x: barX, y: barTop, width: BAR_THICKNESS, height: barHeight });
|
|
7978
8282
|
const stops = bandStops(layout);
|
|
7979
8283
|
const bar = {
|
|
7980
8284
|
type: "rect",
|
|
@@ -7988,7 +8292,7 @@ function renderSideLegend(context, layout) {
|
|
|
7988
8292
|
rx: 3,
|
|
7989
8293
|
zoneGradient: { axis: "y", min: chart.axisY.min, max: chart.axisY.max },
|
|
7990
8294
|
style: {
|
|
7991
|
-
fill: stops.length ? { kind: "linear-gradient", angle: 270, stops } : { kind: "solid", color:
|
|
8295
|
+
fill: stops.length ? { kind: "linear-gradient", angle: 270, stops } : { kind: "solid", color: chunkXJ4W6TW4_cjs.DEFAULT_ZONE_FILL },
|
|
7992
8296
|
stroke: { kind: "solid", color: chart.gridColor ?? "#e2e8f0" },
|
|
7993
8297
|
strokeWidth: 1
|
|
7994
8298
|
}
|
|
@@ -8010,12 +8314,12 @@ function renderSideLegend(context, layout) {
|
|
|
8010
8314
|
strokeWidth: 1
|
|
8011
8315
|
}
|
|
8012
8316
|
};
|
|
8013
|
-
const label =
|
|
8317
|
+
const label = chunkXJ4W6TW4_cjs.chartText({
|
|
8014
8318
|
id: `chart-treemap-legend-tick-label-${chart.id}-${index}`,
|
|
8015
8319
|
order: nextOrder(),
|
|
8016
8320
|
bounds,
|
|
8017
8321
|
frame: { x: labelX2, y: y - layout.fontSize / 2, width: LABEL_SIZE, height: layout.fontSize + 2 },
|
|
8018
|
-
text:
|
|
8322
|
+
text: chunkXJ4W6TW4_cjs.formatFieldValue(value),
|
|
8019
8323
|
chart,
|
|
8020
8324
|
align: side === "left" ? "right" : "left"
|
|
8021
8325
|
});
|
|
@@ -8103,7 +8407,7 @@ function renderTreemapHeader(context, layout, header, index) {
|
|
|
8103
8407
|
};
|
|
8104
8408
|
const smallFontSize = Math.max(8, Math.max(9, chart.fontSize ?? 12) - 1);
|
|
8105
8409
|
const label = {
|
|
8106
|
-
...
|
|
8410
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
8107
8411
|
id: `chart-treemap-header-label-${chart.id}-${index}`,
|
|
8108
8412
|
order: nextOrder(),
|
|
8109
8413
|
bounds,
|
|
@@ -8118,7 +8422,7 @@ function renderTreemapHeader(context, layout, header, index) {
|
|
|
8118
8422
|
align: "center"
|
|
8119
8423
|
}),
|
|
8120
8424
|
fontSize: smallFontSize,
|
|
8121
|
-
color:
|
|
8425
|
+
color: chunkXJ4W6TW4_cjs.contrastTextColor(fill2)
|
|
8122
8426
|
};
|
|
8123
8427
|
return [background, label];
|
|
8124
8428
|
}
|
|
@@ -8134,7 +8438,7 @@ function renderTile(context, layout, tile, nextTile) {
|
|
|
8134
8438
|
function createTileNode(context, layout, tile, color, nextColor) {
|
|
8135
8439
|
const { chart, plot, bounds, diagnostics, nextOrder } = context;
|
|
8136
8440
|
const gap = layout.cellGap;
|
|
8137
|
-
const shadow =
|
|
8441
|
+
const shadow = chunkXJ4W6TW4_cjs.resolveChartShadow(chart.shadowStyle);
|
|
8138
8442
|
const clipPath = shadow ? `M ${plot.x} ${plot.y} H ${plot.x + plot.width} V ${plot.y + plot.height} H ${plot.x} Z` : void 0;
|
|
8139
8443
|
const tileX = plot.x + tile.x + gap / 2;
|
|
8140
8444
|
const tileY = plot.y + tile.y + gap / 2;
|
|
@@ -8151,10 +8455,10 @@ function createTileNode(context, layout, tile, color, nextColor) {
|
|
|
8151
8455
|
kind: "linear-gradient",
|
|
8152
8456
|
angle: 0,
|
|
8153
8457
|
stops: [
|
|
8154
|
-
{ offset: 0, color:
|
|
8155
|
-
{ offset: 100, color:
|
|
8458
|
+
{ offset: 0, color: chunkXJ4W6TW4_cjs.representativeColor(color, fallback) },
|
|
8459
|
+
{ offset: 100, color: chunkXJ4W6TW4_cjs.representativeColor(nextColor, fallback) }
|
|
8156
8460
|
]
|
|
8157
|
-
} :
|
|
8461
|
+
} : chunkXJ4W6TW4_cjs.paint(color, diagnostics, chart.id);
|
|
8158
8462
|
return {
|
|
8159
8463
|
type: "rect",
|
|
8160
8464
|
id: `chart-treemap-tile-${chart.id}-${tile.item.leaf.id}`,
|
|
@@ -8168,7 +8472,7 @@ function createTileNode(context, layout, tile, color, nextColor) {
|
|
|
8168
8472
|
style: {
|
|
8169
8473
|
fill: fill2,
|
|
8170
8474
|
stroke: { kind: "solid", color: chart.config?.tileStrokeColor ?? chart.gridColor ?? "#e2e8f0" },
|
|
8171
|
-
strokeWidth:
|
|
8475
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.config?.tileStrokeWidth, chunkXJ4W6TW4_cjs.finite(chart.gridWidth, 1)),
|
|
8172
8476
|
shadow,
|
|
8173
8477
|
clip: clipPath ? { type: "path", d: clipPath } : void 0
|
|
8174
8478
|
}
|
|
@@ -8183,12 +8487,12 @@ function createTileLabel(context, layout, tile, color) {
|
|
|
8183
8487
|
const height = Math.max(1, tile.height - gap - pad * 1.5);
|
|
8184
8488
|
const x = plot.x + tile.x + gap / 2 + pad;
|
|
8185
8489
|
const y = plot.y + tile.y + gap / 2 + pad * 0.75;
|
|
8186
|
-
const textColor = chart.config?.tileTextColor ??
|
|
8490
|
+
const textColor = chart.config?.tileTextColor ?? chunkXJ4W6TW4_cjs.contrastTextColor(chunkXJ4W6TW4_cjs.representativeColor(color, "#ffffff"));
|
|
8187
8491
|
const lineHeight = layout.labelSize * 1.2;
|
|
8188
8492
|
const maxLines = Math.max(1, Math.floor(height / lineHeight));
|
|
8189
|
-
const labelLines =
|
|
8493
|
+
const labelLines = chunkXJ4W6TW4_cjs.wrapText(leaf.label, width, layout.labelSize).slice(0, maxLines).map((line) => chunkXJ4W6TW4_cjs.ellipsizeToWidth(line, width, layout.labelSize, true));
|
|
8190
8494
|
const label = {
|
|
8191
|
-
...
|
|
8495
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
8192
8496
|
id: `chart-treemap-label-${chart.id}-${leaf.id}`,
|
|
8193
8497
|
order: nextOrder(),
|
|
8194
8498
|
bounds,
|
|
@@ -8202,12 +8506,12 @@ function createTileLabel(context, layout, tile, color) {
|
|
|
8202
8506
|
color: textColor
|
|
8203
8507
|
};
|
|
8204
8508
|
const valueText = String(value);
|
|
8205
|
-
const valueFits = labelLines.length * lineHeight + layout.valueSize * 1.2 <= height + 2 &&
|
|
8509
|
+
const valueFits = labelLines.length * lineHeight + layout.valueSize * 1.2 <= height + 2 && chunkXJ4W6TW4_cjs.estimateTextWidth(valueText, layout.valueSize, false) <= width;
|
|
8206
8510
|
if (chart.config?.showTileValues === false || !valueFits) {
|
|
8207
8511
|
return [label];
|
|
8208
8512
|
}
|
|
8209
8513
|
const valueNode = {
|
|
8210
|
-
...
|
|
8514
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
8211
8515
|
id: `chart-treemap-value-${chart.id}-${leaf.id}`,
|
|
8212
8516
|
order: nextOrder(),
|
|
8213
8517
|
bounds,
|
|
@@ -8284,7 +8588,7 @@ function buildCartesianChart(foundation) {
|
|
|
8284
8588
|
|
|
8285
8589
|
// src/renderScene/charts/chartFrame.ts
|
|
8286
8590
|
function scaleDetail(chart, plot) {
|
|
8287
|
-
const horizontal =
|
|
8591
|
+
const horizontal = chunkXJ4W6TW4_cjs.isHorizontalBar(chart);
|
|
8288
8592
|
const range = horizontal ? `${plot.x},${plot.width}` : `${plot.y},${plot.height}`;
|
|
8289
8593
|
return {
|
|
8290
8594
|
of: "chartScale",
|
|
@@ -8292,7 +8596,7 @@ function scaleDetail(chart, plot) {
|
|
|
8292
8596
|
};
|
|
8293
8597
|
}
|
|
8294
8598
|
function pieDetail(chart, plot) {
|
|
8295
|
-
const { outerRadius, innerRadius, cornerRadius } =
|
|
8599
|
+
const { outerRadius, innerRadius, cornerRadius } = chunkXJ4W6TW4_cjs.resolvePieRadii(
|
|
8296
8600
|
plot.width,
|
|
8297
8601
|
plot.height,
|
|
8298
8602
|
chart.config?.innerRadius,
|
|
@@ -8305,8 +8609,8 @@ function pieDetail(chart, plot) {
|
|
|
8305
8609
|
}
|
|
8306
8610
|
function polarAreaDetail(chart, plot) {
|
|
8307
8611
|
const maxRadius = Math.max(1, Math.min(plot.width, plot.height) / 2 - 4);
|
|
8308
|
-
const innerRadius = Math.max(0, Math.min(
|
|
8309
|
-
const cornerRadius = Math.max(0,
|
|
8612
|
+
const innerRadius = Math.max(0, Math.min(chunkXJ4W6TW4_cjs.finite(chart.config?.innerRadius, 0), maxRadius - 1));
|
|
8613
|
+
const cornerRadius = Math.max(0, chunkXJ4W6TW4_cjs.finite(chart.config?.pieCornerRadius, 0));
|
|
8310
8614
|
return {
|
|
8311
8615
|
of: "pieGeometry",
|
|
8312
8616
|
pieGeometry: `${plot.x + plot.width / 2},${plot.y + plot.height / 2},${maxRadius},${innerRadius},${cornerRadius}`
|
|
@@ -8315,8 +8619,8 @@ function polarAreaDetail(chart, plot) {
|
|
|
8315
8619
|
function radarDetail(chart, plot) {
|
|
8316
8620
|
const configuredCount = (chart.config?.categories?.filter(Boolean) ?? []).length;
|
|
8317
8621
|
const dataCount = Math.max(0, ...chart.series.map((series) => series.values.length));
|
|
8318
|
-
const count =
|
|
8319
|
-
const radius =
|
|
8622
|
+
const count = chunkXJ4W6TW4_cjs.radarCategoryCount(configuredCount, dataCount);
|
|
8623
|
+
const radius = chunkXJ4W6TW4_cjs.radarRadius(plot.width, plot.height, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12), chart.showAxisLabels !== false);
|
|
8320
8624
|
const centerX = plot.x + plot.width / 2;
|
|
8321
8625
|
const centerY = plot.y + plot.height / 2;
|
|
8322
8626
|
const curved = chart.chartType === "radial" ? 1 : 0;
|
|
@@ -8350,9 +8654,9 @@ function buildChartFrame(chart, bounds, plot, order) {
|
|
|
8350
8654
|
height: chart.height,
|
|
8351
8655
|
rx: chart.cornerRadius ?? 12,
|
|
8352
8656
|
style: {
|
|
8353
|
-
fill:
|
|
8657
|
+
fill: chunkXJ4W6TW4_cjs.paint(chart.fillColor ?? "#ffffff", [], chart.id),
|
|
8354
8658
|
stroke: { kind: "solid", color: chart.strokeColor ?? "#475569" },
|
|
8355
|
-
strokeWidth:
|
|
8659
|
+
strokeWidth: chunkXJ4W6TW4_cjs.finite(chart.strokeWidth, 1)
|
|
8356
8660
|
}
|
|
8357
8661
|
};
|
|
8358
8662
|
const detail = frameDetail(chart, plot);
|
|
@@ -8412,7 +8716,7 @@ function buildChartTitle(chart, bounds, plot, renderOrder) {
|
|
|
8412
8716
|
}
|
|
8413
8717
|
return [
|
|
8414
8718
|
{
|
|
8415
|
-
...
|
|
8719
|
+
...chunkXJ4W6TW4_cjs.chartText({
|
|
8416
8720
|
id: `chart-title-${chart.id}`,
|
|
8417
8721
|
order: renderOrder.next(),
|
|
8418
8722
|
bounds,
|
|
@@ -8422,8 +8726,8 @@ function buildChartTitle(chart, bounds, plot, renderOrder) {
|
|
|
8422
8726
|
}),
|
|
8423
8727
|
...chart.titleColor ? { color: chart.titleColor } : {},
|
|
8424
8728
|
fontWeight: chart.titleWeight ?? "bold",
|
|
8425
|
-
fontSize:
|
|
8426
|
-
prop:
|
|
8729
|
+
fontSize: chunkXJ4W6TW4_cjs.finite(chart.titleSize, Math.max(10, chunkXJ4W6TW4_cjs.finite(chart.fontSize, 12)) + 2),
|
|
8730
|
+
prop: chunkXJ4W6TW4_cjs.CHART_TITLE_PROP
|
|
8427
8731
|
}
|
|
8428
8732
|
];
|
|
8429
8733
|
}
|
|
@@ -8476,14 +8780,14 @@ function buildChart(chart, index, diagnostics) {
|
|
|
8476
8780
|
// src/renderScene/charts/artifacts.ts
|
|
8477
8781
|
function buildCharts(charts, diagnostics) {
|
|
8478
8782
|
return charts.flatMap(
|
|
8479
|
-
(chart, index) =>
|
|
8783
|
+
(chart, index) => chunkXJ4W6TW4_cjs.tag(buildChart(chart, index, diagnostics), "chart", chart.id, chart.chartType, chart.title ?? "Chart")
|
|
8480
8784
|
);
|
|
8481
8785
|
}
|
|
8482
8786
|
|
|
8483
8787
|
// src/renderScene/scene/build.ts
|
|
8484
8788
|
function sceneBounds(nodes) {
|
|
8485
8789
|
if (!nodes.length) {
|
|
8486
|
-
return
|
|
8790
|
+
return chunkXJ4W6TW4_cjs.EMPTY_BOUNDS;
|
|
8487
8791
|
}
|
|
8488
8792
|
return {
|
|
8489
8793
|
minX: Math.min(...nodes.map((n) => n.bounds.minX)),
|
|
@@ -8497,8 +8801,8 @@ function stackingOf(input) {
|
|
|
8497
8801
|
const add = (role, objects, legacyBase) => {
|
|
8498
8802
|
objects.forEach((object, index) => {
|
|
8499
8803
|
stacking.set(`${role}:${object.id}`, {
|
|
8500
|
-
rank:
|
|
8501
|
-
sequence:
|
|
8804
|
+
rank: chunkXJ4W6TW4_cjs.stackRank(object),
|
|
8805
|
+
sequence: chunkXJ4W6TW4_cjs.stackSequence(object, legacyBase + index)
|
|
8502
8806
|
});
|
|
8503
8807
|
});
|
|
8504
8808
|
};
|
|
@@ -8514,6 +8818,7 @@ function stackingOf(input) {
|
|
|
8514
8818
|
);
|
|
8515
8819
|
add("chart", input.charts ?? [], 2e4);
|
|
8516
8820
|
add("path", input.paths ?? [], 3e4);
|
|
8821
|
+
add("dimension", input.dimensions ?? [], 31e3);
|
|
8517
8822
|
return stacking;
|
|
8518
8823
|
}
|
|
8519
8824
|
function stampStacking(nodes, input) {
|
|
@@ -8534,7 +8839,8 @@ function buildRenderScene(input, options = {}) {
|
|
|
8534
8839
|
...buildLinks(input.links, measureText),
|
|
8535
8840
|
...buildShapes(input.shapes, diagnostics, measureText),
|
|
8536
8841
|
...buildComponents(input.components ?? input.widgets ?? []),
|
|
8537
|
-
...buildIsometricObjects(input.isometricObjects ?? [])
|
|
8842
|
+
...buildIsometricObjects(input.isometricObjects ?? []),
|
|
8843
|
+
...buildDimensions(input.dimensions ?? [])
|
|
8538
8844
|
];
|
|
8539
8845
|
stampStacking(nodes, input);
|
|
8540
8846
|
nodes.sort(
|
|
@@ -8974,31 +9280,31 @@ function chartSeriesAttrs(detail) {
|
|
|
8974
9280
|
];
|
|
8975
9281
|
}
|
|
8976
9282
|
function frameBoundaryAttrs(detail) {
|
|
8977
|
-
return [`${
|
|
9283
|
+
return [`${chunkXJ4W6TW4_cjs.CORNER_RADIUS_ATTR}="${num(detail.cornerRadius)}"`, `${chunkXJ4W6TW4_cjs.SQUARE_CORNER_ATTR}="${detail.squareCorner}"`];
|
|
8978
9284
|
}
|
|
8979
9285
|
function declaredBoundsAttr(bounds) {
|
|
8980
|
-
return `${
|
|
9286
|
+
return `${chunkXJ4W6TW4_cjs.SYMBOL_BOUNDS_ATTR}="${num(bounds.x)},${num(bounds.y)},${num(bounds.width)},${num(bounds.height)}"`;
|
|
8981
9287
|
}
|
|
8982
9288
|
function symbolGeometryAttrs(detail) {
|
|
8983
9289
|
return [
|
|
8984
|
-
`${
|
|
8985
|
-
`${
|
|
9290
|
+
`${chunkXJ4W6TW4_cjs.SYMBOL_POINTS_ATTR}="${xml(JSON.stringify(detail.points))}"`,
|
|
9291
|
+
`${chunkXJ4W6TW4_cjs.SYMBOL_TENSION_ATTR}="${num(detail.tension)}"`,
|
|
8986
9292
|
declaredBoundsAttr(detail.declaredBounds)
|
|
8987
9293
|
];
|
|
8988
9294
|
}
|
|
8989
9295
|
function pathGeometryAttrs(detail) {
|
|
8990
9296
|
return [
|
|
8991
|
-
`${
|
|
8992
|
-
`${
|
|
8993
|
-
`${
|
|
9297
|
+
`${chunkXJ4W6TW4_cjs.PATH_POINTS_ATTR}="${xml(JSON.stringify(detail.points))}"`,
|
|
9298
|
+
`${chunkXJ4W6TW4_cjs.PATH_TENSION_ATTR}="${num(detail.tension)}"`,
|
|
9299
|
+
`${chunkXJ4W6TW4_cjs.PATH_CLOSED_ATTR}="${detail.closed}"`
|
|
8994
9300
|
];
|
|
8995
9301
|
}
|
|
8996
9302
|
function isometricGeometryAttrs(detail) {
|
|
8997
9303
|
return [
|
|
8998
|
-
`${
|
|
8999
|
-
`${
|
|
9304
|
+
`${chunkXJ4W6TW4_cjs.ISOMETRIC_SIZE_ATTR}="${num(detail.width)},${num(detail.height)},${num(detail.depth)}"`,
|
|
9305
|
+
`${chunkXJ4W6TW4_cjs.CORNER_RADIUS_ATTR}="${num(detail.cornerRadius)}"`,
|
|
9000
9306
|
declaredBoundsAttr(detail.bounds),
|
|
9001
|
-
`${
|
|
9307
|
+
`${chunkXJ4W6TW4_cjs.ISOMETRIC_LABEL_OFFSET_ATTR}="${num(detail.labelOffsetX)},${num(detail.labelOffsetY)}"`
|
|
9002
9308
|
];
|
|
9003
9309
|
}
|
|
9004
9310
|
function linkDetailAttrs(detail) {
|
|
@@ -9144,7 +9450,7 @@ function renderSvgDocument(scene, options = {}) {
|
|
|
9144
9450
|
const nodes = options.linkHitAreas ? withLinkHitAreas(scene.nodes) : scene.nodes;
|
|
9145
9451
|
const body = nodes.map((node) => nodeSvg(node, defs)).join("\n ");
|
|
9146
9452
|
const declaration = options.includeXmlDeclaration === false ? "" : '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
9147
|
-
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="${
|
|
9453
|
+
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="${chunkXJ4W6TW4_cjs.DOM_CONTRACT_VERSION}">
|
|
9148
9454
|
<defs>${defs.entries.join("")}</defs>
|
|
9149
9455
|
${body}
|
|
9150
9456
|
</svg>`;
|
|
@@ -9164,9 +9470,9 @@ function renderCanvas(input, options = {}) {
|
|
|
9164
9470
|
}
|
|
9165
9471
|
var SCENE_CACHE_LIMIT = 50;
|
|
9166
9472
|
var sceneCache = /* @__PURE__ */ new Map();
|
|
9167
|
-
var cachedForRegistry =
|
|
9473
|
+
var cachedForRegistry = chunkXJ4W6TW4_cjs.componentRegistryVersion();
|
|
9168
9474
|
function cachedRenderScene(source) {
|
|
9169
|
-
const registry =
|
|
9475
|
+
const registry = chunkXJ4W6TW4_cjs.componentRegistryVersion();
|
|
9170
9476
|
if (registry !== cachedForRegistry) {
|
|
9171
9477
|
sceneCache.clear();
|
|
9172
9478
|
cachedForRegistry = registry;
|
|
@@ -9198,7 +9504,7 @@ function render(source, options = {}) {
|
|
|
9198
9504
|
var SCENE_ORDER_BASE = 1e4;
|
|
9199
9505
|
function defineComponent(definition) {
|
|
9200
9506
|
const { scene, ...descriptor } = definition;
|
|
9201
|
-
const unregisterDescriptor =
|
|
9507
|
+
const unregisterDescriptor = chunkXJ4W6TW4_cjs.registerComponentDescriptor(descriptor);
|
|
9202
9508
|
const unregisterBuilder = registerComponentBuilder(
|
|
9203
9509
|
descriptor.type,
|
|
9204
9510
|
(component, index) => scene(component, { order: SCENE_ORDER_BASE + index })
|
|
@@ -9216,5 +9522,5 @@ exports.defineComponent = defineComponent;
|
|
|
9216
9522
|
exports.render = render;
|
|
9217
9523
|
exports.renderCanvas = renderCanvas;
|
|
9218
9524
|
exports.sflToRenderInput = sflToRenderInput;
|
|
9219
|
-
//# sourceMappingURL=chunk-
|
|
9220
|
-
//# sourceMappingURL=chunk-
|
|
9525
|
+
//# sourceMappingURL=chunk-WQRT5PVT.cjs.map
|
|
9526
|
+
//# sourceMappingURL=chunk-WQRT5PVT.cjs.map
|