@diagrammo/dgmo 0.75.0 → 0.77.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 (120) hide show
  1. package/dist/advanced.d.ts +181 -12
  2. package/dist/advanced.js +267 -60
  3. package/dist/block.css +20 -3
  4. package/dist/block.d.ts +12 -4
  5. package/dist/block.js +35 -18
  6. package/dist/{chart-meta-lP8Rl19E.d.ts → chart-meta-Cf_jkApJ.d.ts} +2 -2
  7. package/dist/chart-meta.d.ts +3 -3
  8. package/dist/chart-meta.js +6 -6
  9. package/dist/{charts-d3-SQEVMIAM.js → charts-d3-HMEMHSSW.js} +5 -5
  10. package/dist/{chunk-E3BJVEMZ.js → chunk-2MTM4E6M.js} +2 -2
  11. package/dist/{chunk-UBW53CNS.js → chunk-3E4YB6TY.js} +2 -2
  12. package/dist/{chunk-IFC3JXCT.js → chunk-3O7ZYVJV.js} +2 -2
  13. package/dist/{chunk-Q6BAFS7I.js → chunk-43AJKH2U.js} +3 -3
  14. package/dist/{chunk-2NRIGEHZ.js → chunk-46KVXDUJ.js} +10 -3
  15. package/dist/chunk-53SEVJQM.js +9 -0
  16. package/dist/{chunk-UTTRJ6KN.js → chunk-5ZD4DDG7.js} +4 -4
  17. package/dist/{chunk-AFR6GWXD.js → chunk-6BVAW7KI.js} +4 -4
  18. package/dist/{chunk-CLQJAGWL.js → chunk-6IN4F4RH.js} +4 -4
  19. package/dist/{chunk-76IBFEYW.js → chunk-6ZZKEYBS.js} +4 -4
  20. package/dist/{chunk-QUYYL3LP.js → chunk-7CXW6EGX.js} +5 -5
  21. package/dist/chunk-7IATMZSA.js +72 -0
  22. package/dist/{chunk-HOIAQ3P2.js → chunk-B52RL5VV.js} +2 -2
  23. package/dist/{chunk-IGQW7TKM.js → chunk-BH3BQICT.js} +5 -5
  24. package/dist/{chunk-3LJNQ6LR.js → chunk-CF3I5SOG.js} +5 -5
  25. package/dist/{chunk-ZMKCG3FT.js → chunk-CHOK7NCJ.js} +6 -6
  26. package/dist/{chunk-U74EGVOA.js → chunk-CIWFL2LM.js} +4 -4
  27. package/dist/{chunk-OUJG73YJ.js → chunk-CYMYZYLI.js} +5 -5
  28. package/dist/{chunk-BCB24FG7.js → chunk-D3B6YEZK.js} +3 -3
  29. package/dist/{chunk-XHROEQ23.js → chunk-DSXWJAOA.js} +4 -4
  30. package/dist/{chunk-RT7ACF77.js → chunk-EGY3TS62.js} +6 -6
  31. package/dist/{chunk-CQKD6GOC.js → chunk-EUVUOPRC.js} +4 -4
  32. package/dist/{chunk-TDHD3HNO.js → chunk-F4X5NVKY.js} +37 -16
  33. package/dist/{chunk-7G4XMHDB.js → chunk-FF7LRT5L.js} +4 -4
  34. package/dist/{chunk-6DYZ2JM6.js → chunk-FR5EVD2X.js} +206 -32
  35. package/dist/{chunk-R5JPMW2F.js → chunk-FTTB64OJ.js} +5 -5
  36. package/dist/{chunk-U7AO6FRL.js → chunk-H7BYMIVK.js} +312 -118
  37. package/dist/{chunk-M3IVOGZE.js → chunk-HDLRRY3N.js} +61 -55
  38. package/dist/{chunk-F4CPZRG2.js → chunk-J76YDS4V.js} +2 -2
  39. package/dist/{chunk-SUA56ZSB.js → chunk-LTTZX6RD.js} +6 -2
  40. package/dist/{chunk-7EZ5AKBK.js → chunk-LYJ53DBK.js} +8 -6
  41. package/dist/{chunk-JQ575OAK.js → chunk-MZEGUDTA.js} +2 -2
  42. package/dist/{chunk-IHUOYDLN.js → chunk-N5NQIZ56.js} +5 -5
  43. package/dist/{chunk-GE5RO4BS.js → chunk-N6MZSBOL.js} +5 -1
  44. package/dist/{chunk-DU3OIBQE.js → chunk-NWNSXHA5.js} +6 -2
  45. package/dist/{chunk-32MOGTKT.js → chunk-OO2L2LWV.js} +4 -4
  46. package/dist/{chunk-XCAEHWQB.js → chunk-OZOHREFQ.js} +3 -3
  47. package/dist/{chunk-DSH7NJ2G.js → chunk-QBM5BURJ.js} +4 -4
  48. package/dist/{chunk-YVDBBWEP.js → chunk-QXMHBIQG.js} +4 -4
  49. package/dist/{chunk-UWYZIGCB.js → chunk-RGW26UAR.js} +2 -2
  50. package/dist/{chunk-QI4Q5ZZH.js → chunk-RV5A3EGI.js} +4 -4
  51. package/dist/{chunk-HGFKDSKZ.js → chunk-SI3PYDL4.js} +4 -4
  52. package/dist/{chunk-CAPR5DET.js → chunk-SSEAULA5.js} +2 -2
  53. package/dist/{chunk-AYM472K3.js → chunk-SWUQJ5VR.js} +3 -3
  54. package/dist/{chunk-HFCKU73Y.js → chunk-TI4YUUW6.js} +3 -3
  55. package/dist/{chunk-LYLRNAX2.js → chunk-TKIPK5P6.js} +3 -3
  56. package/dist/{chunk-QT5UMFPE.js → chunk-U4DS2ODO.js} +3 -3
  57. package/dist/{chunk-XFLLYY3V.js → chunk-UBDVAHGK.js} +36 -52
  58. package/dist/{chunk-JL7BDLC6.js → chunk-UH5YTZN7.js} +4 -4
  59. package/dist/{chunk-GEURKGZS.js → chunk-V4NHFY22.js} +4 -4
  60. package/dist/{chunk-4SXHMFFP.js → chunk-VRPV6QXR.js} +23 -12
  61. package/dist/{chunk-BFTRW24X.js → chunk-WHWUVDYK.js} +65 -24
  62. package/dist/{chunk-U5B3TUEW.js → chunk-XCFIAGT7.js} +2 -2
  63. package/dist/{chunk-COCMMQXW.js → chunk-XFXJXLK7.js} +2 -2
  64. package/dist/{chunk-YDA46XHI.js → chunk-XPBJVSRY.js} +2 -2
  65. package/dist/{chunk-VV6HZQ5K.js → chunk-YM5RMLFO.js} +2 -2
  66. package/dist/{d3--y67plmW.d.ts → d3-BiaJtaSw.d.ts} +1 -1
  67. package/dist/{dgmo-router-KYNLRE7S.js → dgmo-router-A3LIHT6H.js} +7 -7
  68. package/dist/{dgmo-router-CY5j16Pl.d.ts → dgmo-router-BwXHZ_P3.d.ts} +1 -1
  69. package/dist/{dimensions-NLQ64ED5.js → dimensions-OFF4GRFL.js} +4 -4
  70. package/dist/{flowchart-parser-LY5GGQL2.js → flowchart-parser-NVBP3C5D.js} +2 -2
  71. package/dist/{flowchart-renderer-RIJ5FZKO.js → flowchart-renderer-BBJUPORB.js} +6 -6
  72. package/dist/index.d.ts +7 -7
  73. package/dist/index.js +14 -14
  74. package/dist/{layout-UJ62RQQ3.js → layout-2OJ25STS.js} +2 -2
  75. package/dist/{layout-DAYQ46PS.js → layout-Y2V3LYV7.js} +3 -3
  76. package/dist/{parser-LUOINP6H.js → parser-QYAIFXLP.js} +3 -3
  77. package/dist/{parser-L7RXUKYN.js → parser-WVE6SKB7.js} +2 -2
  78. package/dist/{parser-JYIZEKAS.js → parser-ZYAFHXKQ.js} +2 -2
  79. package/dist/{renderer-FUJNSC5X.js → renderer-2ANDPQWC.js} +3 -3
  80. package/dist/{renderer-UYZSP7MF.js → renderer-2LDT4TUX.js} +5 -5
  81. package/dist/{renderer-4EWGZLJ6.js → renderer-2NYQDW37.js} +3 -3
  82. package/dist/{renderer-LBNVKVO3.js → renderer-2RIIIO34.js} +5 -5
  83. package/dist/{renderer-PKRKLOYR.js → renderer-3HFU3DTO.js} +5 -5
  84. package/dist/{renderer-UUP6OX6F.js → renderer-4BF6ILP6.js} +5 -5
  85. package/dist/{renderer-MUW4G2N6.js → renderer-5E2AH5TO.js} +7 -7
  86. package/dist/{renderer-DKW273R7.js → renderer-62SLWRYF.js} +6 -5
  87. package/dist/{renderer-WDSBFDQ2.js → renderer-ANJUDBOS.js} +6 -6
  88. package/dist/{renderer-OTHBTGBN.js → renderer-CVWQD442.js} +3 -3
  89. package/dist/{renderer-GJDVPXI3.js → renderer-D6GJ6EVK.js} +6 -6
  90. package/dist/{renderer-KMOGGMM7.js → renderer-DNFV2IQI.js} +5 -5
  91. package/dist/{renderer-UYYBJ7OB.js → renderer-EDVCGIQO.js} +10 -10
  92. package/dist/{renderer-73QHYZ2Q.js → renderer-EFQSMHID.js} +6 -6
  93. package/dist/{renderer-EP4GRCDX.js → renderer-FTX67CYZ.js} +3 -3
  94. package/dist/{renderer-GF6S5ZX6.js → renderer-G2DPKJAN.js} +5 -5
  95. package/dist/{renderer-QAMOXOZ2.js → renderer-GHBF5PRH.js} +3 -3
  96. package/dist/{renderer-5W3HWIUL.js → renderer-GZLRX764.js} +5 -5
  97. package/dist/{renderer-CO5O5VR5.js → renderer-H2HYLFN3.js} +3 -3
  98. package/dist/{renderer-JMJ7Q5OC.js → renderer-IR5655M7.js} +5 -5
  99. package/dist/{renderer-4PNVGHVA.js → renderer-L237AOOZ.js} +3 -3
  100. package/dist/{renderer-A2YWSBPY.js → renderer-LSJWYGOL.js} +7 -7
  101. package/dist/{renderer-PR3KLNST.js → renderer-LWXDMZOV.js} +5 -5
  102. package/dist/{renderer-3FB56573.js → renderer-MYSVPERC.js} +5 -5
  103. package/dist/{renderer-FGGDZZFQ.js → renderer-OL5QSZPC.js} +6 -6
  104. package/dist/{renderer-XBL6CLN2.js → renderer-P26HH3NA.js} +5 -5
  105. package/dist/{renderer-D7N7PPB7.js → renderer-R5HIRN2M.js} +3 -3
  106. package/dist/{renderer-BUEFD2IF.js → renderer-RNFECJ5D.js} +5 -5
  107. package/dist/{renderer-F24V3RD3.js → renderer-RPZVNCTF.js} +5 -5
  108. package/dist/{renderer-PIEPRK6M.js → renderer-SDNWZDUY.js} +5 -5
  109. package/dist/{renderer-RUHC6D3B.js → renderer-UKHH4UWV.js} +5 -5
  110. package/dist/{renderer-CGOPX4HW.js → renderer-VF7X66SL.js} +5 -5
  111. package/dist/{renderer-ZAJ5353N.js → renderer-Y3Y7PEUS.js} +3 -3
  112. package/dist/{renderer-radial-MZP3SVTZ.js → renderer-radial-QNGCGKZP.js} +5 -5
  113. package/dist/{state-renderer-454ADT7E.js → state-renderer-ELWDRXD6.js} +7 -7
  114. package/dist/{tag-groups-DrHT2tEc.d.ts → tag-groups-BAtkq0b_.d.ts} +39 -1
  115. package/dist/{themes-GWhsabnx.d.ts → themes-DpsyRSO7.d.ts} +2 -2
  116. package/docs/language-reference.md +3 -3
  117. package/gallery/fixtures/sketch.dgmo +1 -1
  118. package/package.json +5 -4
  119. package/dist/chunk-PDKUANDZ.js +0 -35
  120. package/dist/chunk-UTCPNJND.js +0 -7
