@diagrammo/dgmo 0.54.0 → 0.55.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 (196) hide show
  1. package/dist/advanced.d.ts +76 -9
  2. package/dist/advanced.js +118 -95
  3. package/dist/auto.js +125 -124
  4. package/dist/auto.mjs +1579 -282
  5. package/dist/block.js +49 -48
  6. package/dist/chart-meta.js +43 -43
  7. package/dist/{charts-d3-25E4VWXO.js → charts-d3-KZ6V4OP2.js} +7 -6
  8. package/dist/{chunk-MTZOXISJ.js → chunk-2HX6ZGY7.js} +3 -3
  9. package/dist/{chunk-ICKXIMBA.js → chunk-2R6HG6D5.js} +5 -5
  10. package/dist/{chunk-NUTWTV6G.js → chunk-2ZJXKJSI.js} +102 -56
  11. package/dist/{chunk-LPJ6H5X4.js → chunk-32HUNA33.js} +53 -11
  12. package/dist/{chunk-UIT7E6UF.js → chunk-3BFXELBL.js} +51 -4
  13. package/dist/{chunk-C2UORMIA.js → chunk-3BZJ5KD5.js} +7 -3
  14. package/dist/{chunk-A3BDLDYG.js → chunk-3FUTFYSP.js} +57 -18
  15. package/dist/{chunk-DPGQ5UMO.js → chunk-4MZCJV4M.js} +6 -6
  16. package/dist/{chunk-WWHECSYZ.js → chunk-4R5KIPNX.js} +2 -2
  17. package/dist/{chunk-47JNEKJA.js → chunk-5D5VHDJM.js} +43 -8
  18. package/dist/{chunk-KQYQECWQ.js → chunk-5H5GWWA4.js} +49 -13
  19. package/dist/{chunk-RRGKMJYL.js → chunk-5K5XBEXT.js} +8 -3
  20. package/dist/{chunk-HAA25PLC.js → chunk-6NJWBMJV.js} +44 -9
  21. package/dist/{chunk-3FRO35WW.js → chunk-A2ARDILY.js} +17 -3
  22. package/dist/{chunk-TLNVYWPA.js → chunk-A2PTRSAO.js} +2 -2
  23. package/dist/{chunk-APKUAJ2L.js → chunk-A2RUBBVT.js} +14 -1
  24. package/dist/{chunk-KS5ZSM5T.js → chunk-A4UJP4IS.js} +61 -13
  25. package/dist/{chunk-LRSW4JLE.js → chunk-AKE6C2D7.js} +3 -3
  26. package/dist/{chunk-2NZOHEP4.js → chunk-ASPS5O6F.js} +3 -3
  27. package/dist/{chunk-KV4HLIJE.js → chunk-AU75JHSR.js} +6 -3
  28. package/dist/{chunk-R5BGGBFF.js → chunk-DS4MDEQ7.js} +2 -2
  29. package/dist/{chunk-7JDTNFAK.js → chunk-EFUQENO5.js} +76 -32
  30. package/dist/{chunk-BULHGPHK.js → chunk-EMSOFHEN.js} +2 -2
  31. package/dist/{chunk-IYNKLCAZ.js → chunk-ETTDF3S2.js} +45 -7
  32. package/dist/{chunk-KDK5EKUR.js → chunk-ETYF5QZR.js} +2 -2
  33. package/dist/{chunk-COJW2NEY.js → chunk-F5ZNUMSY.js} +50 -11
  34. package/dist/{chunk-EAI6XJ7D.js → chunk-FBP33UM6.js} +3 -3
  35. package/dist/{chunk-KINOX74I.js → chunk-FGAMFJNJ.js} +48 -10
  36. package/dist/{chunk-J7HQPVYH.js → chunk-GRXPFBYC.js} +23 -2
  37. package/dist/{chunk-GQ5ECRP4.js → chunk-GTO5VCYG.js} +3 -3
  38. package/dist/{chunk-RJ5LBZ5U.js → chunk-HES4K6DV.js} +13 -13
  39. package/dist/{chunk-ADCHLNWT.js → chunk-HGKOVKAX.js} +3 -3
  40. package/dist/{chunk-EPRF3ZRV.js → chunk-HLGOG44K.js} +2 -2
  41. package/dist/{chunk-KQ3FNRGR.js → chunk-HUTP35XT.js} +5 -4
  42. package/dist/{chunk-OJ435DQZ.js → chunk-HX7QNHC6.js} +3 -3
  43. package/dist/{chunk-6KL7TFLS.js → chunk-IALX52TR.js} +2 -2
  44. package/dist/{chunk-7SP4C6EV.js → chunk-IF4KYSJZ.js} +7 -3
  45. package/dist/{chunk-5XSNLXU5.js → chunk-IG6J7JWH.js} +51 -12
  46. package/dist/{chunk-M24VXUFG.js → chunk-IIUYKQ5J.js} +3 -3
  47. package/dist/{chunk-5VXU6MND.js → chunk-INTAQV2Y.js} +2 -2
  48. package/dist/{chunk-3KHJJP3J.js → chunk-ITXL2KU5.js} +2 -2
  49. package/dist/{chunk-I47VHSPS.js → chunk-IWG2ECAO.js} +2 -2
  50. package/dist/{chunk-CSHFU6LT.js → chunk-JGCEFKZP.js} +7 -7
  51. package/dist/{chunk-O576GYAP.js → chunk-JQLSFZZP.js} +2 -2
  52. package/dist/{chunk-AHTTKERF.js → chunk-JR7Q6GHE.js} +2 -2
  53. package/dist/{chunk-4T6OCSJ2.js → chunk-KC3WBBI7.js} +3 -3
  54. package/dist/{chunk-BM7MG6HT.js → chunk-KK3L5NVK.js} +3 -3
  55. package/dist/{chunk-FR6UFVSV.js → chunk-L2DIXZUT.js} +91 -41
  56. package/dist/{chunk-WW4BQ744.js → chunk-LCRPGGGS.js} +6 -6
  57. package/dist/{chunk-GKYHWJXI.js → chunk-LKGQ46P4.js} +3 -3
  58. package/dist/{chunk-IOIMQHQ6.js → chunk-LW7STMYZ.js} +2 -2
  59. package/dist/{chunk-OR3R27CU.js → chunk-M53MDBIW.js} +2 -2
  60. package/dist/{chunk-T7Y554OK.js → chunk-MEH4TJEX.js} +4 -4
  61. package/dist/{chunk-T3FAJAJT.js → chunk-MNS2ENXF.js} +3 -3
  62. package/dist/{chunk-CCGWX6AO.js → chunk-MSWIBF6J.js} +2 -2
  63. package/dist/{chunk-B7N5KYXQ.js → chunk-NL7FUIVD.js} +4 -4
  64. package/dist/{chunk-EQOMY4PY.js → chunk-NN5TF4OV.js} +2 -2
  65. package/dist/{chunk-BZJIITYM.js → chunk-NPPUZ4SK.js} +4 -4
  66. package/dist/{chunk-XWODFBHJ.js → chunk-NYOOPQFD.js} +7 -3
  67. package/dist/{chunk-VQFDBNYF.js → chunk-O4CZDTQA.js} +3 -3
  68. package/dist/{chunk-FVMKCZHF.js → chunk-P5XXIVEU.js} +2 -2
  69. package/dist/{chunk-F7XM366V.js → chunk-PC4YLEKA.js} +3 -3
  70. package/dist/{chunk-AQEYUVGJ.js → chunk-PCVXXPYU.js} +12 -5
  71. package/dist/{chunk-TJN2OIVG.js → chunk-PKUWYPI5.js} +180 -12
  72. package/dist/{chunk-W6PCFRPL.js → chunk-PSIDVCBA.js} +2 -2
  73. package/dist/{chunk-RIEAN4D5.js → chunk-PV7ND5WL.js} +48 -8
  74. package/dist/{chunk-7K6NDSXH.js → chunk-Q5CMQVWF.js} +3 -3
  75. package/dist/{chunk-FFVFZLRT.js → chunk-QQXFYTLC.js} +346 -46
  76. package/dist/{chunk-N7BSBAVP.js → chunk-QZYGRDMM.js} +108 -89
  77. package/dist/{chunk-U4IN6AHE.js → chunk-RKBCKCSF.js} +2 -2
  78. package/dist/{chunk-GK32ZFZY.js → chunk-RSBH2C7O.js} +3 -3
  79. package/dist/{chunk-OSXQKC3S.js → chunk-RYNCWA5X.js} +6 -3
  80. package/dist/{chunk-S7YFT3PO.js → chunk-RZWIPDZ2.js} +3 -3
  81. package/dist/{chunk-7UPFTBOW.js → chunk-S52F62GW.js} +4 -4
  82. package/dist/{chunk-WKNAJ4BR.js → chunk-SCOHNGPG.js} +51 -10
  83. package/dist/{chunk-BWYFIVZF.js → chunk-UBQU2BY6.js} +3 -3
  84. package/dist/{chunk-VMSBMIHW.js → chunk-UES4P7FN.js} +2 -2
  85. package/dist/chunk-US3P2DQO.js +87 -0
  86. package/dist/{chunk-AJFHNS67.js → chunk-UXXLE6AH.js} +5 -5
  87. package/dist/{chunk-M3H7ZE6C.js → chunk-VMWSZCAK.js} +5 -4
  88. package/dist/{chunk-S7FOIURR.js → chunk-VVIRAGID.js} +6 -6
  89. package/dist/{chunk-3SBHODJ4.js → chunk-VXTUWXFB.js} +48 -9
  90. package/dist/{chunk-HFEOOQ46.js → chunk-W4TSD3IP.js} +2 -2
  91. package/dist/{chunk-7U4OR7CD.js → chunk-WB3NA3JJ.js} +2 -2
  92. package/dist/{chunk-3SEEP2JM.js → chunk-WITOJZGL.js} +8 -4
  93. package/dist/{chunk-6OYDOQ2Q.js → chunk-WVGNXDEE.js} +2 -2
  94. package/dist/{chunk-UEU6IYKY.js → chunk-X3X4LZDC.js} +2 -2
  95. package/dist/{chunk-SBOAZ7YK.js → chunk-XKKH2DPG.js} +39 -39
  96. package/dist/{chunk-NR5HCAUD.js → chunk-XSVWUOUZ.js} +1 -1
  97. package/dist/{chunk-62Y27T4C.js → chunk-Y4BBGFKY.js} +2 -2
  98. package/dist/{chunk-YENNFS5F.js → chunk-YP2T5YUP.js} +8 -3
  99. package/dist/{chunk-2NYXI35Z.js → chunk-YXKNXIWA.js} +5 -4
  100. package/dist/{chunk-KBVOVDYP.js → chunk-ZGIBV36U.js} +3 -3
  101. package/dist/{chunk-4ZIKWVSQ.js → chunk-ZP265ICS.js} +4 -4
  102. package/dist/{chunk-DLU643TF.js → chunk-ZWVKTWK6.js} +3 -3
  103. package/dist/{chunk-QBYP2FBZ.js → chunk-ZXNHHO6D.js} +2 -2
  104. package/dist/cli.cjs +150 -147
  105. package/dist/clock.js +34 -1
  106. package/dist/completion-registry.js +12 -4
  107. package/dist/dgmo-router-T4HGLIGA.js +88 -0
  108. package/dist/{dimensions-L6BXQXXL.js → dimensions-3JINHSYK.js} +6 -6
  109. package/dist/editor.js +10 -1
  110. package/dist/element.js +124 -123
  111. package/dist/element.mjs +1579 -282
  112. package/dist/{flowchart-parser-UKYOW3VM.js → flowchart-parser-M7KKTLX7.js} +4 -4
  113. package/dist/{flowchart-renderer-DCFKUDDR.js → flowchart-renderer-FFEQFQEU.js} +5 -5
  114. package/dist/highlight.js +10 -1
  115. package/dist/index.js +58 -48
  116. package/dist/{layout-G2ABQJQZ.js → layout-3ZZBKUQC.js} +3 -3
  117. package/dist/{layout-CH4HFFRD.js → layout-AUKTWGYL.js} +4 -4
  118. package/dist/{layout-QBNAMEOA.js → layout-CRLTSFYQ.js} +3 -3
  119. package/dist/{layout-25Y3VDYF.js → layout-FNZDJGKF.js} +4 -4
  120. package/dist/{layout-NY7MHJCL.js → layout-GHWRJKZQ.js} +4 -4
  121. package/dist/{layout-ITLPDG6M.js → layout-LGXOKUCD.js} +4 -4
  122. package/dist/{layout-A6OIGZN2.js → layout-UR7CYAHL.js} +2 -2
  123. package/dist/{layout-4SPLI4HG.js → layout-UTMEVFHN.js} +4 -4
  124. package/dist/{layout-search-LUI475P3.js → layout-search-U2H4ORFJ.js} +8 -6
  125. package/dist/{parser-XRDUX2AR.js → parser-2AXPSKWB.js} +5 -5
  126. package/dist/{parser-B2A7XOAK.js → parser-2AZ2KQTO.js} +4 -4
  127. package/dist/{parser-VVE4THG3.js → parser-2LF33IS2.js} +4 -4
  128. package/dist/{parser-MHKYQPC2.js → parser-3QJ2Z4H4.js} +3 -3
  129. package/dist/parser-5GCQFSTQ.js +13 -0
  130. package/dist/{parser-XCPMEB2Z.js → parser-62OHBRU5.js} +3 -3
  131. package/dist/{parser-GML6V2KZ.js → parser-7LYJFZCP.js} +4 -4
  132. package/dist/{parser-LTA2BOZO.js → parser-BMOTF72G.js} +3 -3
  133. package/dist/{parser-FHRMFUNX.js → parser-CIFLYZYP.js} +3 -3
  134. package/dist/{parser-KTYF6WO5.js → parser-D2UL2G5U.js} +3 -3
  135. package/dist/{parser-5C3PEZK3.js → parser-DM2APTKB.js} +3 -3
  136. package/dist/{parser-X5XLFY4Z.js → parser-DYYTPLBL.js} +4 -4
  137. package/dist/{parser-WPPJGB4R.js → parser-GOUGUTPU.js} +4 -4
  138. package/dist/{parser-T3D7BV6O.js → parser-HGVUVD6J.js} +3 -3
  139. package/dist/{parser-F4FEU57T.js → parser-IEJD3CZB.js} +3 -3
  140. package/dist/{parser-FY3YFFBS.js → parser-JBEWNLAV.js} +5 -5
  141. package/dist/{parser-2UWWNTFL.js → parser-JMXPHNZD.js} +4 -4
  142. package/dist/{parser-YULS5MLD.js → parser-JMXSQY3K.js} +4 -4
  143. package/dist/{parser-YPWYT46P.js → parser-LUXS7J32.js} +4 -4
  144. package/dist/{parser-O7YQYFEN.js → parser-M5BUHULF.js} +4 -4
  145. package/dist/{parser-MVSYFK63.js → parser-MESRHUS4.js} +4 -4
  146. package/dist/{parser-HA3PF5FL.js → parser-OOYNI2UT.js} +4 -4
  147. package/dist/{parser-OPIXXUY4.js → parser-PVBUAVRR.js} +4 -4
  148. package/dist/{parser-3RXYQSA7.js → parser-QKRBSQLJ.js} +5 -5
  149. package/dist/{parser-CCNJKDDA.js → parser-S6NWSIJO.js} +4 -4
  150. package/dist/{parser-S4EJPNVN.js → parser-SFEK6Q7Z.js} +4 -4
  151. package/dist/{parser-7UI6UQ7B.js → parser-SUV52NQW.js} +4 -4
  152. package/dist/{parser-ESHNUFME.js → parser-SZHGLOOZ.js} +4 -4
  153. package/dist/{parser-66RYGJRB.js → parser-TO7IENWL.js} +4 -4
  154. package/dist/{parser-FPCWDYQV.js → parser-TVAMC7CQ.js} +4 -4
  155. package/dist/{parser-LU7UAKNB.js → parser-VAW46R57.js} +4 -4
  156. package/dist/{parser-6MQM7WT3.js → parser-XDSPOXSE.js} +4 -4
  157. package/dist/pert.d.ts +2 -0
  158. package/dist/{renderer-YVMETH6V.js → renderer-3PWLOJPD.js} +8 -8
  159. package/dist/{renderer-7HMZ5OCJ.js → renderer-5EMHIQL5.js} +3 -3
  160. package/dist/{renderer-2DME63VZ.js → renderer-5PODNLYP.js} +4 -4
  161. package/dist/{renderer-4A32DX5L.js → renderer-AQJIQ2XU.js} +7 -6
  162. package/dist/{renderer-RMAM2SOJ.js → renderer-BEW3AYFT.js} +8 -8
  163. package/dist/{renderer-YP3P6UVT.js → renderer-C3UYAXA6.js} +8 -6
  164. package/dist/{renderer-X2LYSMLU.js → renderer-CENXCMWG.js} +3 -3
  165. package/dist/{renderer-6CFML5G3.js → renderer-CXM3ARYN.js} +8 -7
  166. package/dist/{renderer-LHVCKEWF.js → renderer-DW6TEBLA.js} +8 -7
  167. package/dist/{renderer-Y3NXZINM.js → renderer-FE5M6SEZ.js} +8 -7
  168. package/dist/{renderer-G4UOW3RH.js → renderer-FXK6ZL3P.js} +3 -3
  169. package/dist/{renderer-4K5YYX5R.js → renderer-G5ESLCJB.js} +9 -8
  170. package/dist/{renderer-P3YQES7B.js → renderer-HTDS4FED.js} +9 -8
  171. package/dist/{renderer-YEFOOULC.js → renderer-IO4KCFVL.js} +8 -8
  172. package/dist/{renderer-FXMGCSRP.js → renderer-IRAFJNTK.js} +7 -6
  173. package/dist/{renderer-SES7QZYL.js → renderer-MFTTFW32.js} +9 -8
  174. package/dist/{renderer-Z4GNKNXO.js → renderer-MPXI4FVL.js} +6 -6
  175. package/dist/{renderer-RA4PTAMF.js → renderer-NVBEMQ6L.js} +5 -5
  176. package/dist/{renderer-7ZNVOVFG.js → renderer-OOGDCR6K.js} +3 -3
  177. package/dist/{renderer-CJ56SUMF.js → renderer-Q5P72O4A.js} +7 -7
  178. package/dist/{renderer-WCWI4I6A.js → renderer-QZESC66H.js} +2 -2
  179. package/dist/{renderer-B7Y6I7JX.js → renderer-RDBUXW7P.js} +4 -4
  180. package/dist/{renderer-V5SNTPAM.js → renderer-S4XB3JR2.js} +9 -9
  181. package/dist/{renderer-COJZZ4F6.js → renderer-SIWEEWJ5.js} +7 -6
  182. package/dist/{renderer-C3RI4OPJ.js → renderer-TKTM2SL4.js} +8 -7
  183. package/dist/{renderer-WVD6G2TS.js → renderer-TXTTV4HA.js} +8 -7
  184. package/dist/{renderer-HQ4JFZOV.js → renderer-UZIU4AHK.js} +7 -6
  185. package/dist/{renderer-3VY3VXJE.js → renderer-V72VJIGG.js} +9 -8
  186. package/dist/{renderer-PLVIARM7.js → renderer-VEGOEZOI.js} +7 -6
  187. package/dist/{renderer-OZX5KGQM.js → renderer-W6I6T2TA.js} +6 -6
  188. package/dist/{renderer-TQ5QDZOE.js → renderer-WSHJRR2T.js} +6 -6
  189. package/dist/{renderer-radial-VYBZAXXE.js → renderer-radial-AG75PBYD.js} +7 -7
  190. package/dist/{resolver-WFKZYBJ2.js → resolver-ZSFQQRTH.js} +3 -3
  191. package/dist/{state-parser-VIW2WNA5.js → state-parser-KIPZGIB4.js} +5 -5
  192. package/dist/{state-renderer-H22AQD3U.js → state-renderer-U6OSJG52.js} +9 -8
  193. package/docs/language-reference.md +2 -1
  194. package/package.json +1 -1
  195. package/dist/dgmo-router-TGZWFIZO.js +0 -88
  196. package/dist/parser-6GN5YJBJ.js +0 -13
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tryCollectNote
3
- } from "./chunk-WWHECSYZ.js";
3
+ } from "./chunk-4R5KIPNX.js";
4
4
  import {
5
5
  resolveNotes
6
6
  } from "./chunk-QZAW5SFH.js";
