@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.cjs CHANGED
@@ -717,6 +717,11 @@ function \u5B57\u3092\u5DEE\u3057\u8FBC\u3080(template, values) {
717
717
  return template.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole);
718
718
  }
719
719
 
720
+ // src/text-metrics.ts
721
+ function resolveTextMetrics(value) {
722
+ return value === "monospace" ? "monospace" : "proportional";
723
+ }
724
+
720
725
  // src/layout/clearance-constants.ts
721
726
  var CLEARANCE_NODE_LABEL = 32;
722
727
  var CLEARANCE_LANE_LABEL = 24;
@@ -878,10 +883,10 @@ function defaultAdvanceEm(ch, code) {
878
883
  if (ch >= "0" && ch <= "9") return 0.72;
879
884
  return 0.65;
880
885
  }
881
- function measureTextWidth(text, opts = {}) {
886
+ function measureAdvanceWidth(text, opts = {}) {
882
887
  const fontSize = opts.fontSize ?? 22;
883
888
  const letterSpacing = opts.letterSpacing ?? 0;
884
- const fontFamily = opts.fontFamily ?? "sans";
889
+ const fontFamily = opts.textMetrics === "monospace" ? "mono" : opts.fontFamily ?? "sans";
885
890
  const bound = opts.bound ?? "layout";
886
891
  let advanceEmSum = 0;
887
892
  let charCount = 0;
@@ -889,7 +894,7 @@ function measureTextWidth(text, opts = {}) {
889
894
  for (const ch of \u6587\u5B57\u5217) {
890
895
  charCount++;
891
896
  const code = ch.codePointAt(0) ?? 0;
892
- const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
897
+ const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) && fontFamily !== "mono" ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
893
898
  if (isEmojiGrapheme(ch, code)) {
894
899
  advanceEmSum += fontFamily === "mono" ? MONO_EMOJI_ADVANCE_EM : EMOJI_ADVANCE_EM;
895
900
  continue;
@@ -905,7 +910,12 @@ function measureTextWidth(text, opts = {}) {
905
910
  const table = ch.length === 1 ? INTER_BOLD_ADVANCE_EM[ch] : void 0;
906
911
  advanceEmSum += (table !== void 0 ? table : defaultAdvanceEm(ch, code)) / \u5272\u308A\u623B\u3057;
907
912
  }
908
- const w = advanceEmSum * fontSize + letterSpacing * charCount;
913
+ return advanceEmSum * fontSize + letterSpacing * charCount;
914
+ }
915
+ function measureTextWidth(text, opts = {}) {
916
+ const fontSize = opts.fontSize ?? 22;
917
+ const bound = opts.bound ?? "layout";
918
+ const w = measureAdvanceWidth(text, opts);
909
919
  return bound === "drawn" ? w : Math.max(w, fontSize * 1.2);
910
920
  }
911
921
  function \u53CE\u3081\u308B\u500D\u7387(text, opts, \u5E45) {
@@ -1273,15 +1283,22 @@ function requiredVerticalLabelGap(pillHs) {
1273
1283
  const step = parallelLabelStepY(pillHs);
1274
1284
  return (pillHs.length - 1) * step + Math.max(first, last) + CLEARANCE_NODE_LABEL * 2;
1275
1285
  }
1276
- function computeLabelBoxW(label, sub) {
1277
- const mainW = measureTextWidth(label ?? "", { fontSize: EDGE_LABEL_TEXT.main.fontSize });
1278
- const subW = sub ? measureTextWidth(sub, { fontSize: EDGE_LABEL_TEXT.sub.fontSize, fontFamily: "mono" }) : 0;
1286
+ function computeLabelBoxW(label, sub, textMetrics = "proportional") {
1287
+ const mainW = measureTextWidth(label ?? "", {
1288
+ fontSize: EDGE_LABEL_TEXT.main.fontSize,
1289
+ textMetrics
1290
+ });
1291
+ const subW = sub ? measureTextWidth(sub, {
1292
+ fontSize: EDGE_LABEL_TEXT.sub.fontSize,
1293
+ fontFamily: "mono",
1294
+ textMetrics
1295
+ }) : 0;
1279
1296
  const raw = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
1280
1297
  const EPSILON = 1e-6;
1281
1298
  return Math.ceil((raw - EPSILON) / 2) * 2;
1282
1299
  }
1283
- function computeLabelBBoxWorld(edge) {
1284
- const boxW = computeLabelBoxW(edge.label, edge.sub);
1300
+ function computeLabelBBoxWorld(edge, textMetrics = "proportional") {
1301
+ const boxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
1285
1302
  const boxH = edge.sub ? LABEL_PILL_H_WITH_SUB : LABEL_PILL_H_MAIN_ONLY;
1286
1303
  const anchor = edge.labelAnchor;
1287
1304
  const boxLeftX = anchor === "start" ? 0 : anchor === "end" ? -boxW : -boxW / 2;
@@ -1505,7 +1522,7 @@ function footerShapeDrawTop(node) {
1505
1522
  // src/layout/collisions.ts
1506
1523
  var LANE_LABEL_CLEARANCE_MARGIN = 2;
1507
1524
  var NEAR_MISS_MARGIN = LANE_LABEL_CLEARANCE_MARGIN;
1508
- function collectBBoxes(lanes, nodes, edges) {
1525
+ function collectBBoxes(lanes, nodes, edges, textMetrics = "proportional") {
1509
1526
  const out = [];
1510
1527
  for (const lane of lanes) {
1511
1528
  if (!lane.label) continue;
@@ -1514,7 +1531,7 @@ function collectBBoxes(lanes, nodes, edges) {
1514
1531
  id: lane.id,
1515
1532
  x: lane.x + 16,
1516
1533
  y: lane.y + 8,
1517
- w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2 }) + 24,
1534
+ w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2, textMetrics }) + 24,
1518
1535
  h: 28
1519
1536
  });
1520
1537
  }
@@ -1532,7 +1549,7 @@ function collectBBoxes(lanes, nodes, edges) {
1532
1549
  }
1533
1550
  for (const e of edges) {
1534
1551
  if (!hasRenderedLabel(e)) continue;
1535
- const bbox = computeLabelBBoxWorld(e);
1552
+ const bbox = computeLabelBBoxWorld(e, textMetrics);
1536
1553
  out.push({
1537
1554
  kind: "edge-label",
1538
1555
  id: e.id,
@@ -2176,7 +2193,7 @@ function clampShiftMagnitude(shift, maxMagnitude) {
2176
2193
  };
2177
2194
  return { dx: clampAxis(shift.dx), dy: clampAxis(shift.dy) };
2178
2195
  }
2179
- function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE) {
2196
+ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE, textMetrics = "proportional") {
2180
2197
  if (edges.length === 0) {
2181
2198
  return {
2182
2199
  edges,
@@ -2187,7 +2204,7 @@ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClea
2187
2204
  }
2188
2205
  const MAX_ACCUMULATED_SHIFT = CHAIN_SHIFT_MAX_ACCUMULATED;
2189
2206
  const labelBBox = (e, offsetX, offsetY) => {
2190
- const base = computeLabelBBoxWorld(e);
2207
+ const base = computeLabelBBoxWorld(e, textMetrics);
2191
2208
  return {
2192
2209
  kind: "edge-label",
2193
2210
  id: e.id,
@@ -2788,11 +2805,15 @@ var \u5411\u304D\u306E\u9806 = [
2788
2805
  { axis: "x", sign: -1, \u540D\u524D: "\u5DE6" },
2789
2806
  { axis: "x", sign: 1, \u540D\u524D: "\u53F3" }
2790
2807
  ];
2791
- function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles) {
2808
+ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles, textMetrics = "proportional") {
2792
2809
  const edgeById = new Map(edges.map((e) => [e.id, e]));
2793
2810
  const \u81EA\u5206 = edgeById.get(labelId);
2794
2811
  if (!\u81EA\u5206) return null;
2795
- const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({ kind: "edge-label", id: e.id, ...computeLabelBBoxWorld(e) }));
2812
+ const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({
2813
+ kind: "edge-label",
2814
+ id: e.id,
2815
+ ...computeLabelBBoxWorld(e, textMetrics)
2816
+ }));
2796
2817
  const label = labels.find((l) => l.id === labelId);
2797
2818
  if (!label) return null;
2798
2819
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
@@ -2834,7 +2855,7 @@ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B,
2834
2855
  }
2835
2856
  return `\u9003\u3052\u5834\u306A\u3057: ${\u7406\u7531.sort((a, b) => a.\u9806 - b.\u9806).map((r) => r.\u6587).join(" / ")}`;
2836
2857
  }
2837
- function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
2858
+ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8, textMetrics = "proportional") {
2838
2859
  if (edges.length === 0) return edges;
2839
2860
  const labeledIds = new Set(
2840
2861
  edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => e.id)
@@ -2852,7 +2873,7 @@ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
2852
2873
  const out = [];
2853
2874
  for (const e of edges) {
2854
2875
  if (!labeledIds.has(e.id)) continue;
2855
- const base = computeLabelBBoxWorld(e);
2876
+ const base = computeLabelBBoxWorld(e, textMetrics);
2856
2877
  const s = getShift(e.id);
2857
2878
  out.push({ kind: "edge-label", id: e.id, x: base.x + s.dx, y: base.y + s.dy, w: base.w, h: base.h });
2858
2879
  }
@@ -2985,7 +3006,7 @@ function applyEdgeLabelAndPathShifts(edges, labelShiftMap, edgePathShiftMap) {
2985
3006
 
2986
3007
  // src/layout/curve-path.ts
2987
3008
  var SAME_HEIGHT_THRESHOLD = 1;
2988
- function curvePath(from, to, edge, labelMarginExtra = 0) {
3009
+ function curvePath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
2989
3010
  const fromLeft = from.cx - from.w / 2;
2990
3011
  const fromRight = from.cx + from.w / 2;
2991
3012
  const toLeft = to.cx - to.w / 2;
@@ -3053,7 +3074,7 @@ function curvePath(from, to, edge, labelMarginExtra = 0) {
3053
3074
  normalX *= -1;
3054
3075
  normalY *= -1;
3055
3076
  }
3056
- const labelW = computeLabelBoxW(edge?.label, edge?.sub);
3077
+ const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
3057
3078
  const labelH = labelPillH(edge?.sub);
3058
3079
  const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
3059
3080
  return {
@@ -3085,7 +3106,7 @@ function polyline(points) {
3085
3106
  });
3086
3107
  return distinct.map((p, i) => `${i === 0 ? "M" : "L"} ${point(p)}`).join(" ");
3087
3108
  }
3088
- function metroPath(from, to, edge, labelMarginExtra = 0) {
3109
+ function metroPath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
3089
3110
  const fromLeft = from.cx - from.w / 2;
3090
3111
  const fromRight = from.cx + from.w / 2;
3091
3112
  const toLeft = to.cx - to.w / 2;
@@ -3196,7 +3217,7 @@ function metroPath(from, to, edge, labelMarginExtra = 0) {
3196
3217
  normalX *= -1;
3197
3218
  normalY *= -1;
3198
3219
  }
3199
- const labelW = computeLabelBoxW(edge?.label, edge?.sub);
3220
+ const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
3200
3221
  const labelH = labelPillH(edge?.sub);
3201
3222
  const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
3202
3223
  return {
@@ -3365,7 +3386,14 @@ var NARROW_RATIO = 0.37;
3365
3386
  var ASCII_RATIO = 0.86;
3366
3387
  var WIDE_CHARS = "W@%Mm";
3367
3388
  var NARROW_CHARS = "ijlI.,:;'! ";
3368
- function textWidth(s, size, \u5B57\u9001\u308A = 0) {
3389
+ function textWidth(s, size, \u5B57\u9001\u308A = 0, textMetrics = "proportional") {
3390
+ if (textMetrics === "monospace") {
3391
+ return measureAdvanceWidth(s, {
3392
+ fontSize: size,
3393
+ letterSpacing: \u5B57\u9001\u308A,
3394
+ fontFamily: "mono"
3395
+ });
3396
+ }
3369
3397
  let \u5E45 = 0;
3370
3398
  let \u5B57\u6570 = 0;
3371
3399
  for (const c of s) {
@@ -3402,8 +3430,8 @@ function splitRow(row) {
3402
3430
  }
3403
3431
  return { left: row.trim(), right: "", split: false };
3404
3432
  }
3405
- function rowColumnWidth(text, size, mono) {
3406
- return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size);
3433
+ function rowColumnWidth(text, size, mono, textMetrics = "proportional") {
3434
+ return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size, 0, textMetrics);
3407
3435
  }
3408
3436
  function displayWidth(text) {
3409
3437
  let w = 0;
@@ -3429,12 +3457,12 @@ function \u6841\u3067\u7701\u304F(text, \u4E0A\u9650) {
3429
3457
  if (displayWidth(text) <= \u4E0A\u9650) return text;
3430
3458
  return `${\u6841\u3067\u5272\u308B(text, \u4E0A\u9650 - 1)[0]}\u2026`;
3431
3459
  }
3432
- function requiredRowsWidth(rows, kind) {
3460
+ function requiredRowsWidth(rows, kind, textMetrics = "proportional") {
3433
3461
  if (!rows || rows.length === 0) return 0;
3434
3462
  const splits = rows.map(splitRow);
3435
3463
  const \u4E00\u756A\u5E83\u3044 = (\u53D6\u308B) => splits.reduce((m, s) => Math.max(m, \u53D6\u308B(s)), 0);
3436
- const storage = ROW_PAD_X_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.left, 26, true)) + STORAGE_COL_GAP_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.right, 26, true)) + ROW_RIGHT_PAD_PX;
3437
- const generic = ROW_PAD_X_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)) + ROW_COL_GAP_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.right, GENERIC_ROW_RIGHT_SIZE_PX, true)) + ROW_RIGHT_PAD_PX;
3464
+ const storage = ROW_PAD_X_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.left, 26, true, textMetrics)) + STORAGE_COL_GAP_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.right, 26, true, textMetrics)) + ROW_RIGHT_PAD_PX;
3465
+ const generic = ROW_PAD_X_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false, textMetrics)) + ROW_COL_GAP_PX + \u4E00\u756A\u5E83\u3044((s) => rowColumnWidth(s.right, GENERIC_ROW_RIGHT_SIZE_PX, true, textMetrics)) + ROW_RIGHT_PAD_PX;
3438
3466
  if (kind === void 0) return Math.ceil(Math.max(storage, generic));
3439
3467
  return Math.ceil(kind === "storage" ? storage : generic);
3440
3468
  }
@@ -3499,7 +3527,10 @@ var \u5DE6\u53F3\u306E\u4F59\u767D = 8;
3499
3527
  function \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45) {
3500
3528
  return \u7BB1\u306E\u5E45 - \u5DE6\u53F3\u306E\u4F59\u767D * 2;
3501
3529
  }
3502
- function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
3530
+ function \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics = "proportional") {
3531
+ return (text, fontSize) => textWidth(text, fontSize, 0, textMetrics);
3532
+ }
3533
+ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
3503
3534
  if (\u4F7F\u3048\u308B\u5E452 <= 0) return "";
3504
3535
  if (\u6E2C\u308B(text, fontSize) <= \u4F7F\u3048\u308B\u5E452) return text;
3505
3536
  const \u7701\u7565 = "\u2026";
@@ -3516,7 +3547,7 @@ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6
3516
3547
  return `${\u51FA}${\u7701\u7565}`;
3517
3548
  }
3518
3549
  var \u7E2E\u3081\u306E\u4E0B\u9650 = MIN_TEXT_SIZE;
3519
- function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
3550
+ function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
3520
3551
  let size = fontSize;
3521
3552
  while (size > \u7E2E\u3081\u306E\u4E0B\u9650 && \u6E2C\u308B(text, size) > \u4F7F\u3048\u308B\u5E452) size -= 1;
3522
3553
  return { text: \u5E45\u3067\u5207\u308B(text, size, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B), fontSize: size };
@@ -3526,7 +3557,7 @@ function \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text) {
3526
3557
  if (typeof \u533A\u5207\u308A !== "function") return [...text];
3527
3558
  return [...new \u533A\u5207\u308A(void 0, { granularity: "grapheme" }).segment(text)].map((g) => g.segment);
3528
3559
  }
3529
- function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553) {
3560
+ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553, \u6E2C\u308B) {
3530
3561
  const \u5019\u88DC = \u884C.filter((r, i) => i === 0 || r.text.trim() !== "");
3531
3562
  if (\u5019\u88DC.length === 0) return [];
3532
3563
  const \u4F7F\u3048\u308B\u9AD8\u3055 = \u7BB1\u306E\u9AD8\u30553 - \u4E0A\u4E0B\u306E\u4F59\u767D * 2;
@@ -3534,7 +3565,7 @@ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8
3534
3565
  const \u6B8B\u3059 = [...\u5019\u88DC];
3535
3566
  while (\u6B8B\u3059.length > 1 && \u9AD8\u3055(\u6B8B\u3059) > \u4F7F\u3048\u308B\u9AD8\u3055) \u6B8B\u3059.pop();
3536
3567
  const \u5E45 = \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45);
3537
- const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45) }));
3568
+ const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45, \u6E2C\u308B) }));
3538
3569
  const \u7DCF\u9AD8 = \u9AD8\u3055(\u53CE\u3081\u305F);
3539
3570
  let \u7A4D\u307F = -\u7DCF\u9AD8 / 2;
3540
3571
  return \u53CE\u3081\u305F.map((r) => {
@@ -3547,9 +3578,9 @@ function \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(\u66F8\u3044\u305F, \u63A7\u
3547
3578
  const v = (\u66F8\u3044\u305F ?? "").trim();
3548
3579
  return v === "" ? \u63A7\u3048 : v;
3549
3580
  }
3550
- function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45) {
3581
+ function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45, textMetrics = "proportional") {
3551
3582
  if (!(\u5E45 > 0) || !(size > 0)) return 1;
3552
- const \u5B9F\u5E45 = textWidth(text, size, letterSpacing);
3583
+ const \u5B9F\u5E45 = textWidth(text, size, letterSpacing, textMetrics);
3553
3584
  return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
3554
3585
  }
3555
3586
  function \u8AAD\u3081\u308B\u4E0B\u9650\u306E\u500D\u7387(\u5927\u304D\u3055) {
@@ -3764,13 +3795,13 @@ function fitArt(region, extent, art) {
3764
3795
  );
3765
3796
  }
3766
3797
  var \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
3767
- function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0) {
3798
+ function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0, textMetrics = "proportional") {
3768
3799
  return Math.max(
3769
3800
  displayWidth(text) * size * MONO_ADVANCE_RATIO,
3770
- textWidth(text, size, letterSpacing)
3801
+ textWidth(text, size, letterSpacing, textMetrics)
3771
3802
  );
3772
3803
  }
3773
- function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089) {
3804
+ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089, textMetrics = "proportional") {
3774
3805
  const \u623B\u3057 = Number.isFinite(\u500D\u7387) && \u500D\u7387 > 0 ? 1 / \u500D\u7387 : 1;
3775
3806
  let \u4E0A\u9650 = Number.POSITIVE_INFINITY;
3776
3807
  for (const \u5B572 of \u5B57\u3089) {
@@ -3779,7 +3810,7 @@ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089)
3779
3810
  if (Number.isFinite(\u9AD8\u3055) && \u9AD8\u3055 > 0) {
3780
3811
  \u4E0A\u9650 = Math.min(\u4E0A\u9650, \u9AD8\u3055 * \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u5B572.size);
3781
3812
  }
3782
- const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0);
3813
+ const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0, textMetrics);
3783
3814
  if (Number.isFinite(\u5E45) && \u5E45 > 0 && \u5B9F\u5E45 > 0) {
3784
3815
  \u4E0A\u9650 = Math.min(\u4E0A\u9650, \u5E45 / \u5B9F\u5E45);
3785
3816
  }
@@ -4974,9 +5005,14 @@ var PAD_LEFT = 24;
4974
5005
  var \u7BB1\u306E\u6700\u5927\u5E45 = 140;
4975
5006
  var \u7BB1\u306E\u6700\u5927\u9AD8\u3055 = 38;
4976
5007
  var \u6728\u306E\u679D\u306E\u592A\u3055 = (\u6BB5) => Math.max(1.1, 2.6 - \u6BB5 * 0.45);
4977
- function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}) {
5008
+ function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
4978
5009
  const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
4979
- return computeTreeLayout(treeNodes, node.w - PAD_LEFT - PAD_RIGHT, node.h - PAD_TOP - PAD_BOTTOM);
5010
+ return computeTreeLayout(
5011
+ treeNodes,
5012
+ node.w - PAD_LEFT - PAD_RIGHT,
5013
+ node.h - PAD_TOP - PAD_BOTTOM,
5014
+ textMetrics
5015
+ );
4980
5016
  }
4981
5017
  function \u6728\u306E\u884C(n) {
4982
5018
  return [
@@ -4989,12 +5025,14 @@ function TreeNode({
4989
5025
  active,
4990
5026
  stateValues = {},
4991
5027
  drawing = false,
4992
- progress = 1
5028
+ progress = 1,
5029
+ textMetrics = "proportional"
4993
5030
  }) {
4994
5031
  const x0 = node.cx - node.w / 2;
4995
5032
  const y0 = node.cy - node.h / 2;
4996
5033
  const gradientId = `tree-root-grad-${node.id}`;
4997
- const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues);
5034
+ const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
5035
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
4998
5036
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
4999
5037
  const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
5000
5038
  const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
@@ -5048,10 +5086,10 @@ function TreeNode({
5048
5086
  const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
5049
5087
  const isRoot = n.depth === 0;
5050
5088
  const \u6750\u6599 = \u6728\u306E\u884C(n);
5051
- const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h);
5089
+ const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h, \u6E2C\u308B);
5052
5090
  const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
5053
5091
  const \u540D\u524D = \u6750\u6599[0];
5054
- const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B\u5E45(n.w));
5092
+ const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B\u5E45(n.w), \u6E2C\u308B);
5055
5093
  return /* @__PURE__ */ jsxRuntime.jsx(
5056
5094
  "g",
5057
5095
  {
@@ -5133,7 +5171,7 @@ function TreeNode({
5133
5171
  })
5134
5172
  ] });
5135
5173
  }
5136
- function computeTreeLayout(treeNodes, canvasW, canvasH) {
5174
+ function computeTreeLayout(treeNodes, canvasW, canvasH, textMetrics = "proportional") {
5137
5175
  const ids = new Set(treeNodes.map((n) => n.id));
5138
5176
  const childrenOf = /* @__PURE__ */ new Map();
5139
5177
  for (const n of treeNodes) {
@@ -5181,7 +5219,7 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
5181
5219
  const \u7BB1\u306E\u5E45 = (n, depth) => {
5182
5220
  const \u6750\u6599 = \u6728\u306E\u884C({ ...n, depth });
5183
5221
  const \u540D\u524D = \u6750\u6599[0];
5184
- const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize}) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
5222
+ const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize, textMetrics }) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
5185
5223
  return Math.min(Math.max(\u8981\u308B, nodeW), slotW * 0.92);
