@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.js CHANGED
@@ -710,6 +710,11 @@ function \u5B57\u3092\u5DEE\u3057\u8FBC\u3080(template, values) {
710
710
  return template.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole);
711
711
  }
712
712
 
713
+ // src/text-metrics.ts
714
+ function resolveTextMetrics(value) {
715
+ return value === "monospace" ? "monospace" : "proportional";
716
+ }
717
+
713
718
  // src/formula/ast.ts
714
719
  var ALLOWED_MATH_FNS = /* @__PURE__ */ new Set([
715
720
  "min",
@@ -1648,13 +1653,215 @@ function \u5024\u3092\u540D\u524D\u3067\u8AAD\u3080(\u5165\u529B\u6B04, \u5024)
1648
1653
  return \u5024.split(",").map((v) => \u5165\u529B\u6B04.\u540D\u524D.get(v) ?? v).join(",");
1649
1654
  }
1650
1655
 
1656
+ // src/layout/text-width.ts
1657
+ var INTER_BOLD_ADVANCE_EM = {
1658
+ // uppercase (実測係数化、 Inter Bold 仕様 × 1.20)
1659
+ A: 0.86,
1660
+ B: 0.86,
1661
+ C: 0.88,
1662
+ D: 0.93,
1663
+ E: 0.82,
1664
+ F: 0.79,
1665
+ G: 0.94,
1666
+ H: 0.92,
1667
+ I: 0.44,
1668
+ J: 0.66,
1669
+ K: 0.86,
1670
+ L: 0.74,
1671
+ M: 1.12,
1672
+ N: 0.94,
1673
+ O: 0.94,
1674
+ P: 0.85,
1675
+ Q: 0.94,
1676
+ R: 0.87,
1677
+ S: 0.79,
1678
+ T: 0.82,
1679
+ U: 0.91,
1680
+ V: 0.85,
1681
+ W: 1.22,
1682
+ X: 0.85,
1683
+ Y: 0.82,
1684
+ Z: 0.82,
1685
+ // lowercase (実測係数化、 Inter Bold 仕様 × 1.22)
1686
+ a: 0.73,
1687
+ b: 0.77,
1688
+ c: 0.68,
1689
+ d: 0.77,
1690
+ e: 0.73,
1691
+ f: 0.51,
1692
+ g: 0.76,
1693
+ h: 0.77,
1694
+ i: 0.39,
1695
+ j: 0.41,
1696
+ k: 0.73,
1697
+ l: 0.39,
1698
+ m: 1.15,
1699
+ n: 0.77,
1700
+ o: 0.76,
1701
+ p: 0.77,
1702
+ q: 0.77,
1703
+ r: 0.54,
1704
+ s: 0.65,
1705
+ t: 0.54,
1706
+ u: 0.77,
1707
+ v: 0.71,
1708
+ w: 1.05,
1709
+ x: 0.71,
1710
+ y: 0.71,
1711
+ z: 0.66,
1712
+ // digits (Inter Bold tabular-nums、 実測係数化 × 1.20)
1713
+ "0": 0.72,
1714
+ "1": 0.72,
1715
+ "2": 0.72,
1716
+ "3": 0.72,
1717
+ "4": 0.72,
1718
+ "5": 0.72,
1719
+ "6": 0.72,
1720
+ "7": 0.72,
1721
+ "8": 0.72,
1722
+ "9": 0.72,
1723
+ // ascii symbols (実測係数化 × 1.15、 punct 系は kerning が広く効くため 1.20)
1724
+ " ": 0.35,
1725
+ "!": 0.44,
1726
+ '"': 0.59,
1727
+ "#": 0.78,
1728
+ "$": 0.72,
1729
+ "%": 1,
1730
+ "&": 0.86,
1731
+ "'": 0.32,
1732
+ "(": 0.46,
1733
+ ")": 0.46,
1734
+ "*": 0.63,
1735
+ "+": 0.78,
1736
+ ",": 0.36,
1737
+ "-": 0.5,
1738
+ ".": 0.36,
1739
+ "/": 0.51,
1740
+ ":": 0.36,
1741
+ ";": 0.36,
1742
+ "<": 0.78,
1743
+ "=": 0.78,
1744
+ ">": 0.78,
1745
+ "?": 0.63,
1746
+ "@": 1.17,
1747
+ "[": 0.48,
1748
+ "\\": 0.51,
1749
+ "]": 0.48,
1750
+ "^": 0.63,
1751
+ "_": 0.63,
1752
+ "`": 0.48,
1753
+ "{": 0.52,
1754
+ "|": 0.37,
1755
+ "}": 0.52,
1756
+ "~": 0.78
1757
+ };
1758
+ var JETBRAINS_MONO_ADVANCE_EM = 0.63;
1759
+ function isCJK(code) {
1760
+ return code >= 12288 && code <= 12543 || // CJK symbols / hiragana / katakana
1761
+ code >= 13312 && code <= 40959 || // CJK ideographs
1762
+ code >= 63744 && code <= 64255 || // CJK compat ideographs
1763
+ code >= 65281 && code <= 65376 || // fullwidth ASCII
1764
+ code >= 65504 && code <= 65510;
1765
+ }
1766
+ function isHalfwidthKana(code) {
1767
+ return code >= 65377 && code <= 65500;
1768
+ }
1769
+ var EMOJI_ADVANCE_EM = 1.05;
1770
+ var MONO_EMOJI_ADVANCE_EM = 1.16;
1771
+ var DRAWN_CJK_RATIO = 1.08;
1772
+ var DRAWN_ASCII_RATIO = 1.16;
1773
+ function isAscii(code) {
1774
+ return code < 128;
1775
+ }
1776
+ var WIDE_SYMBOL_ADVANCE_EM = 0.95;
1777
+ function isEmoji(code) {
1778
+ return code >= 126976 && code <= 129791 || // 絵文字の主要面
1779
+ code >= 9728 && code <= 10175 || // 記号と絵文字 (♻ ✅ ❤ 等)
1780
+ code >= 127462 && code <= 127487;
1781
+ }
1782
+ function isEmojiGrapheme(grapheme, firstCode) {
1783
+ return isEmoji(firstCode) || grapheme.includes("\uFE0F");
1784
+ }
1785
+ function isWideSymbol(code) {
1786
+ return code >= 8592 && code <= 8703 || // 矢印
1787
+ code >= 9472 && code <= 9599 || // 罫線
1788
+ code >= 9632 && code <= 9727 || // 幾何図形
1789
+ code >= 11008 && code <= 11263;
1790
+ }
1791
+ var CLUSTER_JOINER_RE = /\u200d|\ufe0f|[\u{1f000}-\u{1faff}]|[\u{2600}-\u{27bf}]/u;
1792
+ var \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B;
1793
+ function segmentGraphemes(text) {
1794
+ if (typeof Intl === "undefined" || typeof Intl.Segmenter !== "function") {
1795
+ return [...text];
1796
+ }
1797
+ \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B ??= new Intl.Segmenter(void 0, { granularity: "grapheme" });
1798
+ return [...\u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B.segment(text)].map((s) => s.segment);
1799
+ }
1800
+ function defaultAdvanceEm(ch, code) {
1801
+ if (isEmoji(code)) return EMOJI_ADVANCE_EM;
1802
+ if (isWideSymbol(code)) return WIDE_SYMBOL_ADVANCE_EM;
1803
+ if (isCJK(code)) return 1.08;
1804
+ if (isHalfwidthKana(code)) return 0.72;
1805
+ if (ch >= "a" && ch <= "z") return 0.73;
1806
+ if (ch >= "A" && ch <= "Z") return 0.86;
1807
+ if (ch >= "0" && ch <= "9") return 0.72;
1808
+ return 0.65;
1809
+ }
1810
+ function measureAdvanceWidth(text, opts = {}) {
1811
+ const fontSize = opts.fontSize ?? 22;
1812
+ const letterSpacing = opts.letterSpacing ?? 0;
1813
+ const fontFamily = opts.textMetrics === "monospace" ? "mono" : opts.fontFamily ?? "sans";
1814
+ const bound = opts.bound ?? "layout";
1815
+ let advanceEmSum = 0;
1816
+ let charCount = 0;
1817
+ const \u6587\u5B57\u5217 = CLUSTER_JOINER_RE.test(text) ? segmentGraphemes(text) : [...text];
1818
+ for (const ch of \u6587\u5B57\u5217) {
1819
+ charCount++;
1820
+ const code = ch.codePointAt(0) ?? 0;
1821
+ const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) && fontFamily !== "mono" ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
1822
+ if (isEmojiGrapheme(ch, code)) {
1823
+ advanceEmSum += fontFamily === "mono" ? MONO_EMOJI_ADVANCE_EM : EMOJI_ADVANCE_EM;
1824
+ continue;
1825
+ }
1826
+ if (fontFamily === "mono") {
1827
+ advanceEmSum += (isCJK(code) ? 1.08 : JETBRAINS_MONO_ADVANCE_EM) / \u5272\u308A\u623B\u3057;
1828
+ continue;
1829
+ }
1830
+ if (isCJK(code)) {
1831
+ advanceEmSum += 1.08 / \u5272\u308A\u623B\u3057;
1832
+ continue;
1833
+ }
1834
+ const table = ch.length === 1 ? INTER_BOLD_ADVANCE_EM[ch] : void 0;
1835
+ advanceEmSum += (table !== void 0 ? table : defaultAdvanceEm(ch, code)) / \u5272\u308A\u623B\u3057;
1836
+ }
1837
+ return advanceEmSum * fontSize + letterSpacing * charCount;
1838
+ }
1839
+ function measureTextWidth(text, opts = {}) {
1840
+ const fontSize = opts.fontSize ?? 22;
1841
+ const bound = opts.bound ?? "layout";
1842
+ const w = measureAdvanceWidth(text, opts);
1843
+ return bound === "drawn" ? w : Math.max(w, fontSize * 1.2);
1844
+ }
1845
+ function \u53CE\u3081\u308B\u500D\u7387(text, opts, \u5E45) {
1846
+ if (!(\u5E45 > 0) || !(opts.fontSize > 0)) return 1;
1847
+ const \u5B9F\u5E45 = measureTextWidth(text, { ...opts, letterSpacing: 0 });
1848
+ return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
1849
+ }
1850
+
1651
1851
  // src/kinds/text-width.ts
1652
1852
  var WIDE_RATIO = 1.04;
1653
1853
  var NARROW_RATIO = 0.37;
1654
1854
  var ASCII_RATIO = 0.86;
1655
1855
  var WIDE_CHARS = "W@%Mm";
1656
1856
  var NARROW_CHARS = "ijlI.,:;'! ";
1657
- function textWidth(s, size, \u5B57\u9001\u308A = 0) {
1857
+ function textWidth(s, size, \u5B57\u9001\u308A = 0, textMetrics = "proportional") {
1858
+ if (textMetrics === "monospace") {
1859
+ return measureAdvanceWidth(s, {
1860
+ fontSize: size,
1861
+ letterSpacing: \u5B57\u9001\u308A,
1862
+ fontFamily: "mono"
1863
+ });
1864
+ }
1658
1865
  let \u5E45 = 0;
1659
1866
  let \u5B57\u6570 = 0;
1660
1867
  for (const c of s) {
@@ -1691,8 +1898,8 @@ function splitRow(row) {
1691
1898
  }
1692
1899
  return { left: row.trim(), right: "", split: false };
1693
1900
  }
1694
- function rowColumnWidth(text, size, mono) {
1695
- return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size);
1901
+ function rowColumnWidth(text, size, mono, textMetrics = "proportional") {
1902
+ return mono ? displayWidth(text) * size * MONO_ADVANCE_RATIO : textWidth(text, size, 0, textMetrics);
1696
1903
  }
1697
1904
  function displayWidth(text) {
1698
1905
  let w = 0;
@@ -1718,12 +1925,12 @@ function \u6841\u3067\u7701\u304F(text, \u4E0A\u9650) {
1718
1925
  if (displayWidth(text) <= \u4E0A\u9650) return text;
1719
1926
  return `${\u6841\u3067\u5272\u308B(text, \u4E0A\u9650 - 1)[0]}\u2026`;
1720
1927
  }
1721
- function requiredRowsWidth(rows, kind) {
1928
+ function requiredRowsWidth(rows, kind, textMetrics = "proportional") {
1722
1929
  if (!rows || rows.length === 0) return 0;
1723
1930
  const splits = rows.map(splitRow);
1724
1931
  const \u4E00\u756A\u5E83\u3044 = (\u53D6\u308B) => splits.reduce((m, s) => Math.max(m, \u53D6\u308B(s)), 0);
1725
- 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;
1726
- 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;
1932
+ 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;
1933
+ 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;
1727
1934
  if (kind === void 0) return Math.ceil(Math.max(storage, generic));
1728
1935
  return Math.ceil(kind === "storage" ? storage : generic);
1729
1936
  }
@@ -1788,7 +1995,10 @@ var \u5DE6\u53F3\u306E\u4F59\u767D = 8;
1788
1995
  function \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45) {
1789
1996
  return \u7BB1\u306E\u5E45 - \u5DE6\u53F3\u306E\u4F59\u767D * 2;
1790
1997
  }
1791
- function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
1998
+ function \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics = "proportional") {
1999
+ return (text, fontSize) => textWidth(text, fontSize, 0, textMetrics);
2000
+ }
2001
+ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
1792
2002
  if (\u4F7F\u3048\u308B\u5E452 <= 0) return "";
1793
2003
  if (\u6E2C\u308B(text, fontSize) <= \u4F7F\u3048\u308B\u5E452) return text;
1794
2004
  const \u7701\u7565 = "\u2026";
@@ -1805,7 +2015,7 @@ function \u5E45\u3067\u5207\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6
1805
2015
  return `${\u51FA}${\u7701\u7565}`;
1806
2016
  }
1807
2017
  var \u7E2E\u3081\u306E\u4E0B\u9650 = MIN_TEXT_SIZE;
1808
- function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B = textWidth) {
2018
+ function \u5E45\u306B\u53CE\u3081\u308B(text, fontSize, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B) {
1809
2019
  let size = fontSize;
1810
2020
  while (size > \u7E2E\u3081\u306E\u4E0B\u9650 && \u6E2C\u308B(text, size) > \u4F7F\u3048\u308B\u5E452) size -= 1;
1811
2021
  return { text: \u5E45\u3067\u5207\u308B(text, size, \u4F7F\u3048\u308B\u5E452, \u6E2C\u308B), fontSize: size };
@@ -1815,7 +2025,7 @@ function \u66F8\u8A18\u7D20\u306B\u5206\u3051\u308B(text) {
1815
2025
  if (typeof \u533A\u5207\u308A !== "function") return [...text];
1816
2026
  return [...new \u533A\u5207\u308A(void 0, { granularity: "grapheme" }).segment(text)].map((g) => g.segment);
1817
2027
  }
1818
- function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553) {
2028
+ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8\u30553, \u6E2C\u308B) {
1819
2029
  const \u5019\u88DC = \u884C.filter((r, i) => i === 0 || r.text.trim() !== "");
1820
2030
  if (\u5019\u88DC.length === 0) return [];
1821
2031
  const \u4F7F\u3048\u308B\u9AD8\u3055 = \u7BB1\u306E\u9AD8\u30553 - \u4E0A\u4E0B\u306E\u4F59\u767D * 2;
@@ -1823,7 +2033,7 @@ function \u7BB1\u306B\u7A4D\u3080(\u884C, \u7BB1\u306E\u5E45, \u7BB1\u306E\u9AD8
1823
2033
  const \u6B8B\u3059 = [...\u5019\u88DC];
1824
2034
  while (\u6B8B\u3059.length > 1 && \u9AD8\u3055(\u6B8B\u3059) > \u4F7F\u3048\u308B\u9AD8\u3055) \u6B8B\u3059.pop();
1825
2035
  const \u5E45 = \u4F7F\u3048\u308B\u5E45(\u7BB1\u306E\u5E45);
1826
- const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45) }));
2036
+ const \u53CE\u3081\u305F = \u6B8B\u3059.map((r) => ({ ...r, ...\u5E45\u306B\u53CE\u3081\u308B(r.text, r.fontSize, \u5E45, \u6E2C\u308B) }));
1827
2037
  const \u7DCF\u9AD8 = \u9AD8\u3055(\u53CE\u3081\u305F);
1828
2038
  let \u7A4D\u307F = -\u7DCF\u9AD8 / 2;
1829
2039
  return \u53CE\u3081\u305F.map((r) => {
@@ -2180,7 +2390,15 @@ function useInteractiveIntegration(diagram2, options = {}) {
2180
2390
  f.id
2181
2391
  )) }),
2182
2392
  scrolls.length > 0 && /* @__PURE__ */ jsx("div", { className: "cdl-ip-group", children: scrolls.map((s) => /* @__PURE__ */ jsx(ScrollReadout, { id: s.id, name: s.label || s.id, progress: stateOverrides[s.id] }, s.id)) }),
2183
- readouts.length > 0 && /* @__PURE__ */ jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsx(ReadoutWidget, { readout: r, stateOverrides: mergedStateValues }, r.id)) })
2393
+ readouts.length > 0 && /* @__PURE__ */ jsx("div", { className: "cdl-ip-group", children: readouts.map((r) => /* @__PURE__ */ jsx(
2394
+ ReadoutWidget,
2395
+ {
2396
+ readout: r,
2397
+ stateOverrides: mergedStateValues,
2398
+ textMetrics: resolveTextMetrics(diagram2.textMetrics)
2399
+ },
2400
+ r.id
2401
+ )) })
2184
2402
  ] }) })
2185
2403
  );
2186
2404
  }, [diagram2, signals, stateOverrides, mergedStateValues]);
@@ -2601,7 +2819,8 @@ function StepperWidget({
2601
2819
  }
2602
2820
  function ReadoutWidget({
2603
2821
  readout,
2604
- stateOverrides
2822
+ stateOverrides,
2823
+ textMetrics = "proportional"
2605
2824
  }) {
2606
2825
  const rawValue = "source" in readout ? stateOverrides[readout.source] : void 0;
2607
2826
  const numericValue = typeof rawValue === "number" ? rawValue : typeof rawValue === "string" ? Number(rawValue) : Number.NaN;
@@ -2849,7 +3068,8 @@ function ReadoutWidget({
2849
3068
  max: readout.max,
2850
3069
  viewW: readout.viewW ?? 280,
2851
3070
  viewH: readout.viewH ?? 60,
2852
- color: readout.color ?? "#2563eb"
3071
+ color: readout.color ?? "#2563eb",
3072
+ textMetrics
2853
3073
  }
2854
3074
  );
2855
3075
  case "radar": {
@@ -3665,7 +3885,8 @@ function ReadoutWidget({
3665
3885
  { status: "idle", color: "#94a3b8" },
3666
3886
  { status: "error", color: "#ef4444" }
3667
3887
  ],
3668
- max: readout.max ?? 10
3888
+ max: readout.max ?? 10,
3889
+ textMetrics
3669
3890
  }
3670
3891
  );
3671
3892
  case "calendar-week":
@@ -4809,8 +5030,8 @@ function ProgressGroupReadout({
4809
5030
  }) })
4810
5031
  ] });
4811
5032
  }