@@ -19,7 +19,7 @@ import {
19
19
  tagAttrKey,
20
20
  validateTagGroupNames,
21
21
  validateTagValues
22
- } from "./chunk-AHTTKERF.js";
22
+ } from "./chunk-JR7Q6GHE.js";
23
23
  import {
24
24
  BOXES_AND_LINES_REGISTRY,
25
25
  OPTION_NOCOLON_RE,
@@ -30,7 +30,7 @@ import {
30
30
  tryParseSharedOption,
31
31
  warnUnknownMetaKeys,
32
32
  withTagAliases
33
- } from "./chunk-3FRO35WW.js";
33
+ } from "./chunk-A2ARDILY.js";
34
34
  import {
35
35
  makeDgmoError,
36
36
  suggest
@@ -833,4 +833,4 @@ export {
833
833
  looksLikeBoxesAndLines,
834
834
  parseBoxesAndLines
835
835
  };
836
- //# sourceMappingURL=chunk-7UPFTBOW.js.map
836
+ //# sourceMappingURL=chunk-S52F62GW.js.map
@@ -18,12 +18,16 @@ import {
18
18
  import {
19
19
  ScaleContext
20
20
  } from "./chunk-YYVTBZZC.js";
21
+ import {
22
+ layoutInlineHeader
23
+ } from "./chunk-US3P2DQO.js";
21
24
  import {
22
25
  renderIntegratedLegend
23
- } from "./chunk-2NZOHEP4.js";
26
+ } from "./chunk-ASPS5O6F.js";
24
27
  import {
28
+ getLegendExtent,
25
29
  getMaxLegendReservedHeight
26
- } from "./chunk-J7HQPVYH.js";
30
+ } from "./chunk-GRXPFBYC.js";
27
31
  import {
28
32
  TITLE_FONT_SIZE,
29
33
  TITLE_FONT_WEIGHT,
@@ -47,11 +51,12 @@ import {
47
51
  } from "./chunk-JYDMBWRP.js";
48
52
  import {
49
53
  resolveTagColor
50
- } from "./chunk-AHTTKERF.js";
54
+ } from "./chunk-JR7Q6GHE.js";
51
55
  import {
52
56
  fillModeFromOptions,
57
+ legendInlineRequested,
53
58
  legendSuppressed
54
- } from "./chunk-3FRO35WW.js";
59
+ } from "./chunk-A2ARDILY.js";
55
60
  import {
56
61
  resolveColor
57
62
  } from "./chunk-ZKPPI6BF.js";
