@kong-ui-public/documentation 0.7.3 → 0.7.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/arc-BOwQG9_0-DleiJ5MN.js +86 -0
- package/dist/{blockDiagram-9f4a6865-B8YUosP9-Ck5a_RF8.js → blockDiagram-6b2b5046-Nxmf6ECX-CjmiHCoc.js} +106 -106
- package/dist/{c4Diagram-ae766693-9gx0flBR-RbGS48yQ.js → c4Diagram-b947cdbb-Cqv3kxuJ-BXRu2bPz.js} +132 -133
- package/dist/{channel-bVjn1tQE-Wer9OwST.js → channel-b8lMD3zZ-Ds1AntZz.js} +1 -1
- package/dist/{classDiagram-fb54d2a0-BmWHv5ZR-D2x9wzS9.js → classDiagram-35230388-cNSawuF--DF1WKJvq.js} +7 -8
- package/dist/{classDiagram-v2-a2b738ad-QP0MZXwY-DUaknQeO.js → classDiagram-v2-412acd34-DL9yPzEL-1zjaSugS.js} +8 -8
- package/dist/{clone-DD2Lcv4t-DhvFmnqA.js → clone-DA9j_md9-DOEHuNxk.js} +1 -1
- package/dist/{createText-ca0c5216-CUBuCbSf-HdStpTZQ.js → createText-423428c9-Bi8tqKOA-BAeSkls4.js} +1 -2
- package/dist/documentation.es.js +2 -2
- package/dist/documentation.umd.js +724 -995
- package/dist/{edges-066a5561-C4osKU6x-XnDLYo80.js → edges-d417c7a0-CyiospL7-DxH-v6Cl.js} +27 -28
- package/dist/{erDiagram-09d1c15f-SHmUd_X2-BD2Zprb5.js → erDiagram-0ea73325-BWWWgAmd-aPslvlbz.js} +38 -38
- package/dist/{flowDb-c1833063-hXQxSOZp-BgZsffD-.js → flowDb-d35e309a-BQRCRAKf-Cf6biv5M.js} +4 -4
- package/dist/{flowDiagram-b222e15a-D6yXsQur-DAh1PqK2.js → flowDiagram-d949d7c1-D_OK65PK-DS0CyGIC.js} +329 -337
- package/dist/{flowDiagram-v2-13329dc7-DSmTE-fH-DK4Aaksl.js → flowDiagram-v2-49332944-CYs4MQAb-C9m-G3JY.js} +5 -5
- package/dist/{flowchart-elk-definition-ae0efee6-DeHL5Vyb-C3uoamlG.js → flowchart-elk-definition-27cc417a-OqMBrUum-CbH3NCkB.js} +12750 -12752
- package/dist/{ganttDiagram-b62c793e-MpaZ3zUz-n9eAGU5Z.js → ganttDiagram-5c869e3b-Cu9aCqHh-De0u-Oas.js} +477 -488
- package/dist/gitGraphDiagram-b9d81de9-DVB2N99Y-C2np-enA.js +1262 -0
- package/dist/go-BEtjQGEI-BEtjQGEI.js +7 -0
- package/dist/{graph-Ch046BUH-D6losRXJ.js → graph-Ctghcdhb-CqAdUKOZ.js} +3 -3
- package/dist/{index-01f381cb-CT_aViff-Bm97PJyb.js → index-8fae9850-CdUaE101-uMPVRleJ.js} +11 -11
- package/dist/{index-ylfMj1BB.js → index-BRYBB2aM.js} +6919 -6980
- package/dist/{infoDiagram-94cd232f-lx0YonOB-CCDIpRPp.js → infoDiagram-db7b18fc-MHPWI9K2-Cy6tzigE.js} +16 -16
- package/dist/{journeyDiagram-6625b456-Bddw5A6D-kEeZiQ4H.js → journeyDiagram-d5636530-O6dkdrZq-BghpQv6u.js} +42 -42
- package/dist/{latex-CoJDAuLL-lJGSmtOO.js → latex-BOFs-Cxs-XUibdaju.js} +1 -1
- package/dist/{layout-CHOXC5k_-DUAMQEfX.js → layout-Bf4siL6f-B27qrAUf.js} +110 -110
- package/dist/{line-DBfBDzAx-Dps8NSDg.js → line-Bs4J8z8n-kq8RtDQA.js} +1 -1
- package/dist/{linear-Cx2Fv9Zx-CU3jTW7x.js → linear-DG5qhwMV-BSSd8kt2.js} +21 -21
- package/dist/{mindmap-definition-307c710a-gxai40Hx-B5cybnhA.js → mindmap-definition-377f8f1f-BJZNhhv8-Cinm-UDt.js} +6496 -6729
- package/dist/{pieDiagram-bb1d19e5-DBUCFC_C-D0U7-L3H.js → pieDiagram-b0208e96-12B2qtCQ-Bl-9vJIA.js} +68 -68
- package/dist/{quadrantDiagram-c759a472-C-01TGYx-DbcxgXB1.js → quadrantDiagram-0332be45-B77W50pM-bQiH7XpR.js} +2 -2
- package/dist/{requirementDiagram-87253d64-B-l2a_BK-Dx5Ue_Dh.js → requirementDiagram-bf7890df-BfPNYjQ5-CGF46ifn.js} +30 -30
- package/dist/{sankeyDiagram-707fac0f-Bbge0MNO-Daiiy5Xs.js → sankeyDiagram-0acdec17-D5aZuYoJ-DIWEEtuf.js} +22 -22
- package/dist/{sequenceDiagram-6894f283-icQqpauU-BnsQfpZ8.js → sequenceDiagram-c18d009d-DE6VyN7w-6UaAYk4p.js} +808 -841
- package/dist/{stateDiagram-5dee940d-D5DlkHeT-vkteU5K0.js → stateDiagram-43596fc0-CfGH1LmM-km5kjci0.js} +54 -54
- package/dist/{stateDiagram-v2-1992cada-B0wOd1mU-uGp4HBId.js → stateDiagram-v2-2ead4f9c-CvDoRhMn-CkUl-Lcu.js} +12 -12
- package/dist/style.css +1 -1
- package/dist/{styles-b83b31c9-Cl9kVMiN-l7CL0Dl1.js → styles-6860f46c-CJplL-uW-BFTTeCMF.js} +19 -19
- package/dist/{styles-483fbfea-D5_DzLlB-CFEFMKxg.js → styles-7383a064-N1ljH9gq-D7Iipjtf.js} +137 -140
- package/dist/{styles-0784dbeb-BNHFs860-B4vu0CwB.js → styles-b2c874b6-CKJLyUE4-2C22cylE.js} +24 -24
- package/dist/{svgDrawCommon-5e1cfd1d-DOmX8dP4-DFu8Hp1b.js → svgDrawCommon-0ee1b4e9-Dc25Bs_w-QhIkJ1Xp.js} +4 -4
- package/dist/{timeline-definition-bf702344-W3hPiAt--ObBtNo01.js → timeline-definition-d977decf-8C3XuDC--DAD2knZY.js} +2 -2
- package/dist/{vue-Djs4WzmL-BDWKKO52.js → vue-DoU_Nr9K-Cj2gXb1y.js} +2 -2
- package/dist/{vue-html-CdlOxrsR-C0P0LsFn.js → vue-html-iC7i5f9n-Cfh5ktA3.js} +1 -1
- package/dist/{xychartDiagram-f11f50a6-DL5V2cSz-1oy5zYHs.js → xychartDiagram-e50adddc-BRQAut2i-DBHY1QQ6.js} +22 -22
- package/package.json +5 -5
- package/dist/arc-Fs4E7_gE-CkmDW6jG.js +0 -86
- package/dist/gitGraphDiagram-942e62fe-DZ9sNSmE-DfnVvdJs.js +0 -1264
- package/dist/go-DYNyFS5n-DYNyFS5n.js +0 -7
- package/dist/katex-BQC_klMa-CaeA20wX.js +0 -11636
package/dist/{flowDiagram-b222e15a-D6yXsQur-DAh1PqK2.js → flowDiagram-d949d7c1-D_OK65PK-DS0CyGIC.js}
RENAMED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { X as
|
|
2
|
-
import { Y as
|
|
3
|
-
import { h as
|
|
4
|
-
import { e as
|
|
5
|
-
import {
|
|
6
|
-
import { P as
|
|
7
|
-
function
|
|
1
|
+
import { X as mt, j as O } from "./flowDb-d35e309a-BQRCRAKf-Cf6biv5M.js";
|
|
2
|
+
import { Y as kt, E as k, v as K } from "./graph-Ctghcdhb-CqAdUKOZ.js";
|
|
3
|
+
import { h as w, o as q, p as J, c as H, j as tt, l as U, q as W, r as R, t as St } from "./index-BRYBB2aM.js";
|
|
4
|
+
import { e as _t, N as Lt, V as It, O as At, k as C } from "./layout-Bf4siL6f-B27qrAUf.js";
|
|
5
|
+
import { u as Tt, w as Et, O as et, Q as Mt, Z as T, d as rt, f as L, p as at, b as nt } from "./styles-7383a064-N1ljH9gq-D7Iipjtf.js";
|
|
6
|
+
import { P as Nt } from "./line-Bs4J8z8n-kq8RtDQA.js";
|
|
7
|
+
function Bt(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 $t(r, e) {
|
|
13
|
+
return fetch(r, e).then(Bt);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return (e, t) =>
|
|
15
|
+
function Ct(r) {
|
|
16
|
+
return (e, t) => $t(e, t).then((a) => new DOMParser().parseFromString(a, r));
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
normal:
|
|
20
|
-
vee:
|
|
21
|
-
undirected:
|
|
18
|
+
var Dt = Ct("image/svg+xml"), P = {
|
|
19
|
+
normal: Rt,
|
|
20
|
+
vee: Ot,
|
|
21
|
+
undirected: Wt
|
|
22
22
|
};
|
|
23
|
-
function
|
|
24
|
-
|
|
23
|
+
function Ut(r) {
|
|
24
|
+
P = r;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Rt(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 Ot(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
|
}
|
|
34
|
-
function
|
|
34
|
+
function Wt(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 qt(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 Pt(r, e) {
|
|
43
|
+
for (var t = r.append("text"), a = Yt(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 Yt(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 Vt(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" ? qt(n, e) : typeof a != "string" || e.labelType === "html" ? et(n, e) : Pt(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 Y = function(r, e) {
|
|
81
81
|
var t = e.nodes().filter(function(i) {
|
|
82
|
-
return
|
|
82
|
+
return rt(e, i);
|
|
83
83
|
}), a = r.selectAll("g.cluster").data(t, function(i) {
|
|
84
84
|
return i;
|
|
85
85
|
});
|
|
86
|
-
|
|
86
|
+
L(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 = w(this);
|
|
92
|
+
w(this).append("rect");
|
|
93
|
+
var l = o.append("g").attr("class", "label");
|
|
94
|
+
G(l, 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 = L(a, e).style("opacity", 1), a.selectAll("rect").each(function(i) {
|
|
97
|
+
var s = e.node(i), o = w(this);
|
|
98
98
|
T(o, s.style);
|
|
99
99
|
}), a;
|
|
100
100
|
};
|
|
101
|
-
function
|
|
102
|
-
|
|
101
|
+
function zt(r) {
|
|
102
|
+
Y = r;
|
|
103
103
|
}
|
|
104
|
-
let
|
|
104
|
+
let z = function(r, e) {
|
|
105
105
|
var t = r.selectAll("g.edgeLabel").data(e.edges(), function(n) {
|
|
106
|
-
return
|
|
106
|
+
return at(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 = w(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), l = o.node().getBBox();
|
|
112
|
+
s.labelId && o.attr("id", s.labelId), k(s, "width") || (s.width = l.width), k(s, "height") || (s.height = l.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), L(a, e).style("opacity", 0).remove(), t;
|
|
116
116
|
};
|
|
117
|
-
function
|
|
118
|
-
|
|
117
|
+
function Vt(r) {
|
|
118
|
+
z = r;
|
|
119
119
|
}
|
|
120
120
|
function Q(r, e) {
|
|
121
121
|
return r.intersect(e);
|
|
122
122
|
}
|
|
123
|
-
var
|
|
123
|
+
var V = function(r, e, t) {
|
|
124
124
|
var a = r.selectAll("g.edgePath").data(e.edges(), function(s) {
|
|
125
|
-
return
|
|
126
|
-
}).classed("update", !0), n =
|
|
127
|
-
|
|
125
|
+
return at(s);
|
|
126
|
+
}).classed("update", !0), n = Ft(a, e);
|
|
127
|
+
Qt(a, e);
|
|
128
128
|
var i = a.merge !== void 0 ? a.merge(n) : a;
|
|
129
|
-
return
|
|
130
|
-
var o =
|
|
131
|
-
|
|
129
|
+
return L(i, e).style("opacity", 1), i.each(function(s) {
|
|
130
|
+
var o = w(this), l = e.edge(s);
|
|
131
|
+
l.elem = this, l.id && o.attr("id", l.id), nt(
|
|
132
132
|
o,
|
|
133
|
-
|
|
133
|
+
l.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
|
-
o.arrowheadId =
|
|
139
|
-
var
|
|
140
|
-
return "url(" +
|
|
138
|
+
o.arrowheadId = _t("arrowhead");
|
|
139
|
+
var l = w(this).attr("marker-end", function() {
|
|
140
|
+
return "url(" + jt(location.href, o.arrowheadId) + ")";
|
|
141
141
|
}).style("fill", "none");
|
|
142
|
-
|
|
143
|
-
return
|
|
144
|
-
}), T(
|
|
142
|
+
L(l, e).attr("d", function(c) {
|
|
143
|
+
return Ht(e, c);
|
|
144
|
+
}), T(l, 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), l = t[o.arrowhead];
|
|
147
|
+
l(w(this), o.arrowheadId, o, "arrowhead");
|
|
148
148
|
}), i;
|
|
149
149
|
};
|
|
150
|
-
function
|
|
151
|
-
|
|
150
|
+
function Xt(r) {
|
|
151
|
+
V = r;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function jt(r, e) {
|
|
154
154
|
var t = r.split("#")[0];
|
|
155
155
|
return t + "#" + e;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Ht(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(Q(a, i[0])), i.push(Q(n, i[i.length - 1])),
|
|
159
|
+
return i.unshift(Q(a, i[0])), i.push(Q(n, i[i.length - 1])), it(t, i);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
var t = (
|
|
161
|
+
function it(r, e) {
|
|
162
|
+
var t = (Nt || Dt.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 Gt(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 Ft(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 = Lt(n.points.length).map(function() {
|
|
177
|
+
return Gt(i);
|
|
178
178
|
});
|
|
179
|
-
return
|
|
179
|
+
return it(n, s);
|
|
180
180
|
}), t.append("defs"), t;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Qt(r, e) {
|
|
183
183
|
var t = r.exit();
|
|
184
|
-
|
|
184
|
+
L(t, e).style("opacity", 0).remove();
|
|
185
185
|
}
|
|
186
|
-
var
|
|
186
|
+
var X = function(r, e, t) {
|
|
187
187
|
var a = e.nodes().filter(function(s) {
|
|
188
|
-
return !
|
|
188
|
+
return !rt(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), l = w(this);
|
|
194
|
+
nt(
|
|
195
|
+
l,
|
|
196
196
|
o.class,
|
|
197
|
-
(
|
|
198
|
-
),
|
|
199
|
-
var
|
|
200
|
-
o.elem = this, o.id &&
|
|
197
|
+
(l.classed("update") ? "update " : "") + "node"
|
|
198
|
+
), l.select("g.label").remove();
|
|
199
|
+
var c = l.append("g").attr("class", "label"), d = G(c, o), g = t[o.shape], f = It(d.node().getBBox(), "width", "height");
|
|
200
|
+
o.elem = this, o.id && l.attr("id", o.id), o.labelId && c.attr("id", o.labelId), k(o, "width") && (f.width = o.width), k(o, "height") && (f.height = o.height), f.width += o.paddingLeft + o.paddingRight, f.height += o.paddingTop + o.paddingBottom, c.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 = w(this);
|
|
205
205
|
h.select(".label-container").remove();
|
|
206
|
-
var p = g(h,
|
|
206
|
+
var p = g(h, f, o).classed("label-container", !0);
|
|
207
207
|
T(p, o.style);
|
|
208
|
-
var
|
|
209
|
-
o.width =
|
|
208
|
+
var u = p.node().getBBox();
|
|
209
|
+
o.width = u.width, o.height = u.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), L(i, e).style("opacity", 0).remove(), n;
|
|
213
213
|
};
|
|
214
|
-
function
|
|
215
|
-
|
|
214
|
+
function Zt(r) {
|
|
215
|
+
X = r;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Kt(r, e) {
|
|
218
218
|
var t = r.filter(function() {
|
|
219
|
-
return !
|
|
219
|
+
return !w(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), L(r, e).style("opacity", 1).attr("transform", a), L(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,94 +234,94 @@ function Jt(r, e) {
|
|
|
234
234
|
return -i.height / 2;
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Jt(r, e) {
|
|
238
238
|
var t = r.filter(function() {
|
|
239
|
-
return !
|
|
239
|
+
return !w(this).classed("update");
|
|
240
240
|
});
|
|
241
241
|
function a(n) {
|
|
242
242
|
var i = e.edge(n);
|
|
243
|
-
return
|
|
243
|
+
return k(i, "x") ? "translate(" + i.x + "," + i.y + ")" : "";
|
|
244
244
|
}
|
|
245
|
-
t.attr("transform", a),
|
|
245
|
+
t.attr("transform", a), L(r, e).style("opacity", 1).attr("transform", a);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function te(r, e) {
|
|
248
248
|
var t = r.filter(function() {
|
|
249
|
-
return !
|
|
249
|
+
return !w(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), L(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 st(r, e, t, a) {
|
|
258
|
+
var n = r.x, i = r.y, s = n - a.x, o = i - a.y, l = Math.sqrt(e * e * o * o + t * t * s * s), c = Math.abs(e * t * s / l);
|
|
259
|
+
a.x < n && (c = -c);
|
|
260
|
+
var d = Math.abs(e * t * o / l);
|
|
261
|
+
return a.y < i && (d = -d), { x: n + c, y: i + d };
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
263
|
+
function ee(r, e, t) {
|
|
264
|
+
return st(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 re(r, e, t, a) {
|
|
267
|
+
var n, i, s, o, l, c, d, g, f, h, p, u, x, v, S;
|
|
268
|
+
if (n = e.y - r.y, s = r.x - e.x, l = e.x * r.y - r.x * e.y, f = n * t.x + s * t.y + l, h = n * a.x + s * a.y + l, !(f !== 0 && h !== 0 && Z(f, h)) && (i = a.y - t.y, o = t.x - a.x, c = a.x * t.y - t.x * a.y, d = i * r.x + o * r.y + c, g = i * e.x + o * e.y + c, !(d !== 0 && g !== 0 && Z(d, g)) && (p = n * o - i * s, p !== 0)))
|
|
269
|
+
return u = Math.abs(p / 2), x = s * c - o * l, v = x < 0 ? (x - u) / p : (x + u) / p, x = i * l - n * c, S = x < 0 ? (x - u) / p : (x + u) / p, { x: v, y: S };
|
|
270
270
|
}
|
|
271
271
|
function Z(r, e) {
|
|
272
272
|
return r * e > 0;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function A(r, e, t) {
|
|
275
275
|
var a = r.x, n = r.y, i = [], s = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
|
|
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 l = a - r.width / 2 - s, c = n - r.height / 2 - o, d = 0; d < e.length; d++) {
|
|
280
|
+
var g = e[d], f = e[d < e.length - 1 ? d + 1 : 0], h = re(
|
|
281
281
|
r,
|
|
282
282
|
t,
|
|
283
|
-
{ x:
|
|
284
|
-
{ x:
|
|
283
|
+
{ x: l + g.x, y: c + g.y },
|
|
284
|
+
{ x: l + f.x, y: c + f.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, u) {
|
|
289
|
+
var x = p.x - t.x, v = p.y - t.y, S = Math.sqrt(x * x + v * v), I = u.x - t.x, B = u.y - t.y, y = Math.sqrt(I * I + B * B);
|
|
290
|
+
return S < y ? -1 : S === 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),
|
|
296
|
-
}
|
|
297
|
-
var
|
|
298
|
-
rect:
|
|
299
|
-
ellipse:
|
|
300
|
-
circle:
|
|
301
|
-
diamond:
|
|
294
|
+
var t = r.x, a = r.y, n = e.x - t, i = e.y - a, s = r.width / 2, o = r.height / 2, l, c;
|
|
295
|
+
return Math.abs(i) * s > Math.abs(n) * o ? (i < 0 && (o = -o), l = i === 0 ? 0 : o * n / i, c = o) : (n < 0 && (s = -s), l = s, c = n === 0 ? 0 : s * i / n), { x: t + l, y: a + c };
|
|
296
|
+
}
|
|
297
|
+
var j = {
|
|
298
|
+
rect: ne,
|
|
299
|
+
ellipse: ie,
|
|
300
|
+
circle: se,
|
|
301
|
+
diamond: oe
|
|
302
302
|
};
|
|
303
|
-
function
|
|
304
|
-
|
|
303
|
+
function ae(r) {
|
|
304
|
+
j = r;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ne(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 ie(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 st(t, a, n, s);
|
|
316
316
|
}, i;
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function se(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 ee(t, a, i);
|
|
322
322
|
}, n;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function oe(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 },
|
|
@@ -334,32 +334,32 @@ function le(r, e, t) {
|
|
|
334
334
|
}).join(" ")
|
|
335
335
|
);
|
|
336
336
|
return t.intersect = function(o) {
|
|
337
|
-
return
|
|
337
|
+
return A(t, i, o);
|
|
338
338
|
}, s;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function le() {
|
|
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
|
+
he(t);
|
|
343
|
+
var a = D(e, "output"), n = D(a, "clusters"), i = D(a, "edgePaths"), s = z(D(a, "edgeLabels"), t), o = X(D(a, "nodes"), t, j);
|
|
344
|
+
At(t), te(o, t), Jt(s, t), V(i, t, P);
|
|
345
|
+
var l = Y(n, t);
|
|
346
|
+
Kt(l, t), ue(t);
|
|
347
347
|
};
|
|
348
348
|
return r.createNodes = function(e) {
|
|
349
|
-
return arguments.length ? (
|
|
349
|
+
return arguments.length ? (Zt(e), r) : X;
|
|
350
350
|
}, r.createClusters = function(e) {
|
|
351
|
-
return arguments.length ? (
|
|
351
|
+
return arguments.length ? (zt(e), r) : Y;
|
|
352
352
|
}, r.createEdgeLabels = function(e) {
|
|
353
|
-
return arguments.length ? (
|
|
353
|
+
return arguments.length ? (Vt(e), r) : z;
|
|
354
354
|
}, r.createEdgePaths = function(e) {
|
|
355
|
-
return arguments.length ? (
|
|
355
|
+
return arguments.length ? (Xt(e), r) : V;
|
|
356
356
|
}, r.shapes = function(e) {
|
|
357
|
-
return arguments.length ? (
|
|
357
|
+
return arguments.length ? (ae(e), r) : j;
|
|
358
358
|
}, r.arrows = function(e) {
|
|
359
|
-
return arguments.length ? (
|
|
359
|
+
return arguments.length ? (Ut(e), r) : P;
|
|
360
360
|
}, r;
|
|
361
361
|
}
|
|
362
|
-
var
|
|
362
|
+
var de = {
|
|
363
363
|
paddingLeft: 10,
|
|
364
364
|
paddingRight: 10,
|
|
365
365
|
paddingTop: 10,
|
|
@@ -367,54 +367,54 @@ var ce = {
|
|
|
367
367
|
rx: 0,
|
|
368
368
|
ry: 0,
|
|
369
369
|
shape: "rect"
|
|
370
|
-
},
|
|
370
|
+
}, ce = {
|
|
371
371
|
arrowhead: "normal",
|
|
372
|
-
curve:
|
|
372
|
+
curve: R
|
|
373
373
|
};
|
|
374
|
-
function
|
|
374
|
+
function he(r) {
|
|
375
375
|
r.nodes().forEach(function(e) {
|
|
376
376
|
var t = r.node(e);
|
|
377
|
-
!
|
|
377
|
+
!k(t, "label") && !r.children(e).length && (t.label = e), k(t, "paddingX") && C(t, {
|
|
378
378
|
paddingLeft: t.paddingX,
|
|
379
379
|
paddingRight: t.paddingX
|
|
380
|
-
}),
|
|
380
|
+
}), k(t, "paddingY") && C(t, {
|
|
381
381
|
paddingTop: t.paddingY,
|
|
382
382
|
paddingBottom: t.paddingY
|
|
383
|
-
}),
|
|
383
|
+
}), k(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, de), K(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(a) {
|
|
389
389
|
t[a] = Number(t[a]);
|
|
390
|
-
}),
|
|
390
|
+
}), k(t, "width") && (t._prevWidth = t.width), k(t, "height") && (t._prevHeight = t.height);
|
|
391
391
|
}), r.edges().forEach(function(e) {
|
|
392
392
|
var t = r.edge(e);
|
|
393
|
-
|
|
393
|
+
k(t, "label") || (t.label = ""), C(t, ce);
|
|
394
394
|
});
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function ue(r) {
|
|
397
397
|
K(r.nodes(), function(e) {
|
|
398
398
|
var t = r.node(e);
|
|
399
|
-
|
|
399
|
+
k(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, k(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 ot(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
|
|
412
|
+
], o = E(r, i, i, s);
|
|
413
|
+
return t.intersect = function(l) {
|
|
414
|
+
return A(t, s, l);
|
|
415
415
|
}, o;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function lt(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 dt(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
|
|
425
|
+
], o = E(r, i, a, s);
|
|
426
|
+
return t.intersect = function(l) {
|
|
427
|
+
return A(t, s, l);
|
|
428
428
|
}, o;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function dt(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 = E(r, a, n, i);
|
|
438
438
|
return t.intersect = function(o) {
|
|
439
|
-
return
|
|
439
|
+
return A(t, i, o);
|
|
440
440
|
}, s;
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function ct(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 = E(r, a, n, i);
|
|
449
449
|
return t.intersect = function(o) {
|
|
450
|
-
return
|
|
450
|
+
return A(t, i, o);
|
|
451
451
|
}, s;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function ht(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 = E(r, a, n, i);
|
|
460
460
|
return t.intersect = function(o) {
|
|
461
|
-
return
|
|
461
|
+
return A(t, i, o);
|
|
462
462
|
}, s;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function ut(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 = E(r, a, n, i);
|
|
471
471
|
return t.intersect = function(o) {
|
|
472
|
-
return
|
|
472
|
+
return A(t, i, o);
|
|
473
473
|
}, s;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function ft(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 = E(r, a, n, i);
|
|
482
482
|
return t.intersect = function(o) {
|
|
483
|
-
return
|
|
483
|
+
return A(t, i, o);
|
|
484
484
|
}, s;
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function pt(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 = E(r, a, n, i);
|
|
494
494
|
return t.intersect = function(o) {
|
|
495
|
-
return
|
|
495
|
+
return A(t, i, o);
|
|
496
496
|
}, s;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function gt(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 yt(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 xt(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 = E(r, a, n, i);
|
|
517
517
|
return t.intersect = function(o) {
|
|
518
|
-
return
|
|
518
|
+
return A(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 xt(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, l = 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(c) {
|
|
524
|
+
const d = F(t, c), g = d.x - t.x;
|
|
525
|
+
if (n != 0 && (Math.abs(g) < t.width / 2 || Math.abs(g) == t.width / 2 && Math.abs(d.y - t.y) > t.height / 2 - i)) {
|
|
526
|
+
let f = i * i * (1 - g * g / (n * n));
|
|
527
|
+
f != 0 && (f = Math.sqrt(f)), f = i - f, c.y - t.y > 0 && (f = -f), d.y += f;
|
|
528
528
|
}
|
|
529
|
-
return
|
|
530
|
-
},
|
|
529
|
+
return d;
|
|
530
|
+
}, l;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
r.shapes().question =
|
|
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;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
r({ question:
|
|
535
|
+
function pe(r) {
|
|
536
|
+
r({ question: ot }), r({ hexagon: lt }), r({ stadium: gt }), r({ subroutine: yt }), r({ cylinder: xt }), r({ rect_left_inv_arrow: dt }), r({ lean_right: ct }), r({ lean_left: ht }), r({ trapezoid: ut }), r({ inv_trapezoid: ft }), r({ rect_right_inv_arrow: pt });
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function E(r, e, t, a) {
|
|
539
539
|
return r.insert("polygon", ":first-child").attr(
|
|
540
540
|
"points",
|
|
541
541
|
a.map(function(n) {
|
|
@@ -543,126 +543,122 @@ function M(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 ge = {
|
|
547
|
+
addToRender: fe,
|
|
548
|
+
addToRenderV2: pe
|
|
549
|
+
}, vt = {}, ye = 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
|
+
}, wt = function(r, e, t, a, n, i) {
|
|
554
|
+
const s = a ? a.select(`[id="${t}"]`) : w(`[id="${t}"]`), o = n || document;
|
|
555
|
+
Object.keys(r).forEach(function(l) {
|
|
556
|
+
const c = r[l];
|
|
557
|
+
let d = "default";
|
|
558
|
+
c.classes.length > 0 && (d = c.classes.join(" "));
|
|
559
|
+
const g = q(c.styles);
|
|
560
|
+
let f = c.text !== void 0 ? c.text : c.id, h;
|
|
561
|
+
if (J(H().flowchart.htmlLabels)) {
|
|
562
562
|
const x = {
|
|
563
|
-
label:
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
// cspell:disable-line
|
|
567
|
-
(k) => `<i class='${k.replace(":", " ")}'></i>`
|
|
568
|
-
),
|
|
569
|
-
R()
|
|
563
|
+
label: f.replace(
|
|
564
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
565
|
+
(v) => `<i class='${v.replace(":", " ")}'></i>`
|
|
570
566
|
)
|
|
571
567
|
};
|
|
572
|
-
|
|
568
|
+
h = et(s, x).node(), h.parentNode.removeChild(h);
|
|
573
569
|
} else {
|
|
574
570
|
const x = o.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
575
|
-
x.setAttribute("style",
|
|
576
|
-
const
|
|
577
|
-
for (const
|
|
578
|
-
const
|
|
579
|
-
|
|
571
|
+
x.setAttribute("style", g.labelStyle.replace("color:", "fill:"));
|
|
572
|
+
const v = f.split(tt.lineBreakRegex);
|
|
573
|
+
for (const S of v) {
|
|
574
|
+
const I = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
575
|
+
I.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), I.setAttribute("dy", "1em"), I.setAttribute("x", "1"), I.textContent = S, x.appendChild(I);
|
|
580
576
|
}
|
|
581
|
-
|
|
577
|
+
h = x;
|
|
582
578
|
}
|
|
583
|
-
let
|
|
584
|
-
switch (
|
|
579
|
+
let p = 0, u = "";
|
|
580
|
+
switch (c.type) {
|
|
585
581
|
case "round":
|
|
586
|
-
|
|
582
|
+
p = 5, u = "rect";
|
|
587
583
|
break;
|
|
588
584
|
case "square":
|
|
589
|
-
|
|
585
|
+
u = "rect";
|
|
590
586
|
break;
|
|
591
587
|
case "diamond":
|
|
592
|
-
|
|
588
|
+
u = "question";
|
|
593
589
|
break;
|
|
594
590
|
case "hexagon":
|
|
595
|
-
|
|
591
|
+
u = "hexagon";
|
|
596
592
|
break;
|
|
597
593
|
case "odd":
|
|
598
|
-
|
|
594
|
+
u = "rect_left_inv_arrow";
|
|
599
595
|
break;
|
|
600
596
|
case "lean_right":
|
|
601
|
-
|
|
597
|
+
u = "lean_right";
|
|
602
598
|
break;
|
|
603
599
|
case "lean_left":
|
|
604
|
-
|
|
600
|
+
u = "lean_left";
|
|
605
601
|
break;
|
|
606
602
|
case "trapezoid":
|
|
607
|
-
|
|
603
|
+
u = "trapezoid";
|
|
608
604
|
break;
|
|
609
605
|
case "inv_trapezoid":
|
|
610
|
-
|
|
606
|
+
u = "inv_trapezoid";
|
|
611
607
|
break;
|
|
612
608
|
case "odd_right":
|
|
613
|
-
|
|
609
|
+
u = "rect_left_inv_arrow";
|
|
614
610
|
break;
|
|
615
611
|
case "circle":
|
|
616
|
-
|
|
612
|
+
u = "circle";
|
|
617
613
|
break;
|
|
618
614
|
case "ellipse":
|
|
619
|
-
|
|
615
|
+
u = "ellipse";
|
|
620
616
|
break;
|
|
621
617
|
case "stadium":
|
|
622
|
-
|
|
618
|
+
u = "stadium";
|
|
623
619
|
break;
|
|
624
620
|
case "subroutine":
|
|
625
|
-
|
|
621
|
+
u = "subroutine";
|
|
626
622
|
break;
|
|
627
623
|
case "cylinder":
|
|
628
|
-
|
|
624
|
+
u = "cylinder";
|
|
629
625
|
break;
|
|
630
626
|
case "group":
|
|
631
|
-
|
|
627
|
+
u = "rect";
|
|
632
628
|
break;
|
|
633
629
|
default:
|
|
634
|
-
|
|
630
|
+
u = "rect";
|
|
635
631
|
}
|
|
636
|
-
U.warn("Adding node",
|
|
632
|
+
U.warn("Adding node", c.id, c.domId), e.setNode(i.db.lookUpDomId(c.id), {
|
|
637
633
|
labelType: "svg",
|
|
638
|
-
labelStyle:
|
|
639
|
-
shape:
|
|
640
|
-
label:
|
|
641
|
-
rx:
|
|
642
|
-
ry:
|
|
643
|
-
class:
|
|
644
|
-
style:
|
|
645
|
-
id: i.db.lookUpDomId(
|
|
634
|
+
labelStyle: g.labelStyle,
|
|
635
|
+
shape: u,
|
|
636
|
+
label: h,
|
|
637
|
+
rx: p,
|
|
638
|
+
ry: p,
|
|
639
|
+
class: d,
|
|
640
|
+
style: g.style,
|
|
641
|
+
id: i.db.lookUpDomId(c.id)
|
|
646
642
|
});
|
|
647
|
-
}
|
|
648
|
-
},
|
|
643
|
+
});
|
|
644
|
+
}, bt = function(r, e, t) {
|
|
649
645
|
let a = 0, n, i;
|
|
650
646
|
if (r.defaultStyle !== void 0) {
|
|
651
|
-
const s =
|
|
647
|
+
const s = q(r.defaultStyle);
|
|
652
648
|
n = s.style, i = s.labelStyle;
|
|
653
649
|
}
|
|
654
|
-
|
|
650
|
+
r.forEach(function(s) {
|
|
655
651
|
a++;
|
|
656
|
-
const o = "L-" + s.start + "-" + s.end,
|
|
657
|
-
s.type === "arrow_open" ?
|
|
658
|
-
let g = "",
|
|
652
|
+
const o = "L-" + s.start + "-" + s.end, l = "LS-" + s.start, c = "LE-" + s.end, d = {};
|
|
653
|
+
s.type === "arrow_open" ? d.arrowhead = "none" : d.arrowhead = "normal";
|
|
654
|
+
let g = "", f = "";
|
|
659
655
|
if (s.style !== void 0) {
|
|
660
|
-
const h =
|
|
661
|
-
g = h.style,
|
|
656
|
+
const h = q(s.style);
|
|
657
|
+
g = h.style, f = h.labelStyle;
|
|
662
658
|
} else
|
|
663
659
|
switch (s.stroke) {
|
|
664
660
|
case "normal":
|
|
665
|
-
g = "fill:none", n !== void 0 && (g = n), i !== void 0 && (
|
|
661
|
+
g = "fill:none", n !== void 0 && (g = n), i !== void 0 && (f = i);
|
|
666
662
|
break;
|
|
667
663
|
case "dotted":
|
|
668
664
|
g = "fill:none;stroke-width:2px;stroke-dasharray:3;";
|
|
@@ -671,32 +667,28 @@ const ye = {
|
|
|
671
667
|
g = " stroke-width: 3.5px;fill:none";
|
|
672
668
|
break;
|
|
673
669
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
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) {
|
|
670
|
+
d.style = g, d.labelStyle = f, s.interpolate !== void 0 ? d.curve = W(s.interpolate, R) : r.defaultInterpolate !== void 0 ? d.curve = W(r.defaultInterpolate, R) : d.curve = W(vt.curve, R), s.text === void 0 ? s.style !== void 0 && (d.arrowheadStyle = "fill: #333") : (d.arrowheadStyle = "fill: #333", d.labelpos = "c", J(H().flowchart.htmlLabels) ? (d.labelType = "html", d.label = `<span id="L-${o}" class="edgeLabel L-${l}' L-${c}" style="${d.labelStyle}">${s.text.replace(
|
|
671
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
672
|
+
(h) => `<i class='${h.replace(":", " ")}'></i>`
|
|
673
|
+
)}</span>`) : (d.labelType = "text", d.label = s.text.replace(tt.lineBreakRegex, `
|
|
674
|
+
`), s.style === void 0 && (d.style = d.style || "stroke: #333; stroke-width: 1.5px;fill:none"), d.labelStyle = d.labelStyle.replace("color:", "fill:"))), d.id = o, d.class = l + " " + c, d.minlen = s.length || 1, e.setEdge(t.db.lookUpDomId(s.start), t.db.lookUpDomId(s.end), d, a);
|
|
675
|
+
});
|
|
676
|
+
}, xe = function(r, e) {
|
|
685
677
|
return U.info("Extracting classes"), e.db.getClasses();
|
|
686
|
-
}, ve =
|
|
678
|
+
}, ve = function(r, e, t, a) {
|
|
687
679
|
U.info("Drawing flowchart");
|
|
688
|
-
const { securityLevel: n, flowchart: i } =
|
|
680
|
+
const { securityLevel: n, flowchart: i } = H();
|
|
689
681
|
let s;
|
|
690
|
-
n === "sandbox" && (s =
|
|
691
|
-
const o = n === "sandbox" ?
|
|
692
|
-
let
|
|
693
|
-
|
|
694
|
-
const
|
|
682
|
+
n === "sandbox" && (s = w("#i" + e));
|
|
683
|
+
const o = n === "sandbox" ? w(s.nodes()[0].contentDocument.body) : w("body"), l = n === "sandbox" ? s.nodes()[0].contentDocument : document;
|
|
684
|
+
let c = a.db.getDirection();
|
|
685
|
+
c === void 0 && (c = "TD");
|
|
686
|
+
const d = i.nodeSpacing || 50, g = i.rankSpacing || 50, f = new kt({
|
|
695
687
|
multigraph: !0,
|
|
696
688
|
compound: !0
|
|
697
689
|
}).setGraph({
|
|
698
|
-
rankdir:
|
|
699
|
-
nodesep:
|
|
690
|
+
rankdir: c,
|
|
691
|
+
nodesep: d,
|
|
700
692
|
ranksep: g,
|
|
701
693
|
marginx: 8,
|
|
702
694
|
marginy: 8
|
|
@@ -707,82 +699,82 @@ const ye = {
|
|
|
707
699
|
const p = a.db.getSubGraphs();
|
|
708
700
|
for (let y = p.length - 1; y >= 0; y--)
|
|
709
701
|
h = p[y], a.db.addVertex(h.id, h.title, "group", void 0, h.classes);
|
|
710
|
-
const
|
|
711
|
-
U.warn("Get vertices",
|
|
712
|
-
const
|
|
713
|
-
let
|
|
714
|
-
for (
|
|
715
|
-
h = p[
|
|
702
|
+
const u = a.db.getVertices();
|
|
703
|
+
U.warn("Get vertices", u);
|
|
704
|
+
const x = a.db.getEdges();
|
|
705
|
+
let v = 0;
|
|
706
|
+
for (v = p.length - 1; v >= 0; v--) {
|
|
707
|
+
h = p[v], Mt("cluster").append("text");
|
|
716
708
|
for (let y = 0; y < h.nodes.length; y++)
|
|
717
709
|
U.warn(
|
|
718
710
|
"Setting subgraph",
|
|
719
711
|
h.nodes[y],
|
|
720
712
|
a.db.lookUpDomId(h.nodes[y]),
|
|
721
713
|
a.db.lookUpDomId(h.id)
|
|
722
|
-
),
|
|
714
|
+
), f.setParent(a.db.lookUpDomId(h.nodes[y]), a.db.lookUpDomId(h.id));
|
|
723
715
|
}
|
|
724
|
-
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
T(
|
|
729
|
-
},
|
|
716
|
+
wt(u, f, e, o, l, a), bt(x, f, a);
|
|
717
|
+
const S = new le();
|
|
718
|
+
ge.addToRender(S), S.arrows().none = function(y, b, _, m) {
|
|
719
|
+
const M = 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");
|
|
720
|
+
T(M, _[m + "Style"]);
|
|
721
|
+
}, S.arrows().normal = function(y, b) {
|
|
730
722
|
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");
|
|
731
723
|
};
|
|
732
|
-
const
|
|
733
|
-
for (
|
|
724
|
+
const I = o.select(`[id="${e}"]`), B = o.select("#" + e + " g");
|
|
725
|
+
for (S(B, f), B.selectAll("g.node").attr("title", function() {
|
|
734
726
|
return a.db.getTooltip(this.id);
|
|
735
|
-
}), a.db.indexNodes("subGraph" +
|
|
736
|
-
if (h = p[
|
|
737
|
-
const y =
|
|
727
|
+
}), a.db.indexNodes("subGraph" + v), v = 0; v < p.length; v++)
|
|
728
|
+
if (h = p[v], h.title !== "undefined") {
|
|
729
|
+
const y = l.querySelectorAll(
|
|
738
730
|
"#" + e + ' [id="' + a.db.lookUpDomId(h.id) + '"] rect'
|
|
739
|
-
), b =
|
|
731
|
+
), b = l.querySelectorAll(
|
|
740
732
|
"#" + e + ' [id="' + a.db.lookUpDomId(h.id) + '"]'
|
|
741
|
-
),
|
|
742
|
-
|
|
743
|
-
for (let
|
|
744
|
-
b[0].classList.add(h.classes[
|
|
733
|
+
), _ = y[0].x.baseVal.value, m = y[0].y.baseVal.value, M = y[0].width.baseVal.value, $ = w(b[0]).select(".label");
|
|
734
|
+
$.attr("transform", `translate(${_ + M / 2}, ${m + 14})`), $.attr("id", e + "Text");
|
|
735
|
+
for (let N = 0; N < h.classes.length; N++)
|
|
736
|
+
b[0].classList.add(h.classes[N]);
|
|
745
737
|
}
|
|
746
738
|
if (!i.htmlLabels) {
|
|
747
|
-
const y =
|
|
739
|
+
const y = l.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
|
|
748
740
|
for (const b of y) {
|
|
749
|
-
const
|
|
750
|
-
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width",
|
|
741
|
+
const _ = b.getBBox(), m = l.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
742
|
+
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", _.width), m.setAttribute("height", _.height), b.insertBefore(m, b.firstChild);
|
|
751
743
|
}
|
|
752
744
|
}
|
|
753
|
-
|
|
754
|
-
const b =
|
|
745
|
+
St(f, I, i.diagramPadding, i.useMaxWidth), Object.keys(u).forEach(function(y) {
|
|
746
|
+
const b = u[y];
|
|
755
747
|
if (b.link) {
|
|
756
|
-
const
|
|
757
|
-
if (
|
|
758
|
-
const m =
|
|
748
|
+
const _ = o.select("#" + e + ' [id="' + a.db.lookUpDomId(y) + '"]');
|
|
749
|
+
if (_) {
|
|
750
|
+
const m = l.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
759
751
|
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);
|
|
760
|
-
const
|
|
752
|
+
const M = _.insert(function() {
|
|
761
753
|
return m;
|
|
762
|
-
}, ":first-child"),
|
|
763
|
-
|
|
764
|
-
return E.node();
|
|
765
|
-
});
|
|
766
|
-
const $ = L.select(".label");
|
|
767
|
-
$ && B.append(function() {
|
|
754
|
+
}, ":first-child"), $ = _.select(".label-container");
|
|
755
|
+
$ && M.append(function() {
|
|
768
756
|
return $.node();
|
|
769
757
|
});
|
|
758
|
+
const N = _.select(".label");
|
|
759
|
+
N && M.append(function() {
|
|
760
|
+
return N.node();
|
|
761
|
+
});
|
|
770
762
|
}
|
|
771
763
|
}
|
|
772
764
|
});
|
|
773
|
-
},
|
|
774
|
-
setConf:
|
|
775
|
-
addVertices:
|
|
776
|
-
addEdges:
|
|
777
|
-
getClasses:
|
|
765
|
+
}, we = {
|
|
766
|
+
setConf: ye,
|
|
767
|
+
addVertices: wt,
|
|
768
|
+
addEdges: bt,
|
|
769
|
+
getClasses: xe,
|
|
778
770
|
draw: ve
|
|
779
771
|
}, Ie = {
|
|
780
|
-
parser:
|
|
781
|
-
db:
|
|
782
|
-
renderer:
|
|
783
|
-
styles:
|
|
772
|
+
parser: mt,
|
|
773
|
+
db: O,
|
|
774
|
+
renderer: Tt,
|
|
775
|
+
styles: Et,
|
|
784
776
|
init: (r) => {
|
|
785
|
-
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute,
|
|
777
|
+
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, we.setConf(r.flowchart), O.clear(), O.setGen("gen-1");
|
|
786
778
|
}
|
|
787
779
|
};
|
|
788
780
|
export {
|