@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/index.cjs CHANGED
@@ -712,6 +712,11 @@ function \u5B57\u3092\u5DEE\u3057\u8FBC\u3080(template, values) {
712
712
  return template.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole);
713
713
  }
714
714
 
715
+ // src/text-metrics.ts
716
+ function resolveTextMetrics(value) {
717
+ return value === "monospace" ? "monospace" : "proportional";
718
+ }
719
+
715
720
  // src/formula/ast.ts
716
721
  var ALLOWED_MATH_FNS = /* @__PURE__ */ new Set([
717
722
  "min",
@@ -1650,13 +1655,215 @@ function \u5024\u3092\u540D\u524D\u3067\u8AAD\u3080(\u5165\u529B\u6B04, \u5024)
1650
1655
  return \u5024.split(",").map((v) => \u5165\u529B\u6B04.\u540D\u524D.get(v) ?? v).join(",");
1651
1656
  }
1652
1657
 
1658
+ // src/layout/text-width.ts
1659
+ var INTER_BOLD_ADVANCE_EM = {
1660
+ // uppercase (実測係数化、 Inter Bold 仕様 × 1.20)
1661
+ A: 0.86,
1662
+ B: 0.86,
1663
+ C: 0.88,
1664
+ D: 0.93,
1665
+ E: 0.82,
1666
+ F: 0.79,
1667
+ G: 0.94,
1668
+ H: 0.92,
1669
+ I: 0.44,
1670
+ J: 0.66,
1671
+ K: 0.86,
1672
+ L: 0.74,
1673
+ M: 1.12,
1674
+ N: 0.94,
1675
+ O: 0.94,
1676
+ P: 0.85,
1677
+ Q: 0.94,
1678
+ R: 0.87,
1679
+ S: 0.79,
1680
+ T: 0.82,
1681
+ U: 0.91,
1682
+ V: 0.85,
1683
+ W: 1.22,
1684
+ X: 0.85,
1685
+ Y: 0.82,
1686
+ Z: 0.82,
1687
+ // lowercase (実測係数化、 Inter Bold 仕様 × 1.22)
1688
+ a: 0.73,
1689
+ b: 0.77,
1690
+ c: 0.68,
1691
+ d: 0.77,
1692
+ e: 0.73,
1693
+ f: 0.51,
1694
+ g: 0.76,
1695
+ h: 0.77,
1696
+ i: 0.39,
1697
+ j: 0.41,
1698
+ k: 0.73,
1699
+ l: 0.39,
1700
+ m: 1.15,
1701
+ n: 0.77,
1702
+ o: 0.76,
1703
+ p: 0.77,
1704
+ q: 0.77,
1705
+ r: 0.54,
1706
+ s: 0.65,
1707
+ t: 0.54,
1708
+ u: 0.77,
1709
+ v: 0.71,
1710
+ w: 1.05,
1711
+ x: 0.71,
1712
+ y: 0.71,
1713
+ z: 0.66,
1714
+ // digits (Inter Bold tabular-nums、 実測係数化 × 1.20)
1715
+ "0": 0.72,
1716
+ "1": 0.72,
1717
+ "2": 0.72,
1718
+ "3": 0.72,
1719
+ "4": 0.72,
1720
+ "5": 0.72,
1721
+ "6": 0.72,
1722
+ "7": 0.72,
1723
+ "8": 0.72,
1724
+ "9": 0.72,
1725
+ // ascii symbols (実測係数化 × 1.15、 punct 系は kerning が広く効くため 1.20)
1726
+ " ": 0.35,
1727
+ "!": 0.44,
1728
+ '"': 0.59,
1729
+ "#": 0.78,
1730
+ "$": 0.72,
1731
+ "%": 1,
1732
+ "&": 0.86,
1733
+ "'": 0.32,
1734
+ "(": 0.46,
1735
+ ")": 0.46,
1736
+ "*": 0.63,
1737
+ "+": 0.78,
1738
+ ",": 0.36,
1739
+ "-": 0.5,
1740
+ ".": 0.36,
1741
+ "/": 0.51,
1742
+ ":": 0.36,
1743
+ ";": 0.36,
1744
+ "<": 0.78,
1745
+ "=": 0.78,
1746
+ ">": 0.78,
1747
+ "?": 0.63,
1748
+ "@": 1.17,
1749
+ "[": 0.48,
1750
+ "\\": 0.51,
1751
+ "]": 0.48,
1752
+ "^": 0.63,
1753
+ "_": 0.63,
1754
+ "`": 0.48,
1755
+ "{": 0.52,
1756
+ "|": 0.37,
1757
+ "}": 0.52,
1758
+ "~": 0.78
1759
+ };
1760
+ var JETBRAINS_MONO_ADVANCE_EM = 0.63;
1761
+ function isCJK(code) {
1762
+ return code >= 12288 && code <= 12543 || // CJK symbols / hiragana / katakana
1763
+ code >= 13312 && code <= 40959 || // CJK ideographs
1764
+ code >= 63744 && code <= 64255 || // CJK compat ideographs
1765
+ code >= 65281 && code <= 65376 || // fullwidth ASCII
1766
+ code >= 65504 && code <= 65510;
1767
+ }
1768
+ function isHalfwidthKana(code) {
1769
+ return code >= 65377 && code <= 65500;
1770
+ }
1771
+ var EMOJI_ADVANCE_EM = 1.05;
1772
+ var MONO_EMOJI_ADVANCE_EM = 1.16;
1773
+ var DRAWN_CJK_RATIO = 1.08;
1774
+ var DRAWN_ASCII_RATIO = 1.16;
1775
+ function isAscii(code) {
1776
+ return code < 128;
1777
+ }
1778
+ var WIDE_SYMBOL_ADVANCE_EM = 0.95;
1779
+ function isEmoji(code) {
1780
+ return code >= 126976 && code <= 129791 || // 絵文字の主要面
1781
+ code >= 9728 && code <= 10175 || // 記号と絵文字 (♻ ✅ ❤ 等)
1782
+ code >= 127462 && code <= 127487;
1783
+ }
1784
+ function isEmojiGrapheme(grapheme, firstCode) {
1785
+ return isEmoji(firstCode) || grapheme.includes("\uFE0F");
1786
+ }
1787
+ function isWideSymbol(code) {
1788
+ return code >= 8592 && code <= 8703 || // 矢印
1789
+ code >= 9472 && code <= 9599 || // 罫線
1790
+ code >= 9632 && code <= 9727 || // 幾何図形
1791
+ code >= 11008 && code <= 11263;
1792
+ }
1793
+ var CLUSTER_JOINER_RE = /\u200d|\ufe0f|[\u{1f000}-\u{1faff}]|[\u{2600}-\u{27bf}]/u;
1794
+ var \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B;
1795
+ function segmentGraphemes(text) {
1796
+ if (typeof Intl === "undefined" || typeof Intl.Segmenter !== "function") {
1797
+ return [...text];
1798
+ }
1799
+ \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B ??= new Intl.Segmenter(void 0, { granularity: "grapheme" });
1800
+ return [...\u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B.segment(text)].map((s) => s.segment);
1801
+ }
1802
+ function defaultAdvanceEm(ch, code) {
1803
+ if (isEmoji(code)) return EMOJI_ADVANCE_EM;
1804
+ if (isWideSymbol(code)) return WIDE_SYMBOL_ADVANCE_EM;
1805
+ if (isCJK(code)) return 1.08;
1806
+ if (isHalfwidthKana(code)) return 0.72;
1807
+ if (ch >= "a" && ch <= "z") return 0.73;
1808
+ if (ch >= "A" && ch <= "Z") return 0.86;
1809
+ if (ch >= "0" && ch <= "9") return 0.72;
1810
+ return 0.65;
1811
+ }
1812
+ function measureAdvanceWidth(text, opts = {}) {
1813
+ const fontSize = opts.fontSize ?? 22;
1814
+ const letterSpacing = opts.letterSpacing ?? 0;
1815
+ const fontFamily = opts.textMetrics === "monospace" ? "mono" : opts.fontFamily ?? "sans";
1816
+ const bound = opts.bound ?? "layout";
1817
+ let advanceEmSum = 0;
1818
+ let charCount = 0;
1819
+ const \u6587\u5B57\u5217 = CLUSTER_JOINER_RE.test(text) ? segmentGraphemes(text) : [...text];
1820
+ for (const ch of \u6587\u5B57\u5217) {
1821
+ charCount++;
1822
+ const code = ch.codePointAt(0) ?? 0;
1823
+ const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) && fontFamily !== "mono" ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
1824
+ if (isEmojiGrapheme(ch, code)) {
1825
+ advanceEmSum += fontFamily === "mono" ? MONO_EMOJI_ADVANCE_EM : EMOJI_ADVANCE_EM;
1826
+ continue;
1827
+ }
1828
+ if (fontFamily === "mono") {
1829
+ advanceEmSum += (isCJK(code) ? 1.08 : JETBRAINS_MONO_ADVANCE_EM) / \u5272\u308A\u623B\u3057;
1830
+ continue;
1831
+ }
1832
+ if (isCJK(code)) {
1833
+ advanceEmSum += 1.08 / \u5272\u308A\u623B\u3057;
1834
+ continue;
1835
+ }
1836
+ const table = ch.length === 1 ? INTER_BOLD_ADVANCE_EM[ch] : void 0;
1837
+ advanceEmSum += (table !== void 0 ? table : defaultAdvanceEm(ch, code)) / \u5272\u308A\u623B\u3057;
1838
+ }
1839
+ return advanceEmSum * fontSize + letterSpacing * charCount;
1840
+ }
1841
+ function measureTextWidth(text, opts = {}) {
1842
+ const fontSize = opts.fontSize ?? 22;
1843
+ const bound = opts.bound ?? "layout";
1844
+ const w = measureAdvanceWidth(text, opts);
1845
+ return bound === "drawn" ? w : Math.max(w, fontSize * 1.2);
1846
+ }
1847
+ function \u53CE\u3081\u308B\u500D\u7387(text, opts, \u5E45) {
1848
+ if (!(\u5E45 > 0) || !(opts.fontSize > 0)) return 1;
1849
+ const \u5B9F\u5E45 = measureTextWidth(text, { ...opts, letterSpacing: 0 });
1850
+ return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
1851
+ }
1852
+
1653
1853
  // src/kinds/text-width.ts
1654
1854
  var WIDE_RATIO = 1.04;
1655
1855
  var NARROW_RATIO = 0.37;
1656
1856
  var ASCII_RATIO = 0.86;
1657
1857
  var WIDE_CHARS = "W@%Mm";
1658
1858
  var NARROW_CHARS = "ijlI.,:;'! ";
1659
- function textWidth(s, size, \u5B57\u9001\u308A = 0) {
1859
+ function textWidth(s, size, \u5B57\u9001\u308A = 0, textMetrics = "proportional") {
1860
+ if (textMetrics === "monospace") {
1861
+ return measureAdvanceWidth(s, {
1862
+ fontSize: size,
1863
+ letterSpacing: \u5B57\u9001\u308A,
1864
+ fontFamily: "mono"
1865
+ });
1866
+ }
1660
1867
  let \u5E45 = 0;
1661
1868
  let \u5B57\u6570 = 0;
1662
1869
  for (const c of s) {
@@ -1693,8 +1900,8 @@ function splitRow(row) {
1693
1900
  }
1694
1901
  return { left: row.trim(), right: "", split: false };
1695
1902
  }
1696
- function rowColumnWidth(text, size, mono) {
1697
- return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size);
1903
+ function rowColumnWidth(text, size, mono, textMetrics = "proportional") {
1904
+ return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size, 0, textMetrics);
1698
1905
  }
1699
1906
  function displayWidth(text) {
1700
1907
  let w = 0;
@@ -1720,12 +1927,12 @@ function \u6841\u3067\u7701\u304F(text, \u4E0A\u9650) {
1720
1927
  if (displayWidth(text) <= \u4E0A\u9650) return text;
1721
1928
  return `${\u6841\u3067\u5272\u308B(text, \u4E0A\u9650 - 1)[0]}\u2026`;
1722
1929
  }
1723
- function requiredRowsWidth(rows, kind) {
1930
+ function requiredRowsWidth(rows, kind, textMetrics = "proportional") {
1724
1931
  if (!rows || rows.length === 0) return 0;
1725
1932
  const splits = rows.map(splitRow);
1726
1933
  const \u4E00\u756A\u5E83\u3044 = (\u53D6\u308B) => splits.reduce((m, s) => Math.max(m, \u53D6\u308B(s)), 0);
1727
- 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;
1728
- 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;
1934
+ 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;
1935
+ 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;
1729
1936
  if (kind === void 0) return Math.ceil(Math.max(storage, generic));
1730
1937
  return Math.ceil(kind === "storage" ? storage : generic);
1731
1938
  }
@@ -1790,7 +1997,10 @@ var \u5DE6\u53F3\u306E\u4F59\u767D = 8;
1790
1997
  function \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45) {
1791
1998
  return \u7BB1\u306E\u5E45 - \u5DE6\u53F3\u306E\u4F59\u767D * 2;
1792
1999
  }
1793
- function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
2000
+ function \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics = "proportional") {
2001
+ return (text, fontSize) => textWidth(text, fontSize, 0, textMetrics);
2002
+ }
2003
+ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
1794
2004
  if (\u4F7F\u3048\u308B\u5E452 <= 0) return "";
1795
2005
  if (\u6E2C\u308B(text, fontSize) <= \u4F7F\u3048\u308B\u5E452) return text;
1796
2006
  const \u7701\u7565 = "\u2026";
@@ -1807,7 +2017,7 @@ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6
1807
2017
  return `${\u51FA}${\u7701\u7565}`;
1808
2018
  }
1809
2019
  var \u7E2E\u3081\u306E\u4E0B\u9650 = MIN_TEXT_SIZE;
1810
- function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
2020
+ function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
1811
2021
  let size = fontSize;
1812
2022
  while (size > \u7E2E\u3081\u306E\u4E0B\u9650 && \u6E2C\u308B(text, size) > \u4F7F\u3048\u308B\u5E452) size -= 1;
1813
2023
  return { text: \u5E45\u3067\u5207\u308B(text, size, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B), fontSize: size };
@@ -1817,7 +2027,7 @@ function \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text) {
1817
2027
  if (typeof \u533A\u5207\u308A !== "function") return [...text];
1818
2028
  return [...new \u533A\u5207\u308A(void 0, { granularity: "grapheme" }).segment(text)].map((g) => g.segment);
1819
2029
  }
1820
- function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553) {
2030
+ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553, \u6E2C\u308B) {
1821
2031
  const \u5019\u88DC = \u884C.filter((r, i) => i === 0 || r.text.trim() !== "");
1822
2032
  if (\u5019\u88DC.length === 0) return [];
1823
2033
  const \u4F7F\u3048\u308B\u9AD8\u3055 = \u7BB1\u306E\u9AD8\u30553 - \u4E0A\u4E0B\u306E\u4F59\u767D * 2;
@@ -1825,7 +2035,7 @@ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8
1825
2035
  const \u6B8B\u3059 = [...\u5019\u88DC];
1826
2036
  while (\u6B8B\u3059.length > 1 && \u9AD8\u3055(\u6B8B\u3059) > \u4F7F\u3048\u308B\u9AD8\u3055) \u6B8B\u3059.pop();
1827
2037
  const \u5E45 = \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45);
1828
- const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45) }));
2038
+ const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45, \u6E2C\u308B) }));
1829
2039
  const \u7DCF\u9AD8 = \u9AD8\u3055(\u53CE\u3081\u305F);
1830
2040
  let \u7A4D\u307F = -\u7DCF\u9AD8 / 2;
1831
2041
  return \u53CE\u3081\u305F.map((r) => {
@@ -2182,7 +2392,15 @@ function useInteractiveIntegration(diagram2, options = {}) {
2182
2392
  f.id
2183
2393
  )) }),
2184
2394
  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)) }),
2185
- 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)) })
2395
+ readouts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
2396
+ ReadoutWidget,
2397
+ {
2398
+ readout: r,
2399
+ stateOverrides: mergedStateValues,
2400
+ textMetrics: resolveTextMetrics(diagram2.textMetrics)
2401
+ },
2402
+ r.id
2403
+ )) })
2186
2404
  ] }) })
2187
2405
  );
2188
2406
  }, [diagram2, signals, stateOverrides, mergedStateValues]);
@@ -2603,7 +2821,8 @@ function StepperWidget({
2603
2821
  }
2604
2822
  function ReadoutWidget({
2605
2823
  readout,
2606
- stateOverrides
2824
+ stateOverrides,
2825
+ textMetrics = "proportional"
2607
2826
  }) {
2608
2827
  const rawValue = "source" in readout ? stateOverrides[readout.source] : void 0;
2609
2828
  const numericValue = typeof rawValue === "number" ? rawValue : typeof rawValue === "string" ? Number(rawValue) : Number.NaN;
@@ -2851,7 +3070,8 @@ function ReadoutWidget({
2851
3070
  max: readout.max,
2852
3071
  viewW: readout.viewW ?? 280,
2853
3072
  viewH: readout.viewH ?? 60,
2854
- color: readout.color ?? "#2563eb"
3073
+ color: readout.color ?? "#2563eb",
3074
+ textMetrics
2855
3075
  }
2856
3076
  );
2857
3077
  case "radar": {
@@ -3667,7 +3887,8 @@ function ReadoutWidget({
3667
3887
  { status: "idle", color: "#94a3b8" },
3668
3888
  { status: "error", color: "#ef4444" }
3669
3889
  ],
3670
- max: readout.max ?? 10
3890
+ max: readout.max ?? 10,
3891
+ textMetrics
3671
3892
  }
3672
3893
  );
3673
3894
  case "calendar-week":
@@ -4811,8 +5032,8 @@ function ProgressGroupReadout({
4811
5032
  }) })
4812
5033
  ] });
4813
5034
  }
4814
- function sequenceLabelAnchor(x, name, fontSize, viewW) {
4815
- const half = textWidth(name, fontSize) / 2;
5035
+ function sequenceLabelAnchor(x, name, fontSize, viewW, textMetrics = "proportional") {
5036
+ const half = textWidth(name, fontSize, 0, textMetrics) / 2;
4816
5037
  if (x - half < 0) return "start";
4817
5038
  if (x + half > viewW) return "end";
4818
5039
  return "middle";
@@ -4825,7 +5046,8 @@ function SequenceTimelineReadout({
4825
5046
  max,
4826
5047
  viewW,
4827
5048
  viewH,
4828
- color
5049
+ color,
5050
+ textMetrics = "proportional"
4829
5051
  }) {
4830
5052
  const events = [];
4831
5053
  const trimmed = value.trim();
@@ -4868,7 +5090,17 @@ function SequenceTimelineReadout({
4868
5090
  const x = xFor(e.t);
4869
5091
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-event-marker": e.name, children: [
4870
5092
  /* @__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 } }) }),
4871
- /* @__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 }),
5093
+ /* @__PURE__ */ jsxRuntime.jsx(
5094
+ "text",
5095
+ {
5096
+ x,
5097
+ y: trackY - 12,
5098
+ textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW, textMetrics),
5099
+ fontSize: 10,
5100
+ fill: "var(--v4-ink, #1a1f2a)",
5101
+ children: e.name
5102
+ }
5103
+ ),
4872
5104
  /* @__PURE__ */ jsxRuntime.jsx("text", { x, y: trackY + 18, textAnchor: "middle", fontSize: 9, fill: "var(--v4-mute, #64748b)", children: e.t })
4873
5105
  ] }, i);
4874
5106
  })