@@ -6,7 +6,7 @@ import {
6
6
  mapLegendConfig,
7
7
  mapLegendGroups,
8
8
  parsePathRings
9
- } from "./chunk-BFTRW24X.js";
9
+ } from "./chunk-WHWUVDYK.js";
10
10
  import {
11
11
  TITLE_FONT_SIZE,
12
12
  TITLE_FONT_WEIGHT,
@@ -14,10 +14,10 @@ import {
14
14
  } from "./chunk-DEW62ON3.js";
15
15
  import {
16
16
  renderIntegratedLegend
17
- } from "./chunk-QT5UMFPE.js";
17
+ } from "./chunk-U4DS2ODO.js";
18
18
  import {
19
19
  FONT_FAMILY
20
- } from "./chunk-UTCPNJND.js";
20
+ } from "./chunk-53SEVJQM.js";
21
21
  import {
22
22
  measureText
23
23
  } from "./chunk-MTGGOCND.js";
@@ -781,4 +781,4 @@ export {
781
781
  renderMap,
782
782
  renderMapForExport
783
783
  };
784
- //# sourceMappingURL=chunk-DSH7NJ2G.js.map
784
+ //# sourceMappingURL=chunk-QBM5BURJ.js.map
@@ -10,13 +10,13 @@ import {
10
10
  hideTooltip,
11
11
  renderChartTitle,
12
12
  showTooltip
13
- } from "./chunk-UBW53CNS.js";
13
+ } from "./chunk-3E4YB6TY.js";
14
14
  import {
15
15
  renderIntegratedLegend
16
- } from "./chunk-QT5UMFPE.js";
16
+ } from "./chunk-U4DS2ODO.js";
17
17
  import {
18
18
  FONT_FAMILY
19
- } from "./chunk-UTCPNJND.js";
19
+ } from "./chunk-53SEVJQM.js";
20
20
  import {
21
21
  LEGEND_CAPSULE_PAD,
22
22
  LEGEND_DOT_R,
@@ -1672,4 +1672,4 @@ export {
1672
1672
  formatDateLabel,
1673
1673
  renderTimeline
1674
1674
  };
1675
- //# sourceMappingURL=chunk-YVDBBWEP.js.map
1675
+ //# sourceMappingURL=chunk-QXMHBIQG.js.map
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-DEW62ON3.js";
15
15
  import {
16
16
  FONT_FAMILY
17
- } from "./chunk-UTCPNJND.js";
17
+ } from "./chunk-53SEVJQM.js";
18
18
  import {
19
19
  CHAR_WIDTH_RATIO,
20
20
  measureText
@@ -428,4 +428,4 @@ export {
428
428
  renderPyramid,
429
429
  renderPyramidForExport
430
430
  };
431
- //# sourceMappingURL=chunk-UWYZIGCB.js.map
431
+ //# sourceMappingURL=chunk-RGW26UAR.js.map
@@ -28,13 +28,13 @@ import {
28
28
  } from "./chunk-DEW62ON3.js";
29
29
  import {
30
30
  renderIntegratedLegend
31
- } from "./chunk-QT5UMFPE.js";
31
+ } from "./chunk-U4DS2ODO.js";
32
32
  import {
33
33
  getLegendExtent
34
- } from "./chunk-4SXHMFFP.js";
34
+ } from "./chunk-VRPV6QXR.js";
35
35
  import {
36
36
  FONT_FAMILY
37
- } from "./chunk-UTCPNJND.js";
37
+ } from "./chunk-53SEVJQM.js";
38
38
  import {
39
39
  LEGEND_HEIGHT
40
40
  } from "./chunk-YT5ICQ4R.js";
