@cardenelabs/cdl 0.122.0 → 0.123.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 +16 -1
  2. package/README.md +64 -0
  3. package/dist/index.cjs +1065 -617
  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 +1065 -618
  8. package/dist/index.js.map +1 -1
  9. package/dist/react.cjs +834 -403
  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 +834 -403
  14. package/dist/react.js.map +1 -1
  15. package/dist/{render-U_pC-Ksh.d.cts → render-CVczwfRb.d.cts} +20 -2
  16. package/dist/{render-U_pC-Ksh.d.ts → render-CVczwfRb.d.ts} +20 -2
  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 +70 -25
  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 +19 -0
  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;
@@ -9106,8 +9182,8 @@ function sidePoint(n, side) {
9106
9182
  return { x: n.cx + n.w / 2, y: n.cy };
9107
9183
  }
9108
9184
  }
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;
9185
+ 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") {
9186
+ const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub, textMetrics) : 0;
9111
9187
  const labelHalfW = labelBoxW / 2;
9112
9188
  const labelInit = labelInitClearance(edge);
9113
9189
  const verticalPair = fromSide === "bottom" && toSide === "top" || fromSide === "top" && toSide === "bottom";
@@ -9506,7 +9582,7 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
9506
9582
  labelAnchor: "middle"
9507
9583
  };
9508
9584
  }
9509
- function repositionParallelLabels(edges, nodes) {
9585
+ function repositionParallelLabels(edges, nodes, textMetrics = "proportional") {
9510
9586
  const allSegs = new Map(
9511
9587
  edges.map((e) => [e.id, flattenPathSegments(extractPathSegments(e.d))])
9512
9588
  );
@@ -9531,7 +9607,7 @@ function repositionParallelLabels(edges, nodes) {
9531
9607
  for (const pair of byPair.values()) {
9532
9608
  if (pair.length < 2) continue;
9533
9609
  const pairOrder = [...pair].sort(compareSharedPairOrder);
9534
- const boxes = pair.map((e) => computeLabelBBoxWorld(e));
9610
+ const boxes = pair.map((e) => computeLabelBBoxWorld(e, textMetrics));
9535
9611
  const componentOf = pair.map((_, i) => i);
9536
9612
  for (let i = 0; i < pair.length; i++) {
9537
9613
  for (let j = i + 1; j < pair.length; j++) {
@@ -9556,17 +9632,27 @@ function repositionParallelLabels(edges, nodes) {
9556
9632
  nodes,
9557
9633
  allEdges: edges,
9558
9634
  allSegs,
9559
- xRange
9635
+ xRange,
9636
+ textMetrics
9560
9637
  });
9561
9638
  for (let i = 0; i < members.length; i++) members[i].labelY = placed[i];
9562
9639
  }
9563
9640
  }
9564
9641
  }
9565
9642
  function placeAvoidingSiblingPaths(args) {
9566
- const { members, pair, pairOrder, nodes, allEdges, allSegs, xRange } = args;
9643
+ const {
9644
+ members,
9645
+ pair,
9646
+ pairOrder,
9647
+ nodes,
9648
+ allEdges,
9649
+ allSegs,
9650
+ xRange,
9651
+ textMetrics = "proportional"
9652
+ } = args;
9567
9653
  const sizes = members.map((e) => labelPillH(e.sub));
9568
9654
  const wants = members.map((e) => e.labelY);
9569
- const boxes = members.map((e) => computeLabelBBoxWorld(e));
9655
+ const boxes = members.map((e) => computeLabelBBoxWorld(e, textMetrics));
9570
9656
  const all = members.map((_, i) => i);
9571
9657
  const spread = (idx) => spreadWithMinimalShift(
9572
9658
  idx.map((i) => ({ want: wants[i], size: sizes[i] })),
@@ -9757,14 +9843,14 @@ function labelRectAt(cx, cy, w, h) {
9757
9843
  function inflate(r, pad) {
9758
9844
  return { x: r.x - pad, y: r.y - pad, w: r.w + pad * 2, h: r.h + pad * 2 };
9759
9845
  }
9760
- function slideLabelsAlongOwnPath(edges, nodes) {
9846
+ function slideLabelsAlongOwnPath(edges, nodes, textMetrics = "proportional") {
9761
9847
  const withLabel = edges.filter((e) => hasRenderedLabel(e));
9762
9848
  if (withLabel.length === 0) return;
9763
9849
  const segsById = /* @__PURE__ */ new Map();
9764
9850
  for (const e of edges) segsById.set(e.id, flattenPathSegments(extractPathSegments(e.d)));
9765
9851
  const nodeRects = nodes.map(nodeRect);
9766
9852
  for (const e of withLabel) {
9767
- const w = computeLabelBoxW(e.label, e.sub);
9853
+ const w = computeLabelBoxW(e.label, e.sub, textMetrics);
9768
9854
  const h = labelPillH(e.sub);
9769
9855
  if (w === 0 || h === 0) continue;
9770
9856
  const own = segsById.get(e.id) ?? [];
@@ -10066,7 +10152,7 @@ function separateSharedStraightRuns(edges, nodes) {
10066
10152
  e.d = verticesToPath(verts.get(e.id));
10067
10153
  }
10068
10154
  }
10069
- function pullOutgoingFirstCorner(edges, nodes) {
10155
+ function pullOutgoingFirstCorner(edges, nodes, textMetrics = "proportional") {
10070
10156
  if (edges.length < 2) return;
10071
10157
  const \u675F = /* @__PURE__ */ new Map();
10072
10158
  const \u540C\u3058\u7D44\u306E\u6570 = /* @__PURE__ */ new Map();
@@ -10120,10 +10206,10 @@ function pullOutgoingFirstCorner(edges, nodes) {
10120
10206
  }
10121
10207
  e.d = \u524D;
10122
10208
  if (!\u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F) {
10123
- slideLabelsAlongOwnPath(edges, nodes);
10209
+ slideLabelsAlongOwnPath(edges, nodes, textMetrics);
10124
10210
  \u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F = true;
10125
10211
  }
10126
- const labelBox = computeLabelBBoxWorld(e);
10212
+ const labelBox = computeLabelBBoxWorld(e, textMetrics);
10127
10213
  const label = { x: labelBox.x + labelBox.w / 2, y: labelBox.y + labelBox.h / 2 };
10128
10214
  const \u7DDA\u5206\u307E\u3067\u306E\u8DDD\u96E22 = (a, b) => {
10129
10215
  const dx = b.x - a.x;
@@ -10235,13 +10321,13 @@ function fanIncomingEndpoints(edges, nodes) {
10235
10321
  }
10236
10322
  return \u7D42\u70B9\u306E\u79FB\u52D5;
10237
10323
  }
10238
- function followLabelsToFannedTails(edges, obstacles, shifts) {
10324
+ function followLabelsToFannedTails(edges, obstacles, shifts, textMetrics = "proportional") {
10239
10325
  if (shifts.size === 0) return;
10240
10326
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
10241
10327
  const labels = edges.filter(hasRenderedLabel).map((e) => ({
10242
10328
  kind: "edge-label",
10243
10329
  id: e.id,
10244
- ...computeLabelBBoxWorld(e)
10330
+ ...computeLabelBBoxWorld(e, textMetrics)
10245
10331
  }));
10246
10332
  const labelIndexByEdgeId = new Map(labels.map((label, index) => [label.id, index]));
10247
10333
  const edgeById = new Map(edges.map((e) => [e.id, e]));
@@ -10273,7 +10359,7 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
10273
10359
  labelY: e.labelY + \u79FB\u52D5.dy,
10274
10360
  labelAnchor: e.labelAnchor
10275
10361
  };
10276
- const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa });
10362
+ const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa }, textMetrics);
10277
10363
  const \u6700\u5F8C\u306F\u7E26 = Math.abs(\u6700\u5F8C.x2 - \u6700\u5F8C.x1) <= Math.abs(\u6700\u5F8C.y2 - \u6700\u5F8C.y1);
10278
10364
  const \u5019\u88DC = [
10279
10365
  \u5019\u88DCa,
@@ -10284,7 +10370,11 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
10284
10370
  }
10285
10371
  ];
10286
10372
  for (const c of \u5019\u88DC) {
10287
- const \u672D = { kind: "edge-label", id: e.id, ...computeLabelBBoxWorld({ ...e, ...c }) };
10373
+ const \u672D = {
10374
+ kind: "edge-label",
10375
+ id: e.id,
10376
+ ...computeLabelBBoxWorld({ ...e, ...c }, textMetrics)
10377
+ };
10288
10378
  if (segmentsCrossRect([\u6700\u5F8C], \u672D)) continue;
10289
10379
  if (\u672D\u306E\u79FB\u52D5\u3092\u585E\u3050\u76F8\u624B\u3092\u63A2\u3059(\u5468\u308A, \u5143\u306E\u672D, \u672D) !== null) continue;
10290
10380
  e.labelX = c.labelX;
@@ -10478,7 +10568,7 @@ function expandLanesForNodes(lanes, nodes) {
10478
10568
  };
10479
10569
  });
10480
10570
  }
10481
- function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
10571
+ function expandLaneGapsForEdgeLabels(lanes, nodes, edges, textMetrics = "proportional") {
10482
10572
  if (lanes.length < 2) return lanes;
10483
10573
  const layoutedLanes = lanes.filter((l) => !(l.posX !== void 0 && l.posY !== void 0));
10484
10574
  if (layoutedLanes.length < 2) return lanes;
@@ -10494,7 +10584,7 @@ function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
10494
10584
  const fi = laneIndexById.get(fromLane);
10495
10585
  const ti = laneIndexById.get(toLane);
10496
10586
  if (fi === void 0 || ti === void 0 || fi === ti) continue;
10497
- const labelBoxW = computeLabelBoxW(edge.label, edge.sub);
10587
+ const labelBoxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
10498
10588
  if (labelBoxW === 0) continue;
10499
10589
  const lo = Math.min(fi, ti);
10500
10590
  const hi = Math.max(fi, ti);
@@ -10616,7 +10706,7 @@ function \u7DDA\u306E\u7AEF\u306E\u5411\u304D(d, \u7AEF) {
10616
10706
  const \u5019\u88DC = segs.flatMap((s) => [...s.ctrl ?? [], { x: s.x2, y: s.y2 }]);
10617
10707
  return \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC);
10618
10708
  }
10619
- function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
10709
+ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head", textMetrics = "proportional") {
10620
10710
  const text = (\u7AEF === "head" ? edge.headLabel : edge.tailLabel)?.trim();
10621
10711
  if (!text) return null;
10622
10712
  const \u5411\u304D = \u7DDA\u306E\u7AEF\u306E\u5411\u304D(edge.d, \u7AEF);
@@ -10627,7 +10717,8 @@ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
10627
10717
  const w = measureTextWidth(text, {
10628
10718
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
10629
10719
  fontWeight: EDGE_LABEL_TEXT.sub.fontWeight,
10630
- fontFamily: "mono"
10720
+ fontFamily: "mono",
10721
+ textMetrics
10631
10722
  });
10632
10723
  const h = \u7BB1\u306E\u9AD8\u3055;
10633
10724
  const \u672D = hasRenderedLabel(edge) && edge.labelX !== void 0 && edge.labelY !== void 0 ? { x: edge.labelX, y: edge.labelY } : null;
@@ -10676,10 +10767,10 @@ function autoStorageHeight(n, defaultH) {
10676
10767
  }
10677
10768
  return Math.max(defaultH, \u5FC5\u8981);
10678
10769
  }
10679
- function autoRowsWidth(n, defaultW) {
10770
+ function autoRowsWidth(n, defaultW, textMetrics = "proportional") {
10680
10771
  if (n.w != null) return n.w;
10681
10772
  if (!n.rows || n.rows.length === 0) return defaultW;
10682
- const required = requiredRowsWidth(n.rows, n.kind);
10773
+ const required = requiredRowsWidth(n.rows, n.kind, textMetrics);
10683
10774
  return Math.max(defaultW, required);
10684
10775
  }
10685
10776
  function \u7BB1\u306E\u9AD8\u30552(n, \u65E2\u5B9Ah) {
@@ -10717,7 +10808,7 @@ function requiredStackGapForEdgeLabels(diag, allStacks) {
10717
10808
  }
10718
10809
  return required;
10719
10810
  }
10720
- function layoutNodes(diag, lanes) {
10811
+ function layoutNodes(diag, lanes, textMetrics) {
10721
10812
  const laneMap = new Map(lanes.map((l) => [l.id, l]));
10722
10813
  const allStacks = Array.from(new Set(diag.nodes.map((n) => n.stack))).sort((a, b) => a - b);
10723
10814
  const rowH = /* @__PURE__ */ new Map();
@@ -10761,7 +10852,7 @@ function layoutNodes(diag, lanes) {
10761
10852
  }
10762
10853
  const size = NODE_SIZE[n.kind];
10763
10854
  if (n.posX !== void 0 && n.posY !== void 0) {
10764
- const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w);
10855
+ const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w, textMetrics);
10765
10856
  const h2 = n.posH ?? n.h ?? rowH.get(n.stack) ?? size.h;
10766
10857
  out.push({
10767
10858
  ...n,
@@ -10779,7 +10870,7 @@ function layoutNodes(diag, lanes) {
10779
10870
  const \u81EA\u524D\u306E\u9AD8\u3055 = n.rowMarks !== void 0;
10780
10871
  const h = n.h ?? (\u81EA\u524D\u306E\u9AD8\u3055 ? \u7BB1\u306E\u9AD8\u30552(n, size.h) : \u6BB5\u306E\u9AD8\u3055);
10781
10872
  const cy = \u6BB5\u306E\u82AF;
10782
- const w = autoRowsWidth(n, size.w);
10873
+ const w = autoRowsWidth(n, size.w, textMetrics);
10783
10874
  out.push({
10784
10875
  ...n,
10785
10876
  cx,
@@ -10899,10 +10990,16 @@ function applyRowLevelNodeShifts(nodes, lanes, nodeShifts) {
10899
10990
  return moved ? { nodes: outNodes, lanes: outLanes } : null;
10900
10991
  }
10901
10992
  function layout(diag) {
10993
+ const textMetrics = resolveTextMetrics(diag.textMetrics);
10902
10994
  const lanes = layoutLanes(diag);
10903
- const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes));
10995
+ const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes, textMetrics));
10904
10996
  const expandedLanes = expandLanesForNodes(lanes, rawNodes);
10905
- const gapExpandedLanes = expandLaneGapsForEdgeLabels(expandedLanes, rawNodes, diag.edges);
10997
+ const gapExpandedLanes = expandLaneGapsForEdgeLabels(
10998
+ expandedLanes,
10999
+ rawNodes,
11000
+ diag.edges,
11001
+ textMetrics
11002
+ );
10906
11003
  const nodes = rawNodes.map((n) => {
10907
11004
  if (n.posX !== void 0 && n.posY !== void 0) return n;
10908
11005
  const oldLane = lanes.find((l) => l.id === n.lane);
@@ -10911,13 +11008,13 @@ function layout(diag) {
10911
11008
  return { ...n, cx: newLane.x + newLane.width / 2 };
10912
11009
  });
10913
11010
  const containedLanesPre = recomputeContainedLanes(gapExpandedLanes, nodes);
10914
- const edgesPre = layoutEdges(diag, nodes, containedLanesPre);
10915
- const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre);
11011
+ const edgesPre = layoutEdges(diag, nodes, containedLanesPre, textMetrics);
11012
+ const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre, textMetrics);
10916
11013
  const collisionsPre = detectCollisions(bboxesPre, edgesPre);
10917
11014
  const nodesResolved = resolveOverlaps(nodes, collisionsPre);
10918
11015
  const moved = nodesResolved !== nodes;
10919
11016
  const containedLanes = moved ? recomputeContainedLanes(gapExpandedLanes, nodesResolved) : containedLanesPre;
10920
- const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes) : edgesPre;
11017
+ const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes, textMetrics) : edgesPre;
10921
11018
  const chainShiftClearance = Math.max(CLEARANCE_LABEL_LABEL, CLEARANCE_NODE_LABEL);
10922
11019
  let edges;
10923
11020
  let nodesFinal = nodesResolved;
@@ -10928,10 +11025,13 @@ function layout(diag) {
10928
11025
  } else {
10929
11026
  const propagateResult = resolveEdgeLabelOverlapsWithChainAndPropagate(
10930
11027
  edgesAfterMove,
10931
- collectBBoxes(containedLanes, nodesResolved, []).filter(
11028
+ collectBBoxes(containedLanes, nodesResolved, [], textMetrics).filter(
10932
11029
  (b) => b.kind === "node" || b.kind === "lane-label"
10933
11030
  ),
10934
- chainShiftClearance
11031
+ chainShiftClearance,
11032
+ void 0,
11033
+ void 0,
11034
+ textMetrics
10935
11035
  );
10936
11036
  edges = propagateResult.edges;
10937
11037
  if (propagateResult.nodeShifts.size > 0) {
@@ -10943,7 +11043,7 @@ function layout(diag) {
10943
11043
  }
10944
11044
  if (nodesFinal !== nodesResolved) {
10945
11045
  containedLanesFinal = recomputeContainedLanes(laneShiftedBase, nodesFinal);
10946
- edges = layoutEdges(diag, nodesFinal, containedLanesFinal);
11046
+ edges = layoutEdges(diag, nodesFinal, containedLanesFinal, textMetrics);
10947
11047
  }
10948
11048
  }
10949
11049
  const positionedEdgeIds = new Set(
@@ -10951,21 +11051,31 @@ function layout(diag) {
10951
11051
  (e) => e.routing === "curve" || e.routing === "metro" || e.posX1 !== void 0 && e.posY1 !== void 0 && e.posX2 !== void 0 && e.posY2 !== void 0
10952
11052
  ).map((e) => e.id)
10953
11053
  );
10954
- bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds);
10955
- pullOutgoingFirstCorner(edges, nodesFinal);
11054
+ bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds, textMetrics);
11055
+ pullOutgoingFirstCorner(edges, nodesFinal, textMetrics);
10956
11056
  const fannedTailShifts = fanIncomingEndpoints(edges, nodesFinal);
10957
11057
  separateSharedStraightRuns(edges, nodesFinal);
10958
11058
  hopEdgeCrossings(edges);
10959
- const labelClearanceObstacles = collectBBoxes(containedLanesFinal, nodesFinal, []).filter(
11059
+ const labelClearanceObstacles = collectBBoxes(
11060
+ containedLanesFinal,
11061
+ nodesFinal,
11062
+ [],
11063
+ textMetrics
11064
+ ).filter(
10960
11065
  (b) => b.kind === "node" || b.kind === "lane-label"
10961
11066
  );
10962
- followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts);
10963
- repositionParallelLabels(edges, nodesFinal);
10964
- slideLabelsAlongOwnPath(edges, nodesFinal);
11067
+ followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts, textMetrics);
11068
+ repositionParallelLabels(edges, nodesFinal, textMetrics);
11069
+ slideLabelsAlongOwnPath(edges, nodesFinal, textMetrics);
10965
11070
  if (!isChainEdgeLabelDisabled()) {
10966
- edges = resolveLabelClearanceAfterPathPasses(edges, labelClearanceObstacles);
11071
+ edges = resolveLabelClearanceAfterPathPasses(
11072
+ edges,
11073
+ labelClearanceObstacles,
11074
+ void 0,
11075
+ textMetrics
11076
+ );
10967
11077
  }
10968
- const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges);
11078
+ const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges, textMetrics);
10969
11079
  const collisions = detectCollisions(bboxes, edges);