@@ -7945,7 +8177,8 @@ function StatusTimelineReadout({
7945
8177
  label,
7946
8178
  value,
7947
8179
  colorMap,
7948
- max
8180
+ max,
8181
+ textMetrics = "proportional"
7949
8182
  }) {
7950
8183
  const events = [];
7951
8184
  const trimmed = value.trim();
@@ -7970,6 +8203,7 @@ function StatusTimelineReadout({
7970
8203
  const cellW = shown.length > 0 ? (width - 20) / shown.length : 0;
7971
8204
  const height = stripHeight + 40;
7972
8205
  const \u533A\u9593\u306E\u5B57 = (status) => status === "active" || status === "idle" || status === "error" ? \u5F15\u304F(`readout.statusTimeline.${status}`) : status.toUpperCase();
8206
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
7973
8207
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cdl-ip-item cdl-ip-readout-status-timeline", "data-cdl-readout": id, children: [
7974
8208
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cdl-ip-label", children: label }),
7975
8209
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -7983,7 +8217,7 @@ function StatusTimelineReadout({
7983
8217
  const x = 10 + i * cellW;
7984
8218
  const c = colorLookup.get(ev.status) ?? "#cbd5e1";
7985
8219
  const \u5B572 = \u533A\u9593\u306E\u5B57(ev.status);
7986
- const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8);
8220
+ const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8, \u6E2C\u308B);
7987
8221
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-status-event": i, "data-cdl-status": ev.status, children: [
7988
8222
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x, y: 10, width: cellW - 2, height: stripHeight, fill: c, rx: 2 }),
7989
8223
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -12094,6 +12328,8 @@ function diagram(id, options) {
12094
12328
  ...options.palette !== void 0 ? { palette: options.palette } : {},
12095
12329
  // 言語も素通しする。 型の外の値を既定に落とすのは `layout` の 1 箇所に置く
12096
12330
  ...options.lang !== void 0 ? { lang: options.lang } : {},
12331
+ // 字幅の測り方も素通しする。型の外の値を既定に落とすのは `layout` の 1 箇所に置く
12332
+ ...options.textMetrics !== void 0 ? { textMetrics: options.textMetrics } : {},
12097
12333
  // 種類の名前も同じ経路で渡し、空文字の扱いを `layout` の 1 箇所に揃える
12098
12334
  ...options.type !== void 0 ? { type: options.type } : {},
12099
12335
  // inputs / formulas / scrollTriggers / eventBindings は空なら省略 (static diagram の JSON 形状維持)
@@ -12126,196 +12362,6 @@ var ARROW_ANGLE_MAX_DEG = 100;
12126
12362
  var FAN_GAP = 120;
12127
12363
  var DETOUR_GAP = 94;
12128
12364
 
12129
- // src/layout/text-width.ts
12130
- var INTER_BOLD_ADVANCE_EM = {
12131
- // uppercase (実測係数化、 Inter Bold 仕様 × 1.20)
12132
- A: 0.86,
12133
- B: 0.86,
12134
- C: 0.88,
12135
- D: 0.93,
12136
- E: 0.82,
12137
- F: 0.79,
12138
- G: 0.94,
12139
- H: 0.92,
12140
- I: 0.44,
12141
- J: 0.66,
12142
- K: 0.86,
12143
- L: 0.74,
12144
- M: 1.12,
12145
- N: 0.94,
12146
- O: 0.94,
12147
- P: 0.85,
12148
- Q: 0.94,
12149
- R: 0.87,
12150
- S: 0.79,
12151
- T: 0.82,
12152
- U: 0.91,
12153
- V: 0.85,
12154
- W: 1.22,
12155
- X: 0.85,
12156
- Y: 0.82,
12157
- Z: 0.82,
12158
- // lowercase (実測係数化、 Inter Bold 仕様 × 1.22)
12159
- a: 0.73,
12160
- b: 0.77,
12161
- c: 0.68,
12162
- d: 0.77,
12163
- e: 0.73,
12164
- f: 0.51,
12165
- g: 0.76,
12166
- h: 0.77,
12167
- i: 0.39,
12168
- j: 0.41,
12169
- k: 0.73,
12170
- l: 0.39,
12171
- m: 1.15,
12172
- n: 0.77,
12173
- o: 0.76,
12174
- p: 0.77,
12175
- q: 0.77,
12176
- r: 0.54,
12177
- s: 0.65,
12178
- t: 0.54,
12179
- u: 0.77,
12180
- v: 0.71,
12181
- w: 1.05,
12182
- x: 0.71,
12183
- y: 0.71,
12184
- z: 0.66,
12185
- // digits (Inter Bold tabular-nums、 実測係数化 × 1.20)
12186
- "0": 0.72,
12187
- "1": 0.72,
12188
- "2": 0.72,
12189
- "3": 0.72,
12190
- "4": 0.72,
12191
- "5": 0.72,
12192
- "6": 0.72,
12193
- "7": 0.72,
12194
- "8": 0.72,
12195
- "9": 0.72,
12196
- // ascii symbols (実測係数化 × 1.15、 punct 系は kerning が広く効くため 1.20)
12197
- " ": 0.35,
12198
- "!": 0.44,
12199
- '"': 0.59,
12200
- "#": 0.78,
12201
- "$": 0.72,
12202
- "%": 1,
12203
- "&": 0.86,
12204
- "'": 0.32,
12205
- "(": 0.46,
12206
- ")": 0.46,
12207
- "*": 0.63,
12208
- "+": 0.78,
12209
- ",": 0.36,
12210
- "-": 0.5,
12211
- ".": 0.36,
12212
- "/": 0.51,
12213
- ":": 0.36,
12214
- ";": 0.36,
12215
- "<": 0.78,
12216
- "=": 0.78,
12217
- ">": 0.78,
12218
- "?": 0.63,
12219
- "@": 1.17,
12220
- "[": 0.48,
12221
- "\\": 0.51,
12222
- "]": 0.48,
12223
- "^": 0.63,
12224
- "_": 0.63,
12225
- "`": 0.48,
12226
- "{": 0.52,
12227
- "|": 0.37,
12228
- "}": 0.52,
12229
- "~": 0.78
12230
- };
12231
- var JETBRAINS_MONO_ADVANCE_EM = 0.63;
12232
- function isCJK(code) {
12233
- return code >= 12288 && code <= 12543 || // CJK symbols / hiragana / katakana
12234
- code >= 13312 && code <= 40959 || // CJK ideographs
12235
- code >= 63744 && code <= 64255 || // CJK compat ideographs
12236
- code >= 65281 && code <= 65376 || // fullwidth ASCII
12237
- code >= 65504 && code <= 65510;
12238
- }
12239
- function isHalfwidthKana(code) {
12240
- return code >= 65377 && code <= 65500;
12241
- }
12242
- var EMOJI_ADVANCE_EM = 1.05;
12243
- var MONO_EMOJI_ADVANCE_EM = 1.16;
12244
- var DRAWN_CJK_RATIO = 1.08;
12245
- var DRAWN_ASCII_RATIO = 1.16;
12246
- function isAscii(code) {
12247
- return code < 128;
12248
- }
12249
- var WIDE_SYMBOL_ADVANCE_EM = 0.95;
12250
- function isEmoji(code) {
12251
- return code >= 126976 && code <= 129791 || // 絵文字の主要面
12252
- code >= 9728 && code <= 10175 || // 記号と絵文字 (♻ ✅ ❤ 等)
12253
- code >= 127462 && code <= 127487;
12254
- }
12255
- function isEmojiGrapheme(grapheme, firstCode) {
12256
- return isEmoji(firstCode) || grapheme.includes("\uFE0F");
12257
- }
12258
- function isWideSymbol(code) {
12259
- return code >= 8592 && code <= 8703 || // 矢印
12260
- code >= 9472 && code <= 9599 || // 罫線
12261
- code >= 9632 && code <= 9727 || // 幾何図形
12262
- code >= 11008 && code <= 11263;
12263
- }
12264
- var CLUSTER_JOINER_RE = /\u200d|\ufe0f|[\u{1f000}-\u{1faff}]|[\u{2600}-\u{27bf}]/u;
12265
- var \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B;
12266
- function segmentGraphemes(text) {
12267
- if (typeof Intl === "undefined" || typeof Intl.Segmenter !== "function") {
12268
- return [...text];
12269
- }
12270
- \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B ??= new Intl.Segmenter(void 0, { granularity: "grapheme" });
12271
- return [...\u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B.segment(text)].map((s) => s.segment);
12272
- }
12273
- function defaultAdvanceEm(ch, code) {
12274
- if (isEmoji(code)) return EMOJI_ADVANCE_EM;
12275
- if (isWideSymbol(code)) return WIDE_SYMBOL_ADVANCE_EM;
12276
- if (isCJK(code)) return 1.08;
12277
- if (isHalfwidthKana(code)) return 0.72;
12278
- if (ch >= "a" && ch <= "z") return 0.73;
12279
- if (ch >= "A" && ch <= "Z") return 0.86;
12280
- if (ch >= "0" && ch <= "9") return 0.72;
12281
- return 0.65;
12282
- }
12283
- function measureTextWidth(text, opts = {}) {
12284
- const fontSize = opts.fontSize ?? 22;
12285
- const letterSpacing = opts.letterSpacing ?? 0;
12286
- const fontFamily = opts.fontFamily ?? "sans";
12287
- const bound = opts.bound ?? "layout";
12288
- let advanceEmSum = 0;
12289
- let charCount = 0;
12290
- const \u6587\u5B57\u5217 = CLUSTER_JOINER_RE.test(text) ? segmentGraphemes(text) : [...text];
12291
- for (const ch of \u6587\u5B57\u5217) {
12292
- charCount++;
12293
- const code = ch.codePointAt(0) ?? 0;
12294
- const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
12295
- if (isEmojiGrapheme(ch, code)) {
12296
- advanceEmSum += fontFamily === "mono" ? MONO_EMOJI_ADVANCE_EM : EMOJI_ADVANCE_EM;
12297
- continue;
12298
- }
12299
- if (fontFamily === "mono") {
12300
- advanceEmSum += (isCJK(code) ? 1.08 : JETBRAINS_MONO_ADVANCE_EM) / \u5272\u308A\u623B\u3057;
12301
- continue;
12302
- }
12303
- if (isCJK(code)) {
12304
- advanceEmSum += 1.08 / \u5272\u308A\u623B\u3057;
12305
- continue;
12306
- }
12307
- const table = ch.length === 1 ? INTER_BOLD_ADVANCE_EM[ch] : void 0;
12308
- advanceEmSum += (table !== void 0 ? table : defaultAdvanceEm(ch, code)) / \u5272\u308A\u623B\u3057;
12309
- }
12310
- const w = advanceEmSum * fontSize + letterSpacing * charCount;
12311
- return bound === "drawn" ? w : Math.max(w, fontSize * 1.2);
12312
- }
12313
- function \u53CE\u3081\u308B\u500D\u7387(text, opts, \u5E45) {
12314
- if (!(\u5E45 > 0) || !(opts.fontSize > 0)) return 1;
12315
- const \u5B9F\u5E45 = measureTextWidth(text, { ...opts, letterSpacing: 0 });
12316
- return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
12317
- }
12318
-
12319
12365
  // src/label-text.ts
12320
12366
  var EDGE_LABEL_TEXT = {
12321
12367
  // main 行は family を指定せず、 host 側の指定を継承する。
@@ -12675,15 +12721,22 @@ function requiredVerticalLabelGap(pillHs) {
12675
12721
  const step = parallelLabelStepY(pillHs);
12676
12722
  return (pillHs.length - 1) * step + Math.max(first, last) + CLEARANCE_NODE_LABEL * 2;
12677
12723
  }
12678
- function computeLabelBoxW(label, sub) {
12679
- const mainW = measureTextWidth(label ?? "", { fontSize: EDGE_LABEL_TEXT.main.fontSize });
12680
- const subW = sub ? measureTextWidth(sub, { fontSize: EDGE_LABEL_TEXT.sub.fontSize, fontFamily: "mono" }) : 0;
12724
+ function computeLabelBoxW(label, sub, textMetrics = "proportional") {
12725
+ const mainW = measureTextWidth(label ?? "", {
12726
+ fontSize: EDGE_LABEL_TEXT.main.fontSize,
12727
+ textMetrics
12728
+ });
12729
+ const subW = sub ? measureTextWidth(sub, {
12730
+ fontSize: EDGE_LABEL_TEXT.sub.fontSize,
12731
+ fontFamily: "mono",
12732
+ textMetrics
12733
+ }) : 0;
12681
12734
  const raw = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
12682
12735
  const EPSILON = 1e-6;
12683
12736
  return Math.ceil((raw - EPSILON) / 2) * 2;
12684
12737
  }
12685
- function computeLabelBBoxWorld(edge) {
12686
- const boxW = computeLabelBoxW(edge.label, edge.sub);
12738
+ function computeLabelBBoxWorld(edge, textMetrics = "proportional") {
12739
+ const boxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
12687
12740
  const boxH = edge.sub ? LABEL_PILL_H_WITH_SUB : LABEL_PILL_H_MAIN_ONLY;
12688
12741
  const anchor = edge.labelAnchor;
12689
12742
  const boxLeftX = anchor === "start" ? 0 : anchor === "end" ? -boxW : -boxW / 2;
@@ -12922,7 +12975,7 @@ function footerShapeDrawTop(node) {
12922
12975
  // src/layout/collisions.ts
12923
12976
  var LANE_LABEL_CLEARANCE_MARGIN = 2;
12924
12977
  var NEAR_MISS_MARGIN = LANE_LABEL_CLEARANCE_MARGIN;
12925
- function collectBBoxes(lanes, nodes, edges) {
12978
+ function collectBBoxes(lanes, nodes, edges, textMetrics = "proportional") {
12926
12979
  const out = [];
12927
12980
  for (const lane of lanes) {
12928
12981
  if (!lane.label) continue;
@@ -12931,7 +12984,7 @@ function collectBBoxes(lanes, nodes, edges) {
12931
12984
  id: lane.id,
12932
12985
  x: lane.x + 16,
12933
12986
  y: lane.y + 8,
12934
- w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2 }) + 24,
12987
+ w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2, textMetrics }) + 24,
12935
12988
  h: 28
12936
12989
  });
12937
12990
  }
@@ -12949,7 +13002,7 @@ function collectBBoxes(lanes, nodes, edges) {
12949
13002
  }
12950
13003
  for (const e of edges) {
12951
13004
  if (!hasRenderedLabel(e)) continue;
12952
- const bbox = computeLabelBBoxWorld(e);
13005
+ const bbox = computeLabelBBoxWorld(e, textMetrics);
12953
13006
  out.push({
12954
13007
  kind: "edge-label",
12955
13008
  id: e.id,
@@ -13647,10 +13700,10 @@ function forEachCandidatePair(bboxes, margin, visit) {
13647
13700
  }
13648
13701
  }
13649
13702
  }
13650
- function resolveEdgeLabelOverlapsWithChain(edges, fixedObstacles, minClearance = 16, maxIter = 20) {
13703
+ function resolveEdgeLabelOverlapsWithChain(edges, fixedObstacles, minClearance = 16, maxIter = 20, textMetrics = "proportional") {
13651
13704
  if (edges.length === 0) return edges;
13652
13705
  const labelBBox = (e, offsetX, offsetY) => {
13653
- const base = computeLabelBBoxWorld(e);
13706
+ const base = computeLabelBBoxWorld(e, textMetrics);
13654
13707
  return {
13655
13708
  kind: "edge-label",
13656
13709
  id: e.id,
@@ -13751,7 +13804,7 @@ function clampShiftMagnitude(shift, maxMagnitude) {
13751
13804
  };
13752
13805
  return { dx: clampAxis(shift.dx), dy: clampAxis(shift.dy) };
13753
13806
  }
13754
- function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE) {
13807
+ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE, textMetrics = "proportional") {
13755
13808
  if (edges.length === 0) {
13756
13809
  return {
13757
13810
  edges,
@@ -13762,7 +13815,7 @@ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClea
13762
13815
  }
13763
13816
  const MAX_ACCUMULATED_SHIFT = CHAIN_SHIFT_MAX_ACCUMULATED;
13764
13817
  const labelBBox = (e, offsetX, offsetY) => {
13765
- const base = computeLabelBBoxWorld(e);
13818
+ const base = computeLabelBBoxWorld(e, textMetrics);
13766
13819
  return {
13767
13820
  kind: "edge-label",
13768
13821
  id: e.id,
@@ -14363,11 +14416,15 @@ var \u5411\u304D\u306E\u9806 = [
14363
14416
  { axis: "x", sign: -1, \u540D\u524D: "\u5DE6" },
14364
14417
  { axis: "x", sign: 1, \u540D\u524D: "\u53F3" }
14365
14418
  ];
14366
- function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles) {
14419
+ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles, textMetrics = "proportional") {
14367
14420
  const edgeById = new Map(edges.map((e) => [e.id, e]));
14368
14421
  const \u81EA\u5206 = edgeById.get(labelId);
14369
14422
  if (!\u81EA\u5206) return null;
14370
- const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({ kind: "edge-label", id: e.id, ...computeLabelBBoxWorld(e) }));
14423
+ const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({
14424
+ kind: "edge-label",
14425
+ id: e.id,
14426
+ ...computeLabelBBoxWorld(e, textMetrics)
14427
+ }));
14371
14428
  const label = labels.find((l) => l.id === labelId);
14372
14429
  if (!label) return null;
14373
14430
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
@@ -14409,7 +14466,7 @@ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B,
14409
14466
  }
14410
14467
  return `\u9003\u3052\u5834\u306A\u3057: ${\u7406\u7531.sort((a, b) => a.\u9806 - b.\u9806).map((r) => r.\u6587).join(" / ")}`;
14411
14468
  }
14412
- function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
14469
+ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8, textMetrics = "proportional") {
14413
14470
  if (edges.length === 0) return edges;
14414
14471
  const labeledIds = new Set(
14415
14472
  edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => e.id)
@@ -14427,7 +14484,7 @@ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
14427
14484
  const out = [];
14428
14485
  for (const e of edges) {
14429
14486
  if (!labeledIds.has(e.id)) continue;
14430
- const base = computeLabelBBoxWorld(e);
14487
+ const base = computeLabelBBoxWorld(e, textMetrics);
14431
14488
  const s = getShift(e.id);
14432
14489
  out.push({ kind: "edge-label", id: e.id, x: base.x + s.dx, y: base.y + s.dy, w: base.w, h: base.h });
14433
14490
  }
@@ -14560,7 +14617,7 @@ function applyEdgeLabelAndPathShifts(edges, labelShiftMap, edgePathShiftMap) {
14560
14617
 
14561
14618
  // src/layout/curve-path.ts
14562
14619
  var SAME_HEIGHT_THRESHOLD = 1;
14563
- function curvePath(from, to, edge, labelMarginExtra = 0) {
14620
+ function curvePath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
14564
14621
  const fromLeft = from.cx - from.w / 2;
14565
14622
  const fromRight = from.cx + from.w / 2;
14566
14623
  const toLeft = to.cx - to.w / 2;
@@ -14628,7 +14685,7 @@ function curvePath(from, to, edge, labelMarginExtra = 0) {
14628
14685
  normalX *= -1;
14629
14686
  normalY *= -1;
14630
14687
  }
14631
- const labelW = computeLabelBoxW(edge?.label, edge?.sub);
14688
+ const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
14632
14689
  const labelH = labelPillH(edge?.sub);
14633
14690
  const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
14634
14691
  return {
@@ -14660,7 +14717,7 @@ function polyline(points) {
14660
14717
  });
14661
14718
  return distinct.map((p, i) => `${i === 0 ? "M" : "L"} ${point(p)}`).join(" ");
14662
14719
  }
14663
- function metroPath(from, to, edge, labelMarginExtra = 0) {
14720
+ function metroPath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
14664
14721
  const fromLeft = from.cx - from.w / 2;
14665
14722
  const fromRight = from.cx + from.w / 2;
14666
14723
  const toLeft = to.cx - to.w / 2;
@@ -14771,7 +14828,7 @@ function metroPath(from, to, edge, labelMarginExtra = 0) {
14771
14828
  normalX *= -1;
14772
14829
  normalY *= -1;
14773
14830
  }
14774
- const labelW = computeLabelBoxW(edge?.label, edge?.sub);
14831
+ const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
14775
14832
  const labelH = labelPillH(edge?.sub);
14776
14833
  const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
14777
14834
  return {
@@ -14940,9 +14997,9 @@ function \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(\u66F8\u3044\u305F, \u63A7\u
14940
14997
  const v = (\u66F8\u3044\u305F ?? "").trim();
14941
14998
  return v === "" ? \u63A7\u3048 : v;
14942
14999
  }
14943
- function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45) {
15000
+ function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45, textMetrics = "proportional") {
14944
15001
  if (!(\u5E45 > 0) || !(size > 0)) return 1;
14945
- const \u5B9F\u5E45 = textWidth(text, size, letterSpacing);
15002
+ const \u5B9F\u5E45 = textWidth(text, size, letterSpacing, textMetrics);
14946
15003
  return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
14947
15004
  }
14948
15005
  function \u8AAD\u3081\u308B\u4E0B\u9650\u306E\u500D\u7387(\u5927\u304D\u3055) {
@@ -15157,13 +15214,13 @@ function fitArt(region, extent, art) {
15157
15214
  );
15158
15215
  }
15159
15216
  var \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
15160
- function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0) {
15217
+ function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0, textMetrics = "proportional") {
15161
15218
  return Math.max(
15162
15219
  displayWidth(text) * size * MONO_ADVANCE_RATIO,
15163
- textWidth(text, size, letterSpacing)
15220
+ textWidth(text, size, letterSpacing, textMetrics)
15164
15221
  );
15165
15222
  }
15166
- function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089) {
15223
+ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089, textMetrics = "proportional") {
15167
15224
  const \u623B\u3057 = Number.isFinite(\u500D\u7387) && \u500D\u7387 > 0 ? 1 / \u500D\u7387 : 1;
15168
15225
  let \u4E0A\u9650 = Number.POSITIVE_INFINITY;
15169
15226
  for (const \u5B572 of \u5B57\u3089) {
@@ -15172,7 +15229,7 @@ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089)
15172
15229
  if (Number.isFinite(\u9AD8\u3055) && \u9AD8\u3055 > 0) {
15173
15230
  \u4E0A\u9650 = Math.min(\u4E0A\u9650, \u9AD8\u3055 * \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u5B572.size);
15174
15231
  }
15175
- const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0);
15232
+ const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0, textMetrics);
15176
15233
  if (Number.isFinite(\u5E45) && \u5E45 > 0 && \u5B9F\u5E45 > 0) {
15177
15234
  \u4E0A\u9650 = Math.min(\u4E0A\u9650, \u5E45 / \u5B9F\u5E45);
15178
15235
  }
@@ -16028,9 +16085,14 @@ function \u6728\u306E\u5F62(treeNodes) {
16028
16085
  return { \u8449\u306E\u6570, \u6BB5\u6570 };
16029
16086
  }
16030
16087
  var \u6728\u306E\u679D\u306E\u592A\u3055 = (\u6BB5) => Math.max(1.1, 2.6 - \u6BB5 * 0.45);
16031
- function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}) {
16088
+ function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
16032
16089
  const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
16033
- return computeTreeLayout(treeNodes, node.w - PAD_LEFT - PAD_RIGHT, node.h - PAD_TOP - PAD_BOTTOM);
16090
+ return computeTreeLayout(
16091
+ treeNodes,
16092
+ node.w - PAD_LEFT - PAD_RIGHT,
16093
+ node.h - PAD_TOP - PAD_BOTTOM,
16094
+ textMetrics
16095
+ );
16034
16096
  }
16035
16097
  function \u6728\u306E\u884C(n) {
16036
16098
  return [
@@ -16043,12 +16105,14 @@ function TreeNode({
16043
16105
  active,
16044
16106
  stateValues = {},
16045
16107
  drawing = false,
16046
- progress = 1
16108
+ progress = 1,
16109
+ textMetrics = "proportional"
16047
16110
  }) {
16048
16111
  const x0 = node.cx - node.w / 2;
16049
16112
  const y0 = node.cy - node.h / 2;
16050
16113
  const gradientId = `tree-root-grad-${node.id}`;
16051
- const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues);
16114
+ const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
16115
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
16052
16116
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
16053
16117
  const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
16054
16118
  const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
@@ -16102,10 +16166,10 @@ function TreeNode({
16102
16166
  const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
16103
16167
  const isRoot = n.depth === 0;
16104
16168
  const \u6750\u6599 = \u6728\u306E\u884C(n);
16105
- const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h);
16169
+ const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h, \u6E2C\u308B);
16106
16170
  const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
16107
16171
  const \u540D\u524D = \u6750\u6599[0];
16108
- 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));
16172
+ 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);
16109
16173
  return /* @__PURE__ */ jsxRuntime.jsx(
16110
16174
  "g",
16111
16175
  {
@@ -16187,7 +16251,7 @@ function TreeNode({
16187
16251
  })
16188
16252
  ] });
16189
16253
  }
16190
- function computeTreeLayout(treeNodes, canvasW, canvasH) {
16254
+ function computeTreeLayout(treeNodes, canvasW, canvasH, textMetrics = "proportional") {
16191
16255
  const ids = new Set(treeNodes.map((n) => n.id));
16192
16256
  const childrenOf = /* @__PURE__ */ new Map();
16193
16257
  for (const n of treeNodes) {
@@ -16235,7 +16299,7 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
16235
16299
  const \u7BB1\u306E\u5E45 = (n, depth) => {
16236
16300
  const \u6750\u6599 = \u6728\u306E\u884C({ ...n, depth });
16237
16301
  const \u540D\u524D = \u6750\u6599[0];
16238
- const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize}) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
16302
+ const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize, textMetrics }) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
16239
16303
  return Math.min(Math.max(\u8981\u308B, nodeW), slotW * 0.92);
16240
16304
  };
16241
16305
  const \u8449\u306E\u4E26\u3073 = [];
@@ -16339,7 +16403,7 @@ var BRANCH_BOX_H_MAX = 48;
16339
16403
  var SUB_BOX_H_MAX = 40;
16340
16404
  var \u7E26\u306E\u9593\u9694\u306E\u4E0A\u9650 = (\u679D\u306E\u6A2A\u306E\u4F38\u3073) => \u679D\u306E\u6A2A\u306E\u4F38\u3073;
16341
16405
  var MIND_PAD = 40;
16342
- function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
16406
+ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
16343
16407
  const mindData = node.mindData ? resolveMindData(node.mindData, stateValues) : void 0;
16344
16408
  if (!mindData) return void 0;
16345
16409
  return computeMindMapLayout(
@@ -16347,7 +16411,8 @@ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
16347
16411
  node.w / 2,
16348
16412
  node.h / 2,
16349
16413
  node.w - MIND_PAD * 2,
16350
- node.h - MIND_PAD * 2
16414
+ node.h - MIND_PAD * 2,
16415
+ textMetrics
16351
16416
  );
16352
16417
  }
