@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.
Files changed (64) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.md +70 -1
  3. package/dist/index.cjs +1125 -618
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +38 -26
  6. package/dist/index.d.ts +38 -26
  7. package/dist/index.js +1125 -619
  8. package/dist/index.js.map +1 -1
  9. package/dist/react.cjs +894 -404
  10. package/dist/react.cjs.map +1 -1
  11. package/dist/react.d.cts +1 -1
  12. package/dist/react.d.ts +1 -1
  13. package/dist/react.js +894 -404
  14. package/dist/react.js.map +1 -1
  15. package/dist/{render-U_pC-Ksh.d.cts → render-U6omSNH2.d.cts} +23 -4
  16. package/dist/{render-U_pC-Ksh.d.ts → render-U6omSNH2.d.ts} +23 -4
  17. package/package.json +9 -12
  18. package/src/builder.ts +5 -0
  19. package/src/index.ts +2 -0
  20. package/src/kinds/box-lines.ts +17 -4
  21. package/src/kinds/chart-bar.tsx +4 -0
  22. package/src/kinds/chart-gauge.tsx +20 -9
  23. package/src/kinds/chart-pie.tsx +67 -17
  24. package/src/kinds/chart-radial.tsx +7 -2
  25. package/src/kinds/chart-slope.tsx +26 -7
  26. package/src/kinds/chart-stacked-bar.tsx +8 -4
  27. package/src/kinds/chart-stat.tsx +19 -4
  28. package/src/kinds/chart-waffle.tsx +7 -2
  29. package/src/kinds/funnel.tsx +9 -2
  30. package/src/kinds/generic.tsx +5 -2
  31. package/src/kinds/mind-map.tsx +26 -10
  32. package/src/kinds/quadrant.tsx +14 -4
  33. package/src/kinds/row-align.ts +19 -7
  34. package/src/kinds/sequence-board-metrics.ts +13 -3
  35. package/src/kinds/sequence-board.tsx +4 -2
  36. package/src/kinds/shape-basement.tsx +57 -32
  37. package/src/kinds/shape-blockchain.tsx +83 -34
  38. package/src/kinds/shape-commerce.tsx +65 -24
  39. package/src/kinds/shape-finance.tsx +90 -26
  40. package/src/kinds/shape-hardware.tsx +48 -17
  41. package/src/kinds/shape-region.tsx +16 -6
  42. package/src/kinds/shape-software.tsx +30 -8
  43. package/src/kinds/text-width.ts +17 -3
  44. package/src/kinds/tree.tsx +25 -7
  45. package/src/layout/collisions.ts +21 -8
  46. package/src/layout/curve-path.ts +3 -2
  47. package/src/layout/edges.ts +173 -29
  48. package/src/layout/head-label.ts +3 -1
  49. package/src/layout/lanes.ts +3 -2
  50. package/src/layout/metro-path.ts +3 -2
  51. package/src/layout/nodes.ts +14 -6
  52. package/src/layout/predict-bbox.ts +6 -3
  53. package/src/layout/self-loop.ts +10 -4
  54. package/src/layout/spec.ts +20 -6
  55. package/src/layout/text-width.ts +25 -8
  56. package/src/layout.ts +39 -15
  57. package/src/presets.ts +69 -43
  58. package/src/render/edges.tsx +18 -3
  59. package/src/render/interactive-panel.tsx +34 -7
  60. package/src/render/nodes.tsx +97 -48
  61. package/src/render/stage.tsx +3 -0
  62. package/src/text-metrics.ts +9 -0
  63. package/src/types.ts +22 -2
  64. package/src/visual-validate.ts +67 -17
package/dist/react.js CHANGED
@@ -715,6 +715,11 @@ function \u5B57\u3092\u5DEE\u3057\u8FBC\u3080(template, values) {
715
715
  return template.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole);
716
716
  }
717
717
 
718
+ // src/text-metrics.ts
719
+ function resolveTextMetrics(value) {
720
+ return value === "monospace" ? "monospace" : "proportional";
721
+ }
722
+
718
723
  // src/layout/clearance-constants.ts
719
724
  var CLEARANCE_NODE_LABEL = 32;
720
725
  var CLEARANCE_LANE_LABEL = 24;
@@ -876,10 +881,10 @@ function defaultAdvanceEm(ch, code) {
876
881
  if (ch >= "0" && ch <= "9") return 0.72;
877
882
  return 0.65;
878
883
  }
879
- function measureTextWidth(text, opts = {}) {
884
+ function measureAdvanceWidth(text, opts = {}) {
880
885
  const fontSize = opts.fontSize ?? 22;
881
886
  const letterSpacing = opts.letterSpacing ?? 0;
882
- const fontFamily = opts.fontFamily ?? "sans";
887
+ const fontFamily = opts.textMetrics === "monospace" ? "mono" : opts.fontFamily ?? "sans";
883
888
  const bound = opts.bound ?? "layout";
884
889
  let advanceEmSum = 0;
885
890
  let charCount = 0;
@@ -887,7 +892,7 @@ function measureTextWidth(text, opts = {}) {
887
892
  for (const ch of \u6587\u5B57\u5217) {
888
893
  charCount++;
889
894
  const code = ch.codePointAt(0) ?? 0;
890
- const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
895
+ const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) && fontFamily !== "mono" ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
891
896
  if (isEmojiGrapheme(ch, code)) {
892
897
  advanceEmSum += fontFamily === "mono" ? MONO_EMOJI_ADVANCE_EM : EMOJI_ADVANCE_EM;
893
898
  continue;
@@ -903,7 +908,12 @@ function measureTextWidth(text, opts = {}) {
903
908
  const table = ch.length === 1 ? INTER_BOLD_ADVANCE_EM[ch] : void 0;
904
909
  advanceEmSum += (table !== void 0 ? table : defaultAdvanceEm(ch, code)) / \u5272\u308A\u623B\u3057;
905
910
  }
906
- const w = advanceEmSum * fontSize + letterSpacing * charCount;
911
+ return advanceEmSum * fontSize + letterSpacing * charCount;
912
+ }
913
+ function measureTextWidth(text, opts = {}) {
914
+ const fontSize = opts.fontSize ?? 22;
915
+ const bound = opts.bound ?? "layout";
916
+ const w = measureAdvanceWidth(text, opts);
907
917
  return bound === "drawn" ? w : Math.max(w, fontSize * 1.2);
908
918
  }
909
919
  function \u53CE\u3081\u308B\u500D\u7387(text, opts, \u5E45) {
@@ -1271,15 +1281,22 @@ function requiredVerticalLabelGap(pillHs) {
1271
1281
  const step = parallelLabelStepY(pillHs);
1272
1282
  return (pillHs.length - 1) * step + Math.max(first, last) + CLEARANCE_NODE_LABEL * 2;
1273
1283
  }
1274
- function computeLabelBoxW(label, sub) {
1275
- const mainW = measureTextWidth(label ?? "", { fontSize: EDGE_LABEL_TEXT.main.fontSize });
1276
- const subW = sub ? measureTextWidth(sub, { fontSize: EDGE_LABEL_TEXT.sub.fontSize, fontFamily: "mono" }) : 0;
1284
+ function computeLabelBoxW(label, sub, textMetrics = "proportional") {
1285
+ const mainW = measureTextWidth(label ?? "", {
1286
+ fontSize: EDGE_LABEL_TEXT.main.fontSize,
1287
+ textMetrics
1288
+ });
1289
+ const subW = sub ? measureTextWidth(sub, {
1290
+ fontSize: EDGE_LABEL_TEXT.sub.fontSize,
1291
+ fontFamily: "mono",
1292
+ textMetrics
1293
+ }) : 0;
1277
1294
  const raw = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
1278
1295
  const EPSILON = 1e-6;
1279
1296
  return Math.ceil((raw - EPSILON) / 2) * 2;
1280
1297
  }
1281
- function computeLabelBBoxWorld(edge) {
1282
- const boxW = computeLabelBoxW(edge.label, edge.sub);
1298
+ function computeLabelBBoxWorld(edge, textMetrics = "proportional") {
1299
+ const boxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
1283
1300
  const boxH = edge.sub ? LABEL_PILL_H_WITH_SUB : LABEL_PILL_H_MAIN_ONLY;
1284
1301
  const anchor = edge.labelAnchor;
1285
1302
  const boxLeftX = anchor === "start" ? 0 : anchor === "end" ? -boxW : -boxW / 2;
@@ -1503,7 +1520,7 @@ function footerShapeDrawTop(node) {
1503
1520
  // src/layout/collisions.ts
1504
1521
  var LANE_LABEL_CLEARANCE_MARGIN = 2;
1505
1522
  var NEAR_MISS_MARGIN = LANE_LABEL_CLEARANCE_MARGIN;
1506
- function collectBBoxes(lanes, nodes, edges) {
1523
+ function collectBBoxes(lanes, nodes, edges, textMetrics = "proportional") {
1507
1524
  const out = [];
1508
1525
  for (const lane of lanes) {
1509
1526
  if (!lane.label) continue;
@@ -1512,7 +1529,7 @@ function collectBBoxes(lanes, nodes, edges) {
1512
1529
  id: lane.id,
1513
1530
  x: lane.x + 16,
1514
1531
  y: lane.y + 8,
1515
- w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2 }) + 24,
1532
+ w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2, textMetrics }) + 24,
1516
1533
  h: 28
1517
1534
  });
1518
1535
  }
@@ -1530,7 +1547,7 @@ function collectBBoxes(lanes, nodes, edges) {
1530
1547
  }
1531
1548
  for (const e of edges) {
1532
1549
  if (!hasRenderedLabel(e)) continue;
1533
- const bbox = computeLabelBBoxWorld(e);
1550
+ const bbox = computeLabelBBoxWorld(e, textMetrics);
1534
1551
  out.push({
1535
1552
  kind: "edge-label",
1536
1553
  id: e.id,
@@ -2174,7 +2191,7 @@ function clampShiftMagnitude(shift, maxMagnitude) {
2174
2191
  };
2175
2192
  return { dx: clampAxis(shift.dx), dy: clampAxis(shift.dy) };
2176
2193
  }
2177
- function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE) {
2194
+ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE, textMetrics = "proportional") {
2178
2195
  if (edges.length === 0) {
2179
2196
  return {
2180
2197
  edges,
@@ -2185,7 +2202,7 @@ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClea
2185
2202
  }
2186
2203
  const MAX_ACCUMULATED_SHIFT = CHAIN_SHIFT_MAX_ACCUMULATED;
2187
2204
  const labelBBox = (e, offsetX, offsetY) => {
2188
- const base = computeLabelBBoxWorld(e);
2205
+ const base = computeLabelBBoxWorld(e, textMetrics);
2189
2206
  return {
2190
2207
  kind: "edge-label",
2191
2208
  id: e.id,
@@ -2786,11 +2803,15 @@ var \u5411\u304D\u306E\u9806 = [
2786
2803
  { axis: "x", sign: -1, \u540D\u524D: "\u5DE6" },
2787
2804
  { axis: "x", sign: 1, \u540D\u524D: "\u53F3" }
2788
2805
  ];
2789
- function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles) {
2806
+ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles, textMetrics = "proportional") {
2790
2807
  const edgeById = new Map(edges.map((e) => [e.id, e]));
2791
2808
  const \u81EA\u5206 = edgeById.get(labelId);
2792
2809
  if (!\u81EA\u5206) return null;
2793
- const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({ kind: "edge-label", id: e.id, ...computeLabelBBoxWorld(e) }));
2810
+ const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({
2811
+ kind: "edge-label",
2812
+ id: e.id,
2813
+ ...computeLabelBBoxWorld(e, textMetrics)
2814
+ }));
2794
2815
  const label = labels.find((l) => l.id === labelId);
2795
2816
  if (!label) return null;
2796
2817
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
@@ -2832,7 +2853,7 @@ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B,
2832
2853
  }
2833
2854
  return `\u9003\u3052\u5834\u306A\u3057: ${\u7406\u7531.sort((a, b) => a.\u9806 - b.\u9806).map((r) => r.\u6587).join(" / ")}`;
2834
2855
  }
2835
- function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
2856
+ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8, textMetrics = "proportional") {
2836
2857
  if (edges.length === 0) return edges;
2837
2858
  const labeledIds = new Set(
2838
2859
  edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => e.id)
@@ -2850,7 +2871,7 @@ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
2850
2871
  const out = [];
2851
2872
  for (const e of edges) {
2852
2873
  if (!labeledIds.has(e.id)) continue;
2853
- const base = computeLabelBBoxWorld(e);
2874
+ const base = computeLabelBBoxWorld(e, textMetrics);
2854
2875
  const s = getShift(e.id);
2855
2876
  out.push({ kind: "edge-label", id: e.id, x: base.x + s.dx, y: base.y + s.dy, w: base.w, h: base.h });
2856
2877
  }
@@ -2983,7 +3004,7 @@ function applyEdgeLabelAndPathShifts(edges, labelShiftMap, edgePathShiftMap) {
2983
3004
 
2984
3005
  // src/layout/curve-path.ts
2985
3006
  var SAME_HEIGHT_THRESHOLD = 1;
2986
- function curvePath(from, to, edge, labelMarginExtra = 0) {
3007
+ function curvePath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
2987
3008
  const fromLeft = from.cx - from.w / 2;
2988
3009
  const fromRight = from.cx + from.w / 2;
2989
3010
  const toLeft = to.cx - to.w / 2;
@@ -3051,7 +3072,7 @@ function curvePath(from, to, edge, labelMarginExtra = 0) {
3051
3072
  normalX *= -1;
3052
3073
  normalY *= -1;
3053
3074
  }
3054
- const labelW = computeLabelBoxW(edge?.label, edge?.sub);
3075
+ const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
3055
3076
  const labelH = labelPillH(edge?.sub);
3056
3077
  const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
3057
3078
  return {
@@ -3083,7 +3104,7 @@ function polyline(points) {
3083
3104
  });
3084
3105
  return distinct.map((p, i) => `${i === 0 ? "M" : "L"} ${point(p)}`).join(" ");
3085
3106
  }
3086
- function metroPath(from, to, edge, labelMarginExtra = 0) {
3107
+ function metroPath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
3087
3108
  const fromLeft = from.cx - from.w / 2;
3088
3109
  const fromRight = from.cx + from.w / 2;
3089
3110
  const toLeft = to.cx - to.w / 2;
@@ -3194,7 +3215,7 @@ function metroPath(from, to, edge, labelMarginExtra = 0) {
3194
3215
  normalX *= -1;
3195
3216
  normalY *= -1;
3196
3217
  }
3197
- const labelW = computeLabelBoxW(edge?.label, edge?.sub);
3218
+ const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
3198
3219
  const labelH = labelPillH(edge?.sub);
3199
3220
  const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
3200
3221
  return {
@@ -3363,7 +3384,14 @@ var NARROW_RATIO = 0.37;
3363
3384
  var ASCII_RATIO = 0.86;
3364
3385
  var WIDE_CHARS = "W@%Mm";
3365
3386
  var NARROW_CHARS = "ijlI.,:;'! ";
3366
- function textWidth(s, size, \u5B57\u9001\u308A = 0) {
3387
+ function textWidth(s, size, \u5B57\u9001\u308A = 0, textMetrics = "proportional") {
3388
+ if (textMetrics === "monospace") {
3389
+ return measureAdvanceWidth(s, {
3390
+ fontSize: size,
3391
+ letterSpacing: \u5B57\u9001\u308A,
3392
+ fontFamily: "mono"
3393
+ });
3394
+ }
3367
3395
  let \u5E45 = 0;
3368
3396
  let \u5B57\u6570 = 0;
3369
3397
  for (const c of s) {
@@ -3400,8 +3428,8 @@ function splitRow(row) {
3400
3428
  }
3401
3429
  return { left: row.trim(), right: "", split: false };
3402
3430
  }
3403
- function rowColumnWidth(text, size, mono) {
3404
- return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size);
3431
+ function rowColumnWidth(text, size, mono, textMetrics = "proportional") {
3432
+ return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size, 0, textMetrics);
3405
3433
  }
3406
3434
  function displayWidth(text) {
3407
3435
  let w = 0;
@@ -3427,12 +3455,12 @@ function \u6841\u3067\u7701\u304F(text, \u4E0A\u9650) {
3427
3455
  if (displayWidth(text) <= \u4E0A\u9650) return text;
3428
3456
  return `${\u6841\u3067\u5272\u308B(text, \u4E0A\u9650 - 1)[0]}\u2026`;
3429
3457
  }
3430
- function requiredRowsWidth(rows, kind) {
3458
+ function requiredRowsWidth(rows, kind, textMetrics = "proportional") {
3431
3459
  if (!rows || rows.length === 0) return 0;
3432
3460
  const splits = rows.map(splitRow);
3433
3461
  const \u4E00\u756A\u5E83\u3044 = (\u53D6\u308B) => splits.reduce((m, s) => Math.max(m, \u53D6\u308B(s)), 0);
3434
- 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;
3435
- 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;
3462
+ 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;
3463
+ 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;
3436
3464
  if (kind === void 0) return Math.ceil(Math.max(storage, generic));
3437
3465
  return Math.ceil(kind === "storage" ? storage : generic);
3438
3466
  }
@@ -3497,7 +3525,10 @@ var \u5DE6\u53F3\u306E\u4F59\u767D = 8;
3497
3525
  function \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45) {
3498
3526
  return \u7BB1\u306E\u5E45 - \u5DE6\u53F3\u306E\u4F59\u767D * 2;
3499
3527
  }
3500
- function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
3528
+ function \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics = "proportional") {
3529
+ return (text, fontSize) => textWidth(text, fontSize, 0, textMetrics);
3530
+ }
3531
+ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
3501
3532
  if (\u4F7F\u3048\u308B\u5E452 <= 0) return "";
3502
3533
  if (\u6E2C\u308B(text, fontSize) <= \u4F7F\u3048\u308B\u5E452) return text;
3503
3534
  const \u7701\u7565 = "\u2026";
@@ -3514,7 +3545,7 @@ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6
3514
3545
  return `${\u51FA}${\u7701\u7565}`;
3515
3546
  }
3516
3547
  var \u7E2E\u3081\u306E\u4E0B\u9650 = MIN_TEXT_SIZE;
3517
- function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
3548
+ function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
3518
3549
  let size = fontSize;
3519
3550
  while (size > \u7E2E\u3081\u306E\u4E0B\u9650 && \u6E2C\u308B(text, size) > \u4F7F\u3048\u308B\u5E452) size -= 1;
3520
3551
  return { text: \u5E45\u3067\u5207\u308B(text, size, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B), fontSize: size };
@@ -3524,7 +3555,7 @@ function \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text) {
3524
3555
  if (typeof \u533A\u5207\u308A !== "function") return [...text];
3525
3556
  return [...new \u533A\u5207\u308A(void 0, { granularity: "grapheme" }).segment(text)].map((g) => g.segment);
3526
3557
  }
3527
- function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553) {
3558
+ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553, \u6E2C\u308B) {
3528
3559
  const \u5019\u88DC = \u884C.filter((r, i) => i === 0 || r.text.trim() !== "");
3529
3560
  if (\u5019\u88DC.length === 0) return [];
3530
3561
  const \u4F7F\u3048\u308B\u9AD8\u3055 = \u7BB1\u306E\u9AD8\u30553 - \u4E0A\u4E0B\u306E\u4F59\u767D * 2;
@@ -3532,7 +3563,7 @@ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8
3532
3563
  const \u6B8B\u3059 = [...\u5019\u88DC];
3533
3564
  while (\u6B8B\u3059.length > 1 && \u9AD8\u3055(\u6B8B\u3059) > \u4F7F\u3048\u308B\u9AD8\u3055) \u6B8B\u3059.pop();
3534
3565
  const \u5E45 = \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45);
3535
- const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45) }));
3566
+ const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45, \u6E2C\u308B) }));
3536
3567
  const \u7DCF\u9AD8 = \u9AD8\u3055(\u53CE\u3081\u305F);
3537
3568
  let \u7A4D\u307F = -\u7DCF\u9AD8 / 2;
3538
3569
  return \u53CE\u3081\u305F.map((r) => {
@@ -3545,9 +3576,9 @@ function \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(\u66F8\u3044\u305F, \u63A7\u
3545
3576
  const v = (\u66F8\u3044\u305F ?? "").trim();
3546
3577
  return v === "" ? \u63A7\u3048 : v;
3547
3578
  }
3548
- function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45) {
3579
+ function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45, textMetrics = "proportional") {
3549
3580
  if (!(\u5E45 > 0) || !(size > 0)) return 1;
3550
- const \u5B9F\u5E45 = textWidth(text, size, letterSpacing);
3581
+ const \u5B9F\u5E45 = textWidth(text, size, letterSpacing, textMetrics);
3551
3582
  return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
3552
3583
  }
3553
3584
  function \u8AAD\u3081\u308B\u4E0B\u9650\u306E\u500D\u7387(\u5927\u304D\u3055) {
@@ -3762,13 +3793,13 @@ function fitArt(region, extent, art) {
3762
3793
  );
3763
3794
  }
3764
3795
  var \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
3765
- function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0) {
3796
+ function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0, textMetrics = "proportional") {
3766
3797
  return Math.max(
3767
3798
  displayWidth(text) * size * MONO_ADVANCE_RATIO,
3768
- textWidth(text, size, letterSpacing)
3799
+ textWidth(text, size, letterSpacing, textMetrics)
3769
3800
  );
3770
3801
  }
3771
- function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089) {
3802
+ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089, textMetrics = "proportional") {
3772
3803
  const \u623B\u3057 = Number.isFinite(\u500D\u7387) && \u500D\u7387 > 0 ? 1 / \u500D\u7387 : 1;
3773
3804
  let \u4E0A\u9650 = Number.POSITIVE_INFINITY;
3774
3805
  for (const \u5B572 of \u5B57\u3089) {
@@ -3777,7 +3808,7 @@ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089)
3777
3808
  if (Number.isFinite(\u9AD8\u3055) && \u9AD8\u3055 > 0) {
3778
3809
  \u4E0A\u9650 = Math.min(\u4E0A\u9650, \u9AD8\u3055 * \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u5B572.size);
3779
3810
  }
3780
- const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0);
3811
+ const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0, textMetrics);
3781
3812
  if (Number.isFinite(\u5E45) && \u5E45 > 0 && \u5B9F\u5E45 > 0) {
3782
3813
  \u4E0A\u9650 = Math.min(\u4E0A\u9650, \u5E45 / \u5B9F\u5E45);
3783
3814
  }
@@ -4972,9 +5003,14 @@ var PAD_LEFT = 24;
4972
5003
  var \u7BB1\u306E\u6700\u5927\u5E45 = 140;
4973
5004
  var \u7BB1\u306E\u6700\u5927\u9AD8\u3055 = 38;
4974
5005
  var \u6728\u306E\u679D\u306E\u592A\u3055 = (\u6BB5) => Math.max(1.1, 2.6 - \u6BB5 * 0.45);
4975
- function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}) {
5006
+ function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
4976
5007
  const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
4977
- return computeTreeLayout(treeNodes, node.w - PAD_LEFT - PAD_RIGHT, node.h - PAD_TOP - PAD_BOTTOM);
5008
+ return computeTreeLayout(
5009
+ treeNodes,
5010
+ node.w - PAD_LEFT - PAD_RIGHT,
5011
+ node.h - PAD_TOP - PAD_BOTTOM,
5012
+ textMetrics
5013
+ );
4978
5014
  }
