@layers-app/editor 0.5.6-optimization → 0.5.6
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/README.md +0 -19
- package/dist/index.cjs +2 -2
- package/dist/index.js +10 -12
- package/dist/layers.52famHy6.js +1 -0
- package/dist/layers.59MV1gHs.js +41 -0
- package/dist/layers.6IaGqrl-.js +39 -0
- package/dist/layers.6lqPO-3Z.js +32 -0
- package/dist/layers.7JqFgE4-.js +15 -0
- package/dist/layers.8CsJHG7m.js +139 -0
- package/dist/layers.9pNaFvaX.js +1 -0
- package/dist/layers.AK6shBV6.js +42 -0
- package/dist/layers.AamAEMA7.js +160 -0
- package/dist/layers.B-WGMHL6.js +11 -0
- package/dist/layers.B19hGmey.js +1 -0
- package/dist/layers.B2wUdnez.js +437 -0
- package/dist/layers.B3D4g2HH.js +1 -0
- package/dist/layers.B6FBUZ1Z.js +9 -0
- package/dist/layers.B7-Kk2kp.js +11 -0
- package/dist/layers.B7K7JjK6.js +1510 -0
- package/dist/layers.B7USkgSi.js +6 -0
- package/dist/layers.B7hegMVr.js +1034 -0
- package/dist/layers.BAtv1CM7.js +1 -0
- package/dist/layers.BBSE_YmF.js +37 -0
- package/dist/layers.BCG8kdU-.js +32 -0
- package/dist/layers.BCUz59rh.js +39 -0
- package/dist/layers.BF8ID4w9.js +39 -0
- package/dist/layers.BIZaN3QR.js +7 -0
- package/dist/layers.BIeVwYKL.js +1 -0
- package/dist/layers.BJDrjORS.js +244 -0
- package/dist/layers.BK35bp4_.js +931 -0
- package/dist/layers.BKrHVgKG.js +11 -0
- package/dist/layers.BLd2spTm.js +1 -0
- package/dist/layers.BQj7sYv9.js +4 -0
- package/dist/layers.BSTBZrFn.js +1 -0
- package/dist/layers.BTnY40Hl.js +230 -0
- package/dist/layers.BW6eTqTQ.js +9 -0
- package/dist/layers.BX50pyFe.js +42 -0
- package/dist/layers.BXiMBNCf.js +7 -0
- package/dist/layers.BY0saexf.js +44 -0
- package/dist/layers.BYyHDhdF.js +40 -0
- package/dist/layers.B_SkKQaN.js +7 -0
- package/dist/layers.Bb45BkB7.js +35 -0
- package/dist/layers.BbCfEXyj.js +55 -0
- package/dist/layers.Bbx2DS9P.js +10 -0
- package/dist/layers.BeRqUeUL.js +1 -0
- package/dist/layers.BfBHY8YH.js +8 -0
- package/dist/layers.BfPqzMs9.js +1 -0
- package/dist/layers.Bfqazne8.js +70 -0
- package/dist/layers.BgzFjX4U.js +35 -0
- package/dist/layers.BhL3qtd0.js +1126 -0
- package/dist/layers.BitUjngp.js +11 -0
- package/dist/layers.BmR6H-fP.js +2966 -0
- package/dist/layers.Bn7g95cI.js +39 -0
- package/dist/layers.Bn7hw-zZ.js +13 -0
- package/dist/layers.BnYpz8RW.js +1359 -0
- package/dist/layers.BoIdFEtV.js +186 -0
- package/dist/layers.BorvTy9p.js +33 -0
- package/dist/layers.BpilXLfW.js +6 -0
- package/dist/layers.Bt8HOTA6.js +10 -0
- package/dist/layers.BvVfdnbz.js +41 -0
- package/dist/layers.BzUNMS1L.js +2 -0
- package/dist/layers.C-FZw43o.js +41 -0
- package/dist/layers.C0Lgw_Sx.js +11688 -0
- package/dist/layers.C4ToPutV.js +40 -0
- package/dist/layers.C4wkiWhv.js +8 -0
- package/dist/layers.C5ZDJAAD.js +220 -0
- package/dist/layers.C6P4YEcq.js +257 -0
- package/dist/layers.C7x1USYv.js +139 -0
- package/dist/layers.C8_lu5UH.js +23 -0
- package/dist/layers.C99jO8bw.js +1 -0
- package/dist/layers.C9KoadvU.js +122 -0
- package/dist/layers.C9PwfpMh.js +39 -0
- package/dist/layers.CA8KMZRI.js +1 -0
- package/dist/layers.CAGTppwS.js +4 -0
- package/dist/layers.CAgoPdOX.js +1088 -0
- package/dist/layers.CBb84SJY.js +10 -0
- package/dist/layers.CCaOiFeL.js +9 -0
- package/dist/layers.CChtus6s.js +9 -0
- package/dist/layers.CDpYDf4E.js +41 -0
- package/dist/layers.CElZbgj1.js +61 -0
- package/dist/layers.CFXi5TGg.js +5 -0
- package/dist/layers.CGvSf-pD.js +10 -0
- package/dist/layers.CH7Yhxyl.js +1 -0
- package/dist/layers.CHZsXQcr.js +1 -0
- package/dist/layers.CHbqHHw4.js +10 -0
- package/dist/layers.CIK15Iw8.js +1 -0
- package/dist/layers.CIpcY9uj.js +38 -0
- package/dist/layers.CK2ePV5l.js +1 -0
- package/dist/layers.CKOfAypO.js +1 -0
- package/dist/layers.CKuoZO2o.js +5 -0
- package/dist/layers.CLELtUjk.js +40 -0
- package/dist/layers.CNmEkwvP.js +84 -0
- package/dist/layers.CPJv1Tc9.js +46859 -0
- package/dist/layers.CPlQgHvJ.js +37 -0
- package/dist/layers.CR9KcJml.js +9 -0
- package/dist/layers.CRFf4NzO.js +10 -0
- package/dist/layers.CSI1-wyP.js +1 -0
- package/dist/layers.CTmWmJtN.js +32 -0
- package/dist/layers.CXqT56ec.js +304 -0
- package/dist/layers.CZ5YSh6D.js +8 -0
- package/dist/layers.C_2s_qym.js +3 -0
- package/dist/layers.C_IvrzZ3.js +7 -0
- package/dist/layers.C_fjSuvx.js +1 -0
- package/dist/layers.CaMAncU5.js +423 -0
- package/dist/layers.CcaiUz4r.js +1 -0
- package/dist/layers.Cd1zz9ej.js +39 -0
- package/dist/layers.CeafY0UM.js +37 -0
- package/dist/layers.CfcMk6Ta.js +1 -0
- package/dist/layers.Cfl_HoMI.js +769 -0
- package/dist/layers.CfpNlmP9.js +1 -0
- package/dist/layers.CiTTUiMF.js +8 -0
- package/dist/layers.Cj4cFFtZ.js +189 -0
- package/dist/layers.CmdoC_9-.js +7 -0
- package/dist/layers.CoGB8bed.js +8 -0
- package/dist/layers.Cpy28Z7d.js +35 -0
- package/dist/layers.CqVTtuYm.js +6 -0
- package/dist/layers.Cu93NN5Z.js +41 -0
- package/dist/layers.Cu9NodvY.js +1089 -0
- package/dist/layers.CvBE5BLz.js +118 -0
- package/dist/layers.Cx9zn9dM.js +41 -0
- package/dist/layers.CxJcDiDE.js +65 -0
- package/dist/layers.Cyzu9PKQ.js +1 -0
- package/dist/layers.CzAsjHtw.js +34 -0
- package/dist/layers.D0kgeXsw.js +1619 -0
- package/dist/layers.D0zn4_Mx.js +1 -0
- package/dist/layers.D1Vfjokq.js +32 -0
- package/dist/layers.D1rIvRN6.js +9 -0
- package/dist/layers.D22i1Ls7.js +6 -0
- package/dist/layers.D25D_N3C.js +7 -0
- package/dist/layers.D4T8fTcj.js +1223 -0
- package/dist/layers.D4fXRymr.js +40 -0
- package/dist/layers.D4gUAtLW.js +41 -0
- package/dist/layers.D59PMsKH.js +51 -0
- package/dist/layers.D5_C65FS.js +2479 -0
- package/dist/layers.D5j-6Vz3.js +36 -0
- package/dist/layers.D7ikYTua.js +2235 -0
- package/dist/layers.D7jGxypv.js +8 -0
- package/dist/layers.D7n2QyFM.js +48146 -0
- package/dist/layers.D8fdxG58.js +295 -0
- package/dist/layers.D9h1AMfz.js +8 -0
- package/dist/layers.DAsAtqWK.js +4 -0
- package/dist/layers.DBVrBhF0.js +1 -0
- package/dist/layers.DCWjWRvL.js +9 -0
- package/dist/layers.DD9dfhit.js +40 -0
- package/dist/layers.DHD10kvJ.js +1 -0
- package/dist/layers.DHZBzVaT.js +1283 -0
- package/dist/layers.DHfSJOOW.js +1 -0
- package/dist/layers.DKJQWPVn.js +32 -0
- package/dist/layers.DKUfWSX1.js +904 -0
- package/dist/layers.DLK-HpMV.js +1 -0
- package/dist/layers.DLjZPfF1.js +802 -0
- package/dist/layers.DLwuMfdd.js +84 -0
- package/dist/layers.DMIDFKxo.js +36 -0
- package/dist/layers.DMkBISW1.js +1 -0
- package/dist/layers.DN9HoVxI.js +18 -0
- package/dist/layers.DOrgOHBr.js +1 -0
- package/dist/layers.DRvKjryx.js +1265 -0
- package/dist/layers.DTMLuJKN.js +33 -0
- package/dist/layers.DUJa2ZOS.js +8 -0
- package/dist/layers.DVUWZ8Wt.js +37 -0
- package/dist/layers.DVrOJIL5.js +7 -0
- package/dist/layers.DY6GA9ww.js +9166 -0
- package/dist/layers.D_Imug13.js +8 -0
- package/dist/layers.D_KJI4uf.js +1 -0
- package/dist/layers.D_vzZUhY.js +1 -0
- package/dist/layers.DaCB9yHC.js +4 -0
- package/dist/layers.DbaKVP5e.js +1 -0
- package/dist/layers.DcjluSHw.js +84 -0
- package/dist/layers.De0fDaHO.js +40 -0
- package/dist/layers.DeEGG6FS.js +42 -0
- package/dist/layers.DfFJCPRD.js +373 -0
- package/dist/layers.DfLz3NUP.js +320 -0
- package/dist/layers.DhW2E_US.js +1580 -0
- package/dist/layers.DjUOC4st.js +16 -0
- package/dist/layers.DjbsplkN.js +32 -0
- package/dist/layers.DkaJchxc.js +6 -0
- package/dist/layers.DlGVcszu.js +1 -0
- package/dist/layers.DlfnKTKF.js +42 -0
- package/dist/layers.DnxO-9oO.js +1 -0
- package/dist/layers.DqSkTf9R.js +21763 -0
- package/dist/layers.Dr1JK1_Z.js +202 -0
- package/dist/layers.Dr8zNYOs.js +5 -0
- package/dist/layers.DsiNLArY.js +40 -0
- package/dist/layers.DtP3hMV0.js +10 -0
- package/dist/layers.Du1ZlY6H.js +40 -0
- package/dist/layers.Du8uQ4JH.js +1 -0
- package/dist/layers.DuQ8oZjN.js +1 -0
- package/dist/layers.DuwNlZRl.js +11 -0
- package/dist/layers.Dw7Dmv6Y.js +19 -0
- package/dist/layers.DxA6ocdw.js +70 -0
- package/dist/layers.Dy1naDTQ.js +14 -0
- package/dist/layers.E1TwhuY2.js +791 -0
- package/dist/layers.Eelq_G9Y.js +803 -0
- package/dist/layers.Eodu_OXz.js +2 -0
- package/dist/layers.H36OYk_h.js +5 -0
- package/dist/layers.HVpHwo9E.js +5 -0
- package/dist/layers.I-tmhwFG.js +39 -0
- package/dist/layers.Is4NOcYC.js +9 -0
- package/dist/layers.J20L8tWx.js +501 -0
- package/dist/layers.JWCLFILJ.js +1 -0
- package/dist/layers.Jm82B3Oj.js +116 -0
- package/dist/layers.L60GQ2sb.js +8 -0
- package/dist/layers.LJC22eKQ.js +7 -0
- package/dist/layers.MW6tobI-.js +6 -0
- package/dist/layers.MZ6d0DZp.js +10 -0
- package/dist/layers.M_62Sbj7.js +268 -0
- package/dist/layers.O8Nxijec.js +793 -0
- package/dist/layers.OLlYwVPc.js +14 -0
- package/dist/layers.Pw46DBip.js +59 -0
- package/dist/layers.U98UFPWm.js +207 -0
- package/dist/layers.VXlo2W40.js +36 -0
- package/dist/layers.VlKfhmpq.js +10 -0
- package/dist/layers.YOQy_t6q.js +40 -0
- package/dist/layers.ZoMyFX9M.js +2 -0
- package/dist/layers._1XiIhPh.js +7 -0
- package/dist/layers.ay_dYKjj.js +960 -0
- package/dist/layers.b0h5ZBmD.js +61 -0
- package/dist/layers.dDe6FHmh.js +36 -0
- package/dist/layers.dVkHa3a_.js +39 -0
- package/dist/layers.et7zjoY9.js +52 -0
- package/dist/layers.gryxZo3n.js +10 -0
- package/dist/layers.hPuFhhxl.js +41 -0
- package/dist/layers.hweLqW3I.js +261 -0
- package/dist/layers.kaOt41rd.js +9 -0
- package/dist/layers.lCpg7dOn.js +21 -0
- package/dist/layers.lLFiut9N.js +8 -0
- package/dist/layers.lNSz2AQQ.js +6 -0
- package/dist/layers.mV8zYAS9.js +39 -0
- package/dist/layers.oyyMMK1Q.js +21938 -0
- package/dist/layers.qFWUlMDP.js +282 -0
- package/dist/layers.t46sYkQh.js +96 -0
- package/dist/layers.tdFdnJVX.js +38 -0
- package/dist/layers.u4sk_7sk.js +6 -0
- package/dist/layers.uEa7jWOw.js +42 -0
- package/dist/layers.uKwUcHfW.js +9 -0
- package/dist/layers.v6694Ulr.js +425 -0
- package/dist/layers.xkw2pWfm.js +40 -0
- package/dist/layers.ytXaFkr-.js +1 -0
- package/dist/layers.z5ZNUv1T.js +38 -0
- package/package.json +18 -76
- package/dist/layers.7jmq6tBR.js +0 -2227
- package/dist/layers.B90YwJga.js +0 -4
- package/dist/layers.C03OvlLb.js +0 -6
- package/dist/layers.CJiIq6YQ.js +0 -1
- package/dist/layers.CXffIp2y.js +0 -864
- package/dist/layers.CZPeYQ9g.js +0 -3
- package/dist/layers.CZ_Lt7IL.js +0 -7
- package/dist/layers.Ci1-qkbn.js +0 -341
- package/dist/layers.Cnm-pECN.js +0 -2
- package/dist/layers.D6d62qQ_.js +0 -6774
- package/dist/layers.DNCgFYS7.js +0 -27
- package/dist/layers.Dev6Yrwi.js +0 -530
- package/dist/layers.Dgok89qX.js +0 -1
- package/dist/layers.Dq3o7sh3.js +0 -7723
- package/dist/layers.Duy8YzsH.js +0 -2511
- package/dist/layers.QjAkD17S.js +0 -3677
|
@@ -0,0 +1,791 @@
|
|
|
1
|
+
import { f as $, p as St } from "./layers.BhL3qtd0.js";
|
|
2
|
+
import { d as x, a0 as G, l as M, g as D, Y as Lt, _ as V, $ as W, t as Z, V as tt, j as et } from "./layers.DY6GA9ww.js";
|
|
3
|
+
import * as rt from "lodash-es";
|
|
4
|
+
import { pick as _t, defaults as I } from "lodash-es";
|
|
5
|
+
import { l as Et } from "./layers.D4T8fTcj.js";
|
|
6
|
+
import { G as Tt } from "./layers.BJDrjORS.js";
|
|
7
|
+
import { b as T, c as at, i as nt, d as _, e as st, g as it, f as Nt, a as At, s as Pt } from "./layers.B2wUdnez.js";
|
|
8
|
+
import { l as Ct } from "./layers.DTMLuJKN.js";
|
|
9
|
+
import "./layers.DqSkTf9R.js";
|
|
10
|
+
function It(r) {
|
|
11
|
+
if (!r.ok) throw new Error(r.status + " " + r.statusText);
|
|
12
|
+
return r.text();
|
|
13
|
+
}
|
|
14
|
+
function Bt(r, e) {
|
|
15
|
+
return fetch(r, e).then(It);
|
|
16
|
+
}
|
|
17
|
+
function Mt(r) {
|
|
18
|
+
return (e, t) => Bt(e, t).then((n) => new DOMParser().parseFromString(n, r));
|
|
19
|
+
}
|
|
20
|
+
var Dt = Mt("image/svg+xml"), z = {
|
|
21
|
+
normal: Gt,
|
|
22
|
+
vee: Ot,
|
|
23
|
+
undirected: Ut
|
|
24
|
+
};
|
|
25
|
+
function Rt(r) {
|
|
26
|
+
z = r;
|
|
27
|
+
}
|
|
28
|
+
function Gt(r, e, t, n) {
|
|
29
|
+
var a = 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"), s = a.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
30
|
+
T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
|
|
31
|
+
}
|
|
32
|
+
function Ot(r, e, t, n) {
|
|
33
|
+
var a = 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"), s = a.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");
|
|
34
|
+
T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
|
|
35
|
+
}
|
|
36
|
+
function Ut(r, e, t, n) {
|
|
37
|
+
var a = 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"), s = a.append("path").attr("d", "M 0 5 L 10 5").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
38
|
+
T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
|
|
39
|
+
}
|
|
40
|
+
function $t(r, e) {
|
|
41
|
+
var t = r;
|
|
42
|
+
return t.node().appendChild(e.label), T(t, e.labelStyle), t;
|
|
43
|
+
}
|
|
44
|
+
function Wt(r, e) {
|
|
45
|
+
for (var t = r.append("text"), n = Vt(e.label).split(`
|
|
46
|
+
`), a = 0; a < n.length; a++)
|
|
47
|
+
t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(n[a]);
|
|
48
|
+
return T(t, e.labelStyle), t;
|
|
49
|
+
}
|
|
50
|
+
function Vt(r) {
|
|
51
|
+
for (var e = "", t = !1, n, a = 0; a < r.length; ++a)
|
|
52
|
+
if (n = r[a], t) {
|
|
53
|
+
switch (n) {
|
|
54
|
+
case "n":
|
|
55
|
+
e += `
|
|
56
|
+
`;
|
|
57
|
+
break;
|
|
58
|
+
default:
|
|
59
|
+
e += n;
|
|
60
|
+
}
|
|
61
|
+
t = !1;
|
|
62
|
+
} else n === "\\" ? t = !0 : e += n;
|
|
63
|
+
return e;
|
|
64
|
+
}
|
|
65
|
+
function q(r, e, t) {
|
|
66
|
+
var n = e.label, a = r.append("g");
|
|
67
|
+
e.labelType === "svg" ? $t(a, e) : typeof n != "string" || e.labelType === "html" ? at(a, e) : Wt(a, e);
|
|
68
|
+
var s = a.node().getBBox(), i;
|
|
69
|
+
switch (t) {
|
|
70
|
+
case "top":
|
|
71
|
+
i = -e.height / 2;
|
|
72
|
+
break;
|
|
73
|
+
case "bottom":
|
|
74
|
+
i = e.height / 2 - s.height;
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
i = -s.height / 2;
|
|
78
|
+
}
|
|
79
|
+
return a.attr("transform", "translate(" + -s.width / 2 + "," + i + ")"), a;
|
|
80
|
+
}
|
|
81
|
+
var Y = function(r, e) {
|
|
82
|
+
var t = e.nodes().filter(function(s) {
|
|
83
|
+
return nt(e, s);
|
|
84
|
+
}), n = r.selectAll("g.cluster").data(t, function(s) {
|
|
85
|
+
return s;
|
|
86
|
+
});
|
|
87
|
+
_(n.exit(), e).style("opacity", 0).remove();
|
|
88
|
+
var a = n.enter().append("g").attr("class", "cluster").attr("id", function(s) {
|
|
89
|
+
var i = e.node(s);
|
|
90
|
+
return i.id;
|
|
91
|
+
}).style("opacity", 0).each(function(s) {
|
|
92
|
+
var i = e.node(s), o = x(this);
|
|
93
|
+
x(this).append("rect");
|
|
94
|
+
var c = o.append("g").attr("class", "label");
|
|
95
|
+
q(c, i, i.clusterLabelPos);
|
|
96
|
+
});
|
|
97
|
+
return n = n.merge(a), n = _(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
|
|
98
|
+
var i = e.node(s), o = x(this);
|
|
99
|
+
T(o, i.style);
|
|
100
|
+
}), n;
|
|
101
|
+
};
|
|
102
|
+
function zt(r) {
|
|
103
|
+
Y = r;
|
|
104
|
+
}
|
|
105
|
+
let H = function(r, e) {
|
|
106
|
+
var t = r.selectAll("g.edgeLabel").data(e.edges(), function(a) {
|
|
107
|
+
return st(a);
|
|
108
|
+
}).classed("update", !0);
|
|
109
|
+
t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
|
|
110
|
+
var s = x(this);
|
|
111
|
+
s.select(".label").remove();
|
|
112
|
+
var i = e.edge(a), o = q(s, e.edge(a), 0).classed("label", !0), c = o.node().getBBox();
|
|
113
|
+
i.labelId && o.attr("id", i.labelId), Object.prototype.hasOwnProperty.call(i, "width") || (i.width = c.width), Object.prototype.hasOwnProperty.call(i, "height") || (i.height = c.height);
|
|
114
|
+
});
|
|
115
|
+
var n;
|
|
116
|
+
return t.exit ? n = t.exit() : n = t.selectAll(null), _(n, e).style("opacity", 0).remove(), t;
|
|
117
|
+
};
|
|
118
|
+
function Yt(r) {
|
|
119
|
+
H = r;
|
|
120
|
+
}
|
|
121
|
+
function K(r, e) {
|
|
122
|
+
return r.intersect(e);
|
|
123
|
+
}
|
|
124
|
+
var X = function(r, e, t) {
|
|
125
|
+
var n = r.selectAll("g.edgePath").data(e.edges(), function(i) {
|
|
126
|
+
return st(i);
|
|
127
|
+
}).classed("update", !0), a = qt(n, e);
|
|
128
|
+
Qt(n, e);
|
|
129
|
+
var s = n.merge !== void 0 ? n.merge(a) : n;
|
|
130
|
+
return _(s, e).style("opacity", 1), s.each(function(i) {
|
|
131
|
+
var o = x(this), c = e.edge(i);
|
|
132
|
+
c.elem = this, c.id && o.attr("id", c.id), it(
|
|
133
|
+
o,
|
|
134
|
+
c.class,
|
|
135
|
+
(o.classed("update") ? "update " : "") + "edgePath"
|
|
136
|
+
);
|
|
137
|
+
}), s.selectAll("path.path").each(function(i) {
|
|
138
|
+
var o = e.edge(i);
|
|
139
|
+
o.arrowheadId = rt.uniqueId("arrowhead");
|
|
140
|
+
var c = x(this).attr("marker-end", function() {
|
|
141
|
+
return "url(" + Xt(location.href, o.arrowheadId) + ")";
|
|
142
|
+
}).style("fill", "none");
|
|
143
|
+
_(c, e).attr("d", function(d) {
|
|
144
|
+
return Ft(e, d);
|
|
145
|
+
}), T(c, o.style);
|
|
146
|
+
}), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
|
|
147
|
+
var o = e.edge(i), c = t[o.arrowhead];
|
|
148
|
+
c(x(this), o.arrowheadId, o, "arrowhead");
|
|
149
|
+
}), s;
|
|
150
|
+
};
|
|
151
|
+
function Ht(r) {
|
|
152
|
+
X = r;
|
|
153
|
+
}
|
|
154
|
+
function Xt(r, e) {
|
|
155
|
+
var t = r.split("#")[0];
|
|
156
|
+
return t + "#" + e;
|
|
157
|
+
}
|
|
158
|
+
function Ft(r, e) {
|
|
159
|
+
var t = r.edge(e), n = r.node(e.v), a = r.node(e.w), s = t.points.slice(1, t.points.length - 1);
|
|
160
|
+
return s.unshift(K(n, s[0])), s.push(K(a, s[s.length - 1])), ot(t, s);
|
|
161
|
+
}
|
|
162
|
+
function ot(r, e) {
|
|
163
|
+
var t = (Ct || Dt.line)().x(function(n) {
|
|
164
|
+
return n.x;
|
|
165
|
+
}).y(function(n) {
|
|
166
|
+
return n.y;
|
|
167
|
+
});
|
|
168
|
+
return (t.curve || t.interpolate)(r.curve), t(e);
|
|
169
|
+
}
|
|
170
|
+
function jt(r) {
|
|
171
|
+
var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
|
|
172
|
+
return { x: t.e, y: t.f };
|
|
173
|
+
}
|
|
174
|
+
function qt(r, e) {
|
|
175
|
+
var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
|
|
176
|
+
return t.append("path").attr("class", "path").attr("d", function(n) {
|
|
177
|
+
var a = e.edge(n), s = e.node(n.v).elem, i = rt.range(a.points.length).map(function() {
|
|
178
|
+
return jt(s);
|
|
179
|
+
});
|
|
180
|
+
return ot(a, i);
|
|
181
|
+
}), t.append("defs"), t;
|
|
182
|
+
}
|
|
183
|
+
function Qt(r, e) {
|
|
184
|
+
var t = r.exit();
|
|
185
|
+
_(t, e).style("opacity", 0).remove();
|
|
186
|
+
}
|
|
187
|
+
var F = function(r, e, t) {
|
|
188
|
+
var n = e.nodes().filter(function(i) {
|
|
189
|
+
return !nt(e, i);
|
|
190
|
+
}), a = r.selectAll("g.node").data(n, function(i) {
|
|
191
|
+
return i;
|
|
192
|
+
}).classed("update", !0);
|
|
193
|
+
a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
|
|
194
|
+
var o = e.node(i), c = x(this);
|
|
195
|
+
it(
|
|
196
|
+
c,
|
|
197
|
+
o.class,
|
|
198
|
+
(c.classed("update") ? "update " : "") + "node"
|
|
199
|
+
), c.select("g.label").remove();
|
|
200
|
+
var d = c.append("g").attr("class", "label"), l = q(d, o), y = t[o.shape], h = _t(l.node().getBBox(), "width", "height");
|
|
201
|
+
o.elem = this, o.id && c.attr("id", o.id), o.labelId && d.attr("id", o.labelId), Object.prototype.hasOwnProperty.call(o, "width") && (h.width = o.width), Object.prototype.hasOwnProperty.call(o, "height") && (h.height = o.height), h.width += o.paddingLeft + o.paddingRight, h.height += o.paddingTop + o.paddingBottom, d.attr(
|
|
202
|
+
"transform",
|
|
203
|
+
"translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
|
|
204
|
+
);
|
|
205
|
+
var u = x(this);
|
|
206
|
+
u.select(".label-container").remove();
|
|
207
|
+
var f = y(u, h, o).classed("label-container", !0);
|
|
208
|
+
T(f, o.style);
|
|
209
|
+
var g = f.node().getBBox();
|
|
210
|
+
o.width = g.width, o.height = g.height;
|
|
211
|
+
});
|
|
212
|
+
var s;
|
|
213
|
+
return a.exit ? s = a.exit() : s = a.selectAll(null), _(s, e).style("opacity", 0).remove(), a;
|
|
214
|
+
};
|
|
215
|
+
function Kt(r) {
|
|
216
|
+
F = r;
|
|
217
|
+
}
|
|
218
|
+
function Jt(r, e) {
|
|
219
|
+
var t = r.filter(function() {
|
|
220
|
+
return !x(this).classed("update");
|
|
221
|
+
});
|
|
222
|
+
function n(a) {
|
|
223
|
+
var s = e.node(a);
|
|
224
|
+
return "translate(" + s.x + "," + s.y + ")";
|
|
225
|
+
}
|
|
226
|
+
t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n), _(t.selectAll("rect"), e).attr("width", function(a) {
|
|
227
|
+
return e.node(a).width;
|
|
228
|
+
}).attr("height", function(a) {
|
|
229
|
+
return e.node(a).height;
|
|
230
|
+
}).attr("x", function(a) {
|
|
231
|
+
var s = e.node(a);
|
|
232
|
+
return -s.width / 2;
|
|
233
|
+
}).attr("y", function(a) {
|
|
234
|
+
var s = e.node(a);
|
|
235
|
+
return -s.height / 2;
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
function Zt(r, e) {
|
|
239
|
+
var t = r.filter(function() {
|
|
240
|
+
return !x(this).classed("update");
|
|
241
|
+
});
|
|
242
|
+
function n(a) {
|
|
243
|
+
var s = e.edge(a);
|
|
244
|
+
return Object.prototype.hasOwnProperty.call(s, "x") ? "translate(" + s.x + "," + s.y + ")" : "";
|
|
245
|
+
}
|
|
246
|
+
t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
|
|
247
|
+
}
|
|
248
|
+
function te(r, e) {
|
|
249
|
+
var t = r.filter(function() {
|
|
250
|
+
return !x(this).classed("update");
|
|
251
|
+
});
|
|
252
|
+
function n(a) {
|
|
253
|
+
var s = e.node(a);
|
|
254
|
+
return "translate(" + s.x + "," + s.y + ")";
|
|
255
|
+
}
|
|
256
|
+
t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
|
|
257
|
+
}
|
|
258
|
+
function lt(r, e, t, n) {
|
|
259
|
+
var a = r.x, s = r.y, i = a - n.x, o = s - n.y, c = Math.sqrt(e * e * o * o + t * t * i * i), d = Math.abs(e * t * i / c);
|
|
260
|
+
n.x < a && (d = -d);
|
|
261
|
+
var l = Math.abs(e * t * o / c);
|
|
262
|
+
return n.y < s && (l = -l), { x: a + d, y: s + l };
|
|
263
|
+
}
|
|
264
|
+
function ee(r, e, t) {
|
|
265
|
+
return lt(r, e, e, t);
|
|
266
|
+
}
|
|
267
|
+
function re(r, e, t, n) {
|
|
268
|
+
var a, s, i, o, c, d, l, y, h, u, f, g, p, v, k;
|
|
269
|
+
if (a = e.y - r.y, i = r.x - e.x, c = e.x * r.y - r.x * e.y, h = a * t.x + i * t.y + c, u = a * n.x + i * n.y + c, !(h !== 0 && u !== 0 && J(h, u)) && (s = n.y - t.y, o = t.x - n.x, d = n.x * t.y - t.x * n.y, l = s * r.x + o * r.y + d, y = s * e.x + o * e.y + d, !(l !== 0 && y !== 0 && J(l, y)) && (f = a * o - s * i, f !== 0)))
|
|
270
|
+
return g = Math.abs(f / 2), p = i * d - o * c, v = p < 0 ? (p - g) / f : (p + g) / f, p = s * c - a * d, k = p < 0 ? (p - g) / f : (p + g) / f, { x: v, y: k };
|
|
271
|
+
}
|
|
272
|
+
function J(r, e) {
|
|
273
|
+
return r * e > 0;
|
|
274
|
+
}
|
|
275
|
+
function E(r, e, t) {
|
|
276
|
+
var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
|
|
277
|
+
e.forEach(function(f) {
|
|
278
|
+
i = Math.min(i, f.x), o = Math.min(o, f.y);
|
|
279
|
+
});
|
|
280
|
+
for (var c = n - r.width / 2 - i, d = a - r.height / 2 - o, l = 0; l < e.length; l++) {
|
|
281
|
+
var y = e[l], h = e[l < e.length - 1 ? l + 1 : 0], u = re(
|
|
282
|
+
r,
|
|
283
|
+
t,
|
|
284
|
+
{ x: c + y.x, y: d + y.y },
|
|
285
|
+
{ x: c + h.x, y: d + h.y }
|
|
286
|
+
);
|
|
287
|
+
u && s.push(u);
|
|
288
|
+
}
|
|
289
|
+
return s.length ? (s.length > 1 && s.sort(function(f, g) {
|
|
290
|
+
var p = f.x - t.x, v = f.y - t.y, k = Math.sqrt(p * p + v * v), P = g.x - t.x, L = g.y - t.y, O = Math.sqrt(P * P + L * L);
|
|
291
|
+
return k < O ? -1 : k === O ? 0 : 1;
|
|
292
|
+
}), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
|
|
293
|
+
}
|
|
294
|
+
function Q(r, e) {
|
|
295
|
+
var t = r.x, n = r.y, a = e.x - t, s = e.y - n, i = r.width / 2, o = r.height / 2, c, d;
|
|
296
|
+
return Math.abs(s) * i > Math.abs(a) * o ? (s < 0 && (o = -o), c = s === 0 ? 0 : o * a / s, d = o) : (a < 0 && (i = -i), c = i, d = a === 0 ? 0 : i * s / a), { x: t + c, y: n + d };
|
|
297
|
+
}
|
|
298
|
+
var j = {
|
|
299
|
+
rect: ne,
|
|
300
|
+
ellipse: se,
|
|
301
|
+
circle: ie,
|
|
302
|
+
diamond: oe
|
|
303
|
+
};
|
|
304
|
+
function ae(r) {
|
|
305
|
+
j = r;
|
|
306
|
+
}
|
|
307
|
+
function ne(r, e, t) {
|
|
308
|
+
var n = 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);
|
|
309
|
+
return t.intersect = function(a) {
|
|
310
|
+
return Q(t, a);
|
|
311
|
+
}, n;
|
|
312
|
+
}
|
|
313
|
+
function se(r, e, t) {
|
|
314
|
+
var n = e.width / 2, a = e.height / 2, s = r.insert("ellipse", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("rx", n).attr("ry", a);
|
|
315
|
+
return t.intersect = function(i) {
|
|
316
|
+
return lt(t, n, a, i);
|
|
317
|
+
}, s;
|
|
318
|
+
}
|
|
319
|
+
function ie(r, e, t) {
|
|
320
|
+
var n = Math.max(e.width, e.height) / 2, a = r.insert("circle", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("r", n);
|
|
321
|
+
return t.intersect = function(s) {
|
|
322
|
+
return ee(t, n, s);
|
|
323
|
+
}, a;
|
|
324
|
+
}
|
|
325
|
+
function oe(r, e, t) {
|
|
326
|
+
var n = e.width * Math.SQRT2 / 2, a = e.height * Math.SQRT2 / 2, s = [
|
|
327
|
+
{ x: 0, y: -a },
|
|
328
|
+
{ x: -n, y: 0 },
|
|
329
|
+
{ x: 0, y: a },
|
|
330
|
+
{ x: n, y: 0 }
|
|
331
|
+
], i = r.insert("polygon", ":first-child").attr(
|
|
332
|
+
"points",
|
|
333
|
+
s.map(function(o) {
|
|
334
|
+
return o.x + "," + o.y;
|
|
335
|
+
}).join(" ")
|
|
336
|
+
);
|
|
337
|
+
return t.intersect = function(o) {
|
|
338
|
+
return E(t, s, o);
|
|
339
|
+
}, i;
|
|
340
|
+
}
|
|
341
|
+
function le() {
|
|
342
|
+
var r = function(e, t) {
|
|
343
|
+
he(t);
|
|
344
|
+
var n = B(e, "output"), a = B(n, "clusters"), s = B(n, "edgePaths"), i = H(B(n, "edgeLabels"), t), o = F(B(n, "nodes"), t, j);
|
|
345
|
+
Et(t), te(o, t), Zt(i, t), X(s, t, z);
|
|
346
|
+
var c = Y(a, t);
|
|
347
|
+
Jt(c, t), ue(t);
|
|
348
|
+
};
|
|
349
|
+
return r.createNodes = function(e) {
|
|
350
|
+
return arguments.length ? (Kt(e), r) : F;
|
|
351
|
+
}, r.createClusters = function(e) {
|
|
352
|
+
return arguments.length ? (zt(e), r) : Y;
|
|
353
|
+
}, r.createEdgeLabels = function(e) {
|
|
354
|
+
return arguments.length ? (Yt(e), r) : H;
|
|
355
|
+
}, r.createEdgePaths = function(e) {
|
|
356
|
+
return arguments.length ? (Ht(e), r) : X;
|
|
357
|
+
}, r.shapes = function(e) {
|
|
358
|
+
return arguments.length ? (ae(e), r) : j;
|
|
359
|
+
}, r.arrows = function(e) {
|
|
360
|
+
return arguments.length ? (Rt(e), r) : z;
|
|
361
|
+
}, r;
|
|
362
|
+
}
|
|
363
|
+
var ce = {
|
|
364
|
+
paddingLeft: 10,
|
|
365
|
+
paddingRight: 10,
|
|
366
|
+
paddingTop: 10,
|
|
367
|
+
paddingBottom: 10,
|
|
368
|
+
rx: 0,
|
|
369
|
+
ry: 0,
|
|
370
|
+
shape: "rect"
|
|
371
|
+
}, de = {
|
|
372
|
+
arrowhead: "normal",
|
|
373
|
+
curve: G
|
|
374
|
+
};
|
|
375
|
+
function he(r) {
|
|
376
|
+
r.nodes().forEach((e) => {
|
|
377
|
+
const t = r.node(e);
|
|
378
|
+
!Object.prototype.hasOwnProperty.call(t, "label") && !r.children(e).length && (t.label = e), Object.prototype.hasOwnProperty.call(t, "paddingX") && I(t, {
|
|
379
|
+
paddingLeft: t.paddingX,
|
|
380
|
+
paddingRight: t.paddingX
|
|
381
|
+
}), Object.prototype.hasOwnProperty.call(t, "paddingY") && I(t, {
|
|
382
|
+
paddingTop: t.paddingY,
|
|
383
|
+
paddingBottom: t.paddingY
|
|
384
|
+
}), Object.prototype.hasOwnProperty.call(t, "padding") && I(t, {
|
|
385
|
+
paddingLeft: t.padding,
|
|
386
|
+
paddingRight: t.padding,
|
|
387
|
+
paddingTop: t.padding,
|
|
388
|
+
paddingBottom: t.padding
|
|
389
|
+
}), I(t, ce), ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"].forEach((n) => {
|
|
390
|
+
t[n] = Number(t[n]);
|
|
391
|
+
}), Object.prototype.hasOwnProperty.call(t, "width") && (t._prevWidth = t.width), Object.prototype.hasOwnProperty.call(t, "height") && (t._prevHeight = t.height);
|
|
392
|
+
}), r.edges().forEach(function(e) {
|
|
393
|
+
var t = r.edge(e);
|
|
394
|
+
Object.prototype.hasOwnProperty.call(t, "label") || (t.label = ""), I(t, de);
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
function ue(r) {
|
|
398
|
+
r.nodes().forEach((e) => {
|
|
399
|
+
var t = r.node(e);
|
|
400
|
+
Object.prototype.hasOwnProperty.call(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, Object.prototype.hasOwnProperty.call(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
function B(r, e) {
|
|
404
|
+
var t = r.select("g." + e);
|
|
405
|
+
return t.empty() && (t = r.append("g").attr("class", e)), t;
|
|
406
|
+
}
|
|
407
|
+
function ct(r, e, t) {
|
|
408
|
+
const n = e.width, a = e.height, s = (n + a) * 0.9, i = [
|
|
409
|
+
{ x: s / 2, y: 0 },
|
|
410
|
+
{ x: s, y: -s / 2 },
|
|
411
|
+
{ x: s / 2, y: -s },
|
|
412
|
+
{ x: 0, y: -s / 2 }
|
|
413
|
+
], o = N(r, s, s, i);
|
|
414
|
+
return t.intersect = function(c) {
|
|
415
|
+
return E(t, i, c);
|
|
416
|
+
}, o;
|
|
417
|
+
}
|
|
418
|
+
function dt(r, e, t) {
|
|
419
|
+
const a = e.height, s = a / 4, i = e.width + 2 * s, o = [
|
|
420
|
+
{ x: s, y: 0 },
|
|
421
|
+
{ x: i - s, y: 0 },
|
|
422
|
+
{ x: i, y: -a / 2 },
|
|
423
|
+
{ x: i - s, y: -a },
|
|
424
|
+
{ x: s, y: -a },
|
|
425
|
+
{ x: 0, y: -a / 2 }
|
|
426
|
+
], c = N(r, i, a, o);
|
|
427
|
+
return t.intersect = function(d) {
|
|
428
|
+
return E(t, o, d);
|
|
429
|
+
}, c;
|
|
430
|
+
}
|
|
431
|
+
function ht(r, e, t) {
|
|
432
|
+
const n = e.width, a = e.height, s = [
|
|
433
|
+
{ x: -a / 2, y: 0 },
|
|
434
|
+
{ x: n, y: 0 },
|
|
435
|
+
{ x: n, y: -a },
|
|
436
|
+
{ x: -a / 2, y: -a },
|
|
437
|
+
{ x: 0, y: -a / 2 }
|
|
438
|
+
], i = N(r, n, a, s);
|
|
439
|
+
return t.intersect = function(o) {
|
|
440
|
+
return E(t, s, o);
|
|
441
|
+
}, i;
|
|
442
|
+
}
|
|
443
|
+
function ut(r, e, t) {
|
|
444
|
+
const n = e.width, a = e.height, s = [
|
|
445
|
+
{ x: -2 * a / 6, y: 0 },
|
|
446
|
+
{ x: n - a / 6, y: 0 },
|
|
447
|
+
{ x: n + 2 * a / 6, y: -a },
|
|
448
|
+
{ x: a / 6, y: -a }
|
|
449
|
+
], i = N(r, n, a, s);
|
|
450
|
+
return t.intersect = function(o) {
|
|
451
|
+
return E(t, s, o);
|
|
452
|
+
}, i;
|
|
453
|
+
}
|
|
454
|
+
function pt(r, e, t) {
|
|
455
|
+
const n = e.width, a = e.height, s = [
|
|
456
|
+
{ x: 2 * a / 6, y: 0 },
|
|
457
|
+
{ x: n + a / 6, y: 0 },
|
|
458
|
+
{ x: n - 2 * a / 6, y: -a },
|
|
459
|
+
{ x: -a / 6, y: -a }
|
|
460
|
+
], i = N(r, n, a, s);
|
|
461
|
+
return t.intersect = function(o) {
|
|
462
|
+
return E(t, s, o);
|
|
463
|
+
}, i;
|
|
464
|
+
}
|
|
465
|
+
function ft(r, e, t) {
|
|
466
|
+
const n = e.width, a = e.height, s = [
|
|
467
|
+
{ x: -2 * a / 6, y: 0 },
|
|
468
|
+
{ x: n + 2 * a / 6, y: 0 },
|
|
469
|
+
{ x: n - a / 6, y: -a },
|
|
470
|
+
{ x: a / 6, y: -a }
|
|
471
|
+
], i = N(r, n, a, s);
|
|
472
|
+
return t.intersect = function(o) {
|
|
473
|
+
return E(t, s, o);
|
|
474
|
+
}, i;
|
|
475
|
+
}
|
|
476
|
+
function yt(r, e, t) {
|
|
477
|
+
const n = e.width, a = e.height, s = [
|
|
478
|
+
{ x: a / 6, y: 0 },
|
|
479
|
+
{ x: n - a / 6, y: 0 },
|
|
480
|
+
{ x: n + 2 * a / 6, y: -a },
|
|
481
|
+
{ x: -2 * a / 6, y: -a }
|
|
482
|
+
], i = N(r, n, a, s);
|
|
483
|
+
return t.intersect = function(o) {
|
|
484
|
+
return E(t, s, o);
|
|
485
|
+
}, i;
|
|
486
|
+
}
|
|
487
|
+
function vt(r, e, t) {
|
|
488
|
+
const n = e.width, a = e.height, s = [
|
|
489
|
+
{ x: 0, y: 0 },
|
|
490
|
+
{ x: n + a / 2, y: 0 },
|
|
491
|
+
{ x: n, y: -a / 2 },
|
|
492
|
+
{ x: n + a / 2, y: -a },
|
|
493
|
+
{ x: 0, y: -a }
|
|
494
|
+
], i = N(r, n, a, s);
|
|
495
|
+
return t.intersect = function(o) {
|
|
496
|
+
return E(t, s, o);
|
|
497
|
+
}, i;
|
|
498
|
+
}
|
|
499
|
+
function gt(r, e, t) {
|
|
500
|
+
const n = e.height, a = e.width + n / 4, s = r.insert("rect", ":first-child").attr("rx", n / 2).attr("ry", n / 2).attr("x", -a / 2).attr("y", -n / 2).attr("width", a).attr("height", n);
|
|
501
|
+
return t.intersect = function(i) {
|
|
502
|
+
return Q(t, i);
|
|
503
|
+
}, s;
|
|
504
|
+
}
|
|
505
|
+
function wt(r, e, t) {
|
|
506
|
+
const n = e.width, a = e.height, s = [
|
|
507
|
+
{ x: 0, y: 0 },
|
|
508
|
+
{ x: n, y: 0 },
|
|
509
|
+
{ x: n, y: -a },
|
|
510
|
+
{ x: 0, y: -a },
|
|
511
|
+
{ x: 0, y: 0 },
|
|
512
|
+
{ x: -8, y: 0 },
|
|
513
|
+
{ x: n + 8, y: 0 },
|
|
514
|
+
{ x: n + 8, y: -a },
|
|
515
|
+
{ x: -8, y: -a },
|
|
516
|
+
{ x: -8, y: 0 }
|
|
517
|
+
], i = N(r, n, a, s);
|
|
518
|
+
return t.intersect = function(o) {
|
|
519
|
+
return E(t, s, o);
|
|
520
|
+
}, i;
|
|
521
|
+
}
|
|
522
|
+
function mt(r, e, t) {
|
|
523
|
+
const n = e.width, a = n / 2, s = a / (2.5 + n / 50), i = e.height + s, o = "M 0," + s + " a " + a + "," + s + " 0,0,0 " + n + " 0 a " + a + "," + s + " 0,0,0 " + -n + " 0 l 0," + i + " a " + a + "," + s + " 0,0,0 " + n + " 0 l 0," + -i, c = r.attr("label-offset-y", s).insert("path", ":first-child").attr("d", o).attr("transform", "translate(" + -n / 2 + "," + -(i / 2 + s) + ")");
|
|
524
|
+
return t.intersect = function(d) {
|
|
525
|
+
const l = Q(t, d), y = l.x - t.x;
|
|
526
|
+
if (a != 0 && (Math.abs(y) < t.width / 2 || Math.abs(y) == t.width / 2 && Math.abs(l.y - t.y) > t.height / 2 - s)) {
|
|
527
|
+
let h = s * s * (1 - y * y / (a * a));
|
|
528
|
+
h != 0 && (h = Math.sqrt(h)), h = s - h, d.y - t.y > 0 && (h = -h), l.y += h;
|
|
529
|
+
}
|
|
530
|
+
return l;
|
|
531
|
+
}, c;
|
|
532
|
+
}
|
|
533
|
+
function pe(r) {
|
|
534
|
+
r.shapes().question = ct, r.shapes().hexagon = dt, r.shapes().stadium = gt, r.shapes().subroutine = wt, r.shapes().cylinder = mt, r.shapes().rect_left_inv_arrow = ht, r.shapes().lean_right = ut, r.shapes().lean_left = pt, r.shapes().trapezoid = ft, r.shapes().inv_trapezoid = yt, r.shapes().rect_right_inv_arrow = vt;
|
|
535
|
+
}
|
|
536
|
+
function fe(r) {
|
|
537
|
+
r({ question: ct }), r({ hexagon: dt }), r({ stadium: gt }), r({ subroutine: wt }), r({ cylinder: mt }), r({ rect_left_inv_arrow: ht }), r({ lean_right: ut }), r({ lean_left: pt }), r({ trapezoid: ft }), r({ inv_trapezoid: yt }), r({ rect_right_inv_arrow: vt });
|
|
538
|
+
}
|
|
539
|
+
function N(r, e, t, n) {
|
|
540
|
+
return r.insert("polygon", ":first-child").attr(
|
|
541
|
+
"points",
|
|
542
|
+
n.map(function(a) {
|
|
543
|
+
return a.x + "," + a.y;
|
|
544
|
+
}).join(" ")
|
|
545
|
+
).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
|
|
546
|
+
}
|
|
547
|
+
const ye = {
|
|
548
|
+
addToRender: pe,
|
|
549
|
+
addToRenderV2: fe
|
|
550
|
+
}, xt = {}, ve = function(r) {
|
|
551
|
+
const e = Object.keys(r);
|
|
552
|
+
for (const t of e)
|
|
553
|
+
xt[t] = r[t];
|
|
554
|
+
}, bt = async function(r, e, t, n, a, s) {
|
|
555
|
+
const i = n ? n.select(`[id="${t}"]`) : x(`[id="${t}"]`), o = a || document, c = Object.keys(r);
|
|
556
|
+
for (const d of c) {
|
|
557
|
+
const l = r[d];
|
|
558
|
+
let y = "default";
|
|
559
|
+
l.classes.length > 0 && (y = l.classes.join(" "));
|
|
560
|
+
const h = V(l.styles);
|
|
561
|
+
let u = l.text !== void 0 ? l.text : l.id, f;
|
|
562
|
+
if (Z(D().flowchart.htmlLabels)) {
|
|
563
|
+
const v = {
|
|
564
|
+
label: await tt(
|
|
565
|
+
u.replace(
|
|
566
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
567
|
+
// cspell:disable-line
|
|
568
|
+
(k) => `<i class='${k.replace(":", " ")}'></i>`
|
|
569
|
+
),
|
|
570
|
+
D()
|
|
571
|
+
)
|
|
572
|
+
};
|
|
573
|
+
f = at(i, v).node(), f.parentNode.removeChild(f);
|
|
574
|
+
} else {
|
|
575
|
+
const v = o.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
576
|
+
v.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
|
|
577
|
+
const k = u.split(et.lineBreakRegex);
|
|
578
|
+
for (const P of k) {
|
|
579
|
+
const L = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
580
|
+
L.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), L.setAttribute("dy", "1em"), L.setAttribute("x", "1"), L.textContent = P, v.appendChild(L);
|
|
581
|
+
}
|
|
582
|
+
f = v;
|
|
583
|
+
}
|
|
584
|
+
let g = 0, p = "";
|
|
585
|
+
switch (l.type) {
|
|
586
|
+
case "round":
|
|
587
|
+
g = 5, p = "rect";
|
|
588
|
+
break;
|
|
589
|
+
case "square":
|
|
590
|
+
p = "rect";
|
|
591
|
+
break;
|
|
592
|
+
case "diamond":
|
|
593
|
+
p = "question";
|
|
594
|
+
break;
|
|
595
|
+
case "hexagon":
|
|
596
|
+
p = "hexagon";
|
|
597
|
+
break;
|
|
598
|
+
case "odd":
|
|
599
|
+
p = "rect_left_inv_arrow";
|
|
600
|
+
break;
|
|
601
|
+
case "lean_right":
|
|
602
|
+
p = "lean_right";
|
|
603
|
+
break;
|
|
604
|
+
case "lean_left":
|
|
605
|
+
p = "lean_left";
|
|
606
|
+
break;
|
|
607
|
+
case "trapezoid":
|
|
608
|
+
p = "trapezoid";
|
|
609
|
+
break;
|
|
610
|
+
case "inv_trapezoid":
|
|
611
|
+
p = "inv_trapezoid";
|
|
612
|
+
break;
|
|
613
|
+
case "odd_right":
|
|
614
|
+
p = "rect_left_inv_arrow";
|
|
615
|
+
break;
|
|
616
|
+
case "circle":
|
|
617
|
+
p = "circle";
|
|
618
|
+
break;
|
|
619
|
+
case "ellipse":
|
|
620
|
+
p = "ellipse";
|
|
621
|
+
break;
|
|
622
|
+
case "stadium":
|
|
623
|
+
p = "stadium";
|
|
624
|
+
break;
|
|
625
|
+
case "subroutine":
|
|
626
|
+
p = "subroutine";
|
|
627
|
+
break;
|
|
628
|
+
case "cylinder":
|
|
629
|
+
p = "cylinder";
|
|
630
|
+
break;
|
|
631
|
+
case "group":
|
|
632
|
+
p = "rect";
|
|
633
|
+
break;
|
|
634
|
+
default:
|
|
635
|
+
p = "rect";
|
|
636
|
+
}
|
|
637
|
+
M.warn("Adding node", l.id, l.domId), e.setNode(s.db.lookUpDomId(l.id), {
|
|
638
|
+
labelType: "svg",
|
|
639
|
+
labelStyle: h.labelStyle,
|
|
640
|
+
shape: p,
|
|
641
|
+
label: f,
|
|
642
|
+
rx: g,
|
|
643
|
+
ry: g,
|
|
644
|
+
class: y,
|
|
645
|
+
style: h.style,
|
|
646
|
+
id: s.db.lookUpDomId(l.id)
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
}, kt = async function(r, e, t) {
|
|
650
|
+
let n = 0, a, s;
|
|
651
|
+
if (r.defaultStyle !== void 0) {
|
|
652
|
+
const i = V(r.defaultStyle);
|
|
653
|
+
a = i.style, s = i.labelStyle;
|
|
654
|
+
}
|
|
655
|
+
for (const i of r) {
|
|
656
|
+
n++;
|
|
657
|
+
const o = "L-" + i.start + "-" + i.end, c = "LS-" + i.start, d = "LE-" + i.end, l = {};
|
|
658
|
+
i.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
|
|
659
|
+
let y = "", h = "";
|
|
660
|
+
if (i.style !== void 0) {
|
|
661
|
+
const u = V(i.style);
|
|
662
|
+
y = u.style, h = u.labelStyle;
|
|
663
|
+
} else
|
|
664
|
+
switch (i.stroke) {
|
|
665
|
+
case "normal":
|
|
666
|
+
y = "fill:none", a !== void 0 && (y = a), s !== void 0 && (h = s);
|
|
667
|
+
break;
|
|
668
|
+
case "dotted":
|
|
669
|
+
y = "fill:none;stroke-width:2px;stroke-dasharray:3;";
|
|
670
|
+
break;
|
|
671
|
+
case "thick":
|
|
672
|
+
y = " stroke-width: 3.5px;fill:none";
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
l.style = y, l.labelStyle = h, i.interpolate !== void 0 ? l.curve = W(i.interpolate, G) : r.defaultInterpolate !== void 0 ? l.curve = W(r.defaultInterpolate, G) : l.curve = W(xt.curve, G), i.text === void 0 ? i.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", Z(D().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${await tt(
|
|
676
|
+
i.text.replace(
|
|
677
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
678
|
+
// cspell:disable-line
|
|
679
|
+
(u) => `<i class='${u.replace(":", " ")}'></i>`
|
|
680
|
+
),
|
|
681
|
+
D()
|
|
682
|
+
)}</span>`) : (l.labelType = "text", l.label = i.text.replace(et.lineBreakRegex, `
|
|
683
|
+
`), i.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 = c + " " + d, l.minlen = i.length || 1, e.setEdge(t.db.lookUpDomId(i.start), t.db.lookUpDomId(i.end), l, n);
|
|
684
|
+
}
|
|
685
|
+
}, ge = function(r, e) {
|
|
686
|
+
return M.info("Extracting classes"), e.db.getClasses();
|
|
687
|
+
}, we = async function(r, e, t, n) {
|
|
688
|
+
M.info("Drawing flowchart");
|
|
689
|
+
const { securityLevel: a, flowchart: s } = D();
|
|
690
|
+
let i;
|
|
691
|
+
a === "sandbox" && (i = x("#i" + e));
|
|
692
|
+
const o = a === "sandbox" ? x(i.nodes()[0].contentDocument.body) : x("body"), c = a === "sandbox" ? i.nodes()[0].contentDocument : document;
|
|
693
|
+
let d = n.db.getDirection();
|
|
694
|
+
d === void 0 && (d = "TD");
|
|
695
|
+
const l = s.nodeSpacing || 50, y = s.rankSpacing || 50, h = new Tt({
|
|
696
|
+
multigraph: !0,
|
|
697
|
+
compound: !0
|
|
698
|
+
}).setGraph({
|
|
699
|
+
rankdir: d,
|
|
700
|
+
nodesep: l,
|
|
701
|
+
ranksep: y,
|
|
702
|
+
marginx: 8,
|
|
703
|
+
marginy: 8
|
|
704
|
+
}).setDefaultEdgeLabel(function() {
|
|
705
|
+
return {};
|
|
706
|
+
});
|
|
707
|
+
let u;
|
|
708
|
+
const f = n.db.getSubGraphs();
|
|
709
|
+
for (let w = f.length - 1; w >= 0; w--)
|
|
710
|
+
u = f[w], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
|
|
711
|
+
const g = n.db.getVertices();
|
|
712
|
+
M.warn("Get vertices", g);
|
|
713
|
+
const p = n.db.getEdges();
|
|
714
|
+
let v = 0;
|
|
715
|
+
for (v = f.length - 1; v >= 0; v--) {
|
|
716
|
+
u = f[v], Pt("cluster").append("text");
|
|
717
|
+
for (let w = 0; w < u.nodes.length; w++)
|
|
718
|
+
M.warn(
|
|
719
|
+
"Setting subgraph",
|
|
720
|
+
u.nodes[w],
|
|
721
|
+
n.db.lookUpDomId(u.nodes[w]),
|
|
722
|
+
n.db.lookUpDomId(u.id)
|
|
723
|
+
), h.setParent(n.db.lookUpDomId(u.nodes[w]), n.db.lookUpDomId(u.id));
|
|
724
|
+
}
|
|
725
|
+
await bt(g, h, e, o, c, n), await kt(p, h, n);
|
|
726
|
+
const k = new le();
|
|
727
|
+
ye.addToRender(k), k.arrows().none = function(b, S, m, C) {
|
|
728
|
+
const A = b.append("marker").attr("id", S).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");
|
|
729
|
+
T(A, m[C + "Style"]);
|
|
730
|
+
}, k.arrows().normal = function(b, S) {
|
|
731
|
+
b.append("marker").attr("id", S).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");
|
|
732
|
+
};
|
|
733
|
+
const P = o.select(`[id="${e}"]`), L = o.select("#" + e + " g");
|
|
734
|
+
for (k(L, h), L.selectAll("g.node").attr("title", function() {
|
|
735
|
+
return n.db.getTooltip(this.id);
|
|
736
|
+
}), n.db.indexNodes("subGraph" + v), v = 0; v < f.length; v++)
|
|
737
|
+
if (u = f[v], u.title !== "undefined") {
|
|
738
|
+
const w = c.querySelectorAll(
|
|
739
|
+
"#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
|
|
740
|
+
), b = c.querySelectorAll(
|
|
741
|
+
"#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
|
|
742
|
+
), S = w[0].x.baseVal.value, m = w[0].y.baseVal.value, C = w[0].width.baseVal.value, A = x(b[0]).select(".label");
|
|
743
|
+
A.attr("transform", `translate(${S + C / 2}, ${m + 14})`), A.attr("id", e + "Text");
|
|
744
|
+
for (let U = 0; U < u.classes.length; U++)
|
|
745
|
+
b[0].classList.add(u.classes[U]);
|
|
746
|
+
}
|
|
747
|
+
if (!s.htmlLabels) {
|
|
748
|
+
const w = c.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
|
|
749
|
+
for (const b of w) {
|
|
750
|
+
const S = b.getBBox(), m = c.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
751
|
+
m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", S.width), m.setAttribute("height", S.height), b.insertBefore(m, b.firstChild);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
Lt(h, P, s.diagramPadding, s.useMaxWidth), Object.keys(g).forEach(function(w) {
|
|
755
|
+
const b = g[w];
|
|
756
|
+
if (b.link) {
|
|
757
|
+
const S = o.select("#" + e + ' [id="' + n.db.lookUpDomId(w) + '"]');
|
|
758
|
+
if (S) {
|
|
759
|
+
const m = c.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
760
|
+
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"), a === "sandbox" ? m.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : b.linkTarget && m.setAttributeNS("http://www.w3.org/2000/svg", "target", b.linkTarget);
|
|
761
|
+
const C = S.insert(function() {
|
|
762
|
+
return m;
|
|
763
|
+
}, ":first-child"), R = S.select(".label-container");
|
|
764
|
+
R && C.append(function() {
|
|
765
|
+
return R.node();
|
|
766
|
+
});
|
|
767
|
+
const A = S.select(".label");
|
|
768
|
+
A && C.append(function() {
|
|
769
|
+
return A.node();
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
}, me = {
|
|
775
|
+
setConf: ve,
|
|
776
|
+
addVertices: bt,
|
|
777
|
+
addEdges: kt,
|
|
778
|
+
getClasses: ge,
|
|
779
|
+
draw: we
|
|
780
|
+
}, Ne = {
|
|
781
|
+
parser: St,
|
|
782
|
+
db: $,
|
|
783
|
+
renderer: At,
|
|
784
|
+
styles: Nt,
|
|
785
|
+
init: (r) => {
|
|
786
|
+
r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, me.setConf(r.flowchart), $.clear(), $.setGen("gen-1");
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
export {
|
|
790
|
+
Ne as diagram
|
|
791
|
+
};
|