4812
- function sequenceLabelAnchor(x, name, fontSize, viewW) {
4813
- const half = textWidth(name, fontSize) / 2;
5033
+ function sequenceLabelAnchor(x, name, fontSize, viewW, textMetrics = "proportional") {
5034
+ const half = textWidth(name, fontSize, 0, textMetrics) / 2;
4814
5035
  if (x - half < 0) return "start";
4815
5036
  if (x + half > viewW) return "end";
4816
5037
  return "middle";
@@ -4823,7 +5044,8 @@ function SequenceTimelineReadout({
4823
5044
  max,
4824
5045
  viewW,
4825
5046
  viewH,
4826
- color
5047
+ color,
5048
+ textMetrics = "proportional"
4827
5049
  }) {
4828
5050
  const events = [];
4829
5051
  const trimmed = value.trim();
@@ -4866,7 +5088,17 @@ function SequenceTimelineReadout({
4866
5088
  const x = xFor(e.t);
4867
5089
  return /* @__PURE__ */ jsxs("g", { "data-cdl-event-marker": e.name, children: [
4868
5090
  /* @__PURE__ */ jsx("circle", { cx: x, cy: trackY, r: 5, fill: color, stroke: "#fff", strokeWidth: 1.5, children: /* @__PURE__ */ jsx(\u5B57\u306E\u898B\u51FA\u3057, { k: "readout.sequenceTimeline.title", v: { name: e.name, t: e.t } }) }),
4869
- /* @__PURE__ */ jsx("text", { x, y: trackY - 12, textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW), fontSize: 10, fill: "var(--v4-ink, #1a1f2a)", children: e.name }),
5091
+ /* @__PURE__ */ jsx(
5092
+ "text",
5093
+ {
5094
+ x,
5095
+ y: trackY - 12,
5096
+ textAnchor: sequenceLabelAnchor(x, e.name, 10, viewW, textMetrics),
5097
+ fontSize: 10,
5098
+ fill: "var(--v4-ink, #1a1f2a)",
5099
+ children: e.name
5100
+ }
5101
+ ),
4870
5102
  /* @__PURE__ */ jsx("text", { x, y: trackY + 18, textAnchor: "middle", fontSize: 9, fill: "var(--v4-mute, #64748b)", children: e.t })
4871
5103
  ] }, i);
4872
5104
  })
@@ -7943,7 +8175,8 @@ function StatusTimelineReadout({
7943
8175
  label,
7944
8176
  value,
7945
8177
  colorMap,
7946
- max
8178
+ max,
8179
+ textMetrics = "proportional"
7947
8180
  }) {
7948
8181
  const events = [];
7949
8182
  const trimmed = value.trim();
@@ -7968,6 +8201,7 @@ function StatusTimelineReadout({
7968
8201
  const cellW = shown.length > 0 ? (width - 20) / shown.length : 0;
7969
8202
  const height = stripHeight + 40;
7970
8203
  const \u533A\u9593\u306E\u5B57 = (status) => status === "active" || status === "idle" || status === "error" ? \u5F15\u304F(`readout.statusTimeline.${status}`) : status.toUpperCase();
8204
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
7971
8205
  return /* @__PURE__ */ jsxs("div", { className: "cdl-ip-item cdl-ip-readout-status-timeline", "data-cdl-readout": id, children: [
7972
8206
  /* @__PURE__ */ jsx("span", { className: "cdl-ip-label", children: label }),
7973
8207
  /* @__PURE__ */ jsx(
@@ -7981,7 +8215,7 @@ function StatusTimelineReadout({
7981
8215
  const x = 10 + i * cellW;
7982
8216
  const c = colorLookup.get(ev.status) ?? "#cbd5e1";
7983
8217
  const \u5B572 = \u533A\u9593\u306E\u5B57(ev.status);
7984
- const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8);
8218
+ const \u63CF\u304F\u5B57 = \u5E45\u3067\u5207\u308B(\u5B572, 10, cellW - 8, \u6E2C\u308B);
7985
8219
  return /* @__PURE__ */ jsxs("g", { "data-cdl-status-event": i, "data-cdl-status": ev.status, children: [
7986
8220
  /* @__PURE__ */ jsx("rect", { x, y: 10, width: cellW - 2, height: stripHeight, fill: c, rx: 2 }),
7987
8221
  /* @__PURE__ */ jsxs(
@@ -12092,6 +12326,8 @@ function diagram(id, options) {
12092
12326
  ...options.palette !== void 0 ? { palette: options.palette } : {},
12093
12327
  // 言語も素通しする。 型の外の値を既定に落とすのは `layout` の 1 箇所に置く
12094
12328
  ...options.lang !== void 0 ? { lang: options.lang } : {},
12329
+ // 字幅の測り方も素通しする。型の外の値を既定に落とすのは `layout` の 1 箇所に置く
12330
+ ...options.textMetrics !== void 0 ? { textMetrics: options.textMetrics } : {},
12095
12331
  // 種類の名前も同じ経路で渡し、空文字の扱いを `layout` の 1 箇所に揃える
12096
12332
  ...options.type !== void 0 ? { type: options.type } : {},
12097
12333
  // inputs / formulas / scrollTriggers / eventBindings は空なら省略 (static diagram の JSON 形状維持)
@@ -12124,196 +12360,6 @@ var ARROW_ANGLE_MAX_DEG = 100;
12124
12360
  var FAN_GAP = 120;
12125
12361
  var DETOUR_GAP = 94;
12126
12362
 
12127
- // src/layout/text-width.ts
12128
- var INTER_BOLD_ADVANCE_EM = {
12129
- // uppercase (実測係数化、 Inter Bold 仕様 × 1.20)
12130
- A: 0.86,
12131
- B: 0.86,
12132
- C: 0.88,
12133
- D: 0.93,
12134
- E: 0.82,
12135
- F: 0.79,
12136
- G: 0.94,
12137
- H: 0.92,
12138
- I: 0.44,
12139
- J: 0.66,
12140
- K: 0.86,
12141
- L: 0.74,
12142
- M: 1.12,
12143
- N: 0.94,
12144
- O: 0.94,
12145
- P: 0.85,
12146
- Q: 0.94,
12147
- R: 0.87,
12148
- S: 0.79,
12149
- T: 0.82,
12150
- U: 0.91,
12151
- V: 0.85,
12152
- W: 1.22,
12153
- X: 0.85,
12154
- Y: 0.82,
12155
- Z: 0.82,
12156
- // lowercase (実測係数化、 Inter Bold 仕様 × 1.22)
12157
- a: 0.73,
12158
- b: 0.77,
12159
- c: 0.68,
12160
- d: 0.77,
12161
- e: 0.73,
12162
- f: 0.51,
12163
- g: 0.76,
12164
- h: 0.77,
12165
- i: 0.39,
12166
- j: 0.41,
12167
- k: 0.73,
12168
- l: 0.39,
12169
- m: 1.15,
12170
- n: 0.77,
12171
- o: 0.76,
12172
- p: 0.77,
12173
- q: 0.77,
12174
- r: 0.54,
12175
- s: 0.65,
12176
- t: 0.54,
12177
- u: 0.77,
12178
- v: 0.71,
12179
- w: 1.05,
12180
- x: 0.71,
12181
- y: 0.71,
12182
- z: 0.66,
12183
- // digits (Inter Bold tabular-nums、 実測係数化 × 1.20)
12184
- "0": 0.72,
12185
- "1": 0.72,
12186
- "2": 0.72,
12187
- "3": 0.72,
12188
- "4": 0.72,
12189
- "5": 0.72,
12190
- "6": 0.72,
12191
- "7": 0.72,
12192
- "8": 0.72,
12193
- "9": 0.72,
12194
- // ascii symbols (実測係数化 × 1.15、 punct 系は kerning が広く効くため 1.20)
12195
- " ": 0.35,
12196
- "!": 0.44,
12197
- '"': 0.59,
12198
- "#": 0.78,
12199
- "$": 0.72,
12200
- "%": 1,
12201
- "&": 0.86,
12202
- "'": 0.32,
12203
- "(": 0.46,
12204
- ")": 0.46,
12205
- "*": 0.63,
12206
- "+": 0.78,
12207
- ",": 0.36,
12208
- "-": 0.5,
12209
- ".": 0.36,
12210
- "/": 0.51,
12211
- ":": 0.36,
12212
- ";": 0.36,
12213
- "<": 0.78,
12214
- "=": 0.78,
12215
- ">": 0.78,
12216
- "?": 0.63,
12217
- "@": 1.17,
12218
- "[": 0.48,
12219
- "\\": 0.51,
12220
- "]": 0.48,
12221
- "^": 0.63,
12222
- "_": 0.63,
12223
- "`": 0.48,
12224
- "{": 0.52,
12225
- "|": 0.37,
12226
- "}": 0.52,
12227
- "~": 0.78
12228
- };
12229
- var JETBRAINS_MONO_ADVANCE_EM = 0.63;
12230
- function isCJK(code) {
12231
- return code >= 12288 && code <= 12543 || // CJK symbols / hiragana / katakana
12232
- code >= 13312 && code <= 40959 || // CJK ideographs
12233
- code >= 63744 && code <= 64255 || // CJK compat ideographs
12234
- code >= 65281 && code <= 65376 || // fullwidth ASCII
12235
- code >= 65504 && code <= 65510;
12236
- }
12237
- function isHalfwidthKana(code) {
12238
- return code >= 65377 && code <= 65500;
12239
- }
12240
- var EMOJI_ADVANCE_EM = 1.05;
12241
- var MONO_EMOJI_ADVANCE_EM = 1.16;
12242
- var DRAWN_CJK_RATIO = 1.08;
12243
- var DRAWN_ASCII_RATIO = 1.16;
12244
- function isAscii(code) {
12245
- return code < 128;
12246
- }
12247
- var WIDE_SYMBOL_ADVANCE_EM = 0.95;
12248
- function isEmoji(code) {
12249
- return code >= 126976 && code <= 129791 || // 絵文字の主要面
12250
- code >= 9728 && code <= 10175 || // 記号と絵文字 (♻ ✅ ❤ 等)
12251
- code >= 127462 && code <= 127487;
12252
- }
12253
- function isEmojiGrapheme(grapheme, firstCode) {
12254
- return isEmoji(firstCode) || grapheme.includes("\uFE0F");
12255
- }
12256
- function isWideSymbol(code) {
12257
- return code >= 8592 && code <= 8703 || // 矢印
12258
- code >= 9472 && code <= 9599 || // 罫線
12259
- code >= 9632 && code <= 9727 || // 幾何図形
12260
- code >= 11008 && code <= 11263;
12261
- }
12262
- var CLUSTER_JOINER_RE = /\u200d|\ufe0f|[\u{1f000}-\u{1faff}]|[\u{2600}-\u{27bf}]/u;
12263
- var \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B;
12264
- function segmentGraphemes(text) {
12265
- if (typeof Intl === "undefined" || typeof Intl.Segmenter !== "function") {
12266
- return [...text];
12267
- }
12268
- \u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B ??= new Intl.Segmenter(void 0, { granularity: "grapheme" });
12269
- return [...\u66F8\u8A18\u7D20\u3067\u5206\u3051\u308B.segment(text)].map((s) => s.segment);
12270
- }
12271
- function defaultAdvanceEm(ch, code) {
12272
- if (isEmoji(code)) return EMOJI_ADVANCE_EM;
12273
- if (isWideSymbol(code)) return WIDE_SYMBOL_ADVANCE_EM;
12274
- if (isCJK(code)) return 1.08;
12275
- if (isHalfwidthKana(code)) return 0.72;
12276
- if (ch >= "a" && ch <= "z") return 0.73;
12277
- if (ch >= "A" && ch <= "Z") return 0.86;
12278
- if (ch >= "0" && ch <= "9") return 0.72;
12279
- return 0.65;
12280
- }
12281
- function measureTextWidth(text, opts = {}) {
12282
- const fontSize = opts.fontSize ?? 22;
12283
- const letterSpacing = opts.letterSpacing ?? 0;
12284
- const fontFamily = opts.fontFamily ?? "sans";
12285
- const bound = opts.bound ?? "layout";
12286
- let advanceEmSum = 0;
12287
- let charCount = 0;
12288
- const \u6587\u5B57\u5217 = CLUSTER_JOINER_RE.test(text) ? segmentGraphemes(text) : [...text];
12289
- for (const ch of \u6587\u5B57\u5217) {
12290
- charCount++;
12291
- const code = ch.codePointAt(0) ?? 0;
12292
- const \u5272\u308A\u623B\u3057 = bound === "drawn" && !isEmojiGrapheme(ch, code) ? isAscii(code) ? DRAWN_ASCII_RATIO : isCJK(code) ? DRAWN_CJK_RATIO : 1 : 1;
12293
- if (isEmojiGrapheme(ch, code)) {
12294
- advanceEmSum += fontFamily === "mono" ? MONO_EMOJI_ADVANCE_EM : EMOJI_ADVANCE_EM;
12295
- continue;
12296
- }
12297
- if (fontFamily === "mono") {
12298
- advanceEmSum += (isCJK(code) ? 1.08 : JETBRAINS_MONO_ADVANCE_EM) / \u5272\u308A\u623B\u3057;
12299
- continue;
12300
- }
12301
- if (isCJK(code)) {
12302
- advanceEmSum += 1.08 / \u5272\u308A\u623B\u3057;
12303
- continue;
12304
- }
12305
- const table = ch.length === 1 ? INTER_BOLD_ADVANCE_EM[ch] : void 0;
12306
- advanceEmSum += (table !== void 0 ? table : defaultAdvanceEm(ch, code)) / \u5272\u308A\u623B\u3057;
12307
- }
12308
- const w = advanceEmSum * fontSize + letterSpacing * charCount;
12309
- return bound === "drawn" ? w : Math.max(w, fontSize * 1.2);
12310
- }
12311
- function \u53CE\u3081\u308B\u500D\u7387(text, opts, \u5E45) {
12312
- if (!(\u5E45 > 0) || !(opts.fontSize > 0)) return 1;
12313
- const \u5B9F\u5E45 = measureTextWidth(text, { ...opts, letterSpacing: 0 });
12314
- return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
12315
- }
12316
-
12317
12363
  // src/label-text.ts
12318
12364
  var EDGE_LABEL_TEXT = {
12319
12365
  // main 行は family を指定せず、 host 側の指定を継承する。
@@ -12673,15 +12719,22 @@ function requiredVerticalLabelGap(pillHs) {
12673
12719
  const step = parallelLabelStepY(pillHs);
12674
12720
  return (pillHs.length - 1) * step + Math.max(first, last) + CLEARANCE_NODE_LABEL * 2;
12675
12721
  }
12676
- function computeLabelBoxW(label, sub) {
12677
- const mainW = measureTextWidth(label ?? "", { fontSize: EDGE_LABEL_TEXT.main.fontSize });
12678
- const subW = sub ? measureTextWidth(sub, { fontSize: EDGE_LABEL_TEXT.sub.fontSize, fontFamily: "mono" }) : 0;
12722
+ function computeLabelBoxW(label, sub, textMetrics = "proportional") {
12723
+ const mainW = measureTextWidth(label ?? "", {
12724
+ fontSize: EDGE_LABEL_TEXT.main.fontSize,
12725
+ textMetrics
12726
+ });
12727
+ const subW = sub ? measureTextWidth(sub, {
12728
+ fontSize: EDGE_LABEL_TEXT.sub.fontSize,
12729
+ fontFamily: "mono",
12730
+ textMetrics
12731
+ }) : 0;
12679
12732
  const raw = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
12680
12733
  const EPSILON = 1e-6;
12681
12734
  return Math.ceil((raw - EPSILON) / 2) * 2;
12682
12735
  }
12683
- function computeLabelBBoxWorld(edge) {
12684
- const boxW = computeLabelBoxW(edge.label, edge.sub);
12736
+ function computeLabelBBoxWorld(edge, textMetrics = "proportional") {
12737
+ const boxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
12685
12738
  const boxH = edge.sub ? LABEL_PILL_H_WITH_SUB : LABEL_PILL_H_MAIN_ONLY;
12686
12739
  const anchor = edge.labelAnchor;
12687
12740
  const boxLeftX = anchor === "start" ? 0 : anchor === "end" ? -boxW : -boxW / 2;
@@ -12920,7 +12973,7 @@ function footerShapeDrawTop(node) {
12920
12973
  // src/layout/collisions.ts
12921
12974
  var LANE_LABEL_CLEARANCE_MARGIN = 2;
12922
12975
  var NEAR_MISS_MARGIN = LANE_LABEL_CLEARANCE_MARGIN;
12923
- function collectBBoxes(lanes, nodes, edges) {
12976
+ function collectBBoxes(lanes, nodes, edges, textMetrics = "proportional") {
12924
12977
  const out = [];
12925
12978
  for (const lane of lanes) {
12926
12979
  if (!lane.label) continue;
@@ -12929,7 +12982,7 @@ function collectBBoxes(lanes, nodes, edges) {
12929
12982
  id: lane.id,
12930
12983
  x: lane.x + 16,
12931
12984
  y: lane.y + 8,
12932
- w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2 }) + 24,
12985
+ w: measureTextWidth(lane.label, { fontSize: 20, letterSpacing: 2, textMetrics }) + 24,
12933
12986
  h: 28
12934
12987
  });
12935
12988
  }
@@ -12947,7 +13000,7 @@ function collectBBoxes(lanes, nodes, edges) {
12947
13000
  }
12948
13001
  for (const e of edges) {
12949
13002
  if (!hasRenderedLabel(e)) continue;
12950
- const bbox = computeLabelBBoxWorld(e);
13003
+ const bbox = computeLabelBBoxWorld(e, textMetrics);
12951
13004
  out.push({
12952
13005
  kind: "edge-label",
12953
13006
  id: e.id,
@@ -13645,10 +13698,10 @@ function forEachCandidatePair(bboxes, margin, visit) {
13645
13698
  }
13646
13699
  }
13647
13700
  }
13648
- function resolveEdgeLabelOverlapsWithChain(edges, fixedObstacles, minClearance = 16, maxIter = 20) {
13701
+ function resolveEdgeLabelOverlapsWithChain(edges, fixedObstacles, minClearance = 16, maxIter = 20, textMetrics = "proportional") {
13649
13702
  if (edges.length === 0) return edges;
13650
13703
  const labelBBox = (e, offsetX, offsetY) => {
13651
- const base = computeLabelBBoxWorld(e);
13704
+ const base = computeLabelBBoxWorld(e, textMetrics);
13652
13705
  return {
13653
13706
  kind: "edge-label",
13654
13707
  id: e.id,
@@ -13749,7 +13802,7 @@ function clampShiftMagnitude(shift, maxMagnitude) {
13749
13802
  };
13750
13803
  return { dx: clampAxis(shift.dx), dy: clampAxis(shift.dy) };
13751
13804
  }
13752
- function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE) {
13805
+ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClearance = 16, maxIter = 20, pathLabelClearance = LABEL_TO_PATH_CLEARANCE, textMetrics = "proportional") {
13753
13806
  if (edges.length === 0) {
13754
13807
  return {
13755
13808
  edges,
@@ -13760,7 +13813,7 @@ function resolveEdgeLabelOverlapsWithChainAndPropagate(edges, obstacles, minClea
13760
13813
  }
13761
13814
  const MAX_ACCUMULATED_SHIFT = CHAIN_SHIFT_MAX_ACCUMULATED;
13762
13815
  const labelBBox = (e, offsetX, offsetY) => {
13763
- const base = computeLabelBBoxWorld(e);
13816
+ const base = computeLabelBBoxWorld(e, textMetrics);
13764
13817
  return {
13765
13818
  kind: "edge-label",
13766
13819
  id: e.id,
@@ -14361,11 +14414,15 @@ var \u5411\u304D\u306E\u9806 = [
14361
14414
  { axis: "x", sign: -1, \u540D\u524D: "\u5DE6" },
14362
14415
  { axis: "x", sign: 1, \u540D\u524D: "\u53F3" }
14363
14416
  ];
14364
- function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles) {
14417
+ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B, edges, obstacles, textMetrics = "proportional") {
14365
14418
  const edgeById = new Map(edges.map((e) => [e.id, e]));
14366
14419
  const \u81EA\u5206 = edgeById.get(labelId);
14367
14420
  if (!\u81EA\u5206) return null;
14368
- const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({ kind: "edge-label", id: e.id, ...computeLabelBBoxWorld(e) }));
14421
+ const labels = edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => ({
14422
+ kind: "edge-label",
14423
+ id: e.id,
14424
+ ...computeLabelBBoxWorld(e, textMetrics)
14425
+ }));
14369
14426
  const label = labels.find((l) => l.id === labelId);
14370
14427
  if (!label) return null;
14371
14428
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
@@ -14407,7 +14464,7 @@ function \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(labelId, \u76F8\u624B,
14407
14464
  }
14408
14465
  return `\u9003\u3052\u5834\u306A\u3057: ${\u7406\u7531.sort((a, b) => a.\u9806 - b.\u9806).map((r) => r.\u6587).join(" / ")}`;
14409
14466
  }
14410
- function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
14467
+ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8, textMetrics = "proportional") {
14411
14468
  if (edges.length === 0) return edges;
14412
14469
  const labeledIds = new Set(
14413
14470
  edges.filter((e) => e.label?.trim() || e.sub?.trim()).map((e) => e.id)
@@ -14425,7 +14482,7 @@ function resolveLabelClearanceAfterPathPasses(edges, obstacles, maxIter = 8) {
14425
14482
  const out = [];
14426
14483
  for (const e of edges) {
14427
14484
  if (!labeledIds.has(e.id)) continue;
14428
- const base = computeLabelBBoxWorld(e);
14485
+ const base = computeLabelBBoxWorld(e, textMetrics);
14429
14486
  const s = getShift(e.id);
14430
14487
  out.push({ kind: "edge-label", id: e.id, x: base.x + s.dx, y: base.y + s.dy, w: base.w, h: base.h });
14431
14488
  }
@@ -14558,7 +14615,7 @@ function applyEdgeLabelAndPathShifts(edges, labelShiftMap, edgePathShiftMap) {
14558
14615
 
14559
14616
  // src/layout/curve-path.ts
14560
14617
  var SAME_HEIGHT_THRESHOLD = 1;
14561
- function curvePath(from, to, edge, labelMarginExtra = 0) {
14618
+ function curvePath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
14562
14619
  const fromLeft = from.cx - from.w / 2;
14563
14620
  const fromRight = from.cx + from.w / 2;
14564
14621
  const toLeft = to.cx - to.w / 2;
@@ -14626,7 +14683,7 @@ function curvePath(from, to, edge, labelMarginExtra = 0) {
14626
14683
  normalX *= -1;
14627
14684
  normalY *= -1;
14628
14685
  }
14629
- const labelW = computeLabelBoxW(edge?.label, edge?.sub);
14686
+ const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
14630
14687
  const labelH = labelPillH(edge?.sub);
14631
14688
  const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
14632
14689
  return {
@@ -14658,7 +14715,7 @@ function polyline(points) {
14658
14715
  });
14659
14716
  return distinct.map((p, i) => `${i === 0 ? "M" : "L"} ${point(p)}`).join(" ");
14660
14717
  }
14661
- function metroPath(from, to, edge, labelMarginExtra = 0) {
14718
+ function metroPath(from, to, edge, labelMarginExtra = 0, textMetrics = "proportional") {
14662
14719
  const fromLeft = from.cx - from.w / 2;
14663
14720
  const fromRight = from.cx + from.w / 2;
14664
14721
  const toLeft = to.cx - to.w / 2;
@@ -14769,7 +14826,7 @@ function metroPath(from, to, edge, labelMarginExtra = 0) {
14769
14826
  normalX *= -1;
14770
14827
  normalY *= -1;
14771
14828
  }
14772
- const labelW = computeLabelBoxW(edge?.label, edge?.sub);
14829
+ const labelW = computeLabelBoxW(edge?.label, edge?.sub, textMetrics);
14773
14830
  const labelH = labelPillH(edge?.sub);
14774
14831
  const distance = labelPathClearanceHorizontal(edge) + (Math.abs(normalX) * labelW + Math.abs(normalY) * labelH) / 2 + labelMarginExtra;
14775
14832
  return {
@@ -14938,9 +14995,9 @@ function \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(\u66F8\u3044\u305F, \u63A7\u
14938
14995
  const v = (\u66F8\u3044\u305F ?? "").trim();
14939
14996
  return v === "" ? \u63A7\u3048 : v;
14940
14997
  }
14941
- function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45) {
14998
+ function \u5E45\u306E\u500D\u7387(text, size, letterSpacing, \u5E45, textMetrics = "proportional") {
14942
14999
  if (!(\u5E45 > 0) || !(size > 0)) return 1;
14943
- const \u5B9F\u5E45 = textWidth(text, size, letterSpacing);
15000
+ const \u5B9F\u5E45 = textWidth(text, size, letterSpacing, textMetrics);
14944
15001
  return \u5B9F\u5E45 > \u5E45 ? \u5E45 / \u5B9F\u5E45 : 1;
14945
15002
  }
14946
15003
  function \u8AAD\u3081\u308B\u4E0B\u9650\u306E\u500D\u7387(\u5927\u304D\u3055) {
@@ -15155,13 +15212,13 @@ function fitArt(region, extent, art) {
15155
15212
  );
15156
15213
  }
15157
15214
  var \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
15158
- function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0) {
15215
+ function \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, letterSpacing = 0, textMetrics = "proportional") {
15159
15216
  return Math.max(
15160
15217
  displayWidth(text) * size * MONO_ADVANCE_RATIO,
15161
- textWidth(text, size, letterSpacing)
15218
+ textWidth(text, size, letterSpacing, textMetrics)
15162
15219
  );
15163
15220
  }
15164
- function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089) {
15221
+ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089, textMetrics = "proportional") {
15165
15222
  const \u623B\u3057 = Number.isFinite(\u500D\u7387) && \u500D\u7387 > 0 ? 1 / \u500D\u7387 : 1;
15166
15223
  let \u4E0A\u9650 = Number.POSITIVE_INFINITY;
15167
15224
  for (const \u5B572 of \u5B57\u3089) {
@@ -15170,7 +15227,7 @@ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u5B57\u3089)
15170
15227
  if (Number.isFinite(\u9AD8\u3055) && \u9AD8\u3055 > 0) {
15171
15228
  \u4E0A\u9650 = Math.min(\u4E0A\u9650, \u9AD8\u3055 * \u5E2F\u306E\u9AD8\u3055\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u5B572.size);
15172
15229
  }
15173
- const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0);
15230
+ const \u5B9F\u5E45 = \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(\u5B572.text, \u5B572.size, \u5B572.letterSpacing ?? 0, textMetrics);
15174
15231
  if (Number.isFinite(\u5E45) && \u5E45 > 0 && \u5B9F\u5E45 > 0) {
15175
15232
  \u4E0A\u9650 = Math.min(\u4E0A\u9650, \u5E45 / \u5B9F\u5E45);
15176
15233
  }
@@ -16026,9 +16083,14 @@ function \u6728\u306E\u5F62(treeNodes) {
16026
16083
  return { \u8449\u306E\u6570, \u6BB5\u6570 };
16027
16084
  }
16028
16085
  var \u6728\u306E\u679D\u306E\u592A\u3055 = (\u6BB5) => Math.max(1.1, 2.6 - \u6BB5 * 0.45);
16029
- function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}) {
16086
+ function \u6728\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
16030
16087
  const treeNodes = resolveTreeData(node.treeData ?? [], stateValues);
16031
- return computeTreeLayout(treeNodes, node.w - PAD_LEFT - PAD_RIGHT, node.h - PAD_TOP - PAD_BOTTOM);
16088
+ return computeTreeLayout(
16089
+ treeNodes,
16090
+ node.w - PAD_LEFT - PAD_RIGHT,
16091
+ node.h - PAD_TOP - PAD_BOTTOM,
16092
+ textMetrics
16093
+ );
16032
16094
  }
16033
16095
  function \u6728\u306E\u884C(n) {
16034
16096
  return [
@@ -16041,12 +16103,14 @@ function TreeNode({
16041
16103
  active,
16042
16104
  stateValues = {},
16043
16105
  drawing = false,
16044
- progress = 1
16106
+ progress = 1,
16107
+ textMetrics = "proportional"
16045
16108
  }) {
16046
16109
  const x0 = node.cx - node.w / 2;
16047
16110
  const y0 = node.cy - node.h / 2;
16048
16111
  const gradientId = `tree-root-grad-${node.id}`;
16049
- const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues);
16112
+ const layout2 = \u6728\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
16113
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
16050
16114
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
16051
16115
  const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
16052
16116
  const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
@@ -16100,10 +16164,10 @@ function TreeNode({
16100
16164
  const accent = depthColors[Math.min(n.depth, depthColors.length - 1)] ?? depthColors[0];
16101
16165
  const isRoot = n.depth === 0;
16102
16166
  const \u6750\u6599 = \u6728\u306E\u884C(n);
16103
- const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h);
16167
+ const \u884C = \u7BB1\u306B\u7A4D\u3080(\u6750\u6599, n.w, n.h, \u6E2C\u308B);
16104
16168
  const \u88DC\u8DB3\u3042\u308A = (n.subtitle ?? "").trim() !== "";
16105
16169
  const \u540D\u524D = \u6750\u6599[0];
16106
- 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));
16170
+ 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);
16107
16171
  return /* @__PURE__ */ jsx(
16108
16172
  "g",
16109
16173
  {
@@ -16185,7 +16249,7 @@ function TreeNode({
16185
16249
  })
16186
16250
  ] });
16187
16251
  }
16188
- function computeTreeLayout(treeNodes, canvasW, canvasH) {
16252
+ function computeTreeLayout(treeNodes, canvasW, canvasH, textMetrics = "proportional") {
16189
16253
  const ids = new Set(treeNodes.map((n) => n.id));
16190
16254
  const childrenOf = /* @__PURE__ */ new Map();
16191
16255
  for (const n of treeNodes) {
@@ -16233,7 +16297,7 @@ function computeTreeLayout(treeNodes, canvasW, canvasH) {
16233
16297
  const \u7BB1\u306E\u5E45 = (n, depth) => {
16234
16298
  const \u6750\u6599 = \u6728\u306E\u884C({ ...n, depth });
16235
16299
  const \u540D\u524D = \u6750\u6599[0];
16236
- const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize}) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
16300
+ const \u8981\u308B = measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize, textMetrics }) + (nodeW - \u4F7F\u3048\u308B\u5E45(nodeW));
16237
16301
  return Math.min(Math.max(\u8981\u308B, nodeW), slotW * 0.92);
16238
16302
  };
16239
16303
  const \u8449\u306E\u4E26\u3073 = [];
@@ -16337,7 +16401,7 @@ var BRANCH_BOX_H_MAX = 48;
16337
16401
  var SUB_BOX_H_MAX = 40;
16338
16402
  var \u7E26\u306E\u9593\u9694\u306E\u4E0A\u9650 = (\u679D\u306E\u6A2A\u306E\u4F38\u3073) => \u679D\u306E\u6A2A\u306E\u4F38\u3073;
16339
16403
  var MIND_PAD = 40;
16340
- function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
16404
+ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}, textMetrics = "proportional") {
16341
16405
  const mindData = node.mindData ? resolveMindData(node.mindData, stateValues) : void 0;
16342
16406
  if (!mindData) return void 0;
16343
16407
  return computeMindMapLayout(
@@ -16345,7 +16409,8 @@ function \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues = {}) {
16345
16409
  node.w / 2,
16346
16410
  node.h / 2,
16347
16411
  node.w - MIND_PAD * 2,
16348
- node.h - MIND_PAD * 2
16412
+ node.h - MIND_PAD * 2,
16413
+ textMetrics
16349
16414
  );
16350
16415
  }
16351
16416
  function \u653E\u5C04\u306E\u884C(n) {
@@ -16359,12 +16424,14 @@ function MindMapNode({
16359
16424
  active,
16360
16425
  stateValues = {},
16361
16426
  drawing = false,
16362
- progress = 1
16427
+ progress = 1,
16428
+ textMetrics = "proportional"
16363
16429
  }) {
16364
16430
  const x0 = node.cx - node.w / 2;
16365
16431
  const y0 = node.cy - node.h / 2;
16366
- const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues);
16432
+ const layout2 = \u653E\u5C04\u306E\u4E2D\u8EAB(node, stateValues, textMetrics);
16367
16433
  if (!layout2) return /* @__PURE__ */ jsx("g", { transform: `translate(${x0} ${y0})` });
16434
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
16368
16435
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
16369
16436
  const \u6700\u5927\u6DF1\u3055 = layout2.nodes.reduce((m, n) => Math.max(m, n.depth), 0);
16370
16437
  const \u7BB1\u304C\u51FA\u308B = (\u6DF1\u3055) => !drawing || \u6BB5\u306E\u4F38\u3073(\u4F38\u3073, \u6DF1\u3055, \u6700\u5927\u6DF1\u3055) >= 1;
@@ -16411,8 +16478,13 @@ function MindMapNode({
16411
16478
  const \u6587\u5B57\u306E\u5BC4\u305B = \u67A0\u306A\u3057 ? \u5916\u3078 ? "start" : "end" : "middle";
16412
16479
  const \u63CF\u753B\u57DF\u306E\u7AEF = \u5916\u3078 ? node.w - MIND_PAD : MIND_PAD;
16413
16480
  const \u4F7F\u3048\u308B = \u67A0\u306A\u3057 ? Math.abs(\u63CF\u753B\u57DF\u306E\u7AEF - \u6587\u5B57\u306Ex) : \u4F7F\u3048\u308B\u5E45(n.w);
16414
- 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);
16415
- 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);
16481
+ 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);
16482
+ const \u884C = \u7BB1\u306B\u7A4D\u3080(
16483
+ \u6750\u6599,
16484
+ \u67A0\u306A\u3057 ? \u4F7F\u3048\u308B + (n.w - \u4F7F\u3048\u308B\u5E45(n.w)) : n.w,
16485
+ n.h,
16486
+ \u6E2C\u308B
16487
+ );
16416
16488
  const \u6587\u5B57\u306E\u8272 = n.isRoot ? "var(--cdl-text-on-tone, #ffffff)" : "var(--cdl-chip-text, #1a1f2a)";
16417
16489
  return /* @__PURE__ */ jsxs("g", { "data-cdl-unresolved": n.unresolved ? "true" : void 0, children: [
16418
16490
  \u67A0\u306A\u3057 ? null : /* @__PURE__ */ jsx(
@@ -16464,14 +16536,14 @@ function MindMapNode({
16464
16536
  })
16465
16537
  ] });
16466
16538
  }
16467
- function \u63CF\u304F\u6A2A\u306E\u7AEF(n) {
16539
+ function \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics = "proportional") {
16468
16540
  if (n.isRoot || !n.isLeaf) return [n.x - n.w / 2, n.x + n.w / 2];
16469
16541
  const \u8D77\u70B9 = n.x + (n.side === "right" ? -n.w / 2 : n.w / 2);
16470
16542
  const \u540D\u524D = \u653E\u5C04\u306E\u884C(n)[0];
16471
- const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
16543
+ const \u5E45 = textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
16472
16544
  return n.side === "right" ? [\u8D77\u70B9, \u8D77\u70B9 + \u5E45] : [\u8D77\u70B9 - \u5E45, \u8D77\u70B9];
16473
16545
  }
16474
- function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16546
+ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH, textMetrics = "proportional") {
16475
16547
  const nodes = [];
16476
16548
  const edges = [];
16477
16549
  const rootW = 120;
@@ -16549,7 +16621,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16549
16621
  const PREFERRED_GAP = MIND_BOX_GAP;
16550
16622
  const \u679D\u306E\u540D\u524D\u306E\u5E45 = (title) => {
16551
16623
  const \u540D\u524D = \u653E\u5C04\u306E\u884C({ title, isRoot: false })[0];
16552
- return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize);
16624
+ return textWidth(\u540D\u524D.text, \u540D\u524D.fontSize, 0, textMetrics);
16553
16625
  };
16554
16626
  const \u679D\u306E\u6A2A\u3092\u6C7A\u3081\u308B = (br) => {
16555
16627
  const maxSubDepth = subDepthOf(br.id, /* @__PURE__ */ new Set());
@@ -16667,7 +16739,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16667
16739
  let maxExtentX = rootW / 2;
16668
16740
  let maxExtentY = rootH / 2;
16669
16741
  for (const n of nodes) {
16670
- const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
16742
+ const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
16671
16743
  maxExtentX = Math.max(maxExtentX, Math.abs(\u5DE6 - cx), Math.abs(\u53F3 - cx));
16672
16744
  maxExtentY = Math.max(maxExtentY, Math.abs(n.y - cy) + n.h / 2);
16673
16745
  }
@@ -16687,7 +16759,7 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
16687
16759
  let \u5DE6\u7AEF = Number.POSITIVE_INFINITY;
16688
16760
  let \u53F3\u7AEF = Number.NEGATIVE_INFINITY;
16689
16761
  for (const n of nodes) {
16690
- const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
16762
+ const [l, r] = \u63CF\u304F\u6A2A\u306E\u7AEF(n, textMetrics);
16691
16763
  \u5DE6\u7AEF = Math.min(\u5DE6\u7AEF, l);
16692
16764
  \u53F3\u7AEF = Math.max(\u53F3\u7AEF, r);
16693
16765
  }
@@ -16930,10 +17002,16 @@ function emptyCounts() {
16930
17002
  "validation-interrupted": 0
16931
17003
  };
16932
17004
  }
16933
- function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n) {
16934
- const \u7BB1 = (b, \u884C) => ({ \u884C, w: b.w, h: b.h });
16935
- if (n.kind === "tree-hierarchy") return \u6728\u306E\u4E2D\u8EAB(n).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b)));
16936
- if (n.kind === "mind-map") return (\u653E\u5C04\u306E\u4E2D\u8EAB(n)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b)));
17005
+ function \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics = "proportional") {
17006
+ const \u7BB1 = (b, \u884C, \u6E2C\u308B) => ({ \u884C, w: b.w, h: b.h, \u6E2C\u308B });
17007
+ if (n.kind === "tree-hierarchy") {
17008
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
17009
+ return \u6728\u306E\u4E2D\u8EAB(n, {}, textMetrics).nodes.map((b) => \u7BB1(b, \u6728\u306E\u884C(b), \u6E2C\u308B));
17010
+ }
17011
+ if (n.kind === "mind-map") {
17012
+ const \u6E2C\u308B = \u7BB1\u306E\u5B57\u3092\u6E2C\u308B(textMetrics);
17013
+ return (\u653E\u5C04\u306E\u4E2D\u8EAB(n, {}, textMetrics)?.nodes ?? []).map((b) => \u7BB1(b, \u653E\u5C04\u306E\u884C(b), \u6E2C\u308B));
17014
+ }
16937
17015
  return [];
16938
17016
  }
16939
17017
  function measureStubOut(segs) {
@@ -17619,6 +17697,7 @@ function \u4F4D\u7F6E\u3092\u624B\u3067\u66F8\u3044\u305F(n) {
17619
17697
  return n.posX !== void 0 && n.posY !== void 0;
17620
17698
  }
17621
17699
  function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5668) {
17700
+ const textMetrics = laid.textMetrics ?? "proportional";
17622
17701
  const LIFELINE_W_THRESHOLD = 8;
17623
17702
  for (const n of laid.nodes) {
17624
17703
  if (n.w < LIFELINE_W_THRESHOLD) continue;
@@ -17630,7 +17709,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17630
17709
  );
17631
17710
  }
17632
17711
  }
17633
- const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges);
17712
+ const bboxes = collectBBoxes(laid.lanes, laid.nodes, laid.edges, textMetrics);
17634
17713
  const collisions = detectCollisions(bboxes, laid.edges);
17635
17714
  for (const c of collisions) {
17636
17715
  const involvesEdgeLabel = c.a.kind === "edge-label" || c.b.kind === "edge-label";
@@ -17650,7 +17729,11 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17650
17729
  if (!titleTrimmed) continue;
17651
17730
  const \u4F59\u767D = drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING;
17652
17731
  const \u4F7F\u3048\u308B\u5E452 = n.w - \u4F59\u767D;
17653
- const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, { fontSize: titleFontSize(n.kind), bound: "drawn" });
17732
+ const \u5B9F\u5E45 = measureTextWidth(titleTrimmed, {
17733
+ fontSize: titleFontSize(n.kind),
17734
+ bound: "drawn",
17735
+ textMetrics
17736
+ });
17654
17737
  if (titleScalesToFit(n.kind, n.h)) {
17655
17738
  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);
17656
17739
  if (\u7E2E\u3081\u305F\u5927\u304D\u3055 < MIN_TITLE_FONT_SIZE) {
@@ -17718,7 +17801,13 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17718
17801
  const b\u306F\u672D = n.b.kind === "edge-label";
17719
17802
  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;
17720
17803
  const \u76F8\u624B = \u52D5\u304B\u3059 === n.a ? n.b : n.a;
17721
- 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;
17804
+ const reason = \u52D5\u304B\u3059 !== null ? \u672D\u304C\u52D5\u3051\u306A\u3044\u7406\u7531(
17805
+ \u52D5\u304B\u3059.id,
17806
+ \u76F8\u624B,
17807
+ laid.edges,
17808
+ \u672D\u306E\u969C\u5BB3\u7269,
17809
+ textMetrics
17810
+ ) ?? void 0 : void 0;
17722
17811
  push(
17723
17812
  "clearance",
17724
17813
  `${n.a.kind}:${n.a.id} \u2194 ${n.b.kind}:${n.b.id} gap=${n.gap.toFixed(1)}px (need ${n.required}px)`,
@@ -17732,7 +17821,10 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17732
17821
  if (!hasRenderedLabel(e)) continue;
17733
17822
  const segs = extractPathSegments(e.d);
17734
17823
  if (segs.length === 0) continue;
17735
- const minDist = measurePathLabelGapSegs(flattenPathSegments(segs), computeLabelBBoxWorld(e));
17824
+ const minDist = measurePathLabelGapSegs(
17825
+ flattenPathSegments(segs),
17826
+ computeLabelBBoxWorld(e, textMetrics)
17827
+ );
17736
17828
  if (!Number.isFinite(minDist)) continue;
17737
17829
  if (minDist > PROXIMITY_ERROR_THRESHOLD) {
17738
17830
  push(
@@ -17782,8 +17874,15 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17782
17874
  }
17783
17875
  for (const e of laid.edges) {
17784
17876
  if (!hasRenderedLabel(e)) continue;
17785
- const mainW = measureTextWidth(e.label ?? "", { fontSize: EDGE_LABEL_TEXT.main.fontSize });
17786
- const subW = e.sub ? measureTextWidth(e.sub, { fontSize: EDGE_LABEL_TEXT.sub.fontSize, fontFamily: "mono" }) : 0;
17877
+ const mainW = measureTextWidth(e.label ?? "", {
17878
+ fontSize: EDGE_LABEL_TEXT.main.fontSize,
17879
+ textMetrics
17880
+ });
17881
+ const subW = e.sub ? measureTextWidth(e.sub, {
17882
+ fontSize: EDGE_LABEL_TEXT.sub.fontSize,
17883
+ fontFamily: "mono",
17884
+ textMetrics
17885
+ }) : 0;
17787
17886
  const expectedBoxW = Math.max(mainW, subW) + LABEL_PILL_PAD_X * 2;
17788
17887
  const bbox = bboxes.find((b) => b.kind === "edge-label" && b.id === e.id);
17789
17888
  if (!bbox) continue;
@@ -17925,7 +18024,9 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17925
18024
  }
17926
18025
  }
17927
18026
  for (const n of laid.nodes) {
17928
- const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter((line) => droppedLineIsHidden(n.kind, line));
18027
+ const \u843D\u3068\u3057\u305F = labelPlan(n).\u843D\u3068\u3057\u305F.filter(
18028
+ (line) => droppedLineIsHidden(n.kind, line)
18029
+ );
17929
18030
  if (\u843D\u3068\u3057\u305F.length === 0) continue;
17930
18031
  push(
17931
18032
  "shape-label-dropped",
@@ -17934,7 +18035,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17934
18035
  );
17935
18036
  }
17936
18037
  for (const n of laid.nodes) {
17937
- const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n);
18038
+ const \u7BB1 = \u7A4D\u3080\u7BB1\u3092\u96C6\u3081\u308B(n, textMetrics);
17938
18039
  if (\u7BB1.length === 0) continue;
17939
18040
  let \u5BFE\u8C61 = 0;
17940
18041
  const \u843D\u3061\u305F = [];
@@ -17942,7 +18043,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
17942
18043
  const \u5BA3\u8A00 = b.\u884C.slice(1).filter((r) => r.text.trim() !== "");
17943
18044
  if (\u5BA3\u8A00.length === 0) continue;
17944
18045
  \u5BFE\u8C61 += 1;
17945
- const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h).map((r) => r.\u5F79\u5272));
18046
+ const \u6B8B\u3063\u305F = new Set(\u7BB1\u306B\u7A4D\u3080(b.\u884C, b.w, b.h, b.\u6E2C\u308B).map((r) => r.\u5F79\u5272));
17946
18047
  if (\u5BA3\u8A00.every((r) => \u6B8B\u3063\u305F.has(r.\u5F79\u5272))) continue;
17947
18048
  \u843D\u3061\u305F.push({ title: b.\u884C[0]?.text ?? "", h: b.h });
17948
18049
  }
@@ -19005,7 +19106,7 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
19005
19106
  const allowedLanes = /* @__PURE__ */ new Set();
19006
19107
  if (fromNode) allowedLanes.add(fromNode.lane);
19007
19108
  if (toNode) allowedLanes.add(toNode.lane);
19008
- const box = computeLabelBBoxWorld(e);
19109
+ const box = computeLabelBBoxWorld(e, textMetrics);
19009
19110
  for (const lane of laid.lanes) {
19010
19111
  if (allowedLanes.has(lane.id)) continue;
19011
19112
  const side = rectCrossesLaneBorder(box, lane, rangeByLane.get(lane.id));
@@ -19383,7 +19484,7 @@ function pickFreeSides(occupied, count) {
19383
19484
  const \u4F7F\u3046 = \u7A7A\u304D.length > 0 ? \u7A7A\u304D : [SELF_LOOP_SIDE_FALLBACK];
19384
19485
  return Array.from({ length: count }, (_, i) => \u4F7F\u3046[i % \u4F7F\u3046.length]);
19385
19486
  }
19386
- function routeSelfLoopGroup(edges, node, side) {
19487
+ function routeSelfLoopGroup(edges, node, side, textMetrics = "proportional") {
19387
19488
  const horizontal = side === "left" || side === "right";
19388
19489
  const g = sideGeometry(node, side);
19389
19490
  const span = fitSpan(horizontal ? node.h : node.w, SELF_LOOP_SPAN);
@@ -19392,7 +19493,7 @@ function routeSelfLoopGroup(edges, node, side) {
19392
19493
  const \u6700\u5916 = controlOffset(SELF_LOOP_OUT + (edges.length - 1) * SELF_LOOP_STAGGER);
19393
19494
  const \u8A9E\u307E\u3067 = \u6700\u5916 + LABEL_TO_PATH_CLEARANCE;
19394
19495
  const \u8A9E\u5E45 = edges.map(
19395
- (e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub)
19496
+ (e) => horizontal ? labelPillH(e.sub) : computeLabelBoxW(e.label, e.sub, textMetrics)
19396
19497
  );
19397
19498
  const \u4F4D\u7F6E = [];
19398
19499
  let \u7A4D = 0;
@@ -19422,7 +19523,7 @@ function routeSelfLoopGroup(edges, node, side) {
19422
19523
  function isSelfLoop(e) {
19423
19524
  return e.from === e.to;
19424
19525
  }
19425
- function layoutSelfLoops(edges, nodes, occupiedBySide) {
19526
+ function layoutSelfLoops(edges, nodes, occupiedBySide, textMetrics = "proportional") {
19426
19527
  const \u5272\u5F53 = /* @__PURE__ */ new Map();
19427
19528
  for (const edge of edges) {
19428
19529
  if (edge.side) continue;
@@ -19449,7 +19550,7 @@ function layoutSelfLoops(edges, nodes, occupiedBySide) {
19449
19550
  if (\u65E2) \u65E2.edges.push(edge);
19450
19551
  else \u675F.set(key, { node, side, edges: [edge] });
19451
19552
  }
19452
- return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side));
19553
+ return [...\u675F.values()].flatMap((b) => routeSelfLoopGroup(b.edges, b.node, b.side, textMetrics));
19453
19554
  }
19454
19555
 
19455
19556
  // src/layout/tokens.ts
@@ -19667,7 +19768,7 @@ function verticalDetourBlockers(A, B, obstacles) {
19667
19768
  function detourColumnFor(blockers, side) {
19668
19769
  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;
19669
19770
  }
19670
- function layoutEdges(diag, nodes, lanes = []) {
19771
+ function layoutEdges(diag, nodes, lanes = [], textMetrics = "proportional") {
19671
19772
  const labelMarginExtra = (diag.viewport?.labelMargin ?? diag.viewport?.gap ?? DEFAULT_LABEL_MARGIN) - DEFAULT_LABEL_MARGIN;
19672
19773
  const nmap = new Map(nodes.map((n) => [n.id, n]));
19673
19774
  const lmap = new Map(lanes.map((l) => [l.id, l]));
@@ -19700,7 +19801,7 @@ function layoutEdges(diag, nodes, lanes = []) {
19700
19801
  const to = nmap.get(e.to);
19701
19802
  if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
19702
19803
  if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
19703
- const c = curvePath(from, to, e, labelMarginExtra);
19804
+ const c = curvePath(from, to, e, labelMarginExtra, textMetrics);
19704
19805
  positionedEdges.push({
19705
19806
  ...e,
19706
19807
  d: c.d,
@@ -19715,7 +19816,7 @@ function layoutEdges(diag, nodes, lanes = []) {
19715
19816
  const to = nmap.get(e.to);
19716
19817
  if (!from) throw new Error(`cdl layout: edge "${e.id}" \u306E from "${e.from}" \u304C node \u306B\u7121\u3044`);
19717
19818
  if (!to) throw new Error(`cdl layout: edge "${e.id}" \u306E to "${e.to}" \u304C node \u306B\u7121\u3044`);
19718
- const m = metroPath(from, to, e, labelMarginExtra);
19819
+ const m = metroPath(from, to, e, labelMarginExtra, textMetrics);
19719
19820
  positionedEdges.push({
19720
19821
  ...e,
19721
19822
  d: m.d,
@@ -19763,7 +19864,7 @@ function layoutEdges(diag, nodes, lanes = []) {
19763
19864
  \u4F7F\u3046(le.from, le.fromSide);
19764
19865
  \u4F7F\u3046(le.to, le.toSide);
19765
19866
  }
19766
- const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide);
19867
+ const loopEdges = layoutSelfLoops(selfLoopEdges, nmap, occupiedBySide, textMetrics);
19767
19868
  const labelOffsetsByEdgeId = /* @__PURE__ */ new Map();
19768
19869
  const parallelKey = (p) => p.e.from < p.e.to ? `${p.e.from}::${p.e.to}` : `${p.e.to}::${p.e.from}`;
19769
19870
  const byParallel = /* @__PURE__ */ new Map();
@@ -19917,7 +20018,7 @@ function layoutEdges(diag, nodes, lanes = []) {
19917
20018
  const others = nodes.filter((n) => n.id !== c.from && n.id !== c.to);
19918
20019
  if (others.some((n) => segmentsCrossRect(segs, nodeRect(n)))) return true;
19919
20020
  if (!hasRenderedLabel(c.e)) return false;
19920
- const boxW = computeLabelBoxW(c.e.label, c.e.sub);
20021
+ const boxW = computeLabelBoxW(c.e.label, c.e.sub, textMetrics);
19921
20022
  const boxH = labelPillH(c.e.sub);
19922
20023
  const centerX = columnX - (labelPathClearanceHorizontal(c.e) + boxW / 2);
19923
20024
  const pill = { x: centerX - boxW / 2, y: (exitY + returnY) / 2 - boxH / 2, w: boxW, h: boxH };
@@ -20032,7 +20133,8 @@ function layoutEdges(diag, nodes, lanes = []) {
20032
20133
  allOtherNodes,
20033
20134
  { x: endpointOffset.fromDx, y: endpointOffset.fromDy },
20034
20135
  { x: endpointOffset.toDx, y: endpointOffset.toDy },
20035
- avoidRects
20136
+ avoidRects,
20137
+ textMetrics
20036
20138
  );
20037
20139
  const routed1 = route([]);
20038
20140
  const { d, labelX, labelY, labelAnchor, labelAltX } = routed1;
@@ -20088,13 +20190,13 @@ function layoutEdges(diag, nodes, lanes = []) {
20088
20190
  const pillById = /* @__PURE__ */ new Map();
20089
20191
  for (const r of list) {
20090
20192
  if (!hasRenderedLabel(r.e)) continue;
20091
- const w = computeLabelBoxW(r.e.label, r.e.sub);
20193
+ const w = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
20092
20194
  const h = labelPillH(r.e.sub);
20093
20195
  pillById.set(r.e.id, { x: r.baseLabelX - w / 2, y: r.baseLabelY - h / 2, w, h });
20094
20196
  }
20095
20197
  for (const le of positionedEdges) {
20096
20198
  if (!hasRenderedLabel(le)) continue;
20097
- const w = computeLabelBoxW(le.label, le.sub);
20199
+ const w = computeLabelBoxW(le.label, le.sub, textMetrics);
20098
20200
  const h = labelPillH(le.sub);
20099
20201
  pillById.set(le.id, { x: le.labelX - w / 2, y: le.labelY - h / 2, w, h });
20100
20202
  }
@@ -20124,7 +20226,7 @@ function layoutEdges(diag, nodes, lanes = []) {
20124
20226
  const laneOfNode = new Map(nodes.map((n) => [n.id, n.lane]));
20125
20227
  for (const r of flippable) {
20126
20228
  const ownSegs = segsByEdgeId.get(r.e.id);
20127
- const boxW = computeLabelBoxW(r.e.label, r.e.sub);
20229
+ const boxW = computeLabelBoxW(r.e.label, r.e.sub, textMetrics);
20128
20230
  const boxH = labelPillH(r.e.sub);
20129
20231
  const pillAt = (centerX) => ({
20130
20232
  x: centerX - boxW / 2,
@@ -20169,7 +20271,7 @@ function layoutEdges(diag, nodes, lanes = []) {
20169
20271
  if (list.length < 2) continue;
20170
20272
  const boxes = list.map((r) => ({
20171
20273
  cx: r.baseLabelX,
20172
- halfW: computeLabelBoxW(r.e.label, r.e.sub) / 2
20274
+ halfW: computeLabelBoxW(r.e.label, r.e.sub, textMetrics) / 2
20173
20275
  }));
20174
20276
  const overlapsX = (i, j) => Math.abs(boxes[i].cx - boxes[j].cx) < boxes[i].halfW + boxes[j].halfW + CLEARANCE_LABEL_LABEL;
20175
20277
  const componentOf = list.map((_, i) => i);
@@ -20219,7 +20321,7 @@ function layoutEdges(diag, nodes, lanes = []) {
20219
20321
  r,
20220
20322
  baseX: r.baseLabelX,
20221
20323
  baseY: r.baseLabelY,
20222
- w: computeLabelBoxW(r.e.label, r.e.sub),
20324
+ w: computeLabelBoxW(r.e.label, r.e.sub, textMetrics),
20223
20325
  h: labelPillH(r.e.sub)
20224
20326
  }));
20225
20327
  items.sort((a, b) => a.baseX - b.baseX);
@@ -20331,7 +20433,7 @@ function singleStraightSegment(d) {
20331
20433
  if (x1 === x2 && y1 === y2) return null;
20332
20434
  return { x1, y1, x2, y2 };
20333
20435
  }
20334
- function bowSharedStraightPaths(edges, nodes, skipIds) {
20436
+ function bowSharedStraightPaths(edges, nodes, skipIds, textMetrics = "proportional") {
20335
20437
  const groups = /* @__PURE__ */ new Map();
20336
20438
  for (const e of edges) {
20337
20439
  if (skipIds.has(e.id)) continue;
@@ -20367,7 +20469,7 @@ function bowSharedStraightPaths(edges, nodes, skipIds) {
20367
20469
  )
20368
20470
  );
20369
20471
  const groupIds = new Set(group.map((g) => g.e.id));
20370
- const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x));
20472
+ const labelRects = edges.filter((x) => hasRenderedLabel(x) && !groupIds.has(x.id)).map((x) => computeLabelBBoxWorld(x, textMetrics));
20371
20473
  const nodeRects = nodes.map((n) => ({ x: n.cx - n.w / 2, y: n.cy - n.h / 2, w: n.w, h: n.h }));
20372
20474
  const build = (seg, offset) => {
20373
20475
  const cx = midX + nx * offset * 2;
@@ -20487,8 +20589,8 @@ function sidePoint(n, side) {
20487
20589
  return { x: n.cx + n.w / 2, y: n.cy };
20488
20590
  }
20489
20591
  }
20490
- function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _fromLane, _toLane, edge, labelObstacles = obstacles, fromOffset = { x: 0, y: 0 }, toOffset = { x: 0, y: 0 }, avoidRects = []) {
20491
- const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub) : 0;
20592
+ 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") {
20593
+ const labelBoxW = edge ? computeLabelBoxW(edge.label, edge.sub, textMetrics) : 0;
20492
20594
  const labelHalfW = labelBoxW / 2;
20493
20595
  const labelInit = labelInitClearance(edge);
20494
20596
  const verticalPair = fromSide === "bottom" && toSide === "top" || fromSide === "top" && toSide === "bottom";
@@ -20887,7 +20989,7 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
20887
20989
  labelAnchor: "middle"
20888
20990
  };
20889
20991
  }
20890
- function repositionParallelLabels(edges, nodes) {
20992
+ function repositionParallelLabels(edges, nodes, textMetrics = "proportional") {
20891
20993
  const allSegs = new Map(
20892
20994
  edges.map((e) => [e.id, flattenPathSegments(extractPathSegments(e.d))])
20893
20995
  );
@@ -20912,7 +21014,7 @@ function repositionParallelLabels(edges, nodes) {
20912
21014
  for (const pair of byPair.values()) {
20913
21015
  if (pair.length < 2) continue;
20914
21016
  const pairOrder = [...pair].sort(compareSharedPairOrder);
20915
- const boxes = pair.map((e) => computeLabelBBoxWorld(e));
21017
+ const boxes = pair.map((e) => computeLabelBBoxWorld(e, textMetrics));
20916
21018
  const componentOf = pair.map((_, i) => i);
20917
21019
  for (let i = 0; i < pair.length; i++) {
20918
21020
  for (let j = i + 1; j < pair.length; j++) {
@@ -20937,17 +21039,27 @@ function repositionParallelLabels(edges, nodes) {
20937
21039
  nodes,
20938
21040
  allEdges: edges,
20939
21041
  allSegs,
20940
- xRange
21042
+ xRange,
21043
+ textMetrics
20941
21044
  });
20942
21045
  for (let i = 0; i < members.length; i++) members[i].labelY = placed[i];
20943
21046
  }
20944
21047
  }
20945
21048
  }
20946
21049
  function placeAvoidingSiblingPaths(args) {
20947
- const { members, pair, pairOrder, nodes, allEdges, allSegs, xRange } = args;
21050
+ const {
21051
+ members,
21052
+ pair,
21053
+ pairOrder,
21054
+ nodes,
21055
+ allEdges,
21056
+ allSegs,
21057
+ xRange,
21058
+ textMetrics = "proportional"
21059
+ } = args;
20948
21060
  const sizes = members.map((e) => labelPillH(e.sub));
20949
21061
  const wants = members.map((e) => e.labelY);
20950
- const boxes = members.map((e) => computeLabelBBoxWorld(e));
21062
+ const boxes = members.map((e) => computeLabelBBoxWorld(e, textMetrics));
20951
21063
  const all = members.map((_, i) => i);
20952
21064
  const spread = (idx) => spreadWithMinimalShift(
20953
21065
  idx.map((i) => ({ want: wants[i], size: sizes[i] })),
@@ -21138,14 +21250,14 @@ function labelRectAt(cx, cy, w, h) {
21138
21250
  function inflate(r, pad) {
21139
21251
  return { x: r.x - pad, y: r.y - pad, w: r.w + pad * 2, h: r.h + pad * 2 };
21140
21252
  }
21141
- function slideLabelsAlongOwnPath(edges, nodes) {
21253
+ function slideLabelsAlongOwnPath(edges, nodes, textMetrics = "proportional") {
21142
21254
  const withLabel = edges.filter((e) => hasRenderedLabel(e));
21143
21255
  if (withLabel.length === 0) return;
21144
21256
  const segsById = /* @__PURE__ */ new Map();
21145
21257
  for (const e of edges) segsById.set(e.id, flattenPathSegments(extractPathSegments(e.d)));
21146
21258
  const nodeRects = nodes.map(nodeRect);
21147
21259
  for (const e of withLabel) {
21148
- const w = computeLabelBoxW(e.label, e.sub);
21260
+ const w = computeLabelBoxW(e.label, e.sub, textMetrics);
21149
21261
  const h = labelPillH(e.sub);
21150
21262
  if (w === 0 || h === 0) continue;
21151
21263
  const own = segsById.get(e.id) ?? [];
@@ -21447,7 +21559,7 @@ function separateSharedStraightRuns(edges, nodes) {
21447
21559
  e.d = verticesToPath(verts.get(e.id));
21448
21560
  }
21449
21561
  }
21450
- function pullOutgoingFirstCorner(edges, nodes) {
21562
+ function pullOutgoingFirstCorner(edges, nodes, textMetrics = "proportional") {
21451
21563
  if (edges.length < 2) return;
21452
21564
  const \u675F = /* @__PURE__ */ new Map();
21453
21565
  const \u540C\u3058\u7D44\u306E\u6570 = /* @__PURE__ */ new Map();
@@ -21501,10 +21613,10 @@ function pullOutgoingFirstCorner(edges, nodes) {
21501
21613
  }
21502
21614
  e.d = \u524D;
21503
21615
  if (!\u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F) {
21504
- slideLabelsAlongOwnPath(edges, nodes);
21616
+ slideLabelsAlongOwnPath(edges, nodes, textMetrics);
21505
21617
  \u672D\u3092\u65E7\u7D4C\u8DEF\u3078\u8FFD\u5F93\u6E08\u307F = true;
21506
21618
  }
21507
- const labelBox = computeLabelBBoxWorld(e);
21619
+ const labelBox = computeLabelBBoxWorld(e, textMetrics);
21508
21620
  const label = { x: labelBox.x + labelBox.w / 2, y: labelBox.y + labelBox.h / 2 };
21509
21621
  const \u7DDA\u5206\u307E\u3067\u306E\u8DDD\u96E22 = (a, b) => {
21510
21622
  const dx = b.x - a.x;
@@ -21616,13 +21728,13 @@ function fanIncomingEndpoints(edges, nodes) {
21616
21728
  }
21617
21729
  return \u7D42\u70B9\u306E\u79FB\u52D5;
21618
21730
  }
21619
- function followLabelsToFannedTails(edges, obstacles, shifts) {
21731
+ function followLabelsToFannedTails(edges, obstacles, shifts, textMetrics = "proportional") {
21620
21732
  if (shifts.size === 0) return;
21621
21733
  const \u6E2C\u308A\u65B9 = \u7DDA\u306E\u6E2C\u308A\u65B9\u3092\u4F5C\u308B();
21622
21734
  const labels = edges.filter(hasRenderedLabel).map((e) => ({
21623
21735
  kind: "edge-label",
21624
21736
  id: e.id,
21625
- ...computeLabelBBoxWorld(e)
21737
+ ...computeLabelBBoxWorld(e, textMetrics)
21626
21738
  }));
21627
21739
  const labelIndexByEdgeId = new Map(labels.map((label, index) => [label.id, index]));
21628
21740
  const edgeById = new Map(edges.map((e) => [e.id, e]));
@@ -21654,7 +21766,7 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
21654
21766
  labelY: e.labelY + \u79FB\u52D5.dy,
21655
21767
  labelAnchor: e.labelAnchor
21656
21768
  };
21657
- const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa });
21769
+ const \u5019\u88DCa\u306E\u7BB1 = computeLabelBBoxWorld({ ...e, ...\u5019\u88DCa }, textMetrics);
21658
21770
  const \u6700\u5F8C\u306F\u7E26 = Math.abs(\u6700\u5F8C.x2 - \u6700\u5F8C.x1) <= Math.abs(\u6700\u5F8C.y2 - \u6700\u5F8C.y1);
21659
21771
  const \u5019\u88DC = [
21660
21772
  \u5019\u88DCa,
@@ -21665,7 +21777,11 @@ function followLabelsToFannedTails(edges, obstacles, shifts) {
21665
21777
  }
21666
21778
  ];
21667
21779
  for (const c of \u5019\u88DC) {
21668
- const \u672D = { kind: "edge-label", id: e.id, ...computeLabelBBoxWorld({ ...e, ...c }) };
21780
+ const \u672D = {
21781
+ kind: "edge-label",
21782
+ id: e.id,
21783
+ ...computeLabelBBoxWorld({ ...e, ...c }, textMetrics)
21784
+ };
21669
21785
  if (segmentsCrossRect([\u6700\u5F8C], \u672D)) continue;
21670
21786
  if (\u672D\u306E\u79FB\u52D5\u3092\u585E\u3050\u76F8\u624B\u3092\u63A2\u3059(\u5468\u308A, \u5143\u306E\u672D, \u672D) !== null) continue;
21671
21787
  e.labelX = c.labelX;
@@ -21859,7 +21975,7 @@ function expandLanesForNodes(lanes, nodes) {
21859
21975
  };
21860
21976
  });
21861
21977
  }
21862
- function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
21978
+ function expandLaneGapsForEdgeLabels(lanes, nodes, edges, textMetrics = "proportional") {
21863
21979
  if (lanes.length < 2) return lanes;
21864
21980
  const layoutedLanes = lanes.filter((l) => !(l.posX !== void 0 && l.posY !== void 0));
21865
21981
  if (layoutedLanes.length < 2) return lanes;
@@ -21875,7 +21991,7 @@ function expandLaneGapsForEdgeLabels(lanes, nodes, edges) {
21875
21991
  const fi = laneIndexById.get(fromLane);
21876
21992
  const ti = laneIndexById.get(toLane);
21877
21993
  if (fi === void 0 || ti === void 0 || fi === ti) continue;
21878
- const labelBoxW = computeLabelBoxW(edge.label, edge.sub);
21994
+ const labelBoxW = computeLabelBoxW(edge.label, edge.sub, textMetrics);
21879
21995
  if (labelBoxW === 0) continue;
21880
21996
  const lo = Math.min(fi, ti);
21881
21997
  const hi = Math.max(fi, ti);
@@ -21997,7 +22113,7 @@ function \u7DDA\u306E\u7AEF\u306E\u5411\u304D(d, \u7AEF) {
21997
22113
  const \u5019\u88DC = segs.flatMap((s) => [...s.ctrl ?? [], { x: s.x2, y: s.y2 }]);
21998
22114
  return \u5411\u304D\u3092\u53D6\u308B(end, \u5019\u88DC);
21999
22115
  }
22000
- function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
22116
+ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head", textMetrics = "proportional") {
22001
22117
  const text = (\u7AEF === "head" ? edge.headLabel : edge.tailLabel)?.trim();
22002
22118
  if (!text) return null;
22003
22119
  const \u5411\u304D = \u7DDA\u306E\u7AEF\u306E\u5411\u304D(edge.d, \u7AEF);
@@ -22008,7 +22124,8 @@ function \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF = "head") {
22008
22124
  const w = measureTextWidth(text, {
22009
22125
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
22010
22126
  fontWeight: EDGE_LABEL_TEXT.sub.fontWeight,
22011
- fontFamily: "mono"
22127
+ fontFamily: "mono",
22128
+ textMetrics
22012
22129
  });
22013
22130
  const h = \u7BB1\u306E\u9AD8\u3055;
22014
22131
  const \u672D = hasRenderedLabel(edge) && edge.labelX !== void 0 && edge.labelY !== void 0 ? { x: edge.labelX, y: edge.labelY } : null;
@@ -22057,10 +22174,10 @@ function autoStorageHeight(n, defaultH) {
22057
22174
  }
22058
22175
  return Math.max(defaultH, \u5FC5\u8981);
22059
22176
  }
22060
- function autoRowsWidth(n, defaultW) {
22177
+ function autoRowsWidth(n, defaultW, textMetrics = "proportional") {
22061
22178
  if (n.w != null) return n.w;
22062
22179
  if (!n.rows || n.rows.length === 0) return defaultW;
22063
- const required = requiredRowsWidth(n.rows, n.kind);
22180
+ const required = requiredRowsWidth(n.rows, n.kind, textMetrics);
22064
22181
  return Math.max(defaultW, required);
22065
22182
  }
22066
22183
  function \u7BB1\u306E\u9AD8\u30552(n, \u65E2\u5B9Ah) {
@@ -22098,7 +22215,7 @@ function requiredStackGapForEdgeLabels(diag, allStacks) {
22098
22215
  }
22099
22216
  return required;
22100
22217
  }
22101
- function layoutNodes(diag, lanes) {
22218
+ function layoutNodes(diag, lanes, textMetrics) {
22102
22219
  const laneMap = new Map(lanes.map((l) => [l.id, l]));
22103
22220
  const allStacks = Array.from(new Set(diag.nodes.map((n) => n.stack))).sort((a, b) => a - b);
22104
22221
  const rowH = /* @__PURE__ */ new Map();
@@ -22142,7 +22259,7 @@ function layoutNodes(diag, lanes) {
22142
22259
  }
22143
22260
  const size = NODE_SIZE[n.kind];
22144
22261
  if (n.posX !== void 0 && n.posY !== void 0) {
22145
- const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w);
22262
+ const w2 = n.posW ?? n.w ?? autoRowsWidth(n, size.w, textMetrics);
22146
22263
  const h2 = n.posH ?? n.h ?? rowH.get(n.stack) ?? size.h;
22147
22264
  out.push({
22148
22265
  ...n,
@@ -22160,7 +22277,7 @@ function layoutNodes(diag, lanes) {
22160
22277
  const \u81EA\u524D\u306E\u9AD8\u3055 = n.rowMarks !== void 0;
22161
22278
  const h = n.h ?? (\u81EA\u524D\u306E\u9AD8\u3055 ? \u7BB1\u306E\u9AD8\u30552(n, size.h) : \u6BB5\u306E\u9AD8\u3055);
22162
22279
  const cy = \u6BB5\u306E\u82AF;
22163
- const w = autoRowsWidth(n, size.w);
22280
+ const w = autoRowsWidth(n, size.w, textMetrics);
22164
22281
  out.push({
22165
22282
  ...n,
22166
22283
  cx,
@@ -22280,10 +22397,16 @@ function applyRowLevelNodeShifts(nodes, lanes, nodeShifts) {
22280
22397
  return moved ? { nodes: outNodes, lanes: outLanes } : null;
22281
22398
  }
22282
22399
  function layout(diag) {
22400
+ const textMetrics = resolveTextMetrics(diag.textMetrics);
22283
22401
  const lanes = layoutLanes(diag);
22284
- const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes));
22402
+ const rawNodes = applyFooterShapeDrops(lanes, layoutNodes(diag, lanes, textMetrics));
22285
22403
  const expandedLanes = expandLanesForNodes(lanes, rawNodes);
22286
- const gapExpandedLanes = expandLaneGapsForEdgeLabels(expandedLanes, rawNodes, diag.edges);
22404
+ const gapExpandedLanes = expandLaneGapsForEdgeLabels(
22405
+ expandedLanes,
22406
+ rawNodes,
22407
+ diag.edges,
22408
+ textMetrics
22409
+ );
22287
22410
  const nodes = rawNodes.map((n) => {
22288
22411
  if (n.posX !== void 0 && n.posY !== void 0) return n;
22289
22412
  const oldLane = lanes.find((l) => l.id === n.lane);
@@ -22292,13 +22415,13 @@ function layout(diag) {
22292
22415
  return { ...n, cx: newLane.x + newLane.width / 2 };
22293
22416
  });
22294
22417
  const containedLanesPre = recomputeContainedLanes(gapExpandedLanes, nodes);
22295
- const edgesPre = layoutEdges(diag, nodes, containedLanesPre);
22296
- const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre);
22418
+ const edgesPre = layoutEdges(diag, nodes, containedLanesPre, textMetrics);
22419
+ const bboxesPre = collectBBoxes(containedLanesPre, nodes, edgesPre, textMetrics);
22297
22420
  const collisionsPre = detectCollisions(bboxesPre, edgesPre);
22298
22421
  const nodesResolved = resolveOverlaps(nodes, collisionsPre);
22299
22422
  const moved = nodesResolved !== nodes;
22300
22423
  const containedLanes = moved ? recomputeContainedLanes(gapExpandedLanes, nodesResolved) : containedLanesPre;
22301
- const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes) : edgesPre;
22424
+ const edgesAfterMove = moved ? layoutEdges(diag, nodesResolved, containedLanes, textMetrics) : edgesPre;
22302
22425
  const chainShiftClearance = Math.max(CLEARANCE_LABEL_LABEL, CLEARANCE_NODE_LABEL);
22303
22426
  let edges;
22304
22427
  let nodesFinal = nodesResolved;
@@ -22309,10 +22432,13 @@ function layout(diag) {
22309
22432
  } else {
22310
22433
  const propagateResult = resolveEdgeLabelOverlapsWithChainAndPropagate(
22311
22434
  edgesAfterMove,
22312
- collectBBoxes(containedLanes, nodesResolved, []).filter(
22435
+ collectBBoxes(containedLanes, nodesResolved, [], textMetrics).filter(
22313
22436
  (b) => b.kind === "node" || b.kind === "lane-label"
22314
22437
  ),
22315
- chainShiftClearance
22438
+ chainShiftClearance,
22439
+ void 0,
22440
+ void 0,
22441
+ textMetrics
22316
22442
  );
22317
22443
  edges = propagateResult.edges;
22318
22444
  if (propagateResult.nodeShifts.size > 0) {
@@ -22324,7 +22450,7 @@ function layout(diag) {
22324
22450
  }
22325
22451
  if (nodesFinal !== nodesResolved) {
22326
22452
  containedLanesFinal = recomputeContainedLanes(laneShiftedBase, nodesFinal);
22327
- edges = layoutEdges(diag, nodesFinal, containedLanesFinal);
22453
+ edges = layoutEdges(diag, nodesFinal, containedLanesFinal, textMetrics);
22328
22454
  }
22329
22455
  }
22330
22456
  const positionedEdgeIds = new Set(
@@ -22332,21 +22458,31 @@ function layout(diag) {
22332
22458
  (e) => e.routing === "curve" || e.routing === "metro" || e.posX1 !== void 0 && e.posY1 !== void 0 && e.posX2 !== void 0 && e.posY2 !== void 0
22333
22459
  ).map((e) => e.id)
22334
22460
  );
22335
- bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds);
22336
- pullOutgoingFirstCorner(edges, nodesFinal);
22461
+ bowSharedStraightPaths(edges, nodesFinal, positionedEdgeIds, textMetrics);
22462
+ pullOutgoingFirstCorner(edges, nodesFinal, textMetrics);
22337
22463
  const fannedTailShifts = fanIncomingEndpoints(edges, nodesFinal);
22338
22464
  separateSharedStraightRuns(edges, nodesFinal);
22339
22465
  hopEdgeCrossings(edges);
22340
- const labelClearanceObstacles = collectBBoxes(containedLanesFinal, nodesFinal, []).filter(
22466
+ const labelClearanceObstacles = collectBBoxes(
22467
+ containedLanesFinal,
22468
+ nodesFinal,
22469
+ [],
22470
+ textMetrics
22471
+ ).filter(
22341
22472
  (b) => b.kind === "node" || b.kind === "lane-label"
22342
22473
  );
22343
- followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts);
22344
- repositionParallelLabels(edges, nodesFinal);
22345
- slideLabelsAlongOwnPath(edges, nodesFinal);
22474
+ followLabelsToFannedTails(edges, labelClearanceObstacles, fannedTailShifts, textMetrics);
22475
+ repositionParallelLabels(edges, nodesFinal, textMetrics);
22476
+ slideLabelsAlongOwnPath(edges, nodesFinal, textMetrics);
22346
22477
  if (!isChainEdgeLabelDisabled()) {
22347
- edges = resolveLabelClearanceAfterPathPasses(edges, labelClearanceObstacles);
22478
+ edges = resolveLabelClearanceAfterPathPasses(
22479
+ edges,
22480
+ labelClearanceObstacles,
22481
+ void 0,
22482
+ textMetrics
22483
+ );
22348
22484
  }
22349
- const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges);
22485
+ const bboxes = collectBBoxes(containedLanesFinal, nodesFinal, edges, textMetrics);
22350
22486
  const collisions = detectCollisions(bboxes, edges);
22351
22487
  const nearCollisions = detectNearCollisions(bboxes, edges);
22352
22488
  if (collisions.length > 0) {
@@ -22386,6 +22522,8 @@ function layout(diag) {
22386
22522
  // 描画側の固定の字の言語 (#847)。 既定 (`en`) と型の外の値は持たせない = 配置の結果の形を
22387
22523
  // 変更前と揃え、記法の書き損じで一部の字だけ日本語になる形を作らない
22388
22524
  ...resolveLang(diag.lang) === "ja" ? { lang: "ja" } : {},
22525
+ // 既定は持ち越さない。既存の LaidDiagram の形を変えず、等幅の図だけ描画へ伝える
22526
+ ...textMetrics === "monospace" ? { textMetrics: "monospace" } : {},
22389
22527
  // 種類も配色と同じく空の目印を出さない。 遮断をここに揃えると手書きの図にも効く
22390
22528
  ...diag.type ? { type: diag.type } : {},
22391
22529
  bboxes,
@@ -24511,6 +24649,7 @@ function CdlEdgeView({
24511
24649
  "data-cdl-edge-label": edge.label,
24512
24650
  "data-cdl-edge-sub": edge.sub ?? "",
24513
24651
  "data-cdl-tone": edge.tone,
24652
+ "data-cdl-edge-role": edge.role,
24514
24653
  children: [
24515
24654
  isDotted ? /* @__PURE__ */ jsxs("g", { children: [
24516
24655
  /* @__PURE__ */ jsx("path", { id: glowPathId, d: glowPathD, fill: "none", stroke: "none" }),
@@ -24662,11 +24801,12 @@ function CdlEdgeGlowView({
24662
24801
  }
24663
24802
  function CdlEdgeLabelView({
24664
24803
  edge,
24665
- active
24804
+ active,
24805
+ textMetrics = "proportional"
24666
24806
  }) {
24667
24807
  if (!hasRenderedLabel(edge)) return null;
24668
24808
  const color = edgeColor(edge);
24669
- const bbox = computeLabelBBoxWorld(edge);
24809
+ const bbox = computeLabelBBoxWorld(edge, textMetrics);
24670
24810
  const boxW = bbox.w;
24671
24811
  const boxH = bbox.h;
24672
24812
  const boxLeftX = bbox.x - edge.labelX;
@@ -24682,6 +24822,8 @@ function CdlEdgeLabelView({
24682
24822
  "data-cdl-edge-label-for": edge.id,
24683
24823
  "data-cdl-edge-label-text": edge.label,
24684
24824
  "data-cdl-edge-sub-text": edge.sub ?? "",
24825
+ "data-cdl-tone": edge.tone,
24826
+ "data-cdl-edge-role": edge.role,
24685
24827
  children: [
24686
24828
  edge.labelPlate !== false && /* @__PURE__ */ jsx(
24687
24829
  "rect",
@@ -24735,9 +24877,10 @@ function CdlEdgeLabelView({
24735
24877
  function CdlEdgeEndLabelView({
24736
24878
  edge,
24737
24879
  active,
24738
- \u7AEF
24880
+ \u7AEF,
24881
+ textMetrics = "proportional"
24739
24882
  }) {
24740
- const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF);
24883
+ const \u7F6E\u304D\u5834\u6240 = \u7AEF\u306E\u5B57\u3092\u7F6E\u304F(edge, \u7AEF, textMetrics);
24741
24884
  if (!\u7F6E\u304D\u5834\u6240) return null;
24742
24885
  const color = edgeColor(edge);
24743
24886
  return /* @__PURE__ */ jsx(
@@ -24746,6 +24889,8 @@ function CdlEdgeEndLabelView({
24746
24889
  "data-cdl-role": "edge-end-label",
24747
24890
  "data-cdl-edge-end-label-for": edge.id,
24748
24891
  "data-cdl-edge-end": \u7AEF,
24892
+ "data-cdl-tone": edge.tone,
24893
+ "data-cdl-edge-role": edge.role,
24749
24894
  x: \u7F6E\u304D\u5834\u6240.x,
24750
24895
  y: \u7F6E\u304D\u5834\u6240.y,
24751
24896
  fontSize: \u7AEF\u306E\u5B57\u306E\u5927\u304D\u3055,
@@ -24993,12 +25138,18 @@ var g4 = (v) => Math.round(v / 4) * 4;
24993
25138
  function sequenceStepId() {
24994
25139
  return "seq_step";
24995
25140
  }
24996
- function sequenceBoardMetrics(data) {
25141
+ function sequenceBoardMetrics(data, textMetrics = "proportional") {
24997
25142
  const \u540D\u5E45 = data.actors.map(
24998
- (a) => Math.max(textWidth(a.name, SEQ_NAME), a.subtitle ? textWidth(a.subtitle, SEQ_SUB) : 0)
25143
+ (a) => Math.max(
25144
+ textWidth(a.name, SEQ_NAME, 0, textMetrics),
25145
+ a.subtitle ? textWidth(a.subtitle, SEQ_SUB, 0, textMetrics) : 0
25146
+ )
24999
25147
  );
25000
25148
  const colW = g4(Math.max(SEQ_COL_MIN, Math.max(0, ...\u540D\u5E45) + SEQ_COL_PAD));
25001
- const \u8A9E\u5E45 = Math.max(0, ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL)));
25149
+ const \u8A9E\u5E45 = Math.max(
25150
+ 0,
25151
+ ...data.messages.map((m) => textWidth(m.label, SEQ_LABEL, 0, textMetrics))
25152
+ );
25002
25153
  const gutter = g4(SEQ_EDGE + SEQ_GUTTER_PAD + \u8A9E\u5E45 + SEQ_GUTTER_GAP);
25003
25154
  const headY = SEQ_EDGE + SEQ_HEAD;
25004
25155
  const rowY = (i) => headY + SEQ_ROW_PAD + i * SEQ_ROW;
@@ -25011,11 +25162,12 @@ function sequenceBoardMetrics(data) {
25011
25162
  }
25012
25163
  function SequenceBoardNode({
25013
25164
  node,
25014
- stateValues
25165
+ stateValues,
25166
+ textMetrics = "proportional"
25015
25167
  }) {
25016
25168
  const data = node.sequenceData;
25017
25169
  if (!data) return /* @__PURE__ */ jsx("g", { "data-cdl-role": "sequence-board" });
25018
- const m = sequenceBoardMetrics(data);
25170
+ const m = sequenceBoardMetrics(data, textMetrics);
25019
25171
  const x = node.cx - node.w / 2;
25020
25172
  const y = node.cy - node.h / 2;
25021
25173
  const \u73FE\u5728 = (() => {
@@ -25666,7 +25818,8 @@ function GenericNode({
25666
25818
  active,
25667
25819
  value,
25668
25820
  stateValues,
25669
- \u5024\u306E\u540D\u524D
25821
+ \u5024\u306E\u540D\u524D,
25822
+ textMetrics = "proportional"
25670
25823
  }) {
25671
25824
  const base = STYLES[node.kind] ?? FALLBACK;
25672
25825
  const toned = toneColor3(node.tone);
@@ -25805,7 +25958,7 @@ function GenericNode({
25805
25958
  const resolved = node.rows.map((row) => interpolate(row, stateValues, \u5024\u306E\u540D\u524D));
25806
25959
  const splits = resolved.map(splitRow);
25807
25960
  const leftMaxWidth = splits.reduce(
25808
- (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
25961
+ (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false, textMetrics)),
25809
25962
  0
25810
25963
  );
25811
25964
  const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
@@ -26289,8 +26442,8 @@ function \u5024\u3068\u5272\u5408\u306E\u6587\u5B57(\u5024, \u5272\u5408, \u5408
26289
26442
  return \u7D44.\u5024 === null ? \u7D44.\u5272\u5408 : `${\u7D44.\u5024} ${\u7D44.\u5272\u5408}`;
26290
26443
  }
26291
26444
  var \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
26292
- function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587) {
26293
- 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);
26445
+ function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587, textMetrics = "proportional") {
26446
+ 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);
26294
26447
  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);
26295
26448
  }
26296
26449
  function ChartPieNode({
@@ -26298,7 +26451,8 @@ function ChartPieNode({
26298
26451
  active,
26299
26452
  stateValues = {},
26300
26453
  drawing = false,
26301
- progress = 1
26454
+ progress = 1,
26455
+ textMetrics = "proportional"
26302
26456
  }) {
26303
26457
  const instanceId = useId().replace(/[^A-Za-z0-9_-]/g, "");
26304
26458
  const x0 = node.cx - node.w / 2;
@@ -26329,15 +26483,26 @@ function ChartPieNode({
26329
26483
  return `${\u5B9F\u5024\u8868\u8A18(d.value)}%` === \u5272\u5408\u306E\u6587\u5B57[i] ? \u540D : `${\u540D} ${\u5B9F\u5024\u8868\u8A18(d.value)}`;
26330
26484
  });
26331
26485
  if (\u5F62 !== "ring") {
26332
- const \u5171\u901A = { node, active, data, \u5272\u5408: \u4ECA\u306E\u5272\u5408, x0, y0, drawing, progress, instanceId };
26486
+ const \u5171\u901A = {
26487
+ node,
26488
+ active,
26489
+ data,
26490
+ \u5272\u5408: \u4ECA\u306E\u5272\u5408,
26491
+ x0,
26492
+ y0,
26493
+ drawing,
26494
+ progress,
26495
+ instanceId,
26496
+ textMetrics
26497
+ };
26333
26498
  return \u5F62 === "arcs" ? \u5F27\u306E\u5F62(\u5171\u901A) : \u8868\u306E\u5F62(\u5171\u901A);
26334
26499
  }
26335
26500
  const \u540D\u672D\u5E45 = Math.max(
26336
26501
  0,
26337
26502
  ...data.map(
26338
26503
  (_d, i) => Math.max(
26339
- textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A),
26340
- textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A)
26504
+ textWidth(\u5272\u5408\u306E\u6587\u5B57[i] ?? "", \u5272\u5408\u306E\u7D1A, 0, textMetrics),
26505
+ textWidth(\u540D\u524D\u306E\u6587\u5B57[i] ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics)
26341
26506
  )
26342
26507
  )
26343
26508
  );
@@ -26352,8 +26517,8 @@ function ChartPieNode({
26352
26517
  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) : [];
26353
26518
  const \u7A74 = \u524D\u3042\u308A ? \u524D\u306E\u5185\u534A\u5F84 : \u5916\u306E\u5185\u534A\u5F84;
26354
26519
  const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total));
26355
- const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587);
26356
- const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08");
26520
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587, textMetrics);
26521
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08", textMetrics);
26357
26522
  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);
26358
26523
  const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
26359
26524
  const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
@@ -26536,14 +26701,24 @@ function \u67A0(node, active) {
26536
26701
  }
26537
26702
  );
26538
26703
  }
26539
- function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress }) {
26704
+ function \u5F27\u306E\u5F62({
26705
+ node,
26706
+ active,
26707
+ data,
26708
+ \u5272\u5408,
26709
+ x0,
26710
+ y0,
26711
+ drawing,
26712
+ progress,
26713
+ textMetrics
26714
+ }) {
26540
26715
  const PAD = 20;
26541
26716
  const \u540D\u524D\u306E\u7D1A = 14;
26542
26717
  const \u5272\u5408\u306E\u7D1A = 24;
26543
26718
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
26544
26719
  const \u540D\u524D\u304B\u3089\u5272\u5408\u307E\u3067 = 24;
26545
26720
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
26546
- 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)));
26721
+ 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)));
26547
26722
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
26548
26723
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u4E00\u89A7\u5E45 - 28) / 2;
26549
26724
  const R = Math.max(24, Math.min(\u7E26\u304B\u3089, \u6A2A\u304B\u3089));
@@ -26629,7 +26804,18 @@ function \u5F27\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
26629
26804
  })
26630
26805
  ] });
26631
26806
  }
26632
- function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing, progress, instanceId }) {
26807
+ function \u8868\u306E\u5F62({
26808
+ node,
26809
+ active,
26810
+ data,
26811
+ \u5272\u5408,
26812
+ x0,
26813
+ y0,
26814
+ drawing,
26815
+ progress,
26816
+ instanceId,
26817
+ textMetrics
26818
+ }) {
26633
26819
  const PAD = 20;
26634
26820
  const \u898B\u51FA\u3057\u306E\u7D1A = 11;
26635
26821
  const \u540D\u524D\u306E\u7D1A = 15;
@@ -26638,9 +26824,18 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
26638
26824
  const \u5370\u304B\u3089\u540D\u524D\u307E\u30672 = 18;
26639
26825
  const \u5272\u5408\u306E\u6587\u5B57 = \u5272\u5408.map(\u5272\u5408\u8868\u8A18);
26640
26826
  const \u5B9F\u6570\u306E\u6587\u5B57 = data.map((d) => \u5B9F\u5024\u8868\u8A18(d.value));
26641
- const \u540D\u524D\u5E45 = Math.max(0, ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A)));
26642
- 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)));
26643
- 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)));
26827
+ const \u540D\u524D\u5E45 = Math.max(
26828
+ 0,
26829
+ ...data.map((d) => textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics))
26830
+ );
26831
+ const \u5272\u5408\u5E45 = Math.max(
26832
+ textWidth("\u5272\u5408", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
26833
+ ...\u5272\u5408\u306E\u6587\u5B57.map((t) => textWidth(t, \u5272\u5408\u306E\u7D1A, 0, textMetrics))
26834
+ );
26835
+ const \u5B9F\u6570\u5E45 = Math.max(
26836
+ textWidth("\u5024", \u898B\u51FA\u3057\u306E\u7D1A, 0, textMetrics),
26837
+ ...\u5B9F\u6570\u306E\u6587\u5B57.map((t) => textWidth(t, \u5B9F\u6570\u306E\u7D1A, 0, textMetrics))
26838
+ );
26644
26839
  const \u8868\u5E45 = 10 + \u5370\u304B\u3089\u540D\u524D\u307E\u30672 + \u540D\u524D\u5E45 + 28 + \u5272\u5408\u5E45 + 24 + \u5B9F\u6570\u5E45;
26645
26840
  const \u7E26\u304B\u3089 = (node.h - PAD * 2) / 2;
26646
26841
  const \u6A2A\u304B\u3089 = (node.w - PAD * 2 - \u8868\u5E45 - 28) / 2;
@@ -26649,8 +26844,8 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
26649
26844
  const cx = PAD + R;
26650
26845
  const cy = node.h / 2;
26651
26846
  const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)));
26652
- const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587);
26653
- const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08");
26847
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587, textMetrics);
26848
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08", textMetrics);
26654
26849
  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);
26655
26850
  const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
26656
26851
  const \u53F3\u7AEF = node.w - PAD;
@@ -26781,7 +26976,8 @@ function ChartGaugeNode({
26781
26976
  active,
26782
26977
  stateValues = {},
26783
26978
  drawing = false,
26784
- progress = 1
26979
+ progress = 1,
26980
+ textMetrics = "proportional"
26785
26981
  }) {
26786
26982
  const x0 = node.cx - node.w / 2;
26787
26983
  const y0 = node.cy - node.h / 2;
@@ -26800,7 +26996,10 @@ function ChartGaugeNode({
26800
26996
  const \u533A\u753B\u306E\u9593 = 12;
26801
26997
  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);
26802
26998
  const \u5272\u308A\u4ED8\u3051\u308B = (\u4EF6\u305F\u3061) => {
26803
- 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;
26999
+ const \u5E45 = Math.max(
27000
+ \u5370\u306E\u5E452,
27001
+ ...\u4EF6\u305F\u3061.map((d) => textWidth(\u6570\u5024\u306E\u884C(d), \u6570\u5024\u306E\u7D1A, 0, textMetrics))
27002
+ ) + \u533A\u753B\u306E\u9593;
26804
27003
  const \u884C\u306E\u4EF6\u65702 = Math.min(
26805
27004
  Math.max(1, Math.floor(\u4F7F\u3048\u308B\u5E452 / Math.max(\u5E45, 1))),
26806
27005
  Math.max(\u4EF6\u305F\u3061.length, 1)
@@ -26875,7 +27074,7 @@ function ChartGaugeNode({
26875
27074
  return { d, frac, path: \u6247\u306E\u9053(a0, a1, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5916\u534A\u5F84) };
26876
27075
  });
26877
27076
  const \u5408\u8A08\u306E\u6587\u5B57 = \u5B9F\u5024\u8868\u8A18(Math.round(total));
26878
- const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100), 1) / 100;
27077
+ const \u5358\u4F4D\u5E45 = Math.max(textWidth(\u5408\u8A08\u306E\u6587\u5B57, 100, 0, textMetrics), 1) / 100;
26879
27078
  const \u7D1A\u306E\u5019\u88DC = Math.min(
26880
27079
  // 横 = 字の上の角が内側の円に入る大きさ
26881
27080
  \u5185\u534A\u5F84 / Math.sqrt((\u5358\u4F4D\u5E45 / 2) ** 2 + 1.25 ** 2),
@@ -26968,7 +27167,7 @@ function ChartGaugeNode({
26968
27167
  const y = \u5185\u8A33\u306Ey + \u6BB5\u306E\u9AD8\u3055 * \u6BB5;
26969
27168
  const \u53CE\u307E\u308B\u5E45 = \u5185\u8A33\u306E\u5E45 - \u533A\u753B\u306E\u9593;
26970
27169
  const \u6570\u306E\u884C = \u5185\u8A33\u306E\u6570\u5024[idx] ?? "";
26971
- const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A);
27170
+ const \u5207\u3063\u305F\u6570\u306E\u884C = \u5207\u308A\u8A70\u3081\u308B(\u6570\u306E\u884C, \u53CE\u307E\u308B\u5E45, \u6570\u5024\u306E\u7D1A, textMetrics);
26972
27171
  return /* @__PURE__ */ jsxs("g", { "data-cdl-role": "chart-gauge-item", children: [
26973
27172
  /* @__PURE__ */ jsx(
26974
27173
  "rect",
@@ -26989,7 +27188,7 @@ function ChartGaugeNode({
26989
27188
  fontSize: \u540D\u524D\u306E\u7D1A,
26990
27189
  fontWeight: 700,
26991
27190
  fill: "var(--cdl-text, #1a1f2a)",
26992
- children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A)
27191
+ children: \u5207\u308A\u8A70\u3081\u308B(d.label ?? "", \u53CE\u307E\u308B\u5E45, \u540D\u524D\u306E\u7D1A, textMetrics)
26993
27192
  }
26994
27193
  ),
26995
27194
  /* @__PURE__ */ jsx("text", { x, y: y + 46, fontSize: \u6570\u5024\u306E\u7D1A, fill: "var(--cdl-text-dim, #5a6270)", children: \u5207\u3063\u305F\u6570\u306E\u884C === \u6570\u306E\u884C ? /* @__PURE__ */ jsx(
@@ -27007,12 +27206,12 @@ function ChartGaugeNode({
27007
27206
  function \u6975(cx, cy, r, a) {
27008
27207
  return { x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) };
27009
27208
  }
27010
- function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A) {
27011
- if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A) <= \u4E0A\u9650) return s;
27012
- const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A);
27209
+ function \u5207\u308A\u8A70\u3081\u308B(s, \u4E0A\u9650, \u7D1A, textMetrics = "proportional") {
27210
+ if (\u4E0A\u9650 <= 0 || textWidth(s, \u7D1A, 0, textMetrics) <= \u4E0A\u9650) return s;
27211
+ const \u8A18\u53F7\u5E45 = textWidth("\u2026", \u7D1A, 0, textMetrics);
27013
27212
  let out = "";
27014
27213
  for (const c of s) {
27015
- if (textWidth(out + c, \u7D1A) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
27214
+ if (textWidth(out + c, \u7D1A, 0, textMetrics) + \u8A18\u53F7\u5E45 > \u4E0A\u9650) break;
27016
27215
  out += c;
27017
27216
  }
27018
27217
  return `${out}\u2026`;
@@ -27026,7 +27225,8 @@ function ChartRadialNode({
27026
27225
  active,
27027
27226
  stateValues = {},
27028
27227
  drawing = false,
27029
- progress = 1
27228
+ progress = 1,
27229
+ textMetrics = "proportional"
27030
27230
  }) {
27031
27231
  const x0 = node.cx - node.w / 2;
27032
27232
  const y0 = node.cy - node.h / 2;
@@ -27044,7 +27244,10 @@ function ChartRadialNode({
27044
27244
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E45 + Math.max(
27045
27245
  0,
27046
27246
  ...data.map(
27047
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
27247
+ (d, i) => Math.max(
27248
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
27249
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
27250
+ )
27048
27251
  )
27049
27252
  );
27050
27253
  const \u5F27\u306B\u4F7F\u3048\u308B\u5E45 = node.w - PAD * 2 - \u4E00\u89A7\u306E\u5E45 - \u4E00\u89A7\u3068\u5F27\u306E\u9593;
@@ -27191,7 +27394,8 @@ function arcColor2(tone, idx) {
27191
27394
  function ChartStatNode({
27192
27395
  node,
27193
27396
  active,
27194
- stateValues = {}
27397
+ stateValues = {},
27398
+ textMetrics = "proportional"
27195
27399
  }) {
27196
27400
  const x0 = node.cx - node.w / 2;
27197
27401
  const y0 = node.cy - node.h / 2;
@@ -27220,7 +27424,13 @@ function ChartStatNode({
27220
27424
  const frac = total > 0 ? d.value / total : 0;
27221
27425
  const \u8272 = \u5370\u306E\u8272(d.tone, idx);
27222
27426
  const \u6570\u5024 = \u5B9F\u5024\u8868\u8A18(d.value);
27223
- 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);
27427
+ const \u6570\u5024\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A(
27428
+ \u6570\u5024,
27429
+ \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
27430
+ \u533A\u753B.\u6570\u5024\u306E\u7D1A,
27431
+ \u533A\u753B.\u540D\u524D\u306E\u7D1A + 1,
27432
+ textMetrics
27433
+ );
27224
27434
  return /* @__PURE__ */ jsxs(
27225
27435
  "g",
27226
27436
  {
@@ -27277,7 +27487,8 @@ function ChartStatNode({
27277
27487
  `\u524D ${\u5B9F\u5024\u8868\u8A18(d.previous)}`,
27278
27488
  \u67A02.w - \u533A\u753B.\u4F59\u767D * 2,
27279
27489
  \u533A\u753B.\u524D\u306E\u7D1A,
27280
- 8
27490
+ 8,
27491
+ textMetrics
27281
27492
  ),
27282
27493
  textAnchor: "middle",
27283
27494
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -27366,9 +27577,9 @@ function \u533A\u753B\u306E\u5272\u4ED8(w, h, \u4EF6\u6570, \u524D\u3092\u51FA\u
27366
27577
  \u67A0: (idx) => ({ x: \u5E45 * idx, y: 0, w: \u5E45, h })
27367
27578
  };
27368
27579
  }
27369
- function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650) {
27580
+ function \u53CE\u3081\u308B\u7D1A(\u5B572, \u4F7F\u3048\u308B\u5E452, \u521D\u671F, \u4E0B\u9650, textMetrics = "proportional") {
27370
27581
  let \u7D1A = \u521D\u671F;
27371
- while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
27582
+ while (\u7D1A > \u4E0B\u9650 && textWidth(\u5B572, \u7D1A, 0, textMetrics) > \u4F7F\u3048\u308B\u5E452) \u7D1A -= 1;
27372
27583
  return \u7D1A;
27373
27584
  }
27374
27585
  function \u5F27\u306E\u90533(cx, cy, r, \u5272\u5408) {
@@ -27403,7 +27614,8 @@ function ChartWaffleNode({
27403
27614
  active,
27404
27615
  stateValues = {},
27405
27616
  drawing = false,
27406
- progress = 1
27617
+ progress = 1,
27618
+ textMetrics = "proportional"
27407
27619
  }) {
27408
27620
  const x0 = node.cx - node.w / 2;
27409
27621
  const y0 = node.cy - node.h / 2;
@@ -27422,7 +27634,10 @@ function ChartWaffleNode({
27422
27634
  const \u4E00\u89A7\u306E\u5E45 = \u5370\u306E\u5E452 + Math.max(
27423
27635
  0,
27424
27636
  ...data.map(
27425
- (d, i) => Math.max(textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A), textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A))
27637
+ (d, i) => Math.max(
27638
+ textWidth(d.label ?? "", \u540D\u524D\u306E\u7D1A, 0, textMetrics),
27639
+ textWidth(\u6570\u5024\u306E\u6587\u5B57[i] ?? "", \u6570\u5024\u306E\u7D1A, 0, textMetrics)
27640
+ )
27426
27641
  )
27427
27642
  );
27428
27643
  const \u4F7F\u3048\u308B\u9AD8\u3055 = node.h - PAD * 2;
@@ -27524,7 +27739,8 @@ function ChartStackedBarNode({
27524
27739
  active,
27525
27740
  stateValues = {},
27526
27741
  drawing = false,
27527
- progress = 1
27742
+ progress = 1,
27743
+ textMetrics = "proportional"
27528
27744
  }) {
27529
27745
  const x0 = node.cx - node.w / 2;
27530
27746
  const y0 = node.cy - node.h / 2;
@@ -27534,7 +27750,7 @@ function ChartStackedBarNode({
27534
27750
  const \u540D\u524D\u306E\u7D1A = 13;
27535
27751
  const \u533A\u753B\u306E\u7D1A = 12;
27536
27752
  const \u6642\u70B9\u306E\u7D1A = 13;
27537
- 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);
27753
+ 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);
27538
27754
  const \u5E2F\u306E\u5DE6 = PAD + \u6642\u70B9\u306E\u5E45;
27539
27755
  const \u5E2F\u306E\u5E45 = Math.max(40, node.w - \u5E2F\u306E\u5DE6 - PAD);
27540
27756
  const \u5E2F\u306E\u9AD8\u3055 = 44;
@@ -27627,7 +27843,7 @@ function ChartStackedBarNode({
27627
27843
  })()
27628
27844
  ] }, `bar-${\u6BB5}`);
27629
27845
  }),
27630
- \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A).map(({ d, idx, x, \u884C }) => {
27846
+ \u4E00\u89A7\u306E\u4E26\u3073(data, \u5E2F\u306E\u5DE6, node.w - PAD, \u540D\u524D\u306E\u7D1A, textMetrics).map(({ d, idx, x, \u884C }) => {
27631
27847
  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;
27632
27848
  return /* @__PURE__ */ jsxs("g", { "data-cdl-role": "chart-stacked-bar-legend", children: [
27633
27849
  /* @__PURE__ */ jsx("rect", { x, y: y - 5, width: 10, height: 10, rx: 2, fill: \u5370\u306E\u82723(d.tone, idx) }),
@@ -27662,12 +27878,12 @@ function \u5370\u306E\u82723(tone, idx) {
27662
27878
  }
27663
27879
  var \u5370\u304B\u3089\u540D\u524D\u307E\u3067 = 16;
27664
27880
  var \u4EF6\u306E\u9593 = 10;
27665
- function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A) {
27881
+ function \u4E00\u89A7\u306E\u4E26\u3073(data, \u5DE6, \u53F3\u7AEF, \u7D1A, textMetrics = "proportional") {
27666
27882
  const out = [];
27667
27883
  let x = \u5DE6;
27668
27884
  let \u884C = 0;
27669
27885
  data.forEach((d, idx) => {
27670
- const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A);
27886
+ const \u5E45 = \u5370\u304B\u3089\u540D\u524D\u307E\u3067 + textWidth(d.label ?? "", \u7D1A, 0, textMetrics);
27671
27887
  if (x > \u5DE6 && x + \u5E45 > \u53F3\u7AEF) {
27672
27888
  \u884C += 1;
27673
27889
  x = \u5DE6;
@@ -27683,7 +27899,8 @@ function ChartSlopeNode({
27683
27899
  active,
27684
27900
  stateValues = {},
27685
27901
  drawing = false,
27686
- progress = 1
27902
+ progress = 1,
27903
+ textMetrics = "proportional"
27687
27904
  }) {
27688
27905
  const x0 = node.cx - node.w / 2;
27689
27906
  const y0 = node.cy - node.h / 2;
@@ -27726,16 +27943,22 @@ function ChartSlopeNode({
27726
27943
  const \u53F3\u306E\u5B57 = \u7CFB\u5217\u305F\u3061.map(
27727
27944
  (s) => \u5F62 === "delta" ? \u5897\u6E1B\u8868\u8A18(s.\u524D, s.\u4ECA) : \u5B9F\u5024\u8868\u8A18(s.\u4ECA)
27728
27945
  );
27729
- const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
27730
- const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A)));
27946
+ const \u5DE6\u5024\u5E45 = Math.max(0, ...\u5DE6\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
27947
+ const \u53F3\u5024\u5E45 = Math.max(0, ...\u53F3\u306E\u5B57.map((t) => textWidth(t, \u5024\u306E\u7D1A, 0, textMetrics)));
27731
27948
  const \u540D\u524D\u306B\u4F7F\u3048\u308B = Math.max(
27732
27949
  0,
27733
27950
  (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
27734
27951
  );
27735
- 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);
27952
+ const \u540D\u524D\u306E\u7D1A = \u53CE\u3081\u308B\u7D1A2(
27953
+ \u7CFB\u5217\u305F\u3061.map((s) => s.\u540D\u524D),
27954
+ \u540D\u524D\u306B\u4F7F\u3048\u308B,
27955
+ \u540D\u524D\u306E\u4E0A\u9650\u7D1A,
27956
+ \u540D\u524D\u306E\u4E0B\u9650\u7D1A,
27957
+ textMetrics
27958
+ );
27736
27959
  const \u540D\u524D\u5E45 = Math.min(
27737
27960
  \u540D\u524D\u306B\u4F7F\u3048\u308B,
27738
- Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A)))
27961
+ Math.max(0, ...\u7CFB\u5217\u305F\u3061.map((s) => textWidth(s.\u540D\u524D, \u540D\u524D\u306E\u7D1A, 0, textMetrics)))
27739
27962
  );
27740
27963
  const \u5DE6\u306E\u4F59\u767D = \u540D\u524D\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u5DE6\u5024\u5E45 + \u8EF8\u304B\u3089\u5024\u307E\u3067;
27741
27964
  const \u53F3\u306E\u4F59\u767D = \u8EF8\u304B\u3089\u5024\u307E\u3067 + \u53F3\u5024\u5E45 + \u5024\u304B\u3089\u540D\u524D\u307E\u3067 + \u540D\u524D\u5E45;
@@ -27921,10 +28144,12 @@ function \u5370\u306E\u82724(tone, idx) {
27921
28144
  if (tone) return TONE[tone];
27922
28145
  return chartSeriesColor(idx);
27923
28146
  }
27924
- function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650) {
28147
+ function \u53CE\u3081\u308B\u7D1A2(\u540D\u524D\u305F\u3061, \u5E45, \u4E0A\u9650, \u4E0B\u9650, textMetrics = "proportional") {
27925
28148
  if (\u540D\u524D\u305F\u3061.length === 0) return \u4E0A\u9650;
27926
28149
  let \u7D1A = \u4E0A\u9650;
27927
- while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A))) > \u5E45) \u7D1A -= 1;
28150
+ while (\u7D1A > \u4E0B\u9650 && Math.max(...\u540D\u524D\u305F\u3061.map((n) => textWidth(n, \u7D1A, 0, textMetrics))) > \u5E45) {
28151
+ \u7D1A -= 1;
28152
+ }
27928
28153
  return \u7D1A;
27929
28154
  }
27930
28155
  function \u5C0F\u6570\u306E\u6841(n) {
@@ -27972,6 +28197,7 @@ function ChartBarNode({
27972
28197
  return { y: yAt(v), value: v };
27973
28198
  });
27974
28199
  const \u6FC3\u3055 = (v) => vMax > 0 ? v >= vMax ? 1 : 0.45 : 0.9;
28200
+ const \u4E3B\u5F79\u306E\u68D2\u304B = (v) => vMax > 0 && v >= vMax;
27975
28201
  const \u89D2\u4E38 = Math.min(barW * 0.06, 8);
27976
28202
  const \u4F38\u3073 = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
27977
28203
  const \u6A2A\u8EF8\u306Ey = PAD_TOP2 + canvasH;
@@ -28038,6 +28264,7 @@ function ChartBarNode({
28038
28264
  {
28039
28265
  "data-cdl-role": "chart-bar",
28040
28266
  "data-cdl-unresolved": d.unresolved ? "true" : void 0,
28267
+ "data-cdl-emphasis": \u4E3B\u5F79\u306E\u68D2\u304B(d.value) ? "primary" : void 0,
28041
28268
  x: bx,
28042
28269
  y: by,
28043
28270
  width: barW,
@@ -28384,7 +28611,8 @@ function FunnelNode({
28384
28611
  active,
28385
28612
  stateValues = {},
28386
28613
  drawing = false,
28387
- progress = 1
28614
+ progress = 1,
28615
+ textMetrics = "proportional"
28388
28616
  }) {
28389
28617
  const x0 = node.cx - node.w / 2;
28390
28618
  const y0 = node.cy - node.h / 2;
@@ -28433,7 +28661,11 @@ function FunnelNode({
28433
28661
  const \u540D\u524D\u306E\u5B9F\u5B57 = \u540D\u524D\u306E\u5B57 * \u7E26\u500D;
28434
28662
  const \u88DC\u8DB3\u306E\u67A0\u5B57 = \u88DC\u8DB3\u306E\u5B57 * \u7E26\u500D;
28435
28663
  const \u53CE\u307E\u308B\u5E45 = Math.max(0, bottomW - 16);
28436
- 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);
28664
+ const \u88DC\u8DB3\u306E\u5B9F\u5B57 = \u88DC\u8DB3\u306E\u67A0\u5B57 * \u53CE\u3081\u308B\u500D\u7387(
28665
+ \u88DC\u8DB3,
28666
+ { fontSize: \u88DC\u8DB3\u306E\u67A0\u5B57, fontWeight: 500, textMetrics },
28667
+ \u53CE\u307E\u308B\u5E45
28668
+ );
28437
28669
  const \u584A\u306E\u4E0A = y + stageH / 2 - (\u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 1.25) / 2;
28438
28670
  const \u540D\u524D\u306Ey = \u88DC\u8DB3\u3042\u308A ? \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 0.95 : y + stageH / 2 + 5;
28439
28671
  const \u88DC\u8DB3\u306Ey = \u584A\u306E\u4E0A + \u540D\u524D\u306E\u5B9F\u5B57 * 1.2 + \u88DC\u8DB3\u306E\u67A0\u5B57 * 0.95;
@@ -28536,7 +28768,8 @@ function \u7573\u3093\u3060\u6587(\u4EF6\u6570) {
28536
28768
  function QuadrantNode({
28537
28769
  node,
28538
28770
  active,
28539
- stateValues = {}
28771
+ stateValues = {},
28772
+ textMetrics = "proportional"
28540
28773
  }) {
28541
28774
  const x0 = node.cx - node.w / 2;
28542
28775
  const y0 = node.cy - node.h / 2;
@@ -28555,7 +28788,10 @@ function QuadrantNode({
28555
28788
  const SUB_FONT = 10;
28556
28789
  const axisLabelPad = (text) => Math.max(
28557
28790
  PAD_MIN,
28558
- measureTextWidth(`\u2190 ${text}`, { fontSize: AXIS_LABEL_FONT}) + 12
28791
+ measureTextWidth(`\u2190 ${text}`, {
28792
+ fontSize: AXIS_LABEL_FONT,
28793
+ textMetrics
28794
+ }) + 12
28559
28795
  );
28560
28796
  const padBudget = Math.max(0, node.w * 0.5 - PAD_MIN * 2);
28561
28797
  const wantLeft = axisLabelPad(data.xAxis.left) - PAD_MIN;
@@ -28809,7 +29045,11 @@ function QuadrantNode({
28809
29045
  ITEM_MIN_W,
28810
29046
  Math.max(
28811
29047
  ...\u884C\u30892.map(
28812
- (r) => measureTextWidth(r.text, { fontSize: r.size, fontWeight: r.weight })
29048
+ (r) => measureTextWidth(r.text, {
29049
+ fontSize: r.size,
29050
+ fontWeight: r.weight,
29051
+ textMetrics
29052
+ })
28813
29053
  )
28814
29054
  ) + ITEM_PAD_X * 2
28815
29055
  )
@@ -28835,7 +29075,7 @@ function QuadrantNode({
28835
29075
  const \u88DC\u8DB3 = (it.subtitle ?? "").trim();
28836
29076
  const \u88DC\u8DB3\u306E\u5B57 = SUB_FONT * \u53CE\u3081\u308B\u500D\u7387(
28837
29077
  \u88DC\u8DB3,
28838
- { fontSize: SUB_FONT, fontWeight: 500 },
29078
+ { fontSize: SUB_FONT, fontWeight: 500, textMetrics },
28839
29079
  Math.max(0, \u5E45 - ITEM_PAD_X * 2)
28840
29080
  );
28841
29081
  return /* @__PURE__ */ jsxs("g", { children: [
@@ -29239,24 +29479,30 @@ var EYEBROW_GAP2 = 8;
29239
29479
  var EYEBROW_TRACKING = 2;
29240
29480
  var SUB_SIZE = 11;
29241
29481
  var SUB_GAP = 4;
29242
- function labelBlock(node, pos, size, band) {
29482
+ function labelBlock(node, pos, size, band, textMetrics = "proportional") {
29243
29483
  const \u4E0A = node.eyebrow ? size + EYEBROW_GAP2 + EYEBROW_SIZE2 * ASCENT2 : size * ASCENT2;
29244
29484
  const \u4E0B = node.subtitle ? size + SUB_GAP + SUB_SIZE * DESCENT2 : size * DESCENT2;
29245
29485
  const \u5E45 = Math.max(
29246
- textWidth(node.title ?? "", size),
29247
- node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING) : 0,
29248
- node.subtitle ? textWidth(node.subtitle, SUB_SIZE) : 0
29486
+ textWidth(node.title ?? "", size, 0, textMetrics),
29487
+ node.eyebrow ? textWidth(node.eyebrow, EYEBROW_SIZE2, EYEBROW_TRACKING, textMetrics) : 0,
29488
+ node.subtitle ? textWidth(node.subtitle, SUB_SIZE, 0, textMetrics) : 0
29249
29489
  );
29250
- const \u984C\u5E45 = textWidth(node.title ?? "", size);
29251
- const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, textWidth) : 0;
29490
+ const \u984C\u5E45 = textWidth(node.title ?? "", size, 0, textMetrics);
29491
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
29492
+ const \u4E0B\u9650 = \u984C\u5E45 >= \u5E45 ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(node.title ?? "", size, 0, band.w, \u6E2C\u308B) : 0;
29252
29493
  const { k, x, y: baseline } = fitLabel(band, { \u4E0A, \u4E0B, \u5E45 }, pos, \u4E0B\u9650);
29253
29494
  return { k, x, baseline, \u4E0A\u7AEF: baseline - \u4E0A * k, \u4E0B\u7AEF: baseline + \u4E0B * k };
29254
29495
  }
29255
- function commonLabel(node, pos, size, band) {
29256
- const \u584A = labelBlock(node, pos, size, band);
29496
+ function commonLabel(node, pos, size, band, textMetrics = "proportional") {
29497
+ const \u584A = labelBlock(node, pos, size, band, textMetrics);
29257
29498
  const k = \u584A.k;
29258
29499
  const x = \u584A.x;
29259
- 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));
29500
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
29501
+ t,
29502
+ \u5927\u304D\u3055 * k,
29503
+ band.w,
29504
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
29505
+ );
29260
29506
  return /* @__PURE__ */ jsxs(Fragment, { children: [
29261
29507
  node.eyebrow && /* @__PURE__ */ jsx(
29262
29508
  "text",
@@ -29307,7 +29553,7 @@ var RULE_GAP_RATIO = 0.1;
29307
29553
  var RULE_PAD_MAX = 20;
29308
29554
  var RULE_PAD_RATIO = 0.14;
29309
29555
  var RULE_SHRINK_RATIO = 0.055;
29310
- function ShapeFileNode({ node, active }) {
29556
+ function ShapeFileNode({ node, active, textMetrics = "proportional" }) {
29311
29557
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29312
29558
  const \u7D19h = \u5E2F.h;
29313
29559
  const \u7D19w = Math.min(\u5E2F.w, \u7D19h * 0.72);
@@ -29327,7 +29573,7 @@ function ShapeFileNode({ node, active }) {
29327
29573
  const foldTriangle = `M ${x + \u7D19w - fold} ${y} L ${x + \u7D19w} ${y + fold} L ${x + \u7D19w - fold} ${y + fold} Z`;
29328
29574
  const \u540D\u524D\u5E2F = { x, y, w: \u7D19w, h: \u7D19h };
29329
29575
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + node.h * 0.12 };
29330
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F);
29576
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics);
29331
29577
  const \u9593\u9694 = Math.min(RULE_GAP_MAX, \u7D19h * RULE_GAP_RATIO);
29332
29578
  const \u7DDA\u4F59\u767D = Math.min(RULE_PAD_MAX, \u7D19w * RULE_PAD_RATIO);
29333
29579
  const textLines = [0, 1, 2].map((i) => ({ i, ly: y + fold + \u9593\u9694 * (i + 1) })).filter(({ ly }) => ly < \u540D\u524D.\u4E0A\u7AEF);
@@ -29359,12 +29605,12 @@ function ShapeFileNode({ node, active }) {
29359
29605
  i
29360
29606
  );
29361
29607
  }),
29362
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F)
29608
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u540D\u524D\u5E2F, textMetrics)
29363
29609
  ] });
29364
29610
  }
29365
29611
  var TAB_H_MAX = 22;
29366
29612
  var TAB_H_RATIO = 0.3;
29367
- function ShapeFolderNode({ node, active }) {
29613
+ function ShapeFolderNode({ node, active, textMetrics = "proportional" }) {
29368
29614
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29369
29615
  const x = \u5E2F.x;
29370
29616
  const y = \u5E2F.y;
@@ -29385,7 +29631,7 @@ function ShapeFolderNode({ node, active }) {
29385
29631
  const \u5883\u754Cy = y + tabH + Math.min(8, (\u5E2F.h - tabH) * 0.2);
29386
29632
  const \u7AEF = Math.min(6, \u5E2F.w * 0.1);
29387
29633
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 18 };
29388
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F);
29634
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics);
29389
29635
  return /* @__PURE__ */ jsxs("g", { children: [
29390
29636
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, \u5E2F.w * 0.44),
29391
29637
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -29401,13 +29647,13 @@ function ShapeFolderNode({ node, active }) {
29401
29647
  opacity: 0.35
29402
29648
  }
29403
29649
  ),
29404
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F)
29650
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 16, \u5E2F, textMetrics)
29405
29651
  ] });
29406
29652
  }
29407
29653
  var CLOUD_VB_W = 640;
29408
29654
  var CLOUD_VB_H = 512;
29409
29655
  var CLOUD_W_RATIO = 0.9;
29410
- function ShapeCloudNode({ node, active }) {
29656
+ function ShapeCloudNode({ node, active, textMetrics = "proportional" }) {
29411
29657
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29412
29658
  const frame = commonFrame(active);
29413
29659
  const \u7D20\u306E\u500D\u7387 = Math.min(\u5E2F.h / CLOUD_VB_H, \u5E2F.w * CLOUD_W_RATIO / CLOUD_VB_W);
@@ -29430,13 +29676,13 @@ function ShapeCloudNode({ node, active }) {
29430
29676
  strokeLinejoin: "round"
29431
29677
  }
29432
29678
  ) }),
29433
- commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F)
29679
+ commonLabel(node, { x: \u5E2F.cx, y: node.cy + node.h * 0.05 }, 16, \u5E2F, textMetrics)
29434
29680
  ] });
29435
29681
  }
29436
29682
  var CYLINDER_RY_MAX = 18;
29437
29683
  var CYLINDER_RY_RATIO = 0.1;
29438
29684
  var CYLINDER_DISKS = [0.3, 0.55, 0.8];
29439
- function ShapeCylinderNode({ node, active }) {
29685
+ function ShapeCylinderNode({ node, active, textMetrics = "proportional" }) {
29440
29686
  const \u5E2F = bodyBand(node, { \u5F71ry: CYLINDER_SHADOW_RY });
29441
29687
  const x = \u5E2F.x;
29442
29688
  const y = \u5E2F.y;
@@ -29453,7 +29699,7 @@ function ShapeCylinderNode({ node, active }) {
29453
29699
  const \u84CB\u5E95 = y + ry * 2;
29454
29700
  const \u540D\u524D\u4F4D\u7F6E = { x: \u5E2F.cx, y: node.cy + 6 };
29455
29701
  const \u540D\u524D\u5E2F = { x: \u5E2F.x, y: \u84CB\u5E95, w: \u5E2F.w, h: Math.max(0, \u5E2F.\u5E95 - \u84CB\u5E95) };
29456
- const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F);
29702
+ const \u540D\u524D = labelBlock(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics);
29457
29703
  return /* @__PURE__ */ jsxs("g", { children: [
29458
29704
  dropShadow(\u5E2F.cx, \u5E2F.\u5E95, rx * 0.85, CYLINDER_SHADOW_RY),
29459
29705
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: bodyPath, ...frame, strokeLinejoin: "round" }),
@@ -29477,11 +29723,11 @@ function ShapeCylinderNode({ node, active }) {
29477
29723
  },
29478
29724
  i
29479
29725
  )),
29480
- commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F)
29726
+ commonLabel(node, \u540D\u524D\u4F4D\u7F6E, 15, \u540D\u524D\u5E2F, textMetrics)
29481
29727
  ] });
29482
29728
  }
29483
29729
  var HEX_DOT_R = 2.5;
29484
- function ShapeHexagonNode({ node, active }) {
29730
+ function ShapeHexagonNode({ node, active, textMetrics = "proportional" }) {
29485
29731
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY, \u5916: Math.max(HEX_DOT_R, FRAME_HALF) });
29486
29732
  const cx = \u5E2F.cx;
29487
29733
  const cy = \u5E2F.cy;
@@ -29504,11 +29750,12 @@ function ShapeHexagonNode({ node, active }) {
29504
29750
  node,
29505
29751
  { x: cx, y: node.cy + 6 },
29506
29752
  16,
29507
- { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h }
29753
+ { x: \u5E2F.x + cut, y: \u5E2F.y, w: Math.max(0, \u5E2F.w - cut * 2), h: \u5E2F.h },
29754
+ textMetrics
29508
29755
  )
29509
29756
  ] });
29510
29757
  }
29511
- function ShapeDiamondNode({ node, active }) {
29758
+ function ShapeDiamondNode({ node, active, textMetrics = "proportional" }) {
29512
29759
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29513
29760
  const cx = \u5E2F.cx;
29514
29761
  const cy = \u5E2F.cy;
@@ -29549,13 +29796,14 @@ function ShapeDiamondNode({ node, active }) {
29549
29796
  y: cy - \u5E2F.h * innerScale / 4,
29550
29797
  w: \u5E2F.w * innerScale / 2,
29551
29798
  h: \u5E2F.h * innerScale / 2
29552
- }
29799
+ },
29800
+ textMetrics
29553
29801
  )
29554
29802
  ] });
29555
29803
  }
29556
29804
  var STACK_OFFSET_MAX = 12;
29557
29805
  var STACK_OFFSET_RATIO = 0.15;
29558
- function ShapeStackNode({ node, active }) {
29806
+ function ShapeStackNode({ node, active, textMetrics = "proportional" }) {
29559
29807
  const \u5E2F = bodyBand(node, { \u5F71ry: SHADOW_RY });
29560
29808
  const x = \u5E2F.x;
29561
29809
  const y = \u5E2F.y;
@@ -29609,7 +29857,8 @@ function ShapeStackNode({ node, active }) {
29609
29857
  node,
29610
29858
  { x: \u624B\u524Dcx, y: node.cy + \u305A\u308C + 6 },
29611
29859
  15,
29612
- { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH }
29860
+ { x, y: y + \u305A\u308C * 2, w: cardW, h: cardH },
29861
+ textMetrics
29613
29862
  )
29614
29863
  ] });
29615
29864
  }
@@ -29621,16 +29870,22 @@ var PERSON_BODY_LEN = 90;
29621
29870
  var PERSON_SHADOW_DY = 20;
29622
29871
  var PERSON_SHADOW_RY = 4;
29623
29872
  var PERSON_SHADOW_RX = 55;
29624
- function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
29873
+ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan, textMetrics = "proportional") {
29625
29874
  const \u5E45 = Math.max(
29626
- textWidth(node.title ?? "", plan.\u540D\u524D.size),
29627
- node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING) : 0,
29628
- node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size) : 0
29875
+ textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics),
29876
+ node.eyebrow && plan.\u80A9\u66F8 ? textWidth(node.eyebrow, plan.\u80A9\u66F8.size, EYEBROW_TRACKING, textMetrics) : 0,
29877
+ node.subtitle && plan.\u8AAC\u660E ? textWidth(node.subtitle, plan.\u8AAC\u660E.size, 0, textMetrics) : 0
29629
29878
  );
29630
- const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size);
29631
- 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;
29879
+ const \u984C\u5E45 = textWidth(node.title ?? "", plan.\u540D\u524D.size, 0, textMetrics);
29880
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
29881
+ 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;
29632
29882
  const k = \u5E45 > 0 && \u5E45\u4E0A\u9650 > 0 ? Math.min(1, Math.max(\u5E45\u4E0A\u9650 / \u5E45, \u4E0B\u9650)) : 1;
29633
- 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));
29883
+ const \u5207\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593 = 0) => \u5E2F\u3067\u5207\u308B(
29884
+ t,
29885
+ \u5927\u304D\u3055 * k,
29886
+ \u5E45\u4E0A\u9650,
29887
+ (u, f) => textWidth(u, f, \u5B57\u9593 * k, textMetrics)
29888
+ );
29634
29889
  return /* @__PURE__ */ jsxs(Fragment, { children: [
29635
29890
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsx(
29636
29891
  "text",
@@ -29671,7 +29926,7 @@ function planLabel(node, cx, \u5E45\u4E0A\u9650, plan) {
29671
29926
  )
29672
29927
  ] });
29673
29928
  }
29674
- function ShapePersonNode({ node, active }) {
29929
+ function ShapePersonNode({ node, active, textMetrics = "proportional" }) {
29675
29930
  const r = shapeRegion(node);
29676
29931
  const cx = r.cx;
29677
29932
  const strokeColor = active ? "var(--cdl-tone-accent, #2d6a8f)" : "var(--cdl-divider, #d4d4d8)";
@@ -29733,7 +29988,7 @@ function ShapePersonNode({ node, active }) {
29733
29988
  )
29734
29989
  ] })
29735
29990
  ),
29736
- planLabel(node, r.cx, Math.max(0, node.w), r.label)
29991
+ planLabel(node, r.cx, Math.max(0, node.w), r.label, textMetrics)
29737
29992
  ] });
29738
29993
  }
29739
29994
  var commonFrame2 = (active) => ({
@@ -29983,7 +30238,12 @@ function ShapeTerminalNode({ node, active, lang }) {
29983
30238
  )
29984
30239
  ] });
29985
30240
  }
29986
- function ShapeCodeBlockNode({ node, active, lang }) {
30241
+ function ShapeCodeBlockNode({
30242
+ node,
30243
+ active,
30244
+ lang,
30245
+ textMetrics = "proportional"
30246
+ }) {
29987
30247
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
29988
30248
  const frame = commonFrame2(active);
29989
30249
  const \u7DDA = frame.strokeWidth / 2;
@@ -29994,7 +30254,10 @@ function ShapeCodeBlockNode({ node, active, lang }) {
29994
30254
  const lineFont = "ui-monospace, SFMono-Regular, Menlo, monospace";
29995
30255
  const \u672D = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("codeBlock.fileName"));
29996
30256
  const \u672D\u306E\u5B57 = 11;
29997
- const \u30BF\u30D6\u5E45 = Math.min(Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0) + 24), Math.max(0, w));
30257
+ const \u30BF\u30D6\u5E45 = Math.min(
30258
+ Math.max(100, textWidth(\u672D, \u672D\u306E\u5B57, 0, textMetrics) + 24),
30259
+ Math.max(0, w)
30260
+ );
29998
30261
  const \u30BF\u30D6\u9AD8 = 24;
29999
30262
  const \u89D2 = 10;
30000
30263
  const \u6E9D = 32;
@@ -30034,7 +30297,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
30034
30297
  { text: \u672D, size: \u672D\u306E\u5B57, \u5E2F: { \u5E45: \u30BF\u30D6\u5E45, \u9AD8\u3055: \u30BF\u30D6\u9AD8 } },
30035
30298
  { text: "1", size: \u884C\u756A\u53F7\u306E\u5B57, \u5E2F: { \u5E45: \u6E9D - \u6301\u3061\u4E0A\u3052, \u9AD8\u3055: \u884C\u9593 } }
30036
30299
  ];
30037
- const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089);
30300
+ const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
30038
30301
  const tabW = \u30BF\u30D6\u5E45 * \u500D;
30039
30302
  const tabH = \u30BF\u30D6\u9AD8 * \u500D;
30040
30303
  const \u4E38 = \u89D2 * \u500D;
@@ -30073,7 +30336,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
30073
30336
  "data-cdl-counter-scaled": "1",
30074
30337
  x: x + tabW / 2,
30075
30338
  y: y + tabH / 2 + 4 * \u500D,
30076
- fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW),
30339
+ fontSize: \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057 * \u5E45\u306E\u500D\u7387(\u672D, \u672D\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057, 0, tabW, textMetrics),
30077
30340
  fontFamily: lineFont,
30078
30341
  textAnchor: "middle",
30079
30342
  fill: "#e6edf3",
@@ -30155,7 +30418,12 @@ function ShapeCodeBlockNode({ node, active, lang }) {
30155
30418
  )
30156
30419
  ] });
30157
30420
  }
30158
- function ShapeKanbanCardNode({ node, active, lang }) {
30421
+ function ShapeKanbanCardNode({
30422
+ node,
30423
+ active,
30424
+ lang,
30425
+ textMetrics = "proportional"
30426
+ }) {
30159
30427
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
30160
30428
  const frame = commonFrame2(active);
30161
30429
  const \u7DDA = frame.strokeWidth / 2;
@@ -30209,7 +30477,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
30209
30477
  );
30210
30478
  const \u8AAC\u660E = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.subtitle, \u5B57\u5F15("kanbanCard.task"));
30211
30479
  const \u72B6\u614B = \u66F8\u3044\u305F\u5024\u304B\u63A7\u3048(node.eyebrow, \u5B57\u5F15("kanbanCard.status"));
30212
- const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45);
30480
+ const \u72B6\u614B\u306E\u500D\u7387 = \u5E45\u306E\u500D\u7387(\u72B6\u614B, PILL\u5B57, PILL\u5B57\u9593, PILL\u5B57\u5E45, textMetrics);
30213
30481
  const \u8AAC\u660E\u306E\u5B57 = \u540D\u524D.size * \u8AAC\u660E\u5B57\u6BD4;
30214
30482
  const \u4F7F\u3048\u308B\u5E452 = Math.max(0, w - \u5DE6\u53F3\u4F59\u767D * \u500D * 2);
30215
30483
  return /* @__PURE__ */ jsxs("g", { children: [
@@ -30296,7 +30564,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
30296
30564
  {
30297
30565
  x: x + w / 2,
30298
30566
  y: \u540D\u524D.y + \u540D\u524D.size * \u8AAC\u660E\u57FA\u6E96\u6BD4,
30299
- fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452),
30567
+ fontSize: \u8AAC\u660E\u306E\u5B57 * \u5E45\u306E\u500D\u7387(\u8AAC\u660E, \u8AAC\u660E\u306E\u5B57, 0, \u4F7F\u3048\u308B\u5E452, textMetrics),
30300
30568
  textAnchor: "middle",
30301
30569
  fill: "var(--cdl-text-dim, #5a6270)",
30302
30570
  children: \u8AAC\u660E
@@ -30587,18 +30855,33 @@ var externalLabel = (node, cx, bottomY) => /* @__PURE__ */ jsxs(Fragment, { chil
30587
30855
  )
30588
30856
  ] });
30589
30857
  var LABEL_EYEBROW_SPACING = 2;
30590
- function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
30591
- const \u5E45 = textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
30592
- 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;
30858
+ function \u5E45\u306B\u53CE\u3081\u308B2(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
30859
+ const \u6E2C\u308B = (t, s, ls) => textWidth(t, s, ls, textMetrics);
30860
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
30861
+ 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;
30593
30862
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
30594
30863
  const size = \u5927\u304D\u3055 * \u500D\u7387;
30595
30864
  const spacing = \u5B57\u9593 * \u500D\u7387;
30596
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => textWidth(u, f, spacing)) };
30597
- }
30598
- function bottomLabel(node, cx, plan) {
30599
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING, node.w);
30600
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
30601
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
30865
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
30866
+ }
30867
+ function bottomLabel(node, cx, plan, textMetrics = "proportional") {
30868
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B2(
30869
+ node.eyebrow ?? "",
30870
+ plan.\u80A9\u66F8?.size ?? 0,
30871
+ LABEL_EYEBROW_SPACING,
30872
+ node.w,
30873
+ false,
30874
+ textMetrics
30875
+ );
30876
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B2(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
30877
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B2(
30878
+ node.subtitle ?? "",
30879
+ plan.\u8AAC\u660E?.size ?? 0,
30880
+ 0,
30881
+ node.w,
30882
+ false,
30883
+ textMetrics
30884
+ );
30602
30885
  return /* @__PURE__ */ jsxs(Fragment, { children: [
30603
30886
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
30604
30887
  /* @__PURE__ */ jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
@@ -30612,7 +30895,7 @@ var RACK_SLOT_N = 4;
30612
30895
  var RACK_BOTTOM = 8;
30613
30896
  var RACK_H = RACK_SLOT_TOP + RACK_SLOT_N * RACK_SLOT_H + (RACK_SLOT_N - 1) * RACK_SLOT_GAP + RACK_BOTTOM;
30614
30897
  var RACK_W_MIN = 120;
30615
- function ShapeServerRackNode({ node, active }) {
30898
+ function ShapeServerRackNode({ node, active, textMetrics = "proportional" }) {
30616
30899
  const r = shapeRegion(node);
30617
30900
  const frame = commonFrame3(active);
30618
30901
  const \u7DDA = frame.strokeWidth / 2;
@@ -30694,7 +30977,7 @@ function ShapeServerRackNode({ node, active }) {
30694
30977
  ] }, i);
30695
30978
  })
30696
30979
  ] })),
30697
- bottomLabel(node, r.cx, r.label)
30980
+ bottomLabel(node, r.cx, r.label, textMetrics)
30698
30981
  ] });
30699
30982
  }
30700
30983
  var HUB_R = 30;
@@ -30702,7 +30985,7 @@ var ARM_LEN = 68;
30702
30985
  var END_R = 7;
30703
30986
  var WIFI_ARC_R = [10, 16, 22];
30704
30987
  var WIFI_BASE_Y = 5;
30705
- function ShapeNetworkNodeNode({ node, active }) {
30988
+ function ShapeNetworkNodeNode({ node, active, textMetrics = "proportional" }) {
30706
30989
  const r = shapeRegion(node);
30707
30990
  const cx = r.cx;
30708
30991
  const cy = r.cy;
@@ -30778,12 +31061,12 @@ function ShapeNetworkNodeNode({ node, active }) {
30778
31061
  )),
30779
31062
  /* @__PURE__ */ jsx("circle", { cx, cy: cy + WIFI_BASE_Y + 3, r: 2.5, fill: "var(--cdl-tone-accent, #2d6a8f)", stroke: "none" })
30780
31063
  ] })),