10970
11080
  const nearCollisions = detectNearCollisions(bboxes, edges);
10971
11081
  if (collisions.length > 0) {
@@ -11005,6 +11115,8 @@ function layout(diag) {
11005
11115
  // 描画側の固定の字の言語 (#847)。 既定 (`en`) と型の外の値は持たせない = 配置の結果の形を
11006
11116
  // 変更前と揃え、記法の書き損じで一部の字だけ日本語になる形を作らない
11007
11117
  ...resolveLang(diag.lang) === "ja" ? { lang: "ja" } : {},
11118
+ // 既定は持ち越さない。既存の LaidDiagram の形を変えず、等幅の図だけ描画へ伝える
11119
+ ...textMetrics === "monospace" ? { textMetrics: "monospace" } : {},
11008
11120
  // 種類も配色と同じく空の目印を出さない。 遮断をここに揃えると手書きの図にも効く
11009
11121
  ...diag.type ? { type: diag.type } : {},
11010
11122
  bboxes,
@@ -11913,6 +12025,7 @@ function CdlEdgeView({
11913
12025
  "data-cdl-edge-label": edge.label,
11914
12026
  "data-cdl-edge-sub": edge.sub ?? "",
11915
12027
  "data-cdl-tone": edge.tone,
12028
+ "data-cdl-edge-role": edge.role,
11916
12029
  children: [
11917
12030
  isDotted ? /* @__PURE__ */ jsxs("g", { children: [
11918
12031
  /* @__PURE__ */ jsx("path", { id: glowPathId, d: glowPathD, fill: "none", stroke: "none" }),
@@ -12064,11 +12177,12 @@ function CdlEdgeGlowView({
12064
12177
  }
12065
12178
  function CdlEdgeLabelView({
12066
12179
  edge,
12067
- active
12180
+ active,
12181
+ textMetrics = "proportional"
12068
12182
  }) {
12069
12183
  if (!hasRenderedLabel(edge)) return null;
12070
12184
  const color = edgeColor(edge);
12071
- const bbox = computeLabelBBoxWorld(edge);
12185
+ const bbox = computeLabelBBoxWorld(edge, textMetrics);
12072
12186
  const boxW = bbox.w;
12073
12187
  const boxH = bbox.h;
12074
12188
  const boxLeftX = bbox.x - edge.labelX;
@@ -12084,6 +12198,8 @@ function CdlEdgeLabelView({
12084
12198
  "data-cdl-edge-label-for": edge.id,
12085
12199
  "data-cdl-edge-label-text": edge.label,
12086
12200
  "data-cdl-edge-sub-text": edge.sub ?? "",
12201
+ "data-cdl-tone": edge.tone,
12202
+ "data-cdl-edge-role": edge.role,
12087
12203
  children: [
12088
12204
  edge.labelPlate !== false && /* @__PURE__ */ jsx(
12089
12205
  "rect",
@@ -12137,9 +12253,10 @@ function CdlEdgeLabelView({
12137
12253
  function CdlEdgeEndLabelView({
12138
12254
  edge,
12139
12255
  active,
12140
- \u7AEF
12256
+ \u7AEF,
12257
+ textMetrics = "proportional"
12141
12258
  }) {
12142
- const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF);
12259
+ const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF, textMetrics);
12143
12260
  if (!\u7F6E\u304D\u5834\u6240) return null;
12144
12261
  const color = edgeColor(edge);
12145
12262
  return /* @__PURE__ */ jsx(
@@ -12148,6 +12265,8 @@ function CdlEdgeEndLabelView({
12148
12265
  "data-cdl-role": "edge-end-label",
12149
12266
  "data-cdl-edge-end-label-for": edge.id,
12150
12267
  "data-cdl-edge-end": \u7AEF,
12268
+ "data-cdl-tone": edge.tone,
12269
+ "data-cdl-edge-role": edge.role,
12151
12270
  x: \u7F6E\u304D\u5834\u6240.x,
12152
12271
  y: \u7F6E\u304D\u5834\u6240.y,
12153
12272
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
@@ -12392,12 +12511,18 @@ var SEQ_DOT = 7;
12392
12511
  var SEQ_SELF_W = 52;
12393
12512
  var SEQ_COL_MIN = 200;
12394
12513
  var g4 = (v) => Math.round(v / 4) * 4;
12395
- function sequenceBoardMetrics(data) {
12514
+ function sequenceBoardMetrics(data, textMetrics = "proportional") {
12396
12515
  const \u540D\u5E45 = data.actors.map(
12397
- (a) => Math.max(textWidth(a.name, SEQ_NAME), a.subtitle ? textWidth(a.subtitle, SEQ_SUB) : 0)
12516
+ (a) => Math.max(
12517
+ textWidth(a.name, SEQ_NAME, 0, textMetrics),
12518
+ a.subtitle ? textWidth(a.subtitle, SEQ_SUB, 0, textMetrics) : 0
12519
+ )
12398
12520
  );
12399
12521
  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)));
12522
+ const \u8A9E\u5E45 = Math.max(
12523
+ 0,
12524
+ ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL, 0, textMetrics))
12525
+ );
12401
12526
  const gutter = g4(SEQ_EDGE + SEQ_GUTTER_PAD + \u8A9E\u5E45 + SEQ_GUTTER_GAP);
12402
12527
  const headY = SEQ_EDGE + SEQ_HEAD;
12403
12528
  const rowY = (i) => headY + SEQ_ROW_PAD + i * SEQ_ROW;
@@ -12410,11 +12535,12 @@ function sequenceBoardMetrics(data) {
12410
12535
  }
12411
12536
  function SequenceBoardNode({
12412
12537
  node,
12413
- stateValues
12538
+ stateValues,
12539
+ textMetrics = "proportional"
12414
12540
  }) {
12415
12541
  const data = node.sequenceData;
12416
12542
  if (!data) return /* @__PURE__ */ jsx("g", { "data-cdl-role": "sequence-board" });
12417
- const m = sequenceBoardMetrics(data);
12543
+ const m = sequenceBoardMetrics(data, textMetrics);
12418
12544
  const x = node.cx - node.w / 2;
12419
12545
  const y = node.cy - node.h / 2;
12420
12546
  const \u73FE\u5728 = (() => {
@@ -13065,7 +13191,8 @@ function GenericNode({
13065
13191
  active,
13066
13192
  value,
13067
13193
  stateValues,
13068
- \u5024\u306E\u540D\u524D
13194
+ \u5024\u306E\u540D\u524D,
13195
+ textMetrics = "proportional"
13069
13196
  }) {
13070
13197
  const base = STYLES[node.kind] ?? FALLBACK;
13071
13198
  const toned = toneColor3(node.tone);
@@ -13204,7 +13331,7 @@ function GenericNode({
13204
13331
  const resolved = node.rows.map((row) => interpolate(row, stateValues, \u5024\u306E\u540D\u524D));
13205
13332
  const splits = resolved.map(splitRow);
13206
13333
  const leftMaxWidth = splits.reduce(
13207
- (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
13334
+ (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false, textMetrics)),
13208
13335
  0
13209
13336
  );
13210
13337
  const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
@@ -13688,8 +13815,8 @@ function \u5024\u3068\u5272\u5408\u306E\u6587\u5B57(\u5024, \u5272\u5408, \u5408
13688
13815
  return \u7D44.\u5024 === null ? \u7D44.\u5272\u5408 : `${\u7D44.\u5024} ${\u7D44.\u5272\u5408}`;
13689
13816
  }
13690
13817
  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);
13818
+ function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587, textMetrics = "proportional") {
13819
+ 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
13820
  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
13821
  }
13695
13822
  function ChartPieNode({
@@ -13697,7 +13824,8 @@ function ChartPieNode({
13697
13824
  active,
13698
13825
  stateValues = {},
13699
13826
  drawing = false,
13700
- progress = 1
13827
+ progress = 1,
13828
+ textMetrics = "proportional"
13701
13829
  }) {
13702
13830
  const instanceId = useId().replace(/[^A-Za-z0-9_-]/g, "");
13703
13831
  const x0 = node.cx - node.w / 2;
@@ -13728,15 +13856,26 @@ function ChartPieNode({
13728
13856
  return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
13729
13857
  });
13730
13858
  if (\u5F62 !== "ring") {
13731
- const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
13859
+ const \u5171\u901A = {
13860
+ node,
13861
+ active,
13862
+ data,
13863
+ \u5272\u5408: \u4ECA\u306E\u5272\u5408,
13864
+ x0,
13865
+ y0,
13866
+ drawing,
13867
+ progress,
13868
+ instanceId,
13869
+ textMetrics
13870
+ };
13732
13871
  return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
13733
13872
  }
13734
13873
  const \u540D\u672D\u5E45 = Math.max(
13735
13874
  0,
13736
13875
  ...data.map(
13737
13876
  (_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)
13877
+ textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A, 0, textMetrics),
13878
+ textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics)
13740
13879
  )
13741
13880
  )
13742
13881
  );
@@ -13751,8 +13890,8 @@ function ChartPieNode({
13751
13890
  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
13891
  const \u7A74 = \u524D\u3042\u308A ? \u524D\u306E\u5185\u534A\u5F84 : \u5916\u306E\u5185\u534A\u5F84;
13753
13892
  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");
13893
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587, textMetrics);
13894
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08", textMetrics);
13756
13895
  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
13896
  const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
13758
13897
  const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
@@ -13935,14 +14074,24 @@ function \u67A0(node, active) {
13935
14074
  }
13936
14075
  );
13937
14076
  }
13938
- function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
14077
+ function \u5F27\u306E\u5F62({
14078
+ node,
14079
+ active,
14080
+ data,
14081
+ \u5272\u5408,
14082
+ x0,
14083
+ y0,
14084
+ drawing,
14085
+ progress,
14086
+ textMetrics
14087
+ }) {
13939
14088
  const PAD = 20;
13940
14089
  const \u540D\u524D\u306E\u7D1A = 14;
13941
14090
  const \u5272\u5408\u306E\u7D1A = 24;
13942
14091
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
13943
14092
  const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
13944
14093
  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)));
14094
+ 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
14095
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
13947
14096
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
13948
14097
  const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
@@ -14028,7 +14177,18 @@ function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14028
14177
  })
14029
14178
  ] });
14030
14179
  }
14031
- function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
14180
+ function \u8868\u306E\u5F62({
14181
+ node,
14182
+ active,
14183
+ data,
14184
+ \u5272\u5408,
14185
+ x0,
14186
+ y0,
14187
+ drawing,
14188
+ progress,
14189
+ instanceId,
14190
+ textMetrics
14191
+ }) {
14032
14192
  const PAD = 20;
14033
14193
  const \u898B\u51FA\u3057\u306E\u7D1A = 11;
14034
14194
  const \u540D\u524D\u306E\u7D1A = 15;
@@ -14037,9 +14197,18 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14037
14197
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
14038
14198
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
14039
14199
  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)));
14200
+ const \u540D\u524D\u5E45 = Math.max(
14201
+ 0,
14202
+ ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics))
14203
+ );
14204
+ const \u5272\u5408\u5E45 = Math.max(
14205
+ textWidth("\u5272\u5408", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
14206
+ ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A, 0, textMetrics))
14207
+ );
14208
+ const \u5B9F\u6570\u5E45 = Math.max(
14209
+ textWidth("\u5024", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
14210
+ ...\u5B9F\u6570\u306E\u6587\u5B57.map((t) => textWidth(t, \u5B9F\u6570\u306E\u7D1A, 0, textMetrics))
14211
+ );
14043
14212
  const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
14044
14213
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
14045
14214
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
@@ -14048,8 +14217,8 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14048
14217
  const cx = PAD + R;
14049
14218
  const cy = node.h / 2;
14050
14219
  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");
14220
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587, textMetrics);
14221
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08", textMetrics);
14053
14222
  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
14223
  const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
14055
14224
  const \u53F3\u7AEF = node.w - PAD;
@@ -14180,7 +14349,8 @@ function ChartGaugeNode({
14180
14349
  active,
14181
14350
  stateValues = {},
14182
14351
  drawing = false,
14183
- progress = 1
14352
+ progress = 1,
14353
+ textMetrics = "proportional"
14184
14354
  }) {
14185
14355
  const x0 = node.cx - node.w / 2;
14186
14356
  const y0 = node.cy - node.h / 2;
@@ -14199,7 +14369,10 @@ function ChartGaugeNode({
14199
14369
  const \u533A\u753B\u306E\u9593 = 12;
14200
14370
  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
14371
  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;
14372
+ const \u5E45 = Math.max(
14373
+ \u5370\u306E\u5E452,
14374
+ ...\u4EF6\u305F\u3061.map((d) => textWidth(\u6570\u5024\u306E\u884C(d), \u6570\u5024\u306E\u7D1A, 0, textMetrics))
14375
+ ) + \u533A\u753B\u306E\u9593;
14203
14376
  const \u884C\u306E\u4EF6\u65702 = Math.min(
14204
14377
  Math.max(1, Math.floor(\u4F7F\u3048\u308B\u5E452 / Math.max(\u5E45, 1))),
14205
14378
  Math.max(\u4EF6\u305F\u3061.length, 1)
@@ -14274,7 +14447,7 @@ function ChartGaugeNode({
14274
14447
  return { d, frac, path: \u6247\u306E\u9053(a0, a1, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5916\u534A\u5F84) };
14275
14448
  });
14276
14449
  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;
14450
+ const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100, 0, textMetrics), 1) / 100;
14278
14451
  const \u7D1A\u306E\u5019\u88DC = Math.min(
14279
14452
  // 横 = 字の上の角が内側の円に入る大きさ
14280
14453
  \u5185\u534A\u5F84 / Math.sqrt((\u5358\u4F4D\u5E45 / 2) ** 2 + 1.25 ** 2),
@@ -14367,7 +14540,7 @@ function ChartGaugeNode({
14367
14540
  const y = \u5185\u8A33\u306Ey + \u6BB5\u306E\u9AD8\u3055 * \u6BB5;
14368
14541
  const \u53CE\u307E\u308B\u5E45 = \u5185\u8A33\u306E\u5E45 - \u533A\u753B\u306E\u9593;
14369
14542
  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);
14543
+ 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
14544
  return /* @__PURE__ */ jsxs("g", { "data-cdl-role": "chart-gauge-item", children: [
14372
14545
  /* @__PURE__ */ jsx(
14373
14546
  "rect",
@@ -14388,7 +14561,7 @@ function ChartGaugeNode({
14388
14561
  fontSize: \u540D\u524D\u306E\u7D1A,
14389
14562
  fontWeight: 700,
14390
14563
  fill: "var(--cdl-text, #1a1f2a)",
14391
- children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A)
14564
+ children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A, textMetrics)
14392
14565
  }
14393
14566
  ),
14394
14567
  /* @__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 +14579,12 @@ function ChartGaugeNode({
14406
14579
  function \u6975(cx, cy, r, a) {
14407
14580
  return { x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) };
14408
14581
  }
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);
14582
+ function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A, textMetrics = "proportional") {
14583
+ if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A, 0, textMetrics) <= \u4E0A\u9650) return s;
14584
+ const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A, 0, textMetrics);
14412
14585
  let out = "";
14413
14586
  for (const c of s) {
14414
- if (textWidth(out + c, \u7D1A) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
14587
+ if (textWidth(out + c, \u7D1A, 0, textMetrics) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
14415
14588
  out += c;
14416
14589
  }
14417
14590
  return `${out}\u2026`;
@@ -14425,7 +14598,8 @@ function ChartRadialNode({
14425
14598
  active,
14426
14599
  stateValues = {},
14427
14600
  drawing = false,
14428
- progress = 1
14601
+ progress = 1,
14602
+ textMetrics = "proportional"
14429
14603
  }) {
14430
14604
  const x0 = node.cx - node.w / 2;
14431
14605
  const y0 = node.cy - node.h / 2;
@@ -14443,7 +14617,10 @@ function ChartRadialNode({
14443
14617
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E45 + Math.max(
14444
14618
  0,
14445
14619
  ...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))
14620
+ (d, i) => Math.max(
14621
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
14622
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
14623
+ )
14447
14624
  )
14448
14625
  );
14449
14626
  const \u5F27\u306B\u4F7F\u3048\u308B\u5E45 = node.w - PAD * 2 - \u4E00\u89A7\u306E\u5E45 - \u4E00\u89A7\u3068\u5F27\u306E\u9593;
@@ -14590,7 +14767,8 @@ function arcColor2(tone, idx) {
14590
14767
  function ChartStatNode({
14591
14768
  node,
14592
14769
  active,
14593
- stateValues = {}
14770
+ stateValues = {},
14771
+ textMetrics = "proportional"
14594
14772
  }) {
14595
14773
  const x0 = node.cx - node.w / 2;
14596
14774
  const y0 = node.cy - node.h / 2;
@@ -14619,7 +14797,13 @@ function ChartStatNode({
14619
14797
  const frac = total > 0 ? d.value / total : 0;
14620
14798
  const \u8272 = \u5370\u306E\u8272(d.tone, idx);
14621
14799
  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);
14800
+ const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(
14801
+ \u6570\u5024,
14802
+ \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
14803
+ \u533A\u753B.\u6570\u5024\u306E\u7D1A,
14804
+ \u533A\u753B.\u540D\u524D\u306E\u7D1A + 1,
14805
+ textMetrics
14806
+ );
14623
14807
  return /* @__PURE__ */ jsxs(
14624
14808
  "g",
14625
14809
  {
@@ -14676,7 +14860,8 @@ function ChartStatNode({
14676
14860
  `\u524D ${\u5B9F\u5024\u8868\u8A18(d.previous)}`,
14677
14861
  \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
14678
14862
  \u533A\u753B.\u524D\u306E\u7D1A,
14679
- 8
14863
+ 8,
14864
+ textMetrics
14680
14865
  ),
14681
14866
  textAnchor: "middle",
14682
14867
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -14765,9 +14950,9 @@ function \u533A\u753B\u306E\u5272\u4ED8(w, h, \u4EF6\u6570, \u524D\u3092\u51FA\u
14765
14950
  \u67A0: (idx) => ({ x: \u5E45 * idx, y: 0, w: \u5E45, h })
14766
14951
  };
14767
14952
  }
14768
- function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650) {
14953
+ function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650, textMetrics = "proportional") {
14769
14954
  let \u7D1A = \u521D\u671F;
14770
- while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
14955
+ while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A, 0, textMetrics) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
14771
14956
  return \u7D1A;
14772
14957
  }
14773
14958
  function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
@@ -14802,7 +14987,8 @@ function ChartWaffleNode({
14802
14987
  active,
14803
14988
  stateValues = {},
14804
14989
  drawing = false,
14805
- progress = 1
14990
+ progress = 1,
14991
+ textMetrics = "proportional"
14806
14992
  }) {
14807
14993
  const x0 = node.cx - node.w / 2;
14808
14994
  const y0 = node.cy - node.h / 2;
@@ -14821,7 +15007,10 @@ function ChartWaffleNode({
14821
15007
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E452 + Math.max(
14822
15008
  0,
14823
15009
  ...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))
15010
+ (d, i) => Math.max(
15011
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
15012
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
15013
+ )
14825
15014
  )
14826
15015
  );
14827
15016
  const \u4F7F\u3048\u308B\u9AD8\u3055 = node.h - PAD * 2;
@@ -14923,7 +15112,8 @@ function ChartStackedBarNode({
14923
15112
  active,
14924
15113
  stateValues = {},
14925
15114
  drawing = false,
14926
- progress = 1
15115
+ progress = 1,
15116
+ textMetrics = "proportional"
14927
15117
  }) {
14928
15118
  const x0 = node.cx - node.w / 2;
14929
15119
  const y0 = node.cy - node.h / 2;
@@ -14933,7 +15123,7 @@ function ChartStackedBarNode({
14933
15123
  const \u540D\u524D\u306E\u7D1A = 13;
14934
15124
  const \u533A\u753B\u306E\u7D1A = 12;
14935
15125
  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);
15126
+ 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
15127
  const \u5E2F\u306E\u5DE6 = PAD + \u6642\u70B9\u306E\u5E45;
14938
15128
  const \u5E2F\u306E\u5E45 = Math.max(40, node.w - \u5E2F\u306E\u5DE6 - PAD);
14939
15129
  const \u5E2F\u306E\u9AD8\u3055 = 44;
@@ -15026,7 +15216,7 @@ function ChartStackedBarNode({
15026
15216
  })()
15027
15217
  ] }, `bar-${\u6BB5}`);
15028
15218
  }),
15029
- \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A).map(({ d, idx, x, \u884C }) => {
15219
+ \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A, textMetrics).map(({ d, idx, x, \u884C }) => {
15030
15220
  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
15221
  return /* @__PURE__ */ jsxs("g", { "data-cdl-role": "chart-stacked-bar-legend", children: [
15032
15222
  /* @__PURE__ */ jsx("rect", { x, y: y - 5, width: 10, height: 10, rx: 2, fill: \u5370\u306E\u82723(d.tone, idx) }),
@@ -15061,12 +15251,12 @@ function \u5370\u306E\u82723(tone, idx) {
15061
15251
  }
15062
15252
  var \u5370\u304B\u3089\u540D\u524D\u307E\u3067 = 16;
15063
15253
  var \u4EF6\u306E\u9593 = 10;
15064
- function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A) {
15254
+ function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A, textMetrics = "proportional") {
15065
15255
  const out = [];
15066
15256
  let x = \u5DE6;
15067
15257
  let \u884C = 0;
15068
15258
  data.forEach((d, idx) => {
15069
- const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A);
15259
+ const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A, 0, textMetrics);
15070
15260
  if (x > \u5DE6 && x + \u5E45 > \u53F3\u7AEF) {
15071
15261
  \u884C += 1;
15072
15262
  x = \u5DE6;
@@ -15082,7 +15272,8 @@ function ChartSlopeNode({
15082
15272
  active,
15083
15273
  stateValues = {},
15084
15274
  drawing = false,
15085
- progress = 1
15275
+ progress = 1,
15276
+ textMetrics = "proportional"
15086
15277
  }) {
15087
15278
  const x0 = node.cx - node.w / 2;
15088
15279
  const y0 = node.cy - node.h / 2;
@@ -15125,16 +15316,22 @@ function ChartSlopeNode({
15125
15316
  const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
15126
15317
  (s) => \u5F62 === "delta" ? \u5897\u6E1B\u8868\u8A18(s.\u524D, s.\u4ECA) : \u5B9F\u5024\u8868\u8A18(s.\u4ECA)
15127
15318
  );
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)));
15319
+ const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
15320
+ const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
15130
15321
  const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
15131
15322
  0,
15132
15323
  (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
15324
  );
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);
15325
+ const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(
15326
+ \u7CFB\u5217\u305F\u3061.map((s) => s.\u540D\u524D),
15327
+ \u540D\u524D\u306B\u4F7F\u3048\u308B,
15328
+ \u540D\u524D\u306E\u4E0A\u9650\u7D1A,
15329
+ \u540D\u524D\u306E\u4E0B\u9650\u7D1A,
15330
+ textMetrics
15331
+ );
15135
15332
  const \u540D\u524D\u5E45 = Math.min(
15136
15333
  \u540D\u524D\u306B\u4F7F\u3048\u308B,
15137
- Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A)))
15334
+ Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A, 0, textMetrics)))
15138
15335
  );
15139
15336
  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
15337
  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 +15517,12 @@ function \u5370\u306E\u82724(tone, idx) {
15320
15517
  if (tone) return TONE[tone];
15321
15518
  return chartSeriesColor(idx);
15322
15519
  }
15323
- function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650) {
15520
+ function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650, textMetrics = "proportional") {
15324
15521
  if (\u540D\u524D\u305F\u3061.length === 0) return \u4E0A\u9650;
15325
15522
  let \u7D1A = \u4E0A\u9650;
15326
- while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A))) > \u5E45) \u7D1A -= 1;
15523
+ while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A, 0, textMetrics))) > \u5E45) {
15524
+ \u7D1A -= 1;
15525
+ }
15327
15526
  return \u7D1A;
