@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
@@ -16,9 +16,16 @@ import {
16
16
  import {
17
17
  ScaleContext
18
18
  } from "./chunk-YYVTBZZC.js";
19
+ import {
20
+ INLINE_HEADER_PAD,
21
+ layoutInlineHeader
22
+ } from "./chunk-US3P2DQO.js";
19
23
  import {
20
24
  renderIntegratedLegend
21
- } from "./chunk-2NZOHEP4.js";
25
+ } from "./chunk-ASPS5O6F.js";
26
+ import {
27
+ getLegendExtent
28
+ } from "./chunk-GRXPFBYC.js";
22
29
  import {
23
30
  CAPTION_BOX_PADDING_X,
24
31
  CAPTION_BOX_PADDING_Y,
@@ -35,7 +42,7 @@ import {
35
42
  } from "./chunk-6KFWC4CO.js";
36
43
  import {
37
44
  parsePert
38
- } from "./chunk-RRGKMJYL.js";
45
+ } from "./chunk-5K5XBEXT.js";
39
46
  import {
40
47
  addCalendarDays,
41
48
  formatDuration,
@@ -60,7 +67,7 @@ import {
60
67
  import {
61
68
  resolveActiveTagGroup,
62
69
  resolveTagColor
63
- } from "./chunk-AHTTKERF.js";
70
+ } from "./chunk-JR7Q6GHE.js";
64
71
 
65
72
  // src/pert/renderer.ts
66
73
  import * as d3Selection from "d3-selection";
@@ -229,25 +236,54 @@ function renderPert(container, resolved, layout, palette, isDark, options = {})
229
236
  const scaledHeight = layout.height + sDiagramPad * 2 + sTitleHeight + sLegendBlockHeight + analysisBlockHeight + fieldLegendBlockHeight;
230
237
  const svgW = ctx.isBelowFloor ? exportWidth : scaledWidth;
231
238
  const svgH = ctx.isBelowFloor ? exportHeight : scaledHeight;
239
+ const inlineRequested = resolved.options.legendInline === true && showTagLegend;
240
+ const legendExtent = inlineRequested ? getLegendExtent(
241
+ {
242
+ groups: resolved.tagGroups.map((g) => ({
243
+ name: g.name,
244
+ entries: g.entries
245
+ })),
246
+ position: {
247
+ placement: "top-center",
248
+ titleRelation: "inline-with-title"
249
+ },
250
+ mode: options.exportMode ? "export" : "preview"
251
+ },
252
+ { activeGroup: tagLegendActive },
253
+ svgW
254
+ ) : { width: 0, height: 0 };
255
+ const header = layoutInlineHeader({
256
+ requested: inlineRequested,
257
+ title: effectiveTitle ?? "",
258
+ hasLegend: showTagLegend,
259
+ legendWidth: legendExtent.width,
260
+ legendHeight: legendExtent.height,
261
+ containerWidth: svgW,
262
+ titleBandHeight: sTitleHeight,
263
+ legendReserve: sLegendBlockHeight,
264
+ titleBaselineY: sTitleY,
265
+ titleFontSize: sTitleFontSize
266
+ });
232
267
  const svg = d3Selection.select(container).append("svg").attr("width", ctx.isBelowFloor ? "100%" : svgW).attr("height", svgH).attr("viewBox", `0 0 ${svgW} ${svgH}`).attr("preserveAspectRatio", "xMidYMin meet").style("font-family", FONT_FAMILY);
233
268
  const defs = svg.append("defs");
234
269
  buildArrowheads(defs, palette, sArrowheadW, sArrowheadH);
235
270
  if (effectiveTitle) {
236
- svg.append("text").attr("class", "pert-title chart-title").attr("x", svgW / 2).attr("y", sTitleY).attr("text-anchor", "middle").attr("fill", palette.text).attr("font-size", sTitleFontSize).attr("font-weight", TITLE_FONT_WEIGHT).text(effectiveTitle);
271
+ svg.append("text").attr("class", "pert-title chart-title").attr("x", header.titleX).attr("y", sTitleY).attr("text-anchor", header.titleAnchor).attr("fill", palette.text).attr("font-size", sTitleFontSize).attr("font-weight", TITLE_FONT_WEIGHT).text(effectiveTitle);
237
272
  }
238
273
  if (effectiveSubtitle) {
239
274
  const subtitleY = effectiveTitle ? sTitleY + ctx.aesthetic(26) : sTitleY;
240
275
  svg.append("text").attr("class", "pert-subtitle").attr("x", svgW / 2).attr("y", subtitleY).attr("text-anchor", "middle").attr("fill", palette.textMuted).attr("font-size", sSubtitleFontSize).attr("font-weight", 400).text(effectiveSubtitle);
241
276
  }
242
277
  const offsetX = Math.max(sDiagramPad, (svgW - layout.width) / 2);
243
- const offsetY = sDiagramPad + sTitleHeight + sLegendBlockHeight;
278
+ const offsetY = sDiagramPad + sTitleHeight + (header.inline ? 0 : sLegendBlockHeight);
244
279
  if (showTagLegend) {
245
280
  const tagLegendY = sDiagramPad + sTitleHeight + sLegendTopGap;
246
281
  renderTagLegendRow(svg, resolved, palette, isDark, {
247
- x: 0,
248
- y: tagLegendY,
249
- width: svgW,
282
+ x: header.inline ? svgW - INLINE_HEADER_PAD - legendExtent.width : 0,
283
+ y: header.inline ? header.legendY : tagLegendY,
284
+ width: header.inline ? legendExtent.width : svgW,
250
285
  activeGroup: tagLegendActive,
286
+ inline: header.inline,
251
287
  ...options.exportMode !== void 0 && {
252
288
  exportMode: options.exportMode
253
289
  }
@@ -1337,7 +1373,7 @@ function renderCaptionBlock(svg, bullets, args) {
1337
1373
  }
1338
1374
  function renderTagLegendRow(svg, resolved, palette, isDark, args) {
1339
1375
  if (resolved.tagGroups.length === 0) return;
1340
- const { x, y, width, activeGroup, exportMode } = args;
1376
+ const { x, y, width, activeGroup, exportMode, inline } = args;
1341
1377
  const groups = resolved.tagGroups.map((g) => ({
1342
1378
  name: g.name,
1343
1379
  entries: g.entries.map((e) => ({ value: e.value, color: e.color }))
@@ -1349,7 +1385,13 @@ function renderTagLegendRow(svg, resolved, palette, isDark, args) {
1349
1385
  palette,
1350
1386
  isDark,
1351
1387
  width,
1352
- activeGroup
1388
+ activeGroup,
1389
+ ...inline && {
1390
+ position: {
1391
+ placement: "top-center",
1392
+ titleRelation: "inline-with-title"
1393
+ }
1394
+ }
1353
1395
  });
1354
1396
  }
1355
1397
  function renderFieldLegendBlock(svg, args) {
@@ -1823,4 +1865,4 @@ export {
1823
1865
  measurePertAnalysisBlock,
1824
1866
  renderPertAnalysisBlock
1825
1867
  };
1826
- //# sourceMappingURL=chunk-LPJ6H5X4.js.map
1868
+ //# sourceMappingURL=chunk-32HUNA33.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  extractDatePrefix,
3
3
  parseTimelineDate
4
- } from "./chunk-3KHJJP3J.js";
4
+ } from "./chunk-ITXL2KU5.js";
5
5
  import {
6
6
  makeYearContext,
7
7
  parseDateToken,
@@ -16,7 +16,7 @@ import {
16
16
  tagAttrKey,
17
17
  validateTagGroupNames,
18
18
  validateTagValues
19
- } from "./chunk-AHTTKERF.js";
19
+ } from "./chunk-JR7Q6GHE.js";
20
20
  import {
21
21
  EVENT_LINE_REGISTRY,
22
22
  extractColor,
@@ -27,7 +27,7 @@ import {
27
27
  tryParseSharedOption,
28
28
  warnUnknownMetaKeys,
29
29
  withTagAliases
30
- } from "./chunk-3FRO35WW.js";
30
+ } from "./chunk-A2ARDILY.js";
31
31
  import {
32
32
  emit,
33
33
  formatDgmoError,
@@ -133,6 +133,7 @@ var TBD_RE = /^TBD\b/i;
133
133
  var SIDE_RE = /^side\s+(above|below|alternate)\b/i;
134
134
  var ERA_RE = /^\[([^\]]+)\]\s*(.*)$/;
135
135
  var ERA_COLLAPSED_RE = /\bcollapsed:\s*(true|false)\b/i;
136
+ var NOW_RE = /^now\b\s*(.*)$/i;
136
137
  var SECTION_SEAM_RE = /^section\b/i;
137
138
  var DIRECTION_RE = /^direction\s+(\w+)/i;
138
139
  function parseEventLine(content, palette) {
@@ -150,6 +151,7 @@ function parseEventLine(content, palette) {
150
151
  titleLineNumber: null,
151
152
  events: [],
152
153
  eras: [],
154
+ now: null,
153
155
  tagGroups: [],
154
156
  options,
155
157
  diagnostics: [],
@@ -344,6 +346,44 @@ function parseEventLine(content, palette) {
344
346
  options.noLegend = true;
345
347
  continue;
346
348
  }
349
+ if (trimmed.toLowerCase() === "legend-inline") {
350
+ options.legendInline = true;
351
+ continue;
352
+ }
353
+ {
354
+ const nowMatch = trimmed.match(NOW_RE);
355
+ if (nowMatch) {
356
+ const rest = nowMatch[1].trim();
357
+ if (!rest) {
358
+ result.now = {
359
+ computed: true,
360
+ date: null,
361
+ dateValue: null,
362
+ label: "now",
363
+ lineNumber
364
+ };
365
+ } else {
366
+ const prefix = extractDatePrefix(rest, dateCtx);
367
+ if (prefix) {
368
+ const label = prefix.remainder?.trim() || "now";
369
+ result.now = {
370
+ computed: false,
371
+ date: prefix.startDate,
372
+ dateValue: parseTimelineDate(prefix.startDate),
373
+ label,
374
+ lineNumber
375
+ };
376
+ } else {
377
+ result.diagnostics.push(
378
+ emit(EVENT_LINE_DX.BAD_DATE, lineNumber, {
379
+ token: rest.split(/\s+/)[0]
380
+ })
381
+ );
382
+ }
383
+ }
384
+ continue;
385
+ }
386
+ }
347
387
  {
348
388
  const fm = fillModeFromToken(trimmed);
349
389
  if (fm !== null) {
@@ -419,6 +459,13 @@ function parseEventLine(content, palette) {
419
459
  });
420
460
  }
421
461
  validateEventDateOrder(result.events, eraFlaggedLines, result.diagnostics);
462
+ if (result.now && !options.scale) {
463
+ result.diagnostics.push(
464
+ emit(EVENT_LINE_DX.UNSUPPORTED, result.now.lineNumber, {
465
+ reason: "the `now` marker needs a to-scale axis; it is ignored under `no-scale`."
466
+ })
467
+ );
468
+ }
422
469
  return result;
423
470
  }
424
471
  function resolveFutureEvents(events) {
@@ -618,4 +665,4 @@ export {
618
665
  EVENT_LINE_DIAGNOSTICS,
619
666
  parseEventLine
620
667
  };
621
- //# sourceMappingURL=chunk-UIT7E6UF.js.map
668
+ //# sourceMappingURL=chunk-3BFXELBL.js.map
@@ -8,14 +8,14 @@ import {
8
8
  resolveActiveTagGroup,
9
9
  stripDefaultModifier,
10
10
  tagAttrKey
11
- } from "./chunk-AHTTKERF.js";
11
+ } from "./chunk-JR7Q6GHE.js";
12
12
  import {
13
13
  extractColor,
14
14
  fillModeFromToken,
15
15
  measureIndent,
16
16
  parseFirstLine,
17
17
  splitNameAndMeta
18
- } from "./chunk-3FRO35WW.js";
18
+ } from "./chunk-A2ARDILY.js";
19
19
  import {
20
20
  makeDgmoError,
21
21
  makeFail
@@ -214,6 +214,10 @@ function parseBracket(content, palette) {
214
214
  else result.mode = lower;
215
215
  continue;
216
216
  }
217
+ if (lower === "legend-inline") {
218
+ result.legendInline = true;
219
+ continue;
220
+ }
217
221
  if (lower === "no-legend") {
218
222
  result.noLegend = true;
219
223
  continue;
@@ -388,4 +392,4 @@ function parseBracket(content, palette) {
388
392
  export {
389
393
  parseBracket
390
394
  };
391
- //# sourceMappingURL=chunk-C2UORMIA.js.map
395
+ //# sourceMappingURL=chunk-3BZJ5KD5.js.map
@@ -19,9 +19,15 @@ import {
19
19
  import {
20
20
  ScaleContext
21
21
  } from "./chunk-YYVTBZZC.js";
22
+ import {
23
+ layoutInlineHeader
24
+ } from "./chunk-US3P2DQO.js";
22
25
  import {
23
26
  renderIntegratedLegend
24
- } from "./chunk-2NZOHEP4.js";
27
+ } from "./chunk-ASPS5O6F.js";
28
+ import {
29
+ getLegendExtent
30
+ } from "./chunk-GRXPFBYC.js";
25
31
  import {
26
32
  TITLE_FONT_SIZE,
27
33
  TITLE_FONT_WEIGHT,
@@ -32,7 +38,7 @@ import {
32
38
  } from "./chunk-6KFWC4CO.js";
33
39
  import {
34
40
  parseClassDiagram
35
- } from "./chunk-M24VXUFG.js";
41
+ } from "./chunk-IIUYKQ5J.js";
36
42
  import {
37
43
  LEGEND_HEIGHT
38
44
  } from "./chunk-Q5IHQ4NW.js";
@@ -45,8 +51,9 @@ import {
45
51
  } from "./chunk-JYDMBWRP.js";
46
52
  import {
47
53
  fillModeFromOptions,
54
+ legendInlineRequested,
48
55
  legendSuppressed
49
- } from "./chunk-3FRO35WW.js";
56
+ } from "./chunk-A2ARDILY.js";
50
57
 
51
58
  // src/class/renderer.ts
52
59
  import * as d3Selection from "d3-selection";
@@ -159,15 +166,50 @@ function renderClassDiagram(container, parsed, layout, palette, isDark, onClickI
159
166
  const LEGEND_FIXED_GAP = 8;
160
167
  const sLegendFixedGap = ctx.aesthetic(LEGEND_FIXED_GAP);
161
168
  const legendReserve = hasLegend ? sLegendHeight + sLegendFixedGap : 0;
169
+ const isLegendExpanded = legendActive !== false;
170
+ const legendGroups = [
171
+ {
172
+ name: LEGEND_GROUP_NAME,
173
+ entries: legendEntries.map((entry) => ({
174
+ value: entry.label,
175
+ color: palette.colors[entry.colorKey]
176
+ }))
177
+ }
178
+ ];
179
+ const inlineRequested = legendInlineRequested(parsed.options);
180
+ const legendExtent = inlineRequested && hasLegend ? getLegendExtent(
181
+ {
182
+ groups: legendGroups,
183
+ position: {
184
+ placement: "top-center",
185
+ titleRelation: "inline-with-title"
186
+ },
187
+ mode: exportMode ? "export" : "preview"
188
+ },
189
+ { activeGroup: isLegendExpanded ? LEGEND_GROUP_NAME : null },
190
+ width
191
+ ) : { width: 0, height: 0 };
192
+ const header = layoutInlineHeader({
193
+ requested: inlineRequested,
194
+ title: parsed.title ?? "",
195
+ hasLegend,
196
+ legendWidth: legendExtent.width,
197
+ legendHeight: legendExtent.height,
198
+ containerWidth: width,
199
+ titleBandHeight: titleHeight,
200
+ legendReserve,
201
+ titleBaselineY: sTitleY,
202
+ titleFontSize: sTitleFontSize
203
+ });
162
204
  const diagramW = layout.width;
163
205
  const diagramH = layout.height;
164
- const availH = height - titleHeight - legendReserve;
206
+ const availH = height - titleHeight - (header.inline ? 0 : legendReserve);
165
207
  const scaleX = (width - sDiagramPadding * 2) / diagramW;
166
208
  const scaleY = (availH - sDiagramPadding * 2) / diagramH;
167
209
  const scale = Math.min(MAX_SCALE, scaleX, scaleY);
168
210
  const scaledW = diagramW * scale;
169
211
  const offsetX = (width - scaledW) / 2;
170
- const offsetY = titleHeight + legendReserve + sDiagramPadding;
212
+ const offsetY = titleHeight + (header.inline ? 0 : legendReserve) + sDiagramPadding;
171
213
  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);
172
214
  if (ctx.isBelowFloor) {
173
215
  svg.attr("width", "100%");
@@ -184,7 +226,7 @@ function renderClassDiagram(container, parsed, layout, palette, isDark, onClickI
184
226
  defs.append("marker").attr("id", "cd-arrow-depend").attr("viewBox", `0 0 ${AW} ${AH}`).attr("refX", AW).attr("refY", AH / 2).attr("markerWidth", AW).attr("markerHeight", AH).attr("orient", "auto").append("polyline").attr("points", `0,0 ${AW},${AH / 2} 0,${AH}`).attr("fill", "none").attr("stroke", palette.textMuted).attr("stroke-width", 1.5);
185
227
  defs.append("marker").attr("id", "cd-arrow-assoc").attr("viewBox", `0 0 ${AW} ${AH}`).attr("refX", AW).attr("refY", AH / 2).attr("markerWidth", AW).attr("markerHeight", AH).attr("orient", "auto").append("polyline").attr("points", `0,0 ${AW},${AH / 2} 0,${AH}`).attr("fill", "none").attr("stroke", palette.textMuted).attr("stroke-width", 1.5);
186
228
  if (showTitle) {
187
- const titleEl = svg.append("text").attr("class", "chart-title").attr("x", width / 2).attr("y", sTitleY).attr("text-anchor", "middle").attr("fill", palette.text).attr("font-size", sTitleFontSize).attr("font-weight", TITLE_FONT_WEIGHT).style(
229
+ const titleEl = svg.append("text").attr("class", "chart-title").attr("x", header.titleX).attr("y", sTitleY).attr("text-anchor", header.titleAnchor).attr("fill", palette.text).attr("font-size", sTitleFontSize).attr("font-weight", TITLE_FONT_WEIGHT).style(
188
230
  "cursor",
189
231
  onClickItem && parsed.titleLineNumber ? "pointer" : "default"
190
232
  ).text(parsed.title);
@@ -199,22 +241,19 @@ function renderClassDiagram(container, parsed, layout, palette, isDark, onClickI
199
241
  }
200
242
  }
201
243
  }
202
- const isLegendExpanded = legendActive !== false;
203
244
  if (hasLegend) {
204
- const legendGroups = [
205
- {
206
- name: LEGEND_GROUP_NAME,
207
- entries: legendEntries.map((entry) => ({
208
- value: entry.label,
209
- color: palette.colors[entry.colorKey]
210
- }))
211
- }
212
- ];
213
- const legendG = svg.append("g").attr("class", "cd-legend").attr("transform", `translate(0,${titleHeight})`);
245
+ const legendG = svg.append("g").attr("class", "cd-legend").attr(
246
+ "transform",
247
+ header.inline ? `translate(${header.legendX}, ${header.legendY})` : `translate(0,${titleHeight})`
248
+ );
214
249
  renderIntegratedLegend(legendG, {
215
250
  groups: legendGroups,
216
251
  activeGroup: isLegendExpanded ? LEGEND_GROUP_NAME : null,
217
252
  mode: exportMode ? "export" : "preview",
253
+ position: {
254
+ placement: "top-center",
255
+ titleRelation: header.inline ? "inline-with-title" : "below-title"
256
+ },
218
257
  palette,
219
258
  isDark,
220
259
  width
@@ -409,4 +448,4 @@ export {
409
448
  renderClassDiagram,
410
449
  renderClassDiagramForExport
411
450
  };
412
- //# sourceMappingURL=chunk-A3BDLDYG.js.map
451
+ //# sourceMappingURL=chunk-3FUTFYSP.js.map
@@ -4,7 +4,7 @@ import {
4
4
  layoutC4Containers,
5
5
  layoutC4Context,
6
6
  layoutC4Deployment
7
- } from "./chunk-LRSW4JLE.js";
7
+ } from "./chunk-AKE6C2D7.js";
8
8
  import {
9
9
  renderInlineText
10
10
  } from "./chunk-3HDBAXF5.js";
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-3CIOJ5YJ.js";
18
18
  import {
19
19
  renderIntegratedLegend
20
- } from "./chunk-2NZOHEP4.js";
20
+ } from "./chunk-ASPS5O6F.js";
21
21
  import {
22
22
  TITLE_FONT_SIZE,
23
23
  TITLE_FONT_WEIGHT
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-6KFWC4CO.js";
28
28
  import {
29
29
  parseC4
30
- } from "./chunk-2NYXI35Z.js";
30
+ } from "./chunk-YXKNXIWA.js";
31
31
  import {
32
32
  preprocessDescriptionLine
33
33
  } from "./chunk-IYULMRBE.js";
@@ -45,10 +45,10 @@ import {
45
45
  } from "./chunk-JYDMBWRP.js";
46
46
  import {
47
47
  tagAttrKey
48
- } from "./chunk-AHTTKERF.js";
48
+ } from "./chunk-JR7Q6GHE.js";
49
49
  import {
50
50
  fillModeFromOptions
51
- } from "./chunk-3FRO35WW.js";
51
+ } from "./chunk-A2ARDILY.js";
52
52
 
53
53
  // src/c4/renderer.ts
54
54
  import * as d3Selection from "d3-selection";
@@ -1036,4 +1036,4 @@ export {
1036
1036
  renderC4Deployment,
1037
1037
  renderC4DeploymentForExport
1038
1038
  };
1039
- //# sourceMappingURL=chunk-DPGQ5UMO.js.map
1039
+ //# sourceMappingURL=chunk-4MZCJV4M.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  extractColor,
3
3
  measureIndent
4
- } from "./chunk-3FRO35WW.js";
4
+ } from "./chunk-A2ARDILY.js";
5
5
  import {
6
6
  makeDgmoError
7
7
  } from "./chunk-4W2PE66Q.js";
@@ -73,4 +73,4 @@ function tryCollectNote(lines, index, indent, palette, diagnostics) {
73
73
  export {
74
74
  tryCollectNote
75
75
  };
76
- //# sourceMappingURL=chunk-WWHECSYZ.js.map
76
+ //# sourceMappingURL=chunk-4R5KIPNX.js.map
@@ -1,12 +1,16 @@
1
1
  import {
2
2
  renderInlineText
3
3
  } from "./chunk-3HDBAXF5.js";
4
+ import {
5
+ layoutInlineHeader
6
+ } from "./chunk-US3P2DQO.js";
4
7
  import {
5
8
  renderIntegratedLegend
6
- } from "./chunk-2NZOHEP4.js";
9
+ } from "./chunk-ASPS5O6F.js";
7
10
  import {
11
+ getLegendExtent,
8
12
  getMaxLegendReservedHeight
9
- } from "./chunk-J7HQPVYH.js";
13
+ } from "./chunk-GRXPFBYC.js";
10
14
  import {
11
15
  TITLE_FONT_SIZE,
12
16
  TITLE_FONT_WEIGHT,
@@ -31,7 +35,7 @@ import {
31
35
  import {
32
36
  resolveTagColor,
33
37
  tagAttrKey
34
- } from "./chunk-AHTTKERF.js";
38
+ } from "./chunk-JR7Q6GHE.js";
35
39
  import {
36
40
  resolveColor
37
41
  } from "./chunk-ZKPPI6BF.js";
@@ -707,16 +711,41 @@ function renderBracket(container, parsed, palette, isDark, exportDims) {
707
711
  { groups: legendGroups, position: LEGEND_POSITION, mode: "preview" },
708
712
  width
709
713
  ) + LEGEND_GROUP_GAP : 0;
714
+ const inlineRequested = parsed.legendInline === true;
715
+ const legendExtent = inlineRequested && legendGroups.length > 0 ? getLegendExtent(
716
+ {
717
+ groups: legendGroups,
718
+ position: {
719
+ placement: "top-center",
720
+ titleRelation: "inline-with-title"
721
+ },
722
+ mode: exportMode ? "export" : "preview"
723
+ },
724
+ { activeGroup: activeGroup?.name ?? null },
725
+ width
726
+ ) : { width: 0, height: 0 };
727
+ const header = layoutInlineHeader({
728
+ requested: inlineRequested,
729
+ title: parsed.title ?? "",
730
+ hasLegend: legendGroups.length > 0,
731
+ legendWidth: legendExtent.width,
732
+ legendHeight: legendExtent.height,
733
+ containerWidth: width,
734
+ titleBandHeight: titleH,
735
+ legendReserve,
736
+ titleBaselineY: TITLE_Y,
737
+ titleFontSize: TITLE_FONT_SIZE
738
+ });
710
739
  const svg = d3Selection.select(container).append("svg").attr("width", width).attr("height", height).attr("viewBox", `0 0 ${width} ${height}`).attr("preserveAspectRatio", "xMidYMin meet").attr("xmlns", "http://www.w3.org/2000/svg").attr("class", "dgmo-bracket").attr("role", "img").attr(
711
740
  "aria-label",
712
741
  `Tournament bracket${parsed.title ? ` \u2014 ${parsed.title}` : ""}${layout.champion ? `, champion ${layout.champion}` : ""}`
713
742
  ).style("font-family", FONT_FAMILY);
714
743
  if (showTitle) {
715
- const t = 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);
744
+ const t = 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);
716
745
  if (parsed.titleLineNumber !== null)
717
746
  t.attr("data-line-number", parsed.titleLineNumber);
718
747
  }
719
- const areaY = titleH + legendReserve + PADDING;
748
+ const areaY = (header.inline ? titleH : titleH + legendReserve) + PADDING;
720
749
  const areaX = PADDING;
721
750
  const areaW = Math.max(1, width - PADDING * 2);
722
751
  const areaH = Math.max(1, height - areaY - PADDING);
@@ -725,7 +754,10 @@ function renderBracket(container, parsed, palette, isDark, exportDims) {
725
754
  const offsetY = areaY;
726
755
  const root = svg.append("g").attr("class", "dgmo-bracket-body").attr("transform", `translate(${offsetX},${offsetY}) scale(${scale})`);
727
756
  if (legendGroups.length > 0) {
728
- const legendG = svg.append("g").attr("class", "dgmo-bracket-legend").attr("transform", `translate(0, ${titleH})`);
757
+ const legendG = svg.append("g").attr("class", "dgmo-bracket-legend").attr(
758
+ "transform",
759
+ header.inline ? `translate(${header.legendX}, ${header.legendY})` : `translate(0, ${titleH})`
760
+ );
729
761
  renderIntegratedLegend(legendG, {
730
762
  groups: legendGroups,
731
763
  palette: {
@@ -738,7 +770,10 @@ function renderBracket(container, parsed, palette, isDark, exportDims) {
738
770
  isDark,
739
771
  width,
740
772
  mode: exportMode ? "export" : "preview",
741
- position: LEGEND_POSITION,
773
+ position: {
774
+ placement: "top-center",
775
+ titleRelation: header.inline ? "inline-with-title" : "below-title"
776
+ },
742
777
  activeGroup: activeGroup?.name ?? null
743
778
  });
744
779
  }
@@ -959,4 +994,4 @@ export {
959
994
  renderBracket,
960
995
  renderBracketForExport
961
996
  };
962
- //# sourceMappingURL=chunk-47JNEKJA.js.map
997
+ //# sourceMappingURL=chunk-5D5VHDJM.js.map