@@ -315,6 +320,32 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
315
320
  );
316
321
  const needsLegend = (legendGroups.length > 0 || hasAnyDescriptions && !!onToggleDescriptions) && !noLegend;
317
322
  const legendH = needsLegend ? sLegendHeight + 8 : 0;
323
+ const inlineRequested = legendInlineRequested(parsed.options);
324
+ const legendExtent = inlineRequested && needsLegend ? getLegendExtent(
325
+ {
326
+ groups: legendGroups,
327
+ position: {
328
+ placement: "top-center",
329
+ titleRelation: "inline-with-title"
330
+ },
331
+ mode: exportMode ? "export" : "preview",
332
+ showInactivePills: true
333
+ },
334
+ { activeGroup },
335
+ width
336
+ ) : { width: 0, height: 0 };
337
+ const header = layoutInlineHeader({
338
+ requested: inlineRequested,
339
+ title: parsed.title ?? "",
340
+ hasLegend: needsLegend,
341
+ legendWidth: legendExtent.width,
342
+ legendHeight: legendExtent.height,
343
+ containerWidth: width,
344
+ titleBandHeight: titleOffset,
345
+ legendReserve: legendH,
346
+ titleBaselineY: sTitleY,
347
+ titleFontSize: sTitleFontSize
348
+ });
318
349
  const groupLabelsSet = new Set(layout.groups.map((g) => g.label));