30781
- bottomLabel(node, r.cx, r.label)
31064
+ bottomLabel(node, r.cx, r.label, textMetrics)
30782
31065
  ] });
30783
31066
  }
30784
31067
  var PHONE_H = 240;
30785
31068
  var PHONE_W = 110;
30786
- function ShapeMobileDeviceNode({ node, active }) {
31069
+ function ShapeMobileDeviceNode({ node, active, textMetrics = "proportional" }) {
30787
31070
  const r = shapeRegion(node);
30788
31071
  const frame = commonFrame3(active);
30789
31072
  const \u7DDA = frame.strokeWidth / 2;
@@ -30850,7 +31133,7 @@ function ShapeMobileDeviceNode({ node, active }) {
30850
31133
  }
30851
31134
  )
30852
31135
  ] })),
30853
- bottomLabel(node, r.cx, r.label)
31136
+ bottomLabel(node, r.cx, r.label, textMetrics)
30854
31137
  ] });
30855
31138
  }
30856
31139
  function ShapeIotSensorNode({ node, active }) {
@@ -31121,7 +31404,7 @@ var SAT_DISH_R = 12;
31121
31404
  var SAT_DISH_STEM = 12;
31122
31405
  var SAT_MAST_LEN = 22;
31123
31406
  var SAT_MAST_TIP_R = 4;
31124
- function ShapeSatelliteNode({ node, active }) {
31407
+ function ShapeSatelliteNode({ node, active, textMetrics = "proportional" }) {
31125
31408
  const r = shapeRegion(node);
31126
31409
  const cx = r.cx;
31127
31410
  const cy = r.cy;
@@ -31310,7 +31593,7 @@ function ShapeSatelliteNode({ node, active }) {
31310
31593
  ),
31311
31594
  /* @__PURE__ */ jsx("circle", { cx, cy: cy - bodyH / 2 - SAT_MAST_LEN, r: 2, fill: "#ff5f56", stroke: "none", children: /* @__PURE__ */ jsx("animate", { attributeName: "opacity", values: "0.4;1;0.4", dur: "1.4s", repeatCount: "indefinite" }) })
31312
31595
  ] })),