15328
15527
  }
15329
15528
  function \u5C0F\u6570\u306E\u6841(n) {
@@ -15371,6 +15570,7 @@ function ChartBarNode({
15371
15570
  return { y: yAt(v), value: v };
15372
15571
  });
15373
15572
  const \u6FC3\u3055 = (v) => vMax > 0 ? v >= vMax ? 1 : 0.45 : 0.9;
15573
+ const \u4E3B\u5F79\u306E\u68D2\u304B = (v) => vMax > 0 && v >= vMax;
15374
15574
  const \u89D2\u4E38 = Math.min(barW * 0.06, 8);
15375
15575
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
15376
15576
  const \u6A2A\u8EF8\u306Ey = PAD_TOP2 + canvasH;
@@ -15437,6 +15637,7 @@ function ChartBarNode({
15437
15637
  {
15438
15638
  "data-cdl-role": "chart-bar",
15439
15639
  "data-cdl-unresolved": d.unresolved ? "true" : void 0,
15640
+ "data-cdl-emphasis": \u4E3B\u5F79\u306E\u68D2\u304B(d.value) ? "primary" : void 0,
15440
15641
  x: bx,
15441
15642
  y: by,
15442
15643
  width: barW,
@@ -15783,7 +15984,8 @@ function FunnelNode({
15783
15984
  active,
15784
15985
  stateValues = {},
15785
15986
  drawing = false,
15786
- progress = 1
15987
+ progress = 1,
15988
+ textMetrics = "proportional"
15787
15989
  }) {
15788
15990
  const x0 = node.cx - node.w / 2;
15789
15991
  const y0 = node.cy - node.h / 2;
@@ -15832,7 +16034,11 @@ function FunnelNode({
15832
16034
  const \u540D\u524D\u306E\u5B9F\u5B57 = \u540D\u524D\u306E\u5B57 * \u7E26\u500D;
15833
16035
  const \u88DC\u8DB3\u306E\u67A0\u5B57 = \u88DC\u8DB3\u306E\u5B57 * \u7E26\u500D;
15834
16036
  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);
16037
+ const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(
16038
+ \u88DC\u8DB3,
16039
+ { fontSize: \u88DC\u8DB3\u306E\u67A0\u5B57, fontWeight: 500, textMetrics },
16040
+ \u53CE\u307E\u308B\u5E45
16041
+ );
15836
16042
  const \u584A\u306E\u4E0A = y + stageH / 2 - (\u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 1.25) / 2;
15837
16043
  const \u540D\u524D\u306Ey = \u88DC\u8DB3\u3042\u308A ? \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 0.95 : y + stageH / 2 + 5;
15838
16044
  const \u88DC\u8DB3\u306Ey = \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 0.95;
@@ -15935,7 +16141,8 @@ function \u7573\u3093\u3060\u6587(\u4EF6\u6570) {
15935
16141
  function QuadrantNode({
15936
16142
  node,
15937
16143
  active,
15938
- stateValues = {}
16144
+ stateValues = {},
16145
+ textMetrics = "proportional"
15939
16146
  }) {
15940
16147
  const x0 = node.cx - node.w / 2;
15941
16148
  const y0 = node.cy - node.h / 2;
@@ -15954,7 +16161,10 @@ function QuadrantNode({
15954
16161
  const SUB_FONT = 10;
15955
16162
  const axisLabelPad = (text) => Math.max(
15956
16163
  PAD_MIN,
15957
- measureTextWidth(`\u2190 ${text}`, { fontSize: AXIS_LABEL_FONT}) + 12
16164
+ measureTextWidth(`\u2190 ${text}`, {
16165
+ fontSize: AXIS_LABEL_FONT,
16166
+ textMetrics
16167
+ }) + 12
15958
16168
  );
15959
16169
  const padBudget = Math.max(0, node.w * 0.5 - PAD_MIN * 2);
15960
16170
  const wantLeft = axisLabelPad(data.xAxis.left) - PAD_MIN;
@@ -16208,7 +16418,11 @@ function QuadrantNode({
16208
16418
  ITEM_MIN_W,
16209
16419
  Math.max(
16210
16420
  ...\u884C\u30892.map(
16211
- (r) => measureTextWidth(r.text, { fontSize: r.size, fontWeight: r.weight })
16421
+ (r) => measureTextWidth(r.text, {
16422
+ fontSize: r.size,
16423
+ fontWeight: r.weight,
16424
+ textMetrics
16425
+ })
16212
16426
  )
16213
16427
  ) + ITEM_PAD_X * 2
16214
16428
  )
@@ -16234,7 +16448,7 @@ function QuadrantNode({
16234
16448
  const \u88DC\u8DB3 = (it.subtitle ?? "").trim();
16235
16449
  const \u88DC\u8DB3\u306E\u5B57 = SUB_FONT * \u53CE\u3081\u308B\u500D\u7387(
16236
16450
  \u88DC\u8DB3,
16237
- { fontSize: SUB_FONT, fontWeight: 500 },
16451
+ { fontSize: SUB_FONT, fontWeight: 500, textMetrics },
16238
16452
  Math.max(0, \u5E45 - ITEM_PAD_X * 2)
16239
16453
  );
16240
16454
  return /* @__PURE__ */ jsxs("g", { children: [
@@ -16638,24 +16852,30 @@ var EYEBROW_GAP2 = 8;
16638
16852
  var EYEBROW_TRACKING = 2;
16639
16853
  var SUB_SIZE = 11;
16640
16854
  var SUB_GAP = 4;
16641
- function labelBlock(node, pos, size, band) {
16855
+ function labelBlock(node, pos, size, band, textMetrics = "proportional") {
16642
16856
  const \u4E0A = node.eyebrow ? size + EYEBROW_GAP2 + EYEBROW_SIZE2 * ASCENT2 : size * ASCENT2;
16643
16857
  const \u4E0B = node.subtitle ? size + SUB_GAP + SUB_SIZE * DESCENT2 : size * DESCENT2;
16644
16858
  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
16859
+ textWidth(node.title ?? "", size, 0, textMetrics),
16860
+ node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING, textMetrics) : 0,
16861
+ node.subtitle ? textWidth(node.subtitle, SUB_SIZE, 0, textMetrics) : 0
16648
16862
  );
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;
16863
+ const \u984C\u5E45 = textWidth(node.title ?? "", size, 0, textMetrics);
16864
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
16865
+ const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, \u6E2C\u308B) : 0;
16651
16866
  const { k, x, y: baseline } = fitLabel(band, { \u4E0A, \u4E0B, \u5E45 }, pos, \u4E0B\u9650);
16652
16867
  return { k, x, baseline, \u4E0A\u7AEF: baseline - \u4E0A * k, \u4E0B\u7AEF: baseline + \u4E0B * k };
16653
16868
  }
16654
- function commonLabel(node, pos, size, band) {
16655
- const \u584A = labelBlock(node, pos, size, band);
16869
+ function commonLabel(node, pos, size, band, textMetrics = "proportional") {
16870
+ const \u584A = labelBlock(node, pos, size, band, textMetrics);
16656
16871
  const k = \u584A.k;
16657
16872
  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));
16873
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
16874
+ t,
16875
+ \u5927\u304D\u3055 * k,
16876
+ band.w,
16877
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
16878
+ );
16659
16879
  return /* @__PURE__ */ jsxs(Fragment, { children: [
16660
16880
  node.eyebrow && /* @__PURE__ */ jsx(
16661
16881
  "text",
@@ -16706,7 +16926,7 @@ var RULE_GAP_RATIO = 0.1;
16706
16926
  var RULE_PAD_MAX = 20;
16707
16927
  var RULE_PAD_RATIO = 0.14;
16708
16928
  var RULE_SHRINK_RATIO = 0.055;
16709
- function ShapeFileNode({ node, active }) {
16929
+ function ShapeFileNode({ node, active, textMetrics = "proportional" }) {
16710
16930
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16711
16931
  const \u7D19h = \u5E2F.h;
16712
16932
  const \u7D19w = Math.min(\u5E2F.w, \u7D19h * 0.72);
@@ -16726,7 +16946,7 @@ function ShapeFileNode({ node, active }) {
16726
16946
  const foldTriangle = `M ${x + \u7D19w - fold} ${y} L ${x + \u7D19w} ${y + fold} L ${x + \u7D19w - fold} ${y + fold} Z`;
16727
16947
  const \u540D\u524D\u5E2F = { x, y, w: \u7D19w, h: \u7D19h };
16728
16948
  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);
16949
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics);
16730
16950
  const \u9593\u9694 = Math.min(RULE_GAP_MAX, \u7D19h * RULE_GAP_RATIO);
16731
16951
  const \u7DDA\u4F59\u767D = Math.min(RULE_PAD_MAX, \u7D19w * RULE_PAD_RATIO);
16732
16952
  const textLines = [0, 1, 2].map((i) => ({ i, ly: y + fold + \u9593\u9694 * (i + 1) })).filter(({ ly }) => ly < \u540D\u524D.\u4E0A\u7AEF);
@@ -16758,12 +16978,12 @@ function ShapeFileNode({ node, active }) {
16758
16978
  i
16759
16979
  );
16760
16980
  }),
16761
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F)
16981
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics)
16762
16982
  ] });
16763
16983
  }
16764
16984
  var TAB_H_MAX = 22;
16765
16985
  var TAB_H_RATIO = 0.3;
16766
- function ShapeFolderNode({ node, active }) {
16986
+ function ShapeFolderNode({ node, active, textMetrics = "proportional" }) {
16767
16987
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16768
16988
  const x = \u5E2F.x;
16769
16989
  const y = \u5E2F.y;
@@ -16784,7 +17004,7 @@ function ShapeFolderNode({ node, active }) {
16784
17004
  const \u5883\u754Cy = y + tabH + Math.min(8, (\u5E2F.h - tabH) * 0.2);
16785
17005
  const \u7AEF = Math.min(6, \u5E2F.w * 0.1);
16786
17006
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 18 };
16787
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F);
17007
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics);
16788
17008
  return /* @__PURE__ */ jsxs("g", { children: [
16789
17009
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, \u5E2F.w * 0.44),
16790
17010
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -16800,13 +17020,13 @@ function ShapeFolderNode({ node, active }) {
16800
17020
  opacity: 0.35
16801
17021
  }
16802
17022
  ),
16803
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F)
17023
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics)
16804
17024
  ] });
16805
17025
  }
16806
17026
  var CLOUD_VB_W = 640;
16807
17027
  var CLOUD_VB_H = 512;
16808
17028
  var CLOUD_W_RATIO = 0.9;
16809
- function ShapeCloudNode({ node, active }) {
17029
+ function ShapeCloudNode({ node, active, textMetrics = "proportional" }) {
16810
17030
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16811
17031
  const frame = commonFrame(active);
16812
17032
  const \u7D20\u306E\u500D\u7387 = Math.min(\u5E2F.h / CLOUD_VB_H, \u5E2F.w * CLOUD_W_RATIO / CLOUD_VB_W);
@@ -16829,13 +17049,13 @@ function ShapeCloudNode({ node, active }) {
16829
17049
  strokeLinejoin: "round"
16830
17050
  }
16831
17051
  ) }),
16832
- commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F)
17052
+ commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F, textMetrics)
16833
17053
  ] });
