@cardenelabs/cdl 0.122.0 → 0.124.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 +28 -1
- package/README.md +70 -1
- package/dist/index.cjs +1125 -618
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -26
- package/dist/index.d.ts +38 -26
- package/dist/index.js +1125 -619
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +894 -404
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +894 -404
- package/dist/react.js.map +1 -1
- package/dist/{render-U_pC-Ksh.d.cts → render-U6omSNH2.d.cts} +23 -4
- package/dist/{render-U_pC-Ksh.d.ts → render-U6omSNH2.d.ts} +23 -4
- package/package.json +9 -12
- package/src/builder.ts +5 -0
- package/src/index.ts +2 -0
- package/src/kinds/box-lines.ts +17 -4
- package/src/kinds/chart-bar.tsx +4 -0
- package/src/kinds/chart-gauge.tsx +20 -9
- package/src/kinds/chart-pie.tsx +67 -17
- package/src/kinds/chart-radial.tsx +7 -2
- package/src/kinds/chart-slope.tsx +26 -7
- package/src/kinds/chart-stacked-bar.tsx +8 -4
- package/src/kinds/chart-stat.tsx +19 -4
- package/src/kinds/chart-waffle.tsx +7 -2
- package/src/kinds/funnel.tsx +9 -2
- package/src/kinds/generic.tsx +5 -2
- package/src/kinds/mind-map.tsx +26 -10
- package/src/kinds/quadrant.tsx +14 -4
- package/src/kinds/row-align.ts +19 -7
- package/src/kinds/sequence-board-metrics.ts +13 -3
- package/src/kinds/sequence-board.tsx +4 -2
- package/src/kinds/shape-basement.tsx +57 -32
- package/src/kinds/shape-blockchain.tsx +83 -34
- package/src/kinds/shape-commerce.tsx +65 -24
- package/src/kinds/shape-finance.tsx +90 -26
- package/src/kinds/shape-hardware.tsx +48 -17
- package/src/kinds/shape-region.tsx +16 -6
- package/src/kinds/shape-software.tsx +30 -8
- package/src/kinds/text-width.ts +17 -3
- package/src/kinds/tree.tsx +25 -7
- package/src/layout/collisions.ts +21 -8
- package/src/layout/curve-path.ts +3 -2
- package/src/layout/edges.ts +173 -29
- package/src/layout/head-label.ts +3 -1
- package/src/layout/lanes.ts +3 -2
- package/src/layout/metro-path.ts +3 -2
- package/src/layout/nodes.ts +14 -6
- package/src/layout/predict-bbox.ts +6 -3
- package/src/layout/self-loop.ts +10 -4
- package/src/layout/spec.ts +20 -6
- package/src/layout/text-width.ts +25 -8
- package/src/layout.ts +39 -15
- package/src/presets.ts +69 -43
- package/src/render/edges.tsx +18 -3
- package/src/render/interactive-panel.tsx +34 -7
- package/src/render/nodes.tsx +97 -48
- package/src/render/stage.tsx +3 -0
- package/src/text-metrics.ts +9 -0
- package/src/types.ts +22 -2
- package/src/visual-validate.ts +67 -17
package/dist/react.cjs
CHANGED
|
@@ -717,6 +717,11 @@ function \u5B57\u3092\u5DEE\u3057\u8FBC\u3080(template, values) {
|
|
|
717
717
|
return template.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole);
|
|
718
718
|
}
|
|
719
719
|
|
|
720
|
+
// src/text-metrics.ts
|
|
721
|
+
function resolveTextMetrics(value) {
|
|
722
|
+
return value === "monospace" ? "monospace" : "proportional";
|
|
723
|
+
}
|
|
724
|
+
|
|
720
725
|
// src/layout/clearance-constants.ts
|
|
721
726
|
var CLEARANCE_NODE_LABEL = 32;
|
|
722
727
|
var CLEARANCE_LANE_LABEL = 24;
|
|
@@ -878,10 +883,10 @@ function defaultAdvanceEm(ch, code) {
|
|
|
878
883
|
if (ch >= "0" && ch <= "9") return 0.72;
|
|
879
884
|
return 0.65;
|
|
880
885
|
}
|
|
881
|
-
function
|
|
886
|
+
function measureAdvanceWidth(text, opts = {}) {
|
|
882
887
|
const fontSize = opts.fontSize ?? 22;
|
|
883
888
|
const letterSpacing = opts.letterSpacing ?? 0;
|
|
884
|
-
const fontFamily = opts.fontFamily ?? "sans";
|
|
889
|
+
const fontFamily = opts.textMetrics === "monospace" ? "mono" : opts.fontFamily ?? "sans";
|
|
885
890
|
const bound = opts.bound ?? "layout";
|
|
886
891
|
let advanceEmSum = 0;
|
|
887
892
|
let charCount = 0;
|
|
@@ -889,7 +894,7 @@ function measureTextWidth(text, opts = {}) {
|
|
|
889
894
|
for (const ch of \u6587\u5B57\u5217) {
|
|
890
895
|
charCount++;
|
|
891
896
|
const code = ch.codePointAt(0) ?? 0;
|
|
892
|
-
const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
|
|
897
|
+
const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) && fontFamily !== "mono" ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
|
|
893
898
|
if (isEmojiGrapheme(ch, code)) {
|
|
894
899
|
advanceEmSum += fontFamily === "mono" ? MONO_EMOJI_ADVANCE_EM : EMOJI_ADVANCE_EM;
|
|
895
900
|
continue;
|
|
@@ -905,7 +910,12 @@ function measureTextWidth(text, opts = {}) {
|
|
|
905
910
|
const table = ch.length === 1 ? INTER_BOLD_ADVANCE_EM[ch] : void 0;
|
|
906
911
|
advanceEmSum += (table !== void 0 ? table : defaultAdvanceEm(ch, code)) / \u5272\u308A\u623B\u3057;
|
|
907
912
|
}
|
|
908
|
-
|
|
913
|
+
return advanceEmSum * fontSize + letterSpacing * charCount;
|
|
914
|
+
}
|
|
915
|
+
function measureTextWidth(text, opts = {}) {
|
|
916
|
+
const fontSize = opts.fontSize ?? 22;
|
|
917
|
+
const bound = opts.bound ?? "layout";
|
|
918
|
+
const w = measureAdvanceWidth(text, opts);
|
|
909
919
|
return bound === "drawn" ? w : Math.max(w, fontSize * 1.2);
|
|
910
920
|
}
|
|
911
921
|
function \u53CE\u3081\u308B\u500D\u7387(text, opts, \u5E45) {
|
|
@@ -1273,15 +1283,22 @@ function requiredVerticalLabelGap(pillHs) {
|
|
|
1273
1283
|
const step = parallelLabelStepY(pillHs);
|
|
1274
1284
|
return (pillHs.length - 1) * step + Math.max(first, last) + CLEARANCE_NODE_LABEL * 2;
|
|
1275
1285
|
}
|
|
1276
|
-
function computeLabelBoxW(label, sub) {
|
|
1277
|
-
const mainW = measureTextWidth(label ?? "", {
|
|
1278
|
-
|
|
1286
|
+
function computeLabelBoxW(label, sub, textMetrics = "proportional") {
|
|
1287
|
+
const mainW = measureTextWidth(label ?? "", {
|
|
1288
|
+
fontSize: EDGE_LABEL_TEXT.main.fontSize,
|
|
1289
|
+
textMetrics
|
|
1290
|
+
});
|
|
1291
|
+
const subW = sub ? measureTextWidth(sub, {
|
|
1292
|
+
fontSize: EDGE_LABEL_TEXT.sub.fontSize,
|
|
1293
|
+
fontFamily: "mono",
|
|
1294
|
+
textMetrics
|
|
1295
|
+
}) : 0;
|
|
1279
1296
|
const raw = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
|
|
1280
1297
|
const EPSILON = 1e-6;
|
|
1281
1298
|
return Math.ceil((raw - EPSILON) / 2) * 2;
|
|
1282
1299
|
}
|
|
1283
|
-
function computeLabelBBoxWorld(edge) {
|
|
1284
|
-
const boxW = computeLabelBoxW(edge.label, edge.sub);
|
|
1300
|
+
function computeLabelBBoxWorld(edge, textMetrics = "proportional") {
|
|
1301
|
+
const boxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
|
|
1285
1302
|
const boxH = edge.sub ? LABEL_PILL_H_WITH_SUB : LABEL_PILL_H_MAIN_ONLY;
|
|
1286
1303
|
const anchor = edge.labelAnchor;
|
|
1287
1304
|
const boxLeftX = anchor === "start" ? 0 : anchor === "end" ? -boxW : -boxW / 2;
|
|
@@ -1505,7 +1522,7 @@ function footerShapeDrawTop(node) {
|
|
|
1505
1522
|
// src/layout/collisions.ts
|
|
1506
1523
|
var LANE_LABEL_CLEARANCE_MARGIN = 2;
|
|
1507
1524
|
var NEAR_MISS_MARGIN = LANE_LABEL_CLEARANCE_MARGIN;
|
|
1508
|
-
function collectBBoxes(lanes, nodes, edges) {
|
|
1525
|
+
function collectBBoxes(lanes, nodes, edges, textMetrics = "proportional") {
|
|
1509
1526
|
const out = [];
|
|
1510
1527
|
for (const lane of lanes) {
|
|
1511
1528
|
if (!lane.label) continue;
|
|
@@ -1514,7 +1531,7 @@ function collectBBoxes(lanes, nodes, edges) {
|
|
|
1514
1531
|
id: lane.id,
|
|
1515
1532
|
x: lane.x + 16,
|
|
1516
1533
|
y: lane.y + 8,
|
|
1517
|
-
w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2 }) + 24,
|
|
1534
|
+
w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2, textMetrics }) + 24,
|
|
1518
1535
|
h: 28
|
|
1519
1536
|
});
|
|
1520
1537
|
}
|
|
@@ -1532,7 +1549,7 @@ function collectBBoxes(lanes, nodes, edges) {
|
|
|
1532
1549
|
}
|
|
1533
1550
|
for (const e of edges) {
|
|
1534
1551
|
if (!hasRenderedLabel(e)) continue;
|
|
1535
|
-
const bbox = computeLabelBBoxWorld(e);
|
|
1552
|
+
const bbox = computeLabelBBoxWorld(e, textMetrics);
|
|
1536
1553
|
out.push({
|
|
1537
1554
|
kind: "edge-label",
|
|
1538
1555
|
id: e.id,
|
|
@@ -2176,7 +2193,7 @@ function clampShiftMagnitude(shift, maxMagnitude) {
|
|
|
2176
2193
|
};
|
|
2177
2194
|
return { dx: clampAxis(shift.dx), dy: clampAxis(shift.dy) };
|
|
2178
2195
|
}
|
|
2179
|
-
function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE) {
|
|
2196
|
+
function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE, textMetrics = "proportional") {
|
|
2180
2197
|
if (edges.length === 0) {
|
|
2181
2198
|
return {
|
|
2182
2199
|
edges,
|
|
@@ -2187,7 +2204,7 @@ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClea
|
|
|
2187
2204
|
}
|
|
2188
2205
|
const MAX_ACCUMULATED_SHIFT = CHAIN_SHIFT_MAX_ACCUMULATED;
|
|
2189
2206
|
const labelBBox = (e, offsetX, offsetY) => {
|
|
2190
|
-
const base = computeLabelBBoxWorld(e);
|
|
2207
|
+
const base = computeLabelBBoxWorld(e, textMetrics);
|
|
2191
2208
|
return {
|
|
2192
2209
|
kind: "edge-label",
|
|
2193
2210
|
id: e.id,
|
|
@@ -2788,11 +2805,15 @@ var \u5411\u304D\u306E\u9806 = [
|
|
|
2788
2805
|
{ axis: "x", sign: -1, \u540D\u524D: "\u5DE6" },
|
|
2789
2806
|
{ axis: "x", sign: 1, \u540D\u524D: "\u53F3" }
|
|
2790
2807
|
];
|
|
2791
|
-
function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles) {
|
|
2808
|
+
function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles, textMetrics = "proportional") {
|
|
2792
2809
|
const edgeById = new Map(edges.map((e) => [e.id, e]));
|
|
2793
2810
|
const \u81EA\u5206 = edgeById.get(labelId);
|
|
2794
2811
|
if (!\u81EA\u5206) return null;
|
|
2795
|
-
const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({
|
|
2812
|
+
const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({
|
|
2813
|
+
kind: "edge-label",
|
|
2814
|
+
id: e.id,
|
|
2815
|
+
...computeLabelBBoxWorld(e, textMetrics)
|
|
2816
|
+
}));
|
|
2796
2817
|
const label = labels.find((l) => l.id === labelId);
|
|
2797
2818
|
if (!label) return null;
|
|
2798
2819
|
const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
|
|
@@ -2834,7 +2855,7 @@ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B,
|
|
|
2834
2855
|
}
|
|
2835
2856
|
return `\u9003\u3052\u5834\u306A\u3057: ${\u7406\u7531.sort((a, b) => a.\u9806 - b.\u9806).map((r) => r.\u6587).join(" / ")}`;
|
|
2836
2857
|
}
|
|
2837
|
-
function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
|
|
2858
|
+
function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8, textMetrics = "proportional") {
|
|
2838
2859
|
if (edges.length === 0) return edges;
|
|
2839
2860
|
const labeledIds = new Set(
|
|
2840
2861
|
edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => e.id)
|
|
@@ -2852,7 +2873,7 @@ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
|
|
|
2852
2873
|
const out = [];
|
|
2853
2874
|
for (const e of edges) {
|
|
2854
2875
|
if (!labeledIds.has(e.id)) continue;
|
|
2855
|
-
const base = computeLabelBBoxWorld(e);
|
|
2876
|
+
const base = computeLabelBBoxWorld(e, textMetrics);
|
|
2856
2877
|
const s = getShift(e.id);
|
|
2857
2878
|
out.push({ kind: "edge-label", id: e.id, x: base.x + s.dx, y: base.y + s.dy, w: base.w, h: base.h });
|
|
2858
2879
|
}
|
|
@@ -2985,7 +3006,7 @@ function applyEdgeLabelAndPathShifts(edges, labelShiftMap, edgePathShiftMap) {
|
|
|
2985
3006
|
|
|
2986
3007
|
// src/layout/curve-path.ts
|
|
2987
3008
|
var SAME_HEIGHT_THRESHOLD = 1;
|
|
2988
|
-
function curvePath(from, to, edge, labelMarginExtra = 0) {
|
|
3009
|
+
function curvePath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
|
|
2989
3010
|
const fromLeft = from.cx - from.w / 2;
|
|
2990
3011
|
const fromRight = from.cx + from.w / 2;
|
|
2991
3012
|
const toLeft = to.cx - to.w / 2;
|
|
@@ -3053,7 +3074,7 @@ function curvePath(from, to, edge, labelMarginExtra = 0) {
|
|
|
3053
3074
|
normalX *= -1;
|
|
3054
3075
|
normalY *= -1;
|
|
3055
3076
|
}
|
|
3056
|
-
const labelW = computeLabelBoxW(edge?.label, edge?.sub);
|
|
3077
|
+
const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
|
|
3057
3078
|
const labelH = labelPillH(edge?.sub);
|
|
3058
3079
|
const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
|
|
3059
3080
|
return {
|
|
@@ -3085,7 +3106,7 @@ function polyline(points) {
|
|
|
3085
3106
|
});
|
|
3086
3107
|
return distinct.map((p, i) => `${i === 0 ? "M" : "L"} ${point(p)}`).join(" ");
|
|
3087
3108
|
}
|
|
3088
|
-
function metroPath(from, to, edge, labelMarginExtra = 0) {
|
|
3109
|
+
function metroPath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
|
|
3089
3110
|
const fromLeft = from.cx - from.w / 2;
|
|
3090
3111
|
const fromRight = from.cx + from.w / 2;
|
|
3091
3112
|
const toLeft = to.cx - to.w / 2;
|
|
@@ -3196,7 +3217,7 @@ function metroPath(from, to, edge, labelMarginExtra = 0) {
|
|
|
3196
3217
|
normalX *= -1;
|
|
3197
3218
|
normalY *= -1;
|
|
3198
3219
|
}
|
|
3199
|
-
const labelW = computeLabelBoxW(edge?.label, edge?.sub);
|
|
3220
|
+
const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
|
|
3200
3221
|
const labelH = labelPillH(edge?.sub);
|
|
3201
3222
|
const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
|
|
3202
3223
|
return {
|
|
@@ -3365,7 +3386,14 @@ var NARROW_RATIO = 0.37;
|
|
|
3365
3386
|
var ASCII_RATIO = 0.86;
|
|
3366
3387
|
var WIDE_CHARS = "W@%Mm";
|
|
3367
3388
|
var NARROW_CHARS = "ijlI.,:;'! ";
|
|
3368
|
-
function textWidth(s, size, \u5B57\u9001\u308A = 0) {
|
|
3389
|
+
function textWidth(s, size, \u5B57\u9001\u308A = 0, textMetrics = "proportional") {
|
|
3390
|
+
if (textMetrics === "monospace") {
|
|
3391
|
+
return measureAdvanceWidth(s, {
|
|
3392
|
+
fontSize: size,
|
|
3393
|
+
letterSpacing: \u5B57\u9001\u308A,
|
|
3394
|
+
fontFamily: "mono"
|
|
3395
|
+
});
|
|
3396
|
+
}
|
|
3369
3397
|
let \u5E45 = 0;
|
|
3370
3398
|
let \u5B57\u6570 = 0;
|
|
3371
3399
|
for (const c of s) {
|
|
@@ -3402,8 +3430,8 @@ function splitRow(row) {
|
|
|
3402
3430
|
}
|
|
3403
3431
|
return { left: row.trim(), right: "", split: false };
|
|
3404
3432
|
}
|
|
3405
|
-
function rowColumnWidth(text, size, mono) {
|
|
3406
|
-
return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size);
|
|
3433
|
+
function rowColumnWidth(text, size, mono, textMetrics = "proportional") {
|
|
3434
|
+
return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size, 0, textMetrics);
|
|
3407
3435
|
}
|
|
3408
3436
|
function displayWidth(text) {
|
|
3409
3437
|
let w = 0;
|
|
@@ -3429,12 +3457,12 @@ function \u6841\u3067\u7701\u304F(text, \u4E0A\u9650) {
|
|
|
3429
3457
|
if (displayWidth(text) <= \u4E0A\u9650) return text;
|
|
3430
3458
|
return `${\u6841\u3067\u5272\u308B(text, \u4E0A\u9650 - 1)[0]}\u2026`;
|
|
3431
3459
|
}
|
|
3432
|
-
function requiredRowsWidth(rows, kind) {
|
|
3460
|
+
function requiredRowsWidth(rows, kind, textMetrics = "proportional") {
|
|
3433
3461
|
if (!rows || rows.length === 0) return 0;
|
|
3434
3462
|
const splits = rows.map(splitRow);
|
|
3435
3463
|
const \u4E00\u756A\u5E83\u3044 = (\u53D6\u308B) => splits.reduce((m, s) => Math.max(m, \u53D6\u308B(s)), 0);
|
|
3436
|
-
const storage = ROW_PAD_X_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.left, 26, true)) + STORAGE_COL_GAP_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.right, 26, true)) + ROW_RIGHT_PAD_PX;
|
|
3437
|
-
const generic = ROW_PAD_X_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)) + ROW_COL_GAP_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.right, GENERIC_ROW_RIGHT_SIZE_PX, true)) + ROW_RIGHT_PAD_PX;
|
|
3464
|
+
const storage = ROW_PAD_X_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.left, 26, true, textMetrics)) + STORAGE_COL_GAP_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.right, 26, true, textMetrics)) + ROW_RIGHT_PAD_PX;
|
|
3465
|
+
const generic = ROW_PAD_X_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false, textMetrics)) + ROW_COL_GAP_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.right, GENERIC_ROW_RIGHT_SIZE_PX, true, textMetrics)) + ROW_RIGHT_PAD_PX;
|
|
3438
3466
|
if (kind === void 0) return Math.ceil(Math.max(storage, generic));
|
|
3439
3467
|
return Math.ceil(kind === "storage" ? storage : generic);
|
|
3440
3468
|
}
|
|
@@ -3499,7 +3527,10 @@ var \u5DE6\u53F3\u306E\u4F59\u767D = 8;
|
|
|
3499
3527
|
function \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45) {
|
|
3500
3528
|
return \u7BB1\u306E\u5E45 - \u5DE6\u53F3\u306E\u4F59\u767D * 2;
|
|
3501
3529
|
}
|
|
3502
|
-
function \
|
|
3530
|
+
function \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics = "proportional") {
|
|
3531
|
+
return (text, fontSize) => textWidth(text, fontSize, 0, textMetrics);
|
|
3532
|
+
}
|
|
3533
|
+
function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
|
|
3503
3534
|
if (\u4F7F\u3048\u308B\u5E452 <= 0) return "";
|
|
3504
3535
|
if (\u6E2C\u308B(text, fontSize) <= \u4F7F\u3048\u308B\u5E452) return text;
|
|
3505
3536
|
const \u7701\u7565 = "\u2026";
|
|
@@ -3516,7 +3547,7 @@ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6
|
|
|
3516
3547
|
return `${\u51FA}${\u7701\u7565}`;
|
|
3517
3548
|
}
|
|
3518
3549
|
var \u7E2E\u3081\u306E\u4E0B\u9650 = MIN_TEXT_SIZE;
|
|
3519
|
-
function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B
|
|
3550
|
+
function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
|
|
3520
3551
|
let size = fontSize;
|
|
3521
3552
|
while (size > \u7E2E\u3081\u306E\u4E0B\u9650 && \u6E2C\u308B(text, size) > \u4F7F\u3048\u308B\u5E452) size -= 1;
|
|
3522
3553
|
return { text: \u5E45\u3067\u5207\u308B(text, size, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B), fontSize: size };
|
|
@@ -3526,7 +3557,7 @@ function \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text) {
|
|
|
3526
3557
|
if (typeof \u533A\u5207\u308A !== "function") return [...text];
|
|
3527
3558
|
return [...new \u533A\u5207\u308A(void 0, { granularity: "grapheme" }).segment(text)].map((g) => g.segment);
|
|
3528
3559
|
}
|
|
3529
|
-
function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553) {
|
|
3560
|
+
function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553, \u6E2C\u308B) {
|
|
3530
3561
|
const \u5019\u88DC = \u884C.filter((r, i) => i === 0 || r.text.trim() !== "");
|
|
3531
3562
|
if (\u5019\u88DC.length === 0) return [];
|
|
3532
3563
|
const \u4F7F\u3048\u308B\u9AD8\u3055 = \u7BB1\u306E\u9AD8\u30553 - \u4E0A\u4E0B\u306E\u4F59\u767D * 2;
|
|
@@ -3534,7 +3565,7 @@ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8
|
|
|
3534
3565
|
const \u6B8B\u3059 = [...\u5019\u88DC];
|
|
3535
3566
|
while (\u6B8B\u3059.length > 1 && \u9AD8\u3055(\u6B8B\u3059) > \u4F7F\u3048\u308B\u9AD8\u3055) \u6B8B\u3059.pop();
|
|
3536
3567
|
const \u5E45 = \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45);
|
|
3537
|
-
const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45) }));
|
|
3568
|
+
const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45, \u6E2C\u308B) }));
|
|
3538
3569
|
const \u7DCF\u9AD8 = \u9AD8\u3055(\u53CE\u3081\u305F);
|
|
3539
3570
|
let \u7A4D\u307F = -\u7DCF\u9AD8 / 2;
|
|
3540
3571
|
return \u53CE\u3081\u305F.map((r) => {
|
|
@@ -3547,9 +3578,9 @@ function \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(\u66F8\u3044\u305F, \u63A7\u
|
|
|
3547
3578
|
const v = (\u66F8\u3044\u305F ?? "").trim();
|
|
3548
3579
|
return v === "" ? \u63A7\u3048 : v;
|
|
3549
3580
|
}
|
|
3550
|
-
function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45) {
|
|
3581
|
+
function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45, textMetrics = "proportional") {
|
|
3551
3582
|
if (!(\u5E45 > 0) || !(size > 0)) return 1;
|
|
3552
|
-
const \u5B9F\u5E45 = textWidth(text, size, letterSpacing);
|
|
3583
|
+
const \u5B9F\u5E45 = textWidth(text, size, letterSpacing, textMetrics);
|
|
3553
3584
|
return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
|
|
3554
3585
|
}
|
|
3555
3586
|
function \u8AAD\u3081\u308B\u4E0B\u9650\u306E\u500D\u7387(\u5927\u304D\u3055) {
|
|
@@ -3764,13 +3795,13 @@ function fitArt(region, extent, art) {
|
|
|
3764
3795
|
);
|
|
3765
3796
|
}
|
|
3766
3797
|
var \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
|
|
3767
|
-
function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0) {
|
|
3798
|
+
function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0, textMetrics = "proportional") {
|
|
3768
3799
|
return Math.max(
|
|
3769
3800
|
displayWidth(text) * size * MONO_ADVANCE_RATIO,
|
|
3770
|
-
textWidth(text, size, letterSpacing)
|
|
3801
|
+
textWidth(text, size, letterSpacing, textMetrics)
|
|
3771
3802
|
);
|
|
3772
3803
|
}
|
|
3773
|
-
function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089) {
|
|
3804
|
+
function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089, textMetrics = "proportional") {
|
|
3774
3805
|
const \u623B\u3057 = Number.isFinite(\u500D\u7387) && \u500D\u7387 > 0 ? 1 / \u500D\u7387 : 1;
|
|
3775
3806
|
let \u4E0A\u9650 = Number.POSITIVE_INFINITY;
|
|
3776
3807
|
for (const \u5B572 of \u5B57\u3089) {
|
|
@@ -3779,7 +3810,7 @@ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089)
|
|
|
3779
3810
|
if (Number.isFinite(\u9AD8\u3055) && \u9AD8\u3055 > 0) {
|
|
3780
3811
|
\u4E0A\u9650 = Math.min(\u4E0A\u9650, \u9AD8\u3055 * \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u5B572.size);
|
|
3781
3812
|
}
|
|
3782
|
-
const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0);
|
|
3813
|
+
const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0, textMetrics);
|
|
3783
3814
|
if (Number.isFinite(\u5E45) && \u5E45 > 0 && \u5B9F\u5E45 > 0) {
|
|
3784
3815
|
\u4E0A\u9650 = Math.min(\u4E0A\u9650, \u5E45 / \u5B9F\u5E45);
|
|
3785
3816
|
}
|
|
@@ -4974,9 +5005,14 @@ var PAD_LEFT = 24;
|
|
|
4974
5005
|
var \u7BB1\u306E\u6700\u5927\u5E45 = 140;
|
|
4975
5006
|
var \u7BB1\u306E\u6700\u5927\u9AD8\u3055 = 38;
|
|
4976
5007
|
var \u6728\u306E\u679D\u306E\u592A\u3055 = (\u6BB5) => Math.max(1.1, 2.6 - \u6BB5 * 0.45);
|
|
4977
|
-
function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}) {
|
|
5008
|
+
function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
|
|
4978
5009
|
const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
|
|
4979
|
-
return computeTreeLayout(
|
|
5010
|
+
return computeTreeLayout(
|
|
5011
|
+
treeNodes,
|
|
5012
|
+
node.w - PAD_LEFT - PAD_RIGHT,
|
|
5013
|
+
node.h - PAD_TOP - PAD_BOTTOM,
|
|
5014
|
+
textMetrics
|
|
5015
|
+
);
|
|
4980
5016
|
}
|
|
4981
5017
|
function \u6728\u306E\u884C(n) {
|
|
4982
5018
|
return [
|
|
@@ -4989,12 +5025,14 @@ function TreeNode({
|
|
|
4989
5025
|
active,
|
|
4990
5026
|
stateValues = {},
|
|
4991
5027
|
drawing = false,
|
|
4992
|
-
progress = 1
|
|
5028
|
+
progress = 1,
|
|
5029
|
+
textMetrics = "proportional"
|
|
4993
5030
|
}) {
|
|
4994
5031
|
const x0 = node.cx - node.w / 2;
|
|
4995
5032
|
const y0 = node.cy - node.h / 2;
|
|
4996
5033
|
const gradientId = `tree-root-grad-${node.id}`;
|
|
4997
|
-
const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues);
|
|
5034
|
+
const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
|
|
5035
|
+
const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
|
|
4998
5036
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
4999
5037
|
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
5000
5038
|
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
@@ -5048,10 +5086,10 @@ function TreeNode({
|
|
|
5048
5086
|
const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
|
|
5049
5087
|
const isRoot = n.depth === 0;
|
|
5050
5088
|
const \u6750\u6599 = \u6728\u306E\u884C(n);
|
|
5051
|
-
const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h);
|
|
5089
|
+
const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h, \u6E2C\u308B);
|
|
5052
5090
|
const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
|
|
5053
5091
|
const \u540D\u524D = \u6750\u6599[0];
|
|
5054
|
-
const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B\u5E45(n.w));
|
|
5092
|
+
const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B\u5E45(n.w), \u6E2C\u308B);
|
|
5055
5093
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5056
5094
|
"g",
|
|
5057
5095
|
{
|
|
@@ -5133,7 +5171,7 @@ function TreeNode({
|
|
|
5133
5171
|
})
|
|
5134
5172
|
] });
|
|
5135
5173
|
}
|
|
5136
|
-
function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
5174
|
+
function computeTreeLayout(treeNodes, canvasW, canvasH, textMetrics = "proportional") {
|
|
5137
5175
|
const ids = new Set(treeNodes.map((n) => n.id));
|
|
5138
5176
|
const childrenOf = /* @__PURE__ */ new Map();
|
|
5139
5177
|
for (const n of treeNodes) {
|
|
@@ -5181,7 +5219,7 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
|
|
|
5181
5219
|
const \u7BB1\u306E\u5E45 = (n, depth) => {
|
|
5182
5220
|
const \u6750\u6599 = \u6728\u306E\u884C({ ...n, depth });
|
|
5183
5221
|
const \u540D\u524D = \u6750\u6599[0];
|
|
5184
|
-
const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize}) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
|
|
5222
|
+
const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize, textMetrics }) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
|
|
5185
5223
|
return Math.min(Math.max(\u8981\u308B, nodeW), slotW * 0.92);
|
|
5186
5224
|
};
|
|
5187
5225
|
const \u8449\u306E\u4E26\u3073 = [];
|
|
@@ -5285,7 +5323,7 @@ var BRANCH_BOX_H_MAX = 48;
|
|
|
5285
5323
|
var SUB_BOX_H_MAX = 40;
|
|
5286
5324
|
var \u7E26\u306E\u9593\u9694\u306E\u4E0A\u9650 = (\u679D\u306E\u6A2A\u306E\u4F38\u3073) => \u679D\u306E\u6A2A\u306E\u4F38\u3073;
|
|
5287
5325
|
var MIND_PAD = 40;
|
|
5288
|
-
function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
|
|
5326
|
+
function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
|
|
5289
5327
|
const mindData = node.mindData ? resolveMindData(node.mindData, stateValues) : void 0;
|
|
5290
5328
|
if (!mindData) return void 0;
|
|
5291
5329
|
return computeMindMapLayout(
|
|
@@ -5293,7 +5331,8 @@ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
|
|
|
5293
5331
|
node.w / 2,
|
|
5294
5332
|
node.h / 2,
|
|
5295
5333
|
node.w - MIND_PAD * 2,
|
|
5296
|
-
node.h - MIND_PAD * 2
|
|
5334
|
+
node.h - MIND_PAD * 2,
|
|
5335
|
+
textMetrics
|
|
5297
5336
|
);
|
|
5298
5337
|
}
|
|
5299
5338
|
function \u653E\u5C04\u306E\u884C(n) {
|
|
@@ -5307,12 +5346,14 @@ function MindMapNode({
|
|
|
5307
5346
|
active,
|
|
5308
5347
|
stateValues = {},
|
|
5309
5348
|
drawing = false,
|
|
5310
|
-
progress = 1
|
|
5349
|
+
progress = 1,
|
|
5350
|
+
textMetrics = "proportional"
|
|
5311
5351
|
}) {
|
|
5312
5352
|
const x0 = node.cx - node.w / 2;
|
|
5313
5353
|
const y0 = node.cy - node.h / 2;
|
|
5314
|
-
const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues);
|
|
5354
|
+
const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
|
|
5315
5355
|
if (!layout2) return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${x0} ${y0})` });
|
|
5356
|
+
const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
|
|
5316
5357
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
5317
5358
|
const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
|
|
5318
5359
|
const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
|
|
@@ -5359,8 +5400,13 @@ function MindMapNode({
|
|
|
5359
5400
|
const \u6587\u5B57\u306E\u5BC4\u305B = \u67A0\u306A\u3057 ? \u5916\u3078 ? "start" : "end" : "middle";
|
|
5360
5401
|
const \u63CF\u753B\u57DF\u306E\u7AEF = \u5916\u3078 ? node.w - MIND_PAD : MIND_PAD;
|
|
5361
5402
|
const \u4F7F\u3048\u308B = \u67A0\u306A\u3057 ? Math.abs(\u63CF\u753B\u57DF\u306E\u7AEF - \u6587\u5B57\u306Ex) : \u4F7F\u3048\u308B\u5E45(n.w);
|
|
5362
|
-
const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B);
|
|
5363
|
-
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
5403
|
+
const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B, \u6E2C\u308B);
|
|
5404
|
+
const \u884C = \u7BB1\u306B\u7A4D\u3080(
|
|
5405
|
+
\u6750\u6599,
|
|
5406
|
+
\u67A0\u306A\u3057 ? \u4F7F\u3048\u308B + (n.w - \u4F7F\u3048\u308B\u5E45(n.w)) : n.w,
|
|
5407
|
+
n.h,
|
|
5408
|
+
\u6E2C\u308B
|
|
5409
|
+
);
|
|
5364
5410
|
const \u6587\u5B57\u306E\u8272 = n.isRoot ? "var(--cdl-text-on-tone, #ffffff)" : "var(--cdl-chip-text, #1a1f2a)";
|
|
5365
5411
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-unresolved": n.unresolved ? "true" : void 0, children: [
|
|
5366
5412
|
\u67A0\u306A\u3057 ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5412,14 +5458,14 @@ function MindMapNode({
|
|
|
5412
5458
|
})
|
|
5413
5459
|
] });
|
|
5414
5460
|
}
|
|
5415
|
-
function \u63CF\u304F\u6A2A\u306E\u7AEF(n) {
|
|
5461
|
+
function \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics = "proportional") {
|
|
5416
5462
|
if (n.isRoot || !n.isLeaf) return [n.x - n.w / 2, n.x + n.w / 2];
|
|
5417
5463
|
const \u8D77\u70B9 = n.x + (n.side === "right" ? -n.w / 2 : n.w / 2);
|
|
5418
5464
|
const \u540D\u524D = \u653E\u5C04\u306E\u884C(n)[0];
|
|
5419
|
-
const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
|
|
5465
|
+
const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
|
|
5420
5466
|
return n.side === "right" ? [\u8D77\u70B9, \u8D77\u70B9 + \u5E45] : [\u8D77\u70B9 - \u5E45, \u8D77\u70B9];
|
|
5421
5467
|
}
|
|
5422
|
-
function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
5468
|
+
function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH, textMetrics = "proportional") {
|
|
5423
5469
|
const nodes = [];
|
|
5424
5470
|
const edges = [];
|
|
5425
5471
|
const rootW = 120;
|
|
@@ -5497,7 +5543,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
5497
5543
|
const PREFERRED_GAP = MIND_BOX_GAP;
|
|
5498
5544
|
const \u679D\u306E\u540D\u524D\u306E\u5E45 = (title) => {
|
|
5499
5545
|
const \u540D\u524D = \u653E\u5C04\u306E\u884C({ title, isRoot: false })[0];
|
|
5500
|
-
return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
|
|
5546
|
+
return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
|
|
5501
5547
|
};
|
|
5502
5548
|
const \u679D\u306E\u6A2A\u3092\u6C7A\u3081\u308B = (br) => {
|
|
5503
5549
|
const maxSubDepth = subDepthOf(br.id, /* @__PURE__ */ new Set());
|
|
@@ -5615,7 +5661,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
5615
5661
|
let maxExtentX = rootW / 2;
|
|
5616
5662
|
let maxExtentY = rootH / 2;
|
|
5617
5663
|
for (const n of nodes) {
|
|
5618
|
-
const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
|
|
5664
|
+
const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
|
|
5619
5665
|
maxExtentX = Math.max(maxExtentX, Math.abs(\u5DE6 - cx), Math.abs(\u53F3 - cx));
|
|
5620
5666
|
maxExtentY = Math.max(maxExtentY, Math.abs(n.y - cy) + n.h / 2);
|
|
5621
5667
|
}
|
|
@@ -5635,7 +5681,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
5635
5681
|
let \u5DE6\u7AEF = Number.POSITIVE_INFINITY;
|
|
5636
5682
|
let \u53F3\u7AEF = Number.NEGATIVE_INFINITY;
|
|
5637
5683
|
for (const n of nodes) {
|
|
5638
|
-
const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
|
|
5684
|
+
const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
|
|
5639
5685
|
\u5DE6\u7AEF = Math.min(\u5DE6\u7AEF, l);
|
|
5640
5686
|
\u53F3\u7AEF = Math.max(\u53F3\u7AEF, r);
|
|
5641
5687
|
}
|
|
@@ -5857,10 +5903,16 @@ function emptyCounts() {
|
|
|
5857
5903
|
"validation-interrupted": 0
|
|
5858
5904
|
};
|
|
5859
5905
|
}
|
|
5860
|
-
function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n) {
|
|
5861
|
-
const \u7BB1 = (b, \u884C) => ({ \u884C, w: b.w, h: b.h });
|
|
5862
|
-
if (n.kind === "tree-hierarchy")
|
|
5863
|
-
|
|
5906
|
+
function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics = "proportional") {
|
|
5907
|
+
const \u7BB1 = (b, \u884C, \u6E2C\u308B) => ({ \u884C, w: b.w, h: b.h, \u6E2C\u308B });
|
|
5908
|
+
if (n.kind === "tree-hierarchy") {
|
|
5909
|
+
const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
|
|
5910
|
+
return \u6728\u306E\u4E2D\u8EAB(n, {}, textMetrics).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b), \u6E2C\u308B));
|
|
5911
|
+
}
|
|
5912
|
+
if (n.kind === "mind-map") {
|
|
5913
|
+
const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
|
|
5914
|
+
return (\u653E\u5C04\u306E\u4E2D\u8EAB(n, {}, textMetrics)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b), \u6E2C\u308B));
|
|
5915
|
+
}
|
|
5864
5916
|
return [];
|
|
5865
5917
|
}
|
|
5866
5918
|
function measureStubOut(segs) {
|
|
@@ -6494,6 +6546,7 @@ function \u4F4D\u7F6E\u3092\u624B\u3067\u66F8\u3044\u305F(n) {
|
|
|
6494
6546
|
return n.posX !== void 0 && n.posY !== void 0;
|
|
6495
6547
|
}
|
|
6496
6548
|
function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5668) {
|
|
6549
|
+
const textMetrics = laid.textMetrics ?? "proportional";
|
|
6497
6550
|
const LIFELINE_W_THRESHOLD = 8;
|
|
6498
6551
|
for (const n of laid.nodes) {
|
|
6499
6552
|
if (n.w < LIFELINE_W_THRESHOLD) continue;
|
|
@@ -6505,7 +6558,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6505
6558
|
);
|
|
6506
6559
|
}
|
|
6507
6560
|
}
|
|
6508
|
-
const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges);
|
|
6561
|
+
const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges, textMetrics);
|
|
6509
6562
|
const collisions = detectCollisions(bboxes, laid.edges);
|
|
6510
6563
|
for (const c of collisions) {
|
|
6511
6564
|
const involvesEdgeLabel = c.a.kind === "edge-label" || c.b.kind === "edge-label";
|
|
@@ -6525,7 +6578,11 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6525
6578
|
if (!titleTrimmed) continue;
|
|
6526
6579
|
const \u4F59\u767D = drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING;
|
|
6527
6580
|
const \u4F7F\u3048\u308B\u5E452 = n.w - \u4F59\u767D;
|
|
6528
|
-
const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, {
|
|
6581
|
+
const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, {
|
|
6582
|
+
fontSize: titleFontSize(n.kind),
|
|
6583
|
+
bound: "drawn",
|
|
6584
|
+
textMetrics
|
|
6585
|
+
});
|
|
6529
6586
|
if (titleScalesToFit(n.kind, n.h)) {
|
|
6530
6587
|
const \u7E2E\u3081\u305F\u5927\u304D\u3055 = \u5B9F\u5E45 > 0 ? titleFontSize(n.kind) * Math.min(1, \u4F7F\u3048\u308B\u5E452 / \u5B9F\u5E45) : titleFontSize(n.kind);
|
|
6531
6588
|
if (\u7E2E\u3081\u305F\u5927\u304D\u3055 < MIN_TITLE_FONT_SIZE) {
|
|
@@ -6593,7 +6650,13 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6593
6650
|
const b\u306F\u672D = n.b.kind === "edge-label";
|
|
6594
6651
|
const \u52D5\u304B\u3059 = a\u306F\u672D && b\u306F\u672D ? (\u8FBA\u306E\u9806.get(n.a.id) ?? 0) > (\u8FBA\u306E\u9806.get(n.b.id) ?? 0) ? n.a : n.b : a\u306F\u672D ? n.a : b\u306F\u672D ? n.b : null;
|
|
6595
6652
|
const \u76F8\u624B = \u52D5\u304B\u3059 === n.a ? n.b : n.a;
|
|
6596
|
-
const reason = \u52D5\u304B\u3059 !== null ? \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(
|
|
6653
|
+
const reason = \u52D5\u304B\u3059 !== null ? \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(
|
|
6654
|
+
\u52D5\u304B\u3059.id,
|
|
6655
|
+
\u76F8\u624B,
|
|
6656
|
+
laid.edges,
|
|
6657
|
+
\u672D\u306E\u969C\u5BB3\u7269,
|
|
6658
|
+
textMetrics
|
|
6659
|
+
) ?? void 0 : void 0;
|
|
6597
6660
|
push(
|
|
6598
6661
|
"clearance",
|
|
6599
6662
|
`${n.a.kind}:${n.a.id} \u2194 ${n.b.kind}:${n.b.id} gap=${n.gap.toFixed(1)}px (need ${n.required}px)`,
|
|
@@ -6607,7 +6670,10 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6607
6670
|
if (!hasRenderedLabel(e)) continue;
|
|
6608
6671
|
const segs = extractPathSegments(e.d);
|
|
6609
6672
|
if (segs.length === 0) continue;
|
|
6610
|
-
const minDist = measurePathLabelGapSegs(
|
|
6673
|
+
const minDist = measurePathLabelGapSegs(
|
|
6674
|
+
flattenPathSegments(segs),
|
|
6675
|
+
computeLabelBBoxWorld(e, textMetrics)
|
|
6676
|
+
);
|
|
6611
6677
|
if (!Number.isFinite(minDist)) continue;
|
|
6612
6678
|
if (minDist > PROXIMITY_ERROR_THRESHOLD) {
|
|
6613
6679
|
push(
|
|
@@ -6657,8 +6723,15 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6657
6723
|
}
|
|
6658
6724
|
for (const e of laid.edges) {
|
|
6659
6725
|
if (!hasRenderedLabel(e)) continue;
|
|
6660
|
-
const mainW = measureTextWidth(e.label ?? "", {
|
|
6661
|
-
|
|
6726
|
+
const mainW = measureTextWidth(e.label ?? "", {
|
|
6727
|
+
fontSize: EDGE_LABEL_TEXT.main.fontSize,
|
|
6728
|
+
textMetrics
|
|
6729
|
+
});
|
|
6730
|
+
const subW = e.sub ? measureTextWidth(e.sub, {
|
|
6731
|
+
fontSize: EDGE_LABEL_TEXT.sub.fontSize,
|
|
6732
|
+
fontFamily: "mono",
|
|
6733
|
+
textMetrics
|
|
6734
|
+
}) : 0;
|
|
6662
6735
|
const expectedBoxW = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
|
|
6663
6736
|
const bbox = bboxes.find((b) => b.kind === "edge-label" && b.id === e.id);
|
|
6664
6737
|
if (!bbox) continue;
|
|
@@ -6800,7 +6873,9 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6800
6873
|
}
|
|
6801
6874
|
}
|
|
6802
6875
|
for (const n of laid.nodes) {
|
|
6803
|
-
const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter(
|
|
6876
|
+
const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter(
|
|
6877
|
+
(line) => droppedLineIsHidden(n.kind, line)
|
|
6878
|
+
);
|
|
6804
6879
|
if (\u843D\u3068\u3057\u305F.length === 0) continue;
|
|
6805
6880
|
push(
|
|
6806
6881
|
"shape-label-dropped",
|
|
@@ -6809,7 +6884,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6809
6884
|
);
|
|
6810
6885
|
}
|
|
6811
6886
|
for (const n of laid.nodes) {
|
|
6812
|
-
const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n);
|
|
6887
|
+
const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics);
|
|
6813
6888
|
if (\u7BB1.length === 0) continue;
|
|
6814
6889
|
let \u5BFE\u8C61 = 0;
|
|
6815
6890
|
const \u843D\u3061\u305F = [];
|
|
@@ -6817,7 +6892,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6817
6892
|
const \u5BA3\u8A00 = b.\u884C.slice(1).filter((r) => r.text.trim() !== "");
|
|
6818
6893
|
if (\u5BA3\u8A00.length === 0) continue;
|
|
6819
6894
|
\u5BFE\u8C61 += 1;
|
|
6820
|
-
const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h).map((r) => r.\u5F79\u5272));
|
|
6895
|
+
const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h, b.\u6E2C\u308B).map((r) => r.\u5F79\u5272));
|
|
6821
6896
|
if (\u5BA3\u8A00.every((r) => \u6B8B\u3063\u305F.has(r.\u5F79\u5272))) continue;
|
|
6822
6897
|
\u843D\u3061\u305F.push({ title: b.\u884C[0]?.text ?? "", h: b.h });
|
|
6823
6898
|
}
|
|
@@ -7880,7 +7955,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
7880
7955
|
const allowedLanes = /* @__PURE__ */ new Set();
|
|
7881
7956
|
if (fromNode) allowedLanes.add(fromNode.lane);
|
|
7882
7957
|
if (toNode) allowedLanes.add(toNode.lane);
|
|
7883
|
-
const box = computeLabelBBoxWorld(e);
|
|
7958
|
+
const box = computeLabelBBoxWorld(e, textMetrics);
|
|
7884
7959
|
for (const lane of laid.lanes) {
|
|
7885
7960
|
if (allowedLanes.has(lane.id)) continue;
|
|
7886
7961
|
const side = rectCrossesLaneBorder(box, lane, rangeByLane.get(lane.id));
|
|
@@ -8004,7 +8079,7 @@ function pickFreeSides(occupied, count) {
|
|
|
8004
8079
|
const \u4F7F\u3046 = \u7A7A\u304D.length > 0 ? \u7A7A\u304D : [SELF_LOOP_SIDE_FALLBACK];
|
|
8005
8080
|
return Array.from({ length: count }, (_, i) => \u4F7F\u3046[i % \u4F7F\u3046.length]);
|
|
8006
8081
|
}
|
|
8007
|
-
function routeSelfLoopGroup(edges, node, side) {
|
|
8082
|
+
function routeSelfLoopGroup(edges, node, side, textMetrics = "proportional") {
|
|
8008
8083
|
const horizontal = side === "left" || side === "right";
|
|
8009
8084
|
const g = sideGeometry(node, side);
|
|
8010
8085
|
const span = fitSpan(horizontal ? node.h : node.w, SELF_LOOP_SPAN);
|
|
@@ -8013,7 +8088,7 @@ function routeSelfLoopGroup(edges, node, side) {
|
|
|
8013
8088
|
const \u6700\u5916 = controlOffset(SELF_LOOP_OUT + (edges.length - 1) * SELF_LOOP_STAGGER);
|
|
8014
8089
|
const \u8A9E\u307E\u3067 = \u6700\u5916 + LABEL_TO_PATH_CLEARANCE;
|
|
8015
8090
|
const \u8A9E\u5E45 = edges.map(
|
|
8016
|
-
(e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub)
|
|
8091
|
+
(e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub, textMetrics)
|
|
8017
8092
|
);
|
|
8018
8093
|
const \u4F4D\u7F6E = [];
|
|
8019
8094
|
let \u7A4D = 0;
|
|
@@ -8043,7 +8118,7 @@ function routeSelfLoopGroup(edges, node, side) {
|
|
|
8043
8118
|
function isSelfLoop(e) {
|
|
8044
8119
|
return e.from === e.to;
|
|
8045
8120
|
}
|
|
8046
|
-
function layoutSelfLoops(edges, nodes, occupiedBySide) {
|
|
8121
|
+
function layoutSelfLoops(edges, nodes, occupiedBySide, textMetrics = "proportional") {
|
|
8047
8122
|
const \u5272\u5F53 = /* @__PURE__ */ new Map();
|
|
8048
8123
|
for (const edge of edges) {
|
|
8049
8124
|
if (edge.side) continue;
|
|
@@ -8070,7 +8145,7 @@ function layoutSelfLoops(edges, nodes, occupiedBySide) {
|
|
|
8070
8145
|
if (\u65E2) \u65E2.edges.push(edge);
|
|
8071
8146
|
else \u675F.set(key, { node, side, edges: [edge] });
|
|
8072
8147
|
}
|
|
8073
|
-
return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side));
|
|
8148
|
+
return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side, textMetrics));
|
|
8074
8149
|
}
|
|
8075
8150
|
|
|
8076
8151
|
// src/layout/tokens.ts
|
|
@@ -8288,7 +8363,7 @@ function verticalDetourBlockers(A, B, obstacles) {
|
|
|
8288
8363
|
function detourColumnFor(blockers, side) {
|
|
8289
8364
|
return side === "left" ? Math.min(...blockers.map((n) => n.cx - n.w / 2)) - VERTICAL_DETOUR_GAP : Math.max(...blockers.map((n) => n.cx + n.w / 2)) + VERTICAL_DETOUR_GAP;
|
|
8290
8365
|
}
|
|
8291
|
-
function layoutEdges(diag, nodes, lanes = []) {
|
|
8366
|
+
function layoutEdges(diag, nodes, lanes = [], textMetrics = "proportional") {
|
|
8292
8367
|
const labelMarginExtra = (diag.viewport?.labelMargin ?? diag.viewport?.gap ?? DEFAULT_LABEL_MARGIN) - DEFAULT_LABEL_MARGIN;
|
|
8293
8368
|
const nmap = new Map(nodes.map((n) => [n.id, n]));
|
|
8294
8369
|
const lmap = new Map(lanes.map((l) => [l.id, l]));
|
|
@@ -8321,7 +8396,7 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8321
8396
|
const to = nmap.get(e.to);
|
|
8322
8397
|
if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
|
|
8323
8398
|
if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
|
|
8324
|
-
const c = curvePath(from, to, e, labelMarginExtra);
|
|
8399
|
+
const c = curvePath(from, to, e, labelMarginExtra, textMetrics);
|
|
8325
8400
|
positionedEdges.push({
|
|
8326
8401
|
...e,
|
|
8327
8402
|
d: c.d,
|
|
@@ -8336,7 +8411,7 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8336
8411
|
const to = nmap.get(e.to);
|
|
8337
8412
|
if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
|
|
8338
8413
|
if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
|
|
8339
|
-
const m = metroPath(from, to, e, labelMarginExtra);
|
|
8414
|
+
const m = metroPath(from, to, e, labelMarginExtra, textMetrics);
|
|
8340
8415
|
positionedEdges.push({
|
|
8341
8416
|
...e,
|
|
8342
8417
|
d: m.d,
|
|
@@ -8384,7 +8459,7 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8384
8459
|
\u4F7F\u3046(le.from, le.fromSide);
|
|
8385
8460
|
\u4F7F\u3046(le.to, le.toSide);
|
|
8386
8461
|
}
|
|
8387
|
-
const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide);
|
|
8462
|
+
const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide, textMetrics);
|
|
8388
8463
|
const labelOffsetsByEdgeId = /* @__PURE__ */ new Map();
|
|
8389
8464
|
const parallelKey = (p) => p.e.from < p.e.to ? `${p.e.from}::${p.e.to}` : `${p.e.to}::${p.e.from}`;
|
|
8390
8465
|
const byParallel = /* @__PURE__ */ new Map();
|
|
@@ -8538,7 +8613,7 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8538
8613
|
const others = nodes.filter((n) => n.id !== c.from && n.id !== c.to);
|
|
8539
8614
|
if (others.some((n) => segmentsCrossRect(segs, nodeRect(n)))) return true;
|
|
8540
8615
|
if (!hasRenderedLabel(c.e)) return false;
|
|
8541
|
-
const boxW = computeLabelBoxW(c.e.label, c.e.sub);
|
|
8616
|
+
const boxW = computeLabelBoxW(c.e.label, c.e.sub, textMetrics);
|
|
8542
8617
|
const boxH = labelPillH(c.e.sub);
|
|
8543
8618
|
const centerX = columnX - (labelPathClearanceHorizontal(c.e) + boxW / 2);
|
|
8544
8619
|
const pill = { x: centerX - boxW / 2, y: (exitY + returnY) / 2 - boxH / 2, w: boxW, h: boxH };
|
|
@@ -8653,7 +8728,8 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8653
8728
|
allOtherNodes,
|
|
8654
8729
|
{ x: endpointOffset.fromDx, y: endpointOffset.fromDy },
|
|
8655
8730
|
{ x: endpointOffset.toDx, y: endpointOffset.toDy },
|
|
8656
|
-
avoidRects
|
|
8731
|
+
avoidRects,
|
|
8732
|
+
textMetrics
|
|
8657
8733
|
);
|
|
8658
8734
|
const routed1 = route([]);
|
|
8659
8735
|
const { d, labelX, labelY, labelAnchor, labelAltX } = routed1;
|
|
@@ -8709,13 +8785,13 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8709
8785
|
const pillById = /* @__PURE__ */ new Map();
|
|
8710
8786
|
for (const r of list) {
|
|
8711
8787
|
if (!hasRenderedLabel(r.e)) continue;
|
|
8712
|
-
const w = computeLabelBoxW(r.e.label, r.e.sub);
|
|
8788
|
+
const w = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
|
|
8713
8789
|
const h = labelPillH(r.e.sub);
|
|
8714
8790
|
pillById.set(r.e.id, { x: r.baseLabelX - w / 2, y: r.baseLabelY - h / 2, w, h });
|
|
8715
8791
|
}
|
|
8716
8792
|
for (const le of positionedEdges) {
|
|
8717
8793
|
if (!hasRenderedLabel(le)) continue;
|
|
8718
|
-
const w = computeLabelBoxW(le.label, le.sub);
|
|
8794
|
+
const w = computeLabelBoxW(le.label, le.sub, textMetrics);
|
|
8719
8795
|
const h = labelPillH(le.sub);
|
|
8720
8796
|
pillById.set(le.id, { x: le.labelX - w / 2, y: le.labelY - h / 2, w, h });
|
|
8721
8797
|
}
|
|
@@ -8745,7 +8821,7 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8745
8821
|
const laneOfNode = new Map(nodes.map((n) => [n.id, n.lane]));
|
|
8746
8822
|
for (const r of flippable) {
|
|
8747
8823
|
const ownSegs = segsByEdgeId.get(r.e.id);
|
|
8748
|
-
const boxW = computeLabelBoxW(r.e.label, r.e.sub);
|
|
8824
|
+
const boxW = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
|
|
8749
8825
|
const boxH = labelPillH(r.e.sub);
|
|
8750
8826
|
const pillAt = (centerX) => ({
|
|
8751
8827
|
x: centerX - boxW / 2,
|
|
@@ -8790,7 +8866,7 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8790
8866
|
if (list.length < 2) continue;
|
|
8791
8867
|
const boxes = list.map((r) => ({
|
|
8792
8868
|
cx: r.baseLabelX,
|
|
8793
|
-
halfW: computeLabelBoxW(r.e.label, r.e.sub) / 2
|
|
8869
|
+
halfW: computeLabelBoxW(r.e.label, r.e.sub, textMetrics) / 2
|
|
8794
8870
|
}));
|
|
8795
8871
|
const overlapsX = (i, j) => Math.abs(boxes[i].cx - boxes[j].cx) < boxes[i].halfW + boxes[j].halfW + CLEARANCE_LABEL_LABEL;
|
|
8796
8872
|
const componentOf = list.map((_, i) => i);
|
|
@@ -8840,7 +8916,7 @@ function layoutEdges(diag, nodes, lanes = []) {
|
|
|
8840
8916
|
r,
|
|
8841
8917
|
baseX: r.baseLabelX,
|
|
8842
8918
|
baseY: r.baseLabelY,
|
|
8843
|
-
w: computeLabelBoxW(r.e.label, r.e.sub),
|
|
8919
|
+
w: computeLabelBoxW(r.e.label, r.e.sub, textMetrics),
|
|
8844
8920
|
h: labelPillH(r.e.sub)
|
|
8845
8921
|
}));
|
|
8846
8922
|
items.sort((a, b) => a.baseX - b.baseX);
|
|
@@ -8952,7 +9028,7 @@ function singleStraightSegment(d) {
|
|
|
8952
9028
|
if (x1 === x2 && y1 === y2) return null;
|
|
8953
9029
|
return { x1, y1, x2, y2 };
|
|
8954
9030
|
}
|
|
8955
|
-
function bowSharedStraightPaths(edges, nodes, skipIds) {
|
|
9031
|
+
function bowSharedStraightPaths(edges, nodes, skipIds, textMetrics = "proportional") {
|
|
8956
9032
|
const groups = /* @__PURE__ */ new Map();
|
|
8957
9033
|
for (const e of edges) {
|
|
8958
9034
|
if (skipIds.has(e.id)) continue;
|
|
@@ -8988,7 +9064,7 @@ function bowSharedStraightPaths(edges, nodes, skipIds) {
|
|
|
8988
9064
|
)
|
|
8989
9065
|
);
|
|
8990
9066
|
const groupIds = new Set(group.map((g) => g.e.id));
|
|
8991
|
-
const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x));
|
|
9067
|
+
const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x, textMetrics));
|
|
8992
9068
|
const nodeRects = nodes.map((n) => ({ x: n.cx - n.w / 2, y: n.cy - n.h / 2, w: n.w, h: n.h }));
|
|
8993
9069
|
const build = (seg, offset) => {
|
|
8994
9070
|
const cx = midX + nx * offset * 2;
|
|
@@ -9031,6 +9107,55 @@ function bowSharedStraightPaths(edges, nodes, skipIds) {
|
|
|
9031
9107
|
function nodeRect(n) {
|
|
9032
9108
|
return { x: n.cx - n.w / 2, y: n.cy - n.h / 2, w: n.w, h: n.h };
|
|
9033
9109
|
}
|
|
9110
|
+
function countPathObstacleCrossings(d, obstacles) {
|
|
9111
|
+
const segments = flattenPathSegments(extractPathSegments(d));
|
|
9112
|
+
return obstacles.filter((obstacle) => segmentsCrossRect(segments, nodeRect(obstacle))).length;
|
|
9113
|
+
}
|
|
9114
|
+
function makeBackDetourCandidate(A, B, from, to, obstacles, detourY, side) {
|
|
9115
|
+
const lowIsA = A.y >= B.y;
|
|
9116
|
+
const low = lowIsA ? A : B;
|
|
9117
|
+
const lowBendY = low.y - VERTICAL_DETOUR_EXIT;
|
|
9118
|
+
const bandTop = Math.min(detourY, lowBendY);
|
|
9119
|
+
const bandBottom = Math.max(detourY, lowBendY);
|
|
9120
|
+
const bandObstacles = obstacles.map(nodeRect).filter((rect) => rect.y + rect.h >= bandTop && rect.y <= bandBottom);
|
|
9121
|
+
let columnX = detourColumnFor([from, to], side);
|
|
9122
|
+
while (true) {
|
|
9123
|
+
const blockers = bandObstacles.filter(
|
|
9124
|
+
(rect) => rect.x - VERTICAL_DETOUR_GAP < columnX && columnX < rect.x + rect.w + VERTICAL_DETOUR_GAP
|
|
9125
|
+
);
|
|
9126
|
+
if (blockers.length === 0) break;
|
|
9127
|
+
columnX = side === "left" ? Math.min(...blockers.map((rect) => rect.x - VERTICAL_DETOUR_GAP)) : Math.max(...blockers.map((rect) => rect.x + rect.w + VERTICAL_DETOUR_GAP));
|
|
9128
|
+
}
|
|
9129
|
+
const bendAY = lowIsA ? lowBendY : detourY;
|
|
9130
|
+
const bendBY = lowIsA ? detourY : lowBendY;
|
|
9131
|
+
const vertices = [
|
|
9132
|
+
A,
|
|
9133
|
+
{ x: A.x, y: bendAY },
|
|
9134
|
+
{ x: columnX, y: bendAY },
|
|
9135
|
+
{ x: columnX, y: bendBY },
|
|
9136
|
+
{ x: B.x, y: bendBY },
|
|
9137
|
+
B
|
|
9138
|
+
];
|
|
9139
|
+
const d = verticesToPath(vertices);
|
|
9140
|
+
const high = lowIsA ? B : A;
|
|
9141
|
+
return {
|
|
9142
|
+
d,
|
|
9143
|
+
labelX: (high.x + columnX) / 2,
|
|
9144
|
+
crossings: countPathObstacleCrossings(d, obstacles),
|
|
9145
|
+
length: vertices.slice(1).reduce((sum, vertex, index) => {
|
|
9146
|
+
const previous = vertices[index];
|
|
9147
|
+
return sum + Math.hypot(vertex.x - previous.x, vertex.y - previous.y);
|
|
9148
|
+
}, 0)
|
|
9149
|
+
};
|
|
9150
|
+
}
|
|
9151
|
+
function chooseBackDetourCandidate(A, B, from, to, obstacles, detourY) {
|
|
9152
|
+
const left = makeBackDetourCandidate(A, B, from, to, obstacles, detourY, "left");
|
|
9153
|
+
const right = makeBackDetourCandidate(A, B, from, to, obstacles, detourY, "right");
|
|
9154
|
+
if (left.crossings !== right.crossings) return left.crossings < right.crossings ? left : right;
|
|
9155
|
+
if (Math.abs(left.length - right.length) >= 0.5) return left.length < right.length ? left : right;
|
|
9156
|
+
const preferred = Math.abs(A.x - B.x) < 0.5 ? "right" : A.x < B.x ? "left" : "right";
|
|
9157
|
+
return preferred === "left" ? left : right;
|
|
9158
|
+
}
|
|
9034
9159
|
function rectGap(a, b) {
|
|
9035
9160
|
const dx = Math.max(0, a.x - (b.x + b.w), b.x - (a.x + a.w));
|
|
9036
9161
|
const dy = Math.max(0, a.y - (b.y + b.h), b.y - (a.y + a.h));
|
|
@@ -9108,8 +9233,8 @@ function sidePoint(n, side) {
|
|
|
9108
9233
|
return { x: n.cx + n.w / 2, y: n.cy };
|
|
9109
9234
|
}
|
|
9110
9235
|
}
|
|
9111
|
-
function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _fromLane, _toLane, edge, labelObstacles = obstacles, fromOffset = { x: 0, y: 0 }, toOffset = { x: 0, y: 0 }, avoidRects = []) {
|
|
9112
|
-
const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub) : 0;
|
|
9236
|
+
function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _fromLane, _toLane, edge, labelObstacles = obstacles, fromOffset = { x: 0, y: 0 }, toOffset = { x: 0, y: 0 }, avoidRects = [], textMetrics = "proportional") {
|
|
9237
|
+
const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub, textMetrics) : 0;
|
|
9113
9238
|
const labelHalfW = labelBoxW / 2;
|
|
9114
9239
|
const labelInit = labelInitClearance(edge);
|
|
9115
9240
|
const verticalPair = fromSide === "bottom" && toSide === "top" || fromSide === "top" && toSide === "bottom";
|
|
@@ -9481,7 +9606,7 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
|
|
|
9481
9606
|
const detourY = Math.min(A.y, B.y) - 100;
|
|
9482
9607
|
const corner = 14;
|
|
9483
9608
|
const xDir = B.x > A.x ? 1 : -1;
|
|
9484
|
-
|
|
9609
|
+
const existing = {
|
|
9485
9610
|
d: `M ${A.x} ${A.y}
|
|
9486
9611
|
L ${A.x} ${detourY + corner}
|
|
9487
9612
|
Q ${A.x} ${detourY}, ${A.x + xDir * corner} ${detourY}
|
|
@@ -9495,6 +9620,16 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
|
|
|
9495
9620
|
labelY: detourY - labelInit,
|
|
9496
9621
|
labelAnchor: "middle"
|
|
9497
9622
|
};
|
|
9623
|
+
const existingCrossings = countPathObstacleCrossings(existing.d, obstacles);
|
|
9624
|
+
if (existingCrossings === 0) return existing;
|
|
9625
|
+
const candidate = chooseBackDetourCandidate(A, B, from, to, obstacles, detourY);
|
|
9626
|
+
if (candidate.crossings >= existingCrossings) return existing;
|
|
9627
|
+
return {
|
|
9628
|
+
d: candidate.d,
|
|
9629
|
+
labelX: candidate.labelX,
|
|
9630
|
+
labelY: detourY - labelInit,
|
|
9631
|
+
labelAnchor: "middle"
|
|
9632
|
+
};
|
|
9498
9633
|
}
|
|
9499
9634
|
const midX = fromSide === "left" || fromSide === "right" ? B.x : A.x;
|
|
9500
9635
|
const midY = fromSide === "top" || fromSide === "bottom" ? B.y : A.y;
|
|
@@ -9508,7 +9643,7 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
|
|
|
9508
9643
|
labelAnchor: "middle"
|
|
9509
9644
|
};
|
|
9510
9645
|
}
|
|
9511
|
-
function repositionParallelLabels(edges, nodes) {
|
|
9646
|
+
function repositionParallelLabels(edges, nodes, textMetrics = "proportional") {
|
|
9512
9647
|
const allSegs = new Map(
|
|
9513
9648
|
edges.map((e) => [e.id, flattenPathSegments(extractPathSegments(e.d))])
|
|
9514
9649
|
);
|
|
@@ -9533,7 +9668,7 @@ function repositionParallelLabels(edges, nodes) {
|
|
|
9533
9668
|
for (const pair of byPair.values()) {
|
|
9534
9669
|
if (pair.length < 2) continue;
|
|
9535
9670
|
const pairOrder = [...pair].sort(compareSharedPairOrder);
|
|
9536
|
-
const boxes = pair.map((e) => computeLabelBBoxWorld(e));
|
|
9671
|
+
const boxes = pair.map((e) => computeLabelBBoxWorld(e, textMetrics));
|
|
9537
9672
|
const componentOf = pair.map((_, i) => i);
|
|
9538
9673
|
for (let i = 0; i < pair.length; i++) {
|
|
9539
9674
|
for (let j = i + 1; j < pair.length; j++) {
|
|
@@ -9558,17 +9693,27 @@ function repositionParallelLabels(edges, nodes) {
|
|
|
9558
9693
|
nodes,
|
|
9559
9694
|
allEdges: edges,
|
|
9560
9695
|
allSegs,
|
|
9561
|
-
xRange
|
|
9696
|
+
xRange,
|
|
9697
|
+
textMetrics
|
|
9562
9698
|
});
|
|
9563
9699
|
for (let i = 0; i < members.length; i++) members[i].labelY = placed[i];
|
|
9564
9700
|
}
|
|
9565
9701
|
}
|
|
9566
9702
|
}
|
|
9567
9703
|
function placeAvoidingSiblingPaths(args) {
|
|
9568
|
-
const {
|
|
9704
|
+
const {
|
|
9705
|
+
members,
|
|
9706
|
+
pair,
|
|
9707
|
+
pairOrder,
|
|
9708
|
+
nodes,
|
|
9709
|
+
allEdges,
|
|
9710
|
+
allSegs,
|
|
9711
|
+
xRange,
|
|
9712
|
+
textMetrics = "proportional"
|
|
9713
|
+
} = args;
|
|
9569
9714
|
const sizes = members.map((e) => labelPillH(e.sub));
|
|
9570
9715
|
const wants = members.map((e) => e.labelY);
|
|
9571
|
-
const boxes = members.map((e) => computeLabelBBoxWorld(e));
|
|
9716
|
+
const boxes = members.map((e) => computeLabelBBoxWorld(e, textMetrics));
|
|
9572
9717
|
const all = members.map((_, i) => i);
|
|
9573
9718
|
const spread = (idx) => spreadWithMinimalShift(
|
|
9574
9719
|
idx.map((i) => ({ want: wants[i], size: sizes[i] })),
|
|
@@ -9759,14 +9904,14 @@ function labelRectAt(cx, cy, w, h) {
|
|
|
9759
9904
|
function inflate(r, pad) {
|
|
9760
9905
|
return { x: r.x - pad, y: r.y - pad, w: r.w + pad * 2, h: r.h + pad * 2 };
|
|
9761
9906
|
}
|
|
9762
|
-
function slideLabelsAlongOwnPath(edges, nodes) {
|
|
9907
|
+
function slideLabelsAlongOwnPath(edges, nodes, textMetrics = "proportional") {
|
|
9763
9908
|
const withLabel = edges.filter((e) => hasRenderedLabel(e));
|
|
9764
9909
|
if (withLabel.length === 0) return;
|
|
9765
9910
|
const segsById = /* @__PURE__ */ new Map();
|
|
9766
9911
|
for (const e of edges) segsById.set(e.id, flattenPathSegments(extractPathSegments(e.d)));
|
|
9767
9912
|
const nodeRects = nodes.map(nodeRect);
|
|
9768
9913
|
for (const e of withLabel) {
|
|
9769
|
-
const w = computeLabelBoxW(e.label, e.sub);
|
|
9914
|
+
const w = computeLabelBoxW(e.label, e.sub, textMetrics);
|
|
9770
9915
|
const h = labelPillH(e.sub);
|
|
9771
9916
|
if (w === 0 || h === 0) continue;
|
|
9772
9917
|
const own = segsById.get(e.id) ?? [];
|
|
@@ -10068,7 +10213,7 @@ function separateSharedStraightRuns(edges, nodes) {
|
|
|
10068
10213
|
e.d = verticesToPath(verts.get(e.id));
|
|
10069
10214
|
}
|
|
10070
10215
|
}
|
|
10071
|
-
function pullOutgoingFirstCorner(edges, nodes) {
|
|
10216
|
+
function pullOutgoingFirstCorner(edges, nodes, textMetrics = "proportional") {
|
|
10072
10217
|
if (edges.length < 2) return;
|
|
10073
10218
|
const \u675F = /* @__PURE__ */ new Map();
|
|
10074
10219
|
const \u540C\u3058\u7D44\u306E\u6570 = /* @__PURE__ */ new Map();
|
|
@@ -10122,10 +10267,10 @@ function pullOutgoingFirstCorner(edges, nodes) {
|
|
|
10122
10267
|
}
|
|
10123
10268
|
e.d = \u524D;
|
|
10124
10269
|
if (!\u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F) {
|
|
10125
|
-
slideLabelsAlongOwnPath(edges, nodes);
|
|
10270
|
+
slideLabelsAlongOwnPath(edges, nodes, textMetrics);
|
|
10126
10271
|
\u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F = true;
|
|
10127
10272
|
}
|
|
10128
|
-
const labelBox = computeLabelBBoxWorld(e);
|
|
10273
|
+
const labelBox = computeLabelBBoxWorld(e, textMetrics);
|
|
10129
10274
|
const label = { x: labelBox.x + labelBox.w / 2, y: labelBox.y + labelBox.h / 2 };
|
|
10130
10275
|
const \u7DDA\u5206\u307E\u3067\u306E\u8DDD\u96E22 = (a, b) => {
|
|
10131
10276
|
const dx = b.x - a.x;
|
|
@@ -10237,13 +10382,13 @@ function fanIncomingEndpoints(edges, nodes) {
|
|
|
10237
10382
|
}
|
|
10238
10383
|
return \u7D42\u70B9\u306E\u79FB\u52D5;
|
|
10239
10384
|
}
|
|
10240
|
-
function followLabelsToFannedTails(edges, obstacles, shifts) {
|
|
10385
|
+
function followLabelsToFannedTails(edges, obstacles, shifts, textMetrics = "proportional") {
|
|
10241
10386
|
if (shifts.size === 0) return;
|
|
10242
10387
|
const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
|
|
10243
10388
|
const labels = edges.filter(hasRenderedLabel).map((e) => ({
|
|
10244
10389
|
kind: "edge-label",
|
|
10245
10390
|
id: e.id,
|
|
10246
|
-
...computeLabelBBoxWorld(e)
|
|
10391
|
+
...computeLabelBBoxWorld(e, textMetrics)
|
|
10247
10392
|
}));
|
|
10248
10393
|
const labelIndexByEdgeId = new Map(labels.map((label, index) => [label.id, index]));
|
|
10249
10394
|
const edgeById = new Map(edges.map((e) => [e.id, e]));
|
|
@@ -10275,7 +10420,7 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
|
|
|
10275
10420
|
labelY: e.labelY + \u79FB\u52D5.dy,
|
|
10276
10421
|
labelAnchor: e.labelAnchor
|
|
10277
10422
|
};
|
|
10278
|
-
const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa });
|
|
10423
|
+
const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa }, textMetrics);
|
|
10279
10424
|
const \u6700\u5F8C\u306F\u7E26 = Math.abs(\u6700\u5F8C.x2 - \u6700\u5F8C.x1) <= Math.abs(\u6700\u5F8C.y2 - \u6700\u5F8C.y1);
|
|
10280
10425
|
const \u5019\u88DC = [
|
|
10281
10426
|
\u5019\u88DCa,
|
|
@@ -10286,7 +10431,11 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
|
|
|
10286
10431
|
}
|
|
10287
10432
|
];
|
|
10288
10433
|
for (const c of \u5019\u88DC) {
|
|
10289
|
-
const \u672D = {
|
|
10434
|
+
const \u672D = {
|
|
10435
|
+
kind: "edge-label",
|
|
10436
|
+
id: e.id,
|
|
10437
|
+
...computeLabelBBoxWorld({ ...e, ...c }, textMetrics)
|
|
10438
|
+
};
|
|
10290
10439
|
if (segmentsCrossRect([\u6700\u5F8C], \u672D)) continue;
|
|
10291
10440
|
if (\u672D\u306E\u79FB\u52D5\u3092\u585E\u3050\u76F8\u624B\u3092\u63A2\u3059(\u5468\u308A, \u5143\u306E\u672D, \u672D) !== null) continue;
|
|
10292
10441
|
e.labelX = c.labelX;
|
|
@@ -10480,7 +10629,7 @@ function expandLanesForNodes(lanes, nodes) {
|
|
|
10480
10629
|
};
|
|
10481
10630
|
});
|
|
10482
10631
|
}
|
|
10483
|
-
function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
|
|
10632
|
+
function expandLaneGapsForEdgeLabels(lanes, nodes, edges, textMetrics = "proportional") {
|
|
10484
10633
|
if (lanes.length < 2) return lanes;
|
|
10485
10634
|
const layoutedLanes = lanes.filter((l) => !(l.posX !== void 0 && l.posY !== void 0));
|
|
10486
10635
|
if (layoutedLanes.length < 2) return lanes;
|
|
@@ -10496,7 +10645,7 @@ function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
|
|
|
10496
10645
|
const fi = laneIndexById.get(fromLane);
|
|
10497
10646
|
const ti = laneIndexById.get(toLane);
|
|
10498
10647
|
if (fi === void 0 || ti === void 0 || fi === ti) continue;
|
|
10499
|
-
const labelBoxW = computeLabelBoxW(edge.label, edge.sub);
|
|
10648
|
+
const labelBoxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
|
|
10500
10649
|
if (labelBoxW === 0) continue;
|
|
10501
10650
|
const lo = Math.min(fi, ti);
|
|
10502
10651
|
const hi = Math.max(fi, ti);
|
|
@@ -10618,7 +10767,7 @@ function \u7DDA\u306E\u7AEF\u306E\u5411\u304D(d, \u7AEF) {
|
|
|
10618
10767
|
const \u5019\u88DC = segs.flatMap((s) => [...s.ctrl ?? [], { x: s.x2, y: s.y2 }]);
|
|
10619
10768
|
return \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC);
|
|
10620
10769
|
}
|
|
10621
|
-
function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
|
|
10770
|
+
function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head", textMetrics = "proportional") {
|
|
10622
10771
|
const text = (\u7AEF === "head" ? edge.headLabel : edge.tailLabel)?.trim();
|
|
10623
10772
|
if (!text) return null;
|
|
10624
10773
|
const \u5411\u304D = \u7DDA\u306E\u7AEF\u306E\u5411\u304D(edge.d, \u7AEF);
|
|
@@ -10629,7 +10778,8 @@ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
|
|
|
10629
10778
|
const w = measureTextWidth(text, {
|
|
10630
10779
|
fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
|
|
10631
10780
|
fontWeight: EDGE_LABEL_TEXT.sub.fontWeight,
|
|
10632
|
-
fontFamily: "mono"
|
|
10781
|
+
fontFamily: "mono",
|
|
10782
|
+
textMetrics
|
|
10633
10783
|
});
|
|
10634
10784
|
const h = \u7BB1\u306E\u9AD8\u3055;
|
|
10635
10785
|
const \u672D = hasRenderedLabel(edge) && edge.labelX !== void 0 && edge.labelY !== void 0 ? { x: edge.labelX, y: edge.labelY } : null;
|
|
@@ -10678,10 +10828,10 @@ function autoStorageHeight(n, defaultH) {
|
|
|
10678
10828
|
}
|
|
10679
10829
|
return Math.max(defaultH, \u5FC5\u8981);
|
|
10680
10830
|
}
|
|
10681
|
-
function autoRowsWidth(n, defaultW) {
|
|
10831
|
+
function autoRowsWidth(n, defaultW, textMetrics = "proportional") {
|
|
10682
10832
|
if (n.w != null) return n.w;
|
|
10683
10833
|
if (!n.rows || n.rows.length === 0) return defaultW;
|
|
10684
|
-
const required = requiredRowsWidth(n.rows, n.kind);
|
|
10834
|
+
const required = requiredRowsWidth(n.rows, n.kind, textMetrics);
|
|
10685
10835
|
return Math.max(defaultW, required);
|
|
10686
10836
|
}
|
|
10687
10837
|
function \u7BB1\u306E\u9AD8\u30552(n, \u65E2\u5B9Ah) {
|
|
@@ -10719,7 +10869,7 @@ function requiredStackGapForEdgeLabels(diag, allStacks) {
|
|
|
10719
10869
|
}
|
|
10720
10870
|
return required;
|
|
10721
10871
|
}
|
|
10722
|
-
function layoutNodes(diag, lanes) {
|
|
10872
|
+
function layoutNodes(diag, lanes, textMetrics) {
|
|
10723
10873
|
const laneMap = new Map(lanes.map((l) => [l.id, l]));
|
|
10724
10874
|
const allStacks = Array.from(new Set(diag.nodes.map((n) => n.stack))).sort((a, b) => a - b);
|
|
10725
10875
|
const rowH = /* @__PURE__ */ new Map();
|
|
@@ -10763,7 +10913,7 @@ function layoutNodes(diag, lanes) {
|
|
|
10763
10913
|
}
|
|
10764
10914
|
const size = NODE_SIZE[n.kind];
|
|
10765
10915
|
if (n.posX !== void 0 && n.posY !== void 0) {
|
|
10766
|
-
const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w);
|
|
10916
|
+
const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w, textMetrics);
|
|
10767
10917
|
const h2 = n.posH ?? n.h ?? rowH.get(n.stack) ?? size.h;
|
|
10768
10918
|
out.push({
|
|
10769
10919
|
...n,
|
|
@@ -10781,7 +10931,7 @@ function layoutNodes(diag, lanes) {
|
|
|
10781
10931
|
const \u81EA\u524D\u306E\u9AD8\u3055 = n.rowMarks !== void 0;
|
|
10782
10932
|
const h = n.h ?? (\u81EA\u524D\u306E\u9AD8\u3055 ? \u7BB1\u306E\u9AD8\u30552(n, size.h) : \u6BB5\u306E\u9AD8\u3055);
|
|
10783
10933
|
const cy = \u6BB5\u306E\u82AF;
|
|
10784
|
-
const w = autoRowsWidth(n, size.w);
|
|
10934
|
+
const w = autoRowsWidth(n, size.w, textMetrics);
|
|
10785
10935
|
out.push({
|
|
10786
10936
|
...n,
|
|
10787
10937
|
cx,
|
|
@@ -10901,10 +11051,16 @@ function applyRowLevelNodeShifts(nodes, lanes, nodeShifts) {
|
|
|
10901
11051
|
return moved ? { nodes: outNodes, lanes: outLanes } : null;
|
|
10902
11052
|
}
|
|
10903
11053
|
function layout(diag) {
|
|
11054
|
+
const textMetrics = resolveTextMetrics(diag.textMetrics);
|
|
10904
11055
|
const lanes = layoutLanes(diag);
|
|
10905
|
-
const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes));
|
|
11056
|
+
const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes, textMetrics));
|
|
10906
11057
|
const expandedLanes = expandLanesForNodes(lanes, rawNodes);
|
|
10907
|
-
const gapExpandedLanes = expandLaneGapsForEdgeLabels(
|
|
11058
|
+
const gapExpandedLanes = expandLaneGapsForEdgeLabels(
|
|
11059
|
+
expandedLanes,
|
|
11060
|
+
rawNodes,
|
|
11061
|
+
diag.edges,
|
|
11062
|
+
textMetrics
|
|
11063
|
+
);
|
|
10908
11064
|
const nodes = rawNodes.map((n) => {
|
|
10909
11065
|
if (n.posX !== void 0 && n.posY !== void 0) return n;
|
|
10910
11066
|
const oldLane = lanes.find((l) => l.id === n.lane);
|
|
@@ -10913,13 +11069,13 @@ function layout(diag) {
|
|
|
10913
11069
|
return { ...n, cx: newLane.x + newLane.width / 2 };
|
|
10914
11070
|
});
|
|
10915
11071
|
const containedLanesPre = recomputeContainedLanes(gapExpandedLanes, nodes);
|
|
10916
|
-
const edgesPre = layoutEdges(diag, nodes, containedLanesPre);
|
|
10917
|
-
const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre);
|
|
11072
|
+
const edgesPre = layoutEdges(diag, nodes, containedLanesPre, textMetrics);
|
|
11073
|
+
const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre, textMetrics);
|
|
10918
11074
|
const collisionsPre = detectCollisions(bboxesPre, edgesPre);
|
|
10919
11075
|
const nodesResolved = resolveOverlaps(nodes, collisionsPre);
|
|
10920
11076
|
const moved = nodesResolved !== nodes;
|
|
10921
11077
|
const containedLanes = moved ? recomputeContainedLanes(gapExpandedLanes, nodesResolved) : containedLanesPre;
|
|
10922
|
-
const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes) : edgesPre;
|
|
11078
|
+
const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes, textMetrics) : edgesPre;
|
|
10923
11079
|
const chainShiftClearance = Math.max(CLEARANCE_LABEL_LABEL, CLEARANCE_NODE_LABEL);
|
|
10924
11080
|
let edges;
|
|
10925
11081
|
let nodesFinal = nodesResolved;
|
|
@@ -10930,10 +11086,13 @@ function layout(diag) {
|
|
|
10930
11086
|
} else {
|
|
10931
11087
|
const propagateResult = resolveEdgeLabelOverlapsWithChainAndPropagate(
|
|
10932
11088
|
edgesAfterMove,
|
|
10933
|
-
collectBBoxes(containedLanes, nodesResolved, []).filter(
|
|
11089
|
+
collectBBoxes(containedLanes, nodesResolved, [], textMetrics).filter(
|
|
10934
11090
|
(b) => b.kind === "node" || b.kind === "lane-label"
|
|
10935
11091
|
),
|
|
10936
|
-
chainShiftClearance
|
|
11092
|
+
chainShiftClearance,
|
|
11093
|
+
void 0,
|
|
11094
|
+
void 0,
|
|
11095
|
+
textMetrics
|
|
10937
11096
|
);
|
|
10938
11097
|
edges = propagateResult.edges;
|
|
10939
11098
|
if (propagateResult.nodeShifts.size > 0) {
|
|
@@ -10945,7 +11104,7 @@ function layout(diag) {
|
|
|
10945
11104
|
}
|
|
10946
11105
|
if (nodesFinal !== nodesResolved) {
|
|
10947
11106
|
containedLanesFinal = recomputeContainedLanes(laneShiftedBase, nodesFinal);
|
|
10948
|
-
edges = layoutEdges(diag, nodesFinal, containedLanesFinal);
|
|
11107
|
+
edges = layoutEdges(diag, nodesFinal, containedLanesFinal, textMetrics);
|
|
10949
11108
|
}
|
|
10950
11109
|
}
|
|
10951
11110
|
const positionedEdgeIds = new Set(
|
|
@@ -10953,21 +11112,31 @@ function layout(diag) {
|
|
|
10953
11112
|
(e) => e.routing === "curve" || e.routing === "metro" || e.posX1 !== void 0 && e.posY1 !== void 0 && e.posX2 !== void 0 && e.posY2 !== void 0
|
|
10954
11113
|
).map((e) => e.id)
|
|
10955
11114
|
);
|
|
10956
|
-
bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds);
|
|
10957
|
-
pullOutgoingFirstCorner(edges, nodesFinal);
|
|
11115
|
+
bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds, textMetrics);
|
|
11116
|
+
pullOutgoingFirstCorner(edges, nodesFinal, textMetrics);
|
|
10958
11117
|
const fannedTailShifts = fanIncomingEndpoints(edges, nodesFinal);
|
|
10959
11118
|
separateSharedStraightRuns(edges, nodesFinal);
|
|
10960
11119
|
hopEdgeCrossings(edges);
|
|
10961
|
-
const labelClearanceObstacles = collectBBoxes(
|
|
11120
|
+
const labelClearanceObstacles = collectBBoxes(
|
|
11121
|
+
containedLanesFinal,
|
|
11122
|
+
nodesFinal,
|
|
11123
|
+
[],
|
|
11124
|
+
textMetrics
|
|
11125
|
+
).filter(
|
|
10962
11126
|
(b) => b.kind === "node" || b.kind === "lane-label"
|
|
10963
11127
|
);
|
|
10964
|
-
followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts);
|
|
10965
|
-
repositionParallelLabels(edges, nodesFinal);
|
|
10966
|
-
slideLabelsAlongOwnPath(edges, nodesFinal);
|
|
11128
|
+
followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts, textMetrics);
|
|
11129
|
+
repositionParallelLabels(edges, nodesFinal, textMetrics);
|
|
11130
|
+
slideLabelsAlongOwnPath(edges, nodesFinal, textMetrics);
|
|
10967
11131
|
if (!isChainEdgeLabelDisabled()) {
|
|
10968
|
-
edges = resolveLabelClearanceAfterPathPasses(
|
|
11132
|
+
edges = resolveLabelClearanceAfterPathPasses(
|
|
11133
|
+
edges,
|
|
11134
|
+
labelClearanceObstacles,
|
|
11135
|
+
void 0,
|
|
11136
|
+
textMetrics
|
|
11137
|
+
);
|
|
10969
11138
|
}
|
|
10970
|
-
const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges);
|
|
11139
|
+
const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges, textMetrics);
|
|
10971
11140
|
const collisions = detectCollisions(bboxes, edges);
|
|
10972
11141
|
const nearCollisions = detectNearCollisions(bboxes, edges);
|
|
10973
11142
|
if (collisions.length > 0) {
|
|
@@ -11007,6 +11176,8 @@ function layout(diag) {
|
|
|
11007
11176
|
// 描画側の固定の字の言語 (#847)。 既定 (`en`) と型の外の値は持たせない = 配置の結果の形を
|
|
11008
11177
|
// 変更前と揃え、記法の書き損じで一部の字だけ日本語になる形を作らない
|
|
11009
11178
|
...resolveLang(diag.lang) === "ja" ? { lang: "ja" } : {},
|
|
11179
|
+
// 既定は持ち越さない。既存の LaidDiagram の形を変えず、等幅の図だけ描画へ伝える
|
|
11180
|
+
...textMetrics === "monospace" ? { textMetrics: "monospace" } : {},
|
|
11010
11181
|
// 種類も配色と同じく空の目印を出さない。 遮断をここに揃えると手書きの図にも効く
|
|
11011
11182
|
...diag.type ? { type: diag.type } : {},
|
|
11012
11183
|
bboxes,
|
|
@@ -11915,6 +12086,7 @@ function CdlEdgeView({
|
|
|
11915
12086
|
"data-cdl-edge-label": edge.label,
|
|
11916
12087
|
"data-cdl-edge-sub": edge.sub ?? "",
|
|
11917
12088
|
"data-cdl-tone": edge.tone,
|
|
12089
|
+
"data-cdl-edge-role": edge.role,
|
|
11918
12090
|
children: [
|
|
11919
12091
|
isDotted ? /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
11920
12092
|
/* @__PURE__ */ jsxRuntime.jsx("path", { id: glowPathId, d: glowPathD, fill: "none", stroke: "none" }),
|
|
@@ -12066,11 +12238,12 @@ function CdlEdgeGlowView({
|
|
|
12066
12238
|
}
|
|
12067
12239
|
function CdlEdgeLabelView({
|
|
12068
12240
|
edge,
|
|
12069
|
-
active
|
|
12241
|
+
active,
|
|
12242
|
+
textMetrics = "proportional"
|
|
12070
12243
|
}) {
|
|
12071
12244
|
if (!hasRenderedLabel(edge)) return null;
|
|
12072
12245
|
const color = edgeColor(edge);
|
|
12073
|
-
const bbox = computeLabelBBoxWorld(edge);
|
|
12246
|
+
const bbox = computeLabelBBoxWorld(edge, textMetrics);
|
|
12074
12247
|
const boxW = bbox.w;
|
|
12075
12248
|
const boxH = bbox.h;
|
|
12076
12249
|
const boxLeftX = bbox.x - edge.labelX;
|
|
@@ -12086,6 +12259,8 @@ function CdlEdgeLabelView({
|
|
|
12086
12259
|
"data-cdl-edge-label-for": edge.id,
|
|
12087
12260
|
"data-cdl-edge-label-text": edge.label,
|
|
12088
12261
|
"data-cdl-edge-sub-text": edge.sub ?? "",
|
|
12262
|
+
"data-cdl-tone": edge.tone,
|
|
12263
|
+
"data-cdl-edge-role": edge.role,
|
|
12089
12264
|
children: [
|
|
12090
12265
|
edge.labelPlate !== false && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12091
12266
|
"rect",
|
|
@@ -12139,9 +12314,10 @@ function CdlEdgeLabelView({
|
|
|
12139
12314
|
function CdlEdgeEndLabelView({
|
|
12140
12315
|
edge,
|
|
12141
12316
|
active,
|
|
12142
|
-
\u7AEF
|
|
12317
|
+
\u7AEF,
|
|
12318
|
+
textMetrics = "proportional"
|
|
12143
12319
|
}) {
|
|
12144
|
-
const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF);
|
|
12320
|
+
const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF, textMetrics);
|
|
12145
12321
|
if (!\u7F6E\u304D\u5834\u6240) return null;
|
|
12146
12322
|
const color = edgeColor(edge);
|
|
12147
12323
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12150,6 +12326,8 @@ function CdlEdgeEndLabelView({
|
|
|
12150
12326
|
"data-cdl-role": "edge-end-label",
|
|
12151
12327
|
"data-cdl-edge-end-label-for": edge.id,
|
|
12152
12328
|
"data-cdl-edge-end": \u7AEF,
|
|
12329
|
+
"data-cdl-tone": edge.tone,
|
|
12330
|
+
"data-cdl-edge-role": edge.role,
|
|
12153
12331
|
x: \u7F6E\u304D\u5834\u6240.x,
|
|
12154
12332
|
y: \u7F6E\u304D\u5834\u6240.y,
|
|
12155
12333
|
fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
|
|
@@ -12394,12 +12572,18 @@ var SEQ_DOT = 7;
|
|
|
12394
12572
|
var SEQ_SELF_W = 52;
|
|
12395
12573
|
var SEQ_COL_MIN = 200;
|
|
12396
12574
|
var g4 = (v) => Math.round(v / 4) * 4;
|
|
12397
|
-
function sequenceBoardMetrics(data) {
|
|
12575
|
+
function sequenceBoardMetrics(data, textMetrics = "proportional") {
|
|
12398
12576
|
const \u540D\u5E45 = data.actors.map(
|
|
12399
|
-
(a) => Math.max(
|
|
12577
|
+
(a) => Math.max(
|
|
12578
|
+
textWidth(a.name, SEQ_NAME, 0, textMetrics),
|
|
12579
|
+
a.subtitle ? textWidth(a.subtitle, SEQ_SUB, 0, textMetrics) : 0
|
|
12580
|
+
)
|
|
12400
12581
|
);
|
|
12401
12582
|
const colW = g4(Math.max(SEQ_COL_MIN, Math.max(0, ...\u540D\u5E45) + SEQ_COL_PAD));
|
|
12402
|
-
const \u8A9E\u5E45 = Math.max(
|
|
12583
|
+
const \u8A9E\u5E45 = Math.max(
|
|
12584
|
+
0,
|
|
12585
|
+
...data.messages.map((m) => textWidth(m.label, SEQ_LABEL, 0, textMetrics))
|
|
12586
|
+
);
|
|
12403
12587
|
const gutter = g4(SEQ_EDGE + SEQ_GUTTER_PAD + \u8A9E\u5E45 + SEQ_GUTTER_GAP);
|
|
12404
12588
|
const headY = SEQ_EDGE + SEQ_HEAD;
|
|
12405
12589
|
const rowY = (i) => headY + SEQ_ROW_PAD + i * SEQ_ROW;
|
|
@@ -12412,11 +12596,12 @@ function sequenceBoardMetrics(data) {
|
|
|
12412
12596
|
}
|
|
12413
12597
|
function SequenceBoardNode({
|
|
12414
12598
|
node,
|
|
12415
|
-
stateValues
|
|
12599
|
+
stateValues,
|
|
12600
|
+
textMetrics = "proportional"
|
|
12416
12601
|
}) {
|
|
12417
12602
|
const data = node.sequenceData;
|
|
12418
12603
|
if (!data) return /* @__PURE__ */ jsxRuntime.jsx("g", { "data-cdl-role": "sequence-board" });
|
|
12419
|
-
const m = sequenceBoardMetrics(data);
|
|
12604
|
+
const m = sequenceBoardMetrics(data, textMetrics);
|
|
12420
12605
|
const x = node.cx - node.w / 2;
|
|
12421
12606
|
const y = node.cy - node.h / 2;
|
|
12422
12607
|
const \u73FE\u5728 = (() => {
|
|
@@ -13067,7 +13252,8 @@ function GenericNode({
|
|
|
13067
13252
|
active,
|
|
13068
13253
|
value,
|
|
13069
13254
|
stateValues,
|
|
13070
|
-
\u5024\u306E\u540D\u524D
|
|
13255
|
+
\u5024\u306E\u540D\u524D,
|
|
13256
|
+
textMetrics = "proportional"
|
|
13071
13257
|
}) {
|
|
13072
13258
|
const base = STYLES[node.kind] ?? FALLBACK;
|
|
13073
13259
|
const toned = toneColor3(node.tone);
|
|
@@ -13206,7 +13392,7 @@ function GenericNode({
|
|
|
13206
13392
|
const resolved = node.rows.map((row) => interpolate(row, stateValues, \u5024\u306E\u540D\u524D));
|
|
13207
13393
|
const splits = resolved.map(splitRow);
|
|
13208
13394
|
const leftMaxWidth = splits.reduce(
|
|
13209
|
-
(m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
|
|
13395
|
+
(m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false, textMetrics)),
|
|
13210
13396
|
0
|
|
13211
13397
|
);
|
|
13212
13398
|
const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
|
|
@@ -13690,8 +13876,8 @@ function \u5024\u3068\u5272\u5408\u306E\u6587\u5B57(\u5024, \u5272\u5408, \u5408
|
|
|
13690
13876
|
return \u7D44.\u5024 === null ? \u7D44.\u5272\u5408 : `${\u7D44.\u5024} ${\u7D44.\u5272\u5408}`;
|
|
13691
13877
|
}
|
|
13692
13878
|
var \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
|
|
13693
|
-
function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587) {
|
|
13694
|
-
const \u5165\u308B\u5927\u304D\u3055 = \u7A74\u306E\u534A\u5F84 * 2 * \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / Math.max(textWidth(\u6587, 1), 1e-6);
|
|
13879
|
+
function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587, textMetrics = "proportional") {
|
|
13880
|
+
const \u5165\u308B\u5927\u304D\u3055 = \u7A74\u306E\u534A\u5F84 * 2 * \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / Math.max(textWidth(\u6587, 1, 0, textMetrics), 1e-6);
|
|
13695
13881
|
return Math.min(Math.max(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7E2E\u3093\u3060\u7D75\u306E\u5B57\u306E\u4E0B\u9650), \u5165\u308B\u5927\u304D\u3055);
|
|
13696
13882
|
}
|
|
13697
13883
|
function ChartPieNode({
|
|
@@ -13699,7 +13885,8 @@ function ChartPieNode({
|
|
|
13699
13885
|
active,
|
|
13700
13886
|
stateValues = {},
|
|
13701
13887
|
drawing = false,
|
|
13702
|
-
progress = 1
|
|
13888
|
+
progress = 1,
|
|
13889
|
+
textMetrics = "proportional"
|
|
13703
13890
|
}) {
|
|
13704
13891
|
const instanceId = react.useId().replace(/[^A-Za-z0-9_-]/g, "");
|
|
13705
13892
|
const x0 = node.cx - node.w / 2;
|
|
@@ -13730,15 +13917,26 @@ function ChartPieNode({
|
|
|
13730
13917
|
return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
|
|
13731
13918
|
});
|
|
13732
13919
|
if (\u5F62 !== "ring") {
|
|
13733
|
-
const \u5171\u901A = {
|
|
13920
|
+
const \u5171\u901A = {
|
|
13921
|
+
node,
|
|
13922
|
+
active,
|
|
13923
|
+
data,
|
|
13924
|
+
\u5272\u5408: \u4ECA\u306E\u5272\u5408,
|
|
13925
|
+
x0,
|
|
13926
|
+
y0,
|
|
13927
|
+
drawing,
|
|
13928
|
+
progress,
|
|
13929
|
+
instanceId,
|
|
13930
|
+
textMetrics
|
|
13931
|
+
};
|
|
13734
13932
|
return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
|
|
13735
13933
|
}
|
|
13736
13934
|
const \u540D\u672D\u5E45 = Math.max(
|
|
13737
13935
|
0,
|
|
13738
13936
|
...data.map(
|
|
13739
13937
|
(_d, i) => Math.max(
|
|
13740
|
-
textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
|
|
13741
|
-
textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
|
|
13938
|
+
textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A, 0, textMetrics),
|
|
13939
|
+
textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics)
|
|
13742
13940
|
)
|
|
13743
13941
|
)
|
|
13744
13942
|
);
|
|
@@ -13753,8 +13951,8 @@ function ChartPieNode({
|
|
|
13753
13951
|
const \u524D\u306Eslices = \u524D\u3042\u308A ? \u8F2A\u3092\u7D44\u3080(data, cx, cy, \u524D\u306E\u5916\u534A\u5F84, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5272\u5408) : [];
|
|
13754
13952
|
const \u7A74 = \u524D\u3042\u308A ? \u524D\u306E\u5185\u534A\u5F84 : \u5916\u306E\u5185\u534A\u5F84;
|
|
13755
13953
|
const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total));
|
|
13756
|
-
const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587);
|
|
13757
|
-
const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08");
|
|
13954
|
+
const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587, textMetrics);
|
|
13955
|
+
const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08", textMetrics);
|
|
13758
13956
|
const \u5408\u8A08\u306E\u4E0B = Math.max(Math.round(radius * 0.2), \u5408\u8A08\u306E\u5B57 * 0.25 + \u898B\u51FA\u3057\u306E\u5B572 * 0.8);
|
|
13759
13957
|
const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
|
|
13760
13958
|
const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
@@ -13937,14 +14135,24 @@ function \u67A0(node, active) {
|
|
|
13937
14135
|
}
|
|
13938
14136
|
);
|
|
13939
14137
|
}
|
|
13940
|
-
function \u5F27\u306E\u5F62({
|
|
14138
|
+
function \u5F27\u306E\u5F62({
|
|
14139
|
+
node,
|
|
14140
|
+
active,
|
|
14141
|
+
data,
|
|
14142
|
+
\u5272\u5408,
|
|
14143
|
+
x0,
|
|
14144
|
+
y0,
|
|
14145
|
+
drawing,
|
|
14146
|
+
progress,
|
|
14147
|
+
textMetrics
|
|
14148
|
+
}) {
|
|
13941
14149
|
const PAD = 20;
|
|
13942
14150
|
const \u540D\u524D\u306E\u7D1A = 14;
|
|
13943
14151
|
const \u5272\u5408\u306E\u7D1A = 24;
|
|
13944
14152
|
const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
|
|
13945
14153
|
const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
|
|
13946
14154
|
const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
|
|
13947
|
-
const \u4E00\u89A7\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A))) + \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 + Math.max(0, ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A)));
|
|
14155
|
+
const \u4E00\u89A7\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics))) + \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 + Math.max(0, ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A, 0, textMetrics)));
|
|
13948
14156
|
const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
|
|
13949
14157
|
const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
|
|
13950
14158
|
const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
|
|
@@ -14030,7 +14238,18 @@ function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
|
|
|
14030
14238
|
})
|
|
14031
14239
|
] });
|
|
14032
14240
|
}
|
|
14033
|
-
function \u8868\u306E\u5F62({
|
|
14241
|
+
function \u8868\u306E\u5F62({
|
|
14242
|
+
node,
|
|
14243
|
+
active,
|
|
14244
|
+
data,
|
|
14245
|
+
\u5272\u5408,
|
|
14246
|
+
x0,
|
|
14247
|
+
y0,
|
|
14248
|
+
drawing,
|
|
14249
|
+
progress,
|
|
14250
|
+
instanceId,
|
|
14251
|
+
textMetrics
|
|
14252
|
+
}) {
|
|
14034
14253
|
const PAD = 20;
|
|
14035
14254
|
const \u898B\u51FA\u3057\u306E\u7D1A = 11;
|
|
14036
14255
|
const \u540D\u524D\u306E\u7D1A = 15;
|
|
@@ -14039,9 +14258,18 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
|
|
|
14039
14258
|
const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
|
|
14040
14259
|
const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
|
|
14041
14260
|
const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
|
|
14042
|
-
const \u540D\u524D\u5E45 = Math.max(
|
|
14043
|
-
|
|
14044
|
-
|
|
14261
|
+
const \u540D\u524D\u5E45 = Math.max(
|
|
14262
|
+
0,
|
|
14263
|
+
...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics))
|
|
14264
|
+
);
|
|
14265
|
+
const \u5272\u5408\u5E45 = Math.max(
|
|
14266
|
+
textWidth("\u5272\u5408", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
|
|
14267
|
+
...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A, 0, textMetrics))
|
|
14268
|
+
);
|
|
14269
|
+
const \u5B9F\u6570\u5E45 = Math.max(
|
|
14270
|
+
textWidth("\u5024", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
|
|
14271
|
+
...\u5B9F\u6570\u306E\u6587\u5B57.map((t) => textWidth(t, \u5B9F\u6570\u306E\u7D1A, 0, textMetrics))
|
|
14272
|
+
);
|
|
14045
14273
|
const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
|
|
14046
14274
|
const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
|
|
14047
14275
|
const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
|
|
@@ -14050,8 +14278,8 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
|
|
|
14050
14278
|
const cx = PAD + R;
|
|
14051
14279
|
const cy = node.h / 2;
|
|
14052
14280
|
const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)));
|
|
14053
|
-
const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587);
|
|
14054
|
-
const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08");
|
|
14281
|
+
const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587, textMetrics);
|
|
14282
|
+
const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08", textMetrics);
|
|
14055
14283
|
const \u5408\u8A08\u306E\u4E0B = Math.max(Math.round(R * 0.2), \u5408\u8A08\u306E\u5B57 * 0.25 + \u898B\u51FA\u3057\u306E\u5B572 * 0.8);
|
|
14056
14284
|
const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
|
|
14057
14285
|
const \u53F3\u7AEF = node.w - PAD;
|
|
@@ -14182,7 +14410,8 @@ function ChartGaugeNode({
|
|
|
14182
14410
|
active,
|
|
14183
14411
|
stateValues = {},
|
|
14184
14412
|
drawing = false,
|
|
14185
|
-
progress = 1
|
|
14413
|
+
progress = 1,
|
|
14414
|
+
textMetrics = "proportional"
|
|
14186
14415
|
}) {
|
|
14187
14416
|
const x0 = node.cx - node.w / 2;
|
|
14188
14417
|
const y0 = node.cy - node.h / 2;
|
|
@@ -14201,7 +14430,10 @@ function ChartGaugeNode({
|
|
|
14201
14430
|
const \u533A\u753B\u306E\u9593 = 12;
|
|
14202
14431
|
const \u6570\u5024\u306E\u884C = (d) => \u5024\u3068\u5272\u5408\u306E\u6587\u5B57(\u5B9F\u5024\u8868\u8A18(d.value), \u5272\u5408\u8868\u8A18(d.value / total), total);
|
|
14203
14432
|
const \u5272\u308A\u4ED8\u3051\u308B = (\u4EF6\u305F\u3061) => {
|
|
14204
|
-
const \u5E45 = Math.max(
|
|
14433
|
+
const \u5E45 = Math.max(
|
|
14434
|
+
\u5370\u306E\u5E452,
|
|
14435
|
+
...\u4EF6\u305F\u3061.map((d) => textWidth(\u6570\u5024\u306E\u884C(d), \u6570\u5024\u306E\u7D1A, 0, textMetrics))
|
|
14436
|
+
) + \u533A\u753B\u306E\u9593;
|
|
14205
14437
|
const \u884C\u306E\u4EF6\u65702 = Math.min(
|
|
14206
14438
|
Math.max(1, Math.floor(\u4F7F\u3048\u308B\u5E452 / Math.max(\u5E45, 1))),
|
|
14207
14439
|
Math.max(\u4EF6\u305F\u3061.length, 1)
|
|
@@ -14276,7 +14508,7 @@ function ChartGaugeNode({
|
|
|
14276
14508
|
return { d, frac, path: \u6247\u306E\u9053(a0, a1, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5916\u534A\u5F84) };
|
|
14277
14509
|
});
|
|
14278
14510
|
const \u5408\u8A08\u306E\u6587\u5B57 = \u5B9F\u5024\u8868\u8A18(Math.round(total));
|
|
14279
|
-
const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100), 1) / 100;
|
|
14511
|
+
const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100, 0, textMetrics), 1) / 100;
|
|
14280
14512
|
const \u7D1A\u306E\u5019\u88DC = Math.min(
|
|
14281
14513
|
// 横 = 字の上の角が内側の円に入る大きさ
|
|
14282
14514
|
\u5185\u534A\u5F84 / Math.sqrt((\u5358\u4F4D\u5E45 / 2) ** 2 + 1.25 ** 2),
|
|
@@ -14369,7 +14601,7 @@ function ChartGaugeNode({
|
|
|
14369
14601
|
const y = \u5185\u8A33\u306Ey + \u6BB5\u306E\u9AD8\u3055 * \u6BB5;
|
|
14370
14602
|
const \u53CE\u307E\u308B\u5E45 = \u5185\u8A33\u306E\u5E45 - \u533A\u753B\u306E\u9593;
|
|
14371
14603
|
const \u6570\u306E\u884C = \u5185\u8A33\u306E\u6570\u5024[idx] ?? "";
|
|
14372
|
-
const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A);
|
|
14604
|
+
const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A, textMetrics);
|
|
14373
14605
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-gauge-item", children: [
|
|
14374
14606
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14375
14607
|
"rect",
|
|
@@ -14390,7 +14622,7 @@ function ChartGaugeNode({
|
|
|
14390
14622
|
fontSize: \u540D\u524D\u306E\u7D1A,
|
|
14391
14623
|
fontWeight: 700,
|
|
14392
14624
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
14393
|
-
children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A)
|
|
14625
|
+
children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A, textMetrics)
|
|
14394
14626
|
}
|
|
14395
14627
|
),
|
|
14396
14628
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x, y: y + 46, fontSize: \u6570\u5024\u306E\u7D1A, fill: "var(--cdl-text-dim, #5a6270)", children: \u5207\u3063\u305F\u6570\u306E\u884C === \u6570\u306E\u884C ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14408,12 +14640,12 @@ function ChartGaugeNode({
|
|
|
14408
14640
|
function \u6975(cx, cy, r, a) {
|
|
14409
14641
|
return { x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) };
|
|
14410
14642
|
}
|
|
14411
|
-
function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A) {
|
|
14412
|
-
if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A) <= \u4E0A\u9650) return s;
|
|
14413
|
-
const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A);
|
|
14643
|
+
function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A, textMetrics = "proportional") {
|
|
14644
|
+
if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A, 0, textMetrics) <= \u4E0A\u9650) return s;
|
|
14645
|
+
const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A, 0, textMetrics);
|
|
14414
14646
|
let out = "";
|
|
14415
14647
|
for (const c of s) {
|
|
14416
|
-
if (textWidth(out + c, \u7D1A) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
|
|
14648
|
+
if (textWidth(out + c, \u7D1A, 0, textMetrics) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
|
|
14417
14649
|
out += c;
|
|
14418
14650
|
}
|
|
14419
14651
|
return `${out}\u2026`;
|
|
@@ -14427,7 +14659,8 @@ function ChartRadialNode({
|
|
|
14427
14659
|
active,
|
|
14428
14660
|
stateValues = {},
|
|
14429
14661
|
drawing = false,
|
|
14430
|
-
progress = 1
|
|
14662
|
+
progress = 1,
|
|
14663
|
+
textMetrics = "proportional"
|
|
14431
14664
|
}) {
|
|
14432
14665
|
const x0 = node.cx - node.w / 2;
|
|
14433
14666
|
const y0 = node.cy - node.h / 2;
|
|
@@ -14445,7 +14678,10 @@ function ChartRadialNode({
|
|
|
14445
14678
|
const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E45 + Math.max(
|
|
14446
14679
|
0,
|
|
14447
14680
|
...data.map(
|
|
14448
|
-
(d, i) => Math.max(
|
|
14681
|
+
(d, i) => Math.max(
|
|
14682
|
+
textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
|
|
14683
|
+
textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
|
|
14684
|
+
)
|
|
14449
14685
|
)
|
|
14450
14686
|
);
|
|
14451
14687
|
const \u5F27\u306B\u4F7F\u3048\u308B\u5E45 = node.w - PAD * 2 - \u4E00\u89A7\u306E\u5E45 - \u4E00\u89A7\u3068\u5F27\u306E\u9593;
|
|
@@ -14592,7 +14828,8 @@ function arcColor2(tone, idx) {
|
|
|
14592
14828
|
function ChartStatNode({
|
|
14593
14829
|
node,
|
|
14594
14830
|
active,
|
|
14595
|
-
stateValues = {}
|
|
14831
|
+
stateValues = {},
|
|
14832
|
+
textMetrics = "proportional"
|
|
14596
14833
|
}) {
|
|
14597
14834
|
const x0 = node.cx - node.w / 2;
|
|
14598
14835
|
const y0 = node.cy - node.h / 2;
|
|
@@ -14621,7 +14858,13 @@ function ChartStatNode({
|
|
|
14621
14858
|
const frac = total > 0 ? d.value / total : 0;
|
|
14622
14859
|
const \u8272 = \u5370\u306E\u8272(d.tone, idx);
|
|
14623
14860
|
const \u6570\u5024 = \u5B9F\u5024\u8868\u8A18(d.value);
|
|
14624
|
-
const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(
|
|
14861
|
+
const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(
|
|
14862
|
+
\u6570\u5024,
|
|
14863
|
+
\u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
|
|
14864
|
+
\u533A\u753B.\u6570\u5024\u306E\u7D1A,
|
|
14865
|
+
\u533A\u753B.\u540D\u524D\u306E\u7D1A + 1,
|
|
14866
|
+
textMetrics
|
|
14867
|
+
);
|
|
14625
14868
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14626
14869
|
"g",
|
|
14627
14870
|
{
|
|
@@ -14678,7 +14921,8 @@ function ChartStatNode({
|
|
|
14678
14921
|
`\u524D ${\u5B9F\u5024\u8868\u8A18(d.previous)}`,
|
|
14679
14922
|
\u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
|
|
14680
14923
|
\u533A\u753B.\u524D\u306E\u7D1A,
|
|
14681
|
-
8
|
|
14924
|
+
8,
|
|
14925
|
+
textMetrics
|
|
14682
14926
|
),
|
|
14683
14927
|
textAnchor: "middle",
|
|
14684
14928
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
@@ -14767,9 +15011,9 @@ function \u533A\u753B\u306E\u5272\u4ED8(w, h, \u4EF6\u6570, \u524D\u3092\u51FA\u
|
|
|
14767
15011
|
\u67A0: (idx) => ({ x: \u5E45 * idx, y: 0, w: \u5E45, h })
|
|
14768
15012
|
};
|
|
14769
15013
|
}
|
|
14770
|
-
function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650) {
|
|
15014
|
+
function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650, textMetrics = "proportional") {
|
|
14771
15015
|
let \u7D1A = \u521D\u671F;
|
|
14772
|
-
while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
|
|
15016
|
+
while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A, 0, textMetrics) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
|
|
14773
15017
|
return \u7D1A;
|
|
14774
15018
|
}
|
|
14775
15019
|
function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
|
|
@@ -14804,7 +15048,8 @@ function ChartWaffleNode({
|
|
|
14804
15048
|
active,
|
|
14805
15049
|
stateValues = {},
|
|
14806
15050
|
drawing = false,
|
|
14807
|
-
progress = 1
|
|
15051
|
+
progress = 1,
|
|
15052
|
+
textMetrics = "proportional"
|
|
14808
15053
|
}) {
|
|
14809
15054
|
const x0 = node.cx - node.w / 2;
|
|
14810
15055
|
const y0 = node.cy - node.h / 2;
|
|
@@ -14823,7 +15068,10 @@ function ChartWaffleNode({
|
|
|
14823
15068
|
const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E452 + Math.max(
|
|
14824
15069
|
0,
|
|
14825
15070
|
...data.map(
|
|
14826
|
-
(d, i) => Math.max(
|
|
15071
|
+
(d, i) => Math.max(
|
|
15072
|
+
textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
|
|
15073
|
+
textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
|
|
15074
|
+
)
|
|
14827
15075
|
)
|
|
14828
15076
|
);
|
|
14829
15077
|
const \u4F7F\u3048\u308B\u9AD8\u3055 = node.h - PAD * 2;
|
|
@@ -14925,7 +15173,8 @@ function ChartStackedBarNode({
|
|
|
14925
15173
|
active,
|
|
14926
15174
|
stateValues = {},
|
|
14927
15175
|
drawing = false,
|
|
14928
|
-
progress = 1
|
|
15176
|
+
progress = 1,
|
|
15177
|
+
textMetrics = "proportional"
|
|
14929
15178
|
}) {
|
|
14930
15179
|
const x0 = node.cx - node.w / 2;
|
|
14931
15180
|
const y0 = node.cy - node.h / 2;
|
|
@@ -14935,7 +15184,7 @@ function ChartStackedBarNode({
|
|
|
14935
15184
|
const \u540D\u524D\u306E\u7D1A = 13;
|
|
14936
15185
|
const \u533A\u753B\u306E\u7D1A = 12;
|
|
14937
15186
|
const \u6642\u70B9\u306E\u7D1A = 13;
|
|
14938
|
-
const \u6642\u70B9\u306E\u5E45 = Math.max(0, ...\u5E2F\u305F\u3061.map((b) => textWidth(b.\u540D\u524D, \u6642\u70B9\u306E\u7D1A))) + (\u5E2F\u305F\u3061.length > 1 ? 16 : 0);
|
|
15187
|
+
const \u6642\u70B9\u306E\u5E45 = Math.max(0, ...\u5E2F\u305F\u3061.map((b) => textWidth(b.\u540D\u524D, \u6642\u70B9\u306E\u7D1A, 0, textMetrics))) + (\u5E2F\u305F\u3061.length > 1 ? 16 : 0);
|
|
14939
15188
|
const \u5E2F\u306E\u5DE6 = PAD + \u6642\u70B9\u306E\u5E45;
|
|
14940
15189
|
const \u5E2F\u306E\u5E45 = Math.max(40, node.w - \u5E2F\u306E\u5DE6 - PAD);
|
|
14941
15190
|
const \u5E2F\u306E\u9AD8\u3055 = 44;
|
|
@@ -15028,7 +15277,7 @@ function ChartStackedBarNode({
|
|
|
15028
15277
|
})()
|
|
15029
15278
|
] }, `bar-${\u6BB5}`);
|
|
15030
15279
|
}),
|
|
15031
|
-
\u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A).map(({ d, idx, x, \u884C }) => {
|
|
15280
|
+
\u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A, textMetrics).map(({ d, idx, x, \u884C }) => {
|
|
15032
15281
|
const y = \u4E0A\u7AEF + \u5E2F\u305F\u3061.length * (\u5E2F\u306E\u9AD8\u3055 + \u5E2F\u306E\u9593) - \u5E2F\u306E\u9593 + 16 + \u4E00\u89A7\u306E\u9AD8\u3055 / 2 + \u884C * \u4E00\u89A7\u306E\u9AD8\u3055;
|
|
15033
15282
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stacked-bar-legend", children: [
|
|
15034
15283
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x, y: y - 5, width: 10, height: 10, rx: 2, fill: \u5370\u306E\u82723(d.tone, idx) }),
|
|
@@ -15063,12 +15312,12 @@ function \u5370\u306E\u82723(tone, idx) {
|
|
|
15063
15312
|
}
|
|
15064
15313
|
var \u5370\u304B\u3089\u540D\u524D\u307E\u3067 = 16;
|
|
15065
15314
|
var \u4EF6\u306E\u9593 = 10;
|
|
15066
|
-
function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A) {
|
|
15315
|
+
function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A, textMetrics = "proportional") {
|
|
15067
15316
|
const out = [];
|
|
15068
15317
|
let x = \u5DE6;
|
|
15069
15318
|
let \u884C = 0;
|
|
15070
15319
|
data.forEach((d, idx) => {
|
|
15071
|
-
const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A);
|
|
15320
|
+
const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A, 0, textMetrics);
|
|
15072
15321
|
if (x > \u5DE6 && x + \u5E45 > \u53F3\u7AEF) {
|
|
15073
15322
|
\u884C += 1;
|
|
15074
15323
|
x = \u5DE6;
|
|
@@ -15084,7 +15333,8 @@ function ChartSlopeNode({
|
|
|
15084
15333
|
active,
|
|
15085
15334
|
stateValues = {},
|
|
15086
15335
|
drawing = false,
|
|
15087
|
-
progress = 1
|
|
15336
|
+
progress = 1,
|
|
15337
|
+
textMetrics = "proportional"
|
|
15088
15338
|
}) {
|
|
15089
15339
|
const x0 = node.cx - node.w / 2;
|
|
15090
15340
|
const y0 = node.cy - node.h / 2;
|
|
@@ -15127,16 +15377,22 @@ function ChartSlopeNode({
|
|
|
15127
15377
|
const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
|
|
15128
15378
|
(s) => \u5F62 === "delta" ? \u5897\u6E1B\u8868\u8A18(s.\u524D, s.\u4ECA) : \u5B9F\u5024\u8868\u8A18(s.\u4ECA)
|
|
15129
15379
|
);
|
|
15130
|
-
const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
|
|
15131
|
-
const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
|
|
15380
|
+
const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
|
|
15381
|
+
const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
|
|
15132
15382
|
const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
|
|
15133
15383
|
0,
|
|
15134
15384
|
(node.w - PAD * 2 - \u7DDA\u306E\u6700\u5C0F\u5E45 - (\u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067) - (\u53F3\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067)) / 2
|
|
15135
15385
|
);
|
|
15136
|
-
const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(
|
|
15386
|
+
const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(
|
|
15387
|
+
\u7CFB\u5217\u305F\u3061.map((s) => s.\u540D\u524D),
|
|
15388
|
+
\u540D\u524D\u306B\u4F7F\u3048\u308B,
|
|
15389
|
+
\u540D\u524D\u306E\u4E0A\u9650\u7D1A,
|
|
15390
|
+
\u540D\u524D\u306E\u4E0B\u9650\u7D1A,
|
|
15391
|
+
textMetrics
|
|
15392
|
+
);
|
|
15137
15393
|
const \u540D\u524D\u5E45 = Math.min(
|
|
15138
15394
|
\u540D\u524D\u306B\u4F7F\u3048\u308B,
|
|
15139
|
-
Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A)))
|
|
15395
|
+
Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A, 0, textMetrics)))
|
|
15140
15396
|
);
|
|
15141
15397
|
const \u5DE6\u306E\u4F59\u767D = \u540D\u524D\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067;
|
|
15142
15398
|
const \u53F3\u306E\u4F59\u767D = \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u540D\u524D\u5E45;
|
|
@@ -15322,10 +15578,12 @@ function \u5370\u306E\u82724(tone, idx) {
|
|
|
15322
15578
|
if (tone) return TONE[tone];
|
|
15323
15579
|
return chartSeriesColor(idx);
|
|
15324
15580
|
}
|
|
15325
|
-
function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650) {
|
|
15581
|
+
function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650, textMetrics = "proportional") {
|
|
15326
15582
|
if (\u540D\u524D\u305F\u3061.length === 0) return \u4E0A\u9650;
|
|
15327
15583
|
let \u7D1A = \u4E0A\u9650;
|
|
15328
|
-
while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A))) > \u5E45)
|
|
15584
|
+
while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A, 0, textMetrics))) > \u5E45) {
|
|
15585
|
+
\u7D1A -= 1;
|
|
15586
|
+
}
|
|
15329
15587
|
return \u7D1A;
|
|
15330
15588
|
}
|
|
15331
15589
|
function \u5C0F\u6570\u306E\u6841(n) {
|
|
@@ -15373,6 +15631,7 @@ function ChartBarNode({
|
|
|
15373
15631
|
return { y: yAt(v), value: v };
|
|
15374
15632
|
});
|
|
15375
15633
|
const \u6FC3\u3055 = (v) => vMax > 0 ? v >= vMax ? 1 : 0.45 : 0.9;
|
|
15634
|
+
const \u4E3B\u5F79\u306E\u68D2\u304B = (v) => vMax > 0 && v >= vMax;
|
|
15376
15635
|
const \u89D2\u4E38 = Math.min(barW * 0.06, 8);
|
|
15377
15636
|
const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
|
|
15378
15637
|
const \u6A2A\u8EF8\u306Ey = PAD_TOP2 + canvasH;
|
|
@@ -15439,6 +15698,7 @@ function ChartBarNode({
|
|
|
15439
15698
|
{
|
|
15440
15699
|
"data-cdl-role": "chart-bar",
|
|
15441
15700
|
"data-cdl-unresolved": d.unresolved ? "true" : void 0,
|
|
15701
|
+
"data-cdl-emphasis": \u4E3B\u5F79\u306E\u68D2\u304B(d.value) ? "primary" : void 0,
|
|
15442
15702
|
x: bx,
|
|
15443
15703
|
y: by,
|
|
15444
15704
|
width: barW,
|
|
@@ -15785,7 +16045,8 @@ function FunnelNode({
|
|
|
15785
16045
|
active,
|
|
15786
16046
|
stateValues = {},
|
|
15787
16047
|
drawing = false,
|
|
15788
|
-
progress = 1
|
|
16048
|
+
progress = 1,
|
|
16049
|
+
textMetrics = "proportional"
|
|
15789
16050
|
}) {
|
|
15790
16051
|
const x0 = node.cx - node.w / 2;
|
|
15791
16052
|
const y0 = node.cy - node.h / 2;
|
|
@@ -15834,7 +16095,11 @@ function FunnelNode({
|
|
|
15834
16095
|
const \u540D\u524D\u306E\u5B9F\u5B57 = \u540D\u524D\u306E\u5B57 * \u7E26\u500D;
|
|
15835
16096
|
const \u88DC\u8DB3\u306E\u67A0\u5B57 = \u88DC\u8DB3\u306E\u5B57 * \u7E26\u500D;
|
|
15836
16097
|
const \u53CE\u307E\u308B\u5E45 = Math.max(0, bottomW - 16);
|
|
15837
|
-
const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(
|
|
16098
|
+
const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(
|
|
16099
|
+
\u88DC\u8DB3,
|
|
16100
|
+
{ fontSize: \u88DC\u8DB3\u306E\u67A0\u5B57, fontWeight: 500, textMetrics },
|
|
16101
|
+
\u53CE\u307E\u308B\u5E45
|
|
16102
|
+
);
|
|
15838
16103
|
const \u584A\u306E\u4E0A = y + stageH / 2 - (\u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 1.25) / 2;
|
|
15839
16104
|
const \u540D\u524D\u306Ey = \u88DC\u8DB3\u3042\u308A ? \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 0.95 : y + stageH / 2 + 5;
|
|
15840
16105
|
const \u88DC\u8DB3\u306Ey = \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 0.95;
|
|
@@ -15937,7 +16202,8 @@ function \u7573\u3093\u3060\u6587(\u4EF6\u6570) {
|
|
|
15937
16202
|
function QuadrantNode({
|
|
15938
16203
|
node,
|
|
15939
16204
|
active,
|
|
15940
|
-
stateValues = {}
|
|
16205
|
+
stateValues = {},
|
|
16206
|
+
textMetrics = "proportional"
|
|
15941
16207
|
}) {
|
|
15942
16208
|
const x0 = node.cx - node.w / 2;
|
|
15943
16209
|
const y0 = node.cy - node.h / 2;
|
|
@@ -15956,7 +16222,10 @@ function QuadrantNode({
|
|
|
15956
16222
|
const SUB_FONT = 10;
|
|
15957
16223
|
const axisLabelPad = (text) => Math.max(
|
|
15958
16224
|
PAD_MIN,
|
|
15959
|
-
measureTextWidth(`\u2190 ${text}`, {
|
|
16225
|
+
measureTextWidth(`\u2190 ${text}`, {
|
|
16226
|
+
fontSize: AXIS_LABEL_FONT,
|
|
16227
|
+
textMetrics
|
|
16228
|
+
}) + 12
|
|
15960
16229
|
);
|
|
15961
16230
|
const padBudget = Math.max(0, node.w * 0.5 - PAD_MIN * 2);
|
|
15962
16231
|
const wantLeft = axisLabelPad(data.xAxis.left) - PAD_MIN;
|
|
@@ -16210,7 +16479,11 @@ function QuadrantNode({
|
|
|
16210
16479
|
ITEM_MIN_W,
|
|
16211
16480
|
Math.max(
|
|
16212
16481
|
...\u884C\u30892.map(
|
|
16213
|
-
(r) => measureTextWidth(r.text, {
|
|
16482
|
+
(r) => measureTextWidth(r.text, {
|
|
16483
|
+
fontSize: r.size,
|
|
16484
|
+
fontWeight: r.weight,
|
|
16485
|
+
textMetrics
|
|
16486
|
+
})
|
|
16214
16487
|
)
|
|
16215
16488
|
) + ITEM_PAD_X * 2
|
|
16216
16489
|
)
|
|
@@ -16236,7 +16509,7 @@ function QuadrantNode({
|
|
|
16236
16509
|
const \u88DC\u8DB3 = (it.subtitle ?? "").trim();
|
|
16237
16510
|
const \u88DC\u8DB3\u306E\u5B57 = SUB_FONT * \u53CE\u3081\u308B\u500D\u7387(
|
|
16238
16511
|
\u88DC\u8DB3,
|
|
16239
|
-
{ fontSize: SUB_FONT, fontWeight: 500 },
|
|
16512
|
+
{ fontSize: SUB_FONT, fontWeight: 500, textMetrics },
|
|
16240
16513
|
Math.max(0, \u5E45 - ITEM_PAD_X * 2)
|
|
16241
16514
|
);
|
|
16242
16515
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
@@ -16640,24 +16913,30 @@ var EYEBROW_GAP2 = 8;
|
|
|
16640
16913
|
var EYEBROW_TRACKING = 2;
|
|
16641
16914
|
var SUB_SIZE = 11;
|
|
16642
16915
|
var SUB_GAP = 4;
|
|
16643
|
-
function labelBlock(node, pos, size, band) {
|
|
16916
|
+
function labelBlock(node, pos, size, band, textMetrics = "proportional") {
|
|
16644
16917
|
const \u4E0A = node.eyebrow ? size + EYEBROW_GAP2 + EYEBROW_SIZE2 * ASCENT2 : size * ASCENT2;
|
|
16645
16918
|
const \u4E0B = node.subtitle ? size + SUB_GAP + SUB_SIZE * DESCENT2 : size * DESCENT2;
|
|
16646
16919
|
const \u5E45 = Math.max(
|
|
16647
|
-
textWidth(node.title ?? "", size),
|
|
16648
|
-
node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING) : 0,
|
|
16649
|
-
node.subtitle ? textWidth(node.subtitle, SUB_SIZE) : 0
|
|
16920
|
+
textWidth(node.title ?? "", size, 0, textMetrics),
|
|
16921
|
+
node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING, textMetrics) : 0,
|
|
16922
|
+
node.subtitle ? textWidth(node.subtitle, SUB_SIZE, 0, textMetrics) : 0
|
|
16650
16923
|
);
|
|
16651
|
-
const \u984C\u5E45 = textWidth(node.title ?? "", size);
|
|
16652
|
-
const \
|
|
16924
|
+
const \u984C\u5E45 = textWidth(node.title ?? "", size, 0, textMetrics);
|
|
16925
|
+
const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
|
|
16926
|
+
const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, \u6E2C\u308B) : 0;
|
|
16653
16927
|
const { k, x, y: baseline } = fitLabel(band, { \u4E0A, \u4E0B, \u5E45 }, pos, \u4E0B\u9650);
|
|
16654
16928
|
return { k, x, baseline, \u4E0A\u7AEF: baseline - \u4E0A * k, \u4E0B\u7AEF: baseline + \u4E0B * k };
|
|
16655
16929
|
}
|
|
16656
|
-
function commonLabel(node, pos, size, band) {
|
|
16657
|
-
const \u584A = labelBlock(node, pos, size, band);
|
|
16930
|
+
function commonLabel(node, pos, size, band, textMetrics = "proportional") {
|
|
16931
|
+
const \u584A = labelBlock(node, pos, size, band, textMetrics);
|
|
16658
16932
|
const k = \u584A.k;
|
|
16659
16933
|
const x = \u584A.x;
|
|
16660
|
-
const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
|
|
16934
|
+
const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
|
|
16935
|
+
t,
|
|
16936
|
+
\u5927\u304D\u3055 * k,
|
|
16937
|
+
band.w,
|
|
16938
|
+
(u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
|
|
16939
|
+
);
|
|
16661
16940
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16662
16941
|
node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16663
16942
|
"text",
|
|
@@ -16708,7 +16987,7 @@ var RULE_GAP_RATIO = 0.1;
|
|
|
16708
16987
|
var RULE_PAD_MAX = 20;
|
|
16709
16988
|
var RULE_PAD_RATIO = 0.14;
|
|
16710
16989
|
var RULE_SHRINK_RATIO = 0.055;
|
|
16711
|
-
function ShapeFileNode({ node, active }) {
|
|
16990
|
+
function ShapeFileNode({ node, active, textMetrics = "proportional" }) {
|
|
16712
16991
|
const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
|
|
16713
16992
|
const \u7D19h = \u5E2F.h;
|
|
16714
16993
|
const \u7D19w = Math.min(\u5E2F.w, \u7D19h * 0.72);
|
|
@@ -16728,7 +17007,7 @@ function ShapeFileNode({ node, active }) {
|
|
|
16728
17007
|
const foldTriangle = `M ${x + \u7D19w - fold} ${y} L ${x + \u7D19w} ${y + fold} L ${x + \u7D19w - fold} ${y + fold} Z`;
|
|
16729
17008
|
const \u540D\u524D\u5E2F = { x, y, w: \u7D19w, h: \u7D19h };
|
|
16730
17009
|
const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + node.h * 0.12 };
|
|
16731
|
-
const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F);
|
|
17010
|
+
const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics);
|
|
16732
17011
|
const \u9593\u9694 = Math.min(RULE_GAP_MAX, \u7D19h * RULE_GAP_RATIO);
|
|
16733
17012
|
const \u7DDA\u4F59\u767D = Math.min(RULE_PAD_MAX, \u7D19w * RULE_PAD_RATIO);
|
|
16734
17013
|
const textLines = [0, 1, 2].map((i) => ({ i, ly: y + fold + \u9593\u9694 * (i + 1) })).filter(({ ly }) => ly < \u540D\u524D.\u4E0A\u7AEF);
|
|
@@ -16760,12 +17039,12 @@ function ShapeFileNode({ node, active }) {
|
|
|
16760
17039
|
i
|
|
16761
17040
|
);
|
|
16762
17041
|
}),
|
|
16763
|
-
commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F)
|
|
17042
|
+
commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics)
|
|
16764
17043
|
] });
|
|
16765
17044
|
}
|
|
16766
17045
|
var TAB_H_MAX = 22;
|
|
16767
17046
|
var TAB_H_RATIO = 0.3;
|
|
16768
|
-
function ShapeFolderNode({ node, active }) {
|
|
17047
|
+
function ShapeFolderNode({ node, active, textMetrics = "proportional" }) {
|
|
16769
17048
|
const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
|
|
16770
17049
|
const x = \u5E2F.x;
|
|
16771
17050
|
const y = \u5E2F.y;
|
|
@@ -16786,7 +17065,7 @@ function ShapeFolderNode({ node, active }) {
|
|
|
16786
17065
|
const \u5883\u754Cy = y + tabH + Math.min(8, (\u5E2F.h - tabH) * 0.2);
|
|
16787
17066
|
const \u7AEF = Math.min(6, \u5E2F.w * 0.1);
|
|
16788
17067
|
const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 18 };
|
|
16789
|
-
const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F);
|
|
17068
|
+
const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics);
|
|
16790
17069
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
16791
17070
|
dropShadow(\u5E2F.cx, \u5E2F.\u5E95, \u5E2F.w * 0.44),
|
|
16792
17071
|
/* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
|
|
@@ -16802,13 +17081,13 @@ function ShapeFolderNode({ node, active }) {
|
|
|
16802
17081
|
opacity: 0.35
|
|
16803
17082
|
}
|
|
16804
17083
|
),
|
|
16805
|
-
commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F)
|
|
17084
|
+
commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics)
|
|
16806
17085
|
] });
|
|
16807
17086
|
}
|
|
16808
17087
|
var CLOUD_VB_W = 640;
|
|
16809
17088
|
var CLOUD_VB_H = 512;
|
|
16810
17089
|
var CLOUD_W_RATIO = 0.9;
|
|
16811
|
-
function ShapeCloudNode({ node, active }) {
|
|
17090
|
+
function ShapeCloudNode({ node, active, textMetrics = "proportional" }) {
|
|
16812
17091
|
const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
|
|
16813
17092
|
const frame = commonFrame(active);
|
|
16814
17093
|
const \u7D20\u306E\u500D\u7387 = Math.min(\u5E2F.h / CLOUD_VB_H, \u5E2F.w * CLOUD_W_RATIO / CLOUD_VB_W);
|
|
@@ -16831,13 +17110,13 @@ function ShapeCloudNode({ node, active }) {
|
|
|
16831
17110
|
strokeLinejoin: "round"
|
|
16832
17111
|
}
|
|
16833
17112
|
) }),
|
|
16834
|
-
commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F)
|
|
17113
|
+
commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F, textMetrics)
|
|
16835
17114
|
] });
|
|
16836
17115
|
}
|
|
16837
17116
|
var CYLINDER_RY_MAX = 18;
|
|
16838
17117
|
var CYLINDER_RY_RATIO = 0.1;
|
|
16839
17118
|
var CYLINDER_DISKS = [0.3, 0.55, 0.8];
|
|
16840
|
-
function ShapeCylinderNode({ node, active }) {
|
|
17119
|
+
function ShapeCylinderNode({ node, active, textMetrics = "proportional" }) {
|
|
16841
17120
|
const \u5E2F = bodyBand(node, { \u5F71ry: CYLINDER_SHADOW_RY });
|
|
16842
17121
|
const x = \u5E2F.x;
|
|
16843
17122
|
const y = \u5E2F.y;
|
|
@@ -16854,7 +17133,7 @@ function ShapeCylinderNode({ node, active }) {
|
|
|
16854
17133
|
const \u84CB\u5E95 = y + ry * 2;
|
|
16855
17134
|
const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 6 };
|
|
16856
17135
|
const \u540D\u524D\u5E2F = { x: \u5E2F.x, y: \u84CB\u5E95, w: \u5E2F.w, h: Math.max(0, \u5E2F.\u5E95 - \u84CB\u5E95) };
|
|
16857
|
-
const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F);
|
|
17136
|
+
const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics);
|
|
16858
17137
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
16859
17138
|
dropShadow(\u5E2F.cx, \u5E2F.\u5E95, rx * 0.85, CYLINDER_SHADOW_RY),
|
|
16860
17139
|
/* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
|
|
@@ -16878,11 +17157,11 @@ function ShapeCylinderNode({ node, active }) {
|
|
|
16878
17157
|
},
|
|
16879
17158
|
i
|
|
16880
17159
|
)),
|
|
16881
|
-
commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F)
|
|
17160
|
+
commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics)
|
|
16882
17161
|
] });
|
|
16883
17162
|
}
|
|
16884
17163
|
var HEX_DOT_R = 2.5;
|
|
16885
|
-
function ShapeHexagonNode({ node, active }) {
|
|
17164
|
+
function ShapeHexagonNode({ node, active, textMetrics = "proportional" }) {
|
|
16886
17165
|
const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY, \u5916: Math.max(HEX_DOT_R, FRAME_HALF) });
|
|
16887
17166
|
const cx = \u5E2F.cx;
|
|
16888
17167
|
const cy = \u5E2F.cy;
|
|
@@ -16905,11 +17184,12 @@ function ShapeHexagonNode({ node, active }) {
|
|
|
16905
17184
|
node,
|
|
16906
17185
|
{ x: cx, y: node.cy + 6 },
|
|
16907
17186
|
16,
|
|
16908
|
-
{ x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h }
|
|
17187
|
+
{ x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h },
|
|
17188
|
+
textMetrics
|
|
16909
17189
|
)
|
|
16910
17190
|
] });
|
|
16911
17191
|
}
|
|
16912
|
-
function ShapeDiamondNode({ node, active }) {
|
|
17192
|
+
function ShapeDiamondNode({ node, active, textMetrics = "proportional" }) {
|
|
16913
17193
|
const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
|
|
16914
17194
|
const cx = \u5E2F.cx;
|
|
16915
17195
|
const cy = \u5E2F.cy;
|
|
@@ -16950,13 +17230,14 @@ function ShapeDiamondNode({ node, active }) {
|
|
|
16950
17230
|
y: cy - \u5E2F.h * innerScale / 4,
|
|
16951
17231
|
w: \u5E2F.w * innerScale / 2,
|
|
16952
17232
|
h: \u5E2F.h * innerScale / 2
|
|
16953
|
-
}
|
|
17233
|
+
},
|
|
17234
|
+
textMetrics
|
|
16954
17235
|
)
|
|
16955
17236
|
] });
|
|
16956
17237
|
}
|
|
16957
17238
|
var STACK_OFFSET_MAX = 12;
|
|
16958
17239
|
var STACK_OFFSET_RATIO = 0.15;
|
|
16959
|
-
function ShapeStackNode({ node, active }) {
|
|
17240
|
+
function ShapeStackNode({ node, active, textMetrics = "proportional" }) {
|
|
16960
17241
|
const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
|
|
16961
17242
|
const x = \u5E2F.x;
|
|
16962
17243
|
const y = \u5E2F.y;
|
|
@@ -17010,7 +17291,8 @@ function ShapeStackNode({ node, active }) {
|
|
|
17010
17291
|
node,
|
|
17011
17292
|
{ x: \u624B\u524Dcx, y: node.cy + \u305A\u308C + 6 },
|
|
17012
17293
|
15,
|
|
17013
|
-
{ x, y: y + \u305A\u308C * 2, w: cardW, h: cardH }
|
|
17294
|
+
{ x, y: y + \u305A\u308C * 2, w: cardW, h: cardH },
|
|
17295
|
+
textMetrics
|
|
17014
17296
|
)
|
|
17015
17297
|
] });
|
|
17016
17298
|
}
|
|
@@ -17022,16 +17304,22 @@ var PERSON_BODY_LEN = 90;
|
|
|
17022
17304
|
var PERSON_SHADOW_DY = 20;
|
|
17023
17305
|
var PERSON_SHADOW_RY = 4;
|
|
17024
17306
|
var PERSON_SHADOW_RX = 55;
|
|
17025
|
-
function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
|
|
17307
|
+
function planLabel(node, cx, \u5E45\u4E0A\u9650, plan, textMetrics = "proportional") {
|
|
17026
17308
|
const \u5E45 = Math.max(
|
|
17027
|
-
textWidth(node.title ?? "", plan.\u540D\u524D.size),
|
|
17028
|
-
node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING) : 0,
|
|
17029
|
-
node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size) : 0
|
|
17309
|
+
textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics),
|
|
17310
|
+
node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING, textMetrics) : 0,
|
|
17311
|
+
node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size, 0, textMetrics) : 0
|
|
17030
17312
|
);
|
|
17031
|
-
const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size);
|
|
17032
|
-
const \
|
|
17313
|
+
const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics);
|
|
17314
|
+
const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
|
|
17315
|
+
const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", plan.\u540D\u524D.size, 0, \u5E45\u4E0A\u9650, \u6E2C\u308B) : 0;
|
|
17033
17316
|
const k = \u5E45 > 0 && \u5E45\u4E0A\u9650 > 0 ? Math.min(1, Math.max(\u5E45\u4E0A\u9650 / \u5E45, \u4E0B\u9650)) : 1;
|
|
17034
|
-
const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
|
|
17317
|
+
const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
|
|
17318
|
+
t,
|
|
17319
|
+
\u5927\u304D\u3055 * k,
|
|
17320
|
+
\u5E45\u4E0A\u9650,
|
|
17321
|
+
(u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
|
|
17322
|
+
);
|
|
17035
17323
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17036
17324
|
node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
17037
17325
|
"text",
|
|
@@ -17072,7 +17360,7 @@ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
|
|
|
17072
17360
|
)
|
|
17073
17361
|
] });
|
|
17074
17362
|
}
|
|
17075
|
-
function ShapePersonNode({ node, active }) {
|
|
17363
|
+
function ShapePersonNode({ node, active, textMetrics = "proportional" }) {
|
|
17076
17364
|
const r = shapeRegion(node);
|
|
17077
17365
|
const cx = r.cx;
|
|
17078
17366
|
const strokeColor = active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)";
|
|
@@ -17134,7 +17422,7 @@ function ShapePersonNode({ node, active }) {
|
|
|
17134
17422
|
)
|
|
17135
17423
|
] })
|
|
17136
17424
|
),
|
|
17137
|
-
planLabel(node, r.cx, Math.max(0, node.w), r.label)
|
|
17425
|
+
planLabel(node, r.cx, Math.max(0, node.w), r.label, textMetrics)
|
|
17138
17426
|
] });
|
|
17139
17427
|
}
|
|
17140
17428
|
var commonFrame2 = (active) => ({
|
|
@@ -17384,7 +17672,12 @@ function ShapeTerminalNode({ node, active, lang }) {
|
|
|
17384
17672
|
)
|
|
17385
17673
|
] });
|
|
17386
17674
|
}
|
|
17387
|
-
function ShapeCodeBlockNode({
|
|
17675
|
+
function ShapeCodeBlockNode({
|
|
17676
|
+
node,
|
|
17677
|
+
active,
|
|
17678
|
+
lang,
|
|
17679
|
+
textMetrics = "proportional"
|
|
17680
|
+
}) {
|
|
17388
17681
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
17389
17682
|
const frame = commonFrame2(active);
|
|
17390
17683
|
const \u7DDA = frame.strokeWidth / 2;
|
|
@@ -17395,7 +17688,10 @@ function ShapeCodeBlockNode({ node, active, lang }) {
|
|
|
17395
17688
|
const lineFont = "ui-monospace, SFMono-Regular, Menlo, monospace";
|
|
17396
17689
|
const \u672D = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("codeBlock.fileName"));
|
|
17397
17690
|
const \u672D\u306E\u5B57 = 11;
|
|
17398
|
-
const \u30BF\u30D6\u5E45 = Math.min(
|
|
17691
|
+
const \u30BF\u30D6\u5E45 = Math.min(
|
|
17692
|
+
Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0, textMetrics) + 24),
|
|
17693
|
+
Math.max(0, w)
|
|
17694
|
+
);
|
|
17399
17695
|
const \u30BF\u30D6\u9AD8 = 24;
|
|
17400
17696
|
const \u89D2 = 10;
|
|
17401
17697
|
const \u6E9D = 32;
|
|
@@ -17435,7 +17731,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
|
|
|
17435
17731
|
{ text: \u672D, size: \u672D\u306E\u5B57, \u5E2F: { \u5E45: \u30BF\u30D6\u5E45, \u9AD8\u3055: \u30BF\u30D6\u9AD8 } },
|
|
17436
17732
|
{ text: "1", size: \u884C\u756A\u53F7\u306E\u5B57, \u5E2F: { \u5E45: \u6E9D - \u6301\u3061\u4E0A\u3052, \u9AD8\u3055: \u884C\u9593 } }
|
|
17437
17733
|
];
|
|
17438
|
-
const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
17734
|
+
const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
17439
17735
|
const tabW = \u30BF\u30D6\u5E45 * \u500D;
|
|
17440
17736
|
const tabH = \u30BF\u30D6\u9AD8 * \u500D;
|
|
17441
17737
|
const \u4E38 = \u89D2 * \u500D;
|
|
@@ -17474,7 +17770,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
|
|
|
17474
17770
|
"data-cdl-counter-scaled": "1",
|
|
17475
17771
|
x: x + tabW / 2,
|
|
17476
17772
|
y: y + tabH / 2 + 4 * \u500D,
|
|
17477
|
-
fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW),
|
|
17773
|
+
fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW, textMetrics),
|
|
17478
17774
|
fontFamily: lineFont,
|
|
17479
17775
|
textAnchor: "middle",
|
|
17480
17776
|
fill: "#e6edf3",
|
|
@@ -17556,7 +17852,12 @@ function ShapeCodeBlockNode({ node, active, lang }) {
|
|
|
17556
17852
|
)
|
|
17557
17853
|
] });
|
|
17558
17854
|
}
|
|
17559
|
-
function ShapeKanbanCardNode({
|
|
17855
|
+
function ShapeKanbanCardNode({
|
|
17856
|
+
node,
|
|
17857
|
+
active,
|
|
17858
|
+
lang,
|
|
17859
|
+
textMetrics = "proportional"
|
|
17860
|
+
}) {
|
|
17560
17861
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
17561
17862
|
const frame = commonFrame2(active);
|
|
17562
17863
|
const \u7DDA = frame.strokeWidth / 2;
|
|
@@ -17610,7 +17911,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
|
|
|
17610
17911
|
);
|
|
17611
17912
|
const \u8AAC\u660E = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("kanbanCard.task"));
|
|
17612
17913
|
const \u72B6\u614B = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.eyebrow, \u5B57\u5F15("kanbanCard.status"));
|
|
17613
|
-
const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45);
|
|
17914
|
+
const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45, textMetrics);
|
|
17614
17915
|
const \u8AAC\u660E\u306E\u5B57 = \u540D\u524D.size * \u8AAC\u660E\u5B57\u6BD4;
|
|
17615
17916
|
const \u4F7F\u3048\u308B\u5E452 = Math.max(0, w - \u5DE6\u53F3\u4F59\u767D * \u500D * 2);
|
|
17616
17917
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
@@ -17697,7 +17998,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
|
|
|
17697
17998
|
{
|
|
17698
17999
|
x: x + w / 2,
|
|
17699
18000
|
y: \u540D\u524D.y + \u540D\u524D.size * \u8AAC\u660E\u57FA\u6E96\u6BD4,
|
|
17700
|
-
fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452),
|
|
18001
|
+
fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452, textMetrics),
|
|
17701
18002
|
textAnchor: "middle",
|
|
17702
18003
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
17703
18004
|
children: \u8AAC\u660E
|
|
@@ -17988,18 +18289,33 @@ var externalLabel = (node, cx, bottomY) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRu
|
|
|
17988
18289
|
)
|
|
17989
18290
|
] });
|
|
17990
18291
|
var LABEL_EYEBROW_SPACING = 2;
|
|
17991
|
-
function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
|
|
17992
|
-
const \
|
|
17993
|
-
const \
|
|
18292
|
+
function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
|
|
18293
|
+
const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
|
|
18294
|
+
const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
|
|
18295
|
+
const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u6E2C\u308B) : 0;
|
|
17994
18296
|
const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
|
|
17995
18297
|
const size = \u5927\u304D\u3055 * \u500D\u7387;
|
|
17996
18298
|
const spacing = \u5B57\u9593 * \u500D\u7387;
|
|
17997
|
-
return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) =>
|
|
17998
|
-
}
|
|
17999
|
-
function bottomLabel(node, cx, plan) {
|
|
18000
|
-
const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(
|
|
18001
|
-
|
|
18002
|
-
|
|
18299
|
+
return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
|
|
18300
|
+
}
|
|
18301
|
+
function bottomLabel(node, cx, plan, textMetrics = "proportional") {
|
|
18302
|
+
const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(
|
|
18303
|
+
node.eyebrow ?? "",
|
|
18304
|
+
plan.\u80A9\u66F8?.size ?? 0,
|
|
18305
|
+
LABEL_EYEBROW_SPACING,
|
|
18306
|
+
node.w,
|
|
18307
|
+
false,
|
|
18308
|
+
textMetrics
|
|
18309
|
+
);
|
|
18310
|
+
const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
|
|
18311
|
+
const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(
|
|
18312
|
+
node.subtitle ?? "",
|
|
18313
|
+
plan.\u8AAC\u660E?.size ?? 0,
|
|
18314
|
+
0,
|
|
18315
|
+
node.w,
|
|
18316
|
+
false,
|
|
18317
|
+
textMetrics
|
|
18318
|
+
);
|
|
18003
18319
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18004
18320
|
node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
|
|
18005
18321
|
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
|
|
@@ -18013,7 +18329,7 @@ var RACK_SLOT_N = 4;
|
|
|
18013
18329
|
var RACK_BOTTOM = 8;
|
|
18014
18330
|
var RACK_H = RACK_SLOT_TOP + RACK_SLOT_N * RACK_SLOT_H + (RACK_SLOT_N - 1) * RACK_SLOT_GAP + RACK_BOTTOM;
|
|
18015
18331
|
var RACK_W_MIN = 120;
|
|
18016
|
-
function ShapeServerRackNode({ node, active }) {
|
|
18332
|
+
function ShapeServerRackNode({ node, active, textMetrics = "proportional" }) {
|
|
18017
18333
|
const r = shapeRegion(node);
|
|
18018
18334
|
const frame = commonFrame3(active);
|
|
18019
18335
|
const \u7DDA = frame.strokeWidth / 2;
|
|
@@ -18095,7 +18411,7 @@ function ShapeServerRackNode({ node, active }) {
|
|
|
18095
18411
|
] }, i);
|
|
18096
18412
|
})
|
|
18097
18413
|
] })),
|
|
18098
|
-
bottomLabel(node, r.cx, r.label)
|
|
18414
|
+
bottomLabel(node, r.cx, r.label, textMetrics)
|
|
18099
18415
|
] });
|
|
18100
18416
|
}
|
|
18101
18417
|
var HUB_R = 30;
|
|
@@ -18103,7 +18419,7 @@ var ARM_LEN = 68;
|
|
|
18103
18419
|
var END_R = 7;
|
|
18104
18420
|
var WIFI_ARC_R = [10, 16, 22];
|
|
18105
18421
|
var WIFI_BASE_Y = 5;
|
|
18106
|
-
function ShapeNetworkNodeNode({ node, active }) {
|
|
18422
|
+
function ShapeNetworkNodeNode({ node, active, textMetrics = "proportional" }) {
|
|
18107
18423
|
const r = shapeRegion(node);
|
|
18108
18424
|
const cx = r.cx;
|
|
18109
18425
|
const cy = r.cy;
|
|
@@ -18179,12 +18495,12 @@ function ShapeNetworkNodeNode({ node, active }) {
|
|
|
18179
18495
|
)),
|
|
18180
18496
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy: cy + WIFI_BASE_Y + 3, r: 2.5, fill: "var(--cdl-tone-accent, #2d6a8f)", stroke: "none" })
|
|
18181
18497
|
] })),
|
|
18182
|
-
bottomLabel(node, r.cx, r.label)
|
|
18498
|
+
bottomLabel(node, r.cx, r.label, textMetrics)
|
|
18183
18499
|
] });
|
|
18184
18500
|
}
|
|
18185
18501
|
var PHONE_H = 240;
|
|
18186
18502
|
var PHONE_W = 110;
|
|
18187
|
-
function ShapeMobileDeviceNode({ node, active }) {
|
|
18503
|
+
function ShapeMobileDeviceNode({ node, active, textMetrics = "proportional" }) {
|
|
18188
18504
|
const r = shapeRegion(node);
|
|
18189
18505
|
const frame = commonFrame3(active);
|
|
18190
18506
|
const \u7DDA = frame.strokeWidth / 2;
|
|
@@ -18251,7 +18567,7 @@ function ShapeMobileDeviceNode({ node, active }) {
|
|
|
18251
18567
|
}
|
|
18252
18568
|
)
|
|
18253
18569
|
] })),
|
|
18254
|
-
bottomLabel(node, r.cx, r.label)
|
|
18570
|
+
bottomLabel(node, r.cx, r.label, textMetrics)
|
|
18255
18571
|
] });
|
|
18256
18572
|
}
|
|
18257
18573
|
function ShapeIotSensorNode({ node, active }) {
|
|
@@ -18522,7 +18838,7 @@ var SAT_DISH_R = 12;
|
|
|
18522
18838
|
var SAT_DISH_STEM = 12;
|
|
18523
18839
|
var SAT_MAST_LEN = 22;
|
|
18524
18840
|
var SAT_MAST_TIP_R = 4;
|
|
18525
|
-
function ShapeSatelliteNode({ node, active }) {
|
|
18841
|
+
function ShapeSatelliteNode({ node, active, textMetrics = "proportional" }) {
|
|
18526
18842
|
const r = shapeRegion(node);
|
|
18527
18843
|
const cx = r.cx;
|
|
18528
18844
|
const cy = r.cy;
|
|
@@ -18711,7 +19027,7 @@ function ShapeSatelliteNode({ node, active }) {
|
|
|
18711
19027
|
),
|
|
18712
19028
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy: cy - bodyH / 2 - SAT_MAST_LEN, r: 2, fill: "#ff5f56", stroke: "none", children: /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "opacity", values: "0.4;1;0.4", dur: "1.4s", repeatCount: "indefinite" }) })
|
|
18713
19029
|
] })),
|
|
18714
|
-
bottomLabel(node, r.cx, r.label)
|
|
19030
|
+
bottomLabel(node, r.cx, r.label, textMetrics)
|
|
18715
19031
|
] });
|
|
18716
19032
|
}
|
|
18717
19033
|
var FRAME_SW_ACTIVE = 3;
|
|
@@ -18797,9 +19113,9 @@ function blockchainNodeExtent(strokeWidth) {
|
|
|
18797
19113
|
const \u6A2A = (NODE_PEER_DIST + NODE_PEER_R) * Math.cos(Math.PI / 6) + \u7DDA;
|
|
18798
19114
|
return { \u4E0A: \u7E26, \u4E0B: \u7E26, \u5DE6: \u6A2A, \u53F3: \u6A2A };
|
|
18799
19115
|
}
|
|
18800
|
-
function bottomLabel2(node, cx, plan) {
|
|
19116
|
+
function bottomLabel2(node, cx, plan, textMetrics = "proportional") {
|
|
18801
19117
|
const \u53CE\u3081\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593, \u984C\u304B = false) => {
|
|
18802
|
-
const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f) + ls * [...u].length;
|
|
19118
|
+
const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f, textMetrics) + ls * [...u].length;
|
|
18803
19119
|
const \u7D20\u306E\u5E45 = \u6E2C\u308B(t, \u5927\u304D\u3055, \u5B57\u9593);
|
|
18804
19120
|
const \u53CE\u307E\u308B = \u7D20\u306E\u5E45 > node.w && node.w > 0 ? node.w / \u7D20\u306E\u5E45 : 1;
|
|
18805
19121
|
const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(t, \u5927\u304D\u3055, \u5B57\u9593, node.w, \u6E2C\u308B) : 0;
|
|
@@ -18832,7 +19148,12 @@ function EthereumDiamond({ cx, cy, h, colors }) {
|
|
|
18832
19148
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${cx} ${midY} L ${cx + w} ${cy + h * 0.05} L ${cx} ${lowerBotY} Z`, fill: c.dark, stroke: c.stroke, strokeWidth: 0.6, strokeLinejoin: "round" })
|
|
18833
19149
|
] });
|
|
18834
19150
|
}
|
|
18835
|
-
function ShapeSmartContractNode({
|
|
19151
|
+
function ShapeSmartContractNode({
|
|
19152
|
+
node,
|
|
19153
|
+
active,
|
|
19154
|
+
lang,
|
|
19155
|
+
textMetrics = "proportional"
|
|
19156
|
+
}) {
|
|
18836
19157
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
18837
19158
|
const frame = commonFrame4(active);
|
|
18838
19159
|
const r = shapeRegion(node);
|
|
@@ -18873,7 +19194,7 @@ function ShapeSmartContractNode({ node, active, lang }) {
|
|
|
18873
19194
|
}
|
|
18874
19195
|
];
|
|
18875
19196
|
const art = (\u500D\u7387) => {
|
|
18876
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
19197
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
18877
19198
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
18878
19199
|
/* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: path, ...frame, strokeLinejoin: "round" }),
|
|
18879
19200
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: foldPath, fill: "none", stroke: frame.stroke, strokeWidth: frame.strokeWidth, strokeLinejoin: "round" }),
|
|
@@ -18895,10 +19216,10 @@ function ShapeSmartContractNode({ node, active, lang }) {
|
|
|
18895
19216
|
};
|
|
18896
19217
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
18897
19218
|
fitArt(r, smartContractExtent(frame.strokeWidth), art),
|
|
18898
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19219
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
18899
19220
|
] });
|
|
18900
19221
|
}
|
|
18901
|
-
var \u5B57\u306E\u5E45 = (text, size) => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size);
|
|
19222
|
+
var \u5B57\u306E\u5E45 = (text, size, textMetrics = "proportional") => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, 0, textMetrics);
|
|
18902
19223
|
var BLOCK_DEFAULT_FIELDS = [
|
|
18903
19224
|
{ key: "hash", label: "blockchainBlock.hash", value: { text: "0xaf31..." } },
|
|
18904
19225
|
{ key: "prev", label: "blockchainBlock.prev", value: { text: "0x7b3f..." } },
|
|
@@ -18906,10 +19227,16 @@ var BLOCK_DEFAULT_FIELDS = [
|
|
|
18906
19227
|
{ key: "nonce", label: "blockchainBlock.nonce", value: { text: "82,914" } },
|
|
18907
19228
|
{ key: "tx", label: "blockchainBlock.tx", value: { \u8F9E\u66F8: "blockchainBlock.txCount" } }
|
|
18908
19229
|
];
|
|
18909
|
-
function ShapeBlockchainBlockNode({
|
|
19230
|
+
function ShapeBlockchainBlockNode({
|
|
19231
|
+
node,
|
|
19232
|
+
active,
|
|
19233
|
+
lang,
|
|
19234
|
+
textMetrics = "proportional"
|
|
19235
|
+
}) {
|
|
18910
19236
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
18911
19237
|
const frame = commonFrame4(active);
|
|
18912
19238
|
const r = shapeRegion(node);
|
|
19239
|
+
const \u6E2C\u308B\u5B57 = (text, size) => \u5B57\u306E\u5E45(text, size, textMetrics);
|
|
18913
19240
|
const bw = BLOCK_W;
|
|
18914
19241
|
const bh = BLOCK_H;
|
|
18915
19242
|
const cx = r.cx;
|
|
@@ -18930,9 +19257,9 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
|
|
|
18930
19257
|
const \u5E2F\u306E\u6B8B\u308A = bw - 14 - 30;
|
|
18931
19258
|
const \u80A9\u66F8\u306E\u9699\u9593 = 8;
|
|
18932
19259
|
const \u80A9\u66F8\u306E\u4E0A\u9650 = (\u5E2F\u306E\u6B8B\u308A - \u80A9\u66F8\u306E\u9699\u9593) / 2;
|
|
18933
|
-
const \u80A9\u66F8\u306E\u500D\u7387 = \u80A9\u66F8 === "" ? 1 : \u5E45\u306E\u500D\u7387(\u80A9\u66F8, \u80A9\u66F8\u306E\u5B57, 0, \u80A9\u66F8\u306E\u4E0A\u9650);
|
|
19260
|
+
const \u80A9\u66F8\u306E\u500D\u7387 = \u80A9\u66F8 === "" ? 1 : \u5E45\u306E\u500D\u7387(\u80A9\u66F8, \u80A9\u66F8\u306E\u5B57, 0, \u80A9\u66F8\u306E\u4E0A\u9650, textMetrics);
|
|
18934
19261
|
const \u80A9\u66F8\u306E\u6307\u5B9A = \u80A9\u66F8\u306E\u5B57 * \u80A9\u66F8\u306E\u500D\u7387;
|
|
18935
|
-
const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \
|
|
19262
|
+
const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u6E2C\u308B\u5B57(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
|
|
18936
19263
|
const \u898B\u51FA\u3057\u306E\u5E45 = \u5E2F\u306E\u6B8B\u308A - (\u80A9\u66F8 === "" ? 0 : \u80A9\u66F8\u306E\u5E45 + \u80A9\u66F8\u306E\u9699\u9593);
|
|
18937
19264
|
const \u6253\u3061\u6D88\u3059\u5B57\u3089 = [
|
|
18938
19265
|
{ text: \u898B\u51FA\u3057, size: \u898B\u51FA\u3057\u306E\u5B57, \u5E2F: { \u5E45: \u898B\u51FA\u3057\u306E\u5E45, \u9AD8\u3055: \u898B\u51FA\u3057\u306E\u5E2F } },
|
|
@@ -18943,12 +19270,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
|
|
|
18943
19270
|
{
|
|
18944
19271
|
text: f.value,
|
|
18945
19272
|
size: \u5024\u306E\u5B57,
|
|
18946
|
-
\u5E2F: { \u5E45: bw - 28 - \
|
|
19273
|
+
\u5E2F: { \u5E45: bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
|
|
18947
19274
|
}
|
|
18948
19275
|
])
|
|
18949
19276
|
];
|
|
18950
19277
|
const art = (\u500D\u7387) => {
|
|
18951
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
19278
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
18952
19279
|
const \u984C\u306E\u5927\u304D\u3055 = \u898B\u51FA\u3057\u306E\u5B57 * \u500D;
|
|
18953
19280
|
const \u80A9\u66F8\u306E\u5927\u304D\u3055 = \u80A9\u66F8\u306E\u6307\u5B9A * \u500D;
|
|
18954
19281
|
const \u540D\u306E\u5927\u304D\u3055 = \u540D\u306E\u5B57 * \u500D;
|
|
@@ -18957,7 +19284,7 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
|
|
|
18957
19284
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
|
|
18958
19285
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
|
|
18959
19286
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${x} ${y + 32} L ${x} ${y + 8} Q ${x} ${y}, ${x + 8} ${y} L ${x + bw - 8} ${y} Q ${x + bw} ${y}, ${x + bw} ${y + 8} L ${x + bw} ${y + 32} Z`, fill: "var(--cdl-tone-accent, #2d6a8f)", fillOpacity: 0.9, stroke: "none" }),
|
|
18960
|
-
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "blockchain-block-title", "data-cdl-counter-scaled": "1", x: x + 14, y: y + 22, fontSize: \u984C\u306E\u5927\u304D\u3055, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, \u984C\u306E\u5927\u304D\u3055, \u898B\u51FA\u3057\u306E\u5E45, \
|
|
19287
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "blockchain-block-title", "data-cdl-counter-scaled": "1", x: x + 14, y: y + 22, fontSize: \u984C\u306E\u5927\u304D\u3055, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, \u984C\u306E\u5927\u304D\u3055, \u898B\u51FA\u3057\u306E\u5E45, \u6E2C\u308B\u5B57) }),
|
|
18961
19288
|
\u80A9\u66F8 !== "" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18962
19289
|
"text",
|
|
18963
19290
|
{
|
|
@@ -18977,7 +19304,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
|
|
|
18977
19304
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
|
|
18978
19305
|
fields.map((f, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
18979
19306
|
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-counter-scaled": "1", x: x + 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u540D\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "var(--cdl-text-dim, #5a6270)", children: f.label }),
|
|
18980
|
-
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": `blockchain-block-${f.key}`, "data-cdl-counter-scaled": "1", x: x + bw - 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u5024\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(
|
|
19307
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": `blockchain-block-${f.key}`, "data-cdl-counter-scaled": "1", x: x + bw - 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u5024\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(
|
|
19308
|
+
f.value,
|
|
19309
|
+
\u5024\u306E\u5927\u304D\u3055,
|
|
19310
|
+
bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5927\u304D\u3055) - 8,
|
|
19311
|
+
\u6E2C\u308B\u5B57
|
|
19312
|
+
) }),
|
|
18981
19313
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: x + 14, y1: y + 60 + i * \u884C\u306E\u9593\u9694, x2: x + bw - 14, y2: y + 60 + i * \u884C\u306E\u9593\u9694, stroke: "var(--cdl-divider, #d4d4d8)", strokeWidth: 0.5, opacity: 0.5 })
|
|
18982
19314
|
] }, i)),
|
|
18983
19315
|
/* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
|
|
@@ -18989,7 +19321,11 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
|
|
|
18989
19321
|
};
|
|
18990
19322
|
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: fitArt(r, blockchainBlockExtent(frame.strokeWidth), art) });
|
|
18991
19323
|
}
|
|
18992
|
-
function ShapeBlockchainNode({
|
|
19324
|
+
function ShapeBlockchainNode({
|
|
19325
|
+
node,
|
|
19326
|
+
active,
|
|
19327
|
+
textMetrics = "proportional"
|
|
19328
|
+
}) {
|
|
18993
19329
|
const frame = commonFrame4(active);
|
|
18994
19330
|
const r = shapeRegion(node);
|
|
18995
19331
|
const cx = r.cx;
|
|
@@ -19005,7 +19341,7 @@ function ShapeBlockchainNode({ node, active }) {
|
|
|
19005
19341
|
{ text: "0x\u2026", size: CHAIN_HASH_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: CHAIN_ROW_GAP } }
|
|
19006
19342
|
];
|
|
19007
19343
|
const art = (\u500D\u7387) => {
|
|
19008
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
19344
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
19009
19345
|
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
|
|
19010
19346
|
const bx = startX + i * (blockW + linkW);
|
|
19011
19347
|
const isCurrent = i === blockCount - 1;
|
|
@@ -19041,10 +19377,14 @@ function ShapeBlockchainNode({ node, active }) {
|
|
|
19041
19377
|
};
|
|
19042
19378
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19043
19379
|
fitArt(r, chainExtent(), art),
|
|
19044
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19380
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
19045
19381
|
] });
|
|
19046
19382
|
}
|
|
19047
|
-
function ShapeBitcoinChainNode({
|
|
19383
|
+
function ShapeBitcoinChainNode({
|
|
19384
|
+
node,
|
|
19385
|
+
active,
|
|
19386
|
+
textMetrics = "proportional"
|
|
19387
|
+
}) {
|
|
19048
19388
|
const frame = commonFrame4(active);
|
|
19049
19389
|
const r = shapeRegion(node);
|
|
19050
19390
|
const cx = r.cx;
|
|
@@ -19060,7 +19400,7 @@ function ShapeBitcoinChainNode({ node, active }) {
|
|
|
19060
19400
|
{ text: "#820", size: BTC_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
|
|
19061
19401
|
];
|
|
19062
19402
|
const art = (\u500D\u7387) => {
|
|
19063
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
19403
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
19064
19404
|
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
|
|
19065
19405
|
const bx = startX + i * (blockW + linkW);
|
|
19066
19406
|
const isCurrent = i === blockCount - 1;
|
|
@@ -19091,10 +19431,14 @@ function ShapeBitcoinChainNode({ node, active }) {
|
|
|
19091
19431
|
};
|
|
19092
19432
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19093
19433
|
fitArt(r, chainExtent(), art),
|
|
19094
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19434
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
19095
19435
|
] });
|
|
19096
19436
|
}
|
|
19097
|
-
function ShapeEthereumChainNode({
|
|
19437
|
+
function ShapeEthereumChainNode({
|
|
19438
|
+
node,
|
|
19439
|
+
active,
|
|
19440
|
+
textMetrics = "proportional"
|
|
19441
|
+
}) {
|
|
19098
19442
|
const frame = commonFrame4(active);
|
|
19099
19443
|
const r = shapeRegion(node);
|
|
19100
19444
|
const cx = r.cx;
|
|
@@ -19110,7 +19454,7 @@ function ShapeEthereumChainNode({ node, active }) {
|
|
|
19110
19454
|
{ text: "#214", size: ETH_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
|
|
19111
19455
|
];
|
|
19112
19456
|
const art = (\u500D\u7387) => {
|
|
19113
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
19457
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
19114
19458
|
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
|
|
19115
19459
|
const bx = startX + i * (blockW + linkW);
|
|
19116
19460
|
const isCurrent = i === blockCount - 1;
|
|
@@ -19142,10 +19486,14 @@ function ShapeEthereumChainNode({ node, active }) {
|
|
|
19142
19486
|
};
|
|
19143
19487
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19144
19488
|
fitArt(r, chainExtent(), art),
|
|
19145
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19489
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
19146
19490
|
] });
|
|
19147
19491
|
}
|
|
19148
|
-
function ShapeBlockchainNodeNode({
|
|
19492
|
+
function ShapeBlockchainNodeNode({
|
|
19493
|
+
node,
|
|
19494
|
+
active,
|
|
19495
|
+
textMetrics = "proportional"
|
|
19496
|
+
}) {
|
|
19149
19497
|
const frame = commonFrame4(active);
|
|
19150
19498
|
const r = shapeRegion(node);
|
|
19151
19499
|
const cx = r.cx;
|
|
@@ -19199,10 +19547,15 @@ function ShapeBlockchainNodeNode({ node, active }) {
|
|
|
19199
19547
|
] });
|
|
19200
19548
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19201
19549
|
fitArt(r, blockchainNodeExtent(frame.strokeWidth), art),
|
|
19202
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19550
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
19203
19551
|
] });
|
|
19204
19552
|
}
|
|
19205
|
-
function ShapeRpcNodeNode({
|
|
19553
|
+
function ShapeRpcNodeNode({
|
|
19554
|
+
node,
|
|
19555
|
+
active,
|
|
19556
|
+
lang,
|
|
19557
|
+
textMetrics = "proportional"
|
|
19558
|
+
}) {
|
|
19206
19559
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
19207
19560
|
const frame = commonFrame4(active);
|
|
19208
19561
|
const r = shapeRegion(node);
|
|
@@ -19221,10 +19574,10 @@ function ShapeRpcNodeNode({ node, active, lang }) {
|
|
|
19221
19574
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy + 26, fontSize: 11, textAnchor: "middle", fill: "#7a8290", fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", children: "JSON-RPC 2.0" }),
|
|
19222
19575
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 16, y: y + bh - 24, width: bw - 32, height: 8, rx: 4, fill: "#0f1419", stroke: "none" }),
|
|
19223
19576
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 16, y: y + bh - 24, width: (bw - 32) * 0.92, height: 8, rx: 4, fill: "#27c93f", stroke: "none", children: /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "width", values: `${(bw - 32) * 0.86};${(bw - 32) * 0.96};${(bw - 32) * 0.86}`, dur: "3s", repeatCount: "indefinite" }) }),
|
|
19224
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19577
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
19225
19578
|
] });
|
|
19226
19579
|
}
|
|
19227
|
-
function ShapeWalletNode({ node, active }) {
|
|
19580
|
+
function ShapeWalletNode({ node, active, textMetrics = "proportional" }) {
|
|
19228
19581
|
const frame = commonFrame4(active);
|
|
19229
19582
|
const r = shapeRegion(node);
|
|
19230
19583
|
const cx = r.cx;
|
|
@@ -19298,10 +19651,10 @@ function ShapeWalletNode({ node, active }) {
|
|
|
19298
19651
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: foldY + 3, fontSize: 9, fontWeight: 700, fill: "#5a3a10", textAnchor: "middle", opacity: 0.8, children: "\u039E" }),
|
|
19299
19652
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${x + 2} ${y + 6} L ${x + w - 2} ${y + 6}`, fill: "none", stroke: "#ffffff", strokeWidth: 1, opacity: 0.4 })
|
|
19300
19653
|
] }),
|
|
19301
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19654
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
19302
19655
|
] });
|
|
19303
19656
|
}
|
|
19304
|
-
function ShapeNftNode({ node, active }) {
|
|
19657
|
+
function ShapeNftNode({ node, active, textMetrics = "proportional" }) {
|
|
19305
19658
|
const frame = commonFrame4(active);
|
|
19306
19659
|
const r = shapeRegion(node);
|
|
19307
19660
|
const cx = r.cx;
|
|
@@ -19317,7 +19670,7 @@ function ShapeNftNode({ node, active }) {
|
|
|
19317
19670
|
{ text: "#1024", size: NFT_ID_SIZE, \u5E2F: { \u5E45: cardW - 16 - 34, \u9AD8\u3055: cardH - artH } }
|
|
19318
19671
|
];
|
|
19319
19672
|
const art = (\u500D\u7387) => {
|
|
19320
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
19673
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
19321
19674
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19322
19675
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 4, y: y + 4, width: cardW, height: cardH, rx: 14, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
|
|
19323
19676
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: cardW, height: cardH, rx: 14, ...frame }),
|
|
@@ -19355,10 +19708,10 @@ function ShapeNftNode({ node, active }) {
|
|
|
19355
19708
|
};
|
|
19356
19709
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19357
19710
|
fitArt(r, nftExtent(frame.strokeWidth), art),
|
|
19358
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19711
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
19359
19712
|
] });
|
|
19360
19713
|
}
|
|
19361
|
-
function ShapeTokenNode({ node, active }) {
|
|
19714
|
+
function ShapeTokenNode({ node, active, textMetrics = "proportional" }) {
|
|
19362
19715
|
const frame = commonFrame4(active);
|
|
19363
19716
|
const r = shapeRegion(node);
|
|
19364
19717
|
const cx = r.cx;
|
|
@@ -19395,7 +19748,7 @@ function ShapeTokenNode({ node, active }) {
|
|
|
19395
19748
|
}
|
|
19396
19749
|
}
|
|
19397
19750
|
),
|
|
19398
|
-
bottomLabel2(node, r.cx, r.label)
|
|
19751
|
+
bottomLabel2(node, r.cx, r.label, textMetrics)
|
|
19399
19752
|
] });
|
|
19400
19753
|
}
|
|
19401
19754
|
var commonFrame5 = (active) => ({
|
|
@@ -19414,7 +19767,8 @@ function \u5B57\u306E\u6BD4(c) {
|
|
|
19414
19767
|
if (\u5E83\u5B57.has(c)) return \u5E83\u5B57\u6BD4;
|
|
19415
19768
|
return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD4 : \u5E83\u5B57\u6BD4;
|
|
19416
19769
|
}
|
|
19417
|
-
function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
|
|
19770
|
+
function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
|
|
19771
|
+
if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
|
|
19418
19772
|
let \u5E45 = 0;
|
|
19419
19773
|
let \u5B57\u6570 = 0;
|
|
19420
19774
|
for (const c of \u6587\u5B57\u5217) {
|
|
@@ -19423,18 +19777,33 @@ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
|
|
|
19423
19777
|
}
|
|
19424
19778
|
return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
|
|
19425
19779
|
}
|
|
19426
|
-
function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
|
|
19427
|
-
const \
|
|
19428
|
-
const \
|
|
19780
|
+
function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
|
|
19781
|
+
const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E45(t, s, ls, textMetrics);
|
|
19782
|
+
const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
|
|
19783
|
+
const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u6E2C\u308B) : 0;
|
|
19429
19784
|
const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
|
|
19430
19785
|
const size = \u5927\u304D\u3055 * \u500D\u7387;
|
|
19431
19786
|
const spacing = \u5B57\u9593 * \u500D\u7387;
|
|
19432
|
-
return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \
|
|
19433
|
-
}
|
|
19434
|
-
function bottomLabel3(node, cx, plan) {
|
|
19435
|
-
const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(
|
|
19436
|
-
|
|
19437
|
-
|
|
19787
|
+
return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
|
|
19788
|
+
}
|
|
19789
|
+
function bottomLabel3(node, cx, plan, textMetrics = "proportional") {
|
|
19790
|
+
const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(
|
|
19791
|
+
node.eyebrow ?? "",
|
|
19792
|
+
plan.\u80A9\u66F8?.size ?? 0,
|
|
19793
|
+
LABEL_EYEBROW_SPACING2,
|
|
19794
|
+
node.w,
|
|
19795
|
+
false,
|
|
19796
|
+
textMetrics
|
|
19797
|
+
);
|
|
19798
|
+
const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
|
|
19799
|
+
const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(
|
|
19800
|
+
node.subtitle ?? "",
|
|
19801
|
+
plan.\u8AAC\u660E?.size ?? 0,
|
|
19802
|
+
0,
|
|
19803
|
+
node.w,
|
|
19804
|
+
false,
|
|
19805
|
+
textMetrics
|
|
19806
|
+
);
|
|
19438
19807
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
19439
19808
|
node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
|
|
19440
19809
|
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
|
|
@@ -19453,7 +19822,7 @@ var BANK_STEP_SW = 1;
|
|
|
19453
19822
|
var BANK_COLUMN_MIN = 24;
|
|
19454
19823
|
var BANK_BLD_W_MIN = 120;
|
|
19455
19824
|
var BANK_BLD_W_MAX = 280;
|
|
19456
|
-
function ShapeBankNode({ node, active }) {
|
|
19825
|
+
function ShapeBankNode({ node, active, textMetrics = "proportional" }) {
|
|
19457
19826
|
const frame = commonFrame5(active);
|
|
19458
19827
|
const r = shapeRegion(node);
|
|
19459
19828
|
const \u7DDA = frame.strokeWidth / 2;
|
|
@@ -19500,7 +19869,7 @@ function ShapeBankNode({ node, active }) {
|
|
|
19500
19869
|
] });
|
|
19501
19870
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19502
19871
|
fitArt(r, \u5E83\u304C\u308A, \u7D75),
|
|
19503
|
-
bottomLabel3(node, r.cx, r.label)
|
|
19872
|
+
bottomLabel3(node, r.cx, r.label, textMetrics)
|
|
19504
19873
|
] });
|
|
19505
19874
|
}
|
|
19506
19875
|
var TRUST_CROWN_RISE = 4;
|
|
@@ -19512,7 +19881,12 @@ var TRUST_BASE_H = 14;
|
|
|
19512
19881
|
var TRUST_BODY_OUT = 8;
|
|
19513
19882
|
var TRUST_BLD_W_MIN = 140;
|
|
19514
19883
|
var TRUST_BLD_W_MAX = 280;
|
|
19515
|
-
function ShapeTrustBankNode({
|
|
19884
|
+
function ShapeTrustBankNode({
|
|
19885
|
+
node,
|
|
19886
|
+
active,
|
|
19887
|
+
lang,
|
|
19888
|
+
textMetrics = "proportional"
|
|
19889
|
+
}) {
|
|
19516
19890
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
19517
19891
|
const frame = commonFrame5(active);
|
|
19518
19892
|
const r = shapeRegion(node);
|
|
@@ -19566,10 +19940,15 @@ function ShapeTrustBankNode({ node, active, lang }) {
|
|
|
19566
19940
|
] });
|
|
19567
19941
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19568
19942
|
fitArt(r, \u5E83\u304C\u308A, \u7D75),
|
|
19569
|
-
bottomLabel3(node, r.cx, r.label)
|
|
19943
|
+
bottomLabel3(node, r.cx, r.label, textMetrics)
|
|
19570
19944
|
] });
|
|
19571
19945
|
}
|
|
19572
|
-
function ShapePaymentProviderNode({
|
|
19946
|
+
function ShapePaymentProviderNode({
|
|
19947
|
+
node,
|
|
19948
|
+
active,
|
|
19949
|
+
lang,
|
|
19950
|
+
textMetrics = "proportional"
|
|
19951
|
+
}) {
|
|
19573
19952
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
19574
19953
|
const frame = commonFrame5(active);
|
|
19575
19954
|
const r = shapeRegion(node);
|
|
@@ -19594,10 +19973,14 @@ function ShapePaymentProviderNode({ node, active, lang }) {
|
|
|
19594
19973
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy + 9, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: accentDarker, fontFamily: "Georgia, serif", children: "$" })
|
|
19595
19974
|
] }),
|
|
19596
19975
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: y + boxH - 16, fontSize: 11, fontWeight: 700, letterSpacing: 2, textAnchor: "middle", fill: "#a4b5f2", children: \u5B57\u5F15("paymentProvider.status") }),
|
|
19597
|
-
bottomLabel3(node, r.cx, r.label)
|
|
19976
|
+
bottomLabel3(node, r.cx, r.label, textMetrics)
|
|
19598
19977
|
] });
|
|
19599
19978
|
}
|
|
19600
|
-
function ShapeCreditCardNode({
|
|
19979
|
+
function ShapeCreditCardNode({
|
|
19980
|
+
node,
|
|
19981
|
+
active,
|
|
19982
|
+
textMetrics = "proportional"
|
|
19983
|
+
}) {
|
|
19601
19984
|
const frame = commonFrame5(active);
|
|
19602
19985
|
const r = shapeRegion(node);
|
|
19603
19986
|
const cardW = Math.min(r.availW - 30, 260);
|
|
@@ -19619,7 +20002,7 @@ function ShapeCreditCardNode({ node, active }) {
|
|
|
19619
20002
|
[0, 1, 2, 3].map((block) => /* @__PURE__ */ jsxRuntime.jsx("g", { children: [0, 1, 2, 3].map((dot) => /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + 32 + block * (cardW - 64) / 4 + dot * 8, cy: y + cardH - 40, r: 2.8, fill: "#ffffff", stroke: "none" }, dot)) }, block)),
|
|
19620
20003
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + cardW - 48, cy: y + cardH - 24, r: 15, fill: "#c9302c", opacity: 0.9, stroke: "none" }),
|
|
19621
20004
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + cardW - 30, cy: y + cardH - 24, r: 15, fill: "#e5c07b", opacity: 0.9, stroke: "none" }),
|
|
19622
|
-
bottomLabel3(node, r.cx, r.label)
|
|
20005
|
+
bottomLabel3(node, r.cx, r.label, textMetrics)
|
|
19623
20006
|
] });
|
|
19624
20007
|
}
|
|
19625
20008
|
var BROKERAGE_TICK_H = 18;
|
|
@@ -19644,7 +20027,12 @@ var BROKERAGE_SHADE_OUT = 2;
|
|
|
19644
20027
|
var BROKERAGE_W_MIN = BROKERAGE_COLS * BROKERAGE_CELL_W + (BROKERAGE_COLS - 1) * BROKERAGE_GAP_X + 6;
|
|
19645
20028
|
var BROKERAGE_W_MAX = 140;
|
|
19646
20029
|
var BROKERAGE_H_MIN = BROKERAGE_TICK_H + BROKERAGE_LOGO_H + BROKERAGE_BASE_H;
|
|
19647
|
-
function ShapeBrokerageNode({
|
|
20030
|
+
function ShapeBrokerageNode({
|
|
20031
|
+
node,
|
|
20032
|
+
active,
|
|
20033
|
+
lang,
|
|
20034
|
+
textMetrics = "proportional"
|
|
20035
|
+
}) {
|
|
19648
20036
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
19649
20037
|
const frame = commonFrame5(active);
|
|
19650
20038
|
const r = shapeRegion(node);
|
|
@@ -19683,7 +20071,7 @@ function ShapeBrokerageNode({ node, active, lang }) {
|
|
|
19683
20071
|
}
|
|
19684
20072
|
];
|
|
19685
20073
|
const \u7D75 = (\u500D\u7387) => {
|
|
19686
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
20074
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
19687
20075
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19688
20076
|
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx, cy: y + h + BROKERAGE_SHADOW_DY, rx: w * BROKERAGE_SHADOW_RX_RATIO, ry: BROKERAGE_SHADOW_RY, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
|
|
19689
20077
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: w, height: h, fill: "#255a7a", stroke: accentDarker, strokeWidth: frame.strokeWidth }),
|
|
@@ -19711,12 +20099,17 @@ function ShapeBrokerageNode({ node, active, lang }) {
|
|
|
19711
20099
|
};
|
|
19712
20100
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19713
20101
|
fitArt(r, \u5E83\u304C\u308A, \u7D75),
|
|
19714
|
-
bottomLabel3(node, r.cx, r.label)
|
|
20102
|
+
bottomLabel3(node, r.cx, r.label, textMetrics)
|
|
19715
20103
|
] });
|
|
19716
20104
|
}
|
|
19717
20105
|
var EXCHANGE_SUB_SIZE = 11;
|
|
19718
20106
|
var EXCHANGE_HEX_R = 52;
|
|
19719
|
-
function ShapeExchangeNode({
|
|
20107
|
+
function ShapeExchangeNode({
|
|
20108
|
+
node,
|
|
20109
|
+
active,
|
|
20110
|
+
lang,
|
|
20111
|
+
textMetrics = "proportional"
|
|
20112
|
+
}) {
|
|
19720
20113
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
19721
20114
|
const frame = commonFrame5(active);
|
|
19722
20115
|
const r = shapeRegion(node);
|
|
@@ -19761,7 +20154,7 @@ function ShapeExchangeNode({ node, active, lang }) {
|
|
|
19761
20154
|
}
|
|
19762
20155
|
];
|
|
19763
20156
|
const \u7D75 = (\u500D\u7387) => {
|
|
19764
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
20157
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
19765
20158
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19766
20159
|
nodes.map((n, i) => /* @__PURE__ */ jsxRuntime.jsx("line", { x1: cx, y1: cy, x2: n.cx, y2: n.cy, stroke: accentDarker, strokeWidth: 1.5, strokeDasharray: "3 2" }, `l${i}`)),
|
|
19767
20160
|
nodes.map((n, i) => {
|
|
@@ -19780,7 +20173,7 @@ function ShapeExchangeNode({ node, active, lang }) {
|
|
|
19780
20173
|
};
|
|
19781
20174
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19782
20175
|
fitArt(r, \u5E83\u304C\u308A, \u7D75),
|
|
19783
|
-
bottomLabel3(node, r.cx, r.label)
|
|
20176
|
+
bottomLabel3(node, r.cx, r.label, textMetrics)
|
|
19784
20177
|
] });
|
|
19785
20178
|
}
|
|
19786
20179
|
var ATM_SIGN_H = 26;
|
|
@@ -19797,7 +20190,12 @@ var ATM_PANEL_H = 146;
|
|
|
19797
20190
|
var ATM_W_MIN = 100;
|
|
19798
20191
|
var ATM_W_MAX = ATM_PANEL_W;
|
|
19799
20192
|
var ATM_H_MIN = ATM_SIGN_H + ATM_SIGN_GAP + 30 + ATM_FLOOR_RESERVE;
|
|
19800
|
-
function ShapeAtmNode({
|
|
20193
|
+
function ShapeAtmNode({
|
|
20194
|
+
node,
|
|
20195
|
+
active,
|
|
20196
|
+
lang,
|
|
20197
|
+
textMetrics = "proportional"
|
|
20198
|
+
}) {
|
|
19801
20199
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
19802
20200
|
const frame = commonFrame5(active);
|
|
19803
20201
|
const r = shapeRegion(node);
|
|
@@ -19881,7 +20279,7 @@ function ShapeAtmNode({ node, active, lang }) {
|
|
|
19881
20279
|
] });
|
|
19882
20280
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19883
20281
|
fitArt(r, \u5E83\u304C\u308A, \u7D75),
|
|
19884
|
-
bottomLabel3(node, r.cx, r.label)
|
|
20282
|
+
bottomLabel3(node, r.cx, r.label, textMetrics)
|
|
19885
20283
|
] });
|
|
19886
20284
|
}
|
|
19887
20285
|
var commonFrame6 = (active) => ({
|
|
@@ -19900,7 +20298,8 @@ function \u5B57\u306E\u6BD42(c) {
|
|
|
19900
20298
|
if (\u5E83\u5B572.has(c)) return \u5E83\u5B57\u6BD42;
|
|
19901
20299
|
return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD42 : \u5E83\u5B57\u6BD42;
|
|
19902
20300
|
}
|
|
19903
|
-
function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
|
|
20301
|
+
function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
|
|
20302
|
+
if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
|
|
19904
20303
|
let \u5E45 = 0;
|
|
19905
20304
|
let \u5B57\u6570 = 0;
|
|
19906
20305
|
for (const c of \u6587\u5B57\u5217) {
|
|
@@ -19909,18 +20308,33 @@ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
|
|
|
19909
20308
|
}
|
|
19910
20309
|
return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
|
|
19911
20310
|
}
|
|
19912
|
-
function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
|
|
19913
|
-
const \
|
|
19914
|
-
const \
|
|
20311
|
+
function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
|
|
20312
|
+
const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E452(t, s, ls, textMetrics);
|
|
20313
|
+
const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
|
|
20314
|
+
const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u6E2C\u308B) : 0;
|
|
19915
20315
|
const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
|
|
19916
20316
|
const size = \u5927\u304D\u3055 * \u500D\u7387;
|
|
19917
20317
|
const spacing = \u5B57\u9593 * \u500D\u7387;
|
|
19918
|
-
return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \
|
|
19919
|
-
}
|
|
19920
|
-
function bottomLabel4(node, cx, plan) {
|
|
19921
|
-
const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(
|
|
19922
|
-
|
|
19923
|
-
|
|
20318
|
+
return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
|
|
20319
|
+
}
|
|
20320
|
+
function bottomLabel4(node, cx, plan, textMetrics = "proportional") {
|
|
20321
|
+
const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(
|
|
20322
|
+
node.eyebrow ?? "",
|
|
20323
|
+
plan.\u80A9\u66F8?.size ?? 0,
|
|
20324
|
+
LABEL_EYEBROW_SPACING3,
|
|
20325
|
+
node.w,
|
|
20326
|
+
false,
|
|
20327
|
+
textMetrics
|
|
20328
|
+
);
|
|
20329
|
+
const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
|
|
20330
|
+
const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(
|
|
20331
|
+
node.subtitle ?? "",
|
|
20332
|
+
plan.\u8AAC\u660E?.size ?? 0,
|
|
20333
|
+
0,
|
|
20334
|
+
node.w,
|
|
20335
|
+
false,
|
|
20336
|
+
textMetrics
|
|
20337
|
+
);
|
|
19924
20338
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
19925
20339
|
node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
|
|
19926
20340
|
/* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
|
|
@@ -19932,7 +20346,7 @@ var WEBSITE_BAR_H = 32;
|
|
|
19932
20346
|
var WEBSITE_H_MIN = WEBSITE_BAR_H + 98;
|
|
19933
20347
|
var WEBSITE_W_MIN = 160;
|
|
19934
20348
|
var WEBSITE_W_MAX = 280;
|
|
19935
|
-
function ShapeWebsiteNode({ node, active }) {
|
|
20349
|
+
function ShapeWebsiteNode({ node, active, textMetrics = "proportional" }) {
|
|
19936
20350
|
const frame = commonFrame6(active);
|
|
19937
20351
|
const r = shapeRegion(node);
|
|
19938
20352
|
const cx = r.cx;
|
|
@@ -19958,10 +20372,10 @@ function ShapeWebsiteNode({ node, active }) {
|
|
|
19958
20372
|
] });
|
|
19959
20373
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
19960
20374
|
fitArt(r, \u5E83\u304C\u308A, \u7D75),
|
|
19961
|
-
bottomLabel4(node, r.cx, r.label)
|
|
20375
|
+
bottomLabel4(node, r.cx, r.label, textMetrics)
|
|
19962
20376
|
] });
|
|
19963
20377
|
}
|
|
19964
|
-
function ShapeStorefrontNode({ node, active, lang }) {
|
|
20378
|
+
function ShapeStorefrontNode({ node, active, lang, textMetrics = "proportional" }) {
|
|
19965
20379
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
19966
20380
|
const frame = commonFrame6(active);
|
|
19967
20381
|
const r = shapeRegion(node);
|
|
@@ -20006,7 +20420,7 @@ function ShapeStorefrontNode({ node, active, lang }) {
|
|
|
20006
20420
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x: doorX + doorW / 2, y: doorY + doorH * 0.85 + 11, fontSize: 11, fontWeight: 700, letterSpacing: 1, textAnchor: "middle", fill: "#5a3a10", children: \u5B57\u5F15("storefront.open") }),
|
|
20007
20421
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: doorX + 6, cy: doorY + doorH * 0.55, r: 1.5, fill: "#c15a4a" }),
|
|
20008
20422
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: x - 6, y: y + bh - 6, width: bw + 12, height: 8, fill: "#5a6270", stroke: "none" }),
|
|
20009
|
-
bottomLabel4(node, r.cx, r.label)
|
|
20423
|
+
bottomLabel4(node, r.cx, r.label, textMetrics)
|
|
20010
20424
|
] });
|
|
20011
20425
|
}
|
|
20012
20426
|
var WAREHOUSE_ROOF_H = 18;
|
|
@@ -20020,7 +20434,7 @@ var WAREHOUSE_SHADOW_RX_RATIO = 0.5;
|
|
|
20020
20434
|
var WAREHOUSE_H_MIN = WAREHOUSE_ROOF_H + WAREHOUSE_SIGN_H + 68;
|
|
20021
20435
|
var WAREHOUSE_W_MIN = 160;
|
|
20022
20436
|
var WAREHOUSE_W_MAX = 240;
|
|
20023
|
-
function ShapeWarehouseNode({ node, active, lang }) {
|
|
20437
|
+
function ShapeWarehouseNode({ node, active, lang, textMetrics = "proportional" }) {
|
|
20024
20438
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
20025
20439
|
const frame = commonFrame6(active);
|
|
20026
20440
|
const r = shapeRegion(node);
|
|
@@ -20073,13 +20487,13 @@ function ShapeWarehouseNode({ node, active, lang }) {
|
|
|
20073
20487
|
] });
|
|
20074
20488
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
20075
20489
|
fitArt(r, \u5E83\u304C\u308A, \u7D75),
|
|
20076
|
-
bottomLabel4(node, r.cx, r.label)
|
|
20490
|
+
bottomLabel4(node, r.cx, r.label, textMetrics)
|
|
20077
20491
|
] });
|
|
20078
20492
|
}
|
|
20079
20493
|
var HANDLE_GRIP_X = 118;
|
|
20080
20494
|
var HANDLE_GRIP_R = 4;
|
|
20081
20495
|
var CART_SHADOW_RX = 80;
|
|
20082
|
-
function ShapeOnlineShopNode({ node, active }) {
|
|
20496
|
+
function ShapeOnlineShopNode({ node, active, textMetrics = "proportional" }) {
|
|
20083
20497
|
const frame = commonFrame6(active);
|
|
20084
20498
|
const r = shapeRegion(node);
|
|
20085
20499
|
const cy = r.cy + 10;
|
|
@@ -20135,10 +20549,10 @@ function ShapeOnlineShopNode({ node, active }) {
|
|
|
20135
20549
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 16 * s, fill: "#0f1830", stroke: "#000", strokeWidth: 2 * s }),
|
|
20136
20550
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 8 * s, fill: "#5a6270", stroke: "#0f1830", strokeWidth: 1.5 * s }),
|
|
20137
20551
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 2 * s, fill: "#0f1830" }),
|
|
20138
|
-
bottomLabel4(node, r.cx, r.label)
|
|
20552
|
+
bottomLabel4(node, r.cx, r.label, textMetrics)
|
|
20139
20553
|
] });
|
|
20140
20554
|
}
|
|
20141
|
-
function ShapeCdnEdgeNode({ node, active }) {
|
|
20555
|
+
function ShapeCdnEdgeNode({ node, active, textMetrics = "proportional" }) {
|
|
20142
20556
|
const frame = commonFrame6(active);
|
|
20143
20557
|
const r = shapeRegion(node);
|
|
20144
20558
|
const cx = r.cx;
|
|
@@ -20201,7 +20615,7 @@ function ShapeCdnEdgeNode({ node, active }) {
|
|
|
20201
20615
|
] });
|
|
20202
20616
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
20203
20617
|
fitArt(r, { \u4E0A: \u5E83\u304C\u308A, \u4E0B: \u5E83\u304C\u308A, \u5DE6: \u5E83\u304C\u308A, \u53F3: \u5E83\u304C\u308A }, \u7D75),
|
|
20204
|
-
bottomLabel4(node, r.cx, r.label)
|
|
20618
|
+
bottomLabel4(node, r.cx, r.label, textMetrics)
|
|
20205
20619
|
] });
|
|
20206
20620
|
}
|
|
20207
20621
|
var API_ROW_TOP = 52;
|
|
@@ -20216,7 +20630,7 @@ var API_METHOD_BOX_W = 54;
|
|
|
20216
20630
|
var API_METHOD_TEXT_W = 48;
|
|
20217
20631
|
var API_W_MIN = 200;
|
|
20218
20632
|
var API_W_MAX = 300;
|
|
20219
|
-
function ShapeApiGatewayNode({ node, active, lang }) {
|
|
20633
|
+
function ShapeApiGatewayNode({ node, active, lang, textMetrics = "proportional" }) {
|
|
20220
20634
|
const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
|
|
20221
20635
|
const frame = commonFrame6(active);
|
|
20222
20636
|
const r = shapeRegion(node);
|
|
@@ -20228,7 +20642,13 @@ function ShapeApiGatewayNode({ node, active, lang }) {
|
|
|
20228
20642
|
const x = cx - bw / 2;
|
|
20229
20643
|
const y = r.cy - \u7E26 / 2 + \u4F59\u767D;
|
|
20230
20644
|
const \u5E83\u304C\u308A = { \u4E0A: \u7E26 / 2, \u4E0B: \u7E26 / 2, \u5DE6: bw / 2 + \u4F59\u767D, \u53F3: bw / 2 + \u4F59\u767D };
|
|
20231
|
-
const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(
|
|
20645
|
+
const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(
|
|
20646
|
+
11,
|
|
20647
|
+
11 * API_METHOD_TEXT_W / Math.max(
|
|
20648
|
+
displayWidth(s) * 11 * MONO_ADVANCE_RATIO,
|
|
20649
|
+
textWidth(s, 11, 0, textMetrics)
|
|
20650
|
+
)
|
|
20651
|
+
);
|
|
20232
20652
|
const rowPitch = Math.max(
|
|
20233
20653
|
API_ROW_PITCH_MIN,
|
|
20234
20654
|
(bh - API_ROW_TOP - API_ROW_H - API_ROW_BOTTOM_PAD) / (API_ROWS - 1)
|
|
@@ -20244,7 +20664,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
|
|
|
20244
20664
|
\u5E2F: { \u5E45: bw - 32 - 64 - 16, \u9AD8\u3055: API_ROW_H }
|
|
20245
20665
|
}));
|
|
20246
20666
|
const \u7D75 = (\u500D\u7387) => {
|
|
20247
|
-
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
|
|
20667
|
+
const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
|
|
20248
20668
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
20249
20669
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + DROP_SHADOW_D, y: y + DROP_SHADOW_D, width: bw, height: bh, rx: 10, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
|
|
20250
20670
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 10, fill: "#1a2332", stroke: frame.stroke, strokeWidth: frame.strokeWidth }),
|
|
@@ -20261,7 +20681,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
|
|
|
20261
20681
|
};
|
|
20262
20682
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
20263
20683
|
fitArt(r, \u5E83\u304C\u308A, \u7D75),
|
|
20264
|
-
bottomLabel4(node, r.cx, r.label)
|
|
20684
|
+
bottomLabel4(node, r.cx, r.label, textMetrics)
|
|
20265
20685
|
] });
|
|
20266
20686
|
}
|
|
20267
20687
|
function bottomLabel5(node, cx, plan) {
|
|
@@ -20561,6 +20981,7 @@ function CdlNodeView({
|
|
|
20561
20981
|
chartLineScale,
|
|
20562
20982
|
\u95A2\u4FC2\u306E\u53D7\u3051\u53E3,
|
|
20563
20983
|
lang,
|
|
20984
|
+
textMetrics,
|
|
20564
20985
|
\u5024\u306E\u540D\u524D
|
|
20565
20986
|
}) {
|
|
20566
20987
|
const value = node.value ? interpolate(node.value, stateValues, \u5024\u306E\u540D\u524D) : void 0;
|
|
@@ -20605,7 +21026,14 @@ function CdlNodeView({
|
|
|
20605
21026
|
return /* @__PURE__ */ jsxRuntime.jsx(CardNode, { node: resolvedNode, active });
|
|
20606
21027
|
// 時系列のやり取り (#578)。 1 つの箱が図を丸ごと描く = 縦が時間で、参加者は箱を持たない
|
|
20607
21028
|
case "sequence-board":
|
|
20608
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21029
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21030
|
+
SequenceBoardNode,
|
|
21031
|
+
{
|
|
21032
|
+
node: resolvedNode,
|
|
21033
|
+
stateValues,
|
|
21034
|
+
textMetrics
|
|
21035
|
+
}
|
|
21036
|
+
);
|
|
20609
21037
|
// 図表 9 種は payload が `{signal}` を取れるので stateValues を渡す
|
|
20610
21038
|
// (`render/payload-binding.ts` が描画直前に解決する)。 取れる欄は種別で違い、
|
|
20611
21039
|
// 数と語を取る 7 種に対し、mind-map / tree-hierarchy は **名前だけ** を取る (#467)。
|
|
@@ -20630,7 +21058,8 @@ function CdlNodeView({
|
|
|
20630
21058
|
active,
|
|
20631
21059
|
stateValues,
|
|
20632
21060
|
drawing,
|
|
20633
|
-
progress
|
|
21061
|
+
progress,
|
|
21062
|
+
textMetrics
|
|
20634
21063
|
}
|
|
20635
21064
|
);
|
|
20636
21065
|
case "chart-gauge":
|
|
@@ -20641,7 +21070,8 @@ function CdlNodeView({
|
|
|
20641
21070
|
active,
|
|
20642
21071
|
stateValues,
|
|
20643
21072
|
drawing,
|
|
20644
|
-
progress
|
|
21073
|
+
progress,
|
|
21074
|
+
textMetrics
|
|
20645
21075
|
}
|
|
20646
21076
|
);
|
|
20647
21077
|
case "chart-stacked-bar":
|
|
@@ -20652,7 +21082,8 @@ function CdlNodeView({
|
|
|
20652
21082
|
active,
|
|
20653
21083
|
stateValues,
|
|
20654
21084
|
drawing,
|
|
20655
|
-
progress
|
|
21085
|
+
progress,
|
|
21086
|
+
textMetrics
|
|
20656
21087
|
}
|
|
20657
21088
|
);
|
|
20658
21089
|
case "chart-slope":
|
|
@@ -20663,7 +21094,8 @@ function CdlNodeView({
|
|
|
20663
21094
|
active,
|
|
20664
21095
|
stateValues,
|
|
20665
21096
|
drawing,
|
|
20666
|
-
progress
|
|
21097
|
+
progress,
|
|
21098
|
+
textMetrics
|
|
20667
21099
|
}
|
|
20668
21100
|
);
|
|
20669
21101
|
case "chart-waffle":
|
|
@@ -20674,11 +21106,20 @@ function CdlNodeView({
|
|
|
20674
21106
|
active,
|
|
20675
21107
|
stateValues,
|
|
20676
21108
|
drawing,
|
|
20677
|
-
progress
|
|
21109
|
+
progress,
|
|
21110
|
+
textMetrics
|
|
20678
21111
|
}
|
|
20679
21112
|
);
|
|
20680
21113
|
case "chart-stat":
|
|
20681
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21114
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21115
|
+
ChartStatNode,
|
|
21116
|
+
{
|
|
21117
|
+
node: resolvedNode,
|
|
21118
|
+
active,
|
|
21119
|
+
stateValues,
|
|
21120
|
+
textMetrics
|
|
21121
|
+
}
|
|
21122
|
+
);
|
|
20682
21123
|
case "chart-radial":
|
|
20683
21124
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20684
21125
|
ChartRadialNode,
|
|
@@ -20687,7 +21128,8 @@ function CdlNodeView({
|
|
|
20687
21128
|
active,
|
|
20688
21129
|
stateValues,
|
|
20689
21130
|
drawing,
|
|
20690
|
-
progress
|
|
21131
|
+
progress,
|
|
21132
|
+
textMetrics
|
|
20691
21133
|
}
|
|
20692
21134
|
);
|
|
20693
21135
|
case "chart-bar":
|
|
@@ -20720,7 +21162,8 @@ function CdlNodeView({
|
|
|
20720
21162
|
active,
|
|
20721
21163
|
stateValues,
|
|
20722
21164
|
drawing,
|
|
20723
|
-
progress
|
|
21165
|
+
progress,
|
|
21166
|
+
textMetrics
|
|
20724
21167
|
}
|
|
20725
21168
|
);
|
|
20726
21169
|
case "funnel-stages":
|
|
@@ -20731,11 +21174,20 @@ function CdlNodeView({
|
|
|
20731
21174
|
active,
|
|
20732
21175
|
stateValues,
|
|
20733
21176
|
drawing,
|
|
20734
|
-
progress
|
|
21177
|
+
progress,
|
|
21178
|
+
textMetrics
|
|
20735
21179
|
}
|
|
20736
21180
|
);
|
|
20737
21181
|
case "quadrant-matrix":
|
|
20738
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21182
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21183
|
+
QuadrantNode,
|
|
21184
|
+
{
|
|
21185
|
+
node: resolvedNode,
|
|
21186
|
+
active,
|
|
21187
|
+
stateValues,
|
|
21188
|
+
textMetrics
|
|
21189
|
+
}
|
|
21190
|
+
);
|
|
20739
21191
|
case "tree-hierarchy":
|
|
20740
21192
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20741
21193
|
TreeNode,
|
|
@@ -20744,7 +21196,8 @@ function CdlNodeView({
|
|
|
20744
21196
|
active,
|
|
20745
21197
|
stateValues,
|
|
20746
21198
|
drawing,
|
|
20747
|
-
progress
|
|
21199
|
+
progress,
|
|
21200
|
+
textMetrics
|
|
20748
21201
|
}
|
|
20749
21202
|
);
|
|
20750
21203
|
case "journey-map":
|
|
@@ -20759,91 +21212,91 @@ function CdlNodeView({
|
|
|
20759
21212
|
}
|
|
20760
21213
|
);
|
|
20761
21214
|
case "shape-file":
|
|
20762
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active });
|
|
21215
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active, textMetrics });
|
|
20763
21216
|
case "shape-folder":
|
|
20764
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeFolderNode, { node: resolvedNode, active });
|
|
21217
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeFolderNode, { node: resolvedNode, active, textMetrics });
|
|
20765
21218
|
case "shape-cloud":
|
|
20766
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCloudNode, { node: resolvedNode, active });
|
|
21219
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCloudNode, { node: resolvedNode, active, textMetrics });
|
|
20767
21220
|
case "shape-cylinder":
|
|
20768
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCylinderNode, { node: resolvedNode, active });
|
|
21221
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCylinderNode, { node: resolvedNode, active, textMetrics });
|
|
20769
21222
|
case "shape-hexagon":
|
|
20770
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeHexagonNode, { node: resolvedNode, active });
|
|
21223
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeHexagonNode, { node: resolvedNode, active, textMetrics });
|
|
20771
21224
|
case "shape-diamond":
|
|
20772
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeDiamondNode, { node: resolvedNode, active });
|
|
21225
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeDiamondNode, { node: resolvedNode, active, textMetrics });
|
|
20773
21226
|
case "shape-stack":
|
|
20774
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeStackNode, { node: resolvedNode, active });
|
|
21227
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeStackNode, { node: resolvedNode, active, textMetrics });
|
|
20775
21228
|
case "shape-person":
|
|
20776
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapePersonNode, { node: resolvedNode, active });
|
|
21229
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapePersonNode, { node: resolvedNode, active, textMetrics });
|
|
20777
21230
|
case "shape-window":
|
|
20778
21231
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeWindowNode, { node: resolvedNode, active });
|
|
20779
21232
|
case "shape-terminal":
|
|
20780
21233
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeTerminalNode, { node: resolvedNode, active, lang });
|
|
20781
21234
|
case "shape-code-block":
|
|
20782
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang });
|
|
21235
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20783
21236
|
case "shape-kanban-card":
|
|
20784
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang });
|
|
21237
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20785
21238
|
case "shape-message-bubble":
|
|
20786
21239
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeMessageBubbleNode, { node: resolvedNode, active });
|
|
20787
21240
|
case "shape-gear":
|
|
20788
21241
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeGearNode, { node: resolvedNode, active });
|
|
20789
21242
|
case "shape-server-rack":
|
|
20790
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeServerRackNode, { node: resolvedNode, active });
|
|
21243
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeServerRackNode, { node: resolvedNode, active, textMetrics });
|
|
20791
21244
|
case "shape-network-node":
|
|
20792
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeNetworkNodeNode, { node: resolvedNode, active });
|
|
21245
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeNetworkNodeNode, { node: resolvedNode, active, textMetrics });
|
|
20793
21246
|
case "shape-mobile-device":
|
|
20794
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeMobileDeviceNode, { node: resolvedNode, active });
|
|
21247
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeMobileDeviceNode, { node: resolvedNode, active, textMetrics });
|
|
20795
21248
|
case "shape-iot-sensor":
|
|
20796
21249
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeIotSensorNode, { node: resolvedNode, active });
|
|
20797
21250
|
case "shape-robot-arm":
|
|
20798
21251
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeRobotArmNode, { node: resolvedNode, active });
|
|
20799
21252
|
case "shape-satellite":
|
|
20800
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeSatelliteNode, { node: resolvedNode, active });
|
|
21253
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeSatelliteNode, { node: resolvedNode, active, textMetrics });
|
|
20801
21254
|
case "shape-smart-contract":
|
|
20802
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang });
|
|
21255
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20803
21256
|
case "shape-blockchain-block":
|
|
20804
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang });
|
|
21257
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20805
21258
|
case "shape-rpc-node":
|
|
20806
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang });
|
|
21259
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20807
21260
|
case "shape-wallet":
|
|
20808
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeWalletNode, { node: resolvedNode, active });
|
|
21261
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeWalletNode, { node: resolvedNode, active, textMetrics });
|
|
20809
21262
|
case "shape-nft":
|
|
20810
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeNftNode, { node: resolvedNode, active });
|
|
21263
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeNftNode, { node: resolvedNode, active, textMetrics });
|
|
20811
21264
|
case "shape-token":
|
|
20812
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeTokenNode, { node: resolvedNode, active });
|
|
21265
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeTokenNode, { node: resolvedNode, active, textMetrics });
|
|
20813
21266
|
case "shape-blockchain":
|
|
20814
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNode, { node: resolvedNode, active });
|
|
21267
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNode, { node: resolvedNode, active, textMetrics });
|
|
20815
21268
|
case "shape-bitcoin-chain":
|
|
20816
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBitcoinChainNode, { node: resolvedNode, active });
|
|
21269
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBitcoinChainNode, { node: resolvedNode, active, textMetrics });
|
|
20817
21270
|
case "shape-ethereum-chain":
|
|
20818
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeEthereumChainNode, { node: resolvedNode, active });
|
|
21271
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeEthereumChainNode, { node: resolvedNode, active, textMetrics });
|
|
20819
21272
|
case "shape-blockchain-node":
|
|
20820
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active });
|
|
21273
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active, textMetrics });
|
|
20821
21274
|
case "shape-bank":
|
|
20822
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBankNode, { node: resolvedNode, active });
|
|
21275
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBankNode, { node: resolvedNode, active, textMetrics });
|
|
20823
21276
|
case "shape-trust-bank":
|
|
20824
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang });
|
|
21277
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20825
21278
|
case "shape-payment-provider":
|
|
20826
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang });
|
|
21279
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20827
21280
|
case "shape-credit-card":
|
|
20828
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCreditCardNode, { node: resolvedNode, active });
|
|
21281
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCreditCardNode, { node: resolvedNode, active, textMetrics });
|
|
20829
21282
|
case "shape-brokerage":
|
|
20830
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang });
|
|
21283
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20831
21284
|
case "shape-exchange":
|
|
20832
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeExchangeNode, { node: resolvedNode, active, lang });
|
|
21285
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeExchangeNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20833
21286
|
case "shape-atm":
|
|
20834
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeAtmNode, { node: resolvedNode, active, lang });
|
|
21287
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeAtmNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20835
21288
|
case "shape-website":
|
|
20836
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeWebsiteNode, { node: resolvedNode, active });
|
|
21289
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeWebsiteNode, { node: resolvedNode, active, textMetrics });
|
|
20837
21290
|
case "shape-storefront":
|
|
20838
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang });
|
|
21291
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20839
21292
|
case "shape-warehouse":
|
|
20840
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang });
|
|
21293
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20841
21294
|
case "shape-online-shop":
|
|
20842
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeOnlineShopNode, { node: resolvedNode, active });
|
|
21295
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeOnlineShopNode, { node: resolvedNode, active, textMetrics });
|
|
20843
21296
|
case "shape-cdn-edge":
|
|
20844
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCdnEdgeNode, { node: resolvedNode, active });
|
|
21297
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeCdnEdgeNode, { node: resolvedNode, active, textMetrics });
|
|
20845
21298
|
case "shape-api-gateway":
|
|
20846
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang });
|
|
21299
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang, textMetrics });
|
|
20847
21300
|
case "shape-auditor":
|
|
20848
21301
|
return /* @__PURE__ */ jsxRuntime.jsx(ShapeAuditorNode, { node: resolvedNode, active });
|
|
20849
21302
|
case "shape-regulator":
|
|
@@ -20863,7 +21316,17 @@ function CdlNodeView({
|
|
|
20863
21316
|
case "station":
|
|
20864
21317
|
return /* @__PURE__ */ jsxRuntime.jsx(StationNode, { node: resolvedNode, active });
|
|
20865
21318
|
default:
|
|
20866
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21319
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21320
|
+
GenericNode,
|
|
21321
|
+
{
|
|
21322
|
+
node: resolvedNode,
|
|
21323
|
+
active,
|
|
21324
|
+
value: node.value,
|
|
21325
|
+
stateValues,
|
|
21326
|
+
\u5024\u306E\u540D\u524D,
|
|
21327
|
+
textMetrics
|
|
21328
|
+
}
|
|
21329
|
+
);
|
|
20867
21330
|
}
|
|
20868
21331
|
})();
|
|
20869
21332
|
const offsetX = node.renderOffsetX !== void 0 ? resolveNumericAttr(node.renderOffsetX, stateValues, 0) : 0;
|
|
@@ -20924,7 +21387,7 @@ function CdlNodeView({
|
|
|
20924
21387
|
}
|
|
20925
21388
|
),
|
|
20926
21389
|
inner,
|
|
20927
|
-
\u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode)
|
|
21390
|
+
\u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode, textMetrics ?? "proportional")
|
|
20928
21391
|
]
|
|
20929
21392
|
}
|
|
20930
21393
|
);
|
|
@@ -20933,17 +21396,17 @@ var FIGURE_TITLE_GAP = 10;
|
|
|
20933
21396
|
var FIGURE_TITLE_SIZE = 15;
|
|
20934
21397
|
var FIGURE_EYEBROW_SIZE = 11;
|
|
20935
21398
|
var FIGURE_EYEBROW_LIFT = 1.1;
|
|
20936
|
-
function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45) {
|
|
20937
|
-
const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0);
|
|
21399
|
+
function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45, textMetrics = "proportional") {
|
|
21400
|
+
const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0, textMetrics);
|
|
20938
21401
|
return \u5B9F\u5E45 > \u5E45 ? \u7D20\u306E\u5927\u304D\u3055 * \u5E45 / \u5B9F\u5E45 : \u7D20\u306E\u5927\u304D\u3055;
|
|
20939
21402
|
}
|
|
20940
|
-
function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
|
|
21403
|
+
function \u7BB1\u306E\u4E0A\u306E\u8A9E(node, textMetrics = "proportional") {
|
|
20941
21404
|
if (!drawsFigureTitle(node.kind)) return null;
|
|
20942
21405
|
const \u540D\u524D = (node.title ?? "").trim();
|
|
20943
21406
|
const \u5C0F\u898B\u51FA\u3057 = (node.eyebrow ?? "").trim();
|
|
20944
21407
|
if (\u540D\u524D === "" && \u5C0F\u898B\u51FA\u3057 === "") return null;
|
|
20945
21408
|
const \u984C\u306Ey = node.cy - node.h / 2 - FIGURE_TITLE_GAP;
|
|
20946
|
-
const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w);
|
|
21409
|
+
const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w, textMetrics);
|
|
20947
21410
|
const \u5C0F\u898B\u51FA\u3057\u306Ey = \u540D\u524D === "" ? \u984C\u306Ey : \u984C\u306Ey - \u984C\u306E\u5927\u304D\u3055 * FIGURE_EYEBROW_LIFT;
|
|
20948
21411
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20949
21412
|
\u5C0F\u898B\u51FA\u3057 !== "" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20953,7 +21416,7 @@ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
|
|
|
20953
21416
|
x: node.cx,
|
|
20954
21417
|
y: \u5C0F\u898B\u51FA\u3057\u306Ey,
|
|
20955
21418
|
textAnchor: "middle",
|
|
20956
|
-
fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w),
|
|
21419
|
+
fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w, textMetrics),
|
|
20957
21420
|
fontWeight: 600,
|
|
20958
21421
|
letterSpacing: 0.6,
|
|
20959
21422
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
@@ -21278,6 +21741,7 @@ function CdlStage({
|
|
|
21278
21741
|
node,
|
|
21279
21742
|
active: activeSet.has(node.id),
|
|
21280
21743
|
lang: laid.lang,
|
|
21744
|
+
textMetrics: laid.textMetrics,
|
|
21281
21745
|
\u95A2\u4FC2\u306E\u53D7\u3051\u53E3: \u7BB1\u306E\u53D7\u3051\u53E3,
|
|
21282
21746
|
drawing: \u63CF\u304F,
|
|
21283
21747
|
progress: \u63CF\u304F ? \u63CF\u304F\u9032\u307F : progress,
|
|
@@ -21294,7 +21758,8 @@ function CdlStage({
|
|
|
21294
21758
|
CdlEdgeLabelView,
|
|
21295
21759
|
{
|
|
21296
21760
|
edge,
|
|
21297
|
-
active: activeSet.has(edge.id)
|
|
21761
|
+
active: activeSet.has(edge.id),
|
|
21762
|
+
textMetrics: laid.textMetrics
|
|
21298
21763
|
},
|
|
21299
21764
|
`label-${edge.id}`
|
|
21300
21765
|
)),
|
|
@@ -21304,7 +21769,8 @@ function CdlStage({
|
|
|
21304
21769
|
{
|
|
21305
21770
|
edge,
|
|
21306
21771
|
active: activeSet.has(edge.id),
|
|
21307
|
-
\u7AEF
|
|
21772
|
+
\u7AEF,
|
|
21773
|
+
textMetrics: laid.textMetrics
|
|
21308
21774
|
},
|
|
21309
21775
|
`${\u7AEF}-label-${edge.id}`
|
|
21310
21776
|
))
|
|
@@ -22369,7 +22835,15 @@ function useInteractiveIntegration(diagram, options = {}) {
|
|
|
22369
22835
|
f.id
|
|
22370
22836
|
)) }),
|
|
22371
22837
|
scrolls.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cdl-ip-group", children: scrolls.map((s) => /* @__PURE__ */ jsxRuntime.jsx(ScrollReadout, { id: s.id, name: s.label || s.id, progress: stateOverrides[s.id] }, s.id)) }),
|
|
22372
|
-
readouts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
22838
|
+
readouts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
22839
|
+
ReadoutWidget,
|
|
22840
|
+
{
|
|
22841
|
+
readout: r,
|
|
22842
|
+
stateOverrides: mergedStateValues,
|
|
22843
|
+
textMetrics: resolveTextMetrics(diagram.textMetrics)
|
|
22844
|
+
},
|
|
22845
|
+
r.id
|
|
22846
|
+
)) })
|
|
22373
22847
|
] }) })
|
|
22374
22848
|
);
|
|
22375
22849
|
}, [diagram, signals, stateOverrides, mergedStateValues]);
|
|
@@ -22790,7 +23264,8 @@ function StepperWidget({
|
|
|
22790
23264
|
}
|
|
22791
23265
|
function ReadoutWidget({
|
|
22792
23266
|
readout,
|
|
22793
|
-
stateOverrides
|
|
23267
|
+
stateOverrides,
|
|
23268
|
+
textMetrics = "proportional"
|
|
22794
23269
|
}) {
|
|
22795
23270
|
const rawValue = "source" in readout ? stateOverrides[readout.source] : void 0;
|
|
22796
23271
|
const numericValue = typeof rawValue === "number" ? rawValue : typeof rawValue === "string" ? Number(rawValue) : Number.NaN;
|
|
@@ -23038,7 +23513,8 @@ function ReadoutWidget({
|
|
|
23038
23513
|
max: readout.max,
|
|
23039
23514
|
viewW: readout.viewW ?? 280,
|
|
23040
23515
|
viewH: readout.viewH ?? 60,
|
|
23041
|
-
color: readout.color ?? "#2563eb"
|
|
23516
|
+
color: readout.color ?? "#2563eb",
|
|
23517
|
+
textMetrics
|
|
23042
23518
|
}
|
|
23043
23519
|
);
|
|
23044
23520
|
case "radar": {
|
|
@@ -23854,7 +24330,8 @@ function ReadoutWidget({
|
|
|
23854
24330
|
{ status: "idle", color: "#94a3b8" },
|
|
23855
24331
|
{ status: "error", color: "#ef4444" }
|
|
23856
24332
|
],
|
|
23857
|
-
max: readout.max ?? 10
|
|
24333
|
+
max: readout.max ?? 10,
|
|
24334
|
+
textMetrics
|
|
23858
24335
|
}
|
|
23859
24336
|
);
|
|
23860
24337
|
case "calendar-week":
|
|
@@ -24998,8 +25475,8 @@ function ProgressGroupReadout({
|
|
|
24998
25475
|
}) })
|
|
24999
25476
|
] });
|
|
25000
25477
|
}
|
|
25001
|
-
function sequenceLabelAnchor(x, name, fontSize, viewW) {
|
|
25002
|
-
const half = textWidth(name, fontSize) / 2;
|
|
25478
|
+
function sequenceLabelAnchor(x, name, fontSize, viewW, textMetrics = "proportional") {
|
|
25479
|
+
const half = textWidth(name, fontSize, 0, textMetrics) / 2;
|
|
25003
25480
|
if (x - half < 0) return "start";
|
|
25004
25481
|
if (x + half > viewW) return "end";
|
|
25005
25482
|
return "middle";
|
|
@@ -25012,7 +25489,8 @@ function SequenceTimelineReadout({
|
|
|
25012
25489
|
max,
|
|
25013
25490
|
viewW,
|
|
25014
25491
|
viewH,
|
|
25015
|
-
color
|
|
25492
|
+
color,
|
|
25493
|
+
textMetrics = "proportional"
|
|
25016
25494
|
}) {
|
|
25017
25495
|
const events = [];
|
|
25018
25496
|
const trimmed = value.trim();
|
|
@@ -25055,7 +25533,17 @@ function SequenceTimelineReadout({
|
|
|
25055
25533
|
const x = xFor(e.t);
|
|
25056
25534
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-event-marker": e.name, children: [
|
|
25057
25535
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x, cy: trackY, r: 5, fill: color, stroke: "#fff", strokeWidth: 1.5, children: /* @__PURE__ */ jsxRuntime.jsx(\u5B57\u306E\u898B\u51FA\u3057, { k: "readout.sequenceTimeline.title", v: { name: e.name, t: e.t } }) }),
|
|
25058
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25536
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25537
|
+
"text",
|
|
25538
|
+
{
|
|
25539
|
+
x,
|
|
25540
|
+
y: trackY - 12,
|
|
25541
|
+
textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW, textMetrics),
|
|
25542
|
+
fontSize: 10,
|
|
25543
|
+
fill: "var(--v4-ink, #1a1f2a)",
|
|
25544
|
+
children: e.name
|
|
25545
|
+
}
|
|
25546
|
+
),
|
|
25059
25547
|
/* @__PURE__ */ jsxRuntime.jsx("text", { x, y: trackY + 18, textAnchor: "middle", fontSize: 9, fill: "var(--v4-mute, #64748b)", children: e.t })
|
|
25060
25548
|
] }, i);
|
|
25061
25549
|
})
|
|
@@ -28132,7 +28620,8 @@ function StatusTimelineReadout({
|
|
|
28132
28620
|
label,
|
|
28133
28621
|
value,
|
|
28134
28622
|
colorMap,
|
|
28135
|
-
max
|
|
28623
|
+
max,
|
|
28624
|
+
textMetrics = "proportional"
|
|
28136
28625
|
}) {
|
|
28137
28626
|
const events = [];
|
|
28138
28627
|
const trimmed = value.trim();
|
|
@@ -28157,6 +28646,7 @@ function StatusTimelineReadout({
|
|
|
28157
28646
|
const cellW = shown.length > 0 ? (width - 20) / shown.length : 0;
|
|
28158
28647
|
const height = stripHeight + 40;
|
|
28159
28648
|
const \u533A\u9593\u306E\u5B57 = (status) => status === "active" || status === "idle" || status === "error" ? \u5F15\u304F(`readout.statusTimeline.${status}`) : status.toUpperCase();
|
|
28649
|
+
const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
|
|
28160
28650
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cdl-ip-item cdl-ip-readout-status-timeline", "data-cdl-readout": id, children: [
|
|
28161
28651
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "cdl-ip-label", children: label }),
|
|
28162
28652
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -28170,7 +28660,7 @@ function StatusTimelineReadout({
|
|
|
28170
28660
|
const x = 10 + i * cellW;
|
|
28171
28661
|
const c = colorLookup.get(ev.status) ?? "#cbd5e1";
|
|
28172
28662
|
const \u5B572 = \u533A\u9593\u306E\u5B57(ev.status);
|
|
28173
|
-
const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8);
|
|
28663
|
+
const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8, \u6E2C\u308B);
|
|
28174
28664
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-status-event": i, "data-cdl-status": ev.status, children: [
|
|
28175
28665
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x, y: 10, width: cellW - 2, height: stripHeight, fill: c, rx: 2 }),
|
|
28176
28666
|
/* @__PURE__ */ jsxRuntime.jsxs(
|