@@ -603,4 +603,4 @@ export {
603
603
  renderERDiagram,
604
604
  renderERDiagramForExport
605
605
  };
606
- //# sourceMappingURL=chunk-QI4Q5ZZH.js.map
606
+ //# sourceMappingURL=chunk-RV5A3EGI.js.map
@@ -11,14 +11,14 @@ import {
11
11
  } from "./chunk-DEW62ON3.js";
12
12
  import {
13
13
  renderIntegratedLegend
14
- } from "./chunk-QT5UMFPE.js";
14
+ } from "./chunk-U4DS2ODO.js";
15
15
  import {
16
16
  getLegendExtent,
17
17
  getMaxLegendReservedHeight
18
- } from "./chunk-4SXHMFFP.js";
18
+ } from "./chunk-VRPV6QXR.js";
19
19
  import {
20
20
  FONT_FAMILY
21
- } from "./chunk-UTCPNJND.js";
21
+ } from "./chunk-53SEVJQM.js";
22
22
  import {
23
23
  LEGEND_GROUP_GAP
24
24
  } from "./chunk-YT5ICQ4R.js";
@@ -1001,4 +1001,4 @@ export {
1001
1001
  renderBracket,
1002
1002
  renderBracketForExport
1003
1003
  };
1004
- //# sourceMappingURL=chunk-HGFKDSKZ.js.map
1004
+ //# sourceMappingURL=chunk-SI3PYDL4.js.map
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-DEW62ON3.js";
9
9
  import {
10
10
  FONT_FAMILY
11
- } from "./chunk-UTCPNJND.js";
11
+ } from "./chunk-53SEVJQM.js";
12
12
  import {
13
13
  resolveTagColor,
14
14
  tagAttrKey
@@ -401,4 +401,4 @@ function drawCenteredLabel(g, label, cx, cy, fill, fontSize, tight = false, halo
401
401
  export {
402
402
  renderSwimlaneForExport
403
403
  };
404
- //# sourceMappingURL=chunk-CAPR5DET.js.map
404
+ //# sourceMappingURL=chunk-SSEAULA5.js.map
@@ -24,10 +24,10 @@ import {
24
24
  } from "./chunk-DEW62ON3.js";
25
25
  import {
26
26
  renderIntegratedLegend
27
- } from "./chunk-QT5UMFPE.js";
27
+ } from "./chunk-U4DS2ODO.js";
28
28
  import {
29
29
  FONT_FAMILY
30
- } from "./chunk-UTCPNJND.js";
30
+ } from "./chunk-53SEVJQM.js";
31
31
  import {
32
32
  LEGEND_HEIGHT
33
33
  } from "./chunk-YT5ICQ4R.js";