16834
17054
  }
16835
17055
  var CYLINDER_RY_MAX = 18;
16836
17056
  var CYLINDER_RY_RATIO = 0.1;
16837
17057
  var CYLINDER_DISKS = [0.3, 0.55, 0.8];
16838
- function ShapeCylinderNode({ node, active }) {
17058
+ function ShapeCylinderNode({ node, active, textMetrics = "proportional" }) {
16839
17059
  const \u5E2F = bodyBand(node, { \u5F71ry: CYLINDER_SHADOW_RY });
16840
17060
  const x = \u5E2F.x;
16841
17061
  const y = \u5E2F.y;
@@ -16852,7 +17072,7 @@ function ShapeCylinderNode({ node, active }) {
16852
17072
  const \u84CB\u5E95 = y + ry * 2;
16853
17073
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 6 };
16854
17074
  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);
17075
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics);
16856
17076
  return /* @__PURE__ */ jsxs("g", { children: [
16857
17077
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, rx * 0.85, CYLINDER_SHADOW_RY),
16858
17078
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -16876,11 +17096,11 @@ function ShapeCylinderNode({ node, active }) {
16876
17096
  },
16877
17097
  i
16878
17098
  )),
16879
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F)
17099
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics)
16880
17100
  ] });
16881
17101
  }
16882
17102
  var HEX_DOT_R = 2.5;
16883
- function ShapeHexagonNode({ node, active }) {
17103
+ function ShapeHexagonNode({ node, active, textMetrics = "proportional" }) {
16884
17104
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY, \u5916: Math.max(HEX_DOT_R, FRAME_HALF) });
16885
17105
  const cx = \u5E2F.cx;
16886
17106
  const cy = \u5E2F.cy;
@@ -16903,11 +17123,12 @@ function ShapeHexagonNode({ node, active }) {
16903
17123
  node,
16904
17124
  { x: cx, y: node.cy + 6 },
16905
17125
  16,
16906
- { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h }
17126
+ { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h },
17127
+ textMetrics
16907
17128
  )
16908
17129
  ] });
16909
17130
  }
16910
- function ShapeDiamondNode({ node, active }) {
17131
+ function ShapeDiamondNode({ node, active, textMetrics = "proportional" }) {
16911
17132
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16912
17133
  const cx = \u5E2F.cx;
16913
17134
  const cy = \u5E2F.cy;
@@ -16948,13 +17169,14 @@ function ShapeDiamondNode({ node, active }) {
16948
17169
  y: cy - \u5E2F.h * innerScale / 4,
16949
17170
  w: \u5E2F.w * innerScale / 2,
16950
17171
  h: \u5E2F.h * innerScale / 2
16951
- }
17172
+ },
17173
+ textMetrics
16952
17174
  )
16953
17175
  ] });
16954
17176
  }
16955
17177
  var STACK_OFFSET_MAX = 12;
16956
17178
  var STACK_OFFSET_RATIO = 0.15;
16957
- function ShapeStackNode({ node, active }) {
17179
+ function ShapeStackNode({ node, active, textMetrics = "proportional" }) {
16958
17180
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16959
17181
  const x = \u5E2F.x;
16960
17182
  const y = \u5E2F.y;
@@ -17008,7 +17230,8 @@ function ShapeStackNode({ node, active }) {
17008
17230
  node,
17009
17231
  { x: \u624B\u524Dcx, y: node.cy + \u305A\u308C + 6 },
17010
17232
  15,
17011
- { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH }
17233
+ { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH },
17234
+ textMetrics
17012
17235
  )
17013
17236
  ] });
17014
17237
  }
@@ -17020,16 +17243,22 @@ var PERSON_BODY_LEN = 90;
17020
17243
  var PERSON_SHADOW_DY = 20;
17021
17244
  var PERSON_SHADOW_RY = 4;
17022
17245
  var PERSON_SHADOW_RX = 55;
17023
- function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
17246
+ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan, textMetrics = "proportional") {
17024
17247
  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
17248
+ textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics),
17249
+ node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING, textMetrics) : 0,
17250
+ node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size, 0, textMetrics) : 0
17028
17251
  );
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;
17252
+ const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics);
17253
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
17254
+ 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
17255
  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));
17256
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
17257
+ t,
17258
+ \u5927\u304D\u3055 * k,
17259
+ \u5E45\u4E0A\u9650,
17260
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
17261
+ );
17033
17262
  return /* @__PURE__ */ jsxs(Fragment, { children: [
17034
17263
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsx(
17035
17264
  "text",
@@ -17070,7 +17299,7 @@ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
17070
17299
  )
17071
17300
  ] });
17072
17301
  }
17073
- function ShapePersonNode({ node, active }) {
17302
+ function ShapePersonNode({ node, active, textMetrics = "proportional" }) {
17074
17303
  const r = shapeRegion(node);
17075
17304
  const cx = r.cx;
17076
17305
  const strokeColor = active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)";
@@ -17132,7 +17361,7 @@ function ShapePersonNode({ node, active }) {
17132
17361
  )
17133
17362
  ] })
17134
17363
  ),
17135
- planLabel(node, r.cx, Math.max(0, node.w), r.label)
17364
+ planLabel(node, r.cx, Math.max(0, node.w), r.label, textMetrics)
17136
17365
  ] });
17137
17366
  }
17138
17367
  var commonFrame2 = (active) => ({
@@ -17382,7 +17611,12 @@ function ShapeTerminalNode({ node, active, lang }) {
17382
17611
  )
17383
17612
  ] });
17384
17613
  }
17385
- function ShapeCodeBlockNode({ node, active, lang }) {
17614
+ function ShapeCodeBlockNode({
17615
+ node,
17616
+ active,
17617
+ lang,
17618
+ textMetrics = "proportional"
17619
+ }) {
17386
17620
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
17387
17621
  const frame = commonFrame2(active);
17388
17622
  const \u7DDA = frame.strokeWidth / 2;
@@ -17393,7 +17627,10 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17393
17627
  const lineFont = "ui-monospace, SFMono-Regular, Menlo, monospace";
17394
17628
  const \u672D = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("codeBlock.fileName"));
17395
17629
  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));
17630
+ const \u30BF\u30D6\u5E45 = Math.min(
17631
+ Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0, textMetrics) + 24),
17632
+ Math.max(0, w)
17633
+ );
17397
17634
  const \u30BF\u30D6\u9AD8 = 24;
17398
17635
  const \u89D2 = 10;
17399
17636
  const \u6E9D = 32;
@@ -17433,7 +17670,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17433
17670
  { text: \u672D, size: \u672D\u306E\u5B57, \u5E2F: { \u5E45: \u30BF\u30D6\u5E45, \u9AD8\u3055: \u30BF\u30D6\u9AD8 } },
17434
17671
  { text: "1", size: \u884C\u756A\u53F7\u306E\u5B57, \u5E2F: { \u5E45: \u6E9D - \u6301\u3061\u4E0A\u3052, \u9AD8\u3055: \u884C\u9593 } }
17435
17672
  ];
17436
- const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089);
17673
+ const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
17437
17674
  const tabW = \u30BF\u30D6\u5E45 * \u500D;
17438
17675
  const tabH = \u30BF\u30D6\u9AD8 * \u500D;
17439
17676
  const \u4E38 = \u89D2 * \u500D;
@@ -17472,7 +17709,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17472
17709
  "data-cdl-counter-scaled": "1",
17473
17710
  x: x + tabW / 2,
17474
17711
  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),
17712
+ fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW, textMetrics),
17476
17713
  fontFamily: lineFont,
17477
17714
  textAnchor: "middle",
17478
17715
  fill: "#e6edf3",
@@ -17554,7 +17791,12 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17554
17791
  )
17555
17792
  ] });
17556
17793
  }
17557
- function ShapeKanbanCardNode({ node, active, lang }) {
17794
+ function ShapeKanbanCardNode({
17795
+ node,
17796
+ active,
17797
+ lang,
17798
+ textMetrics = "proportional"
17799
+ }) {
17558
17800
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
17559
17801
  const frame = commonFrame2(active);
17560
17802
  const \u7DDA = frame.strokeWidth / 2;
@@ -17608,7 +17850,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
17608
17850
  );
17609
17851
  const \u8AAC\u660E = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("kanbanCard.task"));
17610
17852
  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);
17853
+ const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45, textMetrics);
17612
17854
  const \u8AAC\u660E\u306E\u5B57 = \u540D\u524D.size * \u8AAC\u660E\u5B57\u6BD4;