31313
- bottomLabel(node, r.cx, r.label)
31596
+ bottomLabel(node, r.cx, r.label, textMetrics)
31314
31597
  ] });
31315
31598
  }
31316
31599
  var FRAME_SW_ACTIVE = 3;
@@ -31396,9 +31679,9 @@ function blockchainNodeExtent(strokeWidth) {
31396
31679
  const \u6A2A = (NODE_PEER_DIST + NODE_PEER_R) * Math.cos(Math.PI / 6) + \u7DDA;
31397
31680
  return { \u4E0A: \u7E26, \u4E0B: \u7E26, \u5DE6: \u6A2A, \u53F3: \u6A2A };
31398
31681
  }
31399
- function bottomLabel2(node, cx, plan) {
31682
+ function bottomLabel2(node, cx, plan, textMetrics = "proportional") {
31400
31683
  const \u53CE\u3081\u308B = (t, \u5927\u304D\u3055, \u5B57\u9593, \u984C\u304B = false) => {
31401
- const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f) + ls * [...u].length;
31684
+ const \u6E2C\u308B = (u, f, ls) => \u5B57\u306E\u5E45(u, f, textMetrics) + ls * [...u].length;
31402
31685
  const \u7D20\u306E\u5E45 = \u6E2C\u308B(t, \u5927\u304D\u3055, \u5B57\u9593);
31403
31686
  const \u53CE\u307E\u308B = \u7D20\u306E\u5E45 > node.w && node.w > 0 ? node.w / \u7D20\u306E\u5E45 : 1;
31404
31687
  const \u4E0B\u9650 = \u984C\u304B ? \u5207\u3063\u3066\u53CE\u307E\u308B\u4E0B\u9650(t, \u5927\u304D\u3055, \u5B57\u9593, node.w, \u6E2C\u308B) : 0;
@@ -31431,7 +31714,12 @@ function EthereumDiamond({ cx, cy, h, colors }) {
31431
31714
  /* @__PURE__ */ jsx("path", { d: `M ${cx} ${midY} L ${cx + w} ${cy + h * 0.05} L ${cx} ${lowerBotY} Z`, fill: c.dark, stroke: c.stroke, strokeWidth: 0.6, strokeLinejoin: "round" })
31432
31715
  ] });
