@diagrammo/dgmo 0.48.2 → 0.50.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 (244) hide show
  1. package/.cursorrules +12 -3
  2. package/.github/copilot-instructions.md +12 -3
  3. package/.windsurfrules +12 -3
  4. package/SKILL.md +12 -3
  5. package/dist/advanced.d.ts +851 -1
  6. package/dist/advanced.js +601 -177
  7. package/dist/auto.css +63 -0
  8. package/dist/auto.js +220 -110
  9. package/dist/auto.mjs +45920 -33167
  10. package/dist/block.css +63 -0
  11. package/dist/block.d.ts +13 -5
  12. package/dist/block.js +239 -62
  13. package/dist/{charts-d3-QOZHKTCT.js → charts-d3-DKUD7MQE.js} +9 -8
  14. package/dist/{chunk-3MQQNXPD.js → chunk-2C56LEML.js} +3 -3
  15. package/dist/{chunk-L66GEFB6.js → chunk-2JJ2KNPI.js} +4 -4
  16. package/dist/{chunk-6SM5NJQH.js → chunk-2QYTMIRR.js} +4 -4
  17. package/dist/{chunk-RJE5JTVK.js → chunk-3G6TMNVF.js} +7 -7
  18. package/dist/{chunk-MO5YHHMQ.js → chunk-3LKM6FMW.js} +2 -2
  19. package/dist/{chunk-76OWZ3BA.js → chunk-3P2DKJCG.js} +2 -2
  20. package/dist/chunk-3TDRHT4J.js +1043 -0
  21. package/dist/chunk-3XPUDB7B.js +420 -0
  22. package/dist/{chunk-2LACINWN.js → chunk-3ZPC476N.js} +7 -7
  23. package/dist/{chunk-G2H74XJZ.js → chunk-4BMJQFNK.js} +8 -8
  24. package/dist/{chunk-THXCFRTU.js → chunk-4S723I74.js} +9 -9
  25. package/dist/{chunk-6NYWYNBI.js → chunk-4XK3FLFB.js} +3 -3
  26. package/dist/chunk-5JSWBPZZ.js +607 -0
  27. package/dist/{chunk-WCT3NYCV.js → chunk-5LWQH6QV.js} +1 -1
  28. package/dist/{chunk-7DTWEFUE.js → chunk-5Z736BSU.js} +8 -8
  29. package/dist/{chunk-ERLBPDGU.js → chunk-6BFZKBGD.js} +2 -2
  30. package/dist/{chunk-6HO5ZTXK.js → chunk-6IAA2QQ2.js} +2 -2
  31. package/dist/{chunk-H6PI3KJT.js → chunk-6IUAK7RZ.js} +2 -2
  32. package/dist/{chunk-RTLBSQ3G.js → chunk-6M5PJFQG.js} +3 -3
  33. package/dist/{chunk-Z5CGSFJB.js → chunk-6X4AKWLF.js} +4 -4
  34. package/dist/{chunk-OJR3MQYV.js → chunk-6ZT4U37Q.js} +291 -52
  35. package/dist/{chunk-5QXL4NYS.js → chunk-7G2ER4CY.js} +10 -5
  36. package/dist/chunk-7PQYTZMA.js +681 -0
  37. package/dist/{chunk-OURHMODR.js → chunk-7RB5Q6MB.js} +11 -11
  38. package/dist/{chunk-YAA6IID3.js → chunk-7UEMZREK.js} +2 -2
  39. package/dist/{chunk-AN2MOO5T.js → chunk-A3WQVFBS.js} +3 -3
  40. package/dist/{chunk-VOKGH627.js → chunk-AHGF2YYA.js} +13 -3
  41. package/dist/{chunk-CI2G3OEB.js → chunk-ASS5YYIZ.js} +12 -12
  42. package/dist/{chunk-TYS6CSS5.js → chunk-BCYVE3N5.js} +2 -2
  43. package/dist/chunk-BDXC7MDK.js +2395 -0
  44. package/dist/chunk-BTUTZMPT.js +482 -0
  45. package/dist/{chunk-YGJTDXVR.js → chunk-C4GQDB5L.js} +2 -2
  46. package/dist/{chunk-Y2ZE3MSG.js → chunk-C63UWAKM.js} +2 -2
  47. package/dist/{chunk-725LDASD.js → chunk-CLD2OKV7.js} +2 -2
  48. package/dist/{chunk-WBRZJOEC.js → chunk-CMCR5WBW.js} +3 -3
  49. package/dist/{chunk-IZMRON6C.js → chunk-CVV36CWI.js} +2 -2
  50. package/dist/chunk-DMJJ3CEQ.js +254 -0
  51. package/dist/{chunk-MZSBFAPJ.js → chunk-EJTKV7CY.js} +9 -9
  52. package/dist/{chunk-FITOLXSX.js → chunk-EOFPYPAU.js} +26 -2
  53. package/dist/{chunk-X5LCYCL5.js → chunk-ER5SCQWQ.js} +5 -5
  54. package/dist/{chunk-4OHACBGX.js → chunk-F2L5GCQ4.js} +2 -2
  55. package/dist/{chunk-FCIIHT24.js → chunk-F5UDBSJY.js} +7 -7
  56. package/dist/{chunk-3JLKYGBQ.js → chunk-F7BFXWNQ.js} +2 -2
  57. package/dist/{chunk-FANX6UJR.js → chunk-FAL7NOK3.js} +11 -11
  58. package/dist/{chunk-BUPDIHML.js → chunk-FB2WHOEQ.js} +4 -4
  59. package/dist/chunk-FL4IOQ37.js +379 -0
  60. package/dist/{chunk-LIOHW36Z.js → chunk-GBE54KY6.js} +6 -5
  61. package/dist/{chunk-RUNNI6VE.js → chunk-GL5UZ6NY.js} +3 -3
  62. package/dist/{chunk-4GRI7MEB.js → chunk-GPWHQ5FJ.js} +6 -6
  63. package/dist/chunk-GROQGHCT.js +960 -0
  64. package/dist/{chunk-SGZYXELT.js → chunk-H73FP42Q.js} +9 -6
  65. package/dist/{chunk-PBAHEPLQ.js → chunk-HGN652MU.js} +7 -6
  66. package/dist/{chunk-3SMGIJDD.js → chunk-HHXOONLX.js} +13 -1
  67. package/dist/{chunk-QOOUC2J5.js → chunk-HQCHYB5F.js} +2 -2
  68. package/dist/{chunk-AELOBFW5.js → chunk-I4IFRCUB.js} +3 -3
  69. package/dist/{chunk-GMR5MFHJ.js → chunk-I7F2A35O.js} +2 -2
  70. package/dist/{chunk-T2OE3YQB.js → chunk-IA3FJYWR.js} +3 -3
  71. package/dist/chunk-IAEC4KLA.js +492 -0
  72. package/dist/chunk-IVKC4GID.js +32 -0
  73. package/dist/{chunk-HSH73DP6.js → chunk-JFYIP7XU.js} +139 -39
  74. package/dist/{chunk-CKNVO24D.js → chunk-JZNMXEIV.js} +2 -2
  75. package/dist/chunk-KJXIHOVL.js +940 -0
  76. package/dist/chunk-L2ZTFHAY.js +331 -0
  77. package/dist/{chunk-B7JUCQUA.js → chunk-M5RXSRO2.js} +4 -4
  78. package/dist/{chunk-ULOEATBZ.js → chunk-NFFIKVNO.js} +106 -29
  79. package/dist/{chunk-PZMETGLY.js → chunk-NISQC5KW.js} +358 -122
  80. package/dist/chunk-O4VUFXIH.js +574 -0
  81. package/dist/{chunk-RVMRZAPB.js → chunk-O76UD6VJ.js} +3 -3
  82. package/dist/{chunk-JM4LEPY3.js → chunk-O7NUCTFU.js} +2 -2
  83. package/dist/{chunk-JED6ZDEE.js → chunk-O7WP4ZD4.js} +2 -2
  84. package/dist/{chunk-EVCVDTXE.js → chunk-OHQEMBLI.js} +3 -3
  85. package/dist/{chunk-ZBWMSD5N.js → chunk-ONA5KPV3.js} +4 -4
  86. package/dist/{chunk-Y3J7VR52.js → chunk-OTAL43EH.js} +34 -2
  87. package/dist/{chunk-WCSOJFU3.js → chunk-OTP5KVLO.js} +3 -3
  88. package/dist/{chunk-RYEGFMUO.js → chunk-PGEGPSCZ.js} +2 -2
  89. package/dist/{chunk-ZO27FGJS.js → chunk-PH5X4GIP.js} +2 -2
  90. package/dist/{chunk-ZJEL4H2R.js → chunk-PJUGRJHJ.js} +9 -9
  91. package/dist/{chunk-ZGR7ULFJ.js → chunk-PLZI6KPM.js} +26 -14
  92. package/dist/{chunk-3R5POCTZ.js → chunk-PMN3Q7RJ.js} +6 -6
  93. package/dist/{chunk-YGJZWZTY.js → chunk-PZFVK3IH.js} +2 -2
  94. package/dist/chunk-Q4V4XQWV.js +158 -0
  95. package/dist/chunk-QDFNCATJ.js +325 -0
  96. package/dist/{chunk-QEBUY5NY.js → chunk-QFQ35BTO.js} +4 -4
  97. package/dist/chunk-QQJUTGQH.js +135 -0
  98. package/dist/{chunk-PWIHZ6NJ.js → chunk-QUJGFNFN.js} +4 -4
  99. package/dist/{chunk-J5FIXQRT.js → chunk-R56LASIN.js} +4 -4
  100. package/dist/{chunk-SRTU6HMQ.js → chunk-RV26LTUU.js} +8 -8
  101. package/dist/chunk-RV6A2B5S.js +354 -0
  102. package/dist/{chunk-EB6FPQUP.js → chunk-S5GRONXL.js} +3 -3
  103. package/dist/{chunk-5MLYVTYM.js → chunk-SCHXJTZL.js} +2 -2
  104. package/dist/{chunk-T3UBLACL.js → chunk-SCQ5VPUF.js} +19 -5
  105. package/dist/{chunk-PBHE5UG6.js → chunk-SGFZZAUO.js} +46 -12
  106. package/dist/{chunk-BUVJFRPY.js → chunk-SU2VBK4L.js} +4 -4
  107. package/dist/{chunk-SML67VPV.js → chunk-T4BRO3Z6.js} +3 -3
  108. package/dist/{chunk-NURGB5Z4.js → chunk-TSA237IM.js} +2 -2
  109. package/dist/chunk-TWCLK2GA.js +273 -0
  110. package/dist/{chunk-IJZFN3HM.js → chunk-TWQUYVP3.js} +4 -4
  111. package/dist/{chunk-DKEPS5LH.js → chunk-U2HGPLZS.js} +36 -2
  112. package/dist/{chunk-B65G5DNL.js → chunk-URSQLCTR.js} +3 -3
  113. package/dist/{chunk-ILKORZ3H.js → chunk-UUS2GIJZ.js} +7 -7
  114. package/dist/{chunk-XAKEUMEJ.js → chunk-UXOSVCLJ.js} +4 -4
  115. package/dist/{chunk-QLCCJEJI.js → chunk-WCUHAQKB.js} +2 -2
  116. package/dist/{chunk-WVAJFAIA.js → chunk-WWN566I7.js} +257 -101
  117. package/dist/{chunk-IPWPWM6R.js → chunk-X2NMFTG3.js} +111 -10
  118. package/dist/{chunk-UWN33VNX.js → chunk-XCLHOZAM.js} +10 -10
  119. package/dist/{chunk-P235SVAH.js → chunk-XDXNDSKO.js} +2 -2
  120. package/dist/chunk-XHVV4NVW.js +51 -0
  121. package/dist/{chunk-33LCUH4H.js → chunk-XMVQ5F4M.js} +4 -4
  122. package/dist/{chunk-MITI6NOL.js → chunk-YA7D2N2O.js} +11 -11
  123. package/dist/{chunk-7JEGTRLD.js → chunk-YB3FW24O.js} +3 -3
  124. package/dist/chunk-YNRDWYZP.js +295 -0
  125. package/dist/{chunk-44CM72SQ.js → chunk-YZLMKW4T.js} +3 -3
  126. package/dist/chunk-Z6XJQ6KO.js +452 -0
  127. package/dist/cli.cjs +179 -133
  128. package/dist/clock.d.ts +10 -0
  129. package/dist/clock.js +235 -0
  130. package/dist/countdown.d.ts +12 -0
  131. package/dist/countdown.js +450 -0
  132. package/dist/dgmo-router-QOMFCOOV.js +84 -0
  133. package/dist/dimensions-P5FSX2QN.js +22 -0
  134. package/dist/editor.js +43 -2
  135. package/dist/element.js +220 -110
  136. package/dist/element.mjs +45920 -33167
  137. package/dist/{flowchart-parser-ZNSKIBVR.js → flowchart-parser-OE4WHLTF.js} +4 -4
  138. package/dist/{flowchart-renderer-SNDSII4D.js → flowchart-renderer-GPCSMTOR.js} +8 -8
  139. package/dist/highlight.d.ts +17 -1
  140. package/dist/highlight.js +163 -6
  141. package/dist/index.d.ts +5 -1
  142. package/dist/index.js +199 -233
  143. package/dist/{layout-HRBZPFCN.js → layout-34CLNICW.js} +5 -5
  144. package/dist/layout-46366KBT.js +10 -0
  145. package/dist/{layout-HWDSRX5E.js → layout-5BG6DFCU.js} +6 -6
  146. package/dist/layout-6RDJHS6E.js +9 -0
  147. package/dist/{layout-7QXCNOVS.js → layout-7H4H46CS.js} +3 -3
  148. package/dist/{layout-46N4JJYK.js → layout-7SKMFYHL.js} +5 -5
  149. package/dist/{layout-EE6GE46Y.js → layout-DC4TVXER.js} +5 -5
  150. package/dist/layout-FGQWRYYW.js +14 -0
  151. package/dist/{layout-S2QBYSK2.js → layout-NXG63LWH.js} +3 -3
  152. package/dist/{layout-N76NR4ZO.js → layout-PUQCB6AN.js} +7 -7
  153. package/dist/{layout-HYZPWAK5.js → layout-QNUQLEHU.js} +3 -3
  154. package/dist/{layout-UM5F4DJB.js → layout-T3OZU5QW.js} +5 -5
  155. package/dist/layout-TJIWF7EM.js +14 -0
  156. package/dist/layout-VYELEAW7.js +14 -0
  157. package/dist/{layout-5RA6QWR6.js → layout-WZHNDT2O.js} +6 -6
  158. package/dist/{layout-search-OYV77HHS.js → layout-search-QS44PI5R.js} +6 -6
  159. package/dist/{parser-6BTRLKRZ.js → parser-45DENHFZ.js} +4 -4
  160. package/dist/{parser-TFZFBVWN.js → parser-4AI5ZN5F.js} +3 -3
  161. package/dist/{parser-XDVELHRK.js → parser-4P36TUVD.js} +4 -4
  162. package/dist/{parser-ZSDPZYQP.js → parser-5AURY4A6.js} +4 -4
  163. package/dist/{parser-N5O4IHUN.js → parser-A2BEFMGK.js} +4 -4
  164. package/dist/parser-B5FVS7O6.js +11 -0
  165. package/dist/{parser-NGU3ETO6.js → parser-C2HF2C2E.js} +4 -4
  166. package/dist/parser-CSFUN3CT.js +14 -0
  167. package/dist/{parser-TRTHDFPP.js → parser-D3QT6GWN.js} +5 -5
  168. package/dist/parser-D5637H5H.js +15 -0
  169. package/dist/{parser-VQP2UJ6W.js → parser-DFFEDKHH.js} +3 -3
  170. package/dist/parser-DOKMZXVZ.js +13 -0
  171. package/dist/parser-FMPCVFRK.js +15 -0
  172. package/dist/{parser-Y6WTBU76.js → parser-HYRTF3DO.js} +3 -3
  173. package/dist/{parser-I6KXEYFK.js → parser-I2UIJKVQ.js} +4 -4
  174. package/dist/{parser-O5J4VBII.js → parser-IBWNAPY4.js} +3 -3
  175. package/dist/{parser-PQ3POX45.js → parser-KUQWRPIT.js} +4 -4
  176. package/dist/{parser-2MFP2H2E.js → parser-LWKKBNSA.js} +3 -3
  177. package/dist/{parser-OV7NOBW6.js → parser-O4QFCUW7.js} +5 -5
  178. package/dist/{parser-IXSZZQHY.js → parser-PGMQDD4G.js} +4 -4
  179. package/dist/{parser-3STE62GB.js → parser-Q4QKCIWQ.js} +4 -4
  180. package/dist/parser-QTOB4KFL.js +14 -0
  181. package/dist/{parser-2EWECDSA.js → parser-QYYM4QVW.js} +4 -4
  182. package/dist/{parser-4OGOBJJ4.js → parser-RZMQP7MM.js} +4 -4
  183. package/dist/parser-RZPVAQVX.js +11 -0
  184. package/dist/parser-SOUJOEYI.js +13 -0
  185. package/dist/{parser-4FL2CMDG.js → parser-UQE5OWZI.js} +5 -5
  186. package/dist/{parser-NRAI6O25.js → parser-WAV5JRPT.js} +4 -4
  187. package/dist/{parser-KNSQSKQO.js → parser-YLKYBRIT.js} +5 -5
  188. package/dist/{parser-XKRP7QKP.js → parser-YS7TOS2K.js} +3 -3
  189. package/dist/{parser-AQETEVRW.js → parser-ZSOWUBML.js} +5 -5
  190. package/dist/{parser-CFZD5IBL.js → parser-ZTBATMLX.js} +4 -4
  191. package/dist/{renderer-VACVQYML.js → renderer-35HSIDMZ.js} +8 -8
  192. package/dist/{renderer-5MYBMBYO.js → renderer-4ITCHBT7.js} +5 -5
  193. package/dist/{renderer-CLJHQPBJ.js → renderer-67NPCBIS.js} +11 -11
  194. package/dist/{renderer-5NDVNDAZ.js → renderer-6GHYK7DX.js} +9 -9
  195. package/dist/{renderer-Z7I3W2PP.js → renderer-6RNGHC5Z.js} +8 -8
  196. package/dist/renderer-72LGR2YF.js +14 -0
  197. package/dist/{renderer-KQB7UGDS.js → renderer-7RH2SI3B.js} +3 -3
  198. package/dist/renderer-7SWMIFMM.js +21 -0
  199. package/dist/renderer-BBCEFILK.js +24 -0
  200. package/dist/{renderer-JGBKUCZD.js → renderer-BSW7SRIZ.js} +4 -4
  201. package/dist/{renderer-BYCNMBF7.js → renderer-BY533UWU.js} +11 -11
  202. package/dist/{renderer-6W5462RB.js → renderer-BZSBPTZJ.js} +9 -9
  203. package/dist/{renderer-7MVLWWQD.js → renderer-CXUC4KAD.js} +9 -9
  204. package/dist/{renderer-QIWVHWZO.js → renderer-DAXMXIKD.js} +3 -3
  205. package/dist/renderer-FZUKFUNZ.js +23 -0
  206. package/dist/renderer-G2NLGNKF.js +17 -0
  207. package/dist/renderer-GO3FE3RA.js +24 -0
  208. package/dist/{renderer-ZGNTUWC4.js → renderer-HPGR6USK.js} +8 -8
  209. package/dist/{renderer-UV6MI64M.js → renderer-HVCU2C3Z.js} +3 -3
  210. package/dist/renderer-ICJN2SA2.js +24 -0
  211. package/dist/{renderer-AWWAF6XD.js → renderer-INEXO7B6.js} +10 -10
  212. package/dist/{renderer-YY2OSF6E.js → renderer-KDYCFRBX.js} +8 -8
  213. package/dist/renderer-KY4KQBTF.js +19 -0
  214. package/dist/{renderer-B2OMQIQG.js → renderer-LBN65V45.js} +13 -13
  215. package/dist/{renderer-N43WR5GV.js → renderer-MGBWOCXG.js} +10 -10
  216. package/dist/{renderer-PGX2TKVS.js → renderer-O4JKUGKO.js} +8 -8
  217. package/dist/{renderer-4JHRUBE6.js → renderer-OOGFODWP.js} +10 -10
  218. package/dist/{renderer-6EEZHMH4.js → renderer-Q6ZKPLS6.js} +9 -9
  219. package/dist/{renderer-RPOA5YPZ.js → renderer-SZQ326M5.js} +12 -12
  220. package/dist/{renderer-ZRNG54CW.js → renderer-TKG6LS4U.js} +11 -11
  221. package/dist/{renderer-W4M6QLIJ.js → renderer-TQMZGDAX.js} +13 -13
  222. package/dist/renderer-radial-JELMHQ24.js +21 -0
  223. package/dist/{resolver-NOAA7ID7.js → resolver-FHBCO3PL.js} +3 -3
  224. package/dist/{state-parser-Z2V23ATR.js → state-parser-3REXRK3R.js} +4 -4
  225. package/dist/{state-renderer-B4DQBM6M.js → state-renderer-XYLNRWXR.js} +8 -8
  226. package/docs/ai-integration.md +12 -3
  227. package/docs/language-reference.md +429 -24
  228. package/gallery/fixtures/body.dgmo +17 -0
  229. package/gallery/fixtures/bracket.dgmo +30 -0
  230. package/gallery/fixtures/clock.dgmo +8 -0
  231. package/gallery/fixtures/countdown.dgmo +3 -0
  232. package/gallery/fixtures/family.dgmo +23 -0
  233. package/gallery/fixtures/goal.dgmo +4 -0
  234. package/gallery/fixtures/sketch.dgmo +22 -0
  235. package/package.json +12 -4
  236. package/dist/chunk-ODZVHU3R.js +0 -153
  237. package/dist/dgmo-router-X35VLZLM.js +0 -73
  238. package/dist/dimensions-J3FHIMJ6.js +0 -22
  239. package/dist/layout-5T6RH5M6.js +0 -14
  240. package/dist/layout-G23F7LDH.js +0 -9
  241. package/dist/layout-OB3RI63S.js +0 -14
  242. package/dist/parser-JAL2HD4I.js +0 -13
  243. package/dist/renderer-SMIBCRVB.js +0 -24
  244. package/dist/renderer-radial-C32GPJQ7.js +0 -21
