bg-editor 0.0.2 → 0.0.4
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/_baseUniq-DlmMKNm6.js +473 -0
- package/dist/{arc-CNm23MW7.js → arc-sEnPjXGq.js} +1 -1
- package/dist/{architecture-U656AL7Q-Ww8rTIvv.js → architecture-U656AL7Q-CPkFywIH.js} +1 -1
- package/dist/{architectureDiagram-VXUJARFQ-DH2EEb-C.js → architectureDiagram-VXUJARFQ-OSzH5GM4.js} +3 -3
- package/dist/{blockDiagram-VD42YOAC-CPmwRP5b.js → blockDiagram-VD42YOAC-CEfQMAZF.js} +5 -5
- package/dist/{c4Diagram-YG6GDRKO-Jsc4hIGa.js → c4Diagram-YG6GDRKO-DrD1o0bF.js} +2 -2
- package/dist/{channel-BfuwZbo4.js → channel-DNawwE5r.js} +1 -1
- package/dist/{chunk-4BX2VUAB-4Zvho0Ds.js → chunk-4BX2VUAB-ApZvZj_H.js} +1 -1
- package/dist/{chunk-55IACEB6-BmOb908D.js → chunk-55IACEB6-DYxYeHe7.js} +1 -1
- package/dist/{chunk-B4BG7PRW-Dx9fTyv9.js → chunk-B4BG7PRW-D_Pl6xS7.js} +4 -4
- package/dist/{chunk-DI55MBZ5-Dwa8xe-f.js → chunk-DI55MBZ5-D8kT33qO.js} +3 -3
- package/dist/{chunk-FMBD7UC4-DBAEvnpB.js → chunk-FMBD7UC4-DpTCe04g.js} +1 -1
- package/dist/{chunk-QN33PNHL-BFK0rIbg.js → chunk-QN33PNHL-Z4BQIuxq.js} +1 -1
- package/dist/{chunk-QZHKN3VN-B5HHmgvT.js → chunk-QZHKN3VN-Cmhrs4io.js} +1 -1
- package/dist/{chunk-TZMSLE5B-CYLAjMP8.js → chunk-TZMSLE5B-BUPp2n-T.js} +1 -1
- package/dist/{classDiagram-v2-WZHVMYZB-CQOOlc6C.js → classDiagram-2ON5EDUG-DJl6LMGs.js} +2 -2
- package/dist/{classDiagram-2ON5EDUG-CQOOlc6C.js → classDiagram-v2-WZHVMYZB-DJl6LMGs.js} +2 -2
- package/dist/{clone-CF1B7msQ.js → clone-iCXWBcXq.js} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-DZx3YOg1.js → cose-bilkent-S5V4N54A-CnIbqqnS.js} +8 -8
- package/dist/{dagre-6UL2VRFP-sT9qv2gP.js → dagre-6UL2VRFP-3a93Ccgj.js} +116 -117
- package/dist/{defaultLocale-C44w2ZBZ.js → defaultLocale-DEnRyJdC.js} +3 -3
- package/dist/diagram-PSM6KHXK-hPQJhwjP.js +396 -0
- package/dist/{diagram-QEK2KX5R-g5F_w0er.js → diagram-QEK2KX5R-vTFC9KE_.js} +3 -3
- package/dist/{diagram-S2PKOQOG-CRelpUZk.js → diagram-S2PKOQOG-BdLipS0J.js} +3 -3
- package/dist/{erDiagram-Q2GNP2WA-CfWWAKsy.js → erDiagram-Q2GNP2WA-CCKMWiuO.js} +4 -4
- package/dist/{flowDiagram-NV44I4VS-DuCCJQ8z.js → flowDiagram-NV44I4VS-Dci2ZYE1.js} +5 -5
- package/dist/{ganttDiagram-LVOFAZNH-DKb9FhvV.js → ganttDiagram-LVOFAZNH-C1o-J89x.js} +2 -2
- package/dist/{gitGraph-F6HP7TQM-Cg_TcdDS.js → gitGraph-F6HP7TQM-CECU0RWB.js} +1 -1
- package/dist/{gitGraphDiagram-NY62KEGX-CjO_i2YA.js → gitGraphDiagram-NY62KEGX-D5fV34WX.js} +4 -4
- package/dist/graph-Bve-nWS5.js +382 -0
- package/dist/index-0M7iCg0y.js +164750 -0
- package/dist/{info-NVLQJR56-D-AxJYeF.js → info-NVLQJR56-Bqk59KfO.js} +1 -1
- package/dist/{infoDiagram-ER5ION4S-9EH9zF_4.js → infoDiagram-ER5ION4S-DJ6J2mgS.js} +2 -2
- package/dist/{journeyDiagram-XKPGCS4Q-BaCrHQBZ.js → journeyDiagram-XKPGCS4Q-TRwtnzXO.js} +4 -4
- package/dist/{kanban-definition-3W4ZIXB7-BK9PMHrf.js → kanban-definition-3W4ZIXB7-BC83cBPr.js} +2 -2
- package/dist/layout-CpvWZ0xd.js +1416 -0
- package/dist/{linear-edUYtIiO.js → linear-C88svcwx.js} +6 -6
- package/dist/{mermaid-parser.core-BMy5yPs4.js → mermaid-parser.core-DGRDGxqQ.js} +6707 -5486
- package/dist/min-Bgv4PVuI.js +39 -0
- package/dist/{mindmap-definition-VGOIOE7T-bSEDOEZl.js → mindmap-definition-VGOIOE7T-BYiyXN9v.js} +11 -11
- package/dist/{packet-BFZMPI3H-DHEklZAi.js → packet-BFZMPI3H-87WloAg0.js} +1 -1
- package/dist/{pie-7BOR55EZ-DDu5Qx9i.js → pie-7BOR55EZ-CWT2R5xc.js} +1 -1
- package/dist/{pieDiagram-ADFJNKIX-QEkPDMva.js → pieDiagram-ADFJNKIX-BCVT3x3r.js} +9 -9
- package/dist/{quadrantDiagram-AYHSOK5B-zvs9JNV-.js → quadrantDiagram-AYHSOK5B-BgYJ_lms.js} +2 -2
- package/dist/{radar-NHE76QYJ-DEeIs6w7.js → radar-NHE76QYJ-DI34pls7.js} +1 -1
- package/dist/{requirementDiagram-UZGBJVZJ-PLEQdkam.js → requirementDiagram-UZGBJVZJ-Bh4vxSq4.js} +3 -3
- package/dist/{sankeyDiagram-TZEHDZUN-B9FpEfLk.js → sankeyDiagram-TZEHDZUN-3rmpF6iD.js} +1 -1
- package/dist/{sequenceDiagram-WL72ISMW-ClWHIEm8.js → sequenceDiagram-WL72ISMW-DRPHhT6P.js} +3 -3
- package/dist/{stateDiagram-FKZM4ZOC-CSNc1r0e.js → stateDiagram-FKZM4ZOC-Bg5i_DMD.js} +4 -4
- package/dist/{stateDiagram-v2-4FDKWEC3-BbDtuFwM.js → stateDiagram-v2-4FDKWEC3-D1fxP-ej.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{timeline-definition-IT6M3QCI-Ddq-6bZx.js → timeline-definition-IT6M3QCI-CWHNY2JH.js} +2 -2
- package/dist/{treemap-KMMF4GRG-D3-cXS0o.js → treemap-KMMF4GRG-DL-NPl5s.js} +1 -1
- package/dist/umo-editor.js +1 -1
- package/dist/{xychartDiagram-PRI3JC2R-BpMDi10C.js → xychartDiagram-PRI3JC2R-C7tSOfMZ.js} +2 -2
- package/package.json +6 -1
- package/dist/_basePickBy-xii7lYdk.js +0 -152
- package/dist/_baseUniq-ltuhkD8D.js +0 -615
- package/dist/diagram-PSM6KHXK-CgyZu1Ty.js +0 -533
- package/dist/graph-IPeEmdRy.js +0 -248
- package/dist/index-DfWUTVm_.js +0 -122164
- package/dist/layout-C1dI-ZSJ.js +0 -1336
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { _ as w, ar as F, as as Y, at as _, au as H, l as
|
|
3
|
-
import { G as B } from "./graph-
|
|
4
|
-
import { l as I } from "./layout-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { m as A } from "./_basePickBy-xii7lYdk.js";
|
|
2
|
+
import { _ as w, ar as F, as as Y, at as _, au as H, l as i, c as V, av as z, aw as U, ag as $, al as q, ah as P, af as K, ax as Q, ay as W, az as Z } from "./index-0M7iCg0y.js";
|
|
3
|
+
import { i as b, G as B } from "./graph-Bve-nWS5.js";
|
|
4
|
+
import { l as I } from "./layout-CpvWZ0xd.js";
|
|
5
|
+
import { c as L } from "./clone-iCXWBcXq.js";
|
|
6
|
+
import { m as A } from "./min-Bgv4PVuI.js";
|
|
8
7
|
function h(e) {
|
|
9
8
|
var t = {
|
|
10
9
|
options: {
|
|
@@ -19,8 +18,8 @@ function h(e) {
|
|
|
19
18
|
}
|
|
20
19
|
function ee(e) {
|
|
21
20
|
return A(e.nodes(), function(t) {
|
|
22
|
-
var n = e.node(t), a = e.parent(t),
|
|
23
|
-
return b(n) || (
|
|
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;
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
function ne(e) {
|
|
@@ -29,16 +28,16 @@ function ne(e) {
|
|
|
29
28
|
return b(t.name) || (a.name = t.name), b(n) || (a.value = n), a;
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
|
-
var d = /* @__PURE__ */ new Map(),
|
|
33
|
-
|
|
31
|
+
var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ w(() => {
|
|
32
|
+
y.clear(), J.clear(), d.clear();
|
|
34
33
|
}, "clear"), D = /* @__PURE__ */ w((e, t) => {
|
|
35
|
-
const n =
|
|
36
|
-
return
|
|
34
|
+
const n = y.get(t) || [];
|
|
35
|
+
return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
|
|
37
36
|
}, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
|
|
38
|
-
const n =
|
|
39
|
-
return
|
|
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);
|
|
40
39
|
}, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
|
|
41
|
-
|
|
40
|
+
i.warn(
|
|
42
41
|
"Copying children of ",
|
|
43
42
|
e,
|
|
44
43
|
"root",
|
|
@@ -47,13 +46,13 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
47
46
|
t.node(e),
|
|
48
47
|
a
|
|
49
48
|
);
|
|
50
|
-
const
|
|
51
|
-
e !== a &&
|
|
49
|
+
const r = t.children(e) || [];
|
|
50
|
+
e !== a && r.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", r), r.forEach((o) => {
|
|
52
51
|
if (t.children(o).length > 0)
|
|
53
52
|
G(o, t, n, a);
|
|
54
53
|
else {
|
|
55
54
|
const l = t.node(o);
|
|
56
|
-
|
|
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(
|
|
57
56
|
"Not Setting parent for node=",
|
|
58
57
|
o,
|
|
59
58
|
"cluster!==rootId",
|
|
@@ -62,12 +61,12 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
62
61
|
o !== e
|
|
63
62
|
));
|
|
64
63
|
const u = t.edges(o);
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
i.debug("Copying Edges", u), u.forEach((c) => {
|
|
65
|
+
i.info("Edge", c);
|
|
67
66
|
const m = t.edge(c.v, c.w, c.name);
|
|
68
|
-
|
|
67
|
+
i.info("Edge data", m, a);
|
|
69
68
|
try {
|
|
70
|
-
se(c, a) ? (
|
|
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(
|
|
71
70
|
"Skipping copy of edge ",
|
|
72
71
|
c.v,
|
|
73
72
|
"-->",
|
|
@@ -78,64 +77,64 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
78
77
|
e
|
|
79
78
|
);
|
|
80
79
|
} catch (v) {
|
|
81
|
-
|
|
80
|
+
i.error(v);
|
|
82
81
|
}
|
|
83
82
|
});
|
|
84
83
|
}
|
|
85
|
-
|
|
84
|
+
i.debug("Removing node", o), t.removeNode(o);
|
|
86
85
|
});
|
|
87
86
|
}, "copy"), R = /* @__PURE__ */ w((e, t) => {
|
|
88
87
|
const n = t.children(e);
|
|
89
88
|
let a = [...n];
|
|
90
|
-
for (const
|
|
91
|
-
J.set(
|
|
89
|
+
for (const r of n)
|
|
90
|
+
J.set(r, e), a = [...a, ...R(r, t)];
|
|
92
91
|
return a;
|
|
93
|
-
}, "extractDescendants"),
|
|
94
|
-
const a = e.edges().filter((c) => c.v === t || c.w === t),
|
|
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 }));
|
|
95
94
|
return o.filter((c) => l.some((m) => c.v === m.v && c.w === m.w));
|
|
96
95
|
}, "findCommonEdges"), C = /* @__PURE__ */ w((e, t, n) => {
|
|
97
96
|
const a = t.children(e);
|
|
98
|
-
if (
|
|
97
|
+
if (i.trace("Searching children of id ", e, a), a.length < 1)
|
|
99
98
|
return e;
|
|
100
|
-
let
|
|
99
|
+
let r;
|
|
101
100
|
for (const o of a) {
|
|
102
|
-
const l = C(o, t, n), u =
|
|
101
|
+
const l = C(o, t, n), u = ie(t, n, l);
|
|
103
102
|
if (l)
|
|
104
103
|
if (u.length > 0)
|
|
105
|
-
|
|
104
|
+
r = l;
|
|
106
105
|
else
|
|
107
106
|
return l;
|
|
108
107
|
}
|
|
109
|
-
return
|
|
110
|
-
}, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"),
|
|
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) => {
|
|
111
110
|
if (!e || t > 10) {
|
|
112
|
-
|
|
111
|
+
i.debug("Opting out, no graph ");
|
|
113
112
|
return;
|
|
114
113
|
} else
|
|
115
|
-
|
|
114
|
+
i.debug("Opting in, graph ");
|
|
116
115
|
e.nodes().forEach(function(n) {
|
|
117
|
-
e.children(n).length > 0 && (
|
|
116
|
+
e.children(n).length > 0 && (i.warn(
|
|
118
117
|
"Cluster identified",
|
|
119
118
|
n,
|
|
120
119
|
" Replacement id in edges: ",
|
|
121
120
|
C(n, e, n)
|
|
122
|
-
),
|
|
121
|
+
), y.set(n, R(n, e)), d.set(n, { id: C(n, e, n), clusterData: e.node(n) }));
|
|
123
122
|
}), e.nodes().forEach(function(n) {
|
|
124
|
-
const a = e.children(n),
|
|
125
|
-
a.length > 0 ? (
|
|
123
|
+
const a = e.children(n), r = e.edges();
|
|
124
|
+
a.length > 0 ? (i.debug("Cluster identified", n, y), r.forEach((o) => {
|
|
126
125
|
const l = D(o.v, n), u = D(o.w, n);
|
|
127
|
-
l ^ u && (
|
|
128
|
-
})) :
|
|
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);
|
|
129
128
|
});
|
|
130
129
|
for (let n of d.keys()) {
|
|
131
|
-
const a = d.get(n).id,
|
|
132
|
-
|
|
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);
|
|
133
132
|
}
|
|
134
133
|
e.edges().forEach(function(n) {
|
|
135
134
|
const a = e.edge(n);
|
|
136
|
-
|
|
137
|
-
let
|
|
138
|
-
if (
|
|
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(
|
|
139
138
|
"Fix XXX",
|
|
140
139
|
d,
|
|
141
140
|
"ids:",
|
|
@@ -146,53 +145,53 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
146
145
|
" --- ",
|
|
147
146
|
d.get(n.w)
|
|
148
147
|
), d.get(n.v) || d.get(n.w)) {
|
|
149
|
-
if (
|
|
150
|
-
const l = e.parent(
|
|
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);
|
|
151
150
|
d.get(l).externalConnections = !0, a.fromCluster = n.v;
|
|
152
151
|
}
|
|
153
152
|
if (o !== n.w) {
|
|
154
153
|
const l = e.parent(o);
|
|
155
154
|
d.get(l).externalConnections = !0, a.toCluster = n.w;
|
|
156
155
|
}
|
|
157
|
-
|
|
156
|
+
i.warn("Fix Replacing with XXX", r, o, n.name), e.setEdge(r, o, a, n.name);
|
|
158
157
|
}
|
|
159
|
-
}),
|
|
158
|
+
}), i.warn("Adjusted Graph", h(e)), T(e, 0), i.trace(d);
|
|
160
159
|
}, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
|
|
161
|
-
if (
|
|
162
|
-
|
|
160
|
+
if (i.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
|
|
161
|
+
i.error("Bailing out");
|
|
163
162
|
return;
|
|
164
163
|
}
|
|
165
164
|
let n = e.nodes(), a = !1;
|
|
166
|
-
for (const
|
|
167
|
-
const o = e.children(
|
|
165
|
+
for (const r of n) {
|
|
166
|
+
const o = e.children(r);
|
|
168
167
|
a = a || o.length > 0;
|
|
169
168
|
}
|
|
170
169
|
if (!a) {
|
|
171
|
-
|
|
170
|
+
i.debug("Done, no node has children", e.nodes());
|
|
172
171
|
return;
|
|
173
172
|
}
|
|
174
|
-
|
|
175
|
-
for (const
|
|
176
|
-
if (
|
|
173
|
+
i.debug("Nodes = ", n, t);
|
|
174
|
+
for (const r of n)
|
|
175
|
+
if (i.debug(
|
|
177
176
|
"Extracting node",
|
|
178
|
-
|
|
177
|
+
r,
|
|
179
178
|
d,
|
|
180
|
-
d.has(
|
|
181
|
-
!e.parent(
|
|
182
|
-
e.node(
|
|
179
|
+
d.has(r) && !d.get(r).externalConnections,
|
|
180
|
+
!e.parent(r),
|
|
181
|
+
e.node(r),
|
|
183
182
|
e.children("D"),
|
|
184
183
|
" Depth ",
|
|
185
184
|
t
|
|
186
|
-
), !d.has(
|
|
187
|
-
|
|
188
|
-
else if (!d.get(
|
|
189
|
-
|
|
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(
|
|
190
189
|
"Cluster without external connections, without a parent and with children",
|
|
191
|
-
|
|
190
|
+
r,
|
|
192
191
|
t
|
|
193
192
|
);
|
|
194
193
|
let l = e.graph().rankdir === "TB" ? "LR" : "TB";
|
|
195
|
-
d.get(
|
|
194
|
+
d.get(r)?.clusterData?.dir && (l = d.get(r).clusterData.dir, i.warn("Fixing dir", d.get(r).clusterData.dir, l));
|
|
196
195
|
const u = new B({
|
|
197
196
|
multigraph: !0,
|
|
198
197
|
compound: !0
|
|
@@ -205,52 +204,52 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
205
204
|
}).setDefaultEdgeLabel(function() {
|
|
206
205
|
return {};
|
|
207
206
|
});
|
|
208
|
-
|
|
207
|
+
i.warn("Old graph before copy", h(e)), G(r, e, u, r), e.setNode(r, {
|
|
209
208
|
clusterNode: !0,
|
|
210
|
-
id:
|
|
211
|
-
clusterData: d.get(
|
|
212
|
-
label: d.get(
|
|
209
|
+
id: r,
|
|
210
|
+
clusterData: d.get(r).clusterData,
|
|
211
|
+
label: d.get(r).label,
|
|
213
212
|
graph: u
|
|
214
|
-
}),
|
|
213
|
+
}), i.warn("New graph after copy node: (", r, ")", h(u)), i.debug("Old graph after copy", h(e));
|
|
215
214
|
} else
|
|
216
|
-
|
|
215
|
+
i.warn(
|
|
217
216
|
"Cluster ** ",
|
|
218
|
-
|
|
217
|
+
r,
|
|
219
218
|
" **not meeting the criteria !externalConnections:",
|
|
220
|
-
!d.get(
|
|
219
|
+
!d.get(r).externalConnections,
|
|
221
220
|
" no parent: ",
|
|
222
|
-
!e.parent(
|
|
221
|
+
!e.parent(r),
|
|
223
222
|
" children ",
|
|
224
|
-
e.children(
|
|
223
|
+
e.children(r) && e.children(r).length > 0,
|
|
225
224
|
e.children("D"),
|
|
226
225
|
t
|
|
227
|
-
),
|
|
228
|
-
n = e.nodes(),
|
|
229
|
-
for (const
|
|
230
|
-
const o = e.node(
|
|
231
|
-
|
|
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);
|
|
232
231
|
}
|
|
233
232
|
}, "extractor"), M = /* @__PURE__ */ w((e, t) => {
|
|
234
233
|
if (t.length === 0)
|
|
235
234
|
return [];
|
|
236
235
|
let n = Object.assign([], t);
|
|
237
236
|
return t.forEach((a) => {
|
|
238
|
-
const
|
|
237
|
+
const r = e.children(a), o = M(e, r);
|
|
239
238
|
n = [...n, ...o];
|
|
240
239
|
}), n;
|
|
241
|
-
}, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a,
|
|
242
|
-
|
|
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);
|
|
243
242
|
const l = t.graph().rankdir;
|
|
244
|
-
|
|
243
|
+
i.trace("Dir in recursive render - dir:", l);
|
|
245
244
|
const u = e.insert("g").attr("class", "root");
|
|
246
|
-
t.nodes() ?
|
|
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]));
|
|
247
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");
|
|
248
247
|
await Promise.all(
|
|
249
248
|
t.nodes().map(async function(f) {
|
|
250
249
|
const s = t.node(f);
|
|
251
|
-
if (
|
|
252
|
-
const g = JSON.parse(JSON.stringify(
|
|
253
|
-
|
|
250
|
+
if (r !== void 0) {
|
|
251
|
+
const g = JSON.parse(JSON.stringify(r.clusterData));
|
|
252
|
+
i.trace(
|
|
254
253
|
`Setting data for parent cluster XXX
|
|
255
254
|
Node.id = `,
|
|
256
255
|
f,
|
|
@@ -259,11 +258,11 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
259
258
|
g.height,
|
|
260
259
|
`
|
|
261
260
|
Parent cluster`,
|
|
262
|
-
|
|
263
|
-
), t.setNode(
|
|
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));
|
|
264
263
|
}
|
|
265
|
-
if (
|
|
266
|
-
|
|
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));
|
|
267
266
|
const { ranksep: g, nodesep: E } = t.graph();
|
|
268
267
|
s.graph.setGraph({
|
|
269
268
|
...s.graph.graph(),
|
|
@@ -278,7 +277,7 @@ Parent cluster`,
|
|
|
278
277
|
t.node(f),
|
|
279
278
|
o
|
|
280
279
|
), x = N.elem;
|
|
281
|
-
z(s, x), s.diff = N.diff || 0,
|
|
280
|
+
z(s, x), s.diff = N.diff || 0, i.info(
|
|
282
281
|
"New compound node after recursive render XAX",
|
|
283
282
|
f,
|
|
284
283
|
"width",
|
|
@@ -290,7 +289,7 @@ Parent cluster`,
|
|
|
290
289
|
// node.y
|
|
291
290
|
), U(x, s);
|
|
292
291
|
} else
|
|
293
|
-
t.children(f).length > 0 ? (
|
|
292
|
+
t.children(f).length > 0 ? (i.trace(
|
|
294
293
|
"Cluster - the non recursive path XBX",
|
|
295
294
|
f,
|
|
296
295
|
s.id,
|
|
@@ -298,12 +297,12 @@ Parent cluster`,
|
|
|
298
297
|
s.width,
|
|
299
298
|
"Graph:",
|
|
300
299
|
t
|
|
301
|
-
),
|
|
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 }));
|
|
302
301
|
})
|
|
303
302
|
), await (/* @__PURE__ */ w(async () => {
|
|
304
303
|
const f = t.edges().map(async function(s) {
|
|
305
304
|
const g = t.edge(s.v, s.w, s.name);
|
|
306
|
-
|
|
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(
|
|
307
306
|
"Fix",
|
|
308
307
|
d,
|
|
309
308
|
"ids:",
|
|
@@ -315,12 +314,12 @@ Parent cluster`,
|
|
|
315
314
|
), await Z(v, g);
|
|
316
315
|
});
|
|
317
316
|
await Promise.all(f);
|
|
318
|
-
}, "processEdges"))(),
|
|
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)));
|
|
319
318
|
let O = 0, { subGraphTitleTotalMargin: S } = q(o);
|
|
320
319
|
return await Promise.all(
|
|
321
320
|
oe(t).map(async function(f) {
|
|
322
321
|
const s = t.node(f);
|
|
323
|
-
if (
|
|
322
|
+
if (i.info(
|
|
324
323
|
"Position XBX => " + f + ": (" + s.x,
|
|
325
324
|
"," + s.y,
|
|
326
325
|
") width: ",
|
|
@@ -328,7 +327,7 @@ Parent cluster`,
|
|
|
328
327
|
" height: ",
|
|
329
328
|
s.height
|
|
330
329
|
), s?.clusterNode)
|
|
331
|
-
s.y += S,
|
|
330
|
+
s.y += S, i.info(
|
|
332
331
|
"A tainted cluster node XBX1",
|
|
333
332
|
f,
|
|
334
333
|
s.id,
|
|
@@ -339,7 +338,7 @@ Parent cluster`,
|
|
|
339
338
|
t.parent(f)
|
|
340
339
|
), d.get(s.id).node = s, P(s);
|
|
341
340
|
else if (t.children(f).length > 0) {
|
|
342
|
-
|
|
341
|
+
i.info(
|
|
343
342
|
"A pure cluster node XBX1",
|
|
344
343
|
f,
|
|
345
344
|
s.id,
|
|
@@ -350,10 +349,10 @@ Parent cluster`,
|
|
|
350
349
|
t.parent(f)
|
|
351
350
|
), s.height += S, t.node(s.parentId);
|
|
352
351
|
const g = s?.padding / 2 || 0, E = s?.labelBBox?.height || 0, N = E - g || 0;
|
|
353
|
-
|
|
352
|
+
i.debug("OffsetY", N, "labelHeight", E, "halfPadding", g), await K(c, s), d.get(s.id).node = s;
|
|
354
353
|
} else {
|
|
355
354
|
const g = t.node(s.parentId);
|
|
356
|
-
s.y += S / 2,
|
|
355
|
+
s.y += S / 2, i.info(
|
|
357
356
|
"A regular node XBX1 - using the padding",
|
|
358
357
|
s.id,
|
|
359
358
|
"parent",
|
|
@@ -373,16 +372,16 @@ Parent cluster`,
|
|
|
373
372
|
})
|
|
374
373
|
), t.edges().forEach(function(f) {
|
|
375
374
|
const s = t.edge(f);
|
|
376
|
-
|
|
375
|
+
i.info("Edge " + f.v + " -> " + f.w + ": " + JSON.stringify(s), s), s.points.forEach((x) => x.y += S / 2);
|
|
377
376
|
const g = t.node(f.v);
|
|
378
377
|
var E = t.node(f.w);
|
|
379
378
|
const N = Q(m, s, d, n, g, E, a);
|
|
380
379
|
W(s, N);
|
|
381
380
|
}), t.nodes().forEach(function(f) {
|
|
382
381
|
const s = t.node(f);
|
|
383
|
-
|
|
384
|
-
}),
|
|
385
|
-
}, "recursiveRender"),
|
|
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) => {
|
|
386
385
|
const n = new B({
|
|
387
386
|
multigraph: !0,
|
|
388
387
|
compound: !0
|
|
@@ -397,7 +396,7 @@ Parent cluster`,
|
|
|
397
396
|
}), a = t.select("g");
|
|
398
397
|
F(a, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((o) => {
|
|
399
398
|
n.setNode(o.id, { ...o }), o.parentId && n.setParent(o.id, o.parentId);
|
|
400
|
-
}),
|
|
399
|
+
}), i.debug("Edges:", e.edges), e.edges.forEach((o) => {
|
|
401
400
|
if (o.start === o.end) {
|
|
402
401
|
const l = o.start, u = l + "---" + l + "---1", c = l + "---" + l + "---2", m = n.node(l);
|
|
403
402
|
n.setNode(u, {
|
|
@@ -425,21 +424,21 @@ Parent cluster`,
|
|
|
425
424
|
width: 10,
|
|
426
425
|
height: 10
|
|
427
426
|
}), n.setParent(c, m.parentId);
|
|
428
|
-
const v = structuredClone(o), X = structuredClone(o),
|
|
429
|
-
v.label = "", v.arrowTypeEnd = "none", v.id = l + "-cyclic-special-1", X.arrowTypeStart = "none", X.arrowTypeEnd = "none", X.id = l + "-cyclic-special-mid",
|
|
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");
|
|
430
429
|
} else
|
|
431
430
|
n.setEdge(o.start, o.end, { ...o }, o.id);
|
|
432
|
-
}),
|
|
433
|
-
const
|
|
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();
|
|
434
433
|
await j(
|
|
435
434
|
a,
|
|
436
435
|
n,
|
|
437
436
|
e.type,
|
|
438
437
|
e.diagramId,
|
|
439
438
|
void 0,
|
|
440
|
-
|
|
439
|
+
r
|
|
441
440
|
);
|
|
442
441
|
}, "render");
|
|
443
442
|
export {
|
|
444
|
-
|
|
443
|
+
ge as render
|
|
445
444
|
};
|