@@ -1039,4 +1039,4 @@ export {
1039
1039
  renderC4Deployment,
1040
1040
  renderC4DeploymentForExport
1041
1041
  };
1042
- //# sourceMappingURL=chunk-AYM472K3.js.map
1042
+ //# sourceMappingURL=chunk-SWUQJ5VR.js.map
@@ -24,10 +24,10 @@ import {
24
24
  } from "./chunk-RU2HHHYA.js";
25
25
  import {
26
26
  renderIntegratedLegend
27
- } from "./chunk-QT5UMFPE.js";
27
+ } from "./chunk-U4DS2ODO.js";
28
28
  import {
29
29
  FONT_FAMILY
30
- } from "./chunk-UTCPNJND.js";
30
+ } from "./chunk-53SEVJQM.js";
31
31
  import {
32
32
  measureText,
33
33
  truncateText,
@@ -877,4 +877,4 @@ export {
877
877
  renderJourneyMap,
878
878
  renderJourneyMapForExport
879
879
  };
880
- //# sourceMappingURL=chunk-HFCKU73Y.js.map
880
+ //# sourceMappingURL=chunk-TI4YUUW6.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  MONO_FAMILY
3
- } from "./chunk-XCAEHWQB.js";
3
+ } from "./chunk-OZOHREFQ.js";
4
4
  import {
5
5
  FONT_FAMILY
6
- } from "./chunk-UTCPNJND.js";
6
+ } from "./chunk-53SEVJQM.js";
7
7
  import {
8
8
  truncateText
9
9
  } from "./chunk-MTGGOCND.js";