319
350
  let labelZoneExtension = 0;
320
351
  for (const group of parsed.groups) {
@@ -323,19 +354,20 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
323
354
  }
324
355
  }
325
356
  const contentW = layout.width;
326
- const contentH = layout.height + titleOffset + legendH + labelZoneExtension;
357
+ const vOverhead = titleOffset + (header.inline ? 0 : legendH) + labelZoneExtension;
358
+ const availH = Math.max(1, height - vOverhead - sDiagramPadding * 2);
327
359
  const scaleX = width / (contentW + sDiagramPadding * 2);
328
- const scaleY = height / (contentH + sDiagramPadding * 2);
360
+ const scaleY = availH / layout.height;
329
361
  const scale = Math.min(scaleX, scaleY, 3);
330
362
  const offsetX = (width - contentW * scale) / 2;
331
- const offsetY = sDiagramPadding + titleOffset + legendH;
363
+ const offsetY = sDiagramPadding + titleOffset + (header.inline ? 0 : legendH);
332
364
  const svg = d3Selection.select(container).append("svg").attr("width", width).attr("height", height).attr("viewBox", `0 0 ${width} ${height}`).attr("preserveAspectRatio", "xMidYMin meet").style("font-family", FONT_FAMILY).style("background", palette.bg);
333
365
  if (sctx.isBelowFloor) {
334
366
  svg.attr("width", "100%");
335
367
  }