31433
31716
  }
31434
- function ShapeSmartContractNode({ node, active, lang }) {
31717
+ function ShapeSmartContractNode({
31718
+ node,
31719
+ active,
31720
+ lang,
31721
+ textMetrics = "proportional"
31722
+ }) {
31435
31723
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
31436
31724
  const frame = commonFrame4(active);
31437
31725
  const r = shapeRegion(node);
@@ -31472,7 +31760,7 @@ function ShapeSmartContractNode({ node, active, lang }) {
31472
31760
  }
31473
31761
  ];
31474
31762
  const art = (\u500D\u7387) => {
31475
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
31763
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31476
31764
  return /* @__PURE__ */ jsxs("g", { children: [
31477
31765
  /* @__PURE__ */ jsx("path", { "data-cdl-role": "node-body", d: path, ...frame, strokeLinejoin: "round" }),
31478
31766
  /* @__PURE__ */ jsx("path", { d: foldPath, fill: "none", stroke: frame.stroke, strokeWidth: frame.strokeWidth, strokeLinejoin: "round" }),
@@ -31494,10 +31782,10 @@ function ShapeSmartContractNode({ node, active, lang }) {
31494
31782
  };
31495
31783
  return /* @__PURE__ */ jsxs("g", { children: [
31496
31784
  fitArt(r, smartContractExtent(frame.strokeWidth), art),
31497
- bottomLabel2(node, r.cx, r.label)
31785
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31498
31786
  ] });
31499
31787
  }
31500
- var \u5B57\u306E\u5E45 = (text, size) => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size);
31788
+ var \u5B57\u306E\u5E45 = (text, size, textMetrics = "proportional") => \u7D75\u306E\u4E2D\u306E\u5B57\u306E\u5E45(text, size, 0, textMetrics);
31501
31789
  var BLOCK_DEFAULT_FIELDS = [
31502
31790
  { key: "hash", label: "blockchainBlock.hash", value: { text: "0xaf31..." } },
31503
31791
  { key: "prev", label: "blockchainBlock.prev", value: { text: "0x7b3f..." } },
@@ -31505,10 +31793,16 @@ var BLOCK_DEFAULT_FIELDS = [
31505
31793
  { key: "nonce", label: "blockchainBlock.nonce", value: { text: "82,914" } },
31506
31794
  { key: "tx", label: "blockchainBlock.tx", value: { \u8F9E\u66F8: "blockchainBlock.txCount" } }
31507
31795
  ];
31508
- function ShapeBlockchainBlockNode({ node, active, lang }) {
31796
+ function ShapeBlockchainBlockNode({
31797
+ node,
31798
+ active,
31799
+ lang,
31800
+ textMetrics = "proportional"
31801
+ }) {
31509
31802
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
31510
31803
  const frame = commonFrame4(active);
31511
31804
  const r = shapeRegion(node);
31805
+ const \u6E2C\u308B\u5B57 = (text, size) => \u5B57\u306E\u5E45(text, size, textMetrics);
31512
31806
  const bw = BLOCK_W;
31513
31807
  const bh = BLOCK_H;
31514
31808
  const cx = r.cx;
@@ -31529,9 +31823,9 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31529
31823
  const \u5E2F\u306E\u6B8B\u308A = bw - 14 - 30;
31530
31824
  const \u80A9\u66F8\u306E\u9699\u9593 = 8;
31531
31825
  const \u80A9\u66F8\u306E\u4E0A\u9650 = (\u5E2F\u306E\u6B8B\u308A - \u80A9\u66F8\u306E\u9699\u9593) / 2;
31532
- 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);
31826
+ 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);
31533
31827
  const \u80A9\u66F8\u306E\u6307\u5B9A = \u80A9\u66F8\u306E\u5B57 * \u80A9\u66F8\u306E\u500D\u7387;
31534
- const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u5B57\u306E\u5E45(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
31828
+ const \u80A9\u66F8\u306E\u5E45 = \u80A9\u66F8 === "" ? 0 : \u6E2C\u308B\u5B57(\u80A9\u66F8, \u80A9\u66F8\u306E\u6307\u5B9A);
31535
31829
  const \u898B\u51FA\u3057\u306E\u5E45 = \u5E2F\u306E\u6B8B\u308A - (\u80A9\u66F8 === "" ? 0 : \u80A9\u66F8\u306E\u5E45 + \u80A9\u66F8\u306E\u9699\u9593);
31536
31830
  const \u6253\u3061\u6D88\u3059\u5B57\u3089 = [
31537
31831
  { text: \u898B\u51FA\u3057, size: \u898B\u51FA\u3057\u306E\u5B57, \u5E2F: { \u5E45: \u898B\u51FA\u3057\u306E\u5E45, \u9AD8\u3055: \u898B\u51FA\u3057\u306E\u5E2F } },
@@ -31542,12 +31836,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31542
31836
  {
31543
31837
  text: f.value,
31544
31838
  size: \u5024\u306E\u5B57,
31545
- \u5E2F: { \u5E45: bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
31839
+ \u5E2F: { \u5E45: bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5B57) - 8, \u9AD8\u3055: \u884C\u306E\u9593\u9694 }
31546
31840
  }
31547
31841
  ])
31548
31842
  ];
31549
31843
  const art = (\u500D\u7387) => {
31550
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
31844
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31551
31845
  const \u984C\u306E\u5927\u304D\u3055 = \u898B\u51FA\u3057\u306E\u5B57 * \u500D;
31552
31846
  const \u80A9\u66F8\u306E\u5927\u304D\u3055 = \u80A9\u66F8\u306E\u6307\u5B9A * \u500D;
31553
31847
  const \u540D\u306E\u5927\u304D\u3055 = \u540D\u306E\u5B57 * \u500D;
@@ -31556,7 +31850,7 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31556
31850
  /* @__PURE__ */ jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
31557
31851
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
31558
31852
  /* @__PURE__ */ jsx("path", { d: `M ${x} ${y + 32} L ${x} ${y + 8} Q ${x} ${y}, ${x + 8} ${y} L ${x + bw - 8} ${y} Q ${x + bw} ${y}, ${x + bw} ${y + 8} L ${x + bw} ${y + 32} Z`, fill: "var(--cdl-tone-accent, #2d6a8f)", fillOpacity: 0.9, stroke: "none" }),
31559
- /* @__PURE__ */ jsx("text", { "data-cdl-role": "blockchain-block-title", "data-cdl-counter-scaled": "1", x: x + 14, y: y + 22, fontSize: \u984C\u306E\u5927\u304D\u3055, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, \u984C\u306E\u5927\u304D\u3055, \u898B\u51FA\u3057\u306E\u5E45, \u5B57\u306E\u5E45) }),
31853
+ /* @__PURE__ */ jsx("text", { "data-cdl-role": "blockchain-block-title", "data-cdl-counter-scaled": "1", x: x + 14, y: y + 22, fontSize: \u984C\u306E\u5927\u304D\u3055, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, \u984C\u306E\u5927\u304D\u3055, \u898B\u51FA\u3057\u306E\u5E45, \u6E2C\u308B\u5B57) }),
31560
31854
  \u80A9\u66F8 !== "" && /* @__PURE__ */ jsx(
31561
31855
  "text",
31562
31856
  {
@@ -31576,7 +31870,12 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31576
31870
  /* @__PURE__ */ jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
31577
31871
  fields.map((f, i) => /* @__PURE__ */ jsxs("g", { children: [
31578
31872
  /* @__PURE__ */ jsx("text", { "data-cdl-counter-scaled": "1", x: x + 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u540D\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "var(--cdl-text-dim, #5a6270)", children: f.label }),
31579
- /* @__PURE__ */ jsx("text", { "data-cdl-role": `blockchain-block-${f.key}`, "data-cdl-counter-scaled": "1", x: x + bw - 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u5024\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(f.value, \u5024\u306E\u5927\u304D\u3055, bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5927\u304D\u3055) - 8, \u5B57\u306E\u5E45) }),
31873
+ /* @__PURE__ */ jsx("text", { "data-cdl-role": `blockchain-block-${f.key}`, "data-cdl-counter-scaled": "1", x: x + bw - 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u5024\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(
31874
+ f.value,
31875
+ \u5024\u306E\u5927\u304D\u3055,
31876
+ bw - 28 - \u6E2C\u308B\u5B57(f.label, \u540D\u306E\u5927\u304D\u3055) - 8,
31877
+ \u6E2C\u308B\u5B57
31878
+ ) }),
31580
31879
  /* @__PURE__ */ jsx("line", { x1: x + 14, y1: y + 60 + i * \u884C\u306E\u9593\u9694, x2: x + bw - 14, y2: y + 60 + i * \u884C\u306E\u9593\u9694, stroke: "var(--cdl-divider, #d4d4d8)", strokeWidth: 0.5, opacity: 0.5 })
31581
31880
  ] }, i)),
31582
31881
  /* @__PURE__ */ jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
@@ -31588,7 +31887,11 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
31588
31887
  };
31589
31888
  return /* @__PURE__ */ jsx("g", { children: fitArt(r, blockchainBlockExtent(frame.strokeWidth), art) });
31590
31889
  }
31591
- function ShapeBlockchainNode({ node, active }) {
31890
+ function ShapeBlockchainNode({
31891
+ node,
31892
+ active,
31893
+ textMetrics = "proportional"
31894
+ }) {
31592
31895
  const frame = commonFrame4(active);
31593
31896
  const r = shapeRegion(node);
31594
31897
  const cx = r.cx;
@@ -31604,7 +31907,7 @@ function ShapeBlockchainNode({ node, active }) {
31604
31907
  { text: "0x\u2026", size: CHAIN_HASH_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: CHAIN_ROW_GAP } }
31605
31908
  ];
31606
31909
  const art = (\u500D\u7387) => {
31607
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
31910
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31608
31911
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
31609
31912
  const bx = startX + i * (blockW + linkW);
31610
31913
  const isCurrent = i === blockCount - 1;
@@ -31640,10 +31943,14 @@ function ShapeBlockchainNode({ node, active }) {
31640
31943
  };
31641
31944
  return /* @__PURE__ */ jsxs("g", { children: [
31642
31945
  fitArt(r, chainExtent(), art),
31643
- bottomLabel2(node, r.cx, r.label)
31946
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31644
31947
  ] });
31645
31948
  }
31646
- function ShapeBitcoinChainNode({ node, active }) {
31949
+ function ShapeBitcoinChainNode({
31950
+ node,
31951
+ active,
31952
+ textMetrics = "proportional"
31953
+ }) {
31647
31954
  const frame = commonFrame4(active);
31648
31955
  const r = shapeRegion(node);
31649
31956
  const cx = r.cx;
@@ -31659,7 +31966,7 @@ function ShapeBitcoinChainNode({ node, active }) {
31659
31966
  { text: "#820", size: BTC_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
31660
31967
  ];
31661
31968
  const art = (\u500D\u7387) => {
31662
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
31969
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31663
31970
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
31664
31971
  const bx = startX + i * (blockW + linkW);
31665
31972
  const isCurrent = i === blockCount - 1;
@@ -31690,10 +31997,14 @@ function ShapeBitcoinChainNode({ node, active }) {
31690
31997
  };
31691
31998
  return /* @__PURE__ */ jsxs("g", { children: [
31692
31999
  fitArt(r, chainExtent(), art),
31693
- bottomLabel2(node, r.cx, r.label)
32000
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31694
32001
  ] });
31695
32002
  }
31696
- function ShapeEthereumChainNode({ node, active }) {
32003
+ function ShapeEthereumChainNode({
32004
+ node,
32005
+ active,
32006
+ textMetrics = "proportional"
32007
+ }) {
31697
32008
  const frame = commonFrame4(active);
31698
32009
  const r = shapeRegion(node);
31699
32010
  const cx = r.cx;
@@ -31709,7 +32020,7 @@ function ShapeEthereumChainNode({ node, active }) {
31709
32020
  { text: "#214", size: ETH_NO_SIZE, \u5E2F: { \u5E45: CHAIN_TEXT_W, \u9AD8\u3055: 20 } }
31710
32021
  ];
31711
32022
  const art = (\u500D\u7387) => {
31712
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
32023
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31713
32024
  return /* @__PURE__ */ jsx("g", { children: Array.from({ length: blockCount }, (_, i) => i).map((i) => {
31714
32025
  const bx = startX + i * (blockW + linkW);
31715
32026
  const isCurrent = i === blockCount - 1;
@@ -31741,10 +32052,14 @@ function ShapeEthereumChainNode({ node, active }) {
31741
32052
  };
31742
32053
  return /* @__PURE__ */ jsxs("g", { children: [
31743
32054
  fitArt(r, chainExtent(), art),
31744
- bottomLabel2(node, r.cx, r.label)
32055
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31745
32056
  ] });
31746
32057
  }
31747
- function ShapeBlockchainNodeNode({ node, active }) {
32058
+ function ShapeBlockchainNodeNode({
32059
+ node,
32060
+ active,
32061
+ textMetrics = "proportional"
32062
+ }) {
31748
32063
  const frame = commonFrame4(active);
31749
32064
  const r = shapeRegion(node);
31750
32065
  const cx = r.cx;
@@ -31798,10 +32113,15 @@ function ShapeBlockchainNodeNode({ node, active }) {
31798
32113
  ] });
31799
32114
  return /* @__PURE__ */ jsxs("g", { children: [
31800
32115
  fitArt(r, blockchainNodeExtent(frame.strokeWidth), art),
31801
- bottomLabel2(node, r.cx, r.label)
32116
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31802
32117
  ] });
31803
32118
  }
31804
- function ShapeRpcNodeNode({ node, active, lang }) {
32119
+ function ShapeRpcNodeNode({
32120
+ node,
32121
+ active,
32122
+ lang,
32123
+ textMetrics = "proportional"
32124
+ }) {
31805
32125
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
31806
32126
  const frame = commonFrame4(active);
31807
32127
  const r = shapeRegion(node);
@@ -31820,10 +32140,10 @@ function ShapeRpcNodeNode({ node, active, lang }) {
31820
32140
  /* @__PURE__ */ jsx("text", { x: cx, y: cy + 26, fontSize: 11, textAnchor: "middle", fill: "#7a8290", fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", children: "JSON-RPC 2.0" }),
31821
32141
  /* @__PURE__ */ jsx("rect", { x: x + 16, y: y + bh - 24, width: bw - 32, height: 8, rx: 4, fill: "#0f1419", stroke: "none" }),
31822
32142
  /* @__PURE__ */ jsx("rect", { x: x + 16, y: y + bh - 24, width: (bw - 32) * 0.92, height: 8, rx: 4, fill: "#27c93f", stroke: "none", children: /* @__PURE__ */ jsx("animate", { attributeName: "width", values: `${(bw - 32) * 0.86};${(bw - 32) * 0.96};${(bw - 32) * 0.86}`, dur: "3s", repeatCount: "indefinite" }) }),
31823
- bottomLabel2(node, r.cx, r.label)
32143
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31824
32144
  ] });
31825
32145
  }
31826
- function ShapeWalletNode({ node, active }) {
32146
+ function ShapeWalletNode({ node, active, textMetrics = "proportional" }) {
31827
32147
  const frame = commonFrame4(active);
31828
32148
  const r = shapeRegion(node);
31829
32149
  const cx = r.cx;
@@ -31897,10 +32217,10 @@ function ShapeWalletNode({ node, active }) {
31897
32217
  /* @__PURE__ */ jsx("text", { x: cx, y: foldY + 3, fontSize: 9, fontWeight: 700, fill: "#5a3a10", textAnchor: "middle", opacity: 0.8, children: "\u039E" }),
31898
32218
  /* @__PURE__ */ jsx("path", { d: `M ${x + 2} ${y + 6} L ${x + w - 2} ${y + 6}`, fill: "none", stroke: "#ffffff", strokeWidth: 1, opacity: 0.4 })
31899
32219
  ] }),
31900
- bottomLabel2(node, r.cx, r.label)
32220
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31901
32221
  ] });
31902
32222
  }
31903
- function ShapeNftNode({ node, active }) {
32223
+ function ShapeNftNode({ node, active, textMetrics = "proportional" }) {
31904
32224
  const frame = commonFrame4(active);
31905
32225
  const r = shapeRegion(node);
31906
32226
  const cx = r.cx;
@@ -31916,7 +32236,7 @@ function ShapeNftNode({ node, active }) {
31916
32236
  { text: "#1024", size: NFT_ID_SIZE, \u5E2F: { \u5E45: cardW - 16 - 34, \u9AD8\u3055: cardH - artH } }
31917
32237
  ];
31918
32238
  const art = (\u500D\u7387) => {
31919
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
32239
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
31920
32240
  return /* @__PURE__ */ jsxs("g", { children: [
31921
32241
  /* @__PURE__ */ jsx("rect", { x: x + 4, y: y + 4, width: cardW, height: cardH, rx: 14, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
31922
32242
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: cardW, height: cardH, rx: 14, ...frame }),
@@ -31954,10 +32274,10 @@ function ShapeNftNode({ node, active }) {
31954
32274
  };
31955
32275
  return /* @__PURE__ */ jsxs("g", { children: [
31956
32276
  fitArt(r, nftExtent(frame.strokeWidth), art),
31957
- bottomLabel2(node, r.cx, r.label)
32277
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31958
32278
  ] });
31959
32279
  }
31960
- function ShapeTokenNode({ node, active }) {
32280
+ function ShapeTokenNode({ node, active, textMetrics = "proportional" }) {
31961
32281
  const frame = commonFrame4(active);
31962
32282
  const r = shapeRegion(node);
31963
32283
  const cx = r.cx;
@@ -31994,7 +32314,7 @@ function ShapeTokenNode({ node, active }) {
31994
32314
  }
31995
32315
  }
31996
32316
  ),
31997
- bottomLabel2(node, r.cx, r.label)
32317
+ bottomLabel2(node, r.cx, r.label, textMetrics)
31998
32318
  ] });
31999
32319
  }
32000
32320
  var commonFrame5 = (active) => ({
@@ -32013,7 +32333,8 @@ function \u5B57\u306E\u6BD4(c) {
32013
32333
  if (\u5E83\u5B57.has(c)) return \u5E83\u5B57\u6BD4;
32014
32334
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD4 : \u5E83\u5B57\u6BD4;
32015
32335
  }
32016
- function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
32336
+ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
32337
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
32017
32338
  let \u5E45 = 0;
32018
32339
  let \u5B57\u6570 = 0;
32019
32340
  for (const c of \u6587\u5B57\u5217) {
@@ -32022,18 +32343,33 @@ function \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
32022
32343
  }
32023
32344
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
32024
32345
  }
32025
- function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
32026
- const \u5E45 = \u5B57\u5E45(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
32027
- 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;
32346
+ function \u5E45\u306B\u53CE\u3081\u308B3(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
32347
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E45(t, s, ls, textMetrics);
32348
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
32349
+ 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;
32028
32350
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
32029
32351
  const size = \u5927\u304D\u3055 * \u500D\u7387;
32030
32352
  const spacing = \u5B57\u9593 * \u500D\u7387;
32031
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u5B57\u5E45(u, f, spacing)) };
32032
- }
32033
- function bottomLabel3(node, cx, plan) {
32034
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING2, node.w);
32035
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
32036
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
32353
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
32354
+ }
32355
+ function bottomLabel3(node, cx, plan, textMetrics = "proportional") {
32356
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B3(
32357
+ node.eyebrow ?? "",
32358
+ plan.\u80A9\u66F8?.size ?? 0,
32359
+ LABEL_EYEBROW_SPACING2,
32360
+ node.w,
32361
+ false,
32362
+ textMetrics
32363
+ );
32364
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B3(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
32365
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B3(
32366
+ node.subtitle ?? "",
32367
+ plan.\u8AAC\u660E?.size ?? 0,
32368
+ 0,
32369
+ node.w,
32370
+ false,
32371
+ textMetrics
32372
+ );
32037
32373
  return /* @__PURE__ */ jsxs(Fragment, { children: [
32038
32374
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
32039
32375
  /* @__PURE__ */ jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
@@ -32052,7 +32388,7 @@ var BANK_STEP_SW = 1;
32052
32388
  var BANK_COLUMN_MIN = 24;
32053
32389
  var BANK_BLD_W_MIN = 120;
32054
32390
  var BANK_BLD_W_MAX = 280;
32055
- function ShapeBankNode({ node, active }) {
32391
+ function ShapeBankNode({ node, active, textMetrics = "proportional" }) {
32056
32392
  const frame = commonFrame5(active);
32057
32393
  const r = shapeRegion(node);
32058
32394
  const \u7DDA = frame.strokeWidth / 2;
@@ -32099,7 +32435,7 @@ function ShapeBankNode({ node, active }) {
32099
32435
  ] });
32100
32436
  return /* @__PURE__ */ jsxs("g", { children: [
32101
32437
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32102
- bottomLabel3(node, r.cx, r.label)
32438
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32103
32439
  ] });
32104
32440
  }
32105
32441
  var TRUST_CROWN_RISE = 4;
@@ -32111,7 +32447,12 @@ var TRUST_BASE_H = 14;
32111
32447
  var TRUST_BODY_OUT = 8;
32112
32448
  var TRUST_BLD_W_MIN = 140;
32113
32449
  var TRUST_BLD_W_MAX = 280;
32114
- function ShapeTrustBankNode({ node, active, lang }) {
32450
+ function ShapeTrustBankNode({
32451
+ node,
32452
+ active,
32453
+ lang,
32454
+ textMetrics = "proportional"
32455
+ }) {
32115
32456
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32116
32457
  const frame = commonFrame5(active);
32117
32458
  const r = shapeRegion(node);
@@ -32165,10 +32506,15 @@ function ShapeTrustBankNode({ node, active, lang }) {
32165
32506
  ] });
32166
32507
  return /* @__PURE__ */ jsxs("g", { children: [
32167
32508
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32168
- bottomLabel3(node, r.cx, r.label)
32509
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32169
32510
  ] });
32170
32511
  }
32171
- function ShapePaymentProviderNode({ node, active, lang }) {
32512
+ function ShapePaymentProviderNode({
32513
+ node,
32514
+ active,
32515
+ lang,
32516
+ textMetrics = "proportional"
32517
+ }) {
32172
32518
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32173
32519
  const frame = commonFrame5(active);
32174
32520
  const r = shapeRegion(node);
@@ -32193,10 +32539,14 @@ function ShapePaymentProviderNode({ node, active, lang }) {
32193
32539
  /* @__PURE__ */ jsx("text", { x: cx, y: cy + 9, fontSize: 13, fontWeight: 700, textAnchor: "middle", fill: accentDarker, fontFamily: "Georgia, serif", children: "$" })
32194
32540
  ] }),
32195
32541
  /* @__PURE__ */ jsx("text", { x: cx, y: y + boxH - 16, fontSize: 11, fontWeight: 700, letterSpacing: 2, textAnchor: "middle", fill: "#a4b5f2", children: \u5B57\u5F15("paymentProvider.status") }),
32196
- bottomLabel3(node, r.cx, r.label)
32542
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32197
32543
  ] });
32198
32544
  }
32199
- function ShapeCreditCardNode({ node, active }) {
32545
+ function ShapeCreditCardNode({
32546
+ node,
32547
+ active,
32548
+ textMetrics = "proportional"
32549
+ }) {
32200
32550
  const frame = commonFrame5(active);
32201
32551
  const r = shapeRegion(node);
32202
32552
  const cardW = Math.min(r.availW - 30, 260);
@@ -32218,7 +32568,7 @@ function ShapeCreditCardNode({ node, active }) {
32218
32568
  [0, 1, 2, 3].map((block) => /* @__PURE__ */ jsx("g", { children: [0, 1, 2, 3].map((dot) => /* @__PURE__ */ jsx("circle", { cx: x + 32 + block * (cardW - 64) / 4 + dot * 8, cy: y + cardH - 40, r: 2.8, fill: "#ffffff", stroke: "none" }, dot)) }, block)),
32219
32569
  /* @__PURE__ */ jsx("circle", { cx: x + cardW - 48, cy: y + cardH - 24, r: 15, fill: "#c9302c", opacity: 0.9, stroke: "none" }),
32220
32570
  /* @__PURE__ */ jsx("circle", { cx: x + cardW - 30, cy: y + cardH - 24, r: 15, fill: "#e5c07b", opacity: 0.9, stroke: "none" }),
32221
- bottomLabel3(node, r.cx, r.label)
32571
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32222
32572
  ] });
32223
32573
  }
32224
32574
  var BROKERAGE_TICK_H = 18;
@@ -32243,7 +32593,12 @@ var BROKERAGE_SHADE_OUT = 2;
32243
32593
  var BROKERAGE_W_MIN = BROKERAGE_COLS * BROKERAGE_CELL_W + (BROKERAGE_COLS - 1) * BROKERAGE_GAP_X + 6;
32244
32594
  var BROKERAGE_W_MAX = 140;
32245
32595
  var BROKERAGE_H_MIN = BROKERAGE_TICK_H + BROKERAGE_LOGO_H + BROKERAGE_BASE_H;
32246
- function ShapeBrokerageNode({ node, active, lang }) {
32596
+ function ShapeBrokerageNode({
32597
+ node,
32598
+ active,
32599
+ lang,
32600
+ textMetrics = "proportional"
32601
+ }) {
32247
32602
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32248
32603
  const frame = commonFrame5(active);
32249
32604
  const r = shapeRegion(node);
@@ -32282,7 +32637,7 @@ function ShapeBrokerageNode({ node, active, lang }) {
32282
32637
  }
32283
32638
  ];
32284
32639
  const \u7D75 = (\u500D\u7387) => {
32285
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
32640
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
32286
32641
  return /* @__PURE__ */ jsxs("g", { children: [
32287
32642
  /* @__PURE__ */ jsx("ellipse", { cx, cy: y + h + BROKERAGE_SHADOW_DY, rx: w * BROKERAGE_SHADOW_RX_RATIO, ry: BROKERAGE_SHADOW_RY, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
32288
32643
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: w, height: h, fill: "#255a7a", stroke: accentDarker, strokeWidth: frame.strokeWidth }),
@@ -32310,12 +32665,17 @@ function ShapeBrokerageNode({ node, active, lang }) {
32310
32665
  };
32311
32666
  return /* @__PURE__ */ jsxs("g", { children: [
32312
32667
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32313
- bottomLabel3(node, r.cx, r.label)
32668
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32314
32669
  ] });
32315
32670
  }
32316
32671
  var EXCHANGE_SUB_SIZE = 11;
32317
32672
  var EXCHANGE_HEX_R = 52;
32318
- function ShapeExchangeNode({ node, active, lang }) {
32673
+ function ShapeExchangeNode({
32674
+ node,
32675
+ active,
32676
+ lang,
32677
+ textMetrics = "proportional"
32678
+ }) {
32319
32679
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32320
32680
  const frame = commonFrame5(active);
32321
32681
  const r = shapeRegion(node);
@@ -32360,7 +32720,7 @@ function ShapeExchangeNode({ node, active, lang }) {
32360
32720
  }
32361
32721
  ];
32362
32722
  const \u7D75 = (\u500D\u7387) => {
32363
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
32723
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
32364
32724
  return /* @__PURE__ */ jsxs("g", { children: [
32365
32725
  nodes.map((n, i) => /* @__PURE__ */ jsx("line", { x1: cx, y1: cy, x2: n.cx, y2: n.cy, stroke: accentDarker, strokeWidth: 1.5, strokeDasharray: "3 2" }, `l${i}`)),
32366
32726
  nodes.map((n, i) => {
@@ -32379,7 +32739,7 @@ function ShapeExchangeNode({ node, active, lang }) {
32379
32739
  };
32380
32740
  return /* @__PURE__ */ jsxs("g", { children: [
32381
32741
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32382
- bottomLabel3(node, r.cx, r.label)
32742
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32383
32743
  ] });
32384
32744
  }
32385
32745
  var ATM_SIGN_H = 26;
@@ -32396,7 +32756,12 @@ var ATM_PANEL_H = 146;
32396
32756
  var ATM_W_MIN = 100;
32397
32757
  var ATM_W_MAX = ATM_PANEL_W;
32398
32758
  var ATM_H_MIN = ATM_SIGN_H + ATM_SIGN_GAP + 30 + ATM_FLOOR_RESERVE;
32399
- function ShapeAtmNode({ node, active, lang }) {
32759
+ function ShapeAtmNode({
32760
+ node,
32761
+ active,
32762
+ lang,
32763
+ textMetrics = "proportional"
32764
+ }) {
32400
32765
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32401
32766
  const frame = commonFrame5(active);
32402
32767
  const r = shapeRegion(node);
@@ -32480,7 +32845,7 @@ function ShapeAtmNode({ node, active, lang }) {
32480
32845
  ] });
32481
32846
  return /* @__PURE__ */ jsxs("g", { children: [
32482
32847
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32483
- bottomLabel3(node, r.cx, r.label)
32848
+ bottomLabel3(node, r.cx, r.label, textMetrics)
32484
32849
  ] });
32485
32850
  }
32486
32851
  var commonFrame6 = (active) => ({
@@ -32499,7 +32864,8 @@ function \u5B57\u306E\u6BD42(c) {
32499
32864
  if (\u5E83\u5B572.has(c)) return \u5E83\u5B57\u6BD42;
32500
32865
  return (c.codePointAt(0) ?? 0) < 128 ? \u4E26\u5B57\u6BD42 : \u5E83\u5B57\u6BD42;
32501
32866
  }
32502
- function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
32867
+ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics = "proportional") {
32868
+ if (textMetrics === "monospace") return textWidth(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, textMetrics);
32503
32869
  let \u5E45 = 0;
32504
32870
  let \u5B57\u6570 = 0;
32505
32871
  for (const c of \u6587\u5B57\u5217) {
@@ -32508,18 +32874,33 @@ function \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593) {
32508
32874
  }
32509
32875
  return \u5E45 + \u5B57\u9593 * \u5B57\u6570;
32510
32876
  }
32511
- function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false) {
32512
- const \u5E45 = \u5B57\u5E452(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
32513
- 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;
32877
+ function \u5E45\u306B\u53CE\u3081\u308B4(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593, \u7BB1\u5E45, \u984C\u304B = false, textMetrics = "proportional") {
32878
+ const \u6E2C\u308B = (t, s, ls) => \u5B57\u5E452(t, s, ls, textMetrics);
32879
+ const \u5E45 = \u6E2C\u308B(\u6587\u5B57\u5217, \u5927\u304D\u3055, \u5B57\u9593);
32880
+ 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;
32514
32881
  const \u500D\u7387 = \u5E45 > 0 && \u7BB1\u5E45 > 0 ? Math.min(1, Math.max(\u7BB1\u5E45 / \u5E45, \u4E0B\u9650)) : 1;
32515
32882
  const size = \u5927\u304D\u3055 * \u500D\u7387;
32516
32883
  const spacing = \u5B57\u9593 * \u500D\u7387;
32517
- return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u5B57\u5E452(u, f, spacing)) };
32518
- }
32519
- function bottomLabel4(node, cx, plan) {
32520
- const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(node.eyebrow ?? "", plan.\u80A9\u66F8?.size ?? 0, LABEL_EYEBROW_SPACING3, node.w);
32521
- const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true);
32522
- const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(node.subtitle ?? "", plan.\u8AAC\u660E?.size ?? 0, 0, node.w);
32884
+ return { size, spacing, text: \u5E2F\u3067\u5207\u308B(\u6587\u5B57\u5217, size, \u7BB1\u5E45, (u, f) => \u6E2C\u308B(u, f, spacing)) };
32885
+ }
32886
+ function bottomLabel4(node, cx, plan, textMetrics = "proportional") {
32887
+ const \u80A9 = \u5E45\u306B\u53CE\u3081\u308B4(
32888
+ node.eyebrow ?? "",
32889
+ plan.\u80A9\u66F8?.size ?? 0,
32890
+ LABEL_EYEBROW_SPACING3,
32891
+ node.w,
32892
+ false,
32893
+ textMetrics
32894
+ );
32895
+ const \u540D = \u5E45\u306B\u53CE\u3081\u308B4(node.title ?? "", plan.\u540D\u524D.size, 0, node.w, true, textMetrics);
32896
+ const \u8AAC = \u5E45\u306B\u53CE\u3081\u308B4(
32897
+ node.subtitle ?? "",
32898
+ plan.\u8AAC\u660E?.size ?? 0,
32899
+ 0,
32900
+ node.w,
32901
+ false,
32902
+ textMetrics
32903
+ );
32523
32904
  return /* @__PURE__ */ jsxs(Fragment, { children: [
32524
32905
  node.eyebrow && plan.\u80A9\u66F8 && /* @__PURE__ */ jsx("text", { x: cx, y: plan.\u80A9\u66F8.y, fontSize: \u80A9.size, fontWeight: 700, letterSpacing: \u80A9.spacing, textAnchor: "middle", fill: "var(--cdl-tone-accent, #2d6a8f)", children: \u80A9.text }),
32525
32906
  /* @__PURE__ */ jsx("text", { "data-cdl-role": "node-label", x: cx, y: plan.\u540D\u524D.y, fontSize: \u540D.size, fontWeight: 700, textAnchor: "middle", fill: "var(--cdl-text, #1a1f2a)", children: \u540D.text }),
@@ -32531,7 +32912,7 @@ var WEBSITE_BAR_H = 32;
32531
32912
  var WEBSITE_H_MIN = WEBSITE_BAR_H + 98;
32532
32913
  var WEBSITE_W_MIN = 160;
32533
32914
  var WEBSITE_W_MAX = 280;
32534
- function ShapeWebsiteNode({ node, active }) {
32915
+ function ShapeWebsiteNode({ node, active, textMetrics = "proportional" }) {
32535
32916
  const frame = commonFrame6(active);
32536
32917
  const r = shapeRegion(node);
32537
32918
  const cx = r.cx;
@@ -32557,10 +32938,10 @@ function ShapeWebsiteNode({ node, active }) {
32557
32938
  ] });
32558
32939
  return /* @__PURE__ */ jsxs("g", { children: [
32559
32940
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32560
- bottomLabel4(node, r.cx, r.label)
32941
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32561
32942
  ] });
32562
32943
  }
32563
- function ShapeStorefrontNode({ node, active, lang }) {
32944
+ function ShapeStorefrontNode({ node, active, lang, textMetrics = "proportional" }) {
32564
32945
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32565
32946
  const frame = commonFrame6(active);
32566
32947
  const r = shapeRegion(node);
@@ -32605,7 +32986,7 @@ function ShapeStorefrontNode({ node, active, lang }) {
32605
32986
  /* @__PURE__ */ jsx("text", { x: doorX + doorW / 2, y: doorY + doorH * 0.85 + 11, fontSize: 11, fontWeight: 700, letterSpacing: 1, textAnchor: "middle", fill: "#5a3a10", children: \u5B57\u5F15("storefront.open") }),
32606
32987
  /* @__PURE__ */ jsx("circle", { cx: doorX + 6, cy: doorY + doorH * 0.55, r: 1.5, fill: "#c15a4a" }),
32607
32988
  /* @__PURE__ */ jsx("rect", { x: x - 6, y: y + bh - 6, width: bw + 12, height: 8, fill: "#5a6270", stroke: "none" }),
32608
- bottomLabel4(node, r.cx, r.label)
32989
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32609
32990
  ] });
32610
32991
  }
32611
32992
  var WAREHOUSE_ROOF_H = 18;
@@ -32619,7 +33000,7 @@ var WAREHOUSE_SHADOW_RX_RATIO = 0.5;
32619
33000
  var WAREHOUSE_H_MIN = WAREHOUSE_ROOF_H + WAREHOUSE_SIGN_H + 68;
32620
33001
  var WAREHOUSE_W_MIN = 160;
32621
33002
  var WAREHOUSE_W_MAX = 240;
32622
- function ShapeWarehouseNode({ node, active, lang }) {
33003
+ function ShapeWarehouseNode({ node, active, lang, textMetrics = "proportional" }) {
32623
33004
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32624
33005
  const frame = commonFrame6(active);
32625
33006
  const r = shapeRegion(node);
@@ -32672,13 +33053,13 @@ function ShapeWarehouseNode({ node, active, lang }) {
32672
33053
  ] });
32673
33054
  return /* @__PURE__ */ jsxs("g", { children: [
32674
33055
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32675
- bottomLabel4(node, r.cx, r.label)
33056
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32676
33057
  ] });
32677
33058
  }
32678
33059
  var HANDLE_GRIP_X = 118;
32679
33060
  var HANDLE_GRIP_R = 4;
32680
33061
  var CART_SHADOW_RX = 80;
32681
- function ShapeOnlineShopNode({ node, active }) {
33062
+ function ShapeOnlineShopNode({ node, active, textMetrics = "proportional" }) {
32682
33063
  const frame = commonFrame6(active);
32683
33064
  const r = shapeRegion(node);
32684
33065
  const cy = r.cy + 10;
@@ -32734,10 +33115,10 @@ function ShapeOnlineShopNode({ node, active }) {
32734
33115
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 16 * s, fill: "#0f1830", stroke: "#000", strokeWidth: 2 * s }),
32735
33116
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 8 * s, fill: "#5a6270", stroke: "#0f1830", strokeWidth: 1.5 * s }),
32736
33117
  /* @__PURE__ */ jsx("circle", { cx: wheelR, cy: wheelY, r: 2 * s, fill: "#0f1830" }),
32737
- bottomLabel4(node, r.cx, r.label)
33118
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32738
33119
  ] });
32739
33120
  }
32740
- function ShapeCdnEdgeNode({ node, active }) {
33121
+ function ShapeCdnEdgeNode({ node, active, textMetrics = "proportional" }) {
32741
33122
  const frame = commonFrame6(active);
32742
33123
  const r = shapeRegion(node);
32743
33124
  const cx = r.cx;
@@ -32800,7 +33181,7 @@ function ShapeCdnEdgeNode({ node, active }) {
32800
33181
  ] });
32801
33182
  return /* @__PURE__ */ jsxs("g", { children: [
32802
33183
  fitArt(r, { \u4E0A: \u5E83\u304C\u308A, \u4E0B: \u5E83\u304C\u308A, \u5DE6: \u5E83\u304C\u308A, \u53F3: \u5E83\u304C\u308A }, \u7D75),
32803
- bottomLabel4(node, r.cx, r.label)
33184
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32804
33185
  ] });
32805
33186
  }
32806
33187
  var API_ROW_TOP = 52;
@@ -32815,7 +33196,7 @@ var API_METHOD_BOX_W = 54;
32815
33196
  var API_METHOD_TEXT_W = 48;
32816
33197
  var API_W_MIN = 200;
32817
33198
  var API_W_MAX = 300;
32818
- function ShapeApiGatewayNode({ node, active, lang }) {
33199
+ function ShapeApiGatewayNode({ node, active, lang, textMetrics = "proportional" }) {
32819
33200
  const \u5B57\u5F15 = \u5B57\u5F15\u304D\u3092\u4F5C\u308B(lang);
32820
33201
  const frame = commonFrame6(active);
32821
33202
  const r = shapeRegion(node);
@@ -32827,7 +33208,13 @@ function ShapeApiGatewayNode({ node, active, lang }) {
32827
33208
  const x = cx - bw / 2;
32828
33209
  const y = r.cy - \u7E26 / 2 + \u4F59\u767D;
32829
33210
  const \u5E83\u304C\u308A = { \u4E0A: \u7E26 / 2, \u4E0B: \u7E26 / 2, \u5DE6: bw / 2 + \u4F59\u767D, \u53F3: bw / 2 + \u4F59\u767D };
32830
- 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)));
33211
+ const \u7A2E\u985E\u306E\u5B57 = (s) => Math.min(
33212
+ 11,
33213
+ 11 * API_METHOD_TEXT_W / Math.max(
33214
+ displayWidth(s) * 11 * MONO_ADVANCE_RATIO,
33215
+ textWidth(s, 11, 0, textMetrics)
33216
+ )
33217
+ );
32831
33218
  const rowPitch = Math.max(
32832
33219
  API_ROW_PITCH_MIN,
32833
33220
  (bh - API_ROW_TOP - API_ROW_H - API_ROW_BOTTOM_PAD) / (API_ROWS - 1)
@@ -32843,7 +33230,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
32843
33230
  \u5E2F: { \u5E45: bw - 32 - 64 - 16, \u9AD8\u3055: API_ROW_H }
32844
33231
  }));
32845
33232
  const \u7D75 = (\u500D\u7387) => {
32846
- const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089);
33233
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387, \u6253\u3061\u6D88\u3059\u5B57\u3089, textMetrics);
32847
33234
  return /* @__PURE__ */ jsxs("g", { children: [
32848
33235
  /* @__PURE__ */ jsx("rect", { x: x + DROP_SHADOW_D, y: y + DROP_SHADOW_D, width: bw, height: bh, rx: 10, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
32849
33236
  /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 10, fill: "#1a2332", stroke: frame.stroke, strokeWidth: frame.strokeWidth }),
@@ -32860,7 +33247,7 @@ function ShapeApiGatewayNode({ node, active, lang }) {
32860
33247
  };
32861
33248
  return /* @__PURE__ */ jsxs("g", { children: [
32862
33249
  fitArt(r, \u5E83\u304C\u308A, \u7D75),
32863
- bottomLabel4(node, r.cx, r.label)
33250
+ bottomLabel4(node, r.cx, r.label, textMetrics)
32864
33251
  ] });
32865
33252
  }
32866
33253
  function bottomLabel5(node, cx, plan) {
@@ -33160,6 +33547,7 @@ function CdlNodeView({
33160
33547
  chartLineScale,
33161
33548
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3,
33162
33549
  lang,
33550
+ textMetrics,
33163
33551
  \u5024\u306E\u540D\u524D
33164
33552
  }) {
33165
33553
  const value = node.value ? interpolate(node.value, stateValues, \u5024\u306E\u540D\u524D) : void 0;
@@ -33204,7 +33592,14 @@ function CdlNodeView({
33204
33592
  return /* @__PURE__ */ jsx(CardNode, { node: resolvedNode, active });
33205
33593
  // 時系列のやり取り (#578)。 1 つの箱が図を丸ごと描く = 縦が時間で、参加者は箱を持たない
33206
33594
  case "sequence-board":
33207
- return /* @__PURE__ */ jsx(SequenceBoardNode, { node: resolvedNode, stateValues });
33595
+ return /* @__PURE__ */ jsx(
33596
+ SequenceBoardNode,
33597
+ {
33598
+ node: resolvedNode,
33599
+ stateValues,
33600
+ textMetrics
33601
+ }
33602
+ );
33208
33603
  // 図表 9 種は payload が `{signal}` を取れるので stateValues を渡す
33209
33604
  // (`render/payload-binding.ts` が描画直前に解決する)。 取れる欄は種別で違い、
33210
33605
  // 数と語を取る 7 種に対し、mind-map / tree-hierarchy は **名前だけ** を取る (#467)。
@@ -33229,7 +33624,8 @@ function CdlNodeView({
33229
33624
  active,
33230
33625
  stateValues,
33231
33626
  drawing,
33232
- progress
33627
+ progress,
33628
+ textMetrics
33233
33629
  }
33234
33630
  );
33235
33631
  case "chart-gauge":
@@ -33240,7 +33636,8 @@ function CdlNodeView({
33240
33636
  active,
33241
33637
  stateValues,
33242
33638
  drawing,
33243
- progress
33639
+ progress,
33640
+ textMetrics
33244
33641
  }
33245
33642
  );
33246
33643
  case "chart-stacked-bar":
@@ -33251,7 +33648,8 @@ function CdlNodeView({
33251
33648
  active,
33252
33649
  stateValues,
33253
33650
  drawing,
33254
- progress
33651
+ progress,
33652
+ textMetrics
33255
33653
  }
33256
33654
  );
33257
33655
  case "chart-slope":
@@ -33262,7 +33660,8 @@ function CdlNodeView({
33262
33660
  active,
33263
33661
  stateValues,
33264
33662
  drawing,
33265
- progress
33663
+ progress,
33664
+ textMetrics
33266
33665
  }
33267
33666
  );
33268
33667
  case "chart-waffle":
@@ -33273,11 +33672,20 @@ function CdlNodeView({
33273
33672
  active,
33274
33673
  stateValues,
33275
33674
  drawing,
33276
- progress
33675
+ progress,
33676
+ textMetrics
33277
33677
  }
33278
33678
  );
33279
33679
  case "chart-stat":
33280
- return /* @__PURE__ */ jsx(ChartStatNode, { node: resolvedNode, active, stateValues });
33680
+ return /* @__PURE__ */ jsx(
33681
+ ChartStatNode,
33682
+ {
33683
+ node: resolvedNode,
33684
+ active,
33685
+ stateValues,
33686
+ textMetrics
33687
+ }
33688
+ );
33281
33689
  case "chart-radial":
33282
33690
  return /* @__PURE__ */ jsx(
33283
33691
  ChartRadialNode,
@@ -33286,7 +33694,8 @@ function CdlNodeView({
33286
33694
  active,
33287
33695
  stateValues,
33288
33696
  drawing,
33289
- progress
33697
+ progress,
33698
+ textMetrics
33290
33699
  }
33291
33700
  );
33292
33701
  case "chart-bar":
@@ -33319,7 +33728,8 @@ function CdlNodeView({
33319
33728
  active,
33320
33729
  stateValues,
33321
33730
  drawing,
33322
- progress
33731
+ progress,
33732
+ textMetrics
33323
33733
  }
33324
33734
  );
33325
33735
  case "funnel-stages":
@@ -33330,11 +33740,20 @@ function CdlNodeView({
33330
33740
  active,
33331
33741
  stateValues,
33332
33742
  drawing,
33333
- progress
33743
+ progress,
33744
+ textMetrics
33334
33745
  }
33335
33746
  );
33336
33747
  case "quadrant-matrix":
33337
- return /* @__PURE__ */ jsx(QuadrantNode, { node: resolvedNode, active, stateValues });
33748
+ return /* @__PURE__ */ jsx(
33749
+ QuadrantNode,
33750
+ {
33751
+ node: resolvedNode,
33752
+ active,
33753
+ stateValues,
33754
+ textMetrics
33755
+ }
33756
+ );
33338
33757
  case "tree-hierarchy":
33339
33758
  return /* @__PURE__ */ jsx(
33340
33759
  TreeNode,
@@ -33343,7 +33762,8 @@ function CdlNodeView({
33343
33762
  active,
33344
33763
  stateValues,
33345
33764
  drawing,
33346
- progress
33765
+ progress,
33766
+ textMetrics
33347
33767
  }
33348
33768
  );
33349
33769
  case "journey-map":
@@ -33358,91 +33778,91 @@ function CdlNodeView({
33358
33778
  }
33359
33779
  );
33360
33780
  case "shape-file":
33361
- return /* @__PURE__ */ jsx(ShapeFileNode, { node: resolvedNode, active });
33781
+ return /* @__PURE__ */ jsx(ShapeFileNode, { node: resolvedNode, active, textMetrics });
33362
33782
  case "shape-folder":
33363
- return /* @__PURE__ */ jsx(ShapeFolderNode, { node: resolvedNode, active });
33783
+ return /* @__PURE__ */ jsx(ShapeFolderNode, { node: resolvedNode, active, textMetrics });
33364
33784
  case "shape-cloud":
33365
- return /* @__PURE__ */ jsx(ShapeCloudNode, { node: resolvedNode, active });
33785
+ return /* @__PURE__ */ jsx(ShapeCloudNode, { node: resolvedNode, active, textMetrics });
33366
33786
  case "shape-cylinder":
33367
- return /* @__PURE__ */ jsx(ShapeCylinderNode, { node: resolvedNode, active });
33787
+ return /* @__PURE__ */ jsx(ShapeCylinderNode, { node: resolvedNode, active, textMetrics });
33368
33788
  case "shape-hexagon":
33369
- return /* @__PURE__ */ jsx(ShapeHexagonNode, { node: resolvedNode, active });
33789
+ return /* @__PURE__ */ jsx(ShapeHexagonNode, { node: resolvedNode, active, textMetrics });
33370
33790
  case "shape-diamond":
33371
- return /* @__PURE__ */ jsx(ShapeDiamondNode, { node: resolvedNode, active });
33791
+ return /* @__PURE__ */ jsx(ShapeDiamondNode, { node: resolvedNode, active, textMetrics });
33372
33792
  case "shape-stack":
33373
- return /* @__PURE__ */ jsx(ShapeStackNode, { node: resolvedNode, active });
33793
+ return /* @__PURE__ */ jsx(ShapeStackNode, { node: resolvedNode, active, textMetrics });
33374
33794
  case "shape-person":
33375
- return /* @__PURE__ */ jsx(ShapePersonNode, { node: resolvedNode, active });
33795
+ return /* @__PURE__ */ jsx(ShapePersonNode, { node: resolvedNode, active, textMetrics });
33376
33796
  case "shape-window":
33377
33797
  return /* @__PURE__ */ jsx(ShapeWindowNode, { node: resolvedNode, active });
33378
33798
  case "shape-terminal":
33379
33799
  return /* @__PURE__ */ jsx(ShapeTerminalNode, { node: resolvedNode, active, lang });
33380
33800
  case "shape-code-block":
33381
- return /* @__PURE__ */ jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang });
33801
+ return /* @__PURE__ */ jsx(ShapeCodeBlockNode, { node: resolvedNode, active, lang, textMetrics });
33382
33802
  case "shape-kanban-card":
33383
- return /* @__PURE__ */ jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang });
33803
+ return /* @__PURE__ */ jsx(ShapeKanbanCardNode, { node: resolvedNode, active, lang, textMetrics });
33384
33804
  case "shape-message-bubble":
33385
33805
  return /* @__PURE__ */ jsx(ShapeMessageBubbleNode, { node: resolvedNode, active });
33386
33806
  case "shape-gear":
33387
33807
  return /* @__PURE__ */ jsx(ShapeGearNode, { node: resolvedNode, active });
33388
33808
  case "shape-server-rack":
33389
- return /* @__PURE__ */ jsx(ShapeServerRackNode, { node: resolvedNode, active });
33809
+ return /* @__PURE__ */ jsx(ShapeServerRackNode, { node: resolvedNode, active, textMetrics });
33390
33810
  case "shape-network-node":
33391
- return /* @__PURE__ */ jsx(ShapeNetworkNodeNode, { node: resolvedNode, active });
33811
+ return /* @__PURE__ */ jsx(ShapeNetworkNodeNode, { node: resolvedNode, active, textMetrics });
33392
33812
  case "shape-mobile-device":
33393
- return /* @__PURE__ */ jsx(ShapeMobileDeviceNode, { node: resolvedNode, active });
33813
+ return /* @__PURE__ */ jsx(ShapeMobileDeviceNode, { node: resolvedNode, active, textMetrics });
33394
33814
  case "shape-iot-sensor":
33395
33815
  return /* @__PURE__ */ jsx(ShapeIotSensorNode, { node: resolvedNode, active });
33396
33816
  case "shape-robot-arm":
33397
33817
  return /* @__PURE__ */ jsx(ShapeRobotArmNode, { node: resolvedNode, active });
33398
33818
  case "shape-satellite":
33399
- return /* @__PURE__ */ jsx(ShapeSatelliteNode, { node: resolvedNode, active });
33819
+ return /* @__PURE__ */ jsx(ShapeSatelliteNode, { node: resolvedNode, active, textMetrics });
33400
33820
  case "shape-smart-contract":
33401
- return /* @__PURE__ */ jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang });
33821
+ return /* @__PURE__ */ jsx(ShapeSmartContractNode, { node: resolvedNode, active, lang, textMetrics });
33402
33822
  case "shape-blockchain-block":
33403
- return /* @__PURE__ */ jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang });
33823
+ return /* @__PURE__ */ jsx(ShapeBlockchainBlockNode, { node: resolvedNode, active, lang, textMetrics });
33404
33824
  case "shape-rpc-node":
33405
- return /* @__PURE__ */ jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang });
33825
+ return /* @__PURE__ */ jsx(ShapeRpcNodeNode, { node: resolvedNode, active, lang, textMetrics });
33406
33826
  case "shape-wallet":
33407
- return /* @__PURE__ */ jsx(ShapeWalletNode, { node: resolvedNode, active });
33827
+ return /* @__PURE__ */ jsx(ShapeWalletNode, { node: resolvedNode, active, textMetrics });
33408
33828
  case "shape-nft":
33409
- return /* @__PURE__ */ jsx(ShapeNftNode, { node: resolvedNode, active });
33829
+ return /* @__PURE__ */ jsx(ShapeNftNode, { node: resolvedNode, active, textMetrics });
33410
33830
  case "shape-token":
33411
- return /* @__PURE__ */ jsx(ShapeTokenNode, { node: resolvedNode, active });
33831
+ return /* @__PURE__ */ jsx(ShapeTokenNode, { node: resolvedNode, active, textMetrics });
33412
33832
  case "shape-blockchain":
33413
- return /* @__PURE__ */ jsx(ShapeBlockchainNode, { node: resolvedNode, active });
33833
+ return /* @__PURE__ */ jsx(ShapeBlockchainNode, { node: resolvedNode, active, textMetrics });
33414
33834
  case "shape-bitcoin-chain":
33415
- return /* @__PURE__ */ jsx(ShapeBitcoinChainNode, { node: resolvedNode, active });
33835
+ return /* @__PURE__ */ jsx(ShapeBitcoinChainNode, { node: resolvedNode, active, textMetrics });
33416
33836
  case "shape-ethereum-chain":
33417
- return /* @__PURE__ */ jsx(ShapeEthereumChainNode, { node: resolvedNode, active });
33837
+ return /* @__PURE__ */ jsx(ShapeEthereumChainNode, { node: resolvedNode, active, textMetrics });
33418
33838
  case "shape-blockchain-node":
33419
- return /* @__PURE__ */ jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active });
33839
+ return /* @__PURE__ */ jsx(ShapeBlockchainNodeNode, { node: resolvedNode, active, textMetrics });
33420
33840
  case "shape-bank":
33421
- return /* @__PURE__ */ jsx(ShapeBankNode, { node: resolvedNode, active });
33841
+ return /* @__PURE__ */ jsx(ShapeBankNode, { node: resolvedNode, active, textMetrics });
33422
33842
  case "shape-trust-bank":
33423
- return /* @__PURE__ */ jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang });
33843
+ return /* @__PURE__ */ jsx(ShapeTrustBankNode, { node: resolvedNode, active, lang, textMetrics });
33424
33844
  case "shape-payment-provider":
