@layers-app/editor 0.5.3 → 0.5.5-optimization
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.js +12 -10
- package/dist/layers.B10sB-Vy.js +1 -0
- package/dist/layers.BDsvvINb.js +6774 -0
- package/dist/layers.BFJ7oQiY.js +7723 -0
- package/dist/layers.BwyONivc.js +864 -0
- package/dist/layers.C2lacXcg.js +2511 -0
- package/dist/layers.C69TrYD7.js +7 -0
- package/dist/layers.CEMW9z_P.js +4 -0
- package/dist/layers.Cwao1pOZ.js +6 -0
- package/dist/layers.CzNz0Zya.js +1 -0
- package/dist/layers.D0Z-zLAV.js +530 -0
- package/dist/layers.DNCgFYS7.js +27 -0
- package/dist/layers.EKDSoJm1.js +2227 -0
- package/dist/layers.QjAkD17S.js +3677 -0
- package/dist/layers.ahDFHQXD.js +341 -0
- package/dist/layers.eLiGm-eZ.js +3 -0
- package/dist/layers.hgliNTDV.js +2 -0
- package/package.json +75 -17
- package/dist/layers.-R5PibOa.js +0 -10
- package/dist/layers.-mkaUFzn.js +0 -65
- package/dist/layers.1XpBjqYP.js +0 -1
- package/dist/layers.2Ibk-yAi.js +0 -10
- package/dist/layers.3DsBPqy5.js +0 -10
- package/dist/layers.4OVSS-76.js +0 -320
- package/dist/layers.52famHy6.js +0 -1
- package/dist/layers.7JqFgE4-.js +0 -15
- package/dist/layers.9Su9jHuK.js +0 -9
- package/dist/layers.9pNaFvaX.js +0 -1
- package/dist/layers.9rNftyw-.js +0 -40
- package/dist/layers.B-6jN1Zn.js +0 -41
- package/dist/layers.B0JnuQf0.js +0 -11
- package/dist/layers.B0dbAkLw.js +0 -11
- package/dist/layers.B19MhDZN.js +0 -1265
- package/dist/layers.B19hGmey.js +0 -1
- package/dist/layers.B1IDMpWZ.js +0 -32
- package/dist/layers.B1VK1Umd.js +0 -41
- package/dist/layers.B2IHCuq4.js +0 -202
- package/dist/layers.B2OBW6d_.js +0 -1
- package/dist/layers.B2RJoL8j.js +0 -8
- package/dist/layers.B3D4g2HH.js +0 -1
- package/dist/layers.B66ctuSP.js +0 -1
- package/dist/layers.B9uP5ibo.js +0 -1619
- package/dist/layers.BAtv1CM7.js +0 -1
- package/dist/layers.BDlQMLta.js +0 -1034
- package/dist/layers.BFlW1eUA.js +0 -1088
- package/dist/layers.BIRU7ZCl.js +0 -35
- package/dist/layers.BIeVwYKL.js +0 -1
- package/dist/layers.BJDrjORS.js +0 -244
- package/dist/layers.BJOHTiQN.js +0 -1
- package/dist/layers.BKLAyg9f.js +0 -34
- package/dist/layers.BKktUt3V.js +0 -425
- package/dist/layers.BLZg3-j8.js +0 -44
- package/dist/layers.BLd2spTm.js +0 -1
- package/dist/layers.BPHDdk7q.js +0 -6
- package/dist/layers.BQYTL9KT.js +0 -4
- package/dist/layers.BSTBZrFn.js +0 -1
- package/dist/layers.BUbQisBD.js +0 -40
- package/dist/layers.BY5MS01o.js +0 -304
- package/dist/layers.BY5x-OCj.js +0 -1359
- package/dist/layers.BZYqdVEt.js +0 -5
- package/dist/layers.B_blLMys.js +0 -7
- package/dist/layers.Bau1Nn-R.js +0 -1
- package/dist/layers.BbCfEXyj.js +0 -55
- package/dist/layers.BdC79PeD.js +0 -8
- package/dist/layers.BeQxuBmo.js +0 -373
- package/dist/layers.BgOa2ZQq.js +0 -7
- package/dist/layers.BhoEY-tV.js +0 -1
- package/dist/layers.BiJ8hfRt.js +0 -1510
- package/dist/layers.BipydXP9.js +0 -437
- package/dist/layers.BjNcxnlF.js +0 -40
- package/dist/layers.BjkZnui0.js +0 -6
- package/dist/layers.BjlXrUqq.js +0 -1
- package/dist/layers.BmEnHWGn.js +0 -1126
- package/dist/layers.Bm_lyqCL.js +0 -6
- package/dist/layers.Bo0o9BXc.js +0 -61
- package/dist/layers.Bowu41KP.js +0 -791
- package/dist/layers.BpVuHPkZ.js +0 -33
- package/dist/layers.BpilXLfW.js +0 -6
- package/dist/layers.BptubpVI.js +0 -37
- package/dist/layers.Bq8EFsFh.js +0 -3
- package/dist/layers.Brr7ESXx.js +0 -2
- package/dist/layers.BsTKIt_N.js +0 -19
- package/dist/layers.BshQq6Az.js +0 -189
- package/dist/layers.BsuVfEWr.js +0 -1
- package/dist/layers.Bwphu0_-.js +0 -41
- package/dist/layers.BxBoiyiz.js +0 -2
- package/dist/layers.BxqlTEGI.js +0 -39
- package/dist/layers.BznUuBVb.js +0 -1
- package/dist/layers.C0Lgw_Sx.js +0 -11688
- package/dist/layers.C24uY6Fe.js +0 -931
- package/dist/layers.C2fRZH80.js +0 -1
- package/dist/layers.C3KcBscd.js +0 -1
- package/dist/layers.C4CXznF_.js +0 -37
- package/dist/layers.C7M6CfP5.js +0 -42
- package/dist/layers.C7eXel2I.js +0 -7
- package/dist/layers.C8_lu5UH.js +0 -23
- package/dist/layers.CAm5BKM7.js +0 -1
- package/dist/layers.CBUXk-09.js +0 -11
- package/dist/layers.CDEWhNHi.js +0 -10
- package/dist/layers.CDL3opya.js +0 -8
- package/dist/layers.CE4FK9O5.js +0 -40
- package/dist/layers.CF-302Fh.js +0 -9
- package/dist/layers.CHZsXQcr.js +0 -1
- package/dist/layers.CHmvLyW1.js +0 -8
- package/dist/layers.CJUngdl8.js +0 -37
- package/dist/layers.CLAvgOJP.js +0 -4
- package/dist/layers.CLgsvcu7.js +0 -10
- package/dist/layers.CM9lYwoQ.js +0 -36
- package/dist/layers.CMMTUOh6.js +0 -39
- package/dist/layers.COYYECPe.js +0 -48146
- package/dist/layers.CQ6g1bgB.js +0 -11
- package/dist/layers.CR1i6QWh.js +0 -803
- package/dist/layers.CRKrzT-Y.js +0 -11
- package/dist/layers.CSNKiqFe.js +0 -8
- package/dist/layers.CSYpl3YM.js +0 -960
- package/dist/layers.CTK5IBtb.js +0 -793
- package/dist/layers.CVUgbWcY.js +0 -21763
- package/dist/layers.CXg7Sg55.js +0 -802
- package/dist/layers.C_RheIIS.js +0 -904
- package/dist/layers.C_eoPPmk.js +0 -13
- package/dist/layers.Ccvu-Dlo.js +0 -1
- package/dist/layers.CdGfvF7V.js +0 -1
- package/dist/layers.Cf9fVqKx.js +0 -21938
- package/dist/layers.Cisk2RXM.js +0 -1
- package/dist/layers.CkXqIRYC.js +0 -38
- package/dist/layers.ClJd7I1M.js +0 -9
- package/dist/layers.ClxhzI7j.js +0 -8
- package/dist/layers.CmqoZAnC.js +0 -2479
- package/dist/layers.CnrBP_N5.js +0 -769
- package/dist/layers.Cob5vYhh.js +0 -5
- package/dist/layers.Coygwekn.js +0 -9
- package/dist/layers.Cp5JhAmO.js +0 -7
- package/dist/layers.CqVTtuYm.js +0 -6
- package/dist/layers.CtHBfow6.js +0 -282
- package/dist/layers.CuoaVZrW.js +0 -41
- package/dist/layers.Cyzu9PKQ.js +0 -1
- package/dist/layers.D-7S1Qn6.js +0 -7
- package/dist/layers.D-cAGd4i.js +0 -41
- package/dist/layers.D-v-3mtK.js +0 -9
- package/dist/layers.D0MGpeyX.js +0 -39
- package/dist/layers.D0lTyC6R.js +0 -35
- package/dist/layers.D0zn4_Mx.js +0 -1
- package/dist/layers.D33cj9e8.js +0 -1
- package/dist/layers.D3A8IuMw.js +0 -42
- package/dist/layers.D40oNXih.js +0 -1580
- package/dist/layers.D4T8fTcj.js +0 -1223
- package/dist/layers.D4ydcUW5.js +0 -7
- package/dist/layers.D7jGxypv.js +0 -8
- package/dist/layers.DByfn15F.js +0 -7
- package/dist/layers.DCrkhQnl.js +0 -9
- package/dist/layers.DDVf9_XJ.js +0 -501
- package/dist/layers.DFF0tKf2.js +0 -9
- package/dist/layers.DGB6f2fp.js +0 -186
- package/dist/layers.DGF-imcj.js +0 -6
- package/dist/layers.DGlLGCMd.js +0 -41
- package/dist/layers.DH7bTclZ.js +0 -1
- package/dist/layers.DHrdv4EX.js +0 -32
- package/dist/layers.DIs-8Ynj.js +0 -35
- package/dist/layers.DIuulfCg.js +0 -32
- package/dist/layers.DJS98Zvr.js +0 -42
- package/dist/layers.DLwuMfdd.js +0 -84
- package/dist/layers.DMh-zb88.js +0 -10
- package/dist/layers.DMkBISW1.js +0 -1
- package/dist/layers.DN9HoVxI.js +0 -18
- package/dist/layers.DNray0Kg.js +0 -51
- package/dist/layers.DO8Lq71I.js +0 -4
- package/dist/layers.DOrgOHBr.js +0 -1
- package/dist/layers.DPg8YVWZ.js +0 -118
- package/dist/layers.DRRAWjJ-.js +0 -84
- package/dist/layers.DSnpK9v9.js +0 -40
- package/dist/layers.DT-qahkC.js +0 -41
- package/dist/layers.DT4gw4t8.js +0 -8
- package/dist/layers.DVjOEkHq.js +0 -295
- package/dist/layers.DW9Z4dLd.js +0 -37
- package/dist/layers.DWIf8ql6.js +0 -8
- package/dist/layers.DWynlv5x.js +0 -1
- package/dist/layers.DXKXZPx3.js +0 -10
- package/dist/layers.DXnKtB68.js +0 -2966
- package/dist/layers.DXr2kWj5.js +0 -36
- package/dist/layers.D_MRmmCY.js +0 -40
- package/dist/layers.D_Q80AXV.js +0 -7
- package/dist/layers.D_i2rLsg.js +0 -46859
- package/dist/layers.D_nCsZyv.js +0 -6
- package/dist/layers.Da1VjmYH.js +0 -122
- package/dist/layers.DaLcxrnP.js +0 -4
- package/dist/layers.DbaKVP5e.js +0 -1
- package/dist/layers.DeIaMdiM.js +0 -2
- package/dist/layers.Df5Qb1Ul.js +0 -220
- package/dist/layers.DfXjhAWm.js +0 -207
- package/dist/layers.Dfev0R1t.js +0 -36
- package/dist/layers.Dfw_b3vF.js +0 -2235
- package/dist/layers.Dh45zDPj.js +0 -7
- package/dist/layers.Di7HIxcn.js +0 -268
- package/dist/layers.DilKJOqa.js +0 -139
- package/dist/layers.DjUOC4st.js +0 -16
- package/dist/layers.DlWfA7qx.js +0 -423
- package/dist/layers.Dlp5s5ci.js +0 -41
- package/dist/layers.Dne14exG.js +0 -14
- package/dist/layers.DqpBjyTk.js +0 -10
- package/dist/layers.DrD0W7B3.js +0 -5
- package/dist/layers.DvdRZk6P.js +0 -39
- package/dist/layers.DxA6ocdw.js +0 -70
- package/dist/layers.DxIjFIXA.js +0 -39
- package/dist/layers.DxzveV49.js +0 -96
- package/dist/layers.Dy1naDTQ.js +0 -14
- package/dist/layers.ETa5WiKT.js +0 -160
- package/dist/layers.G9Ka5gtG.js +0 -39
- package/dist/layers.H0NAWny8.js +0 -33
- package/dist/layers.J8OYHqDO.js +0 -32
- package/dist/layers.JWCLFILJ.js +0 -1
- package/dist/layers.MNsWD8fy.js +0 -139
- package/dist/layers.MbNt5pO7.js +0 -39
- package/dist/layers.MsLi1AaR.js +0 -10
- package/dist/layers.NzblQjNP.js +0 -36
- package/dist/layers.PaRWxJTx.js +0 -1
- package/dist/layers.Pfqcm_x1.js +0 -40
- package/dist/layers.QUgQojU2.js +0 -39
- package/dist/layers.QeRtN6Gq.js +0 -1
- package/dist/layers.Rhe5fmYG.js +0 -38
- package/dist/layers.SuFOjX9h.js +0 -9
- package/dist/layers.UA4MYWds.js +0 -1089
- package/dist/layers.X8WQJwc7.js +0 -70
- package/dist/layers.XOnoorb1.js +0 -116
- package/dist/layers.YS67QCmr.js +0 -40
- package/dist/layers.YfvGPzEu.js +0 -1
- package/dist/layers.ZAlzzwQR.js +0 -59
- package/dist/layers.Zh3IN_BW.js +0 -1283
- package/dist/layers.akd0joBp.js +0 -84
- package/dist/layers.b0h5ZBmD.js +0 -61
- package/dist/layers.bfGibH2F.js +0 -38
- package/dist/layers.chFbbZh9.js +0 -9166
- package/dist/layers.e7K9sNTy.js +0 -32
- package/dist/layers.eOMmuyRq.js +0 -52
- package/dist/layers.f5SObLpT.js +0 -6
- package/dist/layers.ftDLkcXk.js +0 -32
- package/dist/layers.gdeLIrFt.js +0 -10
- package/dist/layers.hGSxVR0w.js +0 -8
- package/dist/layers.hMduvmS1.js +0 -42
- package/dist/layers.hYSHj9J1.js +0 -230
- package/dist/layers.hweLqW3I.js +0 -261
- package/dist/layers.i3cprua-.js +0 -1
- package/dist/layers.lCpg7dOn.js +0 -21
- package/dist/layers.pN-YTLfe.js +0 -1
- package/dist/layers.puGhbMne.js +0 -257
- package/dist/layers.rPpIRTrs.js +0 -39
- package/dist/layers.rfeShEsx.js +0 -40
- package/dist/layers.sf1uvSch.js +0 -1
- package/dist/layers.t3fpEPMO.js +0 -8
- package/dist/layers.v4_WldHC.js +0 -9
- package/dist/layers.vHrsDWns.js +0 -40
- package/dist/layers.yIm62nh0.js +0 -5
- package/dist/layers.z72AWJJl.js +0 -42
- package/dist/layers.zj3cbd1g.js +0 -5
- package/dist/layers.zysZLChz.js +0 -9
package/dist/layers.Bowu41KP.js
DELETED
|
@@ -1,791 +0,0 @@
|
|
|
1
|
-
import { f as $, p as St } from "./layers.BmEnHWGn.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.chFbbZh9.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.BipydXP9.js";
|
|
8
|
-
import { l as Ct } from "./layers.H0NAWny8.js";
|
|
9
|
-
import "./layers.CVUgbWcY.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
|
-
};
|