@kong-ui-public/documentation 0.4.12 → 0.4.14
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/arc-DI9wV-Mn-_GgJI37p.js +86 -0
- package/dist/{astro-D4FIwVxr-CovDYZfT.js → astro-U6b0KI4d-Bfq8RcMV.js} +1 -1
- package/dist/{blockDiagram-6b2b5046-BabM1eIl-C85stHtj.js → blockDiagram-91b80b7a-D3OZBNEF-BXra-uP1.js} +24 -24
- package/dist/{c4Diagram-b947cdbb-BBGJ9ivn-Dwz3JGTI.js → c4Diagram-b2a90758-wyqGQ69Q-3S5U0W2q.js} +133 -132
- package/dist/channel-Brhzsu_o-C42tcZPD.js +5 -0
- package/dist/{classDiagram-35230388-CRYNduH8-BOSSyxwU.js → classDiagram-30eddba6-0OAjss5X-DDloSHap.js} +8 -7
- package/dist/{classDiagram-v2-412acd34-5HbyJrnL-ST64CPx5.js → classDiagram-v2-f2df5561-Dn89kA5N-W6p27IrP.js} +7 -7
- package/dist/{clone-BoeTe_OS-CjGEkx_F.js → clone-Bsggwgls-BzwAVRKa.js} +1 -1
- package/dist/{createText-423428c9-Q0HfccbL-DBcIXsnc.js → createText-6b48ae7d-c5hzPIcj-DS42dDY6.js} +2 -1
- package/dist/documentation.es.js +5 -5
- package/dist/documentation.umd.js +991 -720
- package/dist/{edges-d417c7a0-DEJA2PwU-c5o-9uno.js → edges-d32062c0-CGbRbizB-BNCq9bff.js} +28 -27
- package/dist/{erDiagram-0ea73325-C3DQ6B1e-DjAGdzcu.js → erDiagram-47591fe2-CyCEEu9x-BoCVITkJ.js} +38 -38
- package/dist/{flowDb-d35e309a-RvFFqjek-pyC_lUzm.js → flowDb-4b19a42f-wIq43fe7-D6eWU8wc.js} +45 -45
- package/dist/{flowDiagram-d949d7c1-Boa20b_n-BKdBxRnq.js → flowDiagram-5540d9b9-D8Ak_JQc-66jM_qDv.js} +317 -309
- package/dist/{flowDiagram-v2-49332944-BJtijxhz-BfL0l3kS.js → flowDiagram-v2-3b53844e-DxkVnD_T-DVByZPqp.js} +5 -5
- package/dist/{flowchart-elk-definition-27cc417a-BBD3LS9k-DhfRKjaQ.js → flowchart-elk-definition-5fe447d6-CUIdb-2U-rw1sP1Nb.js} +10626 -10624
- package/dist/{ganttDiagram-5c869e3b-CRDFjzTp-C3-yl36r.js → ganttDiagram-9a3bba1f-U28Z8glu-okJ1HHdc.js} +488 -477
- package/dist/{git-rebase-sR-yVH_J-D5M2oE9O.js → git-rebase-B7sc3yJp-BPxHM_r2.js} +1 -1
- package/dist/gitGraphDiagram-96e6b4ee-DTO3lH8N-1qRg2G2i.js +1264 -0
- package/dist/{graph-BIq67vWs-B7ta0ZdY.js → graph-Bc1n6qSP-D5FVfre_.js} +64 -64
- package/dist/{haml-BT5dFrjs-CmYUmNQ_.js → haml-DsuMo-J7-DWhF2QrW.js} +1 -1
- package/dist/{http-DSIFYUfg-BZm1KGvb.js → http-ClrjZLFz-gNFfL9hE.js} +1 -1
- package/dist/{index-_NcqxG2P.js → index-3vhKKQrV.js} +2771 -2689
- package/dist/{index-8fae9850-CaUboB89-KhmQqIkN.js → index-fc10efb0-B2L-sBu4-xOwI5vt1.js} +11 -11
- package/dist/{infoDiagram-db7b18fc-DKsewKnu-nKlnfk12.js → infoDiagram-bcd20f53-DTO3TTbR-DxLIdeSc.js} +12 -12
- package/dist/{journeyDiagram-d5636530-ClddNDmR-DXRHq-4M.js → journeyDiagram-4fe6b3dc-qVhc1UAl-_d--6Ls9.js} +42 -42
- package/dist/katex-BQC_klMa-CaeA20wX.js +11636 -0
- package/dist/{latex-QX-FNvxY-DfqkUAVR.js → latex-9g43iAzl-B3VseW3K.js} +1 -1
- package/dist/{layout-Cz0dAJah-BTgthZsZ.js → layout-DcWyZN_J-vui7Gviz.js} +132 -132
- package/dist/{line-BCVITS7s-Ckay3mGw.js → line-BeML9Stu-Dy9lL6FR.js} +1 -1
- package/dist/{linear-CLHAbj67-CRi7BpMp.js → linear-S-ccJMdE-6xfCU5AQ.js} +35 -35
- package/dist/{mindmap-definition-377f8f1f-BwEJ-DVg-DWk6Jo2n.js → mindmap-definition-f354de21-DH1Q4t1U-DzFbmWqo.js} +6647 -6414
- package/dist/{pieDiagram-b0208e96-Cyz2Kcfu-BKQLF9sW.js → pieDiagram-79897490-BNP6ubu_-6WJB20-7.js} +68 -68
- package/dist/{quadrantDiagram-0332be45-CDMkEQj0-B8KMwkcO.js → quadrantDiagram-62f64e94-BwUp7akV-DvMoXd98.js} +2 -2
- package/dist/{requirementDiagram-bf7890df-Jk3SQ-Q1-ub7Z0GPl.js → requirementDiagram-05bf5f74-N_qzJROT-CrkeOa_P.js} +30 -30
- package/dist/{rst-Bm1i8IkK-C9EaDq6g.js → rst-iTJmEY_6-AgWIzPqn.js} +2 -2
- package/dist/{ruby-CZZKXaz8-BxaDEkRP.js → ruby-3Bt2I2On--AixRnjJ.js} +1 -1
- package/dist/{sankeyDiagram-0acdec17-BJuIUJd_-BnkIVf8S.js → sankeyDiagram-97764748-bwaduY7g-VneUYt0y.js} +22 -22
- package/dist/{sequenceDiagram-c18d009d-B4IxGCEM-B3uFgxU_.js → sequenceDiagram-acc0e65c-Bk-fBLta-CsMH0Cqo.js} +917 -884
- package/dist/shellscript-DQ1J75ow-DQ1J75ow.js +7 -0
- package/dist/{shellsession-BIPXtZci-D6avbCwN.js → shellsession-btSM7PAE-lMmUmCMx.js} +1 -1
- package/dist/{stateDiagram-43596fc0-0xEMkbt_-BALY6uIB.js → stateDiagram-0ff1cf1a-Bi3BTd4c-qFbxEDNM.js} +5 -5
- package/dist/{stateDiagram-v2-2ead4f9c-DS4afpcC-B7o3rR3l.js → stateDiagram-v2-9a9d610d-IejNE6-r-bIvS4iK_.js} +12 -12
- package/dist/{styles-7383a064-C7WyH3qz-C_v2lpXJ.js → styles-3ed67cfa-BaFO0Ztt-yz8KrlaH.js} +140 -137
- package/dist/{styles-6860f46c-ZdhsT5S9-obFqRkzA.js → styles-991ebdfc-D4EpkGAf-B-Xwx8uG.js} +19 -19
- package/dist/{styles-b2c874b6-BFg-Nblp-DDESTBsS.js → styles-d20c7d72-DqCTX9VL-CceYqMjq.js} +24 -24
- package/dist/{svgDrawCommon-0ee1b4e9-CpOZq9bS-Cw8Tr_3J.js → svgDrawCommon-5ccd53ef-C-vBitUh-C3LZR4L9.js} +4 -4
- package/dist/{timeline-definition-d977decf-BqZwyTB6-C3j7tbKa.js → timeline-definition-fea2a41d-Bd7A9rUe-DzZgbnY-.js} +2 -2
- package/dist/{twig-B_Gr-ODl-Cl9Q0GWo.js → twig-Dcp9VbaI-FN48_KCA.js} +1 -1
- package/dist/{xychartDiagram-e50adddc-C1fuuOEQ-CF13knJk.js → xychartDiagram-ab372869-3O-Pt-l7-P2dDKl4d.js} +30 -30
- package/package.json +3 -3
- package/dist/arc-C2t0ExPw-CR_0vqRg.js +0 -86
- package/dist/channel-DXyvEer2-OyVZq8Xo.js +0 -5
- package/dist/gitGraphDiagram-b9d81de9-D1rNIGL0-BG2n_b9U.js +0 -1262
- package/dist/shellscript-CUUTQKn5-CUUTQKn5.js +0 -7
package/dist/{flowDiagram-d949d7c1-Boa20b_n-BKdBxRnq.js → flowDiagram-5540d9b9-D8Ak_JQc-66jM_qDv.js}
RENAMED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { X as
|
|
2
|
-
import { Z as
|
|
3
|
-
import { h as
|
|
4
|
-
import { e as Lt, N as
|
|
5
|
-
import {
|
|
6
|
-
import { P as
|
|
7
|
-
function
|
|
1
|
+
import { X as kt, j as P } from "./flowDb-4b19a42f-wIq43fe7-D6eWU8wc.js";
|
|
2
|
+
import { Z as St, E as S, m as K } from "./graph-Bc1n6qSP-D5FVfre_.js";
|
|
3
|
+
import { h as v, o as z, p as J, c as R, r as tt, j as et, l as U, q, t as W, u as _t } from "./index-3vhKKQrV.js";
|
|
4
|
+
import { e as Lt, N as At, V as It, A as Tt, L as C } from "./layout-DcWyZN_J-vui7Gviz.js";
|
|
5
|
+
import { w as Mt, h as Nt, t as rt, Z as Bt, e as T, p as at, u as A, b as nt, f as it } from "./styles-3ed67cfa-BaFO0Ztt-yz8KrlaH.js";
|
|
6
|
+
import { P as Et } from "./line-BeML9Stu-Dy9lL6FR.js";
|
|
7
|
+
function $t(r) {
|
|
8
8
|
if (!r.ok)
|
|
9
9
|
throw new Error(r.status + " " + r.statusText);
|
|
10
10
|
return r.text();
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return fetch(r, e).then(
|
|
12
|
+
function Ct(r, e) {
|
|
13
|
+
return fetch(r, e).then($t);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return (e, t) =>
|
|
15
|
+
function Dt(r) {
|
|
16
|
+
return (e, t) => Ct(e, t).then((a) => new DOMParser().parseFromString(a, r));
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
normal:
|
|
20
|
-
vee:
|
|
18
|
+
var Ut = Dt("image/svg+xml"), V = {
|
|
19
|
+
normal: Wt,
|
|
20
|
+
vee: Pt,
|
|
21
21
|
undirected: qt
|
|
22
22
|
};
|
|
23
|
-
function
|
|
24
|
-
|
|
23
|
+
function Rt(r) {
|
|
24
|
+
V = r;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Wt(r, e, t, a) {
|
|
27
27
|
var n = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), i = n.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
28
28
|
T(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Pt(r, e, t, a) {
|
|
31
31
|
var n = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), i = n.append("path").attr("d", "M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
32
32
|
T(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
|
|
33
33
|
}
|
|
@@ -35,17 +35,17 @@ function qt(r, e, t, a) {
|
|
|
35
35
|
var n = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), i = n.append("path").attr("d", "M 0 5 L 10 5").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
36
36
|
T(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function zt(r, e) {
|
|
39
39
|
var t = r;
|
|
40
40
|
return t.node().appendChild(e.label), T(t, e.labelStyle), t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
for (var t = r.append("text"), a =
|
|
42
|
+
function Vt(r, e) {
|
|
43
|
+
for (var t = r.append("text"), a = Xt(e.label).split(`
|
|
44
44
|
`), n = 0; n < a.length; n++)
|
|
45
45
|
t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(a[n]);
|
|
46
46
|
return T(t, e.labelStyle), t;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Xt(r) {
|
|
49
49
|
for (var e = "", t = !1, a, n = 0; n < r.length; ++n)
|
|
50
50
|
if (a = r[n], t) {
|
|
51
51
|
switch (a) {
|
|
@@ -63,7 +63,7 @@ function zt(r) {
|
|
|
63
63
|
}
|
|
64
64
|
function G(r, e, t) {
|
|
65
65
|
var a = e.label, n = r.append("g");
|
|
66
|
-
e.labelType === "svg" ?
|
|
66
|
+
e.labelType === "svg" ? zt(n, e) : typeof a != "string" || e.labelType === "html" ? rt(n, e) : Vt(n, e);
|
|
67
67
|
var i = n.node().getBBox(), s;
|
|
68
68
|
switch (t) {
|
|
69
69
|
case "top":
|
|
@@ -77,152 +77,152 @@ function G(r, e, t) {
|
|
|
77
77
|
}
|
|
78
78
|
return n.attr("transform", "translate(" + -i.width / 2 + "," + s + ")"), n;
|
|
79
79
|
}
|
|
80
|
-
var
|
|
80
|
+
var X = function(r, e) {
|
|
81
81
|
var t = e.nodes().filter(function(i) {
|
|
82
|
-
return
|
|
82
|
+
return at(e, i);
|
|
83
83
|
}), a = r.selectAll("g.cluster").data(t, function(i) {
|
|
84
84
|
return i;
|
|
85
85
|
});
|
|
86
|
-
|
|
86
|
+
A(a.exit(), e).style("opacity", 0).remove();
|
|
87
87
|
var n = a.enter().append("g").attr("class", "cluster").attr("id", function(i) {
|
|
88
88
|
var s = e.node(i);
|
|
89
89
|
return s.id;
|
|
90
90
|
}).style("opacity", 0).each(function(i) {
|
|
91
|
-
var s = e.node(i), o =
|
|
92
|
-
|
|
93
|
-
var
|
|
94
|
-
G(
|
|
91
|
+
var s = e.node(i), o = v(this);
|
|
92
|
+
v(this).append("rect");
|
|
93
|
+
var d = o.append("g").attr("class", "label");
|
|
94
|
+
G(d, s, s.clusterLabelPos);
|
|
95
95
|
});
|
|
96
|
-
return a = a.merge(n), a =
|
|
97
|
-
var s = e.node(i), o =
|
|
96
|
+
return a = a.merge(n), a = A(a, e).style("opacity", 1), a.selectAll("rect").each(function(i) {
|
|
97
|
+
var s = e.node(i), o = v(this);
|
|
98
98
|
T(o, s.style);
|
|
99
99
|
}), a;
|
|
100
100
|
};
|
|
101
|
-
function
|
|
102
|
-
|
|
101
|
+
function jt(r) {
|
|
102
|
+
X = r;
|
|
103
103
|
}
|
|
104
|
-
let
|
|
104
|
+
let j = function(r, e) {
|
|
105
105
|
var t = r.selectAll("g.edgeLabel").data(e.edges(), function(n) {
|
|
106
|
-
return
|
|
106
|
+
return nt(n);
|
|
107
107
|
}).classed("update", !0);
|
|
108
108
|
t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(n) {
|
|
109
|
-
var i =
|
|
109
|
+
var i = v(this);
|
|
110
110
|
i.select(".label").remove();
|
|
111
|
-
var s = e.edge(n), o = G(i, e.edge(n), 0).classed("label", !0),
|
|
112
|
-
s.labelId && o.attr("id", s.labelId),
|
|
111
|
+
var s = e.edge(n), o = G(i, e.edge(n), 0).classed("label", !0), d = o.node().getBBox();
|
|
112
|
+
s.labelId && o.attr("id", s.labelId), S(s, "width") || (s.width = d.width), S(s, "height") || (s.height = d.height);
|
|
113
113
|
});
|
|
114
114
|
var a;
|
|
115
|
-
return t.exit ? a = t.exit() : a = t.selectAll(null),
|
|
115
|
+
return t.exit ? a = t.exit() : a = t.selectAll(null), A(a, e).style("opacity", 0).remove(), t;
|
|
116
116
|
};
|
|
117
|
-
function
|
|
118
|
-
|
|
117
|
+
function Ot(r) {
|
|
118
|
+
j = r;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Z(r, e) {
|
|
121
121
|
return r.intersect(e);
|
|
122
122
|
}
|
|
123
|
-
var
|
|
123
|
+
var O = function(r, e, t) {
|
|
124
124
|
var a = r.selectAll("g.edgePath").data(e.edges(), function(s) {
|
|
125
|
-
return
|
|
126
|
-
}).classed("update", !0), n =
|
|
125
|
+
return nt(s);
|
|
126
|
+
}).classed("update", !0), n = Zt(a, e);
|
|
127
127
|
Qt(a, e);
|
|
128
128
|
var i = a.merge !== void 0 ? a.merge(n) : a;
|
|
129
|
-
return
|
|
130
|
-
var o =
|
|
131
|
-
|
|
129
|
+
return A(i, e).style("opacity", 1), i.each(function(s) {
|
|
130
|
+
var o = v(this), d = e.edge(s);
|
|
131
|
+
d.elem = this, d.id && o.attr("id", d.id), it(
|
|
132
132
|
o,
|
|
133
|
-
|
|
133
|
+
d.class,
|
|
134
134
|
(o.classed("update") ? "update " : "") + "edgePath"
|
|
135
135
|
);
|
|
136
136
|
}), i.selectAll("path.path").each(function(s) {
|
|
137
137
|
var o = e.edge(s);
|
|
138
138
|
o.arrowheadId = Lt("arrowhead");
|
|
139
|
-
var
|
|
139
|
+
var d = v(this).attr("marker-end", function() {
|
|
140
140
|
return "url(" + Yt(location.href, o.arrowheadId) + ")";
|
|
141
141
|
}).style("fill", "none");
|
|
142
|
-
|
|
143
|
-
return
|
|
144
|
-
}), T(
|
|
142
|
+
A(d, e).attr("d", function(u) {
|
|
143
|
+
return Gt(e, u);
|
|
144
|
+
}), T(d, o.style);
|
|
145
145
|
}), i.selectAll("defs *").remove(), i.selectAll("defs").each(function(s) {
|
|
146
|
-
var o = e.edge(s),
|
|
147
|
-
|
|
146
|
+
var o = e.edge(s), d = t[o.arrowhead];
|
|
147
|
+
d(v(this), o.arrowheadId, o, "arrowhead");
|
|
148
148
|
}), i;
|
|
149
149
|
};
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function Ht(r) {
|
|
151
|
+
O = r;
|
|
152
152
|
}
|
|
153
153
|
function Yt(r, e) {
|
|
154
154
|
var t = r.split("#")[0];
|
|
155
155
|
return t + "#" + e;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Gt(r, e) {
|
|
158
158
|
var t = r.edge(e), a = r.node(e.v), n = r.node(e.w), i = t.points.slice(1, t.points.length - 1);
|
|
159
|
-
return i.unshift(
|
|
159
|
+
return i.unshift(Z(a, i[0])), i.push(Z(n, i[i.length - 1])), st(t, i);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
var t = (
|
|
161
|
+
function st(r, e) {
|
|
162
|
+
var t = (Et || Ut.line)().x(function(a) {
|
|
163
163
|
return a.x;
|
|
164
164
|
}).y(function(a) {
|
|
165
165
|
return a.y;
|
|
166
166
|
});
|
|
167
167
|
return (t.curve || t.interpolate)(r.curve), t(e);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ft(r) {
|
|
170
170
|
var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
|
|
171
171
|
return { x: t.e, y: t.f };
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Zt(r, e) {
|
|
174
174
|
var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
|
|
175
175
|
return t.append("path").attr("class", "path").attr("d", function(a) {
|
|
176
|
-
var n = e.edge(a), i = e.node(a.v).elem, s =
|
|
177
|
-
return
|
|
176
|
+
var n = e.edge(a), i = e.node(a.v).elem, s = At(n.points.length).map(function() {
|
|
177
|
+
return Ft(i);
|
|
178
178
|
});
|
|
179
|
-
return
|
|
179
|
+
return st(n, s);
|
|
180
180
|
}), t.append("defs"), t;
|
|
181
181
|
}
|
|
182
182
|
function Qt(r, e) {
|
|
183
183
|
var t = r.exit();
|
|
184
|
-
|
|
184
|
+
A(t, e).style("opacity", 0).remove();
|
|
185
185
|
}
|
|
186
|
-
var
|
|
186
|
+
var H = function(r, e, t) {
|
|
187
187
|
var a = e.nodes().filter(function(s) {
|
|
188
|
-
return !
|
|
188
|
+
return !at(e, s);
|
|
189
189
|
}), n = r.selectAll("g.node").data(a, function(s) {
|
|
190
190
|
return s;
|
|
191
191
|
}).classed("update", !0);
|
|
192
192
|
n.exit().remove(), n.enter().append("g").attr("class", "node").style("opacity", 0), n = r.selectAll("g.node"), n.each(function(s) {
|
|
193
|
-
var o = e.node(s),
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
var o = e.node(s), d = v(this);
|
|
194
|
+
it(
|
|
195
|
+
d,
|
|
196
196
|
o.class,
|
|
197
|
-
(
|
|
198
|
-
),
|
|
199
|
-
var
|
|
200
|
-
o.elem = this, o.id &&
|
|
197
|
+
(d.classed("update") ? "update " : "") + "node"
|
|
198
|
+
), d.select("g.label").remove();
|
|
199
|
+
var u = d.append("g").attr("class", "label"), l = G(u, o), g = t[o.shape], c = It(l.node().getBBox(), "width", "height");
|
|
200
|
+
o.elem = this, o.id && d.attr("id", o.id), o.labelId && u.attr("id", o.labelId), S(o, "width") && (c.width = o.width), S(o, "height") && (c.height = o.height), c.width += o.paddingLeft + o.paddingRight, c.height += o.paddingTop + o.paddingBottom, u.attr(
|
|
201
201
|
"transform",
|
|
202
202
|
"translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
|
|
203
203
|
);
|
|
204
|
-
var h =
|
|
204
|
+
var h = v(this);
|
|
205
205
|
h.select(".label-container").remove();
|
|
206
|
-
var p = g(h,
|
|
206
|
+
var p = g(h, c, o).classed("label-container", !0);
|
|
207
207
|
T(p, o.style);
|
|
208
|
-
var
|
|
209
|
-
o.width =
|
|
208
|
+
var w = p.node().getBBox();
|
|
209
|
+
o.width = w.width, o.height = w.height;
|
|
210
210
|
});
|
|
211
211
|
var i;
|
|
212
|
-
return n.exit ? i = n.exit() : i = n.selectAll(null),
|
|
212
|
+
return n.exit ? i = n.exit() : i = n.selectAll(null), A(i, e).style("opacity", 0).remove(), n;
|
|
213
213
|
};
|
|
214
|
-
function
|
|
215
|
-
|
|
214
|
+
function Kt(r) {
|
|
215
|
+
H = r;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Jt(r, e) {
|
|
218
218
|
var t = r.filter(function() {
|
|
219
|
-
return !
|
|
219
|
+
return !v(this).classed("update");
|
|
220
220
|
});
|
|
221
221
|
function a(n) {
|
|
222
222
|
var i = e.node(n);
|
|
223
223
|
return "translate(" + i.x + "," + i.y + ")";
|
|
224
224
|
}
|
|
225
|
-
t.attr("transform", a),
|
|
225
|
+
t.attr("transform", a), A(r, e).style("opacity", 1).attr("transform", a), A(t.selectAll("rect"), e).attr("width", function(n) {
|
|
226
226
|
return e.node(n).width;
|
|
227
227
|
}).attr("height", function(n) {
|
|
228
228
|
return e.node(n).height;
|
|
@@ -234,41 +234,41 @@ function Kt(r, e) {
|
|
|
234
234
|
return -i.height / 2;
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function te(r, e) {
|
|
238
238
|
var t = r.filter(function() {
|
|
239
|
-
return !
|
|
239
|
+
return !v(this).classed("update");
|
|
240
240
|
});
|
|
241
241
|
function a(n) {
|
|
242
242
|
var i = e.edge(n);
|
|
243
|
-
return
|
|
243
|
+
return S(i, "x") ? "translate(" + i.x + "," + i.y + ")" : "";
|
|
244
244
|
}
|
|
245
|
-
t.attr("transform", a),
|
|
245
|
+
t.attr("transform", a), A(r, e).style("opacity", 1).attr("transform", a);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function ee(r, e) {
|
|
248
248
|
var t = r.filter(function() {
|
|
249
|
-
return !
|
|
249
|
+
return !v(this).classed("update");
|
|
250
250
|
});
|
|
251
251
|
function a(n) {
|
|
252
252
|
var i = e.node(n);
|
|
253
253
|
return "translate(" + i.x + "," + i.y + ")";
|
|
254
254
|
}
|
|
255
|
-
t.attr("transform", a),
|
|
255
|
+
t.attr("transform", a), A(r, e).style("opacity", 1).attr("transform", a);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
var n = r.x, i = r.y, s = n - a.x, o = i - a.y,
|
|
259
|
-
a.x < n && (
|
|
260
|
-
var
|
|
261
|
-
return a.y < i && (
|
|
257
|
+
function ot(r, e, t, a) {
|
|
258
|
+
var n = r.x, i = r.y, s = n - a.x, o = i - a.y, d = Math.sqrt(e * e * o * o + t * t * s * s), u = Math.abs(e * t * s / d);
|
|
259
|
+
a.x < n && (u = -u);
|
|
260
|
+
var l = Math.abs(e * t * o / d);
|
|
261
|
+
return a.y < i && (l = -l), { x: n + u, y: i + l };
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
263
|
+
function re(r, e, t) {
|
|
264
|
+
return ot(r, e, e, t);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
var n, i, s, o,
|
|
268
|
-
if (n = e.y - r.y, s = r.x - e.x,
|
|
269
|
-
return
|
|
266
|
+
function ae(r, e, t, a) {
|
|
267
|
+
var n, i, s, o, d, u, l, g, c, h, p, w, f, x, k;
|
|
268
|
+
if (n = e.y - r.y, s = r.x - e.x, d = e.x * r.y - r.x * e.y, c = n * t.x + s * t.y + d, h = n * a.x + s * a.y + d, !(c !== 0 && h !== 0 && Q(c, h)) && (i = a.y - t.y, o = t.x - a.x, u = a.x * t.y - t.x * a.y, l = i * r.x + o * r.y + u, g = i * e.x + o * e.y + u, !(l !== 0 && g !== 0 && Q(l, g)) && (p = n * o - i * s, p !== 0)))
|
|
269
|
+
return w = Math.abs(p / 2), f = s * u - o * d, x = f < 0 ? (f - w) / p : (f + w) / p, f = i * d - n * u, k = f < 0 ? (f - w) / p : (f + w) / p, { x, y: k };
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Q(r, e) {
|
|
272
272
|
return r * e > 0;
|
|
273
273
|
}
|
|
274
274
|
function I(r, e, t) {
|
|
@@ -276,52 +276,52 @@ function I(r, e, t) {
|
|
|
276
276
|
e.forEach(function(p) {
|
|
277
277
|
s = Math.min(s, p.x), o = Math.min(o, p.y);
|
|
278
278
|
});
|
|
279
|
-
for (var
|
|
280
|
-
var g = e[
|
|
279
|
+
for (var d = a - r.width / 2 - s, u = n - r.height / 2 - o, l = 0; l < e.length; l++) {
|
|
280
|
+
var g = e[l], c = e[l < e.length - 1 ? l + 1 : 0], h = ae(
|
|
281
281
|
r,
|
|
282
282
|
t,
|
|
283
|
-
{ x:
|
|
284
|
-
{ x:
|
|
283
|
+
{ x: d + g.x, y: u + g.y },
|
|
284
|
+
{ x: d + c.x, y: u + c.y }
|
|
285
285
|
);
|
|
286
286
|
h && i.push(h);
|
|
287
287
|
}
|
|
288
|
-
return i.length ? (i.length > 1 && i.sort(function(p,
|
|
289
|
-
var
|
|
290
|
-
return
|
|
288
|
+
return i.length ? (i.length > 1 && i.sort(function(p, w) {
|
|
289
|
+
var f = p.x - t.x, x = p.y - t.y, k = Math.sqrt(f * f + x * x), N = w.x - t.x, _ = w.y - t.y, y = Math.sqrt(N * N + _ * _);
|
|
290
|
+
return k < y ? -1 : k === y ? 0 : 1;
|
|
291
291
|
}), i[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
|
|
292
292
|
}
|
|
293
293
|
function F(r, e) {
|
|
294
|
-
var t = r.x, a = r.y, n = e.x - t, i = e.y - a, s = r.width / 2, o = r.height / 2,
|
|
295
|
-
return Math.abs(i) * s > Math.abs(n) * o ? (i < 0 && (o = -o),
|
|
294
|
+
var t = r.x, a = r.y, n = e.x - t, i = e.y - a, s = r.width / 2, o = r.height / 2, d, u;
|
|
295
|
+
return Math.abs(i) * s > Math.abs(n) * o ? (i < 0 && (o = -o), d = i === 0 ? 0 : o * n / i, u = o) : (n < 0 && (s = -s), d = s, u = n === 0 ? 0 : s * i / n), { x: t + d, y: a + u };
|
|
296
296
|
}
|
|
297
297
|
var Y = {
|
|
298
|
-
rect:
|
|
299
|
-
ellipse:
|
|
300
|
-
circle:
|
|
301
|
-
diamond:
|
|
298
|
+
rect: ie,
|
|
299
|
+
ellipse: se,
|
|
300
|
+
circle: oe,
|
|
301
|
+
diamond: le
|
|
302
302
|
};
|
|
303
|
-
function
|
|
303
|
+
function ne(r) {
|
|
304
304
|
Y = r;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ie(r, e, t) {
|
|
307
307
|
var a = r.insert("rect", ":first-child").attr("rx", t.rx).attr("ry", t.ry).attr("x", -e.width / 2).attr("y", -e.height / 2).attr("width", e.width).attr("height", e.height);
|
|
308
308
|
return t.intersect = function(n) {
|
|
309
309
|
return F(t, n);
|
|
310
310
|
}, a;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function se(r, e, t) {
|
|
313
313
|
var a = e.width / 2, n = e.height / 2, i = r.insert("ellipse", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("rx", a).attr("ry", n);
|
|
314
314
|
return t.intersect = function(s) {
|
|
315
|
-
return
|
|
315
|
+
return ot(t, a, n, s);
|
|
316
316
|
}, i;
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function oe(r, e, t) {
|
|
319
319
|
var a = Math.max(e.width, e.height) / 2, n = r.insert("circle", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("r", a);
|
|
320
320
|
return t.intersect = function(i) {
|
|
321
|
-
return
|
|
321
|
+
return re(t, a, i);
|
|
322
322
|
}, n;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function le(r, e, t) {
|
|
325
325
|
var a = e.width * Math.SQRT2 / 2, n = e.height * Math.SQRT2 / 2, i = [
|
|
326
326
|
{ x: 0, y: -n },
|
|
327
327
|
{ x: -a, y: 0 },
|
|
@@ -337,29 +337,29 @@ function oe(r, e, t) {
|
|
|
337
337
|
return I(t, i, o);
|
|
338
338
|
}, s;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function de() {
|
|
341
341
|
var r = function(e, t) {
|
|
342
|
-
|
|
343
|
-
var a = D(e, "output"), n = D(a, "clusters"), i = D(a, "edgePaths"), s =
|
|
344
|
-
|
|
345
|
-
var
|
|
346
|
-
|
|
342
|
+
ue(t);
|
|
343
|
+
var a = D(e, "output"), n = D(a, "clusters"), i = D(a, "edgePaths"), s = j(D(a, "edgeLabels"), t), o = H(D(a, "nodes"), t, Y);
|
|
344
|
+
Tt(t), ee(o, t), te(s, t), O(i, t, V);
|
|
345
|
+
var d = X(n, t);
|
|
346
|
+
Jt(d, t), fe(t);
|
|
347
347
|
};
|
|
348
348
|
return r.createNodes = function(e) {
|
|
349
|
-
return arguments.length ? (
|
|
349
|
+
return arguments.length ? (Kt(e), r) : H;
|
|
350
350
|
}, r.createClusters = function(e) {
|
|
351
|
-
return arguments.length ? (
|
|
351
|
+
return arguments.length ? (jt(e), r) : X;
|
|
352
352
|
}, r.createEdgeLabels = function(e) {
|
|
353
|
-
return arguments.length ? (
|
|
353
|
+
return arguments.length ? (Ot(e), r) : j;
|
|
354
354
|
}, r.createEdgePaths = function(e) {
|
|
355
|
-
return arguments.length ? (
|
|
355
|
+
return arguments.length ? (Ht(e), r) : O;
|
|
356
356
|
}, r.shapes = function(e) {
|
|
357
|
-
return arguments.length ? (
|
|
357
|
+
return arguments.length ? (ne(e), r) : Y;
|
|
358
358
|
}, r.arrows = function(e) {
|
|
359
|
-
return arguments.length ? (
|
|
359
|
+
return arguments.length ? (Rt(e), r) : V;
|
|
360
360
|
}, r;
|
|
361
361
|
}
|
|
362
|
-
var
|
|
362
|
+
var ce = {
|
|
363
363
|
paddingLeft: 10,
|
|
364
364
|
paddingRight: 10,
|
|
365
365
|
paddingTop: 10,
|
|
@@ -367,54 +367,54 @@ var de = {
|
|
|
367
367
|
rx: 0,
|
|
368
368
|
ry: 0,
|
|
369
369
|
shape: "rect"
|
|
370
|
-
},
|
|
370
|
+
}, he = {
|
|
371
371
|
arrowhead: "normal",
|
|
372
|
-
curve:
|
|
372
|
+
curve: W
|
|
373
373
|
};
|
|
374
|
-
function
|
|
374
|
+
function ue(r) {
|
|
375
375
|
r.nodes().forEach(function(e) {
|
|
376
376
|
var t = r.node(e);
|
|
377
|
-
!
|
|
377
|
+
!S(t, "label") && !r.children(e).length && (t.label = e), S(t, "paddingX") && C(t, {
|
|
378
378
|
paddingLeft: t.paddingX,
|
|
379
379
|
paddingRight: t.paddingX
|
|
380
|
-
}),
|
|
380
|
+
}), S(t, "paddingY") && C(t, {
|
|
381
381
|
paddingTop: t.paddingY,
|
|
382
382
|
paddingBottom: t.paddingY
|
|
383
|
-
}),
|
|
383
|
+
}), S(t, "padding") && C(t, {
|
|
384
384
|
paddingLeft: t.padding,
|
|
385
385
|
paddingRight: t.padding,
|
|
386
386
|
paddingTop: t.padding,
|
|
387
387
|
paddingBottom: t.padding
|
|
388
|
-
}), C(t,
|
|
388
|
+
}), C(t, ce), K(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(a) {
|
|
389
389
|
t[a] = Number(t[a]);
|
|
390
|
-
}),
|
|
390
|
+
}), S(t, "width") && (t._prevWidth = t.width), S(t, "height") && (t._prevHeight = t.height);
|
|
391
391
|
}), r.edges().forEach(function(e) {
|
|
392
392
|
var t = r.edge(e);
|
|
393
|
-
|
|
393
|
+
S(t, "label") || (t.label = ""), C(t, he);
|
|
394
394
|
});
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function fe(r) {
|
|
397
397
|
K(r.nodes(), function(e) {
|
|
398
398
|
var t = r.node(e);
|
|
399
|
-
|
|
399
|
+
S(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, S(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
function D(r, e) {
|
|
403
403
|
var t = r.select("g." + e);
|
|
404
404
|
return t.empty() && (t = r.append("g").attr("class", e)), t;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function lt(r, e, t) {
|
|
407
407
|
const a = e.width, n = e.height, i = (a + n) * 0.9, s = [
|
|
408
408
|
{ x: i / 2, y: 0 },
|
|
409
409
|
{ x: i, y: -i / 2 },
|
|
410
410
|
{ x: i / 2, y: -i },
|
|
411
411
|
{ x: 0, y: -i / 2 }
|
|
412
|
-
], o =
|
|
413
|
-
return t.intersect = function(
|
|
414
|
-
return I(t, s,
|
|
412
|
+
], o = M(r, i, i, s);
|
|
413
|
+
return t.intersect = function(d) {
|
|
414
|
+
return I(t, s, d);
|
|
415
415
|
}, o;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function dt(r, e, t) {
|
|
418
418
|
const a = e.height, n = a / 4, i = e.width + 2 * n, s = [
|
|
419
419
|
{ x: n, y: 0 },
|
|
420
420
|
{ x: i - n, y: 0 },
|
|
@@ -422,86 +422,86 @@ function lt(r, e, t) {
|
|
|
422
422
|
{ x: i - n, y: -a },
|
|
423
423
|
{ x: n, y: -a },
|
|
424
424
|
{ x: 0, y: -a / 2 }
|
|
425
|
-
], o =
|
|
426
|
-
return t.intersect = function(
|
|
427
|
-
return I(t, s,
|
|
425
|
+
], o = M(r, i, a, s);
|
|
426
|
+
return t.intersect = function(d) {
|
|
427
|
+
return I(t, s, d);
|
|
428
428
|
}, o;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function ct(r, e, t) {
|
|
431
431
|
const a = e.width, n = e.height, i = [
|
|
432
432
|
{ x: -n / 2, y: 0 },
|
|
433
433
|
{ x: a, y: 0 },
|
|
434
434
|
{ x: a, y: -n },
|
|
435
435
|
{ x: -n / 2, y: -n },
|
|
436
436
|
{ x: 0, y: -n / 2 }
|
|
437
|
-
], s =
|
|
437
|
+
], s = M(r, a, n, i);
|
|
438
438
|
return t.intersect = function(o) {
|
|
439
439
|
return I(t, i, o);
|
|
440
440
|
}, s;
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function ht(r, e, t) {
|
|
443
443
|
const a = e.width, n = e.height, i = [
|
|
444
444
|
{ x: -2 * n / 6, y: 0 },
|
|
445
445
|
{ x: a - n / 6, y: 0 },
|
|
446
446
|
{ x: a + 2 * n / 6, y: -n },
|
|
447
447
|
{ x: n / 6, y: -n }
|
|
448
|
-
], s =
|
|
448
|
+
], s = M(r, a, n, i);
|
|
449
449
|
return t.intersect = function(o) {
|
|
450
450
|
return I(t, i, o);
|
|
451
451
|
}, s;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function ut(r, e, t) {
|
|
454
454
|
const a = e.width, n = e.height, i = [
|
|
455
455
|
{ x: 2 * n / 6, y: 0 },
|
|
456
456
|
{ x: a + n / 6, y: 0 },
|
|
457
457
|
{ x: a - 2 * n / 6, y: -n },
|
|
458
458
|
{ x: -n / 6, y: -n }
|
|
459
|
-
], s =
|
|
459
|
+
], s = M(r, a, n, i);
|
|
460
460
|
return t.intersect = function(o) {
|
|
461
461
|
return I(t, i, o);
|
|
462
462
|
}, s;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function ft(r, e, t) {
|
|
465
465
|
const a = e.width, n = e.height, i = [
|
|
466
466
|
{ x: -2 * n / 6, y: 0 },
|
|
467
467
|
{ x: a + 2 * n / 6, y: 0 },
|
|
468
468
|
{ x: a - n / 6, y: -n },
|
|
469
469
|
{ x: n / 6, y: -n }
|
|
470
|
-
], s =
|
|
470
|
+
], s = M(r, a, n, i);
|
|
471
471
|
return t.intersect = function(o) {
|
|
472
472
|
return I(t, i, o);
|
|
473
473
|
}, s;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function pt(r, e, t) {
|
|
476
476
|
const a = e.width, n = e.height, i = [
|
|
477
477
|
{ x: n / 6, y: 0 },
|
|
478
478
|
{ x: a - n / 6, y: 0 },
|
|
479
479
|
{ x: a + 2 * n / 6, y: -n },
|
|
480
480
|
{ x: -2 * n / 6, y: -n }
|
|
481
|
-
], s =
|
|
481
|
+
], s = M(r, a, n, i);
|
|
482
482
|
return t.intersect = function(o) {
|
|
483
483
|
return I(t, i, o);
|
|
484
484
|
}, s;
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function gt(r, e, t) {
|
|
487
487
|
const a = e.width, n = e.height, i = [
|
|
488
488
|
{ x: 0, y: 0 },
|
|
489
489
|
{ x: a + n / 2, y: 0 },
|
|
490
490
|
{ x: a, y: -n / 2 },
|
|
491
491
|
{ x: a + n / 2, y: -n },
|
|
492
492
|
{ x: 0, y: -n }
|
|
493
|
-
], s =
|
|
493
|
+
], s = M(r, a, n, i);
|
|
494
494
|
return t.intersect = function(o) {
|
|
495
495
|
return I(t, i, o);
|
|
496
496
|
}, s;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function yt(r, e, t) {
|
|
499
499
|
const a = e.height, n = e.width + a / 4, i = r.insert("rect", ":first-child").attr("rx", a / 2).attr("ry", a / 2).attr("x", -n / 2).attr("y", -a / 2).attr("width", n).attr("height", a);
|
|
500
500
|
return t.intersect = function(s) {
|
|
501
501
|
return F(t, s);
|
|
502
502
|
}, i;
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function xt(r, e, t) {
|
|
505
505
|
const a = e.width, n = e.height, i = [
|
|
506
506
|
{ x: 0, y: 0 },
|
|
507
507
|
{ x: a, y: 0 },
|
|
@@ -513,29 +513,29 @@ function yt(r, e, t) {
|
|
|
513
513
|
{ x: a + 8, y: -n },
|
|
514
514
|
{ x: -8, y: -n },
|
|
515
515
|
{ x: -8, y: 0 }
|
|
516
|
-
], s =
|
|
516
|
+
], s = M(r, a, n, i);
|
|
517
517
|
return t.intersect = function(o) {
|
|
518
518
|
return I(t, i, o);
|
|
519
519
|
}, s;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
const a = e.width, n = a / 2, i = n / (2.5 + a / 50), s = e.height + i, o = "M 0," + i + " a " + n + "," + i + " 0,0,0 " + a + " 0 a " + n + "," + i + " 0,0,0 " + -a + " 0 l 0," + s + " a " + n + "," + i + " 0,0,0 " + a + " 0 l 0," + -s,
|
|
523
|
-
return t.intersect = function(
|
|
524
|
-
const
|
|
525
|
-
if (n != 0 && (Math.abs(g) < t.width / 2 || Math.abs(g) == t.width / 2 && Math.abs(
|
|
526
|
-
let
|
|
527
|
-
|
|
521
|
+
function wt(r, e, t) {
|
|
522
|
+
const a = e.width, n = a / 2, i = n / (2.5 + a / 50), s = e.height + i, o = "M 0," + i + " a " + n + "," + i + " 0,0,0 " + a + " 0 a " + n + "," + i + " 0,0,0 " + -a + " 0 l 0," + s + " a " + n + "," + i + " 0,0,0 " + a + " 0 l 0," + -s, d = r.attr("label-offset-y", i).insert("path", ":first-child").attr("d", o).attr("transform", "translate(" + -a / 2 + "," + -(s / 2 + i) + ")");
|
|
523
|
+
return t.intersect = function(u) {
|
|
524
|
+
const l = F(t, u), g = l.x - t.x;
|
|
525
|
+
if (n != 0 && (Math.abs(g) < t.width / 2 || Math.abs(g) == t.width / 2 && Math.abs(l.y - t.y) > t.height / 2 - i)) {
|
|
526
|
+
let c = i * i * (1 - g * g / (n * n));
|
|
527
|
+
c != 0 && (c = Math.sqrt(c)), c = i - c, u.y - t.y > 0 && (c = -c), l.y += c;
|
|
528
528
|
}
|
|
529
|
-
return
|
|
530
|
-
},
|
|
531
|
-
}
|
|
532
|
-
function fe(r) {
|
|
533
|
-
r.shapes().question = ot, r.shapes().hexagon = lt, r.shapes().stadium = gt, r.shapes().subroutine = yt, r.shapes().cylinder = xt, r.shapes().rect_left_inv_arrow = dt, r.shapes().lean_right = ct, r.shapes().lean_left = ht, r.shapes().trapezoid = ut, r.shapes().inv_trapezoid = ft, r.shapes().rect_right_inv_arrow = pt;
|
|
529
|
+
return l;
|
|
530
|
+
}, d;
|
|
534
531
|
}
|
|
535
532
|
function pe(r) {
|
|
536
|
-
r(
|
|
533
|
+
r.shapes().question = lt, r.shapes().hexagon = dt, r.shapes().stadium = yt, r.shapes().subroutine = xt, r.shapes().cylinder = wt, r.shapes().rect_left_inv_arrow = ct, r.shapes().lean_right = ht, r.shapes().lean_left = ut, r.shapes().trapezoid = ft, r.shapes().inv_trapezoid = pt, r.shapes().rect_right_inv_arrow = gt;
|
|
537
534
|
}
|
|
538
|
-
function
|
|
535
|
+
function ge(r) {
|
|
536
|
+
r({ question: lt }), r({ hexagon: dt }), r({ stadium: yt }), r({ subroutine: xt }), r({ cylinder: wt }), r({ rect_left_inv_arrow: ct }), r({ lean_right: ht }), r({ lean_left: ut }), r({ trapezoid: ft }), r({ inv_trapezoid: pt }), r({ rect_right_inv_arrow: gt });
|
|
537
|
+
}
|
|
538
|
+
function M(r, e, t, a) {
|
|
539
539
|
return r.insert("polygon", ":first-child").attr(
|
|
540
540
|
"points",
|
|
541
541
|
a.map(function(n) {
|
|
@@ -543,122 +543,126 @@ function E(r, e, t, a) {
|
|
|
543
543
|
}).join(" ")
|
|
544
544
|
).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
|
|
545
545
|
}
|
|
546
|
-
const
|
|
547
|
-
addToRender:
|
|
548
|
-
addToRenderV2:
|
|
549
|
-
}, vt = {},
|
|
546
|
+
const ye = {
|
|
547
|
+
addToRender: pe,
|
|
548
|
+
addToRenderV2: ge
|
|
549
|
+
}, vt = {}, xe = function(r) {
|
|
550
550
|
const e = Object.keys(r);
|
|
551
551
|
for (const t of e)
|
|
552
552
|
vt[t] = r[t];
|
|
553
|
-
},
|
|
554
|
-
const s = a ? a.select(`[id="${t}"]`) :
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
let
|
|
558
|
-
|
|
559
|
-
const
|
|
560
|
-
let
|
|
561
|
-
if (J(
|
|
553
|
+
}, bt = async function(r, e, t, a, n, i) {
|
|
554
|
+
const s = a ? a.select(`[id="${t}"]`) : v(`[id="${t}"]`), o = n || document, d = Object.keys(r);
|
|
555
|
+
for (const u of d) {
|
|
556
|
+
const l = r[u];
|
|
557
|
+
let g = "default";
|
|
558
|
+
l.classes.length > 0 && (g = l.classes.join(" "));
|
|
559
|
+
const c = z(l.styles);
|
|
560
|
+
let h = l.text !== void 0 ? l.text : l.id, p;
|
|
561
|
+
if (J(R().flowchart.htmlLabels)) {
|
|
562
562
|
const x = {
|
|
563
|
-
label:
|
|
564
|
-
|
|
565
|
-
|
|
563
|
+
label: await tt(
|
|
564
|
+
h.replace(
|
|
565
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
566
|
+
// cspell:disable-line
|
|
567
|
+
(k) => `<i class='${k.replace(":", " ")}'></i>`
|
|
568
|
+
),
|
|
569
|
+
R()
|
|
566
570
|
)
|
|
567
571
|
};
|
|
568
|
-
|
|
572
|
+
p = rt(s, x).node(), p.parentNode.removeChild(p);
|
|
569
573
|
} else {
|
|
570
574
|
const x = o.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
571
|
-
x.setAttribute("style",
|
|
572
|
-
const
|
|
573
|
-
for (const
|
|
574
|
-
const
|
|
575
|
-
|
|
575
|
+
x.setAttribute("style", c.labelStyle.replace("color:", "fill:"));
|
|
576
|
+
const k = h.split(et.lineBreakRegex);
|
|
577
|
+
for (const N of k) {
|
|
578
|
+
const _ = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
579
|
+
_.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), _.setAttribute("dy", "1em"), _.setAttribute("x", "1"), _.textContent = N, x.appendChild(_);
|
|
576
580
|
}
|
|
577
|
-
|
|
581
|
+
p = x;
|
|
578
582
|
}
|
|
579
|
-
let
|
|
580
|
-
switch (
|
|
583
|
+
let w = 0, f = "";
|
|
584
|
+
switch (l.type) {
|
|
581
585
|
case "round":
|
|
582
|
-
|
|
586
|
+
w = 5, f = "rect";
|
|
583
587
|
break;
|
|
584
588
|
case "square":
|
|
585
|
-
|
|
589
|
+
f = "rect";
|
|
586
590
|
break;
|
|
587
591
|
case "diamond":
|
|
588
|
-
|
|
592
|
+
f = "question";
|
|
589
593
|
break;
|
|
590
594
|
case "hexagon":
|
|
591
|
-
|
|
595
|
+
f = "hexagon";
|
|
592
596
|
break;
|
|
593
597
|
case "odd":
|
|
594
|
-
|
|
598
|
+
f = "rect_left_inv_arrow";
|
|
595
599
|
break;
|
|
596
600
|
case "lean_right":
|
|
597
|
-
|
|
601
|
+
f = "lean_right";
|
|
598
602
|
break;
|
|
599
603
|
case "lean_left":
|
|
600
|
-
|
|
604
|
+
f = "lean_left";
|
|
601
605
|
break;
|
|
602
606
|
case "trapezoid":
|
|
603
|
-
|
|
607
|
+
f = "trapezoid";
|
|
604
608
|
break;
|
|
605
609
|
case "inv_trapezoid":
|
|
606
|
-
|
|
610
|
+
f = "inv_trapezoid";
|
|
607
611
|
break;
|
|
608
612
|
case "odd_right":
|
|
609
|
-
|
|
613
|
+
f = "rect_left_inv_arrow";
|
|
610
614
|
break;
|
|
611
615
|
case "circle":
|
|
612
|
-
|
|
616
|
+
f = "circle";
|
|
613
617
|
break;
|
|
614
618
|
case "ellipse":
|
|
615
|
-
|
|
619
|
+
f = "ellipse";
|
|
616
620
|
break;
|
|
617
621
|
case "stadium":
|
|
618
|
-
|
|
622
|
+
f = "stadium";
|
|
619
623
|
break;
|
|
620
624
|
case "subroutine":
|
|
621
|
-
|
|
625
|
+
f = "subroutine";
|
|
622
626
|
break;
|
|
623
627
|
case "cylinder":
|
|
624
|
-
|
|
628
|
+
f = "cylinder";
|
|
625
629
|
break;
|
|
626
630
|
case "group":
|
|
627
|
-
|
|
631
|
+
f = "rect";
|
|
628
632
|
break;
|
|
629
633
|
default:
|
|
630
|
-
|
|
634
|
+
f = "rect";
|
|
631
635
|
}
|
|
632
|
-
U.warn("Adding node",
|
|
636
|
+
U.warn("Adding node", l.id, l.domId), e.setNode(i.db.lookUpDomId(l.id), {
|
|
633
637
|
labelType: "svg",
|
|
634
|
-
labelStyle:
|
|
635
|
-
shape:
|
|
636
|
-
label:
|
|
637
|
-
rx:
|
|
638
|
-
ry:
|
|
639
|
-
class:
|
|
640
|
-
style:
|
|
641
|
-
id: i.db.lookUpDomId(
|
|
638
|
+
labelStyle: c.labelStyle,
|
|
639
|
+
shape: f,
|
|
640
|
+
label: p,
|
|
641
|
+
rx: w,
|
|
642
|
+
ry: w,
|
|
643
|
+
class: g,
|
|
644
|
+
style: c.style,
|
|
645
|
+
id: i.db.lookUpDomId(l.id)
|
|
642
646
|
});
|
|
643
|
-
}
|
|
644
|
-
},
|
|
647
|
+
}
|
|
648
|
+
}, mt = async function(r, e, t) {
|
|
645
649
|
let a = 0, n, i;
|
|
646
650
|
if (r.defaultStyle !== void 0) {
|
|
647
|
-
const s =
|
|
651
|
+
const s = z(r.defaultStyle);
|
|
648
652
|
n = s.style, i = s.labelStyle;
|
|
649
653
|
}
|
|
650
|
-
|
|
654
|
+
for (const s of r) {
|
|
651
655
|
a++;
|
|
652
|
-
const o = "L-" + s.start + "-" + s.end,
|
|
653
|
-
s.type === "arrow_open" ?
|
|
654
|
-
let g = "",
|
|
656
|
+
const o = "L-" + s.start + "-" + s.end, d = "LS-" + s.start, u = "LE-" + s.end, l = {};
|
|
657
|
+
s.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
|
|
658
|
+
let g = "", c = "";
|
|
655
659
|
if (s.style !== void 0) {
|
|
656
|
-
const h =
|
|
657
|
-
g = h.style,
|
|
660
|
+
const h = z(s.style);
|
|
661
|
+
g = h.style, c = h.labelStyle;
|
|
658
662
|
} else
|
|
659
663
|
switch (s.stroke) {
|
|
660
664
|
case "normal":
|
|
661
|
-
g = "fill:none", n !== void 0 && (g = n), i !== void 0 && (
|
|
665
|
+
g = "fill:none", n !== void 0 && (g = n), i !== void 0 && (c = i);
|
|
662
666
|
break;
|
|
663
667
|
case "dotted":
|
|
664
668
|
g = "fill:none;stroke-width:2px;stroke-dasharray:3;";
|
|
@@ -667,28 +671,32 @@ const ge = {
|
|
|
667
671
|
g = " stroke-width: 3.5px;fill:none";
|
|
668
672
|
break;
|
|
669
673
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
674
|
+
l.style = g, l.labelStyle = c, s.interpolate !== void 0 ? l.curve = q(s.interpolate, W) : r.defaultInterpolate !== void 0 ? l.curve = q(r.defaultInterpolate, W) : l.curve = q(vt.curve, W), s.text === void 0 ? s.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", J(R().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${o}" class="edgeLabel L-${d}' L-${u}" style="${l.labelStyle}">${await tt(
|
|
675
|
+
s.text.replace(
|
|
676
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
677
|
+
// cspell:disable-line
|
|
678
|
+
(h) => `<i class='${h.replace(":", " ")}'></i>`
|
|
679
|
+
),
|
|
680
|
+
R()
|
|
681
|
+
)}</span>`) : (l.labelType = "text", l.label = s.text.replace(et.lineBreakRegex, `
|
|
682
|
+
`), s.style === void 0 && (l.style = l.style || "stroke: #333; stroke-width: 1.5px;fill:none"), l.labelStyle = l.labelStyle.replace("color:", "fill:"))), l.id = o, l.class = d + " " + u, l.minlen = s.length || 1, e.setEdge(t.db.lookUpDomId(s.start), t.db.lookUpDomId(s.end), l, a);
|
|
683
|
+
}
|
|
684
|
+
}, we = function(r, e) {
|
|
677
685
|
return U.info("Extracting classes"), e.db.getClasses();
|
|
678
|
-
}, ve = function(r, e, t, a) {
|
|
686
|
+
}, ve = async function(r, e, t, a) {
|
|
679
687
|
U.info("Drawing flowchart");
|
|
680
|
-
const { securityLevel: n, flowchart: i } =
|
|
688
|
+
const { securityLevel: n, flowchart: i } = R();
|
|
681
689
|
let s;
|
|
682
|
-
n === "sandbox" && (s =
|
|
683
|
-
const o = n === "sandbox" ?
|
|
684
|
-
let
|
|
685
|
-
|
|
686
|
-
const
|
|
690
|
+
n === "sandbox" && (s = v("#i" + e));
|
|
691
|
+
const o = n === "sandbox" ? v(s.nodes()[0].contentDocument.body) : v("body"), d = n === "sandbox" ? s.nodes()[0].contentDocument : document;
|
|
692
|
+
let u = a.db.getDirection();
|
|
693
|
+
u === void 0 && (u = "TD");
|
|
694
|
+
const l = i.nodeSpacing || 50, g = i.rankSpacing || 50, c = new St({
|
|
687
695
|
multigraph: !0,
|
|
688
696
|
compound: !0
|
|
689
697
|
}).setGraph({
|
|
690
|
-
rankdir:
|
|
691
|
-
nodesep:
|
|
698
|
+
rankdir: u,
|
|
699
|
+
nodesep: l,
|
|
692
700
|
ranksep: g,
|
|
693
701
|
marginx: 8,
|
|
694
702
|
marginy: 8
|
|
@@ -699,84 +707,84 @@ const ge = {
|
|
|
699
707
|
const p = a.db.getSubGraphs();
|
|
700
708
|
for (let y = p.length - 1; y >= 0; y--)
|
|
701
709
|
h = p[y], a.db.addVertex(h.id, h.title, "group", void 0, h.classes);
|
|
702
|
-
const
|
|
703
|
-
U.warn("Get vertices",
|
|
704
|
-
const
|
|
705
|
-
let
|
|
706
|
-
for (
|
|
707
|
-
h = p[
|
|
710
|
+
const w = a.db.getVertices();
|
|
711
|
+
U.warn("Get vertices", w);
|
|
712
|
+
const f = a.db.getEdges();
|
|
713
|
+
let x = 0;
|
|
714
|
+
for (x = p.length - 1; x >= 0; x--) {
|
|
715
|
+
h = p[x], Bt("cluster").append("text");
|
|
708
716
|
for (let y = 0; y < h.nodes.length; y++)
|
|
709
717
|
U.warn(
|
|
710
718
|
"Setting subgraph",
|
|
711
719
|
h.nodes[y],
|
|
712
720
|
a.db.lookUpDomId(h.nodes[y]),
|
|
713
721
|
a.db.lookUpDomId(h.id)
|
|
714
|
-
),
|
|
722
|
+
), c.setParent(a.db.lookUpDomId(h.nodes[y]), a.db.lookUpDomId(h.id));
|
|
715
723
|
}
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
const
|
|
720
|
-
T(
|
|
721
|
-
},
|
|
724
|
+
await bt(w, c, e, o, d, a), await mt(f, c, a);
|
|
725
|
+
const k = new de();
|
|
726
|
+
ye.addToRender(k), k.arrows().none = function(y, b, L, m) {
|
|
727
|
+
const B = y.append("marker").attr("id", b).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 0 0 L 0 0 z");
|
|
728
|
+
T(B, L[m + "Style"]);
|
|
729
|
+
}, k.arrows().normal = function(y, b) {
|
|
722
730
|
y.append("marker").attr("id", b).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowheadPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
723
731
|
};
|
|
724
|
-
const
|
|
725
|
-
for (
|
|
732
|
+
const N = o.select(`[id="${e}"]`), _ = o.select("#" + e + " g");
|
|
733
|
+
for (k(_, c), _.selectAll("g.node").attr("title", function() {
|
|
726
734
|
return a.db.getTooltip(this.id);
|
|
727
|
-
}), a.db.indexNodes("subGraph" +
|
|
728
|
-
if (h = p[
|
|
729
|
-
const y =
|
|
735
|
+
}), a.db.indexNodes("subGraph" + x), x = 0; x < p.length; x++)
|
|
736
|
+
if (h = p[x], h.title !== "undefined") {
|
|
737
|
+
const y = d.querySelectorAll(
|
|
730
738
|
"#" + e + ' [id="' + a.db.lookUpDomId(h.id) + '"] rect'
|
|
731
|
-
), b =
|
|
739
|
+
), b = d.querySelectorAll(
|
|
732
740
|
"#" + e + ' [id="' + a.db.lookUpDomId(h.id) + '"]'
|
|
733
|
-
), L = y[0].x.baseVal.value, m = y[0].y.baseVal.value,
|
|
734
|
-
$.attr("transform", `translate(${L +
|
|
735
|
-
for (let
|
|
736
|
-
b[0].classList.add(h.classes[
|
|
741
|
+
), L = y[0].x.baseVal.value, m = y[0].y.baseVal.value, B = y[0].width.baseVal.value, $ = v(b[0]).select(".label");
|
|
742
|
+
$.attr("transform", `translate(${L + B / 2}, ${m + 14})`), $.attr("id", e + "Text");
|
|
743
|
+
for (let E = 0; E < h.classes.length; E++)
|
|
744
|
+
b[0].classList.add(h.classes[E]);
|
|
737
745
|
}
|
|
738
746
|
if (!i.htmlLabels) {
|
|
739
|
-
const y =
|
|
747
|
+
const y = d.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
|
|
740
748
|
for (const b of y) {
|
|
741
|
-
const L = b.getBBox(), m =
|
|
749
|
+
const L = b.getBBox(), m = d.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
742
750
|
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", L.width), m.setAttribute("height", L.height), b.insertBefore(m, b.firstChild);
|
|
743
751
|
}
|
|
744
752
|
}
|
|
745
|
-
|
|
746
|
-
const b =
|
|
753
|
+
_t(c, N, i.diagramPadding, i.useMaxWidth), Object.keys(w).forEach(function(y) {
|
|
754
|
+
const b = w[y];
|
|
747
755
|
if (b.link) {
|
|
748
756
|
const L = o.select("#" + e + ' [id="' + a.db.lookUpDomId(y) + '"]');
|
|
749
757
|
if (L) {
|
|
750
|
-
const m =
|
|
758
|
+
const m = d.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
751
759
|
m.setAttributeNS("http://www.w3.org/2000/svg", "class", b.classes.join(" ")), m.setAttributeNS("http://www.w3.org/2000/svg", "href", b.link), m.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), n === "sandbox" ? m.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : b.linkTarget && m.setAttributeNS("http://www.w3.org/2000/svg", "target", b.linkTarget);
|
|
752
|
-
const
|
|
760
|
+
const B = L.insert(function() {
|
|
753
761
|
return m;
|
|
754
762
|
}, ":first-child"), $ = L.select(".label-container");
|
|
755
|
-
$ &&
|
|
763
|
+
$ && B.append(function() {
|
|
756
764
|
return $.node();
|
|
757
765
|
});
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
return
|
|
766
|
+
const E = L.select(".label");
|
|
767
|
+
E && B.append(function() {
|
|
768
|
+
return E.node();
|
|
761
769
|
});
|
|
762
770
|
}
|
|
763
771
|
}
|
|
764
772
|
});
|
|
765
|
-
},
|
|
766
|
-
setConf:
|
|
767
|
-
addVertices:
|
|
768
|
-
addEdges:
|
|
769
|
-
getClasses:
|
|
773
|
+
}, be = {
|
|
774
|
+
setConf: xe,
|
|
775
|
+
addVertices: bt,
|
|
776
|
+
addEdges: mt,
|
|
777
|
+
getClasses: we,
|
|
770
778
|
draw: ve
|
|
771
|
-
},
|
|
772
|
-
parser:
|
|
773
|
-
db:
|
|
774
|
-
renderer:
|
|
775
|
-
styles:
|
|
779
|
+
}, Ie = {
|
|
780
|
+
parser: kt,
|
|
781
|
+
db: P,
|
|
782
|
+
renderer: Mt,
|
|
783
|
+
styles: Nt,
|
|
776
784
|
init: (r) => {
|
|
777
|
-
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute,
|
|
785
|
+
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, be.setConf(r.flowchart), P.clear(), P.setGen("gen-1");
|
|
778
786
|
}
|
|
779
787
|
};
|
|
780
788
|
export {
|
|
781
|
-
|
|
789
|
+
Ie as diagram
|
|
782
790
|
};
|