16353
16418
  function \u653E\u5C04\u306E\u884C(n) {
@@ -16361,12 +16426,14 @@ function MindMapNode({
16361
16426
  active,
16362
16427
  stateValues = {},
16363
16428
  drawing = false,
16364
- progress = 1
16429
+ progress = 1,
16430
+ textMetrics = "proportional"
16365
16431
  }) {
16366
16432
  const x0 = node.cx - node.w / 2;
16367
16433
  const y0 = node.cy - node.h / 2;
16368
- const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues);
16434
+ const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
16369
16435
  if (!layout2) return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${x0} ${y0})` });
16436
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
16370
16437
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
16371
16438
  const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
16372
16439
  const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
@@ -16413,8 +16480,13 @@ function MindMapNode({
16413
16480
  const \u6587\u5B57\u306E\u5BC4\u305B = \u67A0\u306A\u3057 ? \u5916\u3078 ? "start" : "end" : "middle";
16414
16481
  const \u63CF\u753B\u57DF\u306E\u7AEF = \u5916\u3078 ? node.w - MIND_PAD : MIND_PAD;
16415
16482
  const \u4F7F\u3048\u308B = \u67A0\u306A\u3057 ? Math.abs(\u63CF\u753B\u57DF\u306E\u7AEF - \u6587\u5B57\u306Ex) : \u4F7F\u3048\u308B\u5E45(n.w);
16416
- 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);
16417
- 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);
16483
+ 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);
16484
+ const \u884C = \u7BB1\u306B\u7A4D\u3080(
16485
+ \u6750\u6599,
16486
+ \u67A0\u306A\u3057 ? \u4F7F\u3048\u308B + (n.w - \u4F7F\u3048\u308B\u5E45(n.w)) : n.w,
16487
+ n.h,
16488
+ \u6E2C\u308B
16489
+ );
16418
16490
  const \u6587\u5B57\u306E\u8272 = n.isRoot ? "var(--cdl-text-on-tone, #ffffff)" : "var(--cdl-chip-text, #1a1f2a)";
16419
16491
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-unresolved": n.unresolved ? "true" : void 0, children: [
16420
16492
  \u67A0\u306A\u3057 ? null : /* @__PURE__ */ jsxRuntime.jsx(
@@ -16466,14 +16538,14 @@ function MindMapNode({
16466
16538
  })
16467
16539
  ] });
16468
16540
  }
16469
- function \u63CF\u304F\u6A2A\u306E\u7AEF(n) {
16541
+ function \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics = "proportional") {
16470
16542
  if (n.isRoot || !n.isLeaf) return [n.x - n.w / 2, n.x + n.w / 2];
16471
16543
  const \u8D77\u70B9 = n.x + (n.side === "right" ? -n.w / 2 : n.w / 2);
16472
16544
  const \u540D\u524D = \u653E\u5C04\u306E\u884C(n)[0];
16473
- const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
16545
+ const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
16474
16546
  return n.side === "right" ? [\u8D77\u70B9, \u8D77\u70B9 + \u5E45] : [\u8D77\u70B9 - \u5E45, \u8D77\u70B9];
16475
16547
  }
16476
- function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16548
+ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH, textMetrics = "proportional") {
16477
16549
  const nodes = [];
16478
16550
  const edges = [];
16479
16551
  const rootW = 120;
@@ -16551,7 +16623,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16551
16623
  const PREFERRED_GAP = MIND_BOX_GAP;
16552
16624
  const \u679D\u306E\u540D\u524D\u306E\u5E45 = (title) => {
16553
16625
  const \u540D\u524D = \u653E\u5C04\u306E\u884C({ title, isRoot: false })[0];
16554
- return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
16626
+ return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
16555
16627
  };
16556
16628
  const \u679D\u306E\u6A2A\u3092\u6C7A\u3081\u308B = (br) => {
16557
16629
  const maxSubDepth = subDepthOf(br.id, /* @__PURE__ */ new Set());
@@ -16669,7 +16741,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16669
16741
  let maxExtentX = rootW / 2;
16670
16742
  let maxExtentY = rootH / 2;
16671
16743
  for (const n of nodes) {
16672
- const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
16744
+ const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
16673
16745
  maxExtentX = Math.max(maxExtentX, Math.abs(\u5DE6 - cx), Math.abs(\u53F3 - cx));
16674
16746
  maxExtentY = Math.max(maxExtentY, Math.abs(n.y - cy) + n.h / 2);
16675
16747
  }
@@ -16689,7 +16761,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16689
16761
  let \u5DE6\u7AEF = Number.POSITIVE_INFINITY;
16690
16762
  let \u53F3\u7AEF = Number.NEGATIVE_INFINITY;
16691
16763
  for (const n of nodes) {
16692
- const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
16764
+ const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
16693
16765
  \u5DE6\u7AEF = Math.min(\u5DE6\u7AEF, l);
16694
16766
  \u53F3\u7AEF = Math.max(\u53F3\u7AEF, r);
16695
16767
  }
@@ -16932,10 +17004,16 @@ function emptyCounts() {
16932
17004
  "validation-interrupted": 0
16933
17005
  };
16934
17006
  }
16935
- function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n) {
16936
- const \u7BB1 = (b, \u884C) => ({ \u884C, w: b.w, h: b.h });
16937
- if (n.kind === "tree-hierarchy") return \u6728\u306E\u4E2D\u8EAB(n).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b)));
16938
- if (n.kind === "mind-map") return (\u653E\u5C04\u306E\u4E2D\u8EAB(n)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b)));
17007
+ function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics = "proportional") {
17008
+ const \u7BB1 = (b, \u884C, \u6E2C\u308B) => ({ \u884C, w: b.w, h: b.h, \u6E2C\u308B });
17009
+ if (n.kind === "tree-hierarchy") {
17010
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
17011
+ return \u6728\u306E\u4E2D\u8EAB(n, {}, textMetrics).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b), \u6E2C\u308B));
17012
+ }
17013
+ if (n.kind === "mind-map") {
17014
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
17015
+ return (\u653E\u5C04\u306E\u4E2D\u8EAB(n, {}, textMetrics)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b), \u6E2C\u308B));
17016
+ }
16939
17017
  return [];
16940
17018
  }
16941
17019
  function measureStubOut(segs) {
@@ -17621,6 +17699,7 @@ function \u4F4D\u7F6E\u3092\u624B\u3067\u66F8\u3044\u305F(n) {
17621
17699
  return n.posX !== void 0 && n.posY !== void 0;
17622
17700
  }
17623
17701
  function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5668) {
17702
+ const textMetrics = laid.textMetrics ?? "proportional";
17624
17703
  const LIFELINE_W_THRESHOLD = 8;
17625
17704
  for (const n of laid.nodes) {
17626
17705
  if (n.w < LIFELINE_W_THRESHOLD) continue;
@@ -17632,7 +17711,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17632
17711
  );
17633
17712
  }
17634
17713
  }
17635
- const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges);
17714
+ const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges, textMetrics);
17636
17715
  const collisions = detectCollisions(bboxes, laid.edges);
17637
17716
  for (const c of collisions) {
17638
17717
  const involvesEdgeLabel = c.a.kind === "edge-label" || c.b.kind === "edge-label";
@@ -17652,7 +17731,11 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17652
17731
  if (!titleTrimmed) continue;
17653
17732
  const \u4F59\u767D = drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING;
17654
17733
  const \u4F7F\u3048\u308B\u5E452 = n.w - \u4F59\u767D;
17655
- const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, { fontSize: titleFontSize(n.kind), bound: "drawn" });
17734
+ const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, {
17735
+ fontSize: titleFontSize(n.kind),
17736
+ bound: "drawn",
17737
+ textMetrics
17738
+ });
17656
17739
  if (titleScalesToFit(n.kind, n.h)) {
17657
17740
  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);
17658
17741
  if (\u7E2E\u3081\u305F\u5927\u304D\u3055 < MIN_TITLE_FONT_SIZE) {
@@ -17720,7 +17803,13 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17720
17803
  const b\u306F\u672D = n.b.kind === "edge-label";
17721
17804
  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;
17722
17805
  const \u76F8\u624B = \u52D5\u304B\u3059 === n.a ? n.b : n.a;
17723
- 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;
17806
+ const reason = \u52D5\u304B\u3059 !== null ? \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(
17807
+ \u52D5\u304B\u3059.id,
17808
+ \u76F8\u624B,
17809
+ laid.edges,
17810
+ \u672D\u306E\u969C\u5BB3\u7269,
17811
+ textMetrics
17812
+ ) ?? void 0 : void 0;
17724
17813
  push(
17725
17814
  "clearance",
17726
17815
  `${n.a.kind}:${n.a.id} \u2194 ${n.b.kind}:${n.b.id} gap=${n.gap.toFixed(1)}px (need ${n.required}px)`,
@@ -17734,7 +17823,10 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17734
17823
  if (!hasRenderedLabel(e)) continue;
17735
17824
  const segs = extractPathSegments(e.d);
17736
17825
  if (segs.length === 0) continue;
17737
- const minDist = measurePathLabelGapSegs(flattenPathSegments(segs), computeLabelBBoxWorld(e));
17826
+ const minDist = measurePathLabelGapSegs(
17827
+ flattenPathSegments(segs),
17828
+ computeLabelBBoxWorld(e, textMetrics)
17829
+ );
17738
17830
  if (!Number.isFinite(minDist)) continue;
17739
17831
  if (minDist > PROXIMITY_ERROR_THRESHOLD) {
17740
17832
  push(
@@ -17784,8 +17876,15 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17784
17876
  }
17785
17877
  for (const e of laid.edges) {
17786
17878
  if (!hasRenderedLabel(e)) continue;
17787
- const mainW = measureTextWidth(e.label ?? "", { fontSize: EDGE_LABEL_TEXT.main.fontSize });
17788
- const subW = e.sub ? measureTextWidth(e.sub, { fontSize: EDGE_LABEL_TEXT.sub.fontSize, fontFamily: "mono" }) : 0;
17879
+ const mainW = measureTextWidth(e.label ?? "", {
17880
+ fontSize: EDGE_LABEL_TEXT.main.fontSize,
17881
+ textMetrics
17882
+ });
17883
+ const subW = e.sub ? measureTextWidth(e.sub, {
17884
+ fontSize: EDGE_LABEL_TEXT.sub.fontSize,
17885
+ fontFamily: "mono",
17886
+ textMetrics
17887
+ }) : 0;
17789
17888
  const expectedBoxW = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
17790
17889
  const bbox = bboxes.find((b) => b.kind === "edge-label" && b.id === e.id);
17791
17890
  if (!bbox) continue;
@@ -17927,7 +18026,9 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17927
18026
  }
17928
18027
  }
17929
18028
  for (const n of laid.nodes) {
17930
- const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter((line) => droppedLineIsHidden(n.kind, line));
18029
+ const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter(
18030
+ (line) => droppedLineIsHidden(n.kind, line)
18031
+ );
17931
18032
  if (\u843D\u3068\u3057\u305F.length === 0) continue;
17932
18033
  push(
17933
18034
  "shape-label-dropped",
@@ -17936,7 +18037,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17936
18037
  );
17937
18038
  }
17938
18039
  for (const n of laid.nodes) {
17939
- const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n);
18040
+ const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics);
17940
18041
  if (\u7BB1.length === 0) continue;
17941
18042
  let \u5BFE\u8C61 = 0;
17942
18043
  const \u843D\u3061\u305F = [];
@@ -17944,7 +18045,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17944
18045
  const \u5BA3\u8A00 = b.\u884C.slice(1).filter((r) => r.text.trim() !== "");
17945
18046
  if (\u5BA3\u8A00.length === 0) continue;
17946
18047
  \u5BFE\u8C61 += 1;
17947
- const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h).map((r) => r.\u5F79\u5272));
18048
+ const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h, b.\u6E2C\u308B).map((r) => r.\u5F79\u5272));
17948
18049
  if (\u5BA3\u8A00.every((r) => \u6B8B\u3063\u305F.has(r.\u5F79\u5272))) continue;
17949
18050
  \u843D\u3061\u305F.push({ title: b.\u884C[0]?.text ?? "", h: b.h });
17950
18051
  }
@@ -19007,7 +19108,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
19007
19108
  const allowedLanes = /* @__PURE__ */ new Set();
19008
19109
  if (fromNode) allowedLanes.add(fromNode.lane);
19009
19110
  if (toNode) allowedLanes.add(toNode.lane);
19010
- const box = computeLabelBBoxWorld(e);
19111
+ const box = computeLabelBBoxWorld(e, textMetrics);
19011
19112
  for (const lane of laid.lanes) {
19012
19113
  if (allowedLanes.has(lane.id)) continue;
19013
19114
  const side = rectCrossesLaneBorder(box, lane, rangeByLane.get(lane.id));
@@ -19385,7 +19486,7 @@ function pickFreeSides(occupied, count) {
19385
19486
  const \u4F7F\u3046 = \u7A7A\u304D.length > 0 ? \u7A7A\u304D : [SELF_LOOP_SIDE_FALLBACK];
19386
19487
  return Array.from({ length: count }, (_, i) => \u4F7F\u3046[i % \u4F7F\u3046.length]);
19387
19488
  }
19388
- function routeSelfLoopGroup(edges, node, side) {
19489
+ function routeSelfLoopGroup(edges, node, side, textMetrics = "proportional") {
19389
19490
  const horizontal = side === "left" || side === "right";
19390
19491
  const g = sideGeometry(node, side);
19391
19492
  const span = fitSpan(horizontal ? node.h : node.w, SELF_LOOP_SPAN);
@@ -19394,7 +19495,7 @@ function routeSelfLoopGroup(edges, node, side) {
19394
19495
  const \u6700\u5916 = controlOffset(SELF_LOOP_OUT + (edges.length - 1) * SELF_LOOP_STAGGER);
19395
19496
  const \u8A9E\u307E\u3067 = \u6700\u5916 + LABEL_TO_PATH_CLEARANCE;
19396
19497
  const \u8A9E\u5E45 = edges.map(
19397
- (e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub)
19498
+ (e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub, textMetrics)
19398
19499
  );
19399
19500
  const \u4F4D\u7F6E = [];
19400
19501
  let \u7A4D = 0;
@@ -19424,7 +19525,7 @@ function routeSelfLoopGroup(edges, node, side) {
19424
19525
  function isSelfLoop(e) {
19425
19526
  return e.from === e.to;
19426
19527
  }
19427
- function layoutSelfLoops(edges, nodes, occupiedBySide) {
19528
+ function layoutSelfLoops(edges, nodes, occupiedBySide, textMetrics = "proportional") {
19428
19529
  const \u5272\u5F53 = /* @__PURE__ */ new Map();
19429
19530
  for (const edge of edges) {
19430
19531
  if (edge.side) continue;
@@ -19451,7 +19552,7 @@ function layoutSelfLoops(edges, nodes, occupiedBySide) {
19451
19552
  if (\u65E2) \u65E2.edges.push(edge);
19452
19553
  else \u675F.set(key, { node, side, edges: [edge] });
19453
19554
  }
19454
- return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side));
19555
+ return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side, textMetrics));
19455
19556
  }
19456
19557
 
19457
19558
  // src/layout/tokens.ts
@@ -19669,7 +19770,7 @@ function verticalDetourBlockers(A, B, obstacles) {
19669
19770
  function detourColumnFor(blockers, side) {
19670
19771
  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;
19671
19772
  }
19672
- function layoutEdges(diag, nodes, lanes = []) {
19773
+ function layoutEdges(diag, nodes, lanes = [], textMetrics = "proportional") {
19673
19774
  const labelMarginExtra = (diag.viewport?.labelMargin ?? diag.viewport?.gap ?? DEFAULT_LABEL_MARGIN) - DEFAULT_LABEL_MARGIN;
19674
19775
  const nmap = new Map(nodes.map((n) => [n.id, n]));
19675
19776
  const lmap = new Map(lanes.map((l) => [l.id, l]));
@@ -19702,7 +19803,7 @@ function layoutEdges(diag, nodes, lanes = []) {
19702
19803
  const to = nmap.get(e.to);
19703
19804
  if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
19704
19805
  if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
19705
- const c = curvePath(from, to, e, labelMarginExtra);
19806
+ const c = curvePath(from, to, e, labelMarginExtra, textMetrics);
19706
19807
  positionedEdges.push({
19707
19808
  ...e,
19708
19809
  d: c.d,
@@ -19717,7 +19818,7 @@ function layoutEdges(diag, nodes, lanes = []) {
19717
19818
  const to = nmap.get(e.to);
19718
19819
  if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
19719
19820
  if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
19720
- const m = metroPath(from, to, e, labelMarginExtra);
19821
+ const m = metroPath(from, to, e, labelMarginExtra, textMetrics);
19721
19822
  positionedEdges.push({
19722
19823
  ...e,
19723
19824
  d: m.d,
@@ -19765,7 +19866,7 @@ function layoutEdges(diag, nodes, lanes = []) {
19765
19866
  \u4F7F\u3046(le.from, le.fromSide);
19766
19867
  \u4F7F\u3046(le.to, le.toSide);
19767
19868
  }
19768
- const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide);
19869
+ const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide, textMetrics);
19769
19870
  const labelOffsetsByEdgeId = /* @__PURE__ */ new Map();
19770
19871
  const parallelKey = (p) => p.e.from < p.e.to ? `${p.e.from}::${p.e.to}` : `${p.e.to}::${p.e.from}`;
19771
19872
  const byParallel = /* @__PURE__ */ new Map();
@@ -19919,7 +20020,7 @@ function layoutEdges(diag, nodes, lanes = []) {
19919
20020
  const others = nodes.filter((n) => n.id !== c.from && n.id !== c.to);
19920
20021
  if (others.some((n) => segmentsCrossRect(segs, nodeRect(n)))) return true;
19921
20022
  if (!hasRenderedLabel(c.e)) return false;
19922
- const boxW = computeLabelBoxW(c.e.label, c.e.sub);
20023
+ const boxW = computeLabelBoxW(c.e.label, c.e.sub, textMetrics);
19923
20024
  const boxH = labelPillH(c.e.sub);
19924
20025
  const centerX = columnX - (labelPathClearanceHorizontal(c.e) + boxW / 2);
19925
20026
  const pill = { x: centerX - boxW / 2, y: (exitY + returnY) / 2 - boxH / 2, w: boxW, h: boxH };
@@ -20034,7 +20135,8 @@ function layoutEdges(diag, nodes, lanes = []) {
20034
20135
  allOtherNodes,
20035
20136
  { x: endpointOffset.fromDx, y: endpointOffset.fromDy },
20036
20137
  { x: endpointOffset.toDx, y: endpointOffset.toDy },
20037
- avoidRects
20138
+ avoidRects,
20139
+ textMetrics
20038
20140
  );
20039
20141
  const routed1 = route([]);
20040
20142
  const { d, labelX, labelY, labelAnchor, labelAltX } = routed1;
@@ -20090,13 +20192,13 @@ function layoutEdges(diag, nodes, lanes = []) {
20090
20192
  const pillById = /* @__PURE__ */ new Map();
20091
20193
  for (const r of list) {
20092
20194
  if (!hasRenderedLabel(r.e)) continue;
20093
- const w = computeLabelBoxW(r.e.label, r.e.sub);
20195
+ const w = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
20094
20196
  const h = labelPillH(r.e.sub);
20095
20197
  pillById.set(r.e.id, { x: r.baseLabelX - w / 2, y: r.baseLabelY - h / 2, w, h });
20096
20198
  }
20097
20199
  for (const le of positionedEdges) {
20098
20200
  if (!hasRenderedLabel(le)) continue;
20099
- const w = computeLabelBoxW(le.label, le.sub);
20201
+ const w = computeLabelBoxW(le.label, le.sub, textMetrics);
20100
20202
  const h = labelPillH(le.sub);
20101
20203
  pillById.set(le.id, { x: le.labelX - w / 2, y: le.labelY - h / 2, w, h });
20102
20204
  }
@@ -20126,7 +20228,7 @@ function layoutEdges(diag, nodes, lanes = []) {
20126
20228
  const laneOfNode = new Map(nodes.map((n) => [n.id, n.lane]));
20127
20229
  for (const r of flippable) {
20128
20230
  const ownSegs = segsByEdgeId.get(r.e.id);
20129
- const boxW = computeLabelBoxW(r.e.label, r.e.sub);
20231
+ const boxW = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
20130
20232
  const boxH = labelPillH(r.e.sub);
20131
20233
  const pillAt = (centerX) => ({
20132
20234
  x: centerX - boxW / 2,
@@ -20171,7 +20273,7 @@ function layoutEdges(diag, nodes, lanes = []) {
20171
20273
  if (list.length < 2) continue;
20172
20274
  const boxes = list.map((r) => ({
20173
20275
  cx: r.baseLabelX,
20174
- halfW: computeLabelBoxW(r.e.label, r.e.sub) / 2
20276
+ halfW: computeLabelBoxW(r.e.label, r.e.sub, textMetrics) / 2
20175
20277
  }));
20176
20278
  const overlapsX = (i, j) => Math.abs(boxes[i].cx - boxes[j].cx) < boxes[i].halfW + boxes[j].halfW + CLEARANCE_LABEL_LABEL;
20177
20279
  const componentOf = list.map((_, i) => i);
@@ -20221,7 +20323,7 @@ function layoutEdges(diag, nodes, lanes = []) {
20221
20323
  r,
20222
20324
  baseX: r.baseLabelX,
20223
20325
  baseY: r.baseLabelY,
20224
- w: computeLabelBoxW(r.e.label, r.e.sub),
20326
+ w: computeLabelBoxW(r.e.label, r.e.sub, textMetrics),
20225
20327
  h: labelPillH(r.e.sub)
20226
20328
  }));
20227
20329
  items.sort((a, b) => a.baseX - b.baseX);
@@ -20333,7 +20435,7 @@ function singleStraightSegment(d) {
20333
20435
  if (x1 === x2 && y1 === y2) return null;
20334
20436
  return { x1, y1, x2, y2 };
20335
20437
  }
20336
- function bowSharedStraightPaths(edges, nodes, skipIds) {
20438
+ function bowSharedStraightPaths(edges, nodes, skipIds, textMetrics = "proportional") {
20337
20439
  const groups = /* @__PURE__ */ new Map();
20338
20440
  for (const e of edges) {
20339
20441
  if (skipIds.has(e.id)) continue;
@@ -20369,7 +20471,7 @@ function bowSharedStraightPaths(edges, nodes, skipIds) {
20369
20471
  )
20370
20472
  );
20371
20473
  const groupIds = new Set(group.map((g) => g.e.id));
20372
- const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x));
20474
+ const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x, textMetrics));
20373
20475
  const nodeRects = nodes.map((n) => ({ x: n.cx - n.w / 2, y: n.cy - n.h / 2, w: n.w, h: n.h }));
20374
20476
  const build = (seg, offset) => {
20375
20477
  const cx = midX + nx * offset * 2;
@@ -20489,8 +20591,8 @@ function sidePoint(n, side) {
20489
20591
  return { x: n.cx + n.w / 2, y: n.cy };
20490
20592
  }
20491
20593
  }
20492
- function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _fromLane, _toLane, edge, labelObstacles = obstacles, fromOffset = { x: 0, y: 0 }, toOffset = { x: 0, y: 0 }, avoidRects = []) {
20493
- const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub) : 0;
20594
+ 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") {
20595
+ const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub, textMetrics) : 0;
20494
20596
  const labelHalfW = labelBoxW / 2;
20495
20597
  const labelInit = labelInitClearance(edge);
20496
20598
  const verticalPair = fromSide === "bottom" && toSide === "top" || fromSide === "top" && toSide === "bottom";
@@ -20889,7 +20991,7 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
20889
20991
  labelAnchor: "middle"
20890
20992
  };
20891
20993
  }
20892
- function repositionParallelLabels(edges, nodes) {
20994
+ function repositionParallelLabels(edges, nodes, textMetrics = "proportional") {
20893
20995
  const allSegs = new Map(
20894
20996
  edges.map((e) => [e.id, flattenPathSegments(extractPathSegments(e.d))])
20895
20997
  );
@@ -20914,7 +21016,7 @@ function repositionParallelLabels(edges, nodes) {
20914
21016
  for (const pair of byPair.values()) {
20915
21017
  if (pair.length < 2) continue;
20916
21018
  const pairOrder = [...pair].sort(compareSharedPairOrder);
20917
- const boxes = pair.map((e) => computeLabelBBoxWorld(e));
21019
+ const boxes = pair.map((e) => computeLabelBBoxWorld(e, textMetrics));
20918
21020
  const componentOf = pair.map((_, i) => i);
20919
21021
  for (let i = 0; i < pair.length; i++) {
20920
21022
  for (let j = i + 1; j < pair.length; j++) {
@@ -20939,17 +21041,27 @@ function repositionParallelLabels(edges, nodes) {
20939
21041
  nodes,
20940
21042
  allEdges: edges,
20941
21043
  allSegs,
20942
- xRange
21044
+ xRange,
21045
+ textMetrics
20943
21046
  });
20944
21047
  for (let i = 0; i < members.length; i++) members[i].labelY = placed[i];
20945
21048
  }
20946
21049
  }
20947
21050
  }
20948
21051
  function placeAvoidingSiblingPaths(args) {
20949
- const { members, pair, pairOrder, nodes, allEdges, allSegs, xRange } = args;
21052
+ const {
21053
+ members,
21054
+ pair,
21055
+ pairOrder,
21056
+ nodes,
21057
+ allEdges,
21058
+ allSegs,
21059
+ xRange,
21060
+ textMetrics = "proportional"
21061
+ } = args;
20950
21062
  const sizes = members.map((e) => labelPillH(e.sub));
20951
21063
  const wants = members.map((e) => e.labelY);
20952
- const boxes = members.map((e) => computeLabelBBoxWorld(e));
21064
+ const boxes = members.map((e) => computeLabelBBoxWorld(e, textMetrics));
20953
21065
  const all = members.map((_, i) => i);
20954
21066
  const spread = (idx) => spreadWithMinimalShift(
20955
21067
  idx.map((i) => ({ want: wants[i], size: sizes[i] })),
@@ -21140,14 +21252,14 @@ function labelRectAt(cx, cy, w, h) {
21140
21252
  function inflate(r, pad) {
21141
21253
  return { x: r.x - pad, y: r.y - pad, w: r.w + pad * 2, h: r.h + pad * 2 };
21142
21254
  }
21143
- function slideLabelsAlongOwnPath(edges, nodes) {
21255
+ function slideLabelsAlongOwnPath(edges, nodes, textMetrics = "proportional") {
21144
21256
  const withLabel = edges.filter((e) => hasRenderedLabel(e));
21145
21257
  if (withLabel.length === 0) return;
21146
21258
  const segsById = /* @__PURE__ */ new Map();
21147
21259
  for (const e of edges) segsById.set(e.id, flattenPathSegments(extractPathSegments(e.d)));
21148
21260
  const nodeRects = nodes.map(nodeRect);
21149
21261
  for (const e of withLabel) {
21150
- const w = computeLabelBoxW(e.label, e.sub);
21262
+ const w = computeLabelBoxW(e.label, e.sub, textMetrics);
21151
21263
  const h = labelPillH(e.sub);
21152
21264
  if (w === 0 || h === 0) continue;
21153
21265
  const own = segsById.get(e.id) ?? [];
@@ -21449,7 +21561,7 @@ function separateSharedStraightRuns(edges, nodes) {
21449
21561
  e.d = verticesToPath(verts.get(e.id));
21450
21562
  }
21451
21563
  }
21452
- function pullOutgoingFirstCorner(edges, nodes) {
21564
+ function pullOutgoingFirstCorner(edges, nodes, textMetrics = "proportional") {
21453
21565
  if (edges.length < 2) return;
21454
21566
  const \u675F = /* @__PURE__ */ new Map();
21455
21567
  const \u540C\u3058\u7D44\u306E\u6570 = /* @__PURE__ */ new Map();
@@ -21503,10 +21615,10 @@ function pullOutgoingFirstCorner(edges, nodes) {
21503
21615
  }
21504
21616
  e.d = \u524D;
21505
21617
  if (!\u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F) {
21506
- slideLabelsAlongOwnPath(edges, nodes);
21618
+ slideLabelsAlongOwnPath(edges, nodes, textMetrics);
21507
21619
  \u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F = true;
21508
21620
  }
21509
- const labelBox = computeLabelBBoxWorld(e);
21621
+ const labelBox = computeLabelBBoxWorld(e, textMetrics);
21510
21622
  const label = { x: labelBox.x + labelBox.w / 2, y: labelBox.y + labelBox.h / 2 };
21511
21623
  const \u7DDA\u5206\u307E\u3067\u306E\u8DDD\u96E22 = (a, b) => {
21512
21624
  const dx = b.x - a.x;
@@ -21618,13 +21730,13 @@ function fanIncomingEndpoints(edges, nodes) {
21618
21730
  }
21619
21731
  return \u7D42\u70B9\u306E\u79FB\u52D5;
21620
21732
  }
21621
- function followLabelsToFannedTails(edges, obstacles, shifts) {
21733
+ function followLabelsToFannedTails(edges, obstacles, shifts, textMetrics = "proportional") {
21622
21734
  if (shifts.size === 0) return;
21623
21735
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
21624
21736
  const labels = edges.filter(hasRenderedLabel).map((e) => ({
21625
21737
  kind: "edge-label",
21626
21738
  id: e.id,
21627
- ...computeLabelBBoxWorld(e)
21739
+ ...computeLabelBBoxWorld(e, textMetrics)
21628
21740
  }));
21629
21741
  const labelIndexByEdgeId = new Map(labels.map((label, index) => [label.id, index]));
21630
21742
  const edgeById = new Map(edges.map((e) => [e.id, e]));
@@ -21656,7 +21768,7 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
21656
21768
  labelY: e.labelY + \u79FB\u52D5.dy,
21657
21769
  labelAnchor: e.labelAnchor
21658
21770
  };
21659
- const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa });
21771
+ const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa }, textMetrics);
21660
21772
  const \u6700\u5F8C\u306F\u7E26 = Math.abs(\u6700\u5F8C.x2 - \u6700\u5F8C.x1) <= Math.abs(\u6700\u5F8C.y2 - \u6700\u5F8C.y1);
21661
21773
  const \u5019\u88DC = [
21662
21774
  \u5019\u88DCa,
@@ -21667,7 +21779,11 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
21667
21779
  }
21668
21780
  ];
21669
21781
  for (const c of \u5019\u88DC) {
21670
- const \u672D = { kind: "edge-label", id: e.id, ...computeLabelBBoxWorld({ ...e, ...c }) };
21782
+ const \u672D = {
21783
+ kind: "edge-label",
21784
+ id: e.id,
21785
+ ...computeLabelBBoxWorld({ ...e, ...c }, textMetrics)
21786
+ };
21671
21787
  if (segmentsCrossRect([\u6700\u5F8C], \u672D)) continue;
21672
21788
  if (\u672D\u306E\u79FB\u52D5\u3092\u585E\u3050\u76F8\u624B\u3092\u63A2\u3059(\u5468\u308A, \u5143\u306E\u672D, \u672D) !== null) continue;
21673
21789
  e.labelX = c.labelX;
@@ -21861,7 +21977,7 @@ function expandLanesForNodes(lanes, nodes) {
21861
21977
  };
21862
21978
  });
21863
21979
  }
21864
- function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
21980
+ function expandLaneGapsForEdgeLabels(lanes, nodes, edges, textMetrics = "proportional") {
21865
21981
  if (lanes.length < 2) return lanes;
21866
21982
  const layoutedLanes = lanes.filter((l) => !(l.posX !== void 0 && l.posY !== void 0));
21867
21983
  if (layoutedLanes.length < 2) return lanes;
@@ -21877,7 +21993,7 @@ function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
21877
21993
  const fi = laneIndexById.get(fromLane);
21878
21994
  const ti = laneIndexById.get(toLane);
21879
21995
  if (fi === void 0 || ti === void 0 || fi === ti) continue;
21880
- const labelBoxW = computeLabelBoxW(edge.label, edge.sub);
21996
+ const labelBoxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
21881
21997
  if (labelBoxW === 0) continue;
21882
21998
  const lo = Math.min(fi, ti);
21883
21999
  const hi = Math.max(fi, ti);
@@ -21999,7 +22115,7 @@ function \u7DDA\u306E\u7AEF\u306E\u5411\u304D(d, \u7AEF) {
21999
22115
  const \u5019\u88DC = segs.flatMap((s) => [...s.ctrl ?? [], { x: s.x2, y: s.y2 }]);
22000
22116
  return \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC);
22001
22117
  }
22002
- function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
22118
+ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head", textMetrics = "proportional") {
22003
22119
  const text = (\u7AEF === "head" ? edge.headLabel : edge.tailLabel)?.trim();
22004
22120
  if (!text) return null;
22005
22121
  const \u5411\u304D = \u7DDA\u306E\u7AEF\u306E\u5411\u304D(edge.d, \u7AEF);
@@ -22010,7 +22126,8 @@ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
22010
22126
  const w = measureTextWidth(text, {
22011
22127
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
22012
22128
  fontWeight: EDGE_LABEL_TEXT.sub.fontWeight,
22013
- fontFamily: "mono"
22129
+ fontFamily: "mono",
22130
+ textMetrics
22014
22131
  });
22015
22132
  const h = \u7BB1\u306E\u9AD8\u3055;
22016
22133
  const \u672D = hasRenderedLabel(edge) && edge.labelX !== void 0 && edge.labelY !== void 0 ? { x: edge.labelX, y: edge.labelY } : null;
@@ -22059,10 +22176,10 @@ function autoStorageHeight(n, defaultH) {
22059
22176
  }
22060
22177
  return Math.max(defaultH, \u5FC5\u8981);
22061
22178
  }
22062
- function autoRowsWidth(n, defaultW) {
22179
+ function autoRowsWidth(n, defaultW, textMetrics = "proportional") {
22063
22180
  if (n.w != null) return n.w;
22064
22181
  if (!n.rows || n.rows.length === 0) return defaultW;
22065
- const required = requiredRowsWidth(n.rows, n.kind);
22182
+ const required = requiredRowsWidth(n.rows, n.kind, textMetrics);
22066
22183
  return Math.max(defaultW, required);
22067
22184
  }
22068
22185
  function \u7BB1\u306E\u9AD8\u30552(n, \u65E2\u5B9Ah) {
@@ -22100,7 +22217,7 @@ function requiredStackGapForEdgeLabels(diag, allStacks) {
22100
22217
  }
22101
22218
  return required;
22102
22219
  }
22103
- function layoutNodes(diag, lanes) {
22220
+ function layoutNodes(diag, lanes, textMetrics) {
22104
22221
  const laneMap = new Map(lanes.map((l) => [l.id, l]));
22105
22222
  const allStacks = Array.from(new Set(diag.nodes.map((n) => n.stack))).sort((a, b) => a - b);
22106
22223
  const rowH = /* @__PURE__ */ new Map();
@@ -22144,7 +22261,7 @@ function layoutNodes(diag, lanes) {
22144
22261
  }
22145
22262
  const size = NODE_SIZE[n.kind];
22146
22263
  if (n.posX !== void 0 && n.posY !== void 0) {
22147
- const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w);
22264
+ const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w, textMetrics);
22148
22265
  const h2 = n.posH ?? n.h ?? rowH.get(n.stack) ?? size.h;
22149
22266
  out.push({
22150
22267
  ...n,
@@ -22162,7 +22279,7 @@ function layoutNodes(diag, lanes) {
22162
22279
  const \u81EA\u524D\u306E\u9AD8\u3055 = n.rowMarks !== void 0;
22163
22280
  const h = n.h ?? (\u81EA\u524D\u306E\u9AD8\u3055 ? \u7BB1\u306E\u9AD8\u30552(n, size.h) : \u6BB5\u306E\u9AD8\u3055);
22164
22281
  const cy = \u6BB5\u306E\u82AF;
22165
- const w = autoRowsWidth(n, size.w);
22282
+ const w = autoRowsWidth(n, size.w, textMetrics);
22166
22283
  out.push({
22167
22284
  ...n,
22168
22285
  cx,
@@ -22282,10 +22399,16 @@ function applyRowLevelNodeShifts(nodes, lanes, nodeShifts) {
22282
22399
  return moved ? { nodes: outNodes, lanes: outLanes } : null;
22283
22400
  }
22284
22401
  function layout(diag) {
22402
+ const textMetrics = resolveTextMetrics(diag.textMetrics);
22285
22403
  const lanes = layoutLanes(diag);
22286
- const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes));
22404
+ const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes, textMetrics));
22287
22405
  const expandedLanes = expandLanesForNodes(lanes, rawNodes);
22288
- const gapExpandedLanes = expandLaneGapsForEdgeLabels(expandedLanes, rawNodes, diag.edges);
22406
+ const gapExpandedLanes = expandLaneGapsForEdgeLabels(
22407
+ expandedLanes,
22408
+ rawNodes,
22409
+ diag.edges,
22410
+ textMetrics
22411
+ );
22289
22412
  const nodes = rawNodes.map((n) => {
22290
22413
  if (n.posX !== void 0 && n.posY !== void 0) return n;
22291
22414
  const oldLane = lanes.find((l) => l.id === n.lane);
@@ -22294,13 +22417,13 @@ function layout(diag) {
22294
22417
  return { ...n, cx: newLane.x + newLane.width / 2 };
22295
22418
  });
22296
22419
  const containedLanesPre = recomputeContainedLanes(gapExpandedLanes, nodes);
22297
- const edgesPre = layoutEdges(diag, nodes, containedLanesPre);
22298
- const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre);
22420
+ const edgesPre = layoutEdges(diag, nodes, containedLanesPre, textMetrics);
22421
+ const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre, textMetrics);
22299
22422
  const collisionsPre = detectCollisions(bboxesPre, edgesPre);
22300
22423
  const nodesResolved = resolveOverlaps(nodes, collisionsPre);
22301
22424
  const moved = nodesResolved !== nodes;
22302
22425
  const containedLanes = moved ? recomputeContainedLanes(gapExpandedLanes, nodesResolved) : containedLanesPre;
22303
- const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes) : edgesPre;
22426
+ const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes, textMetrics) : edgesPre;
22304
22427
  const chainShiftClearance = Math.max(CLEARANCE_LABEL_LABEL, CLEARANCE_NODE_LABEL);
22305
22428
  let edges;
22306
22429
  let nodesFinal = nodesResolved;
@@ -22311,10 +22434,13 @@ function layout(diag) {
22311
22434
  } else {
22312
22435
  const propagateResult = resolveEdgeLabelOverlapsWithChainAndPropagate(
22313
22436
  edgesAfterMove,
22314
- collectBBoxes(containedLanes, nodesResolved, []).filter(
22437
+ collectBBoxes(containedLanes, nodesResolved, [], textMetrics).filter(
22315
22438
  (b) => b.kind === "node" || b.kind === "lane-label"
22316
22439
  ),
22317
- chainShiftClearance
22440
+ chainShiftClearance,
22441
+ void 0,
22442
+ void 0,
22443
+ textMetrics
22318
22444
  );
22319
22445
  edges = propagateResult.edges;
22320
22446
  if (propagateResult.nodeShifts.size > 0) {
@@ -22326,7 +22452,7 @@ function layout(diag) {
22326
22452
  }
22327
22453
  if (nodesFinal !== nodesResolved) {
22328
22454
  containedLanesFinal = recomputeContainedLanes(laneShiftedBase, nodesFinal);
22329
- edges = layoutEdges(diag, nodesFinal, containedLanesFinal);
22455
+ edges = layoutEdges(diag, nodesFinal, containedLanesFinal, textMetrics);
22330
22456
  }
22331
22457
  }
22332
22458
  const positionedEdgeIds = new Set(
@@ -22334,21 +22460,31 @@ function layout(diag) {
22334
22460
  (e) => e.routing === "curve" || e.routing === "metro" || e.posX1 !== void 0 && e.posY1 !== void 0 && e.posX2 !== void 0 && e.posY2 !== void 0
22335
22461
  ).map((e) => e.id)
22336
22462
  );
22337
- bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds);
22338
- pullOutgoingFirstCorner(edges, nodesFinal);
22463
+ bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds, textMetrics);
22464
+ pullOutgoingFirstCorner(edges, nodesFinal, textMetrics);
22339
22465
  const fannedTailShifts = fanIncomingEndpoints(edges, nodesFinal);
22340
22466
  separateSharedStraightRuns(edges, nodesFinal);
22341
22467
  hopEdgeCrossings(edges);
22342
- const labelClearanceObstacles = collectBBoxes(containedLanesFinal, nodesFinal, []).filter(
22468
+ const labelClearanceObstacles = collectBBoxes(
22469
+ containedLanesFinal,
22470
+ nodesFinal,
22471
+ [],
22472
+ textMetrics
22473
+ ).filter(
22343
22474
  (b) => b.kind === "node" || b.kind === "lane-label"
22344
22475
  );
22345
- followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts);
22346
- repositionParallelLabels(edges, nodesFinal);
22347
- slideLabelsAlongOwnPath(edges, nodesFinal);
22476
+ followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts, textMetrics);
22477
+ repositionParallelLabels(edges, nodesFinal, textMetrics);
22478
+ slideLabelsAlongOwnPath(edges, nodesFinal, textMetrics);
22348
22479
  if (!isChainEdgeLabelDisabled()) {
22349
- edges = resolveLabelClearanceAfterPathPasses(edges, labelClearanceObstacles);
22480
+ edges = resolveLabelClearanceAfterPathPasses(
22481
+ edges,
22482
+ labelClearanceObstacles,
22483
+ void 0,
22484
+ textMetrics
22485
+ );
22350
22486
  }
22351
- const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges);
22487
+ const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges, textMetrics);
22352
22488
  const collisions = detectCollisions(bboxes, edges);
22353
22489
  const nearCollisions = detectNearCollisions(bboxes, edges);
22354
22490
  if (collisions.length > 0) {
@@ -22388,6 +22524,8 @@ function layout(diag) {
22388
22524
  // 描画側の固定の字の言語 (#847)。 既定 (`en`) と型の外の値は持たせない = 配置の結果の形を
22389
22525
  // 変更前と揃え、記法の書き損じで一部の字だけ日本語になる形を作らない
22390
22526
  ...resolveLang(diag.lang) === "ja" ? { lang: "ja" } : {},
22527
+ // 既定は持ち越さない。既存の LaidDiagram の形を変えず、等幅の図だけ描画へ伝える
22528
+ ...textMetrics === "monospace" ? { textMetrics: "monospace" } : {},
22391
22529
  // 種類も配色と同じく空の目印を出さない。 遮断をここに揃えると手書きの図にも効く
22392
22530
  ...diag.type ? { type: diag.type } : {},
22393
22531
  bboxes,
@@ -24513,6 +24651,7 @@ function CdlEdgeView({
24513
24651
  "data-cdl-edge-label": edge.label,
24514
24652
  "data-cdl-edge-sub": edge.sub ?? "",
24515
24653
  "data-cdl-tone": edge.tone,
24654
+ "data-cdl-edge-role": edge.role,
24516
24655
  children: [
24517
24656
  isDotted ? /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
24518
24657
  /* @__PURE__ */ jsxRuntime.jsx("path", { id: glowPathId, d: glowPathD, fill: "none", stroke: "none" }),
@@ -24664,11 +24803,12 @@ function CdlEdgeGlowView({
24664
24803
  }
24665
24804
  function CdlEdgeLabelView({
24666
24805
  edge,
24667
- active
24806
+ active,
24807
+ textMetrics = "proportional"
24668
24808
  }) {
24669
24809
  if (!hasRenderedLabel(edge)) return null;
24670
24810
  const color = edgeColor(edge);
24671
- const bbox = computeLabelBBoxWorld(edge);
24811
+ const bbox = computeLabelBBoxWorld(edge, textMetrics);
24672
24812
  const boxW = bbox.w;
24673
24813
  const boxH = bbox.h;
24674
24814
  const boxLeftX = bbox.x - edge.labelX;
@@ -24684,6 +24824,8 @@ function CdlEdgeLabelView({
24684
24824
  "data-cdl-edge-label-for": edge.id,
24685
24825
  "data-cdl-edge-label-text": edge.label,
24686
24826
  "data-cdl-edge-sub-text": edge.sub ?? "",
24827
+ "data-cdl-tone": edge.tone,
24828
+ "data-cdl-edge-role": edge.role,
24687
24829
  children: [
24688
24830
  edge.labelPlate !== false && /* @__PURE__ */ jsxRuntime.jsx(
24689
24831
  "rect",
@@ -24737,9 +24879,10 @@ function CdlEdgeLabelView({
24737
24879
  function CdlEdgeEndLabelView({
24738
24880
  edge,
24739
24881
  active,
24740
- \u7AEF
24882
+ \u7AEF,
24883
+ textMetrics = "proportional"
24741
24884
  }) {
24742
- const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF);
24885
+ const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF, textMetrics);
24743
24886
  if (!\u7F6E\u304D\u5834\u6240) return null;
24744
24887
  const color = edgeColor(edge);
24745
24888
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -24748,6 +24891,8 @@ function CdlEdgeEndLabelView({
24748
24891
  "data-cdl-role": "edge-end-label",
24749
24892
  "data-cdl-edge-end-label-for": edge.id,
24750
24893
  "data-cdl-edge-end": \u7AEF,
24894
+ "data-cdl-tone": edge.tone,
24895
+ "data-cdl-edge-role": edge.role,
24751
24896
  x: \u7F6E\u304D\u5834\u6240.x,
24752
24897
  y: \u7F6E\u304D\u5834\u6240.y,
24753
24898
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
@@ -24995,12 +25140,18 @@ var g4 = (v) => Math.round(v / 4) * 4;
24995
25140
  function sequenceStepId() {
24996
25141
  return "seq_step";
24997
25142
  }
24998
- function sequenceBoardMetrics(data) {
25143
+ function sequenceBoardMetrics(data, textMetrics = "proportional") {
24999
25144
  const \u540D\u5E45 = data.actors.map(
25000
- (a) => Math.max(textWidth(a.name, SEQ_NAME), a.subtitle ? textWidth(a.subtitle, SEQ_SUB) : 0)
25145
+ (a) => Math.max(
25146
+ textWidth(a.name, SEQ_NAME, 0, textMetrics),
25147
+ a.subtitle ? textWidth(a.subtitle, SEQ_SUB, 0, textMetrics) : 0
25148
+ )
25001
25149
  );
25002
25150
  const colW = g4(Math.max(SEQ_COL_MIN, Math.max(0, ...\u540D\u5E45) + SEQ_COL_PAD));
25003
- const \u8A9E\u5E45 = Math.max(0, ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL)));
25151
+ const \u8A9E\u5E45 = Math.max(
25152
+ 0,
25153
+ ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL, 0, textMetrics))
25154
+ );
25004
25155
  const gutter = g4(SEQ_EDGE + SEQ_GUTTER_PAD + \u8A9E\u5E45 + SEQ_GUTTER_GAP);
25005
25156
  const headY = SEQ_EDGE + SEQ_HEAD;
25006
25157
  const rowY = (i) => headY + SEQ_ROW_PAD + i * SEQ_ROW;
@@ -25013,11 +25164,12 @@ function sequenceBoardMetrics(data) {
25013
25164
  }
25014
25165
  function SequenceBoardNode({
25015
25166
  node,
25016
- stateValues
25167
+ stateValues,
25168
+ textMetrics = "proportional"
25017
25169
  }) {
25018
25170
  const data = node.sequenceData;
25019
25171
  if (!data) return /* @__PURE__ */ jsxRuntime.jsx("g", { "data-cdl-role": "sequence-board" });
25020
- const m = sequenceBoardMetrics(data);
25172
+ const m = sequenceBoardMetrics(data, textMetrics);
25021
25173
  const x = node.cx - node.w / 2;
25022
25174
  const y = node.cy - node.h / 2;
25023
25175
  const \u73FE\u5728 = (() => {
@@ -25668,7 +25820,8 @@ function GenericNode({
25668
25820
  active,
25669
25821
  value,
25670
25822
  stateValues,
25671
- \u5024\u306E\u540D\u524D
25823
+ \u5024\u306E\u540D\u524D,
25824
+ textMetrics = "proportional"
25672
25825
  }) {
25673
25826
  const base = STYLES[node.kind] ?? FALLBACK;
25674
25827
  const toned = toneColor3(node.tone);
@@ -25807,7 +25960,7 @@ function GenericNode({
25807
25960
  const resolved = node.rows.map((row) => interpolate(row, stateValues, \u5024\u306E\u540D\u524D));
25808
25961
  const splits = resolved.map(splitRow);
25809
25962
  const leftMaxWidth = splits.reduce(
25810
- (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
25963
+ (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false, textMetrics)),
25811
25964
  0
25812
25965
  );
25813
25966
  const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
@@ -26291,8 +26444,8 @@ function \u5024\u3068\u5272\u5408\u306E\u6587\u5B57(\u5024, \u5272\u5408, \u5408
26291
26444
  return \u7D44.\u5024 === null ? \u7D44.\u5272\u5408 : `${\u7D44.\u5024} ${\u7D44.\u5272\u5408}`;
26292
26445
  }
26293
26446
  var \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
26294
- function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587) {
26295
- 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);
26447
+ function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587, textMetrics = "proportional") {
26448
+ 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);
26296
26449
  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);
26297
26450
  }
26298
26451
  function ChartPieNode({
@@ -26300,7 +26453,8 @@ function ChartPieNode({
26300
26453
  active,
26301
26454
  stateValues = {},
26302
26455
  drawing = false,
26303
- progress = 1
26456
+ progress = 1,
26457
+ textMetrics = "proportional"
26304
26458
  }) {
26305
26459
  const instanceId = react.useId().replace(/[^A-Za-z0-9_-]/g, "");
26306
26460
  const x0 = node.cx - node.w / 2;
@@ -26331,15 +26485,26 @@ function ChartPieNode({
26331
26485
  return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
26332
26486
  });
26333
26487
  if (\u5F62 !== "ring") {
26334
- const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
26488
+ const \u5171\u901A = {
26489
+ node,
26490
+ active,
26491
+ data,
26492
+ \u5272\u5408: \u4ECA\u306E\u5272\u5408,
26493
+ x0,
26494
+ y0,
26495
+ drawing,
26496
+ progress,
26497
+ instanceId,
26498
+ textMetrics
26499
+ };
26335
26500
  return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
26336
26501
  }
26337
26502
  const \u540D\u672D\u5E45 = Math.max(
26338
26503
  0,
26339
26504
  ...data.map(
26340
26505
  (_d, i) => Math.max(
26341
- textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
26342
- textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
26506
+ textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A, 0, textMetrics),
26507
+ textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics)
26343
26508
  )
26344
26509
  )
26345
26510
  );
@@ -26354,8 +26519,8 @@ function ChartPieNode({
26354
26519
  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) : [];
26355
26520
  const \u7A74 = \u524D\u3042\u308A ? \u524D\u306E\u5185\u534A\u5F84 : \u5916\u306E\u5185\u534A\u5F84;
26356
26521
  const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total));
26357
- const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587);
26358
- const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08");
26522
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587, textMetrics);
26523
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08", textMetrics);
26359
26524
  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);
26360
26525
  const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
26361
26526
  const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
@@ -26538,14 +26703,24 @@ function \u67A0(node, active) {
26538
26703
  }
26539
26704
  );
26540
26705
  }
26541
- function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
26706
+ function \u5F27\u306E\u5F62({
26707
+ node,
26708
+ active,
26709
+ data,
26710
+ \u5272\u5408,
26711
+ x0,
26712
+ y0,
26713
+ drawing,
26714
+ progress,
26715
+ textMetrics
26716
+ }) {
26542
26717
  const PAD = 20;
26543
26718
  const \u540D\u524D\u306E\u7D1A = 14;
26544
26719
  const \u5272\u5408\u306E\u7D1A = 24;
26545
26720
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
26546
26721
  const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
26547
26722
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
26548
- 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)));
26723
+ 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)));
26549
26724
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
26550
26725
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
26551
26726
  const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
@@ -26631,7 +26806,18 @@ function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
26631
26806
  })
26632
26807
  ] });
26633
26808
  }
26634
- function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
26809
+ function \u8868\u306E\u5F62({
26810
+ node,
26811
+ active,
26812
+ data,
26813
+ \u5272\u5408,
26814
+ x0,
26815
+ y0,
26816
+ drawing,
26817
+ progress,
26818
+ instanceId,
26819
+ textMetrics
26820
+ }) {
26635
26821
  const PAD = 20;
26636
26822
  const \u898B\u51FA\u3057\u306E\u7D1A = 11;
26637
26823
  const \u540D\u524D\u306E\u7D1A = 15;
@@ -26640,9 +26826,18 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
26640
26826
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
26641
26827
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
26642
26828
  const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
26643
- const \u540D\u524D\u5E45 = Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A)));
26644
- 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)));
26645
- 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)));
26829
+ const \u540D\u524D\u5E45 = Math.max(
26830
+ 0,
26831
+ ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics))
26832
+ );
26833
+ const \u5272\u5408\u5E45 = Math.max(
26834
+ textWidth("\u5272\u5408", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
26835
+ ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A, 0, textMetrics))
26836
+ );
26837
+ const \u5B9F\u6570\u5E45 = Math.max(
26838
+ textWidth("\u5024", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
26839
+ ...\u5B9F\u6570\u306E\u6587\u5B57.map((t) => textWidth(t, \u5B9F\u6570\u306E\u7D1A, 0, textMetrics))
26840
+ );
26646
26841
  const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
26647
26842
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
26648
26843
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
@@ -26651,8 +26846,8 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
26651
26846
  const cx = PAD + R;
26652
26847
  const cy = node.h / 2;
26653
26848
  const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)));
26654
- const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587);
26655
- const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08");
26849
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587, textMetrics);
26850
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08", textMetrics);
26656
26851
  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);
26657
26852
  const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
26658
26853
  const \u53F3\u7AEF = node.w - PAD;
@@ -26783,7 +26978,8 @@ function ChartGaugeNode({
26783
26978
  active,
26784
26979
  stateValues = {},
26785
26980
  drawing = false,
26786
- progress = 1
26981
+ progress = 1,
26982
+ textMetrics = "proportional"
26787
26983
  }) {
26788
26984
  const x0 = node.cx - node.w / 2;
26789
26985
  const y0 = node.cy - node.h / 2;
@@ -26802,7 +26998,10 @@ function ChartGaugeNode({
26802
26998
  const \u533A\u753B\u306E\u9593 = 12;
26803
26999
  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);
26804
27000
  const \u5272\u308A\u4ED8\u3051\u308B = (\u4EF6\u305F\u3061) => {
26805
- 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;
27001
+ const \u5E45 = Math.max(
27002
+ \u5370\u306E\u5E452,
27003
+ ...\u4EF6\u305F\u3061.map((d) => textWidth(\u6570\u5024\u306E\u884C(d), \u6570\u5024\u306E\u7D1A, 0, textMetrics))
27004
+ ) + \u533A\u753B\u306E\u9593;
26806
27005
  const \u884C\u306E\u4EF6\u65702 = Math.min(
26807
27006
  Math.max(1, Math.floor(\u4F7F\u3048\u308B\u5E452 / Math.max(\u5E45, 1))),
26808
27007
  Math.max(\u4EF6\u305F\u3061.length, 1)
@@ -26877,7 +27076,7 @@ function ChartGaugeNode({
26877
27076
  return { d, frac, path: \u6247\u306E\u9053(a0, a1, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5916\u534A\u5F84) };
26878
27077
  });
26879
27078
  const \u5408\u8A08\u306E\u6587\u5B57 = \u5B9F\u5024\u8868\u8A18(Math.round(total));
26880
- const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100), 1) / 100;
27079
+ const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100, 0, textMetrics), 1) / 100;
26881
27080
  const \u7D1A\u306E\u5019\u88DC = Math.min(
26882
27081
  // 横 = 字の上の角が内側の円に入る大きさ
26883
27082
  \u5185\u534A\u5F84 / Math.sqrt((\u5358\u4F4D\u5E45 / 2) ** 2 + 1.25 ** 2),
@@ -26970,7 +27169,7 @@ function ChartGaugeNode({
26970
27169
  const y = \u5185\u8A33\u306Ey + \u6BB5\u306E\u9AD8\u3055 * \u6BB5;
26971
27170
  const \u53CE\u307E\u308B\u5E45 = \u5185\u8A33\u306E\u5E45 - \u533A\u753B\u306E\u9593;
26972
27171
  const \u6570\u306E\u884C = \u5185\u8A33\u306E\u6570\u5024[idx] ?? "";
26973
- const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A);
27172
+ const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A, textMetrics);
26974
27173
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-gauge-item", children: [
26975
27174
  /* @__PURE__ */ jsxRuntime.jsx(
26976
27175
  "rect",
@@ -26991,7 +27190,7 @@ function ChartGaugeNode({
26991
27190
  fontSize: \u540D\u524D\u306E\u7D1A,
26992
27191
  fontWeight: 700,
26993
27192
  fill: "var(--cdl-text, #1a1f2a)",
26994
- children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A)
27193
+ children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A, textMetrics)
26995
27194
  }
26996
27195
  ),
26997
27196
  /* @__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(
@@ -27009,12 +27208,12 @@ function ChartGaugeNode({
27009
27208
  function \u6975(cx, cy, r, a) {
27010
27209
  return { x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) };
27011
27210
  }
27012
- function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A) {
27013
- if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A) <= \u4E0A\u9650) return s;
27014
- const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A);
27211
+ function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A, textMetrics = "proportional") {
27212
+ if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A, 0, textMetrics) <= \u4E0A\u9650) return s;
27213
+ const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A, 0, textMetrics);
27015
27214
  let out = "";
27016
27215
  for (const c of s) {
27017
- if (textWidth(out + c, \u7D1A) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
27216
+ if (textWidth(out + c, \u7D1A, 0, textMetrics) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
27018
27217
  out += c;
27019
27218
  }
27020
27219
  return `${out}\u2026`;
@@ -27028,7 +27227,8 @@ function ChartRadialNode({
27028
27227
  active,
27029
27228
  stateValues = {},
27030
27229
  drawing = false,
27031
- progress = 1
27230
+ progress = 1,
27231
+ textMetrics = "proportional"
27032
27232
  }) {
27033
27233
  const x0 = node.cx - node.w / 2;
27034
27234
  const y0 = node.cy - node.h / 2;
@@ -27046,7 +27246,10 @@ function ChartRadialNode({
27046
27246
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E45 + Math.max(
27047
27247
  0,
27048
27248
  ...data.map(
27049
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
27249
+ (d, i) => Math.max(
27250
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
27251
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
27252
+ )
27050
27253
  )
27051
27254
  );
27052
27255
  const \u5F27\u306B\u4F7F\u3048\u308B\u5E45 = node.w - PAD * 2 - \u4E00\u89A7\u306E\u5E45 - \u4E00\u89A7\u3068\u5F27\u306E\u9593;
@@ -27193,7 +27396,8 @@ function arcColor2(tone, idx) {
27193
27396
  function ChartStatNode({
27194
27397
  node,
27195
27398
  active,
27196
- stateValues = {}
27399
+ stateValues = {},
27400
+ textMetrics = "proportional"
27197
27401
  }) {
27198
27402
  const x0 = node.cx - node.w / 2;
27199
27403
  const y0 = node.cy - node.h / 2;
@@ -27222,7 +27426,13 @@ function ChartStatNode({
27222
27426
  const frac = total > 0 ? d.value / total : 0;
27223
27427
  const \u8272 = \u5370\u306E\u8272(d.tone, idx);
27224
27428
  const \u6570\u5024 = \u5B9F\u5024\u8868\u8A18(d.value);
27225
- 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);
27429
+ const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(
27430
+ \u6570\u5024,
27431
+ \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
27432
+ \u533A\u753B.\u6570\u5024\u306E\u7D1A,
27433
+ \u533A\u753B.\u540D\u524D\u306E\u7D1A + 1,
27434
+ textMetrics
27435
+ );
27226
27436
  return /* @__PURE__ */ jsxRuntime.jsxs(
27227
27437
  "g",
27228
27438
  {
@@ -27279,7 +27489,8 @@ function ChartStatNode({
27279
27489
  `\u524D ${\u5B9F\u5024\u8868\u8A18(d.previous)}`,
27280
27490
  \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
27281
27491
  \u533A\u753B.\u524D\u306E\u7D1A,
27282
- 8
27492
+ 8,
27493
+ textMetrics
27283
27494
  ),
27284
27495
  textAnchor: "middle",
27285
27496
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -27368,9 +27579,9 @@ function \u533A\u753B\u306E\u5272\u4ED8(w, h, \u4EF6\u6570, \u524D\u3092\u51FA\u
27368
27579
  \u67A0: (idx) => ({ x: \u5E45 * idx, y: 0, w: \u5E45, h })
27369
27580
  };
27370
27581
  }
27371
- function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650) {
27582
+ function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650, textMetrics = "proportional") {
27372
27583
  let \u7D1A = \u521D\u671F;
27373
- while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
27584
+ while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A, 0, textMetrics) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
27374
27585
  return \u7D1A;
27375
27586
  }
27376
27587
  function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
@@ -27405,7 +27616,8 @@ function ChartWaffleNode({
27405
27616
  active,
27406
27617
  stateValues = {},
27407
27618
  drawing = false,
27408
- progress = 1
27619
+ progress = 1,
27620
+ textMetrics = "proportional"
27409
27621
  }) {
27410
27622
  const x0 = node.cx - node.w / 2;
27411
27623
  const y0 = node.cy - node.h / 2;
@@ -27424,7 +27636,10 @@ function ChartWaffleNode({
27424
27636
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E452 + Math.max(
27425
27637
  0,
27426
27638
  ...data.map(
27427
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
27639
+ (d, i) => Math.max(
27640
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
27641
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
27642
+ )
27428
27643
  )
27429
27644
  );
27430
27645
  const \u4F7F\u3048\u308B\u9AD8\u3055 = node.h - PAD * 2;
@@ -27526,7 +27741,8 @@ function ChartStackedBarNode({
27526
27741
  active,
27527
27742
  stateValues = {},
27528
27743
  drawing = false,
27529
- progress = 1
27744
+ progress = 1,
27745
+ textMetrics = "proportional"
27530
27746
  }) {
27531
27747
  const x0 = node.cx - node.w / 2;
27532
27748
  const y0 = node.cy - node.h / 2;
@@ -27536,7 +27752,7 @@ function ChartStackedBarNode({
27536
27752
  const \u540D\u524D\u306E\u7D1A = 13;
27537
27753
  const \u533A\u753B\u306E\u7D1A = 12;
27538
27754
  const \u6642\u70B9\u306E\u7D1A = 13;
27539
- 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);
27755
+ 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);
27540
27756
  const \u5E2F\u306E\u5DE6 = PAD + \u6642\u70B9\u306E\u5E45;
27541
27757
  const \u5E2F\u306E\u5E45 = Math.max(40, node.w - \u5E2F\u306E\u5DE6 - PAD);
27542
27758
  const \u5E2F\u306E\u9AD8\u3055 = 44;
@@ -27629,7 +27845,7 @@ function ChartStackedBarNode({
27629
27845
  })()
27630
27846
  ] }, `bar-${\u6BB5}`);
27631
27847
  }),
27632
- \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A).map(({ d, idx, x, \u884C }) => {
27848
+ \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A, textMetrics).map(({ d, idx, x, \u884C }) => {
27633
27849
  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;
27634
27850
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-role": "chart-stacked-bar-legend", children: [
27635
27851
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x, y: y - 5, width: 10, height: 10, rx: 2, fill: \u5370\u306E\u82723(d.tone, idx) }),
@@ -27664,12 +27880,12 @@ function \u5370\u306E\u82723(tone, idx) {
27664
27880
  }
27665
27881
  var \u5370\u304B\u3089\u540D\u524D\u307E\u3067 = 16;
27666
27882
  var \u4EF6\u306E\u9593 = 10;
27667
- function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A) {
27883
+ function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A, textMetrics = "proportional") {
27668
27884
  const out = [];
27669
27885
  let x = \u5DE6;
27670
27886
  let \u884C = 0;
27671
27887
  data.forEach((d, idx) => {
27672
- const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A);
27888
+ const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A, 0, textMetrics);
27673
27889
  if (x > \u5DE6 && x + \u5E45 > \u53F3\u7AEF) {
27674
27890
  \u884C += 1;
27675
27891
  x = \u5DE6;
@@ -27685,7 +27901,8 @@ function ChartSlopeNode({
27685
27901
  active,
27686
27902
  stateValues = {},
27687
27903
  drawing = false,
27688
- progress = 1
27904
+ progress = 1,
27905
+ textMetrics = "proportional"
27689
27906
  }) {
27690
27907
  const x0 = node.cx - node.w / 2;
27691
27908
  const y0 = node.cy - node.h / 2;
@@ -27728,16 +27945,22 @@ function ChartSlopeNode({
27728
27945
  const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
27729
27946
  (s) => \u5F62 === "delta" ? \u5897\u6E1B\u8868\u8A18(s.\u524D, s.\u4ECA) : \u5B9F\u5024\u8868\u8A18(s.\u4ECA)
27730
27947
  );
27731
- const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
27732
- const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
27948
+ const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
27949
+ const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
27733
27950
  const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
27734
27951
  0,
27735
27952
  (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
27736
27953
  );
27737
- 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);
27954
+ const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(
27955
+ \u7CFB\u5217\u305F\u3061.map((s) => s.\u540D\u524D),
27956
+ \u540D\u524D\u306B\u4F7F\u3048\u308B,
27957
+ \u540D\u524D\u306E\u4E0A\u9650\u7D1A,
27958
+ \u540D\u524D\u306E\u4E0B\u9650\u7D1A,
27959
+ textMetrics
27960
+ );
27738
27961
  const \u540D\u524D\u5E45 = Math.min(
27739
27962
  \u540D\u524D\u306B\u4F7F\u3048\u308B,
27740
- Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A)))
27963
+ Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A, 0, textMetrics)))
27741
27964
  );
27742
27965
  const \u5DE6\u306E\u4F59\u767D = \u540D\u524D\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067;
27743
27966
  const \u53F3\u306E\u4F59\u767D = \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u540D\u524D\u5E45;
@@ -27923,10 +28146,12 @@ function \u5370\u306E\u82724(tone, idx) {
27923
28146
  if (tone) return TONE[tone];
27924
28147
  return chartSeriesColor(idx);
27925
28148
  }
27926
- function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650) {
28149
+ function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650, textMetrics = "proportional") {
27927
28150
  if (\u540D\u524D\u305F\u3061.length === 0) return \u4E0A\u9650;
27928
28151
  let \u7D1A = \u4E0A\u9650;
27929
- while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A))) > \u5E45) \u7D1A -= 1;
28152
+ while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A, 0, textMetrics))) > \u5E45) {
28153
+ \u7D1A -= 1;
28154
+ }
27930
28155
  return \u7D1A;
27931
28156
  }
27932
28157
  function \u5C0F\u6570\u306E\u6841(n) {
@@ -27974,6 +28199,7 @@ function ChartBarNode({
27974
28199
  return { y: yAt(v), value: v };
27975
28200
  });
27976
28201
  const \u6FC3\u3055 = (v) => vMax > 0 ? v >= vMax ? 1 : 0.45 : 0.9;
28202
+ const \u4E3B\u5F79\u306E\u68D2\u304B = (v) => vMax > 0 && v >= vMax;
27977
28203
  const \u89D2\u4E38 = Math.min(barW * 0.06, 8);
27978
28204
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
27979
28205
  const \u6A2A\u8EF8\u306Ey = PAD_TOP2 + canvasH;
@@ -28040,6 +28266,7 @@ function ChartBarNode({
28040
28266
  {
28041
28267
  "data-cdl-role": "chart-bar",
28042
28268
  "data-cdl-unresolved": d.unresolved ? "true" : void 0,
28269
+ "data-cdl-emphasis": \u4E3B\u5F79\u306E\u68D2\u304B(d.value) ? "primary" : void 0,
28043
28270
  x: bx,
28044
28271
  y: by,
28045
28272
  width: barW,
@@ -28386,7 +28613,8 @@ function FunnelNode({
28386
28613
  active,
28387
28614
  stateValues = {},
28388
28615
  drawing = false,
28389
- progress = 1
28616
+ progress = 1,
28617
+ textMetrics = "proportional"
28390
28618
  }) {
28391
28619
  const x0 = node.cx - node.w / 2;
28392
28620
  const y0 = node.cy - node.h / 2;
@@ -28435,7 +28663,11 @@ function FunnelNode({
28435
28663
  const \u540D\u524D\u306E\u5B9F\u5B57 = \u540D\u524D\u306E\u5B57 * \u7E26\u500D;
28436
28664
  const \u88DC\u8DB3\u306E\u67A0\u5B57 = \u88DC\u8DB3\u306E\u5B57 * \u7E26\u500D;
28437
28665
  const \u53CE\u307E\u308B\u5E45 = Math.max(0, bottomW - 16);
28438
- 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);
28666
+ const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(
28667
+ \u88DC\u8DB3,
28668
+ { fontSize: \u88DC\u8DB3\u306E\u67A0\u5B57, fontWeight: 500, textMetrics },
28669
+ \u53CE\u307E\u308B\u5E45
28670
+ );
28439
28671
  const \u584A\u306E\u4E0A = y + stageH / 2 - (\u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 1.25) / 2;
28440
28672
  const \u540D\u524D\u306Ey = \u88DC\u8DB3\u3042\u308A ? \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 0.95 : y + stageH / 2 + 5;
28441
28673
  const \u88DC\u8DB3\u306Ey = \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 0.95;
@@ -28538,7 +28770,8 @@ function \u7573\u3093\u3060\u6587(\u4EF6\u6570) {
28538
28770
  function QuadrantNode({
28539
28771
  node,
28540
28772
  active,
28541
- stateValues = {}
28773
+ stateValues = {},
28774
+ textMetrics = "proportional"
28542
28775
  }) {
28543
28776
  const x0 = node.cx - node.w / 2;
28544
28777
  const y0 = node.cy - node.h / 2;
@@ -28557,7 +28790,10 @@ function QuadrantNode({
28557
28790
  const SUB_FONT = 10;
28558
28791
  const axisLabelPad = (text) => Math.max(
28559
28792
  PAD_MIN,
28560
- measureTextWidth(`\u2190 ${text}`, { fontSize: AXIS_LABEL_FONT}) + 12
28793
+ measureTextWidth(`\u2190 ${text}`, {
28794
+ fontSize: AXIS_LABEL_FONT,
28795
+ textMetrics
28796
+ }) + 12
28561
28797
  );
28562
28798
  const padBudget = Math.max(0, node.w * 0.5 - PAD_MIN * 2);
28563
28799
  const wantLeft = axisLabelPad(data.xAxis.left) - PAD_MIN;
@@ -28811,7 +29047,11 @@ function QuadrantNode({
28811
29047
  ITEM_MIN_W,
28812
29048
  Math.max(
28813
29049
  ...\u884C\u30892.map(
28814
- (r) => measureTextWidth(r.text, { fontSize: r.size, fontWeight: r.weight })
29050
+ (r) => measureTextWidth(r.text, {
29051
+ fontSize: r.size,
29052
+ fontWeight: r.weight,
29053
+ textMetrics
29054
+ })
28815
29055
  )
28816
29056
  ) + ITEM_PAD_X * 2
28817
29057
  )
@@ -28837,7 +29077,7 @@ function QuadrantNode({
28837
29077
  const \u88DC\u8DB3 = (it.subtitle ?? "").trim();
28838
29078
  const \u88DC\u8DB3\u306E\u5B57 = SUB_FONT * \u53CE\u3081\u308B\u500D\u7387(
28839
29079
  \u88DC\u8DB3,
28840
- { fontSize: SUB_FONT, fontWeight: 500 },
29080
+ { fontSize: SUB_FONT, fontWeight: 500, textMetrics },
28841
29081
  Math.max(0, \u5E45 - ITEM_PAD_X * 2)
28842
29082
  );
28843
29083
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
@@ -29241,24 +29481,30 @@ var EYEBROW_GAP2 = 8;
29241
29481
  var EYEBROW_TRACKING = 2;
29242
29482
  var SUB_SIZE = 11;
29243
29483
  var SUB_GAP = 4;
29244
- function labelBlock(node, pos, size, band) {
29484
+ function labelBlock(node, pos, size, band, textMetrics = "proportional") {
29245
29485
  const \u4E0A = node.eyebrow ? size + EYEBROW_GAP2 + EYEBROW_SIZE2 * ASCENT2 : size * ASCENT2;
29246
29486
  const \u4E0B = node.subtitle ? size + SUB_GAP + SUB_SIZE * DESCENT2 : size * DESCENT2;
29247
29487
  const \u5E45 = Math.max(
29248
- textWidth(node.title ?? "", size),
29249
- node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING) : 0,
29250
- node.subtitle ? textWidth(node.subtitle, SUB_SIZE) : 0
29488
+ textWidth(node.title ?? "", size, 0, textMetrics),
29489
+ node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING, textMetrics) : 0,
29490
+ node.subtitle ? textWidth(node.subtitle, SUB_SIZE, 0, textMetrics) : 0
29251
29491
  );
29252
- const \u984C\u5E45 = textWidth(node.title ?? "", size);
29253
- const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, textWidth) : 0;
29492
+ const \u984C\u5E45 = textWidth(node.title ?? "", size, 0, textMetrics);
29493
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
29494
+ const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, \u6E2C\u308B) : 0;
29254
29495
  const { k, x, y: baseline } = fitLabel(band, { \u4E0A, \u4E0B, \u5E45 }, pos, \u4E0B\u9650);
29255
29496
  return { k, x, baseline, \u4E0A\u7AEF: baseline - \u4E0A * k, \u4E0B\u7AEF: baseline + \u4E0B * k };
29256
29497
  }
29257
- function commonLabel(node, pos, size, band) {
29258
- const \u584A = labelBlock(node, pos, size, band);
29498
+ function commonLabel(node, pos, size, band, textMetrics = "proportional") {
29499
+ const \u584A = labelBlock(node, pos, size, band, textMetrics);
29259
29500
  const k = \u584A.k;
29260
29501
  const x = \u584A.x;
29261
- 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));
29502
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
29503
+ t,
29504
+ \u5927\u304D\u3055 * k,
29505
+ band.w,
29506
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
29507
+ );
29262
29508
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
29263
29509
  node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx(
29264
29510
  "text",
@@ -29309,7 +29555,7 @@ var RULE_GAP_RATIO = 0.1;
29309
29555
  var RULE_PAD_MAX = 20;
29310
29556
  var RULE_PAD_RATIO = 0.14;
29311
29557
  var RULE_SHRINK_RATIO = 0.055;
29312
- function ShapeFileNode({ node, active }) {
29558
+ function ShapeFileNode({ node, active, textMetrics = "proportional" }) {
29313
29559
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29314
29560
  const \u7D19h = \u5E2F.h;
29315
29561
  const \u7D19w = Math.min(\u5E2F.w, \u7D19h * 0.72);
@@ -29329,7 +29575,7 @@ function ShapeFileNode({ node, active }) {
29329
29575
  const foldTriangle = `M ${x + \u7D19w - fold} ${y} L ${x + \u7D19w} ${y + fold} L ${x + \u7D19w - fold} ${y + fold} Z`;
29330
29576
  const \u540D\u524D\u5E2F = { x, y, w: \u7D19w, h: \u7D19h };
29331
29577
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + node.h * 0.12 };
29332
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F);
29578
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics);
29333
29579
  const \u9593\u9694 = Math.min(RULE_GAP_MAX, \u7D19h * RULE_GAP_RATIO);
29334
29580
  const \u7DDA\u4F59\u767D = Math.min(RULE_PAD_MAX, \u7D19w * RULE_PAD_RATIO);
29335
29581
  const textLines = [0, 1, 2].map((i) => ({ i, ly: y + fold + \u9593\u9694 * (i + 1) })).filter(({ ly }) => ly < \u540D\u524D.\u4E0A\u7AEF);
@@ -29361,12 +29607,12 @@ function ShapeFileNode({ node, active }) {
29361
29607
  i
29362
29608
  );
29363
29609
  }),
29364
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F)
29610
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics)
29365
29611
  ] });
29366
29612
  }
29367
29613
  var TAB_H_MAX = 22;
29368
29614
  var TAB_H_RATIO = 0.3;
29369
- function ShapeFolderNode({ node, active }) {
29615
+ function ShapeFolderNode({ node, active, textMetrics = "proportional" }) {
29370
29616
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29371
29617
  const x = \u5E2F.x;
29372
29618
  const y = \u5E2F.y;
@@ -29387,7 +29633,7 @@ function ShapeFolderNode({ node, active }) {
29387
29633
  const \u5883\u754Cy = y + tabH + Math.min(8, (\u5E2F.h - tabH) * 0.2);
29388
29634
  const \u7AEF = Math.min(6, \u5E2F.w * 0.1);
29389
29635
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 18 };
29390
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F);
29636
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics);
29391
29637
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
29392
29638
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, \u5E2F.w * 0.44),
29393
29639
  /* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -29403,13 +29649,13 @@ function ShapeFolderNode({ node, active }) {
29403
29649
  opacity: 0.35
29404
29650
  }
29405
29651
  ),
29406
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F)
29652
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics)
29407
29653
  ] });
29408
29654
  }
29409
29655
  var CLOUD_VB_W = 640;
29410
29656
  var CLOUD_VB_H = 512;
29411
29657
  var CLOUD_W_RATIO = 0.9;
29412
- function ShapeCloudNode({ node, active }) {
29658
+ function ShapeCloudNode({ node, active, textMetrics = "proportional" }) {
29413
29659
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29414
29660
  const frame = commonFrame(active);
29415
29661
  const \u7D20\u306E\u500D\u7387 = Math.min(\u5E2F.h / CLOUD_VB_H, \u5E2F.w * CLOUD_W_RATIO / CLOUD_VB_W);
@@ -29432,13 +29678,13 @@ function ShapeCloudNode({ node, active }) {
29432
29678
  strokeLinejoin: "round"
29433
29679
  }
29434
29680
  ) }),
29435
- commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F)
29681
+ commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F, textMetrics)
29436
29682
  ] });
29437
29683
  }
29438
29684
  var CYLINDER_RY_MAX = 18;
29439
29685
  var CYLINDER_RY_RATIO = 0.1;
29440
29686
  var CYLINDER_DISKS = [0.3, 0.55, 0.8];
29441
- function ShapeCylinderNode({ node, active }) {
29687
+ function ShapeCylinderNode({ node, active, textMetrics = "proportional" }) {
29442
29688
  const \u5E2F = bodyBand(node, { \u5F71ry: CYLINDER_SHADOW_RY });
29443
29689
  const x = \u5E2F.x;
29444
29690
  const y = \u5E2F.y;
@@ -29455,7 +29701,7 @@ function ShapeCylinderNode({ node, active }) {
29455
29701
  const \u84CB\u5E95 = y + ry * 2;
29456
29702
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 6 };
29457
29703
  const \u540D\u524D\u5E2F = { x: \u5E2F.x, y: \u84CB\u5E95, w: \u5E2F.w, h: Math.max(0, \u5E2F.\u5E95 - \u84CB\u5E95) };
29458
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F);
29704
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics);
29459
29705
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
29460
29706
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, rx * 0.85, CYLINDER_SHADOW_RY),
29461
29707
  /* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -29479,11 +29725,11 @@ function ShapeCylinderNode({ node, active }) {
29479
29725
  },
29480
29726
  i
29481
29727
  )),
29482
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F)
29728
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics)
29483
29729
  ] });
29484
29730
  }
29485
29731
  var HEX_DOT_R = 2.5;
29486
- function ShapeHexagonNode({ node, active }) {
29732
+ function ShapeHexagonNode({ node, active, textMetrics = "proportional" }) {
29487
29733
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY, \u5916: Math.max(HEX_DOT_R, FRAME_HALF) });
29488
29734
  const cx = \u5E2F.cx;
29489
29735
  const cy = \u5E2F.cy;
@@ -29506,11 +29752,12 @@ function ShapeHexagonNode({ node, active }) {
29506
29752
  node,
29507
29753
  { x: cx, y: node.cy + 6 },
29508
29754
  16,
29509
- { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h }
29755
+ { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h },
29756
+ textMetrics
29510
29757
  )
29511
29758
  ] });
29512
29759
  }
29513
- function ShapeDiamondNode({ node, active }) {
29760
+ function ShapeDiamondNode({ node, active, textMetrics = "proportional" }) {
29514
29761
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29515
29762
  const cx = \u5E2F.cx;
29516
29763
  const cy = \u5E2F.cy;
@@ -29551,13 +29798,14 @@ function ShapeDiamondNode({ node, active }) {
29551
29798
  y: cy - \u5E2F.h * innerScale / 4,
29552
29799
  w: \u5E2F.w * innerScale / 2,
29553
29800
  h: \u5E2F.h * innerScale / 2
29554
- }
29801
+ },
29802
+ textMetrics
29555
29803
  )
29556
29804
  ] });
29557
29805
  }
29558
29806
  var STACK_OFFSET_MAX = 12;
29559
29807
  var STACK_OFFSET_RATIO = 0.15;
29560
- function ShapeStackNode({ node, active }) {
29808
+ function ShapeStackNode({ node, active, textMetrics = "proportional" }) {
29561
29809
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29562
29810
  const x = \u5E2F.x;
29563
29811
  const y = \u5E2F.y;
@@ -29611,7 +29859,8 @@ function ShapeStackNode({ node, active }) {
29611
29859
  node,
29612
29860
  { x: \u624B\u524Dcx, y: node.cy + \u305A\u308C + 6 },
29613
29861
  15,
29614
- { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH }
29862
+ { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH },
29863
+ textMetrics
29615
29864
  )
29616
29865
  ] });
29617
29866
  }
@@ -29623,16 +29872,22 @@ var PERSON_BODY_LEN = 90;
29623
29872
  var PERSON_SHADOW_DY = 20;
29624
29873
  var PERSON_SHADOW_RY = 4;
29625
29874
  var PERSON_SHADOW_RX = 55;
29626
- function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
29875
+ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan, textMetrics = "proportional") {
29627
29876
  const \u5E45 = Math.max(
29628
- textWidth(node.title ?? "", plan.\u540D\u524D.size),
29629
- node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING) : 0,
29630
- node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size) : 0
29877
+ textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics),
29878
+ node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING, textMetrics) : 0,
29879
+ node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size, 0, textMetrics) : 0
29631
29880
  );
29632
- const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size);
29633
- 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;
29881
+ const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics);
29882
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
29883
+ 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;
29634
29884
  const k = \u5E45 > 0 && \u5E45\u4E0A\u9650 > 0 ? Math.min(1, Math.max(\u5E45\u4E0A\u9650 / \u5E45, \u4E0B\u9650)) : 1;
29635
- 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));
29885
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
29886
+ t,
29887
+ \u5927\u304D\u3055 * k,
29888
+ \u5E45\u4E0A\u9650,
29889
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
29890
+ );
29636
29891
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
29637
29892
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsxRuntime.jsx(
29638
29893
  "text",
@@ -29673,7 +29928,7 @@ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
29673
29928
  )
29674
29929
  ] });
29675
29930
  }
29676
- function ShapePersonNode({ node, active }) {
29931
+ function ShapePersonNode({ node, active, textMetrics = "proportional" }) {
29677
29932
  const r = shapeRegion(node);
29678
29933
  const cx = r.cx;
29679
29934
  const strokeColor = active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)";
@@ -29735,7 +29990,7 @@ function ShapePersonNode({ node, active }) {
29735
29990
  )
29736
29991
  ] })
29737
29992
  ),
29738
- planLabel(node, r.cx, Math.max(0, node.w), r.label)
29993
+ planLabel(node, r.cx, Math.max(0, node.w), r.label, textMetrics)
29739
29994
  ] });
29740
29995
  }
29741
29996
  var commonFrame2 = (active) => ({
@@ -29985,7 +30240,12 @@ function ShapeTerminalNode({ node, active, lang }) {
29985
30240
  )
29986
30241
  ] });
29987
30242
  }
29988
- function ShapeCodeBlockNode({ node, active, lang }) {
30243
+ function ShapeCodeBlockNode({
30244
+ node,
30245
+ active,
30246
+ lang,
30247
+ textMetrics = "proportional"
30248
+ }) {
29989
30249
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
29990
30250
  const frame = commonFrame2(active);
29991
30251
  const \u7DDA = frame.strokeWidth / 2;
@@ -29996,7 +30256,10 @@ function ShapeCodeBlockNode({ node, active, lang }) {
29996
30256
  const lineFont = "ui-monospace, SFMono-Regular, Menlo, monospace";
29997
30257
  const \u672D = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("codeBlock.fileName"));
29998
30258
  const \u672D\u306E\u5B57 = 11;
29999
- const \u30BF\u30D6\u5E45 = Math.min(Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0) + 24), Math.max(0, w));
30259
+ const \u30BF\u30D6\u5E45 = Math.min(
30260
+ Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0, textMetrics) + 24),
30261
+ Math.max(0, w)
30262
+ );
30000
30263
  const \u30BF\u30D6\u9AD8 = 24;
30001
30264
  const \u89D2 = 10;
30002
30265
  const \u6E9D = 32;
@@ -30036,7 +30299,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
30036
30299
  { text: \u672D, size: \u672D\u306E\u5B57, \u5E2F: { \u5E45: \u30BF\u30D6\u5E45, \u9AD8\u3055: \u30BF\u30D6\u9AD8 } },
30037
30300
  { text: "1", size: \u884C\u756A\u53F7\u306E\u5B57, \u5E2F: { \u5E45: \u6E9D - \u6301\u3061\u4E0A\u3052, \u9AD8\u3055: \u884C\u9593 } }
30038
30301
  ];
30039
- const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089);
30302
+ const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
30040
30303
  const tabW = \u30BF\u30D6\u5E45 * \u500D;
30041
30304
  const tabH = \u30BF\u30D6\u9AD8 * \u500D;
30042
30305
  const \u4E38 = \u89D2 * \u500D;
@@ -30075,7 +30338,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
30075
30338
  "data-cdl-counter-scaled": "1",
30076
30339
  x: x + tabW / 2,
30077
30340
  y: y + tabH / 2 + 4 * \u500D,
30078
- fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW),
30341
+ fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW, textMetrics),
30079
30342
  fontFamily: lineFont,
30080
30343
  textAnchor: "middle",
30081
30344
  fill: "#e6edf3",
@@ -30157,7 +30420,12 @@ function ShapeCodeBlockNode({ node, active, lang }) {
30157
30420
  )
30158
30421
  ] });
30159
30422
  }
30160
- function ShapeKanbanCardNode({ node, active, lang }) {
30423
+ function ShapeKanbanCardNode({
30424
+ node,
30425
+ active,
30426
+ lang,
30427
+ textMetrics = "proportional"
30428
+ }) {
30161
30429
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
30162
30430
  const frame = commonFrame2(active);
30163
30431
  const \u7DDA = frame.strokeWidth / 2;
@@ -30211,7 +30479,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
30211
30479
  );
30212
30480
  const \u8AAC\u660E = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("kanbanCard.task"));
30213
30481
  const \u72B6\u614B = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.eyebrow, \u5B57\u5F15("kanbanCard.status"));
30214
- const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45);
30482
+ const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45, textMetrics);
30215
30483
  const \u8AAC\u660E\u306E\u5B57 = \u540D\u524D.size * \u8AAC\u660E\u5B57\u6BD4;
30216
30484
  const \u4F7F\u3048\u308B\u5E452 = Math.max(0, w - \u5DE6\u53F3\u4F59\u767D * \u500D * 2);
30217
30485
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
@@ -30298,7 +30566,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
30298
30566
  {
30299
30567
  x: x + w / 2,
30300
30568
  y: \u540D\u524D.y + \u540D\u524D.size * \u8AAC\u660E\u57FA\u6E96\u6BD4,
30301
- fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452),
30569
+ fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452, textMetrics),
30302
30570
  textAnchor: "middle",
30303
30571
  fill: "var(--cdl-text-dim, #5a6270)",
30304
30572
  children: \u8AAC\u660E
@@ -30589,18 +30857,33 @@ var externalLabel = (node, cx, bottomY) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRu
30589
30857
  )
30590
30858
  ] });
30591
30859
  var LABEL_EYEBROW_SPACING = 2;
30592
- function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
30593
- const \u5E45 = textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
30594
- 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;
30860
+ function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
30861
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
30862
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
30863
+ 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;
30595
30864
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
30596
30865
  const size = \u5927\u304D\u3055 * \u500D\u7387;
30597
30866
  const spacing = \u5B57\u9593 * \u500D\u7387;
30598
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => textWidth(u, f, spacing)) };
30599
- }
30600
- function bottomLabel(node, cx, plan) {
30601
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING, node.w);
30602
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
30603
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
30867
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
30868
+ }
30869
+ function bottomLabel(node, cx, plan, textMetrics = "proportional") {
30870
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(
30871
+ node.eyebrow ?? "",
30872
+ plan.\u80A9\u66F8?.size ?? 0,
30873
+ LABEL_EYEBROW_SPACING,
30874
+ node.w,
30875
+ false,
30876
+ textMetrics
30877
+ );
30878
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
30879
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(
30880
+ node.subtitle ?? "",
30881
+ plan.\u8AAC\u660E?.size ?? 0,
30882
+ 0,
30883
+ node.w,
30884
+ false,
30885
+ textMetrics
30886
+ );
30604
30887
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
30605
30888
  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 }),
30606
30889
  /* @__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 }),
@@ -30614,7 +30897,7 @@ var RACK_SLOT_N = 4;
30614
30897
  var RACK_BOTTOM = 8;
30615
30898
  var RACK_H = RACK_SLOT_TOP + RACK_SLOT_N * RACK_SLOT_H + (RACK_SLOT_N - 1) * RACK_SLOT_GAP + RACK_BOTTOM;
30616
30899
  var RACK_W_MIN = 120;
30617
- function ShapeServerRackNode({ node, active }) {
30900
+ function ShapeServerRackNode({ node, active, textMetrics = "proportional" }) {
30618
30901
  const r = shapeRegion(node);
30619
30902
  const frame = commonFrame3(active);
30620
30903
  const \u7DDA = frame.strokeWidth / 2;
@@ -30696,7 +30979,7 @@ function ShapeServerRackNode({ node, active }) {
30696
30979
  ] }, i);
30697
30980
  })
30698
30981
  ] })),
30699
- bottomLabel(node, r.cx, r.label)
30982
+ bottomLabel(node, r.cx, r.label, textMetrics)
30700
30983
  ] });
30701
30984
  }
30702
30985
  var HUB_R = 30;
@@ -30704,7 +30987,7 @@ var ARM_LEN = 68;
30704
30987
  var END_R = 7;
30705
30988
  var WIFI_ARC_R = [10, 16, 22];
30706
30989
  var WIFI_BASE_Y = 5;
30707
- function ShapeNetworkNodeNode({ node, active }) {
30990
+ function ShapeNetworkNodeNode({ node, active, textMetrics = "proportional" }) {
30708
30991
  const r = shapeRegion(node);
30709
30992
  const cx = r.cx;
30710
30993
  const cy = r.cy;
@@ -30780,12 +31063,12 @@ function ShapeNetworkNodeNode({ node, active }) {
30780
31063
  )),
30781
31064
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy: cy + WIFI_BASE_Y + 3, r: 2.5, fill: "var(--cdl-tone-accent, #2d6a8f)", stroke: "none" })
30782
31065
  ] })),
30783
- bottomLabel(node, r.cx, r.label)
31066
+ bottomLabel(node, r.cx, r.label, textMetrics)
30784
31067
  ] });
30785
31068
  }
30786
31069
  var PHONE_H = 240;
30787
31070
  var PHONE_W = 110;
30788
- function ShapeMobileDeviceNode({ node, active }) {
31071
+ function ShapeMobileDeviceNode({ node, active, textMetrics = "proportional" }) {
30789
31072
  const r = shapeRegion(node);
30790
31073
  const frame = commonFrame3(active);
30791
31074
  const \u7DDA = frame.strokeWidth / 2;
@@ -30852,7 +31135,7 @@ function ShapeMobileDeviceNode({ node, active }) {
30852
31135
  }
30853
31136
  )
30854
31137
  ] })),
30855
- bottomLabel(node, r.cx, r.label)
31138
+ bottomLabel(node, r.cx, r.label, textMetrics)
30856
31139
  ] });
30857
31140
  }
30858
31141
  function ShapeIotSensorNode({ node, active }) {
@@ -31123,7 +31406,7 @@ var SAT_DISH_R = 12;
31123
31406
  var SAT_DISH_STEM = 12;
31124
31407
  var SAT_MAST_LEN = 22;
31125
31408
  var SAT_MAST_TIP_R = 4;
31126
- function ShapeSatelliteNode({ node, active }) {
31409
+ function ShapeSatelliteNode({ node, active, textMetrics = "proportional" }) {
31127
31410
  const r = shapeRegion(node);
31128
31411
  const cx = r.cx;
31129
31412
  const cy = r.cy;
@@ -31312,7 +31595,7 @@ function ShapeSatelliteNode({ node, active }) {
31312
31595
  ),
31313
31596
  /* @__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" }) })
31314
31597
  ] })),
31315
- bottomLabel(node, r.cx, r.label)
31598
+ bottomLabel(node, r.cx, r.label, textMetrics)
31316
31599
  ] });
31317
31600
  }
31318
31601
  var FRAME_SW_ACTIVE = 3;
@@ -31398,9 +31681,9 @@ function blockchainNodeExtent(strokeWidth) {
31398
31681
  const \u6A2A = (NODE_PEER_DIST + NODE_PEER_R) * Math.cos(Math.PI / 6) + \u7DDA;
31399
31682
  return { \u4E0A: \u7E26, \u4E0B: \u7E26, \u5DE6: \u6A2A, \u53F3: \u6A2A };
31400
31683
  }
31401
- function bottomLabel2(node, cx, plan) {
31684
+ function bottomLabel2(node, cx, plan, textMetrics = "proportional") {
31402
31685
  const \u53CE\u3081\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593, \u984C\u304B = false) => {
31403
- const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f) + ls * [...u].length;
31686
+ const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f, textMetrics) + ls * [...u].length;
31404
31687
  const \u7D20\u306E\u5E45 = \u6E2C\u308B(t, \u5927\u304D\u3055, \u5B57\u9593);
31405
31688
  const \u53CE\u307E\u308B = \u7D20\u306E\u5E45 > node.w && node.w > 0 ? node.w / \u7D20\u306E\u5E45 : 1;
31406
31689
  const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(t, \u5927\u304D\u3055, \u5B57\u9593, node.w, \u6E2C\u308B) : 0;
@@ -31433,7 +31716,12 @@ function EthereumDiamond({ cx, cy, h, colors }) {
31433
31716
  /* @__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" })
31434
31717
  ] });
31435
31718
  }
31436
- function ShapeSmartContractNode({ node, active, lang }) {
31719
+ function ShapeSmartContractNode({
31720
+ node,
31721
+ active,
31722
+ lang,
31723
+ textMetrics = "proportional"
31724
+ }) {
31437
31725
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
31438
31726
  const frame = commonFrame4(active);
31439
31727
  const r = shapeRegion(node);
@@ -31474,7 +31762,7 @@ function ShapeSmartContractNode({ node, active, lang }) {
31474
31762
  }
31475
31763
  ];
31476
31764
  const art = (\u500D\u7387) => {
31477
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
31765
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31478
31766
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31479
31767
  /* @__PURE__ */ jsxRuntime.jsx("path", { "data-cdl-role": "node-body", d: path, ...frame, strokeLinejoin: "round" }),
31480
31768
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: foldPath, fill: "none", stroke: frame.stroke, strokeWidth: frame.strokeWidth, strokeLinejoin: "round" }),
@@ -31496,10 +31784,10 @@ function ShapeSmartContractNode({ node, active, lang }) {
31496
31784
  };
31497
31785
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31498
31786
  fitArt(r, smartContractExtent(frame.strokeWidth), art),
31499
- bottomLabel2(node, r.cx, r.label)
31787
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31500
31788
  ] });
31501
31789
  }
31502
- var \u5B57\u306E\u5E45 = (text, size) => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size);
31790
+ var \u5B57\u306E\u5E45 = (text, size, textMetrics = "proportional") => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, 0, textMetrics);
31503
31791
  var BLOCK_DEFAULT_FIELDS = [
31504
31792
  { key: "hash", label: "blockchainBlock.hash", value: { text: "0xaf31..." } },
31505
31793
  { key: "prev", label: "blockchainBlock.prev", value: { text: "0x7b3f..." } },
@@ -31507,10 +31795,16 @@ var BLOCK_DEFAULT_FIELDS = [
31507
31795
  { key: "nonce", label: "blockchainBlock.nonce", value: { text: "82,914" } },
31508
31796
  { key: "tx", label: "blockchainBlock.tx", value: { \u8F9E\u66F8: "blockchainBlock.txCount" } }
31509
31797
  ];
31510
- function ShapeBlockchainBlockNode({ node, active, lang }) {
31798
+ function ShapeBlockchainBlockNode({
31799
+ node,
31800
+ active,
31801
+ lang,
31802
+ textMetrics = "proportional"
31803
+ }) {
31511
31804
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
31512
31805
  const frame = commonFrame4(active);
31513
31806
  const r = shapeRegion(node);
31807
+ const \u6E2C\u308B\u5B57 = (text, size) => \u5B57\u306E\u5E45(text, size, textMetrics);
31514
31808
  const bw = BLOCK_W;
31515
31809
  const bh = BLOCK_H;
31516
31810
  const cx = r.cx;
@@ -31531,9 +31825,9 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31531
31825
  const \u5E2F\u306E\u6B8B\u308A = bw - 14 - 30;
31532
31826
  const \u80A9\u66F8\u306E\u9699\u9593 = 8;
31533
31827
  const \u80A9\u66F8\u306E\u4E0A\u9650 = (\u5E2F\u306E\u6B8B\u308A - \u80A9\u66F8\u306E\u9699\u9593) / 2;
31534
- 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);
31828
+ 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);
31535
31829
  const \u80A9\u66F8\u306E\u6307\u5B9A = \u80A9\u66F8\u306E\u5B57 * \u80A9\u66F8\u306E\u500D\u7387;
31536
- const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u5B57\u306E\u5E45(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
31830
+ const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u6E2C\u308B\u5B57(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
31537
31831
  const \u898B\u51FA\u3057\u306E\u5E45 = \u5E2F\u306E\u6B8B\u308A - (\u80A9\u66F8 === "" ? 0 : \u80A9\u66F8\u306E\u5E45 + \u80A9\u66F8\u306E\u9699\u9593);
31538
31832
  const \u6253\u3061\u6D88\u3059\u5B57\u3089 = [
31539
31833
  { text: \u898B\u51FA\u3057, size: \u898B\u51FA\u3057\u306E\u5B57, \u5E2F: { \u5E45: \u898B\u51FA\u3057\u306E\u5E45, \u9AD8\u3055: \u898B\u51FA\u3057\u306E\u5E2F } },
@@ -31544,12 +31838,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31544
31838
  {
31545
31839
  text: f.value,
31546
31840
  size: \u5024\u306E\u5B57,
31547
- \u5E2F: { \u5E45: bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
31841
+ \u5E2F: { \u5E45: bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
31548
31842
  }
31549
31843
  ])
31550
31844
  ];
31551
31845
  const art = (\u500D\u7387) => {
31552
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
31846
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31553
31847
  const \u984C\u306E\u5927\u304D\u3055 = \u898B\u51FA\u3057\u306E\u5B57 * \u500D;
31554
31848
  const \u80A9\u66F8\u306E\u5927\u304D\u3055 = \u80A9\u66F8\u306E\u6307\u5B9A * \u500D;
31555
31849
  const \u540D\u306E\u5927\u304D\u3055 = \u540D\u306E\u5B57 * \u500D;
@@ -31558,7 +31852,7 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31558
31852
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
31559
31853
  /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
31560
31854
  /* @__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" }),
31561
- /* @__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) }),
31855
+ /* @__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) }),
31562
31856
  \u80A9\u66F8 !== "" && /* @__PURE__ */ jsxRuntime.jsx(
31563
31857
  "text",
31564
31858
  {
@@ -31578,7 +31872,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31578
31872
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
31579
31873
  fields.map((f, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31580
31874
  /* @__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 }),
31581
- /* @__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) }),
31875
+ /* @__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(
31876
+ f.value,
31877
+ \u5024\u306E\u5927\u304D\u3055,
31878
+ bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5927\u304D\u3055) - 8,
31879
+ \u6E2C\u308B\u5B57
31880
+ ) }),
31582
31881
  /* @__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 })
31583
31882
  ] }, i)),
31584
31883
  /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
@@ -31590,7 +31889,11 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31590
31889
  };
31591
31890
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: fitArt(r, blockchainBlockExtent(frame.strokeWidth), art) });
31592
31891
  }
31593
- function ShapeBlockchainNode({ node, active }) {
31892
+ function ShapeBlockchainNode({
31893
+ node,
31894
+ active,
31895
+ textMetrics = "proportional"
31896
+ }) {
31594
31897
  const frame = commonFrame4(active);
31595
31898
  const r = shapeRegion(node);
31596
31899
  const cx = r.cx;
@@ -31606,7 +31909,7 @@ function ShapeBlockchainNode({ node, active }) {
31606
31909
  { text: "0x\u2026", size: CHAIN_HASH_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: CHAIN_ROW_GAP } }
31607
31910
  ];
31608
31911
  const art = (\u500D\u7387) => {
31609
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
31912
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31610
31913
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
31611
31914
  const bx = startX + i * (blockW + linkW);
31612
31915
  const isCurrent = i === blockCount - 1;
@@ -31642,10 +31945,14 @@ function ShapeBlockchainNode({ node, active }) {
31642
31945
  };
31643
31946
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31644
31947
  fitArt(r, chainExtent(), art),
31645
- bottomLabel2(node, r.cx, r.label)
31948
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31646
31949
  ] });
31647
31950
  }
31648
- function ShapeBitcoinChainNode({ node, active }) {
31951
+ function ShapeBitcoinChainNode({
31952
+ node,
31953
+ active,
31954
+ textMetrics = "proportional"
31955
+ }) {
31649
31956
  const frame = commonFrame4(active);
31650
31957
  const r = shapeRegion(node);
31651
31958
  const cx = r.cx;
@@ -31661,7 +31968,7 @@ function ShapeBitcoinChainNode({ node, active }) {
31661
31968
  { text: "#820", size: BTC_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
31662
31969
  ];
31663
31970
  const art = (\u500D\u7387) => {
31664
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
31971
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31665
31972
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
31666
31973
  const bx = startX + i * (blockW + linkW);
31667
31974
  const isCurrent = i === blockCount - 1;
@@ -31692,10 +31999,14 @@ function ShapeBitcoinChainNode({ node, active }) {
31692
31999
  };
31693
32000
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31694
32001
  fitArt(r, chainExtent(), art),
31695
- bottomLabel2(node, r.cx, r.label)
32002
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31696
32003
  ] });
31697
32004
  }
31698
- function ShapeEthereumChainNode({ node, active }) {
32005
+ function ShapeEthereumChainNode({
32006
+ node,
32007
+ active,
32008
+ textMetrics = "proportional"
32009
+ }) {
31699
32010
  const frame = commonFrame4(active);
31700
32011
  const r = shapeRegion(node);
31701
32012
  const cx = r.cx;
@@ -31711,7 +32022,7 @@ function ShapeEthereumChainNode({ node, active }) {
31711
32022
  { text: "#214", size: ETH_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
31712
32023
  ];
31713
32024
  const art = (\u500D\u7387) => {
31714
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
32025
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31715
32026
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
31716
32027
  const bx = startX + i * (blockW + linkW);
31717
32028
  const isCurrent = i === blockCount - 1;
@@ -31743,10 +32054,14 @@ function ShapeEthereumChainNode({ node, active }) {
31743
32054
  };
31744
32055
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31745
32056
  fitArt(r, chainExtent(), art),
31746
- bottomLabel2(node, r.cx, r.label)
32057
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31747
32058
  ] });
31748
32059
  }
31749
- function ShapeBlockchainNodeNode({ node, active }) {
32060
+ function ShapeBlockchainNodeNode({
32061
+ node,
32062
+ active,
32063
+ textMetrics = "proportional"
32064
+ }) {
31750
32065
  const frame = commonFrame4(active);
31751
32066
  const r = shapeRegion(node);
31752
32067
  const cx = r.cx;
@@ -31800,10 +32115,15 @@ function ShapeBlockchainNodeNode({ node, active }) {
31800
32115
  ] });
31801
32116
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31802
32117
  fitArt(r, blockchainNodeExtent(frame.strokeWidth), art),
31803
- bottomLabel2(node, r.cx, r.label)
32118
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31804
32119
  ] });
31805
32120
  }
31806
- function ShapeRpcNodeNode({ node, active, lang }) {
32121
+ function ShapeRpcNodeNode({
32122
+ node,
32123
+ active,
32124
+ lang,
32125
+ textMetrics = "proportional"
32126
+ }) {
31807
32127
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
31808
32128
  const frame = commonFrame4(active);
31809
32129
  const r = shapeRegion(node);
@@ -31822,10 +32142,10 @@ function ShapeRpcNodeNode({ node, active, lang }) {
31822
32142
  /* @__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" }),
31823
32143
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 16, y: y + bh - 24, width: bw - 32, height: 8, rx: 4, fill: "#0f1419", stroke: "none" }),
31824
32144
  /* @__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" }) }),
31825
- bottomLabel2(node, r.cx, r.label)
32145
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31826
32146
  ] });
31827
32147
  }
31828
- function ShapeWalletNode({ node, active }) {
32148
+ function ShapeWalletNode({ node, active, textMetrics = "proportional" }) {
31829
32149
  const frame = commonFrame4(active);
31830
32150
  const r = shapeRegion(node);
31831
32151
  const cx = r.cx;
@@ -31899,10 +32219,10 @@ function ShapeWalletNode({ node, active }) {
31899
32219
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: foldY + 3, fontSize: 9, fontWeight: 700, fill: "#5a3a10", textAnchor: "middle", opacity: 0.8, children: "\u039E" }),
31900
32220
  /* @__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 })
31901
32221
  ] }),
31902
- bottomLabel2(node, r.cx, r.label)
32222
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31903
32223
  ] });
31904
32224
  }
31905
- function ShapeNftNode({ node, active }) {
32225
+ function ShapeNftNode({ node, active, textMetrics = "proportional" }) {
31906
32226
  const frame = commonFrame4(active);
31907
32227
  const r = shapeRegion(node);
31908
32228
  const cx = r.cx;
@@ -31918,7 +32238,7 @@ function ShapeNftNode({ node, active }) {
31918
32238
  { text: "#1024", size: NFT_ID_SIZE, \u5E2F: { \u5E45: cardW - 16 - 34, \u9AD8\u3055: cardH - artH } }
31919
32239
  ];
31920
32240
  const art = (\u500D\u7387) => {
31921
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
32241
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31922
32242
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31923
32243
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 4, y: y + 4, width: cardW, height: cardH, rx: 14, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
31924
32244
  /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: cardW, height: cardH, rx: 14, ...frame }),
@@ -31956,10 +32276,10 @@ function ShapeNftNode({ node, active }) {
31956
32276
  };
31957
32277
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
31958
32278
  fitArt(r, nftExtent(frame.strokeWidth), art),
31959
- bottomLabel2(node, r.cx, r.label)
32279
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31960
32280
  ] });
31961
32281
  }
31962
- function ShapeTokenNode({ node, active }) {
32282
+ function ShapeTokenNode({ node, active, textMetrics = "proportional" }) {
31963
32283
  const frame = commonFrame4(active);
31964
32284
  const r = shapeRegion(node);
31965
32285
  const cx = r.cx;
@@ -31996,7 +32316,7 @@ function ShapeTokenNode({ node, active }) {
31996
32316
  }
31997
32317
  }
31998
32318
  ),
31999
- bottomLabel2(node, r.cx, r.label)
32319
+ bottomLabel2(node, r.cx, r.label, textMetrics)
32000
32320
  ] });
32001
32321
  }
32002
32322
  var commonFrame5 = (active) => ({
@@ -32015,7 +32335,8 @@ function \u5B57\u306E\u6BD4(c) {
32015
32335
  if (\u5E83\u5B57.has(c)) return \u5E83\u5B57\u6BD4;
32016
32336
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD4 : \u5E83\u5B57\u6BD4;
32017
32337
  }
32018
- function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
32338
+ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
32339
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
32019
32340
  let \u5E45 = 0;
32020
32341
  let \u5B57\u6570 = 0;
32021
32342
  for (const c of \u6587\u5B57\u5217) {
@@ -32024,18 +32345,33 @@ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
32024
32345
  }
32025
32346
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
32026
32347
  }
32027
- function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
32028
- const \u5E45 = \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
32029
- 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;
32348
+ function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
32349
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E45(t, s, ls, textMetrics);
32350
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
32351
+ 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;
32030
32352
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
32031
32353
  const size = \u5927\u304D\u3055 * \u500D\u7387;
32032
32354
  const spacing = \u5B57\u9593 * \u500D\u7387;
32033
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u5B57\u5E45(u, f, spacing)) };
32034
- }
32035
- function bottomLabel3(node, cx, plan) {
32036
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING2, node.w);
32037
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
32038
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
32355
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
32356
+ }
32357
+ function bottomLabel3(node, cx, plan, textMetrics = "proportional") {
32358
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(
32359
+ node.eyebrow ?? "",
32360
+ plan.\u80A9\u66F8?.size ?? 0,
32361
+ LABEL_EYEBROW_SPACING2,
32362
+ node.w,
32363
+ false,
32364
+ textMetrics
32365
+ );
32366
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
32367
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(
32368
+ node.subtitle ?? "",
32369
+ plan.\u8AAC\u660E?.size ?? 0,
32370
+ 0,
32371
+ node.w,
32372
+ false,
32373
+ textMetrics
32374
+ );
32039
32375
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
32040
32376
  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 }),
32041
32377
  /* @__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 }),
@@ -32054,7 +32390,7 @@ var BANK_STEP_SW = 1;
32054
32390
  var BANK_COLUMN_MIN = 24;
32055
32391
  var BANK_BLD_W_MIN = 120;
32056
32392
  var BANK_BLD_W_MAX = 280;
32057
- function ShapeBankNode({ node, active }) {
32393
+ function ShapeBankNode({ node, active, textMetrics = "proportional" }) {
32058
32394
  const frame = commonFrame5(active);
32059
32395
  const r = shapeRegion(node);
32060
32396
  const \u7DDA = frame.strokeWidth / 2;
@@ -32101,7 +32437,7 @@ function ShapeBankNode({ node, active }) {
32101
32437
  ] });
32102
32438
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32103
32439
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32104
- bottomLabel3(node, r.cx, r.label)
32440
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32105
32441
  ] });
32106
32442
  }
32107
32443
  var TRUST_CROWN_RISE = 4;
@@ -32113,7 +32449,12 @@ var TRUST_BASE_H = 14;
32113
32449
  var TRUST_BODY_OUT = 8;
32114
32450
  var TRUST_BLD_W_MIN = 140;
32115
32451
  var TRUST_BLD_W_MAX = 280;
32116
- function ShapeTrustBankNode({ node, active, lang }) {
32452
+ function ShapeTrustBankNode({
32453
+ node,
32454
+ active,
32455
+ lang,
32456
+ textMetrics = "proportional"
32457
+ }) {
32117
32458
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32118
32459
  const frame = commonFrame5(active);
32119
32460
  const r = shapeRegion(node);
@@ -32167,10 +32508,15 @@ function ShapeTrustBankNode({ node, active, lang }) {
32167
32508
  ] });
32168
32509
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32169
32510
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32170
- bottomLabel3(node, r.cx, r.label)
32511
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32171
32512
  ] });
32172
32513
  }
32173
- function ShapePaymentProviderNode({ node, active, lang }) {
32514
+ function ShapePaymentProviderNode({
32515
+ node,
32516
+ active,
32517
+ lang,
32518
+ textMetrics = "proportional"
32519
+ }) {
32174
32520
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32175
32521
  const frame = commonFrame5(active);
32176
32522
  const r = shapeRegion(node);
@@ -32195,10 +32541,14 @@ function ShapePaymentProviderNode({ node, active, lang }) {
32195
32541
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy + 9, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: accentDarker, fontFamily: "Georgia, serif", children: "$" })
32196
32542
  ] }),
32197
32543
  /* @__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") }),
32198
- bottomLabel3(node, r.cx, r.label)
32544
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32199
32545
  ] });
32200
32546
  }
32201
- function ShapeCreditCardNode({ node, active }) {
32547
+ function ShapeCreditCardNode({
32548
+ node,
32549
+ active,
32550
+ textMetrics = "proportional"
32551
+ }) {
32202
32552
  const frame = commonFrame5(active);
32203
32553
  const r = shapeRegion(node);
32204
32554
  const cardW = Math.min(r.availW - 30, 260);
@@ -32220,7 +32570,7 @@ function ShapeCreditCardNode({ node, active }) {
32220
32570
  [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)),
32221
32571
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + cardW - 48, cy: y + cardH - 24, r: 15, fill: "#c9302c", opacity: 0.9, stroke: "none" }),
32222
32572
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + cardW - 30, cy: y + cardH - 24, r: 15, fill: "#e5c07b", opacity: 0.9, stroke: "none" }),
32223
- bottomLabel3(node, r.cx, r.label)
32573
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32224
32574
  ] });
32225
32575
  }
32226
32576
  var BROKERAGE_TICK_H = 18;
@@ -32245,7 +32595,12 @@ var BROKERAGE_SHADE_OUT = 2;
32245
32595
  var BROKERAGE_W_MIN = BROKERAGE_COLS * BROKERAGE_CELL_W + (BROKERAGE_COLS - 1) * BROKERAGE_GAP_X + 6;
32246
32596
  var BROKERAGE_W_MAX = 140;
32247
32597
  var BROKERAGE_H_MIN = BROKERAGE_TICK_H + BROKERAGE_LOGO_H + BROKERAGE_BASE_H;
32248
- function ShapeBrokerageNode({ node, active, lang }) {
32598
+ function ShapeBrokerageNode({
32599
+ node,
32600
+ active,
32601
+ lang,
32602
+ textMetrics = "proportional"
32603
+ }) {
32249
32604
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32250
32605
  const frame = commonFrame5(active);
32251
32606
  const r = shapeRegion(node);
@@ -32284,7 +32639,7 @@ function ShapeBrokerageNode({ node, active, lang }) {
32284
32639
  }
32285
32640
  ];
32286
32641
  const \u7D75 = (\u500D\u7387) => {
32287
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
32642
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
32288
32643
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32289
32644
  /* @__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" }),
32290
32645
  /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: w, height: h, fill: "#255a7a", stroke: accentDarker, strokeWidth: frame.strokeWidth }),
@@ -32312,12 +32667,17 @@ function ShapeBrokerageNode({ node, active, lang }) {
32312
32667
  };
32313
32668
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32314
32669
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32315
- bottomLabel3(node, r.cx, r.label)
32670
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32316
32671
  ] });
32317
32672
  }
32318
32673
  var EXCHANGE_SUB_SIZE = 11;
32319
32674
  var EXCHANGE_HEX_R = 52;
32320
- function ShapeExchangeNode({ node, active, lang }) {
32675
+ function ShapeExchangeNode({
32676
+ node,
32677
+ active,
32678
+ lang,
32679
+ textMetrics = "proportional"
32680
+ }) {
32321
32681
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32322
32682
  const frame = commonFrame5(active);
32323
32683
  const r = shapeRegion(node);
@@ -32362,7 +32722,7 @@ function ShapeExchangeNode({ node, active, lang }) {
32362
32722
  }
32363
32723
  ];
32364
32724
  const \u7D75 = (\u500D\u7387) => {
32365
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
32725
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
32366
32726
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32367
32727
  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}`)),