5186
5224
  };
5187
5225
  const \u8449\u306E\u4E26\u3073 = [];
@@ -5285,7 +5323,7 @@ var BRANCH_BOX_H_MAX = 48;
5285
5323
  var SUB_BOX_H_MAX = 40;
5286
5324
  var \u7E26\u306E\u9593\u9694\u306E\u4E0A\u9650 = (\u679D\u306E\u6A2A\u306E\u4F38\u3073) => \u679D\u306E\u6A2A\u306E\u4F38\u3073;
5287
5325
  var MIND_PAD = 40;
5288
- function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
5326
+ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
5289
5327
  const mindData = node.mindData ? resolveMindData(node.mindData, stateValues) : void 0;
5290
5328
  if (!mindData) return void 0;
5291
5329
  return computeMindMapLayout(
@@ -5293,7 +5331,8 @@ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
5293
5331
  node.w / 2,
5294
5332
  node.h / 2,
5295
5333
  node.w - MIND_PAD * 2,
5296
- node.h - MIND_PAD * 2
5334
+ node.h - MIND_PAD * 2,
5335
+ textMetrics
5297
5336
  );
5298
5337
  }
5299
5338
  function \u653E\u5C04\u306E\u884C(n) {
@@ -5307,12 +5346,14 @@ function MindMapNode({
5307
5346
  active,
5308
5347
  stateValues = {},
5309
5348
  drawing = false,
5310
- progress = 1
5349
+ progress = 1,
5350
+ textMetrics = "proportional"
5311
5351
  }) {
5312
5352
  const x0 = node.cx - node.w / 2;
5313
5353
  const y0 = node.cy - node.h / 2;
5314
- const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues);
5354
+ const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
5315
5355
  if (!layout2) return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${x0} ${y0})` });
5356
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
5316
5357
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
5317
5358
  const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
5318
5359
  const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
@@ -5359,8 +5400,13 @@ function MindMapNode({
5359
5400
  const \u6587\u5B57\u306E\u5BC4\u305B = \u67A0\u306A\u3057 ? \u5916\u3078 ? "start" : "end" : "middle";
5360
5401
  const \u63CF\u753B\u57DF\u306E\u7AEF = \u5916\u3078 ? node.w - MIND_PAD : MIND_PAD;
5361
5402
  const \u4F7F\u3048\u308B = \u67A0\u306A\u3057 ? Math.abs(\u63CF\u753B\u57DF\u306E\u7AEF - \u6587\u5B57\u306Ex) : \u4F7F\u3048\u308B\u5E45(n.w);
5362
- const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B);
5363
- const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, \u67A0\u306A\u3057 ? \u4F7F\u3048\u308B + (n.w - \u4F7F\u3048\u308B\u5E45(n.w)) : n.w, n.h);
5403
+ const \u53CE\u3081\u305F\u540D\u524D = \u88DC\u8DB3\u3042\u308A ? void 0 : \u5E45\u306B\u53CE\u3081\u308B(\u540D\u524D.text, \u540D\u524D.fontSize, \u4F7F\u3048\u308B, \u6E2C\u308B);
5404
+ const \u884C = \u7BB1\u306B\u7A4D\u3080(
5405
+ \u6750\u6599,
5406
+ \u67A0\u306A\u3057 ? \u4F7F\u3048\u308B + (n.w - \u4F7F\u3048\u308B\u5E45(n.w)) : n.w,
5407
+ n.h,
5408
+ \u6E2C\u308B
5409
+ );
5364
5410
  const \u6587\u5B57\u306E\u8272 = n.isRoot ? "var(--cdl-text-on-tone, #ffffff)" : "var(--cdl-chip-text, #1a1f2a)";
5365
5411
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-unresolved": n.unresolved ? "true" : void 0, children: [
5366
5412
  \u67A0\u306A\u3057 ? null : /* @__PURE__ */ jsxRuntime.jsx(
@@ -5412,14 +5458,14 @@ function MindMapNode({
5412
5458
  })
5413
5459
  ] });
5414
5460
  }
5415
- function \u63CF\u304F\u6A2A\u306E\u7AEF(n) {
5461
+ function \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics = "proportional") {
5416
5462
  if (n.isRoot || !n.isLeaf) return [n.x - n.w / 2, n.x + n.w / 2];
5417
5463
  const \u8D77\u70B9 = n.x + (n.side === "right" ? -n.w / 2 : n.w / 2);
5418
5464
  const \u540D\u524D = \u653E\u5C04\u306E\u884C(n)[0];
5419
- const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
5465
+ const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
5420
5466
  return n.side === "right" ? [\u8D77\u70B9, \u8D77\u70B9 + \u5E45] : [\u8D77\u70B9 - \u5E45, \u8D77\u70B9];
5421
5467
  }
5422
- function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5468
+ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH, textMetrics = "proportional") {
5423
5469
  const nodes = [];
5424
5470
  const edges = [];
5425
5471
  const rootW = 120;
@@ -5497,7 +5543,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5497
5543
  const PREFERRED_GAP = MIND_BOX_GAP;
5498
5544
  const \u679D\u306E\u540D\u524D\u306E\u5E45 = (title) => {
5499
5545
  const \u540D\u524D = \u653E\u5C04\u306E\u884C({ title, isRoot: false })[0];
5500
- return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
5546
+ return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
5501
5547
  };
5502
5548
  const \u679D\u306E\u6A2A\u3092\u6C7A\u3081\u308B = (br) => {
5503
5549
  const maxSubDepth = subDepthOf(br.id, /* @__PURE__ */ new Set());
@@ -5615,7 +5661,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5615
5661
  let maxExtentX = rootW / 2;
5616
5662
  let maxExtentY = rootH / 2;
5617
5663
  for (const n of nodes) {
5618
- const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
5664
+ const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
5619
5665
  maxExtentX = Math.max(maxExtentX, Math.abs(\u5DE6 - cx), Math.abs(\u53F3 - cx));
5620
5666
  maxExtentY = Math.max(maxExtentY, Math.abs(n.y - cy) + n.h / 2);
5621
5667
  }
@@ -5635,7 +5681,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5635
5681
  let \u5DE6\u7AEF = Number.POSITIVE_INFINITY;
5636
5682
  let \u53F3\u7AEF = Number.NEGATIVE_INFINITY;
5637
5683
  for (const n of nodes) {
5638
- const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
5684
+ const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
5639
5685
  \u5DE6\u7AEF = Math.min(\u5DE6\u7AEF, l);
5640
5686
  \u53F3\u7AEF = Math.max(\u53F3\u7AEF, r);
5641
5687
  }
@@ -5857,10 +5903,16 @@ function emptyCounts() {
5857
5903
  "validation-interrupted": 0
5858
5904
  };
5859
5905
  }
5860
- function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n) {
5861
- const \u7BB1 = (b, \u884C) => ({ \u884C, w: b.w, h: b.h });
5862
- if (n.kind === "tree-hierarchy") return \u6728\u306E\u4E2D\u8EAB(n).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b)));
5863
- if (n.kind === "mind-map") return (\u653E\u5C04\u306E\u4E2D\u8EAB(n)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b)));
5906
+ function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics = "proportional") {
5907
+ const \u7BB1 = (b, \u884C, \u6E2C\u308B) => ({ \u884C, w: b.w, h: b.h, \u6E2C\u308B });
5908
+ if (n.kind === "tree-hierarchy") {
5909
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
5910
+ return \u6728\u306E\u4E2D\u8EAB(n, {}, textMetrics).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b), \u6E2C\u308B));
5911
+ }
5912
+ if (n.kind === "mind-map") {
5913
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
5914
+ return (\u653E\u5C04\u306E\u4E2D\u8EAB(n, {}, textMetrics)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b), \u6E2C\u308B));
5915
+ }
5864
5916
  return [];
5865
5917
  }
5866
5918
  function measureStubOut(segs) {
@@ -6494,6 +6546,7 @@ function \u4F4D\u7F6E\u3092\u624B\u3067\u66F8\u3044\u305F(n) {
6494
6546
  return n.posX !== void 0 && n.posY !== void 0;
6495
6547
  }
6496
6548
  function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5668) {
6549
+ const textMetrics = laid.textMetrics ?? "proportional";
6497
6550
  const LIFELINE_W_THRESHOLD = 8;
6498
6551
  for (const n of laid.nodes) {
6499
6552
  if (n.w < LIFELINE_W_THRESHOLD) continue;
@@ -6505,7 +6558,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6505
6558
  );
6506
6559
  }
6507
6560
  }
6508
- const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges);
6561
+ const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges, textMetrics);
6509
6562
  const collisions = detectCollisions(bboxes, laid.edges);
6510
6563
  for (const c of collisions) {
6511
6564
  const involvesEdgeLabel = c.a.kind === "edge-label" || c.b.kind === "edge-label";
@@ -6525,7 +6578,11 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6525
6578
  if (!titleTrimmed) continue;
6526
6579
  const \u4F59\u767D = drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING;
6527
6580
  const \u4F7F\u3048\u308B\u5E452 = n.w - \u4F59\u767D;
6528
- const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, { fontSize: titleFontSize(n.kind), bound: "drawn" });
6581
+ const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, {
6582
+ fontSize: titleFontSize(n.kind),
6583
+ bound: "drawn",
6584
+ textMetrics
6585
+ });
6529
6586
  if (titleScalesToFit(n.kind, n.h)) {
6530
6587
  const \u7E2E\u3081\u305F\u5927\u304D\u3055 = \u5B9F\u5E45 > 0 ? titleFontSize(n.kind) * Math.min(1, \u4F7F\u3048\u308B\u5E452 / \u5B9F\u5E45) : titleFontSize(n.kind);
6531
6588
  if (\u7E2E\u3081\u305F\u5927\u304D\u3055 < MIN_TITLE_FONT_SIZE) {
@@ -6593,7 +6650,13 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6593
6650
  const b\u306F\u672D = n.b.kind === "edge-label";
6594
6651
  const \u52D5\u304B\u3059 = a\u306F\u672D && b\u306F\u672D ? (\u8FBA\u306E\u9806.get(n.a.id) ?? 0) > (\u8FBA\u306E\u9806.get(n.b.id) ?? 0) ? n.a : n.b : a\u306F\u672D ? n.a : b\u306F\u672D ? n.b : null;
6595
6652
  const \u76F8\u624B = \u52D5\u304B\u3059 === n.a ? n.b : n.a;
6596
- const reason = \u52D5\u304B\u3059 !== null ? \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(\u52D5\u304B\u3059.id, \u76F8\u624B, laid.edges, \u672D\u306E\u969C\u5BB3\u7269) ?? void 0 : void 0;
6653
+ const reason = \u52D5\u304B\u3059 !== null ? \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(
6654
+ \u52D5\u304B\u3059.id,
6655
+ \u76F8\u624B,
6656
+ laid.edges,
6657
+ \u672D\u306E\u969C\u5BB3\u7269,
6658
+ textMetrics
6659
+ ) ?? void 0 : void 0;
6597
6660
  push(
6598
6661
  "clearance",
6599
6662
  `${n.a.kind}:${n.a.id} \u2194 ${n.b.kind}:${n.b.id} gap=${n.gap.toFixed(1)}px (need ${n.required}px)`,
@@ -6607,7 +6670,10 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6607
6670
  if (!hasRenderedLabel(e)) continue;
6608
6671
  const segs = extractPathSegments(e.d);
6609
6672
  if (segs.length === 0) continue;
6610
- const minDist = measurePathLabelGapSegs(flattenPathSegments(segs), computeLabelBBoxWorld(e));
6673
+ const minDist = measurePathLabelGapSegs(
6674
+ flattenPathSegments(segs),
6675
+ computeLabelBBoxWorld(e, textMetrics)
6676
+ );
6611
6677
  if (!Number.isFinite(minDist)) continue;
6612
6678
  if (minDist > PROXIMITY_ERROR_THRESHOLD) {
6613
6679
  push(
@@ -6657,8 +6723,15 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6657
6723
  }
6658
6724
  for (const e of laid.edges) {
6659
6725
  if (!hasRenderedLabel(e)) continue;
6660
- const mainW = measureTextWidth(e.label ?? "", { fontSize: EDGE_LABEL_TEXT.main.fontSize });
6661
- const subW = e.sub ? measureTextWidth(e.sub, { fontSize: EDGE_LABEL_TEXT.sub.fontSize, fontFamily: "mono" }) : 0;
6726
+ const mainW = measureTextWidth(e.label ?? "", {
6727
+ fontSize: EDGE_LABEL_TEXT.main.fontSize,
6728
+ textMetrics
6729
+ });
6730
+ const subW = e.sub ? measureTextWidth(e.sub, {
6731
+ fontSize: EDGE_LABEL_TEXT.sub.fontSize,
6732
+ fontFamily: "mono",
6733
+ textMetrics
6734
+ }) : 0;
6662
6735
  const expectedBoxW = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
6663
6736
  const bbox = bboxes.find((b) => b.kind === "edge-label" && b.id === e.id);
6664
6737
  if (!bbox) continue;
@@ -6800,7 +6873,9 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6800
6873
  }
6801
6874
  }
6802
6875
  for (const n of laid.nodes) {
6803
- const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter((line) => droppedLineIsHidden(n.kind, line));
6876
+ const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter(
6877
+ (line) => droppedLineIsHidden(n.kind, line)
6878
+ );
6804
6879
  if (\u843D\u3068\u3057\u305F.length === 0) continue;
6805
6880
  push(
6806
6881
  "shape-label-dropped",
@@ -6809,7 +6884,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6809
6884
  );
6810
6885
  }
6811
6886
  for (const n of laid.nodes) {
6812
- const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n);
6887
+ const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics);
6813
6888
  if (\u7BB1.length === 0) continue;
6814
6889
  let \u5BFE\u8C61 = 0;
6815
6890
  const \u843D\u3061\u305F = [];
@@ -6817,7 +6892,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
6817
6892
  const \u5BA3\u8A00 = b.\u884C.slice(1).filter((r) => r.text.trim() !== "");
6818
6893
  if (\u5BA3\u8A00.length === 0) continue;
6819
6894
  \u5BFE\u8C61 += 1;
6820
- const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h).map((r) => r.\u5F79\u5272));
6895
+ const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h, b.\u6E2C\u308B).map((r) => r.\u5F79\u5272));
6821
6896
  if (\u5BA3\u8A00.every((r) => \u6B8B\u3063\u305F.has(r.\u5F79\u5272))) continue;
6822
6897
  \u843D\u3061\u305F.push({ title: b.\u884C[0]?.text ?? "", h: b.h });
6823
6898
  }
@@ -7880,7 +7955,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
7880
7955
  const allowedLanes = /* @__PURE__ */ new Set();
7881
7956
  if (fromNode) allowedLanes.add(fromNode.lane);
7882
7957
  if (toNode) allowedLanes.add(toNode.lane);
7883
- const box = computeLabelBBoxWorld(e);
7958
+ const box = computeLabelBBoxWorld(e, textMetrics);
7884
7959
  for (const lane of laid.lanes) {
7885
7960
  if (allowedLanes.has(lane.id)) continue;
7886
7961
  const side = rectCrossesLaneBorder(box, lane, rangeByLane.get(lane.id));
@@ -8004,7 +8079,7 @@ function pickFreeSides(occupied, count) {
8004
8079
  const \u4F7F\u3046 = \u7A7A\u304D.length > 0 ? \u7A7A\u304D : [SELF_LOOP_SIDE_FALLBACK];
8005
8080
  return Array.from({ length: count }, (_, i) => \u4F7F\u3046[i % \u4F7F\u3046.length]);
8006
8081
  }
8007
- function routeSelfLoopGroup(edges, node, side) {
8082
+ function routeSelfLoopGroup(edges, node, side, textMetrics = "proportional") {
8008
8083
  const horizontal = side === "left" || side === "right";
8009
8084
  const g = sideGeometry(node, side);
8010
8085
  const span = fitSpan(horizontal ? node.h : node.w, SELF_LOOP_SPAN);
@@ -8013,7 +8088,7 @@ function routeSelfLoopGroup(edges, node, side) {
8013
8088
  const \u6700\u5916 = controlOffset(SELF_LOOP_OUT + (edges.length - 1) * SELF_LOOP_STAGGER);
8014
8089
  const \u8A9E\u307E\u3067 = \u6700\u5916 + LABEL_TO_PATH_CLEARANCE;
8015
8090
  const \u8A9E\u5E45 = edges.map(
8016
- (e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub)
8091
+ (e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub, textMetrics)
8017
8092
  );
8018
8093
  const \u4F4D\u7F6E = [];
8019
8094
  let \u7A4D = 0;
@@ -8043,7 +8118,7 @@ function routeSelfLoopGroup(edges, node, side) {
8043
8118
  function isSelfLoop(e) {
8044
8119
  return e.from === e.to;
8045
8120
  }
8046
- function layoutSelfLoops(edges, nodes, occupiedBySide) {
8121
+ function layoutSelfLoops(edges, nodes, occupiedBySide, textMetrics = "proportional") {
8047
8122
  const \u5272\u5F53 = /* @__PURE__ */ new Map();
8048
8123
  for (const edge of edges) {
8049
8124
  if (edge.side) continue;
@@ -8070,7 +8145,7 @@ function layoutSelfLoops(edges, nodes, occupiedBySide) {
8070
8145
  if (\u65E2) \u65E2.edges.push(edge);
8071
8146
  else \u675F.set(key, { node, side, edges: [edge] });
8072
8147
  }
8073
- return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side));
8148
+ return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side, textMetrics));
8074
8149
  }
8075
8150
 
8076
8151
  // src/layout/tokens.ts
@@ -8288,7 +8363,7 @@ function verticalDetourBlockers(A, B, obstacles) {
8288
8363
  function detourColumnFor(blockers, side) {
8289
8364
  return side === "left" ? Math.min(...blockers.map((n) => n.cx - n.w / 2)) - VERTICAL_DETOUR_GAP : Math.max(...blockers.map((n) => n.cx + n.w / 2)) + VERTICAL_DETOUR_GAP;
8290
8365
  }
8291
- function layoutEdges(diag, nodes, lanes = []) {
8366
+ function layoutEdges(diag, nodes, lanes = [], textMetrics = "proportional") {
8292
8367
  const labelMarginExtra = (diag.viewport?.labelMargin ?? diag.viewport?.gap ?? DEFAULT_LABEL_MARGIN) - DEFAULT_LABEL_MARGIN;
8293
8368
  const nmap = new Map(nodes.map((n) => [n.id, n]));
8294
8369
  const lmap = new Map(lanes.map((l) => [l.id, l]));
@@ -8321,7 +8396,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8321
8396
  const to = nmap.get(e.to);
8322
8397
  if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
8323
8398
  if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
8324
- const c = curvePath(from, to, e, labelMarginExtra);
8399
+ const c = curvePath(from, to, e, labelMarginExtra, textMetrics);
8325
8400
  positionedEdges.push({
8326
8401
  ...e,
8327
8402
  d: c.d,
@@ -8336,7 +8411,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8336
8411
  const to = nmap.get(e.to);
8337
8412
  if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
8338
8413
  if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
8339
- const m = metroPath(from, to, e, labelMarginExtra);
8414
+ const m = metroPath(from, to, e, labelMarginExtra, textMetrics);
8340
8415
  positionedEdges.push({
8341
8416
  ...e,
8342
8417
  d: m.d,
@@ -8384,7 +8459,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8384
8459
  \u4F7F\u3046(le.from, le.fromSide);
8385
8460
  \u4F7F\u3046(le.to, le.toSide);
8386
8461
  }
8387
- const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide);
8462
+ const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide, textMetrics);
8388
8463
  const labelOffsetsByEdgeId = /* @__PURE__ */ new Map();
8389
8464
  const parallelKey = (p) => p.e.from < p.e.to ? `${p.e.from}::${p.e.to}` : `${p.e.to}::${p.e.from}`;
8390
8465
  const byParallel = /* @__PURE__ */ new Map();
@@ -8538,7 +8613,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8538
8613
  const others = nodes.filter((n) => n.id !== c.from && n.id !== c.to);
8539
8614
  if (others.some((n) => segmentsCrossRect(segs, nodeRect(n)))) return true;
8540
8615
  if (!hasRenderedLabel(c.e)) return false;
8541
- const boxW = computeLabelBoxW(c.e.label, c.e.sub);
8616
+ const boxW = computeLabelBoxW(c.e.label, c.e.sub, textMetrics);
8542
8617
  const boxH = labelPillH(c.e.sub);
8543
8618
  const centerX = columnX - (labelPathClearanceHorizontal(c.e) + boxW / 2);
8544
8619
  const pill = { x: centerX - boxW / 2, y: (exitY + returnY) / 2 - boxH / 2, w: boxW, h: boxH };
@@ -8653,7 +8728,8 @@ function layoutEdges(diag, nodes, lanes = []) {
8653
8728
  allOtherNodes,
8654
8729
  { x: endpointOffset.fromDx, y: endpointOffset.fromDy },
8655
8730
  { x: endpointOffset.toDx, y: endpointOffset.toDy },
8656
- avoidRects
8731
+ avoidRects,
8732
+ textMetrics
8657
8733
  );
8658
8734
  const routed1 = route([]);
8659
8735
  const { d, labelX, labelY, labelAnchor, labelAltX } = routed1;
@@ -8709,13 +8785,13 @@ function layoutEdges(diag, nodes, lanes = []) {
8709
8785
  const pillById = /* @__PURE__ */ new Map();
8710
8786
  for (const r of list) {
8711
8787
  if (!hasRenderedLabel(r.e)) continue;
8712
- const w = computeLabelBoxW(r.e.label, r.e.sub);
8788
+ const w = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
8713
8789
  const h = labelPillH(r.e.sub);
8714
8790
  pillById.set(r.e.id, { x: r.baseLabelX - w / 2, y: r.baseLabelY - h / 2, w, h });
8715
8791
  }
8716
8792
  for (const le of positionedEdges) {
8717
8793
  if (!hasRenderedLabel(le)) continue;
8718
- const w = computeLabelBoxW(le.label, le.sub);
8794
+ const w = computeLabelBoxW(le.label, le.sub, textMetrics);
8719
8795
  const h = labelPillH(le.sub);
8720
8796
  pillById.set(le.id, { x: le.labelX - w / 2, y: le.labelY - h / 2, w, h });
8721
8797
  }
@@ -8745,7 +8821,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8745
8821
  const laneOfNode = new Map(nodes.map((n) => [n.id, n.lane]));
8746
8822
  for (const r of flippable) {
8747
8823
  const ownSegs = segsByEdgeId.get(r.e.id);
8748
- const boxW = computeLabelBoxW(r.e.label, r.e.sub);
8824
+ const boxW = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
8749
8825
  const boxH = labelPillH(r.e.sub);
8750
8826
  const pillAt = (centerX) => ({
8751
8827
  x: centerX - boxW / 2,
@@ -8790,7 +8866,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8790
8866
  if (list.length < 2) continue;
8791
8867
  const boxes = list.map((r) => ({
8792
8868
  cx: r.baseLabelX,
8793
- halfW: computeLabelBoxW(r.e.label, r.e.sub) / 2
8869
+ halfW: computeLabelBoxW(r.e.label, r.e.sub, textMetrics) / 2
8794
8870
  }));
8795
8871
  const overlapsX = (i, j) => Math.abs(boxes[i].cx - boxes[j].cx) < boxes[i].halfW + boxes[j].halfW + CLEARANCE_LABEL_LABEL;
8796
8872
  const componentOf = list.map((_, i) => i);
@@ -8840,7 +8916,7 @@ function layoutEdges(diag, nodes, lanes = []) {
8840
8916
  r,
8841
8917
  baseX: r.baseLabelX,
8842
8918
  baseY: r.baseLabelY,
8843
- w: computeLabelBoxW(r.e.label, r.e.sub),
8919
+ w: computeLabelBoxW(r.e.label, r.e.sub, textMetrics),
8844
8920
  h: labelPillH(r.e.sub)
8845
8921
  }));
8846
8922
  items.sort((a, b) => a.baseX - b.baseX);
@@ -8952,7 +9028,7 @@ function singleStraightSegment(d) {
8952
9028
  if (x1 === x2 && y1 === y2) return null;
8953
9029
  return { x1, y1, x2, y2 };
8954
9030
  }
8955
- function bowSharedStraightPaths(edges, nodes, skipIds) {
9031
+ function bowSharedStraightPaths(edges, nodes, skipIds, textMetrics = "proportional") {
8956
9032
  const groups = /* @__PURE__ */ new Map();
8957
9033
  for (const e of edges) {
8958
9034
  if (skipIds.has(e.id)) continue;
@@ -8988,7 +9064,7 @@ function bowSharedStraightPaths(edges, nodes, skipIds) {
8988
9064
  )
8989
9065
  );
8990
9066
  const groupIds = new Set(group.map((g) => g.e.id));
8991
- const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x));
9067
+ const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x, textMetrics));
8992
9068
  const nodeRects = nodes.map((n) => ({ x: n.cx - n.w / 2, y: n.cy - n.h / 2, w: n.w, h: n.h }));
8993
9069
  const build = (seg, offset) => {
8994
9070
  const cx = midX + nx * offset * 2;
@@ -9108,8 +9184,8 @@ function sidePoint(n, side) {
9108
9184
  return { x: n.cx + n.w / 2, y: n.cy };
9109
9185
  }
9110
9186
  }
9111
- function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _fromLane, _toLane, edge, labelObstacles = obstacles, fromOffset = { x: 0, y: 0 }, toOffset = { x: 0, y: 0 }, avoidRects = []) {
9112
- const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub) : 0;
9187
+ 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") {
9188
+ const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub, textMetrics) : 0;
9113
9189
  const labelHalfW = labelBoxW / 2;
9114
9190
  const labelInit = labelInitClearance(edge);
9115
9191
  const verticalPair = fromSide === "bottom" && toSide === "top" || fromSide === "top" && toSide === "bottom";
@@ -9508,7 +9584,7 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
9508
9584
  labelAnchor: "middle"
9509
9585
  };
9510
9586
  }
9511
- function repositionParallelLabels(edges, nodes) {
9587
+ function repositionParallelLabels(edges, nodes, textMetrics = "proportional") {
9512
9588
  const allSegs = new Map(
9513
9589
  edges.map((e) => [e.id, flattenPathSegments(extractPathSegments(e.d))])
9514
9590
  );
@@ -9533,7 +9609,7 @@ function repositionParallelLabels(edges, nodes) {
9533
9609
  for (const pair of byPair.values()) {
9534
9610
  if (pair.length < 2) continue;
9535
9611
  const pairOrder = [...pair].sort(compareSharedPairOrder);
9536
- const boxes = pair.map((e) => computeLabelBBoxWorld(e));
9612
+ const boxes = pair.map((e) => computeLabelBBoxWorld(e, textMetrics));
9537
9613
  const componentOf = pair.map((_, i) => i);
9538
9614
  for (let i = 0; i < pair.length; i++) {
9539
9615
  for (let j = i + 1; j < pair.length; j++) {
@@ -9558,17 +9634,27 @@ function repositionParallelLabels(edges, nodes) {
9558
9634
  nodes,
9559
9635
  allEdges: edges,
9560
9636
  allSegs,
9561
- xRange
9637
+ xRange,
9638
+ textMetrics
9562
9639
  });
9563
9640
  for (let i = 0; i < members.length; i++) members[i].labelY = placed[i];
9564
9641
  }
9565
9642
  }
9566
9643
  }
9567
9644
  function placeAvoidingSiblingPaths(args) {
9568
- const { members, pair, pairOrder, nodes, allEdges, allSegs, xRange } = args;
9645
+ const {
9646
+ members,
9647
+ pair,
9648
+ pairOrder,
9649
+ nodes,
9650
+ allEdges,
9651
+ allSegs,
9652
+ xRange,
9653
+ textMetrics = "proportional"
9654
+ } = args;
9569
9655
  const sizes = members.map((e) => labelPillH(e.sub));
9570
9656
  const wants = members.map((e) => e.labelY);
9571
- const boxes = members.map((e) => computeLabelBBoxWorld(e));
9657
+ const boxes = members.map((e) => computeLabelBBoxWorld(e, textMetrics));
9572
9658
  const all = members.map((_, i) => i);
9573
9659
  const spread = (idx) => spreadWithMinimalShift(
9574
9660
  idx.map((i) => ({ want: wants[i], size: sizes[i] })),
@@ -9759,14 +9845,14 @@ function labelRectAt(cx, cy, w, h) {
9759
9845
  function inflate(r, pad) {
9760
9846
  return { x: r.x - pad, y: r.y - pad, w: r.w + pad * 2, h: r.h + pad * 2 };
9761
9847
  }
9762
- function slideLabelsAlongOwnPath(edges, nodes) {
9848
+ function slideLabelsAlongOwnPath(edges, nodes, textMetrics = "proportional") {
9763
9849
  const withLabel = edges.filter((e) => hasRenderedLabel(e));
9764
9850
  if (withLabel.length === 0) return;
9765
9851
  const segsById = /* @__PURE__ */ new Map();
9766
9852
  for (const e of edges) segsById.set(e.id, flattenPathSegments(extractPathSegments(e.d)));
9767
9853
  const nodeRects = nodes.map(nodeRect);
9768
9854
  for (const e of withLabel) {
9769
- const w = computeLabelBoxW(e.label, e.sub);
9855
+ const w = computeLabelBoxW(e.label, e.sub, textMetrics);
9770
9856
  const h = labelPillH(e.sub);
9771
9857
  if (w === 0 || h === 0) continue;
9772
9858
  const own = segsById.get(e.id) ?? [];
@@ -10068,7 +10154,7 @@ function separateSharedStraightRuns(edges, nodes) {
10068
10154
  e.d = verticesToPath(verts.get(e.id));
10069
10155
  }
10070
10156
  }
10071
- function pullOutgoingFirstCorner(edges, nodes) {
10157
+ function pullOutgoingFirstCorner(edges, nodes, textMetrics = "proportional") {
10072
10158
  if (edges.length < 2) return;
10073
10159
  const \u675F = /* @__PURE__ */ new Map();
10074
10160
  const \u540C\u3058\u7D44\u306E\u6570 = /* @__PURE__ */ new Map();
@@ -10122,10 +10208,10 @@ function pullOutgoingFirstCorner(edges, nodes) {
10122
10208
  }
10123
10209
  e.d = \u524D;
10124
10210
  if (!\u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F) {
10125
- slideLabelsAlongOwnPath(edges, nodes);
10211
+ slideLabelsAlongOwnPath(edges, nodes, textMetrics);
10126
10212
  \u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F = true;
10127
10213
  }
10128
- const labelBox = computeLabelBBoxWorld(e);
10214
+ const labelBox = computeLabelBBoxWorld(e, textMetrics);
10129
10215
  const label = { x: labelBox.x + labelBox.w / 2, y: labelBox.y + labelBox.h / 2 };
10130
10216
  const \u7DDA\u5206\u307E\u3067\u306E\u8DDD\u96E22 = (a, b) => {
10131
10217
  const dx = b.x - a.x;
@@ -10237,13 +10323,13 @@ function fanIncomingEndpoints(edges, nodes) {
10237
10323
  }
10238
10324
  return \u7D42\u70B9\u306E\u79FB\u52D5;
10239
10325
  }
10240
- function followLabelsToFannedTails(edges, obstacles, shifts) {
10326
+ function followLabelsToFannedTails(edges, obstacles, shifts, textMetrics = "proportional") {
10241
10327
  if (shifts.size === 0) return;
10242
10328
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
10243
10329
  const labels = edges.filter(hasRenderedLabel).map((e) => ({
10244
10330
  kind: "edge-label",
10245
10331
  id: e.id,
10246
- ...computeLabelBBoxWorld(e)
10332
+ ...computeLabelBBoxWorld(e, textMetrics)
10247
10333
  }));
10248
10334
  const labelIndexByEdgeId = new Map(labels.map((label, index) => [label.id, index]));
10249
10335
  const edgeById = new Map(edges.map((e) => [e.id, e]));
@@ -10275,7 +10361,7 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
10275
10361
  labelY: e.labelY + \u79FB\u52D5.dy,
10276
10362
  labelAnchor: e.labelAnchor
10277
10363
  };
10278
- const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa });
10364
+ const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa }, textMetrics);
10279
10365
  const \u6700\u5F8C\u306F\u7E26 = Math.abs(\u6700\u5F8C.x2 - \u6700\u5F8C.x1) <= Math.abs(\u6700\u5F8C.y2 - \u6700\u5F8C.y1);
10280
10366
  const \u5019\u88DC = [
10281
10367
  \u5019\u88DCa,
@@ -10286,7 +10372,11 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
10286
10372
  }
10287
10373
  ];
10288
10374
  for (const c of \u5019\u88DC) {
10289
- const \u672D = { kind: "edge-label", id: e.id, ...computeLabelBBoxWorld({ ...e, ...c }) };
10375
+ const \u672D = {
10376
+ kind: "edge-label",
10377
+ id: e.id,
10378
+ ...computeLabelBBoxWorld({ ...e, ...c }, textMetrics)
10379
+ };
10290
10380
  if (segmentsCrossRect([\u6700\u5F8C], \u672D)) continue;
10291
10381
  if (\u672D\u306E\u79FB\u52D5\u3092\u585E\u3050\u76F8\u624B\u3092\u63A2\u3059(\u5468\u308A, \u5143\u306E\u672D, \u672D) !== null) continue;
10292
10382
  e.labelX = c.labelX;
@@ -10480,7 +10570,7 @@ function expandLanesForNodes(lanes, nodes) {
10480
10570
  };
10481
10571
  });
10482
10572
  }
10483
- function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
10573
+ function expandLaneGapsForEdgeLabels(lanes, nodes, edges, textMetrics = "proportional") {
10484
10574
  if (lanes.length < 2) return lanes;
10485
10575
  const layoutedLanes = lanes.filter((l) => !(l.posX !== void 0 && l.posY !== void 0));
10486
10576
  if (layoutedLanes.length < 2) return lanes;
@@ -10496,7 +10586,7 @@ function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
10496
10586
  const fi = laneIndexById.get(fromLane);
10497
10587
  const ti = laneIndexById.get(toLane);
10498
10588
  if (fi === void 0 || ti === void 0 || fi === ti) continue;
10499
- const labelBoxW = computeLabelBoxW(edge.label, edge.sub);
10589
+ const labelBoxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
10500
10590
  if (labelBoxW === 0) continue;
10501
10591
  const lo = Math.min(fi, ti);
10502
10592
  const hi = Math.max(fi, ti);
@@ -10618,7 +10708,7 @@ function \u7DDA\u306E\u7AEF\u306E\u5411\u304D(d, \u7AEF) {
10618
10708
  const \u5019\u88DC = segs.flatMap((s) => [...s.ctrl ?? [], { x: s.x2, y: s.y2 }]);
10619
10709
  return \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC);
10620
10710
  }
10621
- function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
10711
+ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head", textMetrics = "proportional") {
10622
10712
  const text = (\u7AEF === "head" ? edge.headLabel : edge.tailLabel)?.trim();
10623
10713
  if (!text) return null;
10624
10714
  const \u5411\u304D = \u7DDA\u306E\u7AEF\u306E\u5411\u304D(edge.d, \u7AEF);
@@ -10629,7 +10719,8 @@ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
10629
10719
  const w = measureTextWidth(text, {
10630
10720
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
10631
10721
  fontWeight: EDGE_LABEL_TEXT.sub.fontWeight,
10632
- fontFamily: "mono"
10722
+ fontFamily: "mono",
10723
+ textMetrics
10633
10724
  });
10634
10725
  const h = \u7BB1\u306E\u9AD8\u3055;
10635
10726
  const \u672D = hasRenderedLabel(edge) && edge.labelX !== void 0 && edge.labelY !== void 0 ? { x: edge.labelX, y: edge.labelY } : null;
@@ -10678,10 +10769,10 @@ function autoStorageHeight(n, defaultH) {
10678
10769
  }
10679
10770
  return Math.max(defaultH, \u5FC5\u8981);
10680
10771
  }
10681
- function autoRowsWidth(n, defaultW) {
10772
+ function autoRowsWidth(n, defaultW, textMetrics = "proportional") {
10682
10773
  if (n.w != null) return n.w;
10683
10774
  if (!n.rows || n.rows.length === 0) return defaultW;
10684
- const required = requiredRowsWidth(n.rows, n.kind);
10775
+ const required = requiredRowsWidth(n.rows, n.kind, textMetrics);
10685
10776
  return Math.max(defaultW, required);
10686
10777
  }
10687
10778
  function \u7BB1\u306E\u9AD8\u30552(n, \u65E2\u5B9Ah) {
@@ -10719,7 +10810,7 @@ function requiredStackGapForEdgeLabels(diag, allStacks) {
10719
10810
  }
10720
10811
  return required;
10721
10812
  }
10722
- function layoutNodes(diag, lanes) {
10813
+ function layoutNodes(diag, lanes, textMetrics) {
10723
10814
  const laneMap = new Map(lanes.map((l) => [l.id, l]));
10724
10815
  const allStacks = Array.from(new Set(diag.nodes.map((n) => n.stack))).sort((a, b) => a - b);
10725
10816
  const rowH = /* @__PURE__ */ new Map();
@@ -10763,7 +10854,7 @@ function layoutNodes(diag, lanes) {
10763
10854
  }
10764
10855
  const size = NODE_SIZE[n.kind];
10765
10856
  if (n.posX !== void 0 && n.posY !== void 0) {
10766
- const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w);
10857
+ const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w, textMetrics);
10767
10858
  const h2 = n.posH ?? n.h ?? rowH.get(n.stack) ?? size.h;
10768
10859
  out.push({
10769
10860
  ...n,
@@ -10781,7 +10872,7 @@ function layoutNodes(diag, lanes) {
10781
10872
  const \u81EA\u524D\u306E\u9AD8\u3055 = n.rowMarks !== void 0;
10782
10873
  const h = n.h ?? (\u81EA\u524D\u306E\u9AD8\u3055 ? \u7BB1\u306E\u9AD8\u30552(n, size.h) : \u6BB5\u306E\u9AD8\u3055);
10783
10874
  const cy = \u6BB5\u306E\u82AF;
10784
- const w = autoRowsWidth(n, size.w);
10875
+ const w = autoRowsWidth(n, size.w, textMetrics);
10785
10876
  out.push({
10786
10877
  ...n,
10787
10878
  cx,
@@ -10901,10 +10992,16 @@ function applyRowLevelNodeShifts(nodes, lanes, nodeShifts) {
10901
10992
  return moved ? { nodes: outNodes, lanes: outLanes } : null;
10902
10993
  }
10903
10994
  function layout(diag) {
10995
+ const textMetrics = resolveTextMetrics(diag.textMetrics);
10904
10996
  const lanes = layoutLanes(diag);
10905
- const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes));
10997
+ const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes, textMetrics));
10906
10998
  const expandedLanes = expandLanesForNodes(lanes, rawNodes);
10907
- const gapExpandedLanes = expandLaneGapsForEdgeLabels(expandedLanes, rawNodes, diag.edges);
10999
+ const gapExpandedLanes = expandLaneGapsForEdgeLabels(
11000
+ expandedLanes,
11001
+ rawNodes,
11002
+ diag.edges,
11003
+ textMetrics
11004
+ );
10908
11005
  const nodes = rawNodes.map((n) => {
10909
11006
  if (n.posX !== void 0 && n.posY !== void 0) return n;
10910
11007
  const oldLane = lanes.find((l) => l.id === n.lane);
@@ -10913,13 +11010,13 @@ function layout(diag) {
10913
11010
  return { ...n, cx: newLane.x + newLane.width / 2 };
10914
11011
  });
10915
11012
  const containedLanesPre = recomputeContainedLanes(gapExpandedLanes, nodes);
10916
- const edgesPre = layoutEdges(diag, nodes, containedLanesPre);
10917
- const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre);
11013
+ const edgesPre = layoutEdges(diag, nodes, containedLanesPre, textMetrics);
11014
+ const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre, textMetrics);
10918
11015
  const collisionsPre = detectCollisions(bboxesPre, edgesPre);
10919
11016
  const nodesResolved = resolveOverlaps(nodes, collisionsPre);
10920
11017
  const moved = nodesResolved !== nodes;
10921
11018
  const containedLanes = moved ? recomputeContainedLanes(gapExpandedLanes, nodesResolved) : containedLanesPre;
10922
- const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes) : edgesPre;
11019
+ const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes, textMetrics) : edgesPre;
10923
11020
  const chainShiftClearance = Math.max(CLEARANCE_LABEL_LABEL, CLEARANCE_NODE_LABEL);
10924
11021
  let edges;
10925
11022
  let nodesFinal = nodesResolved;
@@ -10930,10 +11027,13 @@ function layout(diag) {
10930
11027
  } else {
10931
11028
  const propagateResult = resolveEdgeLabelOverlapsWithChainAndPropagate(
10932
11029
  edgesAfterMove,
10933
- collectBBoxes(containedLanes, nodesResolved, []).filter(
11030
+ collectBBoxes(containedLanes, nodesResolved, [], textMetrics).filter(
10934
11031
  (b) => b.kind === "node" || b.kind === "lane-label"
10935
11032
  ),
10936
- chainShiftClearance
11033
+ chainShiftClearance,
11034
+ void 0,
11035
+ void 0,
11036
+ textMetrics
10937
11037
  );
10938
11038
  edges = propagateResult.edges;
10939
11039
  if (propagateResult.nodeShifts.size > 0) {
@@ -10945,7 +11045,7 @@ function layout(diag) {
10945
11045
  }
10946
11046
  if (nodesFinal !== nodesResolved) {
10947
11047
  containedLanesFinal = recomputeContainedLanes(laneShiftedBase, nodesFinal);
10948
- edges = layoutEdges(diag, nodesFinal, containedLanesFinal);
11048
+ edges = layoutEdges(diag, nodesFinal, containedLanesFinal, textMetrics);
10949
11049
  }
10950
11050
  }
10951
11051
  const positionedEdgeIds = new Set(
@@ -10953,21 +11053,31 @@ function layout(diag) {
10953
11053
  (e) => e.routing === "curve" || e.routing === "metro" || e.posX1 !== void 0 && e.posY1 !== void 0 && e.posX2 !== void 0 && e.posY2 !== void 0
10954
11054
  ).map((e) => e.id)
10955
11055
  );
10956
- bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds);
10957
- pullOutgoingFirstCorner(edges, nodesFinal);
11056
+ bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds, textMetrics);
11057
+ pullOutgoingFirstCorner(edges, nodesFinal, textMetrics);
10958
11058
  const fannedTailShifts = fanIncomingEndpoints(edges, nodesFinal);
10959
11059
  separateSharedStraightRuns(edges, nodesFinal);
10960
11060
  hopEdgeCrossings(edges);
10961
- const labelClearanceObstacles = collectBBoxes(containedLanesFinal, nodesFinal, []).filter(
11061
+ const labelClearanceObstacles = collectBBoxes(
11062
+ containedLanesFinal,
11063
+ nodesFinal,
11064
+ [],
11065
+ textMetrics
11066
+ ).filter(
10962
11067
  (b) => b.kind === "node" || b.kind === "lane-label"
10963
11068
  );
10964
- followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts);
10965
- repositionParallelLabels(edges, nodesFinal);
10966
- slideLabelsAlongOwnPath(edges, nodesFinal);
11069
+ followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts, textMetrics);
11070
+ repositionParallelLabels(edges, nodesFinal, textMetrics);
11071
+ slideLabelsAlongOwnPath(edges, nodesFinal, textMetrics);
10967
11072
  if (!isChainEdgeLabelDisabled()) {
10968
- edges = resolveLabelClearanceAfterPathPasses(edges, labelClearanceObstacles);
11073
+ edges = resolveLabelClearanceAfterPathPasses(
11074
+ edges,
11075
+ labelClearanceObstacles,
11076
+ void 0,
11077
+ textMetrics
11078
+ );
10969
11079
  }
10970
- const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges);
11080
+ const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges, textMetrics);
10971
11081
  const collisions = detectCollisions(bboxes, edges);
10972
11082
  const nearCollisions = detectNearCollisions(bboxes, edges);
10973
11083
  if (collisions.length > 0) {
@@ -11007,6 +11117,8 @@ function layout(diag) {
11007
11117
  // 描画側の固定の字の言語 (#847)。 既定 (`en`) と型の外の値は持たせない = 配置の結果の形を
11008
11118
  // 変更前と揃え、記法の書き損じで一部の字だけ日本語になる形を作らない
11009
11119
  ...resolveLang(diag.lang) === "ja" ? { lang: "ja" } : {},
11120
+ // 既定は持ち越さない。既存の LaidDiagram の形を変えず、等幅の図だけ描画へ伝える
11121
+ ...textMetrics === "monospace" ? { textMetrics: "monospace" } : {},
11010
11122
  // 種類も配色と同じく空の目印を出さない。 遮断をここに揃えると手書きの図にも効く
11011
11123
  ...diag.type ? { type: diag.type } : {},
11012
11124
  bboxes,
@@ -11915,6 +12027,7 @@ function CdlEdgeView({
11915
12027
  "data-cdl-edge-label": edge.label,
11916
12028
  "data-cdl-edge-sub": edge.sub ?? "",
11917
12029
  "data-cdl-tone": edge.tone,
12030
+ "data-cdl-edge-role": edge.role,
11918
12031
  children: [
11919
12032
  isDotted ? /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
11920
12033
  /* @__PURE__ */ jsxRuntime.jsx("path", { id: glowPathId, d: glowPathD, fill: "none", stroke: "none" }),
@@ -12066,11 +12179,12 @@ function CdlEdgeGlowView({
12066
12179
  }
12067
12180
  function CdlEdgeLabelView({
12068
12181
  edge,
12069
- active
12182
+ active,
12183
+ textMetrics = "proportional"
12070
12184
  }) {
12071
12185
  if (!hasRenderedLabel(edge)) return null;
12072
12186
  const color = edgeColor(edge);
12073
- const bbox = computeLabelBBoxWorld(edge);
12187
+ const bbox = computeLabelBBoxWorld(edge, textMetrics);
12074
12188
  const boxW = bbox.w;
12075
12189
  const boxH = bbox.h;
12076
12190
  const boxLeftX = bbox.x - edge.labelX;
@@ -12086,6 +12200,8 @@ function CdlEdgeLabelView({
12086
12200
  "data-cdl-edge-label-for": edge.id,
12087
12201
  "data-cdl-edge-label-text": edge.label,
12088
12202
  "data-cdl-edge-sub-text": edge.sub ?? "",
12203
+ "data-cdl-tone": edge.tone,
12204
+ "data-cdl-edge-role": edge.role,
12089
12205
  children: [
12090
12206
  edge.labelPlate !== false && /* @__PURE__ */ jsxRuntime.jsx(
12091
12207
  "rect",
@@ -12139,9 +12255,10 @@ function CdlEdgeLabelView({
12139
12255
  function CdlEdgeEndLabelView({
12140
12256
  edge,
12141
12257
  active,
12142
- \u7AEF
12258
+ \u7AEF,
12259
+ textMetrics = "proportional"
12143
12260
  }) {
12144
- const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF);
12261
+ const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF, textMetrics);
12145
12262
  if (!\u7F6E\u304D\u5834\u6240) return null;
12146
12263
  const color = edgeColor(edge);
12147
12264
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -12150,6 +12267,8 @@ function CdlEdgeEndLabelView({
12150
12267
  "data-cdl-role": "edge-end-label",
12151
12268
  "data-cdl-edge-end-label-for": edge.id,
12152
12269
  "data-cdl-edge-end": \u7AEF,
12270
+ "data-cdl-tone": edge.tone,
12271
+ "data-cdl-edge-role": edge.role,
12153
12272
  x: \u7F6E\u304D\u5834\u6240.x,
12154
12273
  y: \u7F6E\u304D\u5834\u6240.y,
12155
12274
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
@@ -12394,12 +12513,18 @@ var SEQ_DOT = 7;
12394
12513
  var SEQ_SELF_W = 52;
12395
12514
  var SEQ_COL_MIN = 200;
12396
12515
  var g4 = (v) => Math.round(v / 4) * 4;
12397
- function sequenceBoardMetrics(data) {
12516
+ function sequenceBoardMetrics(data, textMetrics = "proportional") {
12398
12517
  const \u540D\u5E45 = data.actors.map(
12399
- (a) => Math.max(textWidth(a.name, SEQ_NAME), a.subtitle ? textWidth(a.subtitle, SEQ_SUB) : 0)
12518
+ (a) => Math.max(
12519
+ textWidth(a.name, SEQ_NAME, 0, textMetrics),
12520
+ a.subtitle ? textWidth(a.subtitle, SEQ_SUB, 0, textMetrics) : 0
12521
+ )
12400
12522
  );
12401
12523
  const colW = g4(Math.max(SEQ_COL_MIN, Math.max(0, ...\u540D\u5E45) + SEQ_COL_PAD));
12402
- const \u8A9E\u5E45 = Math.max(0, ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL)));
12524
+ const \u8A9E\u5E45 = Math.max(
12525
+ 0,
12526
+ ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL, 0, textMetrics))
12527
+ );
12403
12528
  const gutter = g4(SEQ_EDGE + SEQ_GUTTER_PAD + \u8A9E\u5E45 + SEQ_GUTTER_GAP);
12404
12529
  const headY = SEQ_EDGE + SEQ_HEAD;
12405
12530
  const rowY = (i) => headY + SEQ_ROW_PAD + i * SEQ_ROW;
@@ -12412,11 +12537,12 @@ function sequenceBoardMetrics(data) {
12412
12537
  }
12413
12538
  function SequenceBoardNode({
12414
12539
  node,
12415
- stateValues
12540
+ stateValues,
12541
+ textMetrics = "proportional"
12416
12542
  }) {
12417
12543
  const data = node.sequenceData;
12418
12544
  if (!data) return /* @__PURE__ */ jsxRuntime.jsx("g", { "data-cdl-role": "sequence-board" });
12419
- const m = sequenceBoardMetrics(data);
12545
+ const m = sequenceBoardMetrics(data, textMetrics);
12420
12546
  const x = node.cx - node.w / 2;
12421
12547
  const y = node.cy - node.h / 2;
12422
12548
  const \u73FE\u5728 = (() => {
@@ -13067,7 +13193,8 @@ function GenericNode({
13067
13193
  active,
13068
13194
  value,
13069
13195
  stateValues,
13070
- \u5024\u306E\u540D\u524D
13196
+ \u5024\u306E\u540D\u524D,
13197
+ textMetrics = "proportional"
13071
13198
  }) {
13072
13199
  const base = STYLES[node.kind] ?? FALLBACK;
13073
13200
  const toned = toneColor3(node.tone);
@@ -13206,7 +13333,7 @@ function GenericNode({
13206
13333
  const resolved = node.rows.map((row) => interpolate(row, stateValues, \u5024\u306E\u540D\u524D));
13207
13334
  const splits = resolved.map(splitRow);
13208
13335
  const leftMaxWidth = splits.reduce(
13209
- (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
13336
+ (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false, textMetrics)),
13210
13337
  0
13211
13338
  );
13212
13339
  const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
@@ -13690,8 +13817,8 @@ function \u5024\u3068\u5272\u5408\u306E\u6587\u5B57(\u5024, \u5272\u5408, \u5408
13690
13817
  return \u7D44.\u5024 === null ? \u7D44.\u5272\u5408 : `${\u7D44.\u5024} ${\u7D44.\u5272\u5408}`;
13691
13818
  }
13692
13819
  var \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
13693
- function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587) {
13694
- const \u5165\u308B\u5927\u304D\u3055 = \u7A74\u306E\u534A\u5F84 * 2 * \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / Math.max(textWidth(\u6587, 1), 1e-6);
13820
+ function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587, textMetrics = "proportional") {
13821
+ const \u5165\u308B\u5927\u304D\u3055 = \u7A74\u306E\u534A\u5F84 * 2 * \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / Math.max(textWidth(\u6587, 1, 0, textMetrics), 1e-6);
13695
13822
  return Math.min(Math.max(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7E2E\u3093\u3060\u7D75\u306E\u5B57\u306E\u4E0B\u9650), \u5165\u308B\u5927\u304D\u3055);
13696
13823
  }
13697
13824
  function ChartPieNode({
@@ -13699,7 +13826,8 @@ function ChartPieNode({
13699
13826
  active,
13700
13827
  stateValues = {},
13701
13828
  drawing = false,
13702
- progress = 1
13829
+ progress = 1,
13830
+ textMetrics = "proportional"
13703
13831
  }) {
13704
13832
  const instanceId = react.useId().replace(/[^A-Za-z0-9_-]/g, "");
13705
13833
  const x0 = node.cx - node.w / 2;
@@ -13730,15 +13858,26 @@ function ChartPieNode({
13730
13858
  return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
13731
13859
  });
13732
13860
  if (\u5F62 !== "ring") {
13733
- const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
13861
+ const \u5171\u901A = {
13862
+ node,
13863
+ active,
13864
+ data,
13865
+ \u5272\u5408: \u4ECA\u306E\u5272\u5408,
13866
+ x0,
13867
+ y0,
13868
+ drawing,
13869
+ progress,
13870
+ instanceId,
13871
+ textMetrics
13872
+ };
13734
13873
  return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
13735
13874
  }
13736
13875
  const \u540D\u672D\u5E45 = Math.max(
13737
13876
  0,
13738
13877
  ...data.map(
13739
13878
  (_d, i) => Math.max(
13740
- textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
13741
- textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
13879
+ textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A, 0, textMetrics),
13880
+ textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics)
13742
13881
  )
13743
13882
  )
13744
13883
  );
@@ -13753,8 +13892,8 @@ function ChartPieNode({
13753
13892
  const \u524D\u306Eslices = \u524D\u3042\u308A ? \u8F2A\u3092\u7D44\u3080(data, cx, cy, \u524D\u306E\u5916\u534A\u5F84, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5272\u5408) : [];
13754
13893
  const \u7A74 = \u524D\u3042\u308A ? \u524D\u306E\u5185\u534A\u5F84 : \u5916\u306E\u5185\u534A\u5F84;
13755
13894
  const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total));
13756
- const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587);
13757
- const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08");
13895
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587, textMetrics);
13896
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08", textMetrics);
13758
13897
  const \u5408\u8A08\u306E\u4E0B = Math.max(Math.round(radius * 0.2), \u5408\u8A08\u306E\u5B57 * 0.25 + \u898B\u51FA\u3057\u306E\u5B572 * 0.8);
13759
13898
  const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
13760
13899
  const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
@@ -13937,14 +14076,24 @@ function \u67A0(node, active) {
13937
14076
  }
13938
14077
  );
13939
14078
  }
13940
- function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
14079
+ function \u5F27\u306E\u5F62({
14080
+ node,
14081
+ active,
14082
+ data,
14083
+ \u5272\u5408,
14084
+ x0,
14085
+ y0,
14086
+ drawing,
14087
+ progress,
14088
+ textMetrics
14089
+ }) {
13941
14090
  const PAD = 20;
13942
14091
  const \u540D\u524D\u306E\u7D1A = 14;
13943
14092
  const \u5272\u5408\u306E\u7D1A = 24;
13944
14093
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
13945
14094
  const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
13946
14095
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
13947
- const \u4E00\u89A7\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A))) + \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 + Math.max(0, ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A)));
14096
+ const \u4E00\u89A7\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics))) + \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 + Math.max(0, ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A, 0, textMetrics)));
13948
14097
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
13949
14098
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
13950
14099
  const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
@@ -14030,7 +14179,18 @@ function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14030
14179
  })
14031
14180
  ] });
14032
14181
  }
14033
- function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
14182
+ function \u8868\u306E\u5F62({
14183
+ node,
14184
+ active,
14185
+ data,
14186
+ \u5272\u5408,
14187
+ x0,
14188
+ y0,
14189
+ drawing,
14190
+ progress,
14191
+ instanceId,
14192
+ textMetrics
14193
+ }) {
14034
14194
  const PAD = 20;
14035
14195
  const \u898B\u51FA\u3057\u306E\u7D1A = 11;
14036
14196
  const \u540D\u524D\u306E\u7D1A = 15;
@@ -14039,9 +14199,18 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14039
14199
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
14040
14200
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
14041
14201
  const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
14042
- const \u540D\u524D\u5E45 = Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A)));
14043
- 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)));
14044
- 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)));
14202
+ const \u540D\u524D\u5E45 = Math.max(
14203
+ 0,
14204
+ ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics))
14205
+ );
14206
+ const \u5272\u5408\u5E45 = Math.max(
14207
+ textWidth("\u5272\u5408", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
14208
+ ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A, 0, textMetrics))
14209
+ );
14210
+ const \u5B9F\u6570\u5E45 = Math.max(
14211
+ textWidth("\u5024", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
14212
+ ...\u5B9F\u6570\u306E\u6587\u5B57.map((t) => textWidth(t, \u5B9F\u6570\u306E\u7D1A, 0, textMetrics))
14213
+ );
14045
14214
  const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
14046
14215
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
14047
14216
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
@@ -14050,8 +14219,8 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
14050
14219
  const cx = PAD + R;
14051
14220
  const cy = node.h / 2;
14052
14221
  const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)));
14053
- const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587);
14054
- const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08");
14222
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587, textMetrics);
14223
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08", textMetrics);
14055
14224
  const \u5408\u8A08\u306E\u4E0B = Math.max(Math.round(R * 0.2), \u5408\u8A08\u306E\u5B57 * 0.25 + \u898B\u51FA\u3057\u306E\u5B572 * 0.8);
14056
14225
  const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
14057
14226
  const \u53F3\u7AEF = node.w - PAD;
@@ -14182,7 +14351,8 @@ function ChartGaugeNode({
14182
14351
  active,
14183
14352
  stateValues = {},
14184
14353
  drawing = false,
14185
- progress = 1
14354
+ progress = 1,
14355
+ textMetrics = "proportional"
14186
14356
  }) {
14187
14357
  const x0 = node.cx - node.w / 2;
14188
14358
  const y0 = node.cy - node.h / 2;
@@ -14201,7 +14371,10 @@ function ChartGaugeNode({
14201
14371
  const \u533A\u753B\u306E\u9593 = 12;
14202
14372
  const \u6570\u5024\u306E\u884C = (d) => \u5024\u3068\u5272\u5408\u306E\u6587\u5B57(\u5B9F\u5024\u8868\u8A18(d.value), \u5272\u5408\u8868\u8A18(d.value / total), total);
14203
14373
  const \u5272\u308A\u4ED8\u3051\u308B = (\u4EF6\u305F\u3061) => {
14204
- 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;
14374
+ const \u5E45 = Math.max(
14375
+ \u5370\u306E\u5E452,
14376
+ ...\u4EF6\u305F\u3061.map((d) => textWidth(\u6570\u5024\u306E\u884C(d), \u6570\u5024\u306E\u7D1A, 0, textMetrics))
14377
+ ) + \u533A\u753B\u306E\u9593;
14205
14378
  const \u884C\u306E\u4EF6\u65702 = Math.min(
14206
14379
  Math.max(1, Math.floor(\u4F7F\u3048\u308B\u5E452 / Math.max(\u5E45, 1))),
14207
14380
  Math.max(\u4EF6\u305F\u3061.length, 1)
@@ -14276,7 +14449,7 @@ function ChartGaugeNode({
14276
14449
  return { d, frac, path: \u6247\u306E\u9053(a0, a1, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5916\u534A\u5F84) };
14277
14450
  });
14278
14451
  const \u5408\u8A08\u306E\u6587\u5B57 = \u5B9F\u5024\u8868\u8A18(Math.round(total));
14279
- const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100), 1) / 100;
14452
+ const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100, 0, textMetrics), 1) / 100;
14280
14453
  const \u7D1A\u306E\u5019\u88DC = Math.min(
14281
14454
  // 横 = 字の上の角が内側の円に入る大きさ
14282
14455
  \u5185\u534A\u5F84 / Math.sqrt((\u5358\u4F4D\u5E45 / 2) ** 2 + 1.25 ** 2),
@@ -14369,7 +14542,7 @@ function ChartGaugeNode({
14369
14542
  const y = \u5185\u8A33\u306Ey + \u6BB5\u306E\u9AD8\u3055 * \u6BB5;
14370
14543
  const \u53CE\u307E\u308B\u5E45 = \u5185\u8A33\u306E\u5E45 - \u533A\u753B\u306E\u9593;
14371
14544
  const \u6570\u306E\u884C = \u5185\u8A33\u306E\u6570\u5024[idx] ?? "";
14372
- const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A);
14545
+ const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A, textMetrics);
14373
14546
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-gauge-item", children: [
14374
14547
  /* @__PURE__ */ jsxRuntime.jsx(
14375
14548
  "rect",
@@ -14390,7 +14563,7 @@ function ChartGaugeNode({
14390
14563
  fontSize: \u540D\u524D\u306E\u7D1A,
14391
14564
  fontWeight: 700,
14392
14565
  fill: "var(--cdl-text, #1a1f2a)",
14393
- children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A)
14566
+ children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A, textMetrics)
14394
14567
  }
14395
14568
  ),
14396
14569
  /* @__PURE__ */ jsxRuntime.jsx("text", { x, y: y + 46, fontSize: \u6570\u5024\u306E\u7D1A, fill: "var(--cdl-text-dim, #5a6270)", children: \u5207\u3063\u305F\u6570\u306E\u884C === \u6570\u306E\u884C ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -14408,12 +14581,12 @@ function ChartGaugeNode({
14408
14581
  function \u6975(cx, cy, r, a) {
14409
14582
  return { x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) };
14410
14583
  }
14411
- function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A) {
14412
- if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A) <= \u4E0A\u9650) return s;
14413
- const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A);
14584
+ function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A, textMetrics = "proportional") {
14585
+ if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A, 0, textMetrics) <= \u4E0A\u9650) return s;
14586
+ const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A, 0, textMetrics);
14414
14587
  let out = "";
14415
14588
  for (const c of s) {
14416
- if (textWidth(out + c, \u7D1A) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
14589
+ if (textWidth(out + c, \u7D1A, 0, textMetrics) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
14417
14590
  out += c;
14418
14591
  }
14419
14592
  return `${out}\u2026`;
@@ -14427,7 +14600,8 @@ function ChartRadialNode({
14427
14600
  active,
14428
14601
  stateValues = {},
14429
14602
  drawing = false,
14430
- progress = 1
14603
+ progress = 1,
14604
+ textMetrics = "proportional"
14431
14605
  }) {
14432
14606
  const x0 = node.cx - node.w / 2;
14433
14607
  const y0 = node.cy - node.h / 2;
@@ -14445,7 +14619,10 @@ function ChartRadialNode({
14445
14619
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E45 + Math.max(
14446
14620
  0,
14447
14621
  ...data.map(
14448
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
14622
+ (d, i) => Math.max(
14623
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
14624
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
14625
+ )
14449
14626
  )
14450
14627
  );
14451
14628
  const \u5F27\u306B\u4F7F\u3048\u308B\u5E45 = node.w - PAD * 2 - \u4E00\u89A7\u306E\u5E45 - \u4E00\u89A7\u3068\u5F27\u306E\u9593;
@@ -14592,7 +14769,8 @@ function arcColor2(tone, idx) {
14592
14769
  function ChartStatNode({
14593
14770
  node,
14594
14771
  active,
14595
- stateValues = {}
14772
+ stateValues = {},
14773
+ textMetrics = "proportional"
14596
14774
  }) {
14597
14775
  const x0 = node.cx - node.w / 2;
14598
14776
  const y0 = node.cy - node.h / 2;
@@ -14621,7 +14799,13 @@ function ChartStatNode({
14621
14799
  const frac = total > 0 ? d.value / total : 0;
14622
14800
  const \u8272 = \u5370\u306E\u8272(d.tone, idx);
14623
14801
  const \u6570\u5024 = \u5B9F\u5024\u8868\u8A18(d.value);
14624
- 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);
14802
+ const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(
14803
+ \u6570\u5024,
14804
+ \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
14805
+ \u533A\u753B.\u6570\u5024\u306E\u7D1A,
14806
+ \u533A\u753B.\u540D\u524D\u306E\u7D1A + 1,
14807
+ textMetrics
14808
+ );
14625
14809
  return /* @__PURE__ */ jsxRuntime.jsxs(
14626
14810
  "g",
14627
14811
  {
@@ -14678,7 +14862,8 @@ function ChartStatNode({
14678
14862
  `\u524D ${\u5B9F\u5024\u8868\u8A18(d.previous)}`,
14679
14863
  \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
14680
14864
  \u533A\u753B.\u524D\u306E\u7D1A,
14681
- 8
14865
+ 8,
14866
+ textMetrics
14682
14867
  ),
14683
14868
  textAnchor: "middle",
14684
14869
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -14767,9 +14952,9 @@ function \u533A\u753B\u306E\u5272\u4ED8(w, h, \u4EF6\u6570, \u524D\u3092\u51FA\u
14767
14952
  \u67A0: (idx) => ({ x: \u5E45 * idx, y: 0, w: \u5E45, h })
14768
14953
  };
14769
14954
  }
14770
- function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650) {
14955
+ function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650, textMetrics = "proportional") {
14771
14956
  let \u7D1A = \u521D\u671F;
14772
- while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
14957
+ while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A, 0, textMetrics) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
14773
14958
  return \u7D1A;
14774
14959
  }
14775
14960
  function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
@@ -14804,7 +14989,8 @@ function ChartWaffleNode({
14804
14989
  active,
14805
14990
  stateValues = {},
14806
14991
  drawing = false,
14807
- progress = 1
14992
+ progress = 1,
14993
+ textMetrics = "proportional"
14808
14994
  }) {
14809
14995
  const x0 = node.cx - node.w / 2;
14810
14996
  const y0 = node.cy - node.h / 2;
@@ -14823,7 +15009,10 @@ function ChartWaffleNode({
14823
15009
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E452 + Math.max(
14824
15010
  0,
14825
15011
  ...data.map(
14826
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
15012
+ (d, i) => Math.max(
15013
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
15014
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
15015
+ )
14827
15016
  )
14828
15017
  );
14829
15018
  const \u4F7F\u3048\u308B\u9AD8\u3055 = node.h - PAD * 2;
@@ -14925,7 +15114,8 @@ function ChartStackedBarNode({
14925
15114
  active,
14926
15115
  stateValues = {},
14927
15116
  drawing = false,
14928
- progress = 1
15117
+ progress = 1,
15118
+ textMetrics = "proportional"
14929
15119
  }) {
14930
15120
  const x0 = node.cx - node.w / 2;
14931
15121
  const y0 = node.cy - node.h / 2;
@@ -14935,7 +15125,7 @@ function ChartStackedBarNode({
14935
15125
  const \u540D\u524D\u306E\u7D1A = 13;
14936
15126
  const \u533A\u753B\u306E\u7D1A = 12;
14937
15127
  const \u6642\u70B9\u306E\u7D1A = 13;
14938
- const \u6642\u70B9\u306E\u5E45 = Math.max(0, ...\u5E2F\u305F\u3061.map((b) => textWidth(b.\u540D\u524D, \u6642\u70B9\u306E\u7D1A))) + (\u5E2F\u305F\u3061.length > 1 ? 16 : 0);
15128
+ const \u6642\u70B9\u306E\u5E45 = Math.max(0, ...\u5E2F\u305F\u3061.map((b) => textWidth(b.\u540D\u524D, \u6642\u70B9\u306E\u7D1A, 0, textMetrics))) + (\u5E2F\u305F\u3061.length > 1 ? 16 : 0);
14939
15129
  const \u5E2F\u306E\u5DE6 = PAD + \u6642\u70B9\u306E\u5E45;
14940
15130
  const \u5E2F\u306E\u5E45 = Math.max(40, node.w - \u5E2F\u306E\u5DE6 - PAD);
14941
15131
  const \u5E2F\u306E\u9AD8\u3055 = 44;
@@ -15028,7 +15218,7 @@ function ChartStackedBarNode({
15028
15218
  })()
15029
15219
  ] }, `bar-${\u6BB5}`);
15030
15220
  }),
15031
- \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A).map(({ d, idx, x, \u884C }) => {
15221
+ \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A, textMetrics).map(({ d, idx, x, \u884C }) => {
15032
15222
  const y = \u4E0A\u7AEF + \u5E2F\u305F\u3061.length * (\u5E2F\u306E\u9AD8\u3055 + \u5E2F\u306E\u9593) - \u5E2F\u306E\u9593 + 16 + \u4E00\u89A7\u306E\u9AD8\u3055 / 2 + \u884C * \u4E00\u89A7\u306E\u9AD8\u3055;
15033
15223
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stacked-bar-legend", children: [
15034
15224
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x, y: y - 5, width: 10, height: 10, rx: 2, fill: \u5370\u306E\u82723(d.tone, idx) }),
@@ -15063,12 +15253,12 @@ function \u5370\u306E\u82723(tone, idx) {
15063
15253
  }
15064
15254
  var \u5370\u304B\u3089\u540D\u524D\u307E\u3067 = 16;
15065
15255
  var \u4EF6\u306E\u9593 = 10;
15066
- function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A) {
15256
+ function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A, textMetrics = "proportional") {
15067
15257
  const out = [];
15068
15258
  let x = \u5DE6;
15069
15259
  let \u884C = 0;
15070
15260
  data.forEach((d, idx) => {
15071
- const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A);
15261
+ const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A, 0, textMetrics);
15072
15262
  if (x > \u5DE6 && x + \u5E45 > \u53F3\u7AEF) {
15073
15263
  \u884C += 1;
15074
15264
  x = \u5DE6;
@@ -15084,7 +15274,8 @@ function ChartSlopeNode({
15084
15274
  active,
15085
15275
  stateValues = {},
15086
15276
  drawing = false,
15087
- progress = 1
15277
+ progress = 1,
15278
+ textMetrics = "proportional"
15088
15279
  }) {
15089
15280
  const x0 = node.cx - node.w / 2;
15090
15281
  const y0 = node.cy - node.h / 2;
@@ -15127,16 +15318,22 @@ function ChartSlopeNode({
15127
15318
  const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
15128
15319
  (s) => \u5F62 === "delta" ? \u5897\u6E1B\u8868\u8A18(s.\u524D, s.\u4ECA) : \u5B9F\u5024\u8868\u8A18(s.\u4ECA)
15129
15320
  );
15130
- const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
15131
- const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
15321
+ const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
15322
+ const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
15132
15323
  const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
15133
15324
  0,
15134
15325
  (node.w - PAD * 2 - \u7DDA\u306E\u6700\u5C0F\u5E45 - (\u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067) - (\u53F3\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067)) / 2
15135
15326
  );
15136
- 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);
15327
+ const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(
15328
+ \u7CFB\u5217\u305F\u3061.map((s) => s.\u540D\u524D),
15329
+ \u540D\u524D\u306B\u4F7F\u3048\u308B,
15330
+ \u540D\u524D\u306E\u4E0A\u9650\u7D1A,
15331
+ \u540D\u524D\u306E\u4E0B\u9650\u7D1A,
15332
+ textMetrics
15333
+ );
15137
15334
  const \u540D\u524D\u5E45 = Math.min(
15138
15335
  \u540D\u524D\u306B\u4F7F\u3048\u308B,
15139
- Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A)))
15336
+ Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A, 0, textMetrics)))
15140
15337
  );
15141
15338
  const \u5DE6\u306E\u4F59\u767D = \u540D\u524D\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067;
15142
15339
  const \u53F3\u306E\u4F59\u767D = \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u540D\u524D\u5E45;
@@ -15322,10 +15519,12 @@ function \u5370\u306E\u82724(tone, idx) {
15322
15519
  if (tone) return TONE[tone];
15323
15520
  return chartSeriesColor(idx);
15324
15521
  }
15325
- function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650) {
15522
+ function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650, textMetrics = "proportional") {
15326
15523
  if (\u540D\u524D\u305F\u3061.length === 0) return \u4E0A\u9650;
15327
15524
  let \u7D1A = \u4E0A\u9650;
15328
- while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A))) > \u5E45) \u7D1A -= 1;
15525
+ while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A, 0, textMetrics))) > \u5E45) {
15526
+ \u7D1A -= 1;
15527
+ }
15329
15528
  return \u7D1A;
15330
15529
  }
15331
15530
  function \u5C0F\u6570\u306E\u6841(n) {
@@ -15373,6 +15572,7 @@ function ChartBarNode({
15373
15572
  return { y: yAt(v), value: v };
15374
15573
  });
15375
15574
  const \u6FC3\u3055 = (v) => vMax > 0 ? v >= vMax ? 1 : 0.45 : 0.9;
15575
+ const \u4E3B\u5F79\u306E\u68D2\u304B = (v) => vMax > 0 && v >= vMax;
15376
15576
  const \u89D2\u4E38 = Math.min(barW * 0.06, 8);
15377
15577
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
15378
15578
  const \u6A2A\u8EF8\u306Ey = PAD_TOP2 + canvasH;
@@ -15439,6 +15639,7 @@ function ChartBarNode({
15439
15639
  {
15440
15640
  "data-cdl-role": "chart-bar",
15441
15641
  "data-cdl-unresolved": d.unresolved ? "true" : void 0,
15642
+ "data-cdl-emphasis": \u4E3B\u5F79\u306E\u68D2\u304B(d.value) ? "primary" : void 0,
15442
15643
  x: bx,
15443
15644
  y: by,
15444
15645
  width: barW,
@@ -15785,7 +15986,8 @@ function FunnelNode({
15785
15986
  active,
15786
15987
  stateValues = {},
15787
15988
  drawing = false,
15788
- progress = 1
15989
+ progress = 1,
15990
+ textMetrics = "proportional"
15789
15991
  }) {
15790
15992
  const x0 = node.cx - node.w / 2;
15791
15993
  const y0 = node.cy - node.h / 2;
@@ -15834,7 +16036,11 @@ function FunnelNode({
15834
16036
  const \u540D\u524D\u306E\u5B9F\u5B57 = \u540D\u524D\u306E\u5B57 * \u7E26\u500D;
15835
16037
  const \u88DC\u8DB3\u306E\u67A0\u5B57 = \u88DC\u8DB3\u306E\u5B57 * \u7E26\u500D;
15836
16038
  const \u53CE\u307E\u308B\u5E45 = Math.max(0, bottomW - 16);
15837
- const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(\u88DC\u8DB3, { fontSize: \u88DC\u8DB3\u306E\u67A0\u5B57, fontWeight: 500 }, \u53CE\u307E\u308B\u5E45);
16039
+ const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(
16040
+ \u88DC\u8DB3,
16041
+ { fontSize: \u88DC\u8DB3\u306E\u67A0\u5B57, fontWeight: 500, textMetrics },
16042
+ \u53CE\u307E\u308B\u5E45
16043
+ );
15838
16044
  const \u584A\u306E\u4E0A = y + stageH / 2 - (\u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 1.25) / 2;
15839
16045
  const \u540D\u524D\u306Ey = \u88DC\u8DB3\u3042\u308A ? \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 0.95 : y + stageH / 2 + 5;
15840
16046
  const \u88DC\u8DB3\u306Ey = \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 0.95;
@@ -15937,7 +16143,8 @@ function \u7573\u3093\u3060\u6587(\u4EF6\u6570) {
15937
16143
  function QuadrantNode({
15938
16144
  node,
15939
16145
  active,
15940
- stateValues = {}
16146
+ stateValues = {},
16147
+ textMetrics = "proportional"
15941
16148
  }) {
15942
16149
  const x0 = node.cx - node.w / 2;
15943
16150
  const y0 = node.cy - node.h / 2;
@@ -15956,7 +16163,10 @@ function QuadrantNode({
15956
16163
  const SUB_FONT = 10;
15957
16164
  const axisLabelPad = (text) => Math.max(
15958
16165
  PAD_MIN,
15959
- measureTextWidth(`\u2190 ${text}`, { fontSize: AXIS_LABEL_FONT}) + 12
16166
+ measureTextWidth(`\u2190 ${text}`, {
16167
+ fontSize: AXIS_LABEL_FONT,
16168
+ textMetrics
16169
+ }) + 12
15960
16170
  );
15961
16171
  const padBudget = Math.max(0, node.w * 0.5 - PAD_MIN * 2);
15962
16172
  const wantLeft = axisLabelPad(data.xAxis.left) - PAD_MIN;
@@ -16210,7 +16420,11 @@ function QuadrantNode({
16210
16420
  ITEM_MIN_W,
16211
16421
  Math.max(
16212
16422
  ...\u884C\u30892.map(
16213
- (r) => measureTextWidth(r.text, { fontSize: r.size, fontWeight: r.weight })
16423
+ (r) => measureTextWidth(r.text, {
16424
+ fontSize: r.size,
16425
+ fontWeight: r.weight,
16426
+ textMetrics
16427
+ })
16214
16428
  )
16215
16429
  ) + ITEM_PAD_X * 2
16216
16430
  )
@@ -16236,7 +16450,7 @@ function QuadrantNode({
16236
16450
  const \u88DC\u8DB3 = (it.subtitle ?? "").trim();
16237
16451
  const \u88DC\u8DB3\u306E\u5B57 = SUB_FONT * \u53CE\u3081\u308B\u500D\u7387(
16238
16452
  \u88DC\u8DB3,
16239
- { fontSize: SUB_FONT, fontWeight: 500 },
16453
+ { fontSize: SUB_FONT, fontWeight: 500, textMetrics },
16240
16454
  Math.max(0, \u5E45 - ITEM_PAD_X * 2)
16241
16455
  );
16242
16456
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
@@ -16640,24 +16854,30 @@ var EYEBROW_GAP2 = 8;
16640
16854
  var EYEBROW_TRACKING = 2;
16641
16855
  var SUB_SIZE = 11;
16642
16856
  var SUB_GAP = 4;
16643
- function labelBlock(node, pos, size, band) {
16857
+ function labelBlock(node, pos, size, band, textMetrics = "proportional") {
16644
16858
  const \u4E0A = node.eyebrow ? size + EYEBROW_GAP2 + EYEBROW_SIZE2 * ASCENT2 : size * ASCENT2;
16645
16859
  const \u4E0B = node.subtitle ? size + SUB_GAP + SUB_SIZE * DESCENT2 : size * DESCENT2;
16646
16860
  const \u5E45 = Math.max(
16647
- textWidth(node.title ?? "", size),
16648
- node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING) : 0,
16649
- node.subtitle ? textWidth(node.subtitle, SUB_SIZE) : 0
16861
+ textWidth(node.title ?? "", size, 0, textMetrics),
16862
+ node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING, textMetrics) : 0,
16863
+ node.subtitle ? textWidth(node.subtitle, SUB_SIZE, 0, textMetrics) : 0
16650
16864
  );
16651
- const \u984C\u5E45 = textWidth(node.title ?? "", size);
16652
- const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, textWidth) : 0;
16865
+ const \u984C\u5E45 = textWidth(node.title ?? "", size, 0, textMetrics);
16866
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
16867
+ const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, \u6E2C\u308B) : 0;
16653
16868
  const { k, x, y: baseline } = fitLabel(band, { \u4E0A, \u4E0B, \u5E45 }, pos, \u4E0B\u9650);
16654
16869
  return { k, x, baseline, \u4E0A\u7AEF: baseline - \u4E0A * k, \u4E0B\u7AEF: baseline + \u4E0B * k };
16655
16870
  }
16656
- function commonLabel(node, pos, size, band) {
16657
- const \u584A = labelBlock(node, pos, size, band);
16871
+ function commonLabel(node, pos, size, band, textMetrics = "proportional") {
16872
+ const \u584A = labelBlock(node, pos, size, band, textMetrics);
16658
16873
  const k = \u584A.k;
16659
16874
  const x = \u584A.x;
16660
- 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));
16875
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
16876
+ t,
16877
+ \u5927\u304D\u3055 * k,
16878
+ band.w,
16879
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
16880
+ );
16661
16881
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16662
16882
  node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx(
16663
16883
  "text",
@@ -16708,7 +16928,7 @@ var RULE_GAP_RATIO = 0.1;
16708
16928
  var RULE_PAD_MAX = 20;
16709
16929
  var RULE_PAD_RATIO = 0.14;
16710
16930
  var RULE_SHRINK_RATIO = 0.055;
16711
- function ShapeFileNode({ node, active }) {
16931
+ function ShapeFileNode({ node, active, textMetrics = "proportional" }) {
16712
16932
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16713
16933
  const \u7D19h = \u5E2F.h;
16714
16934
  const \u7D19w = Math.min(\u5E2F.w, \u7D19h * 0.72);
@@ -16728,7 +16948,7 @@ function ShapeFileNode({ node, active }) {
16728
16948
  const foldTriangle = `M ${x + \u7D19w - fold} ${y} L ${x + \u7D19w} ${y + fold} L ${x + \u7D19w - fold} ${y + fold} Z`;
16729
16949
  const \u540D\u524D\u5E2F = { x, y, w: \u7D19w, h: \u7D19h };
16730
16950
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + node.h * 0.12 };
16731
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F);
16951
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics);
16732
16952
  const \u9593\u9694 = Math.min(RULE_GAP_MAX, \u7D19h * RULE_GAP_RATIO);
16733
16953
  const \u7DDA\u4F59\u767D = Math.min(RULE_PAD_MAX, \u7D19w * RULE_PAD_RATIO);
16734
16954
  const textLines = [0, 1, 2].map((i) => ({ i, ly: y + fold + \u9593\u9694 * (i + 1) })).filter(({ ly }) => ly < \u540D\u524D.\u4E0A\u7AEF);
@@ -16760,12 +16980,12 @@ function ShapeFileNode({ node, active }) {
16760
16980
  i
16761
16981
  );
16762
16982
  }),
16763
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F)
16983
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics)
16764
16984
  ] });
16765
16985
  }
16766
16986
  var TAB_H_MAX = 22;
16767
16987
  var TAB_H_RATIO = 0.3;
16768
- function ShapeFolderNode({ node, active }) {
16988
+ function ShapeFolderNode({ node, active, textMetrics = "proportional" }) {
16769
16989
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16770
16990
  const x = \u5E2F.x;
16771
16991
  const y = \u5E2F.y;
@@ -16786,7 +17006,7 @@ function ShapeFolderNode({ node, active }) {
16786
17006
  const \u5883\u754Cy = y + tabH + Math.min(8, (\u5E2F.h - tabH) * 0.2);
16787
17007
  const \u7AEF = Math.min(6, \u5E2F.w * 0.1);
16788
17008
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 18 };
16789
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F);
17009
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics);
16790
17010
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
16791
17011
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, \u5E2F.w * 0.44),
16792
17012
  /* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -16802,13 +17022,13 @@ function ShapeFolderNode({ node, active }) {
16802
17022
  opacity: 0.35
16803
17023
  }
16804
17024
  ),
16805
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F)
17025
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics)
16806
17026
  ] });
16807
17027
  }
16808
17028
  var CLOUD_VB_W = 640;
16809
17029
  var CLOUD_VB_H = 512;
16810
17030
  var CLOUD_W_RATIO = 0.9;
16811
- function ShapeCloudNode({ node, active }) {
17031
+ function ShapeCloudNode({ node, active, textMetrics = "proportional" }) {
16812
17032
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16813
17033
  const frame = commonFrame(active);
16814
17034
  const \u7D20\u306E\u500D\u7387 = Math.min(\u5E2F.h / CLOUD_VB_H, \u5E2F.w * CLOUD_W_RATIO / CLOUD_VB_W);
@@ -16831,13 +17051,13 @@ function ShapeCloudNode({ node, active }) {
16831
17051
  strokeLinejoin: "round"
16832
17052
  }
16833
17053
  ) }),
16834
- commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F)
17054
+ commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F, textMetrics)
16835
17055
  ] });
16836
17056
  }
16837
17057
  var CYLINDER_RY_MAX = 18;
16838
17058
  var CYLINDER_RY_RATIO = 0.1;
16839
17059
  var CYLINDER_DISKS = [0.3, 0.55, 0.8];
16840
- function ShapeCylinderNode({ node, active }) {
17060
+ function ShapeCylinderNode({ node, active, textMetrics = "proportional" }) {
16841
17061
  const \u5E2F = bodyBand(node, { \u5F71ry: CYLINDER_SHADOW_RY });
16842
17062
  const x = \u5E2F.x;
16843
17063
  const y = \u5E2F.y;
@@ -16854,7 +17074,7 @@ function ShapeCylinderNode({ node, active }) {
16854
17074
  const \u84CB\u5E95 = y + ry * 2;
16855
17075
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 6 };
16856
17076
  const \u540D\u524D\u5E2F = { x: \u5E2F.x, y: \u84CB\u5E95, w: \u5E2F.w, h: Math.max(0, \u5E2F.\u5E95 - \u84CB\u5E95) };
16857
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F);
17077
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics);
16858
17078
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
16859
17079
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, rx * 0.85, CYLINDER_SHADOW_RY),
16860
17080
  /* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -16878,11 +17098,11 @@ function ShapeCylinderNode({ node, active }) {
16878
17098
  },
16879
17099
  i
16880
17100
  )),
16881
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F)
17101
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics)
16882
17102
  ] });
16883
17103
  }
16884
17104
  var HEX_DOT_R = 2.5;
16885
- function ShapeHexagonNode({ node, active }) {
17105
+ function ShapeHexagonNode({ node, active, textMetrics = "proportional" }) {
16886
17106
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY, \u5916: Math.max(HEX_DOT_R, FRAME_HALF) });
16887
17107
  const cx = \u5E2F.cx;
16888
17108
  const cy = \u5E2F.cy;
@@ -16905,11 +17125,12 @@ function ShapeHexagonNode({ node, active }) {
16905
17125
  node,
16906
17126
  { x: cx, y: node.cy + 6 },
16907
17127
  16,
16908
- { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h }
17128
+ { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h },
17129
+ textMetrics
16909
17130
  )
16910
17131
  ] });
16911
17132
  }
16912
- function ShapeDiamondNode({ node, active }) {
17133
+ function ShapeDiamondNode({ node, active, textMetrics = "proportional" }) {
16913
17134
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16914
17135
  const cx = \u5E2F.cx;
16915
17136
  const cy = \u5E2F.cy;
@@ -16950,13 +17171,14 @@ function ShapeDiamondNode({ node, active }) {
16950
17171
  y: cy - \u5E2F.h * innerScale / 4,
16951
17172
  w: \u5E2F.w * innerScale / 2,
16952
17173
  h: \u5E2F.h * innerScale / 2
16953
- }
17174
+ },
17175
+ textMetrics
16954
17176
  )
16955
17177
  ] });
16956
17178
  }
16957
17179
  var STACK_OFFSET_MAX = 12;
16958
17180
  var STACK_OFFSET_RATIO = 0.15;
16959
- function ShapeStackNode({ node, active }) {
17181
+ function ShapeStackNode({ node, active, textMetrics = "proportional" }) {
16960
17182
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
16961
17183
  const x = \u5E2F.x;
16962
17184
  const y = \u5E2F.y;
@@ -17010,7 +17232,8 @@ function ShapeStackNode({ node, active }) {
17010
17232
  node,
17011
17233
  { x: \u624B\u524Dcx, y: node.cy + \u305A\u308C + 6 },
17012
17234
  15,
17013
- { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH }
17235
+ { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH },
17236
+ textMetrics
17014
17237
  )
17015
17238
  ] });
17016
17239
  }
@@ -17022,16 +17245,22 @@ var PERSON_BODY_LEN = 90;
17022
17245
  var PERSON_SHADOW_DY = 20;
17023
17246
  var PERSON_SHADOW_RY = 4;
17024
17247
  var PERSON_SHADOW_RX = 55;
17025
- function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
17248
+ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan, textMetrics = "proportional") {
17026
17249
  const \u5E45 = Math.max(
17027
- textWidth(node.title ?? "", plan.\u540D\u524D.size),
17028
- node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING) : 0,
17029
- node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size) : 0
17250
+ textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics),
17251
+ node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING, textMetrics) : 0,
17252
+ node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size, 0, textMetrics) : 0
17030
17253
  );
17031
- const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size);
17032
- 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;
17254
+ const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics);
17255
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
17256
+ const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", plan.\u540D\u524D.size, 0, \u5E45\u4E0A\u9650, \u6E2C\u308B) : 0;
17033
17257
  const k = \u5E45 > 0 && \u5E45\u4E0A\u9650 > 0 ? Math.min(1, Math.max(\u5E45\u4E0A\u9650 / \u5E45, \u4E0B\u9650)) : 1;
17034
- const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(t, \u5927\u304D\u3055 * k, \u5E45\u4E0A\u9650, (u, f) => textWidth(u, f, \u5B57\u9593 * k));
17258
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
17259
+ t,
17260
+ \u5927\u304D\u3055 * k,
17261
+ \u5E45\u4E0A\u9650,
17262
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
17263
+ );
17035
17264
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17036
17265
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx(
17037
17266
  "text",
@@ -17072,7 +17301,7 @@ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
17072
17301
  )
17073
17302
  ] });
17074
17303
  }
17075
- function ShapePersonNode({ node, active }) {
17304
+ function ShapePersonNode({ node, active, textMetrics = "proportional" }) {
17076
17305
  const r = shapeRegion(node);
17077
17306
  const cx = r.cx;
17078
17307
  const strokeColor = active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)";
@@ -17134,7 +17363,7 @@ function ShapePersonNode({ node, active }) {
17134
17363
  )
17135
17364
  ] })
17136
17365
  ),
17137
- planLabel(node, r.cx, Math.max(0, node.w), r.label)
17366
+ planLabel(node, r.cx, Math.max(0, node.w), r.label, textMetrics)
17138
17367
  ] });
17139
17368
  }
17140
17369
  var commonFrame2 = (active) => ({
@@ -17384,7 +17613,12 @@ function ShapeTerminalNode({ node, active, lang }) {
17384
17613
  )
17385
17614
  ] });
17386
17615
  }
17387
- function ShapeCodeBlockNode({ node, active, lang }) {
17616
+ function ShapeCodeBlockNode({
17617
+ node,
17618
+ active,
17619
+ lang,
17620
+ textMetrics = "proportional"
17621
+ }) {
17388
17622
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
17389
17623
  const frame = commonFrame2(active);
17390
17624
  const \u7DDA = frame.strokeWidth / 2;
@@ -17395,7 +17629,10 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17395
17629
  const lineFont = "ui-monospace, SFMono-Regular, Menlo, monospace";
17396
17630
  const \u672D = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("codeBlock.fileName"));
17397
17631
  const \u672D\u306E\u5B57 = 11;
17398
- const \u30BF\u30D6\u5E45 = Math.min(Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0) + 24), Math.max(0, w));
17632
+ const \u30BF\u30D6\u5E45 = Math.min(
17633
+ Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0, textMetrics) + 24),
17634
+ Math.max(0, w)
17635
+ );
17399
17636
  const \u30BF\u30D6\u9AD8 = 24;
17400
17637
  const \u89D2 = 10;
17401
17638
  const \u6E9D = 32;
@@ -17435,7 +17672,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17435
17672
  { text: \u672D, size: \u672D\u306E\u5B57, \u5E2F: { \u5E45: \u30BF\u30D6\u5E45, \u9AD8\u3055: \u30BF\u30D6\u9AD8 } },
17436
17673
  { text: "1", size: \u884C\u756A\u53F7\u306E\u5B57, \u5E2F: { \u5E45: \u6E9D - \u6301\u3061\u4E0A\u3052, \u9AD8\u3055: \u884C\u9593 } }
17437
17674
  ];
17438
- const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089);
17675
+ const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
17439
17676
  const tabW = \u30BF\u30D6\u5E45 * \u500D;
17440
17677
  const tabH = \u30BF\u30D6\u9AD8 * \u500D;
17441
17678
  const \u4E38 = \u89D2 * \u500D;
@@ -17474,7 +17711,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17474
17711
  "data-cdl-counter-scaled": "1",
17475
17712
  x: x + tabW / 2,
17476
17713
  y: y + tabH / 2 + 4 * \u500D,
17477
- fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW),
17714
+ fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW, textMetrics),
17478
17715
  fontFamily: lineFont,
17479
17716
  textAnchor: "middle",
17480
17717
  fill: "#e6edf3",
@@ -17556,7 +17793,12 @@ function ShapeCodeBlockNode({ node, active, lang }) {
17556
17793
  )
17557
17794
  ] });
17558
17795
  }
17559
- function ShapeKanbanCardNode({ node, active, lang }) {
17796
+ function ShapeKanbanCardNode({
17797
+ node,
17798
+ active,
17799
+ lang,
17800
+ textMetrics = "proportional"
17801
+ }) {
17560
17802
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
17561
17803
  const frame = commonFrame2(active);
17562
17804
  const \u7DDA = frame.strokeWidth / 2;
@@ -17610,7 +17852,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
17610
17852
  );
17611
17853
  const \u8AAC\u660E = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("kanbanCard.task"));
17612
17854
  const \u72B6\u614B = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.eyebrow, \u5B57\u5F15("kanbanCard.status"));
17613
- const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45);
17855
+ const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45, textMetrics);
17614
17856
  const \u8AAC\u660E\u306E\u5B57 = \u540D\u524D.size * \u8AAC\u660E\u5B57\u6BD4;
17615
17857
  const \u4F7F\u3048\u308B\u5E452 = Math.max(0, w - \u5DE6\u53F3\u4F59\u767D * \u500D * 2);
17616
17858
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
@@ -17697,7 +17939,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
17697
17939
  {
17698
17940
  x: x + w / 2,
17699
17941
  y: \u540D\u524D.y + \u540D\u524D.size * \u8AAC\u660E\u57FA\u6E96\u6BD4,
17700
- fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452),
17942
+ fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452, textMetrics),
17701
17943
  textAnchor: "middle",
17702
17944
  fill: "var(--cdl-text-dim, #5a6270)",
17703
17945
  children: \u8AAC\u660E
@@ -17988,18 +18230,33 @@ var externalLabel = (node, cx, bottomY) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRu
17988
18230
  )
17989
18231
  ] });
17990
18232
  var LABEL_EYEBROW_SPACING = 2;
17991
- function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
17992
- const \u5E45 = textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
17993
- 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;
18233
+ function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
18234
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
18235
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
18236
+ const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u6E2C\u308B) : 0;
17994
18237
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
17995
18238
  const size = \u5927\u304D\u3055 * \u500D\u7387;
17996
18239
  const spacing = \u5B57\u9593 * \u500D\u7387;
17997
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => textWidth(u, f, spacing)) };
17998
- }
17999
- function bottomLabel(node, cx, plan) {
18000
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING, node.w);
18001
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
18002
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
18240
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
18241
+ }
18242
+ function bottomLabel(node, cx, plan, textMetrics = "proportional") {
18243
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(
18244
+ node.eyebrow ?? "",
18245
+ plan.\u80A9\u66F8?.size ?? 0,
18246
+ LABEL_EYEBROW_SPACING,
18247
+ node.w,
18248
+ false,
18249
+ textMetrics
18250
+ );
18251
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
18252
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(
18253
+ node.subtitle ?? "",
18254
+ plan.\u8AAC\u660E?.size ?? 0,
18255
+ 0,
18256
+ node.w,
18257
+ false,
18258
+ textMetrics
18259
+ );
18003
18260
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
18004
18261
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
18005
18262
  /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
@@ -18013,7 +18270,7 @@ var RACK_SLOT_N = 4;
18013
18270
  var RACK_BOTTOM = 8;
18014
18271
  var RACK_H = RACK_SLOT_TOP + RACK_SLOT_N * RACK_SLOT_H + (RACK_SLOT_N - 1) * RACK_SLOT_GAP + RACK_BOTTOM;
18015
18272
  var RACK_W_MIN = 120;
18016
- function ShapeServerRackNode({ node, active }) {
18273
+ function ShapeServerRackNode({ node, active, textMetrics = "proportional" }) {
18017
18274
  const r = shapeRegion(node);
18018
18275
  const frame = commonFrame3(active);
18019
18276
  const \u7DDA = frame.strokeWidth / 2;
@@ -18095,7 +18352,7 @@ function ShapeServerRackNode({ node, active }) {
18095
18352
  ] }, i);
18096
18353
  })
18097
18354
  ] })),
18098
- bottomLabel(node, r.cx, r.label)
18355
+ bottomLabel(node, r.cx, r.label, textMetrics)
18099
18356
  ] });
18100
18357
  }
18101
18358
  var HUB_R = 30;
@@ -18103,7 +18360,7 @@ var ARM_LEN = 68;
18103
18360
  var END_R = 7;
18104
18361
  var WIFI_ARC_R = [10, 16, 22];
18105
18362
  var WIFI_BASE_Y = 5;
18106
- function ShapeNetworkNodeNode({ node, active }) {
18363
+ function ShapeNetworkNodeNode({ node, active, textMetrics = "proportional" }) {
18107
18364
  const r = shapeRegion(node);
18108
18365
  const cx = r.cx;
18109
18366
  const cy = r.cy;
@@ -18179,12 +18436,12 @@ function ShapeNetworkNodeNode({ node, active }) {
18179
18436
  )),
18180
18437
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy: cy + WIFI_BASE_Y + 3, r: 2.5, fill: "var(--cdl-tone-accent, #2d6a8f)", stroke: "none" })
18181
18438
  ] })),
18182
- bottomLabel(node, r.cx, r.label)
18439
+ bottomLabel(node, r.cx, r.label, textMetrics)
18183
18440
  ] });
18184
18441
  }
18185
18442
  var PHONE_H = 240;
18186
18443
  var PHONE_W = 110;
18187
- function ShapeMobileDeviceNode({ node, active }) {
18444
+ function ShapeMobileDeviceNode({ node, active, textMetrics = "proportional" }) {
18188
18445
  const r = shapeRegion(node);
18189
18446
  const frame = commonFrame3(active);
18190
18447
  const \u7DDA = frame.strokeWidth / 2;
@@ -18251,7 +18508,7 @@ function ShapeMobileDeviceNode({ node, active }) {
18251
18508
  }
18252
18509
  )
18253
18510
  ] })),
18254
- bottomLabel(node, r.cx, r.label)
18511
+ bottomLabel(node, r.cx, r.label, textMetrics)
18255
18512
  ] });
18256
18513
  }
18257
18514
  function ShapeIotSensorNode({ node, active }) {
@@ -18522,7 +18779,7 @@ var SAT_DISH_R = 12;
18522
18779
  var SAT_DISH_STEM = 12;
18523
18780
  var SAT_MAST_LEN = 22;
18524
18781
  var SAT_MAST_TIP_R = 4;
18525
- function ShapeSatelliteNode({ node, active }) {
18782
+ function ShapeSatelliteNode({ node, active, textMetrics = "proportional" }) {
18526
18783
  const r = shapeRegion(node);
18527
18784
  const cx = r.cx;
18528
18785
  const cy = r.cy;
@@ -18711,7 +18968,7 @@ function ShapeSatelliteNode({ node, active }) {
18711
18968
  ),
18712
18969
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy: cy - bodyH / 2 - SAT_MAST_LEN, r: 2, fill: "#ff5f56", stroke: "none", children: /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "opacity", values: "0.4;1;0.4", dur: "1.4s", repeatCount: "indefinite" }) })
18713
18970
  ] })),
18714
- bottomLabel(node, r.cx, r.label)
18971
+ bottomLabel(node, r.cx, r.label, textMetrics)
18715
18972
  ] });
18716
18973
  }
18717
18974
  var FRAME_SW_ACTIVE = 3;
@@ -18797,9 +19054,9 @@ function blockchainNodeExtent(strokeWidth) {
18797
19054
  const \u6A2A = (NODE_PEER_DIST + NODE_PEER_R) * Math.cos(Math.PI / 6) + \u7DDA;
18798
19055
  return { \u4E0A: \u7E26, \u4E0B: \u7E26, \u5DE6: \u6A2A, \u53F3: \u6A2A };
18799
19056
  }
18800
- function bottomLabel2(node, cx, plan) {
19057
+ function bottomLabel2(node, cx, plan, textMetrics = "proportional") {
18801
19058
  const \u53CE\u3081\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593, \u984C\u304B = false) => {
18802
- const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f) + ls * [...u].length;
19059
+ const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f, textMetrics) + ls * [...u].length;
18803
19060
  const \u7D20\u306E\u5E45 = \u6E2C\u308B(t, \u5927\u304D\u3055, \u5B57\u9593);
18804
19061
  const \u53CE\u307E\u308B = \u7D20\u306E\u5E45 > node.w && node.w > 0 ? node.w / \u7D20\u306E\u5E45 : 1;
18805
19062
  const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(t, \u5927\u304D\u3055, \u5B57\u9593, node.w, \u6E2C\u308B) : 0;
@@ -18832,7 +19089,12 @@ function EthereumDiamond({ cx, cy, h, colors }) {
18832
19089
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${cx} ${midY} L ${cx + w} ${cy + h * 0.05} L ${cx} ${lowerBotY} Z`, fill: c.dark, stroke: c.stroke, strokeWidth: 0.6, strokeLinejoin: "round" })
18833
19090
  ] });
