@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,10 +16,16 @@ import {
16
16
  } from "./chunk-BMR4CIEO.js";
17
17
  import {
18
18
  formatDateLabel
19
- } from "./chunk-4ZIKWVSQ.js";
19
+ } from "./chunk-ZP265ICS.js";
20
+ import {
21
+ layoutInlineHeader
22
+ } from "./chunk-US3P2DQO.js";
20
23
  import {
21
24
  renderIntegratedLegend
22
- } from "./chunk-2NZOHEP4.js";
25
+ } from "./chunk-ASPS5O6F.js";
26
+ import {
27
+ getLegendExtent
28
+ } from "./chunk-GRXPFBYC.js";
23
29
  import {
24
30
  TITLE_FONT_SIZE,
25
31
  TITLE_FONT_WEIGHT,
@@ -28,6 +34,9 @@ import {
28
34
  import {
29
35
  FONT_FAMILY
30
36
  } from "./chunk-6KFWC4CO.js";
37
+ import {
38
+ parseTimelineDate
39
+ } from "./chunk-ITXL2KU5.js";
31
40
  import {
32
41
  CHAR_WIDTH_RATIO,
33
42
  wrapTextToWidth
@@ -42,7 +51,7 @@ import {
42
51
  import {
43
52
  resolveActiveTagGroup,
44
53
  resolveTagColor
45
- } from "./chunk-AHTTKERF.js";
54
+ } from "./chunk-JR7Q6GHE.js";
46
55
  import {
47
56
  resolveColor
48
57
  } from "./chunk-ZKPPI6BF.js";
@@ -89,7 +98,7 @@ var COLLAPSED = "dgmo-evt-collapsed";
89
98
  var OFF = "dgmo-evt-off";
90
99
  var HIDDEN_ATTR = "data-evt-hidden";
91
100
  var HOVER_CSS = `.dgmo-event-dot{transition:transform .12s ease;transform-box:fill-box;transform-origin:center}.dgmo-event-leader,.dgmo-event-card,.dgmo-event-era{transition:opacity .12s ease,filter .12s ease}.dgmo-event-dot,.dgmo-event-card,.dgmo-event-era{cursor:default}[data-legend-entry]{cursor:pointer}.${DIM}{opacity:.2}.dgmo-event-dot.${HL}{transform:scale(1.55)}.dgmo-event-leader.${HL}{stroke-opacity:1;stroke-width:2.5}.dgmo-event-card.${HL}{filter:drop-shadow(0 2px 5px rgba(0,0,0,.22))}.dgmo-event-era.${ERA_HL}{filter:drop-shadow(0 1px 2px rgba(0,0,0,.28))}.dgmo-event-card.${COLLAPSED},.dgmo-event-leader.${COLLAPSED}{opacity:0;pointer-events:none}.dgmo-event-card.${COLLAPSED}.${HL},.dgmo-event-leader.${COLLAPSED}.${HL}{opacity:1;pointer-events:auto}[data-legend-entry].${OFF} text{opacity:.5}`;
92
- function renderEventLine(container, parsed, palette, isDark, onClickItem, exportDims, tagOverride) {
101
+ function renderEventLine(container, parsed, palette, isDark, onClickItem, exportDims, tagOverride, nowDate) {
93
102
  if (parsed.events.length === 0) return;
94
103
  d3Selection.select(container).selectAll(":not([data-d3-tooltip])").remove();
95
104
  const width = exportDims?.width ?? container.clientWidth;
@@ -108,7 +117,32 @@ function renderEventLine(container, parsed, palette, isDark, onClickItem, export
108
117
  const hasLegend = parsed.tagGroups.length > 0 && activeGroup !== null && !parsed.options.noLegend;
109
118
  const titleH = showTitle ? TITLE_AREA : 0;
110
119
  const legendH = hasLegend ? LEGEND_BAND : 0;
111
- const topUsed = titleH + legendH;
120
+ const inlineRequested = parsed.options.legendInline === true;
121
+ const legendExtent = inlineRequested && hasLegend ? getLegendExtent(
122
+ {
123
+ groups: parsed.tagGroups,
124
+ position: {
125
+ placement: "top-center",
126
+ titleRelation: "inline-with-title"
127
+ },
128
+ mode: exportMode ? "export" : "preview"
129
+ },
130
+ { activeGroup: activeGroup ?? null },
131
+ width
132
+ ) : { width: 0, height: 0 };
133
+ const header = layoutInlineHeader({
134
+ requested: inlineRequested,
135
+ title: parsed.title ?? "",
136
+ hasLegend,
137
+ legendWidth: legendExtent.width,
138
+ legendHeight: legendExtent.height,
139
+ containerWidth: width,
140
+ titleBandHeight: titleH,
141
+ legendReserve: legendH,
142
+ titleBaselineY: TITLE_Y,
143
+ titleFontSize: TITLE_FONT_SIZE
144
+ });
145
+ const topUsed = header.inline ? titleH : titleH + legendH;
112
146
  const eraByName = new Map(parsed.eras.map((e) => [e.name, e]));
113
147
  const collapsedSet = new Set(
114
148
  parsed.eras.filter((e) => e.collapsed).map((e) => e.name)
@@ -451,14 +485,17 @@ function renderEventLine(container, parsed, palette, isDark, onClickItem, export
451
485
  }
452
486
  if (!exportMode) svg.append("style").text(HOVER_CSS);
453
487
  if (showTitle) {
454
- const t = svg.append("text").attr("class", "chart-title").attr("x", contentW / 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).attr("data-line-number", parsed.titleLineNumber ?? 1).text(parsed.title);
488
+ const t = svg.append("text").attr("class", "chart-title").attr("x", header.inline ? header.titleX : contentW / 2).attr("y", TITLE_Y).attr("text-anchor", header.inline ? header.titleAnchor : "middle").attr("fill", palette.text).attr("font-family", FONT_FAMILY).attr("font-size", TITLE_FONT_SIZE).attr("font-weight", TITLE_FONT_WEIGHT).attr("data-line-number", parsed.titleLineNumber ?? 1).text(parsed.title);
455
489
  if (onClickItem && parsed.titleLineNumber) {
456
490
  const ln = parsed.titleLineNumber;
457
491
  t.style("cursor", "pointer").on("click", () => onClickItem(ln));
458
492
  }
459
493
  }
460
494
  if (hasLegend) {
461
- const legendG = svg.append("g").attr("transform", `translate(0, ${titleH})`);
495
+ const legendG = svg.append("g").attr(
496
+ "transform",
497
+ header.inline ? `translate(${header.legendX}, ${header.legendY})` : `translate(0, ${titleH})`
498
+ );
462
499
  const groups = parsed.tagGroups.map((g) => ({
463
500
  name: g.name,
464
501
  entries: g.entries.map((e) => ({
@@ -472,7 +509,14 @@ function renderEventLine(container, parsed, palette, isDark, onClickItem, export
472
509
  isDark,
473
510
  width: contentW,
474
511
  mode: exportMode ? "export" : "preview",
475
- activeGroup
512
+ activeGroup,
513
+ // Inline → left-origin so the wrapper's right-flush translate lands the
514
+ // legend at the header's right edge; stacked → centered below the title
515
+ // (== DEFAULT_POSITION, so the stacked output is byte-identical).
516
+ position: {
517
+ placement: "top-center",
518
+ titleRelation: header.inline ? "inline-with-title" : "below-title"
519
+ }
476
520
  });
477
521
  if (!exportMode) addLegendEntryHitAreas(legendG);
478
522
  }
@@ -698,6 +742,111 @@ function renderEventLine(container, parsed, palette, isDark, onClickItem, export
698
742
  }
699
743
  }
700
744
  }
745
+ if (parsed.now && scaled) {
746
+ let nowValue = parsed.now.dateValue;
747
+ if (parsed.now.computed) {
748
+ const d = nowDate ?? /* @__PURE__ */ new Date();
749
+ const iso = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
750
+ const v = parseTimelineDate(iso);
751
+ nowValue = Number.isFinite(v) ? v : null;
752
+ }
753
+ const dated = placed.filter((p) => p.kind !== "era" && !p.future && p.dateValue !== null).sort((a, b) => a.dateValue - b.dateValue);
754
+ let nowX = nowValue === null ? null : valueToSpineX(nowValue, dated);
755
+ const lastReal = dated[dated.length - 1];
756
+ if (nowX !== null && nowValue !== null && lastReal && nowValue > lastReal.dateValue) {
757
+ const trailing = placed.filter((p) => p.future && !p.futureSpan).map((p) => p.x);
758
+ if (trailing.length) nowX = Math.min(...trailing);
759
+ }
760
+ if (nowX !== null) {
761
+ const base = themeBaseBg(palette, isDark);
762
+ const nowColor = palette.destructive;
763
+ const fillMode = parsed.options.fillMode;
764
+ const pillFill = shapeFill(palette, nowColor, isDark, { mode: fillMode });
765
+ const pillStroke = fillMode === "solid" ? "none" : fillMode === "outline" ? nowColor : mix(nowColor, base, 55);
766
+ const pillStrokeW = fillMode === "solid" ? 0 : fillMode === "outline" ? 1.3 : 1;
767
+ const pillText = fillMode === "solid" ? contrastText(
768
+ pillFill,
769
+ palette.textOnFillLight,
770
+ palette.textOnFillDark
771
+ ) : nowColor;
772
+ const label = parsed.now.label;
773
+ const pillH = 18;
774
+ const pillW = Math.max(28, label.length * 6.6 + 16);
775
+ const PIN_GAP = 6;
776
+ const xHalf = pillW / 2 + 4;
777
+ const xLo = nowX - xHalf;
778
+ const xHi = nowX + xHalf;
779
+ const boxes = geo.map((g) => ({
780
+ side: g.p.side,
781
+ top: g.top,
782
+ bot: g.top + g.p.cardH,
783
+ left: g.p.left,
784
+ right: g.p.left + CARD_W
785
+ }));
786
+ const overlapsX = (b) => b.left < xHi && b.right > xLo;
787
+ const cands = [];
788
+ const addAbove = (pillBottom) => {
789
+ const y0 = pillBottom - pillH;
790
+ if (y0 > topUsed + 1)
791
+ cands.push({ y0, y1: pillBottom, stem: spineY - pillBottom });
792
+ };
793
+ const addBelow = (pillTop) => {
794
+ const y1 = pillTop + pillH;
795
+ if (y1 < totalH - 1)
796
+ cands.push({ y0: pillTop, y1, stem: pillTop - spineY });
797
+ };
798
+ addAbove(spineY - LEADER_ABOVE / 2 + pillH / 2);
799
+ addBelow(spineY + LEADER_BELOW / 2 - pillH / 2);
800
+ for (const b of boxes) {
801
+ if (!overlapsX(b)) continue;
802
+ if (b.side === "above") addAbove(b.top - PIN_GAP);
803
+ else addBelow(b.bot + PIN_GAP);
804
+ }
805
+ const isClear = (c) => !boxes.some((b) => overlapsX(b) && b.bot > c.y0 && b.top < c.y1);
806
+ const byStem = (a, b) => a.stem - b.stem;
807
+ const slot = cands.filter(isClear).sort(byStem)[0] ?? cands.sort(byStem)[0] ?? {
808
+ y0: spineY - PIN_GAP - pillH,
809
+ y1: spineY - PIN_GAP,
810
+ stem: PIN_GAP + pillH
811
+ };
812
+ const above = slot.y1 <= spineY;
813
+ const stemFrom = above ? spineY - DOT_R : spineY + DOT_R;
814
+ const stemTo = above ? slot.y1 : slot.y0;
815
+ const pillCX = Math.max(
816
+ pillW / 2 + 2,
817
+ Math.min(nowX, contentW - pillW / 2 - 2)
818
+ );
819
+ const nowG = svg.append("g").attr("class", "evt-now").attr("data-now-x", nowX.toFixed(2));
820
+ const FADE_SPAN = Math.min(LEADER_ABOVE, LEADER_BELOW);
821
+ const ruleTop = spineY - FADE_SPAN;
822
+ const ruleBot = spineY + FADE_SPAN;
823
+ const gradId = `evt-now-fade-${nowX.toFixed(0)}`;
824
+ const grad = nowG.append("defs").append("linearGradient").attr("id", gradId).attr("gradientUnits", "userSpaceOnUse").attr("x1", 0).attr("y1", ruleTop).attr("x2", 0).attr("y2", ruleBot);
825
+ grad.append("stop").attr("offset", "0%").attr("stop-color", nowColor).attr("stop-opacity", 0);
826
+ grad.append("stop").attr("offset", "50%").attr("stop-color", nowColor).attr("stop-opacity", 0.9);
827
+ grad.append("stop").attr("offset", "100%").attr("stop-color", nowColor).attr("stop-opacity", 0);
828
+ nowG.append("line").attr("x1", nowX).attr("y1", ruleTop).attr("x2", nowX).attr("y2", ruleBot).attr("stroke", `url(#${gradId})`).attr("stroke-width", 1.6).attr("stroke-dasharray", "1 4").attr("stroke-linecap", "round");
829
+ nowG.append("path").attr("d", `M${nowX} ${spineY - 5} l5 5 l-5 5 l-5 -5 z`).attr("fill", nowColor);
830
+ nowG.append("line").attr("x1", nowX).attr("y1", stemFrom).attr("x2", nowX).attr("y2", stemTo).attr("stroke", nowColor).attr("stroke-width", 1.6);
831
+ nowG.append("rect").attr("x", pillCX - pillW / 2).attr("y", slot.y0).attr("width", pillW).attr("height", pillH).attr("rx", pillH / 2).attr("fill", pillFill).attr("stroke", pillStroke).attr("stroke-width", pillStrokeW);
832
+ nowG.append("text").attr("x", pillCX).attr("y", slot.y0 + pillH / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-family", FONT_FAMILY).attr("font-size", 10.5).attr("font-weight", 600).attr("fill", pillText).text(label);
833
+ if (!exportMode) {
834
+ const hoverRule = nowG.append("line").attr("class", "evt-now-rule-full").attr("x1", nowX).attr("y1", Math.max(topUsed, 2)).attr("x2", nowX).attr("y2", totalH - 2).attr("stroke", nowColor).attr("stroke-width", 1.4).attr("stroke-dasharray", "1 4").attr("stroke-linecap", "round").attr("opacity", 0).style("transition", "opacity 120ms ease").style("pointer-events", "none");
835
+ hoverRule.lower();
836
+ const nowNode = nowG.node();
837
+ if (nowNode) {
838
+ nowNode.addEventListener(
839
+ "mouseenter",
840
+ () => hoverRule.attr("opacity", 0.5)
841
+ );
842
+ nowNode.addEventListener(
843
+ "mouseleave",
844
+ () => hoverRule.attr("opacity", 0)
845
+ );
846
+ }
847
+ }
848
+ }
849
+ }
701
850
  if (!exportMode) {
702
851
  const root = svg.node();
703
852
  wireEventLineHover(root);
@@ -712,7 +861,8 @@ function renderEventLine(container, parsed, palette, isDark, onClickItem, export
712
861
  isDark,
713
862
  onClickItem,
714
863
  exportDims,
715
- tagOverride
864
+ tagOverride,
865
+ nowDate
716
866
  )
717
867
  );
718
868
  applyEvtHidden(container, root);
@@ -922,7 +1072,7 @@ function wireEventLineHover(root) {
922
1072
  if (!to || !root.contains(to)) applyEvtFocus(root, readPin(root));
923
1073
  });
924
1074
  }
925
- function renderEventLineForExport(container, parsed, palette, isDark, exportDims, tagOverride) {
1075
+ function renderEventLineForExport(container, parsed, palette, isDark, exportDims, tagOverride, nowDate) {
926
1076
  renderEventLine(
927
1077
  container,
928
1078
  parsed,
@@ -930,9 +1080,27 @@ function renderEventLineForExport(container, parsed, palette, isDark, exportDims
930
1080
  isDark,
931
1081
  void 0,
932
1082
  exportDims,
933
- tagOverride
1083
+ tagOverride,
1084
+ nowDate
934
1085
  );
935
1086
  }
1087
+ function valueToSpineX(v, dated) {
1088
+ if (!dated.length) return null;
1089
+ const first = dated[0];
1090
+ const last = dated[dated.length - 1];
1091
+ if (v <= first.dateValue) return first.x;
1092
+ if (v >= last.dateValue) return last.x;
1093
+ for (let i = 0; i < dated.length - 1; i++) {
1094
+ const a = dated[i];
1095
+ const b = dated[i + 1];
1096
+ if (v >= a.dateValue && v <= b.dateValue) {
1097
+ const span = b.dateValue - a.dateValue;
1098
+ if (span <= 0) return a.x;
1099
+ return a.x + (v - a.dateValue) / span * (b.x - a.x);
1100
+ }
1101
+ }
1102
+ return last.x;
1103
+ }
936
1104
  function axisBreakPaths(cx, cy) {
937
1105
  const HUMPS = 2;
938
1106
  const STEPS = 48;
@@ -997,4 +1165,4 @@ export {
997
1165
  focusEventLine,
998
1166
  renderEventLineForExport
999
1167
  };
1000
- //# sourceMappingURL=chunk-TJN2OIVG.js.map
1168
+ //# sourceMappingURL=chunk-PKUWYPI5.js.map
@@ -5,7 +5,7 @@ import {
5
5
  splitNameAndMeta,
6
6
  tryParseSharedOption,
7
7
  warnUnknownMetaKeys
8
- } from "./chunk-3FRO35WW.js";
8
+ } from "./chunk-A2ARDILY.js";
9
9
  import {
10
10
  RECOGNIZED_COLOR_NAMES,
11
11
  resolveColor
@@ -165,4 +165,4 @@ function parseRing(content) {
165
165
  export {
166
166
  parseRing
167
167
  };
168
- //# sourceMappingURL=chunk-W6PCFRPL.js.map
168
+ //# sourceMappingURL=chunk-PSIDVCBA.js.map
@@ -12,12 +12,16 @@ import {
12
12
  NODE_STROKE_WIDTH,
13
13
  SEPARATOR_GAP
14
14
  } from "./chunk-3CIOJ5YJ.js";
15
+ import {
16
+ layoutInlineHeader
17
+ } from "./chunk-US3P2DQO.js";
15
18
  import {
16
19
  renderIntegratedLegend
17
- } from "./chunk-2NZOHEP4.js";
20
+ } from "./chunk-ASPS5O6F.js";
18
21
  import {
22
+ getLegendExtent,
19
23
  getMaxLegendReservedHeight
20
- } from "./chunk-J7HQPVYH.js";
24
+ } from "./chunk-GRXPFBYC.js";
21
25
  import {
22
26
  TITLE_FONT_SIZE,
23
27
  TITLE_FONT_WEIGHT,
@@ -44,11 +48,12 @@ import {
44
48
  import {
45
49
  resolveTagColor,
46
50
  tagAttrKey
47
- } from "./chunk-AHTTKERF.js";
51
+ } from "./chunk-JR7Q6GHE.js";
48
52
  import {
49
53
  fillModeFromOptions,
54
+ legendInlineRequested,
50
55
  legendSuppressed
51
- } from "./chunk-3FRO35WW.js";
56
+ } from "./chunk-A2ARDILY.js";
52
57
  import {
53
58
  resolveColor
54
59
  } from "./chunk-ZKPPI6BF.js";
@@ -116,7 +121,33 @@ function renderFamilyForExport(container, parsed, layout, palette, isDark, opts
116
121
  const contentH = layout.height;
117
122
  const W = opts.fit?.width ?? opts.exportDims?.width ?? contentW + PAD * 2;
118
123
  const legendReserve = hasLegend ? getMaxLegendReservedHeight(legendConfig, W) + LEGEND_GROUP_GAP : 0;
119
- const chrome = titleReserve + legendReserve;
124
+ const inlineRequested = legendInlineRequested(parsed.options);
125
+ const legendExtent = inlineRequested && hasLegend ? getLegendExtent(
126
+ {
127
+ groups: legendGroups,
128
+ position: {
129
+ placement: "top-center",
130
+ titleRelation: "inline-with-title"
131
+ },
132
+ mode: opts.exportMode ? "export" : "preview",
133
+ showInactivePills: true
134
+ },
135
+ { activeGroup: activeTagGroup },
136
+ W
137
+ ) : { width: 0, height: 0 };
138
+ const header = layoutInlineHeader({
139
+ requested: inlineRequested,
140
+ title: parsed.title ?? "",
141
+ hasLegend,
142
+ legendWidth: legendExtent.width,
143
+ legendHeight: legendExtent.height,
144
+ containerWidth: W,
145
+ titleBandHeight: titleReserve,
146
+ legendReserve,
147
+ titleBaselineY: TITLE_Y,
148
+ titleFontSize: TITLE_FONT_SIZE
149
+ });
150
+ const chrome = titleReserve + (header.inline ? 0 : legendReserve);
120
151
  let scale = 1;
121
152
  let H;
122
153
  if (opts.fit) {
@@ -133,12 +164,21 @@ function renderFamilyForExport(container, parsed, layout, palette, isDark, opts
133
164
  ".family-focus-icon{opacity:0;transition:opacity .15s ease;pointer-events:none}.family-card:hover .family-focus-icon{opacity:.6;pointer-events:all}.family-focus-icon:hover{opacity:1}"
134
165
  );
135
166
  if (parsed.title) {
136
- svg.append("text").attr("x", W / 2).attr("y", TITLE_Y).attr("text-anchor", "middle").attr("font-size", TITLE_FONT_SIZE).attr("font-weight", TITLE_FONT_WEIGHT).attr("fill", palette.text).text(parsed.title);
167
+ svg.append("text").attr("class", "chart-title").attr("x", header.titleX).attr("y", TITLE_Y).attr("text-anchor", header.titleAnchor).attr("font-size", TITLE_FONT_SIZE).attr("font-weight", TITLE_FONT_WEIGHT).attr("fill", palette.text).text(parsed.title);
137
168
  }
138
169
  if (hasLegend) {
139
- const legendParent = svg.append("g").attr("transform", `translate(0, ${titleReserve})`);
170
+ const legendParent = svg.append("g").attr(
171
+ "transform",
172
+ header.inline ? `translate(${header.legendX}, ${header.legendY})` : `translate(0, ${titleReserve})`
173
+ );
140
174
  renderIntegratedLegend(legendParent, {
141
175
  ...legendConfig,
176
+ // Inline → left-origin so the wrapper's right-flush translate lands the
177
+ // legend at the chart's right edge; stacked → centered below the title.
178
+ position: {
179
+ placement: "top-center",
180
+ titleRelation: header.inline ? "inline-with-title" : "below-title"
181
+ },
142
182
  palette,
143
183
  isDark,
144
184
  width: W,
@@ -277,4 +317,4 @@ export {
277
317
  renderFamilyForExport,
278
318
  renderFamily
279
319
  };
280
- //# sourceMappingURL=chunk-RIEAN4D5.js.map
320
+ //# sourceMappingURL=chunk-PV7ND5WL.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  renderIntegratedLegend
3
- } from "./chunk-2NZOHEP4.js";
3
+ } from "./chunk-ASPS5O6F.js";
4
4
  import {
5
5
  FONT_FAMILY
6
6
  } from "./chunk-6KFWC4CO.js";
@@ -18,7 +18,7 @@ import {
18
18
  resolveActiveTagGroup,
19
19
  resolveTagColor,
20
20
  tagAttrKey
21
- } from "./chunk-AHTTKERF.js";
21
+ } from "./chunk-JR7Q6GHE.js";
22
22
  import {
23
23
  resolveColor
24
24
  } from "./chunk-ZKPPI6BF.js";
@@ -334,4 +334,4 @@ export {
334
334
  renderBody,
335
335
  renderBodyForExport
336
336
  };
337
- //# sourceMappingURL=chunk-7K6NDSXH.js.map
337
+ //# sourceMappingURL=chunk-Q5CMQVWF.js.map