17613
17855
  const \u4F7F\u3048\u308B\u5E452 = Math.max(0, w - \u5DE6\u53F3\u4F59\u767D * \u500D * 2);
17614
17856
  return /* @__PURE__ */ jsxs("g", { children: [
@@ -17695,7 +17937,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
17695
17937
  {
17696
17938
  x: x + w / 2,
17697
17939
  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),
17940
+ fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452, textMetrics),
17699
17941
  textAnchor: "middle",
17700
17942
  fill: "var(--cdl-text-dim, #5a6270)",
17701
17943
  children: \u8AAC\u660E
@@ -17986,18 +18228,33 @@ var externalLabel = (node, cx, bottomY) => /* @__PURE__ */ jsxs(Fragment, { chil
17986
18228
  )
17987
18229
  ] });
17988
18230
  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;
18231
+ function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
18232
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
18233
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
18234
+ 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
18235
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
17993
18236
  const size = \u5927\u304D\u3055 * \u500D\u7387;
17994
18237
  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);
18238
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
18239
+ }
18240
+ function bottomLabel(node, cx, plan, textMetrics = "proportional") {
18241
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(
18242
+ node.eyebrow ?? "",
18243
+ plan.\u80A9\u66F8?.size ?? 0,
18244
+ LABEL_EYEBROW_SPACING,
18245
+ node.w,
18246
+ false,
18247
+ textMetrics
18248
+ );
18249
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
18250
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(
18251
+ node.subtitle ?? "",
18252
+ plan.\u8AAC\u660E?.size ?? 0,
18253
+ 0,
18254
+ node.w,
18255
+ false,
18256
+ textMetrics
18257
+ );
18001
18258
  return /* @__PURE__ */ jsxs(Fragment, { children: [
18002
18259
  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
18260
  /* @__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 +18268,7 @@ var RACK_SLOT_N = 4;
18011
18268
  var RACK_BOTTOM = 8;
18012
18269
  var RACK_H = RACK_SLOT_TOP + RACK_SLOT_N * RACK_SLOT_H + (RACK_SLOT_N - 1) * RACK_SLOT_GAP + RACK_BOTTOM;
18013
18270
  var RACK_W_MIN = 120;
18014
- function ShapeServerRackNode({ node, active }) {
18271
+ function ShapeServerRackNode({ node, active, textMetrics = "proportional" }) {
18015
18272
  const r = shapeRegion(node);
18016
18273
  const frame = commonFrame3(active);
18017
18274
  const \u7DDA = frame.strokeWidth / 2;
@@ -18093,7 +18350,7 @@ function ShapeServerRackNode({ node, active }) {
18093
18350
  ] }, i);
18094
18351
  })
18095
18352
  ] })),
18096
- bottomLabel(node, r.cx, r.label)
18353
+ bottomLabel(node, r.cx, r.label, textMetrics)
18097
18354
  ] });
18098
18355
  }
18099
18356
  var HUB_R = 30;
@@ -18101,7 +18358,7 @@ var ARM_LEN = 68;
18101
18358
  var END_R = 7;
18102
18359
  var WIFI_ARC_R = [10, 16, 22];
18103
18360
  var WIFI_BASE_Y = 5;
18104
- function ShapeNetworkNodeNode({ node, active }) {
18361
+ function ShapeNetworkNodeNode({ node, active, textMetrics = "proportional" }) {
18105
18362
  const r = shapeRegion(node);
18106
18363
  const cx = r.cx;
18107
18364
  const cy = r.cy;
@@ -18177,12 +18434,12 @@ function ShapeNetworkNodeNode({ node, active }) {
18177
18434
  )),
18178
18435
  /* @__PURE__ */ jsx("circle", { cx, cy: cy + WIFI_BASE_Y + 3, r: 2.5, fill: "var(--cdl-tone-accent, #2d6a8f)", stroke: "none" })
18179
18436
  ] })),
18180
- bottomLabel(node, r.cx, r.label)
18437
+ bottomLabel(node, r.cx, r.label, textMetrics)
18181
18438
  ] });
18182
18439
  }
18183
18440
  var PHONE_H = 240;
18184
18441
  var PHONE_W = 110;
18185
- function ShapeMobileDeviceNode({ node, active }) {
18442
+ function ShapeMobileDeviceNode({ node, active, textMetrics = "proportional" }) {
18186
18443
  const r = shapeRegion(node);
18187
18444
  const frame = commonFrame3(active);
18188
18445
  const \u7DDA = frame.strokeWidth / 2;
@@ -18249,7 +18506,7 @@ function ShapeMobileDeviceNode({ node, active }) {
18249
18506
  }
18250
18507
  )
18251
18508
  ] })),
18252
- bottomLabel(node, r.cx, r.label)
18509
+ bottomLabel(node, r.cx, r.label, textMetrics)
18253
18510
  ] });
18254
18511
  }