@@ -4,6 +4,10 @@ import {
4
4
  import {
5
5
  ScaleContext
6
6
  } from "./chunk-YYVTBZZC.js";
7
+ import {
8
+ VARIANTS,
9
+ allTasks
10
+ } from "./chunk-PGEGPSCZ.js";
7
11
  import {
8
12
  TITLE_FONT_SIZE,
9
13
  TITLE_FONT_WEIGHT,
@@ -16,11 +20,7 @@ import {
16
20
  measureText,
17
21
  truncateText,
18
22
  wrapTextToWidth
19
- } from "./chunk-WCT3NYCV.js";
20
- import {
21
- VARIANTS,
22
- allTasks
23
- } from "./chunk-RYEGFMUO.js";
23
+ } from "./chunk-5LWQH6QV.js";
24
24
  import {
25
25
  contrastText,
26
26
  mix,
@@ -260,6 +260,9 @@ function renderRaci(container, parsed, palette, isDark, handlers, exportDims) {
260
260
  const totalHeight = colBottomY + sVMargin;
261
261
  const svgHeight = exportDims ? totalHeight : Math.max(height, totalHeight);
262
262
  const svg = d3Selection.select(container).append("svg").attr("xmlns", "http://www.w3.org/2000/svg").attr("width", width).attr("height", svgHeight).attr("viewBox", `0 0 ${width} ${svgHeight}`).attr("preserveAspectRatio", "xMidYMin meet").attr("font-family", FONT_FAMILY);
263
+ if (!exportDims && svgHeight > totalHeight) {
264
+ svg.attr("data-content-height", Math.ceil(totalHeight));
265
+ }
263
266
  if (ctx.isBelowFloor) {
264
267
  svg.attr("width", "100%");
265
268
  }
@@ -744,4 +747,4 @@ export {
744
747
  renderRaci,
745
748
  renderRaciForExport
746
749
  };
747
- //# sourceMappingURL=chunk-SGZYXELT.js.map
750
+ //# sourceMappingURL=chunk-H73FP42Q.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  measureText
3
- } from "./chunk-WCT3NYCV.js";
3
+ } from "./chunk-5LWQH6QV.js";
4
4
 
5
5
  // src/label-layout.ts
6
6
  function rectsOverlap(a, b) {
@@ -57,16 +57,16 @@ function segmentsCross(ax, ay, bx, by, cx, cy, dx, dy) {
57
57
  function computeQuadrantPointLabels(points, chartBounds, obstacles, pointRadius, fontSize) {
58
58
  const labelHeight = fontSize + 4;
59
59
  const stepSize = labelHeight + 2;
60
- const minGap = pointRadius + 4;
61
60
  const pointCircles = points.map((p) => ({
62
61
  cx: p.cx,
63
62
  cy: p.cy,
64
- r: pointRadius
63
+ r: p.r ?? pointRadius
65
64
  }));
66
65
  const placedLabels = [];
67
66
  const results = [];
68
67
  for (let i = 0; i < points.length; i++) {
69
68
  const pt = points[i];
69
+ const minGap = (pt.r ?? pointRadius) + 4;
70
70
  const labelWidth = measureText(pt.label, fontSize) + 8;
71
71
  let best = null;
72
72
  const directions = [
@@ -190,8 +190,9 @@ function computeQuadrantPointLabels(points, chartBounds, obstacles, pointRadius,
190
190
  const dx = best.textX - pt.cx;
191
191
  const dy = best.textY - pt.cy;
192
192
  const angle = Math.atan2(dy, dx);
193
- const x1 = pt.cx + Math.cos(angle) * pointRadius;
194
- const y1 = pt.cy + Math.sin(angle) * pointRadius;
193
+ const ptR = pt.r ?? pointRadius;
194
+ const x1 = pt.cx + Math.cos(angle) * ptR;
195
+ const y1 = pt.cy + Math.sin(angle) * ptR;
195
196
  const x2 = Math.max(
196
197
  best.rect.x,
197
198
  Math.min(pt.cx, best.rect.x + best.rect.w)
@@ -220,4 +221,4 @@ export {
220
221
  segmentsCross,
221
222
  computeQuadrantPointLabels
222
223
  };
223
- //# sourceMappingURL=chunk-PBAHEPLQ.js.map
224
+ //# sourceMappingURL=chunk-HGN652MU.js.map
@@ -70,6 +70,18 @@ var MAP_DX = {
70
70
  hint: "Multiple places share this name \u2014 add a scope or `locale <ISO>` to steer it.",
71
71
  example: "map\npoi Portland"
72
72
  },
73
+ AMBIGUOUS_LABEL: {
74
+ // Runtime severity: 'error' (matches E_ prefix). A route/edge referenced a
75
+ // POI by its `label:`, but two or more declared POIs share that label, so the
76
+ // reference can't bind to one. Disambiguate with a unique `as <alias>`.
77
+ code: "E_MAP_AMBIGUOUS_LABEL",
78
+ severity: "error",
79
+ chartType: "map",
80
+ title: "Ambiguous POI label",
81
+ message: (p) => `Reference "${p.name ?? ""}" matches the label of two or more POIs \u2014 give each a distinct \`as <alias>\` and reference the alias instead.`,
82
+ hint: "Multiple POIs share this label \u2014 reference a unique `as <alias>` rather than the label.",
83
+ example: "map\npoi 1 2 label: Depot\npoi 3 4 label: Depot"
84
+ },
73
85
  DUPLICATE_POI: {
74
86
  // Runtime severity: 'warning' (matches W_ prefix). Only a declared-over-
75
87
  // declared collision warns; an implicit endpoint never triggers it.
@@ -109,4 +121,4 @@ export {
109
121
  MAP_DX,
110
122
  MAP_DIAGNOSTICS
111
123
  };
112
- //# sourceMappingURL=chunk-3SMGIJDD.js.map
124
+ //# sourceMappingURL=chunk-HHXOONLX.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  measureText,
3
3
  truncateText
4
- } from "./chunk-WCT3NYCV.js";
4
+ } from "./chunk-5LWQH6QV.js";
5
5
 
6
6
  // src/utils/legend-constants.ts
7
7
  var LEGEND_HEIGHT = 28;
@@ -49,4 +49,4 @@ export {
49
49
  LEGEND_TOGGLE_OFF_OPACITY,
50
50
  LEGEND_GEAR_PILL_W
51
51
  };
52
- //# sourceMappingURL=chunk-QOOUC2J5.js.map
52
+ //# sourceMappingURL=chunk-HQCHYB5F.js.map
@@ -5,7 +5,7 @@ import {
5
5
  stripDefaultModifier,
6
6
  tagAttrKey,
7
7
  validateTagGroupNames
8
- } from "./chunk-QLCCJEJI.js";
8
+ } from "./chunk-WCUHAQKB.js";
9
9
  import {
10
10
  normalizeName
11
11
  } from "./chunk-NOTA6TEI.js";
@@ -18,7 +18,7 @@ import {
18
18
  splitNameAndMeta,
19
19
  warnUnknownMetaKeys,
20
20
  withTagAliases
21
- } from "./chunk-Y3J7VR52.js";
21
+ } from "./chunk-OTAL43EH.js";
22
22
  import {
23
23
  resolveColorWithDiagnostic
24
24
  } from "./chunk-TLVIHFRO.js";
@@ -372,4 +372,4 @@ function parseCardLine(trimmed, lineNumber, counter, metaAliasMap, _palette, dia
372
372
  export {
373
373
  parseKanban
374
374
  };
375
- //# sourceMappingURL=chunk-AELOBFW5.js.map
375
+ //# sourceMappingURL=chunk-I4IFRCUB.js.map
@@ -3,7 +3,7 @@ import {
3
3
  splitNameAndMeta,
4
4
  warnUnknownMetaKeys,
5
5
  withTagAliases
6
- } from "./chunk-Y3J7VR52.js";
6
+ } from "./chunk-OTAL43EH.js";
7
7
  import {
8
8
  makeDgmoError
9
9
  } from "./chunk-CXK4DZH3.js";
@@ -336,4 +336,4 @@ export {
336
336
  parseTimelineDate,
337
337
  parseTimelineEventLine
338
338
  };
339
- //# sourceMappingURL=chunk-GMR5MFHJ.js.map
339
+ //# sourceMappingURL=chunk-I7F2A35O.js.map
@@ -4,14 +4,14 @@ import {
4
4
  import {
5
5
  measureText,
6
6
  truncateText
7
- } from "./chunk-WCT3NYCV.js";
7
+ } from "./chunk-5LWQH6QV.js";
8
8
  import {
9
9
  preprocessDescriptionLine
10
10
  } from "./chunk-IYULMRBE.js";
11
11
  import {
12
12
  injectDefaultTagMetadata,
13
13
  resolveTagColor
14
- } from "./chunk-QLCCJEJI.js";
14
+ } from "./chunk-WCUHAQKB.js";
15
15
 
16
16
  // src/mindmap/text-wrap.ts
17
17
  var H_PAD = 16;
@@ -547,4 +547,4 @@ export {
547
547
  computeNodeText,
548
548
  layoutMindmap
549
549
  };
550
- //# sourceMappingURL=chunk-T2OE3YQB.js.map
550
+ //# sourceMappingURL=chunk-IA3FJYWR.js.map
@@ -0,0 +1,492 @@
1
+ import {
2
+ familyCardRows
3
+ } from "./chunk-IVKC4GID.js";
4
+ import {
5
+ HEADER_HEIGHT,
6
+ LABEL_FONT_SIZE,
7
+ META_FONT_SIZE,
8
+ META_LINE_HEIGHT,
9
+ SEPARATOR_GAP
10
+ } from "./chunk-3CIOJ5YJ.js";
11
+ import {
12
+ measureText
13
+ } from "./chunk-5LWQH6QV.js";
14
+ import {
15
+ buildCoupleQuotient,
16
+ rankClasses
17
+ } from "./chunk-QQJUTGQH.js";
18
+
19
+ // src/family/layout.ts
20
+ var MARGIN = 30;
21
+ var MIN_CARD_W = 132;
22
+ var CARD_H_PAD = 12;
23
+ var CARD_TEXT_PAD = 12;
24
+ var H_GAP = 60;
25
+ var ROW_GAP = 74;
26
+ var KEY_VALUE_GAP = 6;
27
+ var KEY_X = 10;
28
+ var GUTTER_WIDTH = 72;
29
+ function birthYear(persons, id) {
30
+ const b = persons.get(id)?.metadata["b"];
31
+ if (b === void 0) return null;
32
+ const n = parseInt(b, 10);
33
+ return Number.isFinite(n) ? n : null;
34
+ }
35
+ function sortChildrenByBirth(children, persons) {
36
+ return children.map((c, i) => ({ c, i, b: birthYear(persons, c.personId) })).sort((x, y) => {
37
+ if (x.b !== null && y.b !== null) return x.b - y.b || x.i - y.i;
38
+ if (x.b !== null) return -1;
39
+ if (y.b !== null) return 1;
40
+ return x.i - y.i;
41
+ }).map((o) => o.c);
42
+ }
43
+ function computeBloodline(unions, focusId) {
44
+ const childOf = /* @__PURE__ */ new Map();
45
+ const parentOf = /* @__PURE__ */ new Map();
46
+ const unionById = new Map(unions.map((u) => [u.id, u]));
47
+ for (const u of unions) {
48
+ for (const p of u.parents)
49
+ (parentOf.get(p) ?? parentOf.set(p, []).get(p)).push(u.id);
50
+ for (const c of u.children)
51
+ (childOf.get(c.personId) ?? childOf.set(c.personId, []).get(c.personId)).push(u.id);
52
+ }
53
+ const set = /* @__PURE__ */ new Set([focusId]);
54
+ const up = [focusId];
55
+ while (up.length) {
56
+ const id = up.pop();
57
+ for (const uid of childOf.get(id) ?? [])
58
+ for (const p of unionById.get(uid).parents)
59
+ if (!set.has(p)) {
60
+ set.add(p);
61
+ up.push(p);
62
+ }
63
+ }
64
+ const down = [focusId];
65
+ while (down.length) {
66
+ const id = down.pop();
67
+ for (const uid of parentOf.get(id) ?? [])
68
+ for (const c of unionById.get(uid).children)
69
+ if (!set.has(c.personId)) {
70
+ set.add(c.personId);
71
+ down.push(c.personId);
72
+ }
73
+ }
74
+ for (const id of [...set])
75
+ for (const uid of parentOf.get(id) ?? [])
76
+ for (const p of unionById.get(uid).parents) set.add(p);
77
+ return set;
78
+ }
79
+ function cardSize(p) {
80
+ const rows = familyCardRows(p);
81
+ const labeled = rows.filter((r) => !r.year);
82
+ const maxKeyW = labeled.length ? Math.max(...labeled.map((r) => measureText(`${r.key}: `, META_FONT_SIZE))) : 0;
83
+ const valueX = KEY_X + maxKeyW + KEY_VALUE_GAP;
84
+ let contentRight = 0;
85
+ for (const r of rows) {
86
+ const right = r.year ? KEY_X + measureText(r.value, META_FONT_SIZE) : valueX + measureText(r.value, META_FONT_SIZE);
87
+ contentRight = Math.max(contentRight, right);
88
+ }
89
+ const labelW = measureText(p.label, LABEL_FONT_SIZE);
90
+ const width = Math.max(
91
+ MIN_CARD_W,
92
+ labelW + CARD_TEXT_PAD * 2,
93
+ contentRight + CARD_TEXT_PAD
94
+ );
95
+ const height = rows.length > 0 ? HEADER_HEIGHT + SEPARATOR_GAP + rows.length * META_LINE_HEIGHT + CARD_H_PAD : HEADER_HEIGHT + CARD_H_PAD;
96
+ return { width, height };
97
+ }
98
+ function orderRow(persons, parentUnions, unionParents, unionChildren, unionOrder) {
99
+ const disco = /* @__PURE__ */ new Map();
100
+ let seq = 0;
101
+ const visit = (id) => {
102
+ if (disco.has(id)) return;
103
+ disco.set(id, seq++);
104
+ for (const uid of parentUnions.get(id) ?? []) {
105
+ for (const sp of unionParents.get(uid) ?? []) visit(sp);
106
+ for (const ch of unionChildren.get(uid) ?? []) visit(ch);
107
+ }
108
+ };
109
+ for (const uid of unionOrder) {
110
+ for (const p of unionParents.get(uid) ?? []) visit(p);
111
+ }
112
+ for (const id of persons.keys()) visit(id);
113
+ return disco;
114
+ }
115
+ function orderRowSpouses(ids, spouseAdj, discoOf) {
116
+ const inRow = new Set(ids);
117
+ const nbrs = (id) => [...spouseAdj.get(id) ?? []].filter((n) => inRow.has(n));
118
+ const visited = /* @__PURE__ */ new Set();
119
+ const components = [];
120
+ for (const seed of [...ids].sort((a, b) => discoOf(a) - discoOf(b))) {
121
+ if (visited.has(seed)) continue;
122
+ const comp = [];
123
+ const stack = [seed];
124
+ visited.add(seed);
125
+ while (stack.length) {
126
+ const v = stack.pop();
127
+ comp.push(v);
128
+ for (const w of nbrs(v))
129
+ if (!visited.has(w)) {
130
+ visited.add(w);
131
+ stack.push(w);
132
+ }
133
+ }
134
+ if (comp.length === 1) {
135
+ components.push(comp);
136
+ continue;
137
+ }
138
+ const start = comp.filter((id) => nbrs(id).length <= 1).sort((a, b) => discoOf(a) - discoOf(b))[0] ?? comp.slice().sort((a, b) => discoOf(a) - discoOf(b))[0];
139
+ const path = [];
140
+ const seen = /* @__PURE__ */ new Set();
141
+ let cur = start;
142
+ while (cur !== void 0 && !seen.has(cur)) {
143
+ seen.add(cur);
144
+ path.push(cur);
145
+ cur = nbrs(cur).filter((n) => !seen.has(n)).sort((a, b) => discoOf(a) - discoOf(b))[0];
146
+ }
147
+ for (const id of comp) if (!seen.has(id)) path.push(id);
148
+ components.push(path);
149
+ }
150
+ components.sort(
151
+ (x, y) => Math.min(...x.map(discoOf)) - Math.min(...y.map(discoOf))
152
+ );
153
+ return components.flat();
154
+ }
155
+ function focusFamily(parsed, focusId) {
156
+ if (!parsed.persons.has(focusId)) {
157
+ return { persons: parsed.persons, unions: parsed.unions, parents: [] };
158
+ }
159
+ const childOf = /* @__PURE__ */ new Map();
160
+ const parentOf = /* @__PURE__ */ new Map();
161
+ const unionById = new Map(parsed.unions.map((u) => [u.id, u]));
162
+ for (const u of parsed.unions) {
163
+ for (const p of u.parents)
164
+ (parentOf.get(p) ?? parentOf.set(p, []).get(p)).push(u.id);
165
+ for (const c of u.children)
166
+ (childOf.get(c.personId) ?? childOf.set(c.personId, []).get(c.personId)).push(u.id);
167
+ }
168
+ const visible = /* @__PURE__ */ new Set([focusId]);
169
+ const down = [focusId];
170
+ while (down.length) {
171
+ const id = down.pop();
172
+ for (const uid of parentOf.get(id) ?? [])
173
+ for (const c of unionById.get(uid).children)
174
+ if (!visible.has(c.personId)) {
175
+ visible.add(c.personId);
176
+ down.push(c.personId);
177
+ }
178
+ }
179
+ for (const id of [...visible])
180
+ for (const uid of parentOf.get(id) ?? [])
181
+ for (const p of unionById.get(uid).parents) visible.add(p);
182
+ const parentIds = /* @__PURE__ */ new Set();
183
+ for (const uid of childOf.get(focusId) ?? [])
184
+ for (const p of unionById.get(uid).parents) parentIds.add(p);
185
+ const parents = [...parentIds].map((id) => parsed.persons.get(id)).filter((p) => p !== void 0);
186
+ const persons = /* @__PURE__ */ new Map();
187
+ for (const [id, p] of parsed.persons) if (visible.has(id)) persons.set(id, p);
188
+ const unions = parsed.unions.filter((u) => u.parents.every((p) => visible.has(p))).map((u) => ({
189
+ ...u,
190
+ children: u.children.filter((c) => visible.has(c.personId))
191
+ }));
192
+ return { persons, unions, parents };
193
+ }
194
+ function layoutFamily(parsed, focusId) {
195
+ const focused = focusId ? focusFamily(parsed, focusId) : null;
196
+ const persons = focused ? focused.persons : parsed.persons;
197
+ const unions = (focused ? focused.unions : parsed.unions).map((u) => ({ ...u, children: sortChildrenByBirth(u.children, persons) }));
198
+ const focusParents = focused ? focused.parents : [];
199
+ const highlightId = parsed.options["highlight"] || null;
200
+ const litSet = highlightId ? computeBloodline(unions, highlightId) : null;
201
+ const showGen = parsed.options["generations"] === "true";
202
+ const ANCESTOR_STAGGER = 20;
203
+ const ANCESTOR_BAND = focusParents.length > 0 ? 34 + Math.max(0, focusParents.length - 1) * ANCESTOR_STAGGER : 0;
204
+ const quotient = buildCoupleQuotient(persons, unions);
205
+ const classRow = quotient.cycle ? /* @__PURE__ */ new Map() : rankClasses(quotient);
206
+ const rowOf = (id) => {
207
+ const c = quotient.classOf.get(id);
208
+ return c === void 0 ? 0 : classRow.get(c) ?? 0;
209
+ };
210
+ const parentUnions = /* @__PURE__ */ new Map();
211
+ const unionParents = /* @__PURE__ */ new Map();
212
+ const unionChildren = /* @__PURE__ */ new Map();
213
+ const unionOrder = [];
214
+ for (const u of unions) {
215
+ unionOrder.push(u.id);
216
+ unionParents.set(u.id, [...u.parents]);
217
+ unionChildren.set(
218
+ u.id,
219
+ u.children.map((c) => c.personId)
220
+ );
221
+ for (const p of u.parents) {
222
+ (parentUnions.get(p) ?? parentUnions.set(p, []).get(p)).push(u.id);
223
+ }
224
+ }
225
+ const disco = orderRow(
226
+ persons,
227
+ parentUnions,
228
+ unionParents,
229
+ unionChildren,
230
+ unionOrder
231
+ );
232
+ const sizes = /* @__PURE__ */ new Map();
233
+ for (const [id, p] of persons) sizes.set(id, cardSize(p));
234
+ const rowPersons = /* @__PURE__ */ new Map();
235
+ let maxRow = 0;
236
+ for (const id of persons.keys()) {
237
+ const r = rowOf(id);
238
+ maxRow = Math.max(maxRow, r);
239
+ (rowPersons.get(r) ?? rowPersons.set(r, []).get(r)).push(id);
240
+ }
241
+ const spouseAdj = /* @__PURE__ */ new Map();
242
+ for (const u of unions) {
243
+ if (u.parents.length !== 2) continue;
244
+ const [a, b] = u.parents;
245
+ (spouseAdj.get(a) ?? spouseAdj.set(a, /* @__PURE__ */ new Set()).get(a)).add(b);
246
+ (spouseAdj.get(b) ?? spouseAdj.set(b, /* @__PURE__ */ new Set()).get(b)).add(a);
247
+ }
248
+ const discoOf = (id) => disco.get(id) ?? 0;
249
+ for (const [r, arr] of rowPersons) {
250
+ rowPersons.set(r, orderRowSpouses(arr, spouseAdj, discoOf));
251
+ }
252
+ const rowHeight = /* @__PURE__ */ new Map();
253
+ for (let r = 0; r <= maxRow; r++) {
254
+ let h = 0;
255
+ for (const id of rowPersons.get(r) ?? [])
256
+ h = Math.max(h, sizes.get(id).height);
257
+ rowHeight.set(r, h);
258
+ }
259
+ const rowY = /* @__PURE__ */ new Map();
260
+ {
261
+ let acc = MARGIN + ANCESTOR_BAND;
262
+ for (let r = 0; r <= maxRow; r++) {
263
+ rowY.set(r, acc);
264
+ acc += (rowHeight.get(r) ?? 0) + ROW_GAP;
265
+ }
266
+ }
267
+ const centerX = /* @__PURE__ */ new Map();
268
+ for (let r = 0; r <= maxRow; r++) {
269
+ let acc = 0;
270
+ for (const id of rowPersons.get(r) ?? []) {
271
+ const w = sizes.get(id).width;
272
+ centerX.set(id, acc + w / 2);
273
+ acc += w + H_GAP;
274
+ }
275
+ }
276
+ const resolveRow = (ids, desired) => {
277
+ let prevRight = -Infinity;
278
+ for (const id of ids) {
279
+ const half = sizes.get(id).width / 2;
280
+ let c = desired.get(id) ?? centerX.get(id);
281
+ const minC = prevRight + H_GAP + half;
282
+ if (c < minC) c = minC;
283
+ centerX.set(id, c);
284
+ prevRight = c + half;
285
+ }
286
+ };
287
+ const childrenBlockCenter = (uid) => {
288
+ const cs = (unionChildren.get(uid) ?? []).filter((c) => centerX.has(c)).map((c) => centerX.get(c));
289
+ if (cs.length === 0) return void 0;
290
+ return (Math.min(...cs) + Math.max(...cs)) / 2;
291
+ };
292
+ const rowOfPerson = /* @__PURE__ */ new Map();
293
+ for (let r = 0; r <= maxRow; r++)
294
+ for (const id of rowPersons.get(r) ?? []) rowOfPerson.set(id, r);
295
+ for (let iter = 0; iter < 4; iter++) {
296
+ for (let r = maxRow - 1; r >= 0; r--) {
297
+ const desiredParts = /* @__PURE__ */ new Map();
298
+ const add = (id, x) => {
299
+ (desiredParts.get(id) ?? desiredParts.set(id, []).get(id)).push(x);
300
+ };
301
+ for (const u of unions) {
302
+ const onRow = u.parents.filter((p) => rowOfPerson.get(p) === r);
303
+ if (onRow.length === 0) continue;
304
+ const cc = childrenBlockCenter(u.id);
305
+ if (cc === void 0) continue;
306
+ if (onRow.length === 2) {
307
+ const lr = [...onRow].sort(
308
+ (a, b) => centerX.get(a) - centerX.get(b)
309
+ );
310
+ const [l, rr] = lr;
311
+ const d = sizes.get(l).width / 2 + H_GAP + sizes.get(rr).width / 2;
312
+ add(l, cc - d / 2);
313
+ add(rr, cc + d / 2);
314
+ } else {
315
+ for (const p of onRow) add(p, cc);
316
+ }
317
+ }
318
+ const desired = /* @__PURE__ */ new Map();
319
+ for (const [id, xs] of desiredParts)
320
+ desired.set(id, xs.reduce((a, b) => a + b, 0) / xs.length);
321
+ resolveRow(rowPersons.get(r) ?? [], desired);
322
+ }
323
+ }
324
+ const unionMid = (u) => {
325
+ const ps = u.parents.filter((p) => centerX.has(p));
326
+ return ps.reduce((s, p) => s + centerX.get(p), 0) / ps.length;
327
+ };
328
+ for (let pass = 0; pass < 2; pass++) {
329
+ for (let r = 1; r <= maxRow; r++) {
330
+ const desired = /* @__PURE__ */ new Map();
331
+ for (const u of unions) {
332
+ const kids = u.children.map((c) => c.personId).filter((id) => rowOfPerson.get(id) === r && centerX.has(id)).sort((a, b) => centerX.get(a) - centerX.get(b));
333
+ if (kids.length === 0 || u.parents.every((p) => !centerX.has(p)))
334
+ continue;
335
+ const blockW = kids.reduce((s, id) => s + sizes.get(id).width, 0) + H_GAP * (kids.length - 1);
336
+ let left = unionMid(u) - blockW / 2;
337
+ for (const id of kids) {
338
+ const w = sizes.get(id).width;
339
+ desired.set(id, left + w / 2);
340
+ left += w + H_GAP;
341
+ }
342
+ }
343
+ resolveRow(rowPersons.get(r) ?? [], desired);
344
+ }
345
+ }
346
+ let minLeft = Infinity;
347
+ for (const id of persons.keys())
348
+ minLeft = Math.min(minLeft, centerX.get(id) - sizes.get(id).width / 2);
349
+ const gutter = showGen ? GUTTER_WIDTH : 0;
350
+ const dx = (Number.isFinite(minLeft) ? MARGIN - minLeft : MARGIN) + gutter;
351
+ const nodes = [];
352
+ const topY = /* @__PURE__ */ new Map();
353
+ const bottomY = /* @__PURE__ */ new Map();
354
+ for (let r = 0; r <= maxRow; r++) {
355
+ for (const id of rowPersons.get(r) ?? []) {
356
+ const p = persons.get(id);
357
+ const s = sizes.get(id);
358
+ const x = centerX.get(id) - s.width / 2 + dx;
359
+ const y = rowY.get(r);
360
+ centerX.set(id, x + s.width / 2);
361
+ topY.set(id, y);
362
+ bottomY.set(id, y + s.height);
363
+ nodes.push({
364
+ id: p.id,
365
+ label: p.label,
366
+ sex: p.sex,
367
+ metadata: p.metadata,
368
+ ...p.color !== void 0 && { color: p.color },
369
+ tagMetadata: p.tagMetadata,
370
+ x,
371
+ y,
372
+ width: s.width,
373
+ height: s.height,
374
+ row: r,
375
+ ...p.placeholder && { placeholder: true },
376
+ ...litSet && !litSet.has(id) && { dimmed: true },
377
+ lineNumber: p.lineNumber
378
+ });
379
+ }
380
+ }
381
+ let contentRightEdge = 0;
382
+ for (const n of nodes)
383
+ contentRightEdge = Math.max(contentRightEdge, n.x + n.width);
384
+ const bars = [];
385
+ for (const u of unions) {
386
+ if (u.parents.length !== 2) continue;
387
+ const [a, b] = u.parents;
388
+ if (!centerX.has(a) || !centerX.has(b)) continue;
389
+ const rowTop = Math.min(topY.get(a), topY.get(b));
390
+ const ay = rowTop + HEADER_HEIGHT / 2;
391
+ const ax = centerX.get(a);
392
+ const bx = centerX.get(b);
393
+ const x1 = Math.min(ax, bx);
394
+ const x2 = Math.max(ax, bx);
395
+ const leftId = ax <= bx ? a : b;
396
+ const rightId = ax <= bx ? b : a;
397
+ const gapCenter = (centerX.get(leftId) + sizes.get(leftId).width / 2 + (centerX.get(rightId) - sizes.get(rightId).width / 2)) / 2;
398
+ bars.push({
399
+ unionId: u.id,
400
+ x1,
401
+ x2,
402
+ y: ay,
403
+ midX: (x1 + x2) / 2,
404
+ labelX: gapCenter,
405
+ ...u.metadata["m"] !== void 0 && { year: u.metadata["m"] },
406
+ ...u.divorced && { divorced: true },
407
+ ...litSet && !(litSet.has(a) && litSet.has(b)) && { dimmed: true },
408
+ lineNumber: u.lineNumber
409
+ });
410
+ }
411
+ const barByUnion = new Map(bars.map((bar) => [bar.unionId, bar]));
412
+ const edges = [];
413
+ for (const u of unions) {
414
+ if (u.children.length === 0) continue;
415
+ let anchorX;
416
+ let anchorY;
417
+ const bar = barByUnion.get(u.id);
418
+ if (bar) {
419
+ anchorX = bar.midX;
420
+ anchorY = bar.y;
421
+ } else {
422
+ const p = u.parents[0];
423
+ if (p === void 0 || !centerX.has(p)) continue;
424
+ anchorX = centerX.get(p);
425
+ anchorY = bottomY.get(p);
426
+ }
427
+ const kids = u.children.filter((c) => centerX.has(c.personId));
428
+ if (kids.length === 0) continue;
429
+ const childTop = Math.min(...kids.map((c) => topY.get(c.personId)));
430
+ const parentsBottom = Math.max(
431
+ ...u.parents.filter((p) => bottomY.has(p)).map((p) => bottomY.get(p))
432
+ );
433
+ const midY = (parentsBottom + childTop) / 2;
434
+ for (const c of kids) {
435
+ const cx = centerX.get(c.personId);
436
+ const cTop = topY.get(c.personId);
437
+ edges.push({
438
+ unionId: u.id,
439
+ childId: c.personId,
440
+ points: [
441
+ { x: anchorX, y: anchorY },
442
+ { x: anchorX, y: midY },
443
+ { x: cx, y: midY },
444
+ { x: cx, y: cTop }
445
+ ],
446
+ adopted: c.adopted,
447
+ ...litSet && !litSet.has(c.personId) && { dimmed: true }
448
+ });
449
+ }
450
+ }
451
+ const ancestors = [];
452
+ let focusAnchor;
453
+ if (focusId && focusParents.length > 0 && centerX.has(focusId)) {
454
+ const fx = centerX.get(focusId);
455
+ const fTop = topY.get(focusId);
456
+ focusAnchor = { x: fx, y: fTop };
457
+ focusParents.forEach((p, i) => {
458
+ ancestors.push({
459
+ id: p.id,
460
+ label: p.label,
461
+ sex: p.sex,
462
+ ...p.color !== void 0 && { color: p.color },
463
+ x: fx,
464
+ y: MARGIN + 10 + i * ANCESTOR_STAGGER
465
+ });
466
+ });
467
+ }
468
+ const width = contentRightEdge + MARGIN;
469
+ const lastR = maxRow;
470
+ const height = (rowY.get(lastR) ?? MARGIN) + (rowHeight.get(lastR) ?? 0) + MARGIN;
471
+ const rows = [];
472
+ for (let r = 0; r <= maxRow; r++) {
473
+ if (!rowPersons.get(r)?.length) continue;
474
+ rows.push({ row: r, y: rowY.get(r), height: rowHeight.get(r) ?? 0 });
475
+ }
476
+ return {
477
+ nodes,
478
+ bars,
479
+ edges,
480
+ ancestors,
481
+ ...focusAnchor !== void 0 && { focusAnchor },
482
+ rows,
483
+ width,
484
+ height
485
+ };
486
+ }
487
+
488
+ export {
489
+ focusFamily,
490
+ layoutFamily
491
+ };
492
+ //# sourceMappingURL=chunk-IAEC4KLA.js.map