18834
19091
  }
18835
- function ShapeSmartContractNode({ node, active, lang }) {
19092
+ function ShapeSmartContractNode({
19093
+ node,
19094
+ active,
19095
+ lang,
19096
+ textMetrics = "proportional"
19097
+ }) {
18836
19098
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
18837
19099
  const frame = commonFrame4(active);
18838
19100
  const r = shapeRegion(node);
@@ -18873,7 +19135,7 @@ function ShapeSmartContractNode({ node, active, lang }) {
18873
19135
  }
18874
19136
  ];
18875
19137
  const art = (\u500D\u7387) => {
18876
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19138
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
18877
19139
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
18878
19140
  /* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: path, ...frame, strokeLinejoin: "round" }),
18879
19141
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: foldPath, fill: "none", stroke: frame.stroke, strokeWidth: frame.strokeWidth, strokeLinejoin: "round" }),
@@ -18895,10 +19157,10 @@ function ShapeSmartContractNode({ node, active, lang }) {
18895
19157
  };
18896
19158
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
18897
19159
  fitArt(r, smartContractExtent(frame.strokeWidth), art),
18898
- bottomLabel2(node, r.cx, r.label)
19160
+ bottomLabel2(node, r.cx, r.label, textMetrics)
18899
19161
  ] });
18900
19162
  }
18901
- var \u5B57\u306E\u5E45 = (text, size) => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size);
19163
+ var \u5B57\u306E\u5E45 = (text, size, textMetrics = "proportional") => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, 0, textMetrics);
18902
19164
  var BLOCK_DEFAULT_FIELDS = [
18903
19165
  { key: "hash", label: "blockchainBlock.hash", value: { text: "0xaf31..." } },
18904
19166
  { key: "prev", label: "blockchainBlock.prev", value: { text: "0x7b3f..." } },
@@ -18906,10 +19168,16 @@ var BLOCK_DEFAULT_FIELDS = [
18906
19168
  { key: "nonce", label: "blockchainBlock.nonce", value: { text: "82,914" } },
18907
19169
  { key: "tx", label: "blockchainBlock.tx", value: { \u8F9E\u66F8: "blockchainBlock.txCount" } }
18908
19170
  ];
18909
- function ShapeBlockchainBlockNode({ node, active, lang }) {
19171
+ function ShapeBlockchainBlockNode({
19172
+ node,
19173
+ active,
19174
+ lang,
19175
+ textMetrics = "proportional"
19176
+ }) {
18910
19177
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
18911
19178
  const frame = commonFrame4(active);
18912
19179
  const r = shapeRegion(node);
19180
+ const \u6E2C\u308B\u5B57 = (text, size) => \u5B57\u306E\u5E45(text, size, textMetrics);
18913
19181
  const bw = BLOCK_W;
18914
19182
  const bh = BLOCK_H;
18915
19183
  const cx = r.cx;
@@ -18930,9 +19198,9 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18930
19198
  const \u5E2F\u306E\u6B8B\u308A = bw - 14 - 30;
18931
19199
  const \u80A9\u66F8\u306E\u9699\u9593 = 8;
18932
19200
  const \u80A9\u66F8\u306E\u4E0A\u9650 = (\u5E2F\u306E\u6B8B\u308A - \u80A9\u66F8\u306E\u9699\u9593) / 2;
18933
- const \u80A9\u66F8\u306E\u500D\u7387 = \u80A9\u66F8 === "" ? 1 : \u5E45\u306E\u500D\u7387(\u80A9\u66F8, \u80A9\u66F8\u306E\u5B57, 0, \u80A9\u66F8\u306E\u4E0A\u9650);
19201
+ const \u80A9\u66F8\u306E\u500D\u7387 = \u80A9\u66F8 === "" ? 1 : \u5E45\u306E\u500D\u7387(\u80A9\u66F8, \u80A9\u66F8\u306E\u5B57, 0, \u80A9\u66F8\u306E\u4E0A\u9650, textMetrics);
18934
19202
  const \u80A9\u66F8\u306E\u6307\u5B9A = \u80A9\u66F8\u306E\u5B57 * \u80A9\u66F8\u306E\u500D\u7387;
18935
- const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u5B57\u306E\u5E45(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
19203
+ const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u6E2C\u308B\u5B57(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
18936
19204
  const \u898B\u51FA\u3057\u306E\u5E45 = \u5E2F\u306E\u6B8B\u308A - (\u80A9\u66F8 === "" ? 0 : \u80A9\u66F8\u306E\u5E45 + \u80A9\u66F8\u306E\u9699\u9593);
18937
19205
  const \u6253\u3061\u6D88\u3059\u5B57\u3089 = [
18938
19206
  { text: \u898B\u51FA\u3057, size: \u898B\u51FA\u3057\u306E\u5B57, \u5E2F: { \u5E45: \u898B\u51FA\u3057\u306E\u5E45, \u9AD8\u3055: \u898B\u51FA\u3057\u306E\u5E2F } },
@@ -18943,12 +19211,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18943
19211
  {
18944
19212
  text: f.value,
18945
19213
  size: \u5024\u306E\u5B57,
18946
- \u5E2F: { \u5E45: bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
19214
+ \u5E2F: { \u5E45: bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
18947
19215
  }
18948
19216
  ])
18949
19217
  ];
18950
19218
  const art = (\u500D\u7387) => {
18951
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19219
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
18952
19220
  const \u984C\u306E\u5927\u304D\u3055 = \u898B\u51FA\u3057\u306E\u5B57 * \u500D;
18953
19221
  const \u80A9\u66F8\u306E\u5927\u304D\u3055 = \u80A9\u66F8\u306E\u6307\u5B9A * \u500D;
18954
19222
  const \u540D\u306E\u5927\u304D\u3055 = \u540D\u306E\u5B57 * \u500D;
@@ -18957,7 +19225,7 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18957
19225
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
18958
19226
  /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
18959
19227
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${x} ${y + 32} L ${x} ${y + 8} Q ${x} ${y}, ${x + 8} ${y} L ${x + bw - 8} ${y} Q ${x + bw} ${y}, ${x + bw} ${y + 8} L ${x + bw} ${y + 32} Z`, fill: "var(--cdl-tone-accent, #2d6a8f)", fillOpacity: 0.9, stroke: "none" }),
18960
- /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "blockchain-block-title", "data-cdl-counter-scaled": "1", x: x + 14, y: y + 22, fontSize: \u984C\u306E\u5927\u304D\u3055, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, \u984C\u306E\u5927\u304D\u3055, \u898B\u51FA\u3057\u306E\u5E45, \u5B57\u306E\u5E45) }),
19228
+ /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "blockchain-block-title", "data-cdl-counter-scaled": "1", x: x + 14, y: y + 22, fontSize: \u984C\u306E\u5927\u304D\u3055, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, \u984C\u306E\u5927\u304D\u3055, \u898B\u51FA\u3057\u306E\u5E45, \u6E2C\u308B\u5B57) }),
18961
19229
  \u80A9\u66F8 !== "" && /* @__PURE__ */ jsxRuntime.jsx(
18962
19230
  "text",
18963
19231
  {
@@ -18977,7 +19245,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18977
19245
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
18978
19246
  fields.map((f, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
18979
19247
  /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-counter-scaled": "1", x: x + 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u540D\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "var(--cdl-text-dim, #5a6270)", children: f.label }),
18980
- /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": `blockchain-block-${f.key}`, "data-cdl-counter-scaled": "1", x: x + bw - 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u5024\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(f.value, \u5024\u306E\u5927\u304D\u3055, bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5927\u304D\u3055) - 8, \u5B57\u306E\u5E45) }),
19248
+ /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": `blockchain-block-${f.key}`, "data-cdl-counter-scaled": "1", x: x + bw - 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u5024\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(
19249
+ f.value,
19250
+ \u5024\u306E\u5927\u304D\u3055,
19251
+ bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5927\u304D\u3055) - 8,
19252
+ \u6E2C\u308B\u5B57
19253
+ ) }),
18981
19254
  /* @__PURE__ */ jsxRuntime.jsx("line", { x1: x + 14, y1: y + 60 + i * \u884C\u306E\u9593\u9694, x2: x + bw - 14, y2: y + 60 + i * \u884C\u306E\u9593\u9694, stroke: "var(--cdl-divider, #d4d4d8)", strokeWidth: 0.5, opacity: 0.5 })
18982
19255
  ] }, i)),