32368
32728
  nodes.map((n, i) => {
@@ -32381,7 +32741,7 @@ function ShapeExchangeNode({ node, active, lang }) {
32381
32741
  };
32382
32742
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32383
32743
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32384
- bottomLabel3(node, r.cx, r.label)
32744
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32385
32745
  ] });
32386
32746
  }
32387
32747
  var ATM_SIGN_H = 26;
@@ -32398,7 +32758,12 @@ var ATM_PANEL_H = 146;
32398
32758
  var ATM_W_MIN = 100;
32399
32759
  var ATM_W_MAX = ATM_PANEL_W;
32400
32760
  var ATM_H_MIN = ATM_SIGN_H + ATM_SIGN_GAP + 30 + ATM_FLOOR_RESERVE;
32401
- function ShapeAtmNode({ node, active, lang }) {
32761
+ function ShapeAtmNode({
32762
+ node,
32763
+ active,
32764
+ lang,
32765
+ textMetrics = "proportional"
32766
+ }) {
32402
32767
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32403
32768
  const frame = commonFrame5(active);
32404
32769
  const r = shapeRegion(node);
@@ -32482,7 +32847,7 @@ function ShapeAtmNode({ node, active, lang }) {
32482
32847
  ] });
32483
32848
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32484
32849
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32485
- bottomLabel3(node, r.cx, r.label)
32850
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32486
32851
  ] });
