lowcoder-comps 0.0.20 → 0.0.22
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/029c585a.js +825 -0
- package/0f49842f.js +915 -0
- package/14c95def.js +2396 -0
- package/{5a7c40d7.js → 14de54b2.js} +7120 -6939
- package/17b0984b.js +1116 -0
- package/{a1f987b7.js → 1a4b39ab.js} +29 -30
- package/1e35aee7.js +932 -0
- package/{804e952b.js → 1f97d569.js} +73 -76
- package/3120eee5.js +1235 -0
- package/313e94fb.js +796 -0
- package/{384b70d4.js → 41a4677f.js} +10 -12
- package/{e1466a22.js → 48a69d01.js} +89 -97
- package/4a8006fe.js +2501 -0
- package/{a06ced05.js → 585231df.js} +64 -71
- package/5e96f5d8.js +64 -0
- package/5f9be850.js +1055 -0
- package/{3196b84f.js → 6e0c66a6.js} +97 -109
- package/76d315c1.js +2192 -0
- package/{31c6e136.js → 867cdd47.js} +1 -1
- package/{0d5d7030.js → 8a65542f.js} +58 -64
- package/913e1a65.js +804 -0
- package/92e85b65.js +65 -0
- package/97298a99.js +2966 -0
- package/{5fd0f607.js → a396e61e.js} +44 -44
- package/a6d42292.js +1284 -0
- package/afd2e4d5.js +86 -0
- package/be5f3226.js +768 -0
- package/{4791bdd6.js → bf75928a.js} +30142 -30663
- package/{011ccb4a.js → bfd01456.js} +4257 -4221
- package/c239ec69.js +1000 -0
- package/e731f493.js +502 -0
- package/ef3524ce.js +960 -0
- package/f5b4a4bc.js +365 -0
- package/{8d714103.js → fa29410e.js} +598 -622
- package/fbc7bdd4.js +218 -0
- package/index.js +2 -2
- package/package.json +2 -2
- package/01102044.js +0 -940
- package/0e8dfd52.js +0 -793
- package/0f25771b.js +0 -1118
- package/2470e1d8.js +0 -91
- package/32432dc3.js +0 -86
- package/36552e14.js +0 -849
- package/3ad35722.js +0 -365
- package/3f4db197.js +0 -943
- package/71827e37.js +0 -1032
- package/7a200c6a.js +0 -607
- package/872f2918.js +0 -7
- package/93b98f3e.js +0 -832
- package/a42a2ba9.js +0 -2103
- package/af0489f3.js +0 -2456
- package/b56f953d.js +0 -985
- package/b89c6a6a.js +0 -159
- package/bc7030d3.js +0 -70
- package/c739ba3e.js +0 -2679
- package/d306d59c.js +0 -2827
- package/d8adcd1e.js +0 -823
- package/ef845d7f.js +0 -1246
package/f5b4a4bc.js
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
var E = (n, t, e) => new Promise((r, i) => {
|
|
2
|
+
var a = (f) => {
|
|
3
|
+
try {
|
|
4
|
+
l(e.next(f));
|
|
5
|
+
} catch (h) {
|
|
6
|
+
i(h);
|
|
7
|
+
}
|
|
8
|
+
}, u = (f) => {
|
|
9
|
+
try {
|
|
10
|
+
l(e.throw(f));
|
|
11
|
+
} catch (h) {
|
|
12
|
+
i(h);
|
|
13
|
+
}
|
|
14
|
+
}, l = (f) => f.done ? r(f.value) : Promise.resolve(f.value).then(a, u);
|
|
15
|
+
l((e = e.apply(n, t)).next());
|
|
16
|
+
});
|
|
17
|
+
import { b as j, i as m, m as L, G as A, l as M } from "./14c95def.js";
|
|
18
|
+
import { i as _, u as H, s as V, a as U, b as W, p as O, c as Y, d as q, e as z, f as K, g as T, h as B } from "./c239ec69.js";
|
|
19
|
+
import { l as s, p as S, c as X, h as J } from "./bf75928a.js";
|
|
20
|
+
import { a as Q } from "./97298a99.js";
|
|
21
|
+
var Z = 4;
|
|
22
|
+
function I(n) {
|
|
23
|
+
return j(n, Z);
|
|
24
|
+
}
|
|
25
|
+
function x(n) {
|
|
26
|
+
var t = {
|
|
27
|
+
options: {
|
|
28
|
+
directed: n.isDirected(),
|
|
29
|
+
multigraph: n.isMultigraph(),
|
|
30
|
+
compound: n.isCompound()
|
|
31
|
+
},
|
|
32
|
+
nodes: tt(n),
|
|
33
|
+
edges: et(n)
|
|
34
|
+
};
|
|
35
|
+
return m(n.graph()) || (t.value = I(n.graph())), t;
|
|
36
|
+
}
|
|
37
|
+
function tt(n) {
|
|
38
|
+
return L(n.nodes(), function(t) {
|
|
39
|
+
var e = n.node(t), r = n.parent(t), i = { v: t };
|
|
40
|
+
return m(e) || (i.value = e), m(r) || (i.parent = r), i;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function et(n) {
|
|
44
|
+
return L(n.edges(), function(t) {
|
|
45
|
+
var e = n.edge(t), r = { v: t.v, w: t.w };
|
|
46
|
+
return m(t.name) || (r.name = t.name), m(e) || (r.value = e), r;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
let d = {}, g = {}, R = {};
|
|
50
|
+
const nt = () => {
|
|
51
|
+
g = {}, R = {}, d = {};
|
|
52
|
+
}, C = (n, t) => (s.trace("In isDecendant", t, " ", n, " = ", g[t].includes(n)), !!g[t].includes(n)), it = (n, t) => (s.info("Decendants of ", t, " is ", g[t]), s.info("Edge is ", n), n.v === t || n.w === t ? !1 : g[t] ? g[t].includes(n.v) || C(n.v, t) || C(n.w, t) || g[t].includes(n.w) : (s.debug("Tilt, ", t, ",not in decendants"), !1)), p = (n, t, e, r) => {
|
|
53
|
+
s.warn(
|
|
54
|
+
"Copying children of ",
|
|
55
|
+
n,
|
|
56
|
+
"root",
|
|
57
|
+
r,
|
|
58
|
+
"data",
|
|
59
|
+
t.node(n),
|
|
60
|
+
r
|
|
61
|
+
);
|
|
62
|
+
const i = t.children(n) || [];
|
|
63
|
+
n !== r && i.push(n), s.warn("Copying (nodes) clusterId", n, "nodes", i), i.forEach((a) => {
|
|
64
|
+
if (t.children(a).length > 0)
|
|
65
|
+
p(a, t, e, r);
|
|
66
|
+
else {
|
|
67
|
+
const u = t.node(a);
|
|
68
|
+
s.info("cp ", a, " to ", r, " with parent ", n), e.setNode(a, u), r !== t.parent(a) && (s.warn("Setting parent", a, t.parent(a)), e.setParent(a, t.parent(a))), n !== r && a !== n ? (s.debug("Setting parent", a, n), e.setParent(a, n)) : (s.info("In copy ", n, "root", r, "data", t.node(n), r), s.debug(
|
|
69
|
+
"Not Setting parent for node=",
|
|
70
|
+
a,
|
|
71
|
+
"cluster!==rootId",
|
|
72
|
+
n !== r,
|
|
73
|
+
"node!==clusterId",
|
|
74
|
+
a !== n
|
|
75
|
+
));
|
|
76
|
+
const l = t.edges(a);
|
|
77
|
+
s.debug("Copying Edges", l), l.forEach((f) => {
|
|
78
|
+
s.info("Edge", f);
|
|
79
|
+
const h = t.edge(f.v, f.w, f.name);
|
|
80
|
+
s.info("Edge data", h, r);
|
|
81
|
+
try {
|
|
82
|
+
it(f, r) ? (s.info("Copying as ", f.v, f.w, h, f.name), e.setEdge(f.v, f.w, h, f.name), s.info("newGraph edges ", e.edges(), e.edge(e.edges()[0]))) : s.info(
|
|
83
|
+
"Skipping copy of edge ",
|
|
84
|
+
f.v,
|
|
85
|
+
"-->",
|
|
86
|
+
f.w,
|
|
87
|
+
" rootId: ",
|
|
88
|
+
r,
|
|
89
|
+
" clusterId:",
|
|
90
|
+
n
|
|
91
|
+
);
|
|
92
|
+
} catch (w) {
|
|
93
|
+
s.error(w);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
s.debug("Removing node", a), t.removeNode(a);
|
|
98
|
+
});
|
|
99
|
+
}, P = (n, t) => {
|
|
100
|
+
const e = t.children(n);
|
|
101
|
+
let r = [...e];
|
|
102
|
+
for (const i of e)
|
|
103
|
+
R[i] = n, r = [...r, ...P(i, t)];
|
|
104
|
+
return r;
|
|
105
|
+
}, b = (n, t) => {
|
|
106
|
+
s.trace("Searching", n);
|
|
107
|
+
const e = t.children(n);
|
|
108
|
+
if (s.trace("Searching children of id ", n, e), e.length < 1)
|
|
109
|
+
return s.trace("This is a valid node", n), n;
|
|
110
|
+
for (const r of e) {
|
|
111
|
+
const i = b(r, t);
|
|
112
|
+
if (i)
|
|
113
|
+
return s.trace("Found replacement for", n, " => ", i), i;
|
|
114
|
+
}
|
|
115
|
+
}, N = (n) => !d[n] || !d[n].externalConnections ? n : d[n] ? d[n].id : n, st = (n, t) => {
|
|
116
|
+
if (!n || t > 10) {
|
|
117
|
+
s.debug("Opting out, no graph ");
|
|
118
|
+
return;
|
|
119
|
+
} else
|
|
120
|
+
s.debug("Opting in, graph ");
|
|
121
|
+
n.nodes().forEach(function(e) {
|
|
122
|
+
n.children(e).length > 0 && (s.warn(
|
|
123
|
+
"Cluster identified",
|
|
124
|
+
e,
|
|
125
|
+
" Replacement id in edges: ",
|
|
126
|
+
b(e, n)
|
|
127
|
+
), g[e] = P(e, n), d[e] = { id: b(e, n), clusterData: n.node(e) });
|
|
128
|
+
}), n.nodes().forEach(function(e) {
|
|
129
|
+
const r = n.children(e), i = n.edges();
|
|
130
|
+
r.length > 0 ? (s.debug("Cluster identified", e, g), i.forEach((a) => {
|
|
131
|
+
if (a.v !== e && a.w !== e) {
|
|
132
|
+
const u = C(a.v, e), l = C(a.w, e);
|
|
133
|
+
u ^ l && (s.warn("Edge: ", a, " leaves cluster ", e), s.warn("Decendants of XXX ", e, ": ", g[e]), d[e].externalConnections = !0);
|
|
134
|
+
}
|
|
135
|
+
})) : s.debug("Not a cluster ", e, g);
|
|
136
|
+
}), n.edges().forEach(function(e) {
|
|
137
|
+
const r = n.edge(e);
|
|
138
|
+
s.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)), s.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(n.edge(e)));
|
|
139
|
+
let i = e.v, a = e.w;
|
|
140
|
+
if (s.warn(
|
|
141
|
+
"Fix XXX",
|
|
142
|
+
d,
|
|
143
|
+
"ids:",
|
|
144
|
+
e.v,
|
|
145
|
+
e.w,
|
|
146
|
+
"Translating: ",
|
|
147
|
+
d[e.v],
|
|
148
|
+
" --- ",
|
|
149
|
+
d[e.w]
|
|
150
|
+
), d[e.v] && d[e.w] && d[e.v] === d[e.w]) {
|
|
151
|
+
s.warn("Fixing and trixing link to self - removing XXX", e.v, e.w, e.name), s.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name), i = N(e.v), a = N(e.w), n.removeEdge(e.v, e.w, e.name);
|
|
152
|
+
const u = e.w + "---" + e.v;
|
|
153
|
+
n.setNode(u, {
|
|
154
|
+
domId: u,
|
|
155
|
+
id: u,
|
|
156
|
+
labelStyle: "",
|
|
157
|
+
labelText: r.label,
|
|
158
|
+
padding: 0,
|
|
159
|
+
shape: "labelRect",
|
|
160
|
+
style: ""
|
|
161
|
+
});
|
|
162
|
+
const l = structuredClone(r), f = structuredClone(r);
|
|
163
|
+
l.label = "", l.arrowTypeEnd = "none", f.label = "", l.fromCluster = e.v, f.toCluster = e.v, n.setEdge(i, u, l, e.name + "-cyclic-special"), n.setEdge(u, a, f, e.name + "-cyclic-special");
|
|
164
|
+
} else
|
|
165
|
+
(d[e.v] || d[e.w]) && (s.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name), i = N(e.v), a = N(e.w), n.removeEdge(e.v, e.w, e.name), i !== e.v && (r.fromCluster = e.v), a !== e.w && (r.toCluster = e.w), s.warn("Fix Replacing with XXX", i, a, e.name), n.setEdge(i, a, r, e.name));
|
|
166
|
+
}), s.warn("Adjusted Graph", x(n)), F(n, 0), s.trace(d);
|
|
167
|
+
}, F = (n, t) => {
|
|
168
|
+
if (s.warn("extractor - ", t, x(n), n.children("D")), t > 10) {
|
|
169
|
+
s.error("Bailing out");
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
let e = n.nodes(), r = !1;
|
|
173
|
+
for (const i of e) {
|
|
174
|
+
const a = n.children(i);
|
|
175
|
+
r = r || a.length > 0;
|
|
176
|
+
}
|
|
177
|
+
if (!r) {
|
|
178
|
+
s.debug("Done, no node has children", n.nodes());
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
s.debug("Nodes = ", e, t);
|
|
182
|
+
for (const i of e)
|
|
183
|
+
if (s.debug(
|
|
184
|
+
"Extracting node",
|
|
185
|
+
i,
|
|
186
|
+
d,
|
|
187
|
+
d[i] && !d[i].externalConnections,
|
|
188
|
+
!n.parent(i),
|
|
189
|
+
n.node(i),
|
|
190
|
+
n.children("D"),
|
|
191
|
+
" Depth ",
|
|
192
|
+
t
|
|
193
|
+
), !d[i])
|
|
194
|
+
s.debug("Not a cluster", i, t);
|
|
195
|
+
else if (!d[i].externalConnections && // !graph.parent(node) &&
|
|
196
|
+
n.children(i) && n.children(i).length > 0) {
|
|
197
|
+
s.warn(
|
|
198
|
+
"Cluster without external connections, without a parent and with children",
|
|
199
|
+
i,
|
|
200
|
+
t
|
|
201
|
+
);
|
|
202
|
+
let u = n.graph().rankdir === "TB" ? "LR" : "TB";
|
|
203
|
+
d[i] && d[i].clusterData && d[i].clusterData.dir && (u = d[i].clusterData.dir, s.warn("Fixing dir", d[i].clusterData.dir, u));
|
|
204
|
+
const l = new A({
|
|
205
|
+
multigraph: !0,
|
|
206
|
+
compound: !0
|
|
207
|
+
}).setGraph({
|
|
208
|
+
rankdir: u,
|
|
209
|
+
// Todo: set proper spacing
|
|
210
|
+
nodesep: 50,
|
|
211
|
+
ranksep: 50,
|
|
212
|
+
marginx: 8,
|
|
213
|
+
marginy: 8
|
|
214
|
+
}).setDefaultEdgeLabel(function() {
|
|
215
|
+
return {};
|
|
216
|
+
});
|
|
217
|
+
s.warn("Old graph before copy", x(n)), p(i, n, l, i), n.setNode(i, {
|
|
218
|
+
clusterNode: !0,
|
|
219
|
+
id: i,
|
|
220
|
+
clusterData: d[i].clusterData,
|
|
221
|
+
labelText: d[i].labelText,
|
|
222
|
+
graph: l
|
|
223
|
+
}), s.warn("New graph after copy node: (", i, ")", x(l)), s.debug("Old graph after copy", x(n));
|
|
224
|
+
} else
|
|
225
|
+
s.warn(
|
|
226
|
+
"Cluster ** ",
|
|
227
|
+
i,
|
|
228
|
+
" **not meeting the criteria !externalConnections:",
|
|
229
|
+
!d[i].externalConnections,
|
|
230
|
+
" no parent: ",
|
|
231
|
+
!n.parent(i),
|
|
232
|
+
" children ",
|
|
233
|
+
n.children(i) && n.children(i).length > 0,
|
|
234
|
+
n.children("D"),
|
|
235
|
+
t
|
|
236
|
+
), s.debug(d);
|
|
237
|
+
e = n.nodes(), s.warn("New list of nodes", e);
|
|
238
|
+
for (const i of e) {
|
|
239
|
+
const a = n.node(i);
|
|
240
|
+
s.warn(" Now next level", i, a), a.clusterNode && F(a.graph, t + 1);
|
|
241
|
+
}
|
|
242
|
+
}, k = (n, t) => {
|
|
243
|
+
if (t.length === 0)
|
|
244
|
+
return [];
|
|
245
|
+
let e = Object.assign(t);
|
|
246
|
+
return t.forEach((r) => {
|
|
247
|
+
const i = n.children(r), a = k(n, i);
|
|
248
|
+
e = [...e, ...a];
|
|
249
|
+
}), e;
|
|
250
|
+
}, rt = (n) => k(n, n.children()), at = (n, t) => {
|
|
251
|
+
s.info("Creating subgraph rect for ", t.id, t);
|
|
252
|
+
const e = n.insert("g").attr("class", "cluster" + (t.class ? " " + t.class : "")).attr("id", t.id), r = e.insert("rect", ":first-child"), i = S(X().flowchart.htmlLabels), a = e.insert("g").attr("class", "cluster-label"), u = t.labelType === "markdown" ? Q(a, t.labelText, { style: t.labelStyle, useHtmlLabels: i }) : a.node().appendChild(T(t.labelText, t.labelStyle, void 0, !0));
|
|
253
|
+
let l = u.getBBox();
|
|
254
|
+
if (S(X().flowchart.htmlLabels)) {
|
|
255
|
+
const c = u.children[0], o = J(u);
|
|
256
|
+
l = c.getBoundingClientRect(), o.attr("width", l.width), o.attr("height", l.height);
|
|
257
|
+
}
|
|
258
|
+
const f = 0 * t.padding, h = f / 2, w = t.width <= l.width + f ? l.width + f : t.width;
|
|
259
|
+
t.width <= l.width + f ? t.diff = (l.width - t.width) / 2 - t.padding / 2 : t.diff = -t.padding / 2, s.trace("Data ", t, JSON.stringify(t)), r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - w / 2).attr("y", t.y - t.height / 2 - h).attr("width", w).attr("height", t.height + f), i ? a.attr(
|
|
260
|
+
"transform",
|
|
261
|
+
// This puts the labal on top of the box instead of inside it
|
|
262
|
+
"translate(" + (t.x - l.width / 2) + ", " + (t.y - t.height / 2) + ")"
|
|
263
|
+
) : a.attr(
|
|
264
|
+
"transform",
|
|
265
|
+
// This puts the labal on top of the box instead of inside it
|
|
266
|
+
"translate(" + t.x + ", " + (t.y - t.height / 2) + ")"
|
|
267
|
+
);
|
|
268
|
+
const v = r.node().getBBox();
|
|
269
|
+
return t.width = v.width, t.height = v.height, t.intersect = function(c) {
|
|
270
|
+
return B(t, c);
|
|
271
|
+
}, e;
|
|
272
|
+
}, ct = (n, t) => {
|
|
273
|
+
const e = n.insert("g").attr("class", "note-cluster").attr("id", t.id), r = e.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
|
|
274
|
+
r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
|
|
275
|
+
const u = r.node().getBBox();
|
|
276
|
+
return t.width = u.width, t.height = u.height, t.intersect = function(l) {
|
|
277
|
+
return B(t, l);
|
|
278
|
+
}, e;
|
|
279
|
+
}, ot = (n, t) => {
|
|
280
|
+
const e = n.insert("g").attr("class", t.classes).attr("id", t.id), r = e.insert("rect", ":first-child"), i = e.insert("g").attr("class", "cluster-label"), a = e.append("rect"), u = i.node().appendChild(T(t.labelText, t.labelStyle, void 0, !0));
|
|
281
|
+
let l = u.getBBox();
|
|
282
|
+
if (S(X().flowchart.htmlLabels)) {
|
|
283
|
+
const c = u.children[0], o = J(u);
|
|
284
|
+
l = c.getBoundingClientRect(), o.attr("width", l.width), o.attr("height", l.height);
|
|
285
|
+
}
|
|
286
|
+
l = u.getBBox();
|
|
287
|
+
const f = 0 * t.padding, h = f / 2, w = t.width <= l.width + t.padding ? l.width + t.padding : t.width;
|
|
288
|
+
t.width <= l.width + t.padding ? t.diff = (l.width + t.padding * 0 - t.width) / 2 : t.diff = -t.padding / 2, r.attr("class", "outer").attr("x", t.x - w / 2 - h).attr("y", t.y - t.height / 2 - h).attr("width", w + f).attr("height", t.height + f), a.attr("class", "inner").attr("x", t.x - w / 2 - h).attr("y", t.y - t.height / 2 - h + l.height - 1).attr("width", w + f).attr("height", t.height + f - l.height - 3), i.attr(
|
|
289
|
+
"transform",
|
|
290
|
+
"translate(" + (t.x - l.width / 2) + ", " + (t.y - t.height / 2 - t.padding / 3 + (S(X().flowchart.htmlLabels) ? 5 : 3)) + ")"
|
|
291
|
+
);
|
|
292
|
+
const v = r.node().getBBox();
|
|
293
|
+
return t.height = v.height, t.intersect = function(c) {
|
|
294
|
+
return B(t, c);
|
|
295
|
+
}, e;
|
|
296
|
+
}, lt = (n, t) => {
|
|
297
|
+
const e = n.insert("g").attr("class", t.classes).attr("id", t.id), r = e.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
|
|
298
|
+
r.attr("class", "divider").attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2).attr("width", t.width + i).attr("height", t.height + i);
|
|
299
|
+
const u = r.node().getBBox();
|
|
300
|
+
return t.width = u.width, t.height = u.height, t.diff = -t.padding / 2, t.intersect = function(l) {
|
|
301
|
+
return B(t, l);
|
|
302
|
+
}, e;
|
|
303
|
+
}, ft = { rect: at, roundedWithTitle: ot, noteGroup: ct, divider: lt };
|
|
304
|
+
let $ = {};
|
|
305
|
+
const dt = (n, t) => {
|
|
306
|
+
s.trace("Inserting cluster");
|
|
307
|
+
const e = t.shape || "rect";
|
|
308
|
+
$[t.id] = ft[e](n, t);
|
|
309
|
+
}, ut = () => {
|
|
310
|
+
$ = {};
|
|
311
|
+
}, G = (n, t, e, r, i) => E(void 0, null, function* () {
|
|
312
|
+
s.info("Graph in recursive render: XXX", x(t), i);
|
|
313
|
+
const a = t.graph().rankdir;
|
|
314
|
+
s.trace("Dir in recursive render - dir:", a);
|
|
315
|
+
const u = n.insert("g").attr("class", "root");
|
|
316
|
+
t.nodes() ? s.info("Recursive render XXX", t.nodes()) : s.info("No nodes found for", t), t.edges().length > 0 && s.trace("Recursive edges", t.edge(t.edges()[0]));
|
|
317
|
+
const l = u.insert("g").attr("class", "clusters"), f = u.insert("g").attr("class", "edgePaths"), h = u.insert("g").attr("class", "edgeLabels"), w = u.insert("g").attr("class", "nodes");
|
|
318
|
+
yield Promise.all(
|
|
319
|
+
t.nodes().map(function(c) {
|
|
320
|
+
return E(this, null, function* () {
|
|
321
|
+
const o = t.node(c);
|
|
322
|
+
if (i !== void 0) {
|
|
323
|
+
const y = JSON.parse(JSON.stringify(i.clusterData));
|
|
324
|
+
s.info("Setting data for cluster XXX (", c, ") ", y, i), t.setNode(i.id, y), t.parent(c) || (s.trace("Setting parent", c, i.id), t.setParent(c, i.id, y));
|
|
325
|
+
}
|
|
326
|
+
if (s.info("(Insert) Node XXX" + c + ": " + JSON.stringify(t.node(c))), o && o.clusterNode) {
|
|
327
|
+
s.info("Cluster identified", c, o.width, t.node(c));
|
|
328
|
+
const y = yield G(w, o.graph, e, r, t.node(c)), D = y.elem;
|
|
329
|
+
H(o, D), o.diff = y.diff || 0, s.info("Node bounds (abc123)", c, o, o.width, o.x, o.y), V(D, o), s.warn("Recursive render complete ", D, o);
|
|
330
|
+
} else
|
|
331
|
+
t.children(c).length > 0 ? (s.info("Cluster - the non recursive path XXX", c, o.id, o, t), s.info(b(o.id, t)), d[o.id] = { id: b(o.id, t), node: o }) : (s.info("Node - the non recursive path", c, o.id, o), yield U(w, t.node(c), a));
|
|
332
|
+
});
|
|
333
|
+
})
|
|
334
|
+
), t.edges().forEach(function(c) {
|
|
335
|
+
const o = t.edge(c.v, c.w, c.name);
|
|
336
|
+
s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c)), s.info("Edge " + c.v + " -> " + c.w + ": ", c, " ", JSON.stringify(t.edge(c))), s.info("Fix", d, "ids:", c.v, c.w, "Translateing: ", d[c.v], d[c.w]), W(h, o);
|
|
337
|
+
}), t.edges().forEach(function(c) {
|
|
338
|
+
s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c));
|
|
339
|
+
}), s.info("#############################################"), s.info("### Layout ###"), s.info("#############################################"), s.info(t), M(t), s.info("Graph after layout:", x(t));
|
|
340
|
+
let v = 0;
|
|
341
|
+
return rt(t).forEach(function(c) {
|
|
342
|
+
const o = t.node(c);
|
|
343
|
+
s.info("Position " + c + ": " + JSON.stringify(t.node(c))), s.info(
|
|
344
|
+
"Position " + c + ": (" + o.x,
|
|
345
|
+
"," + o.y,
|
|
346
|
+
") width: ",
|
|
347
|
+
o.width,
|
|
348
|
+
" height: ",
|
|
349
|
+
o.height
|
|
350
|
+
), o && o.clusterNode ? O(o) : t.children(c).length > 0 ? (dt(l, o), d[o.id].node = o) : O(o);
|
|
351
|
+
}), t.edges().forEach(function(c) {
|
|
352
|
+
const o = t.edge(c);
|
|
353
|
+
s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(o), o);
|
|
354
|
+
const y = Y(f, c, o, d, e, t, r);
|
|
355
|
+
q(o, y);
|
|
356
|
+
}), t.nodes().forEach(function(c) {
|
|
357
|
+
const o = t.node(c);
|
|
358
|
+
s.info(c, o.type, o.diff), o.type === "group" && (v = o.diff);
|
|
359
|
+
}), { elem: u, diff: v };
|
|
360
|
+
}), vt = (n, t, e, r, i) => E(void 0, null, function* () {
|
|
361
|
+
_(n, e, r, i), z(), K(), ut(), nt(), s.warn("Graph at first:", JSON.stringify(x(t))), st(t), s.warn("Graph after:", JSON.stringify(x(t))), yield G(n, t, r, i);
|
|
362
|
+
});
|
|
363
|
+
export {
|
|
364
|
+
vt as r
|
|
365
|
+
};
|