336
368
  const defs = svg.append("defs");
337
369
  if (showTitle) {
338
- svg.append("text").attr("x", width / 2).attr("y", sTitleY).attr("text-anchor", "middle").attr("font-size", sTitleFontSize).attr("font-weight", TITLE_FONT_WEIGHT).attr("fill", palette.text).text(parsed.title);
370
+ svg.append("text").attr("class", "chart-title").attr("x", header.titleX).attr("y", sTitleY).attr("text-anchor", header.titleAnchor).attr("font-size", sTitleFontSize).attr("font-weight", TITLE_FONT_WEIGHT).attr("fill", palette.text).text(parsed.title);
339
371
  }
340
372
  const diagramG = svg.append("g").attr("transform", `translate(${offsetX},${offsetY}) scale(${scale})`);
341
373
  const arrowColors = /* @__PURE__ */ new Set();
@@ -710,11 +742,20 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
710
742
  }
711
743
  }
712
744
  };
713
- const legendG = svg.append("g").attr("transform", `translate(0,${titleOffset + 4})`);
745
+ const legendG = svg.append("g").attr(
746
+ "transform",
747
+ header.inline ? `translate(${header.legendX}, ${header.legendY})` : `translate(0,${titleOffset + 4})`
748
+ );
714
749
  renderIntegratedLegend(legendG, {
715
750
  groups: legendGroups,
716
751
  activeGroup,
717
752
  mode: exportMode ? "export" : "preview",
753
+ // Inline → left-origin so the wrapper's right-flush translate lands the
754
+ // legend at the chart's right edge; stacked → centered below the title.
755
+ position: {
756
+ placement: "top-center",
757
+ titleRelation: header.inline ? "inline-with-title" : "below-title"
758
+ },
718
759
  // Keep inactive sibling tag groups visible as collapsed pills so the user
719
760
  // can click one to flip the active colouring dimension (preview only).
720
761
  showInactivePills: true,
@@ -759,4 +800,4 @@ export {
759
800
  renderBoxesAndLines,
760
801
  renderBoxesAndLinesForExport
761
802
  };
762
- //# sourceMappingURL=chunk-WKNAJ4BR.js.map
803
+ //# sourceMappingURL=chunk-SCOHNGPG.js.map
@@ -19,10 +19,10 @@ import {
19
19
  injectDefaultTagMetadata,
20
20
  resolveTagColor,
21
21
  tagAttrKey
22
- } from "./chunk-AHTTKERF.js";
22
+ } from "./chunk-JR7Q6GHE.js";
23
23
  import {
24
24
  legendSuppressed
25
- } from "./chunk-3FRO35WW.js";
25
+ } from "./chunk-A2ARDILY.js";
26
26
 
27
27
  // src/org/layout.ts
28
28
  import { hierarchy, tree } from "d3-hierarchy";
@@ -870,4 +870,4 @@ function layoutOrg(parsed, hiddenCounts, activeTagGroup, hiddenAttributes, expan
870
870
  export {
871
871
  layoutOrg
872
872
  };
873
- //# sourceMappingURL=chunk-BWYFIVZF.js.map
873
+ //# sourceMappingURL=chunk-UBQU2BY6.js.map
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-JYDMBWRP.js";
27
27
  import {
28
28
  fillModeFromOptions
29
- } from "./chunk-3FRO35WW.js";
29
+ } from "./chunk-A2ARDILY.js";
30
30
  import {
31
31
  resolveColor
32
32
  } from "./chunk-ZKPPI6BF.js";
@@ -436,4 +436,4 @@ export {
436
436
  renderPyramid,
437
437
  renderPyramidForExport
438
438
  };