@@ -62,4 +62,4 @@ function escapeXml(s) {
62
62
  export {
63
63
  renderLiveLinkCard
64
64
  };
65
- //# sourceMappingURL=chunk-LYLRNAX2.js.map
65
+ //# sourceMappingURL=chunk-TKIPK5P6.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  computeLegendLayout
3
- } from "./chunk-4SXHMFFP.js";
3
+ } from "./chunk-VRPV6QXR.js";
4
4
  import {
5
5
  FONT_FAMILY
6
- } from "./chunk-UTCPNJND.js";
6
+ } from "./chunk-53SEVJQM.js";
7
7
  import {
8
8
  CONTROLS_ICON_PATH,
9
9
  LEGEND_DOT_R,
@@ -294,4 +294,4 @@ export {
294
294
  renderLegendD3,
295
295
  renderIntegratedLegend
296
296
  };
297
- //# sourceMappingURL=chunk-QT5UMFPE.js.map
297
+ //# sourceMappingURL=chunk-U4DS2ODO.js.map
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  edgeSplinePath,
3
- fitDiagramToCanvas
4
- } from "./chunk-PDKUANDZ.js";
3
+ fitDiagramToCanvas,
4
+ selfLoopArcPath
5
+ } from "./chunk-7IATMZSA.js";
5
6
  import {
6
7
  layoutGraph
7
- } from "./chunk-GE5RO4BS.js";
8
+ } from "./chunk-N6MZSBOL.js";
8
9
  import {
9
10
  appendArrowheadMarkers
10
11
  } from "./chunk-LP7EC4MI.js";
@@ -35,14 +36,14 @@ import {
35
36
  } from "./chunk-DEW62ON3.js";
36
37
  import {
37
38
  renderIntegratedLegend
38
- } from "./chunk-QT5UMFPE.js";
39
+ } from "./chunk-U4DS2ODO.js";
39
40
  import {
40
41
  getLegendExtent,
41
42
  getMaxLegendReservedHeight
42
- } from "./chunk-4SXHMFFP.js";
43
+ } from "./chunk-VRPV6QXR.js";
43
44
  import {
44
45
  FONT_FAMILY
45
- } from "./chunk-UTCPNJND.js";
46
+ } from "./chunk-53SEVJQM.js";
46
47
  import {
47
48
  measureText
48
49
  } from "./chunk-MTGGOCND.js";