18255
18512
  function ShapeIotSensorNode({ node, active }) {
@@ -18520,7 +18777,7 @@ var SAT_DISH_R = 12;
18520
18777
  var SAT_DISH_STEM = 12;
18521
18778
  var SAT_MAST_LEN = 22;
18522
18779
  var SAT_MAST_TIP_R = 4;
18523
- function ShapeSatelliteNode({ node, active }) {
18780
+ function ShapeSatelliteNode({ node, active, textMetrics = "proportional" }) {
18524
18781
  const r = shapeRegion(node);
18525
18782
  const cx = r.cx;
18526
18783
  const cy = r.cy;
@@ -18709,7 +18966,7 @@ function ShapeSatelliteNode({ node, active }) {
18709
18966
  ),
18710
18967
  /* @__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
18968
  ] })),
18712
- bottomLabel(node, r.cx, r.label)
18969
+ bottomLabel(node, r.cx, r.label, textMetrics)
18713
18970
  ] });
18714
18971
  }
18715
18972
  var FRAME_SW_ACTIVE = 3;
@@ -18795,9 +19052,9 @@ function blockchainNodeExtent(strokeWidth) {
18795
19052
  const \u6A2A = (NODE_PEER_DIST + NODE_PEER_R) * Math.cos(Math.PI / 6) + \u7DDA;
18796
19053
  return { \u4E0A: \u7E26, \u4E0B: \u7E26, \u5DE6: \u6A2A, \u53F3: \u6A2A };
18797
19054
  }
18798
- function bottomLabel2(node, cx, plan) {
19055
+ function bottomLabel2(node, cx, plan, textMetrics = "proportional") {
18799
19056
  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;
19057
+ const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f, textMetrics) + ls * [...u].length;
18801
19058
  const \u7D20\u306E\u5E45 = \u6E2C\u308B(t, \u5927\u304D\u3055, \u5B57\u9593);
18802
19059
  const \u53CE\u307E\u308B = \u7D20\u306E\u5E45 > node.w && node.w > 0 ? node.w / \u7D20\u306E\u5E45 : 1;
18803
19060
  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 +19087,12 @@ function EthereumDiamond({ cx, cy, h, colors }) {
18830
19087
  /* @__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
19088
  ] });
18832
19089
  }
18833
- function ShapeSmartContractNode({ node, active, lang }) {
19090
+ function ShapeSmartContractNode({
19091
+ node,
19092
+ active,
19093
+ lang,
19094
+ textMetrics = "proportional"
19095
+ }) {
18834
19096
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
18835
19097
  const frame = commonFrame4(active);
18836
19098
  const r = shapeRegion(node);
@@ -18871,7 +19133,7 @@ function ShapeSmartContractNode({ node, active, lang }) {
18871
19133
  }
18872
19134
  ];
18873
19135
  const art = (\u500D\u7387) => {
18874
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19136
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
18875
19137
  return /* @__PURE__ */ jsxs("g", { children: [
18876
19138
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: path, ...frame, strokeLinejoin: "round" }),
18877
19139
  /* @__PURE__ */ jsx("path", { d: foldPath, fill: "none", stroke: frame.stroke, strokeWidth: frame.strokeWidth, strokeLinejoin: "round" }),
@@ -18893,10 +19155,10 @@ function ShapeSmartContractNode({ node, active, lang }) {
18893
19155
  };
18894
19156
  return /* @__PURE__ */ jsxs("g", { children: [
18895
19157
  fitArt(r, smartContractExtent(frame.strokeWidth), art),
18896
- bottomLabel2(node, r.cx, r.label)
19158
+ bottomLabel2(node, r.cx, r.label, textMetrics)
18897
19159
  ] });
18898
19160
  }
18899
- var \u5B57\u306E\u5E45 = (text, size) => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size);
19161
+ var \u5B57\u306E\u5E45 = (text, size, textMetrics = "proportional") => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, 0, textMetrics);
18900
19162
  var BLOCK_DEFAULT_FIELDS = [
18901
19163
  { key: "hash", label: "blockchainBlock.hash", value: { text: "0xaf31..." } },
18902
19164
  { key: "prev", label: "blockchainBlock.prev", value: { text: "0x7b3f..." } },
@@ -18904,10 +19166,16 @@ var BLOCK_DEFAULT_FIELDS = [
18904
19166
  { key: "nonce", label: "blockchainBlock.nonce", value: { text: "82,914" } },
18905
19167
  { key: "tx", label: "blockchainBlock.tx", value: { \u8F9E\u66F8: "blockchainBlock.txCount" } }
18906
19168
  ];
18907
- function ShapeBlockchainBlockNode({ node, active, lang }) {
19169
+ function ShapeBlockchainBlockNode({
19170
+ node,
19171
+ active,
19172
+ lang,
19173
+ textMetrics = "proportional"
19174
+ }) {
18908
19175
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
18909
19176
  const frame = commonFrame4(active);
18910
19177
  const r = shapeRegion(node);
19178
+ const \u6E2C\u308B\u5B57 = (text, size) => \u5B57\u306E\u5E45(text, size, textMetrics);
18911
19179
  const bw = BLOCK_W;
18912
19180
  const bh = BLOCK_H;
18913
19181
  const cx = r.cx;
@@ -18928,9 +19196,9 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18928
19196
  const \u5E2F\u306E\u6B8B\u308A = bw - 14 - 30;
18929
19197
  const \u80A9\u66F8\u306E\u9699\u9593 = 8;
18930
19198
  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);
19199
+ 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
19200
  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);
19201
+ const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u6E2C\u308B\u5B57(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
18934
19202
  const \u898B\u51FA\u3057\u306E\u5E45 = \u5E2F\u306E\u6B8B\u308A - (\u80A9\u66F8 === "" ? 0 : \u80A9\u66F8\u306E\u5E45 + \u80A9\u66F8\u306E\u9699\u9593);
18935
19203
  const \u6253\u3061\u6D88\u3059\u5B57\u3089 = [
18936
19204
  { 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 +19209,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18941
19209
  {
18942
19210
  text: f.value,
18943
19211
  size: \u5024\u306E\u5B57,
18944
- \u5E2F: { \u5E45: bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
19212
+ \u5E2F: { \u5E45: bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
18945
19213
  }
18946
19214
  ])
18947
19215
  ];
18948
19216
  const art = (\u500D\u7387) => {
18949
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19217
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
18950
19218
  const \u984C\u306E\u5927\u304D\u3055 = \u898B\u51FA\u3057\u306E\u5B57 * \u500D;
18951
19219
  const \u80A9\u66F8\u306E\u5927\u304D\u3055 = \u80A9\u66F8\u306E\u6307\u5B9A * \u500D;
18952
19220
  const \u540D\u306E\u5927\u304D\u3055 = \u540D\u306E\u5B57 * \u500D;
@@ -18955,7 +19223,7 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18955
19223
  /* @__PURE__ */ jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
18956
19224
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
18957
19225
  /* @__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) }),
19226
+ /* @__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
19227
  \u80A9\u66F8 !== "" && /* @__PURE__ */ jsx(
18960
19228
  "text",
18961
19229
  {
@@ -18975,7 +19243,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18975
19243
  /* @__PURE__ */ jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
18976
19244
  fields.map((f, i) => /* @__PURE__ */ jsxs("g", { children: [
18977
19245
  /* @__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) }),
19246
+ /* @__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(
19247
+ f.value,
19248
+ \u5024\u306E\u5927\u304D\u3055,
19249
+ bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5927\u304D\u3055) - 8,
19250
+ \u6E2C\u308B\u5B57
19251
+ ) }),
18979
19252
  /* @__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
19253
  ] }, i)),
18981
19254
  /* @__PURE__ */ jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
@@ -18987,7 +19260,11 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18987
19260
  };
18988
19261
  return /* @__PURE__ */ jsx("g", { children: fitArt(r, blockchainBlockExtent(frame.strokeWidth), art) });
18989
19262
  }
18990
- function ShapeBlockchainNode({ node, active }) {
19263
+ function ShapeBlockchainNode({
19264
+ node,
19265
+ active,
19266
+ textMetrics = "proportional"
19267
+ }) {
18991
19268
  const frame = commonFrame4(active);
18992
19269
  const r = shapeRegion(node);
18993
19270
  const cx = r.cx;
@@ -19003,7 +19280,7 @@ function ShapeBlockchainNode({ node, active }) {
19003
19280
  { text: "0x\u2026", size: CHAIN_HASH_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: CHAIN_ROW_GAP } }
19004
19281
  ];
19005
19282
  const art = (\u500D\u7387) => {
19006
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19283
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19007
19284
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19008
19285
  const bx = startX + i * (blockW + linkW);
19009
19286
  const isCurrent = i === blockCount - 1;
@@ -19039,10 +19316,14 @@ function ShapeBlockchainNode({ node, active }) {
19039
19316
  };
19040
19317
  return /* @__PURE__ */ jsxs("g", { children: [
19041
19318
  fitArt(r, chainExtent(), art),
19042
- bottomLabel2(node, r.cx, r.label)
19319
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19043
19320
  ] });
19044
19321
  }
19045
- function ShapeBitcoinChainNode({ node, active }) {
19322
+ function ShapeBitcoinChainNode({
19323
+ node,
19324
+ active,
19325
+ textMetrics = "proportional"
19326
+ }) {
19046
19327
  const frame = commonFrame4(active);
19047
19328
  const r = shapeRegion(node);
19048
19329
  const cx = r.cx;
@@ -19058,7 +19339,7 @@ function ShapeBitcoinChainNode({ node, active }) {
19058
19339
  { text: "#820", size: BTC_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
19059
19340
  ];
19060
19341
  const art = (\u500D\u7387) => {
19061
- 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);
19062
19343
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19063
19344
  const bx = startX + i * (blockW + linkW);
19064
19345
  const isCurrent = i === blockCount - 1;
@@ -19089,10 +19370,14 @@ function ShapeBitcoinChainNode({ node, active }) {
19089
19370
  };
19090
19371
  return /* @__PURE__ */ jsxs("g", { children: [
19091
19372
  fitArt(r, chainExtent(), art),
19092
- bottomLabel2(node, r.cx, r.label)
19373
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19093
19374
  ] });
19094
19375
  }
19095
- function ShapeEthereumChainNode({ node, active }) {
19376
+ function ShapeEthereumChainNode({
19377
+ node,
19378
+ active,
19379
+ textMetrics = "proportional"
19380
+ }) {
19096
19381
  const frame = commonFrame4(active);
19097
19382
  const r = shapeRegion(node);
19098
19383
  const cx = r.cx;
@@ -19108,7 +19393,7 @@ function ShapeEthereumChainNode({ node, active }) {
19108
19393
  { text: "#214", size: ETH_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
19109
19394
  ];
19110
19395
  const art = (\u500D\u7387) => {
19111
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19396
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19112
19397
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19113
19398
  const bx = startX + i * (blockW + linkW);
19114
19399
  const isCurrent = i === blockCount - 1;
@@ -19140,10 +19425,14 @@ function ShapeEthereumChainNode({ node, active }) {
19140
19425
  };
19141
19426
  return /* @__PURE__ */ jsxs("g", { children: [
19142
19427
  fitArt(r, chainExtent(), art),
19143
- bottomLabel2(node, r.cx, r.label)
19428
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19144
19429
  ] });
19145
19430
  }
19146
- function ShapeBlockchainNodeNode({ node, active }) {
19431
+ function ShapeBlockchainNodeNode({
19432
+ node,
19433
+ active,
19434
+ textMetrics = "proportional"
19435
+ }) {
19147
19436
  const frame = commonFrame4(active);
19148
19437
  const r = shapeRegion(node);
19149
19438
  const cx = r.cx;
@@ -19197,10 +19486,15 @@ function ShapeBlockchainNodeNode({ node, active }) {
19197
19486
  ] });
19198
19487
  return /* @__PURE__ */ jsxs("g", { children: [
19199
19488
  fitArt(r, blockchainNodeExtent(frame.strokeWidth), art),
19200
- bottomLabel2(node, r.cx, r.label)
19489
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19201
19490
  ] });
19202
19491
  }
19203
- function ShapeRpcNodeNode({ node, active, lang }) {
19492
+ function ShapeRpcNodeNode({
19493
+ node,
19494
+ active,
19495
+ lang,
19496
+ textMetrics = "proportional"
19497
+ }) {
19204
19498
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19205
19499
  const frame = commonFrame4(active);
19206
19500
  const r = shapeRegion(node);
@@ -19219,10 +19513,10 @@ function ShapeRpcNodeNode({ node, active, lang }) {
19219
19513
  /* @__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
19514
  /* @__PURE__ */ jsx("rect", { x: x + 16, y: y + bh - 24, width: bw - 32, height: 8, rx: 4, fill: "#0f1419", stroke: "none" }),
19221
19515
  /* @__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)
19516
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19223
19517
  ] });
19224
19518
  }
19225
- function ShapeWalletNode({ node, active }) {
19519
+ function ShapeWalletNode({ node, active, textMetrics = "proportional" }) {
19226
19520
  const frame = commonFrame4(active);
19227
19521
  const r = shapeRegion(node);
19228
19522
  const cx = r.cx;
@@ -19296,10 +19590,10 @@ function ShapeWalletNode({ node, active }) {
19296
19590
  /* @__PURE__ */ jsx("text", { x: cx, y: foldY + 3, fontSize: 9, fontWeight: 700, fill: "#5a3a10", textAnchor: "middle", opacity: 0.8, children: "\u039E" }),
19297
19591
  /* @__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
19592
  ] }),
19299
- bottomLabel2(node, r.cx, r.label)
19593
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19300
19594
  ] });
19301
19595
  }
19302
- function ShapeNftNode({ node, active }) {
19596
+ function ShapeNftNode({ node, active, textMetrics = "proportional" }) {
19303
19597
  const frame = commonFrame4(active);
19304
19598
  const r = shapeRegion(node);
19305
19599
  const cx = r.cx;
@@ -19315,7 +19609,7 @@ function ShapeNftNode({ node, active }) {
19315
19609
  { text: "#1024", size: NFT_ID_SIZE, \u5E2F: { \u5E45: cardW - 16 - 34, \u9AD8\u3055: cardH - artH } }
19316
19610
  ];
19317
19611
  const art = (\u500D\u7387) => {
19318
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19612
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19319
19613
  return /* @__PURE__ */ jsxs("g", { children: [
19320
19614
  /* @__PURE__ */ jsx("rect", { x: x + 4, y: y + 4, width: cardW, height: cardH, rx: 14, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
19321
19615
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: cardW, height: cardH, rx: 14, ...frame }),
@@ -19353,10 +19647,10 @@ function ShapeNftNode({ node, active }) {
19353
19647
  };
19354
19648
  return /* @__PURE__ */ jsxs("g", { children: [
19355
19649
  fitArt(r, nftExtent(frame.strokeWidth), art),
19356
- bottomLabel2(node, r.cx, r.label)
19650
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19357
19651
  ] });
19358
19652
  }
19359
- function ShapeTokenNode({ node, active }) {
19653
+ function ShapeTokenNode({ node, active, textMetrics = "proportional" }) {
19360
19654
  const frame = commonFrame4(active);
19361
19655
  const r = shapeRegion(node);
19362
19656
  const cx = r.cx;
@@ -19393,7 +19687,7 @@ function ShapeTokenNode({ node, active }) {
19393
19687
  }
19394
19688
  }
19395
19689
  ),
19396
- bottomLabel2(node, r.cx, r.label)
19690
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19397
19691
  ] });
19398
19692
  }
19399
19693
  var commonFrame5 = (active) => ({
@@ -19412,7 +19706,8 @@ function \u5B57\u306E\u6BD4(c) {
19412
19706
  if (\u5E83\u5B57.has(c)) return \u5E83\u5B57\u6BD4;
19413
19707
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD4 : \u5E83\u5B57\u6BD4;
19414
19708
  }
19415
- function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19709
+ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
19710
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
19416
19711
  let \u5E45 = 0;
19417
19712
  let \u5B57\u6570 = 0;
19418
19713
  for (const c of \u6587\u5B57\u5217) {
@@ -19421,18 +19716,33 @@ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19421
19716
  }
19422
19717
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
19423
19718
  }
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;
19719
+ function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
19720
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E45(t, s, ls, textMetrics);
19721
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
19722
+ 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
19723
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
19428
19724
  const size = \u5927\u304D\u3055 * \u500D\u7387;
19429
19725
  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);
19726
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
19727
+ }
19728
+ function bottomLabel3(node, cx, plan, textMetrics = "proportional") {
19729
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(
19730
+ node.eyebrow ?? "",
19731
+ plan.\u80A9\u66F8?.size ?? 0,
19732
+ LABEL_EYEBROW_SPACING2,
19733
+ node.w,
19734
+ false,
19735
+ textMetrics
19736
+ );
19737
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
19738
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(
19739
+ node.subtitle ?? "",
19740
+ plan.\u8AAC\u660E?.size ?? 0,
19741
+ 0,
19742
+ node.w,
19743
+ false,
19744
+ textMetrics
19745
+ );
19436
19746
  return /* @__PURE__ */ jsxs(Fragment, { children: [
19437
19747
  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
19748
  /* @__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 +19761,7 @@ var BANK_STEP_SW = 1;
19451
19761
  var BANK_COLUMN_MIN = 24;
19452
19762
  var BANK_BLD_W_MIN = 120;
19453
19763
  var BANK_BLD_W_MAX = 280;
19454
- function ShapeBankNode({ node, active }) {
19764
+ function ShapeBankNode({ node, active, textMetrics = "proportional" }) {
19455
19765
  const frame = commonFrame5(active);
19456
19766
  const r = shapeRegion(node);
19457
19767
  const \u7DDA = frame.strokeWidth / 2;
@@ -19498,7 +19808,7 @@ function ShapeBankNode({ node, active }) {
19498
19808
  ] });
19499
19809
  return /* @__PURE__ */ jsxs("g", { children: [
19500
19810
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19501
- bottomLabel3(node, r.cx, r.label)
19811
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19502
19812
  ] });
19503
19813
  }
19504
19814
  var TRUST_CROWN_RISE = 4;
@@ -19510,7 +19820,12 @@ var TRUST_BASE_H = 14;
19510
19820
  var TRUST_BODY_OUT = 8;
19511
19821
  var TRUST_BLD_W_MIN = 140;
19512
19822
  var TRUST_BLD_W_MAX = 280;
19513
- function ShapeTrustBankNode({ node, active, lang }) {
19823
+ function ShapeTrustBankNode({
19824
+ node,
19825
+ active,
19826
+ lang,
19827
+ textMetrics = "proportional"
19828
+ }) {
19514
19829
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19515
19830
  const frame = commonFrame5(active);
19516
19831
  const r = shapeRegion(node);
@@ -19564,10 +19879,15 @@ function ShapeTrustBankNode({ node, active, lang }) {
19564
19879
  ] });
19565
19880
  return /* @__PURE__ */ jsxs("g", { children: [
19566
19881
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19567
- bottomLabel3(node, r.cx, r.label)
19882
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19568
19883
  ] });
19569
19884
  }
19570
- function ShapePaymentProviderNode({ node, active, lang }) {
19885
+ function ShapePaymentProviderNode({
19886
+ node,
19887
+ active,
19888
+ lang,
19889
+ textMetrics = "proportional"
19890
+ }) {
19571
19891
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19572
19892
  const frame = commonFrame5(active);
19573
19893
  const r = shapeRegion(node);
@@ -19592,10 +19912,14 @@ function ShapePaymentProviderNode({ node, active, lang }) {
19592
19912
  /* @__PURE__ */ jsx("text", { x: cx, y: cy + 9, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: accentDarker, fontFamily: "Georgia, serif", children: "$" })
19593
19913
  ] }),
19594
19914
  /* @__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)
19915
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19596
19916
  ] });
19597
19917
  }
19598
- function ShapeCreditCardNode({ node, active }) {
19918
+ function ShapeCreditCardNode({
19919
+ node,
19920
+ active,
19921
+ textMetrics = "proportional"
19922
+ }) {
19599
19923
  const frame = commonFrame5(active);
19600
19924
  const r = shapeRegion(node);
19601
19925
  const cardW = Math.min(r.availW - 30, 260);
@@ -19617,7 +19941,7 @@ function ShapeCreditCardNode({ node, active }) {
19617
19941
  [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
19942
  /* @__PURE__ */ jsx("circle", { cx: x + cardW - 48, cy: y + cardH - 24, r: 15, fill: "#c9302c", opacity: 0.9, stroke: "none" }),
19619
19943
  /* @__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)
19944
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19621
19945
  ] });
19622
19946
  }
19623
19947
  var BROKERAGE_TICK_H = 18;
@@ -19642,7 +19966,12 @@ var BROKERAGE_SHADE_OUT = 2;
19642
19966
  var BROKERAGE_W_MIN = BROKERAGE_COLS * BROKERAGE_CELL_W + (BROKERAGE_COLS - 1) * BROKERAGE_GAP_X + 6;
19643
19967
  var BROKERAGE_W_MAX = 140;
19644
19968
  var BROKERAGE_H_MIN = BROKERAGE_TICK_H + BROKERAGE_LOGO_H + BROKERAGE_BASE_H;
19645
- function ShapeBrokerageNode({ node, active, lang }) {
19969
+ function ShapeBrokerageNode({
19970
+ node,
19971
+ active,
19972
+ lang,
19973
+ textMetrics = "proportional"
19974
+ }) {
19646
19975
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19647
19976
  const frame = commonFrame5(active);
19648
19977
  const r = shapeRegion(node);
@@ -19681,7 +20010,7 @@ function ShapeBrokerageNode({ node, active, lang }) {
19681
20010
  }
19682
20011
  ];
19683
20012
  const \u7D75 = (\u500D\u7387) => {
19684
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20013
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19685
20014
  return /* @__PURE__ */ jsxs("g", { children: [
19686
20015
  /* @__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
20016
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: w, height: h, fill: "#255a7a", stroke: accentDarker, strokeWidth: frame.strokeWidth }),
@@ -19709,12 +20038,17 @@ function ShapeBrokerageNode({ node, active, lang }) {
19709
20038
  };
19710
20039
  return /* @__PURE__ */ jsxs("g", { children: [
19711
20040
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19712
- bottomLabel3(node, r.cx, r.label)
20041
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19713
20042
  ] });
19714
20043
  }
19715
20044
  var EXCHANGE_SUB_SIZE = 11;
19716
20045
  var EXCHANGE_HEX_R = 52;
19717
- function ShapeExchangeNode({ node, active, lang }) {
20046
+ function ShapeExchangeNode({
20047
+ node,
20048
+ active,
20049
+ lang,
20050
+ textMetrics = "proportional"
20051
+ }) {
19718
20052
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19719
20053
  const frame = commonFrame5(active);
19720
20054
  const r = shapeRegion(node);
@@ -19759,7 +20093,7 @@ function ShapeExchangeNode({ node, active, lang }) {
19759
20093
  }
19760
20094
  ];
19761
20095
  const \u7D75 = (\u500D\u7387) => {
19762
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20096
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19763
20097
  return /* @__PURE__ */ jsxs("g", { children: [
19764
20098
  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
20099
  nodes.map((n, i) => {
@@ -19778,7 +20112,7 @@ function ShapeExchangeNode({ node, active, lang }) {
19778
20112
  };
19779
20113
  return /* @__PURE__ */ jsxs("g", { children: [
19780
20114
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19781
- bottomLabel3(node, r.cx, r.label)
20115
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19782
20116
  ] });
19783
20117
  }
19784
20118
  var ATM_SIGN_H = 26;
@@ -19795,7 +20129,12 @@ var ATM_PANEL_H = 146;
19795
20129
  var ATM_W_MIN = 100;
19796
20130
  var ATM_W_MAX = ATM_PANEL_W;
19797
20131
  var ATM_H_MIN = ATM_SIGN_H + ATM_SIGN_GAP + 30 + ATM_FLOOR_RESERVE;
19798
- function ShapeAtmNode({ node, active, lang }) {
20132
+ function ShapeAtmNode({
20133
+ node,
20134
+ active,
20135
+ lang,
20136
+ textMetrics = "proportional"
20137
+ }) {
19799
20138
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19800
20139
  const frame = commonFrame5(active);
19801
20140
  const r = shapeRegion(node);
@@ -19879,7 +20218,7 @@ function ShapeAtmNode({ node, active, lang }) {
19879
20218
  ] });
19880
20219
  return /* @__PURE__ */ jsxs("g", { children: [
19881
20220
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19882
- bottomLabel3(node, r.cx, r.label)
20221
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19883
20222
  ] });
19884
20223
  }
19885
20224
  var commonFrame6 = (active) => ({
@@ -19898,7 +20237,8 @@ function \u5B57\u306E\u6BD42(c) {
19898
20237
  if (\u5E83\u5B572.has(c)) return \u5E83\u5B57\u6BD42;
19899
20238
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD42 : \u5E83\u5B57\u6BD42;
19900
20239
  }
19901
- function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
20240
+ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
20241
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
19902
20242
  let \u5E45 = 0;
19903
20243
  let \u5B57\u6570 = 0;
19904
20244
  for (const c of \u6587\u5B57\u5217) {
@@ -19907,18 +20247,33 @@ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19907
20247
  }
19908
20248
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
19909
20249
  }
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;
20250
+ function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
20251
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E452(t, s, ls, textMetrics);
20252
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
20253
+ 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
20254
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
19914
20255
  const size = \u5927\u304D\u3055 * \u500D\u7387;
19915
20256
  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);
20257
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
20258
+ }
20259
+ function bottomLabel4(node, cx, plan, textMetrics = "proportional") {
20260
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(
20261
+ node.eyebrow ?? "",
20262
+ plan.\u80A9\u66F8?.size ?? 0,
20263
+ LABEL_EYEBROW_SPACING3,
20264
+ node.w,
20265
+ false,
20266
+ textMetrics
20267
+ );
20268
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
20269
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(
20270
+ node.subtitle ?? "",
20271
+ plan.\u8AAC\u660E?.size ?? 0,
20272
+ 0,
20273
+ node.w,
20274
+ false,
20275
+ textMetrics
20276
+ );
19922
20277
  return /* @__PURE__ */ jsxs(Fragment, { children: [
19923
20278
  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
20279
  /* @__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 +20285,7 @@ var WEBSITE_BAR_H = 32;
19930
20285
  var WEBSITE_H_MIN = WEBSITE_BAR_H + 98;
19931
20286
  var WEBSITE_W_MIN = 160;
19932
20287
  var WEBSITE_W_MAX = 280;
19933
- function ShapeWebsiteNode({ node, active }) {
20288
+ function ShapeWebsiteNode({ node, active, textMetrics = "proportional" }) {
19934
20289
  const frame = commonFrame6(active);
19935
20290
  const r = shapeRegion(node);
19936
20291
  const cx = r.cx;
@@ -19956,10 +20311,10 @@ function ShapeWebsiteNode({ node, active }) {
19956
20311
  ] });
19957
20312
  return /* @__PURE__ */ jsxs("g", { children: [
19958
20313
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19959
- bottomLabel4(node, r.cx, r.label)
20314
+ bottomLabel4(node, r.cx, r.label, textMetrics)
19960
20315
  ] });
19961
20316
  }
19962
- function ShapeStorefrontNode({ node, active, lang }) {
20317
+ function ShapeStorefrontNode({ node, active, lang, textMetrics = "proportional" }) {
19963
20318
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19964
20319
  const frame = commonFrame6(active);
19965
20320
  const r = shapeRegion(node);
@@ -20004,7 +20359,7 @@ function ShapeStorefrontNode({ node, active, lang }) {
20004
20359
  /* @__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
20360
  /* @__PURE__ */ jsx("circle", { cx: doorX + 6, cy: doorY + doorH * 0.55, r: 1.5, fill: "#c15a4a" }),
20006
20361
  /* @__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)
20362
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20008
20363
  ] });
20009
20364
  }
20010
20365
  var WAREHOUSE_ROOF_H = 18;
@@ -20018,7 +20373,7 @@ var WAREHOUSE_SHADOW_RX_RATIO = 0.5;
20018
20373
  var WAREHOUSE_H_MIN = WAREHOUSE_ROOF_H + WAREHOUSE_SIGN_H + 68;
20019
20374
  var WAREHOUSE_W_MIN = 160;
20020
20375
  var WAREHOUSE_W_MAX = 240;
20021
- function ShapeWarehouseNode({ node, active, lang }) {
20376
+ function ShapeWarehouseNode({ node, active, lang, textMetrics = "proportional" }) {
20022
20377
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
20023
20378
  const frame = commonFrame6(active);
20024
20379
  const r = shapeRegion(node);
@@ -20071,13 +20426,13 @@ function ShapeWarehouseNode({ node, active, lang }) {
20071
20426
  ] });
20072
20427
  return /* @__PURE__ */ jsxs("g", { children: [
20073
20428
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
20074
- bottomLabel4(node, r.cx, r.label)
20429
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20075
20430
  ] });
20076
20431
  }
20077
20432
  var HANDLE_GRIP_X = 118;
20078
20433
  var HANDLE_GRIP_R = 4;
20079
20434
  var CART_SHADOW_RX = 80;
20080
- function ShapeOnlineShopNode({ node, active }) {
20435
+ function ShapeOnlineShopNode({ node, active, textMetrics = "proportional" }) {
20081
20436
  const frame = commonFrame6(active);
20082
20437
  const r = shapeRegion(node);
20083
20438
  const cy = r.cy + 10;
@@ -20133,10 +20488,10 @@ function ShapeOnlineShopNode({ node, active }) {
20133
20488
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 16 * s, fill: "#0f1830", stroke: "#000", strokeWidth: 2 * s }),
20134
20489
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 8 * s, fill: "#5a6270", stroke: "#0f1830", strokeWidth: 1.5 * s }),
20135
20490
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 2 * s, fill: "#0f1830" }),
20136
- bottomLabel4(node, r.cx, r.label)
20491
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20137
20492
  ] });
20138
20493
  }
20139
- function ShapeCdnEdgeNode({ node, active }) {
20494
+ function ShapeCdnEdgeNode({ node, active, textMetrics = "proportional" }) {
20140
20495
  const frame = commonFrame6(active);
20141
20496
  const r = shapeRegion(node);
20142
20497
  const cx = r.cx;
@@ -20199,7 +20554,7 @@ function ShapeCdnEdgeNode({ node, active }) {
20199
20554
  ] });
20200
20555
  return /* @__PURE__ */ jsxs("g", { children: [
20201
20556
  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)
20557
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20203
20558
  ] });
20204
20559
  }
20205
20560
  var API_ROW_TOP = 52;
@@ -20214,7 +20569,7 @@ var API_METHOD_BOX_W = 54;
20214
20569
  var API_METHOD_TEXT_W = 48;
20215
20570
  var API_W_MIN = 200;
20216
20571
  var API_W_MAX = 300;
20217
- function ShapeApiGatewayNode({ node, active, lang }) {
20572
+ function ShapeApiGatewayNode({ node, active, lang, textMetrics = "proportional" }) {
20218
20573
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
20219
20574
  const frame = commonFrame6(active);
20220
20575
  const r = shapeRegion(node);
@@ -20226,7 +20581,13 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20226
20581
  const x = cx - bw / 2;
20227
20582
  const y = r.cy - \u7E26 / 2 + \u4F59\u767D;
20228
20583
  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)));
20584
+ const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(
20585
+ 11,
20586
+ 11 * API_METHOD_TEXT_W / Math.max(
20587
+ displayWidth(s) * 11 * MONO_ADVANCE_RATIO,
20588
+ textWidth(s, 11, 0, textMetrics)
20589
+ )
20590
+ );
20230
20591
  const rowPitch = Math.max(
20231
20592
  API_ROW_PITCH_MIN,
20232
20593
  (bh - API_ROW_TOP - API_ROW_H - API_ROW_BOTTOM_PAD) / (API_ROWS - 1)
@@ -20242,7 +20603,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20242
20603
  \u5E2F: { \u5E45: bw - 32 - 64 - 16, \u9AD8\u3055: API_ROW_H }
20243
20604
  }));
20244
20605
  const \u7D75 = (\u500D\u7387) => {
20245
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20606
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
20246
20607
  return /* @__PURE__ */ jsxs("g", { children: [
20247
20608
  /* @__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
20609
  /* @__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 +20620,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20259
20620
  };
20260
20621
  return /* @__PURE__ */ jsxs("g", { children: [
20261
20622
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
20262
- bottomLabel4(node, r.cx, r.label)
20623
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20263
20624
  ] });
20264
20625
  }
20265
20626
  function bottomLabel5(node, cx, plan) {
@@ -20559,6 +20920,7 @@ function CdlNodeView({
20559
20920
  chartLineScale,
20560
20921
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3,
20561
20922
  lang,
20923
+ textMetrics,
20562
20924
  \u5024\u306E\u540D\u524D
20563
20925
  }) {
20564
20926
  const value = node.value ? interpolate(node.value, stateValues, \u5024\u306E\u540D\u524D) : void 0;
@@ -20603,7 +20965,14 @@ function CdlNodeView({
20603
20965
  return /* @__PURE__ */ jsx(CardNode, { node: resolvedNode, active });
20604
20966
  // 時系列のやり取り (#578)。 1 つの箱が図を丸ごと描く = 縦が時間で、参加者は箱を持たない
20605
20967
  case "sequence-board":
20606
- return /* @__PURE__ */ jsx(SequenceBoardNode, { node: resolvedNode, stateValues });
20968
+ return /* @__PURE__ */ jsx(
20969
+ SequenceBoardNode,
20970
+ {
20971
+ node: resolvedNode,
20972
+ stateValues,
20973
+ textMetrics
20974
+ }
20975
+ );
20607
20976
  // 図表 9 種は payload が `{signal}` を取れるので stateValues を渡す
20608
20977
  // (`render/payload-binding.ts` が描画直前に解決する)。 取れる欄は種別で違い、
20609
20978
  // 数と語を取る 7 種に対し、mind-map / tree-hierarchy は **名前だけ** を取る (#467)。
@@ -20628,7 +20997,8 @@ function CdlNodeView({
20628
20997
  active,
20629
20998
  stateValues,
20630
20999
  drawing,
20631
- progress
21000
+ progress,
21001
+ textMetrics
20632
21002
  }
20633
21003
  );
20634
21004
  case "chart-gauge":
@@ -20639,7 +21009,8 @@ function CdlNodeView({
20639
21009
  active,
20640
21010
  stateValues,
20641
21011
  drawing,
20642
- progress
21012
+ progress,
21013
+ textMetrics
20643
21014
  }
20644
21015
  );
20645
21016
  case "chart-stacked-bar":
@@ -20650,7 +21021,8 @@ function CdlNodeView({
20650
21021
  active,
20651
21022
  stateValues,
20652
21023
  drawing,
20653
- progress
21024
+ progress,
21025
+ textMetrics
20654
21026
  }
20655
21027
  );
20656
21028
  case "chart-slope":
@@ -20661,7 +21033,8 @@ function CdlNodeView({
20661
21033
  active,
20662
21034
  stateValues,
20663
21035
  drawing,
20664
- progress
21036
+ progress,
21037
+ textMetrics
20665
21038
  }
20666
21039
  );
20667
21040
  case "chart-waffle":
@@ -20672,11 +21045,20 @@ function CdlNodeView({
20672
21045
  active,
20673
21046
  stateValues,
20674
21047
  drawing,
20675
- progress
21048
+ progress,
21049
+ textMetrics
20676
21050
  }
20677
21051
  );
20678
21052
  case "chart-stat":
20679
- return /* @__PURE__ */ jsx(ChartStatNode, { node: resolvedNode, active, stateValues });
21053
+ return /* @__PURE__ */ jsx(
21054
+ ChartStatNode,
21055
+ {
21056
+ node: resolvedNode,
21057
+ active,
21058
+ stateValues,
21059
+ textMetrics
21060
+ }
21061
+ );
20680
21062
  case "chart-radial":
20681
21063
  return /* @__PURE__ */ jsx(
20682
21064
  ChartRadialNode,
@@ -20685,7 +21067,8 @@ function CdlNodeView({
20685
21067
  active,
20686
21068
  stateValues,
20687
21069
  drawing,
20688
- progress
21070
+ progress,
21071
+ textMetrics
20689
21072
  }
20690
21073
  );
20691
21074
  case "chart-bar":
@@ -20718,7 +21101,8 @@ function CdlNodeView({
20718
21101
  active,
20719
21102
  stateValues,
20720
21103
  drawing,
20721
- progress
21104
+ progress,
21105
+ textMetrics
20722
21106
  }
20723
21107
  );
20724
21108
  case "funnel-stages":
@@ -20729,11 +21113,20 @@ function CdlNodeView({
20729
21113
  active,
20730
21114
  stateValues,
20731
21115
  drawing,
20732
- progress
21116
+ progress,
21117
+ textMetrics
20733
21118
  }
20734
21119
  );
20735
21120
  case "quadrant-matrix":
20736
- return /* @__PURE__ */ jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
21121
+ return /* @__PURE__ */ jsx(
21122
+ QuadrantNode,
21123
+ {
21124
+ node: resolvedNode,
21125
+ active,
21126
+ stateValues,
21127
+ textMetrics
21128
+ }
21129
+ );
20737
21130
  case "tree-hierarchy":
20738
21131
  return /* @__PURE__ */ jsx(
20739
21132
  TreeNode,
@@ -20742,7 +21135,8 @@ function CdlNodeView({
20742
21135
  active,
20743
21136
  stateValues,
20744
21137
  drawing,
20745
- progress
21138
+ progress,
21139
+ textMetrics
20746
21140
  }
20747
21141
  );
20748
21142
  case "journey-map":
@@ -20757,91 +21151,91 @@ function CdlNodeView({
20757
21151
  }
20758
21152
  );
20759
21153
  case "shape-file":
20760
- return /* @__PURE__ */ jsx(ShapeFileNode, { node: resolvedNode, active });
21154
+ return /* @__PURE__ */ jsx(ShapeFileNode, { node: resolvedNode, active, textMetrics });
20761
21155
  case "shape-folder":
20762
- return /* @__PURE__ */ jsx(ShapeFolderNode, { node: resolvedNode, active });
21156
+ return /* @__PURE__ */ jsx(ShapeFolderNode, { node: resolvedNode, active, textMetrics });
20763
21157
  case "shape-cloud":
20764
- return /* @__PURE__ */ jsx(ShapeCloudNode, { node: resolvedNode, active });
21158
+ return /* @__PURE__ */ jsx(ShapeCloudNode, { node: resolvedNode, active, textMetrics });
20765
21159
  case "shape-cylinder":
20766
- return /* @__PURE__ */ jsx(ShapeCylinderNode, { node: resolvedNode, active });
21160
+ return /* @__PURE__ */ jsx(ShapeCylinderNode, { node: resolvedNode, active, textMetrics });
20767
21161
  case "shape-hexagon":
20768
- return /* @__PURE__ */ jsx(ShapeHexagonNode, { node: resolvedNode, active });
21162
+ return /* @__PURE__ */ jsx(ShapeHexagonNode, { node: resolvedNode, active, textMetrics });
20769
21163
  case "shape-diamond":
20770
- return /* @__PURE__ */ jsx(ShapeDiamondNode, { node: resolvedNode, active });
21164
+ return /* @__PURE__ */ jsx(ShapeDiamondNode, { node: resolvedNode, active, textMetrics });
20771
21165
  case "shape-stack":
20772
- return /* @__PURE__ */ jsx(ShapeStackNode, { node: resolvedNode, active });
21166
+ return /* @__PURE__ */ jsx(ShapeStackNode, { node: resolvedNode, active, textMetrics });
20773
21167
  case "shape-person":
20774
- return /* @__PURE__ */ jsx(ShapePersonNode, { node: resolvedNode, active });
21168
+ return /* @__PURE__ */ jsx(ShapePersonNode, { node: resolvedNode, active, textMetrics });
20775
21169
  case "shape-window":
20776
21170
  return /* @__PURE__ */ jsx(ShapeWindowNode, { node: resolvedNode, active });
20777
21171
  case "shape-terminal":
20778
21172
  return /* @__PURE__ */ jsx(ShapeTerminalNode, { node: resolvedNode, active, lang });
20779
21173
  case "shape-code-block":
20780
- return /* @__PURE__ */ jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang });
21174
+ return /* @__PURE__ */ jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang, textMetrics });
20781
21175
  case "shape-kanban-card":
20782
- return /* @__PURE__ */ jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang });
21176
+ return /* @__PURE__ */ jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang, textMetrics });
20783
21177
  case "shape-message-bubble":
20784
21178
  return /* @__PURE__ */ jsx(ShapeMessageBubbleNode, { node: resolvedNode, active });
20785
21179
  case "shape-gear":
20786
21180
  return /* @__PURE__ */ jsx(ShapeGearNode, { node: resolvedNode, active });
20787
21181
  case "shape-server-rack":
20788
- return /* @__PURE__ */ jsx(ShapeServerRackNode, { node: resolvedNode, active });
21182
+ return /* @__PURE__ */ jsx(ShapeServerRackNode, { node: resolvedNode, active, textMetrics });
20789
21183
  case "shape-network-node":
20790
- return /* @__PURE__ */ jsx(ShapeNetworkNodeNode, { node: resolvedNode, active });
21184
+ return /* @__PURE__ */ jsx(ShapeNetworkNodeNode, { node: resolvedNode, active, textMetrics });
20791
21185
  case "shape-mobile-device":
20792
- return /* @__PURE__ */ jsx(ShapeMobileDeviceNode, { node: resolvedNode, active });
21186
+ return /* @__PURE__ */ jsx(ShapeMobileDeviceNode, { node: resolvedNode, active, textMetrics });
20793
21187
  case "shape-iot-sensor":
20794
21188
  return /* @__PURE__ */ jsx(ShapeIotSensorNode, { node: resolvedNode, active });
20795
21189
  case "shape-robot-arm":
20796
21190
  return /* @__PURE__ */ jsx(ShapeRobotArmNode, { node: resolvedNode, active });
20797
21191
  case "shape-satellite":
20798
- return /* @__PURE__ */ jsx(ShapeSatelliteNode, { node: resolvedNode, active });
21192
+ return /* @__PURE__ */ jsx(ShapeSatelliteNode, { node: resolvedNode, active, textMetrics });
20799
21193
  case "shape-smart-contract":
20800
- return /* @__PURE__ */ jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang });
21194
+ return /* @__PURE__ */ jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang, textMetrics });
20801
21195
  case "shape-blockchain-block":
20802
- return /* @__PURE__ */ jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang });
21196
+ return /* @__PURE__ */ jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang, textMetrics });
20803
21197
  case "shape-rpc-node":
20804
- return /* @__PURE__ */ jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang });
21198
+ return /* @__PURE__ */ jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang, textMetrics });
20805
21199
  case "shape-wallet":
20806
- return /* @__PURE__ */ jsx(ShapeWalletNode, { node: resolvedNode, active });
21200
+ return /* @__PURE__ */ jsx(ShapeWalletNode, { node: resolvedNode, active, textMetrics });
20807
21201
  case "shape-nft":
20808
- return /* @__PURE__ */ jsx(ShapeNftNode, { node: resolvedNode, active });
21202
+ return /* @__PURE__ */ jsx(ShapeNftNode, { node: resolvedNode, active, textMetrics });
20809
21203
  case "shape-token":
20810
- return /* @__PURE__ */ jsx(ShapeTokenNode, { node: resolvedNode, active });
21204
+ return /* @__PURE__ */ jsx(ShapeTokenNode, { node: resolvedNode, active, textMetrics });
20811
21205
  case "shape-blockchain":
20812
- return /* @__PURE__ */ jsx(ShapeBlockchainNode, { node: resolvedNode, active });
21206
+ return /* @__PURE__ */ jsx(ShapeBlockchainNode, { node: resolvedNode, active, textMetrics });
20813
21207
  case "shape-bitcoin-chain":
20814
- return /* @__PURE__ */ jsx(ShapeBitcoinChainNode, { node: resolvedNode, active });
21208
+ return /* @__PURE__ */ jsx(ShapeBitcoinChainNode, { node: resolvedNode, active, textMetrics });
20815
21209
  case "shape-ethereum-chain":
20816
- return /* @__PURE__ */ jsx(ShapeEthereumChainNode, { node: resolvedNode, active });
21210
+ return /* @__PURE__ */ jsx(ShapeEthereumChainNode, { node: resolvedNode, active, textMetrics });
20817
21211
  case "shape-blockchain-node":
20818
- return /* @__PURE__ */ jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active });
21212
+ return /* @__PURE__ */ jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active, textMetrics });
20819
21213
  case "shape-bank":