33425
- return /* @__PURE__ */ jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang });
33845
+ return /* @__PURE__ */ jsx(ShapePaymentProviderNode, { node: resolvedNode, active, lang, textMetrics });
33426
33846
  case "shape-credit-card":
33427
- return /* @__PURE__ */ jsx(ShapeCreditCardNode, { node: resolvedNode, active });
33847
+ return /* @__PURE__ */ jsx(ShapeCreditCardNode, { node: resolvedNode, active, textMetrics });
33428
33848
  case "shape-brokerage":
33429
- return /* @__PURE__ */ jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang });
33849
+ return /* @__PURE__ */ jsx(ShapeBrokerageNode, { node: resolvedNode, active, lang, textMetrics });
33430
33850
  case "shape-exchange":
33431
- return /* @__PURE__ */ jsx(ShapeExchangeNode, { node: resolvedNode, active, lang });
33851
+ return /* @__PURE__ */ jsx(ShapeExchangeNode, { node: resolvedNode, active, lang, textMetrics });
33432
33852
  case "shape-atm":
33433
- return /* @__PURE__ */ jsx(ShapeAtmNode, { node: resolvedNode, active, lang });
33853
+ return /* @__PURE__ */ jsx(ShapeAtmNode, { node: resolvedNode, active, lang, textMetrics });
33434
33854
  case "shape-website":