18983
19256
  /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
@@ -18989,7 +19262,11 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
18989
19262
  };
18990
19263
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: fitArt(r, blockchainBlockExtent(frame.strokeWidth), art) });
18991
19264
  }
18992
- function ShapeBlockchainNode({ node, active }) {
19265
+ function ShapeBlockchainNode({
19266
+ node,
19267
+ active,
19268
+ textMetrics = "proportional"
19269
+ }) {
18993
19270
  const frame = commonFrame4(active);
18994
19271
  const r = shapeRegion(node);
18995
19272
  const cx = r.cx;
@@ -19005,7 +19282,7 @@ function ShapeBlockchainNode({ node, active }) {
19005
19282
  { text: "0x\u2026", size: CHAIN_HASH_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: CHAIN_ROW_GAP } }
19006
19283
  ];
19007
19284
  const art = (\u500D\u7387) => {
19008
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19285
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19009
19286
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19010
19287
  const bx = startX + i * (blockW + linkW);
19011
19288
  const isCurrent = i === blockCount - 1;
@@ -19041,10 +19318,14 @@ function ShapeBlockchainNode({ node, active }) {
19041
19318
  };
19042
19319
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19043
19320
  fitArt(r, chainExtent(), art),
19044
- bottomLabel2(node, r.cx, r.label)
19321
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19045
19322
  ] });
