lowcoder-comps 0.0.31 → 0.0.33
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/00bb478a.js +1102 -0
- package/02bef5a4.js +505 -0
- package/057d2a44.js +1127 -0
- package/0964fcc6.js +34 -0
- package/14220e98.js +1276 -0
- package/1c074fe4.js +25 -0
- package/250a6954.js +804 -0
- package/256b619e.js +92 -0
- package/2cd27cf0.js +2501 -0
- package/2f064957.js +64 -0
- package/2ff2c7a6.js +6 -0
- package/2ff7471d.js +9 -0
- package/30c4916b.js +8 -0
- package/36ec7270.js +915 -0
- package/38c14832.js +960 -0
- package/3ae34bed.js +819 -0
- package/3e2939fa.js +237 -0
- package/3f5f874f.js +86 -0
- package/3fb86fb9.js +447 -0
- package/415177f9.js +1579 -0
- package/47848c42.js +11636 -0
- package/4c6a0ece.js +162535 -0
- package/4db8e48b.js +2284 -0
- package/531065f1.js +1089 -0
- package/5a398ea8.js +881 -0
- package/5ab1614c.js +268 -0
- package/65bbb6ae.js +1536 -0
- package/777cd15c.js +48428 -0
- package/7dacfa82.js +220 -0
- package/800cf0d0.js +796 -0
- package/92e85b65.js +65 -0
- package/93e9bd3a.js +391 -0
- package/98622dfa.js +16582 -0
- package/a2e74e62.js +2967 -0
- package/a61c3bd3.js +5 -0
- package/b8f48ff4.js +769 -0
- package/bd0f5f65.js +319 -0
- package/bf4428f5.js +1269 -0
- package/cb1972f7.js +455 -0
- package/dfc10c94.js +818 -0
- package/ed2c9753.js +208 -0
- package/ef2833e6.js +927 -0
- package/f9637058.js +16 -0
- package/f9e72519.js +1284 -0
- package/fe063d15.js +19339 -0
- package/index.js +5 -0
- package/package.json +30 -3
- package/README.md +0 -120
- package/index.html +0 -26
- package/index.tsx +0 -21
- package/jest.config.js +0 -6
- package/src/__test__/allComp.test.tsx +0 -61
- package/src/app-env.d.ts +0 -3
- package/src/comps/calendarComp/calendarComp.tsx +0 -633
- package/src/comps/calendarComp/calendarConstants.tsx +0 -1048
- package/src/comps/calendarComp/errorBoundary.tsx +0 -30
- package/src/comps/chartComp/chartComp.tsx +0 -442
- package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +0 -51
- package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +0 -307
- package/src/comps/chartComp/chartConfigs/chartUrls.tsx +0 -9
- package/src/comps/chartComp/chartConfigs/legendConfig.tsx +0 -55
- package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +0 -96
- package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +0 -83
- package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +0 -62
- package/src/comps/chartComp/chartConstants.tsx +0 -299
- package/src/comps/chartComp/chartPropertyView.tsx +0 -235
- package/src/comps/chartComp/chartUtils.ts +0 -291
- package/src/comps/chartComp/reactEcharts/core.tsx +0 -194
- package/src/comps/chartComp/reactEcharts/index.ts +0 -21
- package/src/comps/chartComp/reactEcharts/types.ts +0 -76
- package/src/comps/chartComp/seriesComp.tsx +0 -119
- package/src/comps/imageEditorComp/imageEditorClass.tsx +0 -52
- package/src/comps/imageEditorComp/imageEditorConstants.tsx +0 -109
- package/src/comps/imageEditorComp/index.tsx +0 -184
- package/src/comps/mermaidComp/index.tsx +0 -44
- package/src/comps/mermaidComp/mermaid.tsx +0 -29
- package/src/global.ts +0 -1
- package/src/i18n/comps/index.tsx +0 -29
- package/src/i18n/comps/locales/en.ts +0 -163
- package/src/i18n/comps/locales/enObj.tsx +0 -198
- package/src/i18n/comps/locales/index.ts +0 -7
- package/src/i18n/comps/locales/types.tsx +0 -10
- package/src/i18n/comps/locales/zh.ts +0 -156
- package/src/i18n/comps/locales/zhObj.tsx +0 -4
- package/src/index.ts +0 -11
- package/tsconfig.json +0 -22
- package/vite.config.js +0 -10
package/92e85b65.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { i as a } from "./f9637058.js";
|
|
2
|
+
class o extends Map {
|
|
3
|
+
constructor(n, t = g) {
|
|
4
|
+
if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null)
|
|
5
|
+
for (const [r, s] of n)
|
|
6
|
+
this.set(r, s);
|
|
7
|
+
}
|
|
8
|
+
get(n) {
|
|
9
|
+
return super.get(c(this, n));
|
|
10
|
+
}
|
|
11
|
+
has(n) {
|
|
12
|
+
return super.has(c(this, n));
|
|
13
|
+
}
|
|
14
|
+
set(n, t) {
|
|
15
|
+
return super.set(l(this, n), t);
|
|
16
|
+
}
|
|
17
|
+
delete(n) {
|
|
18
|
+
return super.delete(p(this, n));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function c({ _intern: e, _key: n }, t) {
|
|
22
|
+
const r = n(t);
|
|
23
|
+
return e.has(r) ? e.get(r) : t;
|
|
24
|
+
}
|
|
25
|
+
function l({ _intern: e, _key: n }, t) {
|
|
26
|
+
const r = n(t);
|
|
27
|
+
return e.has(r) ? e.get(r) : (e.set(r, t), t);
|
|
28
|
+
}
|
|
29
|
+
function p({ _intern: e, _key: n }, t) {
|
|
30
|
+
const r = n(t);
|
|
31
|
+
return e.has(r) && (t = e.get(r), e.delete(r)), t;
|
|
32
|
+
}
|
|
33
|
+
function g(e) {
|
|
34
|
+
return e !== null && typeof e == "object" ? e.valueOf() : e;
|
|
35
|
+
}
|
|
36
|
+
const f = Symbol("implicit");
|
|
37
|
+
function h() {
|
|
38
|
+
var e = new o(), n = [], t = [], r = f;
|
|
39
|
+
function s(u) {
|
|
40
|
+
let i = e.get(u);
|
|
41
|
+
if (i === void 0) {
|
|
42
|
+
if (r !== f)
|
|
43
|
+
return r;
|
|
44
|
+
e.set(u, i = n.push(u) - 1);
|
|
45
|
+
}
|
|
46
|
+
return t[i % t.length];
|
|
47
|
+
}
|
|
48
|
+
return s.domain = function(u) {
|
|
49
|
+
if (!arguments.length)
|
|
50
|
+
return n.slice();
|
|
51
|
+
n = [], e = new o();
|
|
52
|
+
for (const i of u)
|
|
53
|
+
e.has(i) || e.set(i, n.push(i) - 1);
|
|
54
|
+
return s;
|
|
55
|
+
}, s.range = function(u) {
|
|
56
|
+
return arguments.length ? (t = Array.from(u), s) : t.slice();
|
|
57
|
+
}, s.unknown = function(u) {
|
|
58
|
+
return arguments.length ? (r = u, s) : r;
|
|
59
|
+
}, s.copy = function() {
|
|
60
|
+
return h(n, t).unknown(r);
|
|
61
|
+
}, a.apply(s, arguments), s;
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
h as o
|
|
65
|
+
};
|
package/93e9bd3a.js
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
var X = (n, t, e) => new Promise((r, i) => {
|
|
2
|
+
var a = (l) => {
|
|
3
|
+
try {
|
|
4
|
+
d(e.next(l));
|
|
5
|
+
} catch (h) {
|
|
6
|
+
i(h);
|
|
7
|
+
}
|
|
8
|
+
}, u = (l) => {
|
|
9
|
+
try {
|
|
10
|
+
d(e.throw(l));
|
|
11
|
+
} catch (h) {
|
|
12
|
+
i(h);
|
|
13
|
+
}
|
|
14
|
+
}, d = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(a, u);
|
|
15
|
+
d((e = e.apply(n, t)).next());
|
|
16
|
+
});
|
|
17
|
+
import { i as N, G as H } from "./5a398ea8.js";
|
|
18
|
+
import { m as J, l as V } from "./65bbb6ae.js";
|
|
19
|
+
import { c as U } from "./30c4916b.js";
|
|
20
|
+
import { i as W, u as _, s as q, a as z, b as K, g as T, p as $, c as Q, d as Y, e as Z, f as I, h as L, j as D } from "./00bb478a.js";
|
|
21
|
+
import { l as s, e as O, r as B, j as R } from "./4c6a0ece.js";
|
|
22
|
+
import { a as tt } from "./a2e74e62.js";
|
|
23
|
+
function m(n) {
|
|
24
|
+
var t = {
|
|
25
|
+
options: {
|
|
26
|
+
directed: n.isDirected(),
|
|
27
|
+
multigraph: n.isMultigraph(),
|
|
28
|
+
compound: n.isCompound()
|
|
29
|
+
},
|
|
30
|
+
nodes: et(n),
|
|
31
|
+
edges: nt(n)
|
|
32
|
+
};
|
|
33
|
+
return N(n.graph()) || (t.value = U(n.graph())), t;
|
|
34
|
+
}
|
|
35
|
+
function et(n) {
|
|
36
|
+
return J(n.nodes(), function(t) {
|
|
37
|
+
var e = n.node(t), r = n.parent(t), i = { v: t };
|
|
38
|
+
return N(e) || (i.value = e), N(r) || (i.parent = r), i;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function nt(n) {
|
|
42
|
+
return J(n.edges(), function(t) {
|
|
43
|
+
var e = n.edge(t), r = { v: t.v, w: t.w };
|
|
44
|
+
return N(t.name) || (r.name = t.name), N(e) || (r.value = e), r;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
let f = {}, g = {}, P = {};
|
|
48
|
+
const it = () => {
|
|
49
|
+
g = {}, P = {}, f = {};
|
|
50
|
+
}, p = (n, t) => (s.trace("In isDescendant", t, " ", n, " = ", g[t].includes(n)), !!g[t].includes(n)), st = (n, t) => (s.info("Descendants of ", t, " is ", g[t]), s.info("Edge is ", n), n.v === t || n.w === t ? !1 : g[t] ? g[t].includes(n.v) || p(n.v, t) || p(n.w, t) || g[t].includes(n.w) : (s.debug("Tilt, ", t, ",not in descendants"), !1)), k = (n, t, e, r) => {
|
|
51
|
+
s.warn(
|
|
52
|
+
"Copying children of ",
|
|
53
|
+
n,
|
|
54
|
+
"root",
|
|
55
|
+
r,
|
|
56
|
+
"data",
|
|
57
|
+
t.node(n),
|
|
58
|
+
r
|
|
59
|
+
);
|
|
60
|
+
const i = t.children(n) || [];
|
|
61
|
+
n !== r && i.push(n), s.warn("Copying (nodes) clusterId", n, "nodes", i), i.forEach((a) => {
|
|
62
|
+
if (t.children(a).length > 0)
|
|
63
|
+
k(a, t, e, r);
|
|
64
|
+
else {
|
|
65
|
+
const u = t.node(a);
|
|
66
|
+
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(
|
|
67
|
+
"Not Setting parent for node=",
|
|
68
|
+
a,
|
|
69
|
+
"cluster!==rootId",
|
|
70
|
+
n !== r,
|
|
71
|
+
"node!==clusterId",
|
|
72
|
+
a !== n
|
|
73
|
+
));
|
|
74
|
+
const d = t.edges(a);
|
|
75
|
+
s.debug("Copying Edges", d), d.forEach((l) => {
|
|
76
|
+
s.info("Edge", l);
|
|
77
|
+
const h = t.edge(l.v, l.w, l.name);
|
|
78
|
+
s.info("Edge data", h, r);
|
|
79
|
+
try {
|
|
80
|
+
st(l, r) ? (s.info("Copying as ", l.v, l.w, h, l.name), e.setEdge(l.v, l.w, h, l.name), s.info("newGraph edges ", e.edges(), e.edge(e.edges()[0]))) : s.info(
|
|
81
|
+
"Skipping copy of edge ",
|
|
82
|
+
l.v,
|
|
83
|
+
"-->",
|
|
84
|
+
l.w,
|
|
85
|
+
" rootId: ",
|
|
86
|
+
r,
|
|
87
|
+
" clusterId:",
|
|
88
|
+
n
|
|
89
|
+
);
|
|
90
|
+
} catch (w) {
|
|
91
|
+
s.error(w);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
s.debug("Removing node", a), t.removeNode(a);
|
|
96
|
+
});
|
|
97
|
+
}, F = (n, t) => {
|
|
98
|
+
const e = t.children(n);
|
|
99
|
+
let r = [...e];
|
|
100
|
+
for (const i of e)
|
|
101
|
+
P[i] = n, r = [...r, ...F(i, t)];
|
|
102
|
+
return r;
|
|
103
|
+
}, C = (n, t) => {
|
|
104
|
+
s.trace("Searching", n);
|
|
105
|
+
const e = t.children(n);
|
|
106
|
+
if (s.trace("Searching children of id ", n, e), e.length < 1)
|
|
107
|
+
return s.trace("This is a valid node", n), n;
|
|
108
|
+
for (const r of e) {
|
|
109
|
+
const i = C(r, t);
|
|
110
|
+
if (i)
|
|
111
|
+
return s.trace("Found replacement for", n, " => ", i), i;
|
|
112
|
+
}
|
|
113
|
+
}, S = (n) => !f[n] || !f[n].externalConnections ? n : f[n] ? f[n].id : n, rt = (n, t) => {
|
|
114
|
+
if (!n || t > 10) {
|
|
115
|
+
s.debug("Opting out, no graph ");
|
|
116
|
+
return;
|
|
117
|
+
} else
|
|
118
|
+
s.debug("Opting in, graph ");
|
|
119
|
+
n.nodes().forEach(function(e) {
|
|
120
|
+
n.children(e).length > 0 && (s.warn(
|
|
121
|
+
"Cluster identified",
|
|
122
|
+
e,
|
|
123
|
+
" Replacement id in edges: ",
|
|
124
|
+
C(e, n)
|
|
125
|
+
), g[e] = F(e, n), f[e] = { id: C(e, n), clusterData: n.node(e) });
|
|
126
|
+
}), n.nodes().forEach(function(e) {
|
|
127
|
+
const r = n.children(e), i = n.edges();
|
|
128
|
+
r.length > 0 ? (s.debug("Cluster identified", e, g), i.forEach((a) => {
|
|
129
|
+
if (a.v !== e && a.w !== e) {
|
|
130
|
+
const u = p(a.v, e), d = p(a.w, e);
|
|
131
|
+
u ^ d && (s.warn("Edge: ", a, " leaves cluster ", e), s.warn("Descendants of XXX ", e, ": ", g[e]), f[e].externalConnections = !0);
|
|
132
|
+
}
|
|
133
|
+
})) : s.debug("Not a cluster ", e, g);
|
|
134
|
+
});
|
|
135
|
+
for (let e of Object.keys(f)) {
|
|
136
|
+
const r = f[e].id, i = n.parent(r);
|
|
137
|
+
i !== e && f[i] && !f[i].externalConnections && (f[e].id = i);
|
|
138
|
+
}
|
|
139
|
+
n.edges().forEach(function(e) {
|
|
140
|
+
const r = n.edge(e);
|
|
141
|
+
s.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)), s.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(n.edge(e)));
|
|
142
|
+
let i = e.v, a = e.w;
|
|
143
|
+
if (s.warn(
|
|
144
|
+
"Fix XXX",
|
|
145
|
+
f,
|
|
146
|
+
"ids:",
|
|
147
|
+
e.v,
|
|
148
|
+
e.w,
|
|
149
|
+
"Translating: ",
|
|
150
|
+
f[e.v],
|
|
151
|
+
" --- ",
|
|
152
|
+
f[e.w]
|
|
153
|
+
), f[e.v] && f[e.w] && f[e.v] === f[e.w]) {
|
|
154
|
+
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 = S(e.v), a = S(e.w), n.removeEdge(e.v, e.w, e.name);
|
|
155
|
+
const u = e.w + "---" + e.v;
|
|
156
|
+
n.setNode(u, {
|
|
157
|
+
domId: u,
|
|
158
|
+
id: u,
|
|
159
|
+
labelStyle: "",
|
|
160
|
+
labelText: r.label,
|
|
161
|
+
padding: 0,
|
|
162
|
+
shape: "labelRect",
|
|
163
|
+
style: ""
|
|
164
|
+
});
|
|
165
|
+
const d = structuredClone(r), l = structuredClone(r);
|
|
166
|
+
d.label = "", d.arrowTypeEnd = "none", l.label = "", d.fromCluster = e.v, l.toCluster = e.v, n.setEdge(i, u, d, e.name + "-cyclic-special"), n.setEdge(u, a, l, e.name + "-cyclic-special");
|
|
167
|
+
} else if (f[e.v] || f[e.w]) {
|
|
168
|
+
if (s.warn("Fixing and trixing - removing XXX", e.v, e.w, e.name), i = S(e.v), a = S(e.w), n.removeEdge(e.v, e.w, e.name), i !== e.v) {
|
|
169
|
+
const u = n.parent(i);
|
|
170
|
+
f[u].externalConnections = !0, r.fromCluster = e.v;
|
|
171
|
+
}
|
|
172
|
+
if (a !== e.w) {
|
|
173
|
+
const u = n.parent(a);
|
|
174
|
+
f[u].externalConnections = !0, r.toCluster = e.w;
|
|
175
|
+
}
|
|
176
|
+
s.warn("Fix Replacing with XXX", i, a, e.name), n.setEdge(i, a, r, e.name);
|
|
177
|
+
}
|
|
178
|
+
}), s.warn("Adjusted Graph", m(n)), G(n, 0), s.trace(f);
|
|
179
|
+
}, G = (n, t) => {
|
|
180
|
+
if (s.warn("extractor - ", t, m(n), n.children("D")), t > 10) {
|
|
181
|
+
s.error("Bailing out");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
let e = n.nodes(), r = !1;
|
|
185
|
+
for (const i of e) {
|
|
186
|
+
const a = n.children(i);
|
|
187
|
+
r = r || a.length > 0;
|
|
188
|
+
}
|
|
189
|
+
if (!r) {
|
|
190
|
+
s.debug("Done, no node has children", n.nodes());
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
s.debug("Nodes = ", e, t);
|
|
194
|
+
for (const i of e)
|
|
195
|
+
if (s.debug(
|
|
196
|
+
"Extracting node",
|
|
197
|
+
i,
|
|
198
|
+
f,
|
|
199
|
+
f[i] && !f[i].externalConnections,
|
|
200
|
+
!n.parent(i),
|
|
201
|
+
n.node(i),
|
|
202
|
+
n.children("D"),
|
|
203
|
+
" Depth ",
|
|
204
|
+
t
|
|
205
|
+
), !f[i])
|
|
206
|
+
s.debug("Not a cluster", i, t);
|
|
207
|
+
else if (!f[i].externalConnections && // !graph.parent(node) &&
|
|
208
|
+
n.children(i) && n.children(i).length > 0) {
|
|
209
|
+
s.warn(
|
|
210
|
+
"Cluster without external connections, without a parent and with children",
|
|
211
|
+
i,
|
|
212
|
+
t
|
|
213
|
+
);
|
|
214
|
+
let u = n.graph().rankdir === "TB" ? "LR" : "TB";
|
|
215
|
+
f[i] && f[i].clusterData && f[i].clusterData.dir && (u = f[i].clusterData.dir, s.warn("Fixing dir", f[i].clusterData.dir, u));
|
|
216
|
+
const d = new H({
|
|
217
|
+
multigraph: !0,
|
|
218
|
+
compound: !0
|
|
219
|
+
}).setGraph({
|
|
220
|
+
rankdir: u,
|
|
221
|
+
// Todo: set proper spacing
|
|
222
|
+
nodesep: 50,
|
|
223
|
+
ranksep: 50,
|
|
224
|
+
marginx: 8,
|
|
225
|
+
marginy: 8
|
|
226
|
+
}).setDefaultEdgeLabel(function() {
|
|
227
|
+
return {};
|
|
228
|
+
});
|
|
229
|
+
s.warn("Old graph before copy", m(n)), k(i, n, d, i), n.setNode(i, {
|
|
230
|
+
clusterNode: !0,
|
|
231
|
+
id: i,
|
|
232
|
+
clusterData: f[i].clusterData,
|
|
233
|
+
labelText: f[i].labelText,
|
|
234
|
+
graph: d
|
|
235
|
+
}), s.warn("New graph after copy node: (", i, ")", m(d)), s.debug("Old graph after copy", m(n));
|
|
236
|
+
} else
|
|
237
|
+
s.warn(
|
|
238
|
+
"Cluster ** ",
|
|
239
|
+
i,
|
|
240
|
+
" **not meeting the criteria !externalConnections:",
|
|
241
|
+
!f[i].externalConnections,
|
|
242
|
+
" no parent: ",
|
|
243
|
+
!n.parent(i),
|
|
244
|
+
" children ",
|
|
245
|
+
n.children(i) && n.children(i).length > 0,
|
|
246
|
+
n.children("D"),
|
|
247
|
+
t
|
|
248
|
+
), s.debug(f);
|
|
249
|
+
e = n.nodes(), s.warn("New list of nodes", e);
|
|
250
|
+
for (const i of e) {
|
|
251
|
+
const a = n.node(i);
|
|
252
|
+
s.warn(" Now next level", i, a), a.clusterNode && G(a.graph, t + 1);
|
|
253
|
+
}
|
|
254
|
+
}, j = (n, t) => {
|
|
255
|
+
if (t.length === 0)
|
|
256
|
+
return [];
|
|
257
|
+
let e = Object.assign(t);
|
|
258
|
+
return t.forEach((r) => {
|
|
259
|
+
const i = n.children(r), a = j(n, i);
|
|
260
|
+
e = [...e, ...a];
|
|
261
|
+
}), e;
|
|
262
|
+
}, at = (n) => j(n, n.children()), ct = (n, t) => {
|
|
263
|
+
s.info("Creating subgraph rect for ", t.id, t);
|
|
264
|
+
const e = O(), r = n.insert("g").attr("class", "cluster" + (t.class ? " " + t.class : "")).attr("id", t.id), i = r.insert("rect", ":first-child"), a = B(e.flowchart.htmlLabels), u = r.insert("g").attr("class", "cluster-label"), d = t.labelType === "markdown" ? tt(u, t.labelText, { style: t.labelStyle, useHtmlLabels: a }) : u.node().appendChild(L(t.labelText, t.labelStyle, void 0, !0));
|
|
265
|
+
let l = d.getBBox();
|
|
266
|
+
if (B(e.flowchart.htmlLabels)) {
|
|
267
|
+
const c = d.children[0], o = R(d);
|
|
268
|
+
l = c.getBoundingClientRect(), o.attr("width", l.width), o.attr("height", l.height);
|
|
269
|
+
}
|
|
270
|
+
const h = 0 * t.padding, w = h / 2, x = t.width <= l.width + h ? l.width + h : t.width;
|
|
271
|
+
t.width <= l.width + h ? t.diff = (l.width - t.width) / 2 - t.padding / 2 : t.diff = -t.padding / 2, s.trace("Data ", t, JSON.stringify(t)), i.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - x / 2).attr("y", t.y - t.height / 2 - w).attr("width", x).attr("height", t.height + h);
|
|
272
|
+
const { subGraphTitleTopMargin: v } = T(e);
|
|
273
|
+
a ? u.attr(
|
|
274
|
+
"transform",
|
|
275
|
+
// This puts the label on top of the box instead of inside it
|
|
276
|
+
`translate(${t.x - l.width / 2}, ${t.y - t.height / 2 + v})`
|
|
277
|
+
) : u.attr(
|
|
278
|
+
"transform",
|
|
279
|
+
// This puts the label on top of the box instead of inside it
|
|
280
|
+
`translate(${t.x}, ${t.y - t.height / 2 + v})`
|
|
281
|
+
);
|
|
282
|
+
const y = i.node().getBBox();
|
|
283
|
+
return t.width = y.width, t.height = y.height, t.intersect = function(c) {
|
|
284
|
+
return D(t, c);
|
|
285
|
+
}, r;
|
|
286
|
+
}, ot = (n, t) => {
|
|
287
|
+
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;
|
|
288
|
+
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");
|
|
289
|
+
const u = r.node().getBBox();
|
|
290
|
+
return t.width = u.width, t.height = u.height, t.intersect = function(d) {
|
|
291
|
+
return D(t, d);
|
|
292
|
+
}, e;
|
|
293
|
+
}, lt = (n, t) => {
|
|
294
|
+
const e = O(), r = n.insert("g").attr("class", t.classes).attr("id", t.id), i = r.insert("rect", ":first-child"), a = r.insert("g").attr("class", "cluster-label"), u = r.append("rect"), d = a.node().appendChild(L(t.labelText, t.labelStyle, void 0, !0));
|
|
295
|
+
let l = d.getBBox();
|
|
296
|
+
if (B(e.flowchart.htmlLabels)) {
|
|
297
|
+
const c = d.children[0], o = R(d);
|
|
298
|
+
l = c.getBoundingClientRect(), o.attr("width", l.width), o.attr("height", l.height);
|
|
299
|
+
}
|
|
300
|
+
l = d.getBBox();
|
|
301
|
+
const h = 0 * t.padding, w = h / 2, x = t.width <= l.width + t.padding ? l.width + t.padding : t.width;
|
|
302
|
+
t.width <= l.width + t.padding ? t.diff = (l.width + t.padding * 0 - t.width) / 2 : t.diff = -t.padding / 2, i.attr("class", "outer").attr("x", t.x - x / 2 - w).attr("y", t.y - t.height / 2 - w).attr("width", x + h).attr("height", t.height + h), u.attr("class", "inner").attr("x", t.x - x / 2 - w).attr("y", t.y - t.height / 2 - w + l.height - 1).attr("width", x + h).attr("height", t.height + h - l.height - 3);
|
|
303
|
+
const { subGraphTitleTopMargin: v } = T(e);
|
|
304
|
+
a.attr(
|
|
305
|
+
"transform",
|
|
306
|
+
`translate(${t.x - l.width / 2}, ${t.y - t.height / 2 - t.padding / 3 + (B(e.flowchart.htmlLabels) ? 5 : 3) + v})`
|
|
307
|
+
);
|
|
308
|
+
const y = i.node().getBBox();
|
|
309
|
+
return t.height = y.height, t.intersect = function(c) {
|
|
310
|
+
return D(t, c);
|
|
311
|
+
}, r;
|
|
312
|
+
}, ft = (n, t) => {
|
|
313
|
+
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;
|
|
314
|
+
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);
|
|
315
|
+
const u = r.node().getBBox();
|
|
316
|
+
return t.width = u.width, t.height = u.height, t.diff = -t.padding / 2, t.intersect = function(d) {
|
|
317
|
+
return D(t, d);
|
|
318
|
+
}, e;
|
|
319
|
+
}, dt = { rect: ct, roundedWithTitle: lt, noteGroup: ot, divider: ft };
|
|
320
|
+
let M = {};
|
|
321
|
+
const ut = (n, t) => {
|
|
322
|
+
s.trace("Inserting cluster");
|
|
323
|
+
const e = t.shape || "rect";
|
|
324
|
+
M[t.id] = dt[e](n, t);
|
|
325
|
+
}, ht = () => {
|
|
326
|
+
M = {};
|
|
327
|
+
}, A = (n, t, e, r, i, a) => X(void 0, null, function* () {
|
|
328
|
+
s.info("Graph in recursive render: XXX", m(t), i);
|
|
329
|
+
const u = t.graph().rankdir;
|
|
330
|
+
s.trace("Dir in recursive render - dir:", u);
|
|
331
|
+
const d = n.insert("g").attr("class", "root");
|
|
332
|
+
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]));
|
|
333
|
+
const l = d.insert("g").attr("class", "clusters"), h = d.insert("g").attr("class", "edgePaths"), w = d.insert("g").attr("class", "edgeLabels"), x = d.insert("g").attr("class", "nodes");
|
|
334
|
+
yield Promise.all(
|
|
335
|
+
t.nodes().map(function(c) {
|
|
336
|
+
return X(this, null, function* () {
|
|
337
|
+
const o = t.node(c);
|
|
338
|
+
if (i !== void 0) {
|
|
339
|
+
const b = JSON.parse(JSON.stringify(i.clusterData));
|
|
340
|
+
s.info("Setting data for cluster XXX (", c, ") ", b, i), t.setNode(i.id, b), t.parent(c) || (s.trace("Setting parent", c, i.id), t.setParent(c, i.id, b));
|
|
341
|
+
}
|
|
342
|
+
if (s.info("(Insert) Node XXX" + c + ": " + JSON.stringify(t.node(c))), o && o.clusterNode) {
|
|
343
|
+
s.info("Cluster identified", c, o.width, t.node(c));
|
|
344
|
+
const b = yield A(
|
|
345
|
+
x,
|
|
346
|
+
o.graph,
|
|
347
|
+
e,
|
|
348
|
+
r,
|
|
349
|
+
t.node(c),
|
|
350
|
+
a
|
|
351
|
+
), E = b.elem;
|
|
352
|
+
_(o, E), o.diff = b.diff || 0, s.info("Node bounds (abc123)", c, o, o.width, o.x, o.y), q(E, o), s.warn("Recursive render complete ", E, o);
|
|
353
|
+
} else
|
|
354
|
+
t.children(c).length > 0 ? (s.info("Cluster - the non recursive path XXX", c, o.id, o, t), s.info(C(o.id, t)), f[o.id] = { id: C(o.id, t), node: o }) : (s.info("Node - the non recursive path", c, o.id, o), yield z(x, t.node(c), u));
|
|
355
|
+
});
|
|
356
|
+
})
|
|
357
|
+
), t.edges().forEach(function(c) {
|
|
358
|
+
const o = t.edge(c.v, c.w, c.name);
|
|
359
|
+
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", f, "ids:", c.v, c.w, "Translating: ", f[c.v], f[c.w]), K(w, o);
|
|
360
|
+
}), t.edges().forEach(function(c) {
|
|
361
|
+
s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c));
|
|
362
|
+
}), s.info("#############################################"), s.info("### Layout ###"), s.info("#############################################"), s.info(t), V(t), s.info("Graph after layout:", m(t));
|
|
363
|
+
let v = 0;
|
|
364
|
+
const { subGraphTitleTotalMargin: y } = T(a);
|
|
365
|
+
return at(t).forEach(function(c) {
|
|
366
|
+
const o = t.node(c);
|
|
367
|
+
s.info("Position " + c + ": " + JSON.stringify(t.node(c))), s.info(
|
|
368
|
+
"Position " + c + ": (" + o.x,
|
|
369
|
+
"," + o.y,
|
|
370
|
+
") width: ",
|
|
371
|
+
o.width,
|
|
372
|
+
" height: ",
|
|
373
|
+
o.height
|
|
374
|
+
), o && o.clusterNode ? (o.y += y, $(o)) : t.children(c).length > 0 ? (o.height += y, ut(l, o), f[o.id].node = o) : (o.y += y / 2, $(o));
|
|
375
|
+
}), t.edges().forEach(function(c) {
|
|
376
|
+
const o = t.edge(c);
|
|
377
|
+
s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(o), o), o.points.forEach((E) => E.y += y / 2);
|
|
378
|
+
const b = Q(h, c, o, f, e, t, r);
|
|
379
|
+
Y(o, b);
|
|
380
|
+
}), t.nodes().forEach(function(c) {
|
|
381
|
+
const o = t.node(c);
|
|
382
|
+
s.info(c, o.type, o.diff), o.type === "group" && (v = o.diff);
|
|
383
|
+
}), { elem: d, diff: v };
|
|
384
|
+
}), Et = (n, t, e, r, i) => X(void 0, null, function* () {
|
|
385
|
+
W(n, e, r, i), Z(), I(), ht(), it(), s.warn("Graph at first:", JSON.stringify(m(t))), rt(t), s.warn("Graph after:", JSON.stringify(m(t)));
|
|
386
|
+
const a = O();
|
|
387
|
+
yield A(n, t, r, i, void 0, a);
|
|
388
|
+
});
|
|
389
|
+
export {
|
|
390
|
+
Et as r
|
|
391
|
+
};
|