@diagrammo/dgmo 0.95.0 → 0.96.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 (215) hide show
  1. package/README.md +1 -1
  2. package/dist/advanced.d.ts +27 -569
  3. package/dist/advanced.js +157 -350
  4. package/dist/block.js +54 -55
  5. package/dist/{calculator-BNH3GSJE.js → calculator-GIB7POFX.js} +2 -2
  6. package/dist/{chart-meta-BbjsRY7o.d.ts → chart-meta-uImk4eTn.d.ts} +1 -1
  7. package/dist/chart-meta.d.ts +2 -2
  8. package/dist/chart-meta.js +15 -15
  9. package/dist/{chart-types-Cppnp31G.d.ts → chart-types-CBVYiLqy.d.ts} +1 -5
  10. package/dist/{charts-d3-SZV2SFTM.js → charts-d3-IRP5VANE.js} +5 -5
  11. package/dist/{chunk-MLY5ALOV.js → chunk-2BYFNZVM.js} +2 -2
  12. package/dist/{chunk-OSSTOSXU.js → chunk-2M3K6GD2.js} +3 -6
  13. package/dist/{chunk-CDM6XMOT.js → chunk-34JOHSVE.js} +2 -2
  14. package/dist/chunk-35A3J4Z5.js +14 -0
  15. package/dist/{chunk-7IALGIOI.js → chunk-3W73ZP6W.js} +9 -4
  16. package/dist/{chunk-IHN6WDEY.js → chunk-4B45SNZH.js} +5 -5
  17. package/dist/{chunk-AULZD45V.js → chunk-5ARANBIE.js} +2 -2
  18. package/dist/{chunk-L5S32VZJ.js → chunk-5BG4OSWJ.js} +5 -5
  19. package/dist/{chunk-VB4VMB2I.js → chunk-5G4DOOX2.js} +1 -1
  20. package/dist/{chunk-EXHXTMVR.js → chunk-5GU6C5WB.js} +2 -2
  21. package/dist/{chunk-EBIDNRSR.js → chunk-5H7SA5ZD.js} +1 -1
  22. package/dist/{chunk-CN4RDJDV.js → chunk-5LG526X7.js} +1 -1
  23. package/dist/{chunk-VF7IKIRS.js → chunk-67RKJEKF.js} +5 -5
  24. package/dist/{chunk-D3K4U3ZM.js → chunk-6K2W3FH7.js} +8 -5
  25. package/dist/{chunk-C6G36F5S.js → chunk-7UWVHNPM.js} +4 -4
  26. package/dist/{chunk-FWVE373X.js → chunk-AQRSEQZV.js} +1 -1
  27. package/dist/{chunk-BQO24BDM.js → chunk-AUXUNV73.js} +1 -1
  28. package/dist/{chunk-3PP746YM.js → chunk-B2YVZ3QU.js} +1 -1
  29. package/dist/{chunk-QPQWY5RU.js → chunk-B5CEV7IR.js} +3 -3
  30. package/dist/{chunk-J7Q4AB23.js → chunk-B7BSRVNC.js} +2 -2
  31. package/dist/{chunk-IXHWS2HI.js → chunk-BD4O4D2A.js} +2 -2
  32. package/dist/{chunk-RQTDUZUH.js → chunk-BUVLLK3D.js} +6 -6
  33. package/dist/{chunk-JJ7RGTAU.js → chunk-CD7VQCDL.js} +6 -6
  34. package/dist/{chunk-6EFCOES2.js → chunk-CP73WWLN.js} +5 -5
  35. package/dist/{chunk-GI5R5B3S.js → chunk-D7DGLJ7N.js} +2 -2
  36. package/dist/{chunk-XOMIYMQ3.js → chunk-DKCVAQU3.js} +6 -6
  37. package/dist/{chunk-KBDMEOLI.js → chunk-DPNSDCR3.js} +1 -1
  38. package/dist/{chunk-BRGRIZQB.js → chunk-DWMQ24JR.js} +2 -2
  39. package/dist/{chunk-4XYZJTFO.js → chunk-EM5SA7NC.js} +11 -3
  40. package/dist/{chunk-AM42TLSZ.js → chunk-EMGNCG5C.js} +1 -1
  41. package/dist/{chunk-3KVUFHUJ.js → chunk-EPB3UEMD.js} +2 -2
  42. package/dist/{chunk-NXU4N5WT.js → chunk-EZ6BI5LL.js} +1 -1
  43. package/dist/{chunk-2ZW4NBYX.js → chunk-FBK32S4D.js} +1 -1
  44. package/dist/{chunk-2I4UQG7W.js → chunk-FHX373L5.js} +1 -1
  45. package/dist/{chunk-AQQUJEDN.js → chunk-FKJWZWNU.js} +1 -1
  46. package/dist/{chunk-TIIZIAGS.js → chunk-FUYEXLAN.js} +6 -13
  47. package/dist/{chunk-TASRGDYP.js → chunk-GEHK4UD5.js} +3 -3
  48. package/dist/{chunk-ZD3QCNB7.js → chunk-GLL237AP.js} +2 -2
  49. package/dist/{chunk-PGSGJLUR.js → chunk-GM2SLMQW.js} +2 -2
  50. package/dist/{chunk-V5D6GDNK.js → chunk-H7JVKUA5.js} +4 -4
  51. package/dist/{chunk-IY62DXT2.js → chunk-H7RQG4PH.js} +2 -2
  52. package/dist/{chunk-KLBTJEIK.js → chunk-HH3DHNQA.js} +1 -1
  53. package/dist/{chunk-GWQRTA5W.js → chunk-HZX4QZGR.js} +1 -1
  54. package/dist/{chunk-KBEWVCK3.js → chunk-I2I2FKAK.js} +1 -1
  55. package/dist/{chunk-BTP2BMWN.js → chunk-I3ZRIMR7.js} +10 -10
  56. package/dist/{chunk-IQN2NGEU.js → chunk-IKXQ6NVR.js} +6 -6
  57. package/dist/{chunk-XJQ6Z3FO.js → chunk-IQZSKWE5.js} +3 -3
  58. package/dist/{chunk-3GUEYQGL.js → chunk-ITDF3MWD.js} +3 -3
  59. package/dist/{chunk-JXGSTBW6.js → chunk-IU7XKZA6.js} +2 -2
  60. package/dist/{chunk-RITTLIDJ.js → chunk-IZFJZCF6.js} +4 -4
  61. package/dist/{chunk-PGBTUGDB.js → chunk-JBAFAKGX.js} +5 -5
  62. package/dist/{chunk-VSAKEMDD.js → chunk-JCC3B2GS.js} +8 -2
  63. package/dist/{chunk-66JTY4AN.js → chunk-JRN2CRXJ.js} +1 -1
  64. package/dist/{chunk-USZLHYEQ.js → chunk-K2SFH3GJ.js} +2 -2
  65. package/dist/{chunk-NM5V5EKY.js → chunk-K2WXMXI2.js} +1 -1
  66. package/dist/{chunk-62GLKE6Q.js → chunk-KDWEOT54.js} +21 -9
  67. package/dist/{chunk-PVWIBKV2.js → chunk-KQAPFIYF.js} +2 -2
  68. package/dist/{chunk-4SACN2C5.js → chunk-LGUFJ7Y2.js} +1 -1
  69. package/dist/{chunk-LAXMUSGW.js → chunk-LRHPBWOY.js} +4 -4
  70. package/dist/{chunk-5XBYLYYI.js → chunk-M4ZUIW3J.js} +3 -3
  71. package/dist/{chunk-S4SJ4LLY.js → chunk-MAYTYF5S.js} +3 -3
  72. package/dist/{chunk-P5XA627W.js → chunk-MVUNMJKO.js} +46 -52
  73. package/dist/{chunk-E7F76M3U.js → chunk-MYHR3PMH.js} +57 -5
  74. package/dist/{chunk-NBAAIRFP.js → chunk-NI4L6HEU.js} +4 -1
  75. package/dist/{chunk-A2A2I4Z4.js → chunk-O2HNVNKO.js} +2 -2
  76. package/dist/{chunk-4UVCTLRH.js → chunk-OAZ6BIIB.js} +3 -3
  77. package/dist/{chunk-IZHGT5HD.js → chunk-OO4GUE4E.js} +3 -3
  78. package/dist/{chunk-KSZB7TIY.js → chunk-OYGJZA24.js} +8 -8
  79. package/dist/{chunk-H6BT45SN.js → chunk-P2GNNEMN.js} +1 -1
  80. package/dist/{chunk-U6VS3T2M.js → chunk-P3PSLC2K.js} +4 -4
  81. package/dist/{chunk-HHVIE45A.js → chunk-P6LKX3IQ.js} +4 -4
  82. package/dist/{chunk-NMS5XSLX.js → chunk-PGD6CNWO.js} +1 -1
  83. package/dist/{chunk-NVZ7R4EK.js → chunk-PWZEJNO6.js} +3 -3
  84. package/dist/{chunk-NPDVWFAQ.js → chunk-QEU6VM4O.js} +1 -1
  85. package/dist/{chunk-UIEKW4SG.js → chunk-R5L5E3TC.js} +0 -1
  86. package/dist/{chunk-2WQ3YZMN.js → chunk-RGFVHYDP.js} +2 -2
  87. package/dist/{chunk-YQMIKX54.js → chunk-RIK6WUMO.js} +62 -29
  88. package/dist/{chunk-BH2SF4TT.js → chunk-RTRORHSP.js} +1 -1
  89. package/dist/{chunk-USE6HIOZ.js → chunk-RVOSA4RR.js} +845 -193
  90. package/dist/{chunk-LKZCUFOW.js → chunk-SCYVGPLI.js} +2 -2
  91. package/dist/{chunk-XIUGSUE4.js → chunk-SIABEREK.js} +6 -2
  92. package/dist/{chunk-R46N5KR4.js → chunk-SQBCNEJB.js} +2 -1
  93. package/dist/{chunk-VTESGA5F.js → chunk-THTYCJGF.js} +2 -2
  94. package/dist/{chunk-4EX4OKGZ.js → chunk-TIPNNOZC.js} +5 -5
  95. package/dist/{chunk-UZ7EZW3B.js → chunk-TO53KK2P.js} +6 -1
  96. package/dist/{chunk-LJGE43SG.js → chunk-TPCP2UOI.js} +3 -3
  97. package/dist/{chunk-Y3SIQN4J.js → chunk-TUOZ6AXC.js} +2 -2
  98. package/dist/{chunk-KRPLP5LP.js → chunk-U6N547QA.js} +1 -1
  99. package/dist/{chunk-BCV2VJTM.js → chunk-VJ7NLYFE.js} +2 -2
  100. package/dist/{chunk-UXNA2H2V.js → chunk-VLI6AWS3.js} +2 -2
  101. package/dist/{chunk-2J2CWWWK.js → chunk-VNAPEZX2.js} +1 -1
  102. package/dist/{chunk-EBVVMUAA.js → chunk-VVTCUIPN.js} +1 -1
  103. package/dist/{chunk-FVTYJUXR.js → chunk-W5MMPPGX.js} +2 -2
  104. package/dist/{chunk-BQMHJ6OW.js → chunk-WGNP5ND2.js} +20 -12
  105. package/dist/{chunk-5OTA2PUH.js → chunk-WLGOIMTI.js} +2 -2
  106. package/dist/{chunk-IGJEKO2P.js → chunk-WTPS73RM.js} +4 -4
  107. package/dist/{chunk-R6EGUTIV.js → chunk-YFIUABSF.js} +2 -2
  108. package/dist/{chunk-7PJBJ2DU.js → chunk-YSGOXZBB.js} +1 -1
  109. package/dist/{chunk-ZECJ7Q6C.js → chunk-YVIPJGFG.js} +2 -2
  110. package/dist/{chunk-5KKZXA44.js → chunk-ZBOIYC2G.js} +4 -2
  111. package/dist/{chunk-RBVFNUAL.js → chunk-ZOKD5F7M.js} +2 -2
  112. package/dist/{collapse-BSPH3BFM.js → collapse-6X5S2S3G.js} +2 -1
  113. package/dist/completion-registry.js +4 -38
  114. package/dist/countdown.js +1 -1
  115. package/dist/{dgmo-router-6YLKM6WU.js → dgmo-router-EPBQKQW2.js} +44 -45
  116. package/dist/{dimensions-DS6FWLRY.js → dimensions-DBCRBZIU.js} +4 -4
  117. package/dist/editor.js +2 -7
  118. package/dist/{flowchart-parser-J3VWIFWB.js → flowchart-parser-SM5LHF2D.js} +3 -3
  119. package/dist/{flowchart-renderer-FECH5KK5.js → flowchart-renderer-PPS2GTTD.js} +9 -9
  120. package/dist/highlight.js +3 -8
  121. package/dist/index.d.ts +42 -6
  122. package/dist/index.js +61 -56
  123. package/dist/{layout-MXHR3P35.js → layout-3J72UULM.js} +3 -3
  124. package/dist/{layout-TIBRMWHL.js → layout-AF4KA5B2.js} +3 -3
  125. package/dist/{layout-5SZ5A64I.js → layout-FCFUVCRI.js} +6 -6
  126. package/dist/{layout-KV27UW25.js → layout-H2KP5A6M.js} +1 -1
  127. package/dist/{layout-ND26WVX2.js → layout-IXQNVRBE.js} +3 -3
  128. package/dist/{layout-YBMT74MG.js → layout-KELSNWBD.js} +6 -6
  129. package/dist/{layout-JTIRCKAW.js → layout-LNVIH45F.js} +3 -3
  130. package/dist/{layout-EWXHEXNS.js → layout-MPSH3YWE.js} +6 -6
  131. package/dist/{layout-HFBK5UEG.js → layout-PPIVGJXD.js} +2 -2
  132. package/dist/{layout-RH3N46HP.js → layout-R6G4MEO3.js} +4 -3
  133. package/dist/{layout-search-AWPJWBKT.js → layout-search-C2TYUH4L.js} +4 -4
  134. package/dist/{parser-BT4NI6JY.js → parser-2AXU2MHJ.js} +3 -3
  135. package/dist/{parser-3QIFY5IN.js → parser-4BOP77CD.js} +2 -2
  136. package/dist/{parser-MA7L3XND.js → parser-4GHAYZKZ.js} +4 -4
  137. package/dist/{parser-LTRQASGB.js → parser-5HQPPVHJ.js} +3 -3
  138. package/dist/{parser-EAQPZX2B.js → parser-5RUD4A3X.js} +3 -3
  139. package/dist/{parser-BJ7RJNUM.js → parser-6WURFLOB.js} +3 -3
  140. package/dist/{parser-AR2GON37.js → parser-722KLLAQ.js} +4 -4
  141. package/dist/{parser-KMKVFET2.js → parser-B7SCN7FG.js} +2 -2
  142. package/dist/{parser-TUAEX6ML.js → parser-BNRX35NT.js} +3 -3
  143. package/dist/{parser-NL73FSFI.js → parser-BPYHIG24.js} +3 -3
  144. package/dist/{parser-3LT3ZUUC.js → parser-CRJYLOHA.js} +2 -2
  145. package/dist/{parser-NUU3DVW4.js → parser-DGLKH4NT.js} +2 -2
  146. package/dist/{parser-5UZV32ZI.js → parser-DRUGM3R6.js} +2 -2
  147. package/dist/{parser-KLCSFQ3J.js → parser-DWV2CYBS.js} +3 -3
  148. package/dist/{parser-2IKPQVKX.js → parser-F3JJNIFC.js} +3 -3
  149. package/dist/{parser-EFF22GYO.js → parser-F75WNYMK.js} +3 -3
  150. package/dist/{parser-RTWPFKXG.js → parser-GBQY3WOZ.js} +3 -3
  151. package/dist/{parser-F7NDRPMA.js → parser-GM5B2EPW.js} +3 -3
  152. package/dist/{parser-K2DI26SC.js → parser-H6HT2WFQ.js} +2 -2
  153. package/dist/{parser-PEZ7RN43.js → parser-HM6FEX5K.js} +3 -3
  154. package/dist/{parser-YG625J5H.js → parser-L7SI3PW4.js} +4 -4
  155. package/dist/{parser-GMQJISZ6.js → parser-LUJX7AXO.js} +2 -2
  156. package/dist/{parser-A3AN76RQ.js → parser-MWINQNQW.js} +3 -3
  157. package/dist/{parser-KJPPUN4D.js → parser-OHBBDCG4.js} +2 -2
  158. package/dist/{parser-BTSTKY5G.js → parser-QWTECQEC.js} +4 -4
  159. package/dist/{parser-4TBSWULQ.js → parser-TTGZYLYD.js} +3 -3
  160. package/dist/{parser-6TDWUKM5.js → parser-UHKROC7Z.js} +3 -3
  161. package/dist/{parser-H5OODY5N.js → parser-W6NX3AIV.js} +3 -3
  162. package/dist/{parser-GDLKUBTO.js → parser-WIKXZP4X.js} +2 -2
  163. package/dist/{parser-4Y6PODW6.js → parser-XEJP37GQ.js} +3 -3
  164. package/dist/{parser-RCIEKN7Y.js → parser-Y7QXD2UR.js} +2 -2
  165. package/dist/{parser-ZRIZFDZY.js → parser-ZV756RMP.js} +4 -4
  166. package/dist/{parser-KKF6Y5MM.js → parser-ZWWQZ4XZ.js} +4 -3
  167. package/dist/{redraw-AHW7EUUF.js → redraw-BZ4GI6IC.js} +6 -4
  168. package/dist/{redraw-STZ4WJAI.js → redraw-LEOXS7C6.js} +3 -3
  169. package/dist/{renderer-4VGO27EE.js → renderer-2MCV75JQ.js} +11 -11
  170. package/dist/{renderer-TINHO2IO.js → renderer-2V2XY2V7.js} +4 -4
  171. package/dist/{renderer-XDX6S7OV.js → renderer-5AEDVLAA.js} +8 -7
  172. package/dist/{renderer-W4MUMXJE.js → renderer-5GP7YUS4.js} +3 -3
  173. package/dist/{renderer-ACQQ2JXA.js → renderer-66NCRXSC.js} +6 -6
  174. package/dist/{renderer-AM7P4LN7.js → renderer-6HU44IGJ.js} +4 -4
  175. package/dist/{renderer-6BDK47V6.js → renderer-7C76HP5W.js} +6 -6
  176. package/dist/{renderer-O6RP52CQ.js → renderer-7RAMBMTH.js} +6 -6
  177. package/dist/{renderer-IGSHD3OT.js → renderer-BYLQ37T2.js} +8 -8
  178. package/dist/{renderer-7OGGV327.js → renderer-CVCCW7UT.js} +4 -4
  179. package/dist/{renderer-QTPWRRJ7.js → renderer-D6EH5UQ6.js} +6 -6
  180. package/dist/renderer-E3334XLT.js +84 -0
  181. package/dist/{renderer-IXBOT6DU.js → renderer-F7YGMEGQ.js} +2 -2
  182. package/dist/{renderer-XCLARXCK.js → renderer-GKY55M4Z.js} +5 -5
  183. package/dist/{renderer-KJ3V5BYP.js → renderer-LFZKG2GR.js} +5 -5
  184. package/dist/{renderer-2LYX6NHN.js → renderer-LJPUCG3U.js} +5 -5
  185. package/dist/{renderer-DAZWHNLI.js → renderer-MGF2NNGG.js} +3 -3
  186. package/dist/{renderer-HX6ICPDX.js → renderer-MVBAQP3M.js} +4 -4
  187. package/dist/{renderer-UGW4N2W5.js → renderer-MZIWP55B.js} +5 -5
  188. package/dist/{renderer-MWZC7TMD.js → renderer-N6PM5CSG.js} +7 -7
  189. package/dist/{renderer-ISQJ2ELA.js → renderer-N75E3UVY.js} +5 -5
  190. package/dist/{renderer-IVHD7ENY.js → renderer-ONENGXFQ.js} +6 -6
  191. package/dist/{renderer-RUSQJFFC.js → renderer-PEJF6R2I.js} +2 -2
  192. package/dist/{renderer-36446HSH.js → renderer-QZJZIAT3.js} +2 -2
  193. package/dist/{renderer-UTEEJDGB.js → renderer-SYRH3B62.js} +6 -6
  194. package/dist/{renderer-2QPHDBZY.js → renderer-TS5NHOQD.js} +5 -5
  195. package/dist/{renderer-Y47EM337.js → renderer-VNJOZPSH.js} +7 -7
  196. package/dist/{renderer-P3WR7TKD.js → renderer-VNUDN6F5.js} +11 -11
  197. package/dist/{renderer-JYHA6R2D.js → renderer-VUXAAGUG.js} +5 -5
  198. package/dist/{renderer-BXD5KVSR.js → renderer-YJVQT7QG.js} +6 -6
  199. package/dist/{renderer-radial-WFUX3Z3C.js → renderer-radial-4R7AKETK.js} +5 -5
  200. package/dist/{state-parser-PMNHLHLE.js → state-parser-EQBBEKHR.js} +4 -4
  201. package/dist/{state-renderer-JQ5DS66J.js → state-renderer-SOGZ2CNN.js} +11 -11
  202. package/dist/{themes-DzIH3Hjv.d.ts → themes-CbJL3w8L.d.ts} +1 -1
  203. package/docs/ai-integration.md +5 -6
  204. package/docs/language-reference.md +68 -104
  205. package/gallery/fixtures/whiteboard.dgmo +1 -0
  206. package/package.json +1 -1
  207. package/dist/chunk-6BQSDF77.js +0 -734
  208. package/dist/chunk-NWSPPGIE.js +0 -60
  209. package/dist/chunk-VBMRZCMQ.js +0 -1465
  210. package/dist/chunk-WZBZXZ6T.js +0 -636
  211. package/dist/layout-D4L44NRG.js +0 -11
  212. package/dist/parser-YHDGKPZI.js +0 -14
  213. package/dist/renderer-WPN2SXGT.js +0 -29
  214. package/dist/renderer-ZV6KCLCL.js +0 -85
  215. package/gallery/fixtures/sketch.dgmo +0 -22