32487
32852
  }
32488
32853
  var commonFrame6 = (active) => ({
@@ -32501,7 +32866,8 @@ function \u5B57\u306E\u6BD42(c) {
32501
32866
  if (\u5E83\u5B572.has(c)) return \u5E83\u5B57\u6BD42;
32502
32867
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD42 : \u5E83\u5B57\u6BD42;
32503
32868
  }
32504
- function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
32869
+ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
32870
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
32505
32871
  let \u5E45 = 0;
32506
32872
  let \u5B57\u6570 = 0;
32507
32873
  for (const c of \u6587\u5B57\u5217) {
@@ -32510,18 +32876,33 @@ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
32510
32876
  }
32511
32877
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
32512
32878
  }
32513
- function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
32514
- const \u5E45 = \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
32515
- 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;
32879
+ function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
32880
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E452(t, s, ls, textMetrics);
32881
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
32882
+ 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;
32516
32883
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
32517
32884
  const size = \u5927\u304D\u3055 * \u500D\u7387;
32518
32885
  const spacing = \u5B57\u9593 * \u500D\u7387;
32519
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u5B57\u5E452(u, f, spacing)) };
32520
- }
32521
- function bottomLabel4(node, cx, plan) {
32522
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING3, node.w);
32523
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
32524
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
32886
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
32887
+ }
32888
+ function bottomLabel4(node, cx, plan, textMetrics = "proportional") {
32889
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(
32890
+ node.eyebrow ?? "",
32891
+ plan.\u80A9\u66F8?.size ?? 0,
32892
+ LABEL_EYEBROW_SPACING3,
32893
+ node.w,
32894
+ false,
32895
+ textMetrics
32896
+ );
32897
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
32898
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(
32899
+ node.subtitle ?? "",
32900
+ plan.\u8AAC\u660E?.size ?? 0,
32901
+ 0,
32902
+ node.w,
32903
+ false,
32904
+ textMetrics
32905
+ );
32525
32906
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
32526
32907
  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 }),