20820
- return /* @__PURE__ */ jsx(ShapeBankNode, { node: resolvedNode, active });
21214
+ return /* @__PURE__ */ jsx(ShapeBankNode, { node: resolvedNode, active, textMetrics });
20821
21215
  case "shape-trust-bank":
20822
- return /* @__PURE__ */ jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang });
21216
+ return /* @__PURE__ */ jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang, textMetrics });
20823
21217
  case "shape-payment-provider":
20824
- return /* @__PURE__ */ jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang });
21218
+ return /* @__PURE__ */ jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang, textMetrics });
20825
21219
  case "shape-credit-card":
20826
- return /* @__PURE__ */ jsx(ShapeCreditCardNode, { node: resolvedNode, active });
21220
+ return /* @__PURE__ */ jsx(ShapeCreditCardNode, { node: resolvedNode, active, textMetrics });
20827
21221
  case "shape-brokerage":
20828
- return /* @__PURE__ */ jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang });
21222
+ return /* @__PURE__ */ jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang, textMetrics });
20829
21223
  case "shape-exchange":
20830
- return /* @__PURE__ */ jsx(ShapeExchangeNode, { node: resolvedNode, active, lang });
21224
+ return /* @__PURE__ */ jsx(ShapeExchangeNode, { node: resolvedNode, active, lang, textMetrics });
20831
21225
  case "shape-atm":