19046
19323
  }
19047
- function ShapeBitcoinChainNode({ node, active }) {
19324
+ function ShapeBitcoinChainNode({
19325
+ node,
19326
+ active,
19327
+ textMetrics = "proportional"
19328
+ }) {
19048
19329
  const frame = commonFrame4(active);
19049
19330
  const r = shapeRegion(node);
19050
19331
  const cx = r.cx;
@@ -19060,7 +19341,7 @@ function ShapeBitcoinChainNode({ node, active }) {
19060
19341
  { text: "#820", size: BTC_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
19061
19342
  ];
19062
19343
  const art = (\u500D\u7387) => {
19063
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19344
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19064
19345
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19065
19346
  const bx = startX + i * (blockW + linkW);
19066
19347
  const isCurrent = i === blockCount - 1;
@@ -19091,10 +19372,14 @@ function ShapeBitcoinChainNode({ node, active }) {
19091
19372
  };
19092
19373
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19093
19374
  fitArt(r, chainExtent(), art),
19094
- bottomLabel2(node, r.cx, r.label)
19375
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19095
19376
  ] });
19096
19377
  }
19097
- function ShapeEthereumChainNode({ node, active }) {
19378
+ function ShapeEthereumChainNode({
19379
+ node,
19380
+ active,
19381
+ textMetrics = "proportional"
19382
+ }) {
19098
19383
  const frame = commonFrame4(active);
19099
19384
  const r = shapeRegion(node);
19100
19385
  const cx = r.cx;
@@ -19110,7 +19395,7 @@ function ShapeEthereumChainNode({ node, active }) {
19110
19395
  { text: "#214", size: ETH_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
19111
19396
  ];
19112
19397
  const art = (\u500D\u7387) => {
19113
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19398
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19114
19399
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
19115
19400
  const bx = startX + i * (blockW + linkW);
19116
19401
  const isCurrent = i === blockCount - 1;
@@ -19142,10 +19427,14 @@ function ShapeEthereumChainNode({ node, active }) {
19142
19427
  };
19143
19428
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19144
19429
  fitArt(r, chainExtent(), art),
19145
- bottomLabel2(node, r.cx, r.label)
19430
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19146
19431
  ] });
19147
19432
  }