439
- //# sourceMappingURL=chunk-VMSBMIHW.js.map
439
+ //# sourceMappingURL=chunk-UES4P7FN.js.map
@@ -0,0 +1,87 @@
1
+ import {
2
+ TITLE_FONT_SIZE,
3
+ TITLE_Y
4
+ } from "./chunk-A4GOY3PE.js";
5
+ import {
6
+ LEGEND_HEIGHT
7
+ } from "./chunk-Q5IHQ4NW.js";
8
+ import {
9
+ measureText
10
+ } from "./chunk-4ASYQ347.js";
11
+
12
+ // src/utils/inline-header.ts
13
+ var LEGEND_INLINE_SUPPORTED = /* @__PURE__ */ new Set([
14
+ // data charts
15
+ "bar",
16
+ "line",
17
+ "radar",
18
+ "scatter",
19
+ "function",
20
+ // structured
21
+ "state",
22
+ "treemap",
23
+ "block",
24
+ "event-line",
25
+ "boxes-and-lines",
26
+ "er",
27
+ "class",
28
+ "family",
29
+ "infra",
30
+ "sequence",
31
+ "sketch",
32
+ "bracket",
33
+ "gantt",
34
+ "pert",
35
+ "sitemap",
36
+ "mindmap",
37
+ "kanban",
38
+ "journey-map"
39
+ ]);
40
+ function legendInlineSupported(type) {
41
+ return LEGEND_INLINE_SUPPORTED.has(type.toLowerCase());
42
+ }
43
+ var INLINE_HEADER_PAD = 8;
44
+ var INLINE_HEADER_GAP = 16;
45
+ var BOLD_WIDTH_FACTOR = 1.06;
46
+ var MIN_INLINE_LEGEND_W = 48;
47
+ function measureTitleWidth(title, fontSize = TITLE_FONT_SIZE) {
48
+ return measureText(title, fontSize) * BOLD_WIDTH_FACTOR;
49
+ }
50
+ function layoutInlineHeader(input) {
51
+ const pad = input.pad ?? INLINE_HEADER_PAD;
52
+ const gap = input.gap ?? INLINE_HEADER_GAP;
53
+ const fontSize = input.titleFontSize ?? TITLE_FONT_SIZE;
54
+ const baselineY = input.titleBaselineY ?? TITLE_Y;
55
+ const stacked = {
56
+ inline: false,
57
+ titleX: input.containerWidth / 2,
58
+ titleAnchor: "middle",
59
+ legendX: 0,
60
+ legendY: input.titleBandHeight,
61
+ headerHeight: input.titleBandHeight + (input.hasLegend ? input.legendReserve : 0)
62
+ };
63
+ if (!input.requested || !input.hasLegend) return stacked;
64
+ const titleW = measureTitleWidth(input.title, fontSize);
65
+ const titleRight = pad + titleW + gap;
66
+ const avail = input.containerWidth - titleRight - pad;
67
+ const fits = avail >= MIN_INLINE_LEGEND_W && input.legendHeight <= LEGEND_HEIGHT + 1 && input.legendWidth <= avail + 0.5;
68
+ if (!fits) return stacked;
69
+ return {
70
+ inline: true,
71
+ titleX: pad,
72
+ titleAnchor: "start",
73
+ // Flush to the right edge; the fit test guarantees this clears the title.
74
+ legendX: input.containerWidth - pad - input.legendWidth,
75
+ // Center the legend row on the title's visual middle (cap-center ≈ baseline
76
+ // − 0.36·fontSize).
77
+ legendY: baselineY - fontSize * 0.36 - input.legendHeight / 2,
78
+ headerHeight: input.titleBandHeight
79
+ };
80
+ }
81
+
82
+ export {
83
+ legendInlineSupported,
84
+ INLINE_HEADER_PAD,
85
+ layoutInlineHeader
86
+ };
87
+ //# sourceMappingURL=chunk-US3P2DQO.js.map
@@ -6,10 +6,10 @@ import {
6
6
  mapLegendConfig,
7
7
  mapLegendGroups,
8
8
  parsePathRings
9
- } from "./chunk-KBVOVDYP.js";
9
+ } from "./chunk-ZGIBV36U.js";
10
10
  import {
11
11
  renderIntegratedLegend
12
- } from "./chunk-2NZOHEP4.js";
12
+ } from "./chunk-ASPS5O6F.js";
13
13
  import {
14
14
  TITLE_FONT_SIZE,
15
15
  TITLE_FONT_WEIGHT,
@@ -20,14 +20,14 @@ import {
20
20
  } from "./chunk-6KFWC4CO.js";
21
21
  import {
22
22
  parseClock
23
- } from "./chunk-KV4HLIJE.js";
23
+ } from "./chunk-AU75JHSR.js";
24
24
  import {
25
25
  fixedParts,
26
26
  formatTime,
27
27
  sunLine,
28
28
  workStatus,
29
29
  zoneParts
30
- } from "./chunk-APKUAJ2L.js";
30
+ } from "./chunk-A2RUBBVT.js";
31
31
  import {
32
32
  measureText
33
33
  } from "./chunk-4ASYQ347.js";
@@ -781,4 +781,4 @@ export {
781
781
  renderMap,
782
782
  renderMapForExport
783
783
  };
