@zombie-mermaid/svg-renderer 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +35 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +837 -831
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/class/renderer.ts +65 -62
- package/src/edge-curves.ts +17 -16
- package/src/er/renderer.ts +50 -49
- package/src/renderer.ts +190 -189
- package/src/sequence/renderer.ts +66 -65
package/dist/index.js
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import { CHART_ACCENT_FALLBACK as
|
|
4
|
-
import { decodeXML as
|
|
1
|
+
import { DEFAULTS as e, applyClickStatement as t, buildStyleBlock as n, detectDiagramType as r, escapeAttr as i, escapeXml as a, extractInitConfig as o, f as s, formatCssColor as c, getReadableTextColor as l, isMonospaceFont as u, measureMultilineText as d, measureTextWidth as f, mixSrgb as p, normalizeBrTags as m, parseCssColor as h, parseStyleProps as g, renderMultilineText as _, renderMultilineTextWithBackground as v, resolveNodeStyle as y, safeHref as b, sanitizeClassName as x, setMonospaceMetrics as S, splitStatements as C, splitStatementsByLine as w, styleOpenTag as T, svgOpenTag as E, themeStyleDeclarations as D, toDirection as O, tryApplyClassAssignment as k, tryApplyClassDef as A, tryApplyStyleStatement as j, withDirectionOverride as ee } from "@zombie-mermaid/core";
|
|
2
|
+
import te from "elkjs/lib/elk.bundled.js";
|
|
3
|
+
import { CHART_ACCENT_FALLBACK as ne, formatClassMember as re, getSeriesColor as ie, matchExpandedBlock as ae, parseClassDiagram as oe, parseErDiagram as se, parseExpandedMeta as ce, parseSequenceDiagram as le, parseXYChart as ue, resolveShapeName as de } from "@zombie-mermaid/mermaid-parser";
|
|
4
|
+
import { decodeXML as fe } from "entities";
|
|
5
5
|
//#region packages/svg-renderer/src/edge-curves.ts
|
|
6
|
-
function fe(e) {
|
|
7
|
-
return `M ${e.x} ${e.y}`;
|
|
8
|
-
}
|
|
9
6
|
function pe(e) {
|
|
10
|
-
return
|
|
7
|
+
return s`M ${e.x} ${e.y}`;
|
|
11
8
|
}
|
|
12
9
|
function me(e) {
|
|
13
|
-
|
|
14
|
-
let t = e[e.length - 1], n = [fe(e[0])], r = (e, t, n) => ` C ${(2 * e.x + t.x) / 3} ${(2 * e.y + t.y) / 3}, ${(e.x + 2 * t.x) / 3} ${(e.y + 2 * t.y) / 3}, ${(e.x + 4 * t.x + n.x) / 6} ${(e.y + 4 * t.y + n.y) / 6}`;
|
|
15
|
-
n.push(` L ${(5 * e[0].x + e[1].x) / 6} ${(5 * e[0].y + e[1].y) / 6}`);
|
|
16
|
-
for (let t = 2; t < e.length; t++) n.push(r(e[t - 2], e[t - 1], e[t]));
|
|
17
|
-
return n.push(r(e[e.length - 2], t, t)), n.push(` L ${t.x} ${t.y}`), n.join("");
|
|
10
|
+
return pe(e[0]) + e.slice(1).map((e) => s` L ${e.x} ${e.y}`).join("");
|
|
18
11
|
}
|
|
19
12
|
function he(e) {
|
|
20
|
-
if (e.length < 3) return
|
|
21
|
-
let t = [
|
|
13
|
+
if (e.length < 3) return me(e);
|
|
14
|
+
let t = e[e.length - 1], n = [pe(e[0])], r = (e, t, n) => s` C ${(2 * e.x + t.x) / 3} ${(2 * e.y + t.y) / 3},` + s` ${(e.x + 2 * t.x) / 3} ${(e.y + 2 * t.y) / 3},` + s` ${(e.x + 4 * t.x + n.x) / 6} ${(e.y + 4 * t.y + n.y) / 6}`;
|
|
15
|
+
n.push(s` L ${(5 * e[0].x + e[1].x) / 6}` + s` ${(5 * e[0].y + e[1].y) / 6}`);
|
|
16
|
+
for (let t = 2; t < e.length; t++) n.push(r(e[t - 2], e[t - 1], e[t]));
|
|
17
|
+
return n.push(r(e[e.length - 2], t, t)), n.push(s` L ${t.x} ${t.y}`), n.join("");
|
|
18
|
+
}
|
|
19
|
+
function ge(e) {
|
|
20
|
+
if (e.length < 3) return me(e);
|
|
21
|
+
let t = [pe(e[0])];
|
|
22
22
|
for (let n = 1; n < e.length - 1; n++) {
|
|
23
|
-
let r = e[n - 1], i = e[n], a = e[n + 1], o = Math.hypot(i.x - r.x, i.y - r.y),
|
|
24
|
-
if (o === 0 ||
|
|
25
|
-
t.push(` L ${i.x} ${i.y}`);
|
|
23
|
+
let r = e[n - 1], i = e[n], a = e[n + 1], o = Math.hypot(i.x - r.x, i.y - r.y), c = Math.hypot(a.x - i.x, a.y - i.y);
|
|
24
|
+
if (o === 0 || c === 0) {
|
|
25
|
+
t.push(s` L ${i.x} ${i.y}`);
|
|
26
26
|
continue;
|
|
27
27
|
}
|
|
28
|
-
let
|
|
29
|
-
t.push(` L ${
|
|
28
|
+
let l = Math.min(12, o / 2, c / 2), u = i.x - (i.x - r.x) / o * l, d = i.y - (i.y - r.y) / o * l, f = i.x + (a.x - i.x) / c * l, p = i.y + (a.y - i.y) / c * l;
|
|
29
|
+
t.push(s` L ${u} ${d}`), t.push(s` Q ${i.x} ${i.y}, ${f} ${p}`);
|
|
30
30
|
}
|
|
31
31
|
let n = e[e.length - 1];
|
|
32
|
-
return t.push(` L ${n.x} ${n.y}`), t.join("");
|
|
32
|
+
return t.push(s` L ${n.x} ${n.y}`), t.join("");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
let n = [
|
|
34
|
+
function _e(e, t) {
|
|
35
|
+
let n = [pe(e[0])], r = e.length - 1;
|
|
36
36
|
for (let i = 0; i < r; i++) {
|
|
37
37
|
let a = e[i], o = e[i + 1];
|
|
38
38
|
if (i === r - 1) {
|
|
39
|
-
n.push(` L ${o.x} ${o.y}`);
|
|
39
|
+
n.push(s` L ${o.x} ${o.y}`);
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
42
|
-
if (t === "before") n.push(` L ${a.x} ${o.y} L ${o.x} ${o.y}`);
|
|
43
|
-
else if (t === "after") n.push(` L ${o.x} ${a.y} L ${o.x} ${o.y}`);
|
|
42
|
+
if (t === "before") n.push(s` L ${a.x} ${o.y} L ${o.x} ${o.y}`);
|
|
43
|
+
else if (t === "after") n.push(s` L ${o.x} ${a.y} L ${o.x} ${o.y}`);
|
|
44
44
|
else {
|
|
45
45
|
let e = (a.y + o.y) / 2;
|
|
46
|
-
n.push(` L ${a.x} ${e} L ${o.x} ${e} L ${o.x} ${o.y}`);
|
|
46
|
+
n.push(s` L ${a.x} ${e} L ${o.x} ${e} L ${o.x} ${o.y}`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
return n.join("");
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function ve(e, t = "linear") {
|
|
52
52
|
if (e.length === 0) return "";
|
|
53
|
-
if (e.length === 1) return
|
|
53
|
+
if (e.length === 1) return pe(e[0]);
|
|
54
54
|
switch (t) {
|
|
55
|
-
case "basis": return
|
|
56
|
-
case "natural": return
|
|
57
|
-
case "step": return
|
|
58
|
-
case "stepBefore": return
|
|
59
|
-
case "stepAfter": return
|
|
60
|
-
default: return
|
|
55
|
+
case "basis": return he(e);
|
|
56
|
+
case "natural": return ge(e);
|
|
57
|
+
case "step": return _e(e, "mid");
|
|
58
|
+
case "stepBefore": return _e(e, "before");
|
|
59
|
+
case "stepAfter": return _e(e, "after");
|
|
60
|
+
default: return me(e);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region packages/svg-renderer/src/elk-instance.ts
|
|
65
|
-
var
|
|
66
|
-
function
|
|
65
|
+
var ye = null, be = null, xe = 20;
|
|
66
|
+
function Se(e = xe) {
|
|
67
67
|
if (!Number.isInteger(e) || e < 1) throw Error(`createLayoutCache: maxSize must be a positive integer, got ${e}`);
|
|
68
68
|
return {
|
|
69
69
|
map: /* @__PURE__ */ new Map(),
|
|
70
70
|
maxSize: e
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
if (Array.isArray(e)) return `[${e.map(
|
|
73
|
+
function Ce(e) {
|
|
74
|
+
if (Array.isArray(e)) return `[${e.map(Ce).join(",")}]`;
|
|
75
75
|
if (typeof e == "object" && e) {
|
|
76
76
|
let t = e;
|
|
77
|
-
return `{${Object.keys(t).sort().map((e) => `${JSON.stringify(e)}:${
|
|
77
|
+
return `{${Object.keys(t).sort().map((e) => `${JSON.stringify(e)}:${Ce(t[e])}`).join(",")}}`;
|
|
78
78
|
}
|
|
79
79
|
return JSON.stringify(e);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
if (
|
|
83
|
-
let
|
|
84
|
-
globalThis.setTimeout = (
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
81
|
+
function we() {
|
|
82
|
+
if (ye && be) return be;
|
|
83
|
+
let e = [], t = globalThis.setTimeout;
|
|
84
|
+
globalThis.setTimeout = (n, r) => r === 0 ? (e.push(n), 0) : t(n, r);
|
|
85
|
+
let n = globalThis, r = "self" in n, i = n.self;
|
|
86
|
+
if (r && n.document === void 0 && delete n.self, ye = new te(), !ye) throw Error("ELKBundled construction unexpectedly produced no instance");
|
|
87
|
+
return r && (n.self = i), globalThis.setTimeout = t, e.forEach((e) => e()), be = ye.worker.worker, be;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
let n = t, r = n ?
|
|
89
|
+
function Te(e, t) {
|
|
90
|
+
let n = t, r = n ? Ce(e) : void 0;
|
|
91
91
|
if (n && r !== void 0) {
|
|
92
92
|
let e = n.map.get(r);
|
|
93
93
|
if (e) return n.map.delete(r), n.map.set(r, e), e;
|
|
94
94
|
}
|
|
95
|
-
let i =
|
|
95
|
+
let i = we(), a, o, s = i.onmessage;
|
|
96
96
|
if (i.onmessage = (e) => {
|
|
97
97
|
e.data.error ? o = e.data.error : a = e.data.data;
|
|
98
98
|
}, i.dispatcher.saveDispatch({ data: {
|
|
@@ -112,10 +112,10 @@ function we(e, t) {
|
|
|
112
112
|
function M(e, t, n) {
|
|
113
113
|
return f(e, t, n);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Ee(e, t) {
|
|
116
116
|
return e.length * t * .6;
|
|
117
117
|
}
|
|
118
|
-
var
|
|
118
|
+
var De = "'JetBrains Mono'", Oe = `${De}, 'SF Mono', 'Fira Code', ui-monospace, monospace`, N = {
|
|
119
119
|
nodeLabel: 13,
|
|
120
120
|
edgeLabel: 11,
|
|
121
121
|
groupHeader: 12
|
|
@@ -131,7 +131,7 @@ var F = {
|
|
|
131
131
|
nodeLabel: 500,
|
|
132
132
|
edgeLabel: 400,
|
|
133
133
|
groupHeader: 600
|
|
134
|
-
},
|
|
134
|
+
}, ke = 12, I = {
|
|
135
135
|
horizontal: 20,
|
|
136
136
|
vertical: 10,
|
|
137
137
|
diamondExtra: 24
|
|
@@ -142,7 +142,7 @@ var F = {
|
|
|
142
142
|
}, R = "0.35em", z = {
|
|
143
143
|
width: 8,
|
|
144
144
|
height: 5
|
|
145
|
-
},
|
|
145
|
+
}, Ae = {
|
|
146
146
|
font: "Inter",
|
|
147
147
|
padding: 40,
|
|
148
148
|
nodeSpacing: 28,
|
|
@@ -150,13 +150,13 @@ var F = {
|
|
|
150
150
|
mergeEdges: !0,
|
|
151
151
|
thoroughness: 3,
|
|
152
152
|
fontSizes: N
|
|
153
|
-
},
|
|
153
|
+
}, je = {
|
|
154
154
|
flowchart: "DOWN",
|
|
155
155
|
state: "DOWN",
|
|
156
156
|
class: "DOWN",
|
|
157
157
|
er: "RIGHT"
|
|
158
158
|
};
|
|
159
|
-
function
|
|
159
|
+
function Me(e, t) {
|
|
160
160
|
switch (e) {
|
|
161
161
|
case "LR": return "RIGHT";
|
|
162
162
|
case "RL": return "LEFT";
|
|
@@ -166,7 +166,7 @@ function je(e, t) {
|
|
|
166
166
|
default: return t;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ne(e) {
|
|
170
170
|
let t = typeof e == "number" ? {
|
|
171
171
|
top: e,
|
|
172
172
|
left: e,
|
|
@@ -175,13 +175,13 @@ function Me(e) {
|
|
|
175
175
|
} : e;
|
|
176
176
|
return `[top=${t.top},left=${t.left},bottom=${t.bottom},right=${t.right}]`;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Pe(e) {
|
|
179
179
|
return {
|
|
180
180
|
"elk.algorithm": "layered",
|
|
181
181
|
"elk.direction": e.direction,
|
|
182
182
|
"elk.spacing.nodeNode": String(e.nodeSpacing),
|
|
183
183
|
"elk.layered.spacing.nodeNodeBetweenLayers": String(e.layerSpacing),
|
|
184
|
-
"elk.padding":
|
|
184
|
+
"elk.padding": Ne(e.padding),
|
|
185
185
|
"elk.edgeRouting": "ORTHOGONAL"
|
|
186
186
|
};
|
|
187
187
|
}
|
|
@@ -193,11 +193,11 @@ function B(e, t, n) {
|
|
|
193
193
|
};
|
|
194
194
|
return n !== void 0 && (r.labels = [{ text: n }]), r;
|
|
195
195
|
}
|
|
196
|
-
var
|
|
196
|
+
var Fe = {
|
|
197
197
|
"elk.edgeLabels.inline": "true",
|
|
198
198
|
"elk.edgeLabels.placement": "CENTER"
|
|
199
199
|
};
|
|
200
|
-
function
|
|
200
|
+
function Ie(e, t) {
|
|
201
201
|
let n = d(e, t.fontSize, F.edgeLabel), r = {
|
|
202
202
|
text: e,
|
|
203
203
|
width: n.width + 8,
|
|
@@ -211,16 +211,16 @@ function V(e) {
|
|
|
211
211
|
sources: [e.source],
|
|
212
212
|
targets: [e.target]
|
|
213
213
|
};
|
|
214
|
-
return e.label && (t.labels = [
|
|
214
|
+
return e.label && (t.labels = [Ie(e.label, e.labelStyle)]), t;
|
|
215
215
|
}
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region packages/svg-renderer/src/layout-engine/to-elk.ts
|
|
218
|
-
function Ie(e) {
|
|
219
|
-
return je(e, Ae.flowchart);
|
|
220
|
-
}
|
|
221
218
|
function Le(e) {
|
|
219
|
+
return Me(e, je.flowchart);
|
|
220
|
+
}
|
|
221
|
+
function Re(e) {
|
|
222
222
|
return {
|
|
223
|
-
...
|
|
223
|
+
...Pe(e),
|
|
224
224
|
"elk.spacing.edgeEdge": "12",
|
|
225
225
|
"elk.layered.spacing.edgeEdgeBetweenLayers": "12",
|
|
226
226
|
"elk.layered.spacing.edgeNodeBetweenLayers": "12",
|
|
@@ -228,13 +228,13 @@ function Le(e) {
|
|
|
228
228
|
"elk.contentAlignment": "H_CENTER V_CENTER"
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function ze(e) {
|
|
232
232
|
return {
|
|
233
233
|
fontSize: e.fontSizes.edgeLabel,
|
|
234
|
-
layoutOptions:
|
|
234
|
+
layoutOptions: Fe
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Be(e, t, n, r) {
|
|
238
238
|
let i = d(t, r, F.nodeLabel), a = i.width + I.horizontal * 2, o = i.height + I.vertical * 2;
|
|
239
239
|
if (n === "diamond") {
|
|
240
240
|
let e = Math.max(a, o) + I.diamondExtra;
|
|
@@ -252,22 +252,22 @@ function ze(e, t, n, r) {
|
|
|
252
252
|
height: o
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
var
|
|
256
|
-
function
|
|
257
|
-
for (let t of e) if (t.direction !== void 0 ||
|
|
255
|
+
var Ve = " root";
|
|
256
|
+
function He(e) {
|
|
257
|
+
for (let t of e) if (t.direction !== void 0 || He(t.children)) return !0;
|
|
258
258
|
return !1;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function Ue(e, t) {
|
|
261
261
|
for (let n of e.nodeIds) t.add(n);
|
|
262
|
-
for (let n of e.children)
|
|
262
|
+
for (let n of e.children) Ue(n, t);
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function We(e, t) {
|
|
265
265
|
let n = /* @__PURE__ */ new Set();
|
|
266
|
-
if (
|
|
266
|
+
if (Ue(e, n), n.size === 0) return !0;
|
|
267
267
|
let r = (t) => n.has(t) || t === e.id;
|
|
268
268
|
return !t.edges.some((e) => r(e.source) !== r(e.target));
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Ge(e) {
|
|
271
271
|
let t = /* @__PURE__ */ new Map();
|
|
272
272
|
function n(e, r) {
|
|
273
273
|
let i = [...r, e.id];
|
|
@@ -277,15 +277,15 @@ function We(e) {
|
|
|
277
277
|
for (let t of e) n(t, []);
|
|
278
278
|
return t;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function Ke(e, t) {
|
|
281
281
|
let n = 0;
|
|
282
282
|
for (; n < e.length && n < t.length && e[n] === t[n];) n++;
|
|
283
283
|
return n;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function qe(e, t) {
|
|
286
286
|
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
287
|
-
for (let t of e.subgraphs) r.add(t.id),
|
|
288
|
-
let i =
|
|
287
|
+
for (let t of e.subgraphs) r.add(t.id), Ye(t, n, r);
|
|
288
|
+
let i = Xe(e.subgraphs), a = Ge(e.subgraphs), o = (e) => e ? a.get(e) ?? [] : [], s = /* @__PURE__ */ new Map();
|
|
289
289
|
s.set(null, []);
|
|
290
290
|
let c = [];
|
|
291
291
|
for (let t = 0; t < e.edges.length; t++) {
|
|
@@ -306,14 +306,14 @@ function Ke(e, t) {
|
|
|
306
306
|
tgtChain: o(a)
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
|
-
let l =
|
|
310
|
-
...
|
|
311
|
-
direction:
|
|
309
|
+
let l = He(e.subgraphs), u = [], d = [], f = {
|
|
310
|
+
...Re({
|
|
311
|
+
direction: Le(e.direction),
|
|
312
312
|
nodeSpacing: t.nodeSpacing,
|
|
313
313
|
layerSpacing: t.layerSpacing,
|
|
314
314
|
padding: t.padding
|
|
315
315
|
}),
|
|
316
|
-
"elk.layered.thoroughness": String(
|
|
316
|
+
"elk.layered.thoroughness": String(Ae.thoroughness),
|
|
317
317
|
"elk.layered.highDegreeNodes.treatment": "true",
|
|
318
318
|
"elk.layered.highDegreeNodes.threshold": "8",
|
|
319
319
|
"elk.layered.compaction.postCompaction.strategy": "LEFT_RIGHT_CONSTRAINT_LOCKING",
|
|
@@ -330,7 +330,7 @@ function Ke(e, t) {
|
|
|
330
330
|
m.set(e, n), n.push(t);
|
|
331
331
|
}
|
|
332
332
|
if (l) for (let { index: e, edge: n, srcChain: r, tgtChain: i } of c) {
|
|
333
|
-
let a =
|
|
333
|
+
let a = Ke(r, i), o = n.source;
|
|
334
334
|
if (r.length > a) {
|
|
335
335
|
for (let t = r.length - 1; t >= a; t--) {
|
|
336
336
|
let i = r[t], a = `${i}_out_${e}`;
|
|
@@ -358,33 +358,33 @@ function Ke(e, t) {
|
|
|
358
358
|
}
|
|
359
359
|
s = `${i[a]}_in_${e}`;
|
|
360
360
|
}
|
|
361
|
-
g(a > 0 ? r[a - 1] :
|
|
361
|
+
g(a > 0 ? r[a - 1] : Ve, V({
|
|
362
362
|
id: `e${e}`,
|
|
363
363
|
source: o,
|
|
364
364
|
target: s,
|
|
365
365
|
label: n.label,
|
|
366
|
-
labelStyle:
|
|
366
|
+
labelStyle: ze(t)
|
|
367
367
|
}));
|
|
368
368
|
}
|
|
369
369
|
for (let [i, a] of e.nodes) if (!n.has(i) && !r.has(i)) {
|
|
370
|
-
let e =
|
|
370
|
+
let e = Be(i, a.label, a.shape, t.fontSizes.nodeLabel);
|
|
371
371
|
u.push(B(i, e, a.label));
|
|
372
372
|
}
|
|
373
|
-
for (let n of [...e.subgraphs].reverse()) u.push(
|
|
373
|
+
for (let n of [...e.subgraphs].reverse()) u.push(Je(n, e, t, s, p, m, e.direction));
|
|
374
374
|
for (let { index: e, edge: n } of s.get(null)) n.source !== n.target && d.push(V({
|
|
375
375
|
id: `e${e}`,
|
|
376
376
|
source: n.source,
|
|
377
377
|
target: n.target,
|
|
378
378
|
label: n.label,
|
|
379
|
-
labelStyle:
|
|
379
|
+
labelStyle: ze(t)
|
|
380
380
|
}));
|
|
381
|
-
if (l) for (let e of m.get(
|
|
381
|
+
if (l) for (let e of m.get(Ve) ?? []) d.push(e);
|
|
382
382
|
else for (let { index: e, edge: n } of c) d.push(V({
|
|
383
383
|
id: `e${e}`,
|
|
384
384
|
source: n.source,
|
|
385
385
|
target: n.target,
|
|
386
386
|
label: n.label,
|
|
387
|
-
labelStyle:
|
|
387
|
+
labelStyle: ze(t)
|
|
388
388
|
}));
|
|
389
389
|
return {
|
|
390
390
|
id: "root",
|
|
@@ -393,9 +393,9 @@ function Ke(e, t) {
|
|
|
393
393
|
edges: d
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
let s = e.direction !== void 0 &&
|
|
398
|
-
direction:
|
|
396
|
+
function Je(e, t, n, r, i, a, o) {
|
|
397
|
+
let s = e.direction !== void 0 && We(e, t) ? e.direction : o, c = Re({
|
|
398
|
+
direction: Le(s),
|
|
399
399
|
nodeSpacing: n.nodeSpacing,
|
|
400
400
|
layerSpacing: n.layerSpacing,
|
|
401
401
|
padding: {
|
|
@@ -410,18 +410,18 @@ function qe(e, t, n, r, i, a, o) {
|
|
|
410
410
|
for (let r of e.nodeIds) {
|
|
411
411
|
let e = t.nodes.get(r);
|
|
412
412
|
if (e) {
|
|
413
|
-
let t =
|
|
413
|
+
let t = Be(r, e.label, e.shape, n.fontSizes.nodeLabel);
|
|
414
414
|
d.push(B(r, t, e.label));
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
for (let o of [...e.children].reverse()) d.push(
|
|
417
|
+
for (let o of [...e.children].reverse()) d.push(Je(o, t, n, r, i, a, s));
|
|
418
418
|
let f = [], p = r.get(e.id) ?? [];
|
|
419
419
|
for (let { index: e, edge: t } of p) t.source !== t.target && f.push(V({
|
|
420
420
|
id: `e${e}`,
|
|
421
421
|
source: t.source,
|
|
422
422
|
target: t.target,
|
|
423
423
|
label: t.label,
|
|
424
|
-
labelStyle:
|
|
424
|
+
labelStyle: ze(n)
|
|
425
425
|
}));
|
|
426
426
|
for (let t of a.get(e.id) ?? []) f.push(t);
|
|
427
427
|
return {
|
|
@@ -433,11 +433,11 @@ function qe(e, t, n, r, i, a, o) {
|
|
|
433
433
|
edges: f
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function Ye(e, t, n) {
|
|
437
437
|
for (let n of e.nodeIds) t.add(n);
|
|
438
|
-
for (let r of e.children) n.add(r.id),
|
|
438
|
+
for (let r of e.children) n.add(r.id), Ye(r, t, n);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Xe(e) {
|
|
441
441
|
let t = /* @__PURE__ */ new Map();
|
|
442
442
|
function n(e) {
|
|
443
443
|
for (let n of e.nodeIds) t.set(n, e.id);
|
|
@@ -448,19 +448,19 @@ function Ye(e) {
|
|
|
448
448
|
}
|
|
449
449
|
//#endregion
|
|
450
450
|
//#region packages/svg-renderer/src/shape-clipping.ts
|
|
451
|
-
function
|
|
451
|
+
function Ze(e, t, n) {
|
|
452
452
|
if (e.length < 2 || t.shape === "rectangle" || t.shape === "rounded" || t.shape === "stadium") return e;
|
|
453
453
|
let r = [...e];
|
|
454
454
|
if (t.shape === "diamond") {
|
|
455
|
-
if (n) r[0] =
|
|
455
|
+
if (n) r[0] = Qe(e[0], e[1], t);
|
|
456
456
|
else {
|
|
457
457
|
let n = e.length - 1;
|
|
458
|
-
r[n] =
|
|
458
|
+
r[n] = Qe(e[n], e[n - 1], t);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
return r;
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Qe(e, t, n) {
|
|
464
464
|
let r = n.x + n.width / 2, i = n.y + n.height / 2, a = {
|
|
465
465
|
x: r,
|
|
466
466
|
y: n.y
|
|
@@ -476,14 +476,14 @@ function Ze(e, t, n) {
|
|
|
476
476
|
}, l = e.x - t.x, u = e.y - t.y;
|
|
477
477
|
if (Math.abs(l) < Math.abs(u)) {
|
|
478
478
|
let t = e.x;
|
|
479
|
-
return u > 0 ? t <= r ?
|
|
479
|
+
return u > 0 ? t <= r ? et(t, c, a) ?? a : et(t, a, o) ?? a : t <= r ? et(t, s, c) ?? s : et(t, o, s) ?? s;
|
|
480
480
|
}
|
|
481
481
|
{
|
|
482
482
|
let t = e.y;
|
|
483
|
-
return l > 0 ? t <= i ?
|
|
483
|
+
return l > 0 ? t <= i ? $e(t, a, c) ?? c : $e(t, c, s) ?? c : t <= i ? $e(t, a, o) ?? o : $e(t, o, s) ?? o;
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function $e(e, t, n) {
|
|
487
487
|
let r = n.y - t.y;
|
|
488
488
|
if (Math.abs(r) < .001) return null;
|
|
489
489
|
let i = (e - t.y) / r;
|
|
@@ -492,7 +492,7 @@ function Qe(e, t, n) {
|
|
|
492
492
|
y: e
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function et(e, t, n) {
|
|
496
496
|
let r = n.x - t.x;
|
|
497
497
|
if (Math.abs(r) < .001) return null;
|
|
498
498
|
let i = (e - t.x) / r;
|
|
@@ -503,11 +503,11 @@ function $e(e, t, n) {
|
|
|
503
503
|
}
|
|
504
504
|
//#endregion
|
|
505
505
|
//#region packages/svg-renderer/src/layout-engine/layer-alignment.ts
|
|
506
|
-
function
|
|
506
|
+
function tt(e, t, n) {
|
|
507
507
|
if (e.length === 0) return;
|
|
508
508
|
let r = n === "LR" || n === "RL", i = /* @__PURE__ */ new Set();
|
|
509
509
|
for (let e of t) i.add(`${e.source}:${e.target}`), i.add(`${e.target}:${e.source}`);
|
|
510
|
-
let a =
|
|
510
|
+
let a = Ae.layerSpacing * .6, o = [...e].sort((e, t) => r ? e.x - t.x : e.y - t.y), s = [], c = [o[0]];
|
|
511
511
|
for (let e = 1; e < o.length; e++) {
|
|
512
512
|
let t = (r ? o[e].x : o[e].y) - (r ? o[e - 1].x : o[e - 1].y), n = c.some((t) => i.has(`${t.id}:${o[e].id}`));
|
|
513
513
|
t <= a && !n ? c.push(o[e]) : (s.push(c), c = [o[e]]);
|
|
@@ -547,28 +547,28 @@ function et(e, t, n) {
|
|
|
547
547
|
}
|
|
548
548
|
//#endregion
|
|
549
549
|
//#region packages/svg-renderer/src/layout-engine/edge-bundling.ts
|
|
550
|
-
var
|
|
551
|
-
function
|
|
550
|
+
var nt = .5;
|
|
551
|
+
function rt(e, t, n) {
|
|
552
552
|
for (let r = 0; r < e.length - 1; r++) {
|
|
553
553
|
let i = e[r], a = e[r + 1], o = Math.min(i.x, a.x), s = Math.max(i.x, a.x), c = Math.min(i.y, a.y), l = Math.max(i.y, a.y);
|
|
554
554
|
for (let e of t) {
|
|
555
555
|
if (n.has(e.id)) continue;
|
|
556
|
-
let t = e.x +
|
|
556
|
+
let t = e.x + nt, r = e.x + e.width - nt, i = e.y + nt, a = e.y + e.height - nt;
|
|
557
557
|
if (!(t >= r || i >= a) && o < r && s > t && c < a && l > i) return !1;
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
return !0;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function it(e, t, n) {
|
|
563
563
|
let r = [];
|
|
564
|
-
for (let i of n) e >= i.x && e <= i.x + i.width && t >= i.y && t <= i.y + i.height && (r.push(i), r.push(...
|
|
564
|
+
for (let i of n) e >= i.x && e <= i.x + i.width && t >= i.y && t <= i.y + i.height && (r.push(i), r.push(...it(e, t, i.children)));
|
|
565
565
|
return r;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
let a = i === "LR", o = i === "RL", s = i === "BT", c = a || o, l = new Set(
|
|
567
|
+
function at(e, t, n, r, i) {
|
|
568
|
+
let a = i === "LR", o = i === "RL", s = i === "BT", c = a || o, l = new Set(it(t, n, r).map((e) => e.id)), u = it(c ? e : t, c ? n : e, r).find((e) => !l.has(e.id));
|
|
569
569
|
return u ? a ? u.x - 12 : o ? u.x + u.width + 12 : s ? u.y + u.height + 12 : u.y - 12 : e;
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function ot(e, t, n, r) {
|
|
572
572
|
let i = new Map(t.map((e) => [e.id, e])), a = /* @__PURE__ */ new Set(), o = r === "LR", s = r === "RL", c = r === "BT", l = o || s, u = /* @__PURE__ */ new Map();
|
|
573
573
|
for (let t of e) {
|
|
574
574
|
if (t.source === t.target) continue;
|
|
@@ -593,7 +593,7 @@ function at(e, t, n, r) {
|
|
|
593
593
|
let m = f.x + f.width / 2, h = f.y + f.height / 2;
|
|
594
594
|
if (l) {
|
|
595
595
|
let i = o ? f.x + f.width : f.x, s = h, c = i + ((o ? Math.min(...p.map((e) => e.node.x)) : Math.max(...p.map((e) => e.node.x + e.node.width))) - i) / 2;
|
|
596
|
-
c =
|
|
596
|
+
c = at(c, m, h, n, r);
|
|
597
597
|
let l = [];
|
|
598
598
|
for (let { edge: n, node: r } of p) {
|
|
599
599
|
let a = o ? r.x : r.x + r.width, u = r.y + r.height / 2, d = [
|
|
@@ -614,7 +614,7 @@ function at(e, t, n, r) {
|
|
|
614
614
|
y: u
|
|
615
615
|
}
|
|
616
616
|
];
|
|
617
|
-
|
|
617
|
+
rt(d, t, /* @__PURE__ */ new Set([e, r.id])) && l.push({
|
|
618
618
|
edge: n,
|
|
619
619
|
points: d
|
|
620
620
|
});
|
|
@@ -623,7 +623,7 @@ function at(e, t, n, r) {
|
|
|
623
623
|
for (let { edge: e, points: t } of l) e.points = t, a.add(e);
|
|
624
624
|
} else {
|
|
625
625
|
let i = m, o = c ? f.y : f.y + f.height, s = o + ((c ? Math.max(...p.map((e) => e.node.y + e.node.height)) : Math.min(...p.map((e) => e.node.y))) - o) / 2;
|
|
626
|
-
s =
|
|
626
|
+
s = at(s, m, h, n, r);
|
|
627
627
|
let l = [];
|
|
628
628
|
for (let { edge: n, node: r } of p) {
|
|
629
629
|
let a = r.x + r.width / 2, u = c ? r.y + r.height : r.y, d = [
|
|
@@ -644,7 +644,7 @@ function at(e, t, n, r) {
|
|
|
644
644
|
y: u
|
|
645
645
|
}
|
|
646
646
|
];
|
|
647
|
-
|
|
647
|
+
rt(d, t, /* @__PURE__ */ new Set([e, r.id])) && l.push({
|
|
648
648
|
edge: n,
|
|
649
649
|
points: d
|
|
650
650
|
});
|
|
@@ -677,7 +677,7 @@ function at(e, t, n, r) {
|
|
|
677
677
|
let p = d.x + d.width / 2, m = d.y + d.height / 2;
|
|
678
678
|
if (l) {
|
|
679
679
|
let i = o ? d.x : d.x + d.width, a = m, s = o ? Math.max(...f.map((e) => e.node.x + e.node.width)) : Math.min(...f.map((e) => e.node.x)), c = s + (i - s) / 2;
|
|
680
|
-
c =
|
|
680
|
+
c = at(c, p, m, n, r);
|
|
681
681
|
let l = [];
|
|
682
682
|
for (let { edge: n, node: r } of f) {
|
|
683
683
|
let s = o ? r.x + r.width : r.x, u = r.y + r.height / 2, d = [
|
|
@@ -698,7 +698,7 @@ function at(e, t, n, r) {
|
|
|
698
698
|
y: a
|
|
699
699
|
}
|
|
700
700
|
];
|
|
701
|
-
|
|
701
|
+
rt(d, t, /* @__PURE__ */ new Set([r.id, e])) && l.push({
|
|
702
702
|
edge: n,
|
|
703
703
|
points: d
|
|
704
704
|
});
|
|
@@ -707,7 +707,7 @@ function at(e, t, n, r) {
|
|
|
707
707
|
for (let { edge: e, points: t } of l) e.points = t;
|
|
708
708
|
} else {
|
|
709
709
|
let i = p, a = c ? d.y + d.height : d.y, o = c ? Math.min(...f.map((e) => e.node.y)) : Math.max(...f.map((e) => e.node.y + e.node.height)), s = o + (a - o) / 2;
|
|
710
|
-
s =
|
|
710
|
+
s = at(s, p, m, n, r);
|
|
711
711
|
let l = [];
|
|
712
712
|
for (let { edge: n, node: r } of f) {
|
|
713
713
|
let o = r.x + r.width / 2, u = [
|
|
@@ -728,7 +728,7 @@ function at(e, t, n, r) {
|
|
|
728
728
|
y: a
|
|
729
729
|
}
|
|
730
730
|
];
|
|
731
|
-
|
|
731
|
+
rt(u, t, /* @__PURE__ */ new Set([r.id, e])) && l.push({
|
|
732
732
|
edge: n,
|
|
733
733
|
points: u
|
|
734
734
|
});
|
|
@@ -740,7 +740,7 @@ function at(e, t, n, r) {
|
|
|
740
740
|
}
|
|
741
741
|
//#endregion
|
|
742
742
|
//#region packages/svg-renderer/src/layout-engine/elk-adapter-utils.ts
|
|
743
|
-
function
|
|
743
|
+
function st(e, t = 0, n = 0) {
|
|
744
744
|
let r = [];
|
|
745
745
|
if (!e.sections || e.sections.length === 0) return r;
|
|
746
746
|
let i = e.sections[0];
|
|
@@ -756,7 +756,7 @@ function ot(e, t = 0, n = 0) {
|
|
|
756
756
|
y: i.endPoint.y + n
|
|
757
757
|
}), r;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function ct(e, t = 0, n = 0) {
|
|
760
760
|
if (!e.labels || e.labels.length === 0) return;
|
|
761
761
|
let r = e.labels[0];
|
|
762
762
|
if (r.x != null && r.y != null) return {
|
|
@@ -766,11 +766,11 @@ function st(e, t = 0, n = 0) {
|
|
|
766
766
|
}
|
|
767
767
|
//#endregion
|
|
768
768
|
//#region packages/svg-renderer/src/layout-engine/from-elk.ts
|
|
769
|
-
var
|
|
770
|
-
function
|
|
771
|
-
let n = e.x + e.width, r = e.y + e.height / 2, i = Math.min(
|
|
772
|
-
for (let e = 0; e <=
|
|
773
|
-
let t = Math.PI * e /
|
|
769
|
+
var lt = 16, ut = 28, dt = 18, ft = 28, pt = 10;
|
|
770
|
+
function mt(e, t) {
|
|
771
|
+
let n = e.x + e.width, r = e.y + e.height / 2, i = Math.min(ft, e.height * .6) / 2, a = ut + t * dt, o = [];
|
|
772
|
+
for (let e = 0; e <= lt; e++) {
|
|
773
|
+
let t = Math.PI * e / lt;
|
|
774
774
|
o.push({
|
|
775
775
|
x: n + a * Math.sin(t),
|
|
776
776
|
y: r - i * Math.cos(t)
|
|
@@ -779,12 +779,12 @@ function pt(e, t) {
|
|
|
779
779
|
return {
|
|
780
780
|
points: o,
|
|
781
781
|
labelPosition: {
|
|
782
|
-
x: n + a +
|
|
782
|
+
x: n + a + pt,
|
|
783
783
|
y: r
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function ht(e, t, n) {
|
|
788
788
|
let r = /* @__PURE__ */ new Map();
|
|
789
789
|
for (let i = 0; i < e.edges.length; i++) {
|
|
790
790
|
let a = e.edges[i];
|
|
@@ -793,7 +793,7 @@ function mt(e, t, n) {
|
|
|
793
793
|
if (!o) continue;
|
|
794
794
|
let s = r.get(o.id) ?? 0;
|
|
795
795
|
r.set(o.id, s + 1);
|
|
796
|
-
let { points: c, labelPosition: l } =
|
|
796
|
+
let { points: c, labelPosition: l } = mt(o, s);
|
|
797
797
|
n.push({
|
|
798
798
|
source: a.source,
|
|
799
799
|
target: a.target,
|
|
@@ -803,38 +803,38 @@ function mt(e, t, n) {
|
|
|
803
803
|
hasArrowEnd: a.hasArrowEnd,
|
|
804
804
|
points: c,
|
|
805
805
|
labelPosition: a.label ? l : void 0,
|
|
806
|
-
inlineStyle:
|
|
806
|
+
inlineStyle: Dt(i, e),
|
|
807
807
|
id: a.id,
|
|
808
808
|
animate: a.animate
|
|
809
809
|
});
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function gt(e) {
|
|
813
813
|
let t = [];
|
|
814
814
|
for (let n of e) t.push({
|
|
815
815
|
x: n.x,
|
|
816
816
|
y: n.y,
|
|
817
817
|
right: n.x + n.width,
|
|
818
818
|
bottom: n.y + n.height
|
|
819
|
-
}), t.push(...
|
|
819
|
+
}), t.push(...gt(n.children));
|
|
820
820
|
return t;
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function _t(e, t, n = !1) {
|
|
823
823
|
let r = [], i = [], a = [], o = /* @__PURE__ */ new Set();
|
|
824
|
-
for (let e of t.subgraphs)
|
|
825
|
-
|
|
826
|
-
let s =
|
|
827
|
-
|
|
824
|
+
for (let e of t.subgraphs) Et(e, o);
|
|
825
|
+
vt(e, t, o, r, a, 0, 0);
|
|
826
|
+
let s = gt(a);
|
|
827
|
+
xt(e, t, i, 0, 0, s.length > 0 ? {
|
|
828
828
|
leftX: Math.min(...s.map((e) => e.x)) - 20,
|
|
829
829
|
rightX: Math.max(...s.map((e) => e.right)) + 20
|
|
830
|
-
} : void 0),
|
|
830
|
+
} : void 0), tt(r, i, t.direction);
|
|
831
831
|
let c = new Map(r.map((e) => [e.id, e]));
|
|
832
|
-
|
|
832
|
+
ht(t, c, i), n && ot(i, r, a, t.direction);
|
|
833
833
|
for (let e of i) {
|
|
834
834
|
let t = c.get(e.source), n = c.get(e.target);
|
|
835
|
-
t && (e.points =
|
|
835
|
+
t && (e.points = Ze(e.points, t, !0)), n && (e.points = Ze(e.points, n, !1));
|
|
836
836
|
}
|
|
837
|
-
let l = e.width ?? 800, u = e.height ?? 600, d = z.width, f =
|
|
837
|
+
let l = e.width ?? 800, u = e.height ?? 600, d = z.width, f = Ae.padding;
|
|
838
838
|
for (let e of i) {
|
|
839
839
|
for (let t of e.points) l = Math.max(l, t.x + d + f), u = Math.max(u, t.y + d + f);
|
|
840
840
|
e.labelPosition && (l = Math.max(l, e.labelPosition.x + 60 + f), u = Math.max(u, e.labelPosition.y + 20 + f));
|
|
@@ -847,13 +847,13 @@ function gt(e, t, n = !1) {
|
|
|
847
847
|
groups: a
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function vt(e, t, n, r, i, a, o) {
|
|
851
851
|
if (e.children) for (let s of e.children) {
|
|
852
852
|
let e = (s.x ?? 0) + a, c = (s.y ?? 0) + o, l = s.width ?? 0, u = s.height ?? 0;
|
|
853
853
|
if (n.has(s.id)) {
|
|
854
854
|
let a = [];
|
|
855
|
-
|
|
856
|
-
let o =
|
|
855
|
+
vt(s, t, n, r, a, e, c);
|
|
856
|
+
let o = Tt(t.subgraphs, s.id);
|
|
857
857
|
i.push({
|
|
858
858
|
id: s.id,
|
|
859
859
|
label: o?.label ?? "",
|
|
@@ -880,11 +880,11 @@ function _t(e, t, n, r, i, a, o) {
|
|
|
880
880
|
interaction: t.interactions.get(s.id)
|
|
881
881
|
});
|
|
882
882
|
}
|
|
883
|
-
s.children && s.children.length > 0 &&
|
|
883
|
+
s.children && s.children.length > 0 && vt(s, t, n, r, i, e, c);
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function yt(e) {
|
|
888
888
|
let t = /^e(\d+)$/.exec(e);
|
|
889
889
|
if (t) return {
|
|
890
890
|
edgeIndex: parseInt(t[1], 10),
|
|
@@ -897,7 +897,7 @@ function vt(e) {
|
|
|
897
897
|
level: parseInt(n[3], 10)
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function bt(e) {
|
|
901
901
|
if (e.length === 0) return {
|
|
902
902
|
x: 0,
|
|
903
903
|
y: 0
|
|
@@ -922,11 +922,11 @@ function yt(e) {
|
|
|
922
922
|
}
|
|
923
923
|
return e[e.length - 1];
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function xt(e, t, n, r, i, a) {
|
|
926
926
|
let o = /* @__PURE__ */ new Map();
|
|
927
|
-
|
|
927
|
+
St(e, o, 0, 0);
|
|
928
928
|
let s = /* @__PURE__ */ new Map();
|
|
929
|
-
|
|
929
|
+
wt(e, s, 0, 0, o);
|
|
930
930
|
let c = 0;
|
|
931
931
|
for (let [e, r] of s) {
|
|
932
932
|
let i = t.edges[e];
|
|
@@ -939,9 +939,9 @@ function bt(e, t, n, r, i, a) {
|
|
|
939
939
|
let u = [...r.targetHops.keys()].sort((e, t) => e - t);
|
|
940
940
|
for (let e of u) s(r.targetHops.get(e));
|
|
941
941
|
let d;
|
|
942
|
-
i.label && o.length >= 2 && (d = r.bridge?.labelPosition ??
|
|
943
|
-
let f =
|
|
944
|
-
f !== o && c++, i.label && f !== o && f.length >= 2 && (d =
|
|
942
|
+
i.label && o.length >= 2 && (d = r.bridge?.labelPosition ?? bt(o));
|
|
943
|
+
let f = Ct(o, a, c);
|
|
944
|
+
f !== o && c++, i.label && f !== o && f.length >= 2 && (d = bt(f)), n.push({
|
|
945
945
|
source: i.source,
|
|
946
946
|
target: i.target,
|
|
947
947
|
label: i.label,
|
|
@@ -950,13 +950,13 @@ function bt(e, t, n, r, i, a) {
|
|
|
950
950
|
hasArrowEnd: i.hasArrowEnd,
|
|
951
951
|
points: f,
|
|
952
952
|
labelPosition: d,
|
|
953
|
-
inlineStyle:
|
|
953
|
+
inlineStyle: Dt(e, t),
|
|
954
954
|
id: i.id,
|
|
955
955
|
animate: i.animate
|
|
956
956
|
});
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function St(e, t, n, r) {
|
|
960
960
|
t.set(e.id, {
|
|
961
961
|
x: n,
|
|
962
962
|
y: r
|
|
@@ -964,10 +964,10 @@ function xt(e, t, n, r) {
|
|
|
964
964
|
for (let i of e.children ?? []) {
|
|
965
965
|
/* v8 ignore next */
|
|
966
966
|
let e = i.x ?? 0, a = i.y ?? 0;
|
|
967
|
-
|
|
967
|
+
St(i, t, n + e, r + a);
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
|
-
function
|
|
970
|
+
function Ct(e, t, n = 0) {
|
|
971
971
|
if (e.length < 2) return e;
|
|
972
972
|
let r = !1;
|
|
973
973
|
for (let t = 1; t < e.length; t++) {
|
|
@@ -1006,11 +1006,11 @@ function St(e, t, n = 0) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
return i;
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function wt(e, t, n, r, i) {
|
|
1010
1010
|
if (e.edges) for (let a of e.edges) {
|
|
1011
|
-
let e =
|
|
1011
|
+
let e = yt(a.id);
|
|
1012
1012
|
if (!e) continue;
|
|
1013
|
-
let { edgeIndex: o } = e, s = a.container, c = s ? i.get(s) : void 0, l = c?.x ?? n, u = c?.y ?? r, d =
|
|
1013
|
+
let { edgeIndex: o } = e, s = a.container, c = s ? i.get(s) : void 0, l = c?.x ?? n, u = c?.y ?? r, d = st(a, l, u), f = ct(a, l, u), p = t.get(o) ?? {
|
|
1014
1014
|
sourceHops: /* @__PURE__ */ new Map(),
|
|
1015
1015
|
targetHops: /* @__PURE__ */ new Map()
|
|
1016
1016
|
};
|
|
@@ -1022,20 +1022,20 @@ function Ct(e, t, n, r, i) {
|
|
|
1022
1022
|
};
|
|
1023
1023
|
e.role === "bridge" ? p.bridge = m : e.role === "source" ? p.sourceHops.set(e.level, m) : p.targetHops.set(e.level, m);
|
|
1024
1024
|
}
|
|
1025
|
-
if (e.children) for (let a of e.children)
|
|
1025
|
+
if (e.children) for (let a of e.children) wt(a, t, n + (a.x ?? 0), r + (a.y ?? 0), i);
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function Tt(e, t) {
|
|
1028
1028
|
for (let n of e) {
|
|
1029
1029
|
if (n.id === t) return n;
|
|
1030
|
-
let e =
|
|
1030
|
+
let e = Tt(n.children, t);
|
|
1031
1031
|
if (e) return e;
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1034
|
+
function Et(e, t) {
|
|
1035
1035
|
t.add(e.id);
|
|
1036
|
-
for (let n of e.children)
|
|
1036
|
+
for (let n of e.children) Et(n, t);
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function Dt(e, t) {
|
|
1039
1039
|
let n, r = t.linkStyles.get("default");
|
|
1040
1040
|
r && (n = { ...r });
|
|
1041
1041
|
let i = t.linkStyles.get(e);
|
|
@@ -1046,37 +1046,37 @@ function Et(e, t) {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
//#endregion
|
|
1048
1048
|
//#region packages/svg-renderer/src/layout-engine.ts
|
|
1049
|
-
function
|
|
1049
|
+
function Ot(e, t = {}) {
|
|
1050
1050
|
let n = {
|
|
1051
|
-
...
|
|
1051
|
+
...Ae,
|
|
1052
1052
|
...t,
|
|
1053
1053
|
fontSizes: P(t.fontSizes)
|
|
1054
1054
|
};
|
|
1055
|
-
return
|
|
1055
|
+
return _t(Te(qe(e, n), t.layoutCache), e, n.mergeEdges);
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1058
|
-
return
|
|
1059
|
-
...
|
|
1057
|
+
function kt(e, t = {}) {
|
|
1058
|
+
return qe(e, {
|
|
1059
|
+
...Ae,
|
|
1060
1060
|
...t,
|
|
1061
1061
|
fontSizes: P(t.fontSizes)
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
1064
|
//#endregion
|
|
1065
1065
|
//#region packages/svg-renderer/src/renderer.ts
|
|
1066
|
-
function
|
|
1066
|
+
function At(e, t, r = "Inter", i = !1, a = N, o = "linear", s, c = !0, l = !0, u, d, f = {}) {
|
|
1067
1067
|
let p = [], m = l && e.nodes.some((e) => !!b(e.interaction?.href));
|
|
1068
|
-
p.push(U(E(e.width, e.height, t, i, u, d, m, f.styleAttribute), s)), p.push(r
|
|
1068
|
+
p.push(U(E(e.width, e.height, t, i, u, d, m, f.styleAttribute), s)), p.push(n(r, !1, f.nonce)), c && e.edges.some((e) => e.animate) && p.push(jt(f.nonce)), p.push("<defs>"), p.push(Mt());
|
|
1069
1069
|
let h = /* @__PURE__ */ new Set();
|
|
1070
1070
|
for (let t of e.edges) t.inlineStyle?.stroke && h.add(t.inlineStyle.stroke);
|
|
1071
|
-
for (let e of h) p.push(
|
|
1071
|
+
for (let e of h) p.push(Nt(e));
|
|
1072
1072
|
p.push("</defs>");
|
|
1073
|
-
for (let t of e.groups) p.push(
|
|
1074
|
-
for (let t of e.edges) p.push(
|
|
1075
|
-
for (let t of e.edges) t.label && p.push(
|
|
1076
|
-
for (let t of e.nodes) p.push(
|
|
1073
|
+
for (let t of e.groups) p.push(It(t, r, a));
|
|
1074
|
+
for (let t of e.edges) p.push(Lt(t, o, c));
|
|
1075
|
+
for (let t of e.edges) t.label && p.push(zt(t, r, a));
|
|
1076
|
+
for (let t of e.nodes) p.push(Ut(t, r, a, l));
|
|
1077
1077
|
return p.push("</svg>"), p.join("\n");
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function jt(e) {
|
|
1080
1080
|
return [
|
|
1081
1081
|
T(e),
|
|
1082
1082
|
" @keyframes zm-edge-dash { to { stroke-dashoffset: -28; } }",
|
|
@@ -1087,67 +1087,67 @@ function At(e) {
|
|
|
1087
1087
|
"</style>"
|
|
1088
1088
|
].join("\n");
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
return
|
|
1090
|
+
function Mt() {
|
|
1091
|
+
return Pt("var(--_arrow)", "");
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1094
|
-
return
|
|
1093
|
+
function Nt(e) {
|
|
1094
|
+
return Pt(i(e), s`-${Ft(e)}`);
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1097
|
-
let n = z.width, r = z.height, i = n - 1, a = `fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`, o = `<polygon points="0 0, ${n} ${r / 2}, 0 ${r}" ${a} />`,
|
|
1098
|
-
return s
|
|
1096
|
+
function Pt(e, t) {
|
|
1097
|
+
let n = z.width, r = z.height, i = n - 1, a = s`fill="${e}" stroke="${e}" stroke-width="0.75" stroke-linejoin="round"`, o = s`<polygon points="0 0, ${n} ${r / 2}, 0 ${r}" ${a} />`, c = (e, t) => s` <marker id="${e}" markerWidth="${n}" markerHeight="${r}" refX="${i}" refY="${r / 2}" orient="${t}">` + s`\n ${o}` + "\n </marker>";
|
|
1098
|
+
return c(s`arrowhead${t}`, "auto") + "\n" + c(s`arrowhead-start${t}`, "auto-start-reverse");
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function Ft(e) {
|
|
1101
1101
|
return e.replace(/[^a-zA-Z0-9]/g, (e) => e.charCodeAt(0).toString(16));
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1104
|
-
let r = n.groupHeader + 16,
|
|
1105
|
-
|
|
1106
|
-
for (let r of e.children)
|
|
1107
|
-
return
|
|
1103
|
+
function It(e, t, n) {
|
|
1104
|
+
let r = n.groupHeader + 16, a = [];
|
|
1105
|
+
a.push(s`<g class="subgraph" data-id="${i(e.id)}" data-label="${i(e.label)}">`), a.push(s` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + s`rx="0" ry="0" fill="var(--_group-fill)" stroke="var(--_node-stroke)" stroke-width="${L.outerBox}" />`), a.push(s` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${r}" ` + s`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${L.outerBox}" />`), a.push(" " + _(e.label, e.x + 12, e.y + r / 2, n.groupHeader, s`font-size="${n.groupHeader}" font-weight="${F.groupHeader}" fill="var(--_text-sec)"`));
|
|
1106
|
+
for (let r of e.children) a.push(It(r, t, n));
|
|
1107
|
+
return a.push("</g>"), a.join("\n");
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1109
|
+
function Lt(e, t, n = !0) {
|
|
1110
1110
|
if (e.points.length < 2) return "";
|
|
1111
|
-
let r = n && (e.animate ?? !1),
|
|
1112
|
-
o || (e.hasArrowEnd && (
|
|
1113
|
-
let
|
|
1114
|
-
`class="edge${r ? " edge-animated" : ""}"`,
|
|
1115
|
-
`data-from="${
|
|
1116
|
-
`data-to="${
|
|
1117
|
-
`data-style="${e.style}"`,
|
|
1118
|
-
`data-arrow-start="${e.hasArrowStart}"`,
|
|
1119
|
-
`data-arrow-end="${e.hasArrowEnd}"`
|
|
1111
|
+
let r = n && (e.animate ?? !1), a = t !== "linear", o = e.style === "invisible", c = e.style === "dotted" ? " stroke-dasharray=\"4 4\"" : "", l = e.style === "thick" ? L.connector * 2 : L.connector, u = o ? "none" : i(e.inlineStyle?.stroke ?? "var(--_line)"), d = i(e.inlineStyle?.["stroke-width"] ?? String(l)), f = e.inlineStyle?.stroke ? s`-${Ft(e.inlineStyle.stroke)}` : "", p = "";
|
|
1112
|
+
o || (e.hasArrowEnd && (p += s` marker-end="url(#arrowhead${f})"`), e.hasArrowStart && (p += s` marker-start="url(#arrowhead-start${f})"`));
|
|
1113
|
+
let m = [
|
|
1114
|
+
s`class="edge${r ? " edge-animated" : ""}"`,
|
|
1115
|
+
s`data-from="${i(e.source)}"`,
|
|
1116
|
+
s`data-to="${i(e.target)}"`,
|
|
1117
|
+
s`data-style="${e.style}"`,
|
|
1118
|
+
s`data-arrow-start="${e.hasArrowStart}"`,
|
|
1119
|
+
s`data-arrow-end="${e.hasArrowEnd}"`
|
|
1120
1120
|
];
|
|
1121
|
-
e.label &&
|
|
1122
|
-
let
|
|
1123
|
-
return `<${
|
|
1121
|
+
e.label && m.push(s`data-label="${i(e.label)}"`), e.id && m.push(s`data-id="${i(e.id)}"`);
|
|
1122
|
+
let h = r && !c ? " stroke-dasharray=\"8 6\"" : "", g = a ? s`d="${ve(e.points, t)}"` : s`points="${Rt(e.points)}"`;
|
|
1123
|
+
return s`<${a ? "path" : "polyline"} ${m.join(" ")} ${g} ` + s`fill="none" stroke="${u}" ` + s`stroke-width="${d}"${c}${h}${p} />`;
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1126
|
-
return e.map((e) => `${e.x},${e.y}`).join(" ");
|
|
1125
|
+
function Rt(e) {
|
|
1126
|
+
return e.map((e) => s`${e.x},${e.y}`).join(" ");
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function zt(e, t, n) {
|
|
1129
1129
|
if (!e.label) return "";
|
|
1130
|
-
let r = e.label,
|
|
1131
|
-
return `<g class="edge-label" data-from="${
|
|
1130
|
+
let r = e.label, a = e.labelPosition ?? Vt(e.points), o = d(r, n.edgeLabel, F.edgeLabel), c = v(r, a.x, a.y, o.width, o.height, n.edgeLabel, 8, s`text-anchor="middle" font-size="${n.edgeLabel}" font-weight="${F.edgeLabel}" fill="var(--_text-sec)"`, "rx=\"2\" ry=\"2\" fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"1\"");
|
|
1131
|
+
return s`<g class="edge-label" data-from="${i(e.source)}" data-to="${i(e.target)}" data-label="${i(r)}">\n` + s` ${c.replace(/\n/g, "\n ")}\n` + "</g>";
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Bt(e, t) {
|
|
1134
1134
|
let n = e[t];
|
|
1135
1135
|
if (!n)
|
|
1136
1136
|
/* v8 ignore next */
|
|
1137
|
-
throw Error(`edgeMidpoint: missing point at index ${t}`);
|
|
1137
|
+
throw Error(s`edgeMidpoint: missing point at index ${t}`);
|
|
1138
1138
|
return n;
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function Vt(e) {
|
|
1141
1141
|
if (e.length === 0) return {
|
|
1142
1142
|
x: 0,
|
|
1143
1143
|
y: 0
|
|
1144
1144
|
};
|
|
1145
1145
|
if (e.length === 1) return e[0];
|
|
1146
1146
|
let t = 0;
|
|
1147
|
-
for (let n = 1; n < e.length; n++) t +=
|
|
1147
|
+
for (let n = 1; n < e.length; n++) t += Ht(Bt(e, n - 1), Bt(e, n));
|
|
1148
1148
|
let n = t / 2;
|
|
1149
1149
|
for (let t = 1; t < e.length; t++) {
|
|
1150
|
-
let r =
|
|
1150
|
+
let r = Bt(e, t - 1), i = Bt(e, t), a = Ht(r, i);
|
|
1151
1151
|
if (n <= a) {
|
|
1152
1152
|
let e = n / a;
|
|
1153
1153
|
return {
|
|
@@ -1159,281 +1159,287 @@ function Bt(e) {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
return e[e.length - 1];
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1162
|
+
function Ht(e, t) {
|
|
1163
1163
|
return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2);
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1166
|
-
let
|
|
1167
|
-
`class="${
|
|
1168
|
-
`data-id="${
|
|
1169
|
-
`data-label="${
|
|
1170
|
-
`data-shape="${e.shape}"`
|
|
1165
|
+
function Ut(e, t, n, r = !0) {
|
|
1166
|
+
let o = Wt(e), c = Tn(e, t, n), l = [], u = x(e.className), d = u ? s`node ${u}` : "node", f = e.interaction, p = [
|
|
1167
|
+
s`class="${d}"`,
|
|
1168
|
+
s`data-id="${i(e.id)}"`,
|
|
1169
|
+
s`data-label="${i(e.label)}"`,
|
|
1170
|
+
s`data-shape="${e.shape}"`
|
|
1171
1171
|
];
|
|
1172
|
-
|
|
1173
|
-
let
|
|
1174
|
-
if (
|
|
1175
|
-
let e =
|
|
1176
|
-
|
|
1172
|
+
l.push(s`<g ${p.join(" ")}>`);
|
|
1173
|
+
let m = r ? b(f?.href) : void 0, h = m ? " " : " ";
|
|
1174
|
+
if (m) {
|
|
1175
|
+
let e = f?.target ? s` target="${i(f.target)}"` : "";
|
|
1176
|
+
l.push(s` <a href="${i(m)}"${e}>`);
|
|
1177
1177
|
}
|
|
1178
|
-
return r &&
|
|
1178
|
+
return r && f?.tooltip && l.push(s`${h}<title>${a(f.tooltip)}</title>`), l.push(s`${h}${o.replace(/\n/g, s`\n${h}`)}`), c && l.push(s`${h}${c.replace(/\n/g, s`\n${h}`)}`), m && l.push(" </a>"), l.push("</g>"), l.join("\n");
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1181
|
-
let { x: t, y: n, width: r, height:
|
|
1180
|
+
function Wt(e) {
|
|
1181
|
+
let { x: t, y: n, width: r, height: a, shape: o, inlineStyle: s } = e, c = i(s?.fill ?? "var(--_node-fill)"), l = i(s?.stroke ?? "var(--_node-stroke)"), u = i(s?.["stroke-width"] ?? String(L.innerBox));
|
|
1182
1182
|
switch (o) {
|
|
1183
|
-
case "diamond": return
|
|
1184
|
-
case "rounded": return
|
|
1185
|
-
case "stadium": return
|
|
1186
|
-
case "circle": return
|
|
1187
|
-
case "subroutine": return
|
|
1188
|
-
case "doublecircle": return
|
|
1189
|
-
case "hexagon": return
|
|
1190
|
-
case "cylinder": return
|
|
1191
|
-
case "asymmetric": return
|
|
1192
|
-
case "trapezoid": return
|
|
1193
|
-
case "trapezoid-alt": return
|
|
1194
|
-
case "parallelogram": return
|
|
1195
|
-
case "parallelogram-alt": return
|
|
1196
|
-
case "state-start": return
|
|
1197
|
-
case "state-end": return
|
|
1198
|
-
case "document": return
|
|
1199
|
-
case "stacked-document": return
|
|
1200
|
-
case "stacked-process": return
|
|
1201
|
-
case "card": return
|
|
1202
|
-
case "lined-process": return
|
|
1203
|
-
case "divided-process": return
|
|
1204
|
-
case "window-pane": return
|
|
1205
|
-
case "triangle": return
|
|
1206
|
-
case "flipped-triangle": return
|
|
1207
|
-
case "filled-circle": return
|
|
1208
|
-
case "crossed-circle": return
|
|
1209
|
-
case "fork-join": return
|
|
1210
|
-
case "notched-pentagon": return
|
|
1211
|
-
case "sloped-rectangle": return
|
|
1212
|
-
case "flag": return
|
|
1213
|
-
case "bow-tie-rectangle": return
|
|
1214
|
-
case "half-rounded-rectangle": return
|
|
1215
|
-
case "brace": return
|
|
1216
|
-
case "brace-right": return
|
|
1217
|
-
case "braces": return
|
|
1218
|
-
case "bolt": return
|
|
1183
|
+
case "diamond": return Yt(t, n, r, a, c, l, u);
|
|
1184
|
+
case "rounded": return Kt(t, n, r, a, c, l, u);
|
|
1185
|
+
case "stadium": return qt(t, n, r, a, c, l, u);
|
|
1186
|
+
case "circle": return Jt(t, n, r, a, c, l, u);
|
|
1187
|
+
case "subroutine": return Xt(t, n, r, a, c, l, u);
|
|
1188
|
+
case "doublecircle": return Zt(t, n, r, a, c, l, u);
|
|
1189
|
+
case "hexagon": return Qt(t, n, r, a, c, l, u);
|
|
1190
|
+
case "cylinder": return $t(t, n, r, a, c, l, u);
|
|
1191
|
+
case "asymmetric": return en(t, n, r, a, c, l, u);
|
|
1192
|
+
case "trapezoid": return tn(t, n, r, a, c, l, u);
|
|
1193
|
+
case "trapezoid-alt": return nn(t, n, r, a, c, l, u);
|
|
1194
|
+
case "parallelogram": return rn(t, n, r, a, c, l, u);
|
|
1195
|
+
case "parallelogram-alt": return an(t, n, r, a, c, l, u);
|
|
1196
|
+
case "state-start": return Cn(t, n, r, a);
|
|
1197
|
+
case "state-end": return wn(t, n, r, a);
|
|
1198
|
+
case "document": return on(t, n, r, a, c, l, u);
|
|
1199
|
+
case "stacked-document": return sn(t, n, r, a, c, l, u, !0);
|
|
1200
|
+
case "stacked-process": return sn(t, n, r, a, c, l, u, !1);
|
|
1201
|
+
case "card": return cn(t, n, r, a, c, l, u);
|
|
1202
|
+
case "lined-process": return ln(t, n, r, a, c, l, u);
|
|
1203
|
+
case "divided-process": return un(t, n, r, a, c, l, u);
|
|
1204
|
+
case "window-pane": return dn(t, n, r, a, c, l, u);
|
|
1205
|
+
case "triangle": return fn(t, n, r, a, c, l, u, !1);
|
|
1206
|
+
case "flipped-triangle": return fn(t, n, r, a, c, l, u, !0);
|
|
1207
|
+
case "filled-circle": return pn(t, n, r, a, l);
|
|
1208
|
+
case "crossed-circle": return mn(t, n, r, a, c, l, u);
|
|
1209
|
+
case "fork-join": return hn(t, n, r, a, l);
|
|
1210
|
+
case "notched-pentagon": return gn(t, n, r, a, c, l, u);
|
|
1211
|
+
case "sloped-rectangle": return _n(t, n, r, a, c, l, u);
|
|
1212
|
+
case "flag": return vn(t, n, r, a, c, l, u);
|
|
1213
|
+
case "bow-tie-rectangle": return yn(t, n, r, a, c, l, u);
|
|
1214
|
+
case "half-rounded-rectangle": return bn(t, n, r, a, c, l, u);
|
|
1215
|
+
case "brace": return xn(t, n, r, a, c, l, u, "left");
|
|
1216
|
+
case "brace-right": return xn(t, n, r, a, c, l, u, "right");
|
|
1217
|
+
case "braces": return xn(t, n, r, a, c, l, u, "both");
|
|
1218
|
+
case "bolt": return Sn(t, n, r, a, c, l, u);
|
|
1219
1219
|
case "text":
|
|
1220
1220
|
case "anchor": return "";
|
|
1221
|
-
default: return
|
|
1221
|
+
default: return Gt(t, n, r, a, c, l, u);
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
function Wt(e, t, n, r, i, a, o) {
|
|
1225
|
-
return `<rect x="${e}" y="${t}" width="${n}" height="${r}" rx="0" ry="0" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1226
|
-
}
|
|
1227
1224
|
function Gt(e, t, n, r, i, a, o) {
|
|
1228
|
-
return `<rect x="${e}" y="${t}" width="${n}" height="${r}" rx="
|
|
1225
|
+
return s`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + s`rx="0" ry="0" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1229
1226
|
}
|
|
1230
1227
|
function Kt(e, t, n, r, i, a, o) {
|
|
1231
|
-
|
|
1232
|
-
return `<rect x="${e}" y="${t}" width="${n}" height="${r}" rx="${s}" ry="${s}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1228
|
+
return s`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + s`rx="6" ry="6" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1233
1229
|
}
|
|
1234
1230
|
function qt(e, t, n, r, i, a, o) {
|
|
1235
|
-
|
|
1231
|
+
let c = r / 2;
|
|
1232
|
+
return s`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + s`rx="${c}" ry="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1236
1233
|
}
|
|
1237
1234
|
function Jt(e, t, n, r, i, a, o) {
|
|
1238
|
-
let
|
|
1239
|
-
return `<
|
|
1240
|
-
`${s},${c - u}`,
|
|
1241
|
-
`${s + l},${c}`,
|
|
1242
|
-
`${s},${c + u}`,
|
|
1243
|
-
`${s - l},${c}`
|
|
1244
|
-
].join(" ")}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1235
|
+
let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2;
|
|
1236
|
+
return s`<circle cx="${c}" cy="${l}" r="${u}" ` + s`fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1245
1237
|
}
|
|
1246
1238
|
function Yt(e, t, n, r, i, a, o) {
|
|
1247
|
-
|
|
1239
|
+
let c = e + n / 2, l = t + r / 2, u = n / 2, d = r / 2, f = [
|
|
1240
|
+
s`${c},${l - d}`,
|
|
1241
|
+
s`${c + u},${l}`,
|
|
1242
|
+
s`${c},${l + d}`,
|
|
1243
|
+
s`${c - u},${l}`
|
|
1244
|
+
].join(" ");
|
|
1245
|
+
return s`<polygon points="${f}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1248
1246
|
}
|
|
1249
1247
|
function Xt(e, t, n, r, i, a, o) {
|
|
1250
|
-
|
|
1251
|
-
return `<circle cx="${s}" cy="${c}" r="${l}" fill="${i}" stroke="${a}" stroke-width="${o}" />\n<circle cx="${s}" cy="${c}" r="${l - 5}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1248
|
+
return s`<rect x="${e}" y="${t}" width="${n}" height="${r}" ` + s`rx="0" ry="0" fill="${i}" stroke="${a}" stroke-width="${o}" />` + s`\n<line x1="${e + 8}" y1="${t}" x2="${e + 8}" y2="${t + r}" ` + s`stroke="${a}" stroke-width="${o}" />` + s`\n<line x1="${e + n - 8}" y1="${t}" x2="${e + n - 8}" y2="${t + r}" ` + s`stroke="${a}" stroke-width="${o}" />`;
|
|
1252
1249
|
}
|
|
1253
1250
|
function Zt(e, t, n, r, i, a, o) {
|
|
1254
|
-
let
|
|
1255
|
-
return `<
|
|
1256
|
-
`${e + s},${t}`,
|
|
1257
|
-
`${e + n - s},${t}`,
|
|
1258
|
-
`${e + n},${t + r / 2}`,
|
|
1259
|
-
`${e + n - s},${t + r}`,
|
|
1260
|
-
`${e + s},${t + r}`,
|
|
1261
|
-
`${e},${t + r / 2}`
|
|
1262
|
-
].join(" ")}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1251
|
+
let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2, d = u - 5;
|
|
1252
|
+
return s`<circle cx="${c}" cy="${l}" r="${u}" ` + s`fill="${i}" stroke="${a}" stroke-width="${o}" />` + s`\n<circle cx="${c}" cy="${l}" r="${d}" ` + s`fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1263
1253
|
}
|
|
1264
1254
|
function Qt(e, t, n, r, i, a, o) {
|
|
1265
|
-
let
|
|
1266
|
-
|
|
1255
|
+
let c = r / 4, l = [
|
|
1256
|
+
s`${e + c},${t}`,
|
|
1257
|
+
s`${e + n - c},${t}`,
|
|
1258
|
+
s`${e + n},${t + r / 2}`,
|
|
1259
|
+
s`${e + n - c},${t + r}`,
|
|
1260
|
+
s`${e + c},${t + r}`,
|
|
1261
|
+
s`${e},${t + r / 2}`
|
|
1262
|
+
].join(" ");
|
|
1263
|
+
return s`<polygon points="${l}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1267
1264
|
}
|
|
1268
1265
|
function $t(e, t, n, r, i, a, o) {
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
`${e + n},${t}`,
|
|
1272
|
-
`${e + n},${t + r}`,
|
|
1273
|
-
`${e + 12},${t + r}`,
|
|
1274
|
-
`${e},${t + r / 2}`
|
|
1275
|
-
].join(" ")}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1266
|
+
let c = e + n / 2, l = t + 7, u = r - 14;
|
|
1267
|
+
return s`<rect x="${e}" y="${l}" width="${n}" height="${u}" ` + s`fill="${i}" stroke="none" />` + s`\n<line x1="${e}" y1="${l}" x2="${e}" y2="${l + u}" stroke="${a}" stroke-width="${o}" />` + s`\n<line x1="${e + n}" y1="${l}" x2="${e + n}" y2="${l + u}" stroke="${a}" stroke-width="${o}" />` + s`\n<ellipse cx="${c}" cy="${t + r - 7}" rx="${n / 2}" ry="${7}" ` + s`fill="${i}" stroke="${a}" stroke-width="${o}" />` + s`\n<ellipse cx="${c}" cy="${l}" rx="${n / 2}" ry="${7}" ` + s`fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1276
1268
|
}
|
|
1277
1269
|
function en(e, t, n, r, i, a, o) {
|
|
1278
|
-
let
|
|
1279
|
-
|
|
1280
|
-
`${e +
|
|
1281
|
-
`${e + n
|
|
1282
|
-
`${e +
|
|
1283
|
-
`${e},${t + r}`
|
|
1284
|
-
].join(" ")
|
|
1270
|
+
let c = [
|
|
1271
|
+
s`${e + 12},${t}`,
|
|
1272
|
+
s`${e + n},${t}`,
|
|
1273
|
+
s`${e + n},${t + r}`,
|
|
1274
|
+
s`${e + 12},${t + r}`,
|
|
1275
|
+
s`${e},${t + r / 2}`
|
|
1276
|
+
].join(" ");
|
|
1277
|
+
return s`<polygon points="${c}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1285
1278
|
}
|
|
1286
1279
|
function tn(e, t, n, r, i, a, o) {
|
|
1287
|
-
let
|
|
1288
|
-
|
|
1289
|
-
`${e},${t}`,
|
|
1290
|
-
`${e + n},${t}`,
|
|
1291
|
-
`${e
|
|
1292
|
-
|
|
1293
|
-
|
|
1280
|
+
let c = n * .15, l = [
|
|
1281
|
+
s`${e + c},${t}`,
|
|
1282
|
+
s`${e + n - c},${t}`,
|
|
1283
|
+
s`${e + n},${t + r}`,
|
|
1284
|
+
s`${e},${t + r}`
|
|
1285
|
+
].join(" ");
|
|
1286
|
+
return s`<polygon points="${l}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1294
1287
|
}
|
|
1295
1288
|
function nn(e, t, n, r, i, a, o) {
|
|
1296
|
-
let
|
|
1297
|
-
|
|
1298
|
-
`${e +
|
|
1299
|
-
`${e + n},${t}`,
|
|
1300
|
-
`${e +
|
|
1301
|
-
|
|
1302
|
-
|
|
1289
|
+
let c = n * .15, l = [
|
|
1290
|
+
s`${e},${t}`,
|
|
1291
|
+
s`${e + n},${t}`,
|
|
1292
|
+
s`${e + n - c},${t + r}`,
|
|
1293
|
+
s`${e + c},${t + r}`
|
|
1294
|
+
].join(" ");
|
|
1295
|
+
return s`<polygon points="${l}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1303
1296
|
}
|
|
1304
1297
|
function rn(e, t, n, r, i, a, o) {
|
|
1305
|
-
let
|
|
1306
|
-
|
|
1307
|
-
`${e},${t}`,
|
|
1308
|
-
`${e + n -
|
|
1309
|
-
`${e
|
|
1310
|
-
|
|
1311
|
-
|
|
1298
|
+
let c = n * .15, l = [
|
|
1299
|
+
s`${e + c},${t}`,
|
|
1300
|
+
s`${e + n},${t}`,
|
|
1301
|
+
s`${e + n - c},${t + r}`,
|
|
1302
|
+
s`${e},${t + r}`
|
|
1303
|
+
].join(" ");
|
|
1304
|
+
return s`<polygon points="${l}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1305
|
+
}
|
|
1306
|
+
function an(e, t, n, r, i, a, o) {
|
|
1307
|
+
let c = n * .15, l = [
|
|
1308
|
+
s`${e},${t}`,
|
|
1309
|
+
s`${e + n - c},${t}`,
|
|
1310
|
+
s`${e + n},${t + r}`,
|
|
1311
|
+
s`${e + c},${t + r}`
|
|
1312
|
+
].join(" ");
|
|
1313
|
+
return s`<polygon points="${l}" fill="${i}" stroke="${a}" stroke-width="${o}" />`;
|
|
1312
1314
|
}
|
|
1313
1315
|
function H(e, t, n) {
|
|
1314
|
-
return `fill="${e}" stroke="${t}" stroke-width="${n}"`;
|
|
1316
|
+
return s`fill="${e}" stroke="${t}" stroke-width="${n}"`;
|
|
1315
1317
|
}
|
|
1316
|
-
function
|
|
1317
|
-
let
|
|
1318
|
-
return `<path d="${
|
|
1319
|
-
}
|
|
1320
|
-
function
|
|
1321
|
-
let
|
|
1322
|
-
for (let n = 2; n >= 1; n--)
|
|
1323
|
-
return
|
|
1324
|
-
}
|
|
1325
|
-
function sn(e, t, n, r, i, a, o) {
|
|
1326
|
-
let s = Math.min(14, n * .12, r * .3);
|
|
1327
|
-
return `<polygon points="${[
|
|
1328
|
-
`${e + s},${t}`,
|
|
1329
|
-
`${e + n},${t}`,
|
|
1330
|
-
`${e + n},${t + r}`,
|
|
1331
|
-
`${e},${t + r}`,
|
|
1332
|
-
`${e},${t + s}`
|
|
1333
|
-
].join(" ")}" ${H(i, a, o)} />`;
|
|
1318
|
+
function on(e, t, n, r, i, a, o) {
|
|
1319
|
+
let c = Math.min(10, r * .16), l = t + r - c, u = s`M ${e} ${t} L ${e + n} ${t} L ${e + n} ${l} ` + s`C ${e + n * .75} ${l + c * 1.8} ${e + n * .25} ${l - c * .8} ${e} ${l} Z`;
|
|
1320
|
+
return s`<path d="${u}" ${H(i, a, o)} />`;
|
|
1321
|
+
}
|
|
1322
|
+
function sn(e, t, n, r, i, a, o, c) {
|
|
1323
|
+
let l = n - 10, u = r - 10, d = [];
|
|
1324
|
+
for (let n = 2; n >= 1; n--) d.push(s`<rect x="${e + 5 * n}" y="${t + 5 * (2 - n)}" width="${l}" height="${u}" ` + s`${H(i, a, o)} />`);
|
|
1325
|
+
return d.push(c ? on(e, t + 10, l, u, i, a, o) : s`<rect x="${e}" y="${t + 10}" width="${l}" height="${u}" ${H(i, a, o)} />`), d.join("\n");
|
|
1334
1326
|
}
|
|
1335
1327
|
function cn(e, t, n, r, i, a, o) {
|
|
1336
|
-
let
|
|
1337
|
-
|
|
1328
|
+
let c = Math.min(14, n * .12, r * .3), l = [
|
|
1329
|
+
s`${e + c},${t}`,
|
|
1330
|
+
s`${e + n},${t}`,
|
|
1331
|
+
s`${e + n},${t + r}`,
|
|
1332
|
+
s`${e},${t + r}`,
|
|
1333
|
+
s`${e},${t + c}`
|
|
1334
|
+
].join(" ");
|
|
1335
|
+
return s`<polygon points="${l}" ${H(i, a, o)} />`;
|
|
1338
1336
|
}
|
|
1339
1337
|
function ln(e, t, n, r, i, a, o) {
|
|
1340
|
-
let
|
|
1341
|
-
return `<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, a, o)} />\n
|
|
1338
|
+
let c = Math.min(12, n * .12);
|
|
1339
|
+
return s`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, a, o)} />\n` + s`<line x1="${e + c}" y1="${t}" x2="${e + c}" y2="${t + r}" stroke="${a}" stroke-width="${o}" />`;
|
|
1342
1340
|
}
|
|
1343
1341
|
function un(e, t, n, r, i, a, o) {
|
|
1344
|
-
let
|
|
1345
|
-
return `<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, a, o)} />\n
|
|
1346
|
-
}
|
|
1347
|
-
function dn(e, t, n, r, i, a, o
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1342
|
+
let c = t + Math.min(16, r * .3);
|
|
1343
|
+
return s`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, a, o)} />\n` + s`<line x1="${e}" y1="${c}" x2="${e + n}" y2="${c}" stroke="${a}" stroke-width="${o}" />`;
|
|
1344
|
+
}
|
|
1345
|
+
function dn(e, t, n, r, i, a, o) {
|
|
1346
|
+
let c = e + Math.min(16, n * .16), l = t + Math.min(14, r * .28);
|
|
1347
|
+
return s`<rect x="${e}" y="${t}" width="${n}" height="${r}" ${H(i, a, o)} />\n` + s`<line x1="${c}" y1="${t}" x2="${c}" y2="${t + r}" stroke="${a}" stroke-width="${o}" />\n` + s`<line x1="${e}" y1="${l}" x2="${e + n}" y2="${l}" stroke="${a}" stroke-width="${o}" />`;
|
|
1348
|
+
}
|
|
1349
|
+
function fn(e, t, n, r, i, a, o, c) {
|
|
1350
|
+
let l = c ? [
|
|
1351
|
+
s`${e},${t}`,
|
|
1352
|
+
s`${e + n},${t}`,
|
|
1353
|
+
s`${e + n / 2},${t + r}`
|
|
1352
1354
|
] : [
|
|
1353
|
-
`${e + n / 2},${t}`,
|
|
1354
|
-
`${e + n},${t + r}`,
|
|
1355
|
-
`${e},${t + r}`
|
|
1356
|
-
]
|
|
1355
|
+
s`${e + n / 2},${t}`,
|
|
1356
|
+
s`${e + n},${t + r}`,
|
|
1357
|
+
s`${e},${t + r}`
|
|
1358
|
+
];
|
|
1359
|
+
return s`<polygon points="${l.join(" ")}" ${H(i, a, o)} />`;
|
|
1357
1360
|
}
|
|
1358
|
-
function
|
|
1361
|
+
function pn(e, t, n, r, i) {
|
|
1359
1362
|
let a = Math.min(n, r) / 2 - 2;
|
|
1360
|
-
return `<circle cx="${e + n / 2}" cy="${t + r / 2}" r="${a}" fill="${i}" stroke="${i}" />`;
|
|
1363
|
+
return s`<circle cx="${e + n / 2}" cy="${t + r / 2}" r="${a}" fill="${i}" stroke="${i}" />`;
|
|
1361
1364
|
}
|
|
1362
|
-
function
|
|
1363
|
-
let
|
|
1364
|
-
return `<circle cx="${
|
|
1365
|
+
function mn(e, t, n, r, i, a, o) {
|
|
1366
|
+
let c = e + n / 2, l = t + r / 2, u = Math.min(n, r) / 2 - 2, d = u / Math.SQRT2;
|
|
1367
|
+
return s`<circle cx="${c}" cy="${l}" r="${u}" ${H(i, a, o)} />\n` + s`<line x1="${c - d}" y1="${l - d}" x2="${c + d}" y2="${l + d}" stroke="${a}" stroke-width="${o}" />\n` + s`<line x1="${c + d}" y1="${l - d}" x2="${c - d}" y2="${l + d}" stroke="${a}" stroke-width="${o}" />`;
|
|
1365
1368
|
}
|
|
1366
|
-
function
|
|
1369
|
+
function hn(e, t, n, r, i) {
|
|
1367
1370
|
let a = Math.min(8, r);
|
|
1368
|
-
return `<rect x="${e}" y="${t + (r - a) / 2}" width="${n}" height="${a}" fill="${i}" stroke="${i}" />`;
|
|
1369
|
-
}
|
|
1370
|
-
function hn(e, t, n, r, i, a, o) {
|
|
1371
|
-
let s = Math.min(14, n * .12, r * .3);
|
|
1372
|
-
return `<polygon points="${[
|
|
1373
|
-
`${e + s},${t}`,
|
|
1374
|
-
`${e + n - s},${t}`,
|
|
1375
|
-
`${e + n},${t + s}`,
|
|
1376
|
-
`${e + n},${t + r}`,
|
|
1377
|
-
`${e},${t + r}`,
|
|
1378
|
-
`${e},${t + s}`
|
|
1379
|
-
].join(" ")}" ${H(i, a, o)} />`;
|
|
1371
|
+
return s`<rect x="${e}" y="${t + (r - a) / 2}" width="${n}" height="${a}" fill="${i}" stroke="${i}" />`;
|
|
1380
1372
|
}
|
|
1381
1373
|
function gn(e, t, n, r, i, a, o) {
|
|
1382
|
-
|
|
1383
|
-
`${e},${t
|
|
1384
|
-
`${e + n},${t}`,
|
|
1385
|
-
`${e + n},${t +
|
|
1386
|
-
`${e},${t + r}
|
|
1387
|
-
|
|
1374
|
+
let c = Math.min(14, n * .12, r * .3), l = [
|
|
1375
|
+
s`${e + c},${t}`,
|
|
1376
|
+
s`${e + n - c},${t}`,
|
|
1377
|
+
s`${e + n},${t + c}`,
|
|
1378
|
+
s`${e + n},${t + r}`,
|
|
1379
|
+
s`${e},${t + r}`,
|
|
1380
|
+
s`${e},${t + c}`
|
|
1381
|
+
].join(" ");
|
|
1382
|
+
return s`<polygon points="${l}" ${H(i, a, o)} />`;
|
|
1388
1383
|
}
|
|
1389
1384
|
function _n(e, t, n, r, i, a, o) {
|
|
1390
|
-
let
|
|
1391
|
-
|
|
1385
|
+
let c = Math.min(12, r * .3), l = [
|
|
1386
|
+
s`${e},${t + c}`,
|
|
1387
|
+
s`${e + n},${t}`,
|
|
1388
|
+
s`${e + n},${t + r}`,
|
|
1389
|
+
s`${e},${t + r}`
|
|
1390
|
+
].join(" ");
|
|
1391
|
+
return s`<polygon points="${l}" ${H(i, a, o)} />`;
|
|
1392
1392
|
}
|
|
1393
1393
|
function vn(e, t, n, r, i, a, o) {
|
|
1394
|
-
let
|
|
1395
|
-
return `<path d="${
|
|
1394
|
+
let c = Math.min(8, r * .14), l = s`M ${e} ${t + c} ` + s`C ${e + n * .25} ${t - c} ${e + n * .75} ${t + c * 2} ${e + n} ${t + c} ` + s`L ${e + n} ${t + r - c} ` + s`C ${e + n * .75} ${t + r + c} ${e + n * .25} ${t + r - c * 2} ${e} ${t + r - c} Z`;
|
|
1395
|
+
return s`<path d="${l}" ${H(i, a, o)} />`;
|
|
1396
1396
|
}
|
|
1397
1397
|
function yn(e, t, n, r, i, a, o) {
|
|
1398
|
-
let
|
|
1399
|
-
return `<path d="${
|
|
1400
|
-
}
|
|
1401
|
-
function bn(e, t, n, r, i, a, o
|
|
1402
|
-
let c =
|
|
1403
|
-
return
|
|
1404
|
-
}
|
|
1405
|
-
function xn(e, t, n, r, i, a, o) {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
`${e + n * .
|
|
1412
|
-
`${e + n
|
|
1413
|
-
`${e},${t + r * .
|
|
1414
|
-
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1398
|
+
let c = Math.min(14, n * .12), l = s`M ${e + c} ${t} L ${e + n} ${t} ` + s`Q ${e + n - c * 1.4} ${t + r / 2} ${e + n} ${t + r} ` + s`L ${e + c} ${t + r} ` + s`Q ${e + c * 1.4} ${t + r / 2} ${e + c} ${t} Z`;
|
|
1399
|
+
return s`<path d="${l}" ${H(i, a, o)} />`;
|
|
1400
|
+
}
|
|
1401
|
+
function bn(e, t, n, r, i, a, o) {
|
|
1402
|
+
let c = r / 2, l = Math.max(0, n - c), u = s`M ${e} ${t} L ${e + l} ${t} ` + s`A ${c} ${c} 0 0 1 ${e + l} ${t + r} ` + s`L ${e} ${t + r} Z`;
|
|
1403
|
+
return s`<path d="${u}" ${H(i, a, o)} />`;
|
|
1404
|
+
}
|
|
1405
|
+
function xn(e, t, n, r, i, a, o, c) {
|
|
1406
|
+
let l = Math.min(10, n * .12), u = [s`<rect x="${e}" y="${t}" width="${n}" height="${r}" fill="none" stroke="none" />`], d = s`M ${e + l} ${t} Q ${e} ${t} ${e} ${t + r * .25} ` + s`Q ${e} ${t + r / 2} ${e - l * .4} ${t + r / 2} ` + s`Q ${e} ${t + r / 2} ${e} ${t + r * .75} ` + s`Q ${e} ${t + r} ${e + l} ${t + r}`, f = s`M ${e + n - l} ${t} Q ${e + n} ${t} ${e + n} ${t + r * .25} ` + s`Q ${e + n} ${t + r / 2} ${e + n + l * .4} ${t + r / 2} ` + s`Q ${e + n} ${t + r / 2} ${e + n} ${t + r * .75} ` + s`Q ${e + n} ${t + r} ${e + n - l} ${t + r}`;
|
|
1407
|
+
return (c === "left" || c === "both") && u.push(s`<path d="${d}" fill="none" stroke="${a}" stroke-width="${o}" />`), (c === "right" || c === "both") && u.push(s`<path d="${f}" fill="none" stroke="${a}" stroke-width="${o}" />`), u.join("\n");
|
|
1408
|
+
}
|
|
1409
|
+
function Sn(e, t, n, r, i, a, o) {
|
|
1410
|
+
let c = [
|
|
1411
|
+
s`${e + n * .42},${t}`,
|
|
1412
|
+
s`${e + n},${t}`,
|
|
1413
|
+
s`${e + n * .62},${t + r * .42}`,
|
|
1414
|
+
s`${e + n},${t + r * .42}`,
|
|
1415
|
+
s`${e + n * .3},${t + r}`,
|
|
1416
|
+
s`${e + n * .5},${t + r * .55}`,
|
|
1417
|
+
s`${e},${t + r * .55}`
|
|
1418
|
+
].join(" ");
|
|
1419
|
+
return s`<polygon points="${c}" ${H(i, a, o)} />`;
|
|
1418
1420
|
}
|
|
1419
1421
|
function Cn(e, t, n, r) {
|
|
1420
|
-
let i = e + n / 2, a = t + r / 2, o = Math.min(n, r) / 2 - 2
|
|
1421
|
-
return `<circle cx="${i}" cy="${a}" r="${o}" fill="
|
|
1422
|
+
let i = e + n / 2, a = t + r / 2, o = Math.min(n, r) / 2 - 2;
|
|
1423
|
+
return s`<circle cx="${i}" cy="${a}" r="${o}" fill="var(--_text)" stroke="none" />`;
|
|
1424
|
+
}
|
|
1425
|
+
function wn(e, t, n, r) {
|
|
1426
|
+
let i = e + n / 2, a = t + r / 2, o = Math.min(n, r) / 2 - 2, c = o - 4;
|
|
1427
|
+
return s`<circle cx="${i}" cy="${a}" r="${o}" ` + s`fill="none" stroke="var(--_text)" stroke-width="${L.innerBox * 2}" />` + s`\n<circle cx="${i}" cy="${a}" r="${c}" fill="var(--_text)" stroke="none" />`;
|
|
1422
1428
|
}
|
|
1423
|
-
function
|
|
1429
|
+
function Tn(e, t, n) {
|
|
1424
1430
|
if ((e.shape === "state-start" || e.shape === "state-end") && !e.label) return "";
|
|
1425
|
-
let r = e.x + e.width / 2,
|
|
1426
|
-
return
|
|
1431
|
+
let r = e.x + e.width / 2, a = e.y + e.height / 2, o = i(e.inlineStyle?.color ?? l(e.inlineStyle?.fill, "var(--_text)")), c = s`text-anchor="middle" font-size="${n.nodeLabel}" font-weight="${F.nodeLabel}" fill="${o}"`, u = e.inlineStyle?.["font-family"];
|
|
1432
|
+
return u && (c += s` style="font-family: ${i(u)};"`), _(e.label, r, a, n.nodeLabel, c);
|
|
1427
1433
|
}
|
|
1428
|
-
function
|
|
1429
|
-
return
|
|
1434
|
+
function En(e) {
|
|
1435
|
+
return i(e).replace(/\r/g, " ").replace(/\n/g, " ").replace(/\t/g, "	");
|
|
1430
1436
|
}
|
|
1431
1437
|
function U(e, t) {
|
|
1432
|
-
return t === void 0 ? e : e.replace("<svg ", `<svg data-src="${
|
|
1438
|
+
return t === void 0 ? e : e.replace("<svg ", s`<svg data-src="${En(t)}" `);
|
|
1433
1439
|
}
|
|
1434
1440
|
//#endregion
|
|
1435
1441
|
//#region packages/svg-renderer/src/resolve-colors.ts
|
|
1436
|
-
var
|
|
1442
|
+
var Dn = class {
|
|
1437
1443
|
raw = /* @__PURE__ */ new Map();
|
|
1438
1444
|
resolved = /* @__PURE__ */ new Map();
|
|
1439
1445
|
inProgress = /* @__PURE__ */ new Set();
|
|
@@ -1445,13 +1451,13 @@ var En = class {
|
|
|
1445
1451
|
let t = this.raw.get(e);
|
|
1446
1452
|
if (t === void 0 || this.inProgress.has(e)) return;
|
|
1447
1453
|
this.inProgress.add(e);
|
|
1448
|
-
let n =
|
|
1454
|
+
let n = Pn(t, this).trim();
|
|
1449
1455
|
this.inProgress.delete(e);
|
|
1450
1456
|
let r = !/\bvar\(|\bcolor-mix\(/.test(n);
|
|
1451
1457
|
return this.resolved.set(e, r ? n : void 0), r ? n : void 0;
|
|
1452
1458
|
}
|
|
1453
1459
|
};
|
|
1454
|
-
function
|
|
1460
|
+
function On(e, t) {
|
|
1455
1461
|
let n = 0;
|
|
1456
1462
|
for (let r = t; r < e.length; r++) {
|
|
1457
1463
|
let t = e[r];
|
|
@@ -1460,7 +1466,7 @@ function Dn(e, t) {
|
|
|
1460
1466
|
}
|
|
1461
1467
|
return -1;
|
|
1462
1468
|
}
|
|
1463
|
-
function
|
|
1469
|
+
function kn(e) {
|
|
1464
1470
|
let t = [], n = 0, r = 0;
|
|
1465
1471
|
for (let i = 0; i < e.length; i++) {
|
|
1466
1472
|
let a = e[i];
|
|
@@ -1468,12 +1474,12 @@ function On(e) {
|
|
|
1468
1474
|
}
|
|
1469
1475
|
return t.push(e.slice(r)), t;
|
|
1470
1476
|
}
|
|
1471
|
-
var
|
|
1472
|
-
function
|
|
1473
|
-
let [n, ...r] =
|
|
1477
|
+
var An = "(?<![\\w-])(var|color-mix)\\(";
|
|
1478
|
+
function jn(e, t) {
|
|
1479
|
+
let [n, ...r] = kn(e), i = (n ?? "").trim(), a = t.lookup(i);
|
|
1474
1480
|
return a === void 0 ? r.length > 0 ? r.join(",").trim() : null : a;
|
|
1475
1481
|
}
|
|
1476
|
-
function
|
|
1482
|
+
function Mn(e) {
|
|
1477
1483
|
let t = e.trim().split(/\s+/), n, r;
|
|
1478
1484
|
for (let e of t) if (/^[\d.]+%$/.test(e)) {
|
|
1479
1485
|
if (r !== void 0) return null;
|
|
@@ -1487,61 +1493,61 @@ function jn(e) {
|
|
|
1487
1493
|
pct: r
|
|
1488
1494
|
};
|
|
1489
1495
|
}
|
|
1490
|
-
function
|
|
1491
|
-
let t =
|
|
1496
|
+
function Nn(e) {
|
|
1497
|
+
let t = kn(e);
|
|
1492
1498
|
if (t.length !== 3) return null;
|
|
1493
1499
|
let [n, r, i] = t;
|
|
1494
1500
|
if (n === void 0 || r === void 0 || i === void 0 || !/^\s*in\s+srgb\s*$/i.test(n)) return null;
|
|
1495
|
-
let a =
|
|
1501
|
+
let a = Mn(r), o = Mn(i);
|
|
1496
1502
|
if (!a || !o) return null;
|
|
1497
1503
|
let s = h(a.color), l = h(o.color);
|
|
1498
1504
|
if (!s || !l) return null;
|
|
1499
1505
|
let u = p(s, l, a.pct, o.pct);
|
|
1500
1506
|
return u ? c(u) : null;
|
|
1501
1507
|
}
|
|
1502
|
-
function
|
|
1503
|
-
let n = "", r = 0, i = new RegExp(
|
|
1508
|
+
function Pn(e, t) {
|
|
1509
|
+
let n = "", r = 0, i = new RegExp(An, "g"), a;
|
|
1504
1510
|
for (; (a = i.exec(e)) !== null;) {
|
|
1505
1511
|
let o = a[1];
|
|
1506
1512
|
if (o === void 0) continue;
|
|
1507
|
-
let s = a.index, c = s + o.length, l =
|
|
1513
|
+
let s = a.index, c = s + o.length, l = On(e, c);
|
|
1508
1514
|
if (l === -1) break;
|
|
1509
|
-
let u =
|
|
1515
|
+
let u = Pn(e.slice(c + 1, l), t), d = o === "var" ? jn(u, t) : Nn(u);
|
|
1510
1516
|
n += e.slice(r, s), n += d ?? `${o}(${u})`, r = l + 1, i.lastIndex = r;
|
|
1511
1517
|
}
|
|
1512
1518
|
return n + e.slice(r);
|
|
1513
1519
|
}
|
|
1514
|
-
function
|
|
1515
|
-
let n = new
|
|
1520
|
+
function Fn(e, t) {
|
|
1521
|
+
let n = new Dn();
|
|
1516
1522
|
for (let [e, r] of Object.entries(t)) n.declare(e, r);
|
|
1517
|
-
return
|
|
1523
|
+
return Pn(e, n);
|
|
1518
1524
|
}
|
|
1519
|
-
var
|
|
1520
|
-
function
|
|
1521
|
-
|
|
1525
|
+
var In = /(--[\w-]+)\s*:\s*([^;{}]+)/g, Ln = /(\s)([\w:.-]+)(=)("[^"]*"|'[^']*')/g, Rn = /* @__PURE__ */ new Set(["data-src"]);
|
|
1526
|
+
function zn(e, t) {
|
|
1527
|
+
In.lastIndex = 0;
|
|
1522
1528
|
let n;
|
|
1523
|
-
for (; (n =
|
|
1529
|
+
for (; (n = In.exec(e)) !== null;) {
|
|
1524
1530
|
let [, e, r] = n;
|
|
1525
1531
|
e !== void 0 && r !== void 0 && t.declare(e, r.trim());
|
|
1526
1532
|
}
|
|
1527
1533
|
}
|
|
1528
|
-
function
|
|
1529
|
-
return e.replace(
|
|
1530
|
-
if (
|
|
1534
|
+
function Bn(e, t) {
|
|
1535
|
+
return e.replace(Ln, (e, n, r, i, a) => {
|
|
1536
|
+
if (Rn.has(r)) return e;
|
|
1531
1537
|
let o = a[0] ?? "\"";
|
|
1532
|
-
return `${n}${r}${i}${o}${
|
|
1538
|
+
return `${n}${r}${i}${o}${Pn(a.slice(1, -1), t)}${o}`;
|
|
1533
1539
|
});
|
|
1534
1540
|
}
|
|
1535
|
-
function
|
|
1536
|
-
let n = new
|
|
1541
|
+
function Vn(e, t) {
|
|
1542
|
+
let n = new Dn();
|
|
1537
1543
|
n.declare("--bg", t.bg), n.declare("--fg", t.fg), t.line && n.declare("--line", t.line), t.accent && n.declare("--accent", t.accent), t.muted && n.declare("--muted", t.muted), t.surface && n.declare("--surface", t.surface), t.border && n.declare("--border", t.border);
|
|
1538
1544
|
for (let t of e.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/g)) {
|
|
1539
1545
|
let e = t[1];
|
|
1540
|
-
e !== void 0 &&
|
|
1546
|
+
e !== void 0 && zn(e, n);
|
|
1541
1547
|
}
|
|
1542
1548
|
for (let t of e.matchAll(/\sstyle=("[^"]*"|'[^']*')/g)) {
|
|
1543
1549
|
let e = t[1];
|
|
1544
|
-
e !== void 0 &&
|
|
1550
|
+
e !== void 0 && zn(e.slice(1, -1), n);
|
|
1545
1551
|
}
|
|
1546
1552
|
let r = "", i = 0;
|
|
1547
1553
|
for (; i < e.length;) {
|
|
@@ -1550,7 +1556,7 @@ function Bn(e, t) {
|
|
|
1550
1556
|
if (r += e.slice(i, t), e.startsWith("<style", t)) {
|
|
1551
1557
|
let a = e.indexOf(">", t), o = e.indexOf("</style>", t);
|
|
1552
1558
|
if (a === -1 || o === -1) break;
|
|
1553
|
-
r += e.slice(t, a + 1), r +=
|
|
1559
|
+
r += e.slice(t, a + 1), r += Pn(e.slice(a + 1, o), n), r += "</style>", i = o + 8;
|
|
1554
1560
|
continue;
|
|
1555
1561
|
}
|
|
1556
1562
|
let a = -1, o = null;
|
|
@@ -1565,7 +1571,7 @@ function Bn(e, t) {
|
|
|
1565
1571
|
}
|
|
1566
1572
|
if (a === -1) break;
|
|
1567
1573
|
let s = e.slice(t, a + 1);
|
|
1568
|
-
r += s.startsWith("<!") || s.startsWith("<?") || s.startsWith("</") ? s :
|
|
1574
|
+
r += s.startsWith("<!") || s.startsWith("<?") || s.startsWith("</") ? s : Bn(s, n), i = a + 1;
|
|
1569
1575
|
}
|
|
1570
1576
|
return r + e.slice(i);
|
|
1571
1577
|
}
|
|
@@ -1587,16 +1593,16 @@ var W = {
|
|
|
1587
1593
|
notePadX: 10,
|
|
1588
1594
|
notePadY: 6
|
|
1589
1595
|
};
|
|
1590
|
-
function
|
|
1596
|
+
function Hn(e) {
|
|
1591
1597
|
return `note ${e}`;
|
|
1592
1598
|
}
|
|
1593
|
-
function
|
|
1599
|
+
function Un(e) {
|
|
1594
1600
|
return `${e} link`;
|
|
1595
1601
|
}
|
|
1596
|
-
function
|
|
1602
|
+
function Wn(e, t) {
|
|
1597
1603
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = P(t.fontSizes);
|
|
1598
1604
|
for (let t of e.classes) {
|
|
1599
|
-
let e = t.annotation ? W.headerBaseHeight + W.annotationHeight : W.headerBaseHeight, r = t.attributes.length > 0 ? t.attributes.length * W.memberRowHeight + W.sectionPadY : W.emptySectionHeight, a = t.methods.length > 0 ? t.methods.length * W.memberRowHeight + W.sectionPadY : W.emptySectionHeight, o = M(t.label, i.nodeLabel, F.nodeLabel), s =
|
|
1605
|
+
let e = t.annotation ? W.headerBaseHeight + W.annotationHeight : W.headerBaseHeight, r = t.attributes.length > 0 ? t.attributes.length * W.memberRowHeight + W.sectionPadY : W.emptySectionHeight, a = t.methods.length > 0 ? t.methods.length * W.memberRowHeight + W.sectionPadY : W.emptySectionHeight, o = M(t.label, i.nodeLabel, F.nodeLabel), s = qn(t.attributes), c = qn(t.methods), l = Math.max(W.minWidth, o + W.boxPadX * 2, s + W.boxPadX * 2, c + W.boxPadX * 2), u = e + r + a;
|
|
1600
1606
|
n.set(t.id, {
|
|
1601
1607
|
width: l,
|
|
1602
1608
|
height: u,
|
|
@@ -1617,12 +1623,12 @@ function Un(e, t) {
|
|
|
1617
1623
|
}));
|
|
1618
1624
|
let c = new Set(n.keys());
|
|
1619
1625
|
for (let [t, n] of e.notes.entries()) {
|
|
1620
|
-
let e =
|
|
1626
|
+
let e = Hn(t), l = d(n.text, i.edgeLabel, F.edgeLabel), u = {
|
|
1621
1627
|
width: l.width + W.notePadX * 2,
|
|
1622
1628
|
height: l.height + W.notePadY * 2
|
|
1623
1629
|
};
|
|
1624
1630
|
r.set(e, u), a.push(B(e, u)), n.forClass !== void 0 && c.has(n.forClass) && s.push(V({
|
|
1625
|
-
id:
|
|
1631
|
+
id: Un(e),
|
|
1626
1632
|
source: e,
|
|
1627
1633
|
target: n.forClass,
|
|
1628
1634
|
labelStyle: o
|
|
@@ -1632,8 +1638,8 @@ function Un(e, t) {
|
|
|
1632
1638
|
elkGraph: {
|
|
1633
1639
|
id: "root",
|
|
1634
1640
|
layoutOptions: {
|
|
1635
|
-
...
|
|
1636
|
-
direction:
|
|
1641
|
+
...Pe({
|
|
1642
|
+
direction: Me(void 0, je.class),
|
|
1637
1643
|
nodeSpacing: W.nodeSpacing,
|
|
1638
1644
|
layerSpacing: W.layerSpacing,
|
|
1639
1645
|
padding: W.padding
|
|
@@ -1647,7 +1653,7 @@ function Un(e, t) {
|
|
|
1647
1653
|
noteSizes: r
|
|
1648
1654
|
};
|
|
1649
1655
|
}
|
|
1650
|
-
function
|
|
1656
|
+
function Gn(e, t, n, r) {
|
|
1651
1657
|
let i = /* @__PURE__ */ new Map();
|
|
1652
1658
|
for (let e of t.classes) i.set(e.id, e);
|
|
1653
1659
|
let a = [];
|
|
@@ -1683,7 +1689,7 @@ function Wn(e, t, n, r) {
|
|
|
1683
1689
|
if (!t)
|
|
1684
1690
|
/* v8 ignore next */
|
|
1685
1691
|
throw Error(`Missing ELK edge for relationship ${e}`);
|
|
1686
|
-
let r =
|
|
1692
|
+
let r = st(t), i = ct(t);
|
|
1687
1693
|
o.push({
|
|
1688
1694
|
from: n.from,
|
|
1689
1695
|
to: n.to,
|
|
@@ -1702,11 +1708,11 @@ function Wn(e, t, n, r) {
|
|
|
1702
1708
|
for (let t of e.children ?? []) l.set(t.id, t);
|
|
1703
1709
|
let u = [];
|
|
1704
1710
|
for (let [e, n] of t.notes.entries()) {
|
|
1705
|
-
let t =
|
|
1711
|
+
let t = Hn(e), i = l.get(t), a = r.get(t);
|
|
1706
1712
|
if (!i || !a)
|
|
1707
1713
|
/* v8 ignore next */
|
|
1708
1714
|
throw Error(`Missing layout for note ${e}`);
|
|
1709
|
-
let o = c.get(
|
|
1715
|
+
let o = c.get(Un(t));
|
|
1710
1716
|
u.push({
|
|
1711
1717
|
id: t,
|
|
1712
1718
|
text: n.text,
|
|
@@ -1715,7 +1721,7 @@ function Wn(e, t, n, r) {
|
|
|
1715
1721
|
y: i.y ?? 0,
|
|
1716
1722
|
width: i.width ?? a.width,
|
|
1717
1723
|
height: i.height ?? a.height,
|
|
1718
|
-
...o ? { linkPoints:
|
|
1724
|
+
...o ? { linkPoints: st(o) } : {}
|
|
1719
1725
|
});
|
|
1720
1726
|
}
|
|
1721
1727
|
return {
|
|
@@ -1726,7 +1732,7 @@ function Wn(e, t, n, r) {
|
|
|
1726
1732
|
notes: u
|
|
1727
1733
|
};
|
|
1728
1734
|
}
|
|
1729
|
-
function
|
|
1735
|
+
function Kn(e, t = {}) {
|
|
1730
1736
|
if (e.classes.length === 0 && e.notes.length === 0) return {
|
|
1731
1737
|
width: 0,
|
|
1732
1738
|
height: 0,
|
|
@@ -1734,110 +1740,110 @@ function Gn(e, t = {}) {
|
|
|
1734
1740
|
relationships: [],
|
|
1735
1741
|
notes: []
|
|
1736
1742
|
};
|
|
1737
|
-
let { elkGraph: n, classSizes: r, noteSizes: i } =
|
|
1738
|
-
return
|
|
1743
|
+
let { elkGraph: n, classSizes: r, noteSizes: i } = Wn(e, t);
|
|
1744
|
+
return Gn(Te(n, t.layoutCache), e, r, i);
|
|
1739
1745
|
}
|
|
1740
|
-
function
|
|
1746
|
+
function qn(e) {
|
|
1741
1747
|
if (e.length === 0) return 0;
|
|
1742
1748
|
let t = 0;
|
|
1743
1749
|
for (let n of e) {
|
|
1744
|
-
let e =
|
|
1750
|
+
let e = Ee(re(n), W.memberFontSize);
|
|
1745
1751
|
e > t && (t = e);
|
|
1746
1752
|
}
|
|
1747
1753
|
return t;
|
|
1748
1754
|
}
|
|
1749
1755
|
//#endregion
|
|
1750
1756
|
//#region packages/svg-renderer/src/class/renderer.ts
|
|
1751
|
-
var
|
|
1757
|
+
var Jn = {
|
|
1752
1758
|
memberSize: 11,
|
|
1753
1759
|
memberWeight: 400,
|
|
1754
1760
|
annotationSize: 10,
|
|
1755
1761
|
annotationWeight: 500
|
|
1756
1762
|
};
|
|
1757
|
-
function
|
|
1763
|
+
function Yn(e, t, r = "Inter", i = !1, a = N, o, s, c, l = !0, u = {}) {
|
|
1758
1764
|
let d = [], f = l && e.classes.some((e) => !!b(e.interaction?.href));
|
|
1759
|
-
d.push(U(E(e.width, e.height, t, i, s, c, f, u.styleAttribute), o)), d.push(r
|
|
1760
|
-
for (let t of e.relationships) d.push(
|
|
1761
|
-
for (let t of e.notes) d.push(
|
|
1762
|
-
for (let t of e.classes) d.push(
|
|
1763
|
-
for (let t of e.notes) d.push(
|
|
1764
|
-
for (let t of e.relationships) d.push(
|
|
1765
|
+
d.push(U(E(e.width, e.height, t, i, s, c, f, u.styleAttribute), o)), d.push(n(r, !0, u.nonce)), d.push("<defs>"), d.push(Xn()), d.push("</defs>");
|
|
1766
|
+
for (let t of e.relationships) d.push(tr(t));
|
|
1767
|
+
for (let t of e.notes) d.push(er(t));
|
|
1768
|
+
for (let t of e.classes) d.push(Zn(t, a, l));
|
|
1769
|
+
for (let t of e.notes) d.push($n(t, a));
|
|
1770
|
+
for (let t of e.relationships) d.push(ir(t, a));
|
|
1765
1771
|
return d.push("</svg>"), d.join("\n");
|
|
1766
1772
|
}
|
|
1767
|
-
function
|
|
1773
|
+
function Xn() {
|
|
1768
1774
|
return " <marker id=\"cls-inherit\" markerWidth=\"12\" markerHeight=\"10\" refX=\"12\" refY=\"5\" orient=\"auto-start-reverse\">\n <polygon points=\"0 0, 12 5, 0 10\" fill=\"var(--bg)\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>\n <marker id=\"cls-composition\" markerWidth=\"12\" markerHeight=\"10\" refX=\"0\" refY=\"5\" orient=\"auto-start-reverse\">\n <polygon points=\"6 0, 12 5, 6 10, 0 5\" fill=\"var(--_arrow)\" stroke=\"var(--_arrow)\" stroke-width=\"1\" />\n </marker>\n <marker id=\"cls-aggregation\" markerWidth=\"12\" markerHeight=\"10\" refX=\"0\" refY=\"5\" orient=\"auto-start-reverse\">\n <polygon points=\"6 0, 12 5, 6 10, 0 5\" fill=\"var(--bg)\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>\n <marker id=\"cls-arrow\" markerWidth=\"8\" markerHeight=\"6\" refX=\"8\" refY=\"3\" orient=\"auto-start-reverse\">\n <polyline points=\"0 0, 8 3, 0 6\" fill=\"none\" stroke=\"var(--_arrow)\" stroke-width=\"1.5\" />\n </marker>";
|
|
1769
1775
|
}
|
|
1770
|
-
function
|
|
1771
|
-
let { x: r, y:
|
|
1772
|
-
`class="${
|
|
1773
|
-
`data-id="${
|
|
1774
|
-
`data-label="${
|
|
1776
|
+
function Zn(e, t, n = !0) {
|
|
1777
|
+
let { x: r, y: a, width: o, height: c, headerHeight: u, attrHeight: d, inlineStyle: f } = e, p = [], m = e.interaction, h = i(f?.fill ?? "var(--_node-fill)"), g = i(f?.stroke ?? "var(--_node-stroke)"), v = i(f?.["stroke-width"] ?? String(L.outerBox)), y = f?.fill ? h : "var(--_group-hdr)", S = f?.color ? i(f.color) : f?.fill ? i(l(f.fill, "var(--_text)")) : void 0, C = e.annotation ? s` data-annotation="${i(e.annotation)}"` : "", w = x(e.className), T = [
|
|
1778
|
+
s`class="${w ? s`class-node ${w}` : "class-node"}"`,
|
|
1779
|
+
s`data-id="${i(e.id)}"`,
|
|
1780
|
+
s`data-label="${i(e.label)}"`
|
|
1775
1781
|
];
|
|
1776
|
-
|
|
1777
|
-
let
|
|
1778
|
-
if (
|
|
1779
|
-
let e =
|
|
1780
|
-
|
|
1781
|
-
}
|
|
1782
|
-
n &&
|
|
1783
|
-
let
|
|
1782
|
+
p.push(s`<g ${T.join(" ")}${C}>`);
|
|
1783
|
+
let E = n ? b(m?.href) : void 0;
|
|
1784
|
+
if (E) {
|
|
1785
|
+
let e = m?.target ? s` target="${i(m.target)}"` : "";
|
|
1786
|
+
p.push(s` <a href="${i(E)}"${e}>`);
|
|
1787
|
+
}
|
|
1788
|
+
n && m?.tooltip && p.push(s` <title>${sr(m.tooltip)}</title>`), p.push(s` <rect x="${r}" y="${a}" width="${o}" height="${c}" ` + s`rx="0" ry="0" fill="${h}" stroke="${g}" stroke-width="${v}" />`), p.push(s` <rect x="${r}" y="${a}" width="${o}" height="${u}" ` + s`rx="0" ry="0" fill="${y}" stroke="${g}" stroke-width="${v}" />`);
|
|
1789
|
+
let D = a + u / 2;
|
|
1784
1790
|
if (e.annotation) {
|
|
1785
|
-
let t =
|
|
1786
|
-
|
|
1791
|
+
let t = a + 12;
|
|
1792
|
+
p.push(s` <text x="${r + o / 2}" y="${t}" text-anchor="middle" dy="${R}" ` + s`font-size="${Jn.annotationSize}" font-weight="${Jn.annotationWeight}" ` + s`font-style="italic" fill="${S ?? "var(--_text-muted)"}"><<${sr(e.annotation)}>></text>`), D = a + u / 2 + 6;
|
|
1787
1793
|
}
|
|
1788
|
-
|
|
1789
|
-
let
|
|
1790
|
-
|
|
1794
|
+
p.push(" " + _(e.label, r + o / 2, D, t.nodeLabel, s`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="${S ?? "var(--_text)"}"`));
|
|
1795
|
+
let O = a + u;
|
|
1796
|
+
p.push(s` <line x1="${r}" y1="${O}" x2="${r + o}" y2="${O}" ` + s`stroke="${g}" stroke-width="${L.innerBox}" />`);
|
|
1791
1797
|
for (let t = 0; t < e.attributes.length; t++) {
|
|
1792
|
-
let n = e.attributes[t], i =
|
|
1793
|
-
|
|
1798
|
+
let n = e.attributes[t], i = O + 4 + t * 20 + 10;
|
|
1799
|
+
p.push(" " + Qn(n, r + W.boxPadX, i, S));
|
|
1794
1800
|
}
|
|
1795
|
-
let
|
|
1796
|
-
|
|
1801
|
+
let k = O + d;
|
|
1802
|
+
p.push(s` <line x1="${r}" y1="${k}" x2="${r + o}" y2="${k}" ` + s`stroke="${g}" stroke-width="${L.innerBox}" />`);
|
|
1797
1803
|
for (let t = 0; t < e.methods.length; t++) {
|
|
1798
|
-
let n = e.methods[t], i =
|
|
1799
|
-
|
|
1804
|
+
let n = e.methods[t], i = k + 4 + t * 20 + 10;
|
|
1805
|
+
p.push(" " + Qn(n, r + W.boxPadX, i, S));
|
|
1800
1806
|
}
|
|
1801
|
-
return
|
|
1807
|
+
return E && p.push(" </a>"), p.push("</g>"), p.join("\n");
|
|
1802
1808
|
}
|
|
1803
|
-
function
|
|
1804
|
-
let i = e.isAbstract ? " font-style=\"italic\"" : "", a = e.isStatic ? " text-decoration=\"underline\"" : "", o = r ?? "var(--_text-faint)",
|
|
1805
|
-
e.visibility &&
|
|
1806
|
-
let
|
|
1807
|
-
return
|
|
1809
|
+
function Qn(e, t, n, r) {
|
|
1810
|
+
let i = e.isAbstract ? " font-style=\"italic\"" : "", a = e.isStatic ? " text-decoration=\"underline\"" : "", o = r ?? "var(--_text-faint)", c = r ?? "var(--_text-sec)", l = r ?? "var(--_text-muted)", u = [];
|
|
1811
|
+
e.visibility && u.push(s`<tspan fill="${o}">${sr(e.visibility)} </tspan>`);
|
|
1812
|
+
let d = e.isMethod ? s`${e.name}(${e.params || ""})` : e.name;
|
|
1813
|
+
return u.push(s`<tspan fill="${c}">${sr(d)}</tspan>`), e.type && (u.push(s`<tspan fill="${o}">: </tspan>`), u.push(s`<tspan fill="${l}">${sr(e.type)}</tspan>`)), s`<text x="${t}" y="${n}" class="mono" dy="${R}" ` + s`font-size="${Jn.memberSize}" font-weight="${Jn.memberWeight}"${i}${a}>` + s`${u.join("")}</text>`;
|
|
1808
1814
|
}
|
|
1809
1815
|
var G = 6;
|
|
1810
|
-
function
|
|
1811
|
-
let { x: n, y: r, width:
|
|
1812
|
-
`${n},${r}`,
|
|
1813
|
-
`${n +
|
|
1814
|
-
`${n +
|
|
1815
|
-
`${n +
|
|
1816
|
-
`${n},${r + o}`
|
|
1817
|
-
].join(" "),
|
|
1818
|
-
return `<g class="class-note"${s
|
|
1819
|
-
}
|
|
1820
|
-
function $n(e) {
|
|
1821
|
-
if (!e.linkPoints || e.linkPoints.length < 2) return "";
|
|
1822
|
-
let t = e.linkPoints.map((e) => `${e.x},${e.y}`).join(" ");
|
|
1823
|
-
return `<polyline class="class-note-link"${e.forClass === void 0 ? "" : ` data-for="${a(e.forClass)}"`} points="${t}" fill="none" stroke="var(--_line)" stroke-width="${L.connector}" stroke-dasharray="2 3" />`;
|
|
1816
|
+
function $n(e, t) {
|
|
1817
|
+
let { x: n, y: r, width: a, height: o } = e, c = e.forClass === void 0 ? "" : s` data-for="${i(e.forClass)}"`, l = [
|
|
1818
|
+
s`${n},${r}`,
|
|
1819
|
+
s`${n + a - G},${r}`,
|
|
1820
|
+
s`${n + a},${r + G}`,
|
|
1821
|
+
s`${n + a},${r + o}`,
|
|
1822
|
+
s`${n},${r + o}`
|
|
1823
|
+
].join(" "), u = s`${n + a - G},${r} ${n + a},${r + G} ` + s`${n + a - G},${r + G}`;
|
|
1824
|
+
return s`<g class="class-note"${c}>` + s`\n <polygon points="${l}" ` + s`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${L.innerBox}" />` + s`\n <polygon points="${u}" ` + s`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${L.innerBox}" />` + s`\n ${_(e.text, n + a / 2, r + o / 2, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`)}` + "\n</g>";
|
|
1824
1825
|
}
|
|
1825
1826
|
function er(e) {
|
|
1827
|
+
if (!e.linkPoints || e.linkPoints.length < 2) return "";
|
|
1828
|
+
let t = e.linkPoints.map((e) => s`${e.x},${e.y}`).join(" "), n = e.forClass === void 0 ? "" : s` data-for="${i(e.forClass)}"`;
|
|
1829
|
+
return s`<polyline class="class-note-link"${n} points="${t}" ` + s`fill="none" stroke="var(--_line)" stroke-width="${L.connector}" stroke-dasharray="2 3" />`;
|
|
1830
|
+
}
|
|
1831
|
+
function tr(e) {
|
|
1826
1832
|
if (e.points.length < 2) return "";
|
|
1827
|
-
let t = e.points.map((e) => `${e.x},${e.y}`).join(" "), n = e.type === "dependency" || e.type === "realization" ? " stroke-dasharray=\"6 4\"" : "", r =
|
|
1833
|
+
let t = e.points.map((e) => s`${e.x},${e.y}`).join(" "), n = e.type === "dependency" || e.type === "realization" ? " stroke-dasharray=\"6 4\"" : "", r = nr(e.type, e.markerAt), a = [
|
|
1828
1834
|
"class=\"class-relationship\"",
|
|
1829
|
-
`data-from="${
|
|
1830
|
-
`data-to="${
|
|
1831
|
-
`data-type="${e.type}"`,
|
|
1832
|
-
`data-marker-at="${e.markerAt}"`
|
|
1835
|
+
s`data-from="${i(e.from)}"`,
|
|
1836
|
+
s`data-to="${i(e.to)}"`,
|
|
1837
|
+
s`data-type="${e.type}"`,
|
|
1838
|
+
s`data-marker-at="${e.markerAt}"`
|
|
1833
1839
|
];
|
|
1834
|
-
return e.label &&
|
|
1840
|
+
return e.label && a.push(s`data-label="${i(e.label)}"`), e.fromCardinality && a.push(s`data-from-cardinality="${i(e.fromCardinality)}"`), e.toCardinality && a.push(s`data-to-cardinality="${i(e.toCardinality)}"`), s`<polyline ${a.join(" ")} points="${t}" fill="none" stroke="var(--_line)" ` + s`stroke-width="${L.connector}"${n}${r} />`;
|
|
1835
1841
|
}
|
|
1836
|
-
function
|
|
1837
|
-
let n =
|
|
1838
|
-
return n ? t === "from" ? ` marker-start="url(#${n})"` : ` marker-end="url(#${n})"` : "";
|
|
1842
|
+
function nr(e, t) {
|
|
1843
|
+
let n = rr(e);
|
|
1844
|
+
return n ? t === "from" ? s` marker-start="url(#${n})"` : s` marker-end="url(#${n})"` : "";
|
|
1839
1845
|
}
|
|
1840
|
-
function
|
|
1846
|
+
function rr(e) {
|
|
1841
1847
|
switch (e) {
|
|
1842
1848
|
case "inheritance":
|
|
1843
1849
|
case "realization": return "cls-inherit";
|
|
@@ -1848,30 +1854,30 @@ function nr(e) {
|
|
|
1848
1854
|
default: return null;
|
|
1849
1855
|
}
|
|
1850
1856
|
}
|
|
1851
|
-
function
|
|
1857
|
+
function ir(e, t) {
|
|
1852
1858
|
if (!e.label && !e.fromCardinality && !e.toCardinality || e.points.length < 2) return "";
|
|
1853
1859
|
let n = [];
|
|
1854
1860
|
if (e.label) {
|
|
1855
|
-
let r = e.labelPosition ??
|
|
1856
|
-
n.push(_(e.label, r.x, r.y - 8, t.edgeLabel, `font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
1861
|
+
let r = e.labelPosition ?? ar(e.points);
|
|
1862
|
+
n.push(_(e.label, r.x, r.y - 8, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
1857
1863
|
}
|
|
1858
1864
|
if (e.fromCardinality && e.points.length >= 2) {
|
|
1859
|
-
let r = e.points[0], i = e.points[1], a =
|
|
1860
|
-
n.push(_(e.fromCardinality, r.x + a.x, r.y + a.y, t.edgeLabel, `font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
1865
|
+
let r = e.points[0], i = e.points[1], a = or(r, i);
|
|
1866
|
+
n.push(_(e.fromCardinality, r.x + a.x, r.y + a.y, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
1861
1867
|
}
|
|
1862
1868
|
if (e.toCardinality && e.points.length >= 2) {
|
|
1863
|
-
let r = e.points[e.points.length - 1], i = e.points[e.points.length - 2], a =
|
|
1864
|
-
n.push(_(e.toCardinality, r.x + a.x, r.y + a.y, t.edgeLabel, `font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
1869
|
+
let r = e.points[e.points.length - 1], i = e.points[e.points.length - 2], a = or(r, i);
|
|
1870
|
+
n.push(_(e.toCardinality, r.x + a.x, r.y + a.y, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
1865
1871
|
}
|
|
1866
1872
|
return n.join("\n");
|
|
1867
1873
|
}
|
|
1868
|
-
function
|
|
1874
|
+
function ar(e) {
|
|
1869
1875
|
return e.length === 0 ? {
|
|
1870
1876
|
x: 0,
|
|
1871
1877
|
y: 0
|
|
1872
1878
|
} : e[Math.floor(e.length / 2)];
|
|
1873
1879
|
}
|
|
1874
|
-
function
|
|
1880
|
+
function or(e, t) {
|
|
1875
1881
|
let n = t.x - e.x, r = t.y - e.y;
|
|
1876
1882
|
return Math.abs(n) > Math.abs(r) ? {
|
|
1877
1883
|
x: n > 0 ? 14 : -14,
|
|
@@ -1881,7 +1887,7 @@ function ar(e, t) {
|
|
|
1881
1887
|
y: r > 0 ? 14 : -14
|
|
1882
1888
|
};
|
|
1883
1889
|
}
|
|
1884
|
-
var
|
|
1890
|
+
var sr = a, K = {
|
|
1885
1891
|
padding: 40,
|
|
1886
1892
|
boxPadX: 14,
|
|
1887
1893
|
headerHeight: 34,
|
|
@@ -1892,12 +1898,12 @@ var or = o, K = {
|
|
|
1892
1898
|
nodeSpacing: 70,
|
|
1893
1899
|
layerSpacing: 90
|
|
1894
1900
|
};
|
|
1895
|
-
function
|
|
1901
|
+
function cr(e, t) {
|
|
1896
1902
|
let n = /* @__PURE__ */ new Map(), r = P(t.fontSizes);
|
|
1897
1903
|
for (let t of e.entities) {
|
|
1898
1904
|
let e = M(t.label, r.nodeLabel, F.nodeLabel), i = 0;
|
|
1899
1905
|
for (let e of t.attributes) {
|
|
1900
|
-
let t =
|
|
1906
|
+
let t = Ee(`${e.type} ${e.name}${e.keys.length > 0 ? " " + e.keys.join(",") : ""}`, K.attrFontSize);
|
|
1901
1907
|
t > i && (i = t);
|
|
1902
1908
|
}
|
|
1903
1909
|
let a = Math.max(K.minWidth, e + K.boxPadX * 2, i + K.boxPadX * 2), o = K.headerHeight + Math.max(t.attributes.length, 1) * K.rowHeight;
|
|
@@ -1920,8 +1926,8 @@ function sr(e, t) {
|
|
|
1920
1926
|
elkGraph: {
|
|
1921
1927
|
id: "root",
|
|
1922
1928
|
layoutOptions: {
|
|
1923
|
-
...
|
|
1924
|
-
direction:
|
|
1929
|
+
...Pe({
|
|
1930
|
+
direction: Me(e.direction, je.er),
|
|
1925
1931
|
nodeSpacing: K.nodeSpacing,
|
|
1926
1932
|
layerSpacing: K.layerSpacing,
|
|
1927
1933
|
padding: K.padding
|
|
@@ -1934,7 +1940,7 @@ function sr(e, t) {
|
|
|
1934
1940
|
entitySizes: n
|
|
1935
1941
|
};
|
|
1936
1942
|
}
|
|
1937
|
-
function
|
|
1943
|
+
function lr(e, t, n) {
|
|
1938
1944
|
let r = /* @__PURE__ */ new Map();
|
|
1939
1945
|
for (let e of t.entities) r.set(e.id, e);
|
|
1940
1946
|
let i = [];
|
|
@@ -1960,7 +1966,7 @@ function cr(e, t, n) {
|
|
|
1960
1966
|
}
|
|
1961
1967
|
let a = [];
|
|
1962
1968
|
for (let [n, r] of (e.edges ?? []).entries()) {
|
|
1963
|
-
let e = t.relationships[n], i =
|
|
1969
|
+
let e = t.relationships[n], i = st(r);
|
|
1964
1970
|
a.push({
|
|
1965
1971
|
entity1: e.entity1,
|
|
1966
1972
|
entity2: e.entity2,
|
|
@@ -1978,15 +1984,15 @@ function cr(e, t, n) {
|
|
|
1978
1984
|
relationships: a
|
|
1979
1985
|
};
|
|
1980
1986
|
}
|
|
1981
|
-
function
|
|
1987
|
+
function ur(e, t = {}) {
|
|
1982
1988
|
if (e.entities.length === 0) return {
|
|
1983
1989
|
width: 0,
|
|
1984
1990
|
height: 0,
|
|
1985
1991
|
entities: [],
|
|
1986
1992
|
relationships: []
|
|
1987
1993
|
};
|
|
1988
|
-
let { elkGraph: n, entitySizes: r } =
|
|
1989
|
-
return
|
|
1994
|
+
let { elkGraph: n, entitySizes: r } = cr(e, t);
|
|
1995
|
+
return lr(Te(n, t.layoutCache), e, r);
|
|
1990
1996
|
}
|
|
1991
1997
|
//#endregion
|
|
1992
1998
|
//#region packages/svg-renderer/src/er/renderer.ts
|
|
@@ -1996,83 +2002,83 @@ var q = {
|
|
|
1996
2002
|
keySize: 9,
|
|
1997
2003
|
keyWeight: 600
|
|
1998
2004
|
};
|
|
1999
|
-
function
|
|
2005
|
+
function dr(e, t, r = "Inter", i = !1, a = N, o, s, c, l = {}) {
|
|
2000
2006
|
let u = [];
|
|
2001
|
-
u.push(U(E(e.width, e.height, t, i, s, c, void 0, l.styleAttribute), o)), u.push(r
|
|
2002
|
-
for (let t of e.relationships) u.push(
|
|
2003
|
-
for (let t of e.entities) u.push(
|
|
2004
|
-
for (let t of e.relationships) u.push(
|
|
2005
|
-
for (let t of e.relationships) u.push(
|
|
2007
|
+
u.push(U(E(e.width, e.height, t, i, s, c, void 0, l.styleAttribute), o)), u.push(n(r, !0, l.nonce)), u.push("<defs>"), u.push("</defs>");
|
|
2008
|
+
for (let t of e.relationships) u.push(mr(t));
|
|
2009
|
+
for (let t of e.entities) u.push(fr(t, a));
|
|
2010
|
+
for (let t of e.relationships) u.push(gr(t));
|
|
2011
|
+
for (let t of e.relationships) u.push(hr(t, a));
|
|
2006
2012
|
return u.push("</svg>"), u.join("\n");
|
|
2007
2013
|
}
|
|
2008
|
-
function
|
|
2009
|
-
let { id: n, x: r, y:
|
|
2010
|
-
|
|
2011
|
-
let
|
|
2012
|
-
|
|
2013
|
-
for (let e = 0; e <
|
|
2014
|
-
let t =
|
|
2015
|
-
|
|
2014
|
+
function fr(e, t) {
|
|
2015
|
+
let { id: n, x: r, y: a, width: o, height: c, headerHeight: l, rowHeight: u, label: d, attributes: f } = e, p = [];
|
|
2016
|
+
p.push(s`<g class="entity" data-id="${i(n)}" data-label="${i(d)}">`), p.push(s` <rect x="${r}" y="${a}" width="${o}" height="${c}" ` + s`rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${L.outerBox}" />`), p.push(s` <rect x="${r}" y="${a}" width="${o}" height="${l}" ` + s`rx="0" ry="0" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${L.outerBox}" />`), p.push(" " + _(d, r + o / 2, a + l / 2, t.nodeLabel, s`text-anchor="middle" font-size="${t.nodeLabel}" font-weight="700" fill="var(--_text)"`));
|
|
2017
|
+
let m = a + l;
|
|
2018
|
+
p.push(s` <line x1="${r}" y1="${m}" x2="${r + o}" y2="${m}" ` + s`stroke="var(--_node-stroke)" stroke-width="${L.innerBox}" />`);
|
|
2019
|
+
for (let e = 0; e < f.length; e++) {
|
|
2020
|
+
let t = f[e], n = m + e * u + u / 2;
|
|
2021
|
+
p.push(" " + pr(t, r, n, o).replace(/\n/g, "\n "));
|
|
2016
2022
|
}
|
|
2017
|
-
return
|
|
2023
|
+
return f.length === 0 && p.push(s` <text x="${r + o / 2}" y="${m + u / 2}" text-anchor="middle" dy="${R}" ` + s`font-size="${q.attrSize}" fill="var(--_text-faint)" font-style="italic">(no attributes)</text>`), p.push("</g>"), p.join("\n");
|
|
2018
2024
|
}
|
|
2019
|
-
function
|
|
2025
|
+
function pr(e, t, n, r) {
|
|
2020
2026
|
let i = [], a = e.comment && e.comment.length > 0;
|
|
2021
2027
|
if (e.comment && e.comment.length > 0) {
|
|
2022
2028
|
let t = e.comment.replace(/<br\s*\/?>/gi, "\n");
|
|
2023
|
-
i.push(`<g><title>${
|
|
2029
|
+
i.push(s`<g><title>${yr(t)}</title>`);
|
|
2024
2030
|
}
|
|
2025
2031
|
let o = 0;
|
|
2026
|
-
e.keys.length > 0 && (o = M(e.keys.join(","), q.keySize, q.keyWeight) + 8, i.push(`<rect x="${t + 6}" y="${n - 7}" width="${o}" height="14" rx="2" ry="2" fill
|
|
2027
|
-
let
|
|
2028
|
-
i.push(`<text x="${
|
|
2029
|
-
let
|
|
2030
|
-
return i.push(`<text x="${
|
|
2032
|
+
e.keys.length > 0 && (o = M(e.keys.join(","), q.keySize, q.keyWeight) + 8, i.push(s`<rect x="${t + 6}" y="${n - 7}" width="${o}" height="14" rx="2" ry="2" ` + "fill=\"var(--_key-badge)\" />"), i.push(s`<text x="${t + 6 + o / 2}" y="${n}" text-anchor="middle" dy="${R}" ` + s`font-size="${q.keySize}" font-weight="${q.keyWeight}" fill="var(--_text-sec)">${e.keys.join(",")}</text>`));
|
|
2033
|
+
let c = t + 8 + (o > 0 ? o + 6 : 0);
|
|
2034
|
+
i.push(s`<text x="${c}" y="${n}" class="mono" dy="${R}" ` + s`font-size="${q.attrSize}" font-weight="${q.attrWeight}">` + s`<tspan fill="var(--_text-muted)">${yr(e.type)}</tspan></text>`);
|
|
2035
|
+
let l = t + r - 8;
|
|
2036
|
+
return i.push(s`<text x="${l}" y="${n}" class="mono" text-anchor="end" dy="${R}" ` + s`font-size="${q.attrSize}" font-weight="${q.attrWeight}">` + s`<tspan fill="var(--_text-sec)">${yr(e.name)}</tspan></text>`), a && i.push("</g>"), i.join("\n");
|
|
2031
2037
|
}
|
|
2032
|
-
function
|
|
2038
|
+
function mr(e) {
|
|
2033
2039
|
if (e.points.length < 2) return "";
|
|
2034
|
-
let t = e.points.map((e) => `${e.x},${e.y}`).join(" "), n = e.identifying ? "" : " stroke-dasharray=\"6 4\"", r = e.label ? ` data-label="${
|
|
2035
|
-
return `<polyline ${[
|
|
2040
|
+
let t = e.points.map((e) => s`${e.x},${e.y}`).join(" "), n = e.identifying ? "" : " stroke-dasharray=\"6 4\"", r = e.label ? s` data-label="${i(e.label)}"` : "", a = [
|
|
2036
2041
|
"class=\"er-relationship\"",
|
|
2037
|
-
`data-entity1="${
|
|
2038
|
-
`data-entity2="${
|
|
2039
|
-
`data-cardinality1="${e.cardinality1}"`,
|
|
2040
|
-
`data-cardinality2="${e.cardinality2}"`,
|
|
2041
|
-
`data-identifying="${e.identifying}"`
|
|
2042
|
-
]
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2042
|
+
s`data-entity1="${i(e.entity1)}"`,
|
|
2043
|
+
s`data-entity2="${i(e.entity2)}"`,
|
|
2044
|
+
s`data-cardinality1="${e.cardinality1}"`,
|
|
2045
|
+
s`data-cardinality2="${e.cardinality2}"`,
|
|
2046
|
+
s`data-identifying="${e.identifying}"`
|
|
2047
|
+
];
|
|
2048
|
+
return s`<polyline ${a.join(" ")}${r} points="${t}" fill="none" stroke="var(--_line)" ` + s`stroke-width="${L.connector}"${n} />`;
|
|
2049
|
+
}
|
|
2050
|
+
function hr(e, t) {
|
|
2045
2051
|
if (!e.label || e.points.length < 2) return "";
|
|
2046
|
-
let n =
|
|
2047
|
-
return `<rect x="${n.x - i / 2}" y="${n.y - a / 2}" width="${i}" height="${a}" rx="2" ry="2" fill
|
|
2052
|
+
let n = vr(e.points), r = d(e.label, t.edgeLabel, F.edgeLabel), i = r.width + 8, a = r.height + 6;
|
|
2053
|
+
return s`<rect x="${n.x - i / 2}" y="${n.y - a / 2}" width="${i}" height="${a}" rx="2" ry="2" ` + "fill=\"var(--bg)\" stroke=\"var(--_inner-stroke)\" stroke-width=\"0.5\" />" + s`\n${_(e.label, n.x, n.y, t.edgeLabel, s`text-anchor="middle" font-size="${t.edgeLabel}" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`)}`;
|
|
2048
2054
|
}
|
|
2049
|
-
function
|
|
2055
|
+
function gr(e) {
|
|
2050
2056
|
if (e.points.length < 2) return "";
|
|
2051
2057
|
let t = [], n = e.points[0], r = e.points[1];
|
|
2052
|
-
t.push(
|
|
2058
|
+
t.push(_r(n, r, e.cardinality1));
|
|
2053
2059
|
let i = e.points[e.points.length - 1], a = e.points[e.points.length - 2];
|
|
2054
|
-
return t.push(
|
|
2060
|
+
return t.push(_r(i, a, e.cardinality2)), t.join("\n");
|
|
2055
2061
|
}
|
|
2056
|
-
function
|
|
2057
|
-
let r = [], i = L.connector + .25, a = e.x - t.x, o = e.y - t.y,
|
|
2058
|
-
if (
|
|
2059
|
-
let
|
|
2060
|
-
if (g) {
|
|
2061
|
-
r.push(`<line x1="${f + u * 6}" y1="${p + d * 6}" x2="${f - u * 6}" y2="${p - d * 6}" stroke="var(--_line)" stroke-width="${i}" />`);
|
|
2062
|
-
let e = f - c * 4, t = p - l * 4;
|
|
2063
|
-
r.push(`<line x1="${e + u * 6}" y1="${t + d * 6}" x2="${e - u * 6}" y2="${t - d * 6}" stroke="var(--_line)" stroke-width="${i}" />`);
|
|
2064
|
-
}
|
|
2062
|
+
function _r(e, t, n) {
|
|
2063
|
+
let r = [], i = L.connector + .25, a = e.x - t.x, o = e.y - t.y, c = Math.sqrt(a * a + o * o);
|
|
2064
|
+
if (c === 0) return "";
|
|
2065
|
+
let l = a / c, u = o / c, d = -u, f = l, p = e.x - l * 4, m = e.y - u * 4, h = e.x - l * 16, g = e.y - u * 16, _ = n === "one" || n === "zero-one", v = n === "many" || n === "zero-many", y = n === "zero-one" || n === "zero-many";
|
|
2065
2066
|
if (_) {
|
|
2066
|
-
|
|
2067
|
-
|
|
2067
|
+
r.push(s`<line x1="${p + d * 6}" y1="${m + f * 6}" ` + s`x2="${p - d * 6}" y2="${m - f * 6}" ` + s`stroke="var(--_line)" stroke-width="${i}" />`);
|
|
2068
|
+
let e = p - l * 4, t = m - u * 4;
|
|
2069
|
+
r.push(s`<line x1="${e + d * 6}" y1="${t + f * 6}" ` + s`x2="${e - d * 6}" y2="${t - f * 6}" ` + s`stroke="var(--_line)" stroke-width="${i}" />`);
|
|
2068
2070
|
}
|
|
2069
2071
|
if (v) {
|
|
2070
|
-
let
|
|
2071
|
-
r.push(`<
|
|
2072
|
+
let e = p, t = m;
|
|
2073
|
+
r.push(s`<line x1="${e + d * 7}" y1="${t + f * 7}" ` + s`x2="${h}" y2="${g}" ` + s`stroke="var(--_line)" stroke-width="${i}" />`), r.push(s`<line x1="${e}" y1="${t}" ` + s`x2="${h}" y2="${g}" ` + s`stroke="var(--_line)" stroke-width="${i}" />`), r.push(s`<line x1="${e - d * 7}" y1="${t - f * 7}" ` + s`x2="${h}" y2="${g}" ` + s`stroke="var(--_line)" stroke-width="${i}" />`);
|
|
2074
|
+
}
|
|
2075
|
+
if (y) {
|
|
2076
|
+
let t = v ? 20 : 12, n = e.x - l * t, a = e.y - u * t;
|
|
2077
|
+
r.push(s`<circle cx="${n}" cy="${a}" r="4" ` + s`fill="var(--bg)" stroke="var(--_line)" stroke-width="${i}" />`);
|
|
2072
2078
|
}
|
|
2073
2079
|
return r.join("\n");
|
|
2074
2080
|
}
|
|
2075
|
-
function
|
|
2081
|
+
function vr(e) {
|
|
2076
2082
|
if (e.length === 0) return {
|
|
2077
2083
|
x: 0,
|
|
2078
2084
|
y: 0
|
|
@@ -2098,7 +2104,7 @@ function _r(e) {
|
|
|
2098
2104
|
}
|
|
2099
2105
|
return e[e.length - 1];
|
|
2100
2106
|
}
|
|
2101
|
-
var
|
|
2107
|
+
var yr = a, J = {
|
|
2102
2108
|
padding: 30,
|
|
2103
2109
|
actorGap: 140,
|
|
2104
2110
|
actorHeight: 40,
|
|
@@ -2120,10 +2126,10 @@ var vr = o, J = {
|
|
|
2120
2126
|
noteStackGap: 4,
|
|
2121
2127
|
boxPad: 10
|
|
2122
2128
|
};
|
|
2123
|
-
function
|
|
2129
|
+
function br(e) {
|
|
2124
2130
|
return e + 8;
|
|
2125
2131
|
}
|
|
2126
|
-
function
|
|
2132
|
+
function xr(e) {
|
|
2127
2133
|
return {
|
|
2128
2134
|
...J,
|
|
2129
2135
|
actorHeight: e?.actorHeight ?? J.actorHeight,
|
|
@@ -2133,7 +2139,7 @@ function br(e) {
|
|
|
2133
2139
|
noteStackGap: e?.noteStackGap ?? J.noteStackGap
|
|
2134
2140
|
};
|
|
2135
2141
|
}
|
|
2136
|
-
function
|
|
2142
|
+
function Sr(e, t = {}) {
|
|
2137
2143
|
if (e.actors.length === 0) return {
|
|
2138
2144
|
width: 0,
|
|
2139
2145
|
height: 0,
|
|
@@ -2145,7 +2151,7 @@ function xr(e, t = {}) {
|
|
|
2145
2151
|
notes: [],
|
|
2146
2152
|
boxes: []
|
|
2147
2153
|
};
|
|
2148
|
-
let n =
|
|
2154
|
+
let n = xr(t.sequence), r = P(t.fontSizes), i = e.actors.map((e) => {
|
|
2149
2155
|
let t = M(e.label, r.nodeLabel, F.nodeLabel);
|
|
2150
2156
|
return Math.max(t + n.actorPadX * 2, 80);
|
|
2151
2157
|
}), a = [], o = n.padding + i[0] / 2;
|
|
@@ -2158,7 +2164,7 @@ function xr(e, t = {}) {
|
|
|
2158
2164
|
}
|
|
2159
2165
|
let s = /* @__PURE__ */ new Map();
|
|
2160
2166
|
for (let t = 0; t < e.actors.length; t++) s.set(e.actors[t].id, t);
|
|
2161
|
-
let c = e.boxes.filter((e) => e.actorIds.length > 0), l = c.some((e) => e.label !== ""), u = c.length === 0 ? 0 : n.boxPad + (l ?
|
|
2167
|
+
let c = e.boxes.filter((e) => e.actorIds.length > 0), l = c.some((e) => e.label !== ""), u = c.length === 0 ? 0 : n.boxPad + (l ? br(r.edgeLabel) : 0), d = n.padding + u, f = e.actors.map((e, t) => ({
|
|
2162
2168
|
id: e.id,
|
|
2163
2169
|
label: e.label,
|
|
2164
2170
|
type: e.type,
|
|
@@ -2373,79 +2379,79 @@ function xr(e, t = {}) {
|
|
|
2373
2379
|
}
|
|
2374
2380
|
//#endregion
|
|
2375
2381
|
//#region packages/svg-renderer/src/sequence/renderer.ts
|
|
2376
|
-
function
|
|
2382
|
+
function Cr(e, t, r = "Inter", i = !1, a = N, o, s, c, l = {}) {
|
|
2377
2383
|
let u = [];
|
|
2378
|
-
u.push(U(E(e.width, e.height, t, i, s, c, void 0, l.styleAttribute), o)), u.push(r
|
|
2379
|
-
for (let t of e.boxes) u.push(
|
|
2380
|
-
for (let t of e.blocks) u.push(
|
|
2381
|
-
for (let t of e.lifelines) u.push(
|
|
2382
|
-
for (let t of e.activations) u.push(
|
|
2383
|
-
for (let t of e.messages) u.push(
|
|
2384
|
-
for (let t of e.notes) u.push(
|
|
2385
|
-
for (let t of e.actors) u.push(
|
|
2384
|
+
u.push(U(E(e.width, e.height, t, i, s, c, void 0, l.styleAttribute), o)), u.push(n(r, !1, l.nonce)), u.push("<defs>"), u.push(wr()), u.push("</defs>");
|
|
2385
|
+
for (let t of e.boxes) u.push(Mr(t, a));
|
|
2386
|
+
for (let t of e.blocks) u.push(Nr(t, a));
|
|
2387
|
+
for (let t of e.lifelines) u.push(Er(t));
|
|
2388
|
+
for (let t of e.activations) u.push(Or(t));
|
|
2389
|
+
for (let t of e.messages) u.push(kr(t, a));
|
|
2390
|
+
for (let t of e.notes) u.push(Pr(t, a));
|
|
2391
|
+
for (let t of e.actors) u.push(Tr(t, a));
|
|
2386
2392
|
return u.push("</svg>"), u.join("\n");
|
|
2387
2393
|
}
|
|
2388
|
-
function
|
|
2394
|
+
function wr() {
|
|
2389
2395
|
let e = z.width, t = z.height;
|
|
2390
|
-
return ` <marker id="seq-arrow" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse"
|
|
2396
|
+
return s` <marker id="seq-arrow" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse">` + s`\n <polygon points="0 0, ${e} ${t / 2}, 0 ${t}" fill="var(--_arrow)" />` + "\n </marker>" + s`\n <marker id="seq-arrow-open" markerWidth="${e}" markerHeight="${t}" refX="${e}" refY="${t / 2}" orient="auto-start-reverse">` + s`\n <polyline points="0 0, ${e} ${t / 2}, 0 ${t}" fill="none" stroke="var(--_arrow)" stroke-width="1" />` + "\n </marker>";
|
|
2391
2397
|
}
|
|
2392
|
-
function
|
|
2393
|
-
let { id: n, x: r, y:
|
|
2394
|
-
if (
|
|
2395
|
-
let e =
|
|
2396
|
-
|
|
2398
|
+
function Tr(e, t) {
|
|
2399
|
+
let { id: n, x: r, y: a, width: o, height: c, label: l, type: u } = e, d = [];
|
|
2400
|
+
if (d.push(s`<g class="actor" data-id="${i(n)}" data-label="${i(l)}" data-type="${u}">`), u === "actor") {
|
|
2401
|
+
let e = c / 24 * .9, n = r - 12 * e, i = a + (c - 24 * e) / 2, o = L.outerBox / e, u = "var(--_line)";
|
|
2402
|
+
d.push(s` <g transform="translate(${n},${i}) scale(${e})">` + s`\n <path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" fill="none" stroke="${u}" stroke-width="${o}" />` + s`\n <path d="M15 10C15 11.6569 13.6569 13 12 13C10.3431 13 9 11.6569 9 10C9 8.34315 10.3431 7 12 7C13.6569 7 15 8.34315 15 10Z" fill="none" stroke="${u}" stroke-width="${o}" />` + s`\n <path d="M5.62842 18.3563C7.08963 17.0398 9.39997 16 12 16C14.6 16 16.9104 17.0398 18.3716 18.3563" fill="none" stroke="${u}" stroke-width="${o}" />` + "\n </g>"), d.push(" " + _(l, r, a + c + 14, t.nodeLabel, s`font-size="${t.nodeLabel}" text-anchor="middle" font-weight="${F.nodeLabel}" fill="var(--_text)"`));
|
|
2397
2403
|
} else {
|
|
2398
2404
|
let e = r - o / 2;
|
|
2399
|
-
|
|
2405
|
+
d.push(s` <rect x="${e}" y="${a}" width="${o}" height="${c}" rx="4" ry="4" ` + s`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${L.outerBox}" />`), d.push(" " + _(l, r, a + c / 2, t.nodeLabel, s`font-size="${t.nodeLabel}" text-anchor="middle" font-weight="${F.nodeLabel}" fill="var(--_text)"`));
|
|
2400
2406
|
}
|
|
2401
|
-
return
|
|
2407
|
+
return d.push("</g>"), d.join("\n");
|
|
2402
2408
|
}
|
|
2403
|
-
function
|
|
2404
|
-
let t = `<line class="lifeline" data-actor="${
|
|
2409
|
+
function Er(e) {
|
|
2410
|
+
let t = s`<line class="lifeline" data-actor="${i(e.actorId)}" ` + s`x1="${e.x}" y1="${e.topY}" x2="${e.x}" y2="${e.bottomY}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />";
|
|
2405
2411
|
if (!e.destroyed) return t;
|
|
2406
|
-
let { x: n, bottomY: r } = e,
|
|
2407
|
-
return t + `\n<path class="destroy" data-actor="${
|
|
2412
|
+
let { x: n, bottomY: r } = e, a = Dr;
|
|
2413
|
+
return t + s`\n<path class="destroy" data-actor="${i(e.actorId)}" ` + s`d="M${n - a} ${r - a} L${n + a} ${r + a} M${n + a} ${r - a} L${n - a} ${r + a}" ` + s`fill="none" stroke="var(--_line)" stroke-width="${L.outerBox}" stroke-linecap="round" />`;
|
|
2408
2414
|
}
|
|
2409
|
-
var
|
|
2410
|
-
function
|
|
2411
|
-
return `<rect class="activation" data-actor="${
|
|
2415
|
+
var Dr = 8;
|
|
2416
|
+
function Or(e) {
|
|
2417
|
+
return s`<rect class="activation" data-actor="${i(e.actorId)}" ` + s`x="${e.x}" y="${e.topY}" width="${e.width}" height="${e.bottomY - e.topY}" ` + s`fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="${L.innerBox}" />`;
|
|
2412
2418
|
}
|
|
2413
|
-
function
|
|
2414
|
-
let n = [], r = e.lineStyle === "dashed" ? " stroke-dasharray=\"6 4\"" : "",
|
|
2415
|
-
if (n.push(`<g class="message" data-from="${
|
|
2419
|
+
function kr(e, t) {
|
|
2420
|
+
let n = [], r = e.lineStyle === "dashed" ? " stroke-dasharray=\"6 4\"" : "", a = e.arrowHead === "filled" ? "seq-arrow" : "seq-arrow-open", o = e.bidirectional ? s` marker-start="url(#${a})"` : "";
|
|
2421
|
+
if (n.push(s`<g class="message" data-from="${i(e.from)}" data-to="${i(e.to)}" ` + s`data-label="${i(e.label)}" data-line-style="${e.lineStyle}" ` + s`data-arrow-head="${e.arrowHead}" data-self="${e.isSelf}" data-bidirectional="${e.bidirectional}">`), e.isSelf) n.push(s` <polyline points="${e.x1},${e.y} ${e.x1 + 30},${e.y} ${e.x1 + 30},${e.y + 20} ${e.x2},${e.y + 20}" ` + s`fill="none" stroke="var(--_line)" stroke-width="${L.connector}"${r} marker-end="url(#${a})"${o} />`), n.push(" " + _(e.label, e.x1 + 30 + 8, e.y + 10, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
2416
2422
|
else {
|
|
2417
|
-
n.push(` <line x1="${e.x1}" y1="${e.y}" x2="${e.x2}" y2="${e.y}" stroke="var(--_line)" stroke-width="${L.connector}"${r} marker-end="url(#${
|
|
2418
|
-
let
|
|
2419
|
-
n.push(" " + _(e.label,
|
|
2423
|
+
n.push(s` <line x1="${e.x1}" y1="${e.y}" x2="${e.x2}" y2="${e.y}" ` + s`stroke="var(--_line)" stroke-width="${L.connector}"${r} marker-end="url(#${a})"${o} />`);
|
|
2424
|
+
let i = (e.x1 + e.x2) / 2;
|
|
2425
|
+
n.push(" " + _(e.label, i, e.y - 10, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
2420
2426
|
}
|
|
2421
|
-
return e.seqNumber !== void 0 && n.push(" " +
|
|
2427
|
+
return e.seqNumber !== void 0 && n.push(" " + Ar(e, t)), n.push("</g>"), n.join("\n");
|
|
2422
2428
|
}
|
|
2423
|
-
function
|
|
2429
|
+
function Ar(e, t) {
|
|
2424
2430
|
let n = Math.max(t.edgeLabel - 2, 8), r = e.bidirectional ? e.x1 + Math.sign(e.x2 - e.x1) * (8 + z.width) : e.x1;
|
|
2425
|
-
return
|
|
2426
|
-
}
|
|
2427
|
-
var Ar = 35;
|
|
2428
|
-
function jr(e, t) {
|
|
2429
|
-
let n = e.label ? ` data-label="${a(e.label)}"` : "", r = e.color === void 0 ? "" : ` data-color="${a(e.color)}"`, i = e.color === void 0 ? "none" : `color-mix(in srgb, ${a(e.color)} ${Ar}%, var(--bg))`, o = [`<g class="participant-box"${n}${r}>`, ` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" fill="${i}" stroke="var(--_node-stroke)" stroke-width="${L.innerBox}" />`];
|
|
2430
|
-
return e.label && o.push(" " + _(e.label, e.x + e.width / 2, e.y + yr(t.edgeLabel) / 2, t.edgeLabel, `font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.groupHeader}" fill="var(--_text-sec)"`)), o.push("</g>"), o.join("\n");
|
|
2431
|
+
return "<g class=\"seq-number\">" + s`<circle cx="${r}" cy="${e.y}" r="${8}" fill="var(--bg)" stroke="var(--_arrow)" stroke-width="${L.innerBox}" />` + _(String(e.seqNumber), r, e.y, n, s`font-size="${n}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_arrow)"`) + "</g>";
|
|
2431
2432
|
}
|
|
2433
|
+
var jr = 35;
|
|
2432
2434
|
function Mr(e, t) {
|
|
2433
|
-
let n =
|
|
2434
|
-
|
|
2435
|
-
let i = `${e.type}${e.label ? ` [${e.label}]` : ""}`, o = i.split("\n")[0], s = M(o, t.edgeLabel, F.groupHeader) + 16;
|
|
2436
|
-
n.push(` <rect x="${e.x}" y="${e.y}" width="${s}" height="18" fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${L.outerBox}" />`), n.push(" " + _(i, e.x + 6, e.y + 9, t.edgeLabel, `font-size="${t.edgeLabel}" font-weight="${F.groupHeader}" fill="var(--_text-sec)"`));
|
|
2437
|
-
for (let r of e.dividers) n.push(` <line x1="${e.x}" y1="${r.y}" x2="${e.x + e.width}" y2="${r.y}" stroke="var(--_line)" stroke-width="0.75" stroke-dasharray="6 4" />`), r.label && n.push(" " + _(`[${r.label}]`, e.x + 8, r.y + 14, t.edgeLabel, `font-size="${t.edgeLabel}" text-anchor="start" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
2438
|
-
return n.push("</g>"), n.join("\n");
|
|
2435
|
+
let n = e.label ? s` data-label="${i(e.label)}"` : "", r = e.color === void 0 ? "" : s` data-color="${i(e.color)}"`, a = e.color === void 0 ? "none" : s`color-mix(in srgb, ${i(e.color)} ${jr}%, var(--bg))`, o = [s`<g class="participant-box"${n}${r}>`, s` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="4" ry="4" ` + s`fill="${a}" stroke="var(--_node-stroke)" stroke-width="${L.innerBox}" />`];
|
|
2436
|
+
return e.label && o.push(" " + _(e.label, e.x + e.width / 2, e.y + br(t.edgeLabel) / 2, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.groupHeader}" fill="var(--_text-sec)"`)), o.push("</g>"), o.join("\n");
|
|
2439
2437
|
}
|
|
2440
2438
|
function Nr(e, t) {
|
|
2441
|
-
let
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2439
|
+
let n = [], r = e.label ? s` data-label="${i(e.label)}"` : "";
|
|
2440
|
+
n.push(s`<g class="block" data-type="${i(e.type)}"${r}>`), n.push(s` <rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ` + s`rx="0" ry="0" fill="none" stroke="var(--_node-stroke)" stroke-width="${L.outerBox}" />`);
|
|
2441
|
+
let a = s`${e.type}${e.label ? s` [${e.label}]` : ""}`, o = a.split("\n")[0], c = M(o, t.edgeLabel, F.groupHeader) + 16;
|
|
2442
|
+
n.push(s` <rect x="${e.x}" y="${e.y}" width="${c}" height="${18}" ` + s`fill="var(--_group-hdr)" stroke="var(--_node-stroke)" stroke-width="${L.outerBox}" />`), n.push(" " + _(a, e.x + 6, e.y + 9, t.edgeLabel, s`font-size="${t.edgeLabel}" font-weight="${F.groupHeader}" fill="var(--_text-sec)"`));
|
|
2443
|
+
for (let r of e.dividers) n.push(s` <line x1="${e.x}" y1="${r.y}" x2="${e.x + e.width}" y2="${r.y}" ` + "stroke=\"var(--_line)\" stroke-width=\"0.75\" stroke-dasharray=\"6 4\" />"), r.label && n.push(" " + _(s`[${r.label}]`, e.x + 8, r.y + 14, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="start" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`));
|
|
2444
|
+
return n.push("</g>"), n.join("\n");
|
|
2445
|
+
}
|
|
2446
|
+
function Pr(e, t) {
|
|
2447
|
+
let { x: n, y: r, width: a, height: o } = e, c = e.actors && e.actors.length > 0 ? s` data-actors="${e.actors.map(i).join(",")}"` : "", l = e.position ? s` data-position="${i(e.position)}"` : "", u = [
|
|
2448
|
+
s`${n},${r}`,
|
|
2449
|
+
s`${n + a - 6},${r}`,
|
|
2450
|
+
s`${n + a},${r + 6}`,
|
|
2451
|
+
s`${n + a},${r + o}`,
|
|
2452
|
+
s`${n},${r + o}`
|
|
2453
|
+
].join(" ");
|
|
2454
|
+
return s`<g class="note"${l}${c}>` + s`\n <polygon points="${u}" ` + s`fill="var(--bg)" stroke="var(--_node-stroke)" stroke-width="${L.innerBox}" />` + s`\n <polygon points="${n + a - 6},${r} ${n + a},${r + 6} ${n + a - 6},${r + 6}" ` + s`fill="var(--_inner-stroke)" stroke="var(--_node-stroke)" stroke-width="${L.innerBox}" />` + s`\n ${_(e.text, n + a / 2, r + o / 2, t.edgeLabel, s`font-size="${t.edgeLabel}" text-anchor="middle" font-weight="${F.edgeLabel}" fill="var(--_text-muted)"`)}` + "\n</g>";
|
|
2449
2455
|
}
|
|
2450
2456
|
//#endregion
|
|
2451
2457
|
//#region packages/svg-renderer/src/xychart/layout.ts
|
|
@@ -2476,24 +2482,24 @@ var Y = {
|
|
|
2476
2482
|
legendGap: 6,
|
|
2477
2483
|
legendItemGap: 16
|
|
2478
2484
|
};
|
|
2479
|
-
function
|
|
2480
|
-
return e.horizontal ?
|
|
2485
|
+
function Fr(e, t = {}) {
|
|
2486
|
+
return e.horizontal ? Lr(e) : Ir(e);
|
|
2481
2487
|
}
|
|
2482
|
-
function
|
|
2488
|
+
function Ir(e) {
|
|
2483
2489
|
let t = !!e.title, n = !!e.xAxis.title, r = !!e.yAxis.title, i = e.series.length > 1, a = e.yAxis.range;
|
|
2484
2490
|
if (!a)
|
|
2485
2491
|
/* v8 ignore next */
|
|
2486
2492
|
throw Error("XY chart: y-axis range was not set by the parser");
|
|
2487
|
-
let o =
|
|
2493
|
+
let o = Ur(a.min, a.max), s = Math.max(...o.map((e) => M(Wr(e), Y.axisLabelFontSize, Y.axisLabelFontWeight)), Y.yLabelWidth), c = Y.padding + (t ? Y.titleHeight : 0) + (i ? Y.legendHeight : 0), l = Y.padding + Y.xLabelHeight + (n ? Y.axisTitlePad : 0), u = Y.padding + s + Y.yLabelGap + (r ? Y.axisTitlePad : 0), d = Y.padding, f = Y.plotWidth, p = Y.plotHeight, m = u + f + d, h = c + p + l, g = {
|
|
2488
2494
|
x: u,
|
|
2489
2495
|
y: c,
|
|
2490
2496
|
width: f,
|
|
2491
2497
|
height: p
|
|
2492
|
-
}, _ =
|
|
2498
|
+
}, _ = Rr(e), v = (e) => u + (e + .5) * (f / _), y = f / _, b = (e) => {
|
|
2493
2499
|
let t = (e - a.min) / (a.max - a.min || 1);
|
|
2494
2500
|
return c + p - t * p;
|
|
2495
|
-
}, x =
|
|
2496
|
-
label:
|
|
2501
|
+
}, x = Br(e, v, c + p, y), S = o.map((e) => ({
|
|
2502
|
+
label: Wr(e),
|
|
2497
2503
|
x: u,
|
|
2498
2504
|
y: b(e),
|
|
2499
2505
|
tx: u - Y.tickLength,
|
|
@@ -2506,7 +2512,7 @@ function Fr(e) {
|
|
|
2506
2512
|
y1: b(e),
|
|
2507
2513
|
x2: u + f,
|
|
2508
2514
|
y2: b(e)
|
|
2509
|
-
})), w =
|
|
2515
|
+
})), w = zr(e, _), T = e.series.map((e, t) => t), E = Vr(e, v, b, y, a.min, w, T), D = Hr(e, v, b, w, T), O = Y.padding + (t ? Y.titleHeight : 0) + Y.legendHeight / 2, k = i ? Gr(e, m / 2, O, T) : [], A = {
|
|
2510
2516
|
x1: u,
|
|
2511
2517
|
y1: c + p,
|
|
2512
2518
|
x2: u + f,
|
|
@@ -2551,12 +2557,12 @@ function Fr(e) {
|
|
|
2551
2557
|
legend: k
|
|
2552
2558
|
};
|
|
2553
2559
|
}
|
|
2554
|
-
function
|
|
2560
|
+
function Lr(e) {
|
|
2555
2561
|
let t = !!e.title, n = !!e.xAxis.title, r = !!e.yAxis.title, i = e.series.length > 1, a = e.yAxis.range;
|
|
2556
2562
|
if (!a)
|
|
2557
2563
|
/* v8 ignore next */
|
|
2558
2564
|
throw Error("XY chart: y-axis range was not set by the parser");
|
|
2559
|
-
let o =
|
|
2565
|
+
let o = Ur(a.min, a.max), s = Rr(e), c = zr(e, s), l = Math.max(...c.map((e) => M(e, Y.axisLabelFontSize, Y.axisLabelFontWeight)), 40), u = Y.padding + (t ? Y.titleHeight : 0) + (i ? Y.legendHeight : 0), d = Y.padding + Y.xLabelHeight + (r ? Y.axisTitlePad : 0), f = Y.padding + l + Y.yLabelGap + (n ? Y.axisTitlePad : 0), p = Y.padding, m = Y.plotWidth, h = Y.plotHeight, g = f + m + p, _ = u + h + d, v = {
|
|
2560
2566
|
x: f,
|
|
2561
2567
|
y: u,
|
|
2562
2568
|
width: m,
|
|
@@ -2565,7 +2571,7 @@ function Ir(e) {
|
|
|
2565
2571
|
let t = (e - a.min) / (a.max - a.min || 1);
|
|
2566
2572
|
return f + t * m;
|
|
2567
2573
|
}, b = h / s, x = (e) => u + (e + .5) * b, S = o.map((e) => ({
|
|
2568
|
-
label:
|
|
2574
|
+
label: Wr(e),
|
|
2569
2575
|
x: y(e),
|
|
2570
2576
|
y: u + h,
|
|
2571
2577
|
tx: y(e),
|
|
@@ -2672,24 +2678,24 @@ function Ir(e) {
|
|
|
2672
2678
|
bars: D,
|
|
2673
2679
|
lines: O,
|
|
2674
2680
|
gridLines: w,
|
|
2675
|
-
legend: i ?
|
|
2681
|
+
legend: i ? Gr(e, g / 2, ie, T) : []
|
|
2676
2682
|
};
|
|
2677
2683
|
}
|
|
2678
|
-
function
|
|
2684
|
+
function Rr(e) {
|
|
2679
2685
|
if (e.xAxis.categories) return e.xAxis.categories.length;
|
|
2680
2686
|
for (let t of e.series) if (t.data.length > 0) return t.data.length;
|
|
2681
2687
|
return 1;
|
|
2682
2688
|
}
|
|
2683
|
-
function
|
|
2689
|
+
function zr(e, t) {
|
|
2684
2690
|
if (e.xAxis.categories) return e.xAxis.categories;
|
|
2685
2691
|
if (e.xAxis.range) {
|
|
2686
2692
|
let { min: n, max: r } = e.xAxis.range, i = t > 1 ? (r - n) / (t - 1) : 0;
|
|
2687
|
-
return Array.from({ length: t }, (e, t) =>
|
|
2693
|
+
return Array.from({ length: t }, (e, t) => Wr(n + i * t));
|
|
2688
2694
|
}
|
|
2689
2695
|
return Array.from({ length: t }, (e, t) => String(t + 1));
|
|
2690
2696
|
}
|
|
2691
|
-
function
|
|
2692
|
-
return
|
|
2697
|
+
function Br(e, t, n, r) {
|
|
2698
|
+
return zr(e, Rr(e)).map((e, r) => ({
|
|
2693
2699
|
label: e,
|
|
2694
2700
|
x: t(r),
|
|
2695
2701
|
y: n,
|
|
@@ -2700,7 +2706,7 @@ function zr(e, t, n, r) {
|
|
|
2700
2706
|
textAnchor: "middle"
|
|
2701
2707
|
}));
|
|
2702
2708
|
}
|
|
2703
|
-
function
|
|
2709
|
+
function Vr(e, t, n, r, i, a, o) {
|
|
2704
2710
|
let s = e.series.filter((e) => e.type === "bar").length;
|
|
2705
2711
|
if (s === 0) return [];
|
|
2706
2712
|
let c = r * (1 - Y.barPadRatio), l = s > 1 ? (c - (s - 1) * Y.barGroupGap) / s : c, u = Math.min(l, Y.maxBarWidth), d = s > 1 ? u * s + Y.barGroupGap * (s - 1) : u, f = [], p = 0, m = 0;
|
|
@@ -2726,7 +2732,7 @@ function Br(e, t, n, r, i, a, o) {
|
|
|
2726
2732
|
}
|
|
2727
2733
|
return f;
|
|
2728
2734
|
}
|
|
2729
|
-
function
|
|
2735
|
+
function Hr(e, t, n, r, i) {
|
|
2730
2736
|
let a = [], o = 0, s = 0;
|
|
2731
2737
|
for (let c of e.series) {
|
|
2732
2738
|
if (c.type !== "line") {
|
|
@@ -2747,7 +2753,7 @@ function Vr(e, t, n, r, i) {
|
|
|
2747
2753
|
}
|
|
2748
2754
|
return a;
|
|
2749
2755
|
}
|
|
2750
|
-
function
|
|
2756
|
+
function Ur(e, t) {
|
|
2751
2757
|
let n = t - e;
|
|
2752
2758
|
if (n <= 0) return [e];
|
|
2753
2759
|
let r = n / 6, i = 10 ** Math.floor(Math.log10(r)), a = r / i, o;
|
|
@@ -2756,10 +2762,10 @@ function Hr(e, t) {
|
|
|
2756
2762
|
for (let e = s; e <= t + o * .001; e += o) c.push(Math.round(e * 1e10) / 1e10);
|
|
2757
2763
|
return c;
|
|
2758
2764
|
}
|
|
2759
|
-
function
|
|
2765
|
+
function Wr(e) {
|
|
2760
2766
|
return Number.isInteger(e) ? String(e) : e.toFixed(+(Math.abs(e) < 10));
|
|
2761
2767
|
}
|
|
2762
|
-
function
|
|
2768
|
+
function Gr(e, t, n, r) {
|
|
2763
2769
|
let i = [], a = 0, o = 0;
|
|
2764
2770
|
for (let t = 0; t < e.series.length; t++) {
|
|
2765
2771
|
let s = e.series[t], c = s.type === "bar" ? `Bar ${a + 1}` : `Line ${o + 1}`;
|
|
@@ -2803,24 +2809,24 @@ var X = {
|
|
|
2803
2809
|
minY: 4,
|
|
2804
2810
|
pointerSize: 6
|
|
2805
2811
|
};
|
|
2806
|
-
function
|
|
2812
|
+
function Kr(e, t, r = "Inter", i = !1, a = !1, o, s, c, l = {}) {
|
|
2807
2813
|
let u = [], d = Math.max(0, ...e.bars.map((e) => e.colorIndex), ...e.lines.map((e) => e.colorIndex)), f = U(E(e.width, e.height, t, i, s, c, void 0, l.styleAttribute).replace("<svg ", `<svg data-xychart-colors="${d}" `), o);
|
|
2808
|
-
u.push(f), u.push(r
|
|
2809
|
-
let p = Math.max(...e.lines.map((e) => e.points.length), 0), m = p > 0 && p <= 12, { style: h, defs: g } =
|
|
2814
|
+
u.push(f), u.push(n(r, !1, l.nonce));
|
|
2815
|
+
let p = Math.max(...e.lines.map((e) => e.points.length), 0), m = p > 0 && p <= 12, { style: h, defs: g } = qr(e, a, m, t.accent, t.bg, l.nonce);
|
|
2810
2816
|
u.push(h), g && u.push(g);
|
|
2811
2817
|
let { plotArea: _ } = e, v = e.xAxis.ticks.map((e) => e.x), y = e.horizontal ? e.yAxis.ticks.map((e) => e.y) : e.gridLines.map((e) => e.y1), b = v.length > 1 ? Math.abs(v[1] - v[0]) : _.width / 6, x = y.length > 1 ? Math.abs(y[1] - y[0]) : _.height / 6, S = b / Math.max(1, Math.round(b / 20)), C = x / Math.max(1, Math.round(x / 20)), w = v[0] ?? _.x, T = y[0] ?? _.y, D = w - Math.ceil((w - _.x) / S) * S, O = T - Math.ceil((T - _.y) / C) * C;
|
|
2812
2818
|
for (let e = O; e <= _.y + _.height + .5; e += C) for (let t = D; t <= _.x + _.width + .5; t += S) u.push(`<circle cx="${Q(t)}" cy="${Q(e)}" r="1.5" class="xychart-grid"/>`);
|
|
2813
2819
|
let k = [];
|
|
2814
2820
|
for (let t of e.bars) {
|
|
2815
|
-
let n = ` data-value="${t.value}"${t.label ? ` data-label="${$(t.label)}"` : ""}`, r = e.horizontal ?
|
|
2821
|
+
let n = ` data-value="${t.value}"${t.label ? ` data-label="${$(t.label)}"` : ""}`, r = e.horizontal ? Yr(t.x, t.y, t.width, t.height, X.barRadius) : Jr(t.x, t.y, t.width, t.height, X.barRadius);
|
|
2816
2822
|
if (u.push(`<path d="${r}" class="xychart-bar xychart-color-${t.colorIndex}"${n}/>`), a) {
|
|
2817
|
-
let e =
|
|
2823
|
+
let e = $r(t.value), n = t.label ? `${t.label}: ${e}` : e, r = Qr(t.x + t.width / 2, t.y, e);
|
|
2818
2824
|
k.push(`<g class="xychart-bar-group"><rect x="${Q(t.x)}" y="${Q(t.y)}" width="${Q(t.width)}" height="${Q(t.height)}" fill="transparent"/><title>${$(n)}</title>` + r + "</g>");
|
|
2819
2825
|
}
|
|
2820
2826
|
}
|
|
2821
2827
|
for (let t of e.lines) {
|
|
2822
2828
|
if (t.points.length === 0) continue;
|
|
2823
|
-
let e =
|
|
2829
|
+
let e = Xr(t.points);
|
|
2824
2830
|
u.push(`<path d="${e}" class="xychart-line-shadow xychart-color-${t.colorIndex}" transform="translate(0,2)"/>`), u.push(`<path d="${e}" class="xychart-line xychart-color-${t.colorIndex}"/>`);
|
|
2825
2831
|
}
|
|
2826
2832
|
let A = [];
|
|
@@ -2843,16 +2849,16 @@ function Gr(e, t, n = "Inter", i = !1, a = !1, o, s, c, l = {}) {
|
|
|
2843
2849
|
let n = e[0].x, r = e[0].label || "";
|
|
2844
2850
|
if (a && e.length > 1) {
|
|
2845
2851
|
let i = Math.min(...e.map((e) => e.y)), a = Math.max(...e.map((e) => e.y)), o = X.dotRadius * 3, s = `<rect x="${Q(n - o)}" y="${Q(i - o)}" width="${Q(o * 2)}" height="${Q(a - i + o * 2)}" fill="transparent" class="xychart-hit"/>`, c = e.map((e) => ({
|
|
2846
|
-
text:
|
|
2852
|
+
text: $r(e.value),
|
|
2847
2853
|
legendLabel: t.get(e.seriesIndex) || `Line ${e.seriesIndex + 1}`
|
|
2848
|
-
})), l =
|
|
2854
|
+
})), l = Zr(n, i - X.dotRadius, r, c), u = c.map((e) => e.text), d = r ? `${r}: ${u.join(" · ")}` : u.join(" · "), f = `<g class="xychart-dot-group">${s}`;
|
|
2849
2855
|
for (let t of e) {
|
|
2850
2856
|
let e = ` data-value="${t.value}"${t.label ? ` data-label="${$(t.label)}"` : ""}`;
|
|
2851
2857
|
f += `<circle cx="${Q(t.x)}" cy="${Q(t.y)}" r="${X.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${e}/>`;
|
|
2852
2858
|
}
|
|
2853
2859
|
f += `<title>${$(d)}</title>${l}</g>`, A.push(f);
|
|
2854
2860
|
} else if (a) {
|
|
2855
|
-
let t = e[0], r = ` data-value="${t.value}"${t.label ? ` data-label="${$(t.label)}"` : ""}`, i =
|
|
2861
|
+
let t = e[0], r = ` data-value="${t.value}"${t.label ? ` data-label="${$(t.label)}"` : ""}`, i = $r(t.value), a = t.label ? `${t.label}: ${i}` : i, o = Qr(n, t.y - X.dotRadius, i), s = m ? `<circle cx="${Q(n)}" cy="${Q(t.y)}" r="${X.dotRadius * 3}" fill="transparent" class="xychart-hit"/>` : "";
|
|
2856
2862
|
A.push(`<g class="xychart-dot-group">${s}<circle cx="${Q(t.x)}" cy="${Q(t.y)}" r="${X.dotRadius}" class="xychart-dot xychart-color-${t.colorIndex}"${r}/><title>${$(a)}</title>${o}</g>`);
|
|
2857
2863
|
} else for (let t of e) {
|
|
2858
2864
|
let e = ` data-value="${t.value}"${t.label ? ` data-label="${$(t.label)}"` : ""}`;
|
|
@@ -2883,13 +2889,13 @@ function Gr(e, t, n = "Inter", i = !1, a = !1, o, s, c, l = {}) {
|
|
|
2883
2889
|
for (let e of A) u.push(e);
|
|
2884
2890
|
return u.push("</svg>"), u.join("\n");
|
|
2885
2891
|
}
|
|
2886
|
-
function
|
|
2887
|
-
let o = r ??
|
|
2892
|
+
function qr(e, t, n, r, i, a) {
|
|
2893
|
+
let o = r ?? ne, s = /* @__PURE__ */ new Set();
|
|
2888
2894
|
for (let t of e.bars) s.add(t.colorIndex);
|
|
2889
2895
|
for (let t of e.lines) s.add(t.colorIndex);
|
|
2890
2896
|
let c = [];
|
|
2891
2897
|
for (let e of [...s].sort((e, t) => e - t)) {
|
|
2892
|
-
let t = e === 0 ? `var(--accent, ${
|
|
2898
|
+
let t = e === 0 ? `var(--accent, ${ne})` : ie(e, o, i);
|
|
2893
2899
|
c.push(` --xychart-color-${e}: ${t};`), c.push(` --xychart-bar-fill-${e}: color-mix(in srgb, var(--bg) 75%, var(--xychart-color-${e}) 25%);`);
|
|
2894
2900
|
}
|
|
2895
2901
|
let l = [];
|
|
@@ -2919,7 +2925,7 @@ ${l.join("\n")}${u}
|
|
|
2919
2925
|
defs: ""
|
|
2920
2926
|
};
|
|
2921
2927
|
}
|
|
2922
|
-
function
|
|
2928
|
+
function Jr(e, t, n, r, i) {
|
|
2923
2929
|
let a = Math.min(i, n / 2, r / 2);
|
|
2924
2930
|
return a <= 0 ? `M${Q(e)},${Q(t)} h${Q(n)} v${Q(r)} h${Q(-n)} Z` : [
|
|
2925
2931
|
`M${Q(e)},${Q(t + a)}`,
|
|
@@ -2933,7 +2939,7 @@ function qr(e, t, n, r, i) {
|
|
|
2933
2939
|
"Z"
|
|
2934
2940
|
].join(" ");
|
|
2935
2941
|
}
|
|
2936
|
-
function
|
|
2942
|
+
function Yr(e, t, n, r, i) {
|
|
2937
2943
|
let a = Math.min(i, n / 2, r / 2);
|
|
2938
2944
|
return a <= 0 ? `M${Q(e)},${Q(t)} h${Q(n)} v${Q(r)} h${Q(-n)} Z` : [
|
|
2939
2945
|
`M${Q(e + a)},${Q(t)}`,
|
|
@@ -2948,7 +2954,7 @@ function Jr(e, t, n, r, i) {
|
|
|
2948
2954
|
"Z"
|
|
2949
2955
|
].join(" ");
|
|
2950
2956
|
}
|
|
2951
|
-
function
|
|
2957
|
+
function Xr(e) {
|
|
2952
2958
|
if (e.length === 0) return "";
|
|
2953
2959
|
if (e.length === 1) return `M${Q(e[0].x)},${Q(e[0].y)}`;
|
|
2954
2960
|
if (e.length === 2) return `M${Q(e[0].x)},${Q(e[0].y)} L${Q(e[1].x)},${Q(e[1].y)}`;
|
|
@@ -2977,7 +2983,7 @@ function Yr(e) {
|
|
|
2977
2983
|
}
|
|
2978
2984
|
return o;
|
|
2979
2985
|
}
|
|
2980
|
-
function
|
|
2986
|
+
function Zr(e, t, n, r) {
|
|
2981
2987
|
let i = M(n, Z.fontSize, 600), a = Math.max(...r.map((e) => {
|
|
2982
2988
|
let t = M(e.legendLabel, Z.fontSize, Z.fontWeight), n = M(e.text, Z.fontSize, Z.fontWeight);
|
|
2983
2989
|
return t + 10 + n;
|
|
@@ -2989,11 +2995,11 @@ function Xr(e, t, n, r) {
|
|
|
2989
2995
|
for (let e of r) h += 20, m += `<text x="${Q(g)}" y="${Q(h)}" text-anchor="start" font-size="${Z.fontSize}" font-weight="${Z.fontWeight}" dy="${R}" class="xychart-tip xychart-tip-text">${$(e.legendLabel)}</text>`, m += `<text x="${Q(_)}" y="${Q(h)}" text-anchor="end" font-size="${Z.fontSize}" font-weight="${Z.fontWeight}" dy="${R}" class="xychart-tip xychart-tip-text">${$(e.text)}</text>`;
|
|
2990
2996
|
return m;
|
|
2991
2997
|
}
|
|
2992
|
-
function
|
|
2998
|
+
function Qr(e, t, n) {
|
|
2993
2999
|
let r = M(n, Z.fontSize, Z.fontWeight) + Z.padX * 2, i = Z.height, a = Math.max(Z.minY, t - Z.offsetY - i - Z.pointerSize), o = e - r / 2, s = e, c = a + i / 2, l = e, u = a + i, d = Z.pointerSize, f = `<polygon points="${Q(l - d)},${Q(u)} ${Q(l + d)},${Q(u)} ${Q(l)},${Q(u + d)}" class="xychart-tip xychart-tip-ptr"/>`;
|
|
2994
3000
|
return `<rect x="${Q(o)}" y="${Q(a)}" width="${Q(r)}" height="${i}" rx="${Z.rx}" class="xychart-tip xychart-tip-bg"/>` + f + `<text x="${Q(s)}" y="${Q(c)}" text-anchor="middle" dy="${R}" class="xychart-tip xychart-tip-text">${$(n)}</text>`;
|
|
2995
3001
|
}
|
|
2996
|
-
function
|
|
3002
|
+
function $r(e) {
|
|
2997
3003
|
return Number.isInteger(e) ? e.toLocaleString("en-US") : e.toFixed(+(Math.abs(e) < 10));
|
|
2998
3004
|
}
|
|
2999
3005
|
function Q(e) {
|
|
@@ -3004,12 +3010,12 @@ function $(e) {
|
|
|
3004
3010
|
}
|
|
3005
3011
|
//#endregion
|
|
3006
3012
|
//#region src/parser.ts
|
|
3007
|
-
function
|
|
3013
|
+
function ei(e) {
|
|
3008
3014
|
let t = e.trim();
|
|
3009
3015
|
return t.length >= 2 && (t[0] === "\"" && t[t.length - 1] === "\"" || t[0] === "'" && t[t.length - 1] === "'") ? t.slice(1, -1) : t;
|
|
3010
3016
|
}
|
|
3011
|
-
var
|
|
3012
|
-
function
|
|
3017
|
+
var ti = "\"graph <dir>\"/\"flowchart <dir>\" (dir: TD, TB, LR, BT, RL), \"stateDiagram-v2\", \"sequenceDiagram\", \"classDiagram\", \"erDiagram\", \"xychart-beta\"";
|
|
3018
|
+
function ni(e) {
|
|
3013
3019
|
let t = e.trim().toLowerCase();
|
|
3014
3020
|
if (/^sequence/.test(t)) return "sequenceDiagram";
|
|
3015
3021
|
if (/^class/.test(t)) return "classDiagram";
|
|
@@ -3017,11 +3023,11 @@ function ti(e) {
|
|
|
3017
3023
|
if (/^xychart/.test(t)) return "xychart-beta";
|
|
3018
3024
|
if (/^state/.test(t)) return "stateDiagram-v2";
|
|
3019
3025
|
}
|
|
3020
|
-
var
|
|
3021
|
-
function
|
|
3026
|
+
var ri = /^(?:[\w-]+@)?<?(?:-{2,}|={2,}|-\.+-?|~{3,})/;
|
|
3027
|
+
function ii(e) {
|
|
3022
3028
|
let t = [];
|
|
3023
3029
|
for (let n of e) n.forEach((e, n) => {
|
|
3024
|
-
if (n === 0 && t.length > 0 &&
|
|
3030
|
+
if (n === 0 && t.length > 0 && ri.test(e.text)) {
|
|
3025
3031
|
let n = t[t.length - 1];
|
|
3026
3032
|
t[t.length - 1] = {
|
|
3027
3033
|
text: `${n.text} ${e.text}`,
|
|
@@ -3031,13 +3037,13 @@ function ri(e) {
|
|
|
3031
3037
|
});
|
|
3032
3038
|
return t;
|
|
3033
3039
|
}
|
|
3034
|
-
function
|
|
3035
|
-
let t =
|
|
3040
|
+
function ai(e) {
|
|
3041
|
+
let t = o(e.split("\n").map((e) => e.trim())), n = ii(w(e));
|
|
3036
3042
|
if (n.length === 0) throw Error("Empty mermaid diagram");
|
|
3037
|
-
let r = n[0], i = /^stateDiagram(-v2)?\s*$/i.test(r.text) ?
|
|
3043
|
+
let r = n[0], i = /^stateDiagram(-v2)?\s*$/i.test(r.text) ? si(n) : oi(n);
|
|
3038
3044
|
return i.initConfig = t, i;
|
|
3039
3045
|
}
|
|
3040
|
-
function
|
|
3046
|
+
function oi(e) {
|
|
3041
3047
|
let t = e[0];
|
|
3042
3048
|
if (t === void 0)
|
|
3043
3049
|
/* v8 ignore next */
|
|
@@ -3049,8 +3055,8 @@ function ai(e) {
|
|
|
3049
3055
|
let r = e[1].trim();
|
|
3050
3056
|
throw Error(r.length > 0 ? `Line ${t.line}: Invalid direction "${r}" in header "${n}". Expected one of: TD, TB, LR, BT, RL.` : `Line ${t.line}: Missing direction in header "${n}". Expected e.g. "graph TD" or "flowchart LR" — one of: TD, TB, LR, BT, RL.`);
|
|
3051
3057
|
}
|
|
3052
|
-
let r =
|
|
3053
|
-
throw Error(`Line ${t.line}: Invalid mermaid header: "${n}".${i} Supported headers: ${
|
|
3058
|
+
let r = ni(n), i = r && r.toLowerCase() !== n.trim().toLowerCase() ? ` Did you mean "${r}"?` : "";
|
|
3059
|
+
throw Error(`Line ${t.line}: Invalid mermaid header: "${n}".${i} Supported headers: ${ti}.`);
|
|
3054
3060
|
}
|
|
3055
3061
|
let i = {
|
|
3056
3062
|
direction: O(r[1]),
|
|
@@ -3067,10 +3073,10 @@ function ai(e) {
|
|
|
3067
3073
|
let n = e[t].text;
|
|
3068
3074
|
if (A(n, i) || k(n, i) || j(n, i)) continue;
|
|
3069
3075
|
if (/^click\s+/i.test(n)) {
|
|
3070
|
-
|
|
3076
|
+
yi(n, i);
|
|
3071
3077
|
continue;
|
|
3072
3078
|
}
|
|
3073
|
-
if (
|
|
3079
|
+
if (xi(n, i)) continue;
|
|
3074
3080
|
let r = n.match(/^linkStyle\s+(default|[\d,\s]+)\s+(.+)$/);
|
|
3075
3081
|
if (r) {
|
|
3076
3082
|
let e = r[1].trim(), t = g(r[2]);
|
|
@@ -3095,7 +3101,7 @@ function ai(e) {
|
|
|
3095
3101
|
let s = n.match(/^subgraph\s+(.+)$/);
|
|
3096
3102
|
if (s) {
|
|
3097
3103
|
let e = s[1].trim(), t = e.match(/^([^\s[]+)\s*\[(.+)\]$/), n, r;
|
|
3098
|
-
t ? (n = t[1], r = m(
|
|
3104
|
+
t ? (n = t[1], r = m(ei(t[2]))) : (r = m(ei(e)), n = r.replace(/\s+/g, "_").replace(/[^\p{L}\p{N}_-]/gu, ""));
|
|
3099
3105
|
let i = {
|
|
3100
3106
|
id: n,
|
|
3101
3107
|
label: r,
|
|
@@ -3110,11 +3116,11 @@ function ai(e) {
|
|
|
3110
3116
|
e && (a.length > 0 ? a[a.length - 1].children.push(e) : i.subgraphs.push(e));
|
|
3111
3117
|
continue;
|
|
3112
3118
|
}
|
|
3113
|
-
|
|
3119
|
+
Ti(n, i, a);
|
|
3114
3120
|
}
|
|
3115
3121
|
return i;
|
|
3116
3122
|
}
|
|
3117
|
-
function
|
|
3123
|
+
function si(e) {
|
|
3118
3124
|
let t = {
|
|
3119
3125
|
direction: "TD",
|
|
3120
3126
|
nodes: /* @__PURE__ */ new Map(),
|
|
@@ -3148,7 +3154,7 @@ function oi(e) {
|
|
|
3148
3154
|
}
|
|
3149
3155
|
continue;
|
|
3150
3156
|
}
|
|
3151
|
-
if (
|
|
3157
|
+
if (xi(s, t)) continue;
|
|
3152
3158
|
let u = s.match(/^state\s+(?:"([^"]+)"\s+as\s+)?([\w\p{L}]+)\s*\{$/u);
|
|
3153
3159
|
if (u) {
|
|
3154
3160
|
let e = u[1] ?? u[2], i = u[2], a = {
|
|
@@ -3168,7 +3174,7 @@ function oi(e) {
|
|
|
3168
3174
|
let d = s.match(/^state\s+"([^"]+)"\s+as\s+([\w\p{L}]+)\s*$/u);
|
|
3169
3175
|
if (d) {
|
|
3170
3176
|
let e = m(d[1]), r = d[2];
|
|
3171
|
-
|
|
3177
|
+
ci(t, n, {
|
|
3172
3178
|
id: r,
|
|
3173
3179
|
label: e,
|
|
3174
3180
|
shape: "rounded"
|
|
@@ -3178,15 +3184,15 @@ function oi(e) {
|
|
|
3178
3184
|
let f = s.match(/^(\[\*\]|[\w\p{L}-]+)\s*(?:([\w-]+)@)?-->\s*(\[\*\]|[\w\p{L}-]+)(?:\s*:\s*(.+))?$/u);
|
|
3179
3185
|
if (f) {
|
|
3180
3186
|
let e = f[1], o = f[2], s = f[3], c = f[4]?.trim(), l = c ? m(c) : void 0;
|
|
3181
|
-
e === "[*]" ? (i++, e = `_start${i > 1 ? i : ""}`,
|
|
3187
|
+
e === "[*]" ? (i++, e = `_start${i > 1 ? i : ""}`, ci(t, n, {
|
|
3182
3188
|
id: e,
|
|
3183
3189
|
label: "",
|
|
3184
3190
|
shape: "state-start"
|
|
3185
|
-
})) : r.has(e) ||
|
|
3191
|
+
})) : r.has(e) || li(t, n, e), s === "[*]" ? (a++, s = `_end${a > 1 ? a : ""}`, ci(t, n, {
|
|
3186
3192
|
id: s,
|
|
3187
3193
|
label: "",
|
|
3188
3194
|
shape: "state-end"
|
|
3189
|
-
})) : r.has(s) ||
|
|
3195
|
+
})) : r.has(s) || li(t, n, s), t.edges.push({
|
|
3190
3196
|
source: e,
|
|
3191
3197
|
target: s,
|
|
3192
3198
|
label: l,
|
|
@@ -3200,7 +3206,7 @@ function oi(e) {
|
|
|
3200
3206
|
let p = s.match(/^([\w\p{L}-]+)\s*:\s*(.+)$/u);
|
|
3201
3207
|
if (p) {
|
|
3202
3208
|
let e = p[1];
|
|
3203
|
-
|
|
3209
|
+
ci(t, n, {
|
|
3204
3210
|
id: e,
|
|
3205
3211
|
label: m(p[2].trim()),
|
|
3206
3212
|
shape: "rounded"
|
|
@@ -3210,14 +3216,14 @@ function oi(e) {
|
|
|
3210
3216
|
}
|
|
3211
3217
|
return t;
|
|
3212
3218
|
}
|
|
3213
|
-
function
|
|
3219
|
+
function ci(e, t, n) {
|
|
3214
3220
|
if (e.nodes.has(n.id) || e.nodes.set(n.id, n), t.length > 0) {
|
|
3215
3221
|
let e = t[t.length - 1];
|
|
3216
3222
|
e.nodeIds.includes(n.id) || e.nodeIds.push(n.id);
|
|
3217
3223
|
}
|
|
3218
3224
|
}
|
|
3219
|
-
function
|
|
3220
|
-
if (!e.nodes.has(n))
|
|
3225
|
+
function li(e, t, n) {
|
|
3226
|
+
if (!e.nodes.has(n)) ci(e, t, {
|
|
3221
3227
|
id: n,
|
|
3222
3228
|
label: n,
|
|
3223
3229
|
shape: "rounded"
|
|
@@ -3227,12 +3233,12 @@ function ci(e, t, n) {
|
|
|
3227
3233
|
e.nodeIds.includes(n) || e.nodeIds.push(n);
|
|
3228
3234
|
}
|
|
3229
3235
|
}
|
|
3230
|
-
var
|
|
3231
|
-
function
|
|
3236
|
+
var ui = /^(<|o|x)?(-{2,}|={2,}|-\.+-|~{3,})(>|o|x)?(?:\|([^|]*)\|)?/, di = /* @__PURE__ */ new Set(["--", "=="]);
|
|
3237
|
+
function fi(e) {
|
|
3232
3238
|
if (e === "o") return "circle";
|
|
3233
3239
|
if (e === "x") return "cross";
|
|
3234
3240
|
}
|
|
3235
|
-
var
|
|
3241
|
+
var pi = /^(<|o|x)?(--|-\.|==)\s+(.+?)\s+(-{2,}[>ox]|={2,}[>ox]|\.+-[>ox]|-{3,}|={3,}|-\.+-)/, mi = [
|
|
3236
3242
|
{
|
|
3237
3243
|
regex: /^([\w\p{L}-]+)\(\(\(((?:"[^"]*"|(?!\)\)\)).)+)\)\)\)/u,
|
|
3238
3244
|
shape: "doublecircle"
|
|
@@ -3281,9 +3287,9 @@ var fi = /^(<|o|x)?(--|-\.|==)\s+(.+?)\s+(-{2,}[>ox]|={2,}[>ox]|\.+-[>ox]|-{3,}|
|
|
|
3281
3287
|
regex: /^([\w\p{L}-]+)\{((?:"[^"]*"|(?!\}).)+)\}/u,
|
|
3282
3288
|
shape: "diamond"
|
|
3283
3289
|
}
|
|
3284
|
-
],
|
|
3285
|
-
function
|
|
3286
|
-
if (e.shape) return
|
|
3290
|
+
], hi = /^([\w\p{L}]+(?:-[\w\p{L}]+)*)/u, gi = /^([\w\p{L}-]+)(?=@\{)/u;
|
|
3291
|
+
function _i(e) {
|
|
3292
|
+
if (e.shape) return de(e.shape) ?? "rectangle";
|
|
3287
3293
|
if (e.icon !== void 0 || e.img !== void 0) switch (e.form?.toLowerCase()) {
|
|
3288
3294
|
case "circle": return "circle";
|
|
3289
3295
|
case "rounded": return "rounded";
|
|
@@ -3291,46 +3297,46 @@ function gi(e) {
|
|
|
3291
3297
|
}
|
|
3292
3298
|
return "rectangle";
|
|
3293
3299
|
}
|
|
3294
|
-
function
|
|
3300
|
+
function vi(e, t) {
|
|
3295
3301
|
return t.label !== void 0 && t.label.length > 0 ? t.label : t.icon ? t.icon : t.img ? t.img : e;
|
|
3296
3302
|
}
|
|
3297
|
-
function
|
|
3298
|
-
|
|
3303
|
+
function yi(e, n) {
|
|
3304
|
+
t(e, n.interactions);
|
|
3299
3305
|
}
|
|
3300
|
-
var
|
|
3301
|
-
function
|
|
3302
|
-
let n = e.match(
|
|
3306
|
+
var bi = /^([\w-]+)(?=@\{)/;
|
|
3307
|
+
function xi(e, t) {
|
|
3308
|
+
let n = e.match(bi);
|
|
3303
3309
|
if (!n || !t.edges.some((e) => e.id === n[1])) return !1;
|
|
3304
|
-
let r =
|
|
3305
|
-
return r ? (
|
|
3310
|
+
let r = ae(e.slice(n[1].length));
|
|
3311
|
+
return r ? (Si(t, n[1], ce(r.body)), !0) : !1;
|
|
3306
3312
|
}
|
|
3307
|
-
function
|
|
3313
|
+
function Si(e, t, n) {
|
|
3308
3314
|
for (let r of e.edges) r.id === t && (n.animate !== void 0 && (r.animate = n.animate.toLowerCase() !== "false"), n.animation !== void 0 && (r.animate = !0));
|
|
3309
3315
|
}
|
|
3310
|
-
var
|
|
3311
|
-
function
|
|
3312
|
-
let r = e.trim(), i =
|
|
3316
|
+
var Ci = /^:::([\w][\w-]*)/, wi = /^([\w\p{L}-]+):::([\w][\w-]*)/u;
|
|
3317
|
+
function Ti(e, t, n) {
|
|
3318
|
+
let r = e.trim(), i = Ei(r, t, n);
|
|
3313
3319
|
if (!i || i.ids.length === 0) return;
|
|
3314
3320
|
r = i.remaining.trim();
|
|
3315
3321
|
let a = i.ids;
|
|
3316
3322
|
for (; r.length > 0;) {
|
|
3317
3323
|
let e, i, o, s, c, l, u, d = r.match(/^([\w-]+)@(?=[-=<~ox])/);
|
|
3318
3324
|
d && (u = d[1], r = r.slice(d[0].length));
|
|
3319
|
-
let f = r.match(
|
|
3320
|
-
if (f && p !== void 0 && !(h === void 0 && g === void 0 &&
|
|
3321
|
-
e = h !== void 0, c =
|
|
3325
|
+
let f = r.match(ui), p = f?.[2], h = f?.[1], g = f?.[3];
|
|
3326
|
+
if (f && p !== void 0 && !(h === void 0 && g === void 0 && di.has(p))) {
|
|
3327
|
+
e = h !== void 0, c = fi(h);
|
|
3322
3328
|
let t = f[4]?.trim();
|
|
3323
|
-
s = t ? m(t) : void 0, r = r.slice(f[0].length).trim(), i =
|
|
3329
|
+
s = t ? m(t) : void 0, r = r.slice(f[0].length).trim(), i = Ai(p), o = g !== void 0, l = fi(g);
|
|
3324
3330
|
} else {
|
|
3325
|
-
let t = r.match(
|
|
3331
|
+
let t = r.match(pi);
|
|
3326
3332
|
if (!t) break;
|
|
3327
|
-
e = !!t[1], c =
|
|
3333
|
+
e = !!t[1], c = fi(t[1]);
|
|
3328
3334
|
let n = t[3].trim();
|
|
3329
3335
|
s = n ? m(n) : void 0;
|
|
3330
3336
|
let a = t[2], u = t[4];
|
|
3331
|
-
r = r.slice(t[0].length).trim(), i =
|
|
3337
|
+
r = r.slice(t[0].length).trim(), i = ji(a, u), l = fi(u.slice(-1)), o = u.endsWith(">") || l !== void 0;
|
|
3332
3338
|
}
|
|
3333
|
-
let _ =
|
|
3339
|
+
let _ = Ei(r, t, n);
|
|
3334
3340
|
if (!_ || _.ids.length === 0) break;
|
|
3335
3341
|
r = _.remaining.trim();
|
|
3336
3342
|
for (let n of a) for (let r of _.ids) t.edges.push({
|
|
@@ -3347,13 +3353,13 @@ function wi(e, t, n) {
|
|
|
3347
3353
|
a = _.ids;
|
|
3348
3354
|
}
|
|
3349
3355
|
}
|
|
3350
|
-
function
|
|
3351
|
-
let r =
|
|
3356
|
+
function Ei(e, t, n) {
|
|
3357
|
+
let r = Di(e, t, n);
|
|
3352
3358
|
if (!r) return null;
|
|
3353
3359
|
let i = [r.id], a = r.remaining.trim();
|
|
3354
3360
|
for (; a.startsWith("&");) {
|
|
3355
3361
|
a = a.slice(1).trim();
|
|
3356
|
-
let e =
|
|
3362
|
+
let e = Di(a, t, n);
|
|
3357
3363
|
if (!e) break;
|
|
3358
3364
|
i.push(e.id), a = e.remaining.trim();
|
|
3359
3365
|
}
|
|
@@ -3362,27 +3368,27 @@ function Ti(e, t, n) {
|
|
|
3362
3368
|
remaining: a
|
|
3363
3369
|
};
|
|
3364
3370
|
}
|
|
3365
|
-
function
|
|
3366
|
-
let r = null, i = e, a, o = i.match(
|
|
3371
|
+
function Di(e, t, n) {
|
|
3372
|
+
let r = null, i = e, a, o = i.match(wi);
|
|
3367
3373
|
o && (a = o[2], i = o[1] + i.slice(o[0].length));
|
|
3368
|
-
let s = i.match(
|
|
3374
|
+
let s = i.match(gi);
|
|
3369
3375
|
if (s) {
|
|
3370
|
-
let e = s[1], a =
|
|
3376
|
+
let e = s[1], a = ae(i.slice(e.length));
|
|
3371
3377
|
if (a) {
|
|
3372
|
-
let o =
|
|
3373
|
-
|
|
3378
|
+
let o = ce(a.body);
|
|
3379
|
+
Oi(t, n, {
|
|
3374
3380
|
id: e,
|
|
3375
|
-
label: m(
|
|
3376
|
-
shape:
|
|
3381
|
+
label: m(vi(e, o)),
|
|
3382
|
+
shape: _i(o)
|
|
3377
3383
|
}), r = e, i = i.slice(e.length + a.length);
|
|
3378
3384
|
}
|
|
3379
3385
|
}
|
|
3380
|
-
if (r === null) for (let { regex: e, shape: a } of
|
|
3386
|
+
if (r === null) for (let { regex: e, shape: a } of mi) {
|
|
3381
3387
|
let o = i.match(e);
|
|
3382
3388
|
if (o) {
|
|
3383
3389
|
r = o[1];
|
|
3384
3390
|
let e = m(o[2]), s = typeof a == "function" ? a(o[3] ?? "") : a;
|
|
3385
|
-
|
|
3391
|
+
Oi(t, n, {
|
|
3386
3392
|
id: r,
|
|
3387
3393
|
label: e,
|
|
3388
3394
|
shape: s
|
|
@@ -3391,8 +3397,8 @@ function Ei(e, t, n) {
|
|
|
3391
3397
|
}
|
|
3392
3398
|
}
|
|
3393
3399
|
if (r === null) {
|
|
3394
|
-
let e = i.match(
|
|
3395
|
-
e && (r = e[1], t.nodes.has(r) ||
|
|
3400
|
+
let e = i.match(hi);
|
|
3401
|
+
e && (r = e[1], t.nodes.has(r) || Oi(t, n, {
|
|
3396
3402
|
id: r,
|
|
3397
3403
|
label: r,
|
|
3398
3404
|
shape: "rectangle"
|
|
@@ -3400,117 +3406,117 @@ function Ei(e, t, n) {
|
|
|
3400
3406
|
}
|
|
3401
3407
|
if (r === null) return null;
|
|
3402
3408
|
a && t.classAssignments.set(r, a);
|
|
3403
|
-
let c = i.match(
|
|
3409
|
+
let c = i.match(Ci);
|
|
3404
3410
|
return c && (t.classAssignments.set(r, c[1]), i = i.slice(c[0].length)), {
|
|
3405
3411
|
id: r,
|
|
3406
3412
|
remaining: i
|
|
3407
3413
|
};
|
|
3408
3414
|
}
|
|
3409
|
-
function
|
|
3410
|
-
e.nodes.has(n.id) || e.nodes.set(n.id, n),
|
|
3415
|
+
function Oi(e, t, n) {
|
|
3416
|
+
e.nodes.has(n.id) || e.nodes.set(n.id, n), ki(t, n.id);
|
|
3411
3417
|
}
|
|
3412
|
-
function
|
|
3418
|
+
function ki(e, t) {
|
|
3413
3419
|
if (e.length > 0) {
|
|
3414
3420
|
let n = e[e.length - 1];
|
|
3415
3421
|
n.nodeIds.includes(t) || n.nodeIds.push(t);
|
|
3416
3422
|
}
|
|
3417
3423
|
}
|
|
3418
|
-
function
|
|
3424
|
+
function Ai(e) {
|
|
3419
3425
|
return e.startsWith("~") ? "invisible" : e.includes(".") ? "dotted" : e.startsWith("=") ? "thick" : "solid";
|
|
3420
3426
|
}
|
|
3421
|
-
function
|
|
3427
|
+
function ji(e, t) {
|
|
3422
3428
|
return e.includes(".") || t.includes(".") ? "dotted" : e.startsWith("=") || t.startsWith("=") ? "thick" : "solid";
|
|
3423
3429
|
}
|
|
3424
3430
|
//#endregion
|
|
3425
3431
|
//#region packages/svg-renderer/src/registry.ts
|
|
3426
|
-
var
|
|
3432
|
+
var Mi = {
|
|
3427
3433
|
type: "xychart",
|
|
3428
|
-
parse:
|
|
3429
|
-
layoutForSvg:
|
|
3434
|
+
parse: ue,
|
|
3435
|
+
layoutForSvg: Fr,
|
|
3430
3436
|
renderSvg(e, t, n) {
|
|
3431
3437
|
let r = n.interactivity === void 0 ? n.interactive ?? !1 : n.interactivity === "full";
|
|
3432
|
-
return
|
|
3438
|
+
return Kr(e, t.colors, t.font, t.transparent, r, t.embedSource, t.title, t.decorative, t.emit);
|
|
3433
3439
|
}
|
|
3434
|
-
},
|
|
3440
|
+
}, Ni = {
|
|
3435
3441
|
type: "sequence",
|
|
3436
|
-
parse:
|
|
3437
|
-
layoutForSvg:
|
|
3442
|
+
parse: le,
|
|
3443
|
+
layoutForSvg: Sr,
|
|
3438
3444
|
renderSvg(e, t) {
|
|
3439
|
-
return
|
|
3445
|
+
return Cr(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
|
|
3440
3446
|
}
|
|
3441
3447
|
};
|
|
3442
|
-
function
|
|
3448
|
+
function Pi(e) {
|
|
3443
3449
|
return (e.interactivity ?? "static") !== "none";
|
|
3444
3450
|
}
|
|
3445
|
-
function
|
|
3451
|
+
function Fi(e) {
|
|
3446
3452
|
return (e.interactivity ?? "static") === "full";
|
|
3447
3453
|
}
|
|
3448
|
-
var
|
|
3449
|
-
xychart:
|
|
3454
|
+
var Ii = {
|
|
3455
|
+
xychart: Mi,
|
|
3450
3456
|
er: {
|
|
3451
3457
|
type: "er",
|
|
3452
|
-
parse:
|
|
3458
|
+
parse: se,
|
|
3453
3459
|
layoutForSvg(e, t) {
|
|
3454
|
-
return
|
|
3460
|
+
return ur(ee(e, t.direction), t);
|
|
3455
3461
|
},
|
|
3456
3462
|
renderSvg(e, t) {
|
|
3457
|
-
return
|
|
3463
|
+
return dr(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, t.emit);
|
|
3458
3464
|
}
|
|
3459
3465
|
},
|
|
3460
|
-
sequence:
|
|
3466
|
+
sequence: Ni,
|
|
3461
3467
|
class: {
|
|
3462
3468
|
type: "class",
|
|
3463
|
-
parse:
|
|
3464
|
-
layoutForSvg:
|
|
3469
|
+
parse: oe,
|
|
3470
|
+
layoutForSvg: Kn,
|
|
3465
3471
|
renderSvg(e, t, n) {
|
|
3466
|
-
return
|
|
3472
|
+
return Yn(e, t.colors, t.font, t.transparent, t.fontSizes, t.embedSource, t.title, t.decorative, Pi(n), t.emit);
|
|
3467
3473
|
}
|
|
3468
3474
|
},
|
|
3469
3475
|
flowchart: {
|
|
3470
3476
|
type: "flowchart",
|
|
3471
|
-
parse: (e, t) =>
|
|
3477
|
+
parse: (e, t) => ai(t),
|
|
3472
3478
|
layoutForSvg(e, t) {
|
|
3473
3479
|
return {
|
|
3474
|
-
graph:
|
|
3480
|
+
graph: Ot(ee(e, t.direction), t),
|
|
3475
3481
|
curve: t.curve ?? e.initConfig?.curve ?? "linear"
|
|
3476
3482
|
};
|
|
3477
3483
|
},
|
|
3478
3484
|
renderSvg(e, t, n) {
|
|
3479
|
-
return
|
|
3485
|
+
return At(e.graph, t.colors, t.font, t.transparent, t.fontSizes, e.curve, t.embedSource, Fi(n), Pi(n), t.title, t.decorative, t.emit);
|
|
3480
3486
|
}
|
|
3481
3487
|
}
|
|
3482
3488
|
};
|
|
3483
3489
|
//#endregion
|
|
3484
3490
|
//#region packages/svg-renderer/src/index.ts
|
|
3485
|
-
function
|
|
3491
|
+
function Li(t) {
|
|
3486
3492
|
return {
|
|
3487
|
-
bg:
|
|
3488
|
-
fg:
|
|
3489
|
-
line:
|
|
3490
|
-
accent:
|
|
3491
|
-
muted:
|
|
3492
|
-
surface:
|
|
3493
|
-
border:
|
|
3493
|
+
bg: t.bg ?? e.bg,
|
|
3494
|
+
fg: t.fg ?? e.fg,
|
|
3495
|
+
line: t.line,
|
|
3496
|
+
accent: t.accent,
|
|
3497
|
+
muted: t.muted,
|
|
3498
|
+
surface: t.surface,
|
|
3499
|
+
border: t.border
|
|
3494
3500
|
};
|
|
3495
3501
|
}
|
|
3496
|
-
function
|
|
3497
|
-
return D(
|
|
3502
|
+
function Ri(e = {}) {
|
|
3503
|
+
return D(Li(e), e.transparent);
|
|
3498
3504
|
}
|
|
3499
|
-
function
|
|
3505
|
+
function zi(e) {
|
|
3500
3506
|
return {
|
|
3501
3507
|
nonce: e.nonce,
|
|
3502
3508
|
styleAttribute: e.styleAttribute
|
|
3503
3509
|
};
|
|
3504
3510
|
}
|
|
3505
|
-
function
|
|
3506
|
-
let n =
|
|
3507
|
-
return t.resolveColors ?
|
|
3511
|
+
function Bi(e, t = {}) {
|
|
3512
|
+
let n = Vi(e, t);
|
|
3513
|
+
return t.resolveColors ? Vn(n, Li(t)) : n;
|
|
3508
3514
|
}
|
|
3509
|
-
function
|
|
3510
|
-
let n =
|
|
3515
|
+
function Vi(e, t) {
|
|
3516
|
+
let n = fe(e), i = Li(t), a = t.font ?? "Inter";
|
|
3511
3517
|
S(u(a));
|
|
3512
|
-
let o = t.transparent ?? !1, s = P(t.fontSizes), c =
|
|
3513
|
-
colors:
|
|
3518
|
+
let o = t.transparent ?? !1, s = P(t.fontSizes), c = r(n), l = t.embedSource ? e : void 0, d = t.title, f = t.decorative, p = zi(t), m = C(n), h = Ii[c], g = h.parse(m, n), _ = h.layoutForSvg(g, t), v = {
|
|
3519
|
+
colors: i,
|
|
3514
3520
|
font: a,
|
|
3515
3521
|
transparent: o,
|
|
3516
3522
|
fontSizes: s,
|
|
@@ -3521,11 +3527,11 @@ function Bi(e, t) {
|
|
|
3521
3527
|
};
|
|
3522
3528
|
return h.renderSvg(_, v, t);
|
|
3523
3529
|
}
|
|
3524
|
-
async function
|
|
3525
|
-
return
|
|
3530
|
+
async function Hi(e, t = {}) {
|
|
3531
|
+
return Bi(e, t);
|
|
3526
3532
|
}
|
|
3527
|
-
var
|
|
3533
|
+
var Ui = Bi, Wi = Hi;
|
|
3528
3534
|
//#endregion
|
|
3529
|
-
export { z as ARROW_HEAD, W as CLS,
|
|
3535
|
+
export { z as ARROW_HEAD, W as CLS, je as ELK_DIRECTION_FALLBACK, N as FONT_SIZES, F as FONT_WEIGHTS, ke as GROUP_HEADER_CONTENT_PAD, Fe as INLINE_CENTERED_EDGE_LABEL, De as MONO_FONT, Oe as MONO_FONT_STACK, I as NODE_PADDING, L as STROKE_WIDTHS, R as TEXT_BASELINE_SHIFT, Pe as baseElkLayoutOptions, br as boxLabelHeight, V as buildElkEdge, Ie as buildElkEdgeLabel, B as buildElkLeafNode, Hn as classNoteId, Ze as clipEdgeToShape, kt as convertToElkFormat, Se as createLayoutCache, Me as directionToElk, Te as elkLayoutSync, Ne as elkPadding, Ee as estimateMonoTextWidth, M as estimateTextWidth, Fn as evaluateCssColorValue, ct as extractEdgeLabelPosition, st as extractEdgePoints, Kn as layoutClassDiagramSync, ur as layoutErDiagramSync, Ot as layoutGraphSync, Sr as layoutSequenceDiagram, Fr as layoutXYChart, ve as pointsToPath, Yn as renderClassSvg, dr as renderErSvg, Wi as renderMermaid, Bi as renderMermaidSVG, Hi as renderMermaidSVGAsync, Ui as renderMermaidSync, Cr as renderSequenceSvg, At as renderSvg, Kr as renderXYChartSvg, Vn as resolveCssColors, P as resolveFontSizes, Ri as themeCssVariables, U as withDataSrc };
|
|
3530
3536
|
|
|
3531
3537
|
//# sourceMappingURL=index.js.map
|