32527
32908
  /* @__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 }),
@@ -32533,7 +32914,7 @@ var WEBSITE_BAR_H = 32;
32533
32914
  var WEBSITE_H_MIN = WEBSITE_BAR_H + 98;
32534
32915
  var WEBSITE_W_MIN = 160;
32535
32916
  var WEBSITE_W_MAX = 280;
32536
- function ShapeWebsiteNode({ node, active }) {
32917
+ function ShapeWebsiteNode({ node, active, textMetrics = "proportional" }) {
32537
32918
  const frame = commonFrame6(active);
32538
32919
  const r = shapeRegion(node);
32539
32920
  const cx = r.cx;
@@ -32559,10 +32940,10 @@ function ShapeWebsiteNode({ node, active }) {
32559
32940
  ] });
32560
32941
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32561
32942
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32562
- bottomLabel4(node, r.cx, r.label)
32943
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32563
32944
  ] });
32564
32945
  }
32565
- function ShapeStorefrontNode({ node, active, lang }) {
32946
+ function ShapeStorefrontNode({ node, active, lang, textMetrics = "proportional" }) {
32566
32947
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32567
32948
  const frame = commonFrame6(active);
32568
32949
  const r = shapeRegion(node);
@@ -32607,7 +32988,7 @@ function ShapeStorefrontNode({ node, active, lang }) {
32607
32988
  /* @__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") }),
32608
32989
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: doorX + 6, cy: doorY + doorH * 0.55, r: 1.5, fill: "#c15a4a" }),
32609
32990
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x - 6, y: y + bh - 6, width: bw + 12, height: 8, fill: "#5a6270", stroke: "none" }),
32610
- bottomLabel4(node, r.cx, r.label)
32991
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32611
32992
  ] });
32612
32993
  }
32613
32994
  var WAREHOUSE_ROOF_H = 18;
@@ -32621,7 +33002,7 @@ var WAREHOUSE_SHADOW_RX_RATIO = 0.5;
32621
33002
  var WAREHOUSE_H_MIN = WAREHOUSE_ROOF_H + WAREHOUSE_SIGN_H + 68;
32622
33003
  var WAREHOUSE_W_MIN = 160;
32623
33004
  var WAREHOUSE_W_MAX = 240;
32624
- function ShapeWarehouseNode({ node, active, lang }) {
33005
+ function ShapeWarehouseNode({ node, active, lang, textMetrics = "proportional" }) {
32625
33006
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32626
33007
  const frame = commonFrame6(active);
32627
33008
  const r = shapeRegion(node);
@@ -32674,13 +33055,13 @@ function ShapeWarehouseNode({ node, active, lang }) {
32674
33055
  ] });
32675
33056
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32676
33057
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32677
- bottomLabel4(node, r.cx, r.label)
33058
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32678
33059
  ] });
32679
33060
  }
32680
33061
  var HANDLE_GRIP_X = 118;
32681
33062
  var HANDLE_GRIP_R = 4;
32682
33063
  var CART_SHADOW_RX = 80;
32683
- function ShapeOnlineShopNode({ node, active }) {
33064
+ function ShapeOnlineShopNode({ node, active, textMetrics = "proportional" }) {
32684
33065
  const frame = commonFrame6(active);
32685
33066
  const r = shapeRegion(node);
32686
33067
  const cy = r.cy + 10;
@@ -32736,10 +33117,10 @@ function ShapeOnlineShopNode({ node, active }) {
32736
33117
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 16 * s, fill: "#0f1830", stroke: "#000", strokeWidth: 2 * s }),
32737
33118
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 8 * s, fill: "#5a6270", stroke: "#0f1830", strokeWidth: 1.5 * s }),
32738
33119
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: wheelR, cy: wheelY, r: 2 * s, fill: "#0f1830" }),
32739
- bottomLabel4(node, r.cx, r.label)
33120
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32740
33121
  ] });
32741
33122
  }
32742
- function ShapeCdnEdgeNode({ node, active }) {
33123
+ function ShapeCdnEdgeNode({ node, active, textMetrics = "proportional" }) {
32743
33124
  const frame = commonFrame6(active);
32744
33125
  const r = shapeRegion(node);
32745
33126
  const cx = r.cx;
@@ -32802,7 +33183,7 @@ function ShapeCdnEdgeNode({ node, active }) {
32802
33183
  ] });
32803
33184
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32804
33185
  fitArt(r, { \u4E0A: \u5E83\u304C\u308A, \u4E0B: \u5E83\u304C\u308A, \u5DE6: \u5E83\u304C\u308A, \u53F3: \u5E83\u304C\u308A }, \u7D75),
32805
- bottomLabel4(node, r.cx, r.label)
33186
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32806
33187
  ] });
32807
33188
  }
32808
33189
  var API_ROW_TOP = 52;
@@ -32817,7 +33198,7 @@ var API_METHOD_BOX_W = 54;
32817
33198
  var API_METHOD_TEXT_W = 48;
32818
33199
  var API_W_MIN = 200;
32819
33200
  var API_W_MAX = 300;
32820
- function ShapeApiGatewayNode({ node, active, lang }) {
33201
+ function ShapeApiGatewayNode({ node, active, lang, textMetrics = "proportional" }) {
32821
33202
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32822
33203
  const frame = commonFrame6(active);
32823
33204
  const r = shapeRegion(node);
@@ -32829,7 +33210,13 @@ function ShapeApiGatewayNode({ node, active, lang }) {
32829
33210
  const x = cx - bw / 2;
32830
33211
  const y = r.cy - \u7E26 / 2 + \u4F59\u767D;
32831
33212
  const \u5E83\u304C\u308A = { \u4E0A: \u7E26 / 2, \u4E0B: \u7E26 / 2, \u5DE6: bw / 2 + \u4F59\u767D, \u53F3: bw / 2 + \u4F59\u767D };
32832
- 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)));
33213
+ const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(
33214
+ 11,
33215
+ 11 * API_METHOD_TEXT_W / Math.max(
33216
+ displayWidth(s) * 11 * MONO_ADVANCE_RATIO,
33217
+ textWidth(s, 11, 0, textMetrics)
33218
+ )
33219
+ );
32833
33220
  const rowPitch = Math.max(
32834
33221
  API_ROW_PITCH_MIN,
32835
33222
  (bh - API_ROW_TOP - API_ROW_H - API_ROW_BOTTOM_PAD) / (API_ROWS - 1)
@@ -32845,7 +33232,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
32845
33232
  \u5E2F: { \u5E45: bw - 32 - 64 - 16, \u9AD8\u3055: API_ROW_H }
32846
33233
  }));
32847
33234
  const \u7D75 = (\u500D\u7387) => {
32848
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
33235
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
32849
33236
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32850
33237
  /* @__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" }),
32851
33238
  /* @__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 }),
@@ -32862,7 +33249,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
32862
33249
  };
32863
33250
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
32864
33251
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32865
- bottomLabel4(node, r.cx, r.label)
33252
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32866
33253
  ] });
32867
33254
  }
32868
33255
  function bottomLabel5(node, cx, plan) {
@@ -33162,6 +33549,7 @@ function CdlNodeView({
33162
33549
  chartLineScale,
33163
33550
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3,
33164
33551
  lang,
33552
+ textMetrics,
33165
33553
  \u5024\u306E\u540D\u524D
33166
33554
  }) {
33167
33555
  const value = node.value ? interpolate(node.value, stateValues, \u5024\u306E\u540D\u524D) : void 0;
@@ -33206,7 +33594,14 @@ function CdlNodeView({
33206
33594
  return /* @__PURE__ */ jsxRuntime.jsx(CardNode, { node: resolvedNode, active });
