@antdv-next/x 1.0.2-beta.3 → 1.0.2-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +1 -1
- package/dist/package.js +1 -1
- package/es/{_basePickBy-DZiMKfOQ.js → _basePickBy-DFHEGO2M.js} +2 -2
- package/es/{_baseUniq-DY3uHjSO.js → _baseUniq-BlS7rXTs.js} +2 -2
- package/es/antdv-next-x.esm.js +45472 -6767
- package/es/architecture-PBZL5I3N-D7tS55xM.js +3 -0
- package/es/{architectureDiagram-2XIMDMQ5-C8x7stcr.js → architectureDiagram-2XIMDMQ5-CmfsCwJk.js} +83 -83
- package/es/{blockDiagram-WCTKOSBZ-DA-s3zoq.js → blockDiagram-WCTKOSBZ-lJAan65A.js} +529 -529
- package/es/{c4Diagram-IC4MRINW-DD81dyS8.js → c4Diagram-IC4MRINW-B1c2x_1Q.js} +168 -168
- package/es/{channel-DZcPzDuw.js → channel-DFgF_2F7.js} +1 -1
- package/es/{chunk-4BX2VUAB-B3zzxglQ.js → chunk-4BX2VUAB-J2N81Fpp.js} +1 -1
- package/es/{chunk-55IACEB6-CA9CRLkM.js → chunk-55IACEB6-DGtfGRgi.js} +1 -1
- package/es/{chunk-7E7YKBS2-C_F-WOLQ.js → chunk-7E7YKBS2-CL2d4WAf.js} +1 -1
- package/es/{chunk-7R4GIKGN-CaI-1szl.js → chunk-7R4GIKGN-QT6IorJ_.js} +2 -2
- package/es/{chunk-C72U2L5F-l6RZhGri.js → chunk-C72U2L5F-OHTVpS-m.js} +1 -1
- package/es/{chunk-EGIJ26TM-Be42NeHw.js → chunk-EGIJ26TM-DyMPGYrB.js} +1 -1
- package/es/{chunk-FMBD7UC4-DJh0L322.js → chunk-FMBD7UC4-DCcRjunY.js} +1 -1
- package/es/{chunk-GEFDOKGD-BWt_f4io.js → chunk-GEFDOKGD-BWpC-zoH.js} +251 -251
- package/es/{chunk-GLR3WWYH-B30PgFZZ.js → chunk-GLR3WWYH-DiXcKb5Y.js} +16 -16
- package/es/{chunk-HHEYEP7N-DkMnkoQX.js → chunk-HHEYEP7N-Cxc7E4dX.js} +2 -2
- package/es/{chunk-JSJVCQXG-ddNKdfu8.js → chunk-JSJVCQXG-D8_heHOp.js} +2 -2
- package/es/{chunk-KX2RTZJC-BbnGQVgL.js → chunk-KX2RTZJC-D5cc4rj6.js} +2 -2
- package/es/{chunk-KYZI473N-B2rmiORt.js → chunk-KYZI473N-BHJ3T5Zv.js} +571 -571
- package/es/{chunk-L3YUKLVL-CmAZrf2E.js → chunk-L3YUKLVL-7oGaUOdc.js} +1 -1
- package/es/{chunk-MX3YWQON-B3_AxMM1.js → chunk-MX3YWQON-BxE-Aq9c.js} +1 -1
- package/es/{chunk-NQ4KR5QH-CmCG9ow3.js → chunk-NQ4KR5QH-EYQBXkqP.js} +119 -119
- package/es/{chunk-O4XLMI2P-CTLwv925.js → chunk-O4XLMI2P-qjOoGpnx.js} +237 -237
- package/es/{chunk-OZEHJAEY-CtONdvqY.js → chunk-OZEHJAEY-D82nx27s.js} +1 -1
- package/es/{chunk-PQ6SQG4A-Dx7no2mb.js → chunk-PQ6SQG4A-D3jtNCWN.js} +2 -2
- package/es/{chunk-PU5JKC2W-O9_8B7zU.js → chunk-PU5JKC2W-DdP8BS-S.js} +63 -63
- package/es/{chunk-QZHKN3VN-BbuqVxkO.js → chunk-QZHKN3VN-CW3cFN-h.js} +1 -1
- package/es/{chunk-R5LLSJPH-CpwKqyBY.js → chunk-R5LLSJPH-CreI2kO9.js} +1 -1
- package/es/{chunk-WL4C6EOR-BXrjoxmr.js → chunk-WL4C6EOR-BDbxJyGk.js} +119 -119
- package/es/{chunk-XIRO2GV7-4kMze38t.js → chunk-XIRO2GV7-S5KkbVnN.js} +1 -1
- package/es/{chunk-XPW4576I-DG6JendS.js → chunk-XPW4576I-B0KVSHwE.js} +1 -1
- package/es/{chunk-XZSTWKYB-DjOnj3KP.js → chunk-XZSTWKYB-CucN1XvM.js} +5 -5
- package/es/{chunk-YBOYWFTD-DVAsFYJ-.js → chunk-YBOYWFTD-CvaddD9G.js} +7 -7
- package/es/classDiagram-VBA2DB6C-Co3LMmg8.js +29 -0
- package/es/classDiagram-v2-RAHNMMFH-BZscgdF2.js +29 -0
- package/es/{clone-CtpnpaZq.js → clone-r3YukIBB.js} +1 -1
- package/es/{cose-bilkent-S5V4N54A-IRlkXPnk.js → cose-bilkent-S5V4N54A-B5OQuIhl.js} +1 -1
- package/es/{dagre-Dm2PNtRY.js → dagre-5aGJFKmT.js} +6 -6
- package/es/dagre-KLK3FWXG-BI5QQMXo.js +294 -0
- package/es/{diagram-E7M64L7V-Cdek_47s.js → diagram-E7M64L7V-Dz62Vz_a.js} +59 -59
- package/es/{diagram-IFDJBPK2-DzCaWPW3.js → diagram-IFDJBPK2-9fjvFkSc.js} +30 -30
- package/es/{diagram-P4PSJMXO-B7pPaer-.js → diagram-P4PSJMXO-BlX6jFjZ.js} +31 -31
- package/es/{erDiagram-INFDFZHY-BZHMCNB3.js → erDiagram-INFDFZHY-BcRXu8Cp.js} +127 -127
- package/es/{flowDiagram-PKNHOUZH-BBJx8-jP.js → flowDiagram-PKNHOUZH-UeyfgU8z.js} +155 -155
- package/es/{ganttDiagram-A5KZAMGK-4TJAHJUF.js → ganttDiagram-A5KZAMGK-txCzqgQ5.js} +602 -599
- package/es/gitGraph-HDMCJU4V-CxsS0Qr1.js +3 -0
- package/es/{gitGraphDiagram-K3NZZRJ6-CSATib_y.js → gitGraphDiagram-K3NZZRJ6-DghWYaFU.js} +175 -175
- package/es/{graphlib-WtNUGuyd.js → graphlib-dRkI1OCL.js} +3 -3
- package/es/info-3K5VOQVL-COqdvM99.js +3 -0
- package/es/{infoDiagram-LFFYTUFH-ahqynRAA.js → infoDiagram-LFFYTUFH-CA-vlAvP.js} +4 -4
- package/es/{isEmpty-BgdRybYg.js → isEmpty-CmA-HYrg.js} +1 -1
- package/es/{ishikawaDiagram-PHBUUO56-B9NWp429.js → ishikawaDiagram-PHBUUO56-DjdpS9Lb.js} +65 -65
- package/es/{journeyDiagram-4ABVD52K-CXmYa8OF.js → journeyDiagram-4ABVD52K-CIJfC1fp.js} +4 -4
- package/es/{kanban-definition-K7BYSVSG-g9tToeab.js → kanban-definition-K7BYSVSG-CC2vwGck.js} +10 -10
- package/es/{line-DETnb8Mr.js → line-Cu9NTacD.js} +1 -1
- package/es/{linear-DGQDIL28.js → linear-C0rAYYmp.js} +1 -1
- package/es/{mermaid-parser.core-DXn-0ev4.js → mermaid-parser.core-7Wn2L29P.js} +15 -15
- package/es/{mermaid.core-W4vXivv8.js → mermaid.core-Bvy_Q6Hu.js} +206 -206
- package/es/{mindmap-definition-YRQLILUH-x9QfilEP.js → mindmap-definition-YRQLILUH-BzTYDYmK.js} +12 -12
- package/es/packet-RMMSAZCW-2PTjWKLd.js +3 -0
- package/es/pie-UPGHQEXC-Du8-k-EA.js +3 -0
- package/es/{pieDiagram-SKSYHLDU-CG2GOW6Z.js → pieDiagram-SKSYHLDU-COvqE_C6.js} +24 -24
- package/es/{quadrantDiagram-337W2JSQ-C81pfz0c.js → quadrantDiagram-337W2JSQ-Dgv8ccjt.js} +3 -3
- package/es/radar-KQ55EAFF-jJOhyjxC.js +3 -0
- package/es/{requirementDiagram-Z7DCOOCP-J-tc0fnw.js → requirementDiagram-Z7DCOOCP-B2NyhxO-.js} +58 -58
- package/es/{sankeyDiagram-WA2Y5GQK-BfGyH2f1.js → sankeyDiagram-WA2Y5GQK-BfnH_gpl.js} +2 -2
- package/es/{sequenceDiagram-2WXFIKYE-m6aSnjku.js → sequenceDiagram-2WXFIKYE-DXssVQOF.js} +388 -388
- package/es/{stateDiagram-RAJIS63D-CPJuOh-s.js → stateDiagram-RAJIS63D-DvDLfupV.js} +67 -67
- package/es/stateDiagram-v2-FVOUBMTO-DIXyaX9W.js +27 -0
- package/es/{timeline-definition-YZTLITO2-C7Vz32PK.js → timeline-definition-YZTLITO2-ErcRjbZf.js} +2 -2
- package/es/treemap-KZPCXAKY-CvZAIYVa.js +3 -0
- package/es/{vennDiagram-LZ73GAT5-BWloH3fI.js → vennDiagram-LZ73GAT5-CDTZUtc8.js} +104 -104
- package/es/{xychartDiagram-JWTSCODW-l-SVBlqB.js → xychartDiagram-JWTSCODW-Y21jBOTg.js} +98 -98
- package/package.json +1 -1
- package/es/architecture-PBZL5I3N-BdQzc3t9.js +0 -3
- package/es/classDiagram-VBA2DB6C-wt_pcvEN.js +0 -29
- package/es/classDiagram-v2-RAHNMMFH-B8Bw4b3n.js +0 -29
- package/es/dagre-KLK3FWXG-DLgOeqbz.js +0 -294
- package/es/gitGraph-HDMCJU4V-CGPcRI5K.js +0 -3
- package/es/info-3K5VOQVL-D6bOjfim.js +0 -3
- package/es/packet-RMMSAZCW-CW6reTze.js +0 -3
- package/es/pie-UPGHQEXC-ByJXXnsc.js +0 -3
- package/es/radar-KQ55EAFF-DLq-eYVH.js +0 -3
- package/es/stateDiagram-v2-FVOUBMTO-uxSkj8dH.js +0 -27
- package/es/treemap-KZPCXAKY-BhLuAwPA.js +0 -3
- /package/es/{isArrayLikeObject-D4gDJaEW.js → isArrayLikeObject-jl2bjkAJ.js} +0 -0
- /package/es/{katex-Bvh2oRWI.js → katex-DCMiIo1z.js} +0 -0
- /package/es/{src-CFVe5TPD.js → src-CUQ6oOYk.js} +0 -0
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { L as o, R as s, b as c, h as l, j as u, k as d, w as f, y as p } from "./chunk-7R4GIKGN-
|
|
4
|
-
import { n as m, r as h } from "./chunk-PU5JKC2W-
|
|
5
|
-
import { n as g, t as _ } from "./chunk-YBOYWFTD-
|
|
6
|
-
import { a as v, i as y, r as b, t as x } from "./chunk-PQ6SQG4A-
|
|
1
|
+
import { g as e, h as t, p as n } from "./src-CUQ6oOYk.js";
|
|
2
|
+
import { i as r, l as i, n as a } from "./chunk-GEFDOKGD-BWpC-zoH.js";
|
|
3
|
+
import { L as o, R as s, b as c, h as l, j as u, k as d, w as f, y as p } from "./chunk-7R4GIKGN-QT6IorJ_.js";
|
|
4
|
+
import { n as m, r as h } from "./chunk-PU5JKC2W-DdP8BS-S.js";
|
|
5
|
+
import { n as g, t as _ } from "./chunk-YBOYWFTD-CvaddD9G.js";
|
|
6
|
+
import { a as v, i as y, r as b, t as x } from "./chunk-PQ6SQG4A-D3jtNCWN.js";
|
|
7
7
|
import { t as S } from "./rough.esm-BhGP2Udb.js";
|
|
8
8
|
//#region ../../node_modules/.pnpm/mermaid@11.13.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KYZI473N.mjs
|
|
9
|
-
var C = /* @__PURE__ */
|
|
10
|
-
let s, u =
|
|
11
|
-
s =
|
|
12
|
-
let d =
|
|
13
|
-
p =
|
|
14
|
-
let h = !!
|
|
9
|
+
var C = /* @__PURE__ */ t(async (e, t, a) => {
|
|
10
|
+
let s, u = t.useHtmlLabels || l(c()?.htmlLabels);
|
|
11
|
+
s = a || "node default";
|
|
12
|
+
let d = e.insert("g").attr("class", s).attr("id", t.domId || t.id), f = d.insert("g").attr("class", "label").attr("style", i(t.labelStyle)), p;
|
|
13
|
+
p = t.label === void 0 ? "" : typeof t.label == "string" ? t.label : t.label[0];
|
|
14
|
+
let h = !!t.icon || !!t.img, g = t.labelType === "markdown", v = await m(f, o(r(p), c()), {
|
|
15
15
|
useHtmlLabels: u,
|
|
16
|
-
width:
|
|
16
|
+
width: t.width || c().flowchart?.wrappingWidth,
|
|
17
17
|
cssClasses: g ? "markdown-node-label" : void 0,
|
|
18
|
-
style:
|
|
18
|
+
style: t.labelStyle,
|
|
19
19
|
addSvgBackground: h,
|
|
20
20
|
markdown: g
|
|
21
|
-
}, c()), y = v.getBBox(), b = (
|
|
21
|
+
}, c()), y = v.getBBox(), b = (t?.padding ?? 0) / 2;
|
|
22
22
|
if (u) {
|
|
23
|
-
let e = v.children[0], t =
|
|
23
|
+
let e = v.children[0], t = n(v);
|
|
24
24
|
await _(e, p), y = e.getBoundingClientRect(), t.attr("width", y.width), t.attr("height", y.height);
|
|
25
25
|
}
|
|
26
|
-
return u ? f.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : f.attr("transform", "translate(0, " + -y.height / 2 + ")"),
|
|
26
|
+
return u ? f.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : f.attr("transform", "translate(0, " + -y.height / 2 + ")"), t.centerLabel && f.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), f.insert("rect", ":first-child"), {
|
|
27
27
|
shapeSvg: d,
|
|
28
28
|
bbox: y,
|
|
29
29
|
halfPadding: b,
|
|
30
30
|
label: f
|
|
31
31
|
};
|
|
32
|
-
}, "labelHelper"), w = /* @__PURE__ */
|
|
33
|
-
let
|
|
34
|
-
useHtmlLabels:
|
|
35
|
-
width:
|
|
36
|
-
style:
|
|
37
|
-
addSvgBackground: !!
|
|
38
|
-
}), u = l.getBBox(), d =
|
|
32
|
+
}, "labelHelper"), w = /* @__PURE__ */ t(async (e, t, i) => {
|
|
33
|
+
let a = i.useHtmlLabels ?? f(c()), s = e.insert("g").attr("class", "label").attr("style", i.labelStyle || ""), l = await m(s, o(r(t), c()), {
|
|
34
|
+
useHtmlLabels: a,
|
|
35
|
+
width: i.width || c()?.flowchart?.wrappingWidth,
|
|
36
|
+
style: i.labelStyle,
|
|
37
|
+
addSvgBackground: !!i.icon || !!i.img
|
|
38
|
+
}), u = l.getBBox(), d = i.padding / 2;
|
|
39
39
|
if (f(c())) {
|
|
40
|
-
let e = l.children[0], t =
|
|
40
|
+
let e = l.children[0], t = n(l);
|
|
41
41
|
u = e.getBoundingClientRect(), t.attr("width", u.width), t.attr("height", u.height);
|
|
42
42
|
}
|
|
43
|
-
return
|
|
44
|
-
shapeSvg:
|
|
43
|
+
return a ? s.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")") : s.attr("transform", "translate(0, " + -u.height / 2 + ")"), i.centerLabel && s.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")"), s.insert("rect", ":first-child"), {
|
|
44
|
+
shapeSvg: e,
|
|
45
45
|
bbox: u,
|
|
46
46
|
halfPadding: d,
|
|
47
47
|
label: s
|
|
48
48
|
};
|
|
49
|
-
}, "insertLabel"), T = /* @__PURE__ */
|
|
49
|
+
}, "insertLabel"), T = /* @__PURE__ */ t((e, t) => {
|
|
50
50
|
let n = t.node().getBBox();
|
|
51
51
|
e.width = n.width, e.height = n.height;
|
|
52
|
-
}, "updateNodeBounds"), E = /* @__PURE__ */
|
|
52
|
+
}, "updateNodeBounds"), E = /* @__PURE__ */ t((e, t) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (t || ""), "getNodeClasses");
|
|
53
53
|
function D(e) {
|
|
54
54
|
let t = e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x},${e.y}`);
|
|
55
55
|
return t.push("Z"), t.join(" ");
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
t(D, "createPathFromPoints");
|
|
58
58
|
function O(e, t, n, r, i, a) {
|
|
59
59
|
let o = [], s = n - e, c = r - t, l = s / a, u = 2 * Math.PI / l, d = t + c / 2;
|
|
60
60
|
for (let t = 0; t <= 50; t++) {
|
|
@@ -66,7 +66,7 @@ function O(e, t, n, r, i, a) {
|
|
|
66
66
|
}
|
|
67
67
|
return o;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
t(O, "generateFullSineWavePoints");
|
|
70
70
|
function k(e, t, n, r, i, a) {
|
|
71
71
|
let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
|
|
72
72
|
for (let i = 0; i < r; i++) {
|
|
@@ -78,14 +78,14 @@ function k(e, t, n, r, i, a) {
|
|
|
78
78
|
}
|
|
79
79
|
return o;
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
var A = /* @__PURE__ */
|
|
81
|
+
t(k, "generateCirclePoints");
|
|
82
|
+
var A = /* @__PURE__ */ t((e, t) => {
|
|
83
83
|
var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
|
|
84
84
|
return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
|
|
85
85
|
x: n + c,
|
|
86
86
|
y: r + l
|
|
87
87
|
};
|
|
88
|
-
}, "intersectRect"), j = /* @__PURE__ */
|
|
88
|
+
}, "intersectRect"), j = /* @__PURE__ */ t(async (e, t, n, r = !1, i = !1) => {
|
|
89
89
|
let a = t || "";
|
|
90
90
|
typeof a == "object" && (a = a[0]);
|
|
91
91
|
let o = c(), s = f(o);
|
|
@@ -97,7 +97,7 @@ var A = /* @__PURE__ */ i((e, t) => {
|
|
|
97
97
|
isNode: i,
|
|
98
98
|
width: Infinity
|
|
99
99
|
}, o);
|
|
100
|
-
}, "createLabel"), M = /* @__PURE__ */
|
|
100
|
+
}, "createLabel"), M = /* @__PURE__ */ t((e, t, n, r, i) => [
|
|
101
101
|
"M",
|
|
102
102
|
e + i,
|
|
103
103
|
t,
|
|
@@ -142,43 +142,43 @@ var A = /* @__PURE__ */ i((e, t) => {
|
|
|
142
142
|
e + i,
|
|
143
143
|
t,
|
|
144
144
|
"Z"
|
|
145
|
-
].join(" "), "createRoundedRectPathD"), N = /* @__PURE__ */
|
|
146
|
-
|
|
147
|
-
let
|
|
148
|
-
C =
|
|
149
|
-
style:
|
|
145
|
+
].join(" "), "createRoundedRectPathD"), N = /* @__PURE__ */ t(async (t, r) => {
|
|
146
|
+
e.info("Creating subgraph rect for ", r.id, r);
|
|
147
|
+
let i = c(), { themeVariables: a, handDrawnSeed: o } = i, { clusterBkg: s, clusterBorder: l } = a, { labelStyles: u, nodeStyles: d, borderStyles: p, backgroundStyles: h } = y(r), _ = t.insert("g").attr("class", "cluster " + r.cssClasses).attr("id", r.id).attr("data-look", r.look), b = f(i), x = _.insert("g").attr("class", "cluster-label "), C;
|
|
148
|
+
C = r.labelType === "markdown" ? await m(x, r.label, {
|
|
149
|
+
style: r.labelStyle,
|
|
150
150
|
useHtmlLabels: b,
|
|
151
151
|
isNode: !0,
|
|
152
|
-
width:
|
|
153
|
-
}) : await j(x,
|
|
152
|
+
width: r.width
|
|
153
|
+
}) : await j(x, r.label, r.labelStyle || "", !1, !0);
|
|
154
154
|
let w = C.getBBox();
|
|
155
|
-
if (f(
|
|
156
|
-
let e = C.children[0], t =
|
|
155
|
+
if (f(i)) {
|
|
156
|
+
let e = C.children[0], t = n(C);
|
|
157
157
|
w = e.getBoundingClientRect(), t.attr("width", w.width), t.attr("height", w.height);
|
|
158
158
|
}
|
|
159
|
-
let T =
|
|
160
|
-
|
|
161
|
-
let E =
|
|
162
|
-
|
|
159
|
+
let T = r.width <= w.width + r.padding ? w.width + r.padding : r.width;
|
|
160
|
+
r.width <= w.width + r.padding ? r.diff = (T - r.width) / 2 - r.padding : r.diff = -r.padding;
|
|
161
|
+
let E = r.height, D = r.x - T / 2, O = r.y - E / 2;
|
|
162
|
+
e.trace("Data ", r, JSON.stringify(r));
|
|
163
163
|
let k;
|
|
164
|
-
if (
|
|
165
|
-
let
|
|
164
|
+
if (r.look === "handDrawn") {
|
|
165
|
+
let t = S.svg(_), n = v(r, {
|
|
166
166
|
roughness: .7,
|
|
167
167
|
fill: s,
|
|
168
168
|
stroke: l,
|
|
169
169
|
fillWeight: 3,
|
|
170
170
|
seed: o
|
|
171
|
-
}), i =
|
|
172
|
-
k = _.insert(() => (
|
|
173
|
-
} else k = _.insert("rect", ":first-child"), k.attr("style", d).attr("rx",
|
|
174
|
-
let { subGraphTitleTopMargin: N } = g(
|
|
175
|
-
if (x.attr("transform", `translate(${
|
|
171
|
+
}), i = t.path(M(D, O, T, E, 0), n);
|
|
172
|
+
k = _.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child"), k.select("path:nth-child(2)").attr("style", p.join(";")), k.select("path").attr("style", h.join(";").replace("fill", "stroke"));
|
|
173
|
+
} else k = _.insert("rect", ":first-child"), k.attr("style", d).attr("rx", r.rx).attr("ry", r.ry).attr("x", D).attr("y", O).attr("width", T).attr("height", E);
|
|
174
|
+
let { subGraphTitleTopMargin: N } = g(i);
|
|
175
|
+
if (x.attr("transform", `translate(${r.x - w.width / 2}, ${r.y - r.height / 2 + N})`), u) {
|
|
176
176
|
let e = x.select("span");
|
|
177
177
|
e && e.attr("style", u);
|
|
178
178
|
}
|
|
179
179
|
let P = k.node().getBBox();
|
|
180
|
-
return
|
|
181
|
-
return A(
|
|
180
|
+
return r.offsetX = 0, r.width = P.width, r.height = P.height, r.offsetY = w.height - r.padding / 2, r.intersect = function(e) {
|
|
181
|
+
return A(r, e);
|
|
182
182
|
}, {
|
|
183
183
|
cluster: _,
|
|
184
184
|
labelBBox: w
|
|
@@ -186,10 +186,10 @@ var A = /* @__PURE__ */ i((e, t) => {
|
|
|
186
186
|
}, "rect"), P = {
|
|
187
187
|
rect: N,
|
|
188
188
|
squareRect: N,
|
|
189
|
-
roundedWithTitle: /* @__PURE__ */
|
|
190
|
-
let
|
|
191
|
-
if (f(
|
|
192
|
-
let e = g.children[0], t =
|
|
189
|
+
roundedWithTitle: /* @__PURE__ */ t(async (e, t) => {
|
|
190
|
+
let r = c(), { themeVariables: i, handDrawnSeed: a } = r, { altBackground: o, compositeBackground: s, compositeTitleBackground: l, nodeBorder: u } = i, d = e.insert("g").attr("class", t.cssClasses).attr("id", t.id).attr("data-id", t.id).attr("data-look", t.look), p = d.insert("g", ":first-child"), m = d.insert("g").attr("class", "cluster-label"), h = d.append("rect"), g = await j(m, t.label, t.labelStyle, void 0, !0), _ = g.getBBox();
|
|
191
|
+
if (f(r)) {
|
|
192
|
+
let e = g.children[0], t = n(g);
|
|
193
193
|
_ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
|
|
194
194
|
}
|
|
195
195
|
let v = 0 * t.padding, y = v / 2, b = (t.width <= _.width + t.padding ? _.width + t.padding : t.width) + v;
|
|
@@ -203,25 +203,25 @@ var A = /* @__PURE__ */ i((e, t) => {
|
|
|
203
203
|
fill: l,
|
|
204
204
|
fillStyle: "solid",
|
|
205
205
|
stroke: u,
|
|
206
|
-
seed:
|
|
207
|
-
}) : n.rectangle(w, T, b, x, { seed:
|
|
206
|
+
seed: a
|
|
207
|
+
}) : n.rectangle(w, T, b, x, { seed: a });
|
|
208
208
|
D = d.insert(() => r, ":first-child");
|
|
209
|
-
let
|
|
209
|
+
let i = n.rectangle(w, E, b, C, {
|
|
210
210
|
fill: e ? o : s,
|
|
211
211
|
fillStyle: e ? "hachure" : "solid",
|
|
212
212
|
stroke: u,
|
|
213
|
-
seed:
|
|
213
|
+
seed: a
|
|
214
214
|
});
|
|
215
|
-
D = d.insert(() => r, ":first-child"), h = d.insert(() =>
|
|
215
|
+
D = d.insert(() => r, ":first-child"), h = d.insert(() => i);
|
|
216
216
|
} else D = p.insert("rect", ":first-child"), D.attr("class", "outer").attr("x", w).attr("y", T).attr("width", b).attr("height", x).attr("data-look", t.look), h.attr("class", "inner").attr("x", w).attr("y", E).attr("width", b).attr("height", C);
|
|
217
|
-
return m.attr("transform", `translate(${t.x - _.width / 2}, ${T + 1 - (f(
|
|
217
|
+
return m.attr("transform", `translate(${t.x - _.width / 2}, ${T + 1 - (f(r) ? 0 : 3)})`), t.height = D.node().getBBox().height, t.offsetX = 0, t.offsetY = _.height - t.padding / 2, t.labelBBox = _, t.intersect = function(e) {
|
|
218
218
|
return A(t, e);
|
|
219
219
|
}, {
|
|
220
220
|
cluster: d,
|
|
221
221
|
labelBBox: _
|
|
222
222
|
};
|
|
223
223
|
}, "roundedWithTitle"),
|
|
224
|
-
noteGroup: /* @__PURE__ */
|
|
224
|
+
noteGroup: /* @__PURE__ */ t((e, t) => {
|
|
225
225
|
let n = e.insert("g").attr("class", "note-cluster").attr("id", t.id), r = n.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
|
|
226
226
|
r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
|
|
227
227
|
let o = r.node().getBBox();
|
|
@@ -235,7 +235,7 @@ var A = /* @__PURE__ */ i((e, t) => {
|
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
237
|
}, "noteGroup"),
|
|
238
|
-
divider: /* @__PURE__ */
|
|
238
|
+
divider: /* @__PURE__ */ t((e, t) => {
|
|
239
239
|
let { themeVariables: n, handDrawnSeed: r } = c(), { nodeBorder: i } = n, a = e.insert("g").attr("class", t.cssClasses).attr("id", t.id).attr("data-look", t.look), o = a.insert("g", ":first-child"), s = 0 * t.padding, l = t.width + s;
|
|
240
240
|
t.diff = -t.padding;
|
|
241
241
|
let u = t.height + s, d = t.x - l / 2, f = t.y - u / 2;
|
|
@@ -258,56 +258,56 @@ var A = /* @__PURE__ */ i((e, t) => {
|
|
|
258
258
|
labelBBox: {}
|
|
259
259
|
};
|
|
260
260
|
}, "divider"),
|
|
261
|
-
kanbanSection: /* @__PURE__ */
|
|
262
|
-
|
|
263
|
-
let
|
|
264
|
-
style:
|
|
261
|
+
kanbanSection: /* @__PURE__ */ t(async (t, r) => {
|
|
262
|
+
e.info("Creating subgraph rect for ", r.id, r);
|
|
263
|
+
let i = c(), { themeVariables: a, handDrawnSeed: o } = i, { clusterBkg: s, clusterBorder: l } = a, { labelStyles: u, nodeStyles: d, borderStyles: p, backgroundStyles: h } = y(r), _ = t.insert("g").attr("class", "cluster " + r.cssClasses).attr("id", r.id).attr("data-look", r.look), b = f(i), x = _.insert("g").attr("class", "cluster-label "), C = await m(x, r.label, {
|
|
264
|
+
style: r.labelStyle,
|
|
265
265
|
useHtmlLabels: b,
|
|
266
266
|
isNode: !0,
|
|
267
|
-
width:
|
|
267
|
+
width: r.width
|
|
268
268
|
}), w = C.getBBox();
|
|
269
|
-
if (f(
|
|
270
|
-
let e = C.children[0], t =
|
|
269
|
+
if (f(i)) {
|
|
270
|
+
let e = C.children[0], t = n(C);
|
|
271
271
|
w = e.getBoundingClientRect(), t.attr("width", w.width), t.attr("height", w.height);
|
|
272
272
|
}
|
|
273
|
-
let T =
|
|
274
|
-
|
|
275
|
-
let E =
|
|
276
|
-
|
|
273
|
+
let T = r.width <= w.width + r.padding ? w.width + r.padding : r.width;
|
|
274
|
+
r.width <= w.width + r.padding ? r.diff = (T - r.width) / 2 - r.padding : r.diff = -r.padding;
|
|
275
|
+
let E = r.height, D = r.x - T / 2, O = r.y - E / 2;
|
|
276
|
+
e.trace("Data ", r, JSON.stringify(r));
|
|
277
277
|
let k;
|
|
278
|
-
if (
|
|
279
|
-
let
|
|
278
|
+
if (r.look === "handDrawn") {
|
|
279
|
+
let t = S.svg(_), n = v(r, {
|
|
280
280
|
roughness: .7,
|
|
281
281
|
fill: s,
|
|
282
282
|
stroke: l,
|
|
283
283
|
fillWeight: 4,
|
|
284
284
|
seed: o
|
|
285
|
-
}), i =
|
|
286
|
-
k = _.insert(() => (
|
|
287
|
-
} else k = _.insert("rect", ":first-child"), k.attr("style", d).attr("rx",
|
|
288
|
-
let { subGraphTitleTopMargin: j } = g(
|
|
289
|
-
if (x.attr("transform", `translate(${
|
|
285
|
+
}), i = t.path(M(D, O, T, E, r.rx), n);
|
|
286
|
+
k = _.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child"), k.select("path:nth-child(2)").attr("style", p.join(";")), k.select("path").attr("style", h.join(";").replace("fill", "stroke"));
|
|
287
|
+
} else k = _.insert("rect", ":first-child"), k.attr("style", d).attr("rx", r.rx).attr("ry", r.ry).attr("x", D).attr("y", O).attr("width", T).attr("height", E);
|
|
288
|
+
let { subGraphTitleTopMargin: j } = g(i);
|
|
289
|
+
if (x.attr("transform", `translate(${r.x - w.width / 2}, ${r.y - r.height / 2 + j})`), u) {
|
|
290
290
|
let e = x.select("span");
|
|
291
291
|
e && e.attr("style", u);
|
|
292
292
|
}
|
|
293
293
|
let N = k.node().getBBox();
|
|
294
|
-
return
|
|
295
|
-
return A(
|
|
294
|
+
return r.offsetX = 0, r.width = N.width, r.height = N.height, r.offsetY = w.height - r.padding / 2, r.intersect = function(e) {
|
|
295
|
+
return A(r, e);
|
|
296
296
|
}, {
|
|
297
297
|
cluster: _,
|
|
298
298
|
labelBBox: w
|
|
299
299
|
};
|
|
300
300
|
}, "kanbanSection")
|
|
301
|
-
}, F = /* @__PURE__ */ new Map(), I = /* @__PURE__ */
|
|
301
|
+
}, F = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ t(async (e, t) => {
|
|
302
302
|
let n = await P[t.shape || "rect"](e, t);
|
|
303
303
|
return F.set(t.id, n), n;
|
|
304
|
-
}, "insertCluster"), L = /* @__PURE__ */
|
|
304
|
+
}, "insertCluster"), L = /* @__PURE__ */ t(() => {
|
|
305
305
|
F = /* @__PURE__ */ new Map();
|
|
306
306
|
}, "clear");
|
|
307
307
|
function R(e, t) {
|
|
308
308
|
return e.intersect(t);
|
|
309
309
|
}
|
|
310
|
-
|
|
310
|
+
t(R, "intersectNode");
|
|
311
311
|
var z = R;
|
|
312
312
|
function B(e, t, n, r) {
|
|
313
313
|
var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
|
|
@@ -318,12 +318,12 @@ function B(e, t, n, r) {
|
|
|
318
318
|
y: a + u
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
|
|
321
|
+
t(B, "intersectEllipse");
|
|
322
322
|
var V = B;
|
|
323
323
|
function ee(e, t, n) {
|
|
324
324
|
return V(e, t, t, n);
|
|
325
325
|
}
|
|
326
|
-
|
|
326
|
+
t(ee, "intersectCircle");
|
|
327
327
|
var te = ee;
|
|
328
328
|
function ne(e, t, n, r) {
|
|
329
329
|
{
|
|
@@ -340,11 +340,11 @@ function ne(e, t, n, r) {
|
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
t(ne, "intersectLine");
|
|
344
344
|
function H(e, t) {
|
|
345
345
|
return e * t > 0;
|
|
346
346
|
}
|
|
347
|
-
|
|
347
|
+
t(H, "sameSign");
|
|
348
348
|
var U = ne;
|
|
349
349
|
function re(e, t, n) {
|
|
350
350
|
let r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
|
|
@@ -367,7 +367,7 @@ function re(e, t, n) {
|
|
|
367
367
|
return a < c ? -1 : a === c ? 0 : 1;
|
|
368
368
|
}), a[0]) : e;
|
|
369
369
|
}
|
|
370
|
-
|
|
370
|
+
t(re, "intersectPolygon");
|
|
371
371
|
var W = {
|
|
372
372
|
node: z,
|
|
373
373
|
circle: te,
|
|
@@ -375,23 +375,23 @@ var W = {
|
|
|
375
375
|
polygon: re,
|
|
376
376
|
rect: A
|
|
377
377
|
};
|
|
378
|
-
function ie(
|
|
379
|
-
let { labelStyles:
|
|
380
|
-
n.labelStyle =
|
|
378
|
+
function ie(t, n) {
|
|
379
|
+
let { labelStyles: r } = y(n);
|
|
380
|
+
n.labelStyle = r;
|
|
381
381
|
let a = E(n), o = a;
|
|
382
382
|
a || (o = "anchor");
|
|
383
|
-
let s =
|
|
383
|
+
let s = t.insert("g").attr("class", o).attr("id", n.domId || n.id), { cssStyles: c } = n, l = S.svg(s), u = v(n, {
|
|
384
384
|
fill: "black",
|
|
385
385
|
stroke: "none",
|
|
386
386
|
fillStyle: "solid"
|
|
387
387
|
});
|
|
388
388
|
n.look !== "handDrawn" && (u.roughness = 0);
|
|
389
389
|
let d = l.circle(0, 0, 2, u), f = s.insert(() => d, ":first-child");
|
|
390
|
-
return f.attr("class", "anchor").attr("style",
|
|
391
|
-
return
|
|
390
|
+
return f.attr("class", "anchor").attr("style", i(c)), T(n, f), n.intersect = function(t) {
|
|
391
|
+
return e.info("Circle intersect", n, 1, t), W.circle(n, 1, t);
|
|
392
392
|
}, s;
|
|
393
393
|
}
|
|
394
|
-
|
|
394
|
+
t(ie, "anchor");
|
|
395
395
|
function ae(e, t, n, r, i, a, o) {
|
|
396
396
|
let s = (e + n) / 2, c = (t + r) / 2, l = Math.atan2(r - t, n - e), u = (n - e) / 2, d = (r - t) / 2, f = u / i, p = d / a, m = Math.sqrt(f ** 2 + p ** 2);
|
|
397
397
|
if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
|
|
@@ -407,7 +407,7 @@ function ae(e, t, n, r, i, a, o) {
|
|
|
407
407
|
}
|
|
408
408
|
return b;
|
|
409
409
|
}
|
|
410
|
-
|
|
410
|
+
t(ae, "generateArcPoints");
|
|
411
411
|
async function oe(e, t) {
|
|
412
412
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
413
413
|
t.labelStyle = n;
|
|
@@ -433,13 +433,13 @@ async function oe(e, t) {
|
|
|
433
433
|
return W.polygon(t, d, e);
|
|
434
434
|
}, i;
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
t(oe, "bowTieRect");
|
|
437
437
|
function G(e, t, n, r) {
|
|
438
438
|
return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
|
|
439
439
|
return e.x + "," + e.y;
|
|
440
440
|
}).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
|
|
441
441
|
}
|
|
442
|
-
|
|
442
|
+
t(G, "insertPolygonShape");
|
|
443
443
|
async function se(e, t) {
|
|
444
444
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
445
445
|
t.labelStyle = n;
|
|
@@ -477,7 +477,7 @@ async function se(e, t) {
|
|
|
477
477
|
return W.polygon(t, u, e);
|
|
478
478
|
}, i;
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
t(se, "card");
|
|
481
481
|
function ce(e, t) {
|
|
482
482
|
let { nodeStyles: n } = y(t);
|
|
483
483
|
t.label = "";
|
|
@@ -505,23 +505,23 @@ function ce(e, t) {
|
|
|
505
505
|
return W.polygon(t, o, e);
|
|
506
506
|
}, r;
|
|
507
507
|
}
|
|
508
|
-
|
|
509
|
-
async function le(
|
|
508
|
+
t(ce, "choice");
|
|
509
|
+
async function le(t, n, r) {
|
|
510
510
|
let { labelStyles: a, nodeStyles: o } = y(n);
|
|
511
511
|
n.labelStyle = a;
|
|
512
|
-
let { shapeSvg: s, bbox: c, halfPadding: l } = await C(
|
|
512
|
+
let { shapeSvg: s, bbox: c, halfPadding: l } = await C(t, n, E(n)), u = r?.padding ?? l, d = c.width / 2 + u, f, { cssStyles: p } = n;
|
|
513
513
|
if (n.look === "handDrawn") {
|
|
514
|
-
let e = S.svg(s),
|
|
515
|
-
f = s.insert(() =>
|
|
514
|
+
let e = S.svg(s), t = v(n, {}), r = e.circle(0, 0, d * 2, t);
|
|
515
|
+
f = s.insert(() => r, ":first-child"), f.attr("class", "basic label-container").attr("style", i(p));
|
|
516
516
|
} else f = s.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", o).attr("r", d).attr("cx", 0).attr("cy", 0);
|
|
517
517
|
return T(n, f), n.calcIntersect = function(e, t) {
|
|
518
518
|
let n = e.width / 2;
|
|
519
519
|
return W.circle(e, n, t);
|
|
520
|
-
}, n.intersect = function(
|
|
521
|
-
return
|
|
520
|
+
}, n.intersect = function(t) {
|
|
521
|
+
return e.info("Circle intersect", n, d, t), W.circle(n, d, t);
|
|
522
522
|
}, s;
|
|
523
523
|
}
|
|
524
|
-
|
|
524
|
+
t(le, "circle");
|
|
525
525
|
function ue(e) {
|
|
526
526
|
let t = Math.cos(Math.PI / 4), n = Math.sin(Math.PI / 4), r = e * 2, i = {
|
|
527
527
|
x: r / 2 * t,
|
|
@@ -539,21 +539,21 @@ function ue(e) {
|
|
|
539
539
|
return `M ${a.x},${a.y} L ${s.x},${s.y}
|
|
540
540
|
M ${i.x},${i.y} L ${o.x},${o.y}`;
|
|
541
541
|
}
|
|
542
|
-
|
|
543
|
-
function de(
|
|
544
|
-
let { labelStyles:
|
|
545
|
-
|
|
546
|
-
let a =
|
|
547
|
-
|
|
542
|
+
t(ue, "createLine");
|
|
543
|
+
function de(t, n) {
|
|
544
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
545
|
+
n.labelStyle = r, n.label = "";
|
|
546
|
+
let a = t.insert("g").attr("class", E(n)).attr("id", n.domId ?? n.id), o = Math.max(30, n?.width ?? 0), { cssStyles: s } = n, c = S.svg(a), l = v(n, {});
|
|
547
|
+
n.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
|
|
548
548
|
let u = c.circle(0, 0, o * 2, l), d = ue(o), f = c.path(d, l), p = a.insert(() => u, ":first-child");
|
|
549
|
-
return p.insert(() => f), s &&
|
|
550
|
-
return
|
|
549
|
+
return p.insert(() => f), s && n.look !== "handDrawn" && p.selectAll("path").attr("style", s), i && n.look !== "handDrawn" && p.selectAll("path").attr("style", i), T(n, p), n.intersect = function(t) {
|
|
550
|
+
return e.info("crossedCircle intersect", n, {
|
|
551
551
|
radius: o,
|
|
552
|
-
point:
|
|
553
|
-
}), W.circle(
|
|
552
|
+
point: t
|
|
553
|
+
}), W.circle(n, o, t);
|
|
554
554
|
}, a;
|
|
555
555
|
}
|
|
556
|
-
|
|
556
|
+
t(de, "crossedCircle");
|
|
557
557
|
function K(e, t, n, r = 100, i = 0, a = 180) {
|
|
558
558
|
let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
|
|
559
559
|
for (let i = 0; i < r; i++) {
|
|
@@ -565,7 +565,7 @@ function K(e, t, n, r = 100, i = 0, a = 180) {
|
|
|
565
565
|
}
|
|
566
566
|
return o;
|
|
567
567
|
}
|
|
568
|
-
|
|
568
|
+
t(K, "generateCirclePoints");
|
|
569
569
|
async function fe(e, t) {
|
|
570
570
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
571
571
|
t.labelStyle = n;
|
|
@@ -618,7 +618,7 @@ async function fe(e, t) {
|
|
|
618
618
|
return W.polygon(t, f, e);
|
|
619
619
|
}, i;
|
|
620
620
|
}
|
|
621
|
-
|
|
621
|
+
t(fe, "curlyBraceLeft");
|
|
622
622
|
function q(e, t, n, r = 100, i = 0, a = 180) {
|
|
623
623
|
let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
|
|
624
624
|
for (let i = 0; i < r; i++) {
|
|
@@ -630,7 +630,7 @@ function q(e, t, n, r = 100, i = 0, a = 180) {
|
|
|
630
630
|
}
|
|
631
631
|
return o;
|
|
632
632
|
}
|
|
633
|
-
|
|
633
|
+
t(q, "generateCirclePoints");
|
|
634
634
|
async function pe(e, t) {
|
|
635
635
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
636
636
|
t.labelStyle = n;
|
|
@@ -683,7 +683,7 @@ async function pe(e, t) {
|
|
|
683
683
|
return W.polygon(t, f, e);
|
|
684
684
|
}, i;
|
|
685
685
|
}
|
|
686
|
-
|
|
686
|
+
t(pe, "curlyBraceRight");
|
|
687
687
|
function J(e, t, n, r = 100, i = 0, a = 180) {
|
|
688
688
|
let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
|
|
689
689
|
for (let i = 0; i < r; i++) {
|
|
@@ -695,7 +695,7 @@ function J(e, t, n, r = 100, i = 0, a = 180) {
|
|
|
695
695
|
}
|
|
696
696
|
return o;
|
|
697
697
|
}
|
|
698
|
-
|
|
698
|
+
t(J, "generateCirclePoints");
|
|
699
699
|
async function me(e, t) {
|
|
700
700
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
701
701
|
t.labelStyle = n;
|
|
@@ -773,7 +773,7 @@ async function me(e, t) {
|
|
|
773
773
|
return W.polygon(t, p, e);
|
|
774
774
|
}, i;
|
|
775
775
|
}
|
|
776
|
-
|
|
776
|
+
t(me, "curlyBraces");
|
|
777
777
|
async function he(e, t) {
|
|
778
778
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
779
779
|
t.labelStyle = n;
|
|
@@ -806,43 +806,43 @@ async function he(e, t) {
|
|
|
806
806
|
return W.polygon(t, g, e);
|
|
807
807
|
}, i;
|
|
808
808
|
}
|
|
809
|
-
|
|
810
|
-
var ge = /* @__PURE__ */
|
|
809
|
+
t(he, "curvedTrapezoid");
|
|
810
|
+
var ge = /* @__PURE__ */ t((e, t, n, r, i, a) => [
|
|
811
811
|
`M${e},${t + a}`,
|
|
812
812
|
`a${i},${a} 0,0,0 ${n},0`,
|
|
813
813
|
`a${i},${a} 0,0,0 ${-n},0`,
|
|
814
814
|
`l0,${r}`,
|
|
815
815
|
`a${i},${a} 0,0,0 ${n},0`,
|
|
816
816
|
`l0,${-r}`
|
|
817
|
-
].join(" "), "createCylinderPathD"), _e = /* @__PURE__ */
|
|
817
|
+
].join(" "), "createCylinderPathD"), _e = /* @__PURE__ */ t((e, t, n, r, i, a) => [
|
|
818
818
|
`M${e},${t + a}`,
|
|
819
819
|
`M${e + n},${t + a}`,
|
|
820
820
|
`a${i},${a} 0,0,0 ${-n},0`,
|
|
821
821
|
`l0,${r}`,
|
|
822
822
|
`a${i},${a} 0,0,0 ${n},0`,
|
|
823
823
|
`l0,${-r}`
|
|
824
|
-
].join(" "), "createOuterCylinderPathD"), ve = /* @__PURE__ */
|
|
825
|
-
async function ye(e,
|
|
826
|
-
let { labelStyles:
|
|
827
|
-
|
|
828
|
-
let { shapeSvg: a, bbox: o, label: s } = await C(e,
|
|
829
|
-
if (
|
|
830
|
-
let e = S.svg(a),
|
|
824
|
+
].join(" "), "createOuterCylinderPathD"), ve = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD");
|
|
825
|
+
async function ye(e, t) {
|
|
826
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
827
|
+
t.labelStyle = n;
|
|
828
|
+
let { shapeSvg: a, bbox: o, label: s } = await C(e, t, E(t)), c = Math.max(o.width + t.padding, t.width ?? 0), l = c / 2, u = l / (2.5 + c / 50), d = Math.max(o.height + u + t.padding, t.height ?? 0), f, { cssStyles: p } = t;
|
|
829
|
+
if (t.look === "handDrawn") {
|
|
830
|
+
let e = S.svg(a), n = _e(0, 0, c, d, l, u), r = ve(0, u, c, d, l, u), i = e.path(n, v(t, {})), o = e.path(r, v(t, { fill: "none" }));
|
|
831
831
|
f = a.insert(() => o, ":first-child"), f = a.insert(() => i, ":first-child"), f.attr("class", "basic label-container"), p && f.attr("style", p);
|
|
832
832
|
} else {
|
|
833
833
|
let e = ge(0, 0, c, d, l, u);
|
|
834
|
-
f = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style",
|
|
834
|
+
f = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", i(p)).attr("style", r);
|
|
835
835
|
}
|
|
836
|
-
return f.attr("label-offset-y", u), f.attr("transform", `translate(${-c / 2}, ${-(d / 2 + u)})`), T(
|
|
837
|
-
let
|
|
838
|
-
if (l != 0 && (Math.abs(r) < (
|
|
836
|
+
return f.attr("label-offset-y", u), f.attr("transform", `translate(${-c / 2}, ${-(d / 2 + u)})`), T(t, f), s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${-(o.height / 2) + (t.padding ?? 0) / 1.5 - (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
|
|
837
|
+
let n = W.rect(t, e), r = n.x - (t.x ?? 0);
|
|
838
|
+
if (l != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - u)) {
|
|
839
839
|
let i = u * u * (1 - r * r / (l * l));
|
|
840
|
-
i > 0 && (i = Math.sqrt(i)), i = u - i, e.y - (
|
|
840
|
+
i > 0 && (i = Math.sqrt(i)), i = u - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
|
|
841
841
|
}
|
|
842
|
-
return
|
|
842
|
+
return n;
|
|
843
843
|
}, a;
|
|
844
844
|
}
|
|
845
|
-
|
|
845
|
+
t(ye, "cylinder");
|
|
846
846
|
async function be(e, t) {
|
|
847
847
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
848
848
|
t.labelStyle = n;
|
|
@@ -882,48 +882,48 @@ async function be(e, t) {
|
|
|
882
882
|
return W.rect(t, e);
|
|
883
883
|
}, i;
|
|
884
884
|
}
|
|
885
|
-
|
|
886
|
-
async function xe(
|
|
887
|
-
let { labelStyles:
|
|
888
|
-
n.labelStyle =
|
|
889
|
-
let { shapeSvg: o, bbox: s, halfPadding: c } = await C(
|
|
885
|
+
t(be, "dividedRectangle");
|
|
886
|
+
async function xe(t, n) {
|
|
887
|
+
let { labelStyles: r, nodeStyles: a } = y(n);
|
|
888
|
+
n.labelStyle = r;
|
|
889
|
+
let { shapeSvg: o, bbox: s, halfPadding: c } = await C(t, n, E(n)), l = s.width / 2 + c + 5, u = s.width / 2 + c, d, { cssStyles: f } = n;
|
|
890
890
|
if (n.look === "handDrawn") {
|
|
891
|
-
let e = S.svg(o),
|
|
891
|
+
let e = S.svg(o), t = v(n, {
|
|
892
892
|
roughness: .2,
|
|
893
893
|
strokeWidth: 2.5
|
|
894
|
-
}),
|
|
894
|
+
}), r = v(n, {
|
|
895
895
|
roughness: .2,
|
|
896
896
|
strokeWidth: 1.5
|
|
897
|
-
}), a = e.circle(0, 0, l * 2,
|
|
898
|
-
d = o.insert("g", ":first-child"), d.attr("class",
|
|
897
|
+
}), a = e.circle(0, 0, l * 2, t), s = e.circle(0, 0, u * 2, r);
|
|
898
|
+
d = o.insert("g", ":first-child"), d.attr("class", i(n.cssClasses)).attr("style", i(f)), d.node()?.appendChild(a), d.node()?.appendChild(s);
|
|
899
899
|
} else {
|
|
900
900
|
d = o.insert("g", ":first-child");
|
|
901
901
|
let e = d.insert("circle", ":first-child"), t = d.insert("circle");
|
|
902
902
|
d.attr("class", "basic label-container").attr("style", a), e.attr("class", "outer-circle").attr("style", a).attr("r", l).attr("cx", 0).attr("cy", 0), t.attr("class", "inner-circle").attr("style", a).attr("r", u).attr("cx", 0).attr("cy", 0);
|
|
903
903
|
}
|
|
904
|
-
return T(n, d), n.intersect = function(
|
|
905
|
-
return
|
|
904
|
+
return T(n, d), n.intersect = function(t) {
|
|
905
|
+
return e.info("DoubleCircle intersect", n, l, t), W.circle(n, l, t);
|
|
906
906
|
}, o;
|
|
907
907
|
}
|
|
908
|
-
|
|
909
|
-
function Se(
|
|
910
|
-
let { labelStyles: i, nodeStyles: a } = y(
|
|
911
|
-
|
|
912
|
-
let o =
|
|
913
|
-
|
|
908
|
+
t(xe, "doublecircle");
|
|
909
|
+
function Se(t, n, { config: { themeVariables: r } }) {
|
|
910
|
+
let { labelStyles: i, nodeStyles: a } = y(n);
|
|
911
|
+
n.label = "", n.labelStyle = i;
|
|
912
|
+
let o = t.insert("g").attr("class", E(n)).attr("id", n.domId ?? n.id), { cssStyles: s } = n, c = S.svg(o), { nodeBorder: l } = r, u = v(n, { fillStyle: "solid" });
|
|
913
|
+
n.look !== "handDrawn" && (u.roughness = 0);
|
|
914
914
|
let d = c.circle(0, 0, 14, u), f = o.insert(() => d, ":first-child");
|
|
915
|
-
return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 &&
|
|
916
|
-
return
|
|
915
|
+
return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 && n.look !== "handDrawn" && f.selectAll("path").attr("style", s), a && n.look !== "handDrawn" && f.selectAll("path").attr("style", a), T(n, f), n.intersect = function(t) {
|
|
916
|
+
return e.info("filledCircle intersect", n, {
|
|
917
917
|
radius: 7,
|
|
918
|
-
point:
|
|
919
|
-
}), W.circle(
|
|
918
|
+
point: t
|
|
919
|
+
}), W.circle(n, 7, t);
|
|
920
920
|
}, o;
|
|
921
921
|
}
|
|
922
|
-
|
|
923
|
-
async function Ce(
|
|
924
|
-
let { labelStyles:
|
|
925
|
-
|
|
926
|
-
let { shapeSvg: a, bbox: o, label: s } = await C(
|
|
922
|
+
t(Se, "filledCircle");
|
|
923
|
+
async function Ce(t, n) {
|
|
924
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
925
|
+
n.labelStyle = r;
|
|
926
|
+
let { shapeSvg: a, bbox: o, label: s } = await C(t, n, E(n)), c = o.width + (n.padding ?? 0), l = c + o.height, u = c + o.height, d = [
|
|
927
927
|
{
|
|
928
928
|
x: 0,
|
|
929
929
|
y: -l
|
|
@@ -936,14 +936,14 @@ async function Ce(e, t) {
|
|
|
936
936
|
x: u / 2,
|
|
937
937
|
y: 0
|
|
938
938
|
}
|
|
939
|
-
], { cssStyles: f } =
|
|
940
|
-
|
|
939
|
+
], { cssStyles: f } = n, p = S.svg(a), m = v(n, {});
|
|
940
|
+
n.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
941
941
|
let h = D(d), g = p.path(h, m), _ = a.insert(() => g, ":first-child").attr("transform", `translate(${-l / 2}, ${l / 2})`);
|
|
942
|
-
return f &&
|
|
943
|
-
return
|
|
942
|
+
return f && n.look !== "handDrawn" && _.selectChildren("path").attr("style", f), i && n.look !== "handDrawn" && _.selectChildren("path").attr("style", i), n.width = c, n.height = l, T(n, _), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${-l / 2 + (n.padding ?? 0) / 2 + (o.y - (o.top ?? 0))})`), n.intersect = function(t) {
|
|
943
|
+
return e.info("Triangle intersect", n, d, t), W.polygon(n, d, t);
|
|
944
944
|
}, a;
|
|
945
945
|
}
|
|
946
|
-
|
|
946
|
+
t(Ce, "flippedTriangle");
|
|
947
947
|
function we(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
|
|
948
948
|
let { nodeStyles: a } = y(t);
|
|
949
949
|
t.label = "";
|
|
@@ -961,12 +961,12 @@ function we(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
|
|
|
961
961
|
return W.rect(t, e);
|
|
962
962
|
}, o;
|
|
963
963
|
}
|
|
964
|
-
|
|
965
|
-
async function Te(
|
|
966
|
-
let { labelStyles:
|
|
967
|
-
|
|
968
|
-
let { shapeSvg: a, bbox: o } = await C(
|
|
969
|
-
|
|
964
|
+
t(we, "forkJoin");
|
|
965
|
+
async function Te(t, n) {
|
|
966
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
967
|
+
n.labelStyle = r;
|
|
968
|
+
let { shapeSvg: a, bbox: o } = await C(t, n, E(n)), s = Math.max(80, o.width + (n.padding ?? 0) * 2, n?.width ?? 0), c = Math.max(50, o.height + (n.padding ?? 0) * 2, n?.height ?? 0), l = c / 2, { cssStyles: u } = n, d = S.svg(a), f = v(n, {});
|
|
969
|
+
n.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
|
|
970
970
|
let p = [
|
|
971
971
|
{
|
|
972
972
|
x: -s / 2,
|
|
@@ -986,15 +986,15 @@ async function Te(e, t) {
|
|
|
986
986
|
y: c / 2
|
|
987
987
|
}
|
|
988
988
|
], m = D(p), h = d.path(m, f), g = a.insert(() => h, ":first-child");
|
|
989
|
-
return g.attr("class", "basic label-container"), u &&
|
|
990
|
-
return
|
|
989
|
+
return g.attr("class", "basic label-container"), u && n.look !== "handDrawn" && g.selectChildren("path").attr("style", u), i && n.look !== "handDrawn" && g.selectChildren("path").attr("style", i), T(n, g), n.intersect = function(t) {
|
|
990
|
+
return e.info("Pill intersect", n, {
|
|
991
991
|
radius: l,
|
|
992
|
-
point:
|
|
993
|
-
}), W.polygon(
|
|
992
|
+
point: t
|
|
993
|
+
}), W.polygon(n, p, t);
|
|
994
994
|
}, a;
|
|
995
995
|
}
|
|
996
|
-
|
|
997
|
-
var Ee = /* @__PURE__ */
|
|
996
|
+
t(Te, "halfRoundedRectangle");
|
|
997
|
+
var Ee = /* @__PURE__ */ t((e, t, n, r, i) => [
|
|
998
998
|
`M${e + i},${t}`,
|
|
999
999
|
`L${e + n - i},${t}`,
|
|
1000
1000
|
`L${e + n},${t - r / 2}`,
|
|
@@ -1040,12 +1040,12 @@ async function De(e, t) {
|
|
|
1040
1040
|
return W.polygon(t, l, e);
|
|
1041
1041
|
}, i;
|
|
1042
1042
|
}
|
|
1043
|
-
|
|
1044
|
-
async function Oe(
|
|
1045
|
-
let { labelStyles:
|
|
1046
|
-
|
|
1047
|
-
let { shapeSvg: a } = await C(
|
|
1048
|
-
|
|
1043
|
+
t(De, "hexagon");
|
|
1044
|
+
async function Oe(t, n) {
|
|
1045
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
1046
|
+
n.label = "", n.labelStyle = r;
|
|
1047
|
+
let { shapeSvg: a } = await C(t, n, E(n)), o = Math.max(30, n?.width ?? 0), s = Math.max(30, n?.height ?? 0), { cssStyles: c } = n, l = S.svg(a), u = v(n, {});
|
|
1048
|
+
n.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
|
|
1049
1049
|
let d = [
|
|
1050
1050
|
{
|
|
1051
1051
|
x: 0,
|
|
@@ -1064,118 +1064,118 @@ async function Oe(e, t) {
|
|
|
1064
1064
|
y: s
|
|
1065
1065
|
}
|
|
1066
1066
|
], f = D(d), p = l.path(f, u), m = a.insert(() => p, ":first-child");
|
|
1067
|
-
return m.attr("class", "basic label-container"), c &&
|
|
1068
|
-
return
|
|
1067
|
+
return m.attr("class", "basic label-container"), c && n.look !== "handDrawn" && m.selectChildren("path").attr("style", c), i && n.look !== "handDrawn" && m.selectChildren("path").attr("style", i), m.attr("transform", `translate(${-o / 2}, ${-s / 2})`), T(n, m), n.intersect = function(t) {
|
|
1068
|
+
return e.info("Pill intersect", n, { points: d }), W.polygon(n, d, t);
|
|
1069
1069
|
}, a;
|
|
1070
1070
|
}
|
|
1071
|
-
|
|
1072
|
-
async function ke(
|
|
1073
|
-
let { labelStyles: a } = y(
|
|
1074
|
-
|
|
1075
|
-
let o =
|
|
1076
|
-
|
|
1077
|
-
let { shapeSvg: u, bbox: d, label: f } = await C(
|
|
1071
|
+
t(Oe, "hourglass");
|
|
1072
|
+
async function ke(t, n, { config: { themeVariables: r, flowchart: i } }) {
|
|
1073
|
+
let { labelStyles: a } = y(n);
|
|
1074
|
+
n.labelStyle = a;
|
|
1075
|
+
let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
|
|
1076
|
+
n.width = Math.max(c, l ?? 0);
|
|
1077
|
+
let { shapeSvg: u, bbox: d, label: f } = await C(t, n, "icon-shape default"), p = n.pos === "t", m = c, g = c, { nodeBorder: _ } = r, { stylesMap: b } = x(n), w = -g / 2, E = -m / 2, D = n.label ? 8 : 0, O = S.svg(u), k = v(n, {
|
|
1078
1078
|
stroke: "none",
|
|
1079
1079
|
fill: "none"
|
|
1080
1080
|
});
|
|
1081
|
-
|
|
1081
|
+
n.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid");
|
|
1082
1082
|
let A = O.rectangle(w, E, g, m, k), j = Math.max(g, d.width), M = m + d.height + D, N = O.rectangle(-j / 2, -M / 2, j, M, {
|
|
1083
1083
|
...k,
|
|
1084
1084
|
fill: "transparent",
|
|
1085
1085
|
stroke: "none"
|
|
1086
1086
|
}), P = u.insert(() => A, ":first-child"), F = u.insert(() => N);
|
|
1087
|
-
if (
|
|
1087
|
+
if (n.icon) {
|
|
1088
1088
|
let e = u.append("g");
|
|
1089
|
-
e.html(`<g>${await h(
|
|
1089
|
+
e.html(`<g>${await h(n.icon, {
|
|
1090
1090
|
height: c,
|
|
1091
1091
|
width: c,
|
|
1092
1092
|
fallbackPrefix: ""
|
|
1093
1093
|
})}</g>`);
|
|
1094
|
-
let
|
|
1094
|
+
let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
|
|
1095
1095
|
e.attr("transform", `translate(${-r / 2 - a},${p ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${b.get("stroke") ?? _};`);
|
|
1096
1096
|
}
|
|
1097
|
-
return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -M / 2 : M / 2 - d.height})`), P.attr("transform", `translate(0,${p ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), T(
|
|
1098
|
-
if (
|
|
1099
|
-
let
|
|
1097
|
+
return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -M / 2 : M / 2 - d.height})`), P.attr("transform", `translate(0,${p ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), T(n, F), n.intersect = function(t) {
|
|
1098
|
+
if (e.info("iconSquare intersect", n, t), !n.label) return W.rect(n, t);
|
|
1099
|
+
let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
|
|
1100
1100
|
return o = p ? [
|
|
1101
1101
|
{
|
|
1102
|
-
x:
|
|
1102
|
+
x: r - d.width / 2,
|
|
1103
1103
|
y: i - a / 2
|
|
1104
1104
|
},
|
|
1105
1105
|
{
|
|
1106
|
-
x:
|
|
1106
|
+
x: r + d.width / 2,
|
|
1107
1107
|
y: i - a / 2
|
|
1108
1108
|
},
|
|
1109
1109
|
{
|
|
1110
|
-
x:
|
|
1110
|
+
x: r + d.width / 2,
|
|
1111
1111
|
y: i - a / 2 + d.height + D
|
|
1112
1112
|
},
|
|
1113
1113
|
{
|
|
1114
|
-
x:
|
|
1114
|
+
x: r + g / 2,
|
|
1115
1115
|
y: i - a / 2 + d.height + D
|
|
1116
1116
|
},
|
|
1117
1117
|
{
|
|
1118
|
-
x:
|
|
1118
|
+
x: r + g / 2,
|
|
1119
1119
|
y: i + a / 2
|
|
1120
1120
|
},
|
|
1121
1121
|
{
|
|
1122
|
-
x:
|
|
1122
|
+
x: r - g / 2,
|
|
1123
1123
|
y: i + a / 2
|
|
1124
1124
|
},
|
|
1125
1125
|
{
|
|
1126
|
-
x:
|
|
1126
|
+
x: r - g / 2,
|
|
1127
1127
|
y: i - a / 2 + d.height + D
|
|
1128
1128
|
},
|
|
1129
1129
|
{
|
|
1130
|
-
x:
|
|
1130
|
+
x: r - d.width / 2,
|
|
1131
1131
|
y: i - a / 2 + d.height + D
|
|
1132
1132
|
}
|
|
1133
1133
|
] : [
|
|
1134
1134
|
{
|
|
1135
|
-
x:
|
|
1135
|
+
x: r - g / 2,
|
|
1136
1136
|
y: i - a / 2
|
|
1137
1137
|
},
|
|
1138
1138
|
{
|
|
1139
|
-
x:
|
|
1139
|
+
x: r + g / 2,
|
|
1140
1140
|
y: i - a / 2
|
|
1141
1141
|
},
|
|
1142
1142
|
{
|
|
1143
|
-
x:
|
|
1143
|
+
x: r + g / 2,
|
|
1144
1144
|
y: i - a / 2 + m
|
|
1145
1145
|
},
|
|
1146
1146
|
{
|
|
1147
|
-
x:
|
|
1147
|
+
x: r + d.width / 2,
|
|
1148
1148
|
y: i - a / 2 + m
|
|
1149
1149
|
},
|
|
1150
1150
|
{
|
|
1151
|
-
x:
|
|
1151
|
+
x: r + d.width / 2 / 2,
|
|
1152
1152
|
y: i + a / 2
|
|
1153
1153
|
},
|
|
1154
1154
|
{
|
|
1155
|
-
x:
|
|
1155
|
+
x: r - d.width / 2,
|
|
1156
1156
|
y: i + a / 2
|
|
1157
1157
|
},
|
|
1158
1158
|
{
|
|
1159
|
-
x:
|
|
1159
|
+
x: r - d.width / 2,
|
|
1160
1160
|
y: i - a / 2 + m
|
|
1161
1161
|
},
|
|
1162
1162
|
{
|
|
1163
|
-
x:
|
|
1163
|
+
x: r - g / 2,
|
|
1164
1164
|
y: i - a / 2 + m
|
|
1165
1165
|
}
|
|
1166
|
-
], W.polygon(
|
|
1166
|
+
], W.polygon(n, o, t);
|
|
1167
1167
|
}, u;
|
|
1168
1168
|
}
|
|
1169
|
-
|
|
1170
|
-
async function Ae(
|
|
1171
|
-
let { labelStyles: a } = y(
|
|
1172
|
-
|
|
1173
|
-
let o =
|
|
1174
|
-
|
|
1175
|
-
let { shapeSvg: u, bbox: d, label: f } = await C(
|
|
1176
|
-
|
|
1169
|
+
t(ke, "icon");
|
|
1170
|
+
async function Ae(t, n, { config: { themeVariables: r, flowchart: i } }) {
|
|
1171
|
+
let { labelStyles: a } = y(n);
|
|
1172
|
+
n.labelStyle = a;
|
|
1173
|
+
let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
|
|
1174
|
+
n.width = Math.max(c, l ?? 0);
|
|
1175
|
+
let { shapeSvg: u, bbox: d, label: f } = await C(t, n, "icon-shape default"), p = n.label ? 8 : 0, m = n.pos === "t", { nodeBorder: g, mainBkg: _ } = r, { stylesMap: b } = x(n), w = S.svg(u), E = v(n, {});
|
|
1176
|
+
n.look !== "handDrawn" && (E.roughness = 0, E.fillStyle = "solid"), E.stroke = b.get("fill") ?? _;
|
|
1177
1177
|
let D = u.append("g");
|
|
1178
|
-
|
|
1178
|
+
n.icon && D.html(`<g>${await h(n.icon, {
|
|
1179
1179
|
height: c,
|
|
1180
1180
|
width: c,
|
|
1181
1181
|
fallbackPrefix: ""
|
|
@@ -1185,296 +1185,296 @@ async function Ae(e, t, { config: { themeVariables: n, flowchart: i } }) {
|
|
|
1185
1185
|
fill: "transparent",
|
|
1186
1186
|
stroke: "none"
|
|
1187
1187
|
}), R = u.insert(() => P, ":first-child"), z = u.insert(() => L);
|
|
1188
|
-
return D.attr("transform", `translate(${-k / 2 - j},${m ? d.height / 2 + p / 2 - A / 2 - M : -d.height / 2 - p / 2 - A / 2 - M})`), D.attr("style", `color: ${b.get("stroke") ?? g};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -I / 2 : I / 2 - d.height})`), R.attr("transform", `translate(0,${m ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), T(
|
|
1189
|
-
return
|
|
1188
|
+
return D.attr("transform", `translate(${-k / 2 - j},${m ? d.height / 2 + p / 2 - A / 2 - M : -d.height / 2 - p / 2 - A / 2 - M})`), D.attr("style", `color: ${b.get("stroke") ?? g};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -I / 2 : I / 2 - d.height})`), R.attr("transform", `translate(0,${m ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), T(n, z), n.intersect = function(t) {
|
|
1189
|
+
return e.info("iconSquare intersect", n, t), W.rect(n, t);
|
|
1190
1190
|
}, u;
|
|
1191
1191
|
}
|
|
1192
|
-
|
|
1193
|
-
async function je(
|
|
1194
|
-
let { labelStyles: a } = y(
|
|
1195
|
-
|
|
1196
|
-
let o =
|
|
1197
|
-
|
|
1198
|
-
let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(
|
|
1199
|
-
|
|
1192
|
+
t(Ae, "iconCircle");
|
|
1193
|
+
async function je(t, n, { config: { themeVariables: r, flowchart: i } }) {
|
|
1194
|
+
let { labelStyles: a } = y(n);
|
|
1195
|
+
n.labelStyle = a;
|
|
1196
|
+
let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
|
|
1197
|
+
n.width = Math.max(c, l ?? 0);
|
|
1198
|
+
let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(t, n, "icon-shape default"), m = n.pos === "t", g = c + f * 2, _ = c + f * 2, { nodeBorder: b, mainBkg: w } = r, { stylesMap: E } = x(n), D = -_ / 2, O = -g / 2, k = n.label ? 8 : 0, A = S.svg(u), j = v(n, {});
|
|
1199
|
+
n.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid"), j.stroke = E.get("fill") ?? w;
|
|
1200
1200
|
let N = A.path(M(D, O, _, g, 5), j), P = Math.max(_, d.width), F = g + d.height + k, I = A.rectangle(-P / 2, -F / 2, P, F, {
|
|
1201
1201
|
...j,
|
|
1202
1202
|
fill: "transparent",
|
|
1203
1203
|
stroke: "none"
|
|
1204
1204
|
}), L = u.insert(() => N, ":first-child").attr("class", "icon-shape2"), R = u.insert(() => I);
|
|
1205
|
-
if (
|
|
1205
|
+
if (n.icon) {
|
|
1206
1206
|
let e = u.append("g");
|
|
1207
|
-
e.html(`<g>${await h(
|
|
1207
|
+
e.html(`<g>${await h(n.icon, {
|
|
1208
1208
|
height: c,
|
|
1209
1209
|
width: c,
|
|
1210
1210
|
fallbackPrefix: ""
|
|
1211
1211
|
})}</g>`);
|
|
1212
|
-
let
|
|
1212
|
+
let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
|
|
1213
1213
|
e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + k / 2 - i / 2 - o : -d.height / 2 - k / 2 - i / 2 - o})`), e.attr("style", `color: ${E.get("stroke") ?? b};`);
|
|
1214
1214
|
}
|
|
1215
|
-
return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), L.attr("transform", `translate(0,${m ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(
|
|
1216
|
-
if (
|
|
1217
|
-
let
|
|
1215
|
+
return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), L.attr("transform", `translate(0,${m ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(n, R), n.intersect = function(t) {
|
|
1216
|
+
if (e.info("iconSquare intersect", n, t), !n.label) return W.rect(n, t);
|
|
1217
|
+
let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
|
|
1218
1218
|
return o = m ? [
|
|
1219
1219
|
{
|
|
1220
|
-
x:
|
|
1220
|
+
x: r - d.width / 2,
|
|
1221
1221
|
y: i - a / 2
|
|
1222
1222
|
},
|
|
1223
1223
|
{
|
|
1224
|
-
x:
|
|
1224
|
+
x: r + d.width / 2,
|
|
1225
1225
|
y: i - a / 2
|
|
1226
1226
|
},
|
|
1227
1227
|
{
|
|
1228
|
-
x:
|
|
1228
|
+
x: r + d.width / 2,
|
|
1229
1229
|
y: i - a / 2 + d.height + k
|
|
1230
1230
|
},
|
|
1231
1231
|
{
|
|
1232
|
-
x:
|
|
1232
|
+
x: r + _ / 2,
|
|
1233
1233
|
y: i - a / 2 + d.height + k
|
|
1234
1234
|
},
|
|
1235
1235
|
{
|
|
1236
|
-
x:
|
|
1236
|
+
x: r + _ / 2,
|
|
1237
1237
|
y: i + a / 2
|
|
1238
1238
|
},
|
|
1239
1239
|
{
|
|
1240
|
-
x:
|
|
1240
|
+
x: r - _ / 2,
|
|
1241
1241
|
y: i + a / 2
|
|
1242
1242
|
},
|
|
1243
1243
|
{
|
|
1244
|
-
x:
|
|
1244
|
+
x: r - _ / 2,
|
|
1245
1245
|
y: i - a / 2 + d.height + k
|
|
1246
1246
|
},
|
|
1247
1247
|
{
|
|
1248
|
-
x:
|
|
1248
|
+
x: r - d.width / 2,
|
|
1249
1249
|
y: i - a / 2 + d.height + k
|
|
1250
1250
|
}
|
|
1251
1251
|
] : [
|
|
1252
1252
|
{
|
|
1253
|
-
x:
|
|
1253
|
+
x: r - _ / 2,
|
|
1254
1254
|
y: i - a / 2
|
|
1255
1255
|
},
|
|
1256
1256
|
{
|
|
1257
|
-
x:
|
|
1257
|
+
x: r + _ / 2,
|
|
1258
1258
|
y: i - a / 2
|
|
1259
1259
|
},
|
|
1260
1260
|
{
|
|
1261
|
-
x:
|
|
1261
|
+
x: r + _ / 2,
|
|
1262
1262
|
y: i - a / 2 + g
|
|
1263
1263
|
},
|
|
1264
1264
|
{
|
|
1265
|
-
x:
|
|
1265
|
+
x: r + d.width / 2,
|
|
1266
1266
|
y: i - a / 2 + g
|
|
1267
1267
|
},
|
|
1268
1268
|
{
|
|
1269
|
-
x:
|
|
1269
|
+
x: r + d.width / 2 / 2,
|
|
1270
1270
|
y: i + a / 2
|
|
1271
1271
|
},
|
|
1272
1272
|
{
|
|
1273
|
-
x:
|
|
1273
|
+
x: r - d.width / 2,
|
|
1274
1274
|
y: i + a / 2
|
|
1275
1275
|
},
|
|
1276
1276
|
{
|
|
1277
|
-
x:
|
|
1277
|
+
x: r - d.width / 2,
|
|
1278
1278
|
y: i - a / 2 + g
|
|
1279
1279
|
},
|
|
1280
1280
|
{
|
|
1281
|
-
x:
|
|
1281
|
+
x: r - _ / 2,
|
|
1282
1282
|
y: i - a / 2 + g
|
|
1283
1283
|
}
|
|
1284
|
-
], W.polygon(
|
|
1284
|
+
], W.polygon(n, o, t);
|
|
1285
1285
|
}, u;
|
|
1286
1286
|
}
|
|
1287
|
-
|
|
1288
|
-
async function Me(
|
|
1289
|
-
let { labelStyles: a } = y(
|
|
1290
|
-
|
|
1291
|
-
let o =
|
|
1292
|
-
|
|
1293
|
-
let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(
|
|
1294
|
-
|
|
1287
|
+
t(je, "iconRounded");
|
|
1288
|
+
async function Me(t, n, { config: { themeVariables: r, flowchart: i } }) {
|
|
1289
|
+
let { labelStyles: a } = y(n);
|
|
1290
|
+
n.labelStyle = a;
|
|
1291
|
+
let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
|
|
1292
|
+
n.width = Math.max(c, l ?? 0);
|
|
1293
|
+
let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(t, n, "icon-shape default"), m = n.pos === "t", g = c + f * 2, _ = c + f * 2, { nodeBorder: b, mainBkg: w } = r, { stylesMap: E } = x(n), D = -_ / 2, O = -g / 2, k = n.label ? 8 : 0, A = S.svg(u), j = v(n, {});
|
|
1294
|
+
n.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid"), j.stroke = E.get("fill") ?? w;
|
|
1295
1295
|
let N = A.path(M(D, O, _, g, .1), j), P = Math.max(_, d.width), F = g + d.height + k, I = A.rectangle(-P / 2, -F / 2, P, F, {
|
|
1296
1296
|
...j,
|
|
1297
1297
|
fill: "transparent",
|
|
1298
1298
|
stroke: "none"
|
|
1299
1299
|
}), L = u.insert(() => N, ":first-child"), R = u.insert(() => I);
|
|
1300
|
-
if (
|
|
1300
|
+
if (n.icon) {
|
|
1301
1301
|
let e = u.append("g");
|
|
1302
|
-
e.html(`<g>${await h(
|
|
1302
|
+
e.html(`<g>${await h(n.icon, {
|
|
1303
1303
|
height: c,
|
|
1304
1304
|
width: c,
|
|
1305
1305
|
fallbackPrefix: ""
|
|
1306
1306
|
})}</g>`);
|
|
1307
|
-
let
|
|
1307
|
+
let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
|
|
1308
1308
|
e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + k / 2 - i / 2 - o : -d.height / 2 - k / 2 - i / 2 - o})`), e.attr("style", `color: ${E.get("stroke") ?? b};`);
|
|
1309
1309
|
}
|
|
1310
|
-
return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), L.attr("transform", `translate(0,${m ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(
|
|
1311
|
-
if (
|
|
1312
|
-
let
|
|
1310
|
+
return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), L.attr("transform", `translate(0,${m ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(n, R), n.intersect = function(t) {
|
|
1311
|
+
if (e.info("iconSquare intersect", n, t), !n.label) return W.rect(n, t);
|
|
1312
|
+
let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
|
|
1313
1313
|
return o = m ? [
|
|
1314
1314
|
{
|
|
1315
|
-
x:
|
|
1315
|
+
x: r - d.width / 2,
|
|
1316
1316
|
y: i - a / 2
|
|
1317
1317
|
},
|
|
1318
1318
|
{
|
|
1319
|
-
x:
|
|
1319
|
+
x: r + d.width / 2,
|
|
1320
1320
|
y: i - a / 2
|
|
1321
1321
|
},
|
|
1322
1322
|
{
|
|
1323
|
-
x:
|
|
1323
|
+
x: r + d.width / 2,
|
|
1324
1324
|
y: i - a / 2 + d.height + k
|
|
1325
1325
|
},
|
|
1326
1326
|
{
|
|
1327
|
-
x:
|
|
1327
|
+
x: r + _ / 2,
|
|
1328
1328
|
y: i - a / 2 + d.height + k
|
|
1329
1329
|
},
|
|
1330
1330
|
{
|
|
1331
|
-
x:
|
|
1331
|
+
x: r + _ / 2,
|
|
1332
1332
|
y: i + a / 2
|
|
1333
1333
|
},
|
|
1334
1334
|
{
|
|
1335
|
-
x:
|
|
1335
|
+
x: r - _ / 2,
|
|
1336
1336
|
y: i + a / 2
|
|
1337
1337
|
},
|
|
1338
1338
|
{
|
|
1339
|
-
x:
|
|
1339
|
+
x: r - _ / 2,
|
|
1340
1340
|
y: i - a / 2 + d.height + k
|
|
1341
1341
|
},
|
|
1342
1342
|
{
|
|
1343
|
-
x:
|
|
1343
|
+
x: r - d.width / 2,
|
|
1344
1344
|
y: i - a / 2 + d.height + k
|
|
1345
1345
|
}
|
|
1346
1346
|
] : [
|
|
1347
1347
|
{
|
|
1348
|
-
x:
|
|
1348
|
+
x: r - _ / 2,
|
|
1349
1349
|
y: i - a / 2
|
|
1350
1350
|
},
|
|
1351
1351
|
{
|
|
1352
|
-
x:
|
|
1352
|
+
x: r + _ / 2,
|
|
1353
1353
|
y: i - a / 2
|
|
1354
1354
|
},
|
|
1355
1355
|
{
|
|
1356
|
-
x:
|
|
1356
|
+
x: r + _ / 2,
|
|
1357
1357
|
y: i - a / 2 + g
|
|
1358
1358
|
},
|
|
1359
1359
|
{
|
|
1360
|
-
x:
|
|
1360
|
+
x: r + d.width / 2,
|
|
1361
1361
|
y: i - a / 2 + g
|
|
1362
1362
|
},
|
|
1363
1363
|
{
|
|
1364
|
-
x:
|
|
1364
|
+
x: r + d.width / 2 / 2,
|
|
1365
1365
|
y: i + a / 2
|
|
1366
1366
|
},
|
|
1367
1367
|
{
|
|
1368
|
-
x:
|
|
1368
|
+
x: r - d.width / 2,
|
|
1369
1369
|
y: i + a / 2
|
|
1370
1370
|
},
|
|
1371
1371
|
{
|
|
1372
|
-
x:
|
|
1372
|
+
x: r - d.width / 2,
|
|
1373
1373
|
y: i - a / 2 + g
|
|
1374
1374
|
},
|
|
1375
1375
|
{
|
|
1376
|
-
x:
|
|
1376
|
+
x: r - _ / 2,
|
|
1377
1377
|
y: i - a / 2 + g
|
|
1378
1378
|
}
|
|
1379
|
-
], W.polygon(
|
|
1379
|
+
], W.polygon(n, o, t);
|
|
1380
1380
|
}, u;
|
|
1381
1381
|
}
|
|
1382
|
-
|
|
1383
|
-
async function Ne(
|
|
1382
|
+
t(Me, "iconSquare");
|
|
1383
|
+
async function Ne(t, n, { config: { flowchart: r } }) {
|
|
1384
1384
|
let i = new Image();
|
|
1385
|
-
i.src =
|
|
1385
|
+
i.src = n?.img ?? "", await i.decode();
|
|
1386
1386
|
let a = Number(i.naturalWidth.toString().replace("px", "")), o = Number(i.naturalHeight.toString().replace("px", ""));
|
|
1387
|
-
|
|
1388
|
-
let { labelStyles: s } = y(
|
|
1389
|
-
|
|
1390
|
-
let c =
|
|
1391
|
-
|
|
1392
|
-
let l = Math.max(
|
|
1393
|
-
|
|
1394
|
-
let { shapeSvg: f, bbox: p, label: m } = await C(
|
|
1395
|
-
|
|
1387
|
+
n.imageAspectRatio = a / o;
|
|
1388
|
+
let { labelStyles: s } = y(n);
|
|
1389
|
+
n.labelStyle = s;
|
|
1390
|
+
let c = r?.wrappingWidth;
|
|
1391
|
+
n.defaultWidth = r?.wrappingWidth;
|
|
1392
|
+
let l = Math.max(n.label ? c ?? 0 : 0, n?.assetWidth ?? a), u = n.constraint === "on" && n?.assetHeight ? n.assetHeight * n.imageAspectRatio : l, d = n.constraint === "on" ? u / n.imageAspectRatio : n?.assetHeight ?? o;
|
|
1393
|
+
n.width = Math.max(u, c ?? 0);
|
|
1394
|
+
let { shapeSvg: f, bbox: p, label: m } = await C(t, n, "image-shape default"), h = n.pos === "t", g = -u / 2, _ = -d / 2, b = n.label ? 8 : 0, x = S.svg(f), w = v(n, {});
|
|
1395
|
+
n.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
1396
1396
|
let E = x.rectangle(g, _, u, d, w), D = Math.max(u, p.width), O = d + p.height + b, k = x.rectangle(-D / 2, -O / 2, D, O, {
|
|
1397
1397
|
...w,
|
|
1398
1398
|
fill: "none",
|
|
1399
1399
|
stroke: "none"
|
|
1400
1400
|
}), A = f.insert(() => E, ":first-child"), j = f.insert(() => k);
|
|
1401
|
-
if (
|
|
1401
|
+
if (n.img) {
|
|
1402
1402
|
let e = f.append("image");
|
|
1403
|
-
e.attr("href",
|
|
1403
|
+
e.attr("href", n.img), e.attr("width", u), e.attr("height", d), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-u / 2},${h ? O / 2 - d : -O / 2})`);
|
|
1404
1404
|
}
|
|
1405
|
-
return m.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${h ? -d / 2 - p.height / 2 - b / 2 : d / 2 - p.height / 2 + b / 2})`), A.attr("transform", `translate(0,${h ? p.height / 2 + b / 2 : -p.height / 2 - b / 2})`), T(
|
|
1406
|
-
if (
|
|
1407
|
-
let
|
|
1405
|
+
return m.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${h ? -d / 2 - p.height / 2 - b / 2 : d / 2 - p.height / 2 + b / 2})`), A.attr("transform", `translate(0,${h ? p.height / 2 + b / 2 : -p.height / 2 - b / 2})`), T(n, j), n.intersect = function(t) {
|
|
1406
|
+
if (e.info("iconSquare intersect", n, t), !n.label) return W.rect(n, t);
|
|
1407
|
+
let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
|
|
1408
1408
|
return o = h ? [
|
|
1409
1409
|
{
|
|
1410
|
-
x:
|
|
1410
|
+
x: r - p.width / 2,
|
|
1411
1411
|
y: i - a / 2
|
|
1412
1412
|
},
|
|
1413
1413
|
{
|
|
1414
|
-
x:
|
|
1414
|
+
x: r + p.width / 2,
|
|
1415
1415
|
y: i - a / 2
|
|
1416
1416
|
},
|
|
1417
1417
|
{
|
|
1418
|
-
x:
|
|
1418
|
+
x: r + p.width / 2,
|
|
1419
1419
|
y: i - a / 2 + p.height + b
|
|
1420
1420
|
},
|
|
1421
1421
|
{
|
|
1422
|
-
x:
|
|
1422
|
+
x: r + u / 2,
|
|
1423
1423
|
y: i - a / 2 + p.height + b
|
|
1424
1424
|
},
|
|
1425
1425
|
{
|
|
1426
|
-
x:
|
|
1426
|
+
x: r + u / 2,
|
|
1427
1427
|
y: i + a / 2
|
|
1428
1428
|
},
|
|
1429
1429
|
{
|
|
1430
|
-
x:
|
|
1430
|
+
x: r - u / 2,
|
|
1431
1431
|
y: i + a / 2
|
|
1432
1432
|
},
|
|
1433
1433
|
{
|
|
1434
|
-
x:
|
|
1434
|
+
x: r - u / 2,
|
|
1435
1435
|
y: i - a / 2 + p.height + b
|
|
1436
1436
|
},
|
|
1437
1437
|
{
|
|
1438
|
-
x:
|
|
1438
|
+
x: r - p.width / 2,
|
|
1439
1439
|
y: i - a / 2 + p.height + b
|
|
1440
1440
|
}
|
|
1441
1441
|
] : [
|
|
1442
1442
|
{
|
|
1443
|
-
x:
|
|
1443
|
+
x: r - u / 2,
|
|
1444
1444
|
y: i - a / 2
|
|
1445
1445
|
},
|
|
1446
1446
|
{
|
|
1447
|
-
x:
|
|
1447
|
+
x: r + u / 2,
|
|
1448
1448
|
y: i - a / 2
|
|
1449
1449
|
},
|
|
1450
1450
|
{
|
|
1451
|
-
x:
|
|
1451
|
+
x: r + u / 2,
|
|
1452
1452
|
y: i - a / 2 + d
|
|
1453
1453
|
},
|
|
1454
1454
|
{
|
|
1455
|
-
x:
|
|
1455
|
+
x: r + p.width / 2,
|
|
1456
1456
|
y: i - a / 2 + d
|
|
1457
1457
|
},
|
|
1458
1458
|
{
|
|
1459
|
-
x:
|
|
1459
|
+
x: r + p.width / 2 / 2,
|
|
1460
1460
|
y: i + a / 2
|
|
1461
1461
|
},
|
|
1462
1462
|
{
|
|
1463
|
-
x:
|
|
1463
|
+
x: r - p.width / 2,
|
|
1464
1464
|
y: i + a / 2
|
|
1465
1465
|
},
|
|
1466
1466
|
{
|
|
1467
|
-
x:
|
|
1467
|
+
x: r - p.width / 2,
|
|
1468
1468
|
y: i - a / 2 + d
|
|
1469
1469
|
},
|
|
1470
1470
|
{
|
|
1471
|
-
x:
|
|
1471
|
+
x: r - u / 2,
|
|
1472
1472
|
y: i - a / 2 + d
|
|
1473
1473
|
}
|
|
1474
|
-
], W.polygon(
|
|
1474
|
+
], W.polygon(n, o, t);
|
|
1475
1475
|
}, f;
|
|
1476
1476
|
}
|
|
1477
|
-
|
|
1477
|
+
t(Ne, "imageSquare");
|
|
1478
1478
|
async function Pe(e, t) {
|
|
1479
1479
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1480
1480
|
t.labelStyle = n;
|
|
@@ -1504,29 +1504,29 @@ async function Pe(e, t) {
|
|
|
1504
1504
|
return W.polygon(t, c, e);
|
|
1505
1505
|
}, i;
|
|
1506
1506
|
}
|
|
1507
|
-
|
|
1508
|
-
async function Y(e,
|
|
1509
|
-
let { labelStyles:
|
|
1510
|
-
|
|
1511
|
-
let { shapeSvg: o, bbox: s } = await C(e,
|
|
1512
|
-
if (
|
|
1513
|
-
let e = S.svg(o),
|
|
1514
|
-
f = o.insert(() =>
|
|
1515
|
-
} else f = o.insert("rect", ":first-child"), f.attr("class", "basic label-container").attr("style", a).attr("rx",
|
|
1516
|
-
return T(
|
|
1507
|
+
t(Pe, "inv_trapezoid");
|
|
1508
|
+
async function Y(e, t, n) {
|
|
1509
|
+
let { labelStyles: r, nodeStyles: a } = y(t);
|
|
1510
|
+
t.labelStyle = r;
|
|
1511
|
+
let { shapeSvg: o, bbox: s } = await C(e, t, E(t)), c = Math.max(s.width + n.labelPaddingX * 2, t?.width || 0), l = Math.max(s.height + n.labelPaddingY * 2, t?.height || 0), u = -c / 2, d = -l / 2, f, { rx: p, ry: m } = t, { cssStyles: h } = t;
|
|
1512
|
+
if (n?.rx && n.ry && (p = n.rx, m = n.ry), t.look === "handDrawn") {
|
|
1513
|
+
let e = S.svg(o), n = v(t, {}), r = p || m ? e.path(M(u, d, c, l, p || 0), n) : e.rectangle(u, d, c, l, n);
|
|
1514
|
+
f = o.insert(() => r, ":first-child"), f.attr("class", "basic label-container").attr("style", i(h));
|
|
1515
|
+
} else f = o.insert("rect", ":first-child"), f.attr("class", "basic label-container").attr("style", a).attr("rx", i(p)).attr("ry", i(m)).attr("x", u).attr("y", d).attr("width", c).attr("height", l);
|
|
1516
|
+
return T(t, f), t.calcIntersect = function(e, t) {
|
|
1517
1517
|
return W.rect(e, t);
|
|
1518
|
-
},
|
|
1519
|
-
return W.rect(
|
|
1518
|
+
}, t.intersect = function(e) {
|
|
1519
|
+
return W.rect(t, e);
|
|
1520
1520
|
}, o;
|
|
1521
1521
|
}
|
|
1522
|
-
|
|
1522
|
+
t(Y, "drawRect");
|
|
1523
1523
|
async function Fe(e, t) {
|
|
1524
1524
|
let { shapeSvg: n, bbox: r, label: i } = await C(e, t, "label"), a = n.insert("rect", ":first-child");
|
|
1525
1525
|
return a.attr("width", .1).attr("height", .1), n.attr("class", "label edgeLabel"), i.attr("transform", `translate(${-(r.width / 2) - (r.x - (r.left ?? 0))}, ${-(r.height / 2) - (r.y - (r.top ?? 0))})`), T(t, a), t.intersect = function(e) {
|
|
1526
1526
|
return W.rect(t, e);
|
|
1527
1527
|
}, n;
|
|
1528
1528
|
}
|
|
1529
|
-
|
|
1529
|
+
t(Fe, "labelRect");
|
|
1530
1530
|
async function Ie(e, t) {
|
|
1531
1531
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1532
1532
|
t.labelStyle = n;
|
|
@@ -1556,7 +1556,7 @@ async function Ie(e, t) {
|
|
|
1556
1556
|
return W.polygon(t, c, e);
|
|
1557
1557
|
}, i;
|
|
1558
1558
|
}
|
|
1559
|
-
|
|
1559
|
+
t(Ie, "lean_left");
|
|
1560
1560
|
async function Le(e, t) {
|
|
1561
1561
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1562
1562
|
t.labelStyle = n;
|
|
@@ -1586,11 +1586,11 @@ async function Le(e, t) {
|
|
|
1586
1586
|
return W.polygon(t, c, e);
|
|
1587
1587
|
}, i;
|
|
1588
1588
|
}
|
|
1589
|
-
|
|
1590
|
-
function Re(
|
|
1591
|
-
let { labelStyles:
|
|
1592
|
-
|
|
1593
|
-
let a =
|
|
1589
|
+
t(Le, "lean_right");
|
|
1590
|
+
function Re(t, n) {
|
|
1591
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
1592
|
+
n.label = "", n.labelStyle = r;
|
|
1593
|
+
let a = t.insert("g").attr("class", E(n)).attr("id", n.domId ?? n.id), { cssStyles: o } = n, s = Math.max(35, n?.width ?? 0), c = Math.max(35, n?.height ?? 0), l = [
|
|
1594
1594
|
{
|
|
1595
1595
|
x: s,
|
|
1596
1596
|
y: 0
|
|
@@ -1615,15 +1615,15 @@ function Re(e, t) {
|
|
|
1615
1615
|
x: 14,
|
|
1616
1616
|
y: c - 7 / 2
|
|
1617
1617
|
}
|
|
1618
|
-
], u = S.svg(a), d = v(
|
|
1619
|
-
|
|
1618
|
+
], u = S.svg(a), d = v(n, {});
|
|
1619
|
+
n.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
|
|
1620
1620
|
let f = D(l), p = u.path(f, d), m = a.insert(() => p, ":first-child");
|
|
1621
|
-
return o &&
|
|
1622
|
-
return
|
|
1621
|
+
return o && n.look !== "handDrawn" && m.selectAll("path").attr("style", o), i && n.look !== "handDrawn" && m.selectAll("path").attr("style", i), m.attr("transform", `translate(-${s / 2},${-c})`), T(n, m), n.intersect = function(t) {
|
|
1622
|
+
return e.info("lightningBolt intersect", n, t), W.polygon(n, l, t);
|
|
1623
1623
|
}, a;
|
|
1624
1624
|
}
|
|
1625
|
-
|
|
1626
|
-
var ze = /* @__PURE__ */
|
|
1625
|
+
t(Re, "lightningBolt");
|
|
1626
|
+
var ze = /* @__PURE__ */ t((e, t, n, r, i, a, o) => [
|
|
1627
1627
|
`M${e},${t + a}`,
|
|
1628
1628
|
`a${i},${a} 0,0,0 ${n},0`,
|
|
1629
1629
|
`a${i},${a} 0,0,0 ${-n},0`,
|
|
@@ -1632,7 +1632,7 @@ var ze = /* @__PURE__ */ i((e, t, n, r, i, a, o) => [
|
|
|
1632
1632
|
`l0,${-r}`,
|
|
1633
1633
|
`M${e},${t + a + o}`,
|
|
1634
1634
|
`a${i},${a} 0,0,0 ${n},0`
|
|
1635
|
-
].join(" "), "createCylinderPathD"), Be = /* @__PURE__ */
|
|
1635
|
+
].join(" "), "createCylinderPathD"), Be = /* @__PURE__ */ t((e, t, n, r, i, a, o) => [
|
|
1636
1636
|
`M${e},${t + a}`,
|
|
1637
1637
|
`M${e + n},${t + a}`,
|
|
1638
1638
|
`a${i},${a} 0,0,0 ${-n},0`,
|
|
@@ -1641,28 +1641,28 @@ var ze = /* @__PURE__ */ i((e, t, n, r, i, a, o) => [
|
|
|
1641
1641
|
`l0,${-r}`,
|
|
1642
1642
|
`M${e},${t + a + o}`,
|
|
1643
1643
|
`a${i},${a} 0,0,0 ${n},0`
|
|
1644
|
-
].join(" "), "createOuterCylinderPathD"), Ve = /* @__PURE__ */
|
|
1645
|
-
async function He(e,
|
|
1646
|
-
let { labelStyles:
|
|
1647
|
-
|
|
1648
|
-
let { shapeSvg: a, bbox: o, label: s } = await C(e,
|
|
1649
|
-
if (
|
|
1650
|
-
let e = S.svg(a),
|
|
1644
|
+
].join(" "), "createOuterCylinderPathD"), Ve = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD");
|
|
1645
|
+
async function He(e, t) {
|
|
1646
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1647
|
+
t.labelStyle = n;
|
|
1648
|
+
let { shapeSvg: a, bbox: o, label: s } = await C(e, t, E(t)), c = Math.max(o.width + (t.padding ?? 0), t.width ?? 0), l = c / 2, u = l / (2.5 + c / 50), d = Math.max(o.height + u + (t.padding ?? 0), t.height ?? 0), f = d * .1, p, { cssStyles: m } = t;
|
|
1649
|
+
if (t.look === "handDrawn") {
|
|
1650
|
+
let e = S.svg(a), n = Be(0, 0, c, d, l, u, f), r = Ve(0, u, c, d, l, u), i = v(t, {}), o = e.path(n, i), s = e.path(r, i);
|
|
1651
1651
|
a.insert(() => s, ":first-child").attr("class", "line"), p = a.insert(() => o, ":first-child"), p.attr("class", "basic label-container"), m && p.attr("style", m);
|
|
1652
1652
|
} else {
|
|
1653
1653
|
let e = ze(0, 0, c, d, l, u, f);
|
|
1654
|
-
p = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style",
|
|
1654
|
+
p = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", i(m)).attr("style", r);
|
|
1655
1655
|
}
|
|
1656
|
-
return p.attr("label-offset-y", u), p.attr("transform", `translate(${-c / 2}, ${-(d / 2 + u)})`), T(
|
|
1657
|
-
let
|
|
1658
|
-
if (l != 0 && (Math.abs(r) < (
|
|
1656
|
+
return p.attr("label-offset-y", u), p.attr("transform", `translate(${-c / 2}, ${-(d / 2 + u)})`), T(t, p), s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${-(o.height / 2) + u - (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
|
|
1657
|
+
let n = W.rect(t, e), r = n.x - (t.x ?? 0);
|
|
1658
|
+
if (l != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - u)) {
|
|
1659
1659
|
let i = u * u * (1 - r * r / (l * l));
|
|
1660
|
-
i > 0 && (i = Math.sqrt(i)), i = u - i, e.y - (
|
|
1660
|
+
i > 0 && (i = Math.sqrt(i)), i = u - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
|
|
1661
1661
|
}
|
|
1662
|
-
return
|
|
1662
|
+
return n;
|
|
1663
1663
|
}, a;
|
|
1664
1664
|
}
|
|
1665
|
-
|
|
1665
|
+
t(He, "linedCylinder");
|
|
1666
1666
|
async function Ue(e, t) {
|
|
1667
1667
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1668
1668
|
t.labelStyle = n;
|
|
@@ -1703,7 +1703,7 @@ async function Ue(e, t) {
|
|
|
1703
1703
|
return W.polygon(t, m, e);
|
|
1704
1704
|
}, i;
|
|
1705
1705
|
}
|
|
1706
|
-
|
|
1706
|
+
t(Ue, "linedWaveEdgedRect");
|
|
1707
1707
|
async function We(e, t) {
|
|
1708
1708
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1709
1709
|
t.labelStyle = n;
|
|
@@ -1791,7 +1791,7 @@ async function We(e, t) {
|
|
|
1791
1791
|
return W.polygon(t, m, e);
|
|
1792
1792
|
}, i;
|
|
1793
1793
|
}
|
|
1794
|
-
|
|
1794
|
+
t(We, "multiRect");
|
|
1795
1795
|
async function Ge(e, t) {
|
|
1796
1796
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1797
1797
|
t.labelStyle = n;
|
|
@@ -1873,7 +1873,7 @@ async function Ge(e, t) {
|
|
|
1873
1873
|
return W.polygon(t, g, e);
|
|
1874
1874
|
}, i;
|
|
1875
1875
|
}
|
|
1876
|
-
|
|
1876
|
+
t(Ge, "multiWaveEdgedRectangle");
|
|
1877
1877
|
async function Ke(e, t, { config: { themeVariables: n } }) {
|
|
1878
1878
|
let { labelStyles: r, nodeStyles: i } = y(t);
|
|
1879
1879
|
t.labelStyle = r, t.useHtmlLabels || f(p()) || (t.centerLabel = !0);
|
|
@@ -1887,8 +1887,8 @@ async function Ke(e, t, { config: { themeVariables: n } }) {
|
|
|
1887
1887
|
return W.rect(t, e);
|
|
1888
1888
|
}, a;
|
|
1889
1889
|
}
|
|
1890
|
-
|
|
1891
|
-
var qe = /* @__PURE__ */
|
|
1890
|
+
t(Ke, "note");
|
|
1891
|
+
var qe = /* @__PURE__ */ t((e, t, n) => [
|
|
1892
1892
|
`M${e + n / 2},${t}`,
|
|
1893
1893
|
`L${e + n},${t - n / 2}`,
|
|
1894
1894
|
`L${e + n / 2},${t - n}`,
|
|
@@ -1947,7 +1947,7 @@ async function Je(e, t) {
|
|
|
1947
1947
|
return this.calcIntersect(t, e);
|
|
1948
1948
|
}, i;
|
|
1949
1949
|
}
|
|
1950
|
-
|
|
1950
|
+
t(Je, "question");
|
|
1951
1951
|
async function Ye(e, t) {
|
|
1952
1952
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1953
1953
|
t.labelStyle = n;
|
|
@@ -1979,35 +1979,35 @@ async function Ye(e, t) {
|
|
|
1979
1979
|
return W.polygon(t, f, e);
|
|
1980
1980
|
}, i;
|
|
1981
1981
|
}
|
|
1982
|
-
|
|
1983
|
-
async function Xe(
|
|
1984
|
-
let { labelStyles:
|
|
1985
|
-
|
|
1982
|
+
t(Ye, "rect_left_inv_arrow");
|
|
1983
|
+
async function Xe(t, r) {
|
|
1984
|
+
let { labelStyles: i, nodeStyles: a } = y(r);
|
|
1985
|
+
r.labelStyle = i;
|
|
1986
1986
|
let o;
|
|
1987
|
-
o =
|
|
1988
|
-
let s =
|
|
1987
|
+
o = r.cssClasses ? "node " + r.cssClasses : "node default";
|
|
1988
|
+
let s = t.insert("g").attr("class", o).attr("id", r.domId || r.id), l = s.insert("g"), u = s.insert("g").attr("class", "label").attr("style", a), d = r.description, p = r.label, m = await j(u, p, r.labelStyle, !0, !0), h = {
|
|
1989
1989
|
width: 0,
|
|
1990
1990
|
height: 0
|
|
1991
1991
|
};
|
|
1992
1992
|
if (f(c())) {
|
|
1993
|
-
let e = m.children[0], t =
|
|
1993
|
+
let e = m.children[0], t = n(m);
|
|
1994
1994
|
h = e.getBoundingClientRect(), t.attr("width", h.width), t.attr("height", h.height);
|
|
1995
1995
|
}
|
|
1996
|
-
|
|
1997
|
-
let g = d || [], _ = m.getBBox(), b = await j(u, Array.isArray(g) ? g.join("<br/>") : g,
|
|
1996
|
+
e.info("Text 2", d);
|
|
1997
|
+
let g = d || [], _ = m.getBBox(), b = await j(u, Array.isArray(g) ? g.join("<br/>") : g, r.labelStyle, !0, !0), x = b.children[0], C = n(b);
|
|
1998
1998
|
h = x.getBoundingClientRect(), C.attr("width", h.width), C.attr("height", h.height);
|
|
1999
|
-
let w = (
|
|
2000
|
-
|
|
2001
|
-
let E = h.width + (
|
|
2002
|
-
if (
|
|
2003
|
-
let
|
|
2004
|
-
N = s.insert(() => (
|
|
2005
|
-
} else A = l.insert("rect", ":first-child"), N = l.insert("line"), A.attr("class", "outer title-state").attr("style",
|
|
2006
|
-
return T(
|
|
2007
|
-
return W.rect(
|
|
1999
|
+
let w = (r.padding || 0) / 2;
|
|
2000
|
+
n(b).attr("transform", "translate( " + (h.width > _.width ? 0 : (_.width - h.width) / 2) + ", " + (_.height + w + 5) + ")"), n(m).attr("transform", "translate( " + (h.width < _.width ? 0 : -(_.width - h.width) / 2) + ", 0)"), h = u.node().getBBox(), u.attr("transform", "translate(" + -h.width / 2 + ", " + (-h.height / 2 - w + 3) + ")");
|
|
2001
|
+
let E = h.width + (r.padding || 0), D = h.height + (r.padding || 0), O = -h.width / 2 - w, k = -h.height / 2 - w, A, N;
|
|
2002
|
+
if (r.look === "handDrawn") {
|
|
2003
|
+
let t = S.svg(s), n = v(r, {}), i = t.path(M(O, k, E, D, r.rx || 0), n), a = t.line(-h.width / 2 - w, -h.height / 2 - w + _.height + w, h.width / 2 + w, -h.height / 2 - w + _.height + w, n);
|
|
2004
|
+
N = s.insert(() => (e.debug("Rough node insert CXC", i), a), ":first-child"), A = s.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child");
|
|
2005
|
+
} else A = l.insert("rect", ":first-child"), N = l.insert("line"), A.attr("class", "outer title-state").attr("style", a).attr("x", -h.width / 2 - w).attr("y", -h.height / 2 - w).attr("width", h.width + (r.padding || 0)).attr("height", h.height + (r.padding || 0)), N.attr("class", "divider").attr("x1", -h.width / 2 - w).attr("x2", h.width / 2 + w).attr("y1", -h.height / 2 - w + _.height + w).attr("y2", -h.height / 2 - w + _.height + w);
|
|
2006
|
+
return T(r, A), r.intersect = function(e) {
|
|
2007
|
+
return W.rect(r, e);
|
|
2008
2008
|
}, s;
|
|
2009
2009
|
}
|
|
2010
|
-
|
|
2010
|
+
t(Xe, "rectWithTitle");
|
|
2011
2011
|
async function Ze(e, t) {
|
|
2012
2012
|
return Y(e, t, {
|
|
2013
2013
|
rx: 5,
|
|
@@ -2017,12 +2017,12 @@ async function Ze(e, t) {
|
|
|
2017
2017
|
labelPaddingY: (t?.padding || 0) * 1
|
|
2018
2018
|
});
|
|
2019
2019
|
}
|
|
2020
|
-
|
|
2021
|
-
async function Qe(e,
|
|
2022
|
-
let { labelStyles:
|
|
2023
|
-
|
|
2024
|
-
let { shapeSvg: a, bbox: o, label: s } = await C(e,
|
|
2025
|
-
|
|
2020
|
+
t(Ze, "roundedRect");
|
|
2021
|
+
async function Qe(e, t) {
|
|
2022
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2023
|
+
t.labelStyle = n;
|
|
2024
|
+
let { shapeSvg: a, bbox: o, label: s } = await C(e, t, E(t)), c = t?.padding ?? 0, l = Math.max(o.width + (t.padding ?? 0) * 2, t?.width ?? 0), u = Math.max(o.height + (t.padding ?? 0) * 2, t?.height ?? 0), d = -o.width / 2 - c, f = -o.height / 2 - c, { cssStyles: p } = t, m = S.svg(a), h = v(t, {});
|
|
2025
|
+
t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
2026
2026
|
let g = [
|
|
2027
2027
|
{
|
|
2028
2028
|
x: d,
|
|
@@ -2053,11 +2053,11 @@ async function Qe(e, n) {
|
|
|
2053
2053
|
y: f + u
|
|
2054
2054
|
}
|
|
2055
2055
|
], _ = m.polygon(g.map((e) => [e.x, e.y]), h), b = a.insert(() => _, ":first-child");
|
|
2056
|
-
return b.attr("class", "basic label-container").attr("style",
|
|
2057
|
-
return W.rect(
|
|
2056
|
+
return b.attr("class", "basic label-container").attr("style", i(p)), r && t.look !== "handDrawn" && b.selectAll("path").attr("style", r), p && t.look !== "handDrawn" && b.selectAll("path").attr("style", r), s.attr("transform", `translate(${-l / 2 + 4 + (t.padding ?? 0) - (o.x - (o.left ?? 0))},${-u / 2 + (t.padding ?? 0) - (o.y - (o.top ?? 0))})`), T(t, b), t.intersect = function(e) {
|
|
2057
|
+
return W.rect(t, e);
|
|
2058
2058
|
}, a;
|
|
2059
2059
|
}
|
|
2060
|
-
|
|
2060
|
+
t(Qe, "shadedProcess");
|
|
2061
2061
|
async function $e(e, t) {
|
|
2062
2062
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2063
2063
|
t.labelStyle = n;
|
|
@@ -2085,7 +2085,7 @@ async function $e(e, t) {
|
|
|
2085
2085
|
return W.polygon(t, m, e);
|
|
2086
2086
|
}, i;
|
|
2087
2087
|
}
|
|
2088
|
-
|
|
2088
|
+
t($e, "slopedRect");
|
|
2089
2089
|
async function et(e, t) {
|
|
2090
2090
|
return Y(e, t, {
|
|
2091
2091
|
rx: 0,
|
|
@@ -2095,7 +2095,7 @@ async function et(e, t) {
|
|
|
2095
2095
|
labelPaddingY: (t?.padding || 0) * 1
|
|
2096
2096
|
});
|
|
2097
2097
|
}
|
|
2098
|
-
|
|
2098
|
+
t(et, "squareRect");
|
|
2099
2099
|
async function tt(e, t) {
|
|
2100
2100
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2101
2101
|
t.labelStyle = n;
|
|
@@ -2121,7 +2121,7 @@ async function tt(e, t) {
|
|
|
2121
2121
|
return W.polygon(t, f, e);
|
|
2122
2122
|
}, i;
|
|
2123
2123
|
}
|
|
2124
|
-
|
|
2124
|
+
t(tt, "stadium");
|
|
2125
2125
|
async function nt(e, t) {
|
|
2126
2126
|
return Y(e, t, {
|
|
2127
2127
|
rx: 5,
|
|
@@ -2129,7 +2129,7 @@ async function nt(e, t) {
|
|
|
2129
2129
|
classes: "flowchart-node"
|
|
2130
2130
|
});
|
|
2131
2131
|
}
|
|
2132
|
-
|
|
2132
|
+
t(nt, "state");
|
|
2133
2133
|
function rt(e, t, { config: { themeVariables: n } }) {
|
|
2134
2134
|
let { labelStyles: r, nodeStyles: i } = y(t);
|
|
2135
2135
|
t.labelStyle = r;
|
|
@@ -2150,7 +2150,7 @@ function rt(e, t, { config: { themeVariables: n } }) {
|
|
|
2150
2150
|
return W.circle(t, 7, e);
|
|
2151
2151
|
}, l;
|
|
2152
2152
|
}
|
|
2153
|
-
|
|
2153
|
+
t(rt, "stateEnd");
|
|
2154
2154
|
function it(e, t, { config: { themeVariables: n } }) {
|
|
2155
2155
|
let { lineColor: r } = n, i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), a;
|
|
2156
2156
|
if (t.look === "handDrawn") {
|
|
@@ -2161,11 +2161,11 @@ function it(e, t, { config: { themeVariables: n } }) {
|
|
|
2161
2161
|
return W.circle(t, 7, e);
|
|
2162
2162
|
}, i;
|
|
2163
2163
|
}
|
|
2164
|
-
|
|
2165
|
-
async function at(e,
|
|
2166
|
-
let { labelStyles:
|
|
2167
|
-
|
|
2168
|
-
let { shapeSvg: a, bbox: o } = await C(e,
|
|
2164
|
+
t(it, "stateStart");
|
|
2165
|
+
async function at(e, t) {
|
|
2166
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2167
|
+
t.labelStyle = n;
|
|
2168
|
+
let { shapeSvg: a, bbox: o } = await C(e, t, E(t)), s = (t?.padding || 0) / 2, c = o.width + t.padding, l = o.height + t.padding, u = -o.width / 2 - s, d = -o.height / 2 - s, f = [
|
|
2169
2169
|
{
|
|
2170
2170
|
x: 0,
|
|
2171
2171
|
y: 0
|
|
@@ -2207,20 +2207,20 @@ async function at(e, n) {
|
|
|
2207
2207
|
y: 0
|
|
2208
2208
|
}
|
|
2209
2209
|
];
|
|
2210
|
-
if (
|
|
2211
|
-
let e = S.svg(a),
|
|
2210
|
+
if (t.look === "handDrawn") {
|
|
2211
|
+
let e = S.svg(a), n = v(t, {}), r = e.rectangle(u - 8, d, c + 16, l, n), o = e.line(u, d, u, d + l, n), s = e.line(u + c, d, u + c, d + l, n);
|
|
2212
2212
|
a.insert(() => o, ":first-child"), a.insert(() => s, ":first-child");
|
|
2213
|
-
let f = a.insert(() =>
|
|
2214
|
-
f.attr("class", "basic label-container").attr("style",
|
|
2213
|
+
let f = a.insert(() => r, ":first-child"), { cssStyles: p } = t;
|
|
2214
|
+
f.attr("class", "basic label-container").attr("style", i(p)), T(t, f);
|
|
2215
2215
|
} else {
|
|
2216
2216
|
let e = G(a, c, l, f);
|
|
2217
|
-
|
|
2217
|
+
r && e.attr("style", r), T(t, e);
|
|
2218
2218
|
}
|
|
2219
|
-
return
|
|
2220
|
-
return W.polygon(
|
|
2219
|
+
return t.intersect = function(e) {
|
|
2220
|
+
return W.polygon(t, f, e);
|
|
2221
2221
|
}, a;
|
|
2222
2222
|
}
|
|
2223
|
-
|
|
2223
|
+
t(at, "subroutine");
|
|
2224
2224
|
async function ot(e, t) {
|
|
2225
2225
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2226
2226
|
t.labelStyle = n;
|
|
@@ -2264,7 +2264,7 @@ async function ot(e, t) {
|
|
|
2264
2264
|
return W.polygon(t, h, e);
|
|
2265
2265
|
}, i;
|
|
2266
2266
|
}
|
|
2267
|
-
|
|
2267
|
+
t(ot, "taggedRect");
|
|
2268
2268
|
async function st(e, t) {
|
|
2269
2269
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2270
2270
|
t.labelStyle = n;
|
|
@@ -2306,7 +2306,7 @@ async function st(e, t) {
|
|
|
2306
2306
|
return W.polygon(t, g, e);
|
|
2307
2307
|
}, i;
|
|
2308
2308
|
}
|
|
2309
|
-
|
|
2309
|
+
t(st, "taggedWaveEdgedRectangle");
|
|
2310
2310
|
async function ct(e, t) {
|
|
2311
2311
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2312
2312
|
t.labelStyle = n;
|
|
@@ -2315,42 +2315,42 @@ async function ct(e, t) {
|
|
|
2315
2315
|
return W.rect(t, e);
|
|
2316
2316
|
}, i;
|
|
2317
2317
|
}
|
|
2318
|
-
|
|
2319
|
-
var lt = /* @__PURE__ */
|
|
2318
|
+
t(ct, "text");
|
|
2319
|
+
var lt = /* @__PURE__ */ t((e, t, n, r, i, a) => `M${e},${t}
|
|
2320
2320
|
a${i},${a} 0,0,1 0,${-r}
|
|
2321
2321
|
l${n},0
|
|
2322
2322
|
a${i},${a} 0,0,1 0,${r}
|
|
2323
2323
|
M${n},${-r}
|
|
2324
2324
|
a${i},${a} 0,0,0 0,${r}
|
|
2325
|
-
l${-n},0`, "createCylinderPathD"), ut = /* @__PURE__ */
|
|
2325
|
+
l${-n},0`, "createCylinderPathD"), ut = /* @__PURE__ */ t((e, t, n, r, i, a) => [
|
|
2326
2326
|
`M${e},${t}`,
|
|
2327
2327
|
`M${e + n},${t}`,
|
|
2328
2328
|
`a${i},${a} 0,0,0 0,${-r}`,
|
|
2329
2329
|
`l${-n},0`,
|
|
2330
2330
|
`a${i},${a} 0,0,0 0,${r}`,
|
|
2331
2331
|
`l${n},0`
|
|
2332
|
-
].join(" "), "createOuterCylinderPathD"), dt = /* @__PURE__ */
|
|
2333
|
-
async function ft(e,
|
|
2334
|
-
let { labelStyles:
|
|
2335
|
-
|
|
2336
|
-
let { shapeSvg: a, bbox: o, label: s, halfPadding: c } = await C(e,
|
|
2337
|
-
if (
|
|
2338
|
-
let e = S.svg(a),
|
|
2332
|
+
].join(" "), "createOuterCylinderPathD"), dt = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e + n / 2},${-r / 2}`, `a${i},${a} 0,0,0 0,${r}`].join(" "), "createInnerCylinderPathD");
|
|
2333
|
+
async function ft(e, t) {
|
|
2334
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2335
|
+
t.labelStyle = n;
|
|
2336
|
+
let { shapeSvg: a, bbox: o, label: s, halfPadding: c } = await C(e, t, E(t)), l = t.look === "neo" ? c * 2 : c, u = o.height + l, d = u / 2, f = d / (2.5 + u / 50), p = o.width + f + l, { cssStyles: m } = t, h;
|
|
2337
|
+
if (t.look === "handDrawn") {
|
|
2338
|
+
let e = S.svg(a), n = ut(0, 0, p, u, f, d), r = dt(0, 0, p, u, f, d), i = e.path(n, v(t, {})), o = e.path(r, v(t, { fill: "none" }));
|
|
2339
2339
|
h = a.insert(() => o, ":first-child"), h = a.insert(() => i, ":first-child"), h.attr("class", "basic label-container"), m && h.attr("style", m);
|
|
2340
2340
|
} else {
|
|
2341
2341
|
let e = lt(0, 0, p, u, f, d);
|
|
2342
|
-
h = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style",
|
|
2342
|
+
h = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", i(m)).attr("style", r), h.attr("class", "basic label-container"), m && h.selectAll("path").attr("style", m), r && h.selectAll("path").attr("style", r);
|
|
2343
2343
|
}
|
|
2344
|
-
return h.attr("label-offset-x", f), h.attr("transform", `translate(${-p / 2}, ${u / 2} )`), s.attr("transform", `translate(${-(o.width / 2) - f - (o.x - (o.left ?? 0))}, ${-(o.height / 2) - (o.y - (o.top ?? 0))})`), T(
|
|
2345
|
-
let
|
|
2346
|
-
if (d != 0 && (Math.abs(r) < (
|
|
2344
|
+
return h.attr("label-offset-x", f), h.attr("transform", `translate(${-p / 2}, ${u / 2} )`), s.attr("transform", `translate(${-(o.width / 2) - f - (o.x - (o.left ?? 0))}, ${-(o.height / 2) - (o.y - (o.top ?? 0))})`), T(t, h), t.intersect = function(e) {
|
|
2345
|
+
let n = W.rect(t, e), r = n.y - (t.y ?? 0);
|
|
2346
|
+
if (d != 0 && (Math.abs(r) < (t.height ?? 0) / 2 || Math.abs(r) == (t.height ?? 0) / 2 && Math.abs(n.x - (t.x ?? 0)) > (t.width ?? 0) / 2 - f)) {
|
|
2347
2347
|
let i = f * f * (1 - r * r / (d * d));
|
|
2348
|
-
i != 0 && (i = Math.sqrt(Math.abs(i))), i = f - i, e.x - (
|
|
2348
|
+
i != 0 && (i = Math.sqrt(Math.abs(i))), i = f - i, e.x - (t.x ?? 0) > 0 && (i = -i), n.x += i;
|
|
2349
2349
|
}
|
|
2350
|
-
return
|
|
2350
|
+
return n;
|
|
2351
2351
|
}, a;
|
|
2352
2352
|
}
|
|
2353
|
-
|
|
2353
|
+
t(ft, "tiltedCylinder");
|
|
2354
2354
|
async function pt(e, t) {
|
|
2355
2355
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2356
2356
|
t.labelStyle = n;
|
|
@@ -2380,7 +2380,7 @@ async function pt(e, t) {
|
|
|
2380
2380
|
return W.polygon(t, c, e);
|
|
2381
2381
|
}, i;
|
|
2382
2382
|
}
|
|
2383
|
-
|
|
2383
|
+
t(pt, "trapezoid");
|
|
2384
2384
|
async function mt(e, t) {
|
|
2385
2385
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2386
2386
|
t.labelStyle = n;
|
|
@@ -2416,11 +2416,11 @@ async function mt(e, t) {
|
|
|
2416
2416
|
return W.polygon(t, d, e);
|
|
2417
2417
|
}, i;
|
|
2418
2418
|
}
|
|
2419
|
-
|
|
2420
|
-
async function ht(
|
|
2421
|
-
let { labelStyles:
|
|
2422
|
-
|
|
2423
|
-
let { shapeSvg: a, bbox: o, label: s } = await C(
|
|
2419
|
+
t(mt, "trapezoidalPentagon");
|
|
2420
|
+
async function ht(t, n) {
|
|
2421
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
2422
|
+
n.labelStyle = r;
|
|
2423
|
+
let { shapeSvg: a, bbox: o, label: s } = await C(t, n, E(n)), l = n.useHtmlLabels || f(c()), u = o.width + (n.padding ?? 0), d = u + o.height, p = u + o.height, m = [
|
|
2424
2424
|
{
|
|
2425
2425
|
x: 0,
|
|
2426
2426
|
y: 0
|
|
@@ -2433,14 +2433,14 @@ async function ht(e, t) {
|
|
|
2433
2433
|
x: p / 2,
|
|
2434
2434
|
y: -d
|
|
2435
2435
|
}
|
|
2436
|
-
], { cssStyles: h } =
|
|
2437
|
-
|
|
2436
|
+
], { cssStyles: h } = n, g = S.svg(a), _ = v(n, {});
|
|
2437
|
+
n.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
|
|
2438
2438
|
let b = D(m), x = g.path(b, _), w = a.insert(() => x, ":first-child").attr("transform", `translate(${-d / 2}, ${d / 2})`);
|
|
2439
|
-
return h &&
|
|
2440
|
-
return
|
|
2439
|
+
return h && n.look !== "handDrawn" && w.selectChildren("path").attr("style", h), i && n.look !== "handDrawn" && w.selectChildren("path").attr("style", i), n.width = u, n.height = d, T(n, w), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${d / 2 - (o.height + (n.padding ?? 0) / (l ? 2 : 1) - (o.y - (o.top ?? 0)))})`), n.intersect = function(t) {
|
|
2440
|
+
return e.info("Triangle intersect", n, m, t), W.polygon(n, m, t);
|
|
2441
2441
|
}, a;
|
|
2442
2442
|
}
|
|
2443
|
-
|
|
2443
|
+
t(ht, "triangle");
|
|
2444
2444
|
async function gt(e, t) {
|
|
2445
2445
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2446
2446
|
t.labelStyle = n;
|
|
@@ -2465,7 +2465,7 @@ async function gt(e, t) {
|
|
|
2465
2465
|
return W.polygon(t, g, e);
|
|
2466
2466
|
}, i;
|
|
2467
2467
|
}
|
|
2468
|
-
|
|
2468
|
+
t(gt, "waveEdgedRectangle");
|
|
2469
2469
|
async function _t(e, t) {
|
|
2470
2470
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2471
2471
|
t.labelStyle = n;
|
|
@@ -2489,7 +2489,7 @@ async function _t(e, t) {
|
|
|
2489
2489
|
return W.polygon(t, g, e);
|
|
2490
2490
|
}, i;
|
|
2491
2491
|
}
|
|
2492
|
-
|
|
2492
|
+
t(_t, "waveRectangle");
|
|
2493
2493
|
async function vt(e, t) {
|
|
2494
2494
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2495
2495
|
t.labelStyle = n;
|
|
@@ -2519,7 +2519,7 @@ async function vt(e, t) {
|
|
|
2519
2519
|
return W.polygon(t, m, e);
|
|
2520
2520
|
}, i;
|
|
2521
2521
|
}
|
|
2522
|
-
|
|
2522
|
+
t(vt, "windowPane");
|
|
2523
2523
|
async function yt(e, t) {
|
|
2524
2524
|
let r = t;
|
|
2525
2525
|
if (r.alias && (t.label = r.alias), t.look === "handDrawn") {
|
|
@@ -2535,20 +2535,20 @@ async function yt(e, t) {
|
|
|
2535
2535
|
t.useHtmlLabels = i.htmlLabels;
|
|
2536
2536
|
let o = i.er?.diagramPadding ?? 10, s = i.er?.entityPadding ?? 6, { cssStyles: c } = t, { labelStyles: u, nodeStyles: d } = y(t);
|
|
2537
2537
|
if (r.attributes.length === 0 && t.label) {
|
|
2538
|
-
let
|
|
2538
|
+
let n = {
|
|
2539
2539
|
rx: 0,
|
|
2540
2540
|
ry: 0,
|
|
2541
2541
|
labelPaddingX: o,
|
|
2542
2542
|
labelPaddingY: o * 1.5,
|
|
2543
2543
|
classes: ""
|
|
2544
2544
|
};
|
|
2545
|
-
|
|
2546
|
-
let
|
|
2545
|
+
a(t.label, i) + n.labelPaddingX * 2 < i.er.minEntityWidth && (t.width = i.er.minEntityWidth);
|
|
2546
|
+
let r = await Y(e, t, n);
|
|
2547
2547
|
if (!l(i.htmlLabels)) {
|
|
2548
|
-
let e =
|
|
2548
|
+
let e = r.select("text"), t = e.node()?.getBBox();
|
|
2549
2549
|
e.attr("transform", `translate(${-t.width / 2}, 0)`);
|
|
2550
2550
|
}
|
|
2551
|
-
return
|
|
2551
|
+
return r;
|
|
2552
2552
|
}
|
|
2553
2553
|
i.htmlLabels || (o *= 1.25, s *= 1.25);
|
|
2554
2554
|
let f = E(t);
|
|
@@ -2583,13 +2583,13 @@ async function yt(e, t) {
|
|
|
2583
2583
|
let F = 0;
|
|
2584
2584
|
b.length > 0 && (F = b.reduce((e, t) => e + (t?.rowHeight ?? 0), 0));
|
|
2585
2585
|
let I = Math.max(j.width + o * 2, t?.width || 0, M), L = Math.max((F ?? 0) + h.height, t?.height || 0), R = -I / 2, z = -L / 2;
|
|
2586
|
-
m.selectAll("g:not(:first-child)").each((e, t,
|
|
2587
|
-
let
|
|
2588
|
-
if (
|
|
2589
|
-
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(
|
|
2590
|
-
e && (c = parseFloat(e[1]), l = parseFloat(e[2]),
|
|
2586
|
+
m.selectAll("g:not(:first-child)").each((e, t, r) => {
|
|
2587
|
+
let i = n(r[t]), a = i.attr("transform"), c = 0, l = 0;
|
|
2588
|
+
if (a) {
|
|
2589
|
+
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
|
|
2590
|
+
e && (c = parseFloat(e[1]), l = parseFloat(e[2]), i.attr("class").includes("attribute-name") ? c += x : i.attr("class").includes("attribute-keys") ? c += x + C : i.attr("class").includes("attribute-comment") && (c += x + C + w));
|
|
2591
2591
|
}
|
|
2592
|
-
|
|
2592
|
+
i.attr("transform", `translate(${R + o / 2 + c}, ${l + z + h.height + s / 2})`);
|
|
2593
2593
|
}), m.select(".name").attr("transform", "translate(" + -h.width / 2 + ", " + (z + s / 2) + ")");
|
|
2594
2594
|
let B = N.rectangle(R, z, I, L, P), V = m.insert(() => B, ":first-child").attr("style", c.join("")), { themeVariables: ee } = p(), { rowEven: te, rowOdd: ne, nodeBorder: H } = ee;
|
|
2595
2595
|
_.push(0);
|
|
@@ -2612,12 +2612,12 @@ async function yt(e, t) {
|
|
|
2612
2612
|
return W.rect(t, e);
|
|
2613
2613
|
}, m;
|
|
2614
2614
|
}
|
|
2615
|
-
|
|
2615
|
+
t(yt, "erBox");
|
|
2616
2616
|
async function X(e, t, r, i = 0, o = 0, s = [], c = "") {
|
|
2617
2617
|
let d = e.insert("g").attr("class", `label ${s.join(" ")}`).attr("transform", `translate(${i}, ${o})`).attr("style", c);
|
|
2618
2618
|
t !== u(t) && (t = u(t), t = t.replaceAll("<", "<").replaceAll(">", ">"));
|
|
2619
2619
|
let f = d.node().appendChild(await m(d, t, {
|
|
2620
|
-
width:
|
|
2620
|
+
width: a(t, r) + 100,
|
|
2621
2621
|
style: c,
|
|
2622
2622
|
useHtmlLabels: r.htmlLabels
|
|
2623
2623
|
}, r));
|
|
@@ -2629,12 +2629,12 @@ async function X(e, t, r, i = 0, o = 0, s = [], c = "") {
|
|
|
2629
2629
|
if (l(r.htmlLabels)) {
|
|
2630
2630
|
let e = f.children[0];
|
|
2631
2631
|
e.style.textAlign = "start";
|
|
2632
|
-
let t =
|
|
2632
|
+
let t = n(f);
|
|
2633
2633
|
p = e.getBoundingClientRect(), t.attr("width", p.width), t.attr("height", p.height);
|
|
2634
2634
|
}
|
|
2635
2635
|
return p;
|
|
2636
2636
|
}
|
|
2637
|
-
|
|
2637
|
+
t(X, "addText");
|
|
2638
2638
|
async function bt(e, t, n, r, i = n.class.padding ?? 12) {
|
|
2639
2639
|
let a = r ? 0 : 3, o = e.insert("g").attr("class", E(t)).attr("id", t.domId || t.id), s = null, c = null, l = null, u = null, d = 0, f = 0, p = 0;
|
|
2640
2640
|
if (s = o.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
|
|
@@ -2665,77 +2665,77 @@ async function bt(e, t, n, r, i = n.class.padding ?? 12) {
|
|
|
2665
2665
|
bbox: _
|
|
2666
2666
|
};
|
|
2667
2667
|
}
|
|
2668
|
-
|
|
2669
|
-
async function Z(
|
|
2670
|
-
let u =
|
|
2671
|
-
g = "text" in
|
|
2672
|
-
let _ = await m(u, s(
|
|
2673
|
-
width:
|
|
2668
|
+
t(bt, "textHelper");
|
|
2669
|
+
async function Z(e, i, o, c = []) {
|
|
2670
|
+
let u = e.insert("g").attr("class", "label").attr("style", c.join("; ")), f = p(), h = "useHtmlLabels" in i ? i.useHtmlLabels : l(f.htmlLabels) ?? !0, g = "";
|
|
2671
|
+
g = "text" in i ? i.text : i.label, !h && g.startsWith("\\") && (g = g.substring(1)), d(g) && (h = !0);
|
|
2672
|
+
let _ = await m(u, s(r(g)), {
|
|
2673
|
+
width: a(g, f) + 50,
|
|
2674
2674
|
classes: "markdown-node-label",
|
|
2675
2675
|
useHtmlLabels: h
|
|
2676
2676
|
}, f), v, y = 1;
|
|
2677
2677
|
if (h) {
|
|
2678
|
-
let e = _.children[0],
|
|
2678
|
+
let e = _.children[0], r = n(_);
|
|
2679
2679
|
y = e.innerHTML.split("<br>").length, e.innerHTML.includes("</math>") && (y += e.innerHTML.split("<mrow>").length - 1);
|
|
2680
|
-
let
|
|
2681
|
-
if (
|
|
2680
|
+
let i = e.getElementsByTagName("img");
|
|
2681
|
+
if (i) {
|
|
2682
2682
|
let e = g.replace(/<img[^>]*>/g, "").trim() === "";
|
|
2683
|
-
await Promise.all([...
|
|
2684
|
-
function
|
|
2685
|
-
if (
|
|
2686
|
-
let e = f.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize,
|
|
2687
|
-
|
|
2688
|
-
} else
|
|
2689
|
-
n
|
|
2683
|
+
await Promise.all([...i].map((n) => new Promise((r) => {
|
|
2684
|
+
function i() {
|
|
2685
|
+
if (n.style.display = "flex", n.style.flexDirection = "column", e) {
|
|
2686
|
+
let e = f.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize, t = parseInt(e, 10) * 5 + "px";
|
|
2687
|
+
n.style.minWidth = t, n.style.maxWidth = t;
|
|
2688
|
+
} else n.style.width = "100%";
|
|
2689
|
+
r(n);
|
|
2690
2690
|
}
|
|
2691
|
-
i
|
|
2692
|
-
|
|
2693
|
-
}),
|
|
2691
|
+
t(i, "setupImage"), setTimeout(() => {
|
|
2692
|
+
n.complete && i();
|
|
2693
|
+
}), n.addEventListener("error", i), n.addEventListener("load", i);
|
|
2694
2694
|
})));
|
|
2695
2695
|
}
|
|
2696
|
-
v = e.getBoundingClientRect(),
|
|
2696
|
+
v = e.getBoundingClientRect(), r.attr("width", v.width), r.attr("height", v.height);
|
|
2697
2697
|
} else {
|
|
2698
|
-
c.includes("font-weight: bolder") &&
|
|
2698
|
+
c.includes("font-weight: bolder") && n(_).selectAll("tspan").attr("font-weight", ""), y = _.children.length;
|
|
2699
2699
|
let e = _.children[0];
|
|
2700
2700
|
(_.textContent === "" || _.textContent.includes(">")) && (e.textContent = g[0] + g.substring(1).replaceAll(">", ">").replaceAll("<", "<").trim(), g[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), v = _.getBBox();
|
|
2701
2701
|
}
|
|
2702
2702
|
return u.attr("transform", "translate(0," + (-v.height / (2 * y) + o) + ")"), v.height;
|
|
2703
2703
|
}
|
|
2704
|
-
|
|
2704
|
+
t(Z, "addText");
|
|
2705
2705
|
async function xt(e, t) {
|
|
2706
|
-
let
|
|
2706
|
+
let r = c(), i = r.class.padding ?? 12, a = i, o = t.useHtmlLabels ?? l(r.htmlLabels) ?? !0, s = t;
|
|
2707
2707
|
s.annotations = s.annotations ?? [], s.members = s.members ?? [], s.methods = s.methods ?? [];
|
|
2708
|
-
let { shapeSvg: u, bbox: d } = await bt(e, t,
|
|
2708
|
+
let { shapeSvg: u, bbox: d } = await bt(e, t, r, o, a), { labelStyles: f, nodeStyles: p } = y(t);
|
|
2709
2709
|
t.labelStyle = f, t.cssStyles = s.styles || "";
|
|
2710
2710
|
let m = s.styles?.join(";") || p || "";
|
|
2711
2711
|
t.cssStyles ||= m.replaceAll("!important", "").split(";");
|
|
2712
|
-
let h = s.members.length === 0 && s.methods.length === 0 && !
|
|
2712
|
+
let h = s.members.length === 0 && s.methods.length === 0 && !r.class?.hideEmptyMembersBox, g = S.svg(u), _ = v(t, {});
|
|
2713
2713
|
t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
|
|
2714
2714
|
let b = d.width, x = d.height;
|
|
2715
|
-
s.members.length === 0 && s.methods.length === 0 ? x +=
|
|
2716
|
-
let C = -b / 2, w = -x / 2, E = g.rectangle(C -
|
|
2715
|
+
s.members.length === 0 && s.methods.length === 0 ? x += a : s.members.length > 0 && s.methods.length === 0 && (x += a * 2);
|
|
2716
|
+
let C = -b / 2, w = -x / 2, E = g.rectangle(C - i, w - i - (h ? i : s.members.length === 0 && s.methods.length === 0 ? -i / 2 : 0), b + 2 * i, x + 2 * i + (h ? i * 2 : s.members.length === 0 && s.methods.length === 0 ? -i : 0), _), D = u.insert(() => E, ":first-child");
|
|
2717
2717
|
D.attr("class", "basic label-container");
|
|
2718
2718
|
let O = D.node().getBBox();
|
|
2719
|
-
u.selectAll(".text").each((e, t,
|
|
2720
|
-
let
|
|
2719
|
+
u.selectAll(".text").each((e, t, r) => {
|
|
2720
|
+
let a = n(r[t]), c = a.attr("transform"), l = 0;
|
|
2721
2721
|
if (c) {
|
|
2722
2722
|
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(c);
|
|
2723
2723
|
e && (l = parseFloat(e[2]));
|
|
2724
2724
|
}
|
|
2725
|
-
let d = l + w +
|
|
2725
|
+
let d = l + w + i - (h ? i : s.members.length === 0 && s.methods.length === 0 ? -i / 2 : 0);
|
|
2726
2726
|
o || (d -= 4);
|
|
2727
2727
|
let f = C;
|
|
2728
|
-
(
|
|
2728
|
+
(a.attr("class").includes("label-group") || a.attr("class").includes("annotation-group")) && (f = -a.node()?.getBBox().width / 2 || 0, u.selectAll("text").each(function(e, t, n) {
|
|
2729
2729
|
window.getComputedStyle(n[t]).textAnchor === "middle" && (f = 0);
|
|
2730
|
-
})),
|
|
2730
|
+
})), a.attr("transform", `translate(${f}, ${d})`);
|
|
2731
2731
|
});
|
|
2732
|
-
let k = u.select(".annotation-group").node().getBBox().height - (h ?
|
|
2732
|
+
let k = u.select(".annotation-group").node().getBBox().height - (h ? i / 2 : 0) || 0, A = u.select(".label-group").node().getBBox().height - (h ? i / 2 : 0) || 0, j = u.select(".members-group").node().getBBox().height - (h ? i / 2 : 0) || 0;
|
|
2733
2733
|
if (s.members.length > 0 || s.methods.length > 0 || h) {
|
|
2734
|
-
let e = g.line(O.x, k + A + w +
|
|
2734
|
+
let e = g.line(O.x, k + A + w + i, O.x + O.width, k + A + w + i, _);
|
|
2735
2735
|
u.insert(() => e).attr("class", "divider").attr("style", m);
|
|
2736
2736
|
}
|
|
2737
2737
|
if (h || s.members.length > 0 || s.methods.length > 0) {
|
|
2738
|
-
let e = g.line(O.x, k + A + j + w +
|
|
2738
|
+
let e = g.line(O.x, k + A + j + w + a * 2 + i, O.x + O.width, k + A + j + w + i + a * 2, _);
|
|
2739
2739
|
u.insert(() => e).attr("class", "divider").attr("style", m);
|
|
2740
2740
|
}
|
|
2741
2741
|
if (s.look !== "handDrawn" && u.selectAll("path").attr("style", m), D.select(":nth-child(2)").attr("style", m), u.selectAll(".divider").select("path").attr("style", m), t.labelStyle ? u.selectAll("span").attr("style", t.labelStyle) : u.selectAll("span").attr("style", m), !o) {
|
|
@@ -2755,20 +2755,20 @@ async function xt(e, t) {
|
|
|
2755
2755
|
return W.rect(t, e);
|
|
2756
2756
|
}, u;
|
|
2757
2757
|
}
|
|
2758
|
-
|
|
2758
|
+
t(xt, "classBox");
|
|
2759
2759
|
async function St(e, t) {
|
|
2760
|
-
let { labelStyles:
|
|
2761
|
-
t.labelStyle =
|
|
2762
|
-
let
|
|
2763
|
-
u = s ? await Q(l, `<<${
|
|
2764
|
-
let d = u, f = await Q(l,
|
|
2760
|
+
let { labelStyles: r, nodeStyles: i } = y(t);
|
|
2761
|
+
t.labelStyle = r;
|
|
2762
|
+
let a = t, o = t, s = "verifyMethod" in t, c = E(t), l = e.insert("g").attr("class", c).attr("id", t.domId ?? t.id), u;
|
|
2763
|
+
u = s ? await Q(l, `<<${a.type}>>`, 0, t.labelStyle) : await Q(l, "<<Element>>", 0, t.labelStyle);
|
|
2764
|
+
let d = u, f = await Q(l, a.name, d, t.labelStyle + "; font-weight: bold;");
|
|
2765
2765
|
if (d += f + 20, s) {
|
|
2766
|
-
let e = await Q(l, `${
|
|
2766
|
+
let e = await Q(l, `${a.requirementId ? `ID: ${a.requirementId}` : ""}`, d, t.labelStyle);
|
|
2767
2767
|
d += e;
|
|
2768
|
-
let n = await Q(l, `${
|
|
2768
|
+
let n = await Q(l, `${a.text ? `Text: ${a.text}` : ""}`, d, t.labelStyle);
|
|
2769
2769
|
d += n;
|
|
2770
|
-
let r = await Q(l, `${
|
|
2771
|
-
d += r, await Q(l, `${
|
|
2770
|
+
let r = await Q(l, `${a.risk ? `Risk: ${a.risk}` : ""}`, d, t.labelStyle);
|
|
2771
|
+
d += r, await Q(l, `${a.verifyMethod ? `Verification: ${a.verifyMethod}` : ""}`, d, t.labelStyle);
|
|
2772
2772
|
} else {
|
|
2773
2773
|
let e = await Q(l, `${o.type ? `Type: ${o.type}` : ""}`, d, t.labelStyle);
|
|
2774
2774
|
d += e, await Q(l, `${o.docRef ? `Doc Ref: ${o.docRef}` : ""}`, d, t.labelStyle);
|
|
@@ -2776,33 +2776,33 @@ async function St(e, t) {
|
|
|
2776
2776
|
let p = (l.node()?.getBBox().width ?? 200) + 20, m = (l.node()?.getBBox().height ?? 200) + 20, h = -p / 2, g = -m / 2, _ = S.svg(l), b = v(t, {});
|
|
2777
2777
|
t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
|
|
2778
2778
|
let x = _.rectangle(h, g, p, m, b), C = l.insert(() => x, ":first-child");
|
|
2779
|
-
if (C.attr("class", "basic label-container").attr("style",
|
|
2780
|
-
let
|
|
2781
|
-
if (
|
|
2782
|
-
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(
|
|
2779
|
+
if (C.attr("class", "basic label-container").attr("style", i), l.selectAll(".label").each((e, t, r) => {
|
|
2780
|
+
let i = n(r[t]), a = i.attr("transform"), o = 0, s = 0;
|
|
2781
|
+
if (a) {
|
|
2782
|
+
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
|
|
2783
2783
|
e && (o = parseFloat(e[1]), s = parseFloat(e[2]));
|
|
2784
2784
|
}
|
|
2785
2785
|
let c = s - m / 2, l = h + 20 / 2;
|
|
2786
|
-
(t === 0 || t === 1) && (l = o),
|
|
2786
|
+
(t === 0 || t === 1) && (l = o), i.attr("transform", `translate(${l}, ${c + 20})`);
|
|
2787
2787
|
}), d > u + f + 20) {
|
|
2788
2788
|
let e = _.line(h, g + u + f + 20, h + p, g + u + f + 20, b);
|
|
2789
|
-
l.insert(() => e).attr("style",
|
|
2789
|
+
l.insert(() => e).attr("style", i);
|
|
2790
2790
|
}
|
|
2791
2791
|
return T(t, C), t.intersect = function(e) {
|
|
2792
2792
|
return W.rect(t, e);
|
|
2793
2793
|
}, l;
|
|
2794
2794
|
}
|
|
2795
|
-
|
|
2796
|
-
async function Q(
|
|
2797
|
-
if (
|
|
2798
|
-
let l =
|
|
2799
|
-
width:
|
|
2795
|
+
t(St, "requirementBox");
|
|
2796
|
+
async function Q(e, t, i, o = "") {
|
|
2797
|
+
if (t === "") return 0;
|
|
2798
|
+
let l = e.insert("g").attr("class", "label").attr("style", o), u = c(), d = u.htmlLabels ?? !0, f = await m(l, s(r(t)), {
|
|
2799
|
+
width: a(t, u) + 50,
|
|
2800
2800
|
classes: "markdown-node-label",
|
|
2801
2801
|
useHtmlLabels: d,
|
|
2802
2802
|
style: o
|
|
2803
2803
|
}, u), p;
|
|
2804
2804
|
if (d) {
|
|
2805
|
-
let e = f.children[0], t =
|
|
2805
|
+
let e = f.children[0], t = n(f);
|
|
2806
2806
|
p = e.getBoundingClientRect(), t.attr("width", p.width), t.attr("height", p.height);
|
|
2807
2807
|
} else {
|
|
2808
2808
|
let e = f.children[0];
|
|
@@ -2811,8 +2811,8 @@ async function Q(t, r, i, o = "") {
|
|
|
2811
2811
|
}
|
|
2812
2812
|
return l.attr("transform", `translate(${-p.width / 2},${-p.height / 2 + i})`), p.height;
|
|
2813
2813
|
}
|
|
2814
|
-
|
|
2815
|
-
var Ct = /* @__PURE__ */
|
|
2814
|
+
t(Q, "addText");
|
|
2815
|
+
var Ct = /* @__PURE__ */ t((e) => {
|
|
2816
2816
|
switch (e) {
|
|
2817
2817
|
case "Very High": return "red";
|
|
2818
2818
|
case "High": return "orange";
|
|
@@ -2857,11 +2857,11 @@ async function wt(e, t, { config: n }) {
|
|
|
2857
2857
|
return W.rect(t, e);
|
|
2858
2858
|
}, o;
|
|
2859
2859
|
}
|
|
2860
|
-
|
|
2861
|
-
async function Tt(
|
|
2862
|
-
let { labelStyles:
|
|
2863
|
-
n.labelStyle =
|
|
2864
|
-
let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await C(
|
|
2860
|
+
t(wt, "kanbanItem");
|
|
2861
|
+
async function Tt(t, n) {
|
|
2862
|
+
let { labelStyles: r, nodeStyles: a } = y(n);
|
|
2863
|
+
n.labelStyle = r;
|
|
2864
|
+
let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await C(t, n, E(n)), u = s.width + 10 * c, d = s.height + 8 * c, f = .15 * u, { cssStyles: p } = n, m = s.width + 20, h = s.height + 20, g = Math.max(u, m), _ = Math.max(d, h);
|
|
2865
2865
|
l.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`);
|
|
2866
2866
|
let b, x = `M0 0
|
|
2867
2867
|
a${f},${f} 1 0,0 ${g * .25},${-1 * _ * .1}
|
|
@@ -2883,20 +2883,20 @@ async function Tt(e, n) {
|
|
|
2883
2883
|
a${f},${f} 1 0,0 ${g * .1},${-1 * _ * .33}
|
|
2884
2884
|
H0 V0 Z`;
|
|
2885
2885
|
if (n.look === "handDrawn") {
|
|
2886
|
-
let e = S.svg(o),
|
|
2887
|
-
b = o.insert(() =>
|
|
2886
|
+
let e = S.svg(o), t = v(n, {}), r = e.path(x, t);
|
|
2887
|
+
b = o.insert(() => r, ":first-child"), b.attr("class", "basic label-container").attr("style", i(p));
|
|
2888
2888
|
} else b = o.insert("path", ":first-child").attr("class", "basic label-container").attr("style", a).attr("d", x);
|
|
2889
2889
|
return b.attr("transform", `translate(${-g / 2}, ${-_ / 2})`), T(n, b), n.calcIntersect = function(e, t) {
|
|
2890
2890
|
return W.rect(e, t);
|
|
2891
|
-
}, n.intersect = function(
|
|
2892
|
-
return
|
|
2891
|
+
}, n.intersect = function(t) {
|
|
2892
|
+
return e.info("Bang intersect", n, t), W.rect(n, t);
|
|
2893
2893
|
}, o;
|
|
2894
2894
|
}
|
|
2895
|
-
|
|
2896
|
-
async function Et(
|
|
2897
|
-
let { labelStyles:
|
|
2898
|
-
n.labelStyle =
|
|
2899
|
-
let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await C(
|
|
2895
|
+
t(Tt, "bang");
|
|
2896
|
+
async function Et(t, n) {
|
|
2897
|
+
let { labelStyles: r, nodeStyles: a } = y(n);
|
|
2898
|
+
n.labelStyle = r;
|
|
2899
|
+
let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await C(t, n, E(n)), u = s.width + 2 * c, d = s.height + 2 * c, f = .15 * u, p = .25 * u, m = .35 * u, h = .2 * u, { cssStyles: g } = n, _, b = `M0 0
|
|
2900
2900
|
a${f},${f} 0 0,1 ${u * .25},${-1 * u * .1}
|
|
2901
2901
|
a${m},${m} 1 0,1 ${u * .4},${-1 * u * .1}
|
|
2902
2902
|
a${p},${p} 1 0,1 ${u * .35},${u * .2}
|
|
@@ -2912,16 +2912,16 @@ async function Et(e, n) {
|
|
|
2912
2912
|
a${h},${h} 1 0,1 ${u * .1},${-1 * d * .65}
|
|
2913
2913
|
H0 V0 Z`;
|
|
2914
2914
|
if (n.look === "handDrawn") {
|
|
2915
|
-
let e = S.svg(o),
|
|
2916
|
-
_ = o.insert(() =>
|
|
2915
|
+
let e = S.svg(o), t = v(n, {}), r = e.path(b, t);
|
|
2916
|
+
_ = o.insert(() => r, ":first-child"), _.attr("class", "basic label-container").attr("style", i(g));
|
|
2917
2917
|
} else _ = o.insert("path", ":first-child").attr("class", "basic label-container").attr("style", a).attr("d", b);
|
|
2918
2918
|
return l.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`), _.attr("transform", `translate(${-u / 2}, ${-d / 2})`), T(n, _), n.calcIntersect = function(e, t) {
|
|
2919
2919
|
return W.rect(e, t);
|
|
2920
|
-
}, n.intersect = function(
|
|
2921
|
-
return
|
|
2920
|
+
}, n.intersect = function(t) {
|
|
2921
|
+
return e.info("Cloud intersect", n, t), W.rect(n, t);
|
|
2922
2922
|
}, o;
|
|
2923
2923
|
}
|
|
2924
|
-
|
|
2924
|
+
t(Et, "cloud");
|
|
2925
2925
|
async function Dt(e, t) {
|
|
2926
2926
|
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2927
2927
|
t.labelStyle = n;
|
|
@@ -2943,11 +2943,11 @@ async function Dt(e, t) {
|
|
|
2943
2943
|
return W.rect(t, e);
|
|
2944
2944
|
}, i;
|
|
2945
2945
|
}
|
|
2946
|
-
|
|
2946
|
+
t(Dt, "defaultMindmapNode");
|
|
2947
2947
|
async function Ot(e, t) {
|
|
2948
2948
|
return le(e, t, { padding: t.padding ?? 0 });
|
|
2949
2949
|
}
|
|
2950
|
-
|
|
2950
|
+
t(Ot, "mindmapCircle");
|
|
2951
2951
|
var kt = [
|
|
2952
2952
|
{
|
|
2953
2953
|
semanticName: "Process",
|
|
@@ -3377,7 +3377,7 @@ var kt = [
|
|
|
3377
3377
|
aliases: ["lined-document"],
|
|
3378
3378
|
handler: Ue
|
|
3379
3379
|
}
|
|
3380
|
-
], At = (/* @__PURE__ */
|
|
3380
|
+
], At = (/* @__PURE__ */ t(() => {
|
|
3381
3381
|
let e = [...Object.entries({
|
|
3382
3382
|
state: nt,
|
|
3383
3383
|
choice: ce,
|
|
@@ -3406,7 +3406,7 @@ var kt = [
|
|
|
3406
3406
|
function jt(e) {
|
|
3407
3407
|
return e in At;
|
|
3408
3408
|
}
|
|
3409
|
-
|
|
3409
|
+
t(jt, "isValidShape");
|
|
3410
3410
|
var $ = /* @__PURE__ */ new Map();
|
|
3411
3411
|
async function Mt(e, t, n) {
|
|
3412
3412
|
let r, i;
|
|
@@ -3419,16 +3419,16 @@ async function Mt(e, t, n) {
|
|
|
3419
3419
|
} else i = await a(e, t, n), r = i;
|
|
3420
3420
|
return t.tooltip && i.attr("title", t.tooltip), $.set(t.id, r), t.haveCallback && r.attr("class", r.attr("class") + " clickable"), r;
|
|
3421
3421
|
}
|
|
3422
|
-
|
|
3423
|
-
var Nt = /* @__PURE__ */
|
|
3422
|
+
t(Mt, "insertNode");
|
|
3423
|
+
var Nt = /* @__PURE__ */ t((e, t) => {
|
|
3424
3424
|
$.set(t.id, e);
|
|
3425
|
-
}, "setNodeElem"), Pt = /* @__PURE__ */
|
|
3425
|
+
}, "setNodeElem"), Pt = /* @__PURE__ */ t(() => {
|
|
3426
3426
|
$.clear();
|
|
3427
|
-
}, "clear"), Ft = /* @__PURE__ */
|
|
3428
|
-
let
|
|
3429
|
-
|
|
3430
|
-
let
|
|
3431
|
-
return
|
|
3427
|
+
}, "clear"), Ft = /* @__PURE__ */ t((t) => {
|
|
3428
|
+
let n = $.get(t.id);
|
|
3429
|
+
e.trace("Transforming node", t.diff, t, "translate(" + (t.x - t.width / 2 - 5) + ", " + t.width / 2 + ")");
|
|
3430
|
+
let r = t.diff || 0;
|
|
3431
|
+
return t.clusterNode ? n.attr("transform", "translate(" + (t.x + r - t.width / 2) + ", " + (t.y - t.height / 2 - 8) + ")") : n.attr("transform", "translate(" + t.x + ", " + t.y + ")"), r;
|
|
3432
3432
|
}, "positionNode");
|
|
3433
3433
|
//#endregion
|
|
3434
3434
|
export { Mt as a, Ft as c, I as i, Nt as l, Pt as n, jt as o, j as r, C as s, L as t, T as u };
|