19148
- function ShapeBlockchainNodeNode({ node, active }) {
19433
+ function ShapeBlockchainNodeNode({
19434
+ node,
19435
+ active,
19436
+ textMetrics = "proportional"
19437
+ }) {
19149
19438
  const frame = commonFrame4(active);
19150
19439
  const r = shapeRegion(node);
19151
19440
  const cx = r.cx;
@@ -19199,10 +19488,15 @@ function ShapeBlockchainNodeNode({ node, active }) {
19199
19488
  ] });
19200
19489
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19201
19490
  fitArt(r, blockchainNodeExtent(frame.strokeWidth), art),
19202
- bottomLabel2(node, r.cx, r.label)
19491
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19203
19492
  ] });
19204
19493
  }
19205
- function ShapeRpcNodeNode({ node, active, lang }) {
19494
+ function ShapeRpcNodeNode({
19495
+ node,
19496
+ active,
19497
+ lang,
19498
+ textMetrics = "proportional"
19499
+ }) {
19206
19500
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19207
19501
  const frame = commonFrame4(active);
19208
19502
  const r = shapeRegion(node);
@@ -19221,10 +19515,10 @@ function ShapeRpcNodeNode({ node, active, lang }) {
19221
19515
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy + 26, fontSize: 11, textAnchor: "middle", fill: "#7a8290", fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", children: "JSON-RPC 2.0" }),
19222
19516
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 16, y: y + bh - 24, width: bw - 32, height: 8, rx: 4, fill: "#0f1419", stroke: "none" }),
19223
19517
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 16, y: y + bh - 24, width: (bw - 32) * 0.92, height: 8, rx: 4, fill: "#27c93f", stroke: "none", children: /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "width", values: `${(bw - 32) * 0.86};${(bw - 32) * 0.96};${(bw - 32) * 0.86}`, dur: "3s", repeatCount: "indefinite" }) }),
19224
- bottomLabel2(node, r.cx, r.label)
19518
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19225
19519
  ] });
