@pinkpixel/marzipan 1.1.0 → 1.1.2
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/README.md +72 -37
- package/dist/_basePickBy-D4kyG5Tu.js +152 -0
- package/dist/_basePickBy-D4kyG5Tu.js.map +1 -0
- package/dist/_baseUniq-s5uZhHMt.js +615 -0
- package/dist/_baseUniq-s5uZhHMt.js.map +1 -0
- package/dist/arc-Cd2Fw3V6.js +84 -0
- package/dist/arc-Cd2Fw3V6.js.map +1 -0
- package/dist/architectureDiagram-VXUJARFQ-ylT61Lln.js +4663 -0
- package/dist/architectureDiagram-VXUJARFQ-ylT61Lln.js.map +1 -0
- package/dist/blockDiagram-VD42YOAC-CoIxLSyQ.js +2257 -0
- package/dist/blockDiagram-VD42YOAC-CoIxLSyQ.js.map +1 -0
- package/dist/c4Diagram-YG6GDRKO-CsQimMM6.js +1581 -0
- package/dist/c4Diagram-YG6GDRKO-CsQimMM6.js.map +1 -0
- package/dist/channel-0tZUlnqz.js +6 -0
- package/dist/channel-0tZUlnqz.js.map +1 -0
- package/dist/chunk-4BX2VUAB-DVkBhLxy.js +9 -0
- package/dist/chunk-4BX2VUAB-DVkBhLxy.js.map +1 -0
- package/dist/chunk-55IACEB6-CVQcegI-.js +9 -0
- package/dist/chunk-55IACEB6-CVQcegI-.js.map +1 -0
- package/dist/chunk-B4BG7PRW-DPUTNckV.js +1376 -0
- package/dist/chunk-B4BG7PRW-DPUTNckV.js.map +1 -0
- package/dist/chunk-DI55MBZ5-F7DI2N9R.js +1371 -0
- package/dist/chunk-DI55MBZ5-F7DI2N9R.js.map +1 -0
- package/dist/chunk-FMBD7UC4-C3wNpU7V.js +20 -0
- package/dist/chunk-FMBD7UC4-C3wNpU7V.js.map +1 -0
- package/dist/chunk-QN33PNHL-BOdqrixJ.js +20 -0
- package/dist/chunk-QN33PNHL-BOdqrixJ.js.map +1 -0
- package/dist/chunk-QZHKN3VN-BFPNdgmW.js +16 -0
- package/dist/chunk-QZHKN3VN-BFPNdgmW.js.map +1 -0
- package/dist/chunk-TZMSLE5B-BZuxNW58.js +65 -0
- package/dist/chunk-TZMSLE5B-BZuxNW58.js.map +1 -0
- package/dist/classDiagram-2ON5EDUG-CiRjpBEe.js +17 -0
- package/dist/classDiagram-2ON5EDUG-CiRjpBEe.js.map +1 -0
- package/dist/classDiagram-v2-WZHVMYZB-CiRjpBEe.js +17 -0
- package/dist/classDiagram-v2-WZHVMYZB-CiRjpBEe.js.map +1 -0
- package/dist/clone-Bm_onhkP.js +9 -0
- package/dist/clone-Bm_onhkP.js.map +1 -0
- package/dist/cose-bilkent-S5V4N54A-D9xMKgKB.js +2609 -0
- package/dist/cose-bilkent-S5V4N54A-D9xMKgKB.js.map +1 -0
- package/dist/dagre-6UL2VRFP-BhIQJjaK.js +445 -0
- package/dist/dagre-6UL2VRFP-BhIQJjaK.js.map +1 -0
- package/dist/diagram-PSM6KHXK-h4YEzD1S.js +532 -0
- package/dist/diagram-PSM6KHXK-h4YEzD1S.js.map +1 -0
- package/dist/diagram-QEK2KX5R-spuV0akZ.js +218 -0
- package/dist/diagram-QEK2KX5R-spuV0akZ.js.map +1 -0
- package/dist/diagram-S2PKOQOG-CQx-wsyw.js +143 -0
- package/dist/diagram-S2PKOQOG-CQx-wsyw.js.map +1 -0
- package/dist/erDiagram-Q2GNP2WA-Cqkjjf2a.js +842 -0
- package/dist/erDiagram-Q2GNP2WA-Cqkjjf2a.js.map +1 -0
- package/dist/flowDiagram-NV44I4VS-mCXE9u9b.js +1621 -0
- package/dist/flowDiagram-NV44I4VS-mCXE9u9b.js.map +1 -0
- package/dist/ganttDiagram-JELNMOA3-Bz1GBIHE.js +2671 -0
- package/dist/ganttDiagram-JELNMOA3-Bz1GBIHE.js.map +1 -0
- package/dist/gitGraphDiagram-V2S2FVAM-Be01Oq15.js +700 -0
- package/dist/gitGraphDiagram-V2S2FVAM-Be01Oq15.js.map +1 -0
- package/dist/graph-DVWVTM7e.js +248 -0
- package/dist/graph-DVWVTM7e.js.map +1 -0
- package/dist/index-kKw24iiA.js +34 -0
- package/dist/index-kKw24iiA.js.map +1 -0
- package/dist/index.d.ts +0 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +270 -277
- package/dist/index.js.map +1 -1
- package/dist/infoDiagram-HS3SLOUP-joTtnw9j.js +25 -0
- package/dist/infoDiagram-HS3SLOUP-joTtnw9j.js.map +1 -0
- package/dist/journeyDiagram-XKPGCS4Q-CMVu7VEd.js +835 -0
- package/dist/journeyDiagram-XKPGCS4Q-CMVu7VEd.js.map +1 -0
- package/dist/kanban-definition-3W4ZIXB7-CfanK5Eg.js +720 -0
- package/dist/kanban-definition-3W4ZIXB7-CfanK5Eg.js.map +1 -0
- package/dist/katex-Cj93GM5Y.js +11605 -0
- package/dist/katex-Cj93GM5Y.js.map +1 -0
- package/dist/layout-BC8VSiQq.js +1336 -0
- package/dist/layout-BC8VSiQq.js.map +1 -0
- package/dist/linear-GV5CIa17.js +260 -0
- package/dist/linear-GV5CIa17.js.map +1 -0
- package/dist/marzipan.d.ts +1 -2
- package/dist/marzipan.d.ts.map +1 -1
- package/dist/marzipan.js +1 -19
- package/dist/marzipan.js.map +1 -1
- package/dist/mermaid.core-cSWK5aGH.js +15302 -0
- package/dist/mermaid.core-cSWK5aGH.js.map +1 -0
- package/dist/mindmap-definition-VGOIOE7T-Vu_RTZar.js +785 -0
- package/dist/mindmap-definition-VGOIOE7T-Vu_RTZar.js.map +1 -0
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +6 -5
- package/dist/parser.js.map +1 -1
- package/dist/pieDiagram-ADFJNKIX-BUcd1l-6.js +162 -0
- package/dist/pieDiagram-ADFJNKIX-BUcd1l-6.js.map +1 -0
- package/dist/plugins/accentSwatchPlugin.d.ts +1 -1
- package/dist/plugins/accentSwatchPlugin.d.ts.map +1 -1
- package/dist/plugins/accentSwatchPlugin.js +162 -81
- package/dist/plugins/accentSwatchPlugin.js.map +1 -1
- package/dist/plugins/block-handles.d.ts +10 -2
- package/dist/plugins/block-handles.d.ts.map +1 -1
- package/dist/plugins/block-handles.js +77 -51
- package/dist/plugins/block-handles.js.map +1 -1
- package/dist/plugins/index.d.ts +0 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +27 -29
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/mermaidPlugin.js +1 -1
- package/dist/plugins/tinyHighlight.d.ts.map +1 -1
- package/dist/plugins/tinyHighlight.js +34 -22
- package/dist/plugins/tinyHighlight.js.map +1 -1
- package/dist/quadrantDiagram-AYHSOK5B-B1ekOH99.js +1023 -0
- package/dist/quadrantDiagram-AYHSOK5B-B1ekOH99.js.map +1 -0
- package/dist/requirementDiagram-UZGBJVZJ-BNcVcwNf.js +851 -0
- package/dist/requirementDiagram-UZGBJVZJ-BNcVcwNf.js.map +1 -0
- package/dist/sankeyDiagram-TZEHDZUN-BpHcdj5K.js +811 -0
- package/dist/sankeyDiagram-TZEHDZUN-BpHcdj5K.js.map +1 -0
- package/dist/sequenceDiagram-WL72ISMW-D5UyNvsv.js +2512 -0
- package/dist/sequenceDiagram-WL72ISMW-D5UyNvsv.js.map +1 -0
- package/dist/stateDiagram-FKZM4ZOC-C8DBscXu.js +264 -0
- package/dist/stateDiagram-FKZM4ZOC-C8DBscXu.js.map +1 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CHqwUDPY.js +17 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CHqwUDPY.js.map +1 -0
- package/dist/timeline-definition-IT6M3QCI-Dtg0oJbr.js +796 -0
- package/dist/timeline-definition-IT6M3QCI-Dtg0oJbr.js.map +1 -0
- package/dist/treemap-GDKQZRPO-rbQo3Em-.js +17926 -0
- package/dist/treemap-GDKQZRPO-rbQo3Em-.js.map +1 -0
- package/dist/xychartDiagram-PRI3JC2R-uNpgYSnV.js +1341 -0
- package/dist/xychartDiagram-PRI3JC2R-uNpgYSnV.js.map +1 -0
- package/docs/.vitepress/config.ts +1 -1
- package/docs/README.md +6 -8
- package/docs/TABLE_OF_CONTENTS.md +4 -1
- package/docs/api.md +262 -202
- package/docs/index.md +22 -19
- package/docs/plugins.md +27 -23
- package/package.json +1 -1
- package/docs/block-handles.md +0 -325
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import { _ as w, aw as F, ax as Y, ay as _, az as H, l as i, c as V, aA as z, aB as U, ag as $, an as q, ah as P, af as K, aC as Q, aD as W, aE as Z } from "./mermaid.core-cSWK5aGH.js";
|
|
2
|
+
import { G as B } from "./graph-DVWVTM7e.js";
|
|
3
|
+
import { l as I } from "./layout-BC8VSiQq.js";
|
|
4
|
+
import { i as b } from "./_baseUniq-s5uZhHMt.js";
|
|
5
|
+
import { c as L } from "./clone-Bm_onhkP.js";
|
|
6
|
+
import { m as A } from "./_basePickBy-D4kyG5Tu.js";
|
|
7
|
+
function h(e) {
|
|
8
|
+
var t = {
|
|
9
|
+
options: {
|
|
10
|
+
directed: e.isDirected(),
|
|
11
|
+
multigraph: e.isMultigraph(),
|
|
12
|
+
compound: e.isCompound()
|
|
13
|
+
},
|
|
14
|
+
nodes: ee(e),
|
|
15
|
+
edges: ne(e)
|
|
16
|
+
};
|
|
17
|
+
return b(e.graph()) || (t.value = L(e.graph())), t;
|
|
18
|
+
}
|
|
19
|
+
function ee(e) {
|
|
20
|
+
return A(e.nodes(), function(t) {
|
|
21
|
+
var n = e.node(t), a = e.parent(t), r = { v: t };
|
|
22
|
+
return b(n) || (r.value = n), b(a) || (r.parent = a), r;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function ne(e) {
|
|
26
|
+
return A(e.edges(), function(t) {
|
|
27
|
+
var n = e.edge(t), a = { v: t.v, w: t.w };
|
|
28
|
+
return b(t.name) || (a.name = t.name), b(n) || (a.value = n), a;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ w(() => {
|
|
32
|
+
y.clear(), J.clear(), d.clear();
|
|
33
|
+
}, "clear"), D = /* @__PURE__ */ w((e, t) => {
|
|
34
|
+
const n = y.get(t) || [];
|
|
35
|
+
return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
|
|
36
|
+
}, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
|
|
37
|
+
const n = y.get(t) || [];
|
|
38
|
+
return i.info("Descendants of ", t, " is ", n), i.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || D(e.v, t) || D(e.w, t) || n.includes(e.w) : (i.debug("Tilt, ", t, ",not in descendants"), !1);
|
|
39
|
+
}, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
|
|
40
|
+
i.warn(
|
|
41
|
+
"Copying children of ",
|
|
42
|
+
e,
|
|
43
|
+
"root",
|
|
44
|
+
a,
|
|
45
|
+
"data",
|
|
46
|
+
t.node(e),
|
|
47
|
+
a
|
|
48
|
+
);
|
|
49
|
+
const r = t.children(e) || [];
|
|
50
|
+
e !== a && r.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", r), r.forEach((o) => {
|
|
51
|
+
if (t.children(o).length > 0)
|
|
52
|
+
G(o, t, n, a);
|
|
53
|
+
else {
|
|
54
|
+
const l = t.node(o);
|
|
55
|
+
i.info("cp ", o, " to ", a, " with parent ", e), n.setNode(o, l), a !== t.parent(o) && (i.warn("Setting parent", o, t.parent(o)), n.setParent(o, t.parent(o))), e !== a && o !== e ? (i.debug("Setting parent", o, e), n.setParent(o, e)) : (i.info("In copy ", e, "root", a, "data", t.node(e), a), i.debug(
|
|
56
|
+
"Not Setting parent for node=",
|
|
57
|
+
o,
|
|
58
|
+
"cluster!==rootId",
|
|
59
|
+
e !== a,
|
|
60
|
+
"node!==clusterId",
|
|
61
|
+
o !== e
|
|
62
|
+
));
|
|
63
|
+
const u = t.edges(o);
|
|
64
|
+
i.debug("Copying Edges", u), u.forEach((c) => {
|
|
65
|
+
i.info("Edge", c);
|
|
66
|
+
const m = t.edge(c.v, c.w, c.name);
|
|
67
|
+
i.info("Edge data", m, a);
|
|
68
|
+
try {
|
|
69
|
+
se(c, a) ? (i.info("Copying as ", c.v, c.w, m, c.name), n.setEdge(c.v, c.w, m, c.name), i.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : i.info(
|
|
70
|
+
"Skipping copy of edge ",
|
|
71
|
+
c.v,
|
|
72
|
+
"-->",
|
|
73
|
+
c.w,
|
|
74
|
+
" rootId: ",
|
|
75
|
+
a,
|
|
76
|
+
" clusterId:",
|
|
77
|
+
e
|
|
78
|
+
);
|
|
79
|
+
} catch (v) {
|
|
80
|
+
i.error(v);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
i.debug("Removing node", o), t.removeNode(o);
|
|
85
|
+
});
|
|
86
|
+
}, "copy"), R = /* @__PURE__ */ w((e, t) => {
|
|
87
|
+
const n = t.children(e);
|
|
88
|
+
let a = [...n];
|
|
89
|
+
for (const r of n)
|
|
90
|
+
J.set(r, e), a = [...a, ...R(r, t)];
|
|
91
|
+
return a;
|
|
92
|
+
}, "extractDescendants"), ie = /* @__PURE__ */ w((e, t, n) => {
|
|
93
|
+
const a = e.edges().filter((c) => c.v === t || c.w === t), r = e.edges().filter((c) => c.v === n || c.w === n), o = a.map((c) => ({ v: c.v === t ? n : c.v, w: c.w === t ? t : c.w })), l = r.map((c) => ({ v: c.v, w: c.w }));
|
|
94
|
+
return o.filter((c) => l.some((m) => c.v === m.v && c.w === m.w));
|
|
95
|
+
}, "findCommonEdges"), C = /* @__PURE__ */ w((e, t, n) => {
|
|
96
|
+
const a = t.children(e);
|
|
97
|
+
if (i.trace("Searching children of id ", e, a), a.length < 1)
|
|
98
|
+
return e;
|
|
99
|
+
let r;
|
|
100
|
+
for (const o of a) {
|
|
101
|
+
const l = C(o, t, n), u = ie(t, n, l);
|
|
102
|
+
if (l)
|
|
103
|
+
if (u.length > 0)
|
|
104
|
+
r = l;
|
|
105
|
+
else
|
|
106
|
+
return l;
|
|
107
|
+
}
|
|
108
|
+
return r;
|
|
109
|
+
}, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"), re = /* @__PURE__ */ w((e, t) => {
|
|
110
|
+
if (!e || t > 10) {
|
|
111
|
+
i.debug("Opting out, no graph ");
|
|
112
|
+
return;
|
|
113
|
+
} else
|
|
114
|
+
i.debug("Opting in, graph ");
|
|
115
|
+
e.nodes().forEach(function(n) {
|
|
116
|
+
e.children(n).length > 0 && (i.warn(
|
|
117
|
+
"Cluster identified",
|
|
118
|
+
n,
|
|
119
|
+
" Replacement id in edges: ",
|
|
120
|
+
C(n, e, n)
|
|
121
|
+
), y.set(n, R(n, e)), d.set(n, { id: C(n, e, n), clusterData: e.node(n) }));
|
|
122
|
+
}), e.nodes().forEach(function(n) {
|
|
123
|
+
const a = e.children(n), r = e.edges();
|
|
124
|
+
a.length > 0 ? (i.debug("Cluster identified", n, y), r.forEach((o) => {
|
|
125
|
+
const l = D(o.v, n), u = D(o.w, n);
|
|
126
|
+
l ^ u && (i.warn("Edge: ", o, " leaves cluster ", n), i.warn("Descendants of XXX ", n, ": ", y.get(n)), d.get(n).externalConnections = !0);
|
|
127
|
+
})) : i.debug("Not a cluster ", n, y);
|
|
128
|
+
});
|
|
129
|
+
for (let n of d.keys()) {
|
|
130
|
+
const a = d.get(n).id, r = e.parent(a);
|
|
131
|
+
r !== n && d.has(r) && !d.get(r).externalConnections && (d.get(n).id = r);
|
|
132
|
+
}
|
|
133
|
+
e.edges().forEach(function(n) {
|
|
134
|
+
const a = e.edge(n);
|
|
135
|
+
i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
|
|
136
|
+
let r = n.v, o = n.w;
|
|
137
|
+
if (i.warn(
|
|
138
|
+
"Fix XXX",
|
|
139
|
+
d,
|
|
140
|
+
"ids:",
|
|
141
|
+
n.v,
|
|
142
|
+
n.w,
|
|
143
|
+
"Translating: ",
|
|
144
|
+
d.get(n.v),
|
|
145
|
+
" --- ",
|
|
146
|
+
d.get(n.w)
|
|
147
|
+
), d.get(n.v) || d.get(n.w)) {
|
|
148
|
+
if (i.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), r = k(n.v), o = k(n.w), e.removeEdge(n.v, n.w, n.name), r !== n.v) {
|
|
149
|
+
const l = e.parent(r);
|
|
150
|
+
d.get(l).externalConnections = !0, a.fromCluster = n.v;
|
|
151
|
+
}
|
|
152
|
+
if (o !== n.w) {
|
|
153
|
+
const l = e.parent(o);
|
|
154
|
+
d.get(l).externalConnections = !0, a.toCluster = n.w;
|
|
155
|
+
}
|
|
156
|
+
i.warn("Fix Replacing with XXX", r, o, n.name), e.setEdge(r, o, a, n.name);
|
|
157
|
+
}
|
|
158
|
+
}), i.warn("Adjusted Graph", h(e)), T(e, 0), i.trace(d);
|
|
159
|
+
}, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
|
|
160
|
+
if (i.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
|
|
161
|
+
i.error("Bailing out");
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
let n = e.nodes(), a = !1;
|
|
165
|
+
for (const r of n) {
|
|
166
|
+
const o = e.children(r);
|
|
167
|
+
a = a || o.length > 0;
|
|
168
|
+
}
|
|
169
|
+
if (!a) {
|
|
170
|
+
i.debug("Done, no node has children", e.nodes());
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
i.debug("Nodes = ", n, t);
|
|
174
|
+
for (const r of n)
|
|
175
|
+
if (i.debug(
|
|
176
|
+
"Extracting node",
|
|
177
|
+
r,
|
|
178
|
+
d,
|
|
179
|
+
d.has(r) && !d.get(r).externalConnections,
|
|
180
|
+
!e.parent(r),
|
|
181
|
+
e.node(r),
|
|
182
|
+
e.children("D"),
|
|
183
|
+
" Depth ",
|
|
184
|
+
t
|
|
185
|
+
), !d.has(r))
|
|
186
|
+
i.debug("Not a cluster", r, t);
|
|
187
|
+
else if (!d.get(r).externalConnections && e.children(r) && e.children(r).length > 0) {
|
|
188
|
+
i.warn(
|
|
189
|
+
"Cluster without external connections, without a parent and with children",
|
|
190
|
+
r,
|
|
191
|
+
t
|
|
192
|
+
);
|
|
193
|
+
let l = e.graph().rankdir === "TB" ? "LR" : "TB";
|
|
194
|
+
d.get(r)?.clusterData?.dir && (l = d.get(r).clusterData.dir, i.warn("Fixing dir", d.get(r).clusterData.dir, l));
|
|
195
|
+
const u = new B({
|
|
196
|
+
multigraph: !0,
|
|
197
|
+
compound: !0
|
|
198
|
+
}).setGraph({
|
|
199
|
+
rankdir: l,
|
|
200
|
+
nodesep: 50,
|
|
201
|
+
ranksep: 50,
|
|
202
|
+
marginx: 8,
|
|
203
|
+
marginy: 8
|
|
204
|
+
}).setDefaultEdgeLabel(function() {
|
|
205
|
+
return {};
|
|
206
|
+
});
|
|
207
|
+
i.warn("Old graph before copy", h(e)), G(r, e, u, r), e.setNode(r, {
|
|
208
|
+
clusterNode: !0,
|
|
209
|
+
id: r,
|
|
210
|
+
clusterData: d.get(r).clusterData,
|
|
211
|
+
label: d.get(r).label,
|
|
212
|
+
graph: u
|
|
213
|
+
}), i.warn("New graph after copy node: (", r, ")", h(u)), i.debug("Old graph after copy", h(e));
|
|
214
|
+
} else
|
|
215
|
+
i.warn(
|
|
216
|
+
"Cluster ** ",
|
|
217
|
+
r,
|
|
218
|
+
" **not meeting the criteria !externalConnections:",
|
|
219
|
+
!d.get(r).externalConnections,
|
|
220
|
+
" no parent: ",
|
|
221
|
+
!e.parent(r),
|
|
222
|
+
" children ",
|
|
223
|
+
e.children(r) && e.children(r).length > 0,
|
|
224
|
+
e.children("D"),
|
|
225
|
+
t
|
|
226
|
+
), i.debug(d);
|
|
227
|
+
n = e.nodes(), i.warn("New list of nodes", n);
|
|
228
|
+
for (const r of n) {
|
|
229
|
+
const o = e.node(r);
|
|
230
|
+
i.warn(" Now next level", r, o), o?.clusterNode && T(o.graph, t + 1);
|
|
231
|
+
}
|
|
232
|
+
}, "extractor"), M = /* @__PURE__ */ w((e, t) => {
|
|
233
|
+
if (t.length === 0)
|
|
234
|
+
return [];
|
|
235
|
+
let n = Object.assign([], t);
|
|
236
|
+
return t.forEach((a) => {
|
|
237
|
+
const r = e.children(a), o = M(e, r);
|
|
238
|
+
n = [...n, ...o];
|
|
239
|
+
}), n;
|
|
240
|
+
}, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a, r, o) => {
|
|
241
|
+
i.warn("Graph in recursive render:XAX", h(t), r);
|
|
242
|
+
const l = t.graph().rankdir;
|
|
243
|
+
i.trace("Dir in recursive render - dir:", l);
|
|
244
|
+
const u = e.insert("g").attr("class", "root");
|
|
245
|
+
t.nodes() ? i.info("Recursive render XXX", t.nodes()) : i.info("No nodes found for", t), t.edges().length > 0 && i.info("Recursive edges", t.edge(t.edges()[0]));
|
|
246
|
+
const c = u.insert("g").attr("class", "clusters"), m = u.insert("g").attr("class", "edgePaths"), v = u.insert("g").attr("class", "edgeLabels"), X = u.insert("g").attr("class", "nodes");
|
|
247
|
+
await Promise.all(
|
|
248
|
+
t.nodes().map(async function(f) {
|
|
249
|
+
const s = t.node(f);
|
|
250
|
+
if (r !== void 0) {
|
|
251
|
+
const g = JSON.parse(JSON.stringify(r.clusterData));
|
|
252
|
+
i.trace(
|
|
253
|
+
`Setting data for parent cluster XXX
|
|
254
|
+
Node.id = `,
|
|
255
|
+
f,
|
|
256
|
+
`
|
|
257
|
+
data=`,
|
|
258
|
+
g.height,
|
|
259
|
+
`
|
|
260
|
+
Parent cluster`,
|
|
261
|
+
r.height
|
|
262
|
+
), t.setNode(r.id, g), t.parent(f) || (i.trace("Setting parent", f, r.id), t.setParent(f, r.id, g));
|
|
263
|
+
}
|
|
264
|
+
if (i.info("(Insert) Node XXX" + f + ": " + JSON.stringify(t.node(f))), s?.clusterNode) {
|
|
265
|
+
i.info("Cluster identified XBX", f, s.width, t.node(f));
|
|
266
|
+
const { ranksep: g, nodesep: E } = t.graph();
|
|
267
|
+
s.graph.setGraph({
|
|
268
|
+
...s.graph.graph(),
|
|
269
|
+
ranksep: g + 25,
|
|
270
|
+
nodesep: E
|
|
271
|
+
});
|
|
272
|
+
const N = await j(
|
|
273
|
+
X,
|
|
274
|
+
s.graph,
|
|
275
|
+
n,
|
|
276
|
+
a,
|
|
277
|
+
t.node(f),
|
|
278
|
+
o
|
|
279
|
+
), x = N.elem;
|
|
280
|
+
z(s, x), s.diff = N.diff || 0, i.info(
|
|
281
|
+
"New compound node after recursive render XAX",
|
|
282
|
+
f,
|
|
283
|
+
"width",
|
|
284
|
+
// node,
|
|
285
|
+
s.width,
|
|
286
|
+
"height",
|
|
287
|
+
s.height
|
|
288
|
+
// node.x,
|
|
289
|
+
// node.y
|
|
290
|
+
), U(x, s);
|
|
291
|
+
} else
|
|
292
|
+
t.children(f).length > 0 ? (i.trace(
|
|
293
|
+
"Cluster - the non recursive path XBX",
|
|
294
|
+
f,
|
|
295
|
+
s.id,
|
|
296
|
+
s,
|
|
297
|
+
s.width,
|
|
298
|
+
"Graph:",
|
|
299
|
+
t
|
|
300
|
+
), i.trace(C(s.id, t)), d.set(s.id, { id: C(s.id, t), node: s })) : (i.trace("Node - the non recursive path XAX", f, X, t.node(f), l), await $(X, t.node(f), { config: o, dir: l }));
|
|
301
|
+
})
|
|
302
|
+
), await (/* @__PURE__ */ w(async () => {
|
|
303
|
+
const f = t.edges().map(async function(s) {
|
|
304
|
+
const g = t.edge(s.v, s.w, s.name);
|
|
305
|
+
i.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), i.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), i.info(
|
|
306
|
+
"Fix",
|
|
307
|
+
d,
|
|
308
|
+
"ids:",
|
|
309
|
+
s.v,
|
|
310
|
+
s.w,
|
|
311
|
+
"Translating: ",
|
|
312
|
+
d.get(s.v),
|
|
313
|
+
d.get(s.w)
|
|
314
|
+
), await Z(v, g);
|
|
315
|
+
});
|
|
316
|
+
await Promise.all(f);
|
|
317
|
+
}, "processEdges"))(), i.info("Graph before layout:", JSON.stringify(h(t))), i.info("############################################# XXX"), i.info("### Layout ### XXX"), i.info("############################################# XXX"), I(t), i.info("Graph after layout:", JSON.stringify(h(t)));
|
|
318
|
+
let O = 0, { subGraphTitleTotalMargin: S } = q(o);
|
|
319
|
+
return await Promise.all(
|
|
320
|
+
oe(t).map(async function(f) {
|
|
321
|
+
const s = t.node(f);
|
|
322
|
+
if (i.info(
|
|
323
|
+
"Position XBX => " + f + ": (" + s.x,
|
|
324
|
+
"," + s.y,
|
|
325
|
+
") width: ",
|
|
326
|
+
s.width,
|
|
327
|
+
" height: ",
|
|
328
|
+
s.height
|
|
329
|
+
), s?.clusterNode)
|
|
330
|
+
s.y += S, i.info(
|
|
331
|
+
"A tainted cluster node XBX1",
|
|
332
|
+
f,
|
|
333
|
+
s.id,
|
|
334
|
+
s.width,
|
|
335
|
+
s.height,
|
|
336
|
+
s.x,
|
|
337
|
+
s.y,
|
|
338
|
+
t.parent(f)
|
|
339
|
+
), d.get(s.id).node = s, P(s);
|
|
340
|
+
else if (t.children(f).length > 0) {
|
|
341
|
+
i.info(
|
|
342
|
+
"A pure cluster node XBX1",
|
|
343
|
+
f,
|
|
344
|
+
s.id,
|
|
345
|
+
s.x,
|
|
346
|
+
s.y,
|
|
347
|
+
s.width,
|
|
348
|
+
s.height,
|
|
349
|
+
t.parent(f)
|
|
350
|
+
), s.height += S, t.node(s.parentId);
|
|
351
|
+
const g = s?.padding / 2 || 0, E = s?.labelBBox?.height || 0, N = E - g || 0;
|
|
352
|
+
i.debug("OffsetY", N, "labelHeight", E, "halfPadding", g), await K(c, s), d.get(s.id).node = s;
|
|
353
|
+
} else {
|
|
354
|
+
const g = t.node(s.parentId);
|
|
355
|
+
s.y += S / 2, i.info(
|
|
356
|
+
"A regular node XBX1 - using the padding",
|
|
357
|
+
s.id,
|
|
358
|
+
"parent",
|
|
359
|
+
s.parentId,
|
|
360
|
+
s.width,
|
|
361
|
+
s.height,
|
|
362
|
+
s.x,
|
|
363
|
+
s.y,
|
|
364
|
+
"offsetY",
|
|
365
|
+
s.offsetY,
|
|
366
|
+
"parent",
|
|
367
|
+
g,
|
|
368
|
+
g?.offsetY,
|
|
369
|
+
s
|
|
370
|
+
), P(s);
|
|
371
|
+
}
|
|
372
|
+
})
|
|
373
|
+
), t.edges().forEach(function(f) {
|
|
374
|
+
const s = t.edge(f);
|
|
375
|
+
i.info("Edge " + f.v + " -> " + f.w + ": " + JSON.stringify(s), s), s.points.forEach((x) => x.y += S / 2);
|
|
376
|
+
const g = t.node(f.v);
|
|
377
|
+
var E = t.node(f.w);
|
|
378
|
+
const N = Q(m, s, d, n, g, E, a);
|
|
379
|
+
W(s, N);
|
|
380
|
+
}), t.nodes().forEach(function(f) {
|
|
381
|
+
const s = t.node(f);
|
|
382
|
+
i.info(f, s.type, s.diff), s.isGroup && (O = s.diff);
|
|
383
|
+
}), i.warn("Returning from recursive render XAX", u, O), { elem: u, diff: O };
|
|
384
|
+
}, "recursiveRender"), ge = /* @__PURE__ */ w(async (e, t) => {
|
|
385
|
+
const n = new B({
|
|
386
|
+
multigraph: !0,
|
|
387
|
+
compound: !0
|
|
388
|
+
}).setGraph({
|
|
389
|
+
rankdir: e.direction,
|
|
390
|
+
nodesep: e.config?.nodeSpacing || e.config?.flowchart?.nodeSpacing || e.nodeSpacing,
|
|
391
|
+
ranksep: e.config?.rankSpacing || e.config?.flowchart?.rankSpacing || e.rankSpacing,
|
|
392
|
+
marginx: 8,
|
|
393
|
+
marginy: 8
|
|
394
|
+
}).setDefaultEdgeLabel(function() {
|
|
395
|
+
return {};
|
|
396
|
+
}), a = t.select("g");
|
|
397
|
+
F(a, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((o) => {
|
|
398
|
+
n.setNode(o.id, { ...o }), o.parentId && n.setParent(o.id, o.parentId);
|
|
399
|
+
}), i.debug("Edges:", e.edges), e.edges.forEach((o) => {
|
|
400
|
+
if (o.start === o.end) {
|
|
401
|
+
const l = o.start, u = l + "---" + l + "---1", c = l + "---" + l + "---2", m = n.node(l);
|
|
402
|
+
n.setNode(u, {
|
|
403
|
+
domId: u,
|
|
404
|
+
id: u,
|
|
405
|
+
parentId: m.parentId,
|
|
406
|
+
labelStyle: "",
|
|
407
|
+
label: "",
|
|
408
|
+
padding: 0,
|
|
409
|
+
shape: "labelRect",
|
|
410
|
+
// shape: 'rect',
|
|
411
|
+
style: "",
|
|
412
|
+
width: 10,
|
|
413
|
+
height: 10
|
|
414
|
+
}), n.setParent(u, m.parentId), n.setNode(c, {
|
|
415
|
+
domId: c,
|
|
416
|
+
id: c,
|
|
417
|
+
parentId: m.parentId,
|
|
418
|
+
labelStyle: "",
|
|
419
|
+
padding: 0,
|
|
420
|
+
// shape: 'rect',
|
|
421
|
+
shape: "labelRect",
|
|
422
|
+
label: "",
|
|
423
|
+
style: "",
|
|
424
|
+
width: 10,
|
|
425
|
+
height: 10
|
|
426
|
+
}), n.setParent(c, m.parentId);
|
|
427
|
+
const v = structuredClone(o), X = structuredClone(o), p = structuredClone(o);
|
|
428
|
+
v.label = "", v.arrowTypeEnd = "none", v.id = l + "-cyclic-special-1", X.arrowTypeStart = "none", X.arrowTypeEnd = "none", X.id = l + "-cyclic-special-mid", p.label = "", m.isGroup && (v.fromCluster = l, p.toCluster = l), p.id = l + "-cyclic-special-2", p.arrowTypeStart = "none", n.setEdge(l, u, v, l + "-cyclic-special-0"), n.setEdge(u, c, X, l + "-cyclic-special-1"), n.setEdge(c, l, p, l + "-cyc<lic-special-2");
|
|
429
|
+
} else
|
|
430
|
+
n.setEdge(o.start, o.end, { ...o }, o.id);
|
|
431
|
+
}), i.warn("Graph at first:", JSON.stringify(h(n))), re(n), i.warn("Graph after XAX:", JSON.stringify(h(n)));
|
|
432
|
+
const r = V();
|
|
433
|
+
await j(
|
|
434
|
+
a,
|
|
435
|
+
n,
|
|
436
|
+
e.type,
|
|
437
|
+
e.diagramId,
|
|
438
|
+
void 0,
|
|
439
|
+
r
|
|
440
|
+
);
|
|
441
|
+
}, "render");
|
|
442
|
+
export {
|
|
443
|
+
ge as render
|
|
444
|
+
};
|
|
445
|
+
//# sourceMappingURL=dagre-6UL2VRFP-BhIQJjaK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dagre-6UL2VRFP-BhIQJjaK.js","sources":["../node_modules/dagre-d3-es/src/graphlib/json.js","../node_modules/mermaid/dist/chunks/mermaid.core/dagre-6UL2VRFP.mjs"],"sourcesContent":["import * as _ from 'lodash-es';\nimport { Graph } from './graph.js';\n\nexport { write, read };\n\nfunction write(g) {\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound(),\n },\n nodes: writeNodes(g),\n edges: writeEdges(g),\n };\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n return json;\n}\n\nfunction writeNodes(g) {\n return _.map(g.nodes(), function (v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n var node = { v: v };\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n return node;\n });\n}\n\nfunction writeEdges(g) {\n return _.map(g.edges(), function (e) {\n var edgeValue = g.edge(e);\n var edge = { v: e.v, w: e.w };\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n return edge;\n });\n}\n\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n _.each(json.nodes, function (entry) {\n g.setNode(entry.v, entry.value);\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n _.each(json.edges, function (entry) {\n g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n });\n return g;\n}\n","import {\n clear as clear2,\n insertEdge,\n insertEdgeLabel,\n markers_default,\n positionEdgeLabel\n} from \"./chunk-QXUST7PY.mjs\";\nimport \"./chunk-HN2XXSSU.mjs\";\nimport {\n clear,\n clear2 as clear3,\n insertCluster,\n insertNode,\n positionNode,\n setNodeElem,\n updateNodeBounds\n} from \"./chunk-JZLCHNYA.mjs\";\nimport {\n getSubGraphTitleMargins\n} from \"./chunk-CVBHYZKI.mjs\";\nimport \"./chunk-ATLVNIR6.mjs\";\nimport \"./chunk-JA3XYJ7Z.mjs\";\nimport \"./chunk-S3R3BYOJ.mjs\";\nimport {\n getConfig2 as getConfig\n} from \"./chunk-ABZYJK2D.mjs\";\nimport {\n __name,\n log\n} from \"./chunk-AGHRB4JF.mjs\";\n\n// src/rendering-util/layout-algorithms/dagre/index.js\nimport { layout as dagreLayout } from \"dagre-d3-es/src/dagre/index.js\";\nimport * as graphlibJson2 from \"dagre-d3-es/src/graphlib/json.js\";\nimport * as graphlib2 from \"dagre-d3-es/src/graphlib/index.js\";\n\n// src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js\nimport * as graphlib from \"dagre-d3-es/src/graphlib/index.js\";\nimport * as graphlibJson from \"dagre-d3-es/src/graphlib/json.js\";\nvar clusterDb = /* @__PURE__ */ new Map();\nvar descendants = /* @__PURE__ */ new Map();\nvar parents = /* @__PURE__ */ new Map();\nvar clear4 = /* @__PURE__ */ __name(() => {\n descendants.clear();\n parents.clear();\n clusterDb.clear();\n}, \"clear\");\nvar isDescendant = /* @__PURE__ */ __name((id, ancestorId) => {\n const ancestorDescendants = descendants.get(ancestorId) || [];\n log.trace(\"In isDescendant\", ancestorId, \" \", id, \" = \", ancestorDescendants.includes(id));\n return ancestorDescendants.includes(id);\n}, \"isDescendant\");\nvar edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => {\n const clusterDescendants = descendants.get(clusterId) || [];\n log.info(\"Descendants of \", clusterId, \" is \", clusterDescendants);\n log.info(\"Edge is \", edge);\n if (edge.v === clusterId || edge.w === clusterId) {\n return false;\n }\n if (!clusterDescendants) {\n log.debug(\"Tilt, \", clusterId, \",not in descendants\");\n return false;\n }\n return clusterDescendants.includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || clusterDescendants.includes(edge.w);\n}, \"edgeInCluster\");\nvar copy = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {\n log.warn(\n \"Copying children of \",\n clusterId,\n \"root\",\n rootId,\n \"data\",\n graph.node(clusterId),\n rootId\n );\n const nodes = graph.children(clusterId) || [];\n if (clusterId !== rootId) {\n nodes.push(clusterId);\n }\n log.warn(\"Copying (nodes) clusterId\", clusterId, \"nodes\", nodes);\n nodes.forEach((node) => {\n if (graph.children(node).length > 0) {\n copy(node, graph, newGraph, rootId);\n } else {\n const data = graph.node(node);\n log.info(\"cp \", node, \" to \", rootId, \" with parent \", clusterId);\n newGraph.setNode(node, data);\n if (rootId !== graph.parent(node)) {\n log.warn(\"Setting parent\", node, graph.parent(node));\n newGraph.setParent(node, graph.parent(node));\n }\n if (clusterId !== rootId && node !== clusterId) {\n log.debug(\"Setting parent\", node, clusterId);\n newGraph.setParent(node, clusterId);\n } else {\n log.info(\"In copy \", clusterId, \"root\", rootId, \"data\", graph.node(clusterId), rootId);\n log.debug(\n \"Not Setting parent for node=\",\n node,\n \"cluster!==rootId\",\n clusterId !== rootId,\n \"node!==clusterId\",\n node !== clusterId\n );\n }\n const edges = graph.edges(node);\n log.debug(\"Copying Edges\", edges);\n edges.forEach((edge) => {\n log.info(\"Edge\", edge);\n const data2 = graph.edge(edge.v, edge.w, edge.name);\n log.info(\"Edge data\", data2, rootId);\n try {\n if (edgeInCluster(edge, rootId)) {\n log.info(\"Copying as \", edge.v, edge.w, data2, edge.name);\n newGraph.setEdge(edge.v, edge.w, data2, edge.name);\n log.info(\"newGraph edges \", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n } else {\n log.info(\n \"Skipping copy of edge \",\n edge.v,\n \"-->\",\n edge.w,\n \" rootId: \",\n rootId,\n \" clusterId:\",\n clusterId\n );\n }\n } catch (e) {\n log.error(e);\n }\n });\n }\n log.debug(\"Removing node\", node);\n graph.removeNode(node);\n });\n}, \"copy\");\nvar extractDescendants = /* @__PURE__ */ __name((id, graph) => {\n const children = graph.children(id);\n let res = [...children];\n for (const child of children) {\n parents.set(child, id);\n res = [...res, ...extractDescendants(child, graph)];\n }\n return res;\n}, \"extractDescendants\");\nvar findCommonEdges = /* @__PURE__ */ __name((graph, id1, id2) => {\n const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1);\n const edges2 = graph.edges().filter((edge) => edge.v === id2 || edge.w === id2);\n const edges1Prim = edges1.map((edge) => {\n return { v: edge.v === id1 ? id2 : edge.v, w: edge.w === id1 ? id1 : edge.w };\n });\n const edges2Prim = edges2.map((edge) => {\n return { v: edge.v, w: edge.w };\n });\n const result = edges1Prim.filter((edgeIn1) => {\n return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w);\n });\n return result;\n}, \"findCommonEdges\");\nvar findNonClusterChild = /* @__PURE__ */ __name((id, graph, clusterId) => {\n const children = graph.children(id);\n log.trace(\"Searching children of id \", id, children);\n if (children.length < 1) {\n return id;\n }\n let reserve;\n for (const child of children) {\n const _id = findNonClusterChild(child, graph, clusterId);\n const commonEdges = findCommonEdges(graph, clusterId, _id);\n if (_id) {\n if (commonEdges.length > 0) {\n reserve = _id;\n } else {\n return _id;\n }\n }\n }\n return reserve;\n}, \"findNonClusterChild\");\nvar getAnchorId = /* @__PURE__ */ __name((id) => {\n if (!clusterDb.has(id)) {\n return id;\n }\n if (!clusterDb.get(id).externalConnections) {\n return id;\n }\n if (clusterDb.has(id)) {\n return clusterDb.get(id).id;\n }\n return id;\n}, \"getAnchorId\");\nvar adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {\n if (!graph || depth > 10) {\n log.debug(\"Opting out, no graph \");\n return;\n } else {\n log.debug(\"Opting in, graph \");\n }\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n if (children.length > 0) {\n log.warn(\n \"Cluster identified\",\n id,\n \" Replacement id in edges: \",\n findNonClusterChild(id, graph, id)\n );\n descendants.set(id, extractDescendants(id, graph));\n clusterDb.set(id, { id: findNonClusterChild(id, graph, id), clusterData: graph.node(id) });\n }\n });\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n const edges = graph.edges();\n if (children.length > 0) {\n log.debug(\"Cluster identified\", id, descendants);\n edges.forEach((edge) => {\n const d1 = isDescendant(edge.v, id);\n const d2 = isDescendant(edge.w, id);\n if (d1 ^ d2) {\n log.warn(\"Edge: \", edge, \" leaves cluster \", id);\n log.warn(\"Descendants of XXX \", id, \": \", descendants.get(id));\n clusterDb.get(id).externalConnections = true;\n }\n });\n } else {\n log.debug(\"Not a cluster \", id, descendants);\n }\n });\n for (let id of clusterDb.keys()) {\n const nonClusterChild = clusterDb.get(id).id;\n const parent = graph.parent(nonClusterChild);\n if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {\n clusterDb.get(id).id = parent;\n }\n }\n graph.edges().forEach(function(e) {\n const edge = graph.edge(e);\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(graph.edge(e)));\n let v = e.v;\n let w = e.w;\n log.warn(\n \"Fix XXX\",\n clusterDb,\n \"ids:\",\n e.v,\n e.w,\n \"Translating: \",\n clusterDb.get(e.v),\n \" --- \",\n clusterDb.get(e.w)\n );\n if (clusterDb.get(e.v) || clusterDb.get(e.w)) {\n log.warn(\"Fixing and trying - removing XXX\", e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n if (v !== e.v) {\n const parent = graph.parent(v);\n clusterDb.get(parent).externalConnections = true;\n edge.fromCluster = e.v;\n }\n if (w !== e.w) {\n const parent = graph.parent(w);\n clusterDb.get(parent).externalConnections = true;\n edge.toCluster = e.w;\n }\n log.warn(\"Fix Replacing with XXX\", v, w, e.name);\n graph.setEdge(v, w, edge, e.name);\n }\n });\n log.warn(\"Adjusted Graph\", graphlibJson.write(graph));\n extractor(graph, 0);\n log.trace(clusterDb);\n}, \"adjustClustersAndEdges\");\nvar extractor = /* @__PURE__ */ __name((graph, depth) => {\n log.warn(\"extractor - \", depth, graphlibJson.write(graph), graph.children(\"D\"));\n if (depth > 10) {\n log.error(\"Bailing out\");\n return;\n }\n let nodes = graph.nodes();\n let hasChildren = false;\n for (const node of nodes) {\n const children = graph.children(node);\n hasChildren = hasChildren || children.length > 0;\n }\n if (!hasChildren) {\n log.debug(\"Done, no node has children\", graph.nodes());\n return;\n }\n log.debug(\"Nodes = \", nodes, depth);\n for (const node of nodes) {\n log.debug(\n \"Extracting node\",\n node,\n clusterDb,\n clusterDb.has(node) && !clusterDb.get(node).externalConnections,\n !graph.parent(node),\n graph.node(node),\n graph.children(\"D\"),\n \" Depth \",\n depth\n );\n if (!clusterDb.has(node)) {\n log.debug(\"Not a cluster\", node, depth);\n } else if (!clusterDb.get(node).externalConnections && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\n \"Cluster without external connections, without a parent and with children\",\n node,\n depth\n );\n const graphSettings = graph.graph();\n let dir = graphSettings.rankdir === \"TB\" ? \"LR\" : \"TB\";\n if (clusterDb.get(node)?.clusterData?.dir) {\n dir = clusterDb.get(node).clusterData.dir;\n log.warn(\"Fixing dir\", clusterDb.get(node).clusterData.dir, dir);\n }\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n log.warn(\"Old graph before copy\", graphlibJson.write(graph));\n copy(node, graph, clusterGraph, node);\n graph.setNode(node, {\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.warn(\"New graph after copy node: (\", node, \")\", graphlibJson.write(clusterGraph));\n log.debug(\"Old graph after copy\", graphlibJson.write(graph));\n } else {\n log.warn(\n \"Cluster ** \",\n node,\n \" **not meeting the criteria !externalConnections:\",\n !clusterDb.get(node).externalConnections,\n \" no parent: \",\n !graph.parent(node),\n \" children \",\n graph.children(node) && graph.children(node).length > 0,\n graph.children(\"D\"),\n depth\n );\n log.debug(clusterDb);\n }\n }\n nodes = graph.nodes();\n log.warn(\"New list of nodes\", nodes);\n for (const node of nodes) {\n const data = graph.node(node);\n log.warn(\" Now next level\", node, data);\n if (data?.clusterNode) {\n extractor(data.graph, depth + 1);\n }\n }\n}, \"extractor\");\nvar sorter = /* @__PURE__ */ __name((graph, nodes) => {\n if (nodes.length === 0) {\n return [];\n }\n let result = Object.assign([], nodes);\n nodes.forEach((node) => {\n const children = graph.children(node);\n const sorted = sorter(graph, children);\n result = [...result, ...sorted];\n });\n return result;\n}, \"sorter\");\nvar sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), \"sortNodesByHierarchy\");\n\n// src/rendering-util/layout-algorithms/dagre/index.js\nvar recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id, parentCluster, siteConfig) => {\n log.warn(\"Graph in recursive render:XAX\", graphlibJson2.write(graph), parentCluster);\n const dir = graph.graph().rankdir;\n log.trace(\"Dir in recursive render - dir:\", dir);\n const elem = _elem.insert(\"g\").attr(\"class\", \"root\");\n if (!graph.nodes()) {\n log.info(\"No nodes found for\", graph);\n } else {\n log.info(\"Recursive render XXX\", graph.nodes());\n }\n if (graph.edges().length > 0) {\n log.info(\"Recursive edges\", graph.edge(graph.edges()[0]));\n }\n const clusters = elem.insert(\"g\").attr(\"class\", \"clusters\");\n const edgePaths = elem.insert(\"g\").attr(\"class\", \"edgePaths\");\n const edgeLabels = elem.insert(\"g\").attr(\"class\", \"edgeLabels\");\n const nodes = elem.insert(\"g\").attr(\"class\", \"nodes\");\n await Promise.all(\n graph.nodes().map(async function(v) {\n const node = graph.node(v);\n if (parentCluster !== void 0) {\n const data = JSON.parse(JSON.stringify(parentCluster.clusterData));\n log.trace(\n \"Setting data for parent cluster XXX\\n Node.id = \",\n v,\n \"\\n data=\",\n data.height,\n \"\\nParent cluster\",\n parentCluster.height\n );\n graph.setNode(parentCluster.id, data);\n if (!graph.parent(v)) {\n log.trace(\"Setting parent\", v, parentCluster.id);\n graph.setParent(v, parentCluster.id, data);\n }\n }\n log.info(\"(Insert) Node XXX\" + v + \": \" + JSON.stringify(graph.node(v)));\n if (node?.clusterNode) {\n log.info(\"Cluster identified XBX\", v, node.width, graph.node(v));\n const { ranksep, nodesep } = graph.graph();\n node.graph.setGraph({\n ...node.graph.graph(),\n ranksep: ranksep + 25,\n nodesep\n });\n const o = await recursiveRender(\n nodes,\n node.graph,\n diagramType,\n id,\n graph.node(v),\n siteConfig\n );\n const newEl = o.elem;\n updateNodeBounds(node, newEl);\n node.diff = o.diff || 0;\n log.info(\n \"New compound node after recursive render XAX\",\n v,\n \"width\",\n // node,\n node.width,\n \"height\",\n node.height\n // node.x,\n // node.y\n );\n setNodeElem(newEl, node);\n } else {\n if (graph.children(v).length > 0) {\n log.trace(\n \"Cluster - the non recursive path XBX\",\n v,\n node.id,\n node,\n node.width,\n \"Graph:\",\n graph\n );\n log.trace(findNonClusterChild(node.id, graph));\n clusterDb.set(node.id, { id: findNonClusterChild(node.id, graph), node });\n } else {\n log.trace(\"Node - the non recursive path XAX\", v, nodes, graph.node(v), dir);\n await insertNode(nodes, graph.node(v), { config: siteConfig, dir });\n }\n }\n })\n );\n const processEdges = /* @__PURE__ */ __name(async () => {\n const edgePromises = graph.edges().map(async function(e) {\n const edge = graph.edge(e.v, e.w, e.name);\n log.info(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n log.info(\"Edge \" + e.v + \" -> \" + e.w + \": \", e, \" \", JSON.stringify(graph.edge(e)));\n log.info(\n \"Fix\",\n clusterDb,\n \"ids:\",\n e.v,\n e.w,\n \"Translating: \",\n clusterDb.get(e.v),\n clusterDb.get(e.w)\n );\n await insertEdgeLabel(edgeLabels, edge);\n });\n await Promise.all(edgePromises);\n }, \"processEdges\");\n await processEdges();\n log.info(\"Graph before layout:\", JSON.stringify(graphlibJson2.write(graph)));\n log.info(\"############################################# XXX\");\n log.info(\"### Layout ### XXX\");\n log.info(\"############################################# XXX\");\n dagreLayout(graph);\n log.info(\"Graph after layout:\", JSON.stringify(graphlibJson2.write(graph)));\n let diff = 0;\n let { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig);\n await Promise.all(\n sortNodesByHierarchy(graph).map(async function(v) {\n const node = graph.node(v);\n log.info(\n \"Position XBX => \" + v + \": (\" + node.x,\n \",\" + node.y,\n \") width: \",\n node.width,\n \" height: \",\n node.height\n );\n if (node?.clusterNode) {\n node.y += subGraphTitleTotalMargin;\n log.info(\n \"A tainted cluster node XBX1\",\n v,\n node.id,\n node.width,\n node.height,\n node.x,\n node.y,\n graph.parent(v)\n );\n clusterDb.get(node.id).node = node;\n positionNode(node);\n } else {\n if (graph.children(v).length > 0) {\n log.info(\n \"A pure cluster node XBX1\",\n v,\n node.id,\n node.x,\n node.y,\n node.width,\n node.height,\n graph.parent(v)\n );\n node.height += subGraphTitleTotalMargin;\n graph.node(node.parentId);\n const halfPadding = node?.padding / 2 || 0;\n const labelHeight = node?.labelBBox?.height || 0;\n const offsetY = labelHeight - halfPadding || 0;\n log.debug(\"OffsetY\", offsetY, \"labelHeight\", labelHeight, \"halfPadding\", halfPadding);\n await insertCluster(clusters, node);\n clusterDb.get(node.id).node = node;\n } else {\n const parent = graph.node(node.parentId);\n node.y += subGraphTitleTotalMargin / 2;\n log.info(\n \"A regular node XBX1 - using the padding\",\n node.id,\n \"parent\",\n node.parentId,\n node.width,\n node.height,\n node.x,\n node.y,\n \"offsetY\",\n node.offsetY,\n \"parent\",\n parent,\n parent?.offsetY,\n node\n );\n positionNode(node);\n }\n }\n })\n );\n graph.edges().forEach(function(e) {\n const edge = graph.edge(e);\n log.info(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(edge), edge);\n edge.points.forEach((point) => point.y += subGraphTitleTotalMargin / 2);\n const startNode = graph.node(e.v);\n var endNode = graph.node(e.w);\n const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id);\n positionEdgeLabel(edge, paths);\n });\n graph.nodes().forEach(function(v) {\n const n = graph.node(v);\n log.info(v, n.type, n.diff);\n if (n.isGroup) {\n diff = n.diff;\n }\n });\n log.warn(\"Returning from recursive render XAX\", elem, diff);\n return { elem, diff };\n}, \"recursiveRender\");\nvar render = /* @__PURE__ */ __name(async (data4Layout, svg) => {\n const graph = new graphlib2.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: data4Layout.direction,\n nodesep: data4Layout.config?.nodeSpacing || data4Layout.config?.flowchart?.nodeSpacing || data4Layout.nodeSpacing,\n ranksep: data4Layout.config?.rankSpacing || data4Layout.config?.flowchart?.rankSpacing || data4Layout.rankSpacing,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n const element = svg.select(\"g\");\n markers_default(element, data4Layout.markers, data4Layout.type, data4Layout.diagramId);\n clear3();\n clear2();\n clear();\n clear4();\n data4Layout.nodes.forEach((node) => {\n graph.setNode(node.id, { ...node });\n if (node.parentId) {\n graph.setParent(node.id, node.parentId);\n }\n });\n log.debug(\"Edges:\", data4Layout.edges);\n data4Layout.edges.forEach((edge) => {\n if (edge.start === edge.end) {\n const nodeId = edge.start;\n const specialId1 = nodeId + \"---\" + nodeId + \"---1\";\n const specialId2 = nodeId + \"---\" + nodeId + \"---2\";\n const node = graph.node(nodeId);\n graph.setNode(specialId1, {\n domId: specialId1,\n id: specialId1,\n parentId: node.parentId,\n labelStyle: \"\",\n label: \"\",\n padding: 0,\n shape: \"labelRect\",\n // shape: 'rect',\n style: \"\",\n width: 10,\n height: 10\n });\n graph.setParent(specialId1, node.parentId);\n graph.setNode(specialId2, {\n domId: specialId2,\n id: specialId2,\n parentId: node.parentId,\n labelStyle: \"\",\n padding: 0,\n // shape: 'rect',\n shape: \"labelRect\",\n label: \"\",\n style: \"\",\n width: 10,\n height: 10\n });\n graph.setParent(specialId2, node.parentId);\n const edge1 = structuredClone(edge);\n const edgeMid = structuredClone(edge);\n const edge2 = structuredClone(edge);\n edge1.label = \"\";\n edge1.arrowTypeEnd = \"none\";\n edge1.id = nodeId + \"-cyclic-special-1\";\n edgeMid.arrowTypeStart = \"none\";\n edgeMid.arrowTypeEnd = \"none\";\n edgeMid.id = nodeId + \"-cyclic-special-mid\";\n edge2.label = \"\";\n if (node.isGroup) {\n edge1.fromCluster = nodeId;\n edge2.toCluster = nodeId;\n }\n edge2.id = nodeId + \"-cyclic-special-2\";\n edge2.arrowTypeStart = \"none\";\n graph.setEdge(nodeId, specialId1, edge1, nodeId + \"-cyclic-special-0\");\n graph.setEdge(specialId1, specialId2, edgeMid, nodeId + \"-cyclic-special-1\");\n graph.setEdge(specialId2, nodeId, edge2, nodeId + \"-cyc<lic-special-2\");\n } else {\n graph.setEdge(edge.start, edge.end, { ...edge }, edge.id);\n }\n });\n log.warn(\"Graph at first:\", JSON.stringify(graphlibJson2.write(graph)));\n adjustClustersAndEdges(graph);\n log.warn(\"Graph after XAX:\", JSON.stringify(graphlibJson2.write(graph)));\n const siteConfig = getConfig();\n await recursiveRender(\n element,\n graph,\n data4Layout.type,\n data4Layout.diagramId,\n void 0,\n siteConfig\n );\n}, \"render\");\nexport {\n render\n};\n"],"names":["write","g","json","writeNodes","writeEdges","_.isUndefined","_.clone","_.map","v","nodeValue","parent","node","e","edgeValue","edge","clusterDb","descendants","parents","clear4","__name","isDescendant","id","ancestorId","ancestorDescendants","log","edgeInCluster","clusterId","clusterDescendants","copy","graph","newGraph","rootId","nodes","data","edges","data2","extractDescendants","children","res","child","findCommonEdges","id1","id2","edges1","edges2","edges1Prim","edges2Prim","edgeIn1","findNonClusterChild","reserve","_id","commonEdges","getAnchorId","adjustClustersAndEdges","depth","d1","d2","nonClusterChild","w","graphlibJson.write","extractor","hasChildren","dir","clusterGraph","graphlib.Graph","sorter","result","sorted","sortNodesByHierarchy","recursiveRender","_elem","diagramType","parentCluster","siteConfig","graphlibJson2.write","elem","clusters","edgePaths","edgeLabels","ranksep","nodesep","o","newEl","updateNodeBounds","setNodeElem","insertNode","edgePromises","insertEdgeLabel","dagreLayout","diff","subGraphTitleTotalMargin","getSubGraphTitleMargins","positionNode","halfPadding","labelHeight","offsetY","insertCluster","point","startNode","endNode","paths","insertEdge","positionEdgeLabel","n","render","data4Layout","svg","graphlib2.Graph","element","markers_default","clear3","clear2","clear","nodeId","specialId1","specialId2","edge1","edgeMid","edge2","getConfig"],"mappings":";;;;;;AAKA,SAASA,EAAMC,GAAG;AAChB,MAAIC,IAAO;AAAA,IACT,SAAS;AAAA,MACP,UAAUD,EAAE,WAAU;AAAA,MACtB,YAAYA,EAAE,aAAY;AAAA,MAC1B,UAAUA,EAAE,WAAU;AAAA,IAC5B;AAAA,IACI,OAAOE,GAAWF,CAAC;AAAA,IACnB,OAAOG,GAAWH,CAAC;AAAA,EACvB;AACE,SAAKI,EAAcJ,EAAE,MAAK,CAAE,MAC1BC,EAAK,QAAQI,EAAQL,EAAE,MAAK,CAAE,IAEzBC;AACT;AAEA,SAASC,GAAWF,GAAG;AACrB,SAAOM,EAAMN,EAAE,MAAK,GAAI,SAAUO,GAAG;AACnC,QAAIC,IAAYR,EAAE,KAAKO,CAAC,GACpBE,IAAST,EAAE,OAAOO,CAAC,GACnBG,IAAO,EAAE,GAAGH,EAAC;AACjB,WAAKH,EAAcI,CAAS,MAC1BE,EAAK,QAAQF,IAEVJ,EAAcK,CAAM,MACvBC,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