784
- //# sourceMappingURL=chunk-AJFHNS67.js.map
784
+ //# sourceMappingURL=chunk-UXXLE6AH.js.map
@@ -16,7 +16,7 @@ import {
16
16
  stripDefaultModifier,
17
17
  validateTagGroupNames,
18
18
  validateTagValues
19
- } from "./chunk-AHTTKERF.js";
19
+ } from "./chunk-JR7Q6GHE.js";
20
20
  import {
21
21
  FILL_FAMILY_TOKENS,
22
22
  OPTION_NOCOLON_RE,
@@ -28,7 +28,7 @@ import {
28
28
  splitNameAndMeta,
29
29
  warnUnknownMetaKeys,
30
30
  withTagAliases
31
- } from "./chunk-3FRO35WW.js";
31
+ } from "./chunk-A2ARDILY.js";
32
32
  import {
33
33
  NAME_DIAGNOSTIC_CODES,
34
34
  formatDgmoError,
@@ -45,7 +45,8 @@ var KNOWN_SEQ_BOOLEANS = /* @__PURE__ */ new Set([
45
45
  "fill-solid",
46
46
  "fill-outline",
47
47
  "no-title",
48
- "no-legend"
48
+ "no-legend",
49
+ "legend-inline"
49
50
  ]);
50
51
  var NO_PREFIX_ONLY_BOOLEANS = /* @__PURE__ */ new Set(["activations"]);
51
52
  var VALID_PARTICIPANT_TYPES = /* @__PURE__ */ new Set([
@@ -1039,4 +1040,4 @@ export {
1039
1040
  parseSequenceDgmo,
1040
1041
  looksLikeSequence
1041
1042
  };
1042
- //# sourceMappingURL=chunk-M3H7ZE6C.js.map
1043
+ //# sourceMappingURL=chunk-VMWSZCAK.js.map
@@ -9,10 +9,10 @@ import {
9
9
  } from "./chunk-YYVTBZZC.js";
10
10
  import {
11
11
  renderIntegratedLegend
12
- } from "./chunk-2NZOHEP4.js";
12
+ } from "./chunk-ASPS5O6F.js";
13
13
  import {
14
14
  getMaxLegendReservedHeight
15
- } from "./chunk-J7HQPVYH.js";
15
+ } from "./chunk-GRXPFBYC.js";
16
16
  import {
17
17
  TITLE_FONT_SIZE,
18
18
  TITLE_FONT_WEIGHT
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-6KFWC4CO.js";
23
23
  import {
24
24
  parseKanban
25
- } from "./chunk-GK32ZFZY.js";
25
+ } from "./chunk-RSBH2C7O.js";
26
26
  import {
27
27
  LEGEND_HEIGHT,
28
28
  measureLegendText
@@ -38,11 +38,11 @@ import {
38
38
  } from "./chunk-JYDMBWRP.js";
39
39
  import {
40
40
  tagAttrKey
41
- } from "./chunk-AHTTKERF.js";
41
+ } from "./chunk-JR7Q6GHE.js";
42
42
  import {
43
43
  fillModeFromOptions,
44
44
  legendSuppressed
45
- } from "./chunk-3FRO35WW.js";
45
+ } from "./chunk-A2ARDILY.js";
46
46
 
47
47
  // src/kanban/renderer.ts
48
48
  import * as d3Selection from "d3-selection";
@@ -893,4 +893,4 @@ export {
893
893
  renderKanban,
894
894
  renderKanbanForExport
895
895
  };
896
- //# sourceMappingURL=chunk-S7FOIURR.js.map
896
+ //# sourceMappingURL=chunk-VVIRAGID.js.map
@@ -6,13 +6,17 @@ import {
6
6
  formatPct,
7
7
  resolveCellColor,
8
8
  resolveColorMode
9
- } from "./chunk-6OYDOQ2Q.js";
9
+ } from "./chunk-WVGNXDEE.js";
10
+ import {
11
+ layoutInlineHeader
12
+ } from "./chunk-US3P2DQO.js";
10
13
  import {
11
14
  renderIntegratedLegend
12
- } from "./chunk-2NZOHEP4.js";
15
+ } from "./chunk-ASPS5O6F.js";
13
16
  import {
17
+ getLegendExtent,
14
18
  getMaxLegendReservedHeight
15
- } from "./chunk-J7HQPVYH.js";
19
+ } from "./chunk-GRXPFBYC.js";
16
20
  import {
17
21
  TITLE_FONT_SIZE,
18
22
  TITLE_FONT_WEIGHT,
@@ -35,7 +39,7 @@ import {
35
39
  } from "./chunk-JYDMBWRP.js";
36
40
  import {
37
41
  tagAttrKey
38
- } from "./chunk-AHTTKERF.js";
42
+ } from "./chunk-JR7Q6GHE.js";
39
43
 
40
44
  // src/treemap/renderer.ts
41
45
  import * as d3Selection from "d3-selection";
@@ -175,9 +179,36 @@ function renderTreemap(container, parsed, palette, isDark, exportDims, options =
175
179
  { groups: legend.groups, position: LEGEND_POSITION, mode: "preview" },
176
180
  width
177
181
  ) + LEGEND_GROUP_GAP : 0;
182
+ const inlineRequested = parsed.options.legendInline === true;
183
+ const legendExtent = inlineRequested && legend ? getLegendExtent(
184
+ {
185
+ groups: legend.groups,
186
+ position: {
187
+ placement: "top-center",
188
+ titleRelation: "inline-with-title"
189
+ },
190
+ mode: exportMode ? "export" : "preview",
191
+ showInactivePills: !exportMode,
192
+ showEmptyGroups: !exportMode
193
+ },
194
+ { activeGroup: legend.activeGroup },
195
+ width
196
+ ) : { width: 0, height: 0 };
197
+ const header = layoutInlineHeader({
198
+ requested: inlineRequested,
199
+ title: parsed.title ?? "",
200
+ hasLegend: !!legend,
201
+ legendWidth: legendExtent.width,
202
+ legendHeight: legendExtent.height,
203
+ containerWidth: width,
204
+ titleBandHeight: titleH,
205
+ legendReserve,
206
+ titleBaselineY: TITLE_Y,
207
+ titleFontSize: TITLE_FONT_SIZE
208
+ });
178
209
  const headerH = opts.noHeaders ? 0 : HEADER_H;
179
210
  const areaX = PADDING;
180
- const areaY = titleH + legendReserve + PADDING;
211
+ const areaY = (header.inline ? titleH : titleH + legendReserve) + PADDING;
181
212
  const areaW = Math.max(1, width - PADDING * 2);
182
213
  const areaH = Math.max(1, height - areaY - PADDING);