19226
19520
  }
19227
- function ShapeWalletNode({ node, active }) {
19521
+ function ShapeWalletNode({ node, active, textMetrics = "proportional" }) {
19228
19522
  const frame = commonFrame4(active);
19229
19523
  const r = shapeRegion(node);
19230
19524
  const cx = r.cx;
@@ -19298,10 +19592,10 @@ function ShapeWalletNode({ node, active }) {
19298
19592
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: foldY + 3, fontSize: 9, fontWeight: 700, fill: "#5a3a10", textAnchor: "middle", opacity: 0.8, children: "\u039E" }),
19299
19593
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${x + 2} ${y + 6} L ${x + w - 2} ${y + 6}`, fill: "none", stroke: "#ffffff", strokeWidth: 1, opacity: 0.4 })
19300
19594
  ] }),
19301
- bottomLabel2(node, r.cx, r.label)
19595
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19302
19596
  ] });
19303
19597
  }
19304
- function ShapeNftNode({ node, active }) {
19598
+ function ShapeNftNode({ node, active, textMetrics = "proportional" }) {
19305
19599
  const frame = commonFrame4(active);
19306
19600
  const r = shapeRegion(node);
19307
19601
  const cx = r.cx;
@@ -19317,7 +19611,7 @@ function ShapeNftNode({ node, active }) {
19317
19611
  { text: "#1024", size: NFT_ID_SIZE, \u5E2F: { \u5E45: cardW - 16 - 34, \u9AD8\u3055: cardH - artH } }
19318
19612
  ];
19319
19613
  const art = (\u500D\u7387) => {
19320
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
19614
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19321
19615
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19322
19616
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 4, y: y + 4, width: cardW, height: cardH, rx: 14, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
19323
19617
  /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: cardW, height: cardH, rx: 14, ...frame }),
@@ -19355,10 +19649,10 @@ function ShapeNftNode({ node, active }) {
19355
19649
  };
19356
19650
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19357
19651
  fitArt(r, nftExtent(frame.strokeWidth), art),
19358
- bottomLabel2(node, r.cx, r.label)
19652
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19359
19653
  ] });
19360
19654
  }
19361
- function ShapeTokenNode({ node, active }) {
19655
+ function ShapeTokenNode({ node, active, textMetrics = "proportional" }) {
19362
19656
  const frame = commonFrame4(active);
19363
19657
  const r = shapeRegion(node);
19364
19658
  const cx = r.cx;
@@ -19395,7 +19689,7 @@ function ShapeTokenNode({ node, active }) {
19395
19689
  }
19396
19690
  }
19397
19691
  ),
19398
- bottomLabel2(node, r.cx, r.label)
19692
+ bottomLabel2(node, r.cx, r.label, textMetrics)
19399
19693
  ] });
19400
19694
  }
19401
19695
  var commonFrame5 = (active) => ({
@@ -19414,7 +19708,8 @@ function \u5B57\u306E\u6BD4(c) {
19414
19708
  if (\u5E83\u5B57.has(c)) return \u5E83\u5B57\u6BD4;
19415
19709
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD4 : \u5E83\u5B57\u6BD4;
19416
19710
  }
19417
- function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19711
+ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
19712
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
19418
19713
  let \u5E45 = 0;
19419
19714
  let \u5B57\u6570 = 0;
19420
19715
  for (const c of \u6587\u5B57\u5217) {
@@ -19423,18 +19718,33 @@ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19423
19718
  }
19424
19719
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
19425
19720
  }
19426
- function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
19427
- const \u5E45 = \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
19428
- 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;
19721
+ function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
19722
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E45(t, s, ls, textMetrics);
19723
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
19724
+ const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u6E2C\u308B) : 0;
19429
19725
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
19430
19726
  const size = \u5927\u304D\u3055 * \u500D\u7387;
19431
19727
  const spacing = \u5B57\u9593 * \u500D\u7387;
19432
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u5B57\u5E45(u, f, spacing)) };
19433
- }
19434
- function bottomLabel3(node, cx, plan) {
19435
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING2, node.w);
19436
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
19437
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
19728
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
19729
+ }
19730
+ function bottomLabel3(node, cx, plan, textMetrics = "proportional") {
19731
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(
19732
+ node.eyebrow ?? "",
19733
+ plan.\u80A9\u66F8?.size ?? 0,
19734
+ LABEL_EYEBROW_SPACING2,
19735
+ node.w,
19736
+ false,
19737
+ textMetrics
19738
+ );
19739
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
19740
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(
19741
+ node.subtitle ?? "",
19742
+ plan.\u8AAC\u660E?.size ?? 0,
19743
+ 0,
19744
+ node.w,
19745
+ false,
19746
+ textMetrics
19747
+ );
19438
19748
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19439
19749
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
19440
19750
  /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
@@ -19453,7 +19763,7 @@ var BANK_STEP_SW = 1;
19453
19763
  var BANK_COLUMN_MIN = 24;
19454
19764
  var BANK_BLD_W_MIN = 120;
19455
19765
  var BANK_BLD_W_MAX = 280;
19456
- function ShapeBankNode({ node, active }) {
19766
+ function ShapeBankNode({ node, active, textMetrics = "proportional" }) {
19457
19767
  const frame = commonFrame5(active);
19458
19768
  const r = shapeRegion(node);
19459
19769
  const \u7DDA = frame.strokeWidth / 2;
@@ -19500,7 +19810,7 @@ function ShapeBankNode({ node, active }) {
19500
19810
  ] });
19501
19811
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19502
19812
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19503
- bottomLabel3(node, r.cx, r.label)
19813
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19504
19814
  ] });
19505
19815
  }
19506
19816
  var TRUST_CROWN_RISE = 4;
@@ -19512,7 +19822,12 @@ var TRUST_BASE_H = 14;
19512
19822
  var TRUST_BODY_OUT = 8;
19513
19823
  var TRUST_BLD_W_MIN = 140;
19514
19824
  var TRUST_BLD_W_MAX = 280;
19515
- function ShapeTrustBankNode({ node, active, lang }) {
19825
+ function ShapeTrustBankNode({
19826
+ node,
19827
+ active,
19828
+ lang,
19829
+ textMetrics = "proportional"
19830
+ }) {
19516
19831
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19517
19832
  const frame = commonFrame5(active);
19518
19833
  const r = shapeRegion(node);
@@ -19566,10 +19881,15 @@ function ShapeTrustBankNode({ node, active, lang }) {
19566
19881
  ] });
19567
19882
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19568
19883
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19569
- bottomLabel3(node, r.cx, r.label)
19884
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19570
19885
  ] });
19571
19886
  }
19572
- function ShapePaymentProviderNode({ node, active, lang }) {
19887
+ function ShapePaymentProviderNode({
19888
+ node,
19889
+ active,
19890
+ lang,
19891
+ textMetrics = "proportional"
19892
+ }) {
19573
19893
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19574
19894
  const frame = commonFrame5(active);
19575
19895
  const r = shapeRegion(node);
@@ -19594,10 +19914,14 @@ function ShapePaymentProviderNode({ node, active, lang }) {
19594
19914
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy + 9, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: accentDarker, fontFamily: "Georgia, serif", children: "$" })
19595
19915
  ] }),
19596
19916
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: y + boxH - 16, fontSize: 11, fontWeight: 700, letterSpacing: 2, textAnchor: "middle", fill: "#a4b5f2", children: \u5B57\u5F15("paymentProvider.status") }),
19597
- bottomLabel3(node, r.cx, r.label)
19917
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19598
19918
  ] });
19599
19919
  }
19600
- function ShapeCreditCardNode({ node, active }) {
19920
+ function ShapeCreditCardNode({
19921
+ node,
19922
+ active,
19923
+ textMetrics = "proportional"
19924
+ }) {
19601
19925
  const frame = commonFrame5(active);
19602
19926
  const r = shapeRegion(node);
19603
19927
  const cardW = Math.min(r.availW - 30, 260);
@@ -19619,7 +19943,7 @@ function ShapeCreditCardNode({ node, active }) {
19619
19943
  [0, 1, 2, 3].map((block) => /* @__PURE__ */ jsxRuntime.jsx("g", { children: [0, 1, 2, 3].map((dot) => /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + 32 + block * (cardW - 64) / 4 + dot * 8, cy: y + cardH - 40, r: 2.8, fill: "#ffffff", stroke: "none" }, dot)) }, block)),
19620
19944
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + cardW - 48, cy: y + cardH - 24, r: 15, fill: "#c9302c", opacity: 0.9, stroke: "none" }),
19621
19945
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + cardW - 30, cy: y + cardH - 24, r: 15, fill: "#e5c07b", opacity: 0.9, stroke: "none" }),
19622
- bottomLabel3(node, r.cx, r.label)
19946
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19623
19947
  ] });
19624
19948
  }
19625
19949
  var BROKERAGE_TICK_H = 18;
@@ -19644,7 +19968,12 @@ var BROKERAGE_SHADE_OUT = 2;
19644
19968
  var BROKERAGE_W_MIN = BROKERAGE_COLS * BROKERAGE_CELL_W + (BROKERAGE_COLS - 1) * BROKERAGE_GAP_X + 6;
19645
19969
  var BROKERAGE_W_MAX = 140;
19646
19970
  var BROKERAGE_H_MIN = BROKERAGE_TICK_H + BROKERAGE_LOGO_H + BROKERAGE_BASE_H;
19647
- function ShapeBrokerageNode({ node, active, lang }) {
19971
+ function ShapeBrokerageNode({
19972
+ node,
19973
+ active,
19974
+ lang,
19975
+ textMetrics = "proportional"
19976
+ }) {
19648
19977
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19649
19978
  const frame = commonFrame5(active);
19650
19979
  const r = shapeRegion(node);
@@ -19683,7 +20012,7 @@ function ShapeBrokerageNode({ node, active, lang }) {
19683
20012
  }
19684
20013
  ];
19685
20014
  const \u7D75 = (\u500D\u7387) => {
19686
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20015
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19687
20016
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19688
20017
  /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx, cy: y + h + BROKERAGE_SHADOW_DY, rx: w * BROKERAGE_SHADOW_RX_RATIO, ry: BROKERAGE_SHADOW_RY, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
19689
20018
  /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: w, height: h, fill: "#255a7a", stroke: accentDarker, strokeWidth: frame.strokeWidth }),
@@ -19711,12 +20040,17 @@ function ShapeBrokerageNode({ node, active, lang }) {
19711
20040
  };
19712
20041
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19713
20042
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19714
- bottomLabel3(node, r.cx, r.label)
20043
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19715
20044
  ] });
19716
20045
  }
19717
20046
  var EXCHANGE_SUB_SIZE = 11;
19718
20047
  var EXCHANGE_HEX_R = 52;
19719
- function ShapeExchangeNode({ node, active, lang }) {
20048
+ function ShapeExchangeNode({
20049
+ node,
20050
+ active,
20051
+ lang,
20052
+ textMetrics = "proportional"
20053
+ }) {
19720
20054
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19721
20055
  const frame = commonFrame5(active);
19722
20056
  const r = shapeRegion(node);
@@ -19761,7 +20095,7 @@ function ShapeExchangeNode({ node, active, lang }) {
19761
20095
  }
19762
20096
  ];
19763
20097
  const \u7D75 = (\u500D\u7387) => {
19764
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20098
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
19765
20099
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19766
20100
  nodes.map((n, i) => /* @__PURE__ */ jsxRuntime.jsx("line", { x1: cx, y1: cy, x2: n.cx, y2: n.cy, stroke: accentDarker, strokeWidth: 1.5, strokeDasharray: "3 2" }, `l${i}`)),
19767
20101
  nodes.map((n, i) => {
@@ -19780,7 +20114,7 @@ function ShapeExchangeNode({ node, active, lang }) {
19780
20114
  };
19781
20115
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19782
20116
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19783
- bottomLabel3(node, r.cx, r.label)
20117
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19784
20118
  ] });
19785
20119
  }
19786
20120
  var ATM_SIGN_H = 26;
@@ -19797,7 +20131,12 @@ var ATM_PANEL_H = 146;
19797
20131
  var ATM_W_MIN = 100;
19798
20132
  var ATM_W_MAX = ATM_PANEL_W;
19799
20133
  var ATM_H_MIN = ATM_SIGN_H + ATM_SIGN_GAP + 30 + ATM_FLOOR_RESERVE;
19800
- function ShapeAtmNode({ node, active, lang }) {
20134
+ function ShapeAtmNode({
20135
+ node,
20136
+ active,
20137
+ lang,
20138
+ textMetrics = "proportional"
20139
+ }) {
19801
20140
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19802
20141
  const frame = commonFrame5(active);
19803
20142
  const r = shapeRegion(node);
@@ -19881,7 +20220,7 @@ function ShapeAtmNode({ node, active, lang }) {
19881
20220
  ] });
19882
20221
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19883
20222
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19884
- bottomLabel3(node, r.cx, r.label)
20223
+ bottomLabel3(node, r.cx, r.label, textMetrics)
19885
20224
  ] });
19886
20225
  }
19887
20226
  var commonFrame6 = (active) => ({
@@ -19900,7 +20239,8 @@ function \u5B57\u306E\u6BD42(c) {
19900
20239
  if (\u5E83\u5B572.has(c)) return \u5E83\u5B57\u6BD42;
19901
20240
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD42 : \u5E83\u5B57\u6BD42;
19902
20241
  }
19903
- function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
20242
+ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
20243
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
19904
20244
  let \u5E45 = 0;
19905
20245
  let \u5B57\u6570 = 0;
19906
20246
  for (const c of \u6587\u5B57\u5217) {
@@ -19909,18 +20249,33 @@ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
19909
20249
  }
19910
20250
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
19911
20251
  }
19912
- function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
19913
- const \u5E45 = \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
19914
- 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;
20252
+ function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
20253
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E452(t, s, ls, textMetrics);
20254
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
20255
+ const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u6E2C\u308B) : 0;
19915
20256
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
19916
20257
  const size = \u5927\u304D\u3055 * \u500D\u7387;
19917
20258
  const spacing = \u5B57\u9593 * \u500D\u7387;
19918
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u5B57\u5E452(u, f, spacing)) };
19919
- }
19920
- function bottomLabel4(node, cx, plan) {
19921
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING3, node.w);
19922
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
19923
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
20259
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
20260
+ }
20261
+ function bottomLabel4(node, cx, plan, textMetrics = "proportional") {
20262
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(
20263
+ node.eyebrow ?? "",
20264
+ plan.\u80A9\u66F8?.size ?? 0,
20265
+ LABEL_EYEBROW_SPACING3,
20266
+ node.w,
20267
+ false,
20268
+ textMetrics
20269
+ );
20270
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
20271
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(
20272
+ node.subtitle ?? "",
20273
+ plan.\u8AAC\u660E?.size ?? 0,
20274
+ 0,
20275
+ node.w,
20276
+ false,
20277
+ textMetrics
20278
+ );
19924
20279
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19925
20280
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
19926
20281
  /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
@@ -19932,7 +20287,7 @@ var WEBSITE_BAR_H = 32;
19932
20287
  var WEBSITE_H_MIN = WEBSITE_BAR_H + 98;
19933
20288
  var WEBSITE_W_MIN = 160;
19934
20289
  var WEBSITE_W_MAX = 280;
19935
- function ShapeWebsiteNode({ node, active }) {
20290
+ function ShapeWebsiteNode({ node, active, textMetrics = "proportional" }) {
19936
20291
  const frame = commonFrame6(active);
19937
20292
  const r = shapeRegion(node);
19938
20293
  const cx = r.cx;
@@ -19958,10 +20313,10 @@ function ShapeWebsiteNode({ node, active }) {
19958
20313
  ] });
19959
20314
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
19960
20315
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
19961
- bottomLabel4(node, r.cx, r.label)
20316
+ bottomLabel4(node, r.cx, r.label, textMetrics)
19962
20317
  ] });
19963
20318
  }
19964
- function ShapeStorefrontNode({ node, active, lang }) {
20319
+ function ShapeStorefrontNode({ node, active, lang, textMetrics = "proportional" }) {
19965
20320
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
19966
20321
  const frame = commonFrame6(active);
19967
20322
  const r = shapeRegion(node);
@@ -20006,7 +20361,7 @@ function ShapeStorefrontNode({ node, active, lang }) {
20006
20361
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: doorX + doorW / 2, y: doorY + doorH * 0.85 + 11, fontSize: 11, fontWeight: 700, letterSpacing: 1, textAnchor: "middle", fill: "#5a3a10", children: \u5B57\u5F15("storefront.open") }),
20007
20362
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: doorX + 6, cy: doorY + doorH * 0.55, r: 1.5, fill: "#c15a4a" }),
20008
20363
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x - 6, y: y + bh - 6, width: bw + 12, height: 8, fill: "#5a6270", stroke: "none" }),
20009
- bottomLabel4(node, r.cx, r.label)
20364
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20010
20365
  ] });
20011
20366
  }
20012
20367
  var WAREHOUSE_ROOF_H = 18;
@@ -20020,7 +20375,7 @@ var WAREHOUSE_SHADOW_RX_RATIO = 0.5;
20020
20375
  var WAREHOUSE_H_MIN = WAREHOUSE_ROOF_H + WAREHOUSE_SIGN_H + 68;
20021
20376
  var WAREHOUSE_W_MIN = 160;
20022
20377
  var WAREHOUSE_W_MAX = 240;
20023
- function ShapeWarehouseNode({ node, active, lang }) {
20378
+ function ShapeWarehouseNode({ node, active, lang, textMetrics = "proportional" }) {
20024
20379
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
20025
20380
  const frame = commonFrame6(active);
20026
20381
  const r = shapeRegion(node);
@@ -20073,13 +20428,13 @@ function ShapeWarehouseNode({ node, active, lang }) {
20073
20428
  ] });
20074
20429
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
20075
20430
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
20076
- bottomLabel4(node, r.cx, r.label)
20431
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20077
20432
  ] });
20078
20433
  }
20079
20434
  var HANDLE_GRIP_X = 118;
20080
20435
  var HANDLE_GRIP_R = 4;
20081
20436
  var CART_SHADOW_RX = 80;
20082
- function ShapeOnlineShopNode({ node, active }) {
20437
+ function ShapeOnlineShopNode({ node, active, textMetrics = "proportional" }) {
20083
20438
  const frame = commonFrame6(active);
20084
20439
  const r = shapeRegion(node);
20085
20440
  const cy = r.cy + 10;
@@ -20135,10 +20490,10 @@ function ShapeOnlineShopNode({ node, active }) {
20135
20490
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 16 * s, fill: "#0f1830", stroke: "#000", strokeWidth: 2 * s }),
20136
20491
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 8 * s, fill: "#5a6270", stroke: "#0f1830", strokeWidth: 1.5 * s }),
20137
20492
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 2 * s, fill: "#0f1830" }),
20138
- bottomLabel4(node, r.cx, r.label)
20493
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20139
20494
  ] });
20140
20495
  }
20141
- function ShapeCdnEdgeNode({ node, active }) {
20496
+ function ShapeCdnEdgeNode({ node, active, textMetrics = "proportional" }) {
20142
20497
  const frame = commonFrame6(active);
20143
20498
  const r = shapeRegion(node);
20144
20499
  const cx = r.cx;
@@ -20201,7 +20556,7 @@ function ShapeCdnEdgeNode({ node, active }) {
20201
20556
  ] });
20202
20557
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
20203
20558
  fitArt(r, { \u4E0A: \u5E83\u304C\u308A, \u4E0B: \u5E83\u304C\u308A, \u5DE6: \u5E83\u304C\u308A, \u53F3: \u5E83\u304C\u308A }, \u7D75),
20204
- bottomLabel4(node, r.cx, r.label)
20559
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20205
20560
  ] });
20206
20561
  }
20207
20562
  var API_ROW_TOP = 52;
@@ -20216,7 +20571,7 @@ var API_METHOD_BOX_W = 54;
20216
20571
  var API_METHOD_TEXT_W = 48;
20217
20572
  var API_W_MIN = 200;
20218
20573
  var API_W_MAX = 300;
20219
- function ShapeApiGatewayNode({ node, active, lang }) {
20574
+ function ShapeApiGatewayNode({ node, active, lang, textMetrics = "proportional" }) {
20220
20575
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
20221
20576
  const frame = commonFrame6(active);
20222
20577
  const r = shapeRegion(node);
@@ -20228,7 +20583,13 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20228
20583
  const x = cx - bw / 2;
20229
20584
  const y = r.cy - \u7E26 / 2 + \u4F59\u767D;
20230
20585
  const \u5E83\u304C\u308A = { \u4E0A: \u7E26 / 2, \u4E0B: \u7E26 / 2, \u5DE6: bw / 2 + \u4F59\u767D, \u53F3: bw / 2 + \u4F59\u767D };
20231
- const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(11, 11 * API_METHOD_TEXT_W / Math.max(displayWidth(s) * 11 * MONO_ADVANCE_RATIO, textWidth(s, 11)));
20586
+ const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(
20587
+ 11,
20588
+ 11 * API_METHOD_TEXT_W / Math.max(
20589
+ displayWidth(s) * 11 * MONO_ADVANCE_RATIO,
20590
+ textWidth(s, 11, 0, textMetrics)
20591
+ )
20592
+ );
20232
20593
  const rowPitch = Math.max(
20233
20594
  API_ROW_PITCH_MIN,
20234
20595
  (bh - API_ROW_TOP - API_ROW_H - API_ROW_BOTTOM_PAD) / (API_ROWS - 1)
@@ -20244,7 +20605,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20244
20605
  \u5E2F: { \u5E45: bw - 32 - 64 - 16, \u9AD8\u3055: API_ROW_H }
20245
20606
  }));
20246
20607
  const \u7D75 = (\u500D\u7387) => {
20247
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
20608
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
20248
20609
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
20249
20610
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + DROP_SHADOW_D, y: y + DROP_SHADOW_D, width: bw, height: bh, rx: 10, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
20250
20611
  /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 10, fill: "#1a2332", stroke: frame.stroke, strokeWidth: frame.strokeWidth }),
@@ -20261,7 +20622,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
20261
20622
  };
20262
20623
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
20263
20624
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
20264
- bottomLabel4(node, r.cx, r.label)
20625
+ bottomLabel4(node, r.cx, r.label, textMetrics)
20265
20626
  ] });
20266
20627
  }
20267
20628
  function bottomLabel5(node, cx, plan) {
@@ -20561,6 +20922,7 @@ function CdlNodeView({
20561
20922
  chartLineScale,
20562
20923
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3,
20563
20924
  lang,
20925
+ textMetrics,
20564
20926
  \u5024\u306E\u540D\u524D
20565
20927
  }) {
20566
20928
  const value = node.value ? interpolate(node.value, stateValues, \u5024\u306E\u540D\u524D) : void 0;
@@ -20605,7 +20967,14 @@ function CdlNodeView({
20605
20967
  return /* @__PURE__ */ jsxRuntime.jsx(CardNode, { node: resolvedNode, active });
20606
20968
  // 時系列のやり取り (#578)。 1 つの箱が図を丸ごと描く = 縦が時間で、参加者は箱を持たない
20607
20969
  case "sequence-board":
20608
- return /* @__PURE__ */ jsxRuntime.jsx(SequenceBoardNode, { node: resolvedNode, stateValues });
20970
+ return /* @__PURE__ */ jsxRuntime.jsx(
20971
+ SequenceBoardNode,
20972
+ {
20973
+ node: resolvedNode,
20974
+ stateValues,
20975
+ textMetrics
20976
+ }
20977
+ );
20609
20978
  // 図表 9 種は payload が `{signal}` を取れるので stateValues を渡す
20610
20979
  // (`render/payload-binding.ts` が描画直前に解決する)。 取れる欄は種別で違い、
20611
20980
  // 数と語を取る 7 種に対し、mind-map / tree-hierarchy は **名前だけ** を取る (#467)。
@@ -20630,7 +20999,8 @@ function CdlNodeView({
20630
20999
  active,
20631
21000
  stateValues,
20632
21001
  drawing,
20633
- progress
21002
+ progress,
21003
+ textMetrics
20634
21004
  }
20635
21005
  );
20636
21006
  case "chart-gauge":
@@ -20641,7 +21011,8 @@ function CdlNodeView({
20641
21011
  active,
20642
21012
  stateValues,
20643
21013
  drawing,
20644
- progress
21014
+ progress,
21015
+ textMetrics
20645
21016
  }
20646
21017
  );
20647
21018
  case "chart-stacked-bar":
@@ -20652,7 +21023,8 @@ function CdlNodeView({
20652
21023
  active,
20653
21024
  stateValues,
20654
21025
  drawing,
20655
- progress
21026
+ progress,
21027
+ textMetrics
20656
21028
  }
20657
21029
  );
20658
21030
  case "chart-slope":
@@ -20663,7 +21035,8 @@ function CdlNodeView({
20663
21035
  active,
20664
21036
  stateValues,
20665
21037
  drawing,
20666
- progress
21038
+ progress,
21039
+ textMetrics
20667
21040
  }
20668
21041
  );
20669
21042
  case "chart-waffle":
@@ -20674,11 +21047,20 @@ function CdlNodeView({
20674
21047
  active,
20675
21048
  stateValues,
20676
21049
  drawing,
20677
- progress
21050
+ progress,
21051
+ textMetrics
20678
21052
  }
20679
21053
  );
20680
21054
  case "chart-stat":
20681
- return /* @__PURE__ */ jsxRuntime.jsx(ChartStatNode, { node: resolvedNode, active, stateValues });
21055
+ return /* @__PURE__ */ jsxRuntime.jsx(
21056
+ ChartStatNode,
21057
+ {
21058
+ node: resolvedNode,
21059
+ active,
21060
+ stateValues,
21061
+ textMetrics
21062
+ }
21063
+ );
20682
21064
  case "chart-radial":
20683
21065
  return /* @__PURE__ */ jsxRuntime.jsx(
20684
21066
  ChartRadialNode,
@@ -20687,7 +21069,8 @@ function CdlNodeView({
20687
21069
  active,
20688
21070
  stateValues,
20689
21071
  drawing,
20690
- progress
21072
+ progress,
21073
+ textMetrics
20691
21074
  }
20692
21075
  );
20693
21076
  case "chart-bar":
@@ -20720,7 +21103,8 @@ function CdlNodeView({
20720
21103
  active,
20721
21104
  stateValues,
20722
21105
  drawing,
20723
- progress
21106
+ progress,
21107
+ textMetrics
20724
21108
  }
20725
21109
  );
20726
21110
  case "funnel-stages":
@@ -20731,11 +21115,20 @@ function CdlNodeView({
20731
21115
  active,
20732
21116
  stateValues,
20733
21117
  drawing,
20734
- progress
21118
+ progress,
21119
+ textMetrics
20735
21120
  }
20736
21121
  );
20737
21122
  case "quadrant-matrix":
20738
- return /* @__PURE__ */ jsxRuntime.jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
21123
+ return /* @__PURE__ */ jsxRuntime.jsx(
21124
+ QuadrantNode,
21125
+ {
21126
+ node: resolvedNode,
21127
+ active,
21128
+ stateValues,
21129
+ textMetrics
21130
+ }
21131
+ );
20739
21132
  case "tree-hierarchy":
20740
21133
  return /* @__PURE__ */ jsxRuntime.jsx(
20741
21134
  TreeNode,
@@ -20744,7 +21137,8 @@ function CdlNodeView({
20744
21137
  active,
20745
21138
  stateValues,
20746
21139
  drawing,
20747
- progress
21140
+ progress,
21141
+ textMetrics
20748
21142
  }
20749
21143
  );
20750
21144
  case "journey-map":
@@ -20759,91 +21153,91 @@ function CdlNodeView({
20759
21153
  }
20760
21154
  );
20761
21155
  case "shape-file":
20762
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active });
21156
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active, textMetrics });
20763
21157
  case "shape-folder":
20764
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeFolderNode, { node: resolvedNode, active });
21158
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeFolderNode, { node: resolvedNode, active, textMetrics });
20765
21159
  case "shape-cloud":
20766
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCloudNode, { node: resolvedNode, active });
21160
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCloudNode, { node: resolvedNode, active, textMetrics });
20767
21161
  case "shape-cylinder":
20768
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCylinderNode, { node: resolvedNode, active });
21162
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCylinderNode, { node: resolvedNode, active, textMetrics });
20769
21163
  case "shape-hexagon":
20770
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeHexagonNode, { node: resolvedNode, active });
21164
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeHexagonNode, { node: resolvedNode, active, textMetrics });
20771
21165
  case "shape-diamond":
20772
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeDiamondNode, { node: resolvedNode, active });
21166
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeDiamondNode, { node: resolvedNode, active, textMetrics });
20773
21167
  case "shape-stack":
20774
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeStackNode, { node: resolvedNode, active });
21168
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeStackNode, { node: resolvedNode, active, textMetrics });
20775
21169
  case "shape-person":
20776
- return /* @__PURE__ */ jsxRuntime.jsx(ShapePersonNode, { node: resolvedNode, active });
21170
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapePersonNode, { node: resolvedNode, active, textMetrics });
20777
21171
  case "shape-window":
20778
21172
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeWindowNode, { node: resolvedNode, active });
20779
21173
  case "shape-terminal":
20780
21174
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeTerminalNode, { node: resolvedNode, active, lang });
20781
21175
  case "shape-code-block":
20782
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang });
21176
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang, textMetrics });
20783
21177
  case "shape-kanban-card":
20784
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang });
21178
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang, textMetrics });
20785
21179
  case "shape-message-bubble":
20786
21180
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeMessageBubbleNode, { node: resolvedNode, active });
20787
21181
  case "shape-gear":
20788
21182
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeGearNode, { node: resolvedNode, active });
20789
21183
  case "shape-server-rack":
20790
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeServerRackNode, { node: resolvedNode, active });
21184
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeServerRackNode, { node: resolvedNode, active, textMetrics });
20791
21185
  case "shape-network-node":
20792
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeNetworkNodeNode, { node: resolvedNode, active });
21186
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeNetworkNodeNode, { node: resolvedNode, active, textMetrics });
20793
21187
  case "shape-mobile-device":
20794
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeMobileDeviceNode, { node: resolvedNode, active });
21188
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeMobileDeviceNode, { node: resolvedNode, active, textMetrics });
20795
21189
  case "shape-iot-sensor":
20796
21190
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeIotSensorNode, { node: resolvedNode, active });
20797
21191
  case "shape-robot-arm":
20798
21192
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeRobotArmNode, { node: resolvedNode, active });
20799
21193
  case "shape-satellite":
20800
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeSatelliteNode, { node: resolvedNode, active });
21194
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeSatelliteNode, { node: resolvedNode, active, textMetrics });
20801
21195
  case "shape-smart-contract":
20802
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang });
21196
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang, textMetrics });
20803
21197
  case "shape-blockchain-block":
20804
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang });
21198
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang, textMetrics });
20805
21199
  case "shape-rpc-node":
20806
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang });
21200
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang, textMetrics });
20807
21201
  case "shape-wallet":
20808
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeWalletNode, { node: resolvedNode, active });
21202
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeWalletNode, { node: resolvedNode, active, textMetrics });
20809
21203
  case "shape-nft":
20810
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeNftNode, { node: resolvedNode, active });
21204
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeNftNode, { node: resolvedNode, active, textMetrics });
20811
21205
  case "shape-token":
20812
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeTokenNode, { node: resolvedNode, active });
21206
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeTokenNode, { node: resolvedNode, active, textMetrics });
20813
21207
  case "shape-blockchain":
20814
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNode, { node: resolvedNode, active });
21208
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNode, { node: resolvedNode, active, textMetrics });
20815
21209
  case "shape-bitcoin-chain":
20816
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBitcoinChainNode, { node: resolvedNode, active });
21210
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBitcoinChainNode, { node: resolvedNode, active, textMetrics });
20817
21211
  case "shape-ethereum-chain":
20818
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeEthereumChainNode, { node: resolvedNode, active });
21212
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeEthereumChainNode, { node: resolvedNode, active, textMetrics });
20819
21213
  case "shape-blockchain-node":
20820
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active });
21214
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active, textMetrics });
20821
21215
  case "shape-bank":
20822
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBankNode, { node: resolvedNode, active });
21216
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBankNode, { node: resolvedNode, active, textMetrics });
20823
21217
  case "shape-trust-bank":
20824
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang });
21218
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang, textMetrics });
20825
21219
  case "shape-payment-provider":
20826
- return /* @__PURE__ */ jsxRuntime.jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang });
21220
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang, textMetrics });
20827
21221
  case "shape-credit-card":
20828
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCreditCardNode, { node: resolvedNode, active });
21222
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCreditCardNode, { node: resolvedNode, active, textMetrics });
20829
21223
  case "shape-brokerage":
20830
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang });
21224
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang, textMetrics });
20831
21225
  case "shape-exchange":
20832
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeExchangeNode, { node: resolvedNode, active, lang });
21226
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeExchangeNode, { node: resolvedNode, active, lang, textMetrics });
20833
21227
  case "shape-atm":
20834
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeAtmNode, { node: resolvedNode, active, lang });
21228
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeAtmNode, { node: resolvedNode, active, lang, textMetrics });
20835
21229
  case "shape-website":
20836
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeWebsiteNode, { node: resolvedNode, active });
21230
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeWebsiteNode, { node: resolvedNode, active, textMetrics });
20837
21231
  case "shape-storefront":
20838
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang });
21232
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang, textMetrics });
20839
21233
  case "shape-warehouse":
20840
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang });
21234
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang, textMetrics });
20841
21235
  case "shape-online-shop":
20842
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeOnlineShopNode, { node: resolvedNode, active });
21236
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeOnlineShopNode, { node: resolvedNode, active, textMetrics });
20843
21237
  case "shape-cdn-edge":
20844
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCdnEdgeNode, { node: resolvedNode, active });
21238
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCdnEdgeNode, { node: resolvedNode, active, textMetrics });
20845
21239
  case "shape-api-gateway":
20846
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang });
21240
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang, textMetrics });
20847
21241
  case "shape-auditor":
20848
21242
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeAuditorNode, { node: resolvedNode, active });
20849
21243
  case "shape-regulator":
@@ -20863,7 +21257,17 @@ function CdlNodeView({
20863
21257
  case "station":
20864
21258
  return /* @__PURE__ */ jsxRuntime.jsx(StationNode, { node: resolvedNode, active });
20865
21259
  default:
20866
- return /* @__PURE__ */ jsxRuntime.jsx(GenericNode, { node: resolvedNode, active, value: node.value, stateValues, \u5024\u306E\u540D\u524D });
21260
+ return /* @__PURE__ */ jsxRuntime.jsx(
21261
+ GenericNode,
21262
+ {
21263
+ node: resolvedNode,
21264
+ active,
21265
+ value: node.value,
21266
+ stateValues,
21267
+ \u5024\u306E\u540D\u524D,
21268
+ textMetrics
21269
+ }
21270
+ );
20867
21271
  }
20868
21272
  })();
20869
21273
  const offsetX = node.renderOffsetX !== void 0 ? resolveNumericAttr(node.renderOffsetX, stateValues, 0) : 0;
@@ -20924,7 +21328,7 @@ function CdlNodeView({
20924
21328
  }
20925
21329
  ),
20926
21330
  inner,
20927
- \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode)
21331
+ \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode, textMetrics ?? "proportional")
20928
21332
  ]
20929
21333
  }
20930
21334
  );
@@ -20933,17 +21337,17 @@ var FIGURE_TITLE_GAP = 10;
20933
21337
  var FIGURE_TITLE_SIZE = 15;
20934
21338
  var FIGURE_EYEBROW_SIZE = 11;
20935
21339
  var FIGURE_EYEBROW_LIFT = 1.1;
20936
- function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45) {
20937
- const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0);
21340
+ function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45, textMetrics = "proportional") {
21341
+ const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0, textMetrics);
20938
21342
  return \u5B9F\u5E45 > \u5E45 ? \u7D20\u306E\u5927\u304D\u3055 * \u5E45 / \u5B9F\u5E45 : \u7D20\u306E\u5927\u304D\u3055;
20939
21343
  }
20940
- function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
21344
+ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node, textMetrics = "proportional") {
20941
21345
  if (!drawsFigureTitle(node.kind)) return null;
20942
21346
  const \u540D\u524D = (node.title ?? "").trim();
20943
21347
  const \u5C0F\u898B\u51FA\u3057 = (node.eyebrow ?? "").trim();
20944
21348
  if (\u540D\u524D === "" && \u5C0F\u898B\u51FA\u3057 === "") return null;
20945
21349
  const \u984C\u306Ey = node.cy - node.h / 2 - FIGURE_TITLE_GAP;
20946
- const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w);
21350
+ const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w, textMetrics);
20947
21351
  const \u5C0F\u898B\u51FA\u3057\u306Ey = \u540D\u524D === "" ? \u984C\u306Ey : \u984C\u306Ey - \u984C\u306E\u5927\u304D\u3055 * FIGURE_EYEBROW_LIFT;
20948
21352
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20949
21353
  \u5C0F\u898B\u51FA\u3057 !== "" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -20953,7 +21357,7 @@ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
20953
21357
  x: node.cx,
20954
21358
  y: \u5C0F\u898B\u51FA\u3057\u306Ey,
20955
21359
  textAnchor: "middle",
20956
- fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w),
21360
+ fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w, textMetrics),
20957
21361
  fontWeight: 600,
20958
21362
  letterSpacing: 0.6,
20959
21363
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -21278,6 +21682,7 @@ function CdlStage({
21278
21682
  node,
21279
21683
  active: activeSet.has(node.id),
21280
21684
  lang: laid.lang,
21685
+ textMetrics: laid.textMetrics,
21281
21686
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3: \u7BB1\u306E\u53D7\u3051\u53E3,
21282
21687
  drawing: \u63CF\u304F,
21283
21688
  progress: \u63CF\u304F ? \u63CF\u304F\u9032\u307F : progress,
@@ -21294,7 +21699,8 @@ function CdlStage({
21294
21699
  CdlEdgeLabelView,
21295
21700
  {
21296
21701
  edge,
21297
- active: activeSet.has(edge.id)
21702
+ active: activeSet.has(edge.id),
21703
+ textMetrics: laid.textMetrics
21298
21704
  },
21299
21705
  `label-${edge.id}`
21300
21706
  )),
@@ -21304,7 +21710,8 @@ function CdlStage({
21304
21710
  {
21305
21711
  edge,
21306
21712
  active: activeSet.has(edge.id),
21307
- \u7AEF
21713
+ \u7AEF,
21714
+ textMetrics: laid.textMetrics
21308
21715
  },
21309
21716
  `${\u7AEF}-label-${edge.id}`
21310
21717
  ))
@@ -22369,7 +22776,15 @@ function useInteractiveIntegration(diagram, options = {}) {
22369
22776
  f.id
22370
22777
  )) }),
22371
22778
  scrolls.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cdl-ip-group", children: scrolls.map((s) => /* @__PURE__ */ jsxRuntime.jsx(ScrollReadout, { id: s.id, name: s.label || s.id, progress: stateOverrides[s.id] }, s.id)) }),
22372
- readouts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsxRuntime.jsx(ReadoutWidget, { readout: r, stateOverrides: mergedStateValues }, r.id)) })
22779
+ readouts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
22780
+ ReadoutWidget,
22781
+ {
22782
+ readout: r,
22783
+ stateOverrides: mergedStateValues,
22784
+ textMetrics: resolveTextMetrics(diagram.textMetrics)
22785
+ },
22786
+ r.id
22787
+ )) })
22373
22788
  ] }) })
22374
22789
  );
22375
22790
  }, [diagram, signals, stateOverrides, mergedStateValues]);
@@ -22790,7 +23205,8 @@ function StepperWidget({
22790
23205
  }
22791
23206
  function ReadoutWidget({
22792
23207
  readout,
22793
- stateOverrides
23208
+ stateOverrides,
23209
+ textMetrics = "proportional"
22794
23210
  }) {
22795
23211
  const rawValue = "source" in readout ? stateOverrides[readout.source] : void 0;
22796
23212
  const numericValue = typeof rawValue === "number" ? rawValue : typeof rawValue === "string" ? Number(rawValue) : Number.NaN;
@@ -23038,7 +23454,8 @@ function ReadoutWidget({
23038
23454
  max: readout.max,
23039
23455
  viewW: readout.viewW ?? 280,
23040
23456
  viewH: readout.viewH ?? 60,
23041
- color: readout.color ?? "#2563eb"
23457
+ color: readout.color ?? "#2563eb",
23458
+ textMetrics
23042
23459
  }
23043
23460
  );
23044
23461
  case "radar": {
@@ -23854,7 +24271,8 @@ function ReadoutWidget({
23854
24271
  { status: "idle", color: "#94a3b8" },
23855
24272
  { status: "error", color: "#ef4444" }
23856
24273
  ],
23857
- max: readout.max ?? 10
24274
+ max: readout.max ?? 10,
24275
+ textMetrics
23858
24276
  }
23859
24277
  );
23860
24278
  case "calendar-week":
@@ -24998,8 +25416,8 @@ function ProgressGroupReadout({
24998
25416
  }) })
24999
25417
  ] });
25000
25418
  }
25001
- function sequenceLabelAnchor(x, name, fontSize, viewW) {
25002
- const half = textWidth(name, fontSize) / 2;
25419
+ function sequenceLabelAnchor(x, name, fontSize, viewW, textMetrics = "proportional") {
25420
+ const half = textWidth(name, fontSize, 0, textMetrics) / 2;
25003
25421
  if (x - half < 0) return "start";
25004
25422
  if (x + half > viewW) return "end";
25005
25423
  return "middle";
@@ -25012,7 +25430,8 @@ function SequenceTimelineReadout({
25012
25430
  max,
25013
25431
  viewW,
25014
25432
  viewH,
25015
- color
25433
+ color,
25434
+ textMetrics = "proportional"
25016
25435
  }) {
25017
25436
  const events = [];
25018
25437
  const trimmed = value.trim();
@@ -25055,7 +25474,17 @@ function SequenceTimelineReadout({
25055
25474
  const x = xFor(e.t);
25056
25475
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-event-marker": e.name, children: [
25057
25476
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x, cy: trackY, r: 5, fill: color, stroke: "#fff", strokeWidth: 1.5, children: /* @__PURE__ */ jsxRuntime.jsx(\u5B57\u306E\u898B\u51FA\u3057, { k: "readout.sequenceTimeline.title", v: { name: e.name, t: e.t } }) }),
25058
- /* @__PURE__ */ jsxRuntime.jsx("text", { x, y: trackY - 12, textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW), fontSize: 10, fill: "var(--v4-ink, #1a1f2a)", children: e.name }),
25477
+ /* @__PURE__ */ jsxRuntime.jsx(
25478
+ "text",
25479
+ {
25480
+ x,
25481
+ y: trackY - 12,
25482
+ textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW, textMetrics),
25483
+ fontSize: 10,
25484
+ fill: "var(--v4-ink, #1a1f2a)",
25485
+ children: e.name
25486
+ }
25487
+ ),
25059
25488
  /* @__PURE__ */ jsxRuntime.jsx("text", { x, y: trackY + 18, textAnchor: "middle", fontSize: 9, fill: "var(--v4-mute, #64748b)", children: e.t })
25060
25489
  ] }, i);
25061
25490
  })
@@ -28132,7 +28561,8 @@ function StatusTimelineReadout({
28132
28561
  label,
28133
28562
  value,
28134
28563
  colorMap,
28135
- max
28564
+ max,
28565
+ textMetrics = "proportional"
28136
28566
  }) {
28137
28567
  const events = [];
28138
28568
  const trimmed = value.trim();
@@ -28157,6 +28587,7 @@ function StatusTimelineReadout({
28157
28587
  const cellW = shown.length > 0 ? (width - 20) / shown.length : 0;
28158
28588
  const height = stripHeight + 40;
28159
28589
  const \u533A\u9593\u306E\u5B57 = (status) => status === "active" || status === "idle" || status === "error" ? \u5F15\u304F(`readout.statusTimeline.${status}`) : status.toUpperCase();
28590
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
28160
28591
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cdl-ip-item cdl-ip-readout-status-timeline", "data-cdl-readout": id, children: [
28161
28592
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cdl-ip-label", children: label }),
28162
28593
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -28170,7 +28601,7 @@ function StatusTimelineReadout({
28170
28601
  const x = 10 + i * cellW;
28171
28602
  const c = colorLookup.get(ev.status) ?? "#cbd5e1";
28172
28603
  const \u5B572 = \u533A\u9593\u306E\u5B57(ev.status);
28173
- const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8);
28604
+ const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8, \u6E2C\u308B);
28174
28605
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-status-event": i, "data-cdl-status": ev.status, children: [
28175
28606
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x, y: 10, width: cellW - 2, height: stripHeight, fill: c, rx: 2 }),
28176
28607
  /* @__PURE__ */ jsxRuntime.jsxs(