4979
5015
  function \u6728\u306E\u884C(n) {
4980
5016
  return [
@@ -4987,12 +5023,14 @@ function TreeNode({
4987
5023
  active,
4988
5024
  stateValues = {},
4989
5025
  drawing = false,
4990
- progress = 1
5026
+ progress = 1,
5027
+ textMetrics = "proportional"
4991
5028
  }) {
4992
5029
  const x0 = node.cx - node.w / 2;
4993
5030
  const y0 = node.cy - node.h / 2;
4994
5031
  const gradientId = `tree-root-grad-${node.id}`;
4995
- const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues);
5032
+ const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
5033
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
4996
5034
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
4997
5035
  const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
4998
5036
  const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
@@ -5046,10 +5084,10 @@ function TreeNode({
5046
5084
  const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
5047
5085
  const isRoot = n.depth === 0;
5048
5086
  const \u6750\u6599 = \u6728\u306E\u884C(n);
5049
- const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h);
5087
+ const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h, \u6E2C\u308B);
5050
5088
  const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
5051
5089
  const \u540D\u524D = \u6750\u6599[0];
5052
- 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));
5090
+ 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);
5053
5091
  return /* @__PURE__ */ jsx(
5054
5092
  "g",
5055
5093
  {
@@ -5131,7 +5169,7 @@ function TreeNode({
5131
5169
  })
5132
5170
  ] });
5133
5171
  }
5134
- function computeTreeLayout(treeNodes, canvasW, canvasH) {
5172
+ function computeTreeLayout(treeNodes, canvasW, canvasH, textMetrics = "proportional") {
5135
5173
  const ids = new Set(treeNodes.map((n) => n.id));
5136
5174
  const childrenOf = /* @__PURE__ */ new Map();
5137
5175
  for (const n of treeNodes) {
@@ -5179,7 +5217,7 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
5179
5217
  const \u7BB1\u306E\u5E45 = (n, depth) => {
5180
5218
  const \u6750\u6599 = \u6728\u306E\u884C({ ...n, depth });
5181
5219
  const \u540D\u524D = \u6750\u6599[0];
5182
- const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize}) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
5220
+ const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize, textMetrics }) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
5183
5221
  return Math.min(Math.max(\u8981\u308B, nodeW), slotW * 0.92);
5184
5222
  };
5185
5223
  const \u8449\u306E\u4E26\u3073 = [];
@@ -5283,7 +5321,7 @@ var BRANCH_BOX_H_MAX = 48;
5283
5321
  var SUB_BOX_H_MAX = 40;
5284
5322
  var \u7E26\u306E\u9593\u9694\u306E\u4E0A\u9650 = (\u679D\u306E\u6A2A\u306E\u4F38\u3073) => \u679D\u306E\u6A2A\u306E\u4F38\u3073;
5285
5323
  var MIND_PAD = 40;
5286
- function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
5324
+ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
5287
5325
  const mindData = node.mindData ? resolveMindData(node.mindData, stateValues) : void 0;
5288
5326
  if (!mindData) return void 0;
5289
5327
  return computeMindMapLayout(
@@ -5291,7 +5329,8 @@ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
5291
5329
  node.w / 2,
5292
5330
  node.h / 2,
5293
5331
  node.w - MIND_PAD * 2,
5294
- node.h - MIND_PAD * 2
5332
+ node.h - MIND_PAD * 2,
5333
+ textMetrics
5295
5334
  );
5296
5335
  }
5297
5336
  function \u653E\u5C04\u306E\u884C(n) {
@@ -5305,12 +5344,14 @@ function MindMapNode({
5305
5344
  active,
5306
5345
  stateValues = {},
5307
5346
  drawing = false,
5308
- progress = 1
5347
+ progress = 1,
5348
+ textMetrics = "proportional"
5309
5349
  }) {
5310
5350
  const x0 = node.cx - node.w / 2;
5311
5351
  const y0 = node.cy - node.h / 2;
5312
- const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues);
5352
+ const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
5313
5353
  if (!layout2) return /* @__PURE__ */ jsx("g", { transform: `translate(${x0} ${y0})` });
5354
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
5314
5355
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
5315
5356
  const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
5316
5357
  const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
@@ -5357,8 +5398,13 @@ function MindMapNode({
5357
5398
  const \u6587\u5B57\u306E\u5BC4\u305B = \u67A0\u306A\u3057 ? \u5916\u3078 ? "start" : "end" : "middle";
5358
5399
  const \u63CF\u753B\u57DF\u306E\u7AEF = \u5916\u3078 ? node.w - MIND_PAD : MIND_PAD;
5359
5400
  const \u4F7F\u3048\u308B = \u67A0\u306A\u3057 ? Math.abs(\u63CF\u753B\u57DF\u306E\u7AEF - \u6587\u5B57\u306Ex) : \u4F7F\u3048\u308B\u5E45(n.w);
5360
- 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);
5361
- const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, \u67A0\u306A\u3057 ? \u4F7F\u3048\u308B + (n.w - \u4F7F\u3048\u308B\u5E45(n.w)) : n.w, n.h);
5401
+ 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);
5402
+ const \u884C = \u7BB1\u306B\u7A4D\u3080(
5403
+ \u6750\u6599,
5404
+ \u67A0\u306A\u3057 ? \u4F7F\u3048\u308B + (n.w - \u4F7F\u3048\u308B\u5E45(n.w)) : n.w,
5405
+ n.h,
5406
+ \u6E2C\u308B
5407
+ );
5362
5408
  const \u6587\u5B57\u306E\u8272 = n.isRoot ? "var(--cdl-text-on-tone, #ffffff)" : "var(--cdl-chip-text, #1a1f2a)";
5363
5409
  return /* @__PURE__ */ jsxs("g", { "data-cdl-unresolved": n.unresolved ? "true" : void 0, children: [
5364
5410
  \u67A0\u306A\u3057 ? null : /* @__PURE__ */ jsx(
@@ -5410,14 +5456,14 @@ function MindMapNode({
5410
5456
  })
5411
5457
  ] });
5412
5458
  }
5413
- function \u63CF\u304F\u6A2A\u306E\u7AEF(n) {
5459
+ function \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics = "proportional") {
5414
5460
  if (n.isRoot || !n.isLeaf) return [n.x - n.w / 2, n.x + n.w / 2];
5415
5461
  const \u8D77\u70B9 = n.x + (n.side === "right" ? -n.w / 2 : n.w / 2);
5416
5462
  const \u540D\u524D = \u653E\u5C04\u306E\u884C(n)[0];
5417
- const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
5463
+ const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
5418
5464
  return n.side === "right" ? [\u8D77\u70B9, \u8D77\u70B9 + \u5E45] : [\u8D77\u70B9 - \u5E45, \u8D77\u70B9];
5419
5465
  }
5420
- function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5466
+ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH, textMetrics = "proportional") {
5421
5467
  const nodes = [];
5422
5468
  const edges = [];
5423
5469
  const rootW = 120;
@@ -5495,7 +5541,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5495
5541
  const PREFERRED_GAP = MIND_BOX_GAP;
5496
5542
  const \u679D\u306E\u540D\u524D\u306E\u5E45 = (title) => {
5497
5543
  const \u540D\u524D = \u653E\u5C04\u306E\u884C({ title, isRoot: false })[0];
5498
- return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
5544
+ return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
5499
5545
  };
5500
5546
  const \u679D\u306E\u6A2A\u3092\u6C7A\u3081\u308B = (br) => {
5501
5547
  const maxSubDepth = subDepthOf(br.id, /* @__PURE__ */ new Set());
@@ -5613,7 +5659,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5613
5659
  let maxExtentX = rootW / 2;
5614
5660
  let maxExtentY = rootH / 2;
5615
5661
  for (const n of nodes) {
5616
- const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
5662
+ const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
5617
5663
  maxExtentX = Math.max(maxExtentX, Math.abs(\u5DE6 - cx), Math.abs(\u53F3 - cx));
5618
5664
  maxExtentY = Math.max(maxExtentY, Math.abs(n.y - cy) + n.h / 2);
5619
5665
  }
@@ -5633,7 +5679,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5633
5679
  let \u5DE6\u7AEF = Number.POSITIVE_INFINITY;
5634
5680
  let \u53F3\u7AEF = Number.NEGATIVE_INFINITY;
5635
5681
  for (const n of nodes) {
5636
- const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
5682
+ const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
5637
5683
  \u5DE6\u7AEF = Math.min(\u5DE6\u7AEF, l);
5638
5684
  \u53F3\u7AEF = Math.max(\u53F3\u7AEF, r);
5639
5685
  }
@@ -5855,10 +5901,16 @@ function emptyCounts() {
5855
5901
  "validation-interrupted": 0
5856
5902
  };
5857
5903
  }
5858
- function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n) {
5859
- const \u7BB1 = (b, \u884C) => ({ \u884C, w: b.w, h: b.h });
5860
- if (n.kind === "tree-hierarchy") return \u6728\u306E\u4E2D\u8EAB(n).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b)));
5861
- if (n.kind === "mind-map") return (\u653E\u5C04\u306E\u4E2D\u8EAB(n)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b)));
5904
+ function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics = "proportional") {
5905
+ const \u7BB1 = (b, \u884C, \u6E2C\u308B) => ({ \u884C, w: b.w, h: b.h, \u6E2C\u308B });
5906
+ if (n.kind === "tree-hierarchy") {
5907
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
5908
+ return \u6728\u306E\u4E2D\u8EAB(n, {}, textMetrics).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b), \u6E2C\u308B));
5909
+ }
5910
+ if (n.kind === "mind-map") {
5911
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
5912
+ return (\u653E\u5C04\u306E\u4E2D\u8EAB(n, {}, textMetrics)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b), \u6E2C\u308B));
5913
+ }
5862
5914
  return [];
5863
5915
  }
5864
5916
  function measureStubOut(segs) {
@@ -6492,6 +6544,7 @@ function \u4F4D\u7F6E\u3092\u624B\u3067\u66F8\u3044\u305F(n) {
6492
6544
  return n.posX !== void 0 && n.posY !== void 0;
6493
6545
  }
6494
6546
  function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5668) {
6547
+ const textMetrics = laid.textMetrics ?? "proportional";
6495
6548
  const LIFELINE_W_THRESHOLD = 8;
6496
6549
  for (const n of laid.nodes) {
6497
6550
  if (n.w < LIFELINE_W_THRESHOLD) continue;
@@ -6503,7 +6556,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6503
6556
  );
6504
6557
  }
6505
6558
  }
6506
- const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges);
6559
+ const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges, textMetrics);
6507
6560
  const collisions = detectCollisions(bboxes, laid.edges);
6508
6561
  for (const c of collisions) {
6509
6562
  const involvesEdgeLabel = c.a.kind === "edge-label" || c.b.kind === "edge-label";
@@ -6523,7 +6576,11 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6523
6576
  if (!titleTrimmed) continue;
6524
6577
  const \u4F59\u767D = drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING;
6525
6578
  const \u4F7F\u3048\u308B\u5E452 = n.w - \u4F59\u767D;
6526
- const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, { fontSize: titleFontSize(n.kind), bound: "drawn" });
6579
+ const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, {
6580
+ fontSize: titleFontSize(n.kind),
6581
+ bound: "drawn",
6582
+ textMetrics
6583
+ });
6527
6584
  if (titleScalesToFit(n.kind, n.h)) {
6528
6585
  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);
6529
6586
  if (\u7E2E\u3081\u305F\u5927\u304D\u3055 < MIN_TITLE_FONT_SIZE) {
@@ -6591,7 +6648,13 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6591
6648
  const b\u306F\u672D = n.b.kind === "edge-label";
6592
6649
  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;
6593
6650
  const \u76F8\u624B = \u52D5\u304B\u3059 === n.a ? n.b : n.a;
6594
- const reason = \u52D5\u304B\u3059 !== null ? \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(\u52D5\u304B\u3059.id, \u76F8\u624B, laid.edges, \u672D\u306E\u969C\u5BB3\u7269) ?? void 0 : void 0;
6651
+ const reason = \u52D5\u304B\u3059 !== null ? \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(
6652
+ \u52D5\u304B\u3059.id,
6653
+ \u76F8\u624B,
6654
+ laid.edges,
6655
+ \u672D\u306E\u969C\u5BB3\u7269,
6656
+ textMetrics
6657
+ ) ?? void 0 : void 0;
6595
6658
  push(
6596
6659
  "clearance",
6597
6660
  `${n.a.kind}:${n.a.id} \u2194 ${n.b.kind}:${n.b.id} gap=${n.gap.toFixed(1)}px (need ${n.required}px)`,
@@ -6605,7 +6668,10 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6605
6668
  if (!hasRenderedLabel(e)) continue;
6606
6669
  const segs = extractPathSegments(e.d);
6607
6670
  if (segs.length === 0) continue;
6608
- const minDist = measurePathLabelGapSegs(flattenPathSegments(segs), computeLabelBBoxWorld(e));
6671
+ const minDist = measurePathLabelGapSegs(
6672
+ flattenPathSegments(segs),
6673
+ computeLabelBBoxWorld(e, textMetrics)
6674
+ );
6609
6675
  if (!Number.isFinite(minDist)) continue;
6610
6676
  if (minDist > PROXIMITY_ERROR_THRESHOLD) {
6611
6677
  push(
@@ -6655,8 +6721,15 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6655
6721
  }
6656
6722
  for (const e of laid.edges) {
6657
6723
  if (!hasRenderedLabel(e)) continue;
6658
- const mainW = measureTextWidth(e.label ?? "", { fontSize: EDGE_LABEL_TEXT.main.fontSize });
6659
- const subW = e.sub ? measureTextWidth(e.sub, { fontSize: EDGE_LABEL_TEXT.sub.fontSize, fontFamily: "mono" }) : 0;
6724
+ const mainW = measureTextWidth(e.label ?? "", {
6725
+ fontSize: EDGE_LABEL_TEXT.main.fontSize,
6726
+ textMetrics
6727
+ });
6728
+ const subW = e.sub ? measureTextWidth(e.sub, {
6729
+ fontSize: EDGE_LABEL_TEXT.sub.fontSize,
6730
+ fontFamily: "mono",
6731
+ textMetrics
6732
+ }) : 0;
6660
6733
  const expectedBoxW = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
6661
6734
  const bbox = bboxes.find((b) => b.kind === "edge-label" && b.id === e.id);
6662
6735
  if (!bbox) continue;
@@ -6798,7 +6871,9 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6798
6871
  }
6799
6872
  }
6800
6873
  for (const n of laid.nodes) {
6801
- const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter((line) => droppedLineIsHidden(n.kind, line));
6874
+ const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter(
6875
+ (line) => droppedLineIsHidden(n.kind, line)
6876
+ );
6802
6877
  if (\u843D\u3068\u3057\u305F.length === 0) continue;
6803
6878
  push(
6804
6879
  "shape-label-dropped",
@@ -6807,7 +6882,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6807
6882
  );
6808
6883
  }
6809
6884
  for (const n of laid.nodes) {
6810
- const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n);
6885
+ const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics);
6811
6886
  if (\u7BB1.length === 0) continue;
6812
6887
  let \u5BFE\u8C61 = 0;
6813
6888
  const \u843D\u3061\u305F = [];
@@ -6815,7 +6890,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6815
6890
  const \u5BA3\u8A00 = b.\u884C.slice(1).filter((r) => r.text.trim() !== "");
6816
6891
  if (\u5BA3\u8A00.length === 0) continue;
6817
6892
  \u5BFE\u8C61 += 1;
6818
- const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h).map((r) => r.\u5F79\u5272));
6893
+ const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h, b.\u6E2C\u308B).map((r) => r.\u5F79\u5272));
6819
6894
  if (\u5BA3\u8A00.every((r) => \u6B8B\u3063\u305F.has(r.\u5F79\u5272))) continue;
6820
6895
  \u843D\u3061\u305F.push({ title: b.\u884C[0]?.text ?? "", h: b.h });
6821
6896
  }
@@ -7878,7 +7953,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
7878
7953
  const allowedLanes = /* @__PURE__ */ new Set();
7879
7954
  if (fromNode) allowedLanes.add(fromNode.lane);
7880
7955
  if (toNode) allowedLanes.add(toNode.lane);
