@kong-ui-public/documentation 0.7.20 → 0.7.21
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/{Tableau10-GLA_9iAD-BMurskAd.js → Tableau10-D7jGxypv-D3w6FIcJ.js} +1 -2
- package/dist/arc-CJ96KFKf-ZAEyyrBI.js +84 -0
- package/dist/{blockDiagram-6b2b5046-ZGxr7RGf-D4pbh8vR.js → blockDiagram-9f4a6865-DOUkHJlG-BPuF5-tK.js} +107 -108
- package/dist/{c4Diagram-b947cdbb-Bo6xALld-D8DXBmHw.js → c4Diagram-ae766693-qW59_Cjl-BSBtINzy.js} +133 -132
- package/dist/{channel-BX3TjCqa-Cdtt6hB1.js → channel-BkEGjNbZ-CzBFLYvk.js} +1 -1
- package/dist/{classDiagram-35230388-C60SAKfJ-FQHXcc4J.js → classDiagram-fb54d2a0-DaEnSnV7-BgUSoTGU.js} +8 -7
- package/dist/{classDiagram-v2-412acd34-CHK1KDqU-CiKmarbv.js → classDiagram-v2-a2b738ad-DVF-sdZH-lL0m0fQD.js} +8 -8
- package/dist/{clone-BSWoNj0I-CW2QP79u.js → clone-Bz5840kP-D3Uvm_gp.js} +1 -1
- package/dist/{createText-423428c9-DeHbckoy-r2CCACGx.js → createText-ca0c5216-DGjoI7Oz-8Az9WSXK.js} +14 -20
- package/dist/documentation.es.js +3 -3
- package/dist/documentation.umd.js +993 -723
- package/dist/{edges-d417c7a0-D7e9Y4V--DVOSTCB5.js → edges-066a5561-ByMuMaff-ipHdGCa_.js} +28 -27
- package/dist/{erDiagram-0ea73325-E3jchkiK-CfTqZxm6.js → erDiagram-09d1c15f-Ctl-zT4O-B9E7LRcs.js} +71 -72
- package/dist/{flowDb-d35e309a-Dch1VW7i-Bk557s4E.js → flowDb-c1833063-nJUM9bYy-B5f_hjwI.js} +4 -4
- package/dist/{flowDiagram-d949d7c1-CxjmKfBF-CuFUEya4.js → flowDiagram-b222e15a-BlrP8xne-DJ_sATm6.js} +339 -333
- package/dist/{flowDiagram-v2-49332944-Duf6j7PN-DgsEJ4Bo.js → flowDiagram-v2-13329dc7-DlqVPxH6-CgXruRZr.js} +5 -5
- package/dist/{flowchart-elk-definition-27cc417a-M-lK4i48-Bs8Ix10e.js → flowchart-elk-definition-ae0efee6-B2FZpaI4-C8o8y5J1.js} +343 -590
- package/dist/{ganttDiagram-5c869e3b-CgjZsm2H-Bon0v47P.js → ganttDiagram-b62c793e-BUkrtLIU-roFbcEhP.js} +513 -534
- package/dist/gitGraphDiagram-942e62fe-BIndO562-dNVJJzzm.js +1264 -0
- package/dist/{graph-Ch18bQn5-BLEKw6WT.js → graph-BN58fiEq-CyCz6HB3.js} +3 -4
- package/dist/{index-8fae9850-kUIz8xNo-CDn9_qZB.js → index-01f381cb-DHHDXut0-C1FToHnX.js} +11 -11
- package/dist/{index-CVS7cBlb.js → index-Dz46e5bv.js} +2354 -2515
- package/dist/{infoDiagram-db7b18fc-BpBtHVy2-DuX4gmA7.js → infoDiagram-94cd232f-CSzv-wTE-Bnonj1Cb.js} +7 -7
- package/dist/{journeyDiagram-d5636530-CZUFMDTA-D5VAFQAG.js → journeyDiagram-6625b456-Ca9U8tWI-DoKEPckV.js} +16 -16
- package/dist/katex-BXNjbZo7-CF_fuFJb.js +11637 -0
- package/dist/{layout-BzV691RN-Br8Ir03a.js → layout-DU4VNk5y-DEbr0_Pk.js} +112 -114
- package/dist/{line-JCh8JM-V-T9MVIZIE.js → line-CwSAou3c-dgS2jcU_.js} +3 -4
- package/dist/{linear-cwTFOJBq-B6q6qtlZ.js → linear-CngEzq0a-B6fRdJQY.js} +70 -94
- package/dist/{mindmap-definition-377f8f1f-BzIPdpBG-DD8FIpST.js → mindmap-definition-307c710a-CvpxqRPj-AB15RcM6.js} +343 -378
- package/dist/{ordinal-MUacOSdK-B1MUT0BL.js → ordinal-DfAQgscy-BEJTu10r.js} +3 -7
- package/dist/{path-Crsf9Nsj-SiSjwXsf.js → path-DLwuMfdd-EbErTa4c.js} +12 -19
- package/dist/{pieDiagram-b0208e96-BQfpnZHG-E8AMqTd3.js → pieDiagram-bb1d19e5-LP-9WGAS-DwilsWxb.js} +61 -61
- package/dist/{quadrantDiagram-0332be45-CNL4JCrn-BYyiYlYH.js → quadrantDiagram-c759a472-B_TsLXO0-BviiuQRe.js} +2 -2
- package/dist/{requirementDiagram-bf7890df-NBqqCuPF-CIHJhGNa.js → requirementDiagram-87253d64-o6jrBKBt-BDXpXGpQ.js} +30 -30
- package/dist/{sankeyDiagram-0acdec17-YE0ROy8d-CU1TmQZx.js → sankeyDiagram-707fac0f-BoEHDAJv-BBNylsjT.js} +44 -58
- package/dist/{sequenceDiagram-c18d009d-Yucxrjw7-D_cnXQcd.js → sequenceDiagram-6894f283-Dsj52Wsi-TDdIX1Wn.js} +845 -812
- package/dist/{stateDiagram-43596fc0-D9IY4Ssi-KJp_o1Vc.js → stateDiagram-5dee940d-COfohDXu-Dra8cHnR.js} +54 -54
- package/dist/{stateDiagram-v2-2ead4f9c-5IZQWbnV-Chm6qgaK.js → stateDiagram-v2-1992cada-v9z1blk7-b2WlcHGI.js} +12 -12
- package/dist/{styles-b2c874b6-pUAi9-OK-C7HwN-ih.js → styles-0784dbeb-DHDYpA72-BTX0XQJ5.js} +24 -24
- package/dist/{styles-7383a064-DLbSva3T-DWY6NPMf.js → styles-483fbfea-DUrqZeOP-BPfiLFkT.js} +140 -137
- package/dist/{styles-6860f46c-DHqkrPDU-JiuD19BB.js → styles-b83b31c9-R9NNyYA0-DnoGi25s.js} +29 -29
- package/dist/{svgDrawCommon-0ee1b4e9-rbw7BPwi-Boin581S.js → svgDrawCommon-5e1cfd1d-DeHC_PTd-44CTrnyq.js} +5 -5
- package/dist/{timeline-definition-d977decf-CtlVf6FF-BqqlH53Y.js → timeline-definition-bf702344-BzpRV6Z8-DHqazJ7N.js} +2 -2
- package/dist/{xychartDiagram-e50adddc-B9qgoJob-CqAKcFLo.js → xychartDiagram-f11f50a6-BMDfQSWf-CixUys_w.js} +40 -40
- package/package.json +6 -6
- package/dist/arc-TomPQHIy-B0wkvDWU.js +0 -86
- package/dist/gitGraphDiagram-b9d81de9-DhOfBQfl-BvCcUYjg.js +0 -1262
package/dist/{flowDiagram-d949d7c1-CxjmKfBF-CuFUEya4.js → flowDiagram-b222e15a-BlrP8xne-DJ_sATm6.js}
RENAMED
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
import { X as
|
|
2
|
-
import { Y as
|
|
3
|
-
import { h as
|
|
4
|
-
import { e as
|
|
5
|
-
import {
|
|
6
|
-
import { P as
|
|
7
|
-
function
|
|
8
|
-
if (!r.ok)
|
|
9
|
-
throw new Error(r.status + " " + r.statusText);
|
|
1
|
+
import { X as kt, j as P } from "./flowDb-c1833063-nJUM9bYy-B5f_hjwI.js";
|
|
2
|
+
import { Y as St, E as S, v as K } from "./graph-BN58fiEq-CyCz6HB3.js";
|
|
3
|
+
import { h as v, o as O, p as J, c as R, r as tt, j as et, l as U, q, t as W, u as _t } from "./index-Dz46e5bv.js";
|
|
4
|
+
import { e as Lt, N as At, V as It, O as Tt, k as C } from "./layout-DU4VNk5y-DEbr0_Pk.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-483fbfea-DUrqZeOP-BPfiLFkT.js";
|
|
6
|
+
import { P as $t } from "./line-CwSAou3c-dgS2jcU_.js";
|
|
7
|
+
function Et(r) {
|
|
8
|
+
if (!r.ok) throw new Error(r.status + " " + r.statusText);
|
|
10
9
|
return r.text();
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
return fetch(r, e).then(
|
|
11
|
+
function Ct(r, e) {
|
|
12
|
+
return fetch(r, e).then(Et);
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
return (e, t) =>
|
|
14
|
+
function Dt(r) {
|
|
15
|
+
return (e, t) => Ct(e, t).then((a) => new DOMParser().parseFromString(a, r));
|
|
17
16
|
}
|
|
18
|
-
var
|
|
19
|
-
normal:
|
|
20
|
-
vee:
|
|
21
|
-
undirected:
|
|
17
|
+
var Ut = Dt("image/svg+xml"), z = {
|
|
18
|
+
normal: Wt,
|
|
19
|
+
vee: Pt,
|
|
20
|
+
undirected: qt
|
|
22
21
|
};
|
|
23
|
-
function
|
|
24
|
-
|
|
22
|
+
function Rt(r) {
|
|
23
|
+
z = r;
|
|
25
24
|
}
|
|
26
|
-
function
|
|
25
|
+
function Wt(r, e, t, a) {
|
|
27
26
|
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
27
|
T(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
|
|
29
28
|
}
|
|
30
|
-
function
|
|
29
|
+
function Pt(r, e, t, a) {
|
|
31
30
|
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
31
|
T(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
|
|
33
32
|
}
|
|
34
|
-
function
|
|
33
|
+
function qt(r, e, t, a) {
|
|
35
34
|
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
35
|
T(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
|
|
37
36
|
}
|
|
38
|
-
function
|
|
37
|
+
function Ot(r, e) {
|
|
39
38
|
var t = r;
|
|
40
39
|
return t.node().appendChild(e.label), T(t, e.labelStyle), t;
|
|
41
40
|
}
|
|
42
|
-
function
|
|
43
|
-
for (var t = r.append("text"), a =
|
|
41
|
+
function zt(r, e) {
|
|
42
|
+
for (var t = r.append("text"), a = Vt(e.label).split(`
|
|
44
43
|
`), n = 0; n < a.length; n++)
|
|
45
44
|
t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(a[n]);
|
|
46
45
|
return T(t, e.labelStyle), t;
|
|
47
46
|
}
|
|
48
|
-
function
|
|
47
|
+
function Vt(r) {
|
|
49
48
|
for (var e = "", t = !1, a, n = 0; n < r.length; ++n)
|
|
50
49
|
if (a = r[n], t) {
|
|
51
50
|
switch (a) {
|
|
@@ -57,13 +56,12 @@ function Yt(r) {
|
|
|
57
56
|
e += a;
|
|
58
57
|
}
|
|
59
58
|
t = !1;
|
|
60
|
-
} else
|
|
61
|
-
a === "\\" ? t = !0 : e += a;
|
|
59
|
+
} else a === "\\" ? t = !0 : e += a;
|
|
62
60
|
return e;
|
|
63
61
|
}
|
|
64
62
|
function G(r, e, t) {
|
|
65
63
|
var a = e.label, n = r.append("g");
|
|
66
|
-
e.labelType === "svg" ?
|
|
64
|
+
e.labelType === "svg" ? Ot(n, e) : typeof a != "string" || e.labelType === "html" ? rt(n, e) : zt(n, e);
|
|
67
65
|
var i = n.node().getBBox(), s;
|
|
68
66
|
switch (t) {
|
|
69
67
|
case "top":
|
|
@@ -77,152 +75,152 @@ function G(r, e, t) {
|
|
|
77
75
|
}
|
|
78
76
|
return n.attr("transform", "translate(" + -i.width / 2 + "," + s + ")"), n;
|
|
79
77
|
}
|
|
80
|
-
var
|
|
78
|
+
var V = function(r, e) {
|
|
81
79
|
var t = e.nodes().filter(function(i) {
|
|
82
|
-
return
|
|
80
|
+
return at(e, i);
|
|
83
81
|
}), a = r.selectAll("g.cluster").data(t, function(i) {
|
|
84
82
|
return i;
|
|
85
83
|
});
|
|
86
|
-
|
|
84
|
+
A(a.exit(), e).style("opacity", 0).remove();
|
|
87
85
|
var n = a.enter().append("g").attr("class", "cluster").attr("id", function(i) {
|
|
88
86
|
var s = e.node(i);
|
|
89
87
|
return s.id;
|
|
90
88
|
}).style("opacity", 0).each(function(i) {
|
|
91
|
-
var s = e.node(i), o =
|
|
92
|
-
|
|
93
|
-
var
|
|
94
|
-
G(
|
|
89
|
+
var s = e.node(i), o = v(this);
|
|
90
|
+
v(this).append("rect");
|
|
91
|
+
var d = o.append("g").attr("class", "label");
|
|
92
|
+
G(d, s, s.clusterLabelPos);
|
|
95
93
|
});
|
|
96
|
-
return a = a.merge(n), a =
|
|
97
|
-
var s = e.node(i), o =
|
|
94
|
+
return a = a.merge(n), a = A(a, e).style("opacity", 1), a.selectAll("rect").each(function(i) {
|
|
95
|
+
var s = e.node(i), o = v(this);
|
|
98
96
|
T(o, s.style);
|
|
99
97
|
}), a;
|
|
100
98
|
};
|
|
101
|
-
function
|
|
102
|
-
|
|
99
|
+
function Xt(r) {
|
|
100
|
+
V = r;
|
|
103
101
|
}
|
|
104
|
-
let
|
|
102
|
+
let X = function(r, e) {
|
|
105
103
|
var t = r.selectAll("g.edgeLabel").data(e.edges(), function(n) {
|
|
106
|
-
return
|
|
104
|
+
return nt(n);
|
|
107
105
|
}).classed("update", !0);
|
|
108
106
|
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 =
|
|
107
|
+
var i = v(this);
|
|
110
108
|
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),
|
|
109
|
+
var s = e.edge(n), o = G(i, e.edge(n), 0).classed("label", !0), d = o.node().getBBox();
|
|
110
|
+
s.labelId && o.attr("id", s.labelId), S(s, "width") || (s.width = d.width), S(s, "height") || (s.height = d.height);
|
|
113
111
|
});
|
|
114
112
|
var a;
|
|
115
|
-
return t.exit ? a = t.exit() : a = t.selectAll(null),
|
|
113
|
+
return t.exit ? a = t.exit() : a = t.selectAll(null), A(a, e).style("opacity", 0).remove(), t;
|
|
116
114
|
};
|
|
117
|
-
function
|
|
118
|
-
|
|
115
|
+
function Yt(r) {
|
|
116
|
+
X = r;
|
|
119
117
|
}
|
|
120
118
|
function Q(r, e) {
|
|
121
119
|
return r.intersect(e);
|
|
122
120
|
}
|
|
123
|
-
var
|
|
121
|
+
var Y = function(r, e, t) {
|
|
124
122
|
var a = r.selectAll("g.edgePath").data(e.edges(), function(s) {
|
|
125
|
-
return
|
|
126
|
-
}).classed("update", !0), n =
|
|
127
|
-
|
|
123
|
+
return nt(s);
|
|
124
|
+
}).classed("update", !0), n = Qt(a, e);
|
|
125
|
+
Zt(a, e);
|
|
128
126
|
var i = a.merge !== void 0 ? a.merge(n) : a;
|
|
129
|
-
return
|
|
130
|
-
var o =
|
|
131
|
-
|
|
127
|
+
return A(i, e).style("opacity", 1), i.each(function(s) {
|
|
128
|
+
var o = v(this), d = e.edge(s);
|
|
129
|
+
d.elem = this, d.id && o.attr("id", d.id), it(
|
|
132
130
|
o,
|
|
133
|
-
|
|
131
|
+
d.class,
|
|
134
132
|
(o.classed("update") ? "update " : "") + "edgePath"
|
|
135
133
|
);
|
|
136
134
|
}), i.selectAll("path.path").each(function(s) {
|
|
137
135
|
var o = e.edge(s);
|
|
138
|
-
o.arrowheadId =
|
|
139
|
-
var
|
|
140
|
-
return "url(" +
|
|
136
|
+
o.arrowheadId = Lt("arrowhead");
|
|
137
|
+
var d = v(this).attr("marker-end", function() {
|
|
138
|
+
return "url(" + Ht(location.href, o.arrowheadId) + ")";
|
|
141
139
|
}).style("fill", "none");
|
|
142
|
-
|
|
143
|
-
return
|
|
144
|
-
}), T(
|
|
140
|
+
A(d, e).attr("d", function(u) {
|
|
141
|
+
return Gt(e, u);
|
|
142
|
+
}), T(d, o.style);
|
|
145
143
|
}), i.selectAll("defs *").remove(), i.selectAll("defs").each(function(s) {
|
|
146
|
-
var o = e.edge(s),
|
|
147
|
-
|
|
144
|
+
var o = e.edge(s), d = t[o.arrowhead];
|
|
145
|
+
d(v(this), o.arrowheadId, o, "arrowhead");
|
|
148
146
|
}), i;
|
|
149
147
|
};
|
|
150
|
-
function
|
|
151
|
-
|
|
148
|
+
function jt(r) {
|
|
149
|
+
Y = r;
|
|
152
150
|
}
|
|
153
|
-
function
|
|
151
|
+
function Ht(r, e) {
|
|
154
152
|
var t = r.split("#")[0];
|
|
155
153
|
return t + "#" + e;
|
|
156
154
|
}
|
|
157
|
-
function
|
|
155
|
+
function Gt(r, e) {
|
|
158
156
|
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])),
|
|
157
|
+
return i.unshift(Q(a, i[0])), i.push(Q(n, i[i.length - 1])), st(t, i);
|
|
160
158
|
}
|
|
161
|
-
function
|
|
162
|
-
var t = (
|
|
159
|
+
function st(r, e) {
|
|
160
|
+
var t = ($t || Ut.line)().x(function(a) {
|
|
163
161
|
return a.x;
|
|
164
162
|
}).y(function(a) {
|
|
165
163
|
return a.y;
|
|
166
164
|
});
|
|
167
165
|
return (t.curve || t.interpolate)(r.curve), t(e);
|
|
168
166
|
}
|
|
169
|
-
function
|
|
167
|
+
function Ft(r) {
|
|
170
168
|
var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
|
|
171
169
|
return { x: t.e, y: t.f };
|
|
172
170
|
}
|
|
173
|
-
function
|
|
171
|
+
function Qt(r, e) {
|
|
174
172
|
var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
|
|
175
173
|
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
|
|
174
|
+
var n = e.edge(a), i = e.node(a.v).elem, s = At(n.points.length).map(function() {
|
|
175
|
+
return Ft(i);
|
|
178
176
|
});
|
|
179
|
-
return
|
|
177
|
+
return st(n, s);
|
|
180
178
|
}), t.append("defs"), t;
|
|
181
179
|
}
|
|
182
|
-
function
|
|
180
|
+
function Zt(r, e) {
|
|
183
181
|
var t = r.exit();
|
|
184
|
-
|
|
182
|
+
A(t, e).style("opacity", 0).remove();
|
|
185
183
|
}
|
|
186
|
-
var
|
|
184
|
+
var j = function(r, e, t) {
|
|
187
185
|
var a = e.nodes().filter(function(s) {
|
|
188
|
-
return !
|
|
186
|
+
return !at(e, s);
|
|
189
187
|
}), n = r.selectAll("g.node").data(a, function(s) {
|
|
190
188
|
return s;
|
|
191
189
|
}).classed("update", !0);
|
|
192
190
|
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
|
-
|
|
191
|
+
var o = e.node(s), d = v(this);
|
|
192
|
+
it(
|
|
193
|
+
d,
|
|
196
194
|
o.class,
|
|
197
|
-
(
|
|
198
|
-
),
|
|
199
|
-
var
|
|
200
|
-
o.elem = this, o.id &&
|
|
195
|
+
(d.classed("update") ? "update " : "") + "node"
|
|
196
|
+
), d.select("g.label").remove();
|
|
197
|
+
var u = d.append("g").attr("class", "label"), l = G(u, o), g = t[o.shape], c = It(l.node().getBBox(), "width", "height");
|
|
198
|
+
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
199
|
"transform",
|
|
202
200
|
"translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
|
|
203
201
|
);
|
|
204
|
-
var h =
|
|
202
|
+
var h = v(this);
|
|
205
203
|
h.select(".label-container").remove();
|
|
206
|
-
var p = g(h,
|
|
204
|
+
var p = g(h, c, o).classed("label-container", !0);
|
|
207
205
|
T(p, o.style);
|
|
208
|
-
var
|
|
209
|
-
o.width =
|
|
206
|
+
var w = p.node().getBBox();
|
|
207
|
+
o.width = w.width, o.height = w.height;
|
|
210
208
|
});
|
|
211
209
|
var i;
|
|
212
|
-
return n.exit ? i = n.exit() : i = n.selectAll(null),
|
|
210
|
+
return n.exit ? i = n.exit() : i = n.selectAll(null), A(i, e).style("opacity", 0).remove(), n;
|
|
213
211
|
};
|
|
214
|
-
function
|
|
215
|
-
|
|
212
|
+
function Kt(r) {
|
|
213
|
+
j = r;
|
|
216
214
|
}
|
|
217
|
-
function
|
|
215
|
+
function Jt(r, e) {
|
|
218
216
|
var t = r.filter(function() {
|
|
219
|
-
return !
|
|
217
|
+
return !v(this).classed("update");
|
|
220
218
|
});
|
|
221
219
|
function a(n) {
|
|
222
220
|
var i = e.node(n);
|
|
223
221
|
return "translate(" + i.x + "," + i.y + ")";
|
|
224
222
|
}
|
|
225
|
-
t.attr("transform", a),
|
|
223
|
+
t.attr("transform", a), A(r, e).style("opacity", 1).attr("transform", a), A(t.selectAll("rect"), e).attr("width", function(n) {
|
|
226
224
|
return e.node(n).width;
|
|
227
225
|
}).attr("height", function(n) {
|
|
228
226
|
return e.node(n).height;
|
|
@@ -234,94 +232,94 @@ function Kt(r, e) {
|
|
|
234
232
|
return -i.height / 2;
|
|
235
233
|
});
|
|
236
234
|
}
|
|
237
|
-
function
|
|
235
|
+
function te(r, e) {
|
|
238
236
|
var t = r.filter(function() {
|
|
239
|
-
return !
|
|
237
|
+
return !v(this).classed("update");
|
|
240
238
|
});
|
|
241
239
|
function a(n) {
|
|
242
240
|
var i = e.edge(n);
|
|
243
|
-
return
|
|
241
|
+
return S(i, "x") ? "translate(" + i.x + "," + i.y + ")" : "";
|
|
244
242
|
}
|
|
245
|
-
t.attr("transform", a),
|
|
243
|
+
t.attr("transform", a), A(r, e).style("opacity", 1).attr("transform", a);
|
|
246
244
|
}
|
|
247
|
-
function
|
|
245
|
+
function ee(r, e) {
|
|
248
246
|
var t = r.filter(function() {
|
|
249
|
-
return !
|
|
247
|
+
return !v(this).classed("update");
|
|
250
248
|
});
|
|
251
249
|
function a(n) {
|
|
252
250
|
var i = e.node(n);
|
|
253
251
|
return "translate(" + i.x + "," + i.y + ")";
|
|
254
252
|
}
|
|
255
|
-
t.attr("transform", a),
|
|
253
|
+
t.attr("transform", a), A(r, e).style("opacity", 1).attr("transform", a);
|
|
256
254
|
}
|
|
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 && (
|
|
255
|
+
function ot(r, e, t, a) {
|
|
256
|
+
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);
|
|
257
|
+
a.x < n && (u = -u);
|
|
258
|
+
var l = Math.abs(e * t * o / d);
|
|
259
|
+
return a.y < i && (l = -l), { x: n + u, y: i + l };
|
|
262
260
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
261
|
+
function re(r, e, t) {
|
|
262
|
+
return ot(r, e, e, t);
|
|
265
263
|
}
|
|
266
|
-
function
|
|
267
|
-
var n, i, s, o,
|
|
268
|
-
if (n = e.y - r.y, s = r.x - e.x,
|
|
269
|
-
return
|
|
264
|
+
function ae(r, e, t, a) {
|
|
265
|
+
var n, i, s, o, d, u, l, g, c, h, p, w, f, x, k;
|
|
266
|
+
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 && Z(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 && Z(l, g)) && (p = n * o - i * s, p !== 0)))
|
|
267
|
+
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
268
|
}
|
|
271
269
|
function Z(r, e) {
|
|
272
270
|
return r * e > 0;
|
|
273
271
|
}
|
|
274
|
-
function
|
|
272
|
+
function I(r, e, t) {
|
|
275
273
|
var a = r.x, n = r.y, i = [], s = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
|
|
276
274
|
e.forEach(function(p) {
|
|
277
275
|
s = Math.min(s, p.x), o = Math.min(o, p.y);
|
|
278
276
|
});
|
|
279
|
-
for (var
|
|
280
|
-
var g = e[
|
|
277
|
+
for (var d = a - r.width / 2 - s, u = n - r.height / 2 - o, l = 0; l < e.length; l++) {
|
|
278
|
+
var g = e[l], c = e[l < e.length - 1 ? l + 1 : 0], h = ae(
|
|
281
279
|
r,
|
|
282
280
|
t,
|
|
283
|
-
{ x:
|
|
284
|
-
{ x:
|
|
281
|
+
{ x: d + g.x, y: u + g.y },
|
|
282
|
+
{ x: d + c.x, y: u + c.y }
|
|
285
283
|
);
|
|
286
284
|
h && i.push(h);
|
|
287
285
|
}
|
|
288
|
-
return i.length ? (i.length > 1 && i.sort(function(p,
|
|
289
|
-
var
|
|
290
|
-
return
|
|
286
|
+
return i.length ? (i.length > 1 && i.sort(function(p, w) {
|
|
287
|
+
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 + _ * _);
|
|
288
|
+
return k < y ? -1 : k === y ? 0 : 1;
|
|
291
289
|
}), i[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
|
|
292
290
|
}
|
|
293
291
|
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:
|
|
292
|
+
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;
|
|
293
|
+
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 };
|
|
294
|
+
}
|
|
295
|
+
var H = {
|
|
296
|
+
rect: ie,
|
|
297
|
+
ellipse: se,
|
|
298
|
+
circle: oe,
|
|
299
|
+
diamond: le
|
|
302
300
|
};
|
|
303
|
-
function
|
|
304
|
-
|
|
301
|
+
function ne(r) {
|
|
302
|
+
H = r;
|
|
305
303
|
}
|
|
306
|
-
function
|
|
304
|
+
function ie(r, e, t) {
|
|
307
305
|
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
306
|
return t.intersect = function(n) {
|
|
309
307
|
return F(t, n);
|
|
310
308
|
}, a;
|
|
311
309
|
}
|
|
312
|
-
function
|
|
310
|
+
function se(r, e, t) {
|
|
313
311
|
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
312
|
return t.intersect = function(s) {
|
|
315
|
-
return
|
|
313
|
+
return ot(t, a, n, s);
|
|
316
314
|
}, i;
|
|
317
315
|
}
|
|
318
|
-
function
|
|
316
|
+
function oe(r, e, t) {
|
|
319
317
|
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
318
|
return t.intersect = function(i) {
|
|
321
|
-
return
|
|
319
|
+
return re(t, a, i);
|
|
322
320
|
}, n;
|
|
323
321
|
}
|
|
324
|
-
function
|
|
322
|
+
function le(r, e, t) {
|
|
325
323
|
var a = e.width * Math.SQRT2 / 2, n = e.height * Math.SQRT2 / 2, i = [
|
|
326
324
|
{ x: 0, y: -n },
|
|
327
325
|
{ x: -a, y: 0 },
|
|
@@ -334,32 +332,32 @@ function oe(r, e, t) {
|
|
|
334
332
|
}).join(" ")
|
|
335
333
|
);
|
|
336
334
|
return t.intersect = function(o) {
|
|
337
|
-
return
|
|
335
|
+
return I(t, i, o);
|
|
338
336
|
}, s;
|
|
339
337
|
}
|
|
340
|
-
function
|
|
338
|
+
function de() {
|
|
341
339
|
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
|
-
|
|
340
|
+
ue(t);
|
|
341
|
+
var a = D(e, "output"), n = D(a, "clusters"), i = D(a, "edgePaths"), s = X(D(a, "edgeLabels"), t), o = j(D(a, "nodes"), t, H);
|
|
342
|
+
Tt(t), ee(o, t), te(s, t), Y(i, t, z);
|
|
343
|
+
var d = V(n, t);
|
|
344
|
+
Jt(d, t), fe(t);
|
|
347
345
|
};
|
|
348
346
|
return r.createNodes = function(e) {
|
|
349
|
-
return arguments.length ? (
|
|
347
|
+
return arguments.length ? (Kt(e), r) : j;
|
|
350
348
|
}, r.createClusters = function(e) {
|
|
351
|
-
return arguments.length ? (
|
|
349
|
+
return arguments.length ? (Xt(e), r) : V;
|
|
352
350
|
}, r.createEdgeLabels = function(e) {
|
|
353
|
-
return arguments.length ? (
|
|
351
|
+
return arguments.length ? (Yt(e), r) : X;
|
|
354
352
|
}, r.createEdgePaths = function(e) {
|
|
355
|
-
return arguments.length ? (
|
|
353
|
+
return arguments.length ? (jt(e), r) : Y;
|
|
356
354
|
}, r.shapes = function(e) {
|
|
357
|
-
return arguments.length ? (
|
|
355
|
+
return arguments.length ? (ne(e), r) : H;
|
|
358
356
|
}, r.arrows = function(e) {
|
|
359
|
-
return arguments.length ? (
|
|
357
|
+
return arguments.length ? (Rt(e), r) : z;
|
|
360
358
|
}, r;
|
|
361
359
|
}
|
|
362
|
-
var
|
|
360
|
+
var ce = {
|
|
363
361
|
paddingLeft: 10,
|
|
364
362
|
paddingRight: 10,
|
|
365
363
|
paddingTop: 10,
|
|
@@ -367,54 +365,54 @@ var de = {
|
|
|
367
365
|
rx: 0,
|
|
368
366
|
ry: 0,
|
|
369
367
|
shape: "rect"
|
|
370
|
-
},
|
|
368
|
+
}, he = {
|
|
371
369
|
arrowhead: "normal",
|
|
372
|
-
curve:
|
|
370
|
+
curve: W
|
|
373
371
|
};
|
|
374
|
-
function
|
|
372
|
+
function ue(r) {
|
|
375
373
|
r.nodes().forEach(function(e) {
|
|
376
374
|
var t = r.node(e);
|
|
377
|
-
!
|
|
375
|
+
!S(t, "label") && !r.children(e).length && (t.label = e), S(t, "paddingX") && C(t, {
|
|
378
376
|
paddingLeft: t.paddingX,
|
|
379
377
|
paddingRight: t.paddingX
|
|
380
|
-
}),
|
|
378
|
+
}), S(t, "paddingY") && C(t, {
|
|
381
379
|
paddingTop: t.paddingY,
|
|
382
380
|
paddingBottom: t.paddingY
|
|
383
|
-
}),
|
|
381
|
+
}), S(t, "padding") && C(t, {
|
|
384
382
|
paddingLeft: t.padding,
|
|
385
383
|
paddingRight: t.padding,
|
|
386
384
|
paddingTop: t.padding,
|
|
387
385
|
paddingBottom: t.padding
|
|
388
|
-
}), C(t,
|
|
386
|
+
}), C(t, ce), K(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(a) {
|
|
389
387
|
t[a] = Number(t[a]);
|
|
390
|
-
}),
|
|
388
|
+
}), S(t, "width") && (t._prevWidth = t.width), S(t, "height") && (t._prevHeight = t.height);
|
|
391
389
|
}), r.edges().forEach(function(e) {
|
|
392
390
|
var t = r.edge(e);
|
|
393
|
-
|
|
391
|
+
S(t, "label") || (t.label = ""), C(t, he);
|
|
394
392
|
});
|
|
395
393
|
}
|
|
396
|
-
function
|
|
394
|
+
function fe(r) {
|
|
397
395
|
K(r.nodes(), function(e) {
|
|
398
396
|
var t = r.node(e);
|
|
399
|
-
|
|
397
|
+
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
398
|
});
|
|
401
399
|
}
|
|
402
400
|
function D(r, e) {
|
|
403
401
|
var t = r.select("g." + e);
|
|
404
402
|
return t.empty() && (t = r.append("g").attr("class", e)), t;
|
|
405
403
|
}
|
|
406
|
-
function
|
|
404
|
+
function lt(r, e, t) {
|
|
407
405
|
const a = e.width, n = e.height, i = (a + n) * 0.9, s = [
|
|
408
406
|
{ x: i / 2, y: 0 },
|
|
409
407
|
{ x: i, y: -i / 2 },
|
|
410
408
|
{ x: i / 2, y: -i },
|
|
411
409
|
{ x: 0, y: -i / 2 }
|
|
412
|
-
], o =
|
|
413
|
-
return t.intersect = function(
|
|
414
|
-
return
|
|
410
|
+
], o = M(r, i, i, s);
|
|
411
|
+
return t.intersect = function(d) {
|
|
412
|
+
return I(t, s, d);
|
|
415
413
|
}, o;
|
|
416
414
|
}
|
|
417
|
-
function
|
|
415
|
+
function dt(r, e, t) {
|
|
418
416
|
const a = e.height, n = a / 4, i = e.width + 2 * n, s = [
|
|
419
417
|
{ x: n, y: 0 },
|
|
420
418
|
{ x: i - n, y: 0 },
|
|
@@ -422,86 +420,86 @@ function lt(r, e, t) {
|
|
|
422
420
|
{ x: i - n, y: -a },
|
|
423
421
|
{ x: n, y: -a },
|
|
424
422
|
{ x: 0, y: -a / 2 }
|
|
425
|
-
], o =
|
|
426
|
-
return t.intersect = function(
|
|
427
|
-
return
|
|
423
|
+
], o = M(r, i, a, s);
|
|
424
|
+
return t.intersect = function(d) {
|
|
425
|
+
return I(t, s, d);
|
|
428
426
|
}, o;
|
|
429
427
|
}
|
|
430
|
-
function
|
|
428
|
+
function ct(r, e, t) {
|
|
431
429
|
const a = e.width, n = e.height, i = [
|
|
432
430
|
{ x: -n / 2, y: 0 },
|
|
433
431
|
{ x: a, y: 0 },
|
|
434
432
|
{ x: a, y: -n },
|
|
435
433
|
{ x: -n / 2, y: -n },
|
|
436
434
|
{ x: 0, y: -n / 2 }
|
|
437
|
-
], s =
|
|
435
|
+
], s = M(r, a, n, i);
|
|
438
436
|
return t.intersect = function(o) {
|
|
439
|
-
return
|
|
437
|
+
return I(t, i, o);
|
|
440
438
|
}, s;
|
|
441
439
|
}
|
|
442
|
-
function
|
|
440
|
+
function ht(r, e, t) {
|
|
443
441
|
const a = e.width, n = e.height, i = [
|
|
444
442
|
{ x: -2 * n / 6, y: 0 },
|
|
445
443
|
{ x: a - n / 6, y: 0 },
|
|
446
444
|
{ x: a + 2 * n / 6, y: -n },
|
|
447
445
|
{ x: n / 6, y: -n }
|
|
448
|
-
], s =
|
|
446
|
+
], s = M(r, a, n, i);
|
|
449
447
|
return t.intersect = function(o) {
|
|
450
|
-
return
|
|
448
|
+
return I(t, i, o);
|
|
451
449
|
}, s;
|
|
452
450
|
}
|
|
453
|
-
function
|
|
451
|
+
function ut(r, e, t) {
|
|
454
452
|
const a = e.width, n = e.height, i = [
|
|
455
453
|
{ x: 2 * n / 6, y: 0 },
|
|
456
454
|
{ x: a + n / 6, y: 0 },
|
|
457
455
|
{ x: a - 2 * n / 6, y: -n },
|
|
458
456
|
{ x: -n / 6, y: -n }
|
|
459
|
-
], s =
|
|
457
|
+
], s = M(r, a, n, i);
|
|
460
458
|
return t.intersect = function(o) {
|
|
461
|
-
return
|
|
459
|
+
return I(t, i, o);
|
|
462
460
|
}, s;
|
|
463
461
|
}
|
|
464
|
-
function
|
|
462
|
+
function ft(r, e, t) {
|
|
465
463
|
const a = e.width, n = e.height, i = [
|
|
466
464
|
{ x: -2 * n / 6, y: 0 },
|
|
467
465
|
{ x: a + 2 * n / 6, y: 0 },
|
|
468
466
|
{ x: a - n / 6, y: -n },
|
|
469
467
|
{ x: n / 6, y: -n }
|
|
470
|
-
], s =
|
|
468
|
+
], s = M(r, a, n, i);
|
|
471
469
|
return t.intersect = function(o) {
|
|
472
|
-
return
|
|
470
|
+
return I(t, i, o);
|
|
473
471
|
}, s;
|
|
474
472
|
}
|
|
475
|
-
function
|
|
473
|
+
function pt(r, e, t) {
|
|
476
474
|
const a = e.width, n = e.height, i = [
|
|
477
475
|
{ x: n / 6, y: 0 },
|
|
478
476
|
{ x: a - n / 6, y: 0 },
|
|
479
477
|
{ x: a + 2 * n / 6, y: -n },
|
|
480
478
|
{ x: -2 * n / 6, y: -n }
|
|
481
|
-
], s =
|
|
479
|
+
], s = M(r, a, n, i);
|
|
482
480
|
return t.intersect = function(o) {
|
|
483
|
-
return
|
|
481
|
+
return I(t, i, o);
|
|
484
482
|
}, s;
|
|
485
483
|
}
|
|
486
|
-
function
|
|
484
|
+
function gt(r, e, t) {
|
|
487
485
|
const a = e.width, n = e.height, i = [
|
|
488
486
|
{ x: 0, y: 0 },
|
|
489
487
|
{ x: a + n / 2, y: 0 },
|
|
490
488
|
{ x: a, y: -n / 2 },
|
|
491
489
|
{ x: a + n / 2, y: -n },
|
|
492
490
|
{ x: 0, y: -n }
|
|
493
|
-
], s =
|
|
491
|
+
], s = M(r, a, n, i);
|
|
494
492
|
return t.intersect = function(o) {
|
|
495
|
-
return
|
|
493
|
+
return I(t, i, o);
|
|
496
494
|
}, s;
|
|
497
495
|
}
|
|
498
|
-
function
|
|
496
|
+
function yt(r, e, t) {
|
|
499
497
|
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
498
|
return t.intersect = function(s) {
|
|
501
499
|
return F(t, s);
|
|
502
500
|
}, i;
|
|
503
501
|
}
|
|
504
|
-
function
|
|
502
|
+
function xt(r, e, t) {
|
|
505
503
|
const a = e.width, n = e.height, i = [
|
|
506
504
|
{ x: 0, y: 0 },
|
|
507
505
|
{ x: a, y: 0 },
|
|
@@ -513,29 +511,29 @@ function yt(r, e, t) {
|
|
|
513
511
|
{ x: a + 8, y: -n },
|
|
514
512
|
{ x: -8, y: -n },
|
|
515
513
|
{ x: -8, y: 0 }
|
|
516
|
-
], s =
|
|
514
|
+
], s = M(r, a, n, i);
|
|
517
515
|
return t.intersect = function(o) {
|
|
518
|
-
return
|
|
516
|
+
return I(t, i, o);
|
|
519
517
|
}, s;
|
|
520
518
|
}
|
|
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
|
-
|
|
519
|
+
function wt(r, e, t) {
|
|
520
|
+
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) + ")");
|
|
521
|
+
return t.intersect = function(u) {
|
|
522
|
+
const l = F(t, u), g = l.x - t.x;
|
|
523
|
+
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)) {
|
|
524
|
+
let c = i * i * (1 - g * g / (n * n));
|
|
525
|
+
c != 0 && (c = Math.sqrt(c)), c = i - c, u.y - t.y > 0 && (c = -c), l.y += c;
|
|
528
526
|
}
|
|
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;
|
|
527
|
+
return l;
|
|
528
|
+
}, d;
|
|
534
529
|
}
|
|
535
530
|
function pe(r) {
|
|
536
|
-
r(
|
|
531
|
+
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;
|
|
532
|
+
}
|
|
533
|
+
function ge(r) {
|
|
534
|
+
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
535
|
}
|
|
538
|
-
function
|
|
536
|
+
function M(r, e, t, a) {
|
|
539
537
|
return r.insert("polygon", ":first-child").attr(
|
|
540
538
|
"points",
|
|
541
539
|
a.map(function(n) {
|
|
@@ -543,122 +541,126 @@ function E(r, e, t, a) {
|
|
|
543
541
|
}).join(" ")
|
|
544
542
|
).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
|
|
545
543
|
}
|
|
546
|
-
const
|
|
547
|
-
addToRender:
|
|
548
|
-
addToRenderV2:
|
|
549
|
-
}, vt = {},
|
|
544
|
+
const ye = {
|
|
545
|
+
addToRender: pe,
|
|
546
|
+
addToRenderV2: ge
|
|
547
|
+
}, vt = {}, xe = function(r) {
|
|
550
548
|
const e = Object.keys(r);
|
|
551
549
|
for (const t of e)
|
|
552
550
|
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(
|
|
551
|
+
}, bt = async function(r, e, t, a, n, i) {
|
|
552
|
+
const s = a ? a.select(`[id="${t}"]`) : v(`[id="${t}"]`), o = n || document, d = Object.keys(r);
|
|
553
|
+
for (const u of d) {
|
|
554
|
+
const l = r[u];
|
|
555
|
+
let g = "default";
|
|
556
|
+
l.classes.length > 0 && (g = l.classes.join(" "));
|
|
557
|
+
const c = O(l.styles);
|
|
558
|
+
let h = l.text !== void 0 ? l.text : l.id, p;
|
|
559
|
+
if (J(R().flowchart.htmlLabels)) {
|
|
562
560
|
const x = {
|
|
563
|
-
label:
|
|
564
|
-
|
|
565
|
-
|
|
561
|
+
label: await tt(
|
|
562
|
+
h.replace(
|
|
563
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
564
|
+
// cspell:disable-line
|
|
565
|
+
(k) => `<i class='${k.replace(":", " ")}'></i>`
|
|
566
|
+
),
|
|
567
|
+
R()
|
|
566
568
|
)
|
|
567
569
|
};
|
|
568
|
-
|
|
570
|
+
p = rt(s, x).node(), p.parentNode.removeChild(p);
|
|
569
571
|
} else {
|
|
570
572
|
const x = o.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
571
|
-
x.setAttribute("style",
|
|
572
|
-
const
|
|
573
|
-
for (const
|
|
574
|
-
const
|
|
575
|
-
|
|
573
|
+
x.setAttribute("style", c.labelStyle.replace("color:", "fill:"));
|
|
574
|
+
const k = h.split(et.lineBreakRegex);
|
|
575
|
+
for (const N of k) {
|
|
576
|
+
const _ = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
577
|
+
_.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), _.setAttribute("dy", "1em"), _.setAttribute("x", "1"), _.textContent = N, x.appendChild(_);
|
|
576
578
|
}
|
|
577
|
-
|
|
579
|
+
p = x;
|
|
578
580
|
}
|
|
579
|
-
let
|
|
580
|
-
switch (
|
|
581
|
+
let w = 0, f = "";
|
|
582
|
+
switch (l.type) {
|
|
581
583
|
case "round":
|
|
582
|
-
|
|
584
|
+
w = 5, f = "rect";
|
|
583
585
|
break;
|
|
584
586
|
case "square":
|
|
585
|
-
|
|
587
|
+
f = "rect";
|
|
586
588
|
break;
|
|
587
589
|
case "diamond":
|
|
588
|
-
|
|
590
|
+
f = "question";
|
|
589
591
|
break;
|
|
590
592
|
case "hexagon":
|
|
591
|
-
|
|
593
|
+
f = "hexagon";
|
|
592
594
|
break;
|
|
593
595
|
case "odd":
|
|
594
|
-
|
|
596
|
+
f = "rect_left_inv_arrow";
|
|
595
597
|
break;
|
|
596
598
|
case "lean_right":
|
|
597
|
-
|
|
599
|
+
f = "lean_right";
|
|
598
600
|
break;
|
|
599
601
|
case "lean_left":
|
|
600
|
-
|
|
602
|
+
f = "lean_left";
|
|
601
603
|
break;
|
|
602
604
|
case "trapezoid":
|
|
603
|
-
|
|
605
|
+
f = "trapezoid";
|
|
604
606
|
break;
|
|
605
607
|
case "inv_trapezoid":
|
|
606
|
-
|
|
608
|
+
f = "inv_trapezoid";
|
|
607
609
|
break;
|
|
608
610
|
case "odd_right":
|
|
609
|
-
|
|
611
|
+
f = "rect_left_inv_arrow";
|
|
610
612
|
break;
|
|
611
613
|
case "circle":
|
|
612
|
-
|
|
614
|
+
f = "circle";
|
|
613
615
|
break;
|
|
614
616
|
case "ellipse":
|
|
615
|
-
|
|
617
|
+
f = "ellipse";
|
|
616
618
|
break;
|
|
617
619
|
case "stadium":
|
|
618
|
-
|
|
620
|
+
f = "stadium";
|
|
619
621
|
break;
|
|
620
622
|
case "subroutine":
|
|
621
|
-
|
|
623
|
+
f = "subroutine";
|
|
622
624
|
break;
|
|
623
625
|
case "cylinder":
|
|
624
|
-
|
|
626
|
+
f = "cylinder";
|
|
625
627
|
break;
|
|
626
628
|
case "group":
|
|
627
|
-
|
|
629
|
+
f = "rect";
|
|
628
630
|
break;
|
|
629
631
|
default:
|
|
630
|
-
|
|
632
|
+
f = "rect";
|
|
631
633
|
}
|
|
632
|
-
U.warn("Adding node",
|
|
634
|
+
U.warn("Adding node", l.id, l.domId), e.setNode(i.db.lookUpDomId(l.id), {
|
|
633
635
|
labelType: "svg",
|
|
634
|
-
labelStyle:
|
|
635
|
-
shape:
|
|
636
|
-
label:
|
|
637
|
-
rx:
|
|
638
|
-
ry:
|
|
639
|
-
class:
|
|
640
|
-
style:
|
|
641
|
-
id: i.db.lookUpDomId(
|
|
636
|
+
labelStyle: c.labelStyle,
|
|
637
|
+
shape: f,
|
|
638
|
+
label: p,
|
|
639
|
+
rx: w,
|
|
640
|
+
ry: w,
|
|
641
|
+
class: g,
|
|
642
|
+
style: c.style,
|
|
643
|
+
id: i.db.lookUpDomId(l.id)
|
|
642
644
|
});
|
|
643
|
-
}
|
|
644
|
-
},
|
|
645
|
+
}
|
|
646
|
+
}, mt = async function(r, e, t) {
|
|
645
647
|
let a = 0, n, i;
|
|
646
648
|
if (r.defaultStyle !== void 0) {
|
|
647
|
-
const s =
|
|
649
|
+
const s = O(r.defaultStyle);
|
|
648
650
|
n = s.style, i = s.labelStyle;
|
|
649
651
|
}
|
|
650
|
-
|
|
652
|
+
for (const s of r) {
|
|
651
653
|
a++;
|
|
652
|
-
const o = "L-" + s.start + "-" + s.end,
|
|
653
|
-
s.type === "arrow_open" ?
|
|
654
|
-
let g = "",
|
|
654
|
+
const o = "L-" + s.start + "-" + s.end, d = "LS-" + s.start, u = "LE-" + s.end, l = {};
|
|
655
|
+
s.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
|
|
656
|
+
let g = "", c = "";
|
|
655
657
|
if (s.style !== void 0) {
|
|
656
|
-
const h =
|
|
657
|
-
g = h.style,
|
|
658
|
+
const h = O(s.style);
|
|
659
|
+
g = h.style, c = h.labelStyle;
|
|
658
660
|
} else
|
|
659
661
|
switch (s.stroke) {
|
|
660
662
|
case "normal":
|
|
661
|
-
g = "fill:none", n !== void 0 && (g = n), i !== void 0 && (
|
|
663
|
+
g = "fill:none", n !== void 0 && (g = n), i !== void 0 && (c = i);
|
|
662
664
|
break;
|
|
663
665
|
case "dotted":
|
|
664
666
|
g = "fill:none;stroke-width:2px;stroke-dasharray:3;";
|
|
@@ -667,28 +669,32 @@ const ge = {
|
|
|
667
669
|
g = " stroke-width: 3.5px;fill:none";
|
|
668
670
|
break;
|
|
669
671
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
672
|
+
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(
|
|
673
|
+
s.text.replace(
|
|
674
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
675
|
+
// cspell:disable-line
|
|
676
|
+
(h) => `<i class='${h.replace(":", " ")}'></i>`
|
|
677
|
+
),
|
|
678
|
+
R()
|
|
679
|
+
)}</span>`) : (l.labelType = "text", l.label = s.text.replace(et.lineBreakRegex, `
|
|
680
|
+
`), 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);
|
|
681
|
+
}
|
|
682
|
+
}, we = function(r, e) {
|
|
677
683
|
return U.info("Extracting classes"), e.db.getClasses();
|
|
678
|
-
}, ve = function(r, e, t, a) {
|
|
684
|
+
}, ve = async function(r, e, t, a) {
|
|
679
685
|
U.info("Drawing flowchart");
|
|
680
|
-
const { securityLevel: n, flowchart: i } =
|
|
686
|
+
const { securityLevel: n, flowchart: i } = R();
|
|
681
687
|
let s;
|
|
682
|
-
n === "sandbox" && (s =
|
|
683
|
-
const o = n === "sandbox" ?
|
|
684
|
-
let
|
|
685
|
-
|
|
686
|
-
const
|
|
688
|
+
n === "sandbox" && (s = v("#i" + e));
|
|
689
|
+
const o = n === "sandbox" ? v(s.nodes()[0].contentDocument.body) : v("body"), d = n === "sandbox" ? s.nodes()[0].contentDocument : document;
|
|
690
|
+
let u = a.db.getDirection();
|
|
691
|
+
u === void 0 && (u = "TD");
|
|
692
|
+
const l = i.nodeSpacing || 50, g = i.rankSpacing || 50, c = new St({
|
|
687
693
|
multigraph: !0,
|
|
688
694
|
compound: !0
|
|
689
695
|
}).setGraph({
|
|
690
|
-
rankdir:
|
|
691
|
-
nodesep:
|
|
696
|
+
rankdir: u,
|
|
697
|
+
nodesep: l,
|
|
692
698
|
ranksep: g,
|
|
693
699
|
marginx: 8,
|
|
694
700
|
marginy: 8
|
|
@@ -699,82 +705,82 @@ const ge = {
|
|
|
699
705
|
const p = a.db.getSubGraphs();
|
|
700
706
|
for (let y = p.length - 1; y >= 0; y--)
|
|
701
707
|
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[
|
|
708
|
+
const w = a.db.getVertices();
|
|
709
|
+
U.warn("Get vertices", w);
|
|
710
|
+
const f = a.db.getEdges();
|
|
711
|
+
let x = 0;
|
|
712
|
+
for (x = p.length - 1; x >= 0; x--) {
|
|
713
|
+
h = p[x], Bt("cluster").append("text");
|
|
708
714
|
for (let y = 0; y < h.nodes.length; y++)
|
|
709
715
|
U.warn(
|
|
710
716
|
"Setting subgraph",
|
|
711
717
|
h.nodes[y],
|
|
712
718
|
a.db.lookUpDomId(h.nodes[y]),
|
|
713
719
|
a.db.lookUpDomId(h.id)
|
|
714
|
-
),
|
|
720
|
+
), c.setParent(a.db.lookUpDomId(h.nodes[y]), a.db.lookUpDomId(h.id));
|
|
715
721
|
}
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
const
|
|
720
|
-
T(
|
|
721
|
-
},
|
|
722
|
+
await bt(w, c, e, o, d, a), await mt(f, c, a);
|
|
723
|
+
const k = new de();
|
|
724
|
+
ye.addToRender(k), k.arrows().none = function(y, b, L, m) {
|
|
725
|
+
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");
|
|
726
|
+
T(B, L[m + "Style"]);
|
|
727
|
+
}, k.arrows().normal = function(y, b) {
|
|
722
728
|
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
729
|
};
|
|
724
|
-
const
|
|
725
|
-
for (
|
|
730
|
+
const N = o.select(`[id="${e}"]`), _ = o.select("#" + e + " g");
|
|
731
|
+
for (k(_, c), _.selectAll("g.node").attr("title", function() {
|
|
726
732
|
return a.db.getTooltip(this.id);
|
|
727
|
-
}), a.db.indexNodes("subGraph" +
|
|
728
|
-
if (h = p[
|
|
729
|
-
const y =
|
|
733
|
+
}), a.db.indexNodes("subGraph" + x), x = 0; x < p.length; x++)
|
|
734
|
+
if (h = p[x], h.title !== "undefined") {
|
|
735
|
+
const y = d.querySelectorAll(
|
|
730
736
|
"#" + e + ' [id="' + a.db.lookUpDomId(h.id) + '"] rect'
|
|
731
|
-
), b =
|
|
737
|
+
), b = d.querySelectorAll(
|
|
732
738
|
"#" + e + ' [id="' + a.db.lookUpDomId(h.id) + '"]'
|
|
733
|
-
),
|
|
734
|
-
|
|
735
|
-
for (let
|
|
736
|
-
b[0].classList.add(h.classes[
|
|
739
|
+
), L = y[0].x.baseVal.value, m = y[0].y.baseVal.value, B = y[0].width.baseVal.value, E = v(b[0]).select(".label");
|
|
740
|
+
E.attr("transform", `translate(${L + B / 2}, ${m + 14})`), E.attr("id", e + "Text");
|
|
741
|
+
for (let $ = 0; $ < h.classes.length; $++)
|
|
742
|
+
b[0].classList.add(h.classes[$]);
|
|
737
743
|
}
|
|
738
744
|
if (!i.htmlLabels) {
|
|
739
|
-
const y =
|
|
745
|
+
const y = d.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
|
|
740
746
|
for (const b of y) {
|
|
741
|
-
const
|
|
742
|
-
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width",
|
|
747
|
+
const L = b.getBBox(), m = d.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
748
|
+
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", L.width), m.setAttribute("height", L.height), b.insertBefore(m, b.firstChild);
|
|
743
749
|
}
|
|
744
750
|
}
|
|
745
|
-
|
|
746
|
-
const b =
|
|
751
|
+
_t(c, N, i.diagramPadding, i.useMaxWidth), Object.keys(w).forEach(function(y) {
|
|
752
|
+
const b = w[y];
|
|
747
753
|
if (b.link) {
|
|
748
|
-
const
|
|
749
|
-
if (
|
|
750
|
-
const m =
|
|
754
|
+
const L = o.select("#" + e + ' [id="' + a.db.lookUpDomId(y) + '"]');
|
|
755
|
+
if (L) {
|
|
756
|
+
const m = d.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
751
757
|
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
|
|
758
|
+
const B = L.insert(function() {
|
|
753
759
|
return m;
|
|
754
|
-
}, ":first-child"),
|
|
755
|
-
|
|
756
|
-
return
|
|
760
|
+
}, ":first-child"), E = L.select(".label-container");
|
|
761
|
+
E && B.append(function() {
|
|
762
|
+
return E.node();
|
|
757
763
|
});
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
return
|
|
764
|
+
const $ = L.select(".label");
|
|
765
|
+
$ && B.append(function() {
|
|
766
|
+
return $.node();
|
|
761
767
|
});
|
|
762
768
|
}
|
|
763
769
|
}
|
|
764
770
|
});
|
|
765
|
-
},
|
|
766
|
-
setConf:
|
|
767
|
-
addVertices:
|
|
768
|
-
addEdges:
|
|
769
|
-
getClasses:
|
|
771
|
+
}, be = {
|
|
772
|
+
setConf: xe,
|
|
773
|
+
addVertices: bt,
|
|
774
|
+
addEdges: mt,
|
|
775
|
+
getClasses: we,
|
|
770
776
|
draw: ve
|
|
771
777
|
}, Ie = {
|
|
772
|
-
parser:
|
|
773
|
-
db:
|
|
774
|
-
renderer:
|
|
775
|
-
styles:
|
|
778
|
+
parser: kt,
|
|
779
|
+
db: P,
|
|
780
|
+
renderer: Mt,
|
|
781
|
+
styles: Nt,
|
|
776
782
|
init: (r) => {
|
|
777
|
-
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute,
|
|
783
|
+
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, be.setConf(r.flowchart), P.clear(), P.setGen("gen-1");
|
|
778
784
|
}
|
|
779
785
|
};
|
|
780
786
|
export {
|