@@ -88,17 +89,6 @@ function stateFill(palette, isDark, nodeColor, colorOff, fillMode) {
88
89
  function stateStroke(palette, nodeColor, colorOff) {
89
90
  return nodeColor ?? stateDefaultColor(palette, colorOff);
90
91
  }
91
- function selfLoopPath(node) {
92
- const cx = node.x;
93
- const cy = node.y;
94
- const r = node.width / 2;
95
- const startX = cx + r;
96
- const startY = cy - 5;
97
- const endX = cx + r;
98
- const endY = cy + 5;
99
- const loopR = 25;
100
- return `M ${startX} ${startY} C ${startX + loopR * 2} ${startY - loopR * 2}, ${endX + loopR * 2} ${endY + loopR * 2}, ${endX} ${endY}`;
101
- }
102
92
  function renderState(container, graph, layout, palette, isDark, onClickItem, exportDims) {
103
93
  d3Selection.select(container).selectAll(":not([data-d3-tooltip])").remove();
104
94
  const width = exportDims?.width ?? container.clientWidth;
@@ -244,42 +234,46 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
244
234
  groupWrapper.append("rect").attr("x", gx).attr("y", gy).attr("width", gw).attr("height", gh).attr("rx", 6).attr("fill", fillColor).attr("stroke", strokeColor).attr("stroke-width", 1).attr("stroke-opacity", 0.5).attr("class", "st-group");
245
235
  groupWrapper.append("text").attr("x", gx + 8).attr("y", gy + sGroupLabelFontSize + 4).attr("fill", strokeColor).attr("font-size", sGroupLabelFontSize).attr("font-weight", "bold").attr("opacity", 0.7).attr("class", "st-group-label").text(group.label);
246
236
  }
247
- const selfLoopEdges = /* @__PURE__ */ new Set();
248
- for (const edge of layout.edges) {
249
- if (edge.source === edge.target) selfLoopEdges.add(edge.lineNumber);
250
- }
251
- const nodePositionMap = /* @__PURE__ */ new Map();
252
- for (const node of layout.nodes) {
253
- nodePositionMap.set(node.id, node);
254
- }
255
237
  const LABEL_PAD = 8;
256
238
  const LABEL_H = 16;
257
239
  const PERP_OFFSET = 10;
240
+ const nodeCenters = /* @__PURE__ */ new Map();
241
+ for (const node of layout.nodes) nodeCenters.set(node.id, node);
258
242
  const labelPositions = [];
259
243
  for (let ei = 0; ei < layout.edges.length; ei++) {
260
244
  const edge = layout.edges[ei];
261
245
  if (!edge.label) continue;
262
246
  const bgW = measureText(edge.label, sEdgeLabelFontSize) + LABEL_PAD;
263
247
  let lx, ly;
264
- if (edge.source === edge.target) {
265
- const node = nodePositionMap.get(edge.source);
266
- if (!node) continue;
267
- lx = node.x + node.width / 2 + 30;
268
- ly = node.y;
269
- } else if (edge.points.length >= 2) {
248
+ if (edge.points.length >= 2) {
270
249
  const midIdx = Math.floor(edge.points.length / 2);
271
250
  const midPt = edge.points[midIdx];
272
251
  const prev = edge.points[Math.max(0, midIdx - 1)];
273
252
  const next = edge.points[Math.min(edge.points.length - 1, midIdx + 1)];
274
- const dx = next.x - prev.x;
275
- const dy = next.y - prev.y;
276
- const len = Math.sqrt(dx * dx + dy * dy);
277
- if (len > 0) {
278
- lx = midPt.x + -dy / len * PERP_OFFSET;
279
- ly = midPt.y + dx / len * PERP_OFFSET;
253
+ const self = edge.source === edge.target;
254
+ const node = self ? nodeCenters.get(edge.source) : void 0;
255
+ if (self && node) {
256
+ const ox = midPt.x - node.x;
257
+ const oy = midPt.y - node.y;
258
+ const olen = Math.sqrt(ox * ox + oy * oy);
259
+ if (olen > 0) {
260
+ lx = midPt.x + ox / olen * PERP_OFFSET;
261
+ ly = midPt.y + oy / olen * PERP_OFFSET;
262
+ } else {
263
+ lx = midPt.x;
264
+ ly = midPt.y;
265
+ }
280
266
  } else {
281
- lx = midPt.x;
282
- ly = midPt.y;
267
+ const dx = next.x - prev.x;
268
+ const dy = next.y - prev.y;
269
+ const len = Math.sqrt(dx * dx + dy * dy);
270
+ if (len > 0) {
271
+ lx = midPt.x + -dy / len * PERP_OFFSET;
272
+ ly = midPt.y + dx / len * PERP_OFFSET;
273
+ } else {
274
+ lx = midPt.x;
275
+ ly = midPt.y;
276
+ }
283
277
  }
284
278
  } else {
285
279
  continue;
@@ -305,18 +299,8 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
305
299
  const edgeG = contentG.append("g").attr("class", "st-edge-group").attr("data-line-number", String(edge.lineNumber)).attr("data-source", edge.source).attr("data-target", edge.target);
306
300
  const edgeColor = palette.textMuted;
307
301
  const markerId = "st-arrow";
308
- if (edge.source === edge.target) {
309
- const node = nodePositionMap.get(edge.source);
310
- if (node) {
311
- edgeG.append("path").attr("d", selfLoopPath(node)).attr("fill", "none").attr("stroke", edgeColor).attr("stroke-width", sEdgeStrokeWidth).attr("marker-end", `url(#${markerId})`).attr("class", "st-edge");
312
- const lp = labelPosMap.get(ei);
313
- if (edge.label && lp) {
314
- edgeG.append("rect").attr("x", lp.x - lp.w / 2).attr("y", lp.y - lp.h / 2 - 1).attr("width", lp.w).attr("height", lp.h).attr("rx", 3).attr("fill", palette.bg).attr("opacity", 0.85).attr("class", "st-edge-label-bg");
315
- edgeG.append("text").attr("x", lp.x).attr("y", lp.y + 4).attr("text-anchor", "middle").attr("fill", edgeColor).attr("font-size", sEdgeLabelFontSize).attr("class", "st-edge-label").text(edge.label);
316
- }
317
- }
318
- } else if (edge.points.length >= 2) {
319
- const pathD = edgeSplinePath(edge.points);
302
+ if (edge.points.length >= 2) {
303
+ const pathD = edge.source === edge.target ? selfLoopArcPath(edge.points) ?? edgeSplinePath(edge.points) : edgeSplinePath(edge.points);
320
304
  if (pathD) {
321
305
  edgeG.append("path").attr("d", pathD).attr("fill", "none").attr("stroke", edgeColor).attr("stroke-width", sEdgeStrokeWidth).attr("marker-end", `url(#${markerId})`).attr("class", "st-edge");
322
306
  }
@@ -481,4 +465,4 @@ export {
481
465
  renderState,
482
466
  renderStateForExport
483
467
  };
484
- //# sourceMappingURL=chunk-XFLLYY3V.js.map
468
+ //# sourceMappingURL=chunk-UBDVAHGK.js.map
@@ -11,7 +11,7 @@ import {
11
11
  initD3Chart,
12
12
  renderChartTitle,
13
13
  resolveExportPalette
14
- } from "./chunk-UBW53CNS.js";
14
+ } from "./chunk-3E4YB6TY.js";
15
15
  import {
16
16
  layoutInlineHeader
17
17
  } from "./chunk-MG3DE3VO.js";
@@ -23,10 +23,10 @@ import {
23
23
  } from "./chunk-DEW62ON3.js";
24
24
  import {
25
25
  computeLegendLayout
26
- } from "./chunk-4SXHMFFP.js";
26
+ } from "./chunk-VRPV6QXR.js";
27
27
  import {
28
28
  FONT_FAMILY
29
- } from "./chunk-UTCPNJND.js";
29
+ } from "./chunk-53SEVJQM.js";
30
30
  import {
31
31
  LEGEND_DOT_R,
32
32
  LEGEND_ENTRY_FONT_SIZE,
@@ -2151,4 +2151,4 @@ export {
2151
2151
  supportsD3DataChart,
2152
2152
  renderDataChartD3
2153
2153
  };
2154
- //# sourceMappingURL=chunk-JL7BDLC6.js.map
2154
+ //# sourceMappingURL=chunk-UH5YTZN7.js.map
@@ -16,13 +16,13 @@ import {
16
16
  } from "./chunk-DEW62ON3.js";
17
17
  import {
18
18
  renderIntegratedLegend
19
- } from "./chunk-QT5UMFPE.js";
19
+ } from "./chunk-U4DS2ODO.js";
20
20
  import {
21
21
  getMaxLegendReservedHeight
22
- } from "./chunk-4SXHMFFP.js";
22
+ } from "./chunk-VRPV6QXR.js";
23
23
  import {
24
24
  FONT_FAMILY
25
- } from "./chunk-UTCPNJND.js";
25
+ } from "./chunk-53SEVJQM.js";
26
26
  import {
27
27
  LEGEND_HEIGHT,
28
28
  measureLegendText
@@ -1154,4 +1154,4 @@ export {
1154
1154
  renderKanban,
1155
1155
  renderKanbanForExport
1156
1156
  };
1157
- //# sourceMappingURL=chunk-GEURKGZS.js.map
1157
+ //# sourceMappingURL=chunk-V4NHFY22.js.map
@@ -108,9 +108,10 @@ function entriesWidth(entries) {
108
108
  }
109
109
  return w;
110
110
  }
111
- function entryWidth(value) {
111
+ function legendEntryWidth(value) {
112
112
  return LEGEND_DOT_R * 2 + LEGEND_ENTRY_DOT_GAP + measureLegendText(value, LEGEND_ENTRY_FONT_SIZE) + LEGEND_ENTRY_TRAIL;
113
113
  }
114
+ var entryWidth = legendEntryWidth;
114
115
  function controlWidth(control) {
115
116
  let w = CONTROL_PILL_PAD;
116
117
  if (control.label) {
@@ -125,12 +126,12 @@ function controlWidth(control) {
125
126
  }
126
127
  return w;
127
128
  }
128
- function capsuleWidth(name, entries, containerWidth, addonWidth = 0) {
129
+ function capsuleWidth(name, entries, containerWidth, addonWidth = 0, trailWidth = 0) {
129
130
  const pw = pillWidth(name);
130
131
  const maxCapsuleW = containerWidth;
131
132
  const baseW = LEGEND_CAPSULE_PAD * 2 + pw + 4 + addonWidth;
132
133
  const ew = entriesWidth(entries);
133
- const singleRowW = baseW + ew;
134
+ const singleRowW = baseW + ew + trailWidth;
134
135
  if (singleRowW <= maxCapsuleW + 0.5) {
135
136
  return {
136
137
  width: singleRowW,
@@ -139,7 +140,7 @@ function capsuleWidth(name, entries, containerWidth, addonWidth = 0) {
139
140
  visibleEntries: entries.length
140
141
  };
141
142
  }
142
- const rowWidth = maxCapsuleW - LEGEND_CAPSULE_PAD;
143
+ const rowWidth = maxCapsuleW - LEGEND_CAPSULE_PAD - trailWidth;
143
144
  let row = 1;
144
145
  let rowX = LEGEND_CAPSULE_PAD + pw + 4 + addonWidth;
145
146
  let visible = 0;
@@ -321,7 +322,8 @@ function computeLegendLayout(config, state, containerWidth) {
321
322
  activeCapsule = buildCapsuleLayout(
322
323
  g,
323
324
  groupAvailW,
324
- config.capsulePillAddonWidth ?? 0
325
+ config.capsulePillAddonWidth ?? 0,
326
+ config.capsuleTrailingAddonWidth ?? 0
325
327
  );
326
328
  } else if (!activeGroupName || config.showInactivePills) {
327
329
  const pw = pillWidth(g.name);
@@ -360,14 +362,15 @@ function computeLegendLayout(config, state, containerWidth) {
360
362
  }
361
363
  };
362
364
  }
363
- function buildCapsuleLayout(group, containerWidth, addonWidth = 0) {
365
+ function buildCapsuleLayout(group, containerWidth, addonWidth = 0, trailWidth = 0) {
364
366
  if (group.gradient) return buildGradientCapsuleLayout(group, group.gradient);
365
367
  const pw = pillWidth(group.name);
366
368
  const info = capsuleWidth(
367
369
  group.name,
368
370
  group.entries,
369
371
  containerWidth,
370
- addonWidth
372
+ addonWidth,
373
+ trailWidth
371
374
  );
372
375
  const pill = {
373
376
  groupName: group.name,
@@ -381,7 +384,7 @@ function buildCapsuleLayout(group, containerWidth, addonWidth = 0) {
381
384
  const ex = LEGEND_CAPSULE_PAD + pw + 4 + addonWidth;
382
385
  let ey = 0;
383
386
  let rowX = ex;
384
- const maxRowW = containerWidth - LEGEND_CAPSULE_PAD;
387
+ const maxRowW = containerWidth - LEGEND_CAPSULE_PAD - trailWidth;
385
388
  let currentRow = 0;
386
389
  for (let i = 0; i < info.visibleEntries; i++) {
387
390
  const entry = group.entries[i];
@@ -433,7 +436,12 @@ function buildCapsuleLayout(group, containerWidth, addonWidth = 0) {
433
436
  pill,
434
437
  entries,
435
438
  ...info.moreCount > 0 && { moreCount: info.moreCount },
436
- ...addonWidth > 0 && { addonX: LEGEND_CAPSULE_PAD + pw + 4 }
439
+ ...addonWidth > 0 && { addonX: LEGEND_CAPSULE_PAD + pw + 4 },
440
+ // After the last entry, on whatever row that entry ended on — `rowX` and
441
+ // `ey` are exactly the cursor the loop left behind.
442
+ ...trailWidth > 0 && {
443
+ trailingAddon: { x: rowX, y: ey, width: trailWidth }
444
+ }
437
445
  };
438
446
  }
439
447
  function layoutRows(activeCapsule, pills, controls, groupAvailW, containerWidth, totalControlsW, alignLeft = false, controlsGroup) {
@@ -528,10 +536,11 @@ function getMaxLegendReservedHeight(config, containerWidth) {
528
536
  const groups = config.groups;
529
537
  if (groups.length === 0) return LEGEND_HEIGHT;
530
538
  const addon = config.capsulePillAddonWidth ?? 0;
539
+ const trail = config.capsuleTrailingAddonWidth ?? 0;
531
540
  let max = LEGEND_HEIGHT;
532
541
  for (const g of groups) {
533
542
  if (g.entries.length === 0) continue;
534
- const info = capsuleWidth(g.name, g.entries, containerWidth, addon);
543
+ const info = capsuleWidth(g.name, g.entries, containerWidth, addon, trail);
535
544
  const h = info.entryRows * LEGEND_HEIGHT;
536
545
  if (h > max) max = h;
537
546
  }
@@ -551,7 +560,8 @@ function getLegendExtent(config, state, containerWidth) {
551
560
  const c = layout.activeCapsule;
552
561
  track(c.x, c.y, c.width, c.height);
553
562
  }
554
- for (const pill of layout.pills) track(pill.x, pill.y, pill.width, pill.height);
563
+ for (const pill of layout.pills)
564
+ track(pill.x, pill.y, pill.width, pill.height);
555
565
  return {
556
566
  width: right - (left === Infinity ? 0 : left),
557
567
  height: bottom || LEGEND_HEIGHT
@@ -560,10 +570,11 @@ function getLegendExtent(config, state, containerWidth) {
560
570
 
561
571
  export {
562
572
  compactNumber,
573
+ legendEntryWidth,
563
574
  controlsGroupCapsuleWidth,
564
575
  computeLegendLayout,
565
576
  getLegendReservedHeight,
566
577
  getMaxLegendReservedHeight,
567
578
  getLegendExtent
568
579
  };
569
- //# sourceMappingURL=chunk-4SXHMFFP.js.map
580
+ //# sourceMappingURL=chunk-VRPV6QXR.js.map