33207
33595
  // 時系列のやり取り (#578)。 1 つの箱が図を丸ごと描く = 縦が時間で、参加者は箱を持たない
33208
33596
  case "sequence-board":
33209
- return /* @__PURE__ */ jsxRuntime.jsx(SequenceBoardNode, { node: resolvedNode, stateValues });
33597
+ return /* @__PURE__ */ jsxRuntime.jsx(
33598
+ SequenceBoardNode,
33599
+ {
33600
+ node: resolvedNode,
33601
+ stateValues,
33602
+ textMetrics
33603
+ }
33604
+ );
33210
33605
  // 図表 9 種は payload が `{signal}` を取れるので stateValues を渡す
33211
33606
  // (`render/payload-binding.ts` が描画直前に解決する)。 取れる欄は種別で違い、
33212
33607
  // 数と語を取る 7 種に対し、mind-map / tree-hierarchy は **名前だけ** を取る (#467)。
@@ -33231,7 +33626,8 @@ function CdlNodeView({
33231
33626
  active,
33232
33627
  stateValues,
33233
33628
  drawing,
33234
- progress
33629
+ progress,
33630
+ textMetrics
33235
33631
  }
33236
33632
  );
33237
33633
  case "chart-gauge":
@@ -33242,7 +33638,8 @@ function CdlNodeView({
33242
33638
  active,
33243
33639
  stateValues,
33244
33640
  drawing,
33245
- progress
33641
+ progress,
33642
+ textMetrics
33246
33643
  }
33247
33644
  );
33248
33645
  case "chart-stacked-bar":
@@ -33253,7 +33650,8 @@ function CdlNodeView({
33253
33650
  active,
33254
33651
  stateValues,
33255
33652
  drawing,
33256
- progress
33653
+ progress,
33654
+ textMetrics
33257
33655
  }
33258
33656
  );
33259
33657
  case "chart-slope":
@@ -33264,7 +33662,8 @@ function CdlNodeView({
33264
33662
  active,
33265
33663
  stateValues,
33266
33664
  drawing,
33267
- progress
33665
+ progress,
33666
+ textMetrics
33268
33667
  }
33269
33668
  );
33270
33669
  case "chart-waffle":
@@ -33275,11 +33674,20 @@ function CdlNodeView({
33275
33674
  active,
33276
33675
  stateValues,
33277
33676
  drawing,
33278
- progress
33677
+ progress,
33678
+ textMetrics
33279
33679
  }
33280
33680
  );
33281
33681
  case "chart-stat":
33282
- return /* @__PURE__ */ jsxRuntime.jsx(ChartStatNode, { node: resolvedNode, active, stateValues });
33682
+ return /* @__PURE__ */ jsxRuntime.jsx(
33683
+ ChartStatNode,
33684
+ {
33685
+ node: resolvedNode,
33686
+ active,
33687
+ stateValues,
33688
+ textMetrics
33689
+ }
33690
+ );
33283
33691
  case "chart-radial":
33284
33692
  return /* @__PURE__ */ jsxRuntime.jsx(
33285
33693
  ChartRadialNode,
@@ -33288,7 +33696,8 @@ function CdlNodeView({
33288
33696
  active,
33289
33697
  stateValues,
33290
33698
  drawing,
33291
- progress
33699
+ progress,
33700
+ textMetrics
33292
33701
  }
33293
33702
  );
33294
33703
  case "chart-bar":
@@ -33321,7 +33730,8 @@ function CdlNodeView({
33321
33730
  active,
33322
33731
  stateValues,
33323
33732
  drawing,
33324
- progress
33733
+ progress,
33734
+ textMetrics
33325
33735
  }
33326
33736
  );
33327
33737
  case "funnel-stages":
@@ -33332,11 +33742,20 @@ function CdlNodeView({
33332
33742
  active,
33333
33743
  stateValues,
33334
33744
  drawing,
33335
- progress
33745
+ progress,
33746
+ textMetrics
33336
33747
  }
33337
33748
  );
33338
33749
  case "quadrant-matrix":
33339
- return /* @__PURE__ */ jsxRuntime.jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
33750
+ return /* @__PURE__ */ jsxRuntime.jsx(
33751
+ QuadrantNode,
33752
+ {
33753
+ node: resolvedNode,
33754
+ active,
33755
+ stateValues,
33756
+ textMetrics
33757
+ }
33758
+ );
33340
33759
  case "tree-hierarchy":
33341
33760
  return /* @__PURE__ */ jsxRuntime.jsx(
33342
33761
  TreeNode,
@@ -33345,7 +33764,8 @@ function CdlNodeView({
33345
33764
  active,
33346
33765
  stateValues,
33347
33766
  drawing,
33348
- progress
33767
+ progress,
33768
+ textMetrics
33349
33769
  }
33350
33770
  );
33351
33771
  case "journey-map":
@@ -33360,91 +33780,91 @@ function CdlNodeView({
33360
33780
  }
33361
33781
  );
33362
33782
  case "shape-file":
33363
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active });
33783
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeFileNode, { node: resolvedNode, active, textMetrics });
33364
33784
  case "shape-folder":
