@diagrammo/dgmo 0.92.1 → 0.94.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.
- package/dist/advanced.d.ts +103 -38
- package/dist/advanced.js +457 -423
- package/dist/block.d.ts +2 -2
- package/dist/block.js +75 -70
- package/dist/{chart-meta-BBqLnv5q.d.ts → chart-meta-BbjsRY7o.d.ts} +2 -2
- package/dist/chart-meta.d.ts +3 -3
- package/dist/chart-meta.js +25 -19
- package/dist/{chart-types-CbXlZFLd.d.ts → chart-types-Cppnp31G.d.ts} +173 -4
- package/dist/{charts-d3-QUUDVETP.js → charts-d3-SZV2SFTM.js} +7 -6
- package/dist/{chunk-ADNIO3XY.js → chunk-2FDQEQID.js} +5 -5
- package/dist/{chunk-QUGC7GWB.js → chunk-2HSHWPTO.js} +15 -15
- package/dist/{chunk-L5NW3PVL.js → chunk-2I4UQG7W.js} +1 -1
- package/dist/{chunk-2YAFDND3.js → chunk-2MS623GW.js} +4 -6
- package/dist/{chunk-73EYNV4O.js → chunk-2XMTZ5JR.js} +4 -6
- package/dist/{chunk-ZJAK6C7Y.js → chunk-3PP746YM.js} +6 -1
- package/dist/{chunk-MDVJYRJT.js → chunk-3TWBMU7K.js} +22 -22
- package/dist/{chunk-FTUMRSGT.js → chunk-3ZP3QC47.js} +8 -288
- package/dist/{chunk-J2E7EUER.js → chunk-4EX4OKGZ.js} +86 -23
- package/dist/{chunk-Y2V5AEVG.js → chunk-4SP6OUO7.js} +1952 -1824
- package/dist/{chunk-HIWHIYLD.js → chunk-4TEPDQHJ.js} +19 -19
- package/dist/{chunk-DEFBUZWV.js → chunk-5HAYT43L.js} +70 -54
- package/dist/{chunk-6WVX4KNP.js → chunk-5ZUZZDW5.js} +97 -297
- package/dist/{chunk-X5BUX2GK.js → chunk-6JCTW74W.js} +7 -5
- package/dist/{chunk-Q6W2K33N.js → chunk-6XLMTAEX.js} +1 -1
- package/dist/{chunk-ONYO5WJW.js → chunk-7IOZ6JE4.js} +21 -21
- package/dist/chunk-7SXV7NUS.js +416 -0
- package/dist/{chunk-NPWVOFB3.js → chunk-7WEYXYLC.js} +1 -1
- package/dist/{chunk-GE7ICBX6.js → chunk-AM42TLSZ.js} +102 -97
- package/dist/{chunk-WLLO3PZ3.js → chunk-AYUSD4Z6.js} +45 -19
- package/dist/{chunk-45QUTYPD.js → chunk-B25IWGDH.js} +69 -20
- package/dist/{chunk-JKST4RTT.js → chunk-BH2SF4TT.js} +6 -6
- package/dist/{chunk-6OIMUSDX.js → chunk-C6G36F5S.js} +9 -9
- package/dist/{chunk-DRFGIOZ6.js → chunk-CIHHTS5B.js} +4 -6
- package/dist/chunk-CYTFO2LF.js +209 -0
- package/dist/{chunk-Q2UFOKPB.js → chunk-DDIOWNHS.js} +22 -22
- package/dist/{chunk-Q6ZQX2HX.js → chunk-DLJJOCIT.js} +4 -6
- package/dist/{chunk-26BBJUBW.js → chunk-DNM3XZCK.js} +4 -6
- package/dist/{chunk-AUS7V54P.js → chunk-ERT7XDQW.js} +1 -1
- package/dist/{chunk-7ENDOHAA.js → chunk-FMAVHTYB.js} +919 -927
- package/dist/{chunk-URQIWIKX.js → chunk-FWVE373X.js} +4 -4
- package/dist/{chunk-VOR32OHN.js → chunk-G3HZ4PGE.js} +13 -15
- package/dist/{chunk-RBFJT23E.js → chunk-GWQRTA5W.js} +6 -6
- package/dist/chunk-GXCDD6NG.js +24 -0
- package/dist/{chunk-3PFMGNOM.js → chunk-HHVIE45A.js} +26 -11
- package/dist/{chunk-MXAP37W6.js → chunk-HI6R27YA.js} +16 -7
- package/dist/{chunk-QQPNCXAO.js → chunk-I37S3EZE.js} +18 -18
- package/dist/{chunk-YITHYQCL.js → chunk-IGJEKO2P.js} +8 -8
- package/dist/{chunk-BZX7QCXJ.js → chunk-IHN6WDEY.js} +15 -15
- package/dist/{chunk-QT3KDDXK.js → chunk-IN7XI6NO.js} +0 -7
- package/dist/{chunk-4QLGGQNO.js → chunk-IZHGT5HD.js} +44 -18
- package/dist/{chunk-5SSTVFPX.js → chunk-JT2BG7LM.js} +5 -7
- package/dist/{chunk-2BJW7FSF.js → chunk-KBEWVCK3.js} +1 -1
- package/dist/{chunk-DUPZ2BBY.js → chunk-KBHT5XEY.js} +143 -6
- package/dist/{chunk-V4D2ZQBE.js → chunk-KRPLP5LP.js} +6 -1
- package/dist/{chunk-QKY6W4NA.js → chunk-KSZB7TIY.js} +25 -25
- package/dist/{chunk-6ZL2XYM7.js → chunk-MLY5ALOV.js} +6 -6
- package/dist/{chunk-VSOZZYLK.js → chunk-NERQSSYD.js} +20 -9
- package/dist/{chunk-OQW4ETJX.js → chunk-NM5V5EKY.js} +6 -1
- package/dist/{chunk-EBSFSOJC.js → chunk-NOQB4KMV.js} +22 -22
- package/dist/{chunk-6BNNLVAR.js → chunk-NPDVWFAQ.js} +6 -1
- package/dist/{chunk-FSJ3ZA6N.js → chunk-OSSTOSXU.js} +12 -12
- package/dist/chunk-P7TRFL4P.js +54 -0
- package/dist/{chunk-A4PNWAUW.js → chunk-PGSGJLUR.js} +6 -1
- package/dist/{chunk-S7W75MIM.js → chunk-QKPOIJBT.js} +23 -5
- package/dist/{chunk-YO6AQU4A.js → chunk-QPQWY5RU.js} +12 -12
- package/dist/{chunk-NREU4JFE.js → chunk-RBVFNUAL.js} +6 -8
- package/dist/{chunk-5EBYPETE.js → chunk-RESEJSCV.js} +3 -5
- package/dist/{chunk-BRSM6Z34.js → chunk-RITTLIDJ.js} +14 -14
- package/dist/{chunk-MX4SZLSV.js → chunk-S5Y3OO3V.js} +16 -8
- package/dist/{chunk-O5WUZGPV.js → chunk-TASRGDYP.js} +18 -18
- package/dist/{chunk-HXULJZA2.js → chunk-TDAGJJPZ.js} +6 -1
- package/dist/chunk-UCHZJJIT.js +421 -0
- package/dist/{chunk-42UJ23H3.js → chunk-UIEKW4SG.js} +1 -0
- package/dist/{chunk-WFA6IULY.js → chunk-URRAWU5D.js} +5 -0
- package/dist/{chunk-IGKFOHBG.js → chunk-VBMRZCMQ.js} +13 -13
- package/dist/{chunk-JRWUHLRP.js → chunk-VDY2GR6U.js} +51 -8
- package/dist/{chunk-EJS3K44P.js → chunk-VGAMBOOC.js} +5 -3
- package/dist/{chunk-B5PEKSRH.js → chunk-VSAKEMDD.js} +6 -1
- package/dist/chunk-WTTIODDV.js +9 -0
- package/dist/{chunk-JLU52ZDT.js → chunk-XJQ6Z3FO.js} +10 -10
- package/dist/{chunk-KTGZDMDX.js → chunk-XKCRKD2B.js} +140 -53
- package/dist/{chunk-LRP5FXST.js → chunk-YQMIKX54.js} +61 -24
- package/dist/{chunk-H5UEVW6Q.js → chunk-ZD3QCNB7.js} +1 -1
- package/dist/clock.js +168 -0
- package/dist/completion-registry.js +3 -1
- package/dist/countdown.js +36 -395
- package/dist/{dgmo-router-4UAPPIKN.js → dgmo-router-E5O7RJSW.js} +50 -43
- package/dist/{dimensions-SCNVYLRF.js → dimensions-DS6FWLRY.js} +3 -3
- package/dist/{d3-BThYBTQk.d.ts → export-context-Ceh3wr0E.d.ts} +2 -8
- package/dist/{flowchart-parser-NA75YQ77.js → flowchart-parser-NZXASOZG.js} +8 -3
- package/dist/{flowchart-renderer-6MGGX4RC.js → flowchart-renderer-PTCRIANF.js} +17 -19
- package/dist/index.d.ts +8 -7
- package/dist/index.js +80 -74
- package/dist/{layout-MBVBAMPA.js → layout-3TSVAGWH.js} +2 -2
- package/dist/layout-ISSBWBH7.js +24 -0
- package/dist/layout-IT4ZTV6C.js +24 -0
- package/dist/{layout-BNLFQHSB.js → layout-U3AH6M7J.js} +9 -10
- package/dist/layout-VC3MXRB4.js +29 -0
- package/dist/layout-VDCJOZSH.js +11 -0
- package/dist/{layout-search-PMYL3VWS.js → layout-search-BBX2BMEF.js} +11 -12
- package/dist/{palettes-IN7ZFRJM.js → palettes-4Y7CL2QL.js} +4 -2
- package/dist/{parser-QYISOAGR.js → parser-4RFY7D52.js} +8 -3
- package/dist/{parser-3MK56JZC.js → parser-4Y6PODW6.js} +2 -2
- package/dist/{parser-GX5YLRIP.js → parser-7QKQ4P4P.js} +8 -3
- package/dist/{parser-2NWH5JUS.js → parser-A3AN76RQ.js} +2 -1
- package/dist/{parser-LCJ76UXS.js → parser-BT4NI6JY.js} +5 -1
- package/dist/{parser-FXDS4JDK.js → parser-F7NDRPMA.js} +2 -2
- package/dist/{parser-BES6LV3G.js → parser-GDLKUBTO.js} +5 -1
- package/dist/{parser-SEUTXN6U.js → parser-KJPPUN4D.js} +2 -2
- package/dist/{parser-SIKL4PLF.js → parser-KMKVFET2.js} +5 -1
- package/dist/{parser-5LW5JDYG.js → parser-NL73FSFI.js} +5 -1
- package/dist/{parser-VA7ZQQTA.js → parser-NUU3DVW4.js} +5 -1
- package/dist/{parser-XZUKNZPB.js → parser-R3LPEQIT.js} +7 -1
- package/dist/{parser-X23GRTQJ.js → parser-RCIEKN7Y.js} +5 -1
- package/dist/{parser-L6RWDXQN.js → parser-TAYRTCPR.js} +8 -3
- package/dist/redraw-AHW7EUUF.js +1698 -0
- package/dist/redraw-STZ4WJAI.js +73 -0
- package/dist/{renderer-LM4ICK6I.js → renderer-2LYX6NHN.js} +4 -5
- package/dist/{renderer-NHTR7IRR.js → renderer-3NLDX7DQ.js} +4 -5
- package/dist/{renderer-TO2NVJP3.js → renderer-4SE7R22T.js} +50 -45
- package/dist/{renderer-3IHQI4A4.js → renderer-53B523PM.js} +11 -10
- package/dist/{renderer-3JY6JAQJ.js → renderer-7OGGV327.js} +5 -6
- package/dist/{renderer-2FVUPBGV.js → renderer-AM7P4LN7.js} +1 -1
- package/dist/{renderer-5VKPB4LL.js → renderer-BXD5KVSR.js} +5 -5
- package/dist/{renderer-OAR5VPH4.js → renderer-DAZWHNLI.js} +2 -2
- package/dist/{renderer-WIU5BJUK.js → renderer-DDWDCM2K.js} +2 -2
- package/dist/{renderer-3QAFDXEY.js → renderer-FMTLSOCX.js} +16 -12
- package/dist/{renderer-JEJT3YET.js → renderer-HX6ICPDX.js} +2 -3
- package/dist/{renderer-NDA2FFYB.js → renderer-ISQJ2ELA.js} +5 -5
- package/dist/{renderer-XGG2UNXT.js → renderer-IXBOT6DU.js} +3 -4
- package/dist/{renderer-S3YCLJKL.js → renderer-J3GPDK73.js} +20 -22
- package/dist/{renderer-DVNMCYHZ.js → renderer-J7ZSTJUE.js} +15 -15
- package/dist/{renderer-ALWVK3EJ.js → renderer-JJ4QW3SK.js} +6 -6
- package/dist/{renderer-RUSFL7WU.js → renderer-JYHA6R2D.js} +8 -7
- package/dist/{renderer-5TZVFQ7K.js → renderer-KJ3V5BYP.js} +7 -8
- package/dist/{renderer-RSK6QFWN.js → renderer-LNP23NSM.js} +7 -9
- package/dist/{renderer-ZHGHTSNG.js → renderer-M5DUMITP.js} +13 -12
- package/dist/{renderer-O6DY46AV.js → renderer-MWZC7TMD.js} +7 -7
- package/dist/{renderer-DC7C5Q3G.js → renderer-NOYLNVTI.js} +2 -2
- package/dist/{renderer-ISSDGK54.js → renderer-O6RP52CQ.js} +3 -3
- package/dist/{renderer-ZGY7P4BM.js → renderer-OUDHH5MV.js} +19 -22
- package/dist/{renderer-QGIHLZOJ.js → renderer-PHLCYVSN.js} +9 -10
- package/dist/{renderer-VPIELEE5.js → renderer-QTPWRRJ7.js} +8 -9
- package/dist/{renderer-LQP3AGEJ.js → renderer-RUSQJFFC.js} +3 -4
- package/dist/{renderer-MM27BSBO.js → renderer-TINHO2IO.js} +3 -4
- package/dist/{renderer-7ZZG5HR3.js → renderer-UTEEJDGB.js} +9 -9
- package/dist/{renderer-J5FKF423.js → renderer-W4MUMXJE.js} +7 -4
- package/dist/{renderer-XO57LTU4.js → renderer-WPN2SXGT.js} +5 -5
- package/dist/{renderer-ZZ6MWVB7.js → renderer-XCLARXCK.js} +4 -4
- package/dist/{renderer-J666LZXJ.js → renderer-XOWDERU2.js} +8 -8
- package/dist/{state-parser-TIR2ORJY.js → state-parser-KPVW5CRI.js} +8 -3
- package/dist/{state-renderer-G6SUXU4J.js → state-renderer-ZVEI265C.js} +18 -21
- package/dist/{tag-groups-DsoVpAY-.d.ts → tag-groups-DydewK3D.d.ts} +2 -173
- package/dist/{themes-DRNjxX7Q.d.ts → themes-DzIH3Hjv.d.ts} +3 -2
- package/docs/ai-integration.md +1 -1
- package/docs/language-reference.md +23 -2
- package/gallery/fixtures/whiteboard.dgmo +3 -0
- package/package.json +2 -6
- package/dist/chunk-3Y63RFJL.js +0 -75
- package/dist/chunk-5DH3KYFH.js +0 -20
- package/dist/chunk-O753JUEZ.js +0 -67
- package/dist/chunk-RJNZHFNG.js +0 -51
- package/dist/chunk-Z6DXWULM.js +0 -23
- package/dist/layout-5USEVQBY.js +0 -25
- package/dist/layout-J3AGFZZ7.js +0 -10
- package/dist/layout-S3RLVPH4.js +0 -25
- package/dist/layout-WRG4APSJ.js +0 -32
- package/dist/{chunk-DGUGE67L.js → chunk-CDYV46JE.js} +3 -3
- package/dist/{chunk-TKAB3FTK.js → chunk-DRQSB72S.js} +11 -11
- package/dist/{chunk-ZKP77MB3.js → chunk-FVTYJUXR.js} +5 -5
- package/dist/{chunk-MA42PIGJ.js → chunk-H5NVCOEJ.js} +4 -4
- package/dist/{chunk-BEA4D7OS.js → chunk-IXHWS2HI.js} +3 -3
- package/dist/{chunk-SOHZDW6N.js → chunk-UXNA2H2V.js} +3 -3
- package/dist/{chunk-NO3UX6AP.js → chunk-V2NQV7VL.js} +4 -4
|
@@ -4,26 +4,27 @@ import {
|
|
|
4
4
|
} from "./chunk-26EVL454.js";
|
|
5
5
|
import {
|
|
6
6
|
layoutGraph
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JT2BG7LM.js";
|
|
8
8
|
import {
|
|
9
9
|
appendArrowheadMarkers
|
|
10
10
|
} from "./chunk-XBJJP2HN.js";
|
|
11
|
-
import {
|
|
12
|
-
NOTE_BADGE_RADIUS,
|
|
13
|
-
noteConnectorPoints,
|
|
14
|
-
renderNoteBadge,
|
|
15
|
-
renderNoteBox,
|
|
16
|
-
renderNoteConnector
|
|
17
|
-
} from "./chunk-JRWUHLRP.js";
|
|
18
11
|
import {
|
|
19
12
|
fitDiagramToCanvas
|
|
20
13
|
} from "./chunk-EPDBWATV.js";
|
|
14
|
+
import {
|
|
15
|
+
serializeSvg
|
|
16
|
+
} from "./chunk-CYRB2JTN.js";
|
|
21
17
|
import {
|
|
22
18
|
ScaleContext
|
|
23
19
|
} from "./chunk-24YPR5EH.js";
|
|
24
20
|
import {
|
|
25
|
-
|
|
26
|
-
} from "./chunk-
|
|
21
|
+
layoutInlineHeader
|
|
22
|
+
} from "./chunk-UIEKW4SG.js";
|
|
23
|
+
import {
|
|
24
|
+
TITLE_FONT_SIZE,
|
|
25
|
+
TITLE_FONT_WEIGHT,
|
|
26
|
+
TITLE_Y
|
|
27
|
+
} from "./chunk-VLC6WNRD.js";
|
|
27
28
|
import {
|
|
28
29
|
ARROWHEAD_HEIGHT,
|
|
29
30
|
ARROWHEAD_WIDTH,
|
|
@@ -32,26 +33,25 @@ import {
|
|
|
32
33
|
NODE_STROKE_WIDTH
|
|
33
34
|
} from "./chunk-XCKNFFKM.js";
|
|
34
35
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import {
|
|
38
|
-
serializeSvg
|
|
39
|
-
} from "./chunk-CYRB2JTN.js";
|
|
36
|
+
renderIntegratedLegend
|
|
37
|
+
} from "./chunk-NMS5XSLX.js";
|
|
40
38
|
import {
|
|
41
39
|
getLegendExtent,
|
|
42
40
|
getMaxLegendReservedHeight
|
|
43
41
|
} from "./chunk-JILEYZ2V.js";
|
|
44
42
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
parseState
|
|
44
|
+
} from "./chunk-2MS623GW.js";
|
|
45
|
+
import {
|
|
46
|
+
NOTE_BADGE_RADIUS,
|
|
47
|
+
noteConnectorPoints,
|
|
48
|
+
renderNoteBadge,
|
|
49
|
+
renderNoteBox,
|
|
50
|
+
renderNoteConnector
|
|
51
|
+
} from "./chunk-VDY2GR6U.js";
|
|
49
52
|
import {
|
|
50
53
|
FONT_FAMILY
|
|
51
54
|
} from "./chunk-ICLB27PZ.js";
|
|
52
|
-
import {
|
|
53
|
-
parseState
|
|
54
|
-
} from "./chunk-2YAFDND3.js";
|
|
55
55
|
import {
|
|
56
56
|
resolveActiveTagGroup,
|
|
57
57
|
resolveGroupTagColor,
|
|
@@ -1,298 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
noteConnectorPoints
|
|
6
|
-
} from "./chunk-JRWUHLRP.js";
|
|
7
|
-
import {
|
|
8
|
-
NOTE_GAP
|
|
9
|
-
} from "./chunk-5DH3KYFH.js";
|
|
2
|
+
NODE_HEIGHT,
|
|
3
|
+
NODE_WIDTH
|
|
4
|
+
} from "./chunk-WTTIODDV.js";
|
|
10
5
|
import {
|
|
11
6
|
LABEL_REACH_WIDE,
|
|
12
|
-
NODE_HEIGHT,
|
|
13
|
-
NODE_WIDTH,
|
|
14
7
|
placeEdgeLabels
|
|
15
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IN7XI6NO.js";
|
|
16
9
|
import {
|
|
10
|
+
buildPlacedNotes,
|
|
11
|
+
noteCanvasShift,
|
|
17
12
|
resolveNotes
|
|
18
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7SXV7NUS.js";
|
|
19
14
|
import {
|
|
20
15
|
measureText,
|
|
21
16
|
wrapTextToWidth
|
|
22
17
|
} from "./chunk-KAO7JL4I.js";
|
|
23
18
|
|
|
24
|
-
// src/utils/notes/place.ts
|
|
25
|
-
var NOTE_CLEAR = 14;
|
|
26
|
-
var intersects = (a, b, pad) => !(a.right + pad <= b.left || b.right + pad <= a.left || a.bottom + pad <= b.top || b.bottom + pad <= a.top);
|
|
27
|
-
var CONNECTOR_CLEAR = 4;
|
|
28
|
-
var EDGE_CLEAR = 6;
|
|
29
|
-
var SLIDE_STEP = 10;
|
|
30
|
-
var SEARCH_REACH = 480;
|
|
31
|
-
var segmentCrosses = (x1, y1, x2, y2, r) => {
|
|
32
|
-
const dx = x2 - x1;
|
|
33
|
-
const dy = y2 - y1;
|
|
34
|
-
const p = [-dx, dx, -dy, dy];
|
|
35
|
-
const q = [x1 - r.left, r.right - x1, y1 - r.top, r.bottom - y1];
|
|
36
|
-
let t0 = 0;
|
|
37
|
-
let t1 = 1;
|
|
38
|
-
for (let i = 0; i < 4; i++) {
|
|
39
|
-
const pi = p[i];
|
|
40
|
-
const qi = q[i];
|
|
41
|
-
if (pi === 0) {
|
|
42
|
-
if (qi <= 0) return false;
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
const t = qi / pi;
|
|
46
|
-
if (pi < 0) t0 = Math.max(t0, t);
|
|
47
|
-
else t1 = Math.min(t1, t);
|
|
48
|
-
}
|
|
49
|
-
return t0 < t1;
|
|
50
|
-
};
|
|
51
|
-
function placeNotes(obstacles, requests, direction, edges = []) {
|
|
52
|
-
const placements = /* @__PURE__ */ new Map();
|
|
53
|
-
const occupied = obstacles.map((p) => ({
|
|
54
|
-
left: p.x - p.width / 2,
|
|
55
|
-
top: p.y - p.height / 2,
|
|
56
|
-
right: p.x + p.width / 2,
|
|
57
|
-
bottom: p.y + p.height / 2
|
|
58
|
-
}));
|
|
59
|
-
for (const req of requests) {
|
|
60
|
-
if (req.collapsed) {
|
|
61
|
-
placements.set(req.key, {
|
|
62
|
-
collapsed: true,
|
|
63
|
-
side: "right",
|
|
64
|
-
x: 0,
|
|
65
|
-
y: 0
|
|
66
|
-
});
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
const p = req.node;
|
|
70
|
-
const cx = p.x;
|
|
71
|
-
const cy = p.y;
|
|
72
|
-
const nodeLeft = cx - p.width / 2;
|
|
73
|
-
const nodeRight = cx + p.width / 2;
|
|
74
|
-
const nodeTop = cy - p.height / 2;
|
|
75
|
-
const nodeBottom = cy + p.height / 2;
|
|
76
|
-
const { noteW, noteH } = req;
|
|
77
|
-
const rectFor = (side) => {
|
|
78
|
-
switch (side) {
|
|
79
|
-
case "right": {
|
|
80
|
-
const left = nodeRight + NOTE_GAP;
|
|
81
|
-
const top = cy - noteH / 2;
|
|
82
|
-
return { left, top, right: left + noteW, bottom: top + noteH };
|
|
83
|
-
}
|
|
84
|
-
case "left": {
|
|
85
|
-
const right = nodeLeft - NOTE_GAP;
|
|
86
|
-
const top = cy - noteH / 2;
|
|
87
|
-
return { left: right - noteW, top, right, bottom: top + noteH };
|
|
88
|
-
}
|
|
89
|
-
case "below": {
|
|
90
|
-
const left = cx - noteW / 2;
|
|
91
|
-
const top = nodeBottom + NOTE_GAP;
|
|
92
|
-
return { left, top, right: left + noteW, bottom: top + noteH };
|
|
93
|
-
}
|
|
94
|
-
case "above":
|
|
95
|
-
default: {
|
|
96
|
-
const left = cx - noteW / 2;
|
|
97
|
-
const bottom = nodeTop - NOTE_GAP;
|
|
98
|
-
return { left, top: bottom - noteH, right: left + noteW, bottom };
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
const order = direction === "LR" ? ["below", "above", "right", "left"] : ["right", "left", "below", "above"];
|
|
103
|
-
const anchor = {
|
|
104
|
-
left: nodeLeft,
|
|
105
|
-
top: nodeTop,
|
|
106
|
-
right: nodeRight,
|
|
107
|
-
bottom: nodeBottom
|
|
108
|
-
};
|
|
109
|
-
const isAnchor = (o) => o.left === anchor.left && o.top === anchor.top && o.right === anchor.right && o.bottom === anchor.bottom;
|
|
110
|
-
const connector = (rect, side) => {
|
|
111
|
-
const [x1, y1, x2, y2] = noteConnectorPoints(p, {
|
|
112
|
-
x: rect.left - cx,
|
|
113
|
-
y: rect.top - cy,
|
|
114
|
-
width: noteW,
|
|
115
|
-
height: noteH,
|
|
116
|
-
side
|
|
117
|
-
});
|
|
118
|
-
return [cx + x1, cy + y1, cx + x2, cy + y2];
|
|
119
|
-
};
|
|
120
|
-
const onEdge = (rect) => {
|
|
121
|
-
const padded = {
|
|
122
|
-
left: rect.left - EDGE_CLEAR,
|
|
123
|
-
top: rect.top - EDGE_CLEAR,
|
|
124
|
-
right: rect.right + EDGE_CLEAR,
|
|
125
|
-
bottom: rect.bottom + EDGE_CLEAR
|
|
126
|
-
};
|
|
127
|
-
return edges.some(
|
|
128
|
-
(path) => path.some(
|
|
129
|
-
(pt, i) => i > 0 && segmentCrosses(path[i - 1].x, path[i - 1].y, pt.x, pt.y, padded)
|
|
130
|
-
)
|
|
131
|
-
);
|
|
132
|
-
};
|
|
133
|
-
const isClear = (rect, side, avoidEdges) => {
|
|
134
|
-
if (occupied.some((o) => intersects(rect, o, NOTE_CLEAR))) return false;
|
|
135
|
-
if (avoidEdges && onEdge(rect)) return false;
|
|
136
|
-
const [x1, y1, x2, y2] = connector(rect, side);
|
|
137
|
-
return !occupied.some(
|
|
138
|
-
(o) => !isAnchor(o) && segmentCrosses(x1, y1, x2, y2, {
|
|
139
|
-
left: o.left - CONNECTOR_CLEAR,
|
|
140
|
-
top: o.top - CONNECTOR_CLEAR,
|
|
141
|
-
right: o.right + CONNECTOR_CLEAR,
|
|
142
|
-
bottom: o.bottom + CONNECTOR_CLEAR
|
|
143
|
-
})
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
const search = (avoidEdges) => {
|
|
147
|
-
let chosen2 = null;
|
|
148
|
-
for (const side of order.slice(0, 2)) {
|
|
149
|
-
const rect = rectFor(side);
|
|
150
|
-
if (isClear(rect, side, avoidEdges)) {
|
|
151
|
-
chosen2 = { rect, side };
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (chosen2) return chosen2;
|
|
156
|
-
let bestLen = Infinity;
|
|
157
|
-
for (const side of order) {
|
|
158
|
-
const axisIsY = side === "above" || side === "below";
|
|
159
|
-
const outward = side === "below" || side === "right" ? 1 : -1;
|
|
160
|
-
const reach = axisIsY ? noteW / 2 : SEARCH_REACH;
|
|
161
|
-
const slides = [0];
|
|
162
|
-
for (let s = SLIDE_STEP; s <= reach; s += SLIDE_STEP) {
|
|
163
|
-
slides.push(s, -s);
|
|
164
|
-
}
|
|
165
|
-
const base = rectFor(side);
|
|
166
|
-
for (let out = 0; out <= SEARCH_REACH; out += NOTE_CLEAR) {
|
|
167
|
-
for (const slide of slides) {
|
|
168
|
-
const dx = axisIsY ? slide : out * outward;
|
|
169
|
-
const dy = axisIsY ? out * outward : slide;
|
|
170
|
-
const rect = {
|
|
171
|
-
left: base.left + dx,
|
|
172
|
-
top: base.top + dy,
|
|
173
|
-
right: base.right + dx,
|
|
174
|
-
bottom: base.bottom + dy
|
|
175
|
-
};
|
|
176
|
-
if (!isClear(rect, side, avoidEdges)) continue;
|
|
177
|
-
const [x1, y1, x2, y2] = connector(rect, side);
|
|
178
|
-
const len = Math.hypot(x2 - x1, y2 - y1);
|
|
179
|
-
if (len < bestLen) {
|
|
180
|
-
bestLen = len;
|
|
181
|
-
chosen2 = { rect, side };
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return chosen2;
|
|
187
|
-
};
|
|
188
|
-
let chosen = search(true) ?? search(false);
|
|
189
|
-
if (!chosen) {
|
|
190
|
-
const side = order[0];
|
|
191
|
-
let rect = rectFor(side);
|
|
192
|
-
const axisIsY = side === "above" || side === "below";
|
|
193
|
-
const outward = side === "below" || side === "right" ? 1 : -1;
|
|
194
|
-
for (let guard = 0; guard < 50; guard++) {
|
|
195
|
-
const blockers = occupied.filter(
|
|
196
|
-
(o) => intersects(rect, o, NOTE_CLEAR)
|
|
197
|
-
);
|
|
198
|
-
if (blockers.length === 0) break;
|
|
199
|
-
if (axisIsY && outward > 0) {
|
|
200
|
-
const top = Math.max(...blockers.map((b) => b.bottom)) + NOTE_CLEAR;
|
|
201
|
-
rect = { ...rect, top, bottom: top + noteH };
|
|
202
|
-
} else if (axisIsY) {
|
|
203
|
-
const bottom = Math.min(...blockers.map((b) => b.top)) - NOTE_CLEAR;
|
|
204
|
-
rect = { ...rect, bottom, top: bottom - noteH };
|
|
205
|
-
} else if (outward > 0) {
|
|
206
|
-
const left = Math.max(...blockers.map((b) => b.right)) + NOTE_CLEAR;
|
|
207
|
-
rect = { ...rect, left, right: left + noteW };
|
|
208
|
-
} else {
|
|
209
|
-
const right = Math.min(...blockers.map((b) => b.left)) - NOTE_CLEAR;
|
|
210
|
-
rect = { ...rect, right, left: right - noteW };
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
chosen = { rect, side };
|
|
214
|
-
}
|
|
215
|
-
occupied.push(chosen.rect);
|
|
216
|
-
placements.set(req.key, {
|
|
217
|
-
collapsed: false,
|
|
218
|
-
side: chosen.side,
|
|
219
|
-
x: chosen.rect.left - p.x,
|
|
220
|
-
y: chosen.rect.top - p.y
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
return placements;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// src/utils/notes/build.ts
|
|
227
|
-
function buildPlacedNotes(anchors, noteByNode, direction, collapsedNotes) {
|
|
228
|
-
const placed = /* @__PURE__ */ new Map();
|
|
229
|
-
if (noteByNode.size === 0) return placed;
|
|
230
|
-
const geoms = /* @__PURE__ */ new Map();
|
|
231
|
-
const requests = [];
|
|
232
|
-
for (const a of anchors) {
|
|
233
|
-
const note = noteByNode.get(a.id);
|
|
234
|
-
if (!note) continue;
|
|
235
|
-
const size = noteBoxSize(note.body);
|
|
236
|
-
geoms.set(a.id, {
|
|
237
|
-
noteW: size.width,
|
|
238
|
-
noteH: size.height,
|
|
239
|
-
...note.color && { color: note.color },
|
|
240
|
-
lines: size.lines,
|
|
241
|
-
lineNumber: note.lineNumber,
|
|
242
|
-
endLineNumber: note.endLineNumber
|
|
243
|
-
});
|
|
244
|
-
requests.push({
|
|
245
|
-
key: a.id,
|
|
246
|
-
node: { x: a.x, y: a.y, width: a.width, height: a.height },
|
|
247
|
-
noteW: size.width,
|
|
248
|
-
noteH: size.height,
|
|
249
|
-
collapsed: collapsedNotes?.has(note.lineNumber) ?? false
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
const placements = placeNotes(
|
|
253
|
-
anchors.map((a) => ({ x: a.x, y: a.y, width: a.width, height: a.height })),
|
|
254
|
-
requests,
|
|
255
|
-
direction
|
|
256
|
-
);
|
|
257
|
-
for (const [id, g] of geoms) {
|
|
258
|
-
const p = placements.get(id);
|
|
259
|
-
placed.set(
|
|
260
|
-
id,
|
|
261
|
-
p.collapsed ? {
|
|
262
|
-
x: 0,
|
|
263
|
-
y: 0,
|
|
264
|
-
width: 0,
|
|
265
|
-
height: 0,
|
|
266
|
-
side: "right",
|
|
267
|
-
...g.color && { color: g.color },
|
|
268
|
-
lines: [],
|
|
269
|
-
lineNumber: g.lineNumber,
|
|
270
|
-
endLineNumber: g.endLineNumber,
|
|
271
|
-
collapsed: true
|
|
272
|
-
} : {
|
|
273
|
-
x: p.x,
|
|
274
|
-
y: p.y,
|
|
275
|
-
width: g.noteW,
|
|
276
|
-
height: g.noteH,
|
|
277
|
-
side: p.side,
|
|
278
|
-
...g.color && { color: g.color },
|
|
279
|
-
lines: g.lines,
|
|
280
|
-
lineNumber: g.lineNumber,
|
|
281
|
-
endLineNumber: g.endLineNumber
|
|
282
|
-
}
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
return placed;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// src/utils/notes/bounds.ts
|
|
289
|
-
function noteCanvasShift(minX, minY, margin = 20) {
|
|
290
|
-
return {
|
|
291
|
-
shiftX: minX < 0 ? margin - minX : 0,
|
|
292
|
-
shiftY: minY < 0 ? margin - minY : 0
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
|
|
296
19
|
// src/boxes-and-lines/layout.ts
|
|
297
20
|
var MARGIN = 40;
|
|
298
21
|
var MAX_PARALLEL_EDGES = 5;
|
|
@@ -382,7 +105,7 @@ function computeNodeSize(node, reserveValueRow) {
|
|
|
382
105
|
return { width: w, height: Math.max(NODE_HEIGHT, totalHeight) };
|
|
383
106
|
}
|
|
384
107
|
async function layoutBoxesAndLines(parsed, collapseInfo, layoutOptions) {
|
|
385
|
-
const { layoutBoxesAndLinesSearch } = await import("./layout-search-
|
|
108
|
+
const { layoutBoxesAndLinesSearch } = await import("./layout-search-BBX2BMEF.js");
|
|
386
109
|
const searchOpts = {
|
|
387
110
|
...layoutOptions?.hideDescriptions !== void 0 && {
|
|
388
111
|
hideDescriptions: layoutOptions.hideDescriptions
|
|
@@ -698,9 +421,6 @@ function applyParallelEdgeOffsets(layout) {
|
|
|
698
421
|
}
|
|
699
422
|
|
|
700
423
|
export {
|
|
701
|
-
placeNotes,
|
|
702
|
-
buildPlacedNotes,
|
|
703
|
-
noteCanvasShift,
|
|
704
424
|
computeNodeSize,
|
|
705
425
|
layoutBoxesAndLines
|
|
706
426
|
};
|
|
@@ -12,14 +12,23 @@ import {
|
|
|
12
12
|
appendArrowheadMarkers
|
|
13
13
|
} from "./chunk-XBJJP2HN.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
placeEdgeLabels
|
|
16
|
+
} from "./chunk-IN7XI6NO.js";
|
|
17
|
+
import {
|
|
18
|
+
parseInfra
|
|
19
|
+
} from "./chunk-UXNA2H2V.js";
|
|
17
20
|
import {
|
|
18
21
|
ScaleContext
|
|
19
22
|
} from "./chunk-24YPR5EH.js";
|
|
20
23
|
import {
|
|
21
|
-
|
|
22
|
-
} from "./chunk-
|
|
24
|
+
layoutInlineHeader
|
|
25
|
+
} from "./chunk-UIEKW4SG.js";
|
|
26
|
+
import {
|
|
27
|
+
TITLE_FONT_SIZE,
|
|
28
|
+
TITLE_FONT_WEIGHT,
|
|
29
|
+
TITLE_OFFSET,
|
|
30
|
+
TITLE_Y
|
|
31
|
+
} from "./chunk-VLC6WNRD.js";
|
|
23
32
|
import {
|
|
24
33
|
ARROWHEAD_HEIGHT,
|
|
25
34
|
ARROWHEAD_WIDTH,
|
|
@@ -31,27 +40,21 @@ import {
|
|
|
31
40
|
NODE_STROKE_WIDTH
|
|
32
41
|
} from "./chunk-XCKNFFKM.js";
|
|
33
42
|
import {
|
|
34
|
-
|
|
35
|
-
} from "./chunk-
|
|
43
|
+
renderIntegratedLegend
|
|
44
|
+
} from "./chunk-NMS5XSLX.js";
|
|
36
45
|
import {
|
|
37
46
|
getLegendExtent,
|
|
38
47
|
getMaxLegendReservedHeight
|
|
39
48
|
} from "./chunk-JILEYZ2V.js";
|
|
40
49
|
import {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} from "./chunk-
|
|
50
|
+
preprocessDescriptionLine
|
|
51
|
+
} from "./chunk-IYULMRBE.js";
|
|
52
|
+
import {
|
|
53
|
+
renderInlineText
|
|
54
|
+
} from "./chunk-QKPOIJBT.js";
|
|
46
55
|
import {
|
|
47
56
|
FONT_FAMILY
|
|
48
57
|
} from "./chunk-ICLB27PZ.js";
|
|
49
|
-
import {
|
|
50
|
-
parseInfra
|
|
51
|
-
} from "./chunk-SOHZDW6N.js";
|
|
52
|
-
import {
|
|
53
|
-
preprocessDescriptionLine
|
|
54
|
-
} from "./chunk-IYULMRBE.js";
|
|
55
58
|
import {
|
|
56
59
|
tagAttrKey
|
|
57
60
|
} from "./chunk-4SACN2C5.js";
|
|
@@ -968,17 +971,66 @@ function renderEdgePaths(svg, edges, nodes, groups, palette, _isDark, animate, d
|
|
|
968
971
|
}
|
|
969
972
|
}
|
|
970
973
|
}
|
|
974
|
+
function placeInfraEdgeLabels(routes, edges, nodes, groups, fontSize) {
|
|
975
|
+
const adapted = {
|
|
976
|
+
nodes: nodes.map((n) => ({
|
|
977
|
+
label: n.id,
|
|
978
|
+
x: n.x,
|
|
979
|
+
y: n.y,
|
|
980
|
+
width: n.width,
|
|
981
|
+
height: n.height
|
|
982
|
+
})),
|
|
983
|
+
groups: groups.map((g) => ({
|
|
984
|
+
label: g.id,
|
|
985
|
+
lineNumber: g.lineNumber,
|
|
986
|
+
x: g.x + g.width / 2,
|
|
987
|
+
y: g.y + g.height / 2,
|
|
988
|
+
width: g.width,
|
|
989
|
+
height: g.height,
|
|
990
|
+
collapsed: false
|
|
991
|
+
})),
|
|
992
|
+
width: 0,
|
|
993
|
+
height: 0,
|
|
994
|
+
edges: edges.map((e, idx) => ({
|
|
995
|
+
source: e.sourceId,
|
|
996
|
+
target: e.targetId,
|
|
997
|
+
...e.label && { label: e.label },
|
|
998
|
+
bidirectional: false,
|
|
999
|
+
lineNumber: e.lineNumber,
|
|
1000
|
+
points: routes[idx] ?? [],
|
|
1001
|
+
yOffset: 0,
|
|
1002
|
+
parallelCount: 1,
|
|
1003
|
+
metadata: {}
|
|
1004
|
+
}))
|
|
1005
|
+
};
|
|
1006
|
+
const blGroups = groups.map((g) => ({
|
|
1007
|
+
label: g.id,
|
|
1008
|
+
children: nodes.filter((n) => n.groupId === g.id).map((n) => n.id),
|
|
1009
|
+
lineNumber: g.lineNumber,
|
|
1010
|
+
metadata: {}
|
|
1011
|
+
}));
|
|
1012
|
+
const placed = placeEdgeLabels(adapted, {
|
|
1013
|
+
fontSize,
|
|
1014
|
+
maxWidth: Number.POSITIVE_INFINITY,
|
|
1015
|
+
groups: blGroups
|
|
1016
|
+
});
|
|
1017
|
+
const out = /* @__PURE__ */ new Map();
|
|
1018
|
+
placed.layout.edges.forEach((e, idx) => {
|
|
1019
|
+
if (e.labelX !== void 0 && e.labelY !== void 0)
|
|
1020
|
+
out.set(idx, { x: e.labelX, y: e.labelY });
|
|
1021
|
+
});
|
|
1022
|
+
return out;
|
|
1023
|
+
}
|
|
971
1024
|
function renderEdgeLabels(svg, edges, nodes, groups, palette, _isDark, animate, direction, sc = buildScaledConstants(ScaleContext.identity())) {
|
|
972
1025
|
const nodeMap = nodeMapWithGroups(nodes, groups);
|
|
973
1026
|
const { srcPts, tgtPts } = computePortPts(edges, nodeMap, direction);
|
|
974
|
-
|
|
975
|
-
if (edge.points.length === 0)
|
|
976
|
-
if (!edge.label) continue;
|
|
1027
|
+
const routes = edges.map((edge) => {
|
|
1028
|
+
if (edge.points.length === 0) return [];
|
|
977
1029
|
const sourceNode = nodeMap.get(edge.sourceId);
|
|
978
1030
|
const targetNode = nodeMap.get(edge.targetId);
|
|
979
|
-
if (!sourceNode || !targetNode)
|
|
1031
|
+
if (!sourceNode || !targetNode) return [];
|
|
980
1032
|
const key = `${edge.sourceId}:${edge.targetId}`;
|
|
981
|
-
|
|
1033
|
+
return edgeWaypoints(
|
|
982
1034
|
sourceNode,
|
|
983
1035
|
targetNode,
|
|
984
1036
|
groups,
|
|
@@ -988,7 +1040,18 @@ function renderEdgeLabels(svg, edges, nodes, groups, palette, _isDark, animate,
|
|
|
988
1040
|
srcPts.get(key),
|
|
989
1041
|
tgtPts.get(key)
|
|
990
1042
|
);
|
|
991
|
-
|
|
1043
|
+
});
|
|
1044
|
+
const labelPts = placeInfraEdgeLabels(
|
|
1045
|
+
routes,
|
|
1046
|
+
edges,
|
|
1047
|
+
nodes,
|
|
1048
|
+
groups,
|
|
1049
|
+
EDGE_LABEL_FONT_SIZE
|
|
1050
|
+
);
|
|
1051
|
+
for (const [idx, edge] of edges.entries()) {
|
|
1052
|
+
if (!edge.label) continue;
|
|
1053
|
+
const wps = routes[idx];
|
|
1054
|
+
const midPt = labelPts.get(idx);
|
|
992
1055
|
if (!midPt) continue;
|
|
993
1056
|
const labelText = edge.label;
|
|
994
1057
|
const g = svg.append("g").attr("class", animate ? "infra-edge-label" : "");
|