33435
- return /* @__PURE__ */ jsx(ShapeWebsiteNode, { node: resolvedNode, active });
33855
+ return /* @__PURE__ */ jsx(ShapeWebsiteNode, { node: resolvedNode, active, textMetrics });
33436
33856
  case "shape-storefront":
33437
- return /* @__PURE__ */ jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang });
33857
+ return /* @__PURE__ */ jsx(ShapeStorefrontNode, { node: resolvedNode, active, lang, textMetrics });
33438
33858
  case "shape-warehouse":
33439
- return /* @__PURE__ */ jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang });
33859
+ return /* @__PURE__ */ jsx(ShapeWarehouseNode, { node: resolvedNode, active, lang, textMetrics });
33440
33860
  case "shape-online-shop":
33441
- return /* @__PURE__ */ jsx(ShapeOnlineShopNode, { node: resolvedNode, active });
33861
+ return /* @__PURE__ */ jsx(ShapeOnlineShopNode, { node: resolvedNode, active, textMetrics });
33442
33862
  case "shape-cdn-edge":
33443
- return /* @__PURE__ */ jsx(ShapeCdnEdgeNode, { node: resolvedNode, active });
33863
+ return /* @__PURE__ */ jsx(ShapeCdnEdgeNode, { node: resolvedNode, active, textMetrics });
33444
33864
  case "shape-api-gateway":