7881
- const box = computeLabelBBoxWorld(e);
7956
+ const box = computeLabelBBoxWorld(e, textMetrics);
7882
7957
  for (const lane of laid.lanes) {
7883
7958
  if (allowedLanes.has(lane.id)) continue;
7884
7959
  const side = rectCrossesLaneBorder(box, lane, rangeByLane.get(lane.id));
@@ -8002,7 +8077,7 @@ function pickFreeSides(occupied, count) {
8002
8077
  const \u4F7F\u3046 = \u7A7A\u304D.length > 0 ? \u7A7A\u304D : [SELF_LOOP_SIDE_FALLBACK];
8003
8078
  return Array.from({ length: count }, (_, i) => \u4F7F\u3046[i % \u4F7F\u3046.length]);
8004
8079
  }
8005
- function routeSelfLoopGroup(edges, node, side) {
8080
+ function routeSelfLoopGroup(edges, node, side, textMetrics = "proportional") {
8006
8081
  const horizontal = side === "left" || side === "right";
8007
8082
  const g = sideGeometry(node, side);
8008
8083
  const span = fitSpan(horizontal ? node.h : node.w, SELF_LOOP_SPAN);
@@ -8011,7 +8086,7 @@ function routeSelfLoopGroup(edges, node, side) {
8011
8086
  const \u6700\u5916 = controlOffset(SELF_LOOP_OUT + (edges.length - 1) * SELF_LOOP_STAGGER);
8012
8087
  const \u8A9E\u307E\u3067 = \u6700\u5916 + LABEL_TO_PATH_CLEARANCE;
8013
8088
  const \u8A9E\u5E45 = edges.map(
8014
- (e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub)
8089
+ (e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub, textMetrics)
8015
8090
  );
8016
8091
  const \u4F4D\u7F6E = [];
8017
8092
  let \u7A4D = 0;
@@ -8041,7 +8116,7 @@ function routeSelfLoopGroup(edges, node, side) {
8041
8116
  function isSelfLoop(e) {
8042
8117
  return e.from === e.to;
8043
8118
  }
8044
- function layoutSelfLoops(edges, nodes, occupiedBySide) {
8119
+ function layoutSelfLoops(edges, nodes, occupiedBySide, textMetrics = "proportional") {
8045
8120
  const \u5272\u5F53 = /* @__PURE__ */ new Map();
8046
8121
  for (const edge of edges) {
8047
8122
  if (edge.side) continue;
@@ -8068,7 +8143,7 @@ function layoutSelfLoops(edges, nodes, occupiedBySide) {
8068
8143
  if (\u65E2) \u65E2.edges.push(edge);
8069
8144
  else \u675F.set(key, { node, side, edges: [edge] });
8070
8145
  }
8071
- return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side));
8146
+ return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side, textMetrics));
8072
8147
  }
8073
8148
 
8074
8149
  // src/layout/tokens.ts
@@ -8286,7 +8361,7 @@ function verticalDetourBlockers(A, B, obstacles) {
8286
8361
  function detourColumnFor(blockers, side) {
8287
8362
  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;
8288
8363
  }
8289
- function layoutEdges(diag, nodes, lanes = []) {
8364
+ function layoutEdges(diag, nodes, lanes = [], textMetrics = "proportional") {
8290
8365
  const labelMarginExtra = (diag.viewport?.labelMargin ?? diag.viewport?.gap ?? DEFAULT_LABEL_MARGIN) - DEFAULT_LABEL_MARGIN;
8291
8366
  const nmap = new Map(nodes.map((n) => [n.id, n]));
8292
8367
  const lmap = new Map(lanes.map((l) => [l.id, l]));
@@ -8319,7 +8394,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8319
8394
  const to = nmap.get(e.to);
8320
8395
  if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
8321
8396
  if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
8322
- const c = curvePath(from, to, e, labelMarginExtra);
8397
+ const c = curvePath(from, to, e, labelMarginExtra, textMetrics);
8323
8398
  positionedEdges.push({
8324
8399
  ...e,
8325
8400
  d: c.d,
@@ -8334,7 +8409,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8334
8409
  const to = nmap.get(e.to);
8335
8410
  if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
8336
8411
  if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
8337
- const m = metroPath(from, to, e, labelMarginExtra);
8412
+ const m = metroPath(from, to, e, labelMarginExtra, textMetrics);
8338
8413
  positionedEdges.push({
8339
8414
  ...e,
8340
8415
  d: m.d,
@@ -8382,7 +8457,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8382
8457
  \u4F7F\u3046(le.from, le.fromSide);
8383
8458
  \u4F7F\u3046(le.to, le.toSide);
8384
8459
  }
8385
- const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide);
8460
+ const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide, textMetrics);
8386
8461
  const labelOffsetsByEdgeId = /* @__PURE__ */ new Map();
8387
8462
  const parallelKey = (p) => p.e.from < p.e.to ? `${p.e.from}::${p.e.to}` : `${p.e.to}::${p.e.from}`;
8388
8463
  const byParallel = /* @__PURE__ */ new Map();
@@ -8536,7 +8611,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8536
8611
  const others = nodes.filter((n) => n.id !== c.from && n.id !== c.to);
8537
8612
  if (others.some((n) => segmentsCrossRect(segs, nodeRect(n)))) return true;
8538
8613
  if (!hasRenderedLabel(c.e)) return false;
8539
- const boxW = computeLabelBoxW(c.e.label, c.e.sub);
8614
+ const boxW = computeLabelBoxW(c.e.label, c.e.sub, textMetrics);
8540
8615
  const boxH = labelPillH(c.e.sub);
8541
8616
  const centerX = columnX - (labelPathClearanceHorizontal(c.e) + boxW / 2);
8542
8617
  const pill = { x: centerX - boxW / 2, y: (exitY + returnY) / 2 - boxH / 2, w: boxW, h: boxH };
@@ -8651,7 +8726,8 @@ function layoutEdges(diag, nodes, lanes = []) {
8651
8726
  allOtherNodes,
8652
8727
  { x: endpointOffset.fromDx, y: endpointOffset.fromDy },
8653
8728
  { x: endpointOffset.toDx, y: endpointOffset.toDy },
8654
- avoidRects
8729
+ avoidRects,
8730
+ textMetrics
8655
8731
  );
8656
8732
  const routed1 = route([]);
8657
8733
  const { d, labelX, labelY, labelAnchor, labelAltX } = routed1;
@@ -8707,13 +8783,13 @@ function layoutEdges(diag, nodes, lanes = []) {
8707
8783
  const pillById = /* @__PURE__ */ new Map();
8708
8784
  for (const r of list) {
8709
8785
  if (!hasRenderedLabel(r.e)) continue;
8710
- const w = computeLabelBoxW(r.e.label, r.e.sub);
8786
+ const w = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
8711
8787
  const h = labelPillH(r.e.sub);
8712
8788
  pillById.set(r.e.id, { x: r.baseLabelX - w / 2, y: r.baseLabelY - h / 2, w, h });
8713
8789
  }
8714
8790
  for (const le of positionedEdges) {
8715
8791
  if (!hasRenderedLabel(le)) continue;
8716
- const w = computeLabelBoxW(le.label, le.sub);
8792
+ const w = computeLabelBoxW(le.label, le.sub, textMetrics);
8717
8793
  const h = labelPillH(le.sub);
8718
8794
  pillById.set(le.id, { x: le.labelX - w / 2, y: le.labelY - h / 2, w, h });
8719
8795
  }
@@ -8743,7 +8819,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8743
8819
  const laneOfNode = new Map(nodes.map((n) => [n.id, n.lane]));
8744
8820
  for (const r of flippable) {
8745
8821
  const ownSegs = segsByEdgeId.get(r.e.id);
8746
- const boxW = computeLabelBoxW(r.e.label, r.e.sub);
8822
+ const boxW = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
8747
8823
  const boxH = labelPillH(r.e.sub);
8748
8824
  const pillAt = (centerX) => ({
8749
8825
  x: centerX - boxW / 2,
@@ -8788,7 +8864,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8788
8864
  if (list.length < 2) continue;
8789
8865
  const boxes = list.map((r) => ({
8790
8866
  cx: r.baseLabelX,
8791
- halfW: computeLabelBoxW(r.e.label, r.e.sub) / 2
8867
+ halfW: computeLabelBoxW(r.e.label, r.e.sub, textMetrics) / 2
8792
8868
  }));
8793
8869
  const overlapsX = (i, j) => Math.abs(boxes[i].cx - boxes[j].cx) < boxes[i].halfW + boxes[j].halfW + CLEARANCE_LABEL_LABEL;
8794
8870
  const componentOf = list.map((_, i) => i);
@@ -8838,7 +8914,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8838
8914
  r,
8839
8915
  baseX: r.baseLabelX,
8840
8916
  baseY: r.baseLabelY,
8841
- w: computeLabelBoxW(r.e.label, r.e.sub),
8917
+ w: computeLabelBoxW(r.e.label, r.e.sub, textMetrics),
8842
8918
  h: labelPillH(r.e.sub)
8843
8919
  }));
8844
8920
  items.sort((a, b) => a.baseX - b.baseX);
@@ -8950,7 +9026,7 @@ function singleStraightSegment(d) {
8950
9026
  if (x1 === x2 && y1 === y2) return null;
8951
9027
  return { x1, y1, x2, y2 };
8952
9028
  }
8953
- function bowSharedStraightPaths(edges, nodes, skipIds) {
9029
+ function bowSharedStraightPaths(edges, nodes, skipIds, textMetrics = "proportional") {
8954
9030
  const groups = /* @__PURE__ */ new Map();
8955
9031
  for (const e of edges) {
8956
9032
  if (skipIds.has(e.id)) continue;
@@ -8986,7 +9062,7 @@ function bowSharedStraightPaths(edges, nodes, skipIds) {
8986
9062
  )
8987
9063
  );
8988
9064
  const groupIds = new Set(group.map((g) => g.e.id));
8989
- const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x));
9065
+ const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x, textMetrics));
8990
9066
  const nodeRects = nodes.map((n) => ({ x: n.cx - n.w / 2, y: n.cy - n.h / 2, w: n.w, h: n.h }));
8991
9067
  const build = (seg, offset) => {
8992
9068
  const cx = midX + nx * offset * 2;
@@ -9029,6 +9105,55 @@ function bowSharedStraightPaths(edges, nodes, skipIds) {
9029
9105
  function nodeRect(n) {
9030
9106
  return { x: n.cx - n.w / 2, y: n.cy - n.h / 2, w: n.w, h: n.h };
9031
9107
  }
9108
+ function countPathObstacleCrossings(d, obstacles) {
9109
+ const segments = flattenPathSegments(extractPathSegments(d));
9110
+ return obstacles.filter((obstacle) => segmentsCrossRect(segments, nodeRect(obstacle))).length;
9111
+ }
9112
+ function makeBackDetourCandidate(A, B, from, to, obstacles, detourY, side) {
9113
+ const lowIsA = A.y >= B.y;
9114
+ const low = lowIsA ? A : B;
9115
+ const lowBendY = low.y - VERTICAL_DETOUR_EXIT;
9116
+ const bandTop = Math.min(detourY, lowBendY);
9117
+ const bandBottom = Math.max(detourY, lowBendY);
9118
+ const bandObstacles = obstacles.map(nodeRect).filter((rect) => rect.y + rect.h >= bandTop && rect.y <= bandBottom);
9119
+ let columnX = detourColumnFor([from, to], side);
9120
+ while (true) {
9121
+ const blockers = bandObstacles.filter(
9122
+ (rect) => rect.x - VERTICAL_DETOUR_GAP < columnX && columnX < rect.x + rect.w + VERTICAL_DETOUR_GAP
9123
+ );
9124
+ if (blockers.length === 0) break;
9125
+ 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));
9126
+ }
9127
+ const bendAY = lowIsA ? lowBendY : detourY;
9128
+ const bendBY = lowIsA ? detourY : lowBendY;
9129
+ const vertices = [
9130
+ A,
9131
+ { x: A.x, y: bendAY },
9132
+ { x: columnX, y: bendAY },
9133
+ { x: columnX, y: bendBY },
9134
+ { x: B.x, y: bendBY },
9135
+ B
9136
+ ];
9137
+ const d = verticesToPath(vertices);
9138
+ const high = lowIsA ? B : A;
9139
+ return {
9140
+ d,
9141
+ labelX: (high.x + columnX) / 2,
9142
+ crossings: countPathObstacleCrossings(d, obstacles),
9143
+ length: vertices.slice(1).reduce((sum, vertex, index) => {
9144
+ const previous = vertices[index];
9145
+ return sum + Math.hypot(vertex.x - previous.x, vertex.y - previous.y);
9146
+ }, 0)
9147
+ };
9148
+ }
9149
+ function chooseBackDetourCandidate(A, B, from, to, obstacles, detourY) {
9150
+ const left = makeBackDetourCandidate(A, B, from, to, obstacles, detourY, "left");
9151
+ const right = makeBackDetourCandidate(A, B, from, to, obstacles, detourY, "right");
9152
+ if (left.crossings !== right.crossings) return left.crossings < right.crossings ? left : right;
9153
+ if (Math.abs(left.length - right.length) >= 0.5) return left.length < right.length ? left : right;
9154
+ const preferred = Math.abs(A.x - B.x) < 0.5 ? "right" : A.x < B.x ? "left" : "right";
9155
+ return preferred === "left" ? left : right;
9156
+ }
9032
9157
  function rectGap(a, b) {
9033
9158
  const dx = Math.max(0, a.x - (b.x + b.w), b.x - (a.x + a.w));
9034
9159
  const dy = Math.max(0, a.y - (b.y + b.h), b.y - (a.y + a.h));
@@ -9106,8 +9231,8 @@ function sidePoint(n, side) {
9106
9231
  return { x: n.cx + n.w / 2, y: n.cy };
9107
9232
  }
9108
9233
  }
9109
- function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _fromLane, _toLane, edge, labelObstacles = obstacles, fromOffset = { x: 0, y: 0 }, toOffset = { x: 0, y: 0 }, avoidRects = []) {
9110
- const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub) : 0;
9234
+ 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") {
9235
+ const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub, textMetrics) : 0;
9111
9236
  const labelHalfW = labelBoxW / 2;
9112
9237
  const labelInit = labelInitClearance(edge);
9113
9238
  const verticalPair = fromSide === "bottom" && toSide === "top" || fromSide === "top" && toSide === "bottom";
@@ -9479,7 +9604,7 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
9479
9604
  const detourY = Math.min(A.y, B.y) - 100;
9480
9605
  const corner = 14;
9481
9606
  const xDir = B.x > A.x ? 1 : -1;
9482
- return {
9607
+ const existing = {
9483
9608
  d: `M ${A.x} ${A.y}
9484
9609
  L ${A.x} ${detourY + corner}
9485
9610
  Q ${A.x} ${detourY}, ${A.x + xDir * corner} ${detourY}
@@ -9493,6 +9618,16 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
9493
9618
  labelY: detourY - labelInit,
9494
9619
  labelAnchor: "middle"
9495
9620
  };
9621
+ const existingCrossings = countPathObstacleCrossings(existing.d, obstacles);
9622
+ if (existingCrossings === 0) return existing;
9623
+ const candidate = chooseBackDetourCandidate(A, B, from, to, obstacles, detourY);
9624
+ if (candidate.crossings >= existingCrossings) return existing;
9625
+ return {
9626
+ d: candidate.d,
9627
+ labelX: candidate.labelX,
9628
+ labelY: detourY - labelInit,
9629
+ labelAnchor: "middle"
9630
+ };
9496
9631
  }
9497
9632
  const midX = fromSide === "left" || fromSide === "right" ? B.x : A.x;
9498
9633
  const midY = fromSide === "top" || fromSide === "bottom" ? B.y : A.y;
@@ -9506,7 +9641,7 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
9506
9641
  labelAnchor: "middle"
9507
9642
  };
9508
9643
  }
9509
- function repositionParallelLabels(edges, nodes) {
9644
+ function repositionParallelLabels(edges, nodes, textMetrics = "proportional") {
9510
9645
  const allSegs = new Map(
9511
9646
  edges.map((e) => [e.id, flattenPathSegments(extractPathSegments(e.d))])
9512
9647
  );
@@ -9531,7 +9666,7 @@ function repositionParallelLabels(edges, nodes) {
9531
9666
  for (const pair of byPair.values()) {
9532
9667
  if (pair.length < 2) continue;
9533
9668
  const pairOrder = [...pair].sort(compareSharedPairOrder);
9534
- const boxes = pair.map((e) => computeLabelBBoxWorld(e));
9669
+ const boxes = pair.map((e) => computeLabelBBoxWorld(e, textMetrics));
9535
9670
  const componentOf = pair.map((_, i) => i);
9536
9671
  for (let i = 0; i < pair.length; i++) {
9537
9672
  for (let j = i + 1; j < pair.length; j++) {
@@ -9556,17 +9691,27 @@ function repositionParallelLabels(edges, nodes) {
9556
9691
  nodes,
9557
9692
  allEdges: edges,
9558
9693
  allSegs,
9559
- xRange
9694
+ xRange,
9695
+ textMetrics
9560
9696
  });
9561
9697
  for (let i = 0; i < members.length; i++) members[i].labelY = placed[i];
9562
9698
  }
9563
9699
  }
9564
9700
  }
9565
9701
  function placeAvoidingSiblingPaths(args) {
9566
- const { members, pair, pairOrder, nodes, allEdges, allSegs, xRange } = args;
9702
+ const {
9703
+ members,
9704
+ pair,
9705
+ pairOrder,
9706
+ nodes,
9707
+ allEdges,
9708
+ allSegs,
9709
+ xRange,
9710
+ textMetrics = "proportional"
9711
+ } = args;
9567
9712
  const sizes = members.map((e) => labelPillH(e.sub));
9568
9713
  const wants = members.map((e) => e.labelY);
9569
- const boxes = members.map((e) => computeLabelBBoxWorld(e));
9714
+ const boxes = members.map((e) => computeLabelBBoxWorld(e, textMetrics));
9570
9715
  const all = members.map((_, i) => i);
9571
9716
  const spread = (idx) => spreadWithMinimalShift(
9572
9717
  idx.map((i) => ({ want: wants[i], size: sizes[i] })),
@@ -9757,14 +9902,14 @@ function labelRectAt(cx, cy, w, h) {
9757
9902
  function inflate(r, pad) {
9758
9903
  return { x: r.x - pad, y: r.y - pad, w: r.w + pad * 2, h: r.h + pad * 2 };
9759
9904
  }
9760
- function slideLabelsAlongOwnPath(edges, nodes) {
9905
+ function slideLabelsAlongOwnPath(edges, nodes, textMetrics = "proportional") {
9761
9906
  const withLabel = edges.filter((e) => hasRenderedLabel(e));
9762
9907
  if (withLabel.length === 0) return;
9763
9908
  const segsById = /* @__PURE__ */ new Map();
9764
9909
  for (const e of edges) segsById.set(e.id, flattenPathSegments(extractPathSegments(e.d)));
9765
9910
  const nodeRects = nodes.map(nodeRect);
9766
9911
  for (const e of withLabel) {
9767
- const w = computeLabelBoxW(e.label, e.sub);
9912
+ const w = computeLabelBoxW(e.label, e.sub, textMetrics);
9768
9913
  const h = labelPillH(e.sub);
9769
9914
  if (w === 0 || h === 0) continue;
9770
9915
  const own = segsById.get(e.id) ?? [];
@@ -10066,7 +10211,7 @@ function separateSharedStraightRuns(edges, nodes) {
10066
10211
  e.d = verticesToPath(verts.get(e.id));
10067
10212
  }
10068
10213
  }
10069
- function pullOutgoingFirstCorner(edges, nodes) {
10214
+ function pullOutgoingFirstCorner(edges, nodes, textMetrics = "proportional") {
10070
10215
  if (edges.length < 2) return;
10071
10216
  const \u675F = /* @__PURE__ */ new Map();
10072
10217
  const \u540C\u3058\u7D44\u306E\u6570 = /* @__PURE__ */ new Map();
@@ -10120,10 +10265,10 @@ function pullOutgoingFirstCorner(edges, nodes) {
10120
10265
  }
10121
10266
  e.d = \u524D;
10122
10267
  if (!\u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F) {
10123
- slideLabelsAlongOwnPath(edges, nodes);
10268
+ slideLabelsAlongOwnPath(edges, nodes, textMetrics);
10124
10269
  \u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F = true;
10125
10270
  }
10126
- const labelBox = computeLabelBBoxWorld(e);
10271
+ const labelBox = computeLabelBBoxWorld(e, textMetrics);
10127
10272
  const label = { x: labelBox.x + labelBox.w / 2, y: labelBox.y + labelBox.h / 2 };
10128
10273
  const \u7DDA\u5206\u307E\u3067\u306E\u8DDD\u96E22 = (a, b) => {
10129
10274
  const dx = b.x - a.x;
@@ -10235,13 +10380,13 @@ function fanIncomingEndpoints(edges, nodes) {
10235
10380
  }
10236
10381
  return \u7D42\u70B9\u306E\u79FB\u52D5;
10237
10382
  }
10238
- function followLabelsToFannedTails(edges, obstacles, shifts) {
10383
+ function followLabelsToFannedTails(edges, obstacles, shifts, textMetrics = "proportional") {
10239
10384
  if (shifts.size === 0) return;
10240
10385
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
10241
10386
  const labels = edges.filter(hasRenderedLabel).map((e) => ({
10242
10387
  kind: "edge-label",
10243
10388
  id: e.id,
10244
- ...computeLabelBBoxWorld(e)
10389
+ ...computeLabelBBoxWorld(e, textMetrics)
10245
10390
  }));
10246
10391
  const labelIndexByEdgeId = new Map(labels.map((label, index) => [label.id, index]));
10247
10392
  const edgeById = new Map(edges.map((e) => [e.id, e]));
@@ -10273,7 +10418,7 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
10273
10418
  labelY: e.labelY + \u79FB\u52D5.dy,
10274
10419
  labelAnchor: e.labelAnchor
10275
10420
  };
10276
- const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa });
10421
+ const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa }, textMetrics);
10277
10422
  const \u6700\u5F8C\u306F\u7E26 = Math.abs(\u6700\u5F8C.x2 - \u6700\u5F8C.x1) <= Math.abs(\u6700\u5F8C.y2 - \u6700\u5F8C.y1);
10278
10423
  const \u5019\u88DC = [
10279
10424
  \u5019\u88DCa,
@@ -10284,7 +10429,11 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
10284
10429
  }
10285
10430
  ];
10286
10431
  for (const c of \u5019\u88DC) {
10287
- const \u672D = { kind: "edge-label", id: e.id, ...computeLabelBBoxWorld({ ...e, ...c }) };
10432
+ const \u672D = {
10433
+ kind: "edge-label",
10434
+ id: e.id,
10435
+ ...computeLabelBBoxWorld({ ...e, ...c }, textMetrics)
10436
+ };
10288
10437
  if (segmentsCrossRect([\u6700\u5F8C], \u672D)) continue;
10289
10438
  if (\u672D\u306E\u79FB\u52D5\u3092\u585E\u3050\u76F8\u624B\u3092\u63A2\u3059(\u5468\u308A, \u5143\u306E\u672D, \u672D) !== null) continue;
10290
10439
  e.labelX = c.labelX;
@@ -10478,7 +10627,7 @@ function expandLanesForNodes(lanes, nodes) {
10478
10627
  };
10479
10628
  });
10480
10629
  }
10481
- function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
10630
+ function expandLaneGapsForEdgeLabels(lanes, nodes, edges, textMetrics = "proportional") {
10482
10631
  if (lanes.length < 2) return lanes;
10483
10632
  const layoutedLanes = lanes.filter((l) => !(l.posX !== void 0 && l.posY !== void 0));
10484
10633
  if (layoutedLanes.length < 2) return lanes;
@@ -10494,7 +10643,7 @@ function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
10494
10643
  const fi = laneIndexById.get(fromLane);
10495
10644
  const ti = laneIndexById.get(toLane);
10496
10645
  if (fi === void 0 || ti === void 0 || fi === ti) continue;
10497
- const labelBoxW = computeLabelBoxW(edge.label, edge.sub);
10646
+ const labelBoxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
10498
10647
  if (labelBoxW === 0) continue;
10499
10648
  const lo = Math.min(fi, ti);
10500
10649
  const hi = Math.max(fi, ti);
@@ -10616,7 +10765,7 @@ function \u7DDA\u306E\u7AEF\u306E\u5411\u304D(d, \u7AEF) {
10616
10765
  const \u5019\u88DC = segs.flatMap((s) => [...s.ctrl ?? [], { x: s.x2, y: s.y2 }]);
10617
10766
  return \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC);
10618
10767
  }
10619
- function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
10768
+ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head", textMetrics = "proportional") {
10620
10769
  const text = (\u7AEF === "head" ? edge.headLabel : edge.tailLabel)?.trim();
10621
10770
  if (!text) return null;
10622
10771
  const \u5411\u304D = \u7DDA\u306E\u7AEF\u306E\u5411\u304D(edge.d, \u7AEF);
@@ -10627,7 +10776,8 @@ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
10627
10776
  const w = measureTextWidth(text, {
10628
10777
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
10629
10778
  fontWeight: EDGE_LABEL_TEXT.sub.fontWeight,
10630
- fontFamily: "mono"
10779
+ fontFamily: "mono",
10780
+ textMetrics
10631
10781
  });
10632
10782
  const h = \u7BB1\u306E\u9AD8\u3055;
10633
10783
  const \u672D = hasRenderedLabel(edge) && edge.labelX !== void 0 && edge.labelY !== void 0 ? { x: edge.labelX, y: edge.labelY } : null;
@@ -10676,10 +10826,10 @@ function autoStorageHeight(n, defaultH) {
10676
10826
  }
10677
10827
  return Math.max(defaultH, \u5FC5\u8981);
10678
10828
  }
10679
- function autoRowsWidth(n, defaultW) {
10829
+ function autoRowsWidth(n, defaultW, textMetrics = "proportional") {
10680
10830
  if (n.w != null) return n.w;
10681
10831
  if (!n.rows || n.rows.length === 0) return defaultW;
10682
- const required = requiredRowsWidth(n.rows, n.kind);
10832
+ const required = requiredRowsWidth(n.rows, n.kind, textMetrics);
10683
10833
  return Math.max(defaultW, required);
10684
10834
  }
10685
10835
  function \u7BB1\u306E\u9AD8\u30552(n, \u65E2\u5B9Ah) {
@@ -10717,7 +10867,7 @@ function requiredStackGapForEdgeLabels(diag, allStacks) {
10717
10867
  }
10718
10868
  return required;
10719
10869
  }
10720
- function layoutNodes(diag, lanes) {
10870
+ function layoutNodes(diag, lanes, textMetrics) {
10721
10871
  const laneMap = new Map(lanes.map((l) => [l.id, l]));
10722
10872
  const allStacks = Array.from(new Set(diag.nodes.map((n) => n.stack))).sort((a, b) => a - b);
10723
10873
  const rowH = /* @__PURE__ */ new Map();
@@ -10761,7 +10911,7 @@ function layoutNodes(diag, lanes) {
10761
10911
  }
10762
10912
  const size = NODE_SIZE[n.kind];
10763
10913
  if (n.posX !== void 0 && n.posY !== void 0) {
10764
- const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w);
10914
+ const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w, textMetrics);
10765
10915
  const h2 = n.posH ?? n.h ?? rowH.get(n.stack) ?? size.h;
10766
10916
  out.push({
10767
10917
  ...n,
@@ -10779,7 +10929,7 @@ function layoutNodes(diag, lanes) {
10779
10929
  const \u81EA\u524D\u306E\u9AD8\u3055 = n.rowMarks !== void 0;
10780
10930
  const h = n.h ?? (\u81EA\u524D\u306E\u9AD8\u3055 ? \u7BB1\u306E\u9AD8\u30552(n, size.h) : \u6BB5\u306E\u9AD8\u3055);
10781
10931
  const cy = \u6BB5\u306E\u82AF;
10782
- const w = autoRowsWidth(n, size.w);
10932
+ const w = autoRowsWidth(n, size.w, textMetrics);
10783
10933
  out.push({
10784
10934
  ...n,
10785
10935
  cx,
@@ -10899,10 +11049,16 @@ function applyRowLevelNodeShifts(nodes, lanes, nodeShifts) {
10899
11049
  return moved ? { nodes: outNodes, lanes: outLanes } : null;
10900
11050
  }
10901
11051
  function layout(diag) {
11052
+ const textMetrics = resolveTextMetrics(diag.textMetrics);
10902
11053
  const lanes = layoutLanes(diag);
10903
- const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes));
11054
+ const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes, textMetrics));
10904
11055
  const expandedLanes = expandLanesForNodes(lanes, rawNodes);
10905
- const gapExpandedLanes = expandLaneGapsForEdgeLabels(expandedLanes, rawNodes, diag.edges);
11056
+ const gapExpandedLanes = expandLaneGapsForEdgeLabels(
11057
+ expandedLanes,
11058
+ rawNodes,
11059
+ diag.edges,
11060
+ textMetrics
11061
+ );
10906
11062
  const nodes = rawNodes.map((n) => {
10907
11063
  if (n.posX !== void 0 && n.posY !== void 0) return n;
10908
11064
  const oldLane = lanes.find((l) => l.id === n.lane);
@@ -10911,13 +11067,13 @@ function layout(diag) {
10911
11067
  return { ...n, cx: newLane.x + newLane.width / 2 };
10912
11068
  });
10913
11069
  const containedLanesPre = recomputeContainedLanes(gapExpandedLanes, nodes);
10914
- const edgesPre = layoutEdges(diag, nodes, containedLanesPre);
10915
- const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre);
11070
+ const edgesPre = layoutEdges(diag, nodes, containedLanesPre, textMetrics);
11071
+ const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre, textMetrics);
10916
11072
  const collisionsPre = detectCollisions(bboxesPre, edgesPre);
10917
11073
  const nodesResolved = resolveOverlaps(nodes, collisionsPre);
10918
11074
  const moved = nodesResolved !== nodes;
10919
11075
  const containedLanes = moved ? recomputeContainedLanes(gapExpandedLanes, nodesResolved) : containedLanesPre;
10920
- const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes) : edgesPre;
11076
+ const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes, textMetrics) : edgesPre;
10921
11077
  const chainShiftClearance = Math.max(CLEARANCE_LABEL_LABEL, CLEARANCE_NODE_LABEL);
10922
11078
  let edges;
10923
11079
  let nodesFinal = nodesResolved;
@@ -10928,10 +11084,13 @@ function layout(diag) {
10928
11084
  } else {
10929
11085
  const propagateResult = resolveEdgeLabelOverlapsWithChainAndPropagate(
10930
11086
  edgesAfterMove,
10931
- collectBBoxes(containedLanes, nodesResolved, []).filter(
11087
+ collectBBoxes(containedLanes, nodesResolved, [], textMetrics).filter(
10932
11088
  (b) => b.kind === "node" || b.kind === "lane-label"
10933
11089
  ),
10934
- chainShiftClearance
11090
+ chainShiftClearance,
11091
+ void 0,
11092
+ void 0,
11093
+ textMetrics
10935
11094
  );
10936
11095
  edges = propagateResult.edges;
10937
11096
  if (propagateResult.nodeShifts.size > 0) {
@@ -10943,7 +11102,7 @@ function layout(diag) {
10943
11102
  }
10944
11103
  if (nodesFinal !== nodesResolved) {
10945
11104
  containedLanesFinal = recomputeContainedLanes(laneShiftedBase, nodesFinal);
10946
- edges = layoutEdges(diag, nodesFinal, containedLanesFinal);
11105
+ edges = layoutEdges(diag, nodesFinal, containedLanesFinal, textMetrics);
10947
11106
  }
10948
11107
  }
10949
11108
  const positionedEdgeIds = new Set(
@@ -10951,21 +11110,31 @@ function layout(diag) {
10951
11110
  (e) => e.routing === "curve" || e.routing === "metro" || e.posX1 !== void 0 && e.posY1 !== void 0 && e.posX2 !== void 0 && e.posY2 !== void 0
10952
11111
  ).map((e) => e.id)
10953
11112
  );
10954
- bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds);
10955
- pullOutgoingFirstCorner(edges, nodesFinal);
11113
+ bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds, textMetrics);
11114
+ pullOutgoingFirstCorner(edges, nodesFinal, textMetrics);
10956
11115
  const fannedTailShifts = fanIncomingEndpoints(edges, nodesFinal);
10957
11116
  separateSharedStraightRuns(edges, nodesFinal);
10958
11117
  hopEdgeCrossings(edges);
10959
- const labelClearanceObstacles = collectBBoxes(containedLanesFinal, nodesFinal, []).filter(
11118
+ const labelClearanceObstacles = collectBBoxes(
11119
+ containedLanesFinal,
11120
+ nodesFinal,
11121
+ [],
11122
+ textMetrics
11123
+ ).filter(
10960
11124
  (b) => b.kind === "node" || b.kind === "lane-label"
10961
11125
  );
10962
- followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts);
10963
- repositionParallelLabels(edges, nodesFinal);
10964
- slideLabelsAlongOwnPath(edges, nodesFinal);
11126
+ followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts, textMetrics);
11127
+ repositionParallelLabels(edges, nodesFinal, textMetrics);
11128
+ slideLabelsAlongOwnPath(edges, nodesFinal, textMetrics);
10965
11129
  if (!isChainEdgeLabelDisabled()) {
10966
- edges = resolveLabelClearanceAfterPathPasses(edges, labelClearanceObstacles);
11130
+ edges = resolveLabelClearanceAfterPathPasses(
11131
+ edges,
11132
+ labelClearanceObstacles,
11133
+ void 0,
11134
+ textMetrics
11135
+ );
10967
11136
  }
10968
- const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges);
11137
+ const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges, textMetrics);
10969
11138
  const collisions = detectCollisions(bboxes, edges);
10970
11139
  const nearCollisions = detectNearCollisions(bboxes, edges);
10971
11140
  if (collisions.length > 0) {
@@ -11005,6 +11174,8 @@ function layout(diag) {
11005
11174
  // 描画側の固定の字の言語 (#847)。 既定 (`en`) と型の外の値は持たせない = 配置の結果の形を
11006
11175
  // 変更前と揃え、記法の書き損じで一部の字だけ日本語になる形を作らない
11007
11176
  ...resolveLang(diag.lang) === "ja" ? { lang: "ja" } : {},
11177
+ // 既定は持ち越さない。既存の LaidDiagram の形を変えず、等幅の図だけ描画へ伝える
11178
+ ...textMetrics === "monospace" ? { textMetrics: "monospace" } : {},
11008
11179
  // 種類も配色と同じく空の目印を出さない。 遮断をここに揃えると手書きの図にも効く
11009
11180
  ...diag.type ? { type: diag.type } : {},
11010
11181
  bboxes,
@@ -11913,6 +12084,7 @@ function CdlEdgeView({
11913
12084
  "data-cdl-edge-label": edge.label,
11914
12085
  "data-cdl-edge-sub": edge.sub ?? "",
11915
12086
  "data-cdl-tone": edge.tone,
12087
+ "data-cdl-edge-role": edge.role,
11916
12088
  children: [
11917
12089
  isDotted ? /* @__PURE__ */ jsxs("g", { children: [
11918
12090
  /* @__PURE__ */ jsx("path", { id: glowPathId, d: glowPathD, fill: "none", stroke: "none" }),
@@ -12064,11 +12236,12 @@ function CdlEdgeGlowView({
12064
12236
  }
12065
12237
  function CdlEdgeLabelView({
12066
12238
  edge,
12067
- active
12239
+ active,
12240
+ textMetrics = "proportional"
12068
12241
  }) {
12069
12242
  if (!hasRenderedLabel(edge)) return null;
12070
12243
  const color = edgeColor(edge);
12071
- const bbox = computeLabelBBoxWorld(edge);
12244
+ const bbox = computeLabelBBoxWorld(edge, textMetrics);
12072
12245
  const boxW = bbox.w;
12073
12246
  const boxH = bbox.h;
12074
12247
  const boxLeftX = bbox.x - edge.labelX;
@@ -12084,6 +12257,8 @@ function CdlEdgeLabelView({
12084
12257
  "data-cdl-edge-label-for": edge.id,
12085
12258
  "data-cdl-edge-label-text": edge.label,
12086
12259
  "data-cdl-edge-sub-text": edge.sub ?? "",
12260
+ "data-cdl-tone": edge.tone,
12261
+ "data-cdl-edge-role": edge.role,
12087
12262
  children: [
12088
12263
  edge.labelPlate !== false && /* @__PURE__ */ jsx(
12089
12264
  "rect",
@@ -12137,9 +12312,10 @@ function CdlEdgeLabelView({
12137
12312
  function CdlEdgeEndLabelView({
12138
12313
  edge,
12139
12314
  active,
12140
- \u7AEF
12315
+ \u7AEF,
12316
+ textMetrics = "proportional"
12141
12317
  }) {
12142
- const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF);
12318
+ const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF, textMetrics);
12143
12319
  if (!\u7F6E\u304D\u5834\u6240) return null;
12144
12320
  const color = edgeColor(edge);
12145
12321
  return /* @__PURE__ */ jsx(
@@ -12148,6 +12324,8 @@ function CdlEdgeEndLabelView({
12148
12324
  "data-cdl-role": "edge-end-label",
12149
12325
  "data-cdl-edge-end-label-for": edge.id,
12150
12326
  "data-cdl-edge-end": \u7AEF,
12327
+ "data-cdl-tone": edge.tone,
12328
+ "data-cdl-edge-role": edge.role,
12151
12329
  x: \u7F6E\u304D\u5834\u6240.x,
12152
12330
  y: \u7F6E\u304D\u5834\u6240.y,
12153
12331
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
@@ -12392,12 +12570,18 @@ var SEQ_DOT = 7;
12392
12570
  var SEQ_SELF_W = 52;
12393
12571
  var SEQ_COL_MIN = 200;
12394
12572
  var g4 = (v) => Math.round(v / 4) * 4;
12395
- function sequenceBoardMetrics(data) {
12573
+ function sequenceBoardMetrics(data, textMetrics = "proportional") {
12396
12574
  const \u540D\u5E45 = data.actors.map(
12397
- (a) => Math.max(textWidth(a.name, SEQ_NAME), a.subtitle ? textWidth(a.subtitle, SEQ_SUB) : 0)
12575
+ (a) => Math.max(
12576
+ textWidth(a.name, SEQ_NAME, 0, textMetrics),
12577
+ a.subtitle ? textWidth(a.subtitle, SEQ_SUB, 0, textMetrics) : 0
12578
+ )
12398
12579
  );
12399
12580
  const colW = g4(Math.max(SEQ_COL_MIN, Math.max(0, ...\u540D\u5E45) + SEQ_COL_PAD));
12400
- const \u8A9E\u5E45 = Math.max(0, ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL)));
12581
+ const \u8A9E\u5E45 = Math.max(
12582
+ 0,
12583
+ ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL, 0, textMetrics))
12584
+ );
12401
12585
  const gutter = g4(SEQ_EDGE + SEQ_GUTTER_PAD + \u8A9E\u5E45 + SEQ_GUTTER_GAP);
12402
12586
  const headY = SEQ_EDGE + SEQ_HEAD;
12403
12587
  const rowY = (i) => headY + SEQ_ROW_PAD + i * SEQ_ROW;
@@ -12410,11 +12594,12 @@ function sequenceBoardMetrics(data) {
12410
12594
  }
12411
12595
  function SequenceBoardNode({
12412
12596
  node,
12413
- stateValues
12597
+ stateValues,
12598
+ textMetrics = "proportional"
12414
12599
  }) {
12415
12600
  const data = node.sequenceData;
12416
12601
  if (!data) return /* @__PURE__ */ jsx("g", { "data-cdl-role": "sequence-board" });
12417
- const m = sequenceBoardMetrics(data);
12602
+ const m = sequenceBoardMetrics(data, textMetrics);
12418
12603
  const x = node.cx - node.w / 2;
12419
12604
  const y = node.cy - node.h / 2;
12420
12605
  const \u73FE\u5728 = (() => {
@@ -13065,7 +13250,8 @@ function GenericNode({
13065
13250
  active,
13066
13251
  value,
13067
13252
  stateValues,
13068
- \u5024\u306E\u540D\u524D
13253
+ \u5024\u306E\u540D\u524D,
13254
+ textMetrics = "proportional"
13069
13255
  }) {
13070
13256
  const base = STYLES[node.kind] ?? FALLBACK;
13071
13257
  const toned = toneColor3(node.tone);
@@ -13204,7 +13390,7 @@ function GenericNode({
13204
13390
  const resolved = node.rows.map((row) => interpolate(row, stateValues, \u5024\u306E\u540D\u524D));
13205
13391
  const splits = resolved.map(splitRow);
13206
13392
  const leftMaxWidth = splits.reduce(
13207
- (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
13393
+ (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false, textMetrics)),
13208
13394
  0
13209
13395
  );
13210
13396
  const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
@@ -13688,8 +13874,8 @@ function \u5024\u3068\u5272\u5408\u306E\u6587\u5B57(\u5024, \u5272\u5408, \u5408
13688
13874
  return \u7D44.\u5024 === null ? \u7D44.\u5272\u5408 : `${\u7D44.\u5024} ${\u7D44.\u5272\u5408}`;
13689
13875
  }
13690
13876
  var \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
13691
- function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587) {
13692
- 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);
13877
+ function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587, textMetrics = "proportional") {
13878
+ 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);
13693
13879
  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);
13694
13880
  }
13695
13881
  function ChartPieNode({
@@ -13697,7 +13883,8 @@ function ChartPieNode({
13697
13883
  active,
13698
13884
  stateValues = {},
13699
13885
  drawing = false,
13700
- progress = 1
13886
+ progress = 1,
13887
+ textMetrics = "proportional"
13701
13888
  }) {
13702
13889
  const instanceId = useId().replace(/[^A-Za-z0-9_-]/g, "");
13703
13890
  const x0 = node.cx - node.w / 2;
@@ -13728,15 +13915,26 @@ function ChartPieNode({
13728
13915
  return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
13729
13916
  });
13730
13917
  if (\u5F62 !== "ring") {
13731
- const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
13918
+ const \u5171\u901A = {
13919
+ node,
13920
+ active,
13921
+ data,
13922
+ \u5272\u5408: \u4ECA\u306E\u5272\u5408,
13923
+ x0,
13924
+ y0,
13925
+ drawing,
13926
+ progress,
13927
+ instanceId,
13928
+ textMetrics
13929
+ };
13732
13930
  return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
13733
13931
  }
13734
13932
  const \u540D\u672D\u5E45 = Math.max(
13735
13933
  0,
13736
13934
  ...data.map(
13737
13935
  (_d, i) => Math.max(
13738
- textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
13739
- textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
13936
+ textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A, 0, textMetrics),
13937
+ textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics)
13740
13938
  )
13741
13939
  )
13742
13940
  );
@@ -13751,8 +13949,8 @@ function ChartPieNode({
13751
13949
  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) : [];
13752
13950
  const \u7A74 = \u524D\u3042\u308A ? \u524D\u306E\u5185\u534A\u5F84 : \u5916\u306E\u5185\u534A\u5F84;
13753
13951
  const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total));
13754
- const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587);
13755
- const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08");
13952
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587, textMetrics);
13953
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08", textMetrics);
13756
13954
  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);
13757
13955
  const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
13758
13956
  const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
@@ -13935,14 +14133,24 @@ function \u67A0(node, active) {
13935
14133
  }
13936
14134
  );
13937
14135
  }
13938
- function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
14136
+ function \u5F27\u306E\u5F62({
14137
+ node,
14138
+ active,
14139
+ data,
14140
+ \u5272\u5408,
14141
+ x0,
14142
+ y0,
14143
+ drawing,
14144
+ progress,
14145
+ textMetrics
14146
+ }) {
13939
14147
  const PAD = 20;
13940
14148
  const \u540D\u524D\u306E\u7D1A = 14;
13941
14149
  const \u5272\u5408\u306E\u7D1A = 24;
13942
14150
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
13943
14151
  const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
13944
14152
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
13945
- 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)));
14153
+ 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)));
13946
14154
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
13947
14155
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
13948
14156
  const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
@@ -14028,7 +14236,18 @@ function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14028
14236
  })
14029
14237
  ] });
14030
14238
  }
14031
- function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
14239
+ function \u8868\u306E\u5F62({
14240
+ node,
14241
+ active,
14242
+ data,
14243
+ \u5272\u5408,
14244
+ x0,
14245
+ y0,
14246
+ drawing,
14247
+ progress,
14248
+ instanceId,
14249
+ textMetrics
14250
+ }) {
14032
14251
  const PAD = 20;
14033
14252
  const \u898B\u51FA\u3057\u306E\u7D1A = 11;
14034
14253
  const \u540D\u524D\u306E\u7D1A = 15;
@@ -14037,9 +14256,18 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14037
14256
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
14038
14257
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
14039
14258
  const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
14040
- const \u540D\u524D\u5E45 = Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A)));
14041
- const \u5272\u5408\u5E45 = Math.max(textWidth("\u5272\u5408", \u898B\u51FA\u3057\u306E\u7D1A), ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A)));
14042
- const \u5B9F\u6570\u5E45 = Math.max(textWidth("\u5024", \u898B\u51FA\u3057\u306E\u7D1A), ...\u5B9F\u6570\u306E\u6587\u5B57.map((t) => textWidth(t, \u5B9F\u6570\u306E\u7D1A)));
14259
+ const \u540D\u524D\u5E45 = Math.max(
14260
+ 0,
14261
+ ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics))
14262
+ );
14263
+ const \u5272\u5408\u5E45 = Math.max(
14264
+ textWidth("\u5272\u5408", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
14265
+ ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A, 0, textMetrics))
14266
+ );
14267
+ const \u5B9F\u6570\u5E45 = Math.max(
14268
+ textWidth("\u5024", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
14269
+ ...\u5B9F\u6570\u306E\u6587\u5B57.map((t) => textWidth(t, \u5B9F\u6570\u306E\u7D1A, 0, textMetrics))
14270
+ );
14043
14271
  const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
14044
14272
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
14045
14273
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
@@ -14048,8 +14276,8 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14048
14276
  const cx = PAD + R;
14049
14277
  const cy = node.h / 2;
14050
14278
  const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)));
14051
- const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587);
14052
- const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08");
14279
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587, textMetrics);
14280
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08", textMetrics);
14053
14281
  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);
14054
14282
  const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
14055
14283
  const \u53F3\u7AEF = node.w - PAD;
@@ -14180,7 +14408,8 @@ function ChartGaugeNode({
14180
14408
  active,
14181
14409
  stateValues = {},
14182
14410
  drawing = false,
14183
- progress = 1
14411
+ progress = 1,
14412
+ textMetrics = "proportional"
14184
14413
  }) {
14185
14414
  const x0 = node.cx - node.w / 2;
14186
14415
  const y0 = node.cy - node.h / 2;
@@ -14199,7 +14428,10 @@ function ChartGaugeNode({
14199
14428
  const \u533A\u753B\u306E\u9593 = 12;
14200
14429
  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);
14201
14430
  const \u5272\u308A\u4ED8\u3051\u308B = (\u4EF6\u305F\u3061) => {
14202
- const \u5E45 = Math.max(\u5370\u306E\u5E452, ...\u4EF6\u305F\u3061.map((d) => textWidth(\u6570\u5024\u306E\u884C(d), \u6570\u5024\u306E\u7D1A))) + \u533A\u753B\u306E\u9593;
14431
+ const \u5E45 = Math.max(
14432
+ \u5370\u306E\u5E452,
14433
+ ...\u4EF6\u305F\u3061.map((d) => textWidth(\u6570\u5024\u306E\u884C(d), \u6570\u5024\u306E\u7D1A, 0, textMetrics))
14434
+ ) + \u533A\u753B\u306E\u9593;
14203
14435
  const \u884C\u306E\u4EF6\u65702 = Math.min(
14204
14436
  Math.max(1, Math.floor(\u4F7F\u3048\u308B\u5E452 / Math.max(\u5E45, 1))),
14205
14437
  Math.max(\u4EF6\u305F\u3061.length, 1)
@@ -14274,7 +14506,7 @@ function ChartGaugeNode({
14274
14506
  return { d, frac, path: \u6247\u306E\u9053(a0, a1, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5916\u534A\u5F84) };
14275
14507
  });
14276
14508
  const \u5408\u8A08\u306E\u6587\u5B57 = \u5B9F\u5024\u8868\u8A18(Math.round(total));
14277
- const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100), 1) / 100;
14509
+ const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100, 0, textMetrics), 1) / 100;
14278
14510
  const \u7D1A\u306E\u5019\u88DC = Math.min(
14279
14511
  // 横 = 字の上の角が内側の円に入る大きさ
14280
14512
  \u5185\u534A\u5F84 / Math.sqrt((\u5358\u4F4D\u5E45 / 2) ** 2 + 1.25 ** 2),
@@ -14367,7 +14599,7 @@ function ChartGaugeNode({
14367
14599
  const y = \u5185\u8A33\u306Ey + \u6BB5\u306E\u9AD8\u3055 * \u6BB5;
14368
14600
  const \u53CE\u307E\u308B\u5E45 = \u5185\u8A33\u306E\u5E45 - \u533A\u753B\u306E\u9593;
14369
14601
  const \u6570\u306E\u884C = \u5185\u8A33\u306E\u6570\u5024[idx] ?? "";
14370
- const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A);
14602
+ const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A, textMetrics);
14371
14603
  return /* @__PURE__ */ jsxs("g", { "data-cdl-role": "chart-gauge-item", children: [
14372
14604
  /* @__PURE__ */ jsx(
14373
14605
  "rect",
@@ -14388,7 +14620,7 @@ function ChartGaugeNode({
14388
14620
  fontSize: \u540D\u524D\u306E\u7D1A,
14389
14621
  fontWeight: 700,
14390
14622
  fill: "var(--cdl-text, #1a1f2a)",
14391
- children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A)
14623
+ children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A, textMetrics)
14392
14624
  }
14393
14625
  ),
14394
14626
  /* @__PURE__ */ 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__ */ jsx(
@@ -14406,12 +14638,12 @@ function ChartGaugeNode({
14406
14638
  function \u6975(cx, cy, r, a) {
14407
14639
  return { x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) };
14408
14640
  }
14409
- function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A) {
14410
- if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A) <= \u4E0A\u9650) return s;
14411
- const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A);
14641
+ function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A, textMetrics = "proportional") {
14642
+ if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A, 0, textMetrics) <= \u4E0A\u9650) return s;
14643
+ const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A, 0, textMetrics);
14412
14644
  let out = "";
14413
14645
  for (const c of s) {
14414
- if (textWidth(out + c, \u7D1A) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
14646
+ if (textWidth(out + c, \u7D1A, 0, textMetrics) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
14415
14647
  out += c;
14416
14648
  }
14417
14649
  return `${out}\u2026`;
@@ -14425,7 +14657,8 @@ function ChartRadialNode({
14425
14657
  active,
14426
14658
  stateValues = {},
14427
14659
  drawing = false,
14428
- progress = 1
14660
+ progress = 1,
14661
+ textMetrics = "proportional"
14429
14662
  }) {
14430
14663
  const x0 = node.cx - node.w / 2;
14431
14664
  const y0 = node.cy - node.h / 2;
@@ -14443,7 +14676,10 @@ function ChartRadialNode({
14443
14676
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E45 + Math.max(
14444
14677
  0,
14445
14678
  ...data.map(
14446
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
14679
+ (d, i) => Math.max(
14680
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
14681
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
14682
+ )
14447
14683
  )
14448
14684
  );
14449
14685
  const \u5F27\u306B\u4F7F\u3048\u308B\u5E45 = node.w - PAD * 2 - \u4E00\u89A7\u306E\u5E45 - \u4E00\u89A7\u3068\u5F27\u306E\u9593;
@@ -14590,7 +14826,8 @@ function arcColor2(tone, idx) {
14590
14826
  function ChartStatNode({
14591
14827
  node,
14592
14828
  active,
14593
- stateValues = {}
14829
+ stateValues = {},
14830
+ textMetrics = "proportional"
14594
14831
  }) {
14595
14832
  const x0 = node.cx - node.w / 2;
14596
14833
  const y0 = node.cy - node.h / 2;
@@ -14619,7 +14856,13 @@ function ChartStatNode({
14619
14856
  const frac = total > 0 ? d.value / total : 0;
14620
14857
  const \u8272 = \u5370\u306E\u8272(d.tone, idx);
14621
14858
  const \u6570\u5024 = \u5B9F\u5024\u8868\u8A18(d.value);
14622
- const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(\u6570\u5024, \u67A02.w - \u533A\u753B.\u4F59\u767D * 2, \u533A\u753B.\u6570\u5024\u306E\u7D1A, \u533A\u753B.\u540D\u524D\u306E\u7D1A + 1);
14859
+ const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(
14860
+ \u6570\u5024,
14861
+ \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
14862
+ \u533A\u753B.\u6570\u5024\u306E\u7D1A,
14863
+ \u533A\u753B.\u540D\u524D\u306E\u7D1A + 1,
14864
+ textMetrics
14865
+ );
14623
14866
  return /* @__PURE__ */ jsxs(
14624
14867
  "g",
14625
14868
  {
@@ -14676,7 +14919,8 @@ function ChartStatNode({
14676
14919
  `\u524D ${\u5B9F\u5024\u8868\u8A18(d.previous)}`,
14677
14920
  \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
14678
14921
  \u533A\u753B.\u524D\u306E\u7D1A,
14679
- 8
14922
+ 8,
14923
+ textMetrics
14680
14924
  ),
14681
14925
  textAnchor: "middle",
14682
14926
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -14765,9 +15009,9 @@ function \u533A\u753B\u306E\u5272\u4ED8(w, h, \u4EF6\u6570, \u524D\u3092\u51FA\u
14765
15009
  \u67A0: (idx) => ({ x: \u5E45 * idx, y: 0, w: \u5E45, h })
14766
15010
  };
14767
15011
  }
14768
- function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650) {
15012
+ function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650, textMetrics = "proportional") {
14769
15013
  let \u7D1A = \u521D\u671F;
14770
- while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
15014
+ while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A, 0, textMetrics) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
14771
15015
  return \u7D1A;
14772
15016
  }
14773
15017
  function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
@@ -14802,7 +15046,8 @@ function ChartWaffleNode({
14802
15046
  active,
14803
15047
  stateValues = {},
14804
15048
  drawing = false,
14805
- progress = 1
15049
+ progress = 1,
15050
+ textMetrics = "proportional"
14806
15051
  }) {
14807
15052
  const x0 = node.cx - node.w / 2;
14808
15053
  const y0 = node.cy - node.h / 2;
@@ -14821,7 +15066,10 @@ function ChartWaffleNode({
14821
15066
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E452 + Math.max(
14822
15067
  0,
14823
15068
  ...data.map(
14824
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
15069
+ (d, i) => Math.max(
15070
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
15071
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
15072
+ )
14825
15073
  )
14826
15074
  );
14827
15075
  const \u4F7F\u3048\u308B\u9AD8\u3055 = node.h - PAD * 2;
@@ -14923,7 +15171,8 @@ function ChartStackedBarNode({
14923
15171
  active,
14924
15172
  stateValues = {},
14925
15173
  drawing = false,
14926
- progress = 1
15174
+ progress = 1,
15175
+ textMetrics = "proportional"
14927
15176
  }) {
14928
15177
  const x0 = node.cx - node.w / 2;
14929
15178
  const y0 = node.cy - node.h / 2;
@@ -14933,7 +15182,7 @@ function ChartStackedBarNode({
14933
15182
  const \u540D\u524D\u306E\u7D1A = 13;
14934
15183
  const \u533A\u753B\u306E\u7D1A = 12;
14935
15184
  const \u6642\u70B9\u306E\u7D1A = 13;
14936
- 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);
15185
+ 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);
14937
15186
  const \u5E2F\u306E\u5DE6 = PAD + \u6642\u70B9\u306E\u5E45;
14938
15187
  const \u5E2F\u306E\u5E45 = Math.max(40, node.w - \u5E2F\u306E\u5DE6 - PAD);
14939
15188
  const \u5E2F\u306E\u9AD8\u3055 = 44;
@@ -15026,7 +15275,7 @@ function ChartStackedBarNode({
15026
15275
  })()
15027
15276
  ] }, `bar-${\u6BB5}`);
15028
15277
  }),
15029
- \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A).map(({ d, idx, x, \u884C }) => {
15278
+ \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A, textMetrics).map(({ d, idx, x, \u884C }) => {
15030
15279
  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;
15031
15280
  return /* @__PURE__ */ jsxs("g", { "data-cdl-role": "chart-stacked-bar-legend", children: [
15032
15281
  /* @__PURE__ */ jsx("rect", { x, y: y - 5, width: 10, height: 10, rx: 2, fill: \u5370\u306E\u82723(d.tone, idx) }),
@@ -15061,12 +15310,12 @@ function \u5370\u306E\u82723(tone, idx) {
15061
15310
  }
15062
15311
  var \u5370\u304B\u3089\u540D\u524D\u307E\u3067 = 16;
15063
15312
  var \u4EF6\u306E\u9593 = 10;
15064
- function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A) {
15313
+ function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A, textMetrics = "proportional") {
15065
15314
  const out = [];
15066
15315
  let x = \u5DE6;
15067
15316
  let \u884C = 0;
15068
15317
  data.forEach((d, idx) => {
15069
- const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A);
15318
+ const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A, 0, textMetrics);
15070
15319
  if (x > \u5DE6 && x + \u5E45 > \u53F3\u7AEF) {
15071
15320
  \u884C += 1;
15072
15321
  x = \u5DE6;
@@ -15082,7 +15331,8 @@ function ChartSlopeNode({
15082
15331
  active,
15083
15332
  stateValues = {},
15084
15333
  drawing = false,
15085
- progress = 1
15334
+ progress = 1,
15335
+ textMetrics = "proportional"
15086
15336
  }) {
15087
15337
  const x0 = node.cx - node.w / 2;
15088
15338
  const y0 = node.cy - node.h / 2;
@@ -15125,16 +15375,22 @@ function ChartSlopeNode({
15125
15375
  const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
15126
15376
  (s) => \u5F62 === "delta" ? \u5897\u6E1B\u8868\u8A18(s.\u524D, s.\u4ECA) : \u5B9F\u5024\u8868\u8A18(s.\u4ECA)
15127
15377
  );
15128
- const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
15129
- const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
15378
+ const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
15379
+ const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
15130
15380
  const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
15131
15381
  0,
15132
15382
  (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
15133
15383
  );
15134
- const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(\u7CFB\u5217\u305F\u3061.map((s) => s.\u540D\u524D), \u540D\u524D\u306B\u4F7F\u3048\u308B, \u540D\u524D\u306E\u4E0A\u9650\u7D1A, \u540D\u524D\u306E\u4E0B\u9650\u7D1A);
15384
+ const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(
15385
+ \u7CFB\u5217\u305F\u3061.map((s) => s.\u540D\u524D),
15386
+ \u540D\u524D\u306B\u4F7F\u3048\u308B,
15387
+ \u540D\u524D\u306E\u4E0A\u9650\u7D1A,
15388
+ \u540D\u524D\u306E\u4E0B\u9650\u7D1A,
15389
+ textMetrics
15390
+ );
15135
15391
  const \u540D\u524D\u5E45 = Math.min(
15136
15392
  \u540D\u524D\u306B\u4F7F\u3048\u308B,
15137
- Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A)))
15393
+ Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A, 0, textMetrics)))
15138
15394
  );
15139
15395
  const \u5DE6\u306E\u4F59\u767D = \u540D\u524D\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067;
15140
15396
  const \u53F3\u306E\u4F59\u767D = \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u540D\u524D\u5E45;
@@ -15320,10 +15576,12 @@ function \u5370\u306E\u82724(tone, idx) {
15320
15576
  if (tone) return TONE[tone];
15321
15577
  return chartSeriesColor(idx);
15322
15578
  }
15323
- function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650) {
15579
+ function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650, textMetrics = "proportional") {
15324
15580
  if (\u540D\u524D\u305F\u3061.length === 0) return \u4E0A\u9650;
15325
15581
  let \u7D1A = \u4E0A\u9650;
15326
- while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A))) > \u5E45) \u7D1A -= 1;
15582
+ while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A, 0, textMetrics))) > \u5E45) {
15583
+ \u7D1A -= 1;
15584
+ }
15327
15585
  return \u7D1A;
15328
15586
  }
15329
15587
  function \u5C0F\u6570\u306E\u6841(n) {
@@ -15371,6 +15629,7 @@ function ChartBarNode({
15371
15629
  return { y: yAt(v), value: v };
15372
15630
  });
15373
15631
  const \u6FC3\u3055 = (v) => vMax > 0 ? v >= vMax ? 1 : 0.45 : 0.9;
15632
+ const \u4E3B\u5F79\u306E\u68D2\u304B = (v) => vMax > 0 && v >= vMax;
15374
15633
  const \u89D2\u4E38 = Math.min(barW * 0.06, 8);
15375
15634
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
15376
15635
  const \u6A2A\u8EF8\u306Ey = PAD_TOP2 + canvasH;
@@ -15437,6 +15696,7 @@ function ChartBarNode({
15437
15696
  {
15438
15697
  "data-cdl-role": "chart-bar",
15439
15698
  "data-cdl-unresolved": d.unresolved ? "true" : void 0,
15699
+ "data-cdl-emphasis": \u4E3B\u5F79\u306E\u68D2\u304B(d.value) ? "primary" : void 0,
15440
15700
  x: bx,
15441
15701
  y: by,
15442
15702
  width: barW,
@@ -15783,7 +16043,8 @@ function FunnelNode({
15783
16043
  active,
15784
16044
  stateValues = {},
15785
16045
  drawing = false,
15786
- progress = 1
16046
+ progress = 1,
16047
+ textMetrics = "proportional"
15787
16048
  }) {
15788
16049
  const x0 = node.cx - node.w / 2;
15789
16050
  const y0 = node.cy - node.h / 2;
@@ -15832,7 +16093,11 @@ function FunnelNode({
15832
16093
  const \u540D\u524D\u306E\u5B9F\u5B57 = \u540D\u524D\u306E\u5B57 * \u7E26\u500D;
15833
16094
  const \u88DC\u8DB3\u306E\u67A0\u5B57 = \u88DC\u8DB3\u306E\u5B57 * \u7E26\u500D;
15834
16095
  const \u53CE\u307E\u308B\u5E45 = Math.max(0, bottomW - 16);
15835
- const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(\u88DC\u8DB3, { fontSize: \u88DC\u8DB3\u306E\u67A0\u5B57, fontWeight: 500 }, \u53CE\u307E\u308B\u5E45);
16096
+ const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(
16097
+ \u88DC\u8DB3,
16098
+ { fontSize: \u88DC\u8DB3\u306E\u67A0\u5B57, fontWeight: 500, textMetrics },
16099
+ \u53CE\u307E\u308B\u5E45
16100
+ );
15836
16101
  const \u584A\u306E\u4E0A = y + stageH / 2 - (\u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 1.25) / 2;
15837
16102
  const \u540D\u524D\u306Ey = \u88DC\u8DB3\u3042\u308A ? \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 0.95 : y + stageH / 2 + 5;
15838
16103
  const \u88DC\u8DB3\u306Ey = \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 0.95;
@@ -15935,7 +16200,8 @@ function \u7573\u3093\u3060\u6587(\u4EF6\u6570) {
15935
16200
  function QuadrantNode({
15936
16201
  node,
15937
16202
  active,
15938
- stateValues = {}
16203
+ stateValues = {},
16204
+ textMetrics = "proportional"
15939
16205
  }) {
15940
16206
  const x0 = node.cx - node.w / 2;
15941
16207
  const y0 = node.cy - node.h / 2;
@@ -15954,7 +16220,10 @@ function QuadrantNode({
15954
16220
  const SUB_FONT = 10;
15955
16221
  const axisLabelPad = (text) => Math.max(
15956
16222
  PAD_MIN,
15957
- measureTextWidth(`\u2190 ${text}`, { fontSize: AXIS_LABEL_FONT}) + 12
16223
+ measureTextWidth(`\u2190 ${text}`, {
16224
+ fontSize: AXIS_LABEL_FONT,
16225
+ textMetrics
16226
+ }) + 12
15958
16227
  );
15959
16228
  const padBudget = Math.max(0, node.w * 0.5 - PAD_MIN * 2);
15960
16229
  const wantLeft = axisLabelPad(data.xAxis.left) - PAD_MIN;
@@ -16208,7 +16477,11 @@ function QuadrantNode({
16208
16477
  ITEM_MIN_W,
16209
16478
  Math.max(
16210
16479
  ...\u884C\u30892.map(
16211
- (r) => measureTextWidth(r.text, { fontSize: r.size, fontWeight: r.weight })
16480
+ (r) => measureTextWidth(r.text, {
16481
+ fontSize: r.size,
16482
+ fontWeight: r.weight,
16483
+ textMetrics
16484
+ })
16212
16485
  )
16213
16486
  ) + ITEM_PAD_X * 2
16214
16487
  )
@@ -16234,7 +16507,7 @@ function QuadrantNode({
16234
16507
  const \u88DC\u8DB3 = (it.subtitle ?? "").trim();
16235
16508
  const \u88DC\u8DB3\u306E\u5B57 = SUB_FONT * \u53CE\u3081\u308B\u500D\u7387(
16236
16509
  \u88DC\u8DB3,
16237
- { fontSize: SUB_FONT, fontWeight: 500 },
16510
+ { fontSize: SUB_FONT, fontWeight: 500, textMetrics },
16238
16511
  Math.max(0, \u5E45 - ITEM_PAD_X * 2)
16239
16512
  );
16240
16513
  return /* @__PURE__ */ jsxs("g", { children: [
@@ -16638,24 +16911,30 @@ var EYEBROW_GAP2 = 8;
16638
16911
  var EYEBROW_TRACKING = 2;
16639
16912
  var SUB_SIZE = 11;
16640
16913
  var SUB_GAP = 4;
16641
- function labelBlock(node, pos, size, band) {
16914
+ function labelBlock(node, pos, size, band, textMetrics = "proportional") {
16642
16915
  const \u4E0A = node.eyebrow ? size + EYEBROW_GAP2 + EYEBROW_SIZE2 * ASCENT2 : size * ASCENT2;
16643
16916
  const \u4E0B = node.subtitle ? size + SUB_GAP + SUB_SIZE * DESCENT2 : size * DESCENT2;
16644
16917
  const \u5E45 = Math.max(
16645
- textWidth(node.title ?? "", size),
16646
- node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING) : 0,
16647
- node.subtitle ? textWidth(node.subtitle, SUB_SIZE) : 0
16918
+ textWidth(node.title ?? "", size, 0, textMetrics),
16919
+ node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING, textMetrics) : 0,
16920
+ node.subtitle ? textWidth(node.subtitle, SUB_SIZE, 0, textMetrics) : 0
16648
16921
  );
16649
- const \u984C\u5E45 = textWidth(node.title ?? "", size);
16650
- const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, textWidth) : 0;
16922
+ const \u984C\u5E45 = textWidth(node.title ?? "", size, 0, textMetrics);
16923
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
16924
+ const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, \u6E2C\u308B) : 0;
16651
16925
  const { k, x, y: baseline } = fitLabel(band, { \u4E0A, \u4E0B, \u5E45 }, pos, \u4E0B\u9650);
16652
16926
  return { k, x, baseline, \u4E0A\u7AEF: baseline - \u4E0A * k, \u4E0B\u7AEF: baseline + \u4E0B * k };
16653
16927
  }
16654
- function commonLabel(node, pos, size, band) {
16655
- const \u584A = labelBlock(node, pos, size, band);
16928
+ function commonLabel(node, pos, size, band, textMetrics = "proportional") {
16929
+ const \u584A = labelBlock(node, pos, size, band, textMetrics);
16656
16930
  const k = \u584A.k;
16657
16931
  const x = \u584A.x;
16658
- const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(t, \u5927\u304D\u3055 * k, band.w, (u, f) => textWidth(u, f, \u5B57\u9593 * k));
16932
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
16933
+ t,
16934
+ \u5927\u304D\u3055 * k,
16935
+ band.w,
16936
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
16937
+ );
16659
16938
  return /* @__PURE__ */ jsxs(Fragment, { children: [
16660
16939
  node.eyebrow && /* @__PURE__ */ jsx(
16661
16940
  "text",
@@ -16706,7 +16985,7 @@ var RULE_GAP_RATIO = 0.1;
16706
16985
  var RULE_PAD_MAX = 20;
16707
16986
  var RULE_PAD_RATIO = 0.14;
16708
16987
  var RULE_SHRINK_RATIO = 0.055;
16709
- function ShapeFileNode({ node, active }) {
16988
+ function ShapeFileNode({ node, active, textMetrics = "proportional" }) {
16710
16989
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16711
16990
  const \u7D19h = \u5E2F.h;
16712
16991
  const \u7D19w = Math.min(\u5E2F.w, \u7D19h * 0.72);
@@ -16726,7 +17005,7 @@ function ShapeFileNode({ node, active }) {
16726
17005
  const foldTriangle = `M ${x + \u7D19w - fold} ${y} L ${x + \u7D19w} ${y + fold} L ${x + \u7D19w - fold} ${y + fold} Z`;
16727
17006
  const \u540D\u524D\u5E2F = { x, y, w: \u7D19w, h: \u7D19h };
16728
17007
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + node.h * 0.12 };
16729
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F);
17008
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics);
16730
17009
  const \u9593\u9694 = Math.min(RULE_GAP_MAX, \u7D19h * RULE_GAP_RATIO);
16731
17010
  const \u7DDA\u4F59\u767D = Math.min(RULE_PAD_MAX, \u7D19w * RULE_PAD_RATIO);
16732
17011
  const textLines = [0, 1, 2].map((i) => ({ i, ly: y + fold + \u9593\u9694 * (i + 1) })).filter(({ ly }) => ly < \u540D\u524D.\u4E0A\u7AEF);
@@ -16758,12 +17037,12 @@ function ShapeFileNode({ node, active }) {
16758
17037
  i
16759
17038
  );
16760
17039
  }),
16761
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F)
17040
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics)
16762
17041
  ] });
16763
17042
  }
16764
17043
  var TAB_H_MAX = 22;
16765
17044
  var TAB_H_RATIO = 0.3;
16766
- function ShapeFolderNode({ node, active }) {
17045
+ function ShapeFolderNode({ node, active, textMetrics = "proportional" }) {
16767
17046
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16768
17047
  const x = \u5E2F.x;
16769
17048
  const y = \u5E2F.y;
@@ -16784,7 +17063,7 @@ function ShapeFolderNode({ node, active }) {
16784
17063
  const \u5883\u754Cy = y + tabH + Math.min(8, (\u5E2F.h - tabH) * 0.2);
16785
17064
  const \u7AEF = Math.min(6, \u5E2F.w * 0.1);
16786
17065
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 18 };
16787
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F);
17066
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics);
16788
17067
  return /* @__PURE__ */ jsxs("g", { children: [
16789
17068
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, \u5E2F.w * 0.44),
16790
17069
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -16800,13 +17079,13 @@ function ShapeFolderNode({ node, active }) {
16800
17079
  opacity: 0.35
16801
17080
  }
16802
17081
  ),
16803
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F)
17082
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics)
16804
17083
  ] });
16805
17084
  }
16806
17085
  var CLOUD_VB_W = 640;
16807
17086
  var CLOUD_VB_H = 512;
16808
17087
  var CLOUD_W_RATIO = 0.9;
16809
- function ShapeCloudNode({ node, active }) {
17088
+ function ShapeCloudNode({ node, active, textMetrics = "proportional" }) {
16810
17089
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16811
17090
  const frame = commonFrame(active);
16812
17091
  const \u7D20\u306E\u500D\u7387 = Math.min(\u5E2F.h / CLOUD_VB_H, \u5E2F.w * CLOUD_W_RATIO / CLOUD_VB_W);
@@ -16829,13 +17108,13 @@ function ShapeCloudNode({ node, active }) {
16829
17108
  strokeLinejoin: "round"
16830
17109
  }
16831
17110
  ) }),
16832
- commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F)
17111
+ commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F, textMetrics)
16833
17112
  ] });
16834
17113
  }
16835
17114
  var CYLINDER_RY_MAX = 18;
16836
17115
  var CYLINDER_RY_RATIO = 0.1;
16837
17116
  var CYLINDER_DISKS = [0.3, 0.55, 0.8];
16838
- function ShapeCylinderNode({ node, active }) {
17117
+ function ShapeCylinderNode({ node, active, textMetrics = "proportional" }) {
16839
17118
  const \u5E2F = bodyBand(node, { \u5F71ry: CYLINDER_SHADOW_RY });
16840
17119
  const x = \u5E2F.x;
16841
17120
  const y = \u5E2F.y;
@@ -16852,7 +17131,7 @@ function ShapeCylinderNode({ node, active }) {
16852
17131
  const \u84CB\u5E95 = y + ry * 2;
16853
17132
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 6 };
16854
17133
  const \u540D\u524D\u5E2F = { x: \u5E2F.x, y: \u84CB\u5E95, w: \u5E2F.w, h: Math.max(0, \u5E2F.\u5E95 - \u84CB\u5E95) };
16855
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F);
17134
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics);
16856
17135
  return /* @__PURE__ */ jsxs("g", { children: [
16857
17136
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, rx * 0.85, CYLINDER_SHADOW_RY),
16858
17137
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -16876,11 +17155,11 @@ function ShapeCylinderNode({ node, active }) {
16876
17155
  },
16877
17156
  i
16878
17157
  )),
16879
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F)
17158
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics)
16880
17159
  ] });
16881
17160
  }
16882
17161
  var HEX_DOT_R = 2.5;
16883
- function ShapeHexagonNode({ node, active }) {
17162
+ function ShapeHexagonNode({ node, active, textMetrics = "proportional" }) {
16884
17163
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY, \u5916: Math.max(HEX_DOT_R, FRAME_HALF) });
16885
17164
  const cx = \u5E2F.cx;
16886
17165
  const cy = \u5E2F.cy;
@@ -16903,11 +17182,12 @@ function ShapeHexagonNode({ node, active }) {
16903
17182
  node,
16904
17183
  { x: cx, y: node.cy + 6 },
16905
17184
  16,
16906
- { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h }
17185
+ { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h },
17186
+ textMetrics
16907
17187
  )
16908
17188
  ] });
16909
17189
  }
16910
- function ShapeDiamondNode({ node, active }) {
17190
+ function ShapeDiamondNode({ node, active, textMetrics = "proportional" }) {
16911
17191
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16912
17192
  const cx = \u5E2F.cx;
16913
17193
  const cy = \u5E2F.cy;
@@ -16948,13 +17228,14 @@ function ShapeDiamondNode({ node, active }) {
16948
17228
  y: cy - \u5E2F.h * innerScale / 4,
16949
17229
  w: \u5E2F.w * innerScale / 2,
16950
17230
  h: \u5E2F.h * innerScale / 2
16951
- }
17231
+ },
17232
+ textMetrics
16952
17233
  )
16953
17234
  ] });
16954
17235
  }
16955
17236
  var STACK_OFFSET_MAX = 12;
16956
17237
  var STACK_OFFSET_RATIO = 0.15;
16957
- function ShapeStackNode({ node, active }) {
17238
+ function ShapeStackNode({ node, active, textMetrics = "proportional" }) {
16958
17239
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16959
17240
  const x = \u5E2F.x;
16960
17241
  const y = \u5E2F.y;
@@ -17008,7 +17289,8 @@ function ShapeStackNode({ node, active }) {
17008
17289
  node,
17009
17290
  { x: \u624B\u524Dcx, y: node.cy + \u305A\u308C + 6 },
17010
17291
  15,
17011
- { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH }
17292
+ { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH },
17293
+ textMetrics
17012
17294
  )
17013
17295
  ] });
17014
17296
  }
@@ -17020,16 +17302,22 @@ var PERSON_BODY_LEN = 90;
17020
17302
  var PERSON_SHADOW_DY = 20;
17021
17303
  var PERSON_SHADOW_RY = 4;
17022
17304
  var PERSON_SHADOW_RX = 55;
17023
- function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
17305
+ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan, textMetrics = "proportional") {
17024
17306
  const \u5E45 = Math.max(
17025
- textWidth(node.title ?? "", plan.\u540D\u524D.size),
17026
- node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING) : 0,
17027
- node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size) : 0
17307
+ textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics),
17308
+ node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING, textMetrics) : 0,
17309
+ node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size, 0, textMetrics) : 0
17028
17310
  );
17029
- const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size);
17030
- const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", plan.\u540D\u524D.size, 0, \u5E45\u4E0A\u9650, textWidth) : 0;
17311
+ const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics);
17312
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
17313
+ 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;
17031
17314
  const k = \u5E45 > 0 && \u5E45\u4E0A\u9650 > 0 ? Math.min(1, Math.max(\u5E45\u4E0A\u9650 / \u5E45, \u4E0B\u9650)) : 1;
17032
- const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(t, \u5927\u304D\u3055 * k, \u5E45\u4E0A\u9650, (u, f) => textWidth(u, f, \u5B57\u9593 * k));
17315
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
17316
+ t,
17317
+ \u5927\u304D\u3055 * k,
17318
+ \u5E45\u4E0A\u9650,
17319
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
17320
+ );
17033
17321
  return /* @__PURE__ */ jsxs(Fragment, { children: [
17034
17322
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsx(
17035
17323
  "text",
@@ -17070,7 +17358,7 @@ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
17070
17358
  )
17071
17359
  ] });
17072
17360
  }
17073
- function ShapePersonNode({ node, active }) {
17361
+ function ShapePersonNode({ node, active, textMetrics = "proportional" }) {
17074
17362
  const r = shapeRegion(node);
17075
17363
  const cx = r.cx;
17076
17364
  const strokeColor = active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)";
@@ -17132,7 +17420,7 @@ function ShapePersonNode({ node, active }) {
17132
17420
  )
17133
17421
  ] })
17134
17422
  ),
17135
- planLabel(node, r.cx, Math.max(0, node.w), r.label)
17423
+ planLabel(node, r.cx, Math.max(0, node.w), r.label, textMetrics)
17136
17424
  ] });
17137
17425
  }
17138
17426
  var commonFrame2 = (active) => ({
@@ -17382,7 +17670,12 @@ function ShapeTerminalNode({ node, active, lang }) {
17382
17670
  )
17383
17671
  ] });
17384
17672
  }
17385
- function ShapeCodeBlockNode({ node, active, lang }) {
17673
+ function ShapeCodeBlockNode({
17674
+ node,
17675
+ active,
17676
+ lang,
17677
+ textMetrics = "proportional"
17678
+ }) {
17386
17679
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
17387
17680
  const frame = commonFrame2(active);
17388
17681
  const \u7DDA = frame.strokeWidth / 2;
@@ -17393,7 +17686,10 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17393
17686
  const lineFont = "ui-monospace, SFMono-Regular, Menlo, monospace";
17394
17687
  const \u672D = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("codeBlock.fileName"));
17395
17688
  const \u672D\u306E\u5B57 = 11;
17396
- const \u30BF\u30D6\u5E45 = Math.min(Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0) + 24), Math.max(0, w));
17689
+ const \u30BF\u30D6\u5E45 = Math.min(
17690
+ Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0, textMetrics) + 24),
17691
+ Math.max(0, w)
17692
+ );
17397
17693
  const \u30BF\u30D6\u9AD8 = 24;
17398
17694
  const \u89D2 = 10;
17399
17695
  const \u6E9D = 32;
@@ -17433,7 +17729,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17433
17729
  { text: \u672D, size: \u672D\u306E\u5B57, \u5E2F: { \u5E45: \u30BF\u30D6\u5E45, \u9AD8\u3055: \u30BF\u30D6\u9AD8 } },
17434
17730
  { text: "1", size: \u884C\u756A\u53F7\u306E\u5B57, \u5E2F: { \u5E45: \u6E9D - \u6301\u3061\u4E0A\u3052, \u9AD8\u3055: \u884C\u9593 } }
17435
17731
  ];
17436
- const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089);
17732
+ const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
17437
17733
  const tabW = \u30BF\u30D6\u5E45 * \u500D;
17438
17734
  const tabH = \u30BF\u30D6\u9AD8 * \u500D;
17439
17735
  const \u4E38 = \u89D2 * \u500D;
@@ -17472,7 +17768,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17472
17768
  "data-cdl-counter-scaled": "1",
17473
17769
  x: x + tabW / 2,
17474
17770
  y: y + tabH / 2 + 4 * \u500D,
17475
- fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW),
17771
+ fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW, textMetrics),
17476
17772
  fontFamily: lineFont,
17477
17773
  textAnchor: "middle",
17478
17774
  fill: "#e6edf3",
@@ -17554,7 +17850,12 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17554
17850
  )
17555
17851
  ] });
17556
17852
  }
17557
- function ShapeKanbanCardNode({ node, active, lang }) {
17853
+ function ShapeKanbanCardNode({
17854
+ node,
17855
+ active,
17856
+ lang,
17857
+ textMetrics = "proportional"
17858
+ }) {
17558
17859
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
17559
17860
  const frame = commonFrame2(active);
17560
17861
  const \u7DDA = frame.strokeWidth / 2;
@@ -17608,7 +17909,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
17608
17909
  );
17609
17910
  const \u8AAC\u660E = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("kanbanCard.task"));
17610
17911
  const \u72B6\u614B = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.eyebrow, \u5B57\u5F15("kanbanCard.status"));
17611
- const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45);
17912
+ const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45, textMetrics);
17612
17913
  const \u8AAC\u660E\u306E\u5B57 = \u540D\u524D.size * \u8AAC\u660E\u5B57\u6BD4;
17613
17914
  const \u4F7F\u3048\u308B\u5E452 = Math.max(0, w - \u5DE6\u53F3\u4F59\u767D * \u500D * 2);
17614
17915
  return /* @__PURE__ */ jsxs("g", { children: [
@@ -17695,7 +17996,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
17695
17996
  {
17696
17997
  x: x + w / 2,
17697
17998
  y: \u540D\u524D.y + \u540D\u524D.size * \u8AAC\u660E\u57FA\u6E96\u6BD4,
17698
- fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452),
17999
+ fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452, textMetrics),
17699
18000
  textAnchor: "middle",
17700
18001
  fill: "var(--cdl-text-dim, #5a6270)",
17701
18002
  children: \u8AAC\u660E
@@ -17986,18 +18287,33 @@ var externalLabel = (node, cx, bottomY) => /* @__PURE__ */ jsxs(Fragment, { chil
17986
18287
  )
17987
18288
  ] });
17988
18289
  var LABEL_EYEBROW_SPACING = 2;
17989
- function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
17990
- const \u5E45 = textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
17991
- const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, textWidth) : 0;
18290
+ function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
18291
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
18292
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
18293
+ 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;
17992
18294
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
17993
18295
  const size = \u5927\u304D\u3055 * \u500D\u7387;
17994
18296
  const spacing = \u5B57\u9593 * \u500D\u7387;
17995
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => textWidth(u, f, spacing)) };
17996
- }
17997
- function bottomLabel(node, cx, plan) {
17998
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING, node.w);
17999
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
18000
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
18297
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
18298
+ }
18299
+ function bottomLabel(node, cx, plan, textMetrics = "proportional") {
18300
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(
18301
+ node.eyebrow ?? "",
18302
+ plan.\u80A9\u66F8?.size ?? 0,
18303
+ LABEL_EYEBROW_SPACING,
18304
+ node.w,
18305
+ false,
18306
+ textMetrics
18307
+ );
18308
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
18309
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(
18310
+ node.subtitle ?? "",
18311
+ plan.\u8AAC\u660E?.size ?? 0,
18312
+ 0,
18313
+ node.w,
18314
+ false,
18315
+ textMetrics
18316
+ );
18001
18317
  return /* @__PURE__ */ jsxs(Fragment, { children: [
18002
18318
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ 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 }),
18003
18319
  /* @__PURE__ */ 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 }),
@@ -18011,7 +18327,7 @@ var RACK_SLOT_N = 4;
18011
18327
  var RACK_BOTTOM = 8;
18012
18328
  var RACK_H = RACK_SLOT_TOP + RACK_SLOT_N * RACK_SLOT_H + (RACK_SLOT_N - 1) * RACK_SLOT_GAP + RACK_BOTTOM;
18013
18329
  var RACK_W_MIN = 120;
18014
- function ShapeServerRackNode({ node, active }) {
18330
+ function ShapeServerRackNode({ node, active, textMetrics = "proportional" }) {
18015
18331
  const r = shapeRegion(node);
18016
18332
  const frame = commonFrame3(active);
18017
18333
  const \u7DDA = frame.strokeWidth / 2;
@@ -18093,7 +18409,7 @@ function ShapeServerRackNode({ node, active }) {
18093
18409
  ] }, i);
18094
18410
  })
18095
18411
  ] })),
18096
- bottomLabel(node, r.cx, r.label)
18412
+ bottomLabel(node, r.cx, r.label, textMetrics)
18097
18413
  ] });
18098
18414
  }
18099
18415
  var HUB_R = 30;
@@ -18101,7 +18417,7 @@ var ARM_LEN = 68;
18101
18417
  var END_R = 7;
18102
18418
  var WIFI_ARC_R = [10, 16, 22];
18103
18419
  var WIFI_BASE_Y = 5;
18104
- function ShapeNetworkNodeNode({ node, active }) {
18420
+ function ShapeNetworkNodeNode({ node, active, textMetrics = "proportional" }) {
18105
18421
  const r = shapeRegion(node);
18106
18422
  const cx = r.cx;
18107
18423
  const cy = r.cy;
@@ -18177,12 +18493,12 @@ function ShapeNetworkNodeNode({ node, active }) {
18177
18493
  )),
18178
18494
  /* @__PURE__ */ jsx("circle", { cx, cy: cy + WIFI_BASE_Y + 3, r: 2.5, fill: "var(--cdl-tone-accent, #2d6a8f)", stroke: "none" })
18179
18495
  ] })),
18180
- bottomLabel(node, r.cx, r.label)
18496
+ bottomLabel(node, r.cx, r.label, textMetrics)
18181
18497
  ] });
18182
18498
  }
18183
18499
  var PHONE_H = 240;
18184
18500
  var PHONE_W = 110;
18185
- function ShapeMobileDeviceNode({ node, active }) {
18501
+ function ShapeMobileDeviceNode({ node, active, textMetrics = "proportional" }) {
18186
18502
  const r = shapeRegion(node);
18187
18503
  const frame = commonFrame3(active);
18188
18504
  const \u7DDA = frame.strokeWidth / 2;
@@ -18249,7 +18565,7 @@ function ShapeMobileDeviceNode({ node, active }) {
18249
18565
  }
18250
18566
  )
18251
18567
  ] })),
18252
- bottomLabel(node, r.cx, r.label)
18568
+ bottomLabel(node, r.cx, r.label, textMetrics)
18253
18569
  ] });
18254
18570
  }
18255
18571
  function ShapeIotSensorNode({ node, active }) {
@@ -18520,7 +18836,7 @@ var SAT_DISH_R = 12;
18520
18836
  var SAT_DISH_STEM = 12;
18521
18837
  var SAT_MAST_LEN = 22;
18522
18838
  var SAT_MAST_TIP_R = 4;
18523
- function ShapeSatelliteNode({ node, active }) {
18839
+ function ShapeSatelliteNode({ node, active, textMetrics = "proportional" }) {
18524
18840
  const r = shapeRegion(node);
18525
18841
  const cx = r.cx;
18526
18842
  const cy = r.cy;
@@ -18709,7 +19025,7 @@ function ShapeSatelliteNode({ node, active }) {
18709
19025
  ),
18710
19026
  /* @__PURE__ */ jsx("circle", { cx, cy: cy - bodyH / 2 - SAT_MAST_LEN, r: 2, fill: "#ff5f56", stroke: "none", children: /* @__PURE__ */ jsx("animate", { attributeName: "opacity", values: "0.4;1;0.4", dur: "1.4s", repeatCount: "indefinite" }) })
18711
19027
  ] })),
18712
- bottomLabel(node, r.cx, r.label)
19028
+ bottomLabel(node, r.cx, r.label, textMetrics)
18713
19029
  ] });
18714
19030
  }
18715
19031
  var FRAME_SW_ACTIVE = 3;
@@ -18795,9 +19111,9 @@ function blockchainNodeExtent(strokeWidth) {
18795
19111
  const \u6A2A = (NODE_PEER_DIST + NODE_PEER_R) * Math.cos(Math.PI / 6) + \u7DDA;
18796
19112
  return { \u4E0A: \u7E26, \u4E0B: \u7E26, \u5DE6: \u6A2A, \u53F3: \u6A2A };
18797
19113
  }
18798
- function bottomLabel2(node, cx, plan) {
19114
+ function bottomLabel2(node, cx, plan, textMetrics = "proportional") {
18799
19115
  const \u53CE\u3081\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593, \u984C\u304B = false) => {
18800
- const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f) + ls * [...u].length;
19116
+ const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f, textMetrics) + ls * [...u].length;
18801
19117
  const \u7D20\u306E\u5E45 = \u6E2C\u308B(t, \u5927\u304D\u3055, \u5B57\u9593);
18802
19118
  const \u53CE\u307E\u308B = \u7D20\u306E\u5E45 > node.w && node.w > 0 ? node.w / \u7D20\u306E\u5E45 : 1;
18803
19119
  const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(t, \u5927\u304D\u3055, \u5B57\u9593, node.w, \u6E2C\u308B) : 0;
@@ -18830,7 +19146,12 @@ function EthereumDiamond({ cx, cy, h, colors }) {
18830
19146
  /* @__PURE__ */ 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" })
18831
19147
  ] });
18832
19148
  }
18833
- function ShapeSmartContractNode({ node, active, lang }) {
19149
+ function ShapeSmartContractNode({
19150
+ node,
19151
+ active,
19152
+ lang,
19153
+ textMetrics = "proportional"
19154
+ }) {
18834
19155
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
18835
19156
  const frame = commonFrame4(active);
18836
19157
  const r = shapeRegion(node);
@@ -18871,7 +19192,7 @@ function ShapeSmartContractNode({ node, active, lang }) {
18871
19192
  }
18872
19193
  ];
18873
19194
  const art = (\u500D\u7387) => {
18874
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19195
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
18875
19196
  return /* @__PURE__ */ jsxs("g", { children: [
18876
19197
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: path, ...frame, strokeLinejoin: "round" }),
18877
19198
  /* @__PURE__ */ jsx("path", { d: foldPath, fill: "none", stroke: frame.stroke, strokeWidth: frame.strokeWidth, strokeLinejoin: "round" }),
@@ -18893,10 +19214,10 @@ function ShapeSmartContractNode({ node, active, lang }) {
18893
19214
  };
18894
19215
  return /* @__PURE__ */ jsxs("g", { children: [
18895
19216
  fitArt(r, smartContractExtent(frame.strokeWidth), art),
18896
- bottomLabel2(node, r.cx, r.label)
19217
+ bottomLabel2(node, r.cx, r.label, textMetrics)
18897
19218
  ] });
18898
19219
  }
18899
- var \u5B57\u306E\u5E45 = (text, size) => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size);
19220
+ var \u5B57\u306E\u5E45 = (text, size, textMetrics = "proportional") => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, 0, textMetrics);
18900
19221
  var BLOCK_DEFAULT_FIELDS = [
18901
19222
  { key: "hash", label: "blockchainBlock.hash", value: { text: "0xaf31..." } },
18902
19223
  { key: "prev", label: "blockchainBlock.prev", value: { text: "0x7b3f..." } },
@@ -18904,10 +19225,16 @@ var BLOCK_DEFAULT_FIELDS = [
18904
19225
  { key: "nonce", label: "blockchainBlock.nonce", value: { text: "82,914" } },
18905
19226
  { key: "tx", label: "blockchainBlock.tx", value: { \u8F9E\u66F8: "blockchainBlock.txCount" } }
18906
19227
  ];
18907
- function ShapeBlockchainBlockNode({ node, active, lang }) {
19228
+ function ShapeBlockchainBlockNode({
19229
+ node,
19230
+ active,
19231
+ lang,
19232
+ textMetrics = "proportional"
19233
+ }) {
18908
19234
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
18909
19235
  const frame = commonFrame4(active);
18910
19236
  const r = shapeRegion(node);
19237
+ const \u6E2C\u308B\u5B57 = (text, size) => \u5B57\u306E\u5E45(text, size, textMetrics);
18911
19238
  const bw = BLOCK_W;
18912
19239
  const bh = BLOCK_H;
18913
19240
  const cx = r.cx;
@@ -18928,9 +19255,9 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18928
19255
  const \u5E2F\u306E\u6B8B\u308A = bw - 14 - 30;
18929
19256
  const \u80A9\u66F8\u306E\u9699\u9593 = 8;
18930
19257
  const \u80A9\u66F8\u306E\u4E0A\u9650 = (\u5E2F\u306E\u6B8B\u308A - \u80A9\u66F8\u306E\u9699\u9593) / 2;
18931
- 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);
19258
+ 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);
18932
19259
  const \u80A9\u66F8\u306E\u6307\u5B9A = \u80A9\u66F8\u306E\u5B57 * \u80A9\u66F8\u306E\u500D\u7387;
18933
- const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u5B57\u306E\u5E45(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
19260
+ const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u6E2C\u308B\u5B57(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
18934
19261
  const \u898B\u51FA\u3057\u306E\u5E45 = \u5E2F\u306E\u6B8B\u308A - (\u80A9\u66F8 === "" ? 0 : \u80A9\u66F8\u306E\u5E45 + \u80A9\u66F8\u306E\u9699\u9593);
18935
19262
  const \u6253\u3061\u6D88\u3059\u5B57\u3089 = [
18936
19263
  { text: \u898B\u51FA\u3057, size: \u898B\u51FA\u3057\u306E\u5B57, \u5E2F: { \u5E45: \u898B\u51FA\u3057\u306E\u5E45, \u9AD8\u3055: \u898B\u51FA\u3057\u306E\u5E2F } },
@@ -18941,12 +19268,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18941
19268
  {
18942
19269
  text: f.value,
18943
19270
  size: \u5024\u306E\u5B57,
18944
- \u5E2F: { \u5E45: bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
19271
+ \u5E2F: { \u5E45: bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
18945
19272
  }
18946
19273
  ])
18947
19274
  ];
18948
19275
  const art = (\u500D\u7387) => {
18949
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19276
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
18950
19277
  const \u984C\u306E\u5927\u304D\u3055 = \u898B\u51FA\u3057\u306E\u5B57 * \u500D;
18951
19278
  const \u80A9\u66F8\u306E\u5927\u304D\u3055 = \u80A9\u66F8\u306E\u6307\u5B9A * \u500D;
18952
19279
  const \u540D\u306E\u5927\u304D\u3055 = \u540D\u306E\u5B57 * \u500D;
@@ -18955,7 +19282,7 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18955
19282
  /* @__PURE__ */ jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
18956
19283
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
18957
19284
  /* @__PURE__ */ 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" }),
18958
- /* @__PURE__ */ 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, \u5B57\u306E\u5E45) }),
19285
+ /* @__PURE__ */ 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) }),
18959
19286
  \u80A9\u66F8 !== "" && /* @__PURE__ */ jsx(
18960
19287
  "text",
18961
19288
  {
@@ -18975,7 +19302,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18975
19302
  /* @__PURE__ */ jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
18976
19303
  fields.map((f, i) => /* @__PURE__ */ jsxs("g", { children: [
18977
19304
  /* @__PURE__ */ 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 }),
18978
- /* @__PURE__ */ 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(f.value, \u5024\u306E\u5927\u304D\u3055, bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5927\u304D\u3055) - 8, \u5B57\u306E\u5E45) }),
19305
+ /* @__PURE__ */ 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(
19306
+ f.value,
19307
+ \u5024\u306E\u5927\u304D\u3055,
19308
+ bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5927\u304D\u3055) - 8,
19309
+ \u6E2C\u308B\u5B57
19310
+ ) }),
18979
19311
  /* @__PURE__ */ 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 })
18980
19312
  ] }, i)),
18981
19313
  /* @__PURE__ */ jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
@@ -18987,7 +19319,11 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18987
19319
  };
18988
19320
  return /* @__PURE__ */ jsx("g", { children: fitArt(r, blockchainBlockExtent(frame.strokeWidth), art) });
18989
19321
  }
18990
- function ShapeBlockchainNode({ node, active }) {
19322
+ function ShapeBlockchainNode({
19323
+ node,
19324
+ active,
19325
+ textMetrics = "proportional"
19326
+ }) {
18991
19327
  const frame = commonFrame4(active);
18992
19328
  const r = shapeRegion(node);
18993
19329
  const cx = r.cx;
@@ -19003,7 +19339,7 @@ function ShapeBlockchainNode({ node, active }) {
19003
19339
  { text: "0x\u2026", size: CHAIN_HASH_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: CHAIN_ROW_GAP } }
19004
19340
  ];
19005
19341
  const art = (\u500D\u7387) => {
19006
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19342
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19007
19343
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19008
19344
  const bx = startX + i * (blockW + linkW);
19009
19345
  const isCurrent = i === blockCount - 1;
@@ -19039,10 +19375,14 @@ function ShapeBlockchainNode({ node, active }) {
19039
19375
  };
19040
19376
  return /* @__PURE__ */ jsxs("g", { children: [
19041
19377
  fitArt(r, chainExtent(), art),
19042
- bottomLabel2(node, r.cx, r.label)
19378
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19043
19379
  ] });
19044
19380
  }
19045
- function ShapeBitcoinChainNode({ node, active }) {
19381
+ function ShapeBitcoinChainNode({
19382
+ node,
19383
+ active,
19384
+ textMetrics = "proportional"
19385
+ }) {
19046
19386
  const frame = commonFrame4(active);
19047
19387
  const r = shapeRegion(node);
19048
19388
  const cx = r.cx;
@@ -19058,7 +19398,7 @@ function ShapeBitcoinChainNode({ node, active }) {
19058
19398
  { text: "#820", size: BTC_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
19059
19399
  ];
19060
19400
  const art = (\u500D\u7387) => {
19061
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19401
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19062
19402
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19063
19403
  const bx = startX + i * (blockW + linkW);
19064
19404
  const isCurrent = i === blockCount - 1;
@@ -19089,10 +19429,14 @@ function ShapeBitcoinChainNode({ node, active }) {
19089
19429
  };
19090
19430
  return /* @__PURE__ */ jsxs("g", { children: [
19091
19431
  fitArt(r, chainExtent(), art),
19092
- bottomLabel2(node, r.cx, r.label)
19432
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19093
19433
  ] });
19094
19434
  }
19095
- function ShapeEthereumChainNode({ node, active }) {
19435
+ function ShapeEthereumChainNode({
19436
+ node,
19437
+ active,
19438
+ textMetrics = "proportional"
19439
+ }) {
19096
19440
  const frame = commonFrame4(active);
19097
19441
  const r = shapeRegion(node);
19098
19442
  const cx = r.cx;
@@ -19108,7 +19452,7 @@ function ShapeEthereumChainNode({ node, active }) {
19108
19452
  { text: "#214", size: ETH_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
19109
19453
  ];
19110
19454
  const art = (\u500D\u7387) => {
19111
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19455
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19112
19456
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19113
19457
  const bx = startX + i * (blockW + linkW);
19114
19458
  const isCurrent = i === blockCount - 1;
@@ -19140,10 +19484,14 @@ function ShapeEthereumChainNode({ node, active }) {
19140
19484
  };
19141
19485
  return /* @__PURE__ */ jsxs("g", { children: [
19142
19486
  fitArt(r, chainExtent(), art),
19143
- bottomLabel2(node, r.cx, r.label)
19487
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19144
19488
  ] });
19145
19489
  }
19146
- function ShapeBlockchainNodeNode({ node, active }) {
19490
+ function ShapeBlockchainNodeNode({
19491
+ node,
19492
+ active,
19493
+ textMetrics = "proportional"
19494
+ }) {
19147
19495
  const frame = commonFrame4(active);
19148
19496
  const r = shapeRegion(node);
19149
19497
  const cx = r.cx;
@@ -19197,10 +19545,15 @@ function ShapeBlockchainNodeNode({ node, active }) {
19197
19545
  ] });
19198
19546
  return /* @__PURE__ */ jsxs("g", { children: [
19199
19547
  fitArt(r, blockchainNodeExtent(frame.strokeWidth), art),
19200
- bottomLabel2(node, r.cx, r.label)
19548
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19201
19549
  ] });
19202
19550
  }
19203
- function ShapeRpcNodeNode({ node, active, lang }) {
19551
+ function ShapeRpcNodeNode({
19552
+ node,
19553
+ active,
19554
+ lang,
19555
+ textMetrics = "proportional"
19556
+ }) {
19204
19557
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19205
19558
  const frame = commonFrame4(active);
19206
19559
  const r = shapeRegion(node);
@@ -19219,10 +19572,10 @@ function ShapeRpcNodeNode({ node, active, lang }) {
19219
19572
  /* @__PURE__ */ 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" }),
19220
19573
  /* @__PURE__ */ jsx("rect", { x: x + 16, y: y + bh - 24, width: bw - 32, height: 8, rx: 4, fill: "#0f1419", stroke: "none" }),
19221
19574
  /* @__PURE__ */ jsx("rect", { x: x + 16, y: y + bh - 24, width: (bw - 32) * 0.92, height: 8, rx: 4, fill: "#27c93f", stroke: "none", children: /* @__PURE__ */ jsx("animate", { attributeName: "width", values: `${(bw - 32) * 0.86};${(bw - 32) * 0.96};${(bw - 32) * 0.86}`, dur: "3s", repeatCount: "indefinite" }) }),
19222
- bottomLabel2(node, r.cx, r.label)
19575
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19223
19576
  ] });
19224
19577
  }
19225
- function ShapeWalletNode({ node, active }) {
19578
+ function ShapeWalletNode({ node, active, textMetrics = "proportional" }) {
19226
19579
  const frame = commonFrame4(active);
19227
19580
  const r = shapeRegion(node);
19228
19581
  const cx = r.cx;
@@ -19296,10 +19649,10 @@ function ShapeWalletNode({ node, active }) {
19296
19649
  /* @__PURE__ */ jsx("text", { x: cx, y: foldY + 3, fontSize: 9, fontWeight: 700, fill: "#5a3a10", textAnchor: "middle", opacity: 0.8, children: "\u039E" }),
19297
19650
  /* @__PURE__ */ jsx("path", { d: `M ${x + 2} ${y + 6} L ${x + w - 2} ${y + 6}`, fill: "none", stroke: "#ffffff", strokeWidth: 1, opacity: 0.4 })
19298
19651
  ] }),
19299
- bottomLabel2(node, r.cx, r.label)
19652
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19300
19653
  ] });
19301
19654
  }
19302
- function ShapeNftNode({ node, active }) {
19655
+ function ShapeNftNode({ node, active, textMetrics = "proportional" }) {
19303
19656
  const frame = commonFrame4(active);
19304
19657
  const r = shapeRegion(node);
19305
19658
  const cx = r.cx;
@@ -19315,7 +19668,7 @@ function ShapeNftNode({ node, active }) {
19315
19668
  { text: "#1024", size: NFT_ID_SIZE, \u5E2F: { \u5E45: cardW - 16 - 34, \u9AD8\u3055: cardH - artH } }
19316
19669
  ];
19317
19670
  const art = (\u500D\u7387) => {
19318
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19671
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19319
19672
  return /* @__PURE__ */ jsxs("g", { children: [
19320
19673
  /* @__PURE__ */ jsx("rect", { x: x + 4, y: y + 4, width: cardW, height: cardH, rx: 14, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
19321
19674
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: cardW, height: cardH, rx: 14, ...frame }),
@@ -19353,10 +19706,10 @@ function ShapeNftNode({ node, active }) {
19353
19706
  };
19354
19707
  return /* @__PURE__ */ jsxs("g", { children: [
19355
19708
  fitArt(r, nftExtent(frame.strokeWidth), art),
19356
- bottomLabel2(node, r.cx, r.label)
19709
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19357
19710
  ] });
19358
19711
  }
19359
- function ShapeTokenNode({ node, active }) {
19712
+ function ShapeTokenNode({ node, active, textMetrics = "proportional" }) {
19360
19713
  const frame = commonFrame4(active);
19361
19714
  const r = shapeRegion(node);
19362
19715
  const cx = r.cx;
@@ -19393,7 +19746,7 @@ function ShapeTokenNode({ node, active }) {
19393
19746
  }
19394
19747
  }
19395
19748
  ),
19396
- bottomLabel2(node, r.cx, r.label)
19749
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19397
19750
  ] });
19398
19751
  }
19399
19752
  var commonFrame5 = (active) => ({
@@ -19412,7 +19765,8 @@ function \u5B57\u306E\u6BD4(c) {
19412
19765
  if (\u5E83\u5B57.has(c)) return \u5E83\u5B57\u6BD4;
19413
19766
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD4 : \u5E83\u5B57\u6BD4;
19414
19767
  }
19415
- function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19768
+ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
19769
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
19416
19770
  let \u5E45 = 0;
19417
19771
  let \u5B57\u6570 = 0;
19418
19772
  for (const c of \u6587\u5B57\u5217) {
@@ -19421,18 +19775,33 @@ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19421
19775
  }
19422
19776
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
19423
19777
  }
19424
- function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
19425
- const \u5E45 = \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
19426
- const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u5B57\u5E45) : 0;
19778
+ function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
19779
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E45(t, s, ls, textMetrics);
19780
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
19781
+ 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;
19427
19782
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
19428
19783
  const size = \u5927\u304D\u3055 * \u500D\u7387;
19429
19784
  const spacing = \u5B57\u9593 * \u500D\u7387;
19430
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u5B57\u5E45(u, f, spacing)) };
19431
- }
19432
- function bottomLabel3(node, cx, plan) {
19433
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING2, node.w);
19434
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
19435
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
19785
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
19786
+ }
19787
+ function bottomLabel3(node, cx, plan, textMetrics = "proportional") {
19788
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(
19789
+ node.eyebrow ?? "",
19790
+ plan.\u80A9\u66F8?.size ?? 0,
19791
+ LABEL_EYEBROW_SPACING2,
19792
+ node.w,
19793
+ false,
19794
+ textMetrics
19795
+ );
19796
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
19797
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(
19798
+ node.subtitle ?? "",
19799
+ plan.\u8AAC\u660E?.size ?? 0,
19800
+ 0,
19801
+ node.w,
19802
+ false,
19803
+ textMetrics
19804
+ );
19436
19805
  return /* @__PURE__ */ jsxs(Fragment, { children: [
19437
19806
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ 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 }),
19438
19807
  /* @__PURE__ */ 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 }),
@@ -19451,7 +19820,7 @@ var BANK_STEP_SW = 1;
19451
19820
  var BANK_COLUMN_MIN = 24;
19452
19821
  var BANK_BLD_W_MIN = 120;
19453
19822
  var BANK_BLD_W_MAX = 280;
19454
- function ShapeBankNode({ node, active }) {
19823
+ function ShapeBankNode({ node, active, textMetrics = "proportional" }) {
19455
19824
  const frame = commonFrame5(active);
19456
19825
  const r = shapeRegion(node);
19457
19826
  const \u7DDA = frame.strokeWidth / 2;
@@ -19498,7 +19867,7 @@ function ShapeBankNode({ node, active }) {
19498
19867
  ] });
19499
19868
  return /* @__PURE__ */ jsxs("g", { children: [
19500
19869
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19501
- bottomLabel3(node, r.cx, r.label)
19870
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19502
19871
  ] });
19503
19872
  }
19504
19873
  var TRUST_CROWN_RISE = 4;
@@ -19510,7 +19879,12 @@ var TRUST_BASE_H = 14;
19510
19879
  var TRUST_BODY_OUT = 8;
19511
19880
  var TRUST_BLD_W_MIN = 140;
19512
19881
  var TRUST_BLD_W_MAX = 280;
19513
- function ShapeTrustBankNode({ node, active, lang }) {
19882
+ function ShapeTrustBankNode({
19883
+ node,
19884
+ active,
19885
+ lang,
19886
+ textMetrics = "proportional"
19887
+ }) {
19514
19888
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19515
19889
  const frame = commonFrame5(active);
19516
19890
  const r = shapeRegion(node);
@@ -19564,10 +19938,15 @@ function ShapeTrustBankNode({ node, active, lang }) {
19564
19938
  ] });
19565
19939
  return /* @__PURE__ */ jsxs("g", { children: [
19566
19940
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19567
- bottomLabel3(node, r.cx, r.label)
19941
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19568
19942
  ] });
19569
19943
  }
19570
- function ShapePaymentProviderNode({ node, active, lang }) {
19944
+ function ShapePaymentProviderNode({
19945
+ node,
19946
+ active,
19947
+ lang,
19948
+ textMetrics = "proportional"
19949
+ }) {
19571
19950
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19572
19951
  const frame = commonFrame5(active);
19573
19952
  const r = shapeRegion(node);
@@ -19592,10 +19971,14 @@ function ShapePaymentProviderNode({ node, active, lang }) {
19592
19971
  /* @__PURE__ */ jsx("text", { x: cx, y: cy + 9, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: accentDarker, fontFamily: "Georgia, serif", children: "$" })
19593
19972
  ] }),
19594
19973
  /* @__PURE__ */ jsx("text", { x: cx, y: y + boxH - 16, fontSize: 11, fontWeight: 700, letterSpacing: 2, textAnchor: "middle", fill: "#a4b5f2", children: \u5B57\u5F15("paymentProvider.status") }),
19595
- bottomLabel3(node, r.cx, r.label)
19974
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19596
19975
  ] });
19597
19976
  }
19598
- function ShapeCreditCardNode({ node, active }) {
19977
+ function ShapeCreditCardNode({
19978
+ node,
19979
+ active,
19980
+ textMetrics = "proportional"
19981
+ }) {
19599
19982
  const frame = commonFrame5(active);
19600
19983
  const r = shapeRegion(node);
19601
19984
  const cardW = Math.min(r.availW - 30, 260);
@@ -19617,7 +20000,7 @@ function ShapeCreditCardNode({ node, active }) {
19617
20000
  [0, 1, 2, 3].map((block) => /* @__PURE__ */ jsx("g", { children: [0, 1, 2, 3].map((dot) => /* @__PURE__ */ jsx("circle", { cx: x + 32 + block * (cardW - 64) / 4 + dot * 8, cy: y + cardH - 40, r: 2.8, fill: "#ffffff", stroke: "none" }, dot)) }, block)),
19618
20001
  /* @__PURE__ */ jsx("circle", { cx: x + cardW - 48, cy: y + cardH - 24, r: 15, fill: "#c9302c", opacity: 0.9, stroke: "none" }),
19619
20002
  /* @__PURE__ */ jsx("circle", { cx: x + cardW - 30, cy: y + cardH - 24, r: 15, fill: "#e5c07b", opacity: 0.9, stroke: "none" }),
19620
- bottomLabel3(node, r.cx, r.label)
20003
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19621
20004
  ] });
19622
20005
  }
19623
20006
  var BROKERAGE_TICK_H = 18;
@@ -19642,7 +20025,12 @@ var BROKERAGE_SHADE_OUT = 2;
19642
20025
  var BROKERAGE_W_MIN = BROKERAGE_COLS * BROKERAGE_CELL_W + (BROKERAGE_COLS - 1) * BROKERAGE_GAP_X + 6;
19643
20026
  var BROKERAGE_W_MAX = 140;
19644
20027
  var BROKERAGE_H_MIN = BROKERAGE_TICK_H + BROKERAGE_LOGO_H + BROKERAGE_BASE_H;
19645
- function ShapeBrokerageNode({ node, active, lang }) {
20028
+ function ShapeBrokerageNode({
20029
+ node,
20030
+ active,
20031
+ lang,
20032
+ textMetrics = "proportional"
20033
+ }) {
19646
20034
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19647
20035
  const frame = commonFrame5(active);
19648
20036
  const r = shapeRegion(node);
@@ -19681,7 +20069,7 @@ function ShapeBrokerageNode({ node, active, lang }) {
19681
20069
  }
19682
20070
  ];
19683
20071
  const \u7D75 = (\u500D\u7387) => {
19684
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20072
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19685
20073
  return /* @__PURE__ */ jsxs("g", { children: [
19686
20074
  /* @__PURE__ */ 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" }),
19687
20075
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: w, height: h, fill: "#255a7a", stroke: accentDarker, strokeWidth: frame.strokeWidth }),
@@ -19709,12 +20097,17 @@ function ShapeBrokerageNode({ node, active, lang }) {
19709
20097
  };
19710
20098
  return /* @__PURE__ */ jsxs("g", { children: [
19711
20099
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19712
- bottomLabel3(node, r.cx, r.label)
20100
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19713
20101
  ] });
19714
20102
  }
19715
20103
  var EXCHANGE_SUB_SIZE = 11;
19716
20104
  var EXCHANGE_HEX_R = 52;
19717
- function ShapeExchangeNode({ node, active, lang }) {
20105
+ function ShapeExchangeNode({
20106
+ node,
20107
+ active,
20108
+ lang,
20109
+ textMetrics = "proportional"
20110
+ }) {
19718
20111
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19719
20112
  const frame = commonFrame5(active);
19720
20113
  const r = shapeRegion(node);
@@ -19759,7 +20152,7 @@ function ShapeExchangeNode({ node, active, lang }) {
19759
20152
  }
19760
20153
  ];
19761
20154
  const \u7D75 = (\u500D\u7387) => {
19762
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20155
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19763
20156
  return /* @__PURE__ */ jsxs("g", { children: [
19764
20157
  nodes.map((n, i) => /* @__PURE__ */ jsx("line", { x1: cx, y1: cy, x2: n.cx, y2: n.cy, stroke: accentDarker, strokeWidth: 1.5, strokeDasharray: "3 2" }, `l${i}`)),
19765
20158
  nodes.map((n, i) => {
@@ -19778,7 +20171,7 @@ function ShapeExchangeNode({ node, active, lang }) {
19778
20171
  };
19779
20172
  return /* @__PURE__ */ jsxs("g", { children: [
19780
20173
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19781
- bottomLabel3(node, r.cx, r.label)
20174
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19782
20175
  ] });
19783
20176
  }
19784
20177
  var ATM_SIGN_H = 26;
@@ -19795,7 +20188,12 @@ var ATM_PANEL_H = 146;
19795
20188
  var ATM_W_MIN = 100;
19796
20189
  var ATM_W_MAX = ATM_PANEL_W;
19797
20190
  var ATM_H_MIN = ATM_SIGN_H + ATM_SIGN_GAP + 30 + ATM_FLOOR_RESERVE;
19798
- function ShapeAtmNode({ node, active, lang }) {
20191
+ function ShapeAtmNode({
20192
+ node,
20193
+ active,
20194
+ lang,
20195
+ textMetrics = "proportional"
20196
+ }) {
19799
20197
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19800
20198
  const frame = commonFrame5(active);
19801
20199
  const r = shapeRegion(node);
@@ -19879,7 +20277,7 @@ function ShapeAtmNode({ node, active, lang }) {
19879
20277
  ] });
19880
20278
  return /* @__PURE__ */ jsxs("g", { children: [
19881
20279
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19882
- bottomLabel3(node, r.cx, r.label)
20280
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19883
20281
  ] });
19884
20282
  }
19885
20283
  var commonFrame6 = (active) => ({
@@ -19898,7 +20296,8 @@ function \u5B57\u306E\u6BD42(c) {
19898
20296
  if (\u5E83\u5B572.has(c)) return \u5E83\u5B57\u6BD42;
19899
20297
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD42 : \u5E83\u5B57\u6BD42;
19900
20298
  }
19901
- function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
20299
+ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
20300
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
19902
20301
  let \u5E45 = 0;
19903
20302
  let \u5B57\u6570 = 0;
19904
20303
  for (const c of \u6587\u5B57\u5217) {
@@ -19907,18 +20306,33 @@ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19907
20306
  }
19908
20307
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
19909
20308
  }
19910
- function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
19911
- const \u5E45 = \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
19912
- const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u5B57\u5E452) : 0;
20309
+ function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
20310
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E452(t, s, ls, textMetrics);
20311
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
20312
+ 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;
19913
20313
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
19914
20314
  const size = \u5927\u304D\u3055 * \u500D\u7387;
19915
20315
  const spacing = \u5B57\u9593 * \u500D\u7387;
19916
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u5B57\u5E452(u, f, spacing)) };
19917
- }
19918
- function bottomLabel4(node, cx, plan) {
19919
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING3, node.w);
19920
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
19921
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
20316
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
20317
+ }
20318
+ function bottomLabel4(node, cx, plan, textMetrics = "proportional") {
20319
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(
20320
+ node.eyebrow ?? "",
20321
+ plan.\u80A9\u66F8?.size ?? 0,
20322
+ LABEL_EYEBROW_SPACING3,
20323
+ node.w,
20324
+ false,
20325
+ textMetrics
20326
+ );
20327
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
20328
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(
20329
+ node.subtitle ?? "",
20330
+ plan.\u8AAC\u660E?.size ?? 0,
20331
+ 0,
20332
+ node.w,
20333
+ false,
20334
+ textMetrics
20335
+ );
19922
20336
  return /* @__PURE__ */ jsxs(Fragment, { children: [
19923
20337
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ 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 }),
19924
20338
  /* @__PURE__ */ 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 }),
@@ -19930,7 +20344,7 @@ var WEBSITE_BAR_H = 32;
19930
20344
  var WEBSITE_H_MIN = WEBSITE_BAR_H + 98;
19931
20345
  var WEBSITE_W_MIN = 160;
19932
20346
  var WEBSITE_W_MAX = 280;
19933
- function ShapeWebsiteNode({ node, active }) {
20347
+ function ShapeWebsiteNode({ node, active, textMetrics = "proportional" }) {
19934
20348
  const frame = commonFrame6(active);
19935
20349
  const r = shapeRegion(node);
19936
20350
  const cx = r.cx;
@@ -19956,10 +20370,10 @@ function ShapeWebsiteNode({ node, active }) {
19956
20370
  ] });
19957
20371
  return /* @__PURE__ */ jsxs("g", { children: [
19958
20372
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19959
- bottomLabel4(node, r.cx, r.label)
20373
+ bottomLabel4(node, r.cx, r.label, textMetrics)
19960
20374
  ] });
19961
20375
  }
19962
- function ShapeStorefrontNode({ node, active, lang }) {
20376
+ function ShapeStorefrontNode({ node, active, lang, textMetrics = "proportional" }) {
19963
20377
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19964
20378
  const frame = commonFrame6(active);
19965
20379
  const r = shapeRegion(node);
@@ -20004,7 +20418,7 @@ function ShapeStorefrontNode({ node, active, lang }) {
20004
20418
  /* @__PURE__ */ 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") }),
20005
20419
  /* @__PURE__ */ jsx("circle", { cx: doorX + 6, cy: doorY + doorH * 0.55, r: 1.5, fill: "#c15a4a" }),
20006
20420
  /* @__PURE__ */ jsx("rect", { x: x - 6, y: y + bh - 6, width: bw + 12, height: 8, fill: "#5a6270", stroke: "none" }),
20007
- bottomLabel4(node, r.cx, r.label)
20421
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20008
20422
  ] });
20009
20423
  }
20010
20424
  var WAREHOUSE_ROOF_H = 18;
@@ -20018,7 +20432,7 @@ var WAREHOUSE_SHADOW_RX_RATIO = 0.5;
20018
20432
  var WAREHOUSE_H_MIN = WAREHOUSE_ROOF_H + WAREHOUSE_SIGN_H + 68;
20019
20433
  var WAREHOUSE_W_MIN = 160;
20020
20434
  var WAREHOUSE_W_MAX = 240;
20021
- function ShapeWarehouseNode({ node, active, lang }) {
20435
+ function ShapeWarehouseNode({ node, active, lang, textMetrics = "proportional" }) {
20022
20436
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
20023
20437
  const frame = commonFrame6(active);
20024
20438
  const r = shapeRegion(node);
@@ -20071,13 +20485,13 @@ function ShapeWarehouseNode({ node, active, lang }) {
20071
20485
  ] });
20072
20486
  return /* @__PURE__ */ jsxs("g", { children: [
20073
20487
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
20074
- bottomLabel4(node, r.cx, r.label)
20488
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20075
20489
  ] });
20076
20490
  }
20077
20491
  var HANDLE_GRIP_X = 118;
20078
20492
  var HANDLE_GRIP_R = 4;
20079
20493
  var CART_SHADOW_RX = 80;
20080
- function ShapeOnlineShopNode({ node, active }) {
20494
+ function ShapeOnlineShopNode({ node, active, textMetrics = "proportional" }) {
20081
20495
  const frame = commonFrame6(active);
20082
20496
  const r = shapeRegion(node);
20083
20497
  const cy = r.cy + 10;
@@ -20133,10 +20547,10 @@ function ShapeOnlineShopNode({ node, active }) {
20133
20547
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 16 * s, fill: "#0f1830", stroke: "#000", strokeWidth: 2 * s }),
20134
20548
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 8 * s, fill: "#5a6270", stroke: "#0f1830", strokeWidth: 1.5 * s }),
20135
20549
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 2 * s, fill: "#0f1830" }),
20136
- bottomLabel4(node, r.cx, r.label)
20550
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20137
20551
  ] });
20138
20552
  }
20139
- function ShapeCdnEdgeNode({ node, active }) {
20553
+ function ShapeCdnEdgeNode({ node, active, textMetrics = "proportional" }) {
20140
20554
  const frame = commonFrame6(active);
20141
20555
  const r = shapeRegion(node);
20142
20556
  const cx = r.cx;
@@ -20199,7 +20613,7 @@ function ShapeCdnEdgeNode({ node, active }) {
20199
20613
  ] });
20200
20614
  return /* @__PURE__ */ jsxs("g", { children: [
20201
20615
  fitArt(r, { \u4E0A: \u5E83\u304C\u308A, \u4E0B: \u5E83\u304C\u308A, \u5DE6: \u5E83\u304C\u308A, \u53F3: \u5E83\u304C\u308A }, \u7D75),
20202
- bottomLabel4(node, r.cx, r.label)
20616
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20203
20617
  ] });
20204
20618
  }
20205
20619
  var API_ROW_TOP = 52;
@@ -20214,7 +20628,7 @@ var API_METHOD_BOX_W = 54;
20214
20628
  var API_METHOD_TEXT_W = 48;
20215
20629
  var API_W_MIN = 200;
20216
20630
  var API_W_MAX = 300;
20217
- function ShapeApiGatewayNode({ node, active, lang }) {
20631
+ function ShapeApiGatewayNode({ node, active, lang, textMetrics = "proportional" }) {
20218
20632
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
20219
20633
  const frame = commonFrame6(active);
20220
20634
  const r = shapeRegion(node);
@@ -20226,7 +20640,13 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20226
20640
  const x = cx - bw / 2;
20227
20641
  const y = r.cy - \u7E26 / 2 + \u4F59\u767D;
20228
20642
  const \u5E83\u304C\u308A = { \u4E0A: \u7E26 / 2, \u4E0B: \u7E26 / 2, \u5DE6: bw / 2 + \u4F59\u767D, \u53F3: bw / 2 + \u4F59\u767D };
20229
- const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(11, 11 * API_METHOD_TEXT_W / Math.max(displayWidth(s) * 11 * MONO_ADVANCE_RATIO, textWidth(s, 11)));
20643
+ const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(
20644
+ 11,
20645
+ 11 * API_METHOD_TEXT_W / Math.max(
20646
+ displayWidth(s) * 11 * MONO_ADVANCE_RATIO,
20647
+ textWidth(s, 11, 0, textMetrics)
20648
+ )
20649
+ );
20230
20650
  const rowPitch = Math.max(
20231
20651
  API_ROW_PITCH_MIN,
20232
20652
  (bh - API_ROW_TOP - API_ROW_H - API_ROW_BOTTOM_PAD) / (API_ROWS - 1)
@@ -20242,7 +20662,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20242
20662
  \u5E2F: { \u5E45: bw - 32 - 64 - 16, \u9AD8\u3055: API_ROW_H }
20243
20663
  }));
20244
20664
  const \u7D75 = (\u500D\u7387) => {
20245
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20665
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
20246
20666
  return /* @__PURE__ */ jsxs("g", { children: [
20247
20667
  /* @__PURE__ */ 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" }),
20248
20668
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 10, fill: "#1a2332", stroke: frame.stroke, strokeWidth: frame.strokeWidth }),
@@ -20259,7 +20679,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20259
20679
  };
20260
20680
  return /* @__PURE__ */ jsxs("g", { children: [
20261
20681
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
20262
- bottomLabel4(node, r.cx, r.label)
20682
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20263
20683
  ] });
20264
20684
  }
20265
20685
  function bottomLabel5(node, cx, plan) {
@@ -20559,6 +20979,7 @@ function CdlNodeView({
20559
20979
  chartLineScale,
20560
20980
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3,
20561
20981
  lang,
20982
+ textMetrics,
20562
20983
  \u5024\u306E\u540D\u524D
20563
20984
  }) {
20564
20985
  const value = node.value ? interpolate(node.value, stateValues, \u5024\u306E\u540D\u524D) : void 0;
@@ -20603,7 +21024,14 @@ function CdlNodeView({
20603
21024
  return /* @__PURE__ */ jsx(CardNode, { node: resolvedNode, active });
20604
21025
  // 時系列のやり取り (#578)。 1 つの箱が図を丸ごと描く = 縦が時間で、参加者は箱を持たない
20605
21026
  case "sequence-board":
20606
- return /* @__PURE__ */ jsx(SequenceBoardNode, { node: resolvedNode, stateValues });
21027
+ return /* @__PURE__ */ jsx(
21028
+ SequenceBoardNode,
21029
+ {
21030
+ node: resolvedNode,
21031
+ stateValues,
21032
+ textMetrics
21033
+ }
21034
+ );
20607
21035
  // 図表 9 種は payload が `{signal}` を取れるので stateValues を渡す
20608
21036
  // (`render/payload-binding.ts` が描画直前に解決する)。 取れる欄は種別で違い、
20609
21037
  // 数と語を取る 7 種に対し、mind-map / tree-hierarchy は **名前だけ** を取る (#467)。
@@ -20628,7 +21056,8 @@ function CdlNodeView({
20628
21056
  active,
20629
21057
  stateValues,
20630
21058
  drawing,
20631
- progress
21059
+ progress,
21060
+ textMetrics
20632
21061
  }
20633
21062
  );
20634
21063
  case "chart-gauge":
@@ -20639,7 +21068,8 @@ function CdlNodeView({
20639
21068
  active,
20640
21069
  stateValues,
20641
21070
  drawing,
20642
- progress
21071
+ progress,
21072
+ textMetrics
20643
21073
  }
20644
21074
  );
20645
21075
  case "chart-stacked-bar":
@@ -20650,7 +21080,8 @@ function CdlNodeView({
20650
21080
  active,
20651
21081
  stateValues,
20652
21082
  drawing,
20653
- progress
21083
+ progress,
21084
+ textMetrics
20654
21085
  }
20655
21086
  );
20656
21087
  case "chart-slope":
@@ -20661,7 +21092,8 @@ function CdlNodeView({
20661
21092
  active,
20662
21093
  stateValues,
20663
21094
  drawing,
20664
- progress
21095
+ progress,
21096
+ textMetrics
20665
21097
  }
20666
21098
  );
20667
21099
  case "chart-waffle":
@@ -20672,11 +21104,20 @@ function CdlNodeView({
20672
21104
  active,
20673
21105
  stateValues,
20674
21106
  drawing,
20675
- progress
21107
+ progress,
21108
+ textMetrics
20676
21109
  }
20677
21110
  );
20678
21111
  case "chart-stat":
20679
- return /* @__PURE__ */ jsx(ChartStatNode, { node: resolvedNode, active, stateValues });
21112
+ return /* @__PURE__ */ jsx(
21113
+ ChartStatNode,
21114
+ {
21115
+ node: resolvedNode,
21116
+ active,
21117
+ stateValues,
21118
+ textMetrics
21119
+ }
21120
+ );
20680
21121
  case "chart-radial":
20681
21122
  return /* @__PURE__ */ jsx(
20682
21123
  ChartRadialNode,
@@ -20685,7 +21126,8 @@ function CdlNodeView({
20685
21126
  active,
20686
21127
  stateValues,
20687
21128
  drawing,
20688
- progress
21129
+ progress,
21130
+ textMetrics
20689
21131
  }
20690
21132
  );
20691
21133
  case "chart-bar":
@@ -20718,7 +21160,8 @@ function CdlNodeView({
20718
21160
  active,
20719
21161
  stateValues,
20720
21162
  drawing,
20721
- progress
21163
+ progress,
21164
+ textMetrics
20722
21165
  }
20723
21166
  );
20724
21167
  case "funnel-stages":
@@ -20729,11 +21172,20 @@ function CdlNodeView({
20729
21172
  active,
20730
21173
  stateValues,
20731
21174
  drawing,
20732
- progress
21175
+ progress,
21176
+ textMetrics
20733
21177
  }
20734
21178
  );
20735
21179
  case "quadrant-matrix":
20736
- return /* @__PURE__ */ jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
21180
+ return /* @__PURE__ */ jsx(
21181
+ QuadrantNode,
21182
+ {
21183
+ node: resolvedNode,
21184
+ active,
21185
+ stateValues,
21186
+ textMetrics
21187
+ }
21188
+ );
20737
21189
  case "tree-hierarchy":
20738
21190
  return /* @__PURE__ */ jsx(
20739
21191
  TreeNode,
@@ -20742,7 +21194,8 @@ function CdlNodeView({
20742
21194
  active,
20743
21195
  stateValues,
20744
21196
  drawing,
20745
- progress
21197
+ progress,
21198
+ textMetrics
20746
21199
  }
20747
21200
  );
20748
21201
  case "journey-map":
@@ -20757,91 +21210,91 @@ function CdlNodeView({
20757
21210
  }
20758
21211
  );
20759
21212
  case "shape-file":
20760
- return /* @__PURE__ */ jsx(ShapeFileNode, { node: resolvedNode, active });
21213
+ return /* @__PURE__ */ jsx(ShapeFileNode, { node: resolvedNode, active, textMetrics });
20761
21214
  case "shape-folder":
20762
- return /* @__PURE__ */ jsx(ShapeFolderNode, { node: resolvedNode, active });
21215
+ return /* @__PURE__ */ jsx(ShapeFolderNode, { node: resolvedNode, active, textMetrics });
20763
21216
  case "shape-cloud":
20764
- return /* @__PURE__ */ jsx(ShapeCloudNode, { node: resolvedNode, active });
21217
+ return /* @__PURE__ */ jsx(ShapeCloudNode, { node: resolvedNode, active, textMetrics });
20765
21218
  case "shape-cylinder":
20766
- return /* @__PURE__ */ jsx(ShapeCylinderNode, { node: resolvedNode, active });
21219
+ return /* @__PURE__ */ jsx(ShapeCylinderNode, { node: resolvedNode, active, textMetrics });
20767
21220
  case "shape-hexagon":
20768
- return /* @__PURE__ */ jsx(ShapeHexagonNode, { node: resolvedNode, active });
21221
+ return /* @__PURE__ */ jsx(ShapeHexagonNode, { node: resolvedNode, active, textMetrics });
20769
21222
  case "shape-diamond":
20770
- return /* @__PURE__ */ jsx(ShapeDiamondNode, { node: resolvedNode, active });
21223
+ return /* @__PURE__ */ jsx(ShapeDiamondNode, { node: resolvedNode, active, textMetrics });
20771
21224
  case "shape-stack":
20772
- return /* @__PURE__ */ jsx(ShapeStackNode, { node: resolvedNode, active });
21225
+ return /* @__PURE__ */ jsx(ShapeStackNode, { node: resolvedNode, active, textMetrics });
20773
21226
  case "shape-person":
20774
- return /* @__PURE__ */ jsx(ShapePersonNode, { node: resolvedNode, active });
21227
+ return /* @__PURE__ */ jsx(ShapePersonNode, { node: resolvedNode, active, textMetrics });
20775
21228
  case "shape-window":
20776
21229
  return /* @__PURE__ */ jsx(ShapeWindowNode, { node: resolvedNode, active });
20777
21230
  case "shape-terminal":
20778
21231
  return /* @__PURE__ */ jsx(ShapeTerminalNode, { node: resolvedNode, active, lang });
20779
21232
  case "shape-code-block":
20780
- return /* @__PURE__ */ jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang });
21233
+ return /* @__PURE__ */ jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang, textMetrics });
20781
21234
  case "shape-kanban-card":
20782
- return /* @__PURE__ */ jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang });
21235
+ return /* @__PURE__ */ jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang, textMetrics });
20783
21236
  case "shape-message-bubble":
20784
21237
  return /* @__PURE__ */ jsx(ShapeMessageBubbleNode, { node: resolvedNode, active });
20785
21238
  case "shape-gear":
20786
21239
  return /* @__PURE__ */ jsx(ShapeGearNode, { node: resolvedNode, active });
20787
21240
  case "shape-server-rack":
20788
- return /* @__PURE__ */ jsx(ShapeServerRackNode, { node: resolvedNode, active });
21241
+ return /* @__PURE__ */ jsx(ShapeServerRackNode, { node: resolvedNode, active, textMetrics });
20789
21242
  case "shape-network-node":
20790
- return /* @__PURE__ */ jsx(ShapeNetworkNodeNode, { node: resolvedNode, active });
21243
+ return /* @__PURE__ */ jsx(ShapeNetworkNodeNode, { node: resolvedNode, active, textMetrics });
20791
21244
  case "shape-mobile-device":
20792
- return /* @__PURE__ */ jsx(ShapeMobileDeviceNode, { node: resolvedNode, active });
21245
+ return /* @__PURE__ */ jsx(ShapeMobileDeviceNode, { node: resolvedNode, active, textMetrics });
20793
21246
  case "shape-iot-sensor":
20794
21247
  return /* @__PURE__ */ jsx(ShapeIotSensorNode, { node: resolvedNode, active });
20795
21248
  case "shape-robot-arm":
20796
21249
  return /* @__PURE__ */ jsx(ShapeRobotArmNode, { node: resolvedNode, active });
20797
21250
  case "shape-satellite":
20798
- return /* @__PURE__ */ jsx(ShapeSatelliteNode, { node: resolvedNode, active });
21251
+ return /* @__PURE__ */ jsx(ShapeSatelliteNode, { node: resolvedNode, active, textMetrics });
20799
21252
  case "shape-smart-contract":
20800
- return /* @__PURE__ */ jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang });
21253
+ return /* @__PURE__ */ jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang, textMetrics });
20801
21254
  case "shape-blockchain-block":
20802
- return /* @__PURE__ */ jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang });
21255
+ return /* @__PURE__ */ jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang, textMetrics });
20803
21256
  case "shape-rpc-node":
20804
- return /* @__PURE__ */ jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang });
21257
+ return /* @__PURE__ */ jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang, textMetrics });
20805
21258
  case "shape-wallet":
20806
- return /* @__PURE__ */ jsx(ShapeWalletNode, { node: resolvedNode, active });
21259
+ return /* @__PURE__ */ jsx(ShapeWalletNode, { node: resolvedNode, active, textMetrics });
20807
21260
  case "shape-nft":
20808
- return /* @__PURE__ */ jsx(ShapeNftNode, { node: resolvedNode, active });
21261
+ return /* @__PURE__ */ jsx(ShapeNftNode, { node: resolvedNode, active, textMetrics });
20809
21262
  case "shape-token":
20810
- return /* @__PURE__ */ jsx(ShapeTokenNode, { node: resolvedNode, active });
21263
+ return /* @__PURE__ */ jsx(ShapeTokenNode, { node: resolvedNode, active, textMetrics });
20811
21264
  case "shape-blockchain":
20812
- return /* @__PURE__ */ jsx(ShapeBlockchainNode, { node: resolvedNode, active });
21265
+ return /* @__PURE__ */ jsx(ShapeBlockchainNode, { node: resolvedNode, active, textMetrics });
20813
21266
  case "shape-bitcoin-chain":
20814
- return /* @__PURE__ */ jsx(ShapeBitcoinChainNode, { node: resolvedNode, active });
21267
+ return /* @__PURE__ */ jsx(ShapeBitcoinChainNode, { node: resolvedNode, active, textMetrics });
20815
21268
  case "shape-ethereum-chain":
20816
- return /* @__PURE__ */ jsx(ShapeEthereumChainNode, { node: resolvedNode, active });
21269
+ return /* @__PURE__ */ jsx(ShapeEthereumChainNode, { node: resolvedNode, active, textMetrics });
20817
21270
  case "shape-blockchain-node":
20818
- return /* @__PURE__ */ jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active });
21271
+ return /* @__PURE__ */ jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active, textMetrics });
20819
21272
  case "shape-bank":
20820
- return /* @__PURE__ */ jsx(ShapeBankNode, { node: resolvedNode, active });
21273
+ return /* @__PURE__ */ jsx(ShapeBankNode, { node: resolvedNode, active, textMetrics });
20821
21274
  case "shape-trust-bank":
20822
- return /* @__PURE__ */ jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang });
21275
+ return /* @__PURE__ */ jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang, textMetrics });
20823
21276
  case "shape-payment-provider":
20824
- return /* @__PURE__ */ jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang });
21277
+ return /* @__PURE__ */ jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang, textMetrics });
20825
21278
  case "shape-credit-card":
20826
- return /* @__PURE__ */ jsx(ShapeCreditCardNode, { node: resolvedNode, active });
21279
+ return /* @__PURE__ */ jsx(ShapeCreditCardNode, { node: resolvedNode, active, textMetrics });
20827
21280
  case "shape-brokerage":
20828
- return /* @__PURE__ */ jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang });
21281
+ return /* @__PURE__ */ jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang, textMetrics });
20829
21282
  case "shape-exchange":
20830
- return /* @__PURE__ */ jsx(ShapeExchangeNode, { node: resolvedNode, active, lang });
21283
+ return /* @__PURE__ */ jsx(ShapeExchangeNode, { node: resolvedNode, active, lang, textMetrics });
20831
21284
  case "shape-atm":
20832
- return /* @__PURE__ */ jsx(ShapeAtmNode, { node: resolvedNode, active, lang });
21285
+ return /* @__PURE__ */ jsx(ShapeAtmNode, { node: resolvedNode, active, lang, textMetrics });
20833
21286
  case "shape-website":
20834
- return /* @__PURE__ */ jsx(ShapeWebsiteNode, { node: resolvedNode, active });
21287
+ return /* @__PURE__ */ jsx(ShapeWebsiteNode, { node: resolvedNode, active, textMetrics });
20835
21288
  case "shape-storefront":
20836
- return /* @__PURE__ */ jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang });
21289
+ return /* @__PURE__ */ jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang, textMetrics });
20837
21290
  case "shape-warehouse":
20838
- return /* @__PURE__ */ jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang });
21291
+ return /* @__PURE__ */ jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang, textMetrics });
20839
21292
  case "shape-online-shop":
20840
- return /* @__PURE__ */ jsx(ShapeOnlineShopNode, { node: resolvedNode, active });
21293
+ return /* @__PURE__ */ jsx(ShapeOnlineShopNode, { node: resolvedNode, active, textMetrics });
20841
21294
  case "shape-cdn-edge":
20842
- return /* @__PURE__ */ jsx(ShapeCdnEdgeNode, { node: resolvedNode, active });
21295
+ return /* @__PURE__ */ jsx(ShapeCdnEdgeNode, { node: resolvedNode, active, textMetrics });
20843
21296
  case "shape-api-gateway":
20844
- return /* @__PURE__ */ jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang });
21297
+ return /* @__PURE__ */ jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang, textMetrics });
20845
21298
  case "shape-auditor":
20846
21299
  return /* @__PURE__ */ jsx(ShapeAuditorNode, { node: resolvedNode, active });
20847
21300
  case "shape-regulator":
@@ -20861,7 +21314,17 @@ function CdlNodeView({
20861
21314
  case "station":
20862
21315
  return /* @__PURE__ */ jsx(StationNode, { node: resolvedNode, active });
20863
21316
  default:
20864
- return /* @__PURE__ */ jsx(GenericNode, { node: resolvedNode, active, value: node.value, stateValues, \u5024\u306E\u540D\u524D });
21317
+ return /* @__PURE__ */ jsx(
21318
+ GenericNode,
21319
+ {
21320
+ node: resolvedNode,
21321
+ active,
21322
+ value: node.value,
21323
+ stateValues,
21324
+ \u5024\u306E\u540D\u524D,
21325
+ textMetrics
21326
+ }
21327
+ );
20865
21328
  }
20866
21329
  })();
20867
21330
  const offsetX = node.renderOffsetX !== void 0 ? resolveNumericAttr(node.renderOffsetX, stateValues, 0) : 0;
@@ -20922,7 +21385,7 @@ function CdlNodeView({
20922
21385
  }
20923
21386
  ),
20924
21387
  inner,
20925
- \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode)
21388
+ \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode, textMetrics ?? "proportional")
20926
21389
  ]
20927
21390
  }
20928
21391
  );
@@ -20931,17 +21394,17 @@ var FIGURE_TITLE_GAP = 10;
20931
21394
  var FIGURE_TITLE_SIZE = 15;
20932
21395
  var FIGURE_EYEBROW_SIZE = 11;
20933
21396
  var FIGURE_EYEBROW_LIFT = 1.1;
20934
- function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45) {
20935
- const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0);
21397
+ function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45, textMetrics = "proportional") {
21398
+ const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0, textMetrics);
20936
21399
  return \u5B9F\u5E45 > \u5E45 ? \u7D20\u306E\u5927\u304D\u3055 * \u5E45 / \u5B9F\u5E45 : \u7D20\u306E\u5927\u304D\u3055;
20937
21400
  }
20938
- function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
21401
+ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node, textMetrics = "proportional") {
20939
21402
  if (!drawsFigureTitle(node.kind)) return null;
20940
21403
  const \u540D\u524D = (node.title ?? "").trim();
20941
21404
  const \u5C0F\u898B\u51FA\u3057 = (node.eyebrow ?? "").trim();
20942
21405
  if (\u540D\u524D === "" && \u5C0F\u898B\u51FA\u3057 === "") return null;
20943
21406
  const \u984C\u306Ey = node.cy - node.h / 2 - FIGURE_TITLE_GAP;
20944
- const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w);
21407
+ const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w, textMetrics);
20945
21408
  const \u5C0F\u898B\u51FA\u3057\u306Ey = \u540D\u524D === "" ? \u984C\u306Ey : \u984C\u306Ey - \u984C\u306E\u5927\u304D\u3055 * FIGURE_EYEBROW_LIFT;
20946
21409
  return /* @__PURE__ */ jsxs(Fragment, { children: [
20947
21410
  \u5C0F\u898B\u51FA\u3057 !== "" && /* @__PURE__ */ jsx(
@@ -20951,7 +21414,7 @@ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
20951
21414
  x: node.cx,
20952
21415
  y: \u5C0F\u898B\u51FA\u3057\u306Ey,
20953
21416
  textAnchor: "middle",
20954
- fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w),
21417
+ fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w, textMetrics),
20955
21418
  fontWeight: 600,
20956
21419
  letterSpacing: 0.6,
20957
21420
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -21276,6 +21739,7 @@ function CdlStage({
21276
21739
  node,
21277
21740
  active: activeSet.has(node.id),
21278
21741
  lang: laid.lang,
21742
+ textMetrics: laid.textMetrics,
21279
21743
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3: \u7BB1\u306E\u53D7\u3051\u53E3,
21280
21744
  drawing: \u63CF\u304F,
21281
21745
  progress: \u63CF\u304F ? \u63CF\u304F\u9032\u307F : progress,
@@ -21292,7 +21756,8 @@ function CdlStage({
21292
21756
  CdlEdgeLabelView,
21293
21757
  {
21294
21758
  edge,
21295
- active: activeSet.has(edge.id)
21759
+ active: activeSet.has(edge.id),
21760
+ textMetrics: laid.textMetrics
21296
21761
  },
21297
21762
  `label-${edge.id}`
21298
21763
  )),
@@ -21302,7 +21767,8 @@ function CdlStage({
21302
21767
  {
21303
21768
  edge,
21304
21769
  active: activeSet.has(edge.id),
21305
- \u7AEF
21770
+ \u7AEF,
21771
+ textMetrics: laid.textMetrics
21306
21772
  },
21307
21773
  `${\u7AEF}-label-${edge.id}`
21308
21774
  ))
@@ -22367,7 +22833,15 @@ function useInteractiveIntegration(diagram, options = {}) {
22367
22833
  f.id
22368
22834
  )) }),
22369
22835
  scrolls.length > 0 && /* @__PURE__ */ jsx("div", { className: "cdl-ip-group", children: scrolls.map((s) => /* @__PURE__ */ jsx(ScrollReadout, { id: s.id, name: s.label || s.id, progress: stateOverrides[s.id] }, s.id)) }),
22370
- readouts.length > 0 && /* @__PURE__ */ jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsx(ReadoutWidget, { readout: r, stateOverrides: mergedStateValues }, r.id)) })
22836
+ readouts.length > 0 && /* @__PURE__ */ jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsx(
22837
+ ReadoutWidget,
22838
+ {
22839
+ readout: r,
22840
+ stateOverrides: mergedStateValues,
22841
+ textMetrics: resolveTextMetrics(diagram.textMetrics)
22842
+ },
22843
+ r.id
22844
+ )) })
22371
22845
  ] }) })
22372
22846
  );
22373
22847
  }, [diagram, signals, stateOverrides, mergedStateValues]);
@@ -22788,7 +23262,8 @@ function StepperWidget({
22788
23262
  }
22789
23263
  function ReadoutWidget({
22790
23264
  readout,
22791
- stateOverrides
23265
+ stateOverrides,
23266
+ textMetrics = "proportional"
22792
23267
  }) {
22793
23268
  const rawValue = "source" in readout ? stateOverrides[readout.source] : void 0;
22794
23269
  const numericValue = typeof rawValue === "number" ? rawValue : typeof rawValue === "string" ? Number(rawValue) : Number.NaN;
@@ -23036,7 +23511,8 @@ function ReadoutWidget({
23036
23511
  max: readout.max,
23037
23512
  viewW: readout.viewW ?? 280,
23038
23513
  viewH: readout.viewH ?? 60,
23039
- color: readout.color ?? "#2563eb"
23514
+ color: readout.color ?? "#2563eb",
23515
+ textMetrics
23040
23516
  }
23041
23517
  );
23042
23518
  case "radar": {
@@ -23852,7 +24328,8 @@ function ReadoutWidget({
23852
24328
  { status: "idle", color: "#94a3b8" },
23853
24329
  { status: "error", color: "#ef4444" }
23854
24330
  ],
23855
- max: readout.max ?? 10
24331
+ max: readout.max ?? 10,
24332
+ textMetrics
23856
24333
  }
23857
24334
  );
23858
24335
  case "calendar-week":
@@ -24996,8 +25473,8 @@ function ProgressGroupReadout({
24996
25473
  }) })
24997
25474
  ] });
24998
25475
  }
24999
- function sequenceLabelAnchor(x, name, fontSize, viewW) {
25000
- const half = textWidth(name, fontSize) / 2;
25476
+ function sequenceLabelAnchor(x, name, fontSize, viewW, textMetrics = "proportional") {
25477
+ const half = textWidth(name, fontSize, 0, textMetrics) / 2;
25001
25478
  if (x - half < 0) return "start";
25002
25479
  if (x + half > viewW) return "end";
25003
25480
  return "middle";
@@ -25010,7 +25487,8 @@ function SequenceTimelineReadout({
25010
25487
  max,
25011
25488
  viewW,
25012
25489
  viewH,
25013
- color
25490
+ color,
25491
+ textMetrics = "proportional"
25014
25492
  }) {
25015
25493
  const events = [];
25016
25494
  const trimmed = value.trim();
@@ -25053,7 +25531,17 @@ function SequenceTimelineReadout({
25053
25531
  const x = xFor(e.t);
25054
25532
  return /* @__PURE__ */ jsxs("g", { "data-cdl-event-marker": e.name, children: [
25055
25533
  /* @__PURE__ */ jsx("circle", { cx: x, cy: trackY, r: 5, fill: color, stroke: "#fff", strokeWidth: 1.5, children: /* @__PURE__ */ jsx(\u5B57\u306E\u898B\u51FA\u3057, { k: "readout.sequenceTimeline.title", v: { name: e.name, t: e.t } }) }),
25056
- /* @__PURE__ */ jsx("text", { x, y: trackY - 12, textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW), fontSize: 10, fill: "var(--v4-ink, #1a1f2a)", children: e.name }),
25534
+ /* @__PURE__ */ jsx(
25535
+ "text",
25536
+ {
25537
+ x,
25538
+ y: trackY - 12,
25539
+ textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW, textMetrics),
25540
+ fontSize: 10,
25541
+ fill: "var(--v4-ink, #1a1f2a)",
25542
+ children: e.name
25543
+ }
25544
+ ),
25057
25545
  /* @__PURE__ */ jsx("text", { x, y: trackY + 18, textAnchor: "middle", fontSize: 9, fill: "var(--v4-mute, #64748b)", children: e.t })
25058
25546
  ] }, i);
25059
25547
  })
@@ -28130,7 +28618,8 @@ function StatusTimelineReadout({
28130
28618
  label,
28131
28619
  value,
28132
28620
  colorMap,
28133
- max
28621
+ max,
28622
+ textMetrics = "proportional"
28134
28623
  }) {
28135
28624
  const events = [];
28136
28625
  const trimmed = value.trim();
@@ -28155,6 +28644,7 @@ function StatusTimelineReadout({
28155
28644
  const cellW = shown.length > 0 ? (width - 20) / shown.length : 0;
28156
28645
  const height = stripHeight + 40;
28157
28646
  const \u533A\u9593\u306E\u5B57 = (status) => status === "active" || status === "idle" || status === "error" ? \u5F15\u304F(`readout.statusTimeline.${status}`) : status.toUpperCase();
28647
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
28158
28648
  return /* @__PURE__ */ jsxs("div", { className: "cdl-ip-item cdl-ip-readout-status-timeline", "data-cdl-readout": id, children: [
28159
28649
  /* @__PURE__ */ jsx("span", { className: "cdl-ip-label", children: label }),
28160
28650
  /* @__PURE__ */ jsx(
@@ -28168,7 +28658,7 @@ function StatusTimelineReadout({
28168
28658
  const x = 10 + i * cellW;
28169
28659
  const c = colorLookup.get(ev.status) ?? "#cbd5e1";
28170
28660
  const \u5B572 = \u533A\u9593\u306E\u5B57(ev.status);
28171
- const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8);
28661
+ const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8, \u6E2C\u308B);
28172
28662
  return /* @__PURE__ */ jsxs("g", { "data-cdl-status-event": i, "data-cdl-status": ev.status, children: [
28173
28663
  /* @__PURE__ */ jsx("rect", { x, y: 10, width: cellW - 2, height: stripHeight, fill: c, rx: 2 }),
28174
28664
  /* @__PURE__ */ jsxs(