20832
- return /* @__PURE__ */ jsx(ShapeAtmNode, { node: resolvedNode, active, lang });
21226
+ return /* @__PURE__ */ jsx(ShapeAtmNode, { node: resolvedNode, active, lang, textMetrics });
20833
21227
  case "shape-website":
20834
- return /* @__PURE__ */ jsx(ShapeWebsiteNode, { node: resolvedNode, active });
21228
+ return /* @__PURE__ */ jsx(ShapeWebsiteNode, { node: resolvedNode, active, textMetrics });
20835
21229
  case "shape-storefront":
20836
- return /* @__PURE__ */ jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang });
21230
+ return /* @__PURE__ */ jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang, textMetrics });
20837
21231
  case "shape-warehouse":
20838
- return /* @__PURE__ */ jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang });
21232
+ return /* @__PURE__ */ jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang, textMetrics });
20839
21233
  case "shape-online-shop":
20840
- return /* @__PURE__ */ jsx(ShapeOnlineShopNode, { node: resolvedNode, active });
21234
+ return /* @__PURE__ */ jsx(ShapeOnlineShopNode, { node: resolvedNode, active, textMetrics });
20841
21235
  case "shape-cdn-edge":
20842
- return /* @__PURE__ */ jsx(ShapeCdnEdgeNode, { node: resolvedNode, active });
21236
+ return /* @__PURE__ */ jsx(ShapeCdnEdgeNode, { node: resolvedNode, active, textMetrics });
20843
21237
  case "shape-api-gateway":
20844
- return /* @__PURE__ */ jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang });
21238
+ return /* @__PURE__ */ jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang, textMetrics });
20845
21239
  case "shape-auditor":
20846
21240
  return /* @__PURE__ */ jsx(ShapeAuditorNode, { node: resolvedNode, active });
20847
21241
  case "shape-regulator":
@@ -20861,7 +21255,17 @@ function CdlNodeView({
20861
21255
  case "station":
20862
21256
  return /* @__PURE__ */ jsx(StationNode, { node: resolvedNode, active });
20863
21257
  default:
20864
- return /* @__PURE__ */ jsx(GenericNode, { node: resolvedNode, active, value: node.value, stateValues, \u5024\u306E\u540D\u524D });
21258
+ return /* @__PURE__ */ jsx(
21259
+ GenericNode,
21260
+ {
21261
+ node: resolvedNode,
21262
+ active,
21263
+ value: node.value,
21264
+ stateValues,
21265
+ \u5024\u306E\u540D\u524D,
21266
+ textMetrics
21267
+ }
21268
+ );
20865
21269
  }
20866
21270
  })();
20867
21271
  const offsetX = node.renderOffsetX !== void 0 ? resolveNumericAttr(node.renderOffsetX, stateValues, 0) : 0;
@@ -20922,7 +21326,7 @@ function CdlNodeView({
20922
21326
  }
20923
21327
  ),
20924
21328
  inner,
20925
- \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode)
21329
+ \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode, textMetrics ?? "proportional")
20926
21330
  ]
20927
21331
  }
20928
21332
  );
@@ -20931,17 +21335,17 @@ var FIGURE_TITLE_GAP = 10;
20931
21335
  var FIGURE_TITLE_SIZE = 15;
20932
21336
  var FIGURE_EYEBROW_SIZE = 11;
20933
21337
  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);
21338
+ function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45, textMetrics = "proportional") {
21339
+ const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0, textMetrics);
20936
21340
  return \u5B9F\u5E45 > \u5E45 ? \u7D20\u306E\u5927\u304D\u3055 * \u5E45 / \u5B9F\u5E45 : \u7D20\u306E\u5927\u304D\u3055;
20937
21341
  }
20938
- function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
21342
+ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node, textMetrics = "proportional") {
20939
21343
  if (!drawsFigureTitle(node.kind)) return null;
20940
21344
  const \u540D\u524D = (node.title ?? "").trim();
20941
21345
  const \u5C0F\u898B\u51FA\u3057 = (node.eyebrow ?? "").trim();
20942
21346
  if (\u540D\u524D === "" && \u5C0F\u898B\u51FA\u3057 === "") return null;
20943
21347
  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);
21348
+ const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w, textMetrics);
20945
21349
  const \u5C0F\u898B\u51FA\u3057\u306Ey = \u540D\u524D === "" ? \u984C\u306Ey : \u984C\u306Ey - \u984C\u306E\u5927\u304D\u3055 * FIGURE_EYEBROW_LIFT;
20946
21350
  return /* @__PURE__ */ jsxs(Fragment, { children: [
20947
21351
  \u5C0F\u898B\u51FA\u3057 !== "" && /* @__PURE__ */ jsx(
@@ -20951,7 +21355,7 @@ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
20951
21355
  x: node.cx,
20952
21356
  y: \u5C0F\u898B\u51FA\u3057\u306Ey,
20953
21357
  textAnchor: "middle",
20954
- fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w),
21358
+ fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w, textMetrics),
20955
21359
  fontWeight: 600,
20956
21360
  letterSpacing: 0.6,
20957
21361
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -21276,6 +21680,7 @@ function CdlStage({
21276
21680
  node,
21277
21681
  active: activeSet.has(node.id),
21278
21682
  lang: laid.lang,
21683
+ textMetrics: laid.textMetrics,
21279
21684
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3: \u7BB1\u306E\u53D7\u3051\u53E3,
21280
21685
  drawing: \u63CF\u304F,
21281
21686
  progress: \u63CF\u304F ? \u63CF\u304F\u9032\u307F : progress,
@@ -21292,7 +21697,8 @@ function CdlStage({
21292
21697
  CdlEdgeLabelView,
21293
21698
  {
21294
21699
  edge,
21295
- active: activeSet.has(edge.id)
21700
+ active: activeSet.has(edge.id),
21701
+ textMetrics: laid.textMetrics
21296
21702
  },
21297
21703
  `label-${edge.id}`
21298
21704
  )),
@@ -21302,7 +21708,8 @@ function CdlStage({
21302
21708
  {
21303
21709
  edge,
21304
21710
  active: activeSet.has(edge.id),
21305
- \u7AEF
21711
+ \u7AEF,
21712
+ textMetrics: laid.textMetrics
21306
21713
  },
21307
21714
  `${\u7AEF}-label-${edge.id}`
21308
21715
  ))
@@ -22367,7 +22774,15 @@ function useInteractiveIntegration(diagram, options = {}) {
22367
22774
  f.id
22368
22775
  )) }),
22369
22776
  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)) })
22777
+ readouts.length > 0 && /* @__PURE__ */ jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsx(
22778
+ ReadoutWidget,
22779
+ {
22780
+ readout: r,
22781
+ stateOverrides: mergedStateValues,
22782
+ textMetrics: resolveTextMetrics(diagram.textMetrics)
22783
+ },
22784
+ r.id
22785
+ )) })
22371
22786
  ] }) })
22372
22787
  );
22373
22788
  }, [diagram, signals, stateOverrides, mergedStateValues]);
@@ -22788,7 +23203,8 @@ function StepperWidget({
22788
23203
  }
22789
23204
  function ReadoutWidget({
22790
23205
  readout,
22791
- stateOverrides
23206
+ stateOverrides,
23207
+ textMetrics = "proportional"
22792
23208
  }) {
22793
23209
  const rawValue = "source" in readout ? stateOverrides[readout.source] : void 0;
22794
23210
  const numericValue = typeof rawValue === "number" ? rawValue : typeof rawValue === "string" ? Number(rawValue) : Number.NaN;
@@ -23036,7 +23452,8 @@ function ReadoutWidget({
23036
23452
  max: readout.max,
23037
23453
  viewW: readout.viewW ?? 280,
23038
23454
  viewH: readout.viewH ?? 60,
23039
- color: readout.color ?? "#2563eb"
23455
+ color: readout.color ?? "#2563eb",
23456
+ textMetrics
23040
23457
  }
23041
23458
  );
23042
23459
  case "radar": {
@@ -23852,7 +24269,8 @@ function ReadoutWidget({
23852
24269
  { status: "idle", color: "#94a3b8" },
23853
24270
  { status: "error", color: "#ef4444" }
23854
24271
  ],
23855
- max: readout.max ?? 10
24272
+ max: readout.max ?? 10,
24273
+ textMetrics
23856
24274
  }
23857
24275
  );
23858
24276
  case "calendar-week":
@@ -24996,8 +25414,8 @@ function ProgressGroupReadout({
24996
25414
  }) })
24997
25415
  ] });
24998
25416
  }
24999
- function sequenceLabelAnchor(x, name, fontSize, viewW) {
25000
- const half = textWidth(name, fontSize) / 2;
25417
+ function sequenceLabelAnchor(x, name, fontSize, viewW, textMetrics = "proportional") {
25418
+ const half = textWidth(name, fontSize, 0, textMetrics) / 2;
25001
25419
  if (x - half < 0) return "start";
25002
25420
  if (x + half > viewW) return "end";
25003
25421
  return "middle";
@@ -25010,7 +25428,8 @@ function SequenceTimelineReadout({
25010
25428
  max,
25011
25429
  viewW,
25012
25430
  viewH,
25013
- color
25431
+ color,
25432
+ textMetrics = "proportional"
25014
25433
  }) {
25015
25434
  const events = [];
25016
25435
  const trimmed = value.trim();
@@ -25053,7 +25472,17 @@ function SequenceTimelineReadout({
25053
25472
  const x = xFor(e.t);
25054
25473
  return /* @__PURE__ */ jsxs("g", { "data-cdl-event-marker": e.name, children: [
25055
25474
  /* @__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 }),
25475
+ /* @__PURE__ */ jsx(
25476
+ "text",
25477
+ {
25478
+ x,
25479
+ y: trackY - 12,
25480
+ textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW, textMetrics),
25481
+ fontSize: 10,
25482
+ fill: "var(--v4-ink, #1a1f2a)",
25483
+ children: e.name
25484
+ }
25485
+ ),
25057
25486
  /* @__PURE__ */ jsx("text", { x, y: trackY + 18, textAnchor: "middle", fontSize: 9, fill: "var(--v4-mute, #64748b)", children: e.t })
25058
25487
  ] }, i);
25059
25488
  })
@@ -28130,7 +28559,8 @@ function StatusTimelineReadout({
28130
28559
  label,
28131
28560
  value,
28132
28561
  colorMap,
28133
- max
28562
+ max,
28563
+ textMetrics = "proportional"
28134
28564
  }) {
28135
28565
  const events = [];
28136
28566
  const trimmed = value.trim();
@@ -28155,6 +28585,7 @@ function StatusTimelineReadout({
28155
28585
  const cellW = shown.length > 0 ? (width - 20) / shown.length : 0;
28156
28586
  const height = stripHeight + 40;
28157
28587
  const \u533A\u9593\u306E\u5B57 = (status) => status === "active" || status === "idle" || status === "error" ? \u5F15\u304F(`readout.statusTimeline.${status}`) : status.toUpperCase();
28588
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
28158
28589
  return /* @__PURE__ */ jsxs("div", { className: "cdl-ip-item cdl-ip-readout-status-timeline", "data-cdl-readout": id, children: [
28159
28590
  /* @__PURE__ */ jsx("span", { className: "cdl-ip-label", children: label }),
28160
28591
  /* @__PURE__ */ jsx(
@@ -28168,7 +28599,7 @@ function StatusTimelineReadout({
28168
28599
  const x = 10 + i * cellW;
28169
28600
  const c = colorLookup.get(ev.status) ?? "#cbd5e1";
28170
28601
  const \u5B572 = \u533A\u9593\u306E\u5B57(ev.status);
28171
- const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8);
28602
+ const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8, \u6E2C\u308B);
28172
28603
  return /* @__PURE__ */ jsxs("g", { "data-cdl-status-event": i, "data-cdl-status": ev.status, children: [
28173
28604
  /* @__PURE__ */ jsx("rect", { x, y: 10, width: cellW - 2, height: stripHeight, fill: c, rx: 2 }),
28174
28605
  /* @__PURE__ */ jsxs(