33445
- return /* @__PURE__ */ jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang });
33865
+ return /* @__PURE__ */ jsx(ShapeApiGatewayNode, { node: resolvedNode, active, lang, textMetrics });
33446
33866
  case "shape-auditor":
33447
33867
  return /* @__PURE__ */ jsx(ShapeAuditorNode, { node: resolvedNode, active });
33448
33868
  case "shape-regulator":
@@ -33462,7 +33882,17 @@ function CdlNodeView({
33462
33882
  case "station":
33463
33883
  return /* @__PURE__ */ jsx(StationNode, { node: resolvedNode, active });
33464
33884
  default:
33465
- return /* @__PURE__ */ jsx(GenericNode, { node: resolvedNode, active, value: node.value, stateValues, \u5024\u306E\u540D\u524D });
33885
+ return /* @__PURE__ */ jsx(
33886
+ GenericNode,
33887
+ {
33888
+ node: resolvedNode,
33889
+ active,
33890
+ value: node.value,
33891
+ stateValues,
33892
+ \u5024\u306E\u540D\u524D,
33893
+ textMetrics
33894
+ }
33895
+ );
33466
33896
  }
33467
33897
  })();
33468
33898
  const offsetX = node.renderOffsetX !== void 0 ? resolveNumericAttr(node.renderOffsetX, stateValues, 0) : 0;
@@ -33523,7 +33953,7 @@ function CdlNodeView({
33523
33953
  }
33524
33954
  ),
33525
33955
  inner,
33526
- \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode)
33956
+ \u7BB1\u306E\u4E0A\u306E\u8A9E(resolvedNode, textMetrics ?? "proportional")
33527
33957
  ]
33528
33958
  }
33529
33959
  );
@@ -33532,17 +33962,17 @@ var FIGURE_TITLE_GAP = 10;
33532
33962
  var FIGURE_TITLE_SIZE = 15;
33533
33963
  var FIGURE_EYEBROW_SIZE = 11;
33534
33964
  var FIGURE_EYEBROW_LIFT = 1.1;
33535
- function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45) {
33536
- const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0);
33965
+ function \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, \u5E45, textMetrics = "proportional") {
33966
+ const \u5B9F\u5E45 = textWidth(\u8A9E, \u7D20\u306E\u5927\u304D\u3055, 0, textMetrics);
33537
33967
  return \u5B9F\u5E45 > \u5E45 ? \u7D20\u306E\u5927\u304D\u3055 * \u5E45 / \u5B9F\u5E45 : \u7D20\u306E\u5927\u304D\u3055;
33538
33968
  }
33539
- function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
33969
+ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node, textMetrics = "proportional") {
33540
33970
  if (!drawsFigureTitle(node.kind)) return null;
33541
33971
  const \u540D\u524D = (node.title ?? "").trim();
33542
33972
  const \u5C0F\u898B\u51FA\u3057 = (node.eyebrow ?? "").trim();
33543
33973
  if (\u540D\u524D === "" && \u5C0F\u898B\u51FA\u3057 === "") return null;
33544
33974
  const \u984C\u306Ey = node.cy - node.h / 2 - FIGURE_TITLE_GAP;
33545
- const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w);
33975
+ const \u984C\u306E\u5927\u304D\u3055 = \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u540D\u524D, FIGURE_TITLE_SIZE, node.w, textMetrics);
33546
33976
  const \u5C0F\u898B\u51FA\u3057\u306Ey = \u540D\u524D === "" ? \u984C\u306Ey : \u984C\u306Ey - \u984C\u306E\u5927\u304D\u3055 * FIGURE_EYEBROW_LIFT;
33547
33977
  return /* @__PURE__ */ jsxs(Fragment, { children: [
33548
33978
  \u5C0F\u898B\u51FA\u3057 !== "" && /* @__PURE__ */ jsx(
@@ -33552,7 +33982,7 @@ function \u7BB1\u306E\u4E0A\u306E\u8A9E(node) {
33552
33982
  x: node.cx,
33553
33983
  y: \u5C0F\u898B\u51FA\u3057\u306Ey,
33554
33984
  textAnchor: "middle",
33555
- fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w),
33985
+ fontSize: \u5E45\u306B\u53CE\u3081\u305F\u5927\u304D\u3055(\u5C0F\u898B\u51FA\u3057, FIGURE_EYEBROW_SIZE, node.w, textMetrics),
33556
33986
  fontWeight: 600,
33557
33987
  letterSpacing: 0.6,
33558
33988
  fill: "var(--cdl-text-dim, #5a6270)",
@@ -33877,6 +34307,7 @@ function CdlStage({
33877
34307
  node,
33878
34308
  active: activeSet.has(node.id),
33879
34309
  lang: laid.lang,
34310
+ textMetrics: laid.textMetrics,
33880
34311
  \u95A2\u4FC2\u306E\u53D7\u3051\u53E3: \u7BB1\u306E\u53D7\u3051\u53E3,
33881
34312
  drawing: \u63CF\u304F,
33882
34313
  progress: \u63CF\u304F ? \u63CF\u304F\u9032\u307F : progress,
@@ -33893,7 +34324,8 @@ function CdlStage({
33893
34324
  CdlEdgeLabelView,
33894
34325
  {
33895
34326
  edge,
33896
- active: activeSet.has(edge.id)
34327
+ active: activeSet.has(edge.id),
34328
+ textMetrics: laid.textMetrics
33897
34329
  },
33898
34330
  `label-${edge.id}`
33899
34331
  )),
@@ -33903,7 +34335,8 @@ function CdlStage({
33903
34335
  {
33904
34336
  edge,
33905
34337
  active: activeSet.has(edge.id),
33906
- \u7AEF
34338
+ \u7AEF,
34339
+ textMetrics: laid.textMetrics
33907
34340
  },
33908
34341
  `${\u7AEF}-label-${edge.id}`
33909
34342
  ))
@@ -34348,8 +34781,8 @@ function pointToSegmentDistance2(px, py, seg) {
34348
34781
  }
34349
34782
 
34350
34783
  // src/layout/predict-bbox.ts
34351
- function predictLabelBBoxWorld(edge) {
34352
- return computeLabelBBoxWorld(edge);
34784
+ function predictLabelBBoxWorld(edge, textMetrics = "proportional") {
34785
+ return computeLabelBBoxWorld(edge, textMetrics);
34353
34786
  }
34354
34787
  function predictNodeBBoxWorld(n) {
34355
34788
  return {
@@ -34409,12 +34842,12 @@ function resolveStorageBoxW(width, presetName, optionName) {
34409
34842
  }
34410
34843
  return width;
34411
34844
  }
34412
- function fitRowsWidth(boxW, rows) {
34413
- return Math.max(boxW, requiredRowsWidth(rows ? [...rows] : void 0, "storage"));
34845
+ function fitRowsWidth(boxW, rows, textMetrics = "proportional") {
34846
+ return Math.max(boxW, requiredRowsWidth(rows ? [...rows] : void 0, "storage", textMetrics));
34414
34847
  }
34415
34848
  function swimlane(preset) {
34416
34849
  const w = preset.laneWidth ?? 400;
34417
- const b = diagram(preset.id, { topic: preset.topic, type: "swimlane" });
34850
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "swimlane" });
34418
34851
  const labelToId = /* @__PURE__ */ new Map();
34419
34852
  const idsInOrder = [];
34420
34853
  for (const label of preset.lanes) {
@@ -34434,7 +34867,7 @@ function swimlane(preset) {
34434
34867
  }
34435
34868
  function flow(preset) {
34436
34869
  const w = preset.laneWidth ?? 400;
34437
- const b = diagram(preset.id, { topic: preset.topic, type: "flow" });
34870
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "flow" });
34438
34871
  b.lane("flow", { width: w, ...preset.laneLabel ? { label: preset.laneLabel } : {} });
34439
34872
  const tone = preset.defaultTone ?? "accent";
34440
34873
  const style = preset.defaultStyle ?? "dotted-flow";
@@ -34495,7 +34928,7 @@ var SEQUENCE_MESSAGE_LOOK = {
34495
34928
  };
34496
34929
  function sequence(preset) {
34497
34930
  const tone = preset.defaultTone ?? "accent";
34498
- const b = diagram(preset.id, { topic: preset.topic, type: "sequence" });
34931
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "sequence" });
34499
34932
  const \u9762\u3005 = preset.actors.map(
34500
34933
  (a) => typeof a === "string" ? { name: a } : { name: a.name, ...a.subtitle ? { subtitle: a.subtitle } : {} }
34501
34934
  );
@@ -34521,7 +34954,7 @@ function sequence(preset) {
34521
34954
  return \u51FA\u756A.length > 0 ? { actor: i, from: \u51FA\u756A[0], to: \u51FA\u756A[\u51FA\u756A.length - 1] } : null;
34522
34955
  }).filter((x) => x !== null);
34523
34956
  const data = { actors: \u9762\u3005, messages: \u8A00\u3065\u3066, bands: \u5E2F };
34524
- const m = sequenceBoardMetrics(data);
34957
+ const m = sequenceBoardMetrics(data, resolveTextMetrics(preset.textMetrics));
34525
34958
  const laneId = "seq";
34526
34959
  b.lane(laneId, { width: m.w + LANE_PAD_MIN * 2 });
34527
34960
  b.node(preset.id, {
@@ -34550,7 +34983,7 @@ function topology(preset) {
34550
34983
  const groupW = preset.groupWidth ?? 460;
34551
34984
  const tone = preset.defaultTone ?? "accent";
34552
34985
  const style = preset.defaultStyle ?? "solid";
34553
- const b = diagram(preset.id, { topic: preset.topic, type: "topology" });
34986
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "topology" });
34554
34987
  const groupOrder = [];
34555
34988
  const groupStackCount = /* @__PURE__ */ new Map();
34556
34989
  const phaseActivate = [];
@@ -34619,7 +35052,12 @@ function er(preset) {
34619
35052
  const entityW = resolveStorageBoxW(preset.entityWidth, "er", "entityWidth");
34620
35053
  const tone = preset.defaultTone ?? "info";
34621
35054
  const \u7E1E\u3092\u6577\u304F = preset.rowStripe ?? true;
34622
- const b = diagram(preset.id, { topic: preset.topic, palette: preset.palette, type: "er" });
35055
+ const b = diagram(preset.id, {
35056
+ topic: preset.topic,
35057
+ palette: preset.palette,
35058
+ textMetrics: preset.textMetrics,
35059
+ type: "er"
35060
+ });
34623
35061
  const entities = [];
34624
35062
  const phaseActivate = [];
34625
35063
  let relIdx = 0;
@@ -34642,7 +35080,7 @@ function er(preset) {
34642
35080
  \u5024.forEach(\u8DB3\u3059);
34643
35081
  const \u8A2D\u8A08\u306E\u5F62 = \u884C.length > 0;
34644
35082
  const rows = \u8A2D\u8A08\u306E\u5F62 ? \u884C : e.rows ?? [];
34645
- const boxW = fitRowsWidth(entityW, rows);
35083
+ const boxW = fitRowsWidth(entityW, rows, resolveTextMetrics(preset.textMetrics));
34646
35084
  b.lane(laneId, { width: boxLaneW(boxW) });
34647
35085
  b.node(e.id, {
34648
35086
  lane: laneId,
@@ -34706,7 +35144,7 @@ function stateMachine(preset) {
34706
35144
  const stateW = resolveStateW(preset.stateWidth, "stateMachine");
34707
35145
  const tone = preset.defaultTone ?? "accent";
34708
35146
  const diagramType = "state";
34709
- const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
35147
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: diagramType });
34710
35148
  const phaseActivate = [];
34711
35149
  const stateOrder = /* @__PURE__ */ new Map();
34712
35150
  const \u72B6\u614B = [];
@@ -34737,7 +35175,7 @@ function stateMachine(preset) {
34737
35175
  const \u884C = (s.actions ?? []).map((a) => a.note ? `${a.label}: ${a.note}` : a.label);
34738
35176
  const \u5370 = (s.actions ?? []).map((a) => FSM_ACTION_MARK[a.when]);
34739
35177
  const laneId = \u683C\u5B50 && s.col !== void 0 ? `col-${s.col}` : `lane-${s.id}`;
34740
- const boxW = \u8A2D\u8A08\u306E\u5F62 ? fitRowsWidth(stateW, \u884C) : stateW;
35178
+ const boxW = \u8A2D\u8A08\u306E\u5F62 ? fitRowsWidth(stateW, \u884C, resolveTextMetrics(preset.textMetrics)) : stateW;
34741
35179
  return { s, \u884C, \u5370, laneId, boxW, stack: \u683C\u5B50 ? s.row ?? 0 : 0 };
34742
35180
  });
34743
35181
  const \u7BC0\u70B9\u306E\u4E2D\u8EAB = \u7BC0\u70B9.map((m) => ({
@@ -34818,7 +35256,11 @@ function infrastructure(preset) {
34818
35256
  const laneW = preset.laneWidth ?? 380;
34819
35257
  const tone = preset.defaultTone ?? "accent";
34820
35258
  const style = preset.defaultStyle ?? "solid";
34821
- const b = diagram(preset.id, { topic: preset.topic, type: "infrastructure" });
35259
+ const b = diagram(preset.id, {
35260
+ topic: preset.topic,
35261
+ textMetrics: preset.textMetrics,
35262
+ type: "infrastructure"
35263
+ });
34822
35264
  const colLaneIds = /* @__PURE__ */ new Map();
34823
35265
  const phaseActivate = [];
34824
35266
  let connIdx = 0;
@@ -34899,7 +35341,12 @@ function classDiagram(preset) {
34899
35341
  const classW = resolveStorageBoxW(preset.classWidth, "classDiagram", "classWidth");
34900
35342
  const \u56F3\u306E\u65E2\u5B9A = preset.defaultTone;
34901
35343
  const \u7E1E\u3092\u6577\u304F = preset.rowStripe ?? true;
34902
- const b = diagram(preset.id, { topic: preset.topic, palette: preset.palette, type: "class" });
35344
+ const b = diagram(preset.id, {
35345
+ topic: preset.topic,
35346
+ palette: preset.palette,
35347
+ textMetrics: preset.textMetrics,
35348
+ type: "class"
35349
+ });
34903
35350
  const classes = [];
34904
35351
  const phaseActivate = [];
34905
35352
  const \u7BB1 = [];
@@ -34925,7 +35372,7 @@ function classDiagram(preset) {
34925
35372
  rows.push(stripAccess(m));
34926
35373
  rowMarks.push({ shape: "chevron", filled: isPublic(m) });
34927
35374
  }
34928
- const boxW = fitRowsWidth(classW, rows);
35375
+ const boxW = fitRowsWidth(classW, rows, resolveTextMetrics(preset.textMetrics));
34929
35376
  const laneId = c.col !== void 0 ? `col-${c.col}` : `lane-${c.id}`;
34930
35377
  return { c, rows, rowMarks, boxW, laneId, stack: c.col !== void 0 ? c.row ?? 0 : 0 };
34931
35378
  });
@@ -34988,7 +35435,7 @@ function classDiagram(preset) {
34988
35435
  }
34989
35436
  function tree(preset) {
34990
35437
  const canvasH = 480;
34991
- const b = diagram(preset.id, { topic: preset.topic, type: "tree" });
35438
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "tree" });
34992
35439
  const treeNodes = [];
34993
35440
  const api = {
34994
35441
  node(n) {
@@ -35027,7 +35474,7 @@ function tree(preset) {
35027
35474
  function userJourney(preset) {
35028
35475
  const canvasW = preset.stepWidth ? preset.stepWidth * 2 : 720;
35029
35476
  const canvasH = 480;
35030
- const b = diagram(preset.id, { topic: preset.topic, type: "journey" });
35477
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "journey" });
35031
35478
  const steps = [];
35032
35479
  const api = {
35033
35480
  step(s) {
@@ -35067,7 +35514,7 @@ function mindMap(preset) {
35067
35514
  const canvasW = preset.branchWidth ? preset.branchWidth * 2 : 720;
35068
35515
  const canvasH = 480;
35069
35516
  const diagramType = "mind";
35070
- const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
35517
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: diagramType });
35071
35518
  const branches = [];
35072
35519
  const api = {
35073
35520
  branch(br) {
@@ -35111,7 +35558,7 @@ function mindMap(preset) {
35111
35558
  function funnel(preset) {
35112
35559
  const canvasW = toGridSize(preset.stageWidth ?? 560);
35113
35560
  const canvasH = 480;
35114
- const b = diagram(preset.id, { topic: preset.topic, type: "funnel" });
35561
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "funnel" });
35115
35562
  const stages = [];
35116
35563
  const api = {
35117
35564
  stage(s) {
@@ -35149,7 +35596,7 @@ function funnel(preset) {
35149
35596
  function quadrant(preset) {
35150
35597
  const canvasW = 640;
35151
35598
  const canvasH = 480;
35152
- const b = diagram(preset.id, { topic: preset.topic, type: "quadrant" });
35599
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "quadrant" });
35153
35600
  const items = [];
35154
35601
  const api = {
35155
35602
  item(it) {
@@ -35200,7 +35647,7 @@ function chart(preset) {
35200
35647
  const canvasH = toGridSize(
35201
35648
  preset.type === "pie" || preset.type === "gauge" || preset.type === "radial" || preset.type === "stat" || preset.type === "waffle" || preset.type === "stacked-bar" ? 320 : 360
35202
35649
  );
35203
- const b = diagram(preset.id, { topic: preset.topic, type: "chart" });
35650
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "chart" });
35204
35651
  const data = [];
35205
35652
  const kindMap = {
35206
35653
  line: "chart-line",
@@ -35250,7 +35697,7 @@ function gantt(preset) {
35250
35697
  const canvasW = preset.laneWidth ? preset.laneWidth * 2 : 720;
35251
35698
  const canvasH = 360;
35252
35699
  const tone = preset.defaultTone ?? "teal";
35253
- const b = diagram(preset.id, { topic: preset.topic, type: "gantt" });
35700
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "gantt" });
35254
35701
  const tasks = [];
35255
35702
  const api = {
35256
35703
  task(t) {
@@ -35318,7 +35765,7 @@ function flowchart(preset) {
35318
35765
  const laneW = preset.laneWidth ?? 380;
35319
35766
  const tone = preset.defaultTone ?? "accent";
35320
35767
  const \u7E26\u306B\u7A4D\u3080 = (preset.direction ?? "horizontal") === "vertical";
35321
- const b = diagram(preset.id, { topic: preset.topic, type: "flowchart" });
35768
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "flowchart" });
35322
35769
  const laneToId = /* @__PURE__ */ new Map();
35323
35770
  const laneStackCount = /* @__PURE__ */ new Map();
35324
35771
  if (\u7E26\u306B\u7A4D\u3080) {
@@ -35393,7 +35840,7 @@ var NET_KIND_LABEL = {
35393
35840
  function network(preset) {
35394
35841
  const laneW = preset.laneWidth ?? 320;
35395
35842
  const tone = preset.defaultTone ?? "info";
35396
- const b = diagram(preset.id, { topic: preset.topic, type: "network" });
35843
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: "network" });
35397
35844
  const colLaneIds = /* @__PURE__ */ new Map();
35398
35845
  const phaseActivate = [];
35399
35846
  let edgeIdx = 0;
@@ -35444,7 +35891,7 @@ function stateMachine2(preset) {
35444
35891
  const laneW = boxLaneW(stateW);
35445
35892
  const tone = preset.defaultTone ?? "accent";
35446
35893
  const diagramType = "state";
35447
- const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
35894
+ const b = diagram(preset.id, { topic: preset.topic, textMetrics: preset.textMetrics, type: diagramType });
35448
35895
  const stateOrder = /* @__PURE__ */ new Map();
35449
35896
  const phaseActivate = [];
35450
35897
  let transIdx = 0;
@@ -35523,6 +35970,6 @@ function slugify(s) {
35523
35970
  return s.toLowerCase().replace(/[^a-z0-9぀-ゟ゠-ヿ一-龯]+/g, "-").replace(/^-|-$/g, "");
35524
35971
  }
35525
35972
 
35526
- export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLASS_RELATION_LOOK, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDiagramThumbnail, CdlDiagramView, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, EDGE_HEADS, EDGE_HEAD_DEFAULT, EDGE_HEAD_FILLS, EDGE_HEAD_FILL_DEFAULT, EDGE_LABEL_TEXT, EDGE_REVEALS, EDGE_REVEAL_DEFAULT, EDGE_STUB_OUT, EDGE_STYLES, ER_CARDINALITY_HEAD, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, FSM_ACTION_MARK, LABEL_INIT_CLEARANCE, LABEL_INIT_CLEARANCE_DOTTED_FLOW, LABEL_SIZE_TOLERANCE_WORLD, LABEL_TO_PATH_CLEARANCE, LANE_BORDER_CLEARANCE_TOL, MARKER_GLOW_RADIUS, MIN_COLUMN_ALIGNMENT_TOLERANCE, MIN_ROW_ALIGNMENT_TOLERANCE, NEAR_COLLISION_DEFAULT_MIN, NEAR_COLLISION_POLICY, NODE_FRAME_SELECTOR, NODE_KINDS, PERF_BUDGET_TOTAL_MS, PERF_SLOWEST_SAMPLE, RELATION_FOCUSES, RELATION_FOCUS_DEFAULT, ROW_GAP_VARIANCE_TOL, SEQUENCE_MESSAGE_LOOK, SPEC_CLEARANCE_POLICY, STAGE_SVG_SELECTOR, TARGET_LABEL_PATH_DIST, TONES, WCAG_AA_LARGE, WCAG_AA_NORMAL, applyDerivedValues, assertNever, attachEventHandlers, batch, bboxClearance, bboxDiffWorld, cdlAdapter, chart, classDiagram, compile, computeEventBindingKey, computeFormulaKey, computeInputSignalKey, computeScrollProgress, computeScrollTriggerKey, computeStateValues, computeViewportScale, computed, countEdgeCrossings, countOrderCrossings, createFormulaComputeds, createInputSignals, createInteractiveSignalsAccessor, createScrollProgressHandle, createScrollProgressSignals, diagram, drawsFigureTitle, effect, er, evaluate as evaluateFormula, extractIdentifiers, flow, flowchart, funnel, gantt, hasInteractivePrimitives, infrastructure, inputDefaultValue, interpolate, isLargeText, labelInitClearance, layout, layoutWithValidation, mindMap, network, orderNodes, parseFormula, pointRectEdgeDistance, pointToSegmentDistance2 as pointToSegmentDistance, predictLabelBBoxWorld, predictNodeBBoxWorld, projectEdgeLabel, projectNode, projectPathSegment, pxToWorld, quadrant, rectRectClearance, rectRectOverlapArea, relatedFocusSet, rendersRows, requiredContrastRatio, requiredNearClearance, requiredRowsHeight, requiredRowsWidth, requiredSpecClearance, resolveEdgeLabelOverlapsWithChain, resolveEdgeLabelOverlapsWithChainAndPropagate, resolveLabelClearanceAfterPathPasses, resolveLang, resolveOverlapsWithChain, resolveTarget, resolveTargetAll, segmentsIntersect2 as segmentsIntersect, sequence, sequenceBoardMetrics, sequenceStepId, signal, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx, 木の札の幅 };
35973
+ export { ARROW_ANGLE_MAX_DEG, ARROW_ENDPOINT_CENTER_TOL, CHAIN_MIN_CLEARANCE, CHAIN_SHIFT_MAX_ACCUMULATED, CHAIN_SHIFT_MAX_ITER, CLASS_RELATION_LOOK, CLEARANCE_LABEL_LABEL, CLEARANCE_LANE_LABEL, CLEARANCE_NODE_LABEL, CLEARANCE_PATH_LABEL, COLUMN_GAP_VARIANCE_TOL, CdlDiagramThumbnail, CdlDiagramView, DETOUR_GAP, DETOUR_SLOT_GAP, DIST_LABEL_PATH_MAX, DIST_LABEL_PATH_MIN, EDGE_HEADS, EDGE_HEAD_DEFAULT, EDGE_HEAD_FILLS, EDGE_HEAD_FILL_DEFAULT, EDGE_LABEL_TEXT, EDGE_REVEALS, EDGE_REVEAL_DEFAULT, EDGE_STUB_OUT, EDGE_STYLES, ER_CARDINALITY_HEAD, FAN_GAP, FONT_RENDER_TOLERANCE_WORLD, FSM_ACTION_MARK, LABEL_INIT_CLEARANCE, LABEL_INIT_CLEARANCE_DOTTED_FLOW, LABEL_SIZE_TOLERANCE_WORLD, LABEL_TO_PATH_CLEARANCE, LANE_BORDER_CLEARANCE_TOL, MARKER_GLOW_RADIUS, MIN_COLUMN_ALIGNMENT_TOLERANCE, MIN_ROW_ALIGNMENT_TOLERANCE, NEAR_COLLISION_DEFAULT_MIN, NEAR_COLLISION_POLICY, NODE_FRAME_SELECTOR, NODE_KINDS, PERF_BUDGET_TOTAL_MS, PERF_SLOWEST_SAMPLE, RELATION_FOCUSES, RELATION_FOCUS_DEFAULT, ROW_GAP_VARIANCE_TOL, SEQUENCE_MESSAGE_LOOK, SPEC_CLEARANCE_POLICY, STAGE_SVG_SELECTOR, TARGET_LABEL_PATH_DIST, TONES, WCAG_AA_LARGE, WCAG_AA_NORMAL, applyDerivedValues, assertNever, attachEventHandlers, batch, bboxClearance, bboxDiffWorld, cdlAdapter, chart, classDiagram, compile, computeEventBindingKey, computeFormulaKey, computeInputSignalKey, computeScrollProgress, computeScrollTriggerKey, computeStateValues, computeViewportScale, computed, countEdgeCrossings, countOrderCrossings, createFormulaComputeds, createInputSignals, createInteractiveSignalsAccessor, createScrollProgressHandle, createScrollProgressSignals, diagram, drawsFigureTitle, effect, er, evaluate as evaluateFormula, extractIdentifiers, flow, flowchart, funnel, gantt, hasInteractivePrimitives, infrastructure, inputDefaultValue, interpolate, isLargeText, labelInitClearance, layout, layoutWithValidation, mindMap, network, orderNodes, parseFormula, pointRectEdgeDistance, pointToSegmentDistance2 as pointToSegmentDistance, predictLabelBBoxWorld, predictNodeBBoxWorld, projectEdgeLabel, projectNode, projectPathSegment, pxToWorld, quadrant, rectRectClearance, rectRectOverlapArea, relatedFocusSet, rendersRows, requiredContrastRatio, requiredNearClearance, requiredRowsHeight, requiredRowsWidth, requiredSpecClearance, resolveEdgeLabelOverlapsWithChain, resolveEdgeLabelOverlapsWithChainAndPropagate, resolveLabelClearanceAfterPathPasses, resolveLang, resolveOverlapsWithChain, resolveTarget, resolveTargetAll, resolveTextMetrics, segmentsIntersect2 as segmentsIntersect, sequence, sequenceBoardMetrics, sequenceStepId, signal, stateMachine, stateMachine2, swimlane, topology, tree, untrack, userJourney, validate, verifyAllDiagramsDom, verifyAuthorIntent, verifyAuthorIntentAll, verifyDiagramDom, visualValidate, visualValidateAll, visualValidateLaid, withDerivedValues, worldToPx, 木の札の幅 };
35527
35974
  //# sourceMappingURL=index.js.map
35528
35975
  //# sourceMappingURL=index.js.map