33365
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeFolderNode, { node: resolvedNode, active });
33785
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeFolderNode, { node: resolvedNode, active, textMetrics });
33366
33786
  case "shape-cloud":
33367
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCloudNode, { node: resolvedNode, active });
33787
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCloudNode, { node: resolvedNode, active, textMetrics });
33368
33788
  case "shape-cylinder":
33369
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCylinderNode, { node: resolvedNode, active });
33789
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCylinderNode, { node: resolvedNode, active, textMetrics });
33370
33790
  case "shape-hexagon":
33371
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeHexagonNode, { node: resolvedNode, active });
33791
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeHexagonNode, { node: resolvedNode, active, textMetrics });
33372
33792
  case "shape-diamond":
33373
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeDiamondNode, { node: resolvedNode, active });
33793
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeDiamondNode, { node: resolvedNode, active, textMetrics });
33374
33794
  case "shape-stack":
33375
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeStackNode, { node: resolvedNode, active });
33795
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeStackNode, { node: resolvedNode, active, textMetrics });
33376
33796
  case "shape-person":
33377
- return /* @__PURE__ */ jsxRuntime.jsx(ShapePersonNode, { node: resolvedNode, active });
33797
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapePersonNode, { node: resolvedNode, active, textMetrics });
33378
33798
  case "shape-window":
33379
33799
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeWindowNode, { node: resolvedNode, active });
33380
33800
  case "shape-terminal":
33381
33801
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeTerminalNode, { node: resolvedNode, active, lang });
33382
33802
  case "shape-code-block":
33383
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang });
33803
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang, textMetrics });
33384
33804
  case "shape-kanban-card":
33385
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang });
33805
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang, textMetrics });
33386
33806
  case "shape-message-bubble":
33387
33807
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeMessageBubbleNode, { node: resolvedNode, active });
33388
33808
  case "shape-gear":
33389
33809
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeGearNode, { node: resolvedNode, active });
33390
33810
  case "shape-server-rack":
33391
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeServerRackNode, { node: resolvedNode, active });
33811
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeServerRackNode, { node: resolvedNode, active, textMetrics });
33392
33812
  case "shape-network-node":
33393
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeNetworkNodeNode, { node: resolvedNode, active });
33813
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeNetworkNodeNode, { node: resolvedNode, active, textMetrics });
33394
33814
  case "shape-mobile-device":
33395
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeMobileDeviceNode, { node: resolvedNode, active });
33815
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeMobileDeviceNode, { node: resolvedNode, active, textMetrics });
33396
33816
  case "shape-iot-sensor":
33397
33817
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeIotSensorNode, { node: resolvedNode, active });
33398
33818
  case "shape-robot-arm":
33399
33819
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeRobotArmNode, { node: resolvedNode, active });
33400
33820
  case "shape-satellite":
33401
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeSatelliteNode, { node: resolvedNode, active });
33821
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeSatelliteNode, { node: resolvedNode, active, textMetrics });
33402
33822
  case "shape-smart-contract":
33403
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang });
33823
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang, textMetrics });
33404
33824
  case "shape-blockchain-block":
33405
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang });
33825
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang, textMetrics });
33406
33826
  case "shape-rpc-node":
33407
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang });
33827
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang, textMetrics });
33408
33828
  case "shape-wallet":
33409
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeWalletNode, { node: resolvedNode, active });
33829
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeWalletNode, { node: resolvedNode, active, textMetrics });
33410
33830
  case "shape-nft":
33411
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeNftNode, { node: resolvedNode, active });
33831
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeNftNode, { node: resolvedNode, active, textMetrics });
33412
33832
  case "shape-token":
33413
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeTokenNode, { node: resolvedNode, active });
33833
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeTokenNode, { node: resolvedNode, active, textMetrics });
33414
33834
  case "shape-blockchain":
33415
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNode, { node: resolvedNode, active });
33835
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNode, { node: resolvedNode, active, textMetrics });
33416
33836
  case "shape-bitcoin-chain":
33417
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBitcoinChainNode, { node: resolvedNode, active });
33837
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBitcoinChainNode, { node: resolvedNode, active, textMetrics });
33418
33838
  case "shape-ethereum-chain":
33419
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeEthereumChainNode, { node: resolvedNode, active });
33839
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeEthereumChainNode, { node: resolvedNode, active, textMetrics });
33420
33840
  case "shape-blockchain-node":
33421
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active });
33841
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active, textMetrics });
33422
33842
  case "shape-bank":
33423
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBankNode, { node: resolvedNode, active });
33843
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBankNode, { node: resolvedNode, active, textMetrics });
33424
33844
  case "shape-trust-bank":
33425
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang });
33845
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang, textMetrics });
33426
33846
  case "shape-payment-provider":
33427
- return /* @__PURE__ */ jsxRuntime.jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang });
33847
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang, textMetrics });
33428
33848
  case "shape-credit-card":
33429
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCreditCardNode, { node: resolvedNode, active });
33849
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCreditCardNode, { node: resolvedNode, active, textMetrics });
33430
33850
  case "shape-brokerage":
33431
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang });
33851
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang, textMetrics });
33432
33852
  case "shape-exchange":
33433
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeExchangeNode, { node: resolvedNode, active, lang });
33853
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeExchangeNode, { node: resolvedNode, active, lang, textMetrics });
33434
33854
  case "shape-atm":
33435
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeAtmNode, { node: resolvedNode, active, lang });
33855
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeAtmNode, { node: resolvedNode, active, lang, textMetrics });
33436
33856
  case "shape-website":
33437
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeWebsiteNode, { node: resolvedNode, active });
33857
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeWebsiteNode, { node: resolvedNode, active, textMetrics });
33438
33858
  case "shape-storefront":
33439
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang });
33859
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang, textMetrics });
33440
33860
  case "shape-warehouse":
33441
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang });
33861
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang, textMetrics });
33442
33862
  case "shape-online-shop":
33443
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeOnlineShopNode, { node: resolvedNode, active });
33863
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeOnlineShopNode, { node: resolvedNode, active, textMetrics });
33444
33864
  case "shape-cdn-edge":
33445
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeCdnEdgeNode, { node: resolvedNode, active });
33865
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeCdnEdgeNode, { node: resolvedNode, active, textMetrics });
33446
33866
  case "shape-api-gateway":
33447
- return /* @__PURE__ */ jsxRuntime.jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang });
33867
+ return /* @__PURE__ */ jsxRuntime.jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang, textMetrics });
33448
33868
  case "shape-auditor":
33449
33869
  return /* @__PURE__ */ jsxRuntime.jsx(ShapeAuditorNode, { node: resolvedNode, active });
33450
33870
  case "shape-regulator":
@@ -33464,7 +33884,17 @@ function CdlNodeView({
33464
33884
  case "station":
33465
33885
  return /* @__PURE__ */ jsxRuntime.jsx(StationNode, { node: resolvedNode, active });
33466
33886
  default:
33467
- return /* @__PURE__ */ jsxRuntime.jsx(GenericNode, { node: resolvedNode, active, value: node.value, stateValues, \u5024\u306E\u540D\u524D });
33887
+ return /* @__PURE__ */ jsxRuntime.jsx(
33888
+ GenericNode,
33889
+ {
33890
+ node: resolvedNode,
33891
+ active,
33892
+ value: node.value,
33893
+ stateValues,
33894
+ \u5024\u306E\u540D\u524D,
33895
+ textMetrics
33896
+ }
33897
+ );
33468
33898
  }
33469
33899
  })();
33470
33900
  const offsetX = node.renderOffsetX !== void 0 ? resolveNumericAttr(node.renderOffsetX, stateValues, 0) : 0;
@@ -33525,7 +33955,7 @@ function CdlNodeView({
33525
33955
  }
33526
33956
  ),
33527
33957
  inner,
33528
- \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode)
33958
+ \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode, textMetrics ?? "proportional")
33529
33959
  ]
33530
33960
  }
33531
33961
  );
@@ -33534,17 +33964,17 @@ var FIGURE_TITLE_GAP = 10;
33534
33964
  var FIGURE_TITLE_SIZE = 15;
33535
33965
  var FIGURE_EYEBROW_SIZE = 11;
33536
33966
  var FIGURE_EYEBROW_LIFT = 1.1;
33537
- function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45) {
33538
- const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0);
33967
+ function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45, textMetrics = "proportional") {
33968
+ const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0, textMetrics);
33539
33969
  return \u5B9F\u5E45 > \u5E45 ? \u7D20\u306E\u5927\u304D\u3055 * \u5E45 / \u5B9F\u5E45 : \u7D20\u306E\u5927\u304D\u3055;
33540
33970
  }
33541
- function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
33971
+ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node, textMetrics = "proportional") {
33542
33972
  if (!drawsFigureTitle(node.kind)) return null;
33543
33973
  const \u540D\u524D = (node.title ?? "").trim();
33544
33974
  const \u5C0F\u898B\u51FA\u3057 = (node.eyebrow ?? "").trim();
33545
33975
  if (\u540D\u524D === "" && \u5C0F\u898B\u51FA\u3057 === "") return null;
33546
33976
  const \u984C\u306Ey = node.cy - node.h / 2 - FIGURE_TITLE_GAP;
33547
- const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w);
33977
+ const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w, textMetrics);
33548
33978
  const \u5C0F\u898B\u51FA\u3057\u306Ey = \u540D\u524D === "" ? \u984C\u306Ey : \u984C\u306Ey - \u984C\u306E\u5927\u304D\u3055 * FIGURE_EYEBROW_LIFT;
33549
33979
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
33550
33980
  \u5C0F\u898B\u51FA\u3057 !== "" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -33554,7 +33984,7 @@ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
33554
33984
  x: node.cx,
33555
33985
  y: \u5C0F\u898B\u51FA\u3057\u306Ey,
33556
33986
  textAnchor: "middle",
33557
- fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w),
33987
+ fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w, textMetrics),
33558
33988
  fontWeight: 600,
33559
33989
  letterSpacing: 0.6,
33560
33990
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -33879,6 +34309,7 @@ function CdlStage({
33879
34309
  node,
33880
34310
  active: activeSet.has(node.id),
33881
34311
  lang: laid.lang,
34312
+ textMetrics: laid.textMetrics,
33882
34313
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3: \u7BB1\u306E\u53D7\u3051\u53E3,
33883
34314
  drawing: \u63CF\u304F,
33884
34315
  progress: \u63CF\u304F ? \u63CF\u304F\u9032\u307F : progress,
@@ -33895,7 +34326,8 @@ function CdlStage({
33895
34326
  CdlEdgeLabelView,
33896
34327
  {
33897
34328
  edge,
33898
- active: activeSet.has(edge.id)
34329
+ active: activeSet.has(edge.id),
34330
+ textMetrics: laid.textMetrics
33899
34331
  },
33900
34332
  `label-${edge.id}`
33901
34333
  )),
@@ -33905,7 +34337,8 @@ function CdlStage({
33905
34337
  {
33906
34338
  edge,
33907
34339
  active: activeSet.has(edge.id),
33908
- \u7AEF
34340
+ \u7AEF,
34341
+ textMetrics: laid.textMetrics
33909
34342
  },
33910
34343
  `${\u7AEF}-label-${edge.id}`
33911
34344
  ))
@@ -34350,8 +34783,8 @@ function pointToSegmentDistance2(px, py, seg) {
34350
34783
  }
34351
34784
 
34352
34785
  // src/layout/predict-bbox.ts
34353
- function predictLabelBBoxWorld(edge) {
34354
- return computeLabelBBoxWorld(edge);
34786
+ function predictLabelBBoxWorld(edge, textMetrics = "proportional") {
34787
+ return computeLabelBBoxWorld(edge, textMetrics);
34355
34788
  }
34356
34789
  function predictNodeBBoxWorld(n) {
34357
34790
  return {
@@ -34411,12 +34844,12 @@ function resolveStorageBoxW(width, presetName, optionName) {
34411
34844
  }
34412
34845
  return width;
34413
34846
  }
34414
- function fitRowsWidth(boxW, rows) {
34415
- return Math.max(boxW, requiredRowsWidth(rows ? [...rows] : void 0, "storage"));
34847
+ function fitRowsWidth(boxW, rows, textMetrics = "proportional") {
34848
+ return Math.max(boxW, requiredRowsWidth(rows ? [...rows] : void 0, "storage", textMetrics));
34416
34849
  }
34417
34850
  function swimlane(preset) {
34418
34851
  const w = preset.laneWidth ?? 400;
34419
- const b = diagram(preset.id, { topic: preset.topic, type: "swimlane" });
34852
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "swimlane" });
34420
34853
  const labelToId = /* @__PURE__ */ new Map();
34421
34854
  const idsInOrder = [];
34422
34855
  for (const label of preset.lanes) {
@@ -34436,7 +34869,7 @@ function swimlane(preset) {
34436
34869
  }
34437
34870
  function flow(preset) {
34438
34871
  const w = preset.laneWidth ?? 400;
34439
- const b = diagram(preset.id, { topic: preset.topic, type: "flow" });
34872
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "flow" });
34440
34873
  b.lane("flow", { width: w, ...preset.laneLabel ? { label: preset.laneLabel } : {} });
34441
34874
  const tone = preset.defaultTone ?? "accent";
34442
34875
  const style = preset.defaultStyle ?? "dotted-flow";
@@ -34497,7 +34930,7 @@ var SEQUENCE_MESSAGE_LOOK = {
34497
34930
  };
34498
34931
  function sequence(preset) {
34499
34932
  const tone = preset.defaultTone ?? "accent";
34500
- const b = diagram(preset.id, { topic: preset.topic, type: "sequence" });
34933
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "sequence" });
34501
34934
  const \u9762\u3005 = preset.actors.map(
34502
34935
  (a) => typeof a === "string" ? { name: a } : { name: a.name, ...a.subtitle ? { subtitle: a.subtitle } : {} }
34503
34936
  );
@@ -34523,7 +34956,7 @@ function sequence(preset) {
34523
34956
  return \u51FA\u756A.length > 0 ? { actor: i, from: \u51FA\u756A[0], to: \u51FA\u756A[\u51FA\u756A.length - 1] } : null;
34524
34957
  }).filter((x) => x !== null);
34525
34958
  const data = { actors: \u9762\u3005, messages: \u8A00\u3065\u3066, bands: \u5E2F };
34526
- const m = sequenceBoardMetrics(data);
34959
+ const m = sequenceBoardMetrics(data, resolveTextMetrics(preset.textMetrics));
34527
34960
  const laneId = "seq";
34528
34961
  b.lane(laneId, { width: m.w + LANE_PAD_MIN * 2 });
34529
34962
  b.node(preset.id, {
@@ -34552,7 +34985,7 @@ function topology(preset) {
34552
34985
  const groupW = preset.groupWidth ?? 460;
34553
34986
  const tone = preset.defaultTone ?? "accent";
34554
34987
  const style = preset.defaultStyle ?? "solid";
34555
- const b = diagram(preset.id, { topic: preset.topic, type: "topology" });
34988
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "topology" });
34556
34989
  const groupOrder = [];
34557
34990
  const groupStackCount = /* @__PURE__ */ new Map();
34558
34991
  const phaseActivate = [];
@@ -34621,7 +35054,12 @@ function er(preset) {
34621
35054
  const entityW = resolveStorageBoxW(preset.entityWidth, "er", "entityWidth");
34622
35055
  const tone = preset.defaultTone ?? "info";
34623
35056
  const \u7E1E\u3092\u6577\u304F = preset.rowStripe ?? true;
34624
- const b = diagram(preset.id, { topic: preset.topic, palette: preset.palette, type: "er" });
35057
+ const b = diagram(preset.id, {
35058
+ topic: preset.topic,
35059
+ palette: preset.palette,
35060
+ textMetrics: preset.textMetrics,
35061
+ type: "er"
35062
+ });
34625
35063
  const entities = [];
34626
35064
  const phaseActivate = [];
34627
35065
  let relIdx = 0;
@@ -34644,7 +35082,7 @@ function er(preset) {
34644
35082
  \u5024.forEach(\u8DB3\u3059);
34645
35083
  const \u8A2D\u8A08\u306E\u5F62 = \u884C.length > 0;
34646
35084
  const rows = \u8A2D\u8A08\u306E\u5F62 ? \u884C : e.rows ?? [];
34647
- const boxW = fitRowsWidth(entityW, rows);
35085
+ const boxW = fitRowsWidth(entityW, rows, resolveTextMetrics(preset.textMetrics));
34648
35086
  b.lane(laneId, { width: boxLaneW(boxW) });
34649
35087
  b.node(e.id, {
34650
35088
  lane: laneId,
@@ -34708,7 +35146,7 @@ function stateMachine(preset) {
34708
35146
  const stateW = resolveStateW(preset.stateWidth, "stateMachine");
34709
35147
  const tone = preset.defaultTone ?? "accent";
34710
35148
  const diagramType = "state";
34711
- const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
35149
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: diagramType });
34712
35150
  const phaseActivate = [];
34713
35151
  const stateOrder = /* @__PURE__ */ new Map();
34714
35152
  const \u72B6\u614B = [];
@@ -34739,7 +35177,7 @@ function stateMachine(preset) {
34739
35177
  const \u884C = (s.actions ?? []).map((a) => a.note ? `${a.label}: ${a.note}` : a.label);
34740
35178
  const \u5370 = (s.actions ?? []).map((a) => FSM_ACTION_MARK[a.when]);
34741
35179
  const laneId = \u683C\u5B50 && s.col !== void 0 ? `col-${s.col}` : `lane-${s.id}`;
34742
- const boxW = \u8A2D\u8A08\u306E\u5F62 ? fitRowsWidth(stateW, \u884C) : stateW;
35180
+ const boxW = \u8A2D\u8A08\u306E\u5F62 ? fitRowsWidth(stateW, \u884C, resolveTextMetrics(preset.textMetrics)) : stateW;
34743
35181
  return { s, \u884C, \u5370, laneId, boxW, stack: \u683C\u5B50 ? s.row ?? 0 : 0 };
34744
35182
  });
34745
35183
  const \u7BC0\u70B9\u306E\u4E2D\u8EAB = \u7BC0\u70B9.map((m) => ({
@@ -34820,7 +35258,11 @@ function infrastructure(preset) {
34820
35258
  const laneW = preset.laneWidth ?? 380;
34821
35259
  const tone = preset.defaultTone ?? "accent";
34822
35260
  const style = preset.defaultStyle ?? "solid";
34823
- const b = diagram(preset.id, { topic: preset.topic, type: "infrastructure" });
35261
+ const b = diagram(preset.id, {
35262
+ topic: preset.topic,
35263
+ textMetrics: preset.textMetrics,
35264
+ type: "infrastructure"
35265
+ });
34824
35266
  const colLaneIds = /* @__PURE__ */ new Map();
34825
35267
  const phaseActivate = [];
34826
35268
  let connIdx = 0;
@@ -34901,7 +35343,12 @@ function classDiagram(preset) {
34901
35343
  const classW = resolveStorageBoxW(preset.classWidth, "classDiagram", "classWidth");
34902
35344
  const \u56F3\u306E\u65E2\u5B9A = preset.defaultTone;
34903
35345
  const \u7E1E\u3092\u6577\u304F = preset.rowStripe ?? true;
34904
- const b = diagram(preset.id, { topic: preset.topic, palette: preset.palette, type: "class" });
35346
+ const b = diagram(preset.id, {
35347
+ topic: preset.topic,
35348
+ palette: preset.palette,
35349
+ textMetrics: preset.textMetrics,
35350
+ type: "class"
35351
+ });
34905
35352
  const classes = [];
34906
35353
  const phaseActivate = [];
34907
35354
  const \u7BB1 = [];
@@ -34927,7 +35374,7 @@ function classDiagram(preset) {
34927
35374
  rows.push(stripAccess(m));
34928
35375
  rowMarks.push({ shape: "chevron", filled: isPublic(m) });
34929
35376
  }
34930
- const boxW = fitRowsWidth(classW, rows);
35377
+ const boxW = fitRowsWidth(classW, rows, resolveTextMetrics(preset.textMetrics));
34931
35378
  const laneId = c.col !== void 0 ? `col-${c.col}` : `lane-${c.id}`;
34932
35379
  return { c, rows, rowMarks, boxW, laneId, stack: c.col !== void 0 ? c.row ?? 0 : 0 };
34933
35380
  });
@@ -34990,7 +35437,7 @@ function classDiagram(preset) {
34990
35437
  }
34991
35438
  function tree(preset) {
34992
35439
  const canvasH = 480;
34993
- const b = diagram(preset.id, { topic: preset.topic, type: "tree" });
35440
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "tree" });
34994
35441
  const treeNodes = [];
34995
35442
  const api = {
34996
35443
  node(n) {
@@ -35029,7 +35476,7 @@ function tree(preset) {
35029
35476
  function userJourney(preset) {
35030
35477
  const canvasW = preset.stepWidth ? preset.stepWidth * 2 : 720;
35031
35478
  const canvasH = 480;
35032
- const b = diagram(preset.id, { topic: preset.topic, type: "journey" });
35479
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "journey" });
35033
35480
  const steps = [];
35034
35481
  const api = {
35035
35482
  step(s) {
@@ -35069,7 +35516,7 @@ function mindMap(preset) {
35069
35516
  const canvasW = preset.branchWidth ? preset.branchWidth * 2 : 720;
35070
35517
  const canvasH = 480;
35071
35518
  const diagramType = "mind";
35072
- const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
35519
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: diagramType });
35073
35520
  const branches = [];
35074
35521
  const api = {
35075
35522
  branch(br) {
@@ -35113,7 +35560,7 @@ function mindMap(preset) {
35113
35560
  function funnel(preset) {
35114
35561
  const canvasW = toGridSize(preset.stageWidth ?? 560);
35115
35562
  const canvasH = 480;
35116
- const b = diagram(preset.id, { topic: preset.topic, type: "funnel" });
35563
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "funnel" });
35117
35564
  const stages = [];
35118
35565
  const api = {
35119
35566
  stage(s) {
@@ -35151,7 +35598,7 @@ function funnel(preset) {
35151
35598
  function quadrant(preset) {
35152
35599
  const canvasW = 640;
35153
35600
  const canvasH = 480;
35154
- const b = diagram(preset.id, { topic: preset.topic, type: "quadrant" });
35601
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "quadrant" });
35155
35602
  const items = [];
35156
35603
  const api = {
35157
35604
  item(it) {
@@ -35202,7 +35649,7 @@ function chart(preset) {
35202
35649
  const canvasH = toGridSize(
35203
35650
  preset.type === "pie" || preset.type === "gauge" || preset.type === "radial" || preset.type === "stat" || preset.type === "waffle" || preset.type === "stacked-bar" ? 320 : 360
35204
35651
  );
35205
- const b = diagram(preset.id, { topic: preset.topic, type: "chart" });
35652
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "chart" });
35206
35653
  const data = [];
35207
35654
  const kindMap = {
35208
35655
  line: "chart-line",
@@ -35252,7 +35699,7 @@ function gantt(preset) {
35252
35699
  const canvasW = preset.laneWidth ? preset.laneWidth * 2 : 720;
35253
35700
  const canvasH = 360;
35254
35701
  const tone = preset.defaultTone ?? "teal";
35255
- const b = diagram(preset.id, { topic: preset.topic, type: "gantt" });
35702
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "gantt" });
35256
35703
  const tasks = [];
35257
35704
  const api = {
35258
35705
  task(t) {
@@ -35320,7 +35767,7 @@ function flowchart(preset) {
35320
35767
  const laneW = preset.laneWidth ?? 380;
35321
35768
  const tone = preset.defaultTone ?? "accent";
35322
35769
  const \u7E26\u306B\u7A4D\u3080 = (preset.direction ?? "horizontal") === "vertical";
35323
- const b = diagram(preset.id, { topic: preset.topic, type: "flowchart" });
35770
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "flowchart" });
35324
35771
  const laneToId = /* @__PURE__ */ new Map();
35325
35772
  const laneStackCount = /* @__PURE__ */ new Map();
35326
35773
  if (\u7E26\u306B\u7A4D\u3080) {
@@ -35395,7 +35842,7 @@ var NET_KIND_LABEL = {
35395
35842
  function network(preset) {
35396
35843
  const laneW = preset.laneWidth ?? 320;
35397
35844
  const tone = preset.defaultTone ?? "info";
35398
- const b = diagram(preset.id, { topic: preset.topic, type: "network" });
35845
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "network" });
35399
35846
  const colLaneIds = /* @__PURE__ */ new Map();
35400
35847
  const phaseActivate = [];
35401
35848
  let edgeIdx = 0;
@@ -35446,7 +35893,7 @@ function stateMachine2(preset) {
35446
35893
  const laneW = boxLaneW(stateW);
35447
35894
  const tone = preset.defaultTone ?? "accent";
35448
35895
  const diagramType = "state";
35449
- const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
35896
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: diagramType });
35450
35897
  const stateOrder = /* @__PURE__ */ new Map();
35451
35898
  const phaseActivate = [];
35452
35899
  let transIdx = 0;
@@ -35651,6 +36098,7 @@ exports.resolveLang = resolveLang;
35651
36098
  exports.resolveOverlapsWithChain = resolveOverlapsWithChain;
35652
36099
  exports.resolveTarget = resolveTarget;
35653
36100
  exports.resolveTargetAll = resolveTargetAll;
36101
+ exports.resolveTextMetrics = resolveTextMetrics;
35654
36102
  exports.segmentsIntersect = segmentsIntersect2;
35655
36103
  exports.sequence = sequence;
35656
36104
  exports.sequenceBoardMetrics = sequenceBoardMetrics;