@@ -3,7 +3,7 @@ import {
3
3
  getSimpleChartLegendGroups,
4
4
  parseChart,
5
5
  parseExtendedChart
6
- } from "./chunk-H6BT45SN.js";
6
+ } from "./chunk-P2GNNEMN.js";
7
7
  import {
8
8
  computeQuadrantPointLabels,
9
9
  rectCircleOverlap,
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-2CW5ZTNH.js";
29
29
  import {
30
30
  layoutInlineHeader
31
- } from "./chunk-UIEKW4SG.js";
31
+ } from "./chunk-R5L5E3TC.js";
32
32
  import {
33
33
  TITLE_FONT_SIZE,
34
34
  TITLE_FONT_WEIGHT,
@@ -43,7 +43,7 @@ import {
43
43
  } from "./chunk-ICLB27PZ.js";
44
44
  import {
45
45
  tagAttrKey
46
- } from "./chunk-4SACN2C5.js";
46
+ } from "./chunk-LGUFJ7Y2.js";
47
47
  import {
48
48
  LEGEND_DOT_R,
49
49
  LEGEND_ENTRY_FONT_SIZE,
@@ -376,6 +376,8 @@ var LABEL_ROTATE_DEG = 40;
376
376
  var NEVER_THIN_MAX = 12;
377
377
  var LABEL_GAP = 8;
378
378
  var LABEL_LINE_HEIGHT = 1.25;
379
+ var ROTATED_LABEL_PAD = 12;
380
+ var MIN_CAPPED_LABEL_W = 40;
379
381
  function spreadIndices(total, count) {
380
382
  if (total <= 0) return /* @__PURE__ */ new Set();
381
383
  if (total === 1 || count <= 1) return /* @__PURE__ */ new Set([0]);
@@ -416,7 +418,7 @@ function planCategoryLabels(labels, slot, font = TICK_FONT) {
416
418
  return {
417
419
  rotate: true,
418
420
  stride,
419
- height: Math.round(widest * Math.sin(rad)) + 12,
421
+ height: Math.round(widest * Math.sin(rad)) + ROTATED_LABEL_PAD,
420
422
  keep: all(stride)
421
423
  };
422
424
  }
@@ -425,29 +427,41 @@ function rotatedLeftReach(first, plan, font) {
425
427
  const rad = LABEL_ROTATE_DEG * Math.PI / 180;
426
428
  return measureText(first, font) * Math.cos(rad) + font * 0.8 * Math.sin(rad);
427
429
  }
428
- function planLabelsFitLeft(labels, mLeft0, plotWFor, slotFor, firstOffset, font = TICK_FONT) {
430
+ function planLabelsFitLeft(labels, mLeft0, plotWFor, slotFor, firstOffset, font = TICK_FONT, maxHeight = Infinity) {
429
431
  const EDGE = 4;
430
- let mLeft = mLeft0;
431
- let plotW = plotWFor(mLeft);
432
- let plan = planCategoryLabels(labels, slotFor(plotW), font);
433
- for (let i = 0; i < 6; i++) {
434
- const reach = rotatedLeftReach(labels[0], plan, font);
435
- const need = Math.ceil(reach + EDGE - firstOffset(plotW));
436
- const next = Math.max(mLeft0, need);
437
- if (next === mLeft) break;
438
- mLeft = next;
439
- plotW = plotWFor(mLeft);
440
- plan = planCategoryLabels(labels, slotFor(plotW), font);
441
- }
442
- return { mLeft, plotW, plan };
432
+ const settle = (shown) => {
433
+ let mLeft = mLeft0;
434
+ let plotW = plotWFor(mLeft);
435
+ let plan = planCategoryLabels(shown, slotFor(plotW), font);
436
+ for (let i = 0; i < 6; i++) {
437
+ const reach = rotatedLeftReach(shown[0], plan, font);
438
+ const need = Math.ceil(reach + EDGE - firstOffset(plotW));
439
+ const next = Math.max(mLeft0, need);
440
+ if (next === mLeft) break;
441
+ mLeft = next;
442
+ plotW = plotWFor(mLeft);
443
+ plan = planCategoryLabels(shown, slotFor(plotW), font);
444
+ }
445
+ return { mLeft, plotW, plan, shown };
446
+ };
447
+ const fit = settle(labels);
448
+ if (!fit.plan.rotate || fit.plan.height <= maxHeight) return fit;
449
+ const rad = LABEL_ROTATE_DEG * Math.PI / 180;
450
+ const maxW = Math.max(
451
+ MIN_CAPPED_LABEL_W,
452
+ Math.floor((maxHeight - ROTATED_LABEL_PAD) / Math.sin(rad))
453
+ );
454
+ return settle(labels.map((t) => truncateText(t, font, maxW)));
443
455
  }
444
456
  function labelSurvives(plan, i) {
445
457
  return plan.keep.has(i);
446
458
  }
447
- function drawCategoryLabels(svg, labels, plan, xFor, baseline, textColor, font = TICK_FONT) {
459
+ function drawCategoryLabels(svg, labels, plan, xFor, baseline, textColor, font = TICK_FONT, full = labels) {
448
460
  labels.forEach((label, i) => {
449
461
  if (!labelSurvives(plan, i)) return;
450
462
  const t = svg.append("text").attr("class", "dgmo-tick").attr("fill", textColor).attr("font-size", font).attr("font-family", FONT_FAMILY).text(label);
463
+ const whole = full[i];
464
+ if (whole !== void 0 && whole !== label) t.append("title").text(whole);
451
465
  if (plan.rotate) {
452
466
  t.attr(
453
467
  "transform",
@@ -462,6 +476,8 @@ function drawCategoryLabels(svg, labels, plan, xFor, baseline, textColor, font =
462
476
  // src/charts-d3/bar.ts
463
477
  import { scaleBand, scaleLinear } from "d3-scale";
464
478
  import { max as d3max, min as d3min } from "d3-array";
479
+ var LABEL_REGION_SHARE = 0.35;
480
+ var PLOT_MIN_SHARE = 0.6;
465
481
  function seriesValues(pt, seriesCount) {
466
482
  const out = [pt.value];
467
483
  for (let s = 1; s < seriesCount; s++) out.push(pt.extraValues?.[s - 1] ?? 0);
@@ -507,24 +523,38 @@ function renderBar(svg, chart, width, height, colors, palette, isDark, textColor
507
523
  const hiVal = Math.max(0, maxVal);
508
524
  const loVal = Math.min(0, minVal);
509
525
  const niceMax = hiVal === 0 && loVal === 0 ? 1 : hiVal;
510
- const leftLabels = horizontal ? data.map((d) => d.label) : [fmtNum(niceMax), fmtNum(niceMax / 2), fmtNum(loVal), fmtNum(loVal / 2)];
511
- const mLeft0 = computeLeftMargin(chart.ylabel, leftLabels);
512
526
  const catLabels = data.map((d) => d.label);
527
+ const sideShown = horizontal ? catLabels.map(
528
+ (t) => truncateText(t, TICK_FONT, width * LABEL_REGION_SHARE)
529
+ ) : catLabels;
530
+ const leftLabels = horizontal ? sideShown : [fmtNum(niceMax), fmtNum(niceMax / 2), fmtNum(loVal), fmtNum(loVal / 2)];
531
+ const mLeft0 = computeLeftMargin(chart.ylabel, leftLabels);
532
+ const mTop = top + 8;
533
+ const xTitleBand = chart.xlabel ? 40 : 18;
534
+ const labelCap = Math.floor(
535
+ Math.min(
536
+ height * LABEL_REGION_SHARE,
537
+ height * (1 - PLOT_MIN_SHARE) - mTop - xTitleBand
538
+ )
539
+ );
513
540
  const fit = horizontal ? null : planLabelsFitLeft(
514
541
  catLabels,
515
542
  mLeft0,
516
543
  (ml) => width - ml - 32,
517
544
  (pw) => data.length === 0 ? Infinity : pw / data.length,
518
545
  // scaleBand padding 0.3: first centre sits 0.65 steps in
519
- (pw) => pw / (data.length + 0.3) * 0.65
546
+ (pw) => pw / (data.length + 0.3) * 0.65,
547
+ TICK_FONT,
548
+ labelCap
520
549
  );
521
550
  const mLeft = fit ? fit.mLeft : mLeft0;
522
551
  const plotW = fit ? fit.plotW : width - mLeft - 32;
523
552
  const labelPlan = fit?.plan ?? planCategoryLabels(catLabels, Infinity);
553
+ const shown = fit?.shown ?? sideShown;
524
554
  const m = {
525
- top: top + 8,
555
+ top: mTop,
526
556
  right: 32,
527
- bottom: horizontal ? 64 : Math.max(64, labelPlan.height + (chart.xlabel ? 40 : 18)),
557
+ bottom: horizontal ? 64 : Math.max(64, labelPlan.height + xTitleBand),
528
558
  left: mLeft
529
559
  };
530
560
  const plotH = height - m.top - m.bottom;
@@ -545,18 +575,21 @@ function renderBar(svg, chart, width, height, colors, palette, isDark, textColor
545
575
  }
546
576
  }
547
577
  if (horiz) {
548
- for (const d of data) {
578
+ data.forEach((d, i) => {
549
579
  const c = (cat(d.label) ?? 0) + cat.bandwidth() / 2;
550
- svg.append("text").attr("x", m.left - 10).attr("y", c + 4).attr("text-anchor", "end").attr("fill", textColor).attr("font-size", TICK_FONT).attr("font-family", FONT_FAMILY).text(d.label);
551
- }
580
+ const t = svg.append("text").attr("x", m.left - 10).attr("y", c + 4).attr("text-anchor", "end").attr("fill", textColor).attr("font-size", TICK_FONT).attr("font-family", FONT_FAMILY).text(shown[i]);
581
+ if (shown[i] !== d.label) t.append("title").text(d.label);
582
+ });
552
583
  } else {
553
584
  drawCategoryLabels(
554
585
  svg,
555
- data.map((d) => d.label),
586
+ shown,
556
587
  labelPlan,
557
588
  (i) => (cat(data[i].label) ?? 0) + cat.bandwidth() / 2,
558
589
  m.top + plotH,
559
- textColor
590
+ textColor,
591
+ TICK_FONT,
592
+ catLabels
560
593
  );
561
594
  }
562
595
  const zero = val(0);
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-ICLB27PZ.js";
18
18
  import {
19
19
  fillModeFromOptions
20
- } from "./chunk-TIIZIAGS.js";
20
+ } from "./chunk-FUYEXLAN.js";
21
21
  import {
22
22
  CHAR_WIDTH_RATIO,
23
23
  measureText