183
214
  const layout = layoutTreemap(parsed.roots, {
@@ -192,7 +223,7 @@ function renderTreemap(container, parsed, palette, isDark, exportDims, options =
192
223
  );
193
224
  svg.append("rect").attr("width", width).attr("height", height).attr("fill", palette.bg);
194
225
  if (showTitle) {
195
- const title = svg.append("text").attr("class", "chart-title").attr("x", width / 2).attr("y", TITLE_Y).attr("text-anchor", "middle").attr("fill", palette.text).attr("font-family", FONT_FAMILY).attr("font-size", TITLE_FONT_SIZE).attr("font-weight", TITLE_FONT_WEIGHT).text(parsed.title);
226
+ const title = svg.append("text").attr("class", "chart-title").attr("x", header.titleX).attr("y", TITLE_Y).attr("text-anchor", header.titleAnchor).attr("fill", palette.text).attr("font-family", FONT_FAMILY).attr("font-size", TITLE_FONT_SIZE).attr("font-weight", TITLE_FONT_WEIGHT).text(parsed.title);
196
227
  if (parsed.titleLineNumber !== null) {
197
228
  title.attr("data-line-number", parsed.titleLineNumber);
198
229
  }
@@ -322,7 +353,10 @@ function renderTreemap(container, parsed, palette, isDark, exportDims, options =
322
353
  }
323
354
  }
324
355
  if (legend) {
325
- const legendG = svg.append("g").attr("class", "dgmo-treemap-legend").attr("transform", `translate(0, ${titleH})`);
356
+ const legendG = svg.append("g").attr("class", "dgmo-treemap-legend").attr(
357
+ "transform",
358
+ header.inline ? `translate(${header.legendX}, ${header.legendY})` : `translate(0, ${titleH})`
359
+ );
326
360
  renderIntegratedLegend(legendG, {
327
361
  groups: legend.groups,
328
362
  palette: {
@@ -335,7 +369,12 @@ function renderTreemap(container, parsed, palette, isDark, exportDims, options =
335
369
  isDark,
336
370
  width,
337
371
  mode: exportMode ? "export" : "preview",
338
- position: LEGEND_POSITION,
372
+ // Inline → left-origin so the wrapper's right-flush translate lands the
373
+ // legend at the chart's right edge; stacked → centered below the title.
374
+ position: {
375
+ placement: "top-center",
376
+ titleRelation: header.inline ? "inline-with-title" : "below-title"
377
+ },
339
378
  activeGroup: legend.activeGroup,
340
379
  // The color-mode switcher is the legend itself: each applicable mode is a
341
380
  // group pill; the active one is the open capsule, the rest are clickable
@@ -399,4 +438,4 @@ export {
399
438
  renderTreemapForExport,
400
439
  renderTreemap
401
440
  };
402
- //# sourceMappingURL=chunk-3SBHODJ4.js.map
441
+ //# sourceMappingURL=chunk-VXTUWXFB.js.map
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-JYDMBWRP.js";
9
9
  import {
10
10
  fillModeFromOptions
11
- } from "./chunk-3FRO35WW.js";
11
+ } from "./chunk-A2ARDILY.js";
12
12
 
13
13
  // src/journey-map/layout.ts
14
14
  var PADDING = 24;
@@ -290,4 +290,4 @@ export {
290
290
  scoreToCurveY,
291
291
  layoutJourneyMap
292
292
  };
293
- //# sourceMappingURL=chunk-HFEOOQ46.js.map
293
+ //# sourceMappingURL=chunk-W4TSD3IP.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  NODE_HEIGHT,
3
3
  NODE_WIDTH
4
- } from "./chunk-I47VHSPS.js";
4
+ } from "./chunk-IWG2ECAO.js";
5
5
 
6
6
  // src/boxes-and-lines/layout-grouped.ts
7
7
  var NODESEP = 50;
@@ -689,4 +689,4 @@ export {
689
689
  acyclicOrient,
690
690
  groupedTierCandidates
691
691
  };
692
- //# sourceMappingURL=chunk-7U4OR7CD.js.map
692
+ //# sourceMappingURL=chunk-WB3NA3JJ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isBlockNode
3
- } from "./chunk-NR5HCAUD.js";
3
+ } from "./chunk-XSVWUOUZ.js";
4
4
  import {
5
5
  AUTO_TAG_COLOR_SENTINEL,
6
6
  finalizeAutoTagColors,
@@ -9,13 +9,13 @@ import {
9
9
  tagAttrKey,
10
10
  validateTagGroupNames,
11
11
  validateTagValues
12
- } from "./chunk-AHTTKERF.js";
12
+ } from "./chunk-JR7Q6GHE.js";
13
13
  import {
14
14
  extractColor,
15
15
  fillModeFromToken,
16
16
  measureIndent,
17
17
  parseFirstLine
18
- } from "./chunk-3FRO35WW.js";
18
+ } from "./chunk-A2ARDILY.js";
19
19
  import {
20
20
  formatDgmoError,
21
21
  makeDgmoError,
@@ -133,6 +133,10 @@ function parseBlock(content, palette) {
133
133
  options.noLegend = true;
134
134
  continue;
135
135
  }
136
+ if (/^legend-inline\s*$/i.test(trimmed)) {
137
+ options.legendInline = true;
138
+ continue;
139
+ }
136
140
  const fm = fillModeFromToken(trimmed);
137
141
  if (fm !== null) {
138
142
  if (fm === "tint") delete options.fillMode;
@@ -338,4 +342,4 @@ function parseBlockTail(tail, aliasMap) {
338
342
  export {
339
343
  parseBlock
340
344
  };
341
- //# sourceMappingURL=chunk-3SEEP2JM.js.map
345
+ //# sourceMappingURL=chunk-WITOJZGL.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveTagColor,
6
6
  tagAttrKey
7
- } from "./chunk-AHTTKERF.js";
7
+ } from "./chunk-JR7Q6GHE.js";
8
8
  import {
9
9
  resolveColor
10
10
  } from "./chunk-ZKPPI6BF.js";
@@ -176,4 +176,4 @@ export {
176
176
  formatPct,
177
177
  buildLegend
178
178
  };
179
- //# sourceMappingURL=chunk-6OYDOQ2Q.js.map
179
+ //# sourceMappingURL=chunk-WVGNXDEE.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  acyclicOrient
3
- } from "./chunk-7U4OR7CD.js";
3
+ } from "./chunk-WB3NA3JJ.js";
4
4
 
5
5
  // src/swimlane/layout.ts
6
6
  var MARGIN = 30;
@@ -419,4 +419,4 @@ function layoutSwimlane(parsed) {
419
419
  export {
420
420
  layoutSwimlane
421
421
  };
422
- //# sourceMappingURL=chunk-UEU6IYKY.js.map
422
+ //# sourceMappingURL=chunk-X3X4LZDC.js.map