@kong-ui-public/documentation 1.4.17-pr.2640.fb8bab909.0 → 1.4.17
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/_basePickBy-BCsiP0lE-DJBdvZNn.js +151 -0
- package/dist/{_baseUniq-SAfYgIkf-buEvGj9H.js → _baseUniq-CsvgMmt0-CCBG5z_B.js} +165 -165
- package/dist/arc-DYb5Ak6k-js8YHzj6.js +83 -0
- package/dist/architecture-U656AL7Q-LZu-yAfZ-CQD6AyxA.js +5 -0
- package/dist/architectureDiagram-KFL7JDKH-BK_an8l5-D20M_MXF.js +4665 -0
- package/dist/blockDiagram-ZYB65J3Q-C0KtqCEe-pwEm3-ie.js +2265 -0
- package/dist/{c4Diagram-6F5ED5ID-D5yqWyf0-DzlUmurv.js → c4Diagram-AAMF2YG6-DYHWlrmc-C6NWDsTV.js} +4 -4
- package/dist/{channel-bVcNKbrJ-NqcPkfCx.js → channel-3QVQMCTA-BwyrTaJi.js} +1 -1
- package/dist/{chunk-TMUBEWPD-BRIzn5gH-alZ9Sg3f.js → chunk-ANTBXLJU-BhR1MDfy-Bec7kb00.js} +1 -1
- package/dist/{chunk-KFBOBJHC-nixdujtH-CrTZo7r-.js → chunk-FHKO5MBM-z_nuC8Da-Dge2Nbr5.js} +1 -1
- package/dist/chunk-GLLZNHP4-DgwBbAOT-BUrsAxH8.js +19 -0
- package/dist/chunk-JBRWN2VN-CHua2TSC-BYWS19Oz.js +1374 -0
- package/dist/chunk-LXBSTHXV-CoED0jHL-Cc8w4JL1.js +1382 -0
- package/dist/chunk-NRVI72HA-DxsqT4Dt-Bo_vu9qn.js +20 -0
- package/dist/{chunk-ASOPGD6M-B5bA_saK-BiT875Ve.js → chunk-OMD6QJNC-_VI6zVGr-Bb4P7zNG.js} +1 -1
- package/dist/chunk-WVR4S24B-C4HIWky3-CkJ0DHSJ.js +8 -0
- package/dist/classDiagram-3BZAVTQC-DrmNjTt_-CS9fxl_R.js +16 -0
- package/dist/classDiagram-v2-QTMF73CY-DrmNjTt_-CS9fxl_R.js +16 -0
- package/dist/{clone-_5SW34SG-DOuhA6mG.js → clone-C0dvnYv6-BozdSvey.js} +1 -1
- package/dist/cytoscape.esm-CjI2IsL8-DYIumutE.js +18721 -0
- package/dist/{dagre-4EVJKHTY-CcAruc30-B3UMlKNl.js → dagre-2BBEFEWP-Bh_bYuL8-Cej31YXN.js} +53 -53
- package/dist/defaultLocale-D7EN2tov-CK6dgF7Y.js +171 -0
- package/dist/diagram-4IRLE6MV-34TaesxP-XfF-gcP2.js +533 -0
- package/dist/diagram-GUPCWM2R-Cr4-5_uX-B8mxM1Uc.js +143 -0
- package/dist/diagram-RP2FKANI-COpvHjzI-C-_mZxuk.js +221 -0
- package/dist/documentation.es.js +1 -1
- package/dist/documentation.umd.js +860 -399
- package/dist/erDiagram-HZWUO2LU-Cu2MerRS-KziSgDQg.js +840 -0
- package/dist/flowDiagram-THRYKUMA-CfrQTB8C-BYn8LF24.js +1627 -0
- package/dist/ganttDiagram-WV7ZQ7D5-gkieebY_-C7YOriZ4.js +2504 -0
- package/dist/gitGraph-F6HP7TQM-suE5ufvy-CQDQV2yP.js +5 -0
- package/dist/{gitGraphDiagram-NRZ2UAAF-B-t90-9e-BkGPAEnk.js → gitGraphDiagram-OJR772UL-CYA7EIoU-Bqc1qZk4.js} +103 -103
- package/dist/{graph-BYZMvqpu-BXRs5843.js → graph-B_1gOUDz-Dm6REFzZ.js} +2 -2
- package/dist/{index-CMZig9xg.js → index-BDD0CD9m.js} +9834 -9540
- package/dist/info-NVLQJR56-CdsHk-Jf-tf8zb8tD.js +5 -0
- package/dist/infoDiagram-6WOFNB3A-ajp3t5Lm-D80dGo5F.js +24 -0
- package/dist/{journeyDiagram-G5WM74LC-BE7U42Ad-y6YegUqL.js → journeyDiagram-FFXJYRFH-kgCEEPLo-CakI8CyJ.js} +357 -333
- package/dist/{kanban-definition-QRCXZQQD-C-5-UNRm-BOYYKTAB.js → kanban-definition-KOZQBZVT-CmM4CHe6-rjuufCiO.js} +75 -73
- package/dist/{katex-Qk2jHgyB-_qyJ_37x.js → katex-C0Lgw_Sx-CbX2I1cQ.js} +1864 -1814
- package/dist/{layout-BHI4imdk-CESYC-il.js → layout-9vIfpCf3-FfABA43y.js} +81 -81
- package/dist/linear-C-k9vokG-Md9dfBfB.js +259 -0
- package/dist/{mermaid-parser.core-Ce96PX3Q-CV9ue_xr.js → mermaid-parser.core-DHL9WXVx-DeKF3RZx.js} +4080 -3590
- package/dist/{mindmap-definition-GWI6TPTV-C98Syvj2-DUWC1UH5.js → mindmap-definition-LNHGMQRG-BsypuFYj-DSVrvuog.js} +1112 -1100
- package/dist/packet-BFZMPI3H-BcK9kJ-B-BxxCPBGn.js +5 -0
- package/dist/pie-7BOR55EZ-Vt5px0F3-BM7egbMh.js +5 -0
- package/dist/pieDiagram-DBDJKBY4-Bam6gKTi-BOqYeC6c.js +161 -0
- package/dist/{quadrantDiagram-OS5C2QUG-M57vVPSx-BRx-dMGe.js → quadrantDiagram-YPSRARAO-CJwMw09m-CN2OO-Le.js} +2 -2
- package/dist/radar-NHE76QYJ-Br11XWE4-4RP4MPFA.js +5 -0
- package/dist/requirementDiagram-EGVEC5DT-DkRytT0X-C2zigskn.js +850 -0
- package/dist/{sankeyDiagram-Y46BX6SQ-D6EdYPdp-D2Qzxmhx.js → sankeyDiagram-HRAUVNP4-08s1UHMk-2j8idkNs.js} +198 -193
- package/dist/{sequenceDiagram-G6AWOVSC-B171TAb1-KCpoI-Ck.js → sequenceDiagram-WFGC7UMF-6_s7-CN7-D-oTpLFJ.js} +1001 -992
- package/dist/stateDiagram-UUKSUZ4H-eWajY90l-BlM614AN.js +263 -0
- package/dist/stateDiagram-v2-EYPG3UTE-Dh7Ngu1O-YVMiocHE.js +16 -0
- package/dist/style.css +1 -1
- package/dist/timeline-definition-3HZDQTIS-4TPEOhE8-fDDLVlO8.js +799 -0
- package/dist/treemap-KMMF4GRG-nu7WEuPi-C1YG24W8.js +5 -0
- package/dist/{xychartDiagram-6QU3TZC5-CqbTSF5W-CUbJ50KT.js → xychartDiagram-FDP5SA34-BbtKlU7T-D1BI5nWs.js} +459 -423
- package/package.json +4 -4
- package/dist/_basePickBy-zlkqRmFy-D6w9JBLu.js +0 -151
- package/dist/arc-CK9P6CkJ-DVgfRhzX.js +0 -83
- package/dist/architecture-I3QFYML2-DJzmbE4M-C3v7Cpg0.js +0 -5
- package/dist/architectureDiagram-UYN6MBPD-DkZdgpXi-BTThTJ0F.js +0 -4592
- package/dist/blockDiagram-ZHA2E4KO-DnCMGCMN-DBXa-baO.js +0 -2247
- package/dist/chunk-5HRBRIJM-BjQ8go1b-CJmT3AYe.js +0 -24
- package/dist/chunk-7U56Z5CX-awhAxjZ0-Cs_UWlwk.js +0 -1213
- package/dist/chunk-T2TOU4HS-DqOVhIzl-O3PUl7Qp.js +0 -1301
- package/dist/classDiagram-LNE6IOMH-fQzyXfo--DYLd8UQH.js +0 -14
- package/dist/classDiagram-v2-MQ7JQ4JX-fQzyXfo--DYLd8UQH.js +0 -14
- package/dist/cytoscape.esm-DAyNQ0qu-i5PnoWfE.js +0 -16110
- package/dist/diagram-QW4FP2JN-DZT_0aFO-SYzM51ke.js +0 -126
- package/dist/erDiagram-6RL3IURR-BfgUC5jv-BrebVho-.js +0 -937
- package/dist/flowDiagram-7ASYPVHJ-Bo9CnsE7-Ds2vln_y.js +0 -1484
- package/dist/ganttDiagram-NTVNEXSI-8E9hjd6N-fR_cmeDc.js +0 -2491
- package/dist/gitGraph-YCYPL57B-BnErPIwo-DXUTceC1.js +0 -5
- package/dist/info-46DW6VJ7-DPpbx_vA-omPXKuBd.js +0 -5
- package/dist/infoDiagram-A4XQUW5V-Bo9uoOcA-CnlgI27B.js +0 -22
- package/dist/linear-C2PheBya-BHVXLcru.js +0 -423
- package/dist/packet-W2GHVCYJ-BLiQbm7T-BD1xX8XM.js +0 -5
- package/dist/pie-BEWT4RHE-D3Mbo3mT-B4n38n6N.js +0 -5
- package/dist/pieDiagram-YF2LJOPJ-BJV27s9B-DA7hy5wG.js +0 -161
- package/dist/requirementDiagram-MIRIMTAZ-D0KDg7rf-CRMUyo68.js +0 -768
- package/dist/stateDiagram-MAYHULR4-D7FUnT9_-aCApnrI4.js +0 -268
- package/dist/stateDiagram-v2-4JROLMXI-Cyc74STT-D-7hwTRo.js +0 -14
- package/dist/timeline-definition-U7ZMHBDA-Bw-dp1yf-C01CsNUU.js +0 -804
|
@@ -1,4592 +0,0 @@
|
|
|
1
|
-
import { _ as ot, a6 as We, a5 as $e, a7 as je, a8 as qe, aj as Qe, ak as Ze, aW as Je, bk as Ke, aq as tr, l as Re, bq as Ee, g as he, bw as fe, a9 as er, aE as rr, bx as ir, by as nr, aQ as or } from "./index-CMZig9xg.js";
|
|
2
|
-
import { m as ar } from "./chunk-TMUBEWPD-BRIzn5gH-alZ9Sg3f.js";
|
|
3
|
-
import { e as sr } from "./chunk-KFBOBJHC-nixdujtH-CrTZo7r-.js";
|
|
4
|
-
import { D as hr } from "./mermaid-parser.core-Ce96PX3Q-CV9ue_xr.js";
|
|
5
|
-
import { N as be } from "./cytoscape.esm-DAyNQ0qu-i5PnoWfE.js";
|
|
6
|
-
var pe = { exports: {} }, ve = { exports: {} }, me = { exports: {} }, lr = me.exports, _e;
|
|
7
|
-
function cr() {
|
|
8
|
-
return _e || (_e = 1, function(A, U) {
|
|
9
|
-
(function(_, k) {
|
|
10
|
-
A.exports = k();
|
|
11
|
-
})(lr, function() {
|
|
12
|
-
return (
|
|
13
|
-
/******/
|
|
14
|
-
function(_) {
|
|
15
|
-
var k = {};
|
|
16
|
-
function T(g) {
|
|
17
|
-
if (k[g])
|
|
18
|
-
return k[g].exports;
|
|
19
|
-
var a = k[g] = {
|
|
20
|
-
/******/
|
|
21
|
-
i: g,
|
|
22
|
-
/******/
|
|
23
|
-
l: !1,
|
|
24
|
-
/******/
|
|
25
|
-
exports: {}
|
|
26
|
-
/******/
|
|
27
|
-
};
|
|
28
|
-
return _[g].call(a.exports, a, a.exports, T), a.l = !0, a.exports;
|
|
29
|
-
}
|
|
30
|
-
return T.m = _, T.c = k, T.i = function(g) {
|
|
31
|
-
return g;
|
|
32
|
-
}, T.d = function(g, a, i) {
|
|
33
|
-
T.o(g, a) || Object.defineProperty(g, a, {
|
|
34
|
-
/******/
|
|
35
|
-
configurable: !1,
|
|
36
|
-
/******/
|
|
37
|
-
enumerable: !0,
|
|
38
|
-
/******/
|
|
39
|
-
get: i
|
|
40
|
-
/******/
|
|
41
|
-
});
|
|
42
|
-
}, T.n = function(g) {
|
|
43
|
-
var a = g && g.__esModule ? (
|
|
44
|
-
/******/
|
|
45
|
-
function() {
|
|
46
|
-
return g.default;
|
|
47
|
-
}
|
|
48
|
-
) : (
|
|
49
|
-
/******/
|
|
50
|
-
function() {
|
|
51
|
-
return g;
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
return T.d(a, "a", a), a;
|
|
55
|
-
}, T.o = function(g, a) {
|
|
56
|
-
return Object.prototype.hasOwnProperty.call(g, a);
|
|
57
|
-
}, T.p = "", T(T.s = 28);
|
|
58
|
-
}([
|
|
59
|
-
/* 0 */
|
|
60
|
-
/***/
|
|
61
|
-
function(_, k, T) {
|
|
62
|
-
function g() {
|
|
63
|
-
}
|
|
64
|
-
g.QUALITY = 1, g.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, g.DEFAULT_INCREMENTAL = !1, g.DEFAULT_ANIMATION_ON_LAYOUT = !0, g.DEFAULT_ANIMATION_DURING_LAYOUT = !1, g.DEFAULT_ANIMATION_PERIOD = 50, g.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, g.DEFAULT_GRAPH_MARGIN = 15, g.NODE_DIMENSIONS_INCLUDE_LABELS = !1, g.SIMPLE_NODE_SIZE = 40, g.SIMPLE_NODE_HALF_SIZE = g.SIMPLE_NODE_SIZE / 2, g.EMPTY_COMPOUND_NODE_SIZE = 40, g.MIN_EDGE_LENGTH = 1, g.WORLD_BOUNDARY = 1e6, g.INITIAL_WORLD_BOUNDARY = g.WORLD_BOUNDARY / 1e3, g.WORLD_CENTER_X = 1200, g.WORLD_CENTER_Y = 900, _.exports = g;
|
|
65
|
-
},
|
|
66
|
-
/* 1 */
|
|
67
|
-
/***/
|
|
68
|
-
function(_, k, T) {
|
|
69
|
-
var g = T(2), a = T(8), i = T(9);
|
|
70
|
-
function r(l, n, v) {
|
|
71
|
-
g.call(this, v), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = v, this.bendpoints = [], this.source = l, this.target = n;
|
|
72
|
-
}
|
|
73
|
-
r.prototype = Object.create(g.prototype);
|
|
74
|
-
for (var e in g)
|
|
75
|
-
r[e] = g[e];
|
|
76
|
-
r.prototype.getSource = function() {
|
|
77
|
-
return this.source;
|
|
78
|
-
}, r.prototype.getTarget = function() {
|
|
79
|
-
return this.target;
|
|
80
|
-
}, r.prototype.isInterGraph = function() {
|
|
81
|
-
return this.isInterGraph;
|
|
82
|
-
}, r.prototype.getLength = function() {
|
|
83
|
-
return this.length;
|
|
84
|
-
}, r.prototype.isOverlapingSourceAndTarget = function() {
|
|
85
|
-
return this.isOverlapingSourceAndTarget;
|
|
86
|
-
}, r.prototype.getBendpoints = function() {
|
|
87
|
-
return this.bendpoints;
|
|
88
|
-
}, r.prototype.getLca = function() {
|
|
89
|
-
return this.lca;
|
|
90
|
-
}, r.prototype.getSourceInLca = function() {
|
|
91
|
-
return this.sourceInLca;
|
|
92
|
-
}, r.prototype.getTargetInLca = function() {
|
|
93
|
-
return this.targetInLca;
|
|
94
|
-
}, r.prototype.getOtherEnd = function(l) {
|
|
95
|
-
if (this.source === l)
|
|
96
|
-
return this.target;
|
|
97
|
-
if (this.target === l)
|
|
98
|
-
return this.source;
|
|
99
|
-
throw "Node is not incident with this edge";
|
|
100
|
-
}, r.prototype.getOtherEndInGraph = function(l, n) {
|
|
101
|
-
for (var v = this.getOtherEnd(l), t = n.getGraphManager().getRoot(); ; ) {
|
|
102
|
-
if (v.getOwner() == n)
|
|
103
|
-
return v;
|
|
104
|
-
if (v.getOwner() == t)
|
|
105
|
-
break;
|
|
106
|
-
v = v.getOwner().getParent();
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}, r.prototype.updateLength = function() {
|
|
110
|
-
var l = new Array(4);
|
|
111
|
-
this.isOverlapingSourceAndTarget = a.getIntersection(this.target.getRect(), this.source.getRect(), l), this.isOverlapingSourceAndTarget || (this.lengthX = l[0] - l[2], this.lengthY = l[1] - l[3], Math.abs(this.lengthX) < 1 && (this.lengthX = i.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = i.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
|
|
112
|
-
}, r.prototype.updateLengthSimple = function() {
|
|
113
|
-
this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = i.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = i.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
|
|
114
|
-
}, _.exports = r;
|
|
115
|
-
},
|
|
116
|
-
/* 2 */
|
|
117
|
-
/***/
|
|
118
|
-
function(_, k, T) {
|
|
119
|
-
function g(a) {
|
|
120
|
-
this.vGraphObject = a;
|
|
121
|
-
}
|
|
122
|
-
_.exports = g;
|
|
123
|
-
},
|
|
124
|
-
/* 3 */
|
|
125
|
-
/***/
|
|
126
|
-
function(_, k, T) {
|
|
127
|
-
var g = T(2), a = T(10), i = T(13), r = T(0), e = T(16), l = T(5);
|
|
128
|
-
function n(t, s, h, u) {
|
|
129
|
-
h == null && u == null && (u = s), g.call(this, u), t.graphManager != null && (t = t.graphManager), this.estimatedSize = a.MIN_VALUE, this.inclusionTreeDepth = a.MAX_VALUE, this.vGraphObject = u, this.edges = [], this.graphManager = t, h != null && s != null ? this.rect = new i(s.x, s.y, h.width, h.height) : this.rect = new i();
|
|
130
|
-
}
|
|
131
|
-
n.prototype = Object.create(g.prototype);
|
|
132
|
-
for (var v in g)
|
|
133
|
-
n[v] = g[v];
|
|
134
|
-
n.prototype.getEdges = function() {
|
|
135
|
-
return this.edges;
|
|
136
|
-
}, n.prototype.getChild = function() {
|
|
137
|
-
return this.child;
|
|
138
|
-
}, n.prototype.getOwner = function() {
|
|
139
|
-
return this.owner;
|
|
140
|
-
}, n.prototype.getWidth = function() {
|
|
141
|
-
return this.rect.width;
|
|
142
|
-
}, n.prototype.setWidth = function(t) {
|
|
143
|
-
this.rect.width = t;
|
|
144
|
-
}, n.prototype.getHeight = function() {
|
|
145
|
-
return this.rect.height;
|
|
146
|
-
}, n.prototype.setHeight = function(t) {
|
|
147
|
-
this.rect.height = t;
|
|
148
|
-
}, n.prototype.getCenterX = function() {
|
|
149
|
-
return this.rect.x + this.rect.width / 2;
|
|
150
|
-
}, n.prototype.getCenterY = function() {
|
|
151
|
-
return this.rect.y + this.rect.height / 2;
|
|
152
|
-
}, n.prototype.getCenter = function() {
|
|
153
|
-
return new l(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
|
|
154
|
-
}, n.prototype.getLocation = function() {
|
|
155
|
-
return new l(this.rect.x, this.rect.y);
|
|
156
|
-
}, n.prototype.getRect = function() {
|
|
157
|
-
return this.rect;
|
|
158
|
-
}, n.prototype.getDiagonal = function() {
|
|
159
|
-
return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
|
|
160
|
-
}, n.prototype.getHalfTheDiagonal = function() {
|
|
161
|
-
return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
|
|
162
|
-
}, n.prototype.setRect = function(t, s) {
|
|
163
|
-
this.rect.x = t.x, this.rect.y = t.y, this.rect.width = s.width, this.rect.height = s.height;
|
|
164
|
-
}, n.prototype.setCenter = function(t, s) {
|
|
165
|
-
this.rect.x = t - this.rect.width / 2, this.rect.y = s - this.rect.height / 2;
|
|
166
|
-
}, n.prototype.setLocation = function(t, s) {
|
|
167
|
-
this.rect.x = t, this.rect.y = s;
|
|
168
|
-
}, n.prototype.moveBy = function(t, s) {
|
|
169
|
-
this.rect.x += t, this.rect.y += s;
|
|
170
|
-
}, n.prototype.getEdgeListToNode = function(t) {
|
|
171
|
-
var s = [], h = this;
|
|
172
|
-
return h.edges.forEach(function(u) {
|
|
173
|
-
if (u.target == t) {
|
|
174
|
-
if (u.source != h) throw "Incorrect edge source!";
|
|
175
|
-
s.push(u);
|
|
176
|
-
}
|
|
177
|
-
}), s;
|
|
178
|
-
}, n.prototype.getEdgesBetween = function(t) {
|
|
179
|
-
var s = [], h = this;
|
|
180
|
-
return h.edges.forEach(function(u) {
|
|
181
|
-
if (!(u.source == h || u.target == h)) throw "Incorrect edge source and/or target";
|
|
182
|
-
(u.target == t || u.source == t) && s.push(u);
|
|
183
|
-
}), s;
|
|
184
|
-
}, n.prototype.getNeighborsList = function() {
|
|
185
|
-
var t = /* @__PURE__ */ new Set(), s = this;
|
|
186
|
-
return s.edges.forEach(function(h) {
|
|
187
|
-
if (h.source == s)
|
|
188
|
-
t.add(h.target);
|
|
189
|
-
else {
|
|
190
|
-
if (h.target != s)
|
|
191
|
-
throw "Incorrect incidency!";
|
|
192
|
-
t.add(h.source);
|
|
193
|
-
}
|
|
194
|
-
}), t;
|
|
195
|
-
}, n.prototype.withChildren = function() {
|
|
196
|
-
var t = /* @__PURE__ */ new Set(), s, h;
|
|
197
|
-
if (t.add(this), this.child != null)
|
|
198
|
-
for (var u = this.child.getNodes(), c = 0; c < u.length; c++)
|
|
199
|
-
s = u[c], h = s.withChildren(), h.forEach(function(N) {
|
|
200
|
-
t.add(N);
|
|
201
|
-
});
|
|
202
|
-
return t;
|
|
203
|
-
}, n.prototype.getNoOfChildren = function() {
|
|
204
|
-
var t = 0, s;
|
|
205
|
-
if (this.child == null)
|
|
206
|
-
t = 1;
|
|
207
|
-
else
|
|
208
|
-
for (var h = this.child.getNodes(), u = 0; u < h.length; u++)
|
|
209
|
-
s = h[u], t += s.getNoOfChildren();
|
|
210
|
-
return t == 0 && (t = 1), t;
|
|
211
|
-
}, n.prototype.getEstimatedSize = function() {
|
|
212
|
-
if (this.estimatedSize == a.MIN_VALUE)
|
|
213
|
-
throw "assert failed";
|
|
214
|
-
return this.estimatedSize;
|
|
215
|
-
}, n.prototype.calcEstimatedSize = function() {
|
|
216
|
-
return this.child == null ? this.estimatedSize = (this.rect.width + this.rect.height) / 2 : (this.estimatedSize = this.child.calcEstimatedSize(), this.rect.width = this.estimatedSize, this.rect.height = this.estimatedSize, this.estimatedSize);
|
|
217
|
-
}, n.prototype.scatter = function() {
|
|
218
|
-
var t, s, h = -r.INITIAL_WORLD_BOUNDARY, u = r.INITIAL_WORLD_BOUNDARY;
|
|
219
|
-
t = r.WORLD_CENTER_X + e.nextDouble() * (u - h) + h;
|
|
220
|
-
var c = -r.INITIAL_WORLD_BOUNDARY, N = r.INITIAL_WORLD_BOUNDARY;
|
|
221
|
-
s = r.WORLD_CENTER_Y + e.nextDouble() * (N - c) + c, this.rect.x = t, this.rect.y = s;
|
|
222
|
-
}, n.prototype.updateBounds = function() {
|
|
223
|
-
if (this.getChild() == null)
|
|
224
|
-
throw "assert failed";
|
|
225
|
-
if (this.getChild().getNodes().length != 0) {
|
|
226
|
-
var t = this.getChild();
|
|
227
|
-
if (t.updateBounds(!0), this.rect.x = t.getLeft(), this.rect.y = t.getTop(), this.setWidth(t.getRight() - t.getLeft()), this.setHeight(t.getBottom() - t.getTop()), r.NODE_DIMENSIONS_INCLUDE_LABELS) {
|
|
228
|
-
var s = t.getRight() - t.getLeft(), h = t.getBottom() - t.getTop();
|
|
229
|
-
this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(s + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > s ? (this.rect.x -= (this.labelWidth - s) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(s + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(h + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > h ? (this.rect.y -= (this.labelHeight - h) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(h + this.labelHeight));
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}, n.prototype.getInclusionTreeDepth = function() {
|
|
233
|
-
if (this.inclusionTreeDepth == a.MAX_VALUE)
|
|
234
|
-
throw "assert failed";
|
|
235
|
-
return this.inclusionTreeDepth;
|
|
236
|
-
}, n.prototype.transform = function(t) {
|
|
237
|
-
var s = this.rect.x;
|
|
238
|
-
s > r.WORLD_BOUNDARY ? s = r.WORLD_BOUNDARY : s < -r.WORLD_BOUNDARY && (s = -r.WORLD_BOUNDARY);
|
|
239
|
-
var h = this.rect.y;
|
|
240
|
-
h > r.WORLD_BOUNDARY ? h = r.WORLD_BOUNDARY : h < -r.WORLD_BOUNDARY && (h = -r.WORLD_BOUNDARY);
|
|
241
|
-
var u = new l(s, h), c = t.inverseTransformPoint(u);
|
|
242
|
-
this.setLocation(c.x, c.y);
|
|
243
|
-
}, n.prototype.getLeft = function() {
|
|
244
|
-
return this.rect.x;
|
|
245
|
-
}, n.prototype.getRight = function() {
|
|
246
|
-
return this.rect.x + this.rect.width;
|
|
247
|
-
}, n.prototype.getTop = function() {
|
|
248
|
-
return this.rect.y;
|
|
249
|
-
}, n.prototype.getBottom = function() {
|
|
250
|
-
return this.rect.y + this.rect.height;
|
|
251
|
-
}, n.prototype.getParent = function() {
|
|
252
|
-
return this.owner == null ? null : this.owner.getParent();
|
|
253
|
-
}, _.exports = n;
|
|
254
|
-
},
|
|
255
|
-
/* 4 */
|
|
256
|
-
/***/
|
|
257
|
-
function(_, k, T) {
|
|
258
|
-
var g = T(0);
|
|
259
|
-
function a() {
|
|
260
|
-
}
|
|
261
|
-
for (var i in g)
|
|
262
|
-
a[i] = g[i];
|
|
263
|
-
a.MAX_ITERATIONS = 2500, a.DEFAULT_EDGE_LENGTH = 50, a.DEFAULT_SPRING_STRENGTH = 0.45, a.DEFAULT_REPULSION_STRENGTH = 4500, a.DEFAULT_GRAVITY_STRENGTH = 0.4, a.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, a.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, a.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, a.COOLING_ADAPTATION_FACTOR = 0.33, a.ADAPTATION_LOWER_NODE_LIMIT = 1e3, a.ADAPTATION_UPPER_NODE_LIMIT = 5e3, a.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, a.MAX_NODE_DISPLACEMENT = a.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, a.MIN_REPULSION_DIST = a.DEFAULT_EDGE_LENGTH / 10, a.CONVERGENCE_CHECK_PERIOD = 100, a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, a.MIN_EDGE_LENGTH = 1, a.GRID_CALCULATION_CHECK_PERIOD = 10, _.exports = a;
|
|
264
|
-
},
|
|
265
|
-
/* 5 */
|
|
266
|
-
/***/
|
|
267
|
-
function(_, k, T) {
|
|
268
|
-
function g(a, i) {
|
|
269
|
-
a == null && i == null ? (this.x = 0, this.y = 0) : (this.x = a, this.y = i);
|
|
270
|
-
}
|
|
271
|
-
g.prototype.getX = function() {
|
|
272
|
-
return this.x;
|
|
273
|
-
}, g.prototype.getY = function() {
|
|
274
|
-
return this.y;
|
|
275
|
-
}, g.prototype.setX = function(a) {
|
|
276
|
-
this.x = a;
|
|
277
|
-
}, g.prototype.setY = function(a) {
|
|
278
|
-
this.y = a;
|
|
279
|
-
}, g.prototype.getDifference = function(a) {
|
|
280
|
-
return new DimensionD(this.x - a.x, this.y - a.y);
|
|
281
|
-
}, g.prototype.getCopy = function() {
|
|
282
|
-
return new g(this.x, this.y);
|
|
283
|
-
}, g.prototype.translate = function(a) {
|
|
284
|
-
return this.x += a.width, this.y += a.height, this;
|
|
285
|
-
}, _.exports = g;
|
|
286
|
-
},
|
|
287
|
-
/* 6 */
|
|
288
|
-
/***/
|
|
289
|
-
function(_, k, T) {
|
|
290
|
-
var g = T(2), a = T(10), i = T(0), r = T(7), e = T(3), l = T(1), n = T(13), v = T(12), t = T(11);
|
|
291
|
-
function s(u, c, N) {
|
|
292
|
-
g.call(this, N), this.estimatedSize = a.MIN_VALUE, this.margin = i.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = u, c != null && c instanceof r ? this.graphManager = c : c != null && c instanceof Layout && (this.graphManager = c.graphManager);
|
|
293
|
-
}
|
|
294
|
-
s.prototype = Object.create(g.prototype);
|
|
295
|
-
for (var h in g)
|
|
296
|
-
s[h] = g[h];
|
|
297
|
-
s.prototype.getNodes = function() {
|
|
298
|
-
return this.nodes;
|
|
299
|
-
}, s.prototype.getEdges = function() {
|
|
300
|
-
return this.edges;
|
|
301
|
-
}, s.prototype.getGraphManager = function() {
|
|
302
|
-
return this.graphManager;
|
|
303
|
-
}, s.prototype.getParent = function() {
|
|
304
|
-
return this.parent;
|
|
305
|
-
}, s.prototype.getLeft = function() {
|
|
306
|
-
return this.left;
|
|
307
|
-
}, s.prototype.getRight = function() {
|
|
308
|
-
return this.right;
|
|
309
|
-
}, s.prototype.getTop = function() {
|
|
310
|
-
return this.top;
|
|
311
|
-
}, s.prototype.getBottom = function() {
|
|
312
|
-
return this.bottom;
|
|
313
|
-
}, s.prototype.isConnected = function() {
|
|
314
|
-
return this.isConnected;
|
|
315
|
-
}, s.prototype.add = function(u, c, N) {
|
|
316
|
-
if (c == null && N == null) {
|
|
317
|
-
var d = u;
|
|
318
|
-
if (this.graphManager == null)
|
|
319
|
-
throw "Graph has no graph mgr!";
|
|
320
|
-
if (this.getNodes().indexOf(d) > -1)
|
|
321
|
-
throw "Node already in graph!";
|
|
322
|
-
return d.owner = this, this.getNodes().push(d), d;
|
|
323
|
-
} else {
|
|
324
|
-
var y = u;
|
|
325
|
-
if (!(this.getNodes().indexOf(c) > -1 && this.getNodes().indexOf(N) > -1))
|
|
326
|
-
throw "Source or target not in graph!";
|
|
327
|
-
if (!(c.owner == N.owner && c.owner == this))
|
|
328
|
-
throw "Both owners must be this graph!";
|
|
329
|
-
return c.owner != N.owner ? null : (y.source = c, y.target = N, y.isInterGraph = !1, this.getEdges().push(y), c.edges.push(y), N != c && N.edges.push(y), y);
|
|
330
|
-
}
|
|
331
|
-
}, s.prototype.remove = function(u) {
|
|
332
|
-
var c = u;
|
|
333
|
-
if (u instanceof e) {
|
|
334
|
-
if (c == null)
|
|
335
|
-
throw "Node is null!";
|
|
336
|
-
if (!(c.owner != null && c.owner == this))
|
|
337
|
-
throw "Owner graph is invalid!";
|
|
338
|
-
if (this.graphManager == null)
|
|
339
|
-
throw "Owner graph manager is invalid!";
|
|
340
|
-
for (var N = c.edges.slice(), d, y = N.length, I = 0; I < y; I++)
|
|
341
|
-
d = N[I], d.isInterGraph ? this.graphManager.remove(d) : d.source.owner.remove(d);
|
|
342
|
-
var w = this.nodes.indexOf(c);
|
|
343
|
-
if (w == -1)
|
|
344
|
-
throw "Node not in owner node list!";
|
|
345
|
-
this.nodes.splice(w, 1);
|
|
346
|
-
} else if (u instanceof l) {
|
|
347
|
-
var d = u;
|
|
348
|
-
if (d == null)
|
|
349
|
-
throw "Edge is null!";
|
|
350
|
-
if (!(d.source != null && d.target != null))
|
|
351
|
-
throw "Source and/or target is null!";
|
|
352
|
-
if (!(d.source.owner != null && d.target.owner != null && d.source.owner == this && d.target.owner == this))
|
|
353
|
-
throw "Source and/or target owner is invalid!";
|
|
354
|
-
var Y = d.source.edges.indexOf(d), F = d.target.edges.indexOf(d);
|
|
355
|
-
if (!(Y > -1 && F > -1))
|
|
356
|
-
throw "Source and/or target doesn't know this edge!";
|
|
357
|
-
d.source.edges.splice(Y, 1), d.target != d.source && d.target.edges.splice(F, 1);
|
|
358
|
-
var w = d.source.owner.getEdges().indexOf(d);
|
|
359
|
-
if (w == -1)
|
|
360
|
-
throw "Not in owner's edge list!";
|
|
361
|
-
d.source.owner.getEdges().splice(w, 1);
|
|
362
|
-
}
|
|
363
|
-
}, s.prototype.updateLeftTop = function() {
|
|
364
|
-
for (var u = a.MAX_VALUE, c = a.MAX_VALUE, N, d, y, I = this.getNodes(), w = I.length, Y = 0; Y < w; Y++) {
|
|
365
|
-
var F = I[Y];
|
|
366
|
-
N = F.getTop(), d = F.getLeft(), u > N && (u = N), c > d && (c = d);
|
|
367
|
-
}
|
|
368
|
-
return u == a.MAX_VALUE ? null : (I[0].getParent().paddingLeft != null ? y = I[0].getParent().paddingLeft : y = this.margin, this.left = c - y, this.top = u - y, new v(this.left, this.top));
|
|
369
|
-
}, s.prototype.updateBounds = function(u) {
|
|
370
|
-
for (var c = a.MAX_VALUE, N = -a.MAX_VALUE, d = a.MAX_VALUE, y = -a.MAX_VALUE, I, w, Y, F, H, z = this.nodes, q = z.length, x = 0; x < q; x++) {
|
|
371
|
-
var it = z[x];
|
|
372
|
-
u && it.child != null && it.updateBounds(), I = it.getLeft(), w = it.getRight(), Y = it.getTop(), F = it.getBottom(), c > I && (c = I), N < w && (N = w), d > Y && (d = Y), y < F && (y = F);
|
|
373
|
-
}
|
|
374
|
-
var o = new n(c, d, N - c, y - d);
|
|
375
|
-
c == a.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), z[0].getParent().paddingLeft != null ? H = z[0].getParent().paddingLeft : H = this.margin, this.left = o.x - H, this.right = o.x + o.width + H, this.top = o.y - H, this.bottom = o.y + o.height + H;
|
|
376
|
-
}, s.calculateBounds = function(u) {
|
|
377
|
-
for (var c = a.MAX_VALUE, N = -a.MAX_VALUE, d = a.MAX_VALUE, y = -a.MAX_VALUE, I, w, Y, F, H = u.length, z = 0; z < H; z++) {
|
|
378
|
-
var q = u[z];
|
|
379
|
-
I = q.getLeft(), w = q.getRight(), Y = q.getTop(), F = q.getBottom(), c > I && (c = I), N < w && (N = w), d > Y && (d = Y), y < F && (y = F);
|
|
380
|
-
}
|
|
381
|
-
var x = new n(c, d, N - c, y - d);
|
|
382
|
-
return x;
|
|
383
|
-
}, s.prototype.getInclusionTreeDepth = function() {
|
|
384
|
-
return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
|
|
385
|
-
}, s.prototype.getEstimatedSize = function() {
|
|
386
|
-
if (this.estimatedSize == a.MIN_VALUE)
|
|
387
|
-
throw "assert failed";
|
|
388
|
-
return this.estimatedSize;
|
|
389
|
-
}, s.prototype.calcEstimatedSize = function() {
|
|
390
|
-
for (var u = 0, c = this.nodes, N = c.length, d = 0; d < N; d++) {
|
|
391
|
-
var y = c[d];
|
|
392
|
-
u += y.calcEstimatedSize();
|
|
393
|
-
}
|
|
394
|
-
return u == 0 ? this.estimatedSize = i.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = u / Math.sqrt(this.nodes.length), this.estimatedSize;
|
|
395
|
-
}, s.prototype.updateConnected = function() {
|
|
396
|
-
var u = this;
|
|
397
|
-
if (this.nodes.length == 0) {
|
|
398
|
-
this.isConnected = !0;
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
var c = new t(), N = /* @__PURE__ */ new Set(), d = this.nodes[0], y, I, w = d.withChildren();
|
|
402
|
-
for (w.forEach(function(x) {
|
|
403
|
-
c.push(x), N.add(x);
|
|
404
|
-
}); c.length !== 0; ) {
|
|
405
|
-
d = c.shift(), y = d.getEdges();
|
|
406
|
-
for (var Y = y.length, F = 0; F < Y; F++) {
|
|
407
|
-
var H = y[F];
|
|
408
|
-
if (I = H.getOtherEndInGraph(d, this), I != null && !N.has(I)) {
|
|
409
|
-
var z = I.withChildren();
|
|
410
|
-
z.forEach(function(x) {
|
|
411
|
-
c.push(x), N.add(x);
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
if (this.isConnected = !1, N.size >= this.nodes.length) {
|
|
417
|
-
var q = 0;
|
|
418
|
-
N.forEach(function(x) {
|
|
419
|
-
x.owner == u && q++;
|
|
420
|
-
}), q == this.nodes.length && (this.isConnected = !0);
|
|
421
|
-
}
|
|
422
|
-
}, _.exports = s;
|
|
423
|
-
},
|
|
424
|
-
/* 7 */
|
|
425
|
-
/***/
|
|
426
|
-
function(_, k, T) {
|
|
427
|
-
var g, a = T(1);
|
|
428
|
-
function i(r) {
|
|
429
|
-
g = T(6), this.layout = r, this.graphs = [], this.edges = [];
|
|
430
|
-
}
|
|
431
|
-
i.prototype.addRoot = function() {
|
|
432
|
-
var r = this.layout.newGraph(), e = this.layout.newNode(null), l = this.add(r, e);
|
|
433
|
-
return this.setRootGraph(l), this.rootGraph;
|
|
434
|
-
}, i.prototype.add = function(r, e, l, n, v) {
|
|
435
|
-
if (l == null && n == null && v == null) {
|
|
436
|
-
if (r == null)
|
|
437
|
-
throw "Graph is null!";
|
|
438
|
-
if (e == null)
|
|
439
|
-
throw "Parent node is null!";
|
|
440
|
-
if (this.graphs.indexOf(r) > -1)
|
|
441
|
-
throw "Graph already in this graph mgr!";
|
|
442
|
-
if (this.graphs.push(r), r.parent != null)
|
|
443
|
-
throw "Already has a parent!";
|
|
444
|
-
if (e.child != null)
|
|
445
|
-
throw "Already has a child!";
|
|
446
|
-
return r.parent = e, e.child = r, r;
|
|
447
|
-
} else {
|
|
448
|
-
v = l, n = e, l = r;
|
|
449
|
-
var t = n.getOwner(), s = v.getOwner();
|
|
450
|
-
if (!(t != null && t.getGraphManager() == this))
|
|
451
|
-
throw "Source not in this graph mgr!";
|
|
452
|
-
if (!(s != null && s.getGraphManager() == this))
|
|
453
|
-
throw "Target not in this graph mgr!";
|
|
454
|
-
if (t == s)
|
|
455
|
-
return l.isInterGraph = !1, t.add(l, n, v);
|
|
456
|
-
if (l.isInterGraph = !0, l.source = n, l.target = v, this.edges.indexOf(l) > -1)
|
|
457
|
-
throw "Edge already in inter-graph edge list!";
|
|
458
|
-
if (this.edges.push(l), !(l.source != null && l.target != null))
|
|
459
|
-
throw "Edge source and/or target is null!";
|
|
460
|
-
if (!(l.source.edges.indexOf(l) == -1 && l.target.edges.indexOf(l) == -1))
|
|
461
|
-
throw "Edge already in source and/or target incidency list!";
|
|
462
|
-
return l.source.edges.push(l), l.target.edges.push(l), l;
|
|
463
|
-
}
|
|
464
|
-
}, i.prototype.remove = function(r) {
|
|
465
|
-
if (r instanceof g) {
|
|
466
|
-
var e = r;
|
|
467
|
-
if (e.getGraphManager() != this)
|
|
468
|
-
throw "Graph not in this graph mgr";
|
|
469
|
-
if (!(e == this.rootGraph || e.parent != null && e.parent.graphManager == this))
|
|
470
|
-
throw "Invalid parent node!";
|
|
471
|
-
var l = [];
|
|
472
|
-
l = l.concat(e.getEdges());
|
|
473
|
-
for (var n, v = l.length, t = 0; t < v; t++)
|
|
474
|
-
n = l[t], e.remove(n);
|
|
475
|
-
var s = [];
|
|
476
|
-
s = s.concat(e.getNodes());
|
|
477
|
-
var h;
|
|
478
|
-
v = s.length;
|
|
479
|
-
for (var t = 0; t < v; t++)
|
|
480
|
-
h = s[t], e.remove(h);
|
|
481
|
-
e == this.rootGraph && this.setRootGraph(null);
|
|
482
|
-
var u = this.graphs.indexOf(e);
|
|
483
|
-
this.graphs.splice(u, 1), e.parent = null;
|
|
484
|
-
} else if (r instanceof a) {
|
|
485
|
-
if (n = r, n == null)
|
|
486
|
-
throw "Edge is null!";
|
|
487
|
-
if (!n.isInterGraph)
|
|
488
|
-
throw "Not an inter-graph edge!";
|
|
489
|
-
if (!(n.source != null && n.target != null))
|
|
490
|
-
throw "Source and/or target is null!";
|
|
491
|
-
if (!(n.source.edges.indexOf(n) != -1 && n.target.edges.indexOf(n) != -1))
|
|
492
|
-
throw "Source and/or target doesn't know this edge!";
|
|
493
|
-
var u = n.source.edges.indexOf(n);
|
|
494
|
-
if (n.source.edges.splice(u, 1), u = n.target.edges.indexOf(n), n.target.edges.splice(u, 1), !(n.source.owner != null && n.source.owner.getGraphManager() != null))
|
|
495
|
-
throw "Edge owner graph or owner graph manager is null!";
|
|
496
|
-
if (n.source.owner.getGraphManager().edges.indexOf(n) == -1)
|
|
497
|
-
throw "Not in owner graph manager's edge list!";
|
|
498
|
-
var u = n.source.owner.getGraphManager().edges.indexOf(n);
|
|
499
|
-
n.source.owner.getGraphManager().edges.splice(u, 1);
|
|
500
|
-
}
|
|
501
|
-
}, i.prototype.updateBounds = function() {
|
|
502
|
-
this.rootGraph.updateBounds(!0);
|
|
503
|
-
}, i.prototype.getGraphs = function() {
|
|
504
|
-
return this.graphs;
|
|
505
|
-
}, i.prototype.getAllNodes = function() {
|
|
506
|
-
if (this.allNodes == null) {
|
|
507
|
-
for (var r = [], e = this.getGraphs(), l = e.length, n = 0; n < l; n++)
|
|
508
|
-
r = r.concat(e[n].getNodes());
|
|
509
|
-
this.allNodes = r;
|
|
510
|
-
}
|
|
511
|
-
return this.allNodes;
|
|
512
|
-
}, i.prototype.resetAllNodes = function() {
|
|
513
|
-
this.allNodes = null;
|
|
514
|
-
}, i.prototype.resetAllEdges = function() {
|
|
515
|
-
this.allEdges = null;
|
|
516
|
-
}, i.prototype.resetAllNodesToApplyGravitation = function() {
|
|
517
|
-
this.allNodesToApplyGravitation = null;
|
|
518
|
-
}, i.prototype.getAllEdges = function() {
|
|
519
|
-
if (this.allEdges == null) {
|
|
520
|
-
var r = [], e = this.getGraphs();
|
|
521
|
-
e.length;
|
|
522
|
-
for (var l = 0; l < e.length; l++)
|
|
523
|
-
r = r.concat(e[l].getEdges());
|
|
524
|
-
r = r.concat(this.edges), this.allEdges = r;
|
|
525
|
-
}
|
|
526
|
-
return this.allEdges;
|
|
527
|
-
}, i.prototype.getAllNodesToApplyGravitation = function() {
|
|
528
|
-
return this.allNodesToApplyGravitation;
|
|
529
|
-
}, i.prototype.setAllNodesToApplyGravitation = function(r) {
|
|
530
|
-
if (this.allNodesToApplyGravitation != null)
|
|
531
|
-
throw "assert failed";
|
|
532
|
-
this.allNodesToApplyGravitation = r;
|
|
533
|
-
}, i.prototype.getRoot = function() {
|
|
534
|
-
return this.rootGraph;
|
|
535
|
-
}, i.prototype.setRootGraph = function(r) {
|
|
536
|
-
if (r.getGraphManager() != this)
|
|
537
|
-
throw "Root not in this graph mgr!";
|
|
538
|
-
this.rootGraph = r, r.parent == null && (r.parent = this.layout.newNode("Root node"));
|
|
539
|
-
}, i.prototype.getLayout = function() {
|
|
540
|
-
return this.layout;
|
|
541
|
-
}, i.prototype.isOneAncestorOfOther = function(r, e) {
|
|
542
|
-
if (!(r != null && e != null))
|
|
543
|
-
throw "assert failed";
|
|
544
|
-
if (r == e)
|
|
545
|
-
return !0;
|
|
546
|
-
var l = r.getOwner(), n;
|
|
547
|
-
do {
|
|
548
|
-
if (n = l.getParent(), n == null)
|
|
549
|
-
break;
|
|
550
|
-
if (n == e)
|
|
551
|
-
return !0;
|
|
552
|
-
if (l = n.getOwner(), l == null)
|
|
553
|
-
break;
|
|
554
|
-
} while (!0);
|
|
555
|
-
l = e.getOwner();
|
|
556
|
-
do {
|
|
557
|
-
if (n = l.getParent(), n == null)
|
|
558
|
-
break;
|
|
559
|
-
if (n == r)
|
|
560
|
-
return !0;
|
|
561
|
-
if (l = n.getOwner(), l == null)
|
|
562
|
-
break;
|
|
563
|
-
} while (!0);
|
|
564
|
-
return !1;
|
|
565
|
-
}, i.prototype.calcLowestCommonAncestors = function() {
|
|
566
|
-
for (var r, e, l, n, v, t = this.getAllEdges(), s = t.length, h = 0; h < s; h++) {
|
|
567
|
-
if (r = t[h], e = r.source, l = r.target, r.lca = null, r.sourceInLca = e, r.targetInLca = l, e == l) {
|
|
568
|
-
r.lca = e.getOwner();
|
|
569
|
-
continue;
|
|
570
|
-
}
|
|
571
|
-
for (n = e.getOwner(); r.lca == null; ) {
|
|
572
|
-
for (r.targetInLca = l, v = l.getOwner(); r.lca == null; ) {
|
|
573
|
-
if (v == n) {
|
|
574
|
-
r.lca = v;
|
|
575
|
-
break;
|
|
576
|
-
}
|
|
577
|
-
if (v == this.rootGraph)
|
|
578
|
-
break;
|
|
579
|
-
if (r.lca != null)
|
|
580
|
-
throw "assert failed";
|
|
581
|
-
r.targetInLca = v.getParent(), v = r.targetInLca.getOwner();
|
|
582
|
-
}
|
|
583
|
-
if (n == this.rootGraph)
|
|
584
|
-
break;
|
|
585
|
-
r.lca == null && (r.sourceInLca = n.getParent(), n = r.sourceInLca.getOwner());
|
|
586
|
-
}
|
|
587
|
-
if (r.lca == null)
|
|
588
|
-
throw "assert failed";
|
|
589
|
-
}
|
|
590
|
-
}, i.prototype.calcLowestCommonAncestor = function(r, e) {
|
|
591
|
-
if (r == e)
|
|
592
|
-
return r.getOwner();
|
|
593
|
-
var l = r.getOwner();
|
|
594
|
-
do {
|
|
595
|
-
if (l == null)
|
|
596
|
-
break;
|
|
597
|
-
var n = e.getOwner();
|
|
598
|
-
do {
|
|
599
|
-
if (n == null)
|
|
600
|
-
break;
|
|
601
|
-
if (n == l)
|
|
602
|
-
return n;
|
|
603
|
-
n = n.getParent().getOwner();
|
|
604
|
-
} while (!0);
|
|
605
|
-
l = l.getParent().getOwner();
|
|
606
|
-
} while (!0);
|
|
607
|
-
return l;
|
|
608
|
-
}, i.prototype.calcInclusionTreeDepths = function(r, e) {
|
|
609
|
-
r == null && e == null && (r = this.rootGraph, e = 1);
|
|
610
|
-
for (var l, n = r.getNodes(), v = n.length, t = 0; t < v; t++)
|
|
611
|
-
l = n[t], l.inclusionTreeDepth = e, l.child != null && this.calcInclusionTreeDepths(l.child, e + 1);
|
|
612
|
-
}, i.prototype.includesInvalidEdge = function() {
|
|
613
|
-
for (var r, e = [], l = this.edges.length, n = 0; n < l; n++)
|
|
614
|
-
r = this.edges[n], this.isOneAncestorOfOther(r.source, r.target) && e.push(r);
|
|
615
|
-
for (var n = 0; n < e.length; n++)
|
|
616
|
-
this.remove(e[n]);
|
|
617
|
-
return !1;
|
|
618
|
-
}, _.exports = i;
|
|
619
|
-
},
|
|
620
|
-
/* 8 */
|
|
621
|
-
/***/
|
|
622
|
-
function(_, k, T) {
|
|
623
|
-
var g = T(12);
|
|
624
|
-
function a() {
|
|
625
|
-
}
|
|
626
|
-
a.calcSeparationAmount = function(i, r, e, l) {
|
|
627
|
-
if (!i.intersects(r))
|
|
628
|
-
throw "assert failed";
|
|
629
|
-
var n = new Array(2);
|
|
630
|
-
this.decideDirectionsForOverlappingNodes(i, r, n), e[0] = Math.min(i.getRight(), r.getRight()) - Math.max(i.x, r.x), e[1] = Math.min(i.getBottom(), r.getBottom()) - Math.max(i.y, r.y), i.getX() <= r.getX() && i.getRight() >= r.getRight() ? e[0] += Math.min(r.getX() - i.getX(), i.getRight() - r.getRight()) : r.getX() <= i.getX() && r.getRight() >= i.getRight() && (e[0] += Math.min(i.getX() - r.getX(), r.getRight() - i.getRight())), i.getY() <= r.getY() && i.getBottom() >= r.getBottom() ? e[1] += Math.min(r.getY() - i.getY(), i.getBottom() - r.getBottom()) : r.getY() <= i.getY() && r.getBottom() >= i.getBottom() && (e[1] += Math.min(i.getY() - r.getY(), r.getBottom() - i.getBottom()));
|
|
631
|
-
var v = Math.abs((r.getCenterY() - i.getCenterY()) / (r.getCenterX() - i.getCenterX()));
|
|
632
|
-
r.getCenterY() === i.getCenterY() && r.getCenterX() === i.getCenterX() && (v = 1);
|
|
633
|
-
var t = v * e[0], s = e[1] / v;
|
|
634
|
-
e[0] < s ? s = e[0] : t = e[1], e[0] = -1 * n[0] * (s / 2 + l), e[1] = -1 * n[1] * (t / 2 + l);
|
|
635
|
-
}, a.decideDirectionsForOverlappingNodes = function(i, r, e) {
|
|
636
|
-
i.getCenterX() < r.getCenterX() ? e[0] = -1 : e[0] = 1, i.getCenterY() < r.getCenterY() ? e[1] = -1 : e[1] = 1;
|
|
637
|
-
}, a.getIntersection2 = function(i, r, e) {
|
|
638
|
-
var l = i.getCenterX(), n = i.getCenterY(), v = r.getCenterX(), t = r.getCenterY();
|
|
639
|
-
if (i.intersects(r))
|
|
640
|
-
return e[0] = l, e[1] = n, e[2] = v, e[3] = t, !0;
|
|
641
|
-
var s = i.getX(), h = i.getY(), u = i.getRight(), c = i.getX(), N = i.getBottom(), d = i.getRight(), y = i.getWidthHalf(), I = i.getHeightHalf(), w = r.getX(), Y = r.getY(), F = r.getRight(), H = r.getX(), z = r.getBottom(), q = r.getRight(), x = r.getWidthHalf(), it = r.getHeightHalf(), o = !1, E = !1;
|
|
642
|
-
if (l === v) {
|
|
643
|
-
if (n > t)
|
|
644
|
-
return e[0] = l, e[1] = h, e[2] = v, e[3] = z, !1;
|
|
645
|
-
if (n < t)
|
|
646
|
-
return e[0] = l, e[1] = N, e[2] = v, e[3] = Y, !1;
|
|
647
|
-
} else if (n === t) {
|
|
648
|
-
if (l > v)
|
|
649
|
-
return e[0] = s, e[1] = n, e[2] = F, e[3] = t, !1;
|
|
650
|
-
if (l < v)
|
|
651
|
-
return e[0] = u, e[1] = n, e[2] = w, e[3] = t, !1;
|
|
652
|
-
} else {
|
|
653
|
-
var f = i.height / i.width, p = r.height / r.width, m = (t - n) / (v - l), O = void 0, L = void 0, C = void 0, P = void 0, S = void 0, B = void 0;
|
|
654
|
-
if (-f === m ? l > v ? (e[0] = c, e[1] = N, o = !0) : (e[0] = u, e[1] = h, o = !0) : f === m && (l > v ? (e[0] = s, e[1] = h, o = !0) : (e[0] = d, e[1] = N, o = !0)), -p === m ? v > l ? (e[2] = H, e[3] = z, E = !0) : (e[2] = F, e[3] = Y, E = !0) : p === m && (v > l ? (e[2] = w, e[3] = Y, E = !0) : (e[2] = q, e[3] = z, E = !0)), o && E)
|
|
655
|
-
return !1;
|
|
656
|
-
if (l > v ? n > t ? (O = this.getCardinalDirection(f, m, 4), L = this.getCardinalDirection(p, m, 2)) : (O = this.getCardinalDirection(-f, m, 3), L = this.getCardinalDirection(-p, m, 1)) : n > t ? (O = this.getCardinalDirection(-f, m, 1), L = this.getCardinalDirection(-p, m, 3)) : (O = this.getCardinalDirection(f, m, 2), L = this.getCardinalDirection(p, m, 4)), !o)
|
|
657
|
-
switch (O) {
|
|
658
|
-
case 1:
|
|
659
|
-
P = h, C = l + -I / m, e[0] = C, e[1] = P;
|
|
660
|
-
break;
|
|
661
|
-
case 2:
|
|
662
|
-
C = d, P = n + y * m, e[0] = C, e[1] = P;
|
|
663
|
-
break;
|
|
664
|
-
case 3:
|
|
665
|
-
P = N, C = l + I / m, e[0] = C, e[1] = P;
|
|
666
|
-
break;
|
|
667
|
-
case 4:
|
|
668
|
-
C = c, P = n + -y * m, e[0] = C, e[1] = P;
|
|
669
|
-
break;
|
|
670
|
-
}
|
|
671
|
-
if (!E)
|
|
672
|
-
switch (L) {
|
|
673
|
-
case 1:
|
|
674
|
-
B = Y, S = v + -it / m, e[2] = S, e[3] = B;
|
|
675
|
-
break;
|
|
676
|
-
case 2:
|
|
677
|
-
S = q, B = t + x * m, e[2] = S, e[3] = B;
|
|
678
|
-
break;
|
|
679
|
-
case 3:
|
|
680
|
-
B = z, S = v + it / m, e[2] = S, e[3] = B;
|
|
681
|
-
break;
|
|
682
|
-
case 4:
|
|
683
|
-
S = H, B = t + -x * m, e[2] = S, e[3] = B;
|
|
684
|
-
break;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
return !1;
|
|
688
|
-
}, a.getCardinalDirection = function(i, r, e) {
|
|
689
|
-
return i > r ? e : 1 + e % 4;
|
|
690
|
-
}, a.getIntersection = function(i, r, e, l) {
|
|
691
|
-
if (l == null)
|
|
692
|
-
return this.getIntersection2(i, r, e);
|
|
693
|
-
var n = i.x, v = i.y, t = r.x, s = r.y, h = e.x, u = e.y, c = l.x, N = l.y, d = void 0, y = void 0, I = void 0, w = void 0, Y = void 0, F = void 0, H = void 0, z = void 0, q = void 0;
|
|
694
|
-
return I = s - v, Y = n - t, H = t * v - n * s, w = N - u, F = h - c, z = c * u - h * N, q = I * F - w * Y, q === 0 ? null : (d = (Y * z - F * H) / q, y = (w * H - I * z) / q, new g(d, y));
|
|
695
|
-
}, a.angleOfVector = function(i, r, e, l) {
|
|
696
|
-
var n = void 0;
|
|
697
|
-
return i !== e ? (n = Math.atan((l - r) / (e - i)), e < i ? n += Math.PI : l < r && (n += this.TWO_PI)) : l < r ? n = this.ONE_AND_HALF_PI : n = this.HALF_PI, n;
|
|
698
|
-
}, a.doIntersect = function(i, r, e, l) {
|
|
699
|
-
var n = i.x, v = i.y, t = r.x, s = r.y, h = e.x, u = e.y, c = l.x, N = l.y, d = (t - n) * (N - u) - (c - h) * (s - v);
|
|
700
|
-
if (d === 0)
|
|
701
|
-
return !1;
|
|
702
|
-
var y = ((N - u) * (c - n) + (h - c) * (N - v)) / d, I = ((v - s) * (c - n) + (t - n) * (N - v)) / d;
|
|
703
|
-
return 0 < y && y < 1 && 0 < I && I < 1;
|
|
704
|
-
}, a.findCircleLineIntersections = function(i, r, e, l, n, v, t) {
|
|
705
|
-
var s = (e - i) * (e - i) + (l - r) * (l - r), h = 2 * ((i - n) * (e - i) + (r - v) * (l - r)), u = (i - n) * (i - n) + (r - v) * (r - v) - t * t, c = h * h - 4 * s * u;
|
|
706
|
-
if (c >= 0) {
|
|
707
|
-
var N = (-h + Math.sqrt(h * h - 4 * s * u)) / (2 * s), d = (-h - Math.sqrt(h * h - 4 * s * u)) / (2 * s), y = null;
|
|
708
|
-
return N >= 0 && N <= 1 ? [N] : d >= 0 && d <= 1 ? [d] : y;
|
|
709
|
-
} else return null;
|
|
710
|
-
}, a.HALF_PI = 0.5 * Math.PI, a.ONE_AND_HALF_PI = 1.5 * Math.PI, a.TWO_PI = 2 * Math.PI, a.THREE_PI = 3 * Math.PI, _.exports = a;
|
|
711
|
-
},
|
|
712
|
-
/* 9 */
|
|
713
|
-
/***/
|
|
714
|
-
function(_, k, T) {
|
|
715
|
-
function g() {
|
|
716
|
-
}
|
|
717
|
-
g.sign = function(a) {
|
|
718
|
-
return a > 0 ? 1 : a < 0 ? -1 : 0;
|
|
719
|
-
}, g.floor = function(a) {
|
|
720
|
-
return a < 0 ? Math.ceil(a) : Math.floor(a);
|
|
721
|
-
}, g.ceil = function(a) {
|
|
722
|
-
return a < 0 ? Math.floor(a) : Math.ceil(a);
|
|
723
|
-
}, _.exports = g;
|
|
724
|
-
},
|
|
725
|
-
/* 10 */
|
|
726
|
-
/***/
|
|
727
|
-
function(_, k, T) {
|
|
728
|
-
function g() {
|
|
729
|
-
}
|
|
730
|
-
g.MAX_VALUE = 2147483647, g.MIN_VALUE = -2147483648, _.exports = g;
|
|
731
|
-
},
|
|
732
|
-
/* 11 */
|
|
733
|
-
/***/
|
|
734
|
-
function(_, k, T) {
|
|
735
|
-
var g = /* @__PURE__ */ function() {
|
|
736
|
-
function n(v, t) {
|
|
737
|
-
for (var s = 0; s < t.length; s++) {
|
|
738
|
-
var h = t[s];
|
|
739
|
-
h.enumerable = h.enumerable || !1, h.configurable = !0, "value" in h && (h.writable = !0), Object.defineProperty(v, h.key, h);
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
return function(v, t, s) {
|
|
743
|
-
return t && n(v.prototype, t), s && n(v, s), v;
|
|
744
|
-
};
|
|
745
|
-
}();
|
|
746
|
-
function a(n, v) {
|
|
747
|
-
if (!(n instanceof v))
|
|
748
|
-
throw new TypeError("Cannot call a class as a function");
|
|
749
|
-
}
|
|
750
|
-
var i = function(n) {
|
|
751
|
-
return { value: n, next: null, prev: null };
|
|
752
|
-
}, r = function(n, v, t, s) {
|
|
753
|
-
return n !== null ? n.next = v : s.head = v, t !== null ? t.prev = v : s.tail = v, v.prev = n, v.next = t, s.length++, v;
|
|
754
|
-
}, e = function(n, v) {
|
|
755
|
-
var t = n.prev, s = n.next;
|
|
756
|
-
return t !== null ? t.next = s : v.head = s, s !== null ? s.prev = t : v.tail = t, n.prev = n.next = null, v.length--, n;
|
|
757
|
-
}, l = function() {
|
|
758
|
-
function n(v) {
|
|
759
|
-
var t = this;
|
|
760
|
-
a(this, n), this.length = 0, this.head = null, this.tail = null, v != null && v.forEach(function(s) {
|
|
761
|
-
return t.push(s);
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
return g(n, [{
|
|
765
|
-
key: "size",
|
|
766
|
-
value: function() {
|
|
767
|
-
return this.length;
|
|
768
|
-
}
|
|
769
|
-
}, {
|
|
770
|
-
key: "insertBefore",
|
|
771
|
-
value: function(v, t) {
|
|
772
|
-
return r(t.prev, i(v), t, this);
|
|
773
|
-
}
|
|
774
|
-
}, {
|
|
775
|
-
key: "insertAfter",
|
|
776
|
-
value: function(v, t) {
|
|
777
|
-
return r(t, i(v), t.next, this);
|
|
778
|
-
}
|
|
779
|
-
}, {
|
|
780
|
-
key: "insertNodeBefore",
|
|
781
|
-
value: function(v, t) {
|
|
782
|
-
return r(t.prev, v, t, this);
|
|
783
|
-
}
|
|
784
|
-
}, {
|
|
785
|
-
key: "insertNodeAfter",
|
|
786
|
-
value: function(v, t) {
|
|
787
|
-
return r(t, v, t.next, this);
|
|
788
|
-
}
|
|
789
|
-
}, {
|
|
790
|
-
key: "push",
|
|
791
|
-
value: function(v) {
|
|
792
|
-
return r(this.tail, i(v), null, this);
|
|
793
|
-
}
|
|
794
|
-
}, {
|
|
795
|
-
key: "unshift",
|
|
796
|
-
value: function(v) {
|
|
797
|
-
return r(null, i(v), this.head, this);
|
|
798
|
-
}
|
|
799
|
-
}, {
|
|
800
|
-
key: "remove",
|
|
801
|
-
value: function(v) {
|
|
802
|
-
return e(v, this);
|
|
803
|
-
}
|
|
804
|
-
}, {
|
|
805
|
-
key: "pop",
|
|
806
|
-
value: function() {
|
|
807
|
-
return e(this.tail, this).value;
|
|
808
|
-
}
|
|
809
|
-
}, {
|
|
810
|
-
key: "popNode",
|
|
811
|
-
value: function() {
|
|
812
|
-
return e(this.tail, this);
|
|
813
|
-
}
|
|
814
|
-
}, {
|
|
815
|
-
key: "shift",
|
|
816
|
-
value: function() {
|
|
817
|
-
return e(this.head, this).value;
|
|
818
|
-
}
|
|
819
|
-
}, {
|
|
820
|
-
key: "shiftNode",
|
|
821
|
-
value: function() {
|
|
822
|
-
return e(this.head, this);
|
|
823
|
-
}
|
|
824
|
-
}, {
|
|
825
|
-
key: "get_object_at",
|
|
826
|
-
value: function(v) {
|
|
827
|
-
if (v <= this.length()) {
|
|
828
|
-
for (var t = 1, s = this.head; t < v; )
|
|
829
|
-
s = s.next, t++;
|
|
830
|
-
return s.value;
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}, {
|
|
834
|
-
key: "set_object_at",
|
|
835
|
-
value: function(v, t) {
|
|
836
|
-
if (v <= this.length()) {
|
|
837
|
-
for (var s = 1, h = this.head; s < v; )
|
|
838
|
-
h = h.next, s++;
|
|
839
|
-
h.value = t;
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
}]), n;
|
|
843
|
-
}();
|
|
844
|
-
_.exports = l;
|
|
845
|
-
},
|
|
846
|
-
/* 12 */
|
|
847
|
-
/***/
|
|
848
|
-
function(_, k, T) {
|
|
849
|
-
function g(a, i, r) {
|
|
850
|
-
this.x = null, this.y = null, a == null && i == null && r == null ? (this.x = 0, this.y = 0) : typeof a == "number" && typeof i == "number" && r == null ? (this.x = a, this.y = i) : a.constructor.name == "Point" && i == null && r == null && (r = a, this.x = r.x, this.y = r.y);
|
|
851
|
-
}
|
|
852
|
-
g.prototype.getX = function() {
|
|
853
|
-
return this.x;
|
|
854
|
-
}, g.prototype.getY = function() {
|
|
855
|
-
return this.y;
|
|
856
|
-
}, g.prototype.getLocation = function() {
|
|
857
|
-
return new g(this.x, this.y);
|
|
858
|
-
}, g.prototype.setLocation = function(a, i, r) {
|
|
859
|
-
a.constructor.name == "Point" && i == null && r == null ? (r = a, this.setLocation(r.x, r.y)) : typeof a == "number" && typeof i == "number" && r == null && (parseInt(a) == a && parseInt(i) == i ? this.move(a, i) : (this.x = Math.floor(a + 0.5), this.y = Math.floor(i + 0.5)));
|
|
860
|
-
}, g.prototype.move = function(a, i) {
|
|
861
|
-
this.x = a, this.y = i;
|
|
862
|
-
}, g.prototype.translate = function(a, i) {
|
|
863
|
-
this.x += a, this.y += i;
|
|
864
|
-
}, g.prototype.equals = function(a) {
|
|
865
|
-
if (a.constructor.name == "Point") {
|
|
866
|
-
var i = a;
|
|
867
|
-
return this.x == i.x && this.y == i.y;
|
|
868
|
-
}
|
|
869
|
-
return this == a;
|
|
870
|
-
}, g.prototype.toString = function() {
|
|
871
|
-
return new g().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
|
|
872
|
-
}, _.exports = g;
|
|
873
|
-
},
|
|
874
|
-
/* 13 */
|
|
875
|
-
/***/
|
|
876
|
-
function(_, k, T) {
|
|
877
|
-
function g(a, i, r, e) {
|
|
878
|
-
this.x = 0, this.y = 0, this.width = 0, this.height = 0, a != null && i != null && r != null && e != null && (this.x = a, this.y = i, this.width = r, this.height = e);
|
|
879
|
-
}
|
|
880
|
-
g.prototype.getX = function() {
|
|
881
|
-
return this.x;
|
|
882
|
-
}, g.prototype.setX = function(a) {
|
|
883
|
-
this.x = a;
|
|
884
|
-
}, g.prototype.getY = function() {
|
|
885
|
-
return this.y;
|
|
886
|
-
}, g.prototype.setY = function(a) {
|
|
887
|
-
this.y = a;
|
|
888
|
-
}, g.prototype.getWidth = function() {
|
|
889
|
-
return this.width;
|
|
890
|
-
}, g.prototype.setWidth = function(a) {
|
|
891
|
-
this.width = a;
|
|
892
|
-
}, g.prototype.getHeight = function() {
|
|
893
|
-
return this.height;
|
|
894
|
-
}, g.prototype.setHeight = function(a) {
|
|
895
|
-
this.height = a;
|
|
896
|
-
}, g.prototype.getRight = function() {
|
|
897
|
-
return this.x + this.width;
|
|
898
|
-
}, g.prototype.getBottom = function() {
|
|
899
|
-
return this.y + this.height;
|
|
900
|
-
}, g.prototype.intersects = function(a) {
|
|
901
|
-
return !(this.getRight() < a.x || this.getBottom() < a.y || a.getRight() < this.x || a.getBottom() < this.y);
|
|
902
|
-
}, g.prototype.getCenterX = function() {
|
|
903
|
-
return this.x + this.width / 2;
|
|
904
|
-
}, g.prototype.getMinX = function() {
|
|
905
|
-
return this.getX();
|
|
906
|
-
}, g.prototype.getMaxX = function() {
|
|
907
|
-
return this.getX() + this.width;
|
|
908
|
-
}, g.prototype.getCenterY = function() {
|
|
909
|
-
return this.y + this.height / 2;
|
|
910
|
-
}, g.prototype.getMinY = function() {
|
|
911
|
-
return this.getY();
|
|
912
|
-
}, g.prototype.getMaxY = function() {
|
|
913
|
-
return this.getY() + this.height;
|
|
914
|
-
}, g.prototype.getWidthHalf = function() {
|
|
915
|
-
return this.width / 2;
|
|
916
|
-
}, g.prototype.getHeightHalf = function() {
|
|
917
|
-
return this.height / 2;
|
|
918
|
-
}, _.exports = g;
|
|
919
|
-
},
|
|
920
|
-
/* 14 */
|
|
921
|
-
/***/
|
|
922
|
-
function(_, k, T) {
|
|
923
|
-
var g = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
|
|
924
|
-
return typeof i;
|
|
925
|
-
} : function(i) {
|
|
926
|
-
return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
|
|
927
|
-
};
|
|
928
|
-
function a() {
|
|
929
|
-
}
|
|
930
|
-
a.lastID = 0, a.createID = function(i) {
|
|
931
|
-
return a.isPrimitive(i) ? i : (i.uniqueID != null || (i.uniqueID = a.getString(), a.lastID++), i.uniqueID);
|
|
932
|
-
}, a.getString = function(i) {
|
|
933
|
-
return i == null && (i = a.lastID), "Object#" + i;
|
|
934
|
-
}, a.isPrimitive = function(i) {
|
|
935
|
-
var r = typeof i > "u" ? "undefined" : g(i);
|
|
936
|
-
return i == null || r != "object" && r != "function";
|
|
937
|
-
}, _.exports = a;
|
|
938
|
-
},
|
|
939
|
-
/* 15 */
|
|
940
|
-
/***/
|
|
941
|
-
function(_, k, T) {
|
|
942
|
-
function g(h) {
|
|
943
|
-
if (Array.isArray(h)) {
|
|
944
|
-
for (var u = 0, c = Array(h.length); u < h.length; u++)
|
|
945
|
-
c[u] = h[u];
|
|
946
|
-
return c;
|
|
947
|
-
} else
|
|
948
|
-
return Array.from(h);
|
|
949
|
-
}
|
|
950
|
-
var a = T(0), i = T(7), r = T(3), e = T(1), l = T(6), n = T(5), v = T(17), t = T(29);
|
|
951
|
-
function s(h) {
|
|
952
|
-
t.call(this), this.layoutQuality = a.QUALITY, this.createBendsAsNeeded = a.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = a.DEFAULT_INCREMENTAL, this.animationOnLayout = a.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = a.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = a.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = a.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new i(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, h != null && (this.isRemoteUse = h);
|
|
953
|
-
}
|
|
954
|
-
s.RANDOM_SEED = 1, s.prototype = Object.create(t.prototype), s.prototype.getGraphManager = function() {
|
|
955
|
-
return this.graphManager;
|
|
956
|
-
}, s.prototype.getAllNodes = function() {
|
|
957
|
-
return this.graphManager.getAllNodes();
|
|
958
|
-
}, s.prototype.getAllEdges = function() {
|
|
959
|
-
return this.graphManager.getAllEdges();
|
|
960
|
-
}, s.prototype.getAllNodesToApplyGravitation = function() {
|
|
961
|
-
return this.graphManager.getAllNodesToApplyGravitation();
|
|
962
|
-
}, s.prototype.newGraphManager = function() {
|
|
963
|
-
var h = new i(this);
|
|
964
|
-
return this.graphManager = h, h;
|
|
965
|
-
}, s.prototype.newGraph = function(h) {
|
|
966
|
-
return new l(null, this.graphManager, h);
|
|
967
|
-
}, s.prototype.newNode = function(h) {
|
|
968
|
-
return new r(this.graphManager, h);
|
|
969
|
-
}, s.prototype.newEdge = function(h) {
|
|
970
|
-
return new e(null, null, h);
|
|
971
|
-
}, s.prototype.checkLayoutSuccess = function() {
|
|
972
|
-
return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
|
|
973
|
-
}, s.prototype.runLayout = function() {
|
|
974
|
-
this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
|
|
975
|
-
var h;
|
|
976
|
-
return this.checkLayoutSuccess() ? h = !1 : h = this.layout(), a.ANIMATE === "during" ? !1 : (h && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, h);
|
|
977
|
-
}, s.prototype.doPostLayout = function() {
|
|
978
|
-
this.incremental || this.transform(), this.update();
|
|
979
|
-
}, s.prototype.update2 = function() {
|
|
980
|
-
if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
|
|
981
|
-
for (var h = this.graphManager.getAllEdges(), u = 0; u < h.length; u++)
|
|
982
|
-
h[u];
|
|
983
|
-
for (var c = this.graphManager.getRoot().getNodes(), u = 0; u < c.length; u++)
|
|
984
|
-
c[u];
|
|
985
|
-
this.update(this.graphManager.getRoot());
|
|
986
|
-
}
|
|
987
|
-
}, s.prototype.update = function(h) {
|
|
988
|
-
if (h == null)
|
|
989
|
-
this.update2();
|
|
990
|
-
else if (h instanceof r) {
|
|
991
|
-
var u = h;
|
|
992
|
-
if (u.getChild() != null)
|
|
993
|
-
for (var c = u.getChild().getNodes(), N = 0; N < c.length; N++)
|
|
994
|
-
update(c[N]);
|
|
995
|
-
if (u.vGraphObject != null) {
|
|
996
|
-
var d = u.vGraphObject;
|
|
997
|
-
d.update(u);
|
|
998
|
-
}
|
|
999
|
-
} else if (h instanceof e) {
|
|
1000
|
-
var y = h;
|
|
1001
|
-
if (y.vGraphObject != null) {
|
|
1002
|
-
var I = y.vGraphObject;
|
|
1003
|
-
I.update(y);
|
|
1004
|
-
}
|
|
1005
|
-
} else if (h instanceof l) {
|
|
1006
|
-
var w = h;
|
|
1007
|
-
if (w.vGraphObject != null) {
|
|
1008
|
-
var Y = w.vGraphObject;
|
|
1009
|
-
Y.update(w);
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
}, s.prototype.initParameters = function() {
|
|
1013
|
-
this.isSubLayout || (this.layoutQuality = a.QUALITY, this.animationDuringLayout = a.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = a.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = a.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = a.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = a.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = a.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
|
|
1014
|
-
}, s.prototype.transform = function(h) {
|
|
1015
|
-
if (h == null)
|
|
1016
|
-
this.transform(new n(0, 0));
|
|
1017
|
-
else {
|
|
1018
|
-
var u = new v(), c = this.graphManager.getRoot().updateLeftTop();
|
|
1019
|
-
if (c != null) {
|
|
1020
|
-
u.setWorldOrgX(h.x), u.setWorldOrgY(h.y), u.setDeviceOrgX(c.x), u.setDeviceOrgY(c.y);
|
|
1021
|
-
for (var N = this.getAllNodes(), d, y = 0; y < N.length; y++)
|
|
1022
|
-
d = N[y], d.transform(u);
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
}, s.prototype.positionNodesRandomly = function(h) {
|
|
1026
|
-
if (h == null)
|
|
1027
|
-
this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
|
|
1028
|
-
else
|
|
1029
|
-
for (var u, c, N = h.getNodes(), d = 0; d < N.length; d++)
|
|
1030
|
-
u = N[d], c = u.getChild(), c == null || c.getNodes().length == 0 ? u.scatter() : (this.positionNodesRandomly(c), u.updateBounds());
|
|
1031
|
-
}, s.prototype.getFlatForest = function() {
|
|
1032
|
-
for (var h = [], u = !0, c = this.graphManager.getRoot().getNodes(), N = !0, d = 0; d < c.length; d++)
|
|
1033
|
-
c[d].getChild() != null && (N = !1);
|
|
1034
|
-
if (!N)
|
|
1035
|
-
return h;
|
|
1036
|
-
var y = /* @__PURE__ */ new Set(), I = [], w = /* @__PURE__ */ new Map(), Y = [];
|
|
1037
|
-
for (Y = Y.concat(c); Y.length > 0 && u; ) {
|
|
1038
|
-
for (I.push(Y[0]); I.length > 0 && u; ) {
|
|
1039
|
-
var F = I[0];
|
|
1040
|
-
I.splice(0, 1), y.add(F);
|
|
1041
|
-
for (var H = F.getEdges(), d = 0; d < H.length; d++) {
|
|
1042
|
-
var z = H[d].getOtherEnd(F);
|
|
1043
|
-
if (w.get(F) != z)
|
|
1044
|
-
if (!y.has(z))
|
|
1045
|
-
I.push(z), w.set(z, F);
|
|
1046
|
-
else {
|
|
1047
|
-
u = !1;
|
|
1048
|
-
break;
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
if (!u)
|
|
1053
|
-
h = [];
|
|
1054
|
-
else {
|
|
1055
|
-
var q = [].concat(g(y));
|
|
1056
|
-
h.push(q);
|
|
1057
|
-
for (var d = 0; d < q.length; d++) {
|
|
1058
|
-
var x = q[d], it = Y.indexOf(x);
|
|
1059
|
-
it > -1 && Y.splice(it, 1);
|
|
1060
|
-
}
|
|
1061
|
-
y = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map();
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
return h;
|
|
1065
|
-
}, s.prototype.createDummyNodesForBendpoints = function(h) {
|
|
1066
|
-
for (var u = [], c = h.source, N = this.graphManager.calcLowestCommonAncestor(h.source, h.target), d = 0; d < h.bendpoints.length; d++) {
|
|
1067
|
-
var y = this.newNode(null);
|
|
1068
|
-
y.setRect(new Point(0, 0), new Dimension(1, 1)), N.add(y);
|
|
1069
|
-
var I = this.newEdge(null);
|
|
1070
|
-
this.graphManager.add(I, c, y), u.add(y), c = y;
|
|
1071
|
-
}
|
|
1072
|
-
var I = this.newEdge(null);
|
|
1073
|
-
return this.graphManager.add(I, c, h.target), this.edgeToDummyNodes.set(h, u), h.isInterGraph() ? this.graphManager.remove(h) : N.remove(h), u;
|
|
1074
|
-
}, s.prototype.createBendpointsFromDummyNodes = function() {
|
|
1075
|
-
var h = [];
|
|
1076
|
-
h = h.concat(this.graphManager.getAllEdges()), h = [].concat(g(this.edgeToDummyNodes.keys())).concat(h);
|
|
1077
|
-
for (var u = 0; u < h.length; u++) {
|
|
1078
|
-
var c = h[u];
|
|
1079
|
-
if (c.bendpoints.length > 0) {
|
|
1080
|
-
for (var N = this.edgeToDummyNodes.get(c), d = 0; d < N.length; d++) {
|
|
1081
|
-
var y = N[d], I = new n(y.getCenterX(), y.getCenterY()), w = c.bendpoints.get(d);
|
|
1082
|
-
w.x = I.x, w.y = I.y, y.getOwner().remove(y);
|
|
1083
|
-
}
|
|
1084
|
-
this.graphManager.add(c, c.source, c.target);
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
}, s.transform = function(h, u, c, N) {
|
|
1088
|
-
if (c != null && N != null) {
|
|
1089
|
-
var d = u;
|
|
1090
|
-
if (h <= 50) {
|
|
1091
|
-
var y = u / c;
|
|
1092
|
-
d -= (u - y) / 50 * (50 - h);
|
|
1093
|
-
} else {
|
|
1094
|
-
var I = u * N;
|
|
1095
|
-
d += (I - u) / 50 * (h - 50);
|
|
1096
|
-
}
|
|
1097
|
-
return d;
|
|
1098
|
-
} else {
|
|
1099
|
-
var w, Y;
|
|
1100
|
-
return h <= 50 ? (w = 9 * u / 500, Y = u / 10) : (w = 9 * u / 50, Y = -8 * u), w * h + Y;
|
|
1101
|
-
}
|
|
1102
|
-
}, s.findCenterOfTree = function(h) {
|
|
1103
|
-
var u = [];
|
|
1104
|
-
u = u.concat(h);
|
|
1105
|
-
var c = [], N = /* @__PURE__ */ new Map(), d = !1, y = null;
|
|
1106
|
-
(u.length == 1 || u.length == 2) && (d = !0, y = u[0]);
|
|
1107
|
-
for (var I = 0; I < u.length; I++) {
|
|
1108
|
-
var w = u[I], Y = w.getNeighborsList().size;
|
|
1109
|
-
N.set(w, w.getNeighborsList().size), Y == 1 && c.push(w);
|
|
1110
|
-
}
|
|
1111
|
-
var F = [];
|
|
1112
|
-
for (F = F.concat(c); !d; ) {
|
|
1113
|
-
var H = [];
|
|
1114
|
-
H = H.concat(F), F = [];
|
|
1115
|
-
for (var I = 0; I < u.length; I++) {
|
|
1116
|
-
var w = u[I], z = u.indexOf(w);
|
|
1117
|
-
z >= 0 && u.splice(z, 1);
|
|
1118
|
-
var q = w.getNeighborsList();
|
|
1119
|
-
q.forEach(function(o) {
|
|
1120
|
-
if (c.indexOf(o) < 0) {
|
|
1121
|
-
var E = N.get(o), f = E - 1;
|
|
1122
|
-
f == 1 && F.push(o), N.set(o, f);
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1125
|
-
}
|
|
1126
|
-
c = c.concat(F), (u.length == 1 || u.length == 2) && (d = !0, y = u[0]);
|
|
1127
|
-
}
|
|
1128
|
-
return y;
|
|
1129
|
-
}, s.prototype.setGraphManager = function(h) {
|
|
1130
|
-
this.graphManager = h;
|
|
1131
|
-
}, _.exports = s;
|
|
1132
|
-
},
|
|
1133
|
-
/* 16 */
|
|
1134
|
-
/***/
|
|
1135
|
-
function(_, k, T) {
|
|
1136
|
-
function g() {
|
|
1137
|
-
}
|
|
1138
|
-
g.seed = 1, g.x = 0, g.nextDouble = function() {
|
|
1139
|
-
return g.x = Math.sin(g.seed++) * 1e4, g.x - Math.floor(g.x);
|
|
1140
|
-
}, _.exports = g;
|
|
1141
|
-
},
|
|
1142
|
-
/* 17 */
|
|
1143
|
-
/***/
|
|
1144
|
-
function(_, k, T) {
|
|
1145
|
-
var g = T(5);
|
|
1146
|
-
function a(i, r) {
|
|
1147
|
-
this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
|
|
1148
|
-
}
|
|
1149
|
-
a.prototype.getWorldOrgX = function() {
|
|
1150
|
-
return this.lworldOrgX;
|
|
1151
|
-
}, a.prototype.setWorldOrgX = function(i) {
|
|
1152
|
-
this.lworldOrgX = i;
|
|
1153
|
-
}, a.prototype.getWorldOrgY = function() {
|
|
1154
|
-
return this.lworldOrgY;
|
|
1155
|
-
}, a.prototype.setWorldOrgY = function(i) {
|
|
1156
|
-
this.lworldOrgY = i;
|
|
1157
|
-
}, a.prototype.getWorldExtX = function() {
|
|
1158
|
-
return this.lworldExtX;
|
|
1159
|
-
}, a.prototype.setWorldExtX = function(i) {
|
|
1160
|
-
this.lworldExtX = i;
|
|
1161
|
-
}, a.prototype.getWorldExtY = function() {
|
|
1162
|
-
return this.lworldExtY;
|
|
1163
|
-
}, a.prototype.setWorldExtY = function(i) {
|
|
1164
|
-
this.lworldExtY = i;
|
|
1165
|
-
}, a.prototype.getDeviceOrgX = function() {
|
|
1166
|
-
return this.ldeviceOrgX;
|
|
1167
|
-
}, a.prototype.setDeviceOrgX = function(i) {
|
|
1168
|
-
this.ldeviceOrgX = i;
|
|
1169
|
-
}, a.prototype.getDeviceOrgY = function() {
|
|
1170
|
-
return this.ldeviceOrgY;
|
|
1171
|
-
}, a.prototype.setDeviceOrgY = function(i) {
|
|
1172
|
-
this.ldeviceOrgY = i;
|
|
1173
|
-
}, a.prototype.getDeviceExtX = function() {
|
|
1174
|
-
return this.ldeviceExtX;
|
|
1175
|
-
}, a.prototype.setDeviceExtX = function(i) {
|
|
1176
|
-
this.ldeviceExtX = i;
|
|
1177
|
-
}, a.prototype.getDeviceExtY = function() {
|
|
1178
|
-
return this.ldeviceExtY;
|
|
1179
|
-
}, a.prototype.setDeviceExtY = function(i) {
|
|
1180
|
-
this.ldeviceExtY = i;
|
|
1181
|
-
}, a.prototype.transformX = function(i) {
|
|
1182
|
-
var r = 0, e = this.lworldExtX;
|
|
1183
|
-
return e != 0 && (r = this.ldeviceOrgX + (i - this.lworldOrgX) * this.ldeviceExtX / e), r;
|
|
1184
|
-
}, a.prototype.transformY = function(i) {
|
|
1185
|
-
var r = 0, e = this.lworldExtY;
|
|
1186
|
-
return e != 0 && (r = this.ldeviceOrgY + (i - this.lworldOrgY) * this.ldeviceExtY / e), r;
|
|
1187
|
-
}, a.prototype.inverseTransformX = function(i) {
|
|
1188
|
-
var r = 0, e = this.ldeviceExtX;
|
|
1189
|
-
return e != 0 && (r = this.lworldOrgX + (i - this.ldeviceOrgX) * this.lworldExtX / e), r;
|
|
1190
|
-
}, a.prototype.inverseTransformY = function(i) {
|
|
1191
|
-
var r = 0, e = this.ldeviceExtY;
|
|
1192
|
-
return e != 0 && (r = this.lworldOrgY + (i - this.ldeviceOrgY) * this.lworldExtY / e), r;
|
|
1193
|
-
}, a.prototype.inverseTransformPoint = function(i) {
|
|
1194
|
-
var r = new g(this.inverseTransformX(i.x), this.inverseTransformY(i.y));
|
|
1195
|
-
return r;
|
|
1196
|
-
}, _.exports = a;
|
|
1197
|
-
},
|
|
1198
|
-
/* 18 */
|
|
1199
|
-
/***/
|
|
1200
|
-
function(_, k, T) {
|
|
1201
|
-
function g(t) {
|
|
1202
|
-
if (Array.isArray(t)) {
|
|
1203
|
-
for (var s = 0, h = Array(t.length); s < t.length; s++)
|
|
1204
|
-
h[s] = t[s];
|
|
1205
|
-
return h;
|
|
1206
|
-
} else
|
|
1207
|
-
return Array.from(t);
|
|
1208
|
-
}
|
|
1209
|
-
var a = T(15), i = T(4), r = T(0), e = T(8), l = T(9);
|
|
1210
|
-
function n() {
|
|
1211
|
-
a.call(this), this.useSmartIdealEdgeLengthCalculation = i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = i.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = i.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = i.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * i.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = i.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = i.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = i.MAX_ITERATIONS;
|
|
1212
|
-
}
|
|
1213
|
-
n.prototype = Object.create(a.prototype);
|
|
1214
|
-
for (var v in a)
|
|
1215
|
-
n[v] = a[v];
|
|
1216
|
-
n.prototype.initParameters = function() {
|
|
1217
|
-
a.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
|
|
1218
|
-
}, n.prototype.calcIdealEdgeLengths = function() {
|
|
1219
|
-
for (var t, s, h, u, c, N, d, y = this.getGraphManager().getAllEdges(), I = 0; I < y.length; I++)
|
|
1220
|
-
t = y[I], s = t.idealLength, t.isInterGraph && (u = t.getSource(), c = t.getTarget(), N = t.getSourceInLca().getEstimatedSize(), d = t.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (t.idealLength += N + d - 2 * r.SIMPLE_NODE_SIZE), h = t.getLca().getInclusionTreeDepth(), t.idealLength += s * i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (u.getInclusionTreeDepth() + c.getInclusionTreeDepth() - 2 * h));
|
|
1221
|
-
}, n.prototype.initSpringEmbedder = function() {
|
|
1222
|
-
var t = this.getAllNodes().length;
|
|
1223
|
-
this.incremental ? (t > i.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * i.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (t - i.ADAPTATION_LOWER_NODE_LIMIT) / (i.ADAPTATION_UPPER_NODE_LIMIT - i.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - i.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = i.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (t > i.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(i.COOLING_ADAPTATION_FACTOR, 1 - (t - i.ADAPTATION_LOWER_NODE_LIMIT) / (i.ADAPTATION_UPPER_NODE_LIMIT - i.ADAPTATION_LOWER_NODE_LIMIT) * (1 - i.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = i.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * i.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
|
|
1224
|
-
}, n.prototype.calcSpringForces = function() {
|
|
1225
|
-
for (var t = this.getAllEdges(), s, h = 0; h < t.length; h++)
|
|
1226
|
-
s = t[h], this.calcSpringForce(s, s.idealLength);
|
|
1227
|
-
}, n.prototype.calcRepulsionForces = function() {
|
|
1228
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, h, u, c, N, d = this.getAllNodes(), y;
|
|
1229
|
-
if (this.useFRGridVariant)
|
|
1230
|
-
for (this.totalIterations % i.GRID_CALCULATION_CHECK_PERIOD == 1 && t && this.updateGrid(), y = /* @__PURE__ */ new Set(), h = 0; h < d.length; h++)
|
|
1231
|
-
c = d[h], this.calculateRepulsionForceOfANode(c, y, t, s), y.add(c);
|
|
1232
|
-
else
|
|
1233
|
-
for (h = 0; h < d.length; h++)
|
|
1234
|
-
for (c = d[h], u = h + 1; u < d.length; u++)
|
|
1235
|
-
N = d[u], c.getOwner() == N.getOwner() && this.calcRepulsionForce(c, N);
|
|
1236
|
-
}, n.prototype.calcGravitationalForces = function() {
|
|
1237
|
-
for (var t, s = this.getAllNodesToApplyGravitation(), h = 0; h < s.length; h++)
|
|
1238
|
-
t = s[h], this.calcGravitationalForce(t);
|
|
1239
|
-
}, n.prototype.moveNodes = function() {
|
|
1240
|
-
for (var t = this.getAllNodes(), s, h = 0; h < t.length; h++)
|
|
1241
|
-
s = t[h], s.move();
|
|
1242
|
-
}, n.prototype.calcSpringForce = function(t, s) {
|
|
1243
|
-
var h = t.getSource(), u = t.getTarget(), c, N, d, y;
|
|
1244
|
-
if (this.uniformLeafNodeSizes && h.getChild() == null && u.getChild() == null)
|
|
1245
|
-
t.updateLengthSimple();
|
|
1246
|
-
else if (t.updateLength(), t.isOverlapingSourceAndTarget)
|
|
1247
|
-
return;
|
|
1248
|
-
c = t.getLength(), c != 0 && (N = t.edgeElasticity * (c - s), d = N * (t.lengthX / c), y = N * (t.lengthY / c), h.springForceX += d, h.springForceY += y, u.springForceX -= d, u.springForceY -= y);
|
|
1249
|
-
}, n.prototype.calcRepulsionForce = function(t, s) {
|
|
1250
|
-
var h = t.getRect(), u = s.getRect(), c = new Array(2), N = new Array(4), d, y, I, w, Y, F, H;
|
|
1251
|
-
if (h.intersects(u)) {
|
|
1252
|
-
e.calcSeparationAmount(h, u, c, i.DEFAULT_EDGE_LENGTH / 2), F = 2 * c[0], H = 2 * c[1];
|
|
1253
|
-
var z = t.noOfChildren * s.noOfChildren / (t.noOfChildren + s.noOfChildren);
|
|
1254
|
-
t.repulsionForceX -= z * F, t.repulsionForceY -= z * H, s.repulsionForceX += z * F, s.repulsionForceY += z * H;
|
|
1255
|
-
} else
|
|
1256
|
-
this.uniformLeafNodeSizes && t.getChild() == null && s.getChild() == null ? (d = u.getCenterX() - h.getCenterX(), y = u.getCenterY() - h.getCenterY()) : (e.getIntersection(h, u, N), d = N[2] - N[0], y = N[3] - N[1]), Math.abs(d) < i.MIN_REPULSION_DIST && (d = l.sign(d) * i.MIN_REPULSION_DIST), Math.abs(y) < i.MIN_REPULSION_DIST && (y = l.sign(y) * i.MIN_REPULSION_DIST), I = d * d + y * y, w = Math.sqrt(I), Y = (t.nodeRepulsion / 2 + s.nodeRepulsion / 2) * t.noOfChildren * s.noOfChildren / I, F = Y * d / w, H = Y * y / w, t.repulsionForceX -= F, t.repulsionForceY -= H, s.repulsionForceX += F, s.repulsionForceY += H;
|
|
1257
|
-
}, n.prototype.calcGravitationalForce = function(t) {
|
|
1258
|
-
var s, h, u, c, N, d, y, I;
|
|
1259
|
-
s = t.getOwner(), h = (s.getRight() + s.getLeft()) / 2, u = (s.getTop() + s.getBottom()) / 2, c = t.getCenterX() - h, N = t.getCenterY() - u, d = Math.abs(c) + t.getWidth() / 2, y = Math.abs(N) + t.getHeight() / 2, t.getOwner() == this.graphManager.getRoot() ? (I = s.getEstimatedSize() * this.gravityRangeFactor, (d > I || y > I) && (t.gravitationForceX = -this.gravityConstant * c, t.gravitationForceY = -this.gravityConstant * N)) : (I = s.getEstimatedSize() * this.compoundGravityRangeFactor, (d > I || y > I) && (t.gravitationForceX = -this.gravityConstant * c * this.compoundGravityConstant, t.gravitationForceY = -this.gravityConstant * N * this.compoundGravityConstant));
|
|
1260
|
-
}, n.prototype.isConverged = function() {
|
|
1261
|
-
var t, s = !1;
|
|
1262
|
-
return this.totalIterations > this.maxIterations / 3 && (s = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), t = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, t || s;
|
|
1263
|
-
}, n.prototype.animate = function() {
|
|
1264
|
-
this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
|
|
1265
|
-
}, n.prototype.calcNoOfChildrenForAllNodes = function() {
|
|
1266
|
-
for (var t, s = this.graphManager.getAllNodes(), h = 0; h < s.length; h++)
|
|
1267
|
-
t = s[h], t.noOfChildren = t.getNoOfChildren();
|
|
1268
|
-
}, n.prototype.calcGrid = function(t) {
|
|
1269
|
-
var s = 0, h = 0;
|
|
1270
|
-
s = parseInt(Math.ceil((t.getRight() - t.getLeft()) / this.repulsionRange)), h = parseInt(Math.ceil((t.getBottom() - t.getTop()) / this.repulsionRange));
|
|
1271
|
-
for (var u = new Array(s), c = 0; c < s; c++)
|
|
1272
|
-
u[c] = new Array(h);
|
|
1273
|
-
for (var c = 0; c < s; c++)
|
|
1274
|
-
for (var N = 0; N < h; N++)
|
|
1275
|
-
u[c][N] = new Array();
|
|
1276
|
-
return u;
|
|
1277
|
-
}, n.prototype.addNodeToGrid = function(t, s, h) {
|
|
1278
|
-
var u = 0, c = 0, N = 0, d = 0;
|
|
1279
|
-
u = parseInt(Math.floor((t.getRect().x - s) / this.repulsionRange)), c = parseInt(Math.floor((t.getRect().width + t.getRect().x - s) / this.repulsionRange)), N = parseInt(Math.floor((t.getRect().y - h) / this.repulsionRange)), d = parseInt(Math.floor((t.getRect().height + t.getRect().y - h) / this.repulsionRange));
|
|
1280
|
-
for (var y = u; y <= c; y++)
|
|
1281
|
-
for (var I = N; I <= d; I++)
|
|
1282
|
-
this.grid[y][I].push(t), t.setGridCoordinates(u, c, N, d);
|
|
1283
|
-
}, n.prototype.updateGrid = function() {
|
|
1284
|
-
var t, s, h = this.getAllNodes();
|
|
1285
|
-
for (this.grid = this.calcGrid(this.graphManager.getRoot()), t = 0; t < h.length; t++)
|
|
1286
|
-
s = h[t], this.addNodeToGrid(s, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
|
|
1287
|
-
}, n.prototype.calculateRepulsionForceOfANode = function(t, s, h, u) {
|
|
1288
|
-
if (this.totalIterations % i.GRID_CALCULATION_CHECK_PERIOD == 1 && h || u) {
|
|
1289
|
-
var c = /* @__PURE__ */ new Set();
|
|
1290
|
-
t.surrounding = new Array();
|
|
1291
|
-
for (var N, d = this.grid, y = t.startX - 1; y < t.finishX + 2; y++)
|
|
1292
|
-
for (var I = t.startY - 1; I < t.finishY + 2; I++)
|
|
1293
|
-
if (!(y < 0 || I < 0 || y >= d.length || I >= d[0].length)) {
|
|
1294
|
-
for (var w = 0; w < d[y][I].length; w++)
|
|
1295
|
-
if (N = d[y][I][w], !(t.getOwner() != N.getOwner() || t == N) && !s.has(N) && !c.has(N)) {
|
|
1296
|
-
var Y = Math.abs(t.getCenterX() - N.getCenterX()) - (t.getWidth() / 2 + N.getWidth() / 2), F = Math.abs(t.getCenterY() - N.getCenterY()) - (t.getHeight() / 2 + N.getHeight() / 2);
|
|
1297
|
-
Y <= this.repulsionRange && F <= this.repulsionRange && c.add(N);
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
t.surrounding = [].concat(g(c));
|
|
1301
|
-
}
|
|
1302
|
-
for (y = 0; y < t.surrounding.length; y++)
|
|
1303
|
-
this.calcRepulsionForce(t, t.surrounding[y]);
|
|
1304
|
-
}, n.prototype.calcRepulsionRange = function() {
|
|
1305
|
-
return 0;
|
|
1306
|
-
}, _.exports = n;
|
|
1307
|
-
},
|
|
1308
|
-
/* 19 */
|
|
1309
|
-
/***/
|
|
1310
|
-
function(_, k, T) {
|
|
1311
|
-
var g = T(1), a = T(4);
|
|
1312
|
-
function i(e, l, n) {
|
|
1313
|
-
g.call(this, e, l, n), this.idealLength = a.DEFAULT_EDGE_LENGTH, this.edgeElasticity = a.DEFAULT_SPRING_STRENGTH;
|
|
1314
|
-
}
|
|
1315
|
-
i.prototype = Object.create(g.prototype);
|
|
1316
|
-
for (var r in g)
|
|
1317
|
-
i[r] = g[r];
|
|
1318
|
-
_.exports = i;
|
|
1319
|
-
},
|
|
1320
|
-
/* 20 */
|
|
1321
|
-
/***/
|
|
1322
|
-
function(_, k, T) {
|
|
1323
|
-
var g = T(3), a = T(4);
|
|
1324
|
-
function i(e, l, n, v) {
|
|
1325
|
-
g.call(this, e, l, n, v), this.nodeRepulsion = a.DEFAULT_REPULSION_STRENGTH, this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0, this.startX = 0, this.finishX = 0, this.startY = 0, this.finishY = 0, this.surrounding = [];
|
|
1326
|
-
}
|
|
1327
|
-
i.prototype = Object.create(g.prototype);
|
|
1328
|
-
for (var r in g)
|
|
1329
|
-
i[r] = g[r];
|
|
1330
|
-
i.prototype.setGridCoordinates = function(e, l, n, v) {
|
|
1331
|
-
this.startX = e, this.finishX = l, this.startY = n, this.finishY = v;
|
|
1332
|
-
}, _.exports = i;
|
|
1333
|
-
},
|
|
1334
|
-
/* 21 */
|
|
1335
|
-
/***/
|
|
1336
|
-
function(_, k, T) {
|
|
1337
|
-
function g(a, i) {
|
|
1338
|
-
this.width = 0, this.height = 0, a !== null && i !== null && (this.height = i, this.width = a);
|
|
1339
|
-
}
|
|
1340
|
-
g.prototype.getWidth = function() {
|
|
1341
|
-
return this.width;
|
|
1342
|
-
}, g.prototype.setWidth = function(a) {
|
|
1343
|
-
this.width = a;
|
|
1344
|
-
}, g.prototype.getHeight = function() {
|
|
1345
|
-
return this.height;
|
|
1346
|
-
}, g.prototype.setHeight = function(a) {
|
|
1347
|
-
this.height = a;
|
|
1348
|
-
}, _.exports = g;
|
|
1349
|
-
},
|
|
1350
|
-
/* 22 */
|
|
1351
|
-
/***/
|
|
1352
|
-
function(_, k, T) {
|
|
1353
|
-
var g = T(14);
|
|
1354
|
-
function a() {
|
|
1355
|
-
this.map = {}, this.keys = [];
|
|
1356
|
-
}
|
|
1357
|
-
a.prototype.put = function(i, r) {
|
|
1358
|
-
var e = g.createID(i);
|
|
1359
|
-
this.contains(e) || (this.map[e] = r, this.keys.push(i));
|
|
1360
|
-
}, a.prototype.contains = function(i) {
|
|
1361
|
-
return g.createID(i), this.map[i] != null;
|
|
1362
|
-
}, a.prototype.get = function(i) {
|
|
1363
|
-
var r = g.createID(i);
|
|
1364
|
-
return this.map[r];
|
|
1365
|
-
}, a.prototype.keySet = function() {
|
|
1366
|
-
return this.keys;
|
|
1367
|
-
}, _.exports = a;
|
|
1368
|
-
},
|
|
1369
|
-
/* 23 */
|
|
1370
|
-
/***/
|
|
1371
|
-
function(_, k, T) {
|
|
1372
|
-
var g = T(14);
|
|
1373
|
-
function a() {
|
|
1374
|
-
this.set = {};
|
|
1375
|
-
}
|
|
1376
|
-
a.prototype.add = function(i) {
|
|
1377
|
-
var r = g.createID(i);
|
|
1378
|
-
this.contains(r) || (this.set[r] = i);
|
|
1379
|
-
}, a.prototype.remove = function(i) {
|
|
1380
|
-
delete this.set[g.createID(i)];
|
|
1381
|
-
}, a.prototype.clear = function() {
|
|
1382
|
-
this.set = {};
|
|
1383
|
-
}, a.prototype.contains = function(i) {
|
|
1384
|
-
return this.set[g.createID(i)] == i;
|
|
1385
|
-
}, a.prototype.isEmpty = function() {
|
|
1386
|
-
return this.size() === 0;
|
|
1387
|
-
}, a.prototype.size = function() {
|
|
1388
|
-
return Object.keys(this.set).length;
|
|
1389
|
-
}, a.prototype.addAllTo = function(i) {
|
|
1390
|
-
for (var r = Object.keys(this.set), e = r.length, l = 0; l < e; l++)
|
|
1391
|
-
i.push(this.set[r[l]]);
|
|
1392
|
-
}, a.prototype.size = function() {
|
|
1393
|
-
return Object.keys(this.set).length;
|
|
1394
|
-
}, a.prototype.addAll = function(i) {
|
|
1395
|
-
for (var r = i.length, e = 0; e < r; e++) {
|
|
1396
|
-
var l = i[e];
|
|
1397
|
-
this.add(l);
|
|
1398
|
-
}
|
|
1399
|
-
}, _.exports = a;
|
|
1400
|
-
},
|
|
1401
|
-
/* 24 */
|
|
1402
|
-
/***/
|
|
1403
|
-
function(_, k, T) {
|
|
1404
|
-
function g() {
|
|
1405
|
-
}
|
|
1406
|
-
g.multMat = function(a, i) {
|
|
1407
|
-
for (var r = [], e = 0; e < a.length; e++) {
|
|
1408
|
-
r[e] = [];
|
|
1409
|
-
for (var l = 0; l < i[0].length; l++) {
|
|
1410
|
-
r[e][l] = 0;
|
|
1411
|
-
for (var n = 0; n < a[0].length; n++)
|
|
1412
|
-
r[e][l] += a[e][n] * i[n][l];
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
return r;
|
|
1416
|
-
}, g.transpose = function(a) {
|
|
1417
|
-
for (var i = [], r = 0; r < a[0].length; r++) {
|
|
1418
|
-
i[r] = [];
|
|
1419
|
-
for (var e = 0; e < a.length; e++)
|
|
1420
|
-
i[r][e] = a[e][r];
|
|
1421
|
-
}
|
|
1422
|
-
return i;
|
|
1423
|
-
}, g.multCons = function(a, i) {
|
|
1424
|
-
for (var r = [], e = 0; e < a.length; e++)
|
|
1425
|
-
r[e] = a[e] * i;
|
|
1426
|
-
return r;
|
|
1427
|
-
}, g.minusOp = function(a, i) {
|
|
1428
|
-
for (var r = [], e = 0; e < a.length; e++)
|
|
1429
|
-
r[e] = a[e] - i[e];
|
|
1430
|
-
return r;
|
|
1431
|
-
}, g.dotProduct = function(a, i) {
|
|
1432
|
-
for (var r = 0, e = 0; e < a.length; e++)
|
|
1433
|
-
r += a[e] * i[e];
|
|
1434
|
-
return r;
|
|
1435
|
-
}, g.mag = function(a) {
|
|
1436
|
-
return Math.sqrt(this.dotProduct(a, a));
|
|
1437
|
-
}, g.normalize = function(a) {
|
|
1438
|
-
for (var i = [], r = this.mag(a), e = 0; e < a.length; e++)
|
|
1439
|
-
i[e] = a[e] / r;
|
|
1440
|
-
return i;
|
|
1441
|
-
}, g.multGamma = function(a) {
|
|
1442
|
-
for (var i = [], r = 0, e = 0; e < a.length; e++)
|
|
1443
|
-
r += a[e];
|
|
1444
|
-
r *= -1 / a.length;
|
|
1445
|
-
for (var l = 0; l < a.length; l++)
|
|
1446
|
-
i[l] = r + a[l];
|
|
1447
|
-
return i;
|
|
1448
|
-
}, g.multL = function(a, i, r) {
|
|
1449
|
-
for (var e = [], l = [], n = [], v = 0; v < i[0].length; v++) {
|
|
1450
|
-
for (var t = 0, s = 0; s < i.length; s++)
|
|
1451
|
-
t += -0.5 * i[s][v] * a[s];
|
|
1452
|
-
l[v] = t;
|
|
1453
|
-
}
|
|
1454
|
-
for (var h = 0; h < r.length; h++) {
|
|
1455
|
-
for (var u = 0, c = 0; c < r.length; c++)
|
|
1456
|
-
u += r[h][c] * l[c];
|
|
1457
|
-
n[h] = u;
|
|
1458
|
-
}
|
|
1459
|
-
for (var N = 0; N < i.length; N++) {
|
|
1460
|
-
for (var d = 0, y = 0; y < i[0].length; y++)
|
|
1461
|
-
d += i[N][y] * n[y];
|
|
1462
|
-
e[N] = d;
|
|
1463
|
-
}
|
|
1464
|
-
return e;
|
|
1465
|
-
}, _.exports = g;
|
|
1466
|
-
},
|
|
1467
|
-
/* 25 */
|
|
1468
|
-
/***/
|
|
1469
|
-
function(_, k, T) {
|
|
1470
|
-
var g = /* @__PURE__ */ function() {
|
|
1471
|
-
function e(l, n) {
|
|
1472
|
-
for (var v = 0; v < n.length; v++) {
|
|
1473
|
-
var t = n[v];
|
|
1474
|
-
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(l, t.key, t);
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
1477
|
-
return function(l, n, v) {
|
|
1478
|
-
return n && e(l.prototype, n), v && e(l, v), l;
|
|
1479
|
-
};
|
|
1480
|
-
}();
|
|
1481
|
-
function a(e, l) {
|
|
1482
|
-
if (!(e instanceof l))
|
|
1483
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1484
|
-
}
|
|
1485
|
-
var i = T(11), r = function() {
|
|
1486
|
-
function e(l, n) {
|
|
1487
|
-
a(this, e), (n !== null || n !== void 0) && (this.compareFunction = this._defaultCompareFunction);
|
|
1488
|
-
var v = void 0;
|
|
1489
|
-
l instanceof i ? v = l.size() : v = l.length, this._quicksort(l, 0, v - 1);
|
|
1490
|
-
}
|
|
1491
|
-
return g(e, [{
|
|
1492
|
-
key: "_quicksort",
|
|
1493
|
-
value: function(l, n, v) {
|
|
1494
|
-
if (n < v) {
|
|
1495
|
-
var t = this._partition(l, n, v);
|
|
1496
|
-
this._quicksort(l, n, t), this._quicksort(l, t + 1, v);
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
}, {
|
|
1500
|
-
key: "_partition",
|
|
1501
|
-
value: function(l, n, v) {
|
|
1502
|
-
for (var t = this._get(l, n), s = n, h = v; ; ) {
|
|
1503
|
-
for (; this.compareFunction(t, this._get(l, h)); )
|
|
1504
|
-
h--;
|
|
1505
|
-
for (; this.compareFunction(this._get(l, s), t); )
|
|
1506
|
-
s++;
|
|
1507
|
-
if (s < h)
|
|
1508
|
-
this._swap(l, s, h), s++, h--;
|
|
1509
|
-
else return h;
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
}, {
|
|
1513
|
-
key: "_get",
|
|
1514
|
-
value: function(l, n) {
|
|
1515
|
-
return l instanceof i ? l.get_object_at(n) : l[n];
|
|
1516
|
-
}
|
|
1517
|
-
}, {
|
|
1518
|
-
key: "_set",
|
|
1519
|
-
value: function(l, n, v) {
|
|
1520
|
-
l instanceof i ? l.set_object_at(n, v) : l[n] = v;
|
|
1521
|
-
}
|
|
1522
|
-
}, {
|
|
1523
|
-
key: "_swap",
|
|
1524
|
-
value: function(l, n, v) {
|
|
1525
|
-
var t = this._get(l, n);
|
|
1526
|
-
this._set(l, n, this._get(l, v)), this._set(l, v, t);
|
|
1527
|
-
}
|
|
1528
|
-
}, {
|
|
1529
|
-
key: "_defaultCompareFunction",
|
|
1530
|
-
value: function(l, n) {
|
|
1531
|
-
return n > l;
|
|
1532
|
-
}
|
|
1533
|
-
}]), e;
|
|
1534
|
-
}();
|
|
1535
|
-
_.exports = r;
|
|
1536
|
-
},
|
|
1537
|
-
/* 26 */
|
|
1538
|
-
/***/
|
|
1539
|
-
function(_, k, T) {
|
|
1540
|
-
function g() {
|
|
1541
|
-
}
|
|
1542
|
-
g.svd = function(a) {
|
|
1543
|
-
this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = a.length, this.n = a[0].length;
|
|
1544
|
-
var i = Math.min(this.m, this.n);
|
|
1545
|
-
this.s = function(Mt) {
|
|
1546
|
-
for (var At = []; Mt-- > 0; )
|
|
1547
|
-
At.push(0);
|
|
1548
|
-
return At;
|
|
1549
|
-
}(Math.min(this.m + 1, this.n)), this.U = function(Mt) {
|
|
1550
|
-
var At = function Ut(Ht) {
|
|
1551
|
-
if (Ht.length == 0)
|
|
1552
|
-
return 0;
|
|
1553
|
-
for (var Rt = [], kt = 0; kt < Ht[0]; kt++)
|
|
1554
|
-
Rt.push(Ut(Ht.slice(1)));
|
|
1555
|
-
return Rt;
|
|
1556
|
-
};
|
|
1557
|
-
return At(Mt);
|
|
1558
|
-
}([this.m, i]), this.V = function(Mt) {
|
|
1559
|
-
var At = function Ut(Ht) {
|
|
1560
|
-
if (Ht.length == 0)
|
|
1561
|
-
return 0;
|
|
1562
|
-
for (var Rt = [], kt = 0; kt < Ht[0]; kt++)
|
|
1563
|
-
Rt.push(Ut(Ht.slice(1)));
|
|
1564
|
-
return Rt;
|
|
1565
|
-
};
|
|
1566
|
-
return At(Mt);
|
|
1567
|
-
}([this.n, this.n]);
|
|
1568
|
-
for (var r = function(Mt) {
|
|
1569
|
-
for (var At = []; Mt-- > 0; )
|
|
1570
|
-
At.push(0);
|
|
1571
|
-
return At;
|
|
1572
|
-
}(this.n), e = function(Mt) {
|
|
1573
|
-
for (var At = []; Mt-- > 0; )
|
|
1574
|
-
At.push(0);
|
|
1575
|
-
return At;
|
|
1576
|
-
}(this.m), l = !0, n = Math.min(this.m - 1, this.n), v = Math.max(0, Math.min(this.n - 2, this.m)), t = 0; t < Math.max(n, v); t++) {
|
|
1577
|
-
if (t < n) {
|
|
1578
|
-
this.s[t] = 0;
|
|
1579
|
-
for (var s = t; s < this.m; s++)
|
|
1580
|
-
this.s[t] = g.hypot(this.s[t], a[s][t]);
|
|
1581
|
-
if (this.s[t] !== 0) {
|
|
1582
|
-
a[t][t] < 0 && (this.s[t] = -this.s[t]);
|
|
1583
|
-
for (var h = t; h < this.m; h++)
|
|
1584
|
-
a[h][t] /= this.s[t];
|
|
1585
|
-
a[t][t] += 1;
|
|
1586
|
-
}
|
|
1587
|
-
this.s[t] = -this.s[t];
|
|
1588
|
-
}
|
|
1589
|
-
for (var u = t + 1; u < this.n; u++) {
|
|
1590
|
-
if (/* @__PURE__ */ function(Mt, At) {
|
|
1591
|
-
return Mt && At;
|
|
1592
|
-
}(t < n, this.s[t] !== 0)) {
|
|
1593
|
-
for (var c = 0, N = t; N < this.m; N++)
|
|
1594
|
-
c += a[N][t] * a[N][u];
|
|
1595
|
-
c = -c / a[t][t];
|
|
1596
|
-
for (var d = t; d < this.m; d++)
|
|
1597
|
-
a[d][u] += c * a[d][t];
|
|
1598
|
-
}
|
|
1599
|
-
r[u] = a[t][u];
|
|
1600
|
-
}
|
|
1601
|
-
if (/* @__PURE__ */ function(Mt, At) {
|
|
1602
|
-
return At;
|
|
1603
|
-
}(l, t < n))
|
|
1604
|
-
for (var y = t; y < this.m; y++)
|
|
1605
|
-
this.U[y][t] = a[y][t];
|
|
1606
|
-
if (t < v) {
|
|
1607
|
-
r[t] = 0;
|
|
1608
|
-
for (var I = t + 1; I < this.n; I++)
|
|
1609
|
-
r[t] = g.hypot(r[t], r[I]);
|
|
1610
|
-
if (r[t] !== 0) {
|
|
1611
|
-
r[t + 1] < 0 && (r[t] = -r[t]);
|
|
1612
|
-
for (var w = t + 1; w < this.n; w++)
|
|
1613
|
-
r[w] /= r[t];
|
|
1614
|
-
r[t + 1] += 1;
|
|
1615
|
-
}
|
|
1616
|
-
if (r[t] = -r[t], /* @__PURE__ */ function(Mt, At) {
|
|
1617
|
-
return Mt && At;
|
|
1618
|
-
}(t + 1 < this.m, r[t] !== 0)) {
|
|
1619
|
-
for (var Y = t + 1; Y < this.m; Y++)
|
|
1620
|
-
e[Y] = 0;
|
|
1621
|
-
for (var F = t + 1; F < this.n; F++)
|
|
1622
|
-
for (var H = t + 1; H < this.m; H++)
|
|
1623
|
-
e[H] += r[F] * a[H][F];
|
|
1624
|
-
for (var z = t + 1; z < this.n; z++)
|
|
1625
|
-
for (var q = -r[z] / r[t + 1], x = t + 1; x < this.m; x++)
|
|
1626
|
-
a[x][z] += q * e[x];
|
|
1627
|
-
}
|
|
1628
|
-
for (var it = t + 1; it < this.n; it++)
|
|
1629
|
-
this.V[it][t] = r[it];
|
|
1630
|
-
}
|
|
1631
|
-
}
|
|
1632
|
-
var o = Math.min(this.n, this.m + 1);
|
|
1633
|
-
n < this.n && (this.s[n] = a[n][n]), this.m < o && (this.s[o - 1] = 0), v + 1 < o && (r[v] = a[v][o - 1]), r[o - 1] = 0;
|
|
1634
|
-
{
|
|
1635
|
-
for (var E = n; E < i; E++) {
|
|
1636
|
-
for (var f = 0; f < this.m; f++)
|
|
1637
|
-
this.U[f][E] = 0;
|
|
1638
|
-
this.U[E][E] = 1;
|
|
1639
|
-
}
|
|
1640
|
-
for (var p = n - 1; p >= 0; p--)
|
|
1641
|
-
if (this.s[p] !== 0) {
|
|
1642
|
-
for (var m = p + 1; m < i; m++) {
|
|
1643
|
-
for (var O = 0, L = p; L < this.m; L++)
|
|
1644
|
-
O += this.U[L][p] * this.U[L][m];
|
|
1645
|
-
O = -O / this.U[p][p];
|
|
1646
|
-
for (var C = p; C < this.m; C++)
|
|
1647
|
-
this.U[C][m] += O * this.U[C][p];
|
|
1648
|
-
}
|
|
1649
|
-
for (var P = p; P < this.m; P++)
|
|
1650
|
-
this.U[P][p] = -this.U[P][p];
|
|
1651
|
-
this.U[p][p] = 1 + this.U[p][p];
|
|
1652
|
-
for (var S = 0; S < p - 1; S++)
|
|
1653
|
-
this.U[S][p] = 0;
|
|
1654
|
-
} else {
|
|
1655
|
-
for (var B = 0; B < this.m; B++)
|
|
1656
|
-
this.U[B][p] = 0;
|
|
1657
|
-
this.U[p][p] = 1;
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1660
|
-
for (var V = this.n - 1; V >= 0; V--) {
|
|
1661
|
-
if (/* @__PURE__ */ function(Mt, At) {
|
|
1662
|
-
return Mt && At;
|
|
1663
|
-
}(V < v, r[V] !== 0))
|
|
1664
|
-
for (var X = V + 1; X < i; X++) {
|
|
1665
|
-
for (var Q = 0, G = V + 1; G < this.n; G++)
|
|
1666
|
-
Q += this.V[G][V] * this.V[G][X];
|
|
1667
|
-
Q = -Q / this.V[V + 1][V];
|
|
1668
|
-
for (var D = V + 1; D < this.n; D++)
|
|
1669
|
-
this.V[D][X] += Q * this.V[D][V];
|
|
1670
|
-
}
|
|
1671
|
-
for (var b = 0; b < this.n; b++)
|
|
1672
|
-
this.V[b][V] = 0;
|
|
1673
|
-
this.V[V][V] = 1;
|
|
1674
|
-
}
|
|
1675
|
-
for (var j = o - 1, et = Math.pow(2, -52), vt = Math.pow(2, -966); o > 0; ) {
|
|
1676
|
-
var $ = void 0, Dt = void 0;
|
|
1677
|
-
for ($ = o - 2; $ >= -1 && $ !== -1; $--)
|
|
1678
|
-
if (Math.abs(r[$]) <= vt + et * (Math.abs(this.s[$]) + Math.abs(this.s[$ + 1]))) {
|
|
1679
|
-
r[$] = 0;
|
|
1680
|
-
break;
|
|
1681
|
-
}
|
|
1682
|
-
if ($ === o - 2)
|
|
1683
|
-
Dt = 4;
|
|
1684
|
-
else {
|
|
1685
|
-
var K = void 0;
|
|
1686
|
-
for (K = o - 1; K >= $ && K !== $; K--) {
|
|
1687
|
-
var nt = (K !== o ? Math.abs(r[K]) : 0) + (K !== $ + 1 ? Math.abs(r[K - 1]) : 0);
|
|
1688
|
-
if (Math.abs(this.s[K]) <= vt + et * nt) {
|
|
1689
|
-
this.s[K] = 0;
|
|
1690
|
-
break;
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
K === $ ? Dt = 3 : K === o - 1 ? Dt = 1 : (Dt = 2, $ = K);
|
|
1694
|
-
}
|
|
1695
|
-
switch ($++, Dt) {
|
|
1696
|
-
case 1:
|
|
1697
|
-
{
|
|
1698
|
-
var mt = r[o - 2];
|
|
1699
|
-
r[o - 2] = 0;
|
|
1700
|
-
for (var ht = o - 2; ht >= $; ht--) {
|
|
1701
|
-
var _t = g.hypot(this.s[ht], mt), Lt = this.s[ht] / _t, Tt = mt / _t;
|
|
1702
|
-
this.s[ht] = _t, ht !== $ && (mt = -Tt * r[ht - 1], r[ht - 1] = Lt * r[ht - 1]);
|
|
1703
|
-
for (var wt = 0; wt < this.n; wt++)
|
|
1704
|
-
_t = Lt * this.V[wt][ht] + Tt * this.V[wt][o - 1], this.V[wt][o - 1] = -Tt * this.V[wt][ht] + Lt * this.V[wt][o - 1], this.V[wt][ht] = _t;
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
break;
|
|
1708
|
-
case 2:
|
|
1709
|
-
{
|
|
1710
|
-
var zt = r[$ - 1];
|
|
1711
|
-
r[$ - 1] = 0;
|
|
1712
|
-
for (var bt = $; bt < o; bt++) {
|
|
1713
|
-
var Gt = g.hypot(this.s[bt], zt), St = this.s[bt] / Gt, Bt = zt / Gt;
|
|
1714
|
-
this.s[bt] = Gt, zt = -Bt * r[bt], r[bt] = St * r[bt];
|
|
1715
|
-
for (var Ft = 0; Ft < this.m; Ft++)
|
|
1716
|
-
Gt = St * this.U[Ft][bt] + Bt * this.U[Ft][$ - 1], this.U[Ft][$ - 1] = -Bt * this.U[Ft][bt] + St * this.U[Ft][$ - 1], this.U[Ft][bt] = Gt;
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
break;
|
|
1720
|
-
case 3:
|
|
1721
|
-
{
|
|
1722
|
-
var $t = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[o - 1]), Math.abs(this.s[o - 2])), Math.abs(r[o - 2])), Math.abs(this.s[$])), Math.abs(r[$])), dt = this.s[o - 1] / $t, M = this.s[o - 2] / $t, R = r[o - 2] / $t, W = this.s[$] / $t, J = r[$] / $t, Z = ((M + dt) * (M - dt) + R * R) / 2, pt = dt * R * (dt * R), lt = 0;
|
|
1723
|
-
/* @__PURE__ */ (function(Mt, At) {
|
|
1724
|
-
return Mt || At;
|
|
1725
|
-
})(Z !== 0, pt !== 0) && (lt = Math.sqrt(Z * Z + pt), Z < 0 && (lt = -lt), lt = pt / (Z + lt));
|
|
1726
|
-
for (var tt = (W + dt) * (W - dt) + lt, gt = W * J, rt = $; rt < o - 1; rt++) {
|
|
1727
|
-
var Nt = g.hypot(tt, gt), yt = tt / Nt, Ct = gt / Nt;
|
|
1728
|
-
rt !== $ && (r[rt - 1] = Nt), tt = yt * this.s[rt] + Ct * r[rt], r[rt] = yt * r[rt] - Ct * this.s[rt], gt = Ct * this.s[rt + 1], this.s[rt + 1] = yt * this.s[rt + 1];
|
|
1729
|
-
for (var ct = 0; ct < this.n; ct++)
|
|
1730
|
-
Nt = yt * this.V[ct][rt] + Ct * this.V[ct][rt + 1], this.V[ct][rt + 1] = -Ct * this.V[ct][rt] + yt * this.V[ct][rt + 1], this.V[ct][rt] = Nt;
|
|
1731
|
-
if (Nt = g.hypot(tt, gt), yt = tt / Nt, Ct = gt / Nt, this.s[rt] = Nt, tt = yt * r[rt] + Ct * this.s[rt + 1], this.s[rt + 1] = -Ct * r[rt] + yt * this.s[rt + 1], gt = Ct * r[rt + 1], r[rt + 1] = yt * r[rt + 1], rt < this.m - 1)
|
|
1732
|
-
for (var at = 0; at < this.m; at++)
|
|
1733
|
-
Nt = yt * this.U[at][rt] + Ct * this.U[at][rt + 1], this.U[at][rt + 1] = -Ct * this.U[at][rt] + yt * this.U[at][rt + 1], this.U[at][rt] = Nt;
|
|
1734
|
-
}
|
|
1735
|
-
r[o - 2] = tt;
|
|
1736
|
-
}
|
|
1737
|
-
break;
|
|
1738
|
-
case 4:
|
|
1739
|
-
{
|
|
1740
|
-
if (this.s[$] <= 0) {
|
|
1741
|
-
this.s[$] = this.s[$] < 0 ? -this.s[$] : 0;
|
|
1742
|
-
for (var st = 0; st <= j; st++)
|
|
1743
|
-
this.V[st][$] = -this.V[st][$];
|
|
1744
|
-
}
|
|
1745
|
-
for (; $ < j && !(this.s[$] >= this.s[$ + 1]); ) {
|
|
1746
|
-
var It = this.s[$];
|
|
1747
|
-
if (this.s[$] = this.s[$ + 1], this.s[$ + 1] = It, $ < this.n - 1)
|
|
1748
|
-
for (var ut = 0; ut < this.n; ut++)
|
|
1749
|
-
It = this.V[ut][$ + 1], this.V[ut][$ + 1] = this.V[ut][$], this.V[ut][$] = It;
|
|
1750
|
-
if ($ < this.m - 1)
|
|
1751
|
-
for (var Ot = 0; Ot < this.m; Ot++)
|
|
1752
|
-
It = this.U[Ot][$ + 1], this.U[Ot][$ + 1] = this.U[Ot][$], this.U[Ot][$] = It;
|
|
1753
|
-
$++;
|
|
1754
|
-
}
|
|
1755
|
-
o--;
|
|
1756
|
-
}
|
|
1757
|
-
break;
|
|
1758
|
-
}
|
|
1759
|
-
}
|
|
1760
|
-
var Yt = { U: this.U, V: this.V, S: this.s };
|
|
1761
|
-
return Yt;
|
|
1762
|
-
}, g.hypot = function(a, i) {
|
|
1763
|
-
var r = void 0;
|
|
1764
|
-
return Math.abs(a) > Math.abs(i) ? (r = i / a, r = Math.abs(a) * Math.sqrt(1 + r * r)) : i != 0 ? (r = a / i, r = Math.abs(i) * Math.sqrt(1 + r * r)) : r = 0, r;
|
|
1765
|
-
}, _.exports = g;
|
|
1766
|
-
},
|
|
1767
|
-
/* 27 */
|
|
1768
|
-
/***/
|
|
1769
|
-
function(_, k, T) {
|
|
1770
|
-
var g = /* @__PURE__ */ function() {
|
|
1771
|
-
function r(e, l) {
|
|
1772
|
-
for (var n = 0; n < l.length; n++) {
|
|
1773
|
-
var v = l[n];
|
|
1774
|
-
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(e, v.key, v);
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
return function(e, l, n) {
|
|
1778
|
-
return l && r(e.prototype, l), n && r(e, n), e;
|
|
1779
|
-
};
|
|
1780
|
-
}();
|
|
1781
|
-
function a(r, e) {
|
|
1782
|
-
if (!(r instanceof e))
|
|
1783
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1784
|
-
}
|
|
1785
|
-
var i = function() {
|
|
1786
|
-
function r(e, l) {
|
|
1787
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, v = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, t = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
|
|
1788
|
-
a(this, r), this.sequence1 = e, this.sequence2 = l, this.match_score = n, this.mismatch_penalty = v, this.gap_penalty = t, this.iMax = e.length + 1, this.jMax = l.length + 1, this.grid = new Array(this.iMax);
|
|
1789
|
-
for (var s = 0; s < this.iMax; s++) {
|
|
1790
|
-
this.grid[s] = new Array(this.jMax);
|
|
1791
|
-
for (var h = 0; h < this.jMax; h++)
|
|
1792
|
-
this.grid[s][h] = 0;
|
|
1793
|
-
}
|
|
1794
|
-
this.tracebackGrid = new Array(this.iMax);
|
|
1795
|
-
for (var u = 0; u < this.iMax; u++) {
|
|
1796
|
-
this.tracebackGrid[u] = new Array(this.jMax);
|
|
1797
|
-
for (var c = 0; c < this.jMax; c++)
|
|
1798
|
-
this.tracebackGrid[u][c] = [null, null, null];
|
|
1799
|
-
}
|
|
1800
|
-
this.alignments = [], this.score = -1, this.computeGrids();
|
|
1801
|
-
}
|
|
1802
|
-
return g(r, [{
|
|
1803
|
-
key: "getScore",
|
|
1804
|
-
value: function() {
|
|
1805
|
-
return this.score;
|
|
1806
|
-
}
|
|
1807
|
-
}, {
|
|
1808
|
-
key: "getAlignments",
|
|
1809
|
-
value: function() {
|
|
1810
|
-
return this.alignments;
|
|
1811
|
-
}
|
|
1812
|
-
// Main dynamic programming procedure
|
|
1813
|
-
}, {
|
|
1814
|
-
key: "computeGrids",
|
|
1815
|
-
value: function() {
|
|
1816
|
-
for (var e = 1; e < this.jMax; e++)
|
|
1817
|
-
this.grid[0][e] = this.grid[0][e - 1] + this.gap_penalty, this.tracebackGrid[0][e] = [!1, !1, !0];
|
|
1818
|
-
for (var l = 1; l < this.iMax; l++)
|
|
1819
|
-
this.grid[l][0] = this.grid[l - 1][0] + this.gap_penalty, this.tracebackGrid[l][0] = [!1, !0, !1];
|
|
1820
|
-
for (var n = 1; n < this.iMax; n++)
|
|
1821
|
-
for (var v = 1; v < this.jMax; v++) {
|
|
1822
|
-
var t = void 0;
|
|
1823
|
-
this.sequence1[n - 1] === this.sequence2[v - 1] ? t = this.grid[n - 1][v - 1] + this.match_score : t = this.grid[n - 1][v - 1] + this.mismatch_penalty;
|
|
1824
|
-
var s = this.grid[n - 1][v] + this.gap_penalty, h = this.grid[n][v - 1] + this.gap_penalty, u = [t, s, h], c = this.arrayAllMaxIndexes(u);
|
|
1825
|
-
this.grid[n][v] = u[c[0]], this.tracebackGrid[n][v] = [c.includes(0), c.includes(1), c.includes(2)];
|
|
1826
|
-
}
|
|
1827
|
-
this.score = this.grid[this.iMax - 1][this.jMax - 1];
|
|
1828
|
-
}
|
|
1829
|
-
// Gets all possible valid sequence combinations
|
|
1830
|
-
}, {
|
|
1831
|
-
key: "alignmentTraceback",
|
|
1832
|
-
value: function() {
|
|
1833
|
-
var e = [];
|
|
1834
|
-
for (e.push({
|
|
1835
|
-
pos: [this.sequence1.length, this.sequence2.length],
|
|
1836
|
-
seq1: "",
|
|
1837
|
-
seq2: ""
|
|
1838
|
-
}); e[0]; ) {
|
|
1839
|
-
var l = e[0], n = this.tracebackGrid[l.pos[0]][l.pos[1]];
|
|
1840
|
-
n[0] && e.push({
|
|
1841
|
-
pos: [l.pos[0] - 1, l.pos[1] - 1],
|
|
1842
|
-
seq1: this.sequence1[l.pos[0] - 1] + l.seq1,
|
|
1843
|
-
seq2: this.sequence2[l.pos[1] - 1] + l.seq2
|
|
1844
|
-
}), n[1] && e.push({
|
|
1845
|
-
pos: [l.pos[0] - 1, l.pos[1]],
|
|
1846
|
-
seq1: this.sequence1[l.pos[0] - 1] + l.seq1,
|
|
1847
|
-
seq2: "-" + l.seq2
|
|
1848
|
-
}), n[2] && e.push({
|
|
1849
|
-
pos: [l.pos[0], l.pos[1] - 1],
|
|
1850
|
-
seq1: "-" + l.seq1,
|
|
1851
|
-
seq2: this.sequence2[l.pos[1] - 1] + l.seq2
|
|
1852
|
-
}), l.pos[0] === 0 && l.pos[1] === 0 && this.alignments.push({
|
|
1853
|
-
sequence1: l.seq1,
|
|
1854
|
-
sequence2: l.seq2
|
|
1855
|
-
}), e.shift();
|
|
1856
|
-
}
|
|
1857
|
-
return this.alignments;
|
|
1858
|
-
}
|
|
1859
|
-
// Helper Functions
|
|
1860
|
-
}, {
|
|
1861
|
-
key: "getAllIndexes",
|
|
1862
|
-
value: function(e, l) {
|
|
1863
|
-
for (var n = [], v = -1; (v = e.indexOf(l, v + 1)) !== -1; )
|
|
1864
|
-
n.push(v);
|
|
1865
|
-
return n;
|
|
1866
|
-
}
|
|
1867
|
-
}, {
|
|
1868
|
-
key: "arrayAllMaxIndexes",
|
|
1869
|
-
value: function(e) {
|
|
1870
|
-
return this.getAllIndexes(e, Math.max.apply(null, e));
|
|
1871
|
-
}
|
|
1872
|
-
}]), r;
|
|
1873
|
-
}();
|
|
1874
|
-
_.exports = i;
|
|
1875
|
-
},
|
|
1876
|
-
/* 28 */
|
|
1877
|
-
/***/
|
|
1878
|
-
function(_, k, T) {
|
|
1879
|
-
var g = function() {
|
|
1880
|
-
};
|
|
1881
|
-
g.FDLayout = T(18), g.FDLayoutConstants = T(4), g.FDLayoutEdge = T(19), g.FDLayoutNode = T(20), g.DimensionD = T(21), g.HashMap = T(22), g.HashSet = T(23), g.IGeometry = T(8), g.IMath = T(9), g.Integer = T(10), g.Point = T(12), g.PointD = T(5), g.RandomSeed = T(16), g.RectangleD = T(13), g.Transform = T(17), g.UniqueIDGeneretor = T(14), g.Quicksort = T(25), g.LinkedList = T(11), g.LGraphObject = T(2), g.LGraph = T(6), g.LEdge = T(1), g.LGraphManager = T(7), g.LNode = T(3), g.Layout = T(15), g.LayoutConstants = T(0), g.NeedlemanWunsch = T(27), g.Matrix = T(24), g.SVD = T(26), _.exports = g;
|
|
1882
|
-
},
|
|
1883
|
-
/* 29 */
|
|
1884
|
-
/***/
|
|
1885
|
-
function(_, k, T) {
|
|
1886
|
-
function g() {
|
|
1887
|
-
this.listeners = [];
|
|
1888
|
-
}
|
|
1889
|
-
var a = g.prototype;
|
|
1890
|
-
a.addListener = function(i, r) {
|
|
1891
|
-
this.listeners.push({
|
|
1892
|
-
event: i,
|
|
1893
|
-
callback: r
|
|
1894
|
-
});
|
|
1895
|
-
}, a.removeListener = function(i, r) {
|
|
1896
|
-
for (var e = this.listeners.length; e >= 0; e--) {
|
|
1897
|
-
var l = this.listeners[e];
|
|
1898
|
-
l.event === i && l.callback === r && this.listeners.splice(e, 1);
|
|
1899
|
-
}
|
|
1900
|
-
}, a.emit = function(i, r) {
|
|
1901
|
-
for (var e = 0; e < this.listeners.length; e++) {
|
|
1902
|
-
var l = this.listeners[e];
|
|
1903
|
-
i === l.event && l.callback(r);
|
|
1904
|
-
}
|
|
1905
|
-
}, _.exports = g;
|
|
1906
|
-
}
|
|
1907
|
-
/******/
|
|
1908
|
-
])
|
|
1909
|
-
);
|
|
1910
|
-
});
|
|
1911
|
-
}(me)), me.exports;
|
|
1912
|
-
}
|
|
1913
|
-
var dr = ve.exports, Le;
|
|
1914
|
-
function gr() {
|
|
1915
|
-
return Le || (Le = 1, function(A, U) {
|
|
1916
|
-
(function(_, k) {
|
|
1917
|
-
A.exports = k(cr());
|
|
1918
|
-
})(dr, function(_) {
|
|
1919
|
-
return (
|
|
1920
|
-
/******/
|
|
1921
|
-
(() => {
|
|
1922
|
-
var k = {
|
|
1923
|
-
/***/
|
|
1924
|
-
45: (
|
|
1925
|
-
/***/
|
|
1926
|
-
(i, r, e) => {
|
|
1927
|
-
var l = {};
|
|
1928
|
-
l.layoutBase = e(551), l.CoSEConstants = e(806), l.CoSEEdge = e(767), l.CoSEGraph = e(880), l.CoSEGraphManager = e(578), l.CoSELayout = e(765), l.CoSENode = e(991), l.ConstraintHandler = e(902), i.exports = l;
|
|
1929
|
-
}
|
|
1930
|
-
),
|
|
1931
|
-
/***/
|
|
1932
|
-
806: (
|
|
1933
|
-
/***/
|
|
1934
|
-
(i, r, e) => {
|
|
1935
|
-
var l = e(551).FDLayoutConstants;
|
|
1936
|
-
function n() {
|
|
1937
|
-
}
|
|
1938
|
-
for (var v in l)
|
|
1939
|
-
n[v] = l[v];
|
|
1940
|
-
n.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, n.DEFAULT_RADIAL_SEPARATION = l.DEFAULT_EDGE_LENGTH, n.DEFAULT_COMPONENT_SEPERATION = 60, n.TILE = !0, n.TILING_PADDING_VERTICAL = 10, n.TILING_PADDING_HORIZONTAL = 10, n.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, n.ENFORCE_CONSTRAINTS = !0, n.APPLY_LAYOUT = !0, n.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, n.TREE_REDUCTION_ON_INCREMENTAL = !0, n.PURE_INCREMENTAL = n.DEFAULT_INCREMENTAL, i.exports = n;
|
|
1941
|
-
}
|
|
1942
|
-
),
|
|
1943
|
-
/***/
|
|
1944
|
-
767: (
|
|
1945
|
-
/***/
|
|
1946
|
-
(i, r, e) => {
|
|
1947
|
-
var l = e(551).FDLayoutEdge;
|
|
1948
|
-
function n(t, s, h) {
|
|
1949
|
-
l.call(this, t, s, h);
|
|
1950
|
-
}
|
|
1951
|
-
n.prototype = Object.create(l.prototype);
|
|
1952
|
-
for (var v in l)
|
|
1953
|
-
n[v] = l[v];
|
|
1954
|
-
i.exports = n;
|
|
1955
|
-
}
|
|
1956
|
-
),
|
|
1957
|
-
/***/
|
|
1958
|
-
880: (
|
|
1959
|
-
/***/
|
|
1960
|
-
(i, r, e) => {
|
|
1961
|
-
var l = e(551).LGraph;
|
|
1962
|
-
function n(t, s, h) {
|
|
1963
|
-
l.call(this, t, s, h);
|
|
1964
|
-
}
|
|
1965
|
-
n.prototype = Object.create(l.prototype);
|
|
1966
|
-
for (var v in l)
|
|
1967
|
-
n[v] = l[v];
|
|
1968
|
-
i.exports = n;
|
|
1969
|
-
}
|
|
1970
|
-
),
|
|
1971
|
-
/***/
|
|
1972
|
-
578: (
|
|
1973
|
-
/***/
|
|
1974
|
-
(i, r, e) => {
|
|
1975
|
-
var l = e(551).LGraphManager;
|
|
1976
|
-
function n(t) {
|
|
1977
|
-
l.call(this, t);
|
|
1978
|
-
}
|
|
1979
|
-
n.prototype = Object.create(l.prototype);
|
|
1980
|
-
for (var v in l)
|
|
1981
|
-
n[v] = l[v];
|
|
1982
|
-
i.exports = n;
|
|
1983
|
-
}
|
|
1984
|
-
),
|
|
1985
|
-
/***/
|
|
1986
|
-
765: (
|
|
1987
|
-
/***/
|
|
1988
|
-
(i, r, e) => {
|
|
1989
|
-
var l = e(551).FDLayout, n = e(578), v = e(880), t = e(991), s = e(767), h = e(806), u = e(902), c = e(551).FDLayoutConstants, N = e(551).LayoutConstants, d = e(551).Point, y = e(551).PointD, I = e(551).DimensionD, w = e(551).Layout, Y = e(551).Integer, F = e(551).IGeometry, H = e(551).LGraph, z = e(551).Transform, q = e(551).LinkedList;
|
|
1990
|
-
function x() {
|
|
1991
|
-
l.call(this), this.toBeTiled = {}, this.constraints = {};
|
|
1992
|
-
}
|
|
1993
|
-
x.prototype = Object.create(l.prototype);
|
|
1994
|
-
for (var it in l)
|
|
1995
|
-
x[it] = l[it];
|
|
1996
|
-
x.prototype.newGraphManager = function() {
|
|
1997
|
-
var o = new n(this);
|
|
1998
|
-
return this.graphManager = o, o;
|
|
1999
|
-
}, x.prototype.newGraph = function(o) {
|
|
2000
|
-
return new v(null, this.graphManager, o);
|
|
2001
|
-
}, x.prototype.newNode = function(o) {
|
|
2002
|
-
return new t(this.graphManager, o);
|
|
2003
|
-
}, x.prototype.newEdge = function(o) {
|
|
2004
|
-
return new s(null, null, o);
|
|
2005
|
-
}, x.prototype.initParameters = function() {
|
|
2006
|
-
l.prototype.initParameters.call(this, arguments), this.isSubLayout || (h.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = h.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = c.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = c.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = c.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1);
|
|
2007
|
-
}, x.prototype.initSpringEmbedder = function() {
|
|
2008
|
-
l.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / c.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = 0.04, this.coolingAdjuster = 1;
|
|
2009
|
-
}, x.prototype.layout = function() {
|
|
2010
|
-
var o = N.DEFAULT_CREATE_BENDS_AS_NEEDED;
|
|
2011
|
-
return o && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
|
|
2012
|
-
}, x.prototype.classicLayout = function() {
|
|
2013
|
-
if (this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(), this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity), this.calcNoOfChildrenForAllNodes(), this.graphManager.calcLowestCommonAncestors(), this.graphManager.calcInclusionTreeDepths(), this.graphManager.getRoot().calcEstimatedSize(), this.calcIdealEdgeLengths(), this.incremental) {
|
|
2014
|
-
if (h.TREE_REDUCTION_ON_INCREMENTAL) {
|
|
2015
|
-
this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
|
|
2016
|
-
var o = new Set(this.getAllNodes()), E = this.nodesWithGravity.filter(function(p) {
|
|
2017
|
-
return o.has(p);
|
|
2018
|
-
});
|
|
2019
|
-
this.graphManager.setAllNodesToApplyGravitation(E);
|
|
2020
|
-
}
|
|
2021
|
-
} else {
|
|
2022
|
-
var f = this.getFlatForest();
|
|
2023
|
-
if (f.length > 0)
|
|
2024
|
-
this.positionNodesRadially(f);
|
|
2025
|
-
else {
|
|
2026
|
-
this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
|
|
2027
|
-
var o = new Set(this.getAllNodes()), E = this.nodesWithGravity.filter(function(O) {
|
|
2028
|
-
return o.has(O);
|
|
2029
|
-
});
|
|
2030
|
-
this.graphManager.setAllNodesToApplyGravitation(E), this.positionNodesRandomly();
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
return Object.keys(this.constraints).length > 0 && (u.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), h.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
|
|
2034
|
-
}, x.prototype.tick = function() {
|
|
2035
|
-
if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
|
|
2036
|
-
if (this.prunedNodesAll.length > 0)
|
|
2037
|
-
this.isTreeGrowing = !0;
|
|
2038
|
-
else
|
|
2039
|
-
return !0;
|
|
2040
|
-
if (this.totalIterations % c.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
|
|
2041
|
-
if (this.isConverged())
|
|
2042
|
-
if (this.prunedNodesAll.length > 0)
|
|
2043
|
-
this.isTreeGrowing = !0;
|
|
2044
|
-
else
|
|
2045
|
-
return !0;
|
|
2046
|
-
this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
|
|
2047
|
-
}
|
|
2048
|
-
if (this.isTreeGrowing) {
|
|
2049
|
-
if (this.growTreeIterations % 10 == 0)
|
|
2050
|
-
if (this.prunedNodesAll.length > 0) {
|
|
2051
|
-
this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
|
|
2052
|
-
var o = new Set(this.getAllNodes()), E = this.nodesWithGravity.filter(function(m) {
|
|
2053
|
-
return o.has(m);
|
|
2054
|
-
});
|
|
2055
|
-
this.graphManager.setAllNodesToApplyGravitation(E), this.graphManager.updateBounds(), this.updateGrid(), h.PURE_INCREMENTAL ? this.coolingFactor = c.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = c.DEFAULT_COOLING_FACTOR_INCREMENTAL;
|
|
2056
|
-
} else
|
|
2057
|
-
this.isTreeGrowing = !1, this.isGrowthFinished = !0;
|
|
2058
|
-
this.growTreeIterations++;
|
|
2059
|
-
}
|
|
2060
|
-
if (this.isGrowthFinished) {
|
|
2061
|
-
if (this.isConverged())
|
|
2062
|
-
return !0;
|
|
2063
|
-
this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), h.PURE_INCREMENTAL ? this.coolingFactor = c.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : this.coolingFactor = c.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
|
|
2064
|
-
}
|
|
2065
|
-
var f = !this.isTreeGrowing && !this.isGrowthFinished, p = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
|
|
2066
|
-
return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(f, p), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
|
|
2067
|
-
}, x.prototype.getPositionsData = function() {
|
|
2068
|
-
for (var o = this.graphManager.getAllNodes(), E = {}, f = 0; f < o.length; f++) {
|
|
2069
|
-
var p = o[f].rect, m = o[f].id;
|
|
2070
|
-
E[m] = {
|
|
2071
|
-
id: m,
|
|
2072
|
-
x: p.getCenterX(),
|
|
2073
|
-
y: p.getCenterY(),
|
|
2074
|
-
w: p.width,
|
|
2075
|
-
h: p.height
|
|
2076
|
-
};
|
|
2077
|
-
}
|
|
2078
|
-
return E;
|
|
2079
|
-
}, x.prototype.runSpringEmbedder = function() {
|
|
2080
|
-
this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
|
|
2081
|
-
var o = !1;
|
|
2082
|
-
if (c.ANIMATE === "during")
|
|
2083
|
-
this.emit("layoutstarted");
|
|
2084
|
-
else {
|
|
2085
|
-
for (; !o; )
|
|
2086
|
-
o = this.tick();
|
|
2087
|
-
this.graphManager.updateBounds();
|
|
2088
|
-
}
|
|
2089
|
-
}, x.prototype.moveNodes = function() {
|
|
2090
|
-
for (var o = this.getAllNodes(), E, f = 0; f < o.length; f++)
|
|
2091
|
-
E = o[f], E.calculateDisplacement();
|
|
2092
|
-
Object.keys(this.constraints).length > 0 && this.updateDisplacements();
|
|
2093
|
-
for (var f = 0; f < o.length; f++)
|
|
2094
|
-
E = o[f], E.move();
|
|
2095
|
-
}, x.prototype.initConstraintVariables = function() {
|
|
2096
|
-
var o = this;
|
|
2097
|
-
this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
|
|
2098
|
-
for (var E = this.graphManager.getAllNodes(), f = 0; f < E.length; f++) {
|
|
2099
|
-
var p = E[f];
|
|
2100
|
-
this.idToNodeMap.set(p.id, p);
|
|
2101
|
-
}
|
|
2102
|
-
var m = function D(b) {
|
|
2103
|
-
for (var j = b.getChild().getNodes(), et, vt = 0, $ = 0; $ < j.length; $++)
|
|
2104
|
-
et = j[$], et.getChild() == null ? o.fixedNodeSet.has(et.id) && (vt += 100) : vt += D(et);
|
|
2105
|
-
return vt;
|
|
2106
|
-
};
|
|
2107
|
-
if (this.constraints.fixedNodeConstraint) {
|
|
2108
|
-
this.constraints.fixedNodeConstraint.forEach(function(D) {
|
|
2109
|
-
o.fixedNodeSet.add(D.nodeId);
|
|
2110
|
-
});
|
|
2111
|
-
for (var E = this.graphManager.getAllNodes(), p, f = 0; f < E.length; f++)
|
|
2112
|
-
if (p = E[f], p.getChild() != null) {
|
|
2113
|
-
var O = m(p);
|
|
2114
|
-
O > 0 && (p.fixedNodeWeight = O);
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
if (this.constraints.relativePlacementConstraint) {
|
|
2118
|
-
var L = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
2119
|
-
if (this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(), this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(), this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(), this.fixedNodesOnVertical = /* @__PURE__ */ new Set(), this.fixedNodeSet.forEach(function(D) {
|
|
2120
|
-
o.fixedNodesOnHorizontal.add(D), o.fixedNodesOnVertical.add(D);
|
|
2121
|
-
}), this.constraints.alignmentConstraint) {
|
|
2122
|
-
if (this.constraints.alignmentConstraint.vertical)
|
|
2123
|
-
for (var P = this.constraints.alignmentConstraint.vertical, f = 0; f < P.length; f++)
|
|
2124
|
-
this.dummyToNodeForVerticalAlignment.set("dummy" + f, []), P[f].forEach(function(b) {
|
|
2125
|
-
L.set(b, "dummy" + f), o.dummyToNodeForVerticalAlignment.get("dummy" + f).push(b), o.fixedNodeSet.has(b) && o.fixedNodesOnHorizontal.add("dummy" + f);
|
|
2126
|
-
});
|
|
2127
|
-
if (this.constraints.alignmentConstraint.horizontal)
|
|
2128
|
-
for (var S = this.constraints.alignmentConstraint.horizontal, f = 0; f < S.length; f++)
|
|
2129
|
-
this.dummyToNodeForHorizontalAlignment.set("dummy" + f, []), S[f].forEach(function(b) {
|
|
2130
|
-
C.set(b, "dummy" + f), o.dummyToNodeForHorizontalAlignment.get("dummy" + f).push(b), o.fixedNodeSet.has(b) && o.fixedNodesOnVertical.add("dummy" + f);
|
|
2131
|
-
});
|
|
2132
|
-
}
|
|
2133
|
-
if (h.RELAX_MOVEMENT_ON_CONSTRAINTS)
|
|
2134
|
-
this.shuffle = function(D) {
|
|
2135
|
-
var b, j, et;
|
|
2136
|
-
for (et = D.length - 1; et >= 2 * D.length / 3; et--)
|
|
2137
|
-
b = Math.floor(Math.random() * (et + 1)), j = D[et], D[et] = D[b], D[b] = j;
|
|
2138
|
-
return D;
|
|
2139
|
-
}, this.nodesInRelativeHorizontal = [], this.nodesInRelativeVertical = [], this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(), this.constraints.relativePlacementConstraint.forEach(function(D) {
|
|
2140
|
-
if (D.left) {
|
|
2141
|
-
var b = L.has(D.left) ? L.get(D.left) : D.left, j = L.has(D.right) ? L.get(D.right) : D.right;
|
|
2142
|
-
o.nodesInRelativeHorizontal.includes(b) || (o.nodesInRelativeHorizontal.push(b), o.nodeToRelativeConstraintMapHorizontal.set(b, []), o.dummyToNodeForVerticalAlignment.has(b) ? o.nodeToTempPositionMapHorizontal.set(b, o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(b)[0]).getCenterX()) : o.nodeToTempPositionMapHorizontal.set(b, o.idToNodeMap.get(b).getCenterX())), o.nodesInRelativeHorizontal.includes(j) || (o.nodesInRelativeHorizontal.push(j), o.nodeToRelativeConstraintMapHorizontal.set(j, []), o.dummyToNodeForVerticalAlignment.has(j) ? o.nodeToTempPositionMapHorizontal.set(j, o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(j)[0]).getCenterX()) : o.nodeToTempPositionMapHorizontal.set(j, o.idToNodeMap.get(j).getCenterX())), o.nodeToRelativeConstraintMapHorizontal.get(b).push({ right: j, gap: D.gap }), o.nodeToRelativeConstraintMapHorizontal.get(j).push({ left: b, gap: D.gap });
|
|
2143
|
-
} else {
|
|
2144
|
-
var et = C.has(D.top) ? C.get(D.top) : D.top, vt = C.has(D.bottom) ? C.get(D.bottom) : D.bottom;
|
|
2145
|
-
o.nodesInRelativeVertical.includes(et) || (o.nodesInRelativeVertical.push(et), o.nodeToRelativeConstraintMapVertical.set(et, []), o.dummyToNodeForHorizontalAlignment.has(et) ? o.nodeToTempPositionMapVertical.set(et, o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(et)[0]).getCenterY()) : o.nodeToTempPositionMapVertical.set(et, o.idToNodeMap.get(et).getCenterY())), o.nodesInRelativeVertical.includes(vt) || (o.nodesInRelativeVertical.push(vt), o.nodeToRelativeConstraintMapVertical.set(vt, []), o.dummyToNodeForHorizontalAlignment.has(vt) ? o.nodeToTempPositionMapVertical.set(vt, o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(vt)[0]).getCenterY()) : o.nodeToTempPositionMapVertical.set(vt, o.idToNodeMap.get(vt).getCenterY())), o.nodeToRelativeConstraintMapVertical.get(et).push({ bottom: vt, gap: D.gap }), o.nodeToRelativeConstraintMapVertical.get(vt).push({ top: et, gap: D.gap });
|
|
2146
|
-
}
|
|
2147
|
-
});
|
|
2148
|
-
else {
|
|
2149
|
-
var B = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map();
|
|
2150
|
-
this.constraints.relativePlacementConstraint.forEach(function(D) {
|
|
2151
|
-
if (D.left) {
|
|
2152
|
-
var b = L.has(D.left) ? L.get(D.left) : D.left, j = L.has(D.right) ? L.get(D.right) : D.right;
|
|
2153
|
-
B.has(b) ? B.get(b).push(j) : B.set(b, [j]), B.has(j) ? B.get(j).push(b) : B.set(j, [b]);
|
|
2154
|
-
} else {
|
|
2155
|
-
var et = C.has(D.top) ? C.get(D.top) : D.top, vt = C.has(D.bottom) ? C.get(D.bottom) : D.bottom;
|
|
2156
|
-
V.has(et) ? V.get(et).push(vt) : V.set(et, [vt]), V.has(vt) ? V.get(vt).push(et) : V.set(vt, [et]);
|
|
2157
|
-
}
|
|
2158
|
-
});
|
|
2159
|
-
var X = function(D, b) {
|
|
2160
|
-
var j = [], et = [], vt = new q(), $ = /* @__PURE__ */ new Set(), Dt = 0;
|
|
2161
|
-
return D.forEach(function(K, nt) {
|
|
2162
|
-
if (!$.has(nt)) {
|
|
2163
|
-
j[Dt] = [], et[Dt] = !1;
|
|
2164
|
-
var mt = nt;
|
|
2165
|
-
for (vt.push(mt), $.add(mt), j[Dt].push(mt); vt.length != 0; ) {
|
|
2166
|
-
mt = vt.shift(), b.has(mt) && (et[Dt] = !0);
|
|
2167
|
-
var ht = D.get(mt);
|
|
2168
|
-
ht.forEach(function(_t) {
|
|
2169
|
-
$.has(_t) || (vt.push(_t), $.add(_t), j[Dt].push(_t));
|
|
2170
|
-
});
|
|
2171
|
-
}
|
|
2172
|
-
Dt++;
|
|
2173
|
-
}
|
|
2174
|
-
}), { components: j, isFixed: et };
|
|
2175
|
-
}, Q = X(B, o.fixedNodesOnHorizontal);
|
|
2176
|
-
this.componentsOnHorizontal = Q.components, this.fixedComponentsOnHorizontal = Q.isFixed;
|
|
2177
|
-
var G = X(V, o.fixedNodesOnVertical);
|
|
2178
|
-
this.componentsOnVertical = G.components, this.fixedComponentsOnVertical = G.isFixed;
|
|
2179
|
-
}
|
|
2180
|
-
}
|
|
2181
|
-
}, x.prototype.updateDisplacements = function() {
|
|
2182
|
-
var o = this;
|
|
2183
|
-
if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(G) {
|
|
2184
|
-
var D = o.idToNodeMap.get(G.nodeId);
|
|
2185
|
-
D.displacementX = 0, D.displacementY = 0;
|
|
2186
|
-
}), this.constraints.alignmentConstraint) {
|
|
2187
|
-
if (this.constraints.alignmentConstraint.vertical)
|
|
2188
|
-
for (var E = this.constraints.alignmentConstraint.vertical, f = 0; f < E.length; f++) {
|
|
2189
|
-
for (var p = 0, m = 0; m < E[f].length; m++) {
|
|
2190
|
-
if (this.fixedNodeSet.has(E[f][m])) {
|
|
2191
|
-
p = 0;
|
|
2192
|
-
break;
|
|
2193
|
-
}
|
|
2194
|
-
p += this.idToNodeMap.get(E[f][m]).displacementX;
|
|
2195
|
-
}
|
|
2196
|
-
for (var O = p / E[f].length, m = 0; m < E[f].length; m++)
|
|
2197
|
-
this.idToNodeMap.get(E[f][m]).displacementX = O;
|
|
2198
|
-
}
|
|
2199
|
-
if (this.constraints.alignmentConstraint.horizontal)
|
|
2200
|
-
for (var L = this.constraints.alignmentConstraint.horizontal, f = 0; f < L.length; f++) {
|
|
2201
|
-
for (var C = 0, m = 0; m < L[f].length; m++) {
|
|
2202
|
-
if (this.fixedNodeSet.has(L[f][m])) {
|
|
2203
|
-
C = 0;
|
|
2204
|
-
break;
|
|
2205
|
-
}
|
|
2206
|
-
C += this.idToNodeMap.get(L[f][m]).displacementY;
|
|
2207
|
-
}
|
|
2208
|
-
for (var P = C / L[f].length, m = 0; m < L[f].length; m++)
|
|
2209
|
-
this.idToNodeMap.get(L[f][m]).displacementY = P;
|
|
2210
|
-
}
|
|
2211
|
-
}
|
|
2212
|
-
if (this.constraints.relativePlacementConstraint)
|
|
2213
|
-
if (h.RELAX_MOVEMENT_ON_CONSTRAINTS)
|
|
2214
|
-
this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(G) {
|
|
2215
|
-
if (!o.fixedNodesOnHorizontal.has(G)) {
|
|
2216
|
-
var D = 0;
|
|
2217
|
-
o.dummyToNodeForVerticalAlignment.has(G) ? D = o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(G)[0]).displacementX : D = o.idToNodeMap.get(G).displacementX, o.nodeToRelativeConstraintMapHorizontal.get(G).forEach(function(b) {
|
|
2218
|
-
if (b.right) {
|
|
2219
|
-
var j = o.nodeToTempPositionMapHorizontal.get(b.right) - o.nodeToTempPositionMapHorizontal.get(G) - D;
|
|
2220
|
-
j < b.gap && (D -= b.gap - j);
|
|
2221
|
-
} else {
|
|
2222
|
-
var j = o.nodeToTempPositionMapHorizontal.get(G) - o.nodeToTempPositionMapHorizontal.get(b.left) + D;
|
|
2223
|
-
j < b.gap && (D += b.gap - j);
|
|
2224
|
-
}
|
|
2225
|
-
}), o.nodeToTempPositionMapHorizontal.set(G, o.nodeToTempPositionMapHorizontal.get(G) + D), o.dummyToNodeForVerticalAlignment.has(G) ? o.dummyToNodeForVerticalAlignment.get(G).forEach(function(b) {
|
|
2226
|
-
o.idToNodeMap.get(b).displacementX = D;
|
|
2227
|
-
}) : o.idToNodeMap.get(G).displacementX = D;
|
|
2228
|
-
}
|
|
2229
|
-
}), this.nodesInRelativeVertical.forEach(function(G) {
|
|
2230
|
-
if (!o.fixedNodesOnHorizontal.has(G)) {
|
|
2231
|
-
var D = 0;
|
|
2232
|
-
o.dummyToNodeForHorizontalAlignment.has(G) ? D = o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(G)[0]).displacementY : D = o.idToNodeMap.get(G).displacementY, o.nodeToRelativeConstraintMapVertical.get(G).forEach(function(b) {
|
|
2233
|
-
if (b.bottom) {
|
|
2234
|
-
var j = o.nodeToTempPositionMapVertical.get(b.bottom) - o.nodeToTempPositionMapVertical.get(G) - D;
|
|
2235
|
-
j < b.gap && (D -= b.gap - j);
|
|
2236
|
-
} else {
|
|
2237
|
-
var j = o.nodeToTempPositionMapVertical.get(G) - o.nodeToTempPositionMapVertical.get(b.top) + D;
|
|
2238
|
-
j < b.gap && (D += b.gap - j);
|
|
2239
|
-
}
|
|
2240
|
-
}), o.nodeToTempPositionMapVertical.set(G, o.nodeToTempPositionMapVertical.get(G) + D), o.dummyToNodeForHorizontalAlignment.has(G) ? o.dummyToNodeForHorizontalAlignment.get(G).forEach(function(b) {
|
|
2241
|
-
o.idToNodeMap.get(b).displacementY = D;
|
|
2242
|
-
}) : o.idToNodeMap.get(G).displacementY = D;
|
|
2243
|
-
}
|
|
2244
|
-
});
|
|
2245
|
-
else {
|
|
2246
|
-
for (var f = 0; f < this.componentsOnHorizontal.length; f++) {
|
|
2247
|
-
var S = this.componentsOnHorizontal[f];
|
|
2248
|
-
if (this.fixedComponentsOnHorizontal[f])
|
|
2249
|
-
for (var m = 0; m < S.length; m++)
|
|
2250
|
-
this.dummyToNodeForVerticalAlignment.has(S[m]) ? this.dummyToNodeForVerticalAlignment.get(S[m]).forEach(function(b) {
|
|
2251
|
-
o.idToNodeMap.get(b).displacementX = 0;
|
|
2252
|
-
}) : this.idToNodeMap.get(S[m]).displacementX = 0;
|
|
2253
|
-
else {
|
|
2254
|
-
for (var B = 0, V = 0, m = 0; m < S.length; m++)
|
|
2255
|
-
if (this.dummyToNodeForVerticalAlignment.has(S[m])) {
|
|
2256
|
-
var X = this.dummyToNodeForVerticalAlignment.get(S[m]);
|
|
2257
|
-
B += X.length * this.idToNodeMap.get(X[0]).displacementX, V += X.length;
|
|
2258
|
-
} else
|
|
2259
|
-
B += this.idToNodeMap.get(S[m]).displacementX, V++;
|
|
2260
|
-
for (var Q = B / V, m = 0; m < S.length; m++)
|
|
2261
|
-
this.dummyToNodeForVerticalAlignment.has(S[m]) ? this.dummyToNodeForVerticalAlignment.get(S[m]).forEach(function(b) {
|
|
2262
|
-
o.idToNodeMap.get(b).displacementX = Q;
|
|
2263
|
-
}) : this.idToNodeMap.get(S[m]).displacementX = Q;
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
for (var f = 0; f < this.componentsOnVertical.length; f++) {
|
|
2267
|
-
var S = this.componentsOnVertical[f];
|
|
2268
|
-
if (this.fixedComponentsOnVertical[f])
|
|
2269
|
-
for (var m = 0; m < S.length; m++)
|
|
2270
|
-
this.dummyToNodeForHorizontalAlignment.has(S[m]) ? this.dummyToNodeForHorizontalAlignment.get(S[m]).forEach(function(j) {
|
|
2271
|
-
o.idToNodeMap.get(j).displacementY = 0;
|
|
2272
|
-
}) : this.idToNodeMap.get(S[m]).displacementY = 0;
|
|
2273
|
-
else {
|
|
2274
|
-
for (var B = 0, V = 0, m = 0; m < S.length; m++)
|
|
2275
|
-
if (this.dummyToNodeForHorizontalAlignment.has(S[m])) {
|
|
2276
|
-
var X = this.dummyToNodeForHorizontalAlignment.get(S[m]);
|
|
2277
|
-
B += X.length * this.idToNodeMap.get(X[0]).displacementY, V += X.length;
|
|
2278
|
-
} else
|
|
2279
|
-
B += this.idToNodeMap.get(S[m]).displacementY, V++;
|
|
2280
|
-
for (var Q = B / V, m = 0; m < S.length; m++)
|
|
2281
|
-
this.dummyToNodeForHorizontalAlignment.has(S[m]) ? this.dummyToNodeForHorizontalAlignment.get(S[m]).forEach(function(et) {
|
|
2282
|
-
o.idToNodeMap.get(et).displacementY = Q;
|
|
2283
|
-
}) : this.idToNodeMap.get(S[m]).displacementY = Q;
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2286
|
-
}
|
|
2287
|
-
}, x.prototype.calculateNodesToApplyGravitationTo = function() {
|
|
2288
|
-
var o = [], E, f = this.graphManager.getGraphs(), p = f.length, m;
|
|
2289
|
-
for (m = 0; m < p; m++)
|
|
2290
|
-
E = f[m], E.updateConnected(), E.isConnected || (o = o.concat(E.getNodes()));
|
|
2291
|
-
return o;
|
|
2292
|
-
}, x.prototype.createBendpoints = function() {
|
|
2293
|
-
var o = [];
|
|
2294
|
-
o = o.concat(this.graphManager.getAllEdges());
|
|
2295
|
-
var E = /* @__PURE__ */ new Set(), f;
|
|
2296
|
-
for (f = 0; f < o.length; f++) {
|
|
2297
|
-
var p = o[f];
|
|
2298
|
-
if (!E.has(p)) {
|
|
2299
|
-
var m = p.getSource(), O = p.getTarget();
|
|
2300
|
-
if (m == O)
|
|
2301
|
-
p.getBendpoints().push(new y()), p.getBendpoints().push(new y()), this.createDummyNodesForBendpoints(p), E.add(p);
|
|
2302
|
-
else {
|
|
2303
|
-
var L = [];
|
|
2304
|
-
if (L = L.concat(m.getEdgeListToNode(O)), L = L.concat(O.getEdgeListToNode(m)), !E.has(L[0])) {
|
|
2305
|
-
if (L.length > 1) {
|
|
2306
|
-
var C;
|
|
2307
|
-
for (C = 0; C < L.length; C++) {
|
|
2308
|
-
var P = L[C];
|
|
2309
|
-
P.getBendpoints().push(new y()), this.createDummyNodesForBendpoints(P);
|
|
2310
|
-
}
|
|
2311
|
-
}
|
|
2312
|
-
L.forEach(function(S) {
|
|
2313
|
-
E.add(S);
|
|
2314
|
-
});
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
if (E.size == o.length)
|
|
2319
|
-
break;
|
|
2320
|
-
}
|
|
2321
|
-
}, x.prototype.positionNodesRadially = function(o) {
|
|
2322
|
-
for (var E = new d(0, 0), f = Math.ceil(Math.sqrt(o.length)), p = 0, m = 0, O = 0, L = new y(0, 0), C = 0; C < o.length; C++) {
|
|
2323
|
-
C % f == 0 && (O = 0, m = p, C != 0 && (m += h.DEFAULT_COMPONENT_SEPERATION), p = 0);
|
|
2324
|
-
var P = o[C], S = w.findCenterOfTree(P);
|
|
2325
|
-
E.x = O, E.y = m, L = x.radialLayout(P, S, E), L.y > p && (p = Math.floor(L.y)), O = Math.floor(L.x + h.DEFAULT_COMPONENT_SEPERATION);
|
|
2326
|
-
}
|
|
2327
|
-
this.transform(new y(N.WORLD_CENTER_X - L.x / 2, N.WORLD_CENTER_Y - L.y / 2));
|
|
2328
|
-
}, x.radialLayout = function(o, E, f) {
|
|
2329
|
-
var p = Math.max(this.maxDiagonalInTree(o), h.DEFAULT_RADIAL_SEPARATION);
|
|
2330
|
-
x.branchRadialLayout(E, null, 0, 359, 0, p);
|
|
2331
|
-
var m = H.calculateBounds(o), O = new z();
|
|
2332
|
-
O.setDeviceOrgX(m.getMinX()), O.setDeviceOrgY(m.getMinY()), O.setWorldOrgX(f.x), O.setWorldOrgY(f.y);
|
|
2333
|
-
for (var L = 0; L < o.length; L++) {
|
|
2334
|
-
var C = o[L];
|
|
2335
|
-
C.transform(O);
|
|
2336
|
-
}
|
|
2337
|
-
var P = new y(m.getMaxX(), m.getMaxY());
|
|
2338
|
-
return O.inverseTransformPoint(P);
|
|
2339
|
-
}, x.branchRadialLayout = function(o, E, f, p, m, O) {
|
|
2340
|
-
var L = (p - f + 1) / 2;
|
|
2341
|
-
L < 0 && (L += 180);
|
|
2342
|
-
var C = (L + f) % 360, P = C * F.TWO_PI / 360, S = m * Math.cos(P), B = m * Math.sin(P);
|
|
2343
|
-
o.setCenter(S, B);
|
|
2344
|
-
var V = [];
|
|
2345
|
-
V = V.concat(o.getEdges());
|
|
2346
|
-
var X = V.length;
|
|
2347
|
-
E != null && X--;
|
|
2348
|
-
for (var Q = 0, G = V.length, D, b = o.getEdgesBetween(E); b.length > 1; ) {
|
|
2349
|
-
var j = b[0];
|
|
2350
|
-
b.splice(0, 1);
|
|
2351
|
-
var et = V.indexOf(j);
|
|
2352
|
-
et >= 0 && V.splice(et, 1), G--, X--;
|
|
2353
|
-
}
|
|
2354
|
-
E != null ? D = (V.indexOf(b[0]) + 1) % G : D = 0;
|
|
2355
|
-
for (var vt = Math.abs(p - f) / X, $ = D; Q != X; $ = ++$ % G) {
|
|
2356
|
-
var Dt = V[$].getOtherEnd(o);
|
|
2357
|
-
if (Dt != E) {
|
|
2358
|
-
var K = (f + Q * vt) % 360, nt = (K + vt) % 360;
|
|
2359
|
-
x.branchRadialLayout(Dt, o, K, nt, m + O, O), Q++;
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
}, x.maxDiagonalInTree = function(o) {
|
|
2363
|
-
for (var E = Y.MIN_VALUE, f = 0; f < o.length; f++) {
|
|
2364
|
-
var p = o[f], m = p.getDiagonal();
|
|
2365
|
-
m > E && (E = m);
|
|
2366
|
-
}
|
|
2367
|
-
return E;
|
|
2368
|
-
}, x.prototype.calcRepulsionRange = function() {
|
|
2369
|
-
return 2 * (this.level + 1) * this.idealEdgeLength;
|
|
2370
|
-
}, x.prototype.groupZeroDegreeMembers = function() {
|
|
2371
|
-
var o = this, E = {};
|
|
2372
|
-
this.memberGroups = {}, this.idToDummyNode = {};
|
|
2373
|
-
for (var f = [], p = this.graphManager.getAllNodes(), m = 0; m < p.length; m++) {
|
|
2374
|
-
var O = p[m], L = O.getParent();
|
|
2375
|
-
this.getNodeDegreeWithChildren(O) === 0 && (L.id == null || !this.getToBeTiled(L)) && f.push(O);
|
|
2376
|
-
}
|
|
2377
|
-
for (var m = 0; m < f.length; m++) {
|
|
2378
|
-
var O = f[m], C = O.getParent().id;
|
|
2379
|
-
typeof E[C] > "u" && (E[C] = []), E[C] = E[C].concat(O);
|
|
2380
|
-
}
|
|
2381
|
-
Object.keys(E).forEach(function(P) {
|
|
2382
|
-
if (E[P].length > 1) {
|
|
2383
|
-
var S = "DummyCompound_" + P;
|
|
2384
|
-
o.memberGroups[S] = E[P];
|
|
2385
|
-
var B = E[P][0].getParent(), V = new t(o.graphManager);
|
|
2386
|
-
V.id = S, V.paddingLeft = B.paddingLeft || 0, V.paddingRight = B.paddingRight || 0, V.paddingBottom = B.paddingBottom || 0, V.paddingTop = B.paddingTop || 0, o.idToDummyNode[S] = V;
|
|
2387
|
-
var X = o.getGraphManager().add(o.newGraph(), V), Q = B.getChild();
|
|
2388
|
-
Q.add(V);
|
|
2389
|
-
for (var G = 0; G < E[P].length; G++) {
|
|
2390
|
-
var D = E[P][G];
|
|
2391
|
-
Q.remove(D), X.add(D);
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
});
|
|
2395
|
-
}, x.prototype.clearCompounds = function() {
|
|
2396
|
-
var o = {}, E = {};
|
|
2397
|
-
this.performDFSOnCompounds();
|
|
2398
|
-
for (var f = 0; f < this.compoundOrder.length; f++)
|
|
2399
|
-
E[this.compoundOrder[f].id] = this.compoundOrder[f], o[this.compoundOrder[f].id] = [].concat(this.compoundOrder[f].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[f].getChild()), this.compoundOrder[f].child = null;
|
|
2400
|
-
this.graphManager.resetAllNodes(), this.tileCompoundMembers(o, E);
|
|
2401
|
-
}, x.prototype.clearZeroDegreeMembers = function() {
|
|
2402
|
-
var o = this, E = this.tiledZeroDegreePack = [];
|
|
2403
|
-
Object.keys(this.memberGroups).forEach(function(f) {
|
|
2404
|
-
var p = o.idToDummyNode[f];
|
|
2405
|
-
if (E[f] = o.tileNodes(o.memberGroups[f], p.paddingLeft + p.paddingRight), p.rect.width = E[f].width, p.rect.height = E[f].height, p.setCenter(E[f].centerX, E[f].centerY), p.labelMarginLeft = 0, p.labelMarginTop = 0, h.NODE_DIMENSIONS_INCLUDE_LABELS) {
|
|
2406
|
-
var m = p.rect.width, O = p.rect.height;
|
|
2407
|
-
p.labelWidth && (p.labelPosHorizontal == "left" ? (p.rect.x -= p.labelWidth, p.setWidth(m + p.labelWidth), p.labelMarginLeft = p.labelWidth) : p.labelPosHorizontal == "center" && p.labelWidth > m ? (p.rect.x -= (p.labelWidth - m) / 2, p.setWidth(p.labelWidth), p.labelMarginLeft = (p.labelWidth - m) / 2) : p.labelPosHorizontal == "right" && p.setWidth(m + p.labelWidth)), p.labelHeight && (p.labelPosVertical == "top" ? (p.rect.y -= p.labelHeight, p.setHeight(O + p.labelHeight), p.labelMarginTop = p.labelHeight) : p.labelPosVertical == "center" && p.labelHeight > O ? (p.rect.y -= (p.labelHeight - O) / 2, p.setHeight(p.labelHeight), p.labelMarginTop = (p.labelHeight - O) / 2) : p.labelPosVertical == "bottom" && p.setHeight(O + p.labelHeight));
|
|
2408
|
-
}
|
|
2409
|
-
});
|
|
2410
|
-
}, x.prototype.repopulateCompounds = function() {
|
|
2411
|
-
for (var o = this.compoundOrder.length - 1; o >= 0; o--) {
|
|
2412
|
-
var E = this.compoundOrder[o], f = E.id, p = E.paddingLeft, m = E.paddingTop, O = E.labelMarginLeft, L = E.labelMarginTop;
|
|
2413
|
-
this.adjustLocations(this.tiledMemberPack[f], E.rect.x, E.rect.y, p, m, O, L);
|
|
2414
|
-
}
|
|
2415
|
-
}, x.prototype.repopulateZeroDegreeMembers = function() {
|
|
2416
|
-
var o = this, E = this.tiledZeroDegreePack;
|
|
2417
|
-
Object.keys(E).forEach(function(f) {
|
|
2418
|
-
var p = o.idToDummyNode[f], m = p.paddingLeft, O = p.paddingTop, L = p.labelMarginLeft, C = p.labelMarginTop;
|
|
2419
|
-
o.adjustLocations(E[f], p.rect.x, p.rect.y, m, O, L, C);
|
|
2420
|
-
});
|
|
2421
|
-
}, x.prototype.getToBeTiled = function(o) {
|
|
2422
|
-
var E = o.id;
|
|
2423
|
-
if (this.toBeTiled[E] != null)
|
|
2424
|
-
return this.toBeTiled[E];
|
|
2425
|
-
var f = o.getChild();
|
|
2426
|
-
if (f == null)
|
|
2427
|
-
return this.toBeTiled[E] = !1, !1;
|
|
2428
|
-
for (var p = f.getNodes(), m = 0; m < p.length; m++) {
|
|
2429
|
-
var O = p[m];
|
|
2430
|
-
if (this.getNodeDegree(O) > 0)
|
|
2431
|
-
return this.toBeTiled[E] = !1, !1;
|
|
2432
|
-
if (O.getChild() == null) {
|
|
2433
|
-
this.toBeTiled[O.id] = !1;
|
|
2434
|
-
continue;
|
|
2435
|
-
}
|
|
2436
|
-
if (!this.getToBeTiled(O))
|
|
2437
|
-
return this.toBeTiled[E] = !1, !1;
|
|
2438
|
-
}
|
|
2439
|
-
return this.toBeTiled[E] = !0, !0;
|
|
2440
|
-
}, x.prototype.getNodeDegree = function(o) {
|
|
2441
|
-
o.id;
|
|
2442
|
-
for (var E = o.getEdges(), f = 0, p = 0; p < E.length; p++) {
|
|
2443
|
-
var m = E[p];
|
|
2444
|
-
m.getSource().id !== m.getTarget().id && (f = f + 1);
|
|
2445
|
-
}
|
|
2446
|
-
return f;
|
|
2447
|
-
}, x.prototype.getNodeDegreeWithChildren = function(o) {
|
|
2448
|
-
var E = this.getNodeDegree(o);
|
|
2449
|
-
if (o.getChild() == null)
|
|
2450
|
-
return E;
|
|
2451
|
-
for (var f = o.getChild().getNodes(), p = 0; p < f.length; p++) {
|
|
2452
|
-
var m = f[p];
|
|
2453
|
-
E += this.getNodeDegreeWithChildren(m);
|
|
2454
|
-
}
|
|
2455
|
-
return E;
|
|
2456
|
-
}, x.prototype.performDFSOnCompounds = function() {
|
|
2457
|
-
this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
|
|
2458
|
-
}, x.prototype.fillCompexOrderByDFS = function(o) {
|
|
2459
|
-
for (var E = 0; E < o.length; E++) {
|
|
2460
|
-
var f = o[E];
|
|
2461
|
-
f.getChild() != null && this.fillCompexOrderByDFS(f.getChild().getNodes()), this.getToBeTiled(f) && this.compoundOrder.push(f);
|
|
2462
|
-
}
|
|
2463
|
-
}, x.prototype.adjustLocations = function(o, E, f, p, m, O, L) {
|
|
2464
|
-
E += p + O, f += m + L;
|
|
2465
|
-
for (var C = E, P = 0; P < o.rows.length; P++) {
|
|
2466
|
-
var S = o.rows[P];
|
|
2467
|
-
E = C;
|
|
2468
|
-
for (var B = 0, V = 0; V < S.length; V++) {
|
|
2469
|
-
var X = S[V];
|
|
2470
|
-
X.rect.x = E, X.rect.y = f, E += X.rect.width + o.horizontalPadding, X.rect.height > B && (B = X.rect.height);
|
|
2471
|
-
}
|
|
2472
|
-
f += B + o.verticalPadding;
|
|
2473
|
-
}
|
|
2474
|
-
}, x.prototype.tileCompoundMembers = function(o, E) {
|
|
2475
|
-
var f = this;
|
|
2476
|
-
this.tiledMemberPack = [], Object.keys(o).forEach(function(p) {
|
|
2477
|
-
var m = E[p];
|
|
2478
|
-
if (f.tiledMemberPack[p] = f.tileNodes(o[p], m.paddingLeft + m.paddingRight), m.rect.width = f.tiledMemberPack[p].width, m.rect.height = f.tiledMemberPack[p].height, m.setCenter(f.tiledMemberPack[p].centerX, f.tiledMemberPack[p].centerY), m.labelMarginLeft = 0, m.labelMarginTop = 0, h.NODE_DIMENSIONS_INCLUDE_LABELS) {
|
|
2479
|
-
var O = m.rect.width, L = m.rect.height;
|
|
2480
|
-
m.labelWidth && (m.labelPosHorizontal == "left" ? (m.rect.x -= m.labelWidth, m.setWidth(O + m.labelWidth), m.labelMarginLeft = m.labelWidth) : m.labelPosHorizontal == "center" && m.labelWidth > O ? (m.rect.x -= (m.labelWidth - O) / 2, m.setWidth(m.labelWidth), m.labelMarginLeft = (m.labelWidth - O) / 2) : m.labelPosHorizontal == "right" && m.setWidth(O + m.labelWidth)), m.labelHeight && (m.labelPosVertical == "top" ? (m.rect.y -= m.labelHeight, m.setHeight(L + m.labelHeight), m.labelMarginTop = m.labelHeight) : m.labelPosVertical == "center" && m.labelHeight > L ? (m.rect.y -= (m.labelHeight - L) / 2, m.setHeight(m.labelHeight), m.labelMarginTop = (m.labelHeight - L) / 2) : m.labelPosVertical == "bottom" && m.setHeight(L + m.labelHeight));
|
|
2481
|
-
}
|
|
2482
|
-
});
|
|
2483
|
-
}, x.prototype.tileNodes = function(o, E) {
|
|
2484
|
-
var f = this.tileNodesByFavoringDim(o, E, !0), p = this.tileNodesByFavoringDim(o, E, !1), m = this.getOrgRatio(f), O = this.getOrgRatio(p), L;
|
|
2485
|
-
return O < m ? L = p : L = f, L;
|
|
2486
|
-
}, x.prototype.getOrgRatio = function(o) {
|
|
2487
|
-
var E = o.width, f = o.height, p = E / f;
|
|
2488
|
-
return p < 1 && (p = 1 / p), p;
|
|
2489
|
-
}, x.prototype.calcIdealRowWidth = function(o, E) {
|
|
2490
|
-
var f = h.TILING_PADDING_VERTICAL, p = h.TILING_PADDING_HORIZONTAL, m = o.length, O = 0, L = 0, C = 0;
|
|
2491
|
-
o.forEach(function(G) {
|
|
2492
|
-
O += G.getWidth(), L += G.getHeight(), G.getWidth() > C && (C = G.getWidth());
|
|
2493
|
-
});
|
|
2494
|
-
var P = O / m, S = L / m, B = Math.pow(f - p, 2) + 4 * (P + p) * (S + f) * m, V = (p - f + Math.sqrt(B)) / (2 * (P + p)), X;
|
|
2495
|
-
E ? (X = Math.ceil(V), X == V && X++) : X = Math.floor(V);
|
|
2496
|
-
var Q = X * (P + p) - p;
|
|
2497
|
-
return C > Q && (Q = C), Q += p * 2, Q;
|
|
2498
|
-
}, x.prototype.tileNodesByFavoringDim = function(o, E, f) {
|
|
2499
|
-
var p = h.TILING_PADDING_VERTICAL, m = h.TILING_PADDING_HORIZONTAL, O = h.TILING_COMPARE_BY, L = {
|
|
2500
|
-
rows: [],
|
|
2501
|
-
rowWidth: [],
|
|
2502
|
-
rowHeight: [],
|
|
2503
|
-
width: 0,
|
|
2504
|
-
height: E,
|
|
2505
|
-
// assume minHeight equals to minWidth
|
|
2506
|
-
verticalPadding: p,
|
|
2507
|
-
horizontalPadding: m,
|
|
2508
|
-
centerX: 0,
|
|
2509
|
-
centerY: 0
|
|
2510
|
-
};
|
|
2511
|
-
O && (L.idealRowWidth = this.calcIdealRowWidth(o, f));
|
|
2512
|
-
var C = function(G) {
|
|
2513
|
-
return G.rect.width * G.rect.height;
|
|
2514
|
-
}, P = function(G, D) {
|
|
2515
|
-
return C(D) - C(G);
|
|
2516
|
-
};
|
|
2517
|
-
o.sort(function(G, D) {
|
|
2518
|
-
var b = P;
|
|
2519
|
-
return L.idealRowWidth ? (b = O, b(G.id, D.id)) : b(G, D);
|
|
2520
|
-
});
|
|
2521
|
-
for (var S = 0, B = 0, V = 0; V < o.length; V++) {
|
|
2522
|
-
var X = o[V];
|
|
2523
|
-
S += X.getCenterX(), B += X.getCenterY();
|
|
2524
|
-
}
|
|
2525
|
-
L.centerX = S / o.length, L.centerY = B / o.length;
|
|
2526
|
-
for (var V = 0; V < o.length; V++) {
|
|
2527
|
-
var X = o[V];
|
|
2528
|
-
if (L.rows.length == 0)
|
|
2529
|
-
this.insertNodeToRow(L, X, 0, E);
|
|
2530
|
-
else if (this.canAddHorizontal(L, X.rect.width, X.rect.height)) {
|
|
2531
|
-
var Q = L.rows.length - 1;
|
|
2532
|
-
L.idealRowWidth || (Q = this.getShortestRowIndex(L)), this.insertNodeToRow(L, X, Q, E);
|
|
2533
|
-
} else
|
|
2534
|
-
this.insertNodeToRow(L, X, L.rows.length, E);
|
|
2535
|
-
this.shiftToLastRow(L);
|
|
2536
|
-
}
|
|
2537
|
-
return L;
|
|
2538
|
-
}, x.prototype.insertNodeToRow = function(o, E, f, p) {
|
|
2539
|
-
var m = p;
|
|
2540
|
-
if (f == o.rows.length) {
|
|
2541
|
-
var O = [];
|
|
2542
|
-
o.rows.push(O), o.rowWidth.push(m), o.rowHeight.push(0);
|
|
2543
|
-
}
|
|
2544
|
-
var L = o.rowWidth[f] + E.rect.width;
|
|
2545
|
-
o.rows[f].length > 0 && (L += o.horizontalPadding), o.rowWidth[f] = L, o.width < L && (o.width = L);
|
|
2546
|
-
var C = E.rect.height;
|
|
2547
|
-
f > 0 && (C += o.verticalPadding);
|
|
2548
|
-
var P = 0;
|
|
2549
|
-
C > o.rowHeight[f] && (P = o.rowHeight[f], o.rowHeight[f] = C, P = o.rowHeight[f] - P), o.height += P, o.rows[f].push(E);
|
|
2550
|
-
}, x.prototype.getShortestRowIndex = function(o) {
|
|
2551
|
-
for (var E = -1, f = Number.MAX_VALUE, p = 0; p < o.rows.length; p++)
|
|
2552
|
-
o.rowWidth[p] < f && (E = p, f = o.rowWidth[p]);
|
|
2553
|
-
return E;
|
|
2554
|
-
}, x.prototype.getLongestRowIndex = function(o) {
|
|
2555
|
-
for (var E = -1, f = Number.MIN_VALUE, p = 0; p < o.rows.length; p++)
|
|
2556
|
-
o.rowWidth[p] > f && (E = p, f = o.rowWidth[p]);
|
|
2557
|
-
return E;
|
|
2558
|
-
}, x.prototype.canAddHorizontal = function(o, E, f) {
|
|
2559
|
-
if (o.idealRowWidth) {
|
|
2560
|
-
var p = o.rows.length - 1, m = o.rowWidth[p];
|
|
2561
|
-
return m + E + o.horizontalPadding <= o.idealRowWidth;
|
|
2562
|
-
}
|
|
2563
|
-
var O = this.getShortestRowIndex(o);
|
|
2564
|
-
if (O < 0)
|
|
2565
|
-
return !0;
|
|
2566
|
-
var L = o.rowWidth[O];
|
|
2567
|
-
if (L + o.horizontalPadding + E <= o.width) return !0;
|
|
2568
|
-
var C = 0;
|
|
2569
|
-
o.rowHeight[O] < f && O > 0 && (C = f + o.verticalPadding - o.rowHeight[O]);
|
|
2570
|
-
var P;
|
|
2571
|
-
o.width - L >= E + o.horizontalPadding ? P = (o.height + C) / (L + E + o.horizontalPadding) : P = (o.height + C) / o.width, C = f + o.verticalPadding;
|
|
2572
|
-
var S;
|
|
2573
|
-
return o.width < E ? S = (o.height + C) / E : S = (o.height + C) / o.width, S < 1 && (S = 1 / S), P < 1 && (P = 1 / P), P < S;
|
|
2574
|
-
}, x.prototype.shiftToLastRow = function(o) {
|
|
2575
|
-
var E = this.getLongestRowIndex(o), f = o.rowWidth.length - 1, p = o.rows[E], m = p[p.length - 1], O = m.width + o.horizontalPadding;
|
|
2576
|
-
if (o.width - o.rowWidth[f] > O && E != f) {
|
|
2577
|
-
p.splice(-1, 1), o.rows[f].push(m), o.rowWidth[E] = o.rowWidth[E] - O, o.rowWidth[f] = o.rowWidth[f] + O, o.width = o.rowWidth[instance.getLongestRowIndex(o)];
|
|
2578
|
-
for (var L = Number.MIN_VALUE, C = 0; C < p.length; C++)
|
|
2579
|
-
p[C].height > L && (L = p[C].height);
|
|
2580
|
-
E > 0 && (L += o.verticalPadding);
|
|
2581
|
-
var P = o.rowHeight[E] + o.rowHeight[f];
|
|
2582
|
-
o.rowHeight[E] = L, o.rowHeight[f] < m.height + o.verticalPadding && (o.rowHeight[f] = m.height + o.verticalPadding);
|
|
2583
|
-
var S = o.rowHeight[E] + o.rowHeight[f];
|
|
2584
|
-
o.height += S - P, this.shiftToLastRow(o);
|
|
2585
|
-
}
|
|
2586
|
-
}, x.prototype.tilingPreLayout = function() {
|
|
2587
|
-
h.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
|
|
2588
|
-
}, x.prototype.tilingPostLayout = function() {
|
|
2589
|
-
h.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
|
|
2590
|
-
}, x.prototype.reduceTrees = function() {
|
|
2591
|
-
for (var o = [], E = !0, f; E; ) {
|
|
2592
|
-
var p = this.graphManager.getAllNodes(), m = [];
|
|
2593
|
-
E = !1;
|
|
2594
|
-
for (var O = 0; O < p.length; O++)
|
|
2595
|
-
if (f = p[O], f.getEdges().length == 1 && !f.getEdges()[0].isInterGraph && f.getChild() == null) {
|
|
2596
|
-
if (h.PURE_INCREMENTAL) {
|
|
2597
|
-
var L = f.getEdges()[0].getOtherEnd(f), C = new I(f.getCenterX() - L.getCenterX(), f.getCenterY() - L.getCenterY());
|
|
2598
|
-
m.push([f, f.getEdges()[0], f.getOwner(), C]);
|
|
2599
|
-
} else
|
|
2600
|
-
m.push([f, f.getEdges()[0], f.getOwner()]);
|
|
2601
|
-
E = !0;
|
|
2602
|
-
}
|
|
2603
|
-
if (E == !0) {
|
|
2604
|
-
for (var P = [], S = 0; S < m.length; S++)
|
|
2605
|
-
m[S][0].getEdges().length == 1 && (P.push(m[S]), m[S][0].getOwner().remove(m[S][0]));
|
|
2606
|
-
o.push(P), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
|
|
2607
|
-
}
|
|
2608
|
-
}
|
|
2609
|
-
this.prunedNodesAll = o;
|
|
2610
|
-
}, x.prototype.growTree = function(o) {
|
|
2611
|
-
for (var E = o.length, f = o[E - 1], p, m = 0; m < f.length; m++)
|
|
2612
|
-
p = f[m], this.findPlaceforPrunedNode(p), p[2].add(p[0]), p[2].add(p[1], p[1].source, p[1].target);
|
|
2613
|
-
o.splice(o.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
|
|
2614
|
-
}, x.prototype.findPlaceforPrunedNode = function(o) {
|
|
2615
|
-
var E, f, p = o[0];
|
|
2616
|
-
if (p == o[1].source ? f = o[1].target : f = o[1].source, h.PURE_INCREMENTAL)
|
|
2617
|
-
p.setCenter(f.getCenterX() + o[3].getWidth(), f.getCenterY() + o[3].getHeight());
|
|
2618
|
-
else {
|
|
2619
|
-
var m = f.startX, O = f.finishX, L = f.startY, C = f.finishY, P = 0, S = 0, B = 0, V = 0, X = [P, B, S, V];
|
|
2620
|
-
if (L > 0)
|
|
2621
|
-
for (var Q = m; Q <= O; Q++)
|
|
2622
|
-
X[0] += this.grid[Q][L - 1].length + this.grid[Q][L].length - 1;
|
|
2623
|
-
if (O < this.grid.length - 1)
|
|
2624
|
-
for (var Q = L; Q <= C; Q++)
|
|
2625
|
-
X[1] += this.grid[O + 1][Q].length + this.grid[O][Q].length - 1;
|
|
2626
|
-
if (C < this.grid[0].length - 1)
|
|
2627
|
-
for (var Q = m; Q <= O; Q++)
|
|
2628
|
-
X[2] += this.grid[Q][C + 1].length + this.grid[Q][C].length - 1;
|
|
2629
|
-
if (m > 0)
|
|
2630
|
-
for (var Q = L; Q <= C; Q++)
|
|
2631
|
-
X[3] += this.grid[m - 1][Q].length + this.grid[m][Q].length - 1;
|
|
2632
|
-
for (var G = Y.MAX_VALUE, D, b, j = 0; j < X.length; j++)
|
|
2633
|
-
X[j] < G ? (G = X[j], D = 1, b = j) : X[j] == G && D++;
|
|
2634
|
-
if (D == 3 && G == 0)
|
|
2635
|
-
X[0] == 0 && X[1] == 0 && X[2] == 0 ? E = 1 : X[0] == 0 && X[1] == 0 && X[3] == 0 ? E = 0 : X[0] == 0 && X[2] == 0 && X[3] == 0 ? E = 3 : X[1] == 0 && X[2] == 0 && X[3] == 0 && (E = 2);
|
|
2636
|
-
else if (D == 2 && G == 0) {
|
|
2637
|
-
var et = Math.floor(Math.random() * 2);
|
|
2638
|
-
X[0] == 0 && X[1] == 0 ? et == 0 ? E = 0 : E = 1 : X[0] == 0 && X[2] == 0 ? et == 0 ? E = 0 : E = 2 : X[0] == 0 && X[3] == 0 ? et == 0 ? E = 0 : E = 3 : X[1] == 0 && X[2] == 0 ? et == 0 ? E = 1 : E = 2 : X[1] == 0 && X[3] == 0 ? et == 0 ? E = 1 : E = 3 : et == 0 ? E = 2 : E = 3;
|
|
2639
|
-
} else if (D == 4 && G == 0) {
|
|
2640
|
-
var et = Math.floor(Math.random() * 4);
|
|
2641
|
-
E = et;
|
|
2642
|
-
} else
|
|
2643
|
-
E = b;
|
|
2644
|
-
E == 0 ? p.setCenter(f.getCenterX(), f.getCenterY() - f.getHeight() / 2 - c.DEFAULT_EDGE_LENGTH - p.getHeight() / 2) : E == 1 ? p.setCenter(f.getCenterX() + f.getWidth() / 2 + c.DEFAULT_EDGE_LENGTH + p.getWidth() / 2, f.getCenterY()) : E == 2 ? p.setCenter(f.getCenterX(), f.getCenterY() + f.getHeight() / 2 + c.DEFAULT_EDGE_LENGTH + p.getHeight() / 2) : p.setCenter(f.getCenterX() - f.getWidth() / 2 - c.DEFAULT_EDGE_LENGTH - p.getWidth() / 2, f.getCenterY());
|
|
2645
|
-
}
|
|
2646
|
-
}, i.exports = x;
|
|
2647
|
-
}
|
|
2648
|
-
),
|
|
2649
|
-
/***/
|
|
2650
|
-
991: (
|
|
2651
|
-
/***/
|
|
2652
|
-
(i, r, e) => {
|
|
2653
|
-
var l = e(551).FDLayoutNode, n = e(551).IMath;
|
|
2654
|
-
function v(s, h, u, c) {
|
|
2655
|
-
l.call(this, s, h, u, c);
|
|
2656
|
-
}
|
|
2657
|
-
v.prototype = Object.create(l.prototype);
|
|
2658
|
-
for (var t in l)
|
|
2659
|
-
v[t] = l[t];
|
|
2660
|
-
v.prototype.calculateDisplacement = function() {
|
|
2661
|
-
var s = this.graphManager.getLayout();
|
|
2662
|
-
this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += s.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += s.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += s.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += s.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > s.coolingFactor * s.maxNodeDisplacement && (this.displacementX = s.coolingFactor * s.maxNodeDisplacement * n.sign(this.displacementX)), Math.abs(this.displacementY) > s.coolingFactor * s.maxNodeDisplacement && (this.displacementY = s.coolingFactor * s.maxNodeDisplacement * n.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
|
|
2663
|
-
}, v.prototype.propogateDisplacementToChildren = function(s, h) {
|
|
2664
|
-
for (var u = this.getChild().getNodes(), c, N = 0; N < u.length; N++)
|
|
2665
|
-
c = u[N], c.getChild() == null ? (c.displacementX += s, c.displacementY += h) : c.propogateDisplacementToChildren(s, h);
|
|
2666
|
-
}, v.prototype.move = function() {
|
|
2667
|
-
var s = this.graphManager.getLayout();
|
|
2668
|
-
(this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), s.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY)), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0;
|
|
2669
|
-
}, v.prototype.setPred1 = function(s) {
|
|
2670
|
-
this.pred1 = s;
|
|
2671
|
-
}, v.prototype.getPred1 = function() {
|
|
2672
|
-
return pred1;
|
|
2673
|
-
}, v.prototype.getPred2 = function() {
|
|
2674
|
-
return pred2;
|
|
2675
|
-
}, v.prototype.setNext = function(s) {
|
|
2676
|
-
this.next = s;
|
|
2677
|
-
}, v.prototype.getNext = function() {
|
|
2678
|
-
return next;
|
|
2679
|
-
}, v.prototype.setProcessed = function(s) {
|
|
2680
|
-
this.processed = s;
|
|
2681
|
-
}, v.prototype.isProcessed = function() {
|
|
2682
|
-
return processed;
|
|
2683
|
-
}, i.exports = v;
|
|
2684
|
-
}
|
|
2685
|
-
),
|
|
2686
|
-
/***/
|
|
2687
|
-
902: (
|
|
2688
|
-
/***/
|
|
2689
|
-
(i, r, e) => {
|
|
2690
|
-
function l(u) {
|
|
2691
|
-
if (Array.isArray(u)) {
|
|
2692
|
-
for (var c = 0, N = Array(u.length); c < u.length; c++)
|
|
2693
|
-
N[c] = u[c];
|
|
2694
|
-
return N;
|
|
2695
|
-
} else
|
|
2696
|
-
return Array.from(u);
|
|
2697
|
-
}
|
|
2698
|
-
var n = e(806), v = e(551).LinkedList, t = e(551).Matrix, s = e(551).SVD;
|
|
2699
|
-
function h() {
|
|
2700
|
-
}
|
|
2701
|
-
h.handleConstraints = function(u) {
|
|
2702
|
-
var c = {};
|
|
2703
|
-
c.fixedNodeConstraint = u.constraints.fixedNodeConstraint, c.alignmentConstraint = u.constraints.alignmentConstraint, c.relativePlacementConstraint = u.constraints.relativePlacementConstraint;
|
|
2704
|
-
for (var N = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), y = [], I = [], w = u.getAllNodes(), Y = 0, F = 0; F < w.length; F++) {
|
|
2705
|
-
var H = w[F];
|
|
2706
|
-
H.getChild() == null && (d.set(H.id, Y++), y.push(H.getCenterX()), I.push(H.getCenterY()), N.set(H.id, H));
|
|
2707
|
-
}
|
|
2708
|
-
c.relativePlacementConstraint && c.relativePlacementConstraint.forEach(function(M) {
|
|
2709
|
-
!M.gap && M.gap != 0 && (M.left ? M.gap = n.DEFAULT_EDGE_LENGTH + N.get(M.left).getWidth() / 2 + N.get(M.right).getWidth() / 2 : M.gap = n.DEFAULT_EDGE_LENGTH + N.get(M.top).getHeight() / 2 + N.get(M.bottom).getHeight() / 2);
|
|
2710
|
-
});
|
|
2711
|
-
var z = function(M, R) {
|
|
2712
|
-
return { x: M.x - R.x, y: M.y - R.y };
|
|
2713
|
-
}, q = function(M) {
|
|
2714
|
-
var R = 0, W = 0;
|
|
2715
|
-
return M.forEach(function(J) {
|
|
2716
|
-
R += y[d.get(J)], W += I[d.get(J)];
|
|
2717
|
-
}), { x: R / M.size, y: W / M.size };
|
|
2718
|
-
}, x = function(M, R, W, J, Z) {
|
|
2719
|
-
function pt(ct, at) {
|
|
2720
|
-
var st = new Set(ct), It = !0, ut = !1, Ot = void 0;
|
|
2721
|
-
try {
|
|
2722
|
-
for (var Yt = at[Symbol.iterator](), Mt; !(It = (Mt = Yt.next()).done); It = !0) {
|
|
2723
|
-
var At = Mt.value;
|
|
2724
|
-
st.add(At);
|
|
2725
|
-
}
|
|
2726
|
-
} catch (Ut) {
|
|
2727
|
-
ut = !0, Ot = Ut;
|
|
2728
|
-
} finally {
|
|
2729
|
-
try {
|
|
2730
|
-
!It && Yt.return && Yt.return();
|
|
2731
|
-
} finally {
|
|
2732
|
-
if (ut)
|
|
2733
|
-
throw Ot;
|
|
2734
|
-
}
|
|
2735
|
-
}
|
|
2736
|
-
return st;
|
|
2737
|
-
}
|
|
2738
|
-
var lt = /* @__PURE__ */ new Map();
|
|
2739
|
-
M.forEach(function(ct, at) {
|
|
2740
|
-
lt.set(at, 0);
|
|
2741
|
-
}), M.forEach(function(ct, at) {
|
|
2742
|
-
ct.forEach(function(st) {
|
|
2743
|
-
lt.set(st.id, lt.get(st.id) + 1);
|
|
2744
|
-
});
|
|
2745
|
-
});
|
|
2746
|
-
var tt = /* @__PURE__ */ new Map(), gt = /* @__PURE__ */ new Map(), rt = new v();
|
|
2747
|
-
lt.forEach(function(ct, at) {
|
|
2748
|
-
ct == 0 ? (rt.push(at), W || (R == "horizontal" ? tt.set(at, d.has(at) ? y[d.get(at)] : J.get(at)) : tt.set(at, d.has(at) ? I[d.get(at)] : J.get(at)))) : tt.set(at, Number.NEGATIVE_INFINITY), W && gt.set(at, /* @__PURE__ */ new Set([at]));
|
|
2749
|
-
}), W && Z.forEach(function(ct) {
|
|
2750
|
-
var at = [];
|
|
2751
|
-
if (ct.forEach(function(ut) {
|
|
2752
|
-
W.has(ut) && at.push(ut);
|
|
2753
|
-
}), at.length > 0) {
|
|
2754
|
-
var st = 0;
|
|
2755
|
-
at.forEach(function(ut) {
|
|
2756
|
-
R == "horizontal" ? (tt.set(ut, d.has(ut) ? y[d.get(ut)] : J.get(ut)), st += tt.get(ut)) : (tt.set(ut, d.has(ut) ? I[d.get(ut)] : J.get(ut)), st += tt.get(ut));
|
|
2757
|
-
}), st = st / at.length, ct.forEach(function(ut) {
|
|
2758
|
-
W.has(ut) || tt.set(ut, st);
|
|
2759
|
-
});
|
|
2760
|
-
} else {
|
|
2761
|
-
var It = 0;
|
|
2762
|
-
ct.forEach(function(ut) {
|
|
2763
|
-
R == "horizontal" ? It += d.has(ut) ? y[d.get(ut)] : J.get(ut) : It += d.has(ut) ? I[d.get(ut)] : J.get(ut);
|
|
2764
|
-
}), It = It / ct.length, ct.forEach(function(ut) {
|
|
2765
|
-
tt.set(ut, It);
|
|
2766
|
-
});
|
|
2767
|
-
}
|
|
2768
|
-
});
|
|
2769
|
-
for (var Nt = function() {
|
|
2770
|
-
var ct = rt.shift(), at = M.get(ct);
|
|
2771
|
-
at.forEach(function(st) {
|
|
2772
|
-
if (tt.get(st.id) < tt.get(ct) + st.gap)
|
|
2773
|
-
if (W && W.has(st.id)) {
|
|
2774
|
-
var It = void 0;
|
|
2775
|
-
if (R == "horizontal" ? It = d.has(st.id) ? y[d.get(st.id)] : J.get(st.id) : It = d.has(st.id) ? I[d.get(st.id)] : J.get(st.id), tt.set(st.id, It), It < tt.get(ct) + st.gap) {
|
|
2776
|
-
var ut = tt.get(ct) + st.gap - It;
|
|
2777
|
-
gt.get(ct).forEach(function(Ot) {
|
|
2778
|
-
tt.set(Ot, tt.get(Ot) - ut);
|
|
2779
|
-
});
|
|
2780
|
-
}
|
|
2781
|
-
} else
|
|
2782
|
-
tt.set(st.id, tt.get(ct) + st.gap);
|
|
2783
|
-
lt.set(st.id, lt.get(st.id) - 1), lt.get(st.id) == 0 && rt.push(st.id), W && gt.set(st.id, pt(gt.get(ct), gt.get(st.id)));
|
|
2784
|
-
});
|
|
2785
|
-
}; rt.length != 0; )
|
|
2786
|
-
Nt();
|
|
2787
|
-
if (W) {
|
|
2788
|
-
var yt = /* @__PURE__ */ new Set();
|
|
2789
|
-
M.forEach(function(ct, at) {
|
|
2790
|
-
ct.length == 0 && yt.add(at);
|
|
2791
|
-
});
|
|
2792
|
-
var Ct = [];
|
|
2793
|
-
gt.forEach(function(ct, at) {
|
|
2794
|
-
if (yt.has(at)) {
|
|
2795
|
-
var st = !1, It = !0, ut = !1, Ot = void 0;
|
|
2796
|
-
try {
|
|
2797
|
-
for (var Yt = ct[Symbol.iterator](), Mt; !(It = (Mt = Yt.next()).done); It = !0) {
|
|
2798
|
-
var At = Mt.value;
|
|
2799
|
-
W.has(At) && (st = !0);
|
|
2800
|
-
}
|
|
2801
|
-
} catch (Rt) {
|
|
2802
|
-
ut = !0, Ot = Rt;
|
|
2803
|
-
} finally {
|
|
2804
|
-
try {
|
|
2805
|
-
!It && Yt.return && Yt.return();
|
|
2806
|
-
} finally {
|
|
2807
|
-
if (ut)
|
|
2808
|
-
throw Ot;
|
|
2809
|
-
}
|
|
2810
|
-
}
|
|
2811
|
-
if (!st) {
|
|
2812
|
-
var Ut = !1, Ht = void 0;
|
|
2813
|
-
Ct.forEach(function(Rt, kt) {
|
|
2814
|
-
Rt.has([].concat(l(ct))[0]) && (Ut = !0, Ht = kt);
|
|
2815
|
-
}), Ut ? ct.forEach(function(Rt) {
|
|
2816
|
-
Ct[Ht].add(Rt);
|
|
2817
|
-
}) : Ct.push(new Set(ct));
|
|
2818
|
-
}
|
|
2819
|
-
}
|
|
2820
|
-
}), Ct.forEach(function(ct, at) {
|
|
2821
|
-
var st = Number.POSITIVE_INFINITY, It = Number.POSITIVE_INFINITY, ut = Number.NEGATIVE_INFINITY, Ot = Number.NEGATIVE_INFINITY, Yt = !0, Mt = !1, At = void 0;
|
|
2822
|
-
try {
|
|
2823
|
-
for (var Ut = ct[Symbol.iterator](), Ht; !(Yt = (Ht = Ut.next()).done); Yt = !0) {
|
|
2824
|
-
var Rt = Ht.value, kt = void 0;
|
|
2825
|
-
R == "horizontal" ? kt = d.has(Rt) ? y[d.get(Rt)] : J.get(Rt) : kt = d.has(Rt) ? I[d.get(Rt)] : J.get(Rt);
|
|
2826
|
-
var Zt = tt.get(Rt);
|
|
2827
|
-
kt < st && (st = kt), kt > ut && (ut = kt), Zt < It && (It = Zt), Zt > Ot && (Ot = Zt);
|
|
2828
|
-
}
|
|
2829
|
-
} catch (Qt) {
|
|
2830
|
-
Mt = !0, At = Qt;
|
|
2831
|
-
} finally {
|
|
2832
|
-
try {
|
|
2833
|
-
!Yt && Ut.return && Ut.return();
|
|
2834
|
-
} finally {
|
|
2835
|
-
if (Mt)
|
|
2836
|
-
throw At;
|
|
2837
|
-
}
|
|
2838
|
-
}
|
|
2839
|
-
var le = (st + ut) / 2 - (It + Ot) / 2, ie = !0, Jt = !1, Kt = void 0;
|
|
2840
|
-
try {
|
|
2841
|
-
for (var qt = ct[Symbol.iterator](), te; !(ie = (te = qt.next()).done); ie = !0) {
|
|
2842
|
-
var oe = te.value;
|
|
2843
|
-
tt.set(oe, tt.get(oe) + le);
|
|
2844
|
-
}
|
|
2845
|
-
} catch (Qt) {
|
|
2846
|
-
Jt = !0, Kt = Qt;
|
|
2847
|
-
} finally {
|
|
2848
|
-
try {
|
|
2849
|
-
!ie && qt.return && qt.return();
|
|
2850
|
-
} finally {
|
|
2851
|
-
if (Jt)
|
|
2852
|
-
throw Kt;
|
|
2853
|
-
}
|
|
2854
|
-
}
|
|
2855
|
-
});
|
|
2856
|
-
}
|
|
2857
|
-
return tt;
|
|
2858
|
-
}, it = function(M) {
|
|
2859
|
-
var R = 0, W = 0, J = 0, Z = 0;
|
|
2860
|
-
if (M.forEach(function(gt) {
|
|
2861
|
-
gt.left ? y[d.get(gt.left)] - y[d.get(gt.right)] >= 0 ? R++ : W++ : I[d.get(gt.top)] - I[d.get(gt.bottom)] >= 0 ? J++ : Z++;
|
|
2862
|
-
}), R > W && J > Z)
|
|
2863
|
-
for (var pt = 0; pt < d.size; pt++)
|
|
2864
|
-
y[pt] = -1 * y[pt], I[pt] = -1 * I[pt];
|
|
2865
|
-
else if (R > W)
|
|
2866
|
-
for (var lt = 0; lt < d.size; lt++)
|
|
2867
|
-
y[lt] = -1 * y[lt];
|
|
2868
|
-
else if (J > Z)
|
|
2869
|
-
for (var tt = 0; tt < d.size; tt++)
|
|
2870
|
-
I[tt] = -1 * I[tt];
|
|
2871
|
-
}, o = function(M) {
|
|
2872
|
-
var R = [], W = new v(), J = /* @__PURE__ */ new Set(), Z = 0;
|
|
2873
|
-
return M.forEach(function(pt, lt) {
|
|
2874
|
-
if (!J.has(lt)) {
|
|
2875
|
-
R[Z] = [];
|
|
2876
|
-
var tt = lt;
|
|
2877
|
-
for (W.push(tt), J.add(tt), R[Z].push(tt); W.length != 0; ) {
|
|
2878
|
-
tt = W.shift();
|
|
2879
|
-
var gt = M.get(tt);
|
|
2880
|
-
gt.forEach(function(rt) {
|
|
2881
|
-
J.has(rt.id) || (W.push(rt.id), J.add(rt.id), R[Z].push(rt.id));
|
|
2882
|
-
});
|
|
2883
|
-
}
|
|
2884
|
-
Z++;
|
|
2885
|
-
}
|
|
2886
|
-
}), R;
|
|
2887
|
-
}, E = function(M) {
|
|
2888
|
-
var R = /* @__PURE__ */ new Map();
|
|
2889
|
-
return M.forEach(function(W, J) {
|
|
2890
|
-
R.set(J, []);
|
|
2891
|
-
}), M.forEach(function(W, J) {
|
|
2892
|
-
W.forEach(function(Z) {
|
|
2893
|
-
R.get(J).push(Z), R.get(Z.id).push({ id: J, gap: Z.gap, direction: Z.direction });
|
|
2894
|
-
});
|
|
2895
|
-
}), R;
|
|
2896
|
-
}, f = function(M) {
|
|
2897
|
-
var R = /* @__PURE__ */ new Map();
|
|
2898
|
-
return M.forEach(function(W, J) {
|
|
2899
|
-
R.set(J, []);
|
|
2900
|
-
}), M.forEach(function(W, J) {
|
|
2901
|
-
W.forEach(function(Z) {
|
|
2902
|
-
R.get(Z.id).push({ id: J, gap: Z.gap, direction: Z.direction });
|
|
2903
|
-
});
|
|
2904
|
-
}), R;
|
|
2905
|
-
}, p = [], m = [], O = !1, L = !1, C = /* @__PURE__ */ new Set(), P = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), B = [];
|
|
2906
|
-
if (c.fixedNodeConstraint && c.fixedNodeConstraint.forEach(function(M) {
|
|
2907
|
-
C.add(M.nodeId);
|
|
2908
|
-
}), c.relativePlacementConstraint && (c.relativePlacementConstraint.forEach(function(M) {
|
|
2909
|
-
M.left ? (P.has(M.left) ? P.get(M.left).push({ id: M.right, gap: M.gap, direction: "horizontal" }) : P.set(M.left, [{ id: M.right, gap: M.gap, direction: "horizontal" }]), P.has(M.right) || P.set(M.right, [])) : (P.has(M.top) ? P.get(M.top).push({ id: M.bottom, gap: M.gap, direction: "vertical" }) : P.set(M.top, [{ id: M.bottom, gap: M.gap, direction: "vertical" }]), P.has(M.bottom) || P.set(M.bottom, []));
|
|
2910
|
-
}), S = E(P), B = o(S)), n.TRANSFORM_ON_CONSTRAINT_HANDLING) {
|
|
2911
|
-
if (c.fixedNodeConstraint && c.fixedNodeConstraint.length > 1)
|
|
2912
|
-
c.fixedNodeConstraint.forEach(function(M, R) {
|
|
2913
|
-
p[R] = [M.position.x, M.position.y], m[R] = [y[d.get(M.nodeId)], I[d.get(M.nodeId)]];
|
|
2914
|
-
}), O = !0;
|
|
2915
|
-
else if (c.alignmentConstraint)
|
|
2916
|
-
(function() {
|
|
2917
|
-
var M = 0;
|
|
2918
|
-
if (c.alignmentConstraint.vertical) {
|
|
2919
|
-
for (var R = c.alignmentConstraint.vertical, W = function(tt) {
|
|
2920
|
-
var gt = /* @__PURE__ */ new Set();
|
|
2921
|
-
R[tt].forEach(function(yt) {
|
|
2922
|
-
gt.add(yt);
|
|
2923
|
-
});
|
|
2924
|
-
var rt = new Set([].concat(l(gt)).filter(function(yt) {
|
|
2925
|
-
return C.has(yt);
|
|
2926
|
-
})), Nt = void 0;
|
|
2927
|
-
rt.size > 0 ? Nt = y[d.get(rt.values().next().value)] : Nt = q(gt).x, R[tt].forEach(function(yt) {
|
|
2928
|
-
p[M] = [Nt, I[d.get(yt)]], m[M] = [y[d.get(yt)], I[d.get(yt)]], M++;
|
|
2929
|
-
});
|
|
2930
|
-
}, J = 0; J < R.length; J++)
|
|
2931
|
-
W(J);
|
|
2932
|
-
O = !0;
|
|
2933
|
-
}
|
|
2934
|
-
if (c.alignmentConstraint.horizontal) {
|
|
2935
|
-
for (var Z = c.alignmentConstraint.horizontal, pt = function(tt) {
|
|
2936
|
-
var gt = /* @__PURE__ */ new Set();
|
|
2937
|
-
Z[tt].forEach(function(yt) {
|
|
2938
|
-
gt.add(yt);
|
|
2939
|
-
});
|
|
2940
|
-
var rt = new Set([].concat(l(gt)).filter(function(yt) {
|
|
2941
|
-
return C.has(yt);
|
|
2942
|
-
})), Nt = void 0;
|
|
2943
|
-
rt.size > 0 ? Nt = y[d.get(rt.values().next().value)] : Nt = q(gt).y, Z[tt].forEach(function(yt) {
|
|
2944
|
-
p[M] = [y[d.get(yt)], Nt], m[M] = [y[d.get(yt)], I[d.get(yt)]], M++;
|
|
2945
|
-
});
|
|
2946
|
-
}, lt = 0; lt < Z.length; lt++)
|
|
2947
|
-
pt(lt);
|
|
2948
|
-
O = !0;
|
|
2949
|
-
}
|
|
2950
|
-
c.relativePlacementConstraint && (L = !0);
|
|
2951
|
-
})();
|
|
2952
|
-
else if (c.relativePlacementConstraint) {
|
|
2953
|
-
for (var V = 0, X = 0, Q = 0; Q < B.length; Q++)
|
|
2954
|
-
B[Q].length > V && (V = B[Q].length, X = Q);
|
|
2955
|
-
if (V < S.size / 2)
|
|
2956
|
-
it(c.relativePlacementConstraint), O = !1, L = !1;
|
|
2957
|
-
else {
|
|
2958
|
-
var G = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), b = [];
|
|
2959
|
-
B[X].forEach(function(M) {
|
|
2960
|
-
P.get(M).forEach(function(R) {
|
|
2961
|
-
R.direction == "horizontal" ? (G.has(M) ? G.get(M).push(R) : G.set(M, [R]), G.has(R.id) || G.set(R.id, []), b.push({ left: M, right: R.id })) : (D.has(M) ? D.get(M).push(R) : D.set(M, [R]), D.has(R.id) || D.set(R.id, []), b.push({ top: M, bottom: R.id }));
|
|
2962
|
-
});
|
|
2963
|
-
}), it(b), L = !1;
|
|
2964
|
-
var j = x(G, "horizontal"), et = x(D, "vertical");
|
|
2965
|
-
B[X].forEach(function(M, R) {
|
|
2966
|
-
m[R] = [y[d.get(M)], I[d.get(M)]], p[R] = [], j.has(M) ? p[R][0] = j.get(M) : p[R][0] = y[d.get(M)], et.has(M) ? p[R][1] = et.get(M) : p[R][1] = I[d.get(M)];
|
|
2967
|
-
}), O = !0;
|
|
2968
|
-
}
|
|
2969
|
-
}
|
|
2970
|
-
if (O) {
|
|
2971
|
-
for (var vt = void 0, $ = t.transpose(p), Dt = t.transpose(m), K = 0; K < $.length; K++)
|
|
2972
|
-
$[K] = t.multGamma($[K]), Dt[K] = t.multGamma(Dt[K]);
|
|
2973
|
-
var nt = t.multMat($, t.transpose(Dt)), mt = s.svd(nt);
|
|
2974
|
-
vt = t.multMat(mt.V, t.transpose(mt.U));
|
|
2975
|
-
for (var ht = 0; ht < d.size; ht++) {
|
|
2976
|
-
var _t = [y[ht], I[ht]], Lt = [vt[0][0], vt[1][0]], Tt = [vt[0][1], vt[1][1]];
|
|
2977
|
-
y[ht] = t.dotProduct(_t, Lt), I[ht] = t.dotProduct(_t, Tt);
|
|
2978
|
-
}
|
|
2979
|
-
L && it(c.relativePlacementConstraint);
|
|
2980
|
-
}
|
|
2981
|
-
}
|
|
2982
|
-
if (n.ENFORCE_CONSTRAINTS) {
|
|
2983
|
-
if (c.fixedNodeConstraint && c.fixedNodeConstraint.length > 0) {
|
|
2984
|
-
var wt = { x: 0, y: 0 };
|
|
2985
|
-
c.fixedNodeConstraint.forEach(function(M, R) {
|
|
2986
|
-
var W = { x: y[d.get(M.nodeId)], y: I[d.get(M.nodeId)] }, J = M.position, Z = z(J, W);
|
|
2987
|
-
wt.x += Z.x, wt.y += Z.y;
|
|
2988
|
-
}), wt.x /= c.fixedNodeConstraint.length, wt.y /= c.fixedNodeConstraint.length, y.forEach(function(M, R) {
|
|
2989
|
-
y[R] += wt.x;
|
|
2990
|
-
}), I.forEach(function(M, R) {
|
|
2991
|
-
I[R] += wt.y;
|
|
2992
|
-
}), c.fixedNodeConstraint.forEach(function(M) {
|
|
2993
|
-
y[d.get(M.nodeId)] = M.position.x, I[d.get(M.nodeId)] = M.position.y;
|
|
2994
|
-
});
|
|
2995
|
-
}
|
|
2996
|
-
if (c.alignmentConstraint) {
|
|
2997
|
-
if (c.alignmentConstraint.vertical)
|
|
2998
|
-
for (var zt = c.alignmentConstraint.vertical, bt = function(M) {
|
|
2999
|
-
var R = /* @__PURE__ */ new Set();
|
|
3000
|
-
zt[M].forEach(function(Z) {
|
|
3001
|
-
R.add(Z);
|
|
3002
|
-
});
|
|
3003
|
-
var W = new Set([].concat(l(R)).filter(function(Z) {
|
|
3004
|
-
return C.has(Z);
|
|
3005
|
-
})), J = void 0;
|
|
3006
|
-
W.size > 0 ? J = y[d.get(W.values().next().value)] : J = q(R).x, R.forEach(function(Z) {
|
|
3007
|
-
C.has(Z) || (y[d.get(Z)] = J);
|
|
3008
|
-
});
|
|
3009
|
-
}, Gt = 0; Gt < zt.length; Gt++)
|
|
3010
|
-
bt(Gt);
|
|
3011
|
-
if (c.alignmentConstraint.horizontal)
|
|
3012
|
-
for (var St = c.alignmentConstraint.horizontal, Bt = function(M) {
|
|
3013
|
-
var R = /* @__PURE__ */ new Set();
|
|
3014
|
-
St[M].forEach(function(Z) {
|
|
3015
|
-
R.add(Z);
|
|
3016
|
-
});
|
|
3017
|
-
var W = new Set([].concat(l(R)).filter(function(Z) {
|
|
3018
|
-
return C.has(Z);
|
|
3019
|
-
})), J = void 0;
|
|
3020
|
-
W.size > 0 ? J = I[d.get(W.values().next().value)] : J = q(R).y, R.forEach(function(Z) {
|
|
3021
|
-
C.has(Z) || (I[d.get(Z)] = J);
|
|
3022
|
-
});
|
|
3023
|
-
}, Ft = 0; Ft < St.length; Ft++)
|
|
3024
|
-
Bt(Ft);
|
|
3025
|
-
}
|
|
3026
|
-
c.relativePlacementConstraint && function() {
|
|
3027
|
-
var M = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), pt = /* @__PURE__ */ new Map(), lt = /* @__PURE__ */ new Set(), tt = /* @__PURE__ */ new Set();
|
|
3028
|
-
if (C.forEach(function(ft) {
|
|
3029
|
-
lt.add(ft), tt.add(ft);
|
|
3030
|
-
}), c.alignmentConstraint) {
|
|
3031
|
-
if (c.alignmentConstraint.vertical)
|
|
3032
|
-
for (var gt = c.alignmentConstraint.vertical, rt = function(ft) {
|
|
3033
|
-
W.set("dummy" + ft, []), gt[ft].forEach(function(xt) {
|
|
3034
|
-
M.set(xt, "dummy" + ft), W.get("dummy" + ft).push(xt), C.has(xt) && lt.add("dummy" + ft);
|
|
3035
|
-
}), Z.set("dummy" + ft, y[d.get(gt[ft][0])]);
|
|
3036
|
-
}, Nt = 0; Nt < gt.length; Nt++)
|
|
3037
|
-
rt(Nt);
|
|
3038
|
-
if (c.alignmentConstraint.horizontal)
|
|
3039
|
-
for (var yt = c.alignmentConstraint.horizontal, Ct = function(ft) {
|
|
3040
|
-
J.set("dummy" + ft, []), yt[ft].forEach(function(xt) {
|
|
3041
|
-
R.set(xt, "dummy" + ft), J.get("dummy" + ft).push(xt), C.has(xt) && tt.add("dummy" + ft);
|
|
3042
|
-
}), pt.set("dummy" + ft, I[d.get(yt[ft][0])]);
|
|
3043
|
-
}, ct = 0; ct < yt.length; ct++)
|
|
3044
|
-
Ct(ct);
|
|
3045
|
-
}
|
|
3046
|
-
var at = /* @__PURE__ */ new Map(), st = /* @__PURE__ */ new Map(), It = function(ft) {
|
|
3047
|
-
P.get(ft).forEach(function(xt) {
|
|
3048
|
-
var Xt = void 0, Wt = void 0;
|
|
3049
|
-
xt.direction == "horizontal" ? (Xt = M.get(ft) ? M.get(ft) : ft, M.get(xt.id) ? Wt = { id: M.get(xt.id), gap: xt.gap, direction: xt.direction } : Wt = xt, at.has(Xt) ? at.get(Xt).push(Wt) : at.set(Xt, [Wt]), at.has(Wt.id) || at.set(Wt.id, [])) : (Xt = R.get(ft) ? R.get(ft) : ft, R.get(xt.id) ? Wt = { id: R.get(xt.id), gap: xt.gap, direction: xt.direction } : Wt = xt, st.has(Xt) ? st.get(Xt).push(Wt) : st.set(Xt, [Wt]), st.has(Wt.id) || st.set(Wt.id, []));
|
|
3050
|
-
});
|
|
3051
|
-
}, ut = !0, Ot = !1, Yt = void 0;
|
|
3052
|
-
try {
|
|
3053
|
-
for (var Mt = P.keys()[Symbol.iterator](), At; !(ut = (At = Mt.next()).done); ut = !0) {
|
|
3054
|
-
var Ut = At.value;
|
|
3055
|
-
It(Ut);
|
|
3056
|
-
}
|
|
3057
|
-
} catch (ft) {
|
|
3058
|
-
Ot = !0, Yt = ft;
|
|
3059
|
-
} finally {
|
|
3060
|
-
try {
|
|
3061
|
-
!ut && Mt.return && Mt.return();
|
|
3062
|
-
} finally {
|
|
3063
|
-
if (Ot)
|
|
3064
|
-
throw Yt;
|
|
3065
|
-
}
|
|
3066
|
-
}
|
|
3067
|
-
var Ht = E(at), Rt = E(st), kt = o(Ht), Zt = o(Rt), le = f(at), ie = f(st), Jt = [], Kt = [];
|
|
3068
|
-
kt.forEach(function(ft, xt) {
|
|
3069
|
-
Jt[xt] = [], ft.forEach(function(Xt) {
|
|
3070
|
-
le.get(Xt).length == 0 && Jt[xt].push(Xt);
|
|
3071
|
-
});
|
|
3072
|
-
}), Zt.forEach(function(ft, xt) {
|
|
3073
|
-
Kt[xt] = [], ft.forEach(function(Xt) {
|
|
3074
|
-
ie.get(Xt).length == 0 && Kt[xt].push(Xt);
|
|
3075
|
-
});
|
|
3076
|
-
});
|
|
3077
|
-
var qt = x(at, "horizontal", lt, Z, Jt), te = x(st, "vertical", tt, pt, Kt), oe = function(ft) {
|
|
3078
|
-
W.get(ft) ? W.get(ft).forEach(function(xt) {
|
|
3079
|
-
y[d.get(xt)] = qt.get(ft);
|
|
3080
|
-
}) : y[d.get(ft)] = qt.get(ft);
|
|
3081
|
-
}, Qt = !0, Ne = !1, Te = void 0;
|
|
3082
|
-
try {
|
|
3083
|
-
for (var ce = qt.keys()[Symbol.iterator](), Ae; !(Qt = (Ae = ce.next()).done); Qt = !0) {
|
|
3084
|
-
var de = Ae.value;
|
|
3085
|
-
oe(de);
|
|
3086
|
-
}
|
|
3087
|
-
} catch (ft) {
|
|
3088
|
-
Ne = !0, Te = ft;
|
|
3089
|
-
} finally {
|
|
3090
|
-
try {
|
|
3091
|
-
!Qt && ce.return && ce.return();
|
|
3092
|
-
} finally {
|
|
3093
|
-
if (Ne)
|
|
3094
|
-
throw Te;
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
var Be = function(ft) {
|
|
3098
|
-
J.get(ft) ? J.get(ft).forEach(function(xt) {
|
|
3099
|
-
I[d.get(xt)] = te.get(ft);
|
|
3100
|
-
}) : I[d.get(ft)] = te.get(ft);
|
|
3101
|
-
}, ge = !0, we = !1, Ie = void 0;
|
|
3102
|
-
try {
|
|
3103
|
-
for (var ue = te.keys()[Symbol.iterator](), Me; !(ge = (Me = ue.next()).done); ge = !0) {
|
|
3104
|
-
var de = Me.value;
|
|
3105
|
-
Be(de);
|
|
3106
|
-
}
|
|
3107
|
-
} catch (ft) {
|
|
3108
|
-
we = !0, Ie = ft;
|
|
3109
|
-
} finally {
|
|
3110
|
-
try {
|
|
3111
|
-
!ge && ue.return && ue.return();
|
|
3112
|
-
} finally {
|
|
3113
|
-
if (we)
|
|
3114
|
-
throw Ie;
|
|
3115
|
-
}
|
|
3116
|
-
}
|
|
3117
|
-
}();
|
|
3118
|
-
}
|
|
3119
|
-
for (var $t = 0; $t < w.length; $t++) {
|
|
3120
|
-
var dt = w[$t];
|
|
3121
|
-
dt.getChild() == null && dt.setCenter(y[d.get(dt.id)], I[d.get(dt.id)]);
|
|
3122
|
-
}
|
|
3123
|
-
}, i.exports = h;
|
|
3124
|
-
}
|
|
3125
|
-
),
|
|
3126
|
-
/***/
|
|
3127
|
-
551: (
|
|
3128
|
-
/***/
|
|
3129
|
-
(i) => {
|
|
3130
|
-
i.exports = _;
|
|
3131
|
-
}
|
|
3132
|
-
)
|
|
3133
|
-
/******/
|
|
3134
|
-
}, T = {};
|
|
3135
|
-
function g(i) {
|
|
3136
|
-
var r = T[i];
|
|
3137
|
-
if (r !== void 0)
|
|
3138
|
-
return r.exports;
|
|
3139
|
-
var e = T[i] = {
|
|
3140
|
-
/******/
|
|
3141
|
-
// no module.id needed
|
|
3142
|
-
/******/
|
|
3143
|
-
// no module.loaded needed
|
|
3144
|
-
/******/
|
|
3145
|
-
exports: {}
|
|
3146
|
-
/******/
|
|
3147
|
-
};
|
|
3148
|
-
return k[i](e, e.exports, g), e.exports;
|
|
3149
|
-
}
|
|
3150
|
-
var a = g(45);
|
|
3151
|
-
return a;
|
|
3152
|
-
})()
|
|
3153
|
-
);
|
|
3154
|
-
});
|
|
3155
|
-
}(ve)), ve.exports;
|
|
3156
|
-
}
|
|
3157
|
-
var ur = pe.exports, xe;
|
|
3158
|
-
function fr() {
|
|
3159
|
-
return xe || (xe = 1, function(A, U) {
|
|
3160
|
-
(function(_, k) {
|
|
3161
|
-
A.exports = k(gr());
|
|
3162
|
-
})(ur, function(_) {
|
|
3163
|
-
return (
|
|
3164
|
-
/******/
|
|
3165
|
-
(() => {
|
|
3166
|
-
var k = {
|
|
3167
|
-
/***/
|
|
3168
|
-
658: (
|
|
3169
|
-
/***/
|
|
3170
|
-
(i) => {
|
|
3171
|
-
i.exports = Object.assign != null ? Object.assign.bind(Object) : function(r) {
|
|
3172
|
-
for (var e = arguments.length, l = Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++)
|
|
3173
|
-
l[n - 1] = arguments[n];
|
|
3174
|
-
return l.forEach(function(v) {
|
|
3175
|
-
Object.keys(v).forEach(function(t) {
|
|
3176
|
-
return r[t] = v[t];
|
|
3177
|
-
});
|
|
3178
|
-
}), r;
|
|
3179
|
-
};
|
|
3180
|
-
}
|
|
3181
|
-
),
|
|
3182
|
-
/***/
|
|
3183
|
-
548: (
|
|
3184
|
-
/***/
|
|
3185
|
-
(i, r, e) => {
|
|
3186
|
-
var l = /* @__PURE__ */ function() {
|
|
3187
|
-
function t(s, h) {
|
|
3188
|
-
var u = [], c = !0, N = !1, d = void 0;
|
|
3189
|
-
try {
|
|
3190
|
-
for (var y = s[Symbol.iterator](), I; !(c = (I = y.next()).done) && (u.push(I.value), !(h && u.length === h)); c = !0)
|
|
3191
|
-
;
|
|
3192
|
-
} catch (w) {
|
|
3193
|
-
N = !0, d = w;
|
|
3194
|
-
} finally {
|
|
3195
|
-
try {
|
|
3196
|
-
!c && y.return && y.return();
|
|
3197
|
-
} finally {
|
|
3198
|
-
if (N) throw d;
|
|
3199
|
-
}
|
|
3200
|
-
}
|
|
3201
|
-
return u;
|
|
3202
|
-
}
|
|
3203
|
-
return function(s, h) {
|
|
3204
|
-
if (Array.isArray(s))
|
|
3205
|
-
return s;
|
|
3206
|
-
if (Symbol.iterator in Object(s))
|
|
3207
|
-
return t(s, h);
|
|
3208
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
3209
|
-
};
|
|
3210
|
-
}(), n = e(140).layoutBase.LinkedList, v = {};
|
|
3211
|
-
v.getTopMostNodes = function(t) {
|
|
3212
|
-
for (var s = {}, h = 0; h < t.length; h++)
|
|
3213
|
-
s[t[h].id()] = !0;
|
|
3214
|
-
var u = t.filter(function(c, N) {
|
|
3215
|
-
typeof c == "number" && (c = N);
|
|
3216
|
-
for (var d = c.parent()[0]; d != null; ) {
|
|
3217
|
-
if (s[d.id()])
|
|
3218
|
-
return !1;
|
|
3219
|
-
d = d.parent()[0];
|
|
3220
|
-
}
|
|
3221
|
-
return !0;
|
|
3222
|
-
});
|
|
3223
|
-
return u;
|
|
3224
|
-
}, v.connectComponents = function(t, s, h, u) {
|
|
3225
|
-
var c = new n(), N = /* @__PURE__ */ new Set(), d = [], y = void 0, I = void 0, w = void 0, Y = !1, F = 1, H = [], z = [], q = function() {
|
|
3226
|
-
var x = t.collection();
|
|
3227
|
-
z.push(x);
|
|
3228
|
-
var it = h[0], o = t.collection();
|
|
3229
|
-
o.merge(it).merge(it.descendants().intersection(s)), d.push(it), o.forEach(function(p) {
|
|
3230
|
-
c.push(p), N.add(p), x.merge(p);
|
|
3231
|
-
});
|
|
3232
|
-
for (var E = function() {
|
|
3233
|
-
it = c.shift();
|
|
3234
|
-
var p = t.collection();
|
|
3235
|
-
it.neighborhood().nodes().forEach(function(C) {
|
|
3236
|
-
s.intersection(it.edgesWith(C)).length > 0 && p.merge(C);
|
|
3237
|
-
});
|
|
3238
|
-
for (var m = 0; m < p.length; m++) {
|
|
3239
|
-
var O = p[m];
|
|
3240
|
-
if (y = h.intersection(O.union(O.ancestors())), y != null && !N.has(y[0])) {
|
|
3241
|
-
var L = y.union(y.descendants());
|
|
3242
|
-
L.forEach(function(C) {
|
|
3243
|
-
c.push(C), N.add(C), x.merge(C), h.has(C) && d.push(C);
|
|
3244
|
-
});
|
|
3245
|
-
}
|
|
3246
|
-
}
|
|
3247
|
-
}; c.length != 0; )
|
|
3248
|
-
E();
|
|
3249
|
-
if (x.forEach(function(p) {
|
|
3250
|
-
s.intersection(p.connectedEdges()).forEach(function(m) {
|
|
3251
|
-
x.has(m.source()) && x.has(m.target()) && x.merge(m);
|
|
3252
|
-
});
|
|
3253
|
-
}), d.length == h.length && (Y = !0), !Y || Y && F > 1) {
|
|
3254
|
-
I = d[0], w = I.connectedEdges().length, d.forEach(function(p) {
|
|
3255
|
-
p.connectedEdges().length < w && (w = p.connectedEdges().length, I = p);
|
|
3256
|
-
}), H.push(I.id());
|
|
3257
|
-
var f = t.collection();
|
|
3258
|
-
f.merge(d[0]), d.forEach(function(p) {
|
|
3259
|
-
f.merge(p);
|
|
3260
|
-
}), d = [], h = h.difference(f), F++;
|
|
3261
|
-
}
|
|
3262
|
-
};
|
|
3263
|
-
do
|
|
3264
|
-
q();
|
|
3265
|
-
while (!Y);
|
|
3266
|
-
return u && H.length > 0 && u.set("dummy" + (u.size + 1), H), z;
|
|
3267
|
-
}, v.relocateComponent = function(t, s, h) {
|
|
3268
|
-
if (!h.fixedNodeConstraint) {
|
|
3269
|
-
var u = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY, N = Number.POSITIVE_INFINITY, d = Number.NEGATIVE_INFINITY;
|
|
3270
|
-
if (h.quality == "draft") {
|
|
3271
|
-
var y = !0, I = !1, w = void 0;
|
|
3272
|
-
try {
|
|
3273
|
-
for (var Y = s.nodeIndexes[Symbol.iterator](), F; !(y = (F = Y.next()).done); y = !0) {
|
|
3274
|
-
var H = F.value, z = l(H, 2), q = z[0], x = z[1], it = h.cy.getElementById(q);
|
|
3275
|
-
if (it) {
|
|
3276
|
-
var o = it.boundingBox(), E = s.xCoords[x] - o.w / 2, f = s.xCoords[x] + o.w / 2, p = s.yCoords[x] - o.h / 2, m = s.yCoords[x] + o.h / 2;
|
|
3277
|
-
E < u && (u = E), f > c && (c = f), p < N && (N = p), m > d && (d = m);
|
|
3278
|
-
}
|
|
3279
|
-
}
|
|
3280
|
-
} catch (S) {
|
|
3281
|
-
I = !0, w = S;
|
|
3282
|
-
} finally {
|
|
3283
|
-
try {
|
|
3284
|
-
!y && Y.return && Y.return();
|
|
3285
|
-
} finally {
|
|
3286
|
-
if (I)
|
|
3287
|
-
throw w;
|
|
3288
|
-
}
|
|
3289
|
-
}
|
|
3290
|
-
var O = t.x - (c + u) / 2, L = t.y - (d + N) / 2;
|
|
3291
|
-
s.xCoords = s.xCoords.map(function(S) {
|
|
3292
|
-
return S + O;
|
|
3293
|
-
}), s.yCoords = s.yCoords.map(function(S) {
|
|
3294
|
-
return S + L;
|
|
3295
|
-
});
|
|
3296
|
-
} else {
|
|
3297
|
-
Object.keys(s).forEach(function(S) {
|
|
3298
|
-
var B = s[S], V = B.getRect().x, X = B.getRect().x + B.getRect().width, Q = B.getRect().y, G = B.getRect().y + B.getRect().height;
|
|
3299
|
-
V < u && (u = V), X > c && (c = X), Q < N && (N = Q), G > d && (d = G);
|
|
3300
|
-
});
|
|
3301
|
-
var C = t.x - (c + u) / 2, P = t.y - (d + N) / 2;
|
|
3302
|
-
Object.keys(s).forEach(function(S) {
|
|
3303
|
-
var B = s[S];
|
|
3304
|
-
B.setCenter(B.getCenterX() + C, B.getCenterY() + P);
|
|
3305
|
-
});
|
|
3306
|
-
}
|
|
3307
|
-
}
|
|
3308
|
-
}, v.calcBoundingBox = function(t, s, h, u) {
|
|
3309
|
-
for (var c = Number.MAX_SAFE_INTEGER, N = Number.MIN_SAFE_INTEGER, d = Number.MAX_SAFE_INTEGER, y = Number.MIN_SAFE_INTEGER, I = void 0, w = void 0, Y = void 0, F = void 0, H = t.descendants().not(":parent"), z = H.length, q = 0; q < z; q++) {
|
|
3310
|
-
var x = H[q];
|
|
3311
|
-
I = s[u.get(x.id())] - x.width() / 2, w = s[u.get(x.id())] + x.width() / 2, Y = h[u.get(x.id())] - x.height() / 2, F = h[u.get(x.id())] + x.height() / 2, c > I && (c = I), N < w && (N = w), d > Y && (d = Y), y < F && (y = F);
|
|
3312
|
-
}
|
|
3313
|
-
var it = {};
|
|
3314
|
-
return it.topLeftX = c, it.topLeftY = d, it.width = N - c, it.height = y - d, it;
|
|
3315
|
-
}, v.calcParentsWithoutChildren = function(t, s) {
|
|
3316
|
-
var h = t.collection();
|
|
3317
|
-
return s.nodes(":parent").forEach(function(u) {
|
|
3318
|
-
var c = !1;
|
|
3319
|
-
u.children().forEach(function(N) {
|
|
3320
|
-
N.css("display") != "none" && (c = !0);
|
|
3321
|
-
}), c || h.merge(u);
|
|
3322
|
-
}), h;
|
|
3323
|
-
}, i.exports = v;
|
|
3324
|
-
}
|
|
3325
|
-
),
|
|
3326
|
-
/***/
|
|
3327
|
-
816: (
|
|
3328
|
-
/***/
|
|
3329
|
-
(i, r, e) => {
|
|
3330
|
-
var l = e(548), n = e(140).CoSELayout, v = e(140).CoSENode, t = e(140).layoutBase.PointD, s = e(140).layoutBase.DimensionD, h = e(140).layoutBase.LayoutConstants, u = e(140).layoutBase.FDLayoutConstants, c = e(140).CoSEConstants, N = function(d, y) {
|
|
3331
|
-
var I = d.cy, w = d.eles, Y = w.nodes(), F = w.edges(), H = void 0, z = void 0, q = void 0, x = {};
|
|
3332
|
-
d.randomize && (H = y.nodeIndexes, z = y.xCoords, q = y.yCoords);
|
|
3333
|
-
var it = function(C) {
|
|
3334
|
-
return typeof C == "function";
|
|
3335
|
-
}, o = function(C, P) {
|
|
3336
|
-
return it(C) ? C(P) : C;
|
|
3337
|
-
}, E = l.calcParentsWithoutChildren(I, w), f = function C(P, S, B, V) {
|
|
3338
|
-
for (var X = S.length, Q = 0; Q < X; Q++) {
|
|
3339
|
-
var G = S[Q], D = null;
|
|
3340
|
-
G.intersection(E).length == 0 && (D = G.children());
|
|
3341
|
-
var b = void 0, j = G.layoutDimensions({
|
|
3342
|
-
nodeDimensionsIncludeLabels: V.nodeDimensionsIncludeLabels
|
|
3343
|
-
});
|
|
3344
|
-
if (G.outerWidth() != null && G.outerHeight() != null)
|
|
3345
|
-
if (V.randomize)
|
|
3346
|
-
if (!G.isParent())
|
|
3347
|
-
b = P.add(new v(B.graphManager, new t(z[H.get(G.id())] - j.w / 2, q[H.get(G.id())] - j.h / 2), new s(parseFloat(j.w), parseFloat(j.h))));
|
|
3348
|
-
else {
|
|
3349
|
-
var et = l.calcBoundingBox(G, z, q, H);
|
|
3350
|
-
G.intersection(E).length == 0 ? b = P.add(new v(B.graphManager, new t(et.topLeftX, et.topLeftY), new s(et.width, et.height))) : b = P.add(new v(B.graphManager, new t(et.topLeftX, et.topLeftY), new s(parseFloat(j.w), parseFloat(j.h))));
|
|
3351
|
-
}
|
|
3352
|
-
else
|
|
3353
|
-
b = P.add(new v(B.graphManager, new t(G.position("x") - j.w / 2, G.position("y") - j.h / 2), new s(parseFloat(j.w), parseFloat(j.h))));
|
|
3354
|
-
else
|
|
3355
|
-
b = P.add(new v(this.graphManager));
|
|
3356
|
-
if (b.id = G.data("id"), b.nodeRepulsion = o(V.nodeRepulsion, G), b.paddingLeft = parseInt(G.css("padding")), b.paddingTop = parseInt(G.css("padding")), b.paddingRight = parseInt(G.css("padding")), b.paddingBottom = parseInt(G.css("padding")), V.nodeDimensionsIncludeLabels && (b.labelWidth = G.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).w, b.labelHeight = G.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).h, b.labelPosVertical = G.css("text-valign"), b.labelPosHorizontal = G.css("text-halign")), x[G.data("id")] = b, isNaN(b.rect.x) && (b.rect.x = 0), isNaN(b.rect.y) && (b.rect.y = 0), D != null && D.length > 0) {
|
|
3357
|
-
var vt = void 0;
|
|
3358
|
-
vt = B.getGraphManager().add(B.newGraph(), b), C(vt, D, B, V);
|
|
3359
|
-
}
|
|
3360
|
-
}
|
|
3361
|
-
}, p = function(C, P, S) {
|
|
3362
|
-
for (var B = 0, V = 0, X = 0; X < S.length; X++) {
|
|
3363
|
-
var Q = S[X], G = x[Q.data("source")], D = x[Q.data("target")];
|
|
3364
|
-
if (G && D && G !== D && G.getEdgesBetween(D).length == 0) {
|
|
3365
|
-
var b = P.add(C.newEdge(), G, D);
|
|
3366
|
-
b.id = Q.id(), b.idealLength = o(d.idealEdgeLength, Q), b.edgeElasticity = o(d.edgeElasticity, Q), B += b.idealLength, V++;
|
|
3367
|
-
}
|
|
3368
|
-
}
|
|
3369
|
-
d.idealEdgeLength != null && (V > 0 ? c.DEFAULT_EDGE_LENGTH = u.DEFAULT_EDGE_LENGTH = B / V : it(d.idealEdgeLength) ? c.DEFAULT_EDGE_LENGTH = u.DEFAULT_EDGE_LENGTH = 50 : c.DEFAULT_EDGE_LENGTH = u.DEFAULT_EDGE_LENGTH = d.idealEdgeLength, c.MIN_REPULSION_DIST = u.MIN_REPULSION_DIST = u.DEFAULT_EDGE_LENGTH / 10, c.DEFAULT_RADIAL_SEPARATION = u.DEFAULT_EDGE_LENGTH);
|
|
3370
|
-
}, m = function(C, P) {
|
|
3371
|
-
P.fixedNodeConstraint && (C.constraints.fixedNodeConstraint = P.fixedNodeConstraint), P.alignmentConstraint && (C.constraints.alignmentConstraint = P.alignmentConstraint), P.relativePlacementConstraint && (C.constraints.relativePlacementConstraint = P.relativePlacementConstraint);
|
|
3372
|
-
};
|
|
3373
|
-
d.nestingFactor != null && (c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = d.nestingFactor), d.gravity != null && (c.DEFAULT_GRAVITY_STRENGTH = u.DEFAULT_GRAVITY_STRENGTH = d.gravity), d.numIter != null && (c.MAX_ITERATIONS = u.MAX_ITERATIONS = d.numIter), d.gravityRange != null && (c.DEFAULT_GRAVITY_RANGE_FACTOR = u.DEFAULT_GRAVITY_RANGE_FACTOR = d.gravityRange), d.gravityCompound != null && (c.DEFAULT_COMPOUND_GRAVITY_STRENGTH = u.DEFAULT_COMPOUND_GRAVITY_STRENGTH = d.gravityCompound), d.gravityRangeCompound != null && (c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = d.gravityRangeCompound), d.initialEnergyOnIncremental != null && (c.DEFAULT_COOLING_FACTOR_INCREMENTAL = u.DEFAULT_COOLING_FACTOR_INCREMENTAL = d.initialEnergyOnIncremental), d.tilingCompareBy != null && (c.TILING_COMPARE_BY = d.tilingCompareBy), d.quality == "proof" ? h.QUALITY = 2 : h.QUALITY = 0, c.NODE_DIMENSIONS_INCLUDE_LABELS = u.NODE_DIMENSIONS_INCLUDE_LABELS = h.NODE_DIMENSIONS_INCLUDE_LABELS = d.nodeDimensionsIncludeLabels, c.DEFAULT_INCREMENTAL = u.DEFAULT_INCREMENTAL = h.DEFAULT_INCREMENTAL = !d.randomize, c.ANIMATE = u.ANIMATE = h.ANIMATE = d.animate, c.TILE = d.tile, c.TILING_PADDING_VERTICAL = typeof d.tilingPaddingVertical == "function" ? d.tilingPaddingVertical.call() : d.tilingPaddingVertical, c.TILING_PADDING_HORIZONTAL = typeof d.tilingPaddingHorizontal == "function" ? d.tilingPaddingHorizontal.call() : d.tilingPaddingHorizontal, c.DEFAULT_INCREMENTAL = u.DEFAULT_INCREMENTAL = h.DEFAULT_INCREMENTAL = !0, c.PURE_INCREMENTAL = !d.randomize, h.DEFAULT_UNIFORM_LEAF_NODE_SIZES = d.uniformNodeDimensions, d.step == "transformed" && (c.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, c.ENFORCE_CONSTRAINTS = !1, c.APPLY_LAYOUT = !1), d.step == "enforced" && (c.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, c.ENFORCE_CONSTRAINTS = !0, c.APPLY_LAYOUT = !1), d.step == "cose" && (c.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, c.ENFORCE_CONSTRAINTS = !1, c.APPLY_LAYOUT = !0), d.step == "all" && (d.randomize ? c.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : c.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, c.ENFORCE_CONSTRAINTS = !0, c.APPLY_LAYOUT = !0), d.fixedNodeConstraint || d.alignmentConstraint || d.relativePlacementConstraint ? c.TREE_REDUCTION_ON_INCREMENTAL = !1 : c.TREE_REDUCTION_ON_INCREMENTAL = !0;
|
|
3374
|
-
var O = new n(), L = O.newGraphManager();
|
|
3375
|
-
return f(L.addRoot(), l.getTopMostNodes(Y), O, d), p(O, L, F), m(O, d), O.runLayout(), x;
|
|
3376
|
-
};
|
|
3377
|
-
i.exports = { coseLayout: N };
|
|
3378
|
-
}
|
|
3379
|
-
),
|
|
3380
|
-
/***/
|
|
3381
|
-
212: (
|
|
3382
|
-
/***/
|
|
3383
|
-
(i, r, e) => {
|
|
3384
|
-
var l = /* @__PURE__ */ function() {
|
|
3385
|
-
function y(I, w) {
|
|
3386
|
-
for (var Y = 0; Y < w.length; Y++) {
|
|
3387
|
-
var F = w[Y];
|
|
3388
|
-
F.enumerable = F.enumerable || !1, F.configurable = !0, "value" in F && (F.writable = !0), Object.defineProperty(I, F.key, F);
|
|
3389
|
-
}
|
|
3390
|
-
}
|
|
3391
|
-
return function(I, w, Y) {
|
|
3392
|
-
return w && y(I.prototype, w), Y && y(I, Y), I;
|
|
3393
|
-
};
|
|
3394
|
-
}();
|
|
3395
|
-
function n(y, I) {
|
|
3396
|
-
if (!(y instanceof I))
|
|
3397
|
-
throw new TypeError("Cannot call a class as a function");
|
|
3398
|
-
}
|
|
3399
|
-
var v = e(658), t = e(548), s = e(657), h = s.spectralLayout, u = e(816), c = u.coseLayout, N = Object.freeze({
|
|
3400
|
-
// 'draft', 'default' or 'proof'
|
|
3401
|
-
// - 'draft' only applies spectral layout
|
|
3402
|
-
// - 'default' improves the quality with subsequent CoSE layout (fast cooling rate)
|
|
3403
|
-
// - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate)
|
|
3404
|
-
quality: "default",
|
|
3405
|
-
// Use random node positions at beginning of layout
|
|
3406
|
-
// if this is set to false, then quality option must be "proof"
|
|
3407
|
-
randomize: !0,
|
|
3408
|
-
// Whether or not to animate the layout
|
|
3409
|
-
animate: !0,
|
|
3410
|
-
// Duration of animation in ms, if enabled
|
|
3411
|
-
animationDuration: 1e3,
|
|
3412
|
-
// Easing of animation, if enabled
|
|
3413
|
-
animationEasing: void 0,
|
|
3414
|
-
// Fit the viewport to the repositioned nodes
|
|
3415
|
-
fit: !0,
|
|
3416
|
-
// Padding around layout
|
|
3417
|
-
padding: 30,
|
|
3418
|
-
// Whether to include labels in node dimensions. Valid in "proof" quality
|
|
3419
|
-
nodeDimensionsIncludeLabels: !1,
|
|
3420
|
-
// Whether or not simple nodes (non-compound nodes) are of uniform dimensions
|
|
3421
|
-
uniformNodeDimensions: !1,
|
|
3422
|
-
// Whether to pack disconnected components - valid only if randomize: true
|
|
3423
|
-
packComponents: !0,
|
|
3424
|
-
// Layout step - all, transformed, enforced, cose - for debug purpose only
|
|
3425
|
-
step: "all",
|
|
3426
|
-
/* spectral layout options */
|
|
3427
|
-
// False for random, true for greedy
|
|
3428
|
-
samplingType: !0,
|
|
3429
|
-
// Sample size to construct distance matrix
|
|
3430
|
-
sampleSize: 25,
|
|
3431
|
-
// Separation amount between nodes
|
|
3432
|
-
nodeSeparation: 75,
|
|
3433
|
-
// Power iteration tolerance
|
|
3434
|
-
piTol: 1e-7,
|
|
3435
|
-
/* CoSE layout options */
|
|
3436
|
-
// Node repulsion (non overlapping) multiplier
|
|
3437
|
-
nodeRepulsion: function(y) {
|
|
3438
|
-
return 4500;
|
|
3439
|
-
},
|
|
3440
|
-
// Ideal edge (non nested) length
|
|
3441
|
-
idealEdgeLength: function(y) {
|
|
3442
|
-
return 50;
|
|
3443
|
-
},
|
|
3444
|
-
// Divisor to compute edge forces
|
|
3445
|
-
edgeElasticity: function(y) {
|
|
3446
|
-
return 0.45;
|
|
3447
|
-
},
|
|
3448
|
-
// Nesting factor (multiplier) to compute ideal edge length for nested edges
|
|
3449
|
-
nestingFactor: 0.1,
|
|
3450
|
-
// Gravity force (constant)
|
|
3451
|
-
gravity: 0.25,
|
|
3452
|
-
// Maximum number of iterations to perform
|
|
3453
|
-
numIter: 2500,
|
|
3454
|
-
// For enabling tiling
|
|
3455
|
-
tile: !0,
|
|
3456
|
-
// The function that specifies the criteria for comparing nodes while sorting them during tiling operation.
|
|
3457
|
-
// Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set.
|
|
3458
|
-
tilingCompareBy: void 0,
|
|
3459
|
-
// Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
|
|
3460
|
-
tilingPaddingVertical: 10,
|
|
3461
|
-
// Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
|
|
3462
|
-
tilingPaddingHorizontal: 10,
|
|
3463
|
-
// Gravity range (constant) for compounds
|
|
3464
|
-
gravityRangeCompound: 1.5,
|
|
3465
|
-
// Gravity force (constant) for compounds
|
|
3466
|
-
gravityCompound: 1,
|
|
3467
|
-
// Gravity range (constant)
|
|
3468
|
-
gravityRange: 3.8,
|
|
3469
|
-
// Initial cooling factor for incremental layout
|
|
3470
|
-
initialEnergyOnIncremental: 0.3,
|
|
3471
|
-
/* constraint options */
|
|
3472
|
-
// Fix required nodes to predefined positions
|
|
3473
|
-
// [{nodeId: 'n1', position: {x: 100, y: 200}, {...}]
|
|
3474
|
-
fixedNodeConstraint: void 0,
|
|
3475
|
-
// Align required nodes in vertical/horizontal direction
|
|
3476
|
-
// {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']}
|
|
3477
|
-
alignmentConstraint: void 0,
|
|
3478
|
-
// Place two nodes relatively in vertical/horizontal direction
|
|
3479
|
-
// [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}]
|
|
3480
|
-
relativePlacementConstraint: void 0,
|
|
3481
|
-
/* layout event callbacks */
|
|
3482
|
-
ready: function() {
|
|
3483
|
-
},
|
|
3484
|
-
// on layoutready
|
|
3485
|
-
stop: function() {
|
|
3486
|
-
}
|
|
3487
|
-
// on layoutstop
|
|
3488
|
-
}), d = function() {
|
|
3489
|
-
function y(I) {
|
|
3490
|
-
n(this, y), this.options = v({}, N, I);
|
|
3491
|
-
}
|
|
3492
|
-
return l(y, [{
|
|
3493
|
-
key: "run",
|
|
3494
|
-
value: function() {
|
|
3495
|
-
var I = this, w = this.options, Y = w.cy, F = w.eles, H = [], z = [], q = void 0, x = [];
|
|
3496
|
-
w.fixedNodeConstraint && (!Array.isArray(w.fixedNodeConstraint) || w.fixedNodeConstraint.length == 0) && (w.fixedNodeConstraint = void 0), w.alignmentConstraint && (w.alignmentConstraint.vertical && (!Array.isArray(w.alignmentConstraint.vertical) || w.alignmentConstraint.vertical.length == 0) && (w.alignmentConstraint.vertical = void 0), w.alignmentConstraint.horizontal && (!Array.isArray(w.alignmentConstraint.horizontal) || w.alignmentConstraint.horizontal.length == 0) && (w.alignmentConstraint.horizontal = void 0)), w.relativePlacementConstraint && (!Array.isArray(w.relativePlacementConstraint) || w.relativePlacementConstraint.length == 0) && (w.relativePlacementConstraint = void 0);
|
|
3497
|
-
var it = w.fixedNodeConstraint || w.alignmentConstraint || w.relativePlacementConstraint;
|
|
3498
|
-
it && (w.tile = !1, w.packComponents = !1);
|
|
3499
|
-
var o = void 0, E = !1;
|
|
3500
|
-
if (Y.layoutUtilities && w.packComponents && (o = Y.layoutUtilities("get"), o || (o = Y.layoutUtilities()), E = !0), F.nodes().length > 0)
|
|
3501
|
-
if (E) {
|
|
3502
|
-
var f = t.getTopMostNodes(w.eles.nodes());
|
|
3503
|
-
if (q = t.connectComponents(Y, w.eles, f), q.forEach(function(K) {
|
|
3504
|
-
var nt = K.boundingBox();
|
|
3505
|
-
x.push({ x: nt.x1 + nt.w / 2, y: nt.y1 + nt.h / 2 });
|
|
3506
|
-
}), w.randomize && q.forEach(function(K) {
|
|
3507
|
-
w.eles = K, H.push(h(w));
|
|
3508
|
-
}), w.quality == "default" || w.quality == "proof") {
|
|
3509
|
-
var p = Y.collection();
|
|
3510
|
-
if (w.tile) {
|
|
3511
|
-
var m = /* @__PURE__ */ new Map(), O = [], L = [], C = 0, P = { nodeIndexes: m, xCoords: O, yCoords: L }, S = [];
|
|
3512
|
-
if (q.forEach(function(K, nt) {
|
|
3513
|
-
K.edges().length == 0 && (K.nodes().forEach(function(mt, ht) {
|
|
3514
|
-
p.merge(K.nodes()[ht]), mt.isParent() || (P.nodeIndexes.set(K.nodes()[ht].id(), C++), P.xCoords.push(K.nodes()[0].position().x), P.yCoords.push(K.nodes()[0].position().y));
|
|
3515
|
-
}), S.push(nt));
|
|
3516
|
-
}), p.length > 1) {
|
|
3517
|
-
var B = p.boundingBox();
|
|
3518
|
-
x.push({ x: B.x1 + B.w / 2, y: B.y1 + B.h / 2 }), q.push(p), H.push(P);
|
|
3519
|
-
for (var V = S.length - 1; V >= 0; V--)
|
|
3520
|
-
q.splice(S[V], 1), H.splice(S[V], 1), x.splice(S[V], 1);
|
|
3521
|
-
}
|
|
3522
|
-
}
|
|
3523
|
-
q.forEach(function(K, nt) {
|
|
3524
|
-
w.eles = K, z.push(c(w, H[nt])), t.relocateComponent(x[nt], z[nt], w);
|
|
3525
|
-
});
|
|
3526
|
-
} else
|
|
3527
|
-
q.forEach(function(K, nt) {
|
|
3528
|
-
t.relocateComponent(x[nt], H[nt], w);
|
|
3529
|
-
});
|
|
3530
|
-
var X = /* @__PURE__ */ new Set();
|
|
3531
|
-
if (q.length > 1) {
|
|
3532
|
-
var Q = [], G = F.filter(function(K) {
|
|
3533
|
-
return K.css("display") == "none";
|
|
3534
|
-
});
|
|
3535
|
-
q.forEach(function(K, nt) {
|
|
3536
|
-
var mt = void 0;
|
|
3537
|
-
if (w.quality == "draft" && (mt = H[nt].nodeIndexes), K.nodes().not(G).length > 0) {
|
|
3538
|
-
var ht = {};
|
|
3539
|
-
ht.edges = [], ht.nodes = [];
|
|
3540
|
-
var _t = void 0;
|
|
3541
|
-
K.nodes().not(G).forEach(function(Lt) {
|
|
3542
|
-
if (w.quality == "draft")
|
|
3543
|
-
if (!Lt.isParent())
|
|
3544
|
-
_t = mt.get(Lt.id()), ht.nodes.push({ x: H[nt].xCoords[_t] - Lt.boundingbox().w / 2, y: H[nt].yCoords[_t] - Lt.boundingbox().h / 2, width: Lt.boundingbox().w, height: Lt.boundingbox().h });
|
|
3545
|
-
else {
|
|
3546
|
-
var Tt = t.calcBoundingBox(Lt, H[nt].xCoords, H[nt].yCoords, mt);
|
|
3547
|
-
ht.nodes.push({ x: Tt.topLeftX, y: Tt.topLeftY, width: Tt.width, height: Tt.height });
|
|
3548
|
-
}
|
|
3549
|
-
else
|
|
3550
|
-
z[nt][Lt.id()] && ht.nodes.push({ x: z[nt][Lt.id()].getLeft(), y: z[nt][Lt.id()].getTop(), width: z[nt][Lt.id()].getWidth(), height: z[nt][Lt.id()].getHeight() });
|
|
3551
|
-
}), K.edges().forEach(function(Lt) {
|
|
3552
|
-
var Tt = Lt.source(), wt = Lt.target();
|
|
3553
|
-
if (Tt.css("display") != "none" && wt.css("display") != "none")
|
|
3554
|
-
if (w.quality == "draft") {
|
|
3555
|
-
var zt = mt.get(Tt.id()), bt = mt.get(wt.id()), Gt = [], St = [];
|
|
3556
|
-
if (Tt.isParent()) {
|
|
3557
|
-
var Bt = t.calcBoundingBox(Tt, H[nt].xCoords, H[nt].yCoords, mt);
|
|
3558
|
-
Gt.push(Bt.topLeftX + Bt.width / 2), Gt.push(Bt.topLeftY + Bt.height / 2);
|
|
3559
|
-
} else
|
|
3560
|
-
Gt.push(H[nt].xCoords[zt]), Gt.push(H[nt].yCoords[zt]);
|
|
3561
|
-
if (wt.isParent()) {
|
|
3562
|
-
var Ft = t.calcBoundingBox(wt, H[nt].xCoords, H[nt].yCoords, mt);
|
|
3563
|
-
St.push(Ft.topLeftX + Ft.width / 2), St.push(Ft.topLeftY + Ft.height / 2);
|
|
3564
|
-
} else
|
|
3565
|
-
St.push(H[nt].xCoords[bt]), St.push(H[nt].yCoords[bt]);
|
|
3566
|
-
ht.edges.push({ startX: Gt[0], startY: Gt[1], endX: St[0], endY: St[1] });
|
|
3567
|
-
} else
|
|
3568
|
-
z[nt][Tt.id()] && z[nt][wt.id()] && ht.edges.push({ startX: z[nt][Tt.id()].getCenterX(), startY: z[nt][Tt.id()].getCenterY(), endX: z[nt][wt.id()].getCenterX(), endY: z[nt][wt.id()].getCenterY() });
|
|
3569
|
-
}), ht.nodes.length > 0 && (Q.push(ht), X.add(nt));
|
|
3570
|
-
}
|
|
3571
|
-
});
|
|
3572
|
-
var D = o.packComponents(Q, w.randomize).shifts;
|
|
3573
|
-
if (w.quality == "draft")
|
|
3574
|
-
H.forEach(function(K, nt) {
|
|
3575
|
-
var mt = K.xCoords.map(function(_t) {
|
|
3576
|
-
return _t + D[nt].dx;
|
|
3577
|
-
}), ht = K.yCoords.map(function(_t) {
|
|
3578
|
-
return _t + D[nt].dy;
|
|
3579
|
-
});
|
|
3580
|
-
K.xCoords = mt, K.yCoords = ht;
|
|
3581
|
-
});
|
|
3582
|
-
else {
|
|
3583
|
-
var b = 0;
|
|
3584
|
-
X.forEach(function(K) {
|
|
3585
|
-
Object.keys(z[K]).forEach(function(nt) {
|
|
3586
|
-
var mt = z[K][nt];
|
|
3587
|
-
mt.setCenter(mt.getCenterX() + D[b].dx, mt.getCenterY() + D[b].dy);
|
|
3588
|
-
}), b++;
|
|
3589
|
-
});
|
|
3590
|
-
}
|
|
3591
|
-
}
|
|
3592
|
-
} else {
|
|
3593
|
-
var j = w.eles.boundingBox();
|
|
3594
|
-
if (x.push({ x: j.x1 + j.w / 2, y: j.y1 + j.h / 2 }), w.randomize) {
|
|
3595
|
-
var et = h(w);
|
|
3596
|
-
H.push(et);
|
|
3597
|
-
}
|
|
3598
|
-
w.quality == "default" || w.quality == "proof" ? (z.push(c(w, H[0])), t.relocateComponent(x[0], z[0], w)) : t.relocateComponent(x[0], H[0], w);
|
|
3599
|
-
}
|
|
3600
|
-
var vt = function(K, nt) {
|
|
3601
|
-
if (w.quality == "default" || w.quality == "proof") {
|
|
3602
|
-
typeof K == "number" && (K = nt);
|
|
3603
|
-
var mt = void 0, ht = void 0, _t = K.data("id");
|
|
3604
|
-
return z.forEach(function(Tt) {
|
|
3605
|
-
_t in Tt && (mt = { x: Tt[_t].getRect().getCenterX(), y: Tt[_t].getRect().getCenterY() }, ht = Tt[_t]);
|
|
3606
|
-
}), w.nodeDimensionsIncludeLabels && (ht.labelWidth && (ht.labelPosHorizontal == "left" ? mt.x += ht.labelWidth / 2 : ht.labelPosHorizontal == "right" && (mt.x -= ht.labelWidth / 2)), ht.labelHeight && (ht.labelPosVertical == "top" ? mt.y += ht.labelHeight / 2 : ht.labelPosVertical == "bottom" && (mt.y -= ht.labelHeight / 2))), mt == null && (mt = { x: K.position("x"), y: K.position("y") }), {
|
|
3607
|
-
x: mt.x,
|
|
3608
|
-
y: mt.y
|
|
3609
|
-
};
|
|
3610
|
-
} else {
|
|
3611
|
-
var Lt = void 0;
|
|
3612
|
-
return H.forEach(function(Tt) {
|
|
3613
|
-
var wt = Tt.nodeIndexes.get(K.id());
|
|
3614
|
-
wt != null && (Lt = { x: Tt.xCoords[wt], y: Tt.yCoords[wt] });
|
|
3615
|
-
}), Lt == null && (Lt = { x: K.position("x"), y: K.position("y") }), {
|
|
3616
|
-
x: Lt.x,
|
|
3617
|
-
y: Lt.y
|
|
3618
|
-
};
|
|
3619
|
-
}
|
|
3620
|
-
};
|
|
3621
|
-
if (w.quality == "default" || w.quality == "proof" || w.randomize) {
|
|
3622
|
-
var $ = t.calcParentsWithoutChildren(Y, F), Dt = F.filter(function(K) {
|
|
3623
|
-
return K.css("display") == "none";
|
|
3624
|
-
});
|
|
3625
|
-
w.eles = F.not(Dt), F.nodes().not(":parent").not(Dt).layoutPositions(I, w, vt), $.length > 0 && $.forEach(function(K) {
|
|
3626
|
-
K.position(vt(K));
|
|
3627
|
-
});
|
|
3628
|
-
} else
|
|
3629
|
-
console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
|
|
3630
|
-
}
|
|
3631
|
-
}]), y;
|
|
3632
|
-
}();
|
|
3633
|
-
i.exports = d;
|
|
3634
|
-
}
|
|
3635
|
-
),
|
|
3636
|
-
/***/
|
|
3637
|
-
657: (
|
|
3638
|
-
/***/
|
|
3639
|
-
(i, r, e) => {
|
|
3640
|
-
var l = e(548), n = e(140).layoutBase.Matrix, v = e(140).layoutBase.SVD, t = function(s) {
|
|
3641
|
-
var h = s.cy, u = s.eles, c = u.nodes(), N = u.nodes(":parent"), d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), w = [], Y = [], F = [], H = [], z = [], q = [], x = [], it = [], o = void 0, E = 1e8, f = 1e-9, p = s.piTol, m = s.samplingType, O = s.nodeSeparation, L = void 0, C = function() {
|
|
3642
|
-
for (var dt = 0, M = 0, R = !1; M < L; ) {
|
|
3643
|
-
dt = Math.floor(Math.random() * o), R = !1;
|
|
3644
|
-
for (var W = 0; W < M; W++)
|
|
3645
|
-
if (H[W] == dt) {
|
|
3646
|
-
R = !0;
|
|
3647
|
-
break;
|
|
3648
|
-
}
|
|
3649
|
-
if (!R)
|
|
3650
|
-
H[M] = dt, M++;
|
|
3651
|
-
else
|
|
3652
|
-
continue;
|
|
3653
|
-
}
|
|
3654
|
-
}, P = function(dt, M, R) {
|
|
3655
|
-
for (var W = [], J = 0, Z = 0, pt = 0, lt = void 0, tt = [], gt = 0, rt = 1, Nt = 0; Nt < o; Nt++)
|
|
3656
|
-
tt[Nt] = E;
|
|
3657
|
-
for (W[Z] = dt, tt[dt] = 0; Z >= J; ) {
|
|
3658
|
-
pt = W[J++];
|
|
3659
|
-
for (var yt = w[pt], Ct = 0; Ct < yt.length; Ct++)
|
|
3660
|
-
lt = y.get(yt[Ct]), tt[lt] == E && (tt[lt] = tt[pt] + 1, W[++Z] = lt);
|
|
3661
|
-
q[pt][M] = tt[pt] * O;
|
|
3662
|
-
}
|
|
3663
|
-
if (R) {
|
|
3664
|
-
for (var ct = 0; ct < o; ct++)
|
|
3665
|
-
q[ct][M] < z[ct] && (z[ct] = q[ct][M]);
|
|
3666
|
-
for (var at = 0; at < o; at++)
|
|
3667
|
-
z[at] > gt && (gt = z[at], rt = at);
|
|
3668
|
-
}
|
|
3669
|
-
return rt;
|
|
3670
|
-
}, S = function(dt) {
|
|
3671
|
-
var M = void 0;
|
|
3672
|
-
if (dt) {
|
|
3673
|
-
M = Math.floor(Math.random() * o);
|
|
3674
|
-
for (var R = 0; R < o; R++)
|
|
3675
|
-
z[R] = E;
|
|
3676
|
-
for (var W = 0; W < L; W++)
|
|
3677
|
-
H[W] = M, M = P(M, W, dt);
|
|
3678
|
-
} else {
|
|
3679
|
-
C();
|
|
3680
|
-
for (var J = 0; J < L; J++)
|
|
3681
|
-
P(H[J], J, dt);
|
|
3682
|
-
}
|
|
3683
|
-
for (var Z = 0; Z < o; Z++)
|
|
3684
|
-
for (var pt = 0; pt < L; pt++)
|
|
3685
|
-
q[Z][pt] *= q[Z][pt];
|
|
3686
|
-
for (var lt = 0; lt < L; lt++)
|
|
3687
|
-
x[lt] = [];
|
|
3688
|
-
for (var tt = 0; tt < L; tt++)
|
|
3689
|
-
for (var gt = 0; gt < L; gt++)
|
|
3690
|
-
x[tt][gt] = q[H[gt]][tt];
|
|
3691
|
-
}, B = function() {
|
|
3692
|
-
for (var dt = v.svd(x), M = dt.S, R = dt.U, W = dt.V, J = M[0] * M[0] * M[0], Z = [], pt = 0; pt < L; pt++) {
|
|
3693
|
-
Z[pt] = [];
|
|
3694
|
-
for (var lt = 0; lt < L; lt++)
|
|
3695
|
-
Z[pt][lt] = 0, pt == lt && (Z[pt][lt] = M[pt] / (M[pt] * M[pt] + J / (M[pt] * M[pt])));
|
|
3696
|
-
}
|
|
3697
|
-
it = n.multMat(n.multMat(W, Z), n.transpose(R));
|
|
3698
|
-
}, V = function() {
|
|
3699
|
-
for (var dt = void 0, M = void 0, R = [], W = [], J = [], Z = [], pt = 0; pt < o; pt++)
|
|
3700
|
-
R[pt] = Math.random(), W[pt] = Math.random();
|
|
3701
|
-
R = n.normalize(R), W = n.normalize(W);
|
|
3702
|
-
for (var lt = f, tt = f, gt = void 0; ; ) {
|
|
3703
|
-
for (var rt = 0; rt < o; rt++)
|
|
3704
|
-
J[rt] = R[rt];
|
|
3705
|
-
if (R = n.multGamma(n.multL(n.multGamma(J), q, it)), dt = n.dotProduct(J, R), R = n.normalize(R), lt = n.dotProduct(J, R), gt = Math.abs(lt / tt), gt <= 1 + p && gt >= 1)
|
|
3706
|
-
break;
|
|
3707
|
-
tt = lt;
|
|
3708
|
-
}
|
|
3709
|
-
for (var Nt = 0; Nt < o; Nt++)
|
|
3710
|
-
J[Nt] = R[Nt];
|
|
3711
|
-
for (tt = f; ; ) {
|
|
3712
|
-
for (var yt = 0; yt < o; yt++)
|
|
3713
|
-
Z[yt] = W[yt];
|
|
3714
|
-
if (Z = n.minusOp(Z, n.multCons(J, n.dotProduct(J, Z))), W = n.multGamma(n.multL(n.multGamma(Z), q, it)), M = n.dotProduct(Z, W), W = n.normalize(W), lt = n.dotProduct(Z, W), gt = Math.abs(lt / tt), gt <= 1 + p && gt >= 1)
|
|
3715
|
-
break;
|
|
3716
|
-
tt = lt;
|
|
3717
|
-
}
|
|
3718
|
-
for (var Ct = 0; Ct < o; Ct++)
|
|
3719
|
-
Z[Ct] = W[Ct];
|
|
3720
|
-
Y = n.multCons(J, Math.sqrt(Math.abs(dt))), F = n.multCons(Z, Math.sqrt(Math.abs(M)));
|
|
3721
|
-
};
|
|
3722
|
-
l.connectComponents(h, u, l.getTopMostNodes(c), d), N.forEach(function(dt) {
|
|
3723
|
-
l.connectComponents(h, u, l.getTopMostNodes(dt.descendants().intersection(u)), d);
|
|
3724
|
-
});
|
|
3725
|
-
for (var X = 0, Q = 0; Q < c.length; Q++)
|
|
3726
|
-
c[Q].isParent() || y.set(c[Q].id(), X++);
|
|
3727
|
-
var G = !0, D = !1, b = void 0;
|
|
3728
|
-
try {
|
|
3729
|
-
for (var j = d.keys()[Symbol.iterator](), et; !(G = (et = j.next()).done); G = !0) {
|
|
3730
|
-
var vt = et.value;
|
|
3731
|
-
y.set(vt, X++);
|
|
3732
|
-
}
|
|
3733
|
-
} catch (dt) {
|
|
3734
|
-
D = !0, b = dt;
|
|
3735
|
-
} finally {
|
|
3736
|
-
try {
|
|
3737
|
-
!G && j.return && j.return();
|
|
3738
|
-
} finally {
|
|
3739
|
-
if (D)
|
|
3740
|
-
throw b;
|
|
3741
|
-
}
|
|
3742
|
-
}
|
|
3743
|
-
for (var $ = 0; $ < y.size; $++)
|
|
3744
|
-
w[$] = [];
|
|
3745
|
-
N.forEach(function(dt) {
|
|
3746
|
-
for (var M = dt.children().intersection(u); M.nodes(":childless").length == 0; )
|
|
3747
|
-
M = M.nodes()[0].children().intersection(u);
|
|
3748
|
-
var R = 0, W = M.nodes(":childless")[0].connectedEdges().length;
|
|
3749
|
-
M.nodes(":childless").forEach(function(J, Z) {
|
|
3750
|
-
J.connectedEdges().length < W && (W = J.connectedEdges().length, R = Z);
|
|
3751
|
-
}), I.set(dt.id(), M.nodes(":childless")[R].id());
|
|
3752
|
-
}), c.forEach(function(dt) {
|
|
3753
|
-
var M = void 0;
|
|
3754
|
-
dt.isParent() ? M = y.get(I.get(dt.id())) : M = y.get(dt.id()), dt.neighborhood().nodes().forEach(function(R) {
|
|
3755
|
-
u.intersection(dt.edgesWith(R)).length > 0 && (R.isParent() ? w[M].push(I.get(R.id())) : w[M].push(R.id()));
|
|
3756
|
-
});
|
|
3757
|
-
});
|
|
3758
|
-
var Dt = function(dt) {
|
|
3759
|
-
var M = y.get(dt), R = void 0;
|
|
3760
|
-
d.get(dt).forEach(function(W) {
|
|
3761
|
-
h.getElementById(W).isParent() ? R = I.get(W) : R = W, w[M].push(R), w[y.get(R)].push(dt);
|
|
3762
|
-
});
|
|
3763
|
-
}, K = !0, nt = !1, mt = void 0;
|
|
3764
|
-
try {
|
|
3765
|
-
for (var ht = d.keys()[Symbol.iterator](), _t; !(K = (_t = ht.next()).done); K = !0) {
|
|
3766
|
-
var Lt = _t.value;
|
|
3767
|
-
Dt(Lt);
|
|
3768
|
-
}
|
|
3769
|
-
} catch (dt) {
|
|
3770
|
-
nt = !0, mt = dt;
|
|
3771
|
-
} finally {
|
|
3772
|
-
try {
|
|
3773
|
-
!K && ht.return && ht.return();
|
|
3774
|
-
} finally {
|
|
3775
|
-
if (nt)
|
|
3776
|
-
throw mt;
|
|
3777
|
-
}
|
|
3778
|
-
}
|
|
3779
|
-
o = y.size;
|
|
3780
|
-
var Tt = void 0;
|
|
3781
|
-
if (o > 2) {
|
|
3782
|
-
L = o < s.sampleSize ? o : s.sampleSize;
|
|
3783
|
-
for (var wt = 0; wt < o; wt++)
|
|
3784
|
-
q[wt] = [];
|
|
3785
|
-
for (var zt = 0; zt < L; zt++)
|
|
3786
|
-
it[zt] = [];
|
|
3787
|
-
return s.quality == "draft" || s.step == "all" ? (S(m), B(), V(), Tt = { nodeIndexes: y, xCoords: Y, yCoords: F }) : (y.forEach(function(dt, M) {
|
|
3788
|
-
Y.push(h.getElementById(M).position("x")), F.push(h.getElementById(M).position("y"));
|
|
3789
|
-
}), Tt = { nodeIndexes: y, xCoords: Y, yCoords: F }), Tt;
|
|
3790
|
-
} else {
|
|
3791
|
-
var bt = y.keys(), Gt = h.getElementById(bt.next().value), St = Gt.position(), Bt = Gt.outerWidth();
|
|
3792
|
-
if (Y.push(St.x), F.push(St.y), o == 2) {
|
|
3793
|
-
var Ft = h.getElementById(bt.next().value), $t = Ft.outerWidth();
|
|
3794
|
-
Y.push(St.x + Bt / 2 + $t / 2 + s.idealEdgeLength), F.push(St.y);
|
|
3795
|
-
}
|
|
3796
|
-
return Tt = { nodeIndexes: y, xCoords: Y, yCoords: F }, Tt;
|
|
3797
|
-
}
|
|
3798
|
-
};
|
|
3799
|
-
i.exports = { spectralLayout: t };
|
|
3800
|
-
}
|
|
3801
|
-
),
|
|
3802
|
-
/***/
|
|
3803
|
-
579: (
|
|
3804
|
-
/***/
|
|
3805
|
-
(i, r, e) => {
|
|
3806
|
-
var l = e(212), n = function(v) {
|
|
3807
|
-
v && v("layout", "fcose", l);
|
|
3808
|
-
};
|
|
3809
|
-
typeof cytoscape < "u" && n(cytoscape), i.exports = n;
|
|
3810
|
-
}
|
|
3811
|
-
),
|
|
3812
|
-
/***/
|
|
3813
|
-
140: (
|
|
3814
|
-
/***/
|
|
3815
|
-
(i) => {
|
|
3816
|
-
i.exports = _;
|
|
3817
|
-
}
|
|
3818
|
-
)
|
|
3819
|
-
/******/
|
|
3820
|
-
}, T = {};
|
|
3821
|
-
function g(i) {
|
|
3822
|
-
var r = T[i];
|
|
3823
|
-
if (r !== void 0)
|
|
3824
|
-
return r.exports;
|
|
3825
|
-
var e = T[i] = {
|
|
3826
|
-
/******/
|
|
3827
|
-
// no module.id needed
|
|
3828
|
-
/******/
|
|
3829
|
-
// no module.loaded needed
|
|
3830
|
-
/******/
|
|
3831
|
-
exports: {}
|
|
3832
|
-
/******/
|
|
3833
|
-
};
|
|
3834
|
-
return k[i](e, e.exports, g), e.exports;
|
|
3835
|
-
}
|
|
3836
|
-
var a = g(579);
|
|
3837
|
-
return a;
|
|
3838
|
-
})()
|
|
3839
|
-
);
|
|
3840
|
-
});
|
|
3841
|
-
}(pe)), pe.exports;
|
|
3842
|
-
}
|
|
3843
|
-
var pr = fr();
|
|
3844
|
-
const vr = /* @__PURE__ */ or(pr);
|
|
3845
|
-
var Ce = {
|
|
3846
|
-
L: "left",
|
|
3847
|
-
R: "right",
|
|
3848
|
-
T: "top",
|
|
3849
|
-
B: "bottom"
|
|
3850
|
-
}, De = {
|
|
3851
|
-
L: /* @__PURE__ */ ot((A) => `${A},${A / 2} 0,${A} 0,0`, "L"),
|
|
3852
|
-
R: /* @__PURE__ */ ot((A) => `0,${A / 2} ${A},0 ${A},${A}`, "R"),
|
|
3853
|
-
T: /* @__PURE__ */ ot((A) => `0,0 ${A},0 ${A / 2},${A}`, "T"),
|
|
3854
|
-
B: /* @__PURE__ */ ot((A) => `${A / 2},0 ${A},${A} 0,${A}`, "B")
|
|
3855
|
-
}, ae = {
|
|
3856
|
-
L: /* @__PURE__ */ ot((A, U) => A - U + 2, "L"),
|
|
3857
|
-
R: /* @__PURE__ */ ot((A, U) => A - 2, "R"),
|
|
3858
|
-
T: /* @__PURE__ */ ot((A, U) => A - U + 2, "T"),
|
|
3859
|
-
B: /* @__PURE__ */ ot((A, U) => A - 2, "B")
|
|
3860
|
-
}, mr = /* @__PURE__ */ ot(function(A) {
|
|
3861
|
-
return Vt(A) ? A === "L" ? "R" : "L" : A === "T" ? "B" : "T";
|
|
3862
|
-
}, "getOppositeArchitectureDirection"), Oe = /* @__PURE__ */ ot(function(A) {
|
|
3863
|
-
const U = A;
|
|
3864
|
-
return U === "L" || U === "R" || U === "T" || U === "B";
|
|
3865
|
-
}, "isArchitectureDirection"), Vt = /* @__PURE__ */ ot(function(A) {
|
|
3866
|
-
const U = A;
|
|
3867
|
-
return U === "L" || U === "R";
|
|
3868
|
-
}, "isArchitectureDirectionX"), jt = /* @__PURE__ */ ot(function(A) {
|
|
3869
|
-
const U = A;
|
|
3870
|
-
return U === "T" || U === "B";
|
|
3871
|
-
}, "isArchitectureDirectionY"), Ge = /* @__PURE__ */ ot(function(A, U) {
|
|
3872
|
-
const _ = Vt(A) && jt(U), k = jt(A) && Vt(U);
|
|
3873
|
-
return _ || k;
|
|
3874
|
-
}, "isArchitectureDirectionXY"), yr = /* @__PURE__ */ ot(function(A) {
|
|
3875
|
-
const U = A[0], _ = A[1], k = Vt(U) && jt(_), T = jt(U) && Vt(_);
|
|
3876
|
-
return k || T;
|
|
3877
|
-
}, "isArchitecturePairXY"), Er = /* @__PURE__ */ ot(function(A) {
|
|
3878
|
-
return A !== "LL" && A !== "RR" && A !== "TT" && A !== "BB";
|
|
3879
|
-
}, "isValidArchitectureDirectionPair"), ye = /* @__PURE__ */ ot(function(A, U) {
|
|
3880
|
-
const _ = `${A}${U}`;
|
|
3881
|
-
return Er(_) ? _ : void 0;
|
|
3882
|
-
}, "getArchitectureDirectionPair"), Nr = /* @__PURE__ */ ot(function([A, U], _) {
|
|
3883
|
-
const k = _[0], T = _[1];
|
|
3884
|
-
return Vt(k) ? jt(T) ? [A + (k === "L" ? -1 : 1), U + (T === "T" ? 1 : -1)] : [A + (k === "L" ? -1 : 1), U] : Vt(T) ? [A + (T === "L" ? 1 : -1), U + (k === "T" ? 1 : -1)] : [A, U + (k === "T" ? 1 : -1)];
|
|
3885
|
-
}, "shiftPositionByArchitectureDirectionPair"), Tr = /* @__PURE__ */ ot(function(A) {
|
|
3886
|
-
return A === "LT" || A === "TL" ? [1, 1] : A === "BL" || A === "LB" ? [1, -1] : A === "BR" || A === "RB" ? [-1, -1] : [-1, 1];
|
|
3887
|
-
}, "getArchitectureDirectionXYFactors"), Ar = /* @__PURE__ */ ot(function(A) {
|
|
3888
|
-
return A.type === "service";
|
|
3889
|
-
}, "isArchitectureService"), wr = /* @__PURE__ */ ot(function(A) {
|
|
3890
|
-
return A.type === "junction";
|
|
3891
|
-
}, "isArchitectureJunction"), Fe = /* @__PURE__ */ ot((A) => A.data(), "edgeData"), re = /* @__PURE__ */ ot((A) => A.data(), "nodeData"), Pe = rr.architecture, Et = new sr(() => ({
|
|
3892
|
-
nodes: {},
|
|
3893
|
-
groups: {},
|
|
3894
|
-
edges: [],
|
|
3895
|
-
registeredIds: {},
|
|
3896
|
-
config: Pe,
|
|
3897
|
-
dataStructures: void 0,
|
|
3898
|
-
elements: {}
|
|
3899
|
-
})), Ir = /* @__PURE__ */ ot(() => {
|
|
3900
|
-
Et.reset(), tr();
|
|
3901
|
-
}, "clear"), Mr = /* @__PURE__ */ ot(function({
|
|
3902
|
-
id: A,
|
|
3903
|
-
icon: U,
|
|
3904
|
-
in: _,
|
|
3905
|
-
title: k,
|
|
3906
|
-
iconText: T
|
|
3907
|
-
}) {
|
|
3908
|
-
if (Et.records.registeredIds[A] !== void 0)
|
|
3909
|
-
throw new Error(
|
|
3910
|
-
`The service id [${A}] is already in use by another ${Et.records.registeredIds[A]}`
|
|
3911
|
-
);
|
|
3912
|
-
if (_ !== void 0) {
|
|
3913
|
-
if (A === _)
|
|
3914
|
-
throw new Error(`The service [${A}] cannot be placed within itself`);
|
|
3915
|
-
if (Et.records.registeredIds[_] === void 0)
|
|
3916
|
-
throw new Error(
|
|
3917
|
-
`The service [${A}]'s parent does not exist. Please make sure the parent is created before this service`
|
|
3918
|
-
);
|
|
3919
|
-
if (Et.records.registeredIds[_] === "node")
|
|
3920
|
-
throw new Error(`The service [${A}]'s parent is not a group`);
|
|
3921
|
-
}
|
|
3922
|
-
Et.records.registeredIds[A] = "node", Et.records.nodes[A] = {
|
|
3923
|
-
id: A,
|
|
3924
|
-
type: "service",
|
|
3925
|
-
icon: U,
|
|
3926
|
-
iconText: T,
|
|
3927
|
-
title: k,
|
|
3928
|
-
edges: [],
|
|
3929
|
-
in: _
|
|
3930
|
-
};
|
|
3931
|
-
}, "addService"), _r = /* @__PURE__ */ ot(() => Object.values(Et.records.nodes).filter(Ar), "getServices"), Lr = /* @__PURE__ */ ot(function({ id: A, in: U }) {
|
|
3932
|
-
Et.records.registeredIds[A] = "node", Et.records.nodes[A] = {
|
|
3933
|
-
id: A,
|
|
3934
|
-
type: "junction",
|
|
3935
|
-
edges: [],
|
|
3936
|
-
in: U
|
|
3937
|
-
};
|
|
3938
|
-
}, "addJunction"), xr = /* @__PURE__ */ ot(() => Object.values(Et.records.nodes).filter(wr), "getJunctions"), Cr = /* @__PURE__ */ ot(() => Object.values(Et.records.nodes), "getNodes"), Dr = /* @__PURE__ */ ot((A) => Et.records.nodes[A], "getNode"), Or = /* @__PURE__ */ ot(function({ id: A, icon: U, in: _, title: k }) {
|
|
3939
|
-
if (Et.records.registeredIds[A] !== void 0)
|
|
3940
|
-
throw new Error(
|
|
3941
|
-
`The group id [${A}] is already in use by another ${Et.records.registeredIds[A]}`
|
|
3942
|
-
);
|
|
3943
|
-
if (_ !== void 0) {
|
|
3944
|
-
if (A === _)
|
|
3945
|
-
throw new Error(`The group [${A}] cannot be placed within itself`);
|
|
3946
|
-
if (Et.records.registeredIds[_] === void 0)
|
|
3947
|
-
throw new Error(
|
|
3948
|
-
`The group [${A}]'s parent does not exist. Please make sure the parent is created before this group`
|
|
3949
|
-
);
|
|
3950
|
-
if (Et.records.registeredIds[_] === "node")
|
|
3951
|
-
throw new Error(`The group [${A}]'s parent is not a group`);
|
|
3952
|
-
}
|
|
3953
|
-
Et.records.registeredIds[A] = "group", Et.records.groups[A] = {
|
|
3954
|
-
id: A,
|
|
3955
|
-
icon: U,
|
|
3956
|
-
title: k,
|
|
3957
|
-
in: _
|
|
3958
|
-
};
|
|
3959
|
-
}, "addGroup"), Rr = /* @__PURE__ */ ot(() => Object.values(Et.records.groups), "getGroups"), br = /* @__PURE__ */ ot(function({
|
|
3960
|
-
lhsId: A,
|
|
3961
|
-
rhsId: U,
|
|
3962
|
-
lhsDir: _,
|
|
3963
|
-
rhsDir: k,
|
|
3964
|
-
lhsInto: T,
|
|
3965
|
-
rhsInto: g,
|
|
3966
|
-
lhsGroup: a,
|
|
3967
|
-
rhsGroup: i,
|
|
3968
|
-
title: r
|
|
3969
|
-
}) {
|
|
3970
|
-
if (!Oe(_))
|
|
3971
|
-
throw new Error(
|
|
3972
|
-
`Invalid direction given for left hand side of edge ${A}--${U}. Expected (L,R,T,B) got ${_}`
|
|
3973
|
-
);
|
|
3974
|
-
if (!Oe(k))
|
|
3975
|
-
throw new Error(
|
|
3976
|
-
`Invalid direction given for right hand side of edge ${A}--${U}. Expected (L,R,T,B) got ${k}`
|
|
3977
|
-
);
|
|
3978
|
-
if (Et.records.nodes[A] === void 0 && Et.records.groups[A] === void 0)
|
|
3979
|
-
throw new Error(
|
|
3980
|
-
`The left-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`
|
|
3981
|
-
);
|
|
3982
|
-
if (Et.records.nodes[U] === void 0 && Et.records.groups[A] === void 0)
|
|
3983
|
-
throw new Error(
|
|
3984
|
-
`The right-hand id [${U}] does not yet exist. Please create the service/group before declaring an edge to it.`
|
|
3985
|
-
);
|
|
3986
|
-
const e = Et.records.nodes[A].in, l = Et.records.nodes[U].in;
|
|
3987
|
-
if (a && e && l && e == l)
|
|
3988
|
-
throw new Error(
|
|
3989
|
-
`The left-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
|
|
3990
|
-
);
|
|
3991
|
-
if (i && e && l && e == l)
|
|
3992
|
-
throw new Error(
|
|
3993
|
-
`The right-hand id [${U}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
|
|
3994
|
-
);
|
|
3995
|
-
const n = {
|
|
3996
|
-
lhsId: A,
|
|
3997
|
-
lhsDir: _,
|
|
3998
|
-
lhsInto: T,
|
|
3999
|
-
lhsGroup: a,
|
|
4000
|
-
rhsId: U,
|
|
4001
|
-
rhsDir: k,
|
|
4002
|
-
rhsInto: g,
|
|
4003
|
-
rhsGroup: i,
|
|
4004
|
-
title: r
|
|
4005
|
-
};
|
|
4006
|
-
Et.records.edges.push(n), Et.records.nodes[A] && Et.records.nodes[U] && (Et.records.nodes[A].edges.push(Et.records.edges[Et.records.edges.length - 1]), Et.records.nodes[U].edges.push(Et.records.edges[Et.records.edges.length - 1]));
|
|
4007
|
-
}, "addEdge"), Gr = /* @__PURE__ */ ot(() => Et.records.edges, "getEdges"), Fr = /* @__PURE__ */ ot(() => {
|
|
4008
|
-
if (Et.records.dataStructures === void 0) {
|
|
4009
|
-
const A = Object.entries(Et.records.nodes).reduce((a, [i, r]) => (a[i] = r.edges.reduce((e, l) => {
|
|
4010
|
-
if (l.lhsId === i) {
|
|
4011
|
-
const n = ye(l.lhsDir, l.rhsDir);
|
|
4012
|
-
n && (e[n] = l.rhsId);
|
|
4013
|
-
} else {
|
|
4014
|
-
const n = ye(l.rhsDir, l.lhsDir);
|
|
4015
|
-
n && (e[n] = l.lhsId);
|
|
4016
|
-
}
|
|
4017
|
-
return e;
|
|
4018
|
-
}, {}), a), {}), U = Object.keys(A)[0], _ = { [U]: 1 }, k = Object.keys(A).reduce(
|
|
4019
|
-
(a, i) => i === U ? a : { ...a, [i]: 1 },
|
|
4020
|
-
{}
|
|
4021
|
-
), T = /* @__PURE__ */ ot((a) => {
|
|
4022
|
-
const i = { [a]: [0, 0] }, r = [a];
|
|
4023
|
-
for (; r.length > 0; ) {
|
|
4024
|
-
const e = r.shift();
|
|
4025
|
-
if (e) {
|
|
4026
|
-
_[e] = 1, delete k[e];
|
|
4027
|
-
const l = A[e], [n, v] = i[e];
|
|
4028
|
-
Object.entries(l).forEach(([t, s]) => {
|
|
4029
|
-
_[s] || (i[s] = Nr(
|
|
4030
|
-
[n, v],
|
|
4031
|
-
t
|
|
4032
|
-
), r.push(s));
|
|
4033
|
-
});
|
|
4034
|
-
}
|
|
4035
|
-
}
|
|
4036
|
-
return i;
|
|
4037
|
-
}, "BFS"), g = [T(U)];
|
|
4038
|
-
for (; Object.keys(k).length > 0; )
|
|
4039
|
-
g.push(T(Object.keys(k)[0]));
|
|
4040
|
-
Et.records.dataStructures = {
|
|
4041
|
-
adjList: A,
|
|
4042
|
-
spatialMaps: g
|
|
4043
|
-
};
|
|
4044
|
-
}
|
|
4045
|
-
return Et.records.dataStructures;
|
|
4046
|
-
}, "getDataStructures"), Pr = /* @__PURE__ */ ot((A, U) => {
|
|
4047
|
-
Et.records.elements[A] = U;
|
|
4048
|
-
}, "setElementForId"), Sr = /* @__PURE__ */ ot((A) => Et.records.elements[A], "getElementById"), se = {
|
|
4049
|
-
clear: Ir,
|
|
4050
|
-
setDiagramTitle: Ze,
|
|
4051
|
-
getDiagramTitle: Qe,
|
|
4052
|
-
setAccTitle: qe,
|
|
4053
|
-
getAccTitle: je,
|
|
4054
|
-
setAccDescription: $e,
|
|
4055
|
-
getAccDescription: We,
|
|
4056
|
-
addService: Mr,
|
|
4057
|
-
getServices: _r,
|
|
4058
|
-
addJunction: Lr,
|
|
4059
|
-
getJunctions: xr,
|
|
4060
|
-
getNodes: Cr,
|
|
4061
|
-
getNode: Dr,
|
|
4062
|
-
addGroup: Or,
|
|
4063
|
-
getGroups: Rr,
|
|
4064
|
-
addEdge: br,
|
|
4065
|
-
getEdges: Gr,
|
|
4066
|
-
setElementForId: Pr,
|
|
4067
|
-
getElementById: Sr,
|
|
4068
|
-
getDataStructures: Fr
|
|
4069
|
-
};
|
|
4070
|
-
function Pt(A) {
|
|
4071
|
-
const U = he().architecture;
|
|
4072
|
-
return U != null && U[A] ? U[A] : Pe[A];
|
|
4073
|
-
}
|
|
4074
|
-
ot(Pt, "getConfigField");
|
|
4075
|
-
var Yr = /* @__PURE__ */ ot((A, U) => {
|
|
4076
|
-
ar(A, U), A.groups.map(U.addGroup), A.services.map((_) => U.addService({ ..._, type: "service" })), A.junctions.map((_) => U.addJunction({ ..._, type: "junction" })), A.edges.map(U.addEdge);
|
|
4077
|
-
}, "populateDb"), kr = {
|
|
4078
|
-
parse: /* @__PURE__ */ ot(async (A) => {
|
|
4079
|
-
const U = await hr("architecture", A);
|
|
4080
|
-
Re.debug(U), Yr(U, se);
|
|
4081
|
-
}, "parse")
|
|
4082
|
-
}, Hr = /* @__PURE__ */ ot((A) => `
|
|
4083
|
-
.edge {
|
|
4084
|
-
stroke-width: ${A.archEdgeWidth};
|
|
4085
|
-
stroke: ${A.archEdgeColor};
|
|
4086
|
-
fill: none;
|
|
4087
|
-
}
|
|
4088
|
-
|
|
4089
|
-
.arrow {
|
|
4090
|
-
fill: ${A.archEdgeArrowColor};
|
|
4091
|
-
}
|
|
4092
|
-
|
|
4093
|
-
.node-bkg {
|
|
4094
|
-
fill: none;
|
|
4095
|
-
stroke: ${A.archGroupBorderColor};
|
|
4096
|
-
stroke-width: ${A.archGroupBorderWidth};
|
|
4097
|
-
stroke-dasharray: 8;
|
|
4098
|
-
}
|
|
4099
|
-
.node-icon-text {
|
|
4100
|
-
display: flex;
|
|
4101
|
-
align-items: center;
|
|
4102
|
-
}
|
|
4103
|
-
|
|
4104
|
-
.node-icon-text > div {
|
|
4105
|
-
color: #fff;
|
|
4106
|
-
margin: 1px;
|
|
4107
|
-
height: fit-content;
|
|
4108
|
-
text-align: center;
|
|
4109
|
-
overflow: hidden;
|
|
4110
|
-
display: -webkit-box;
|
|
4111
|
-
-webkit-box-orient: vertical;
|
|
4112
|
-
}
|
|
4113
|
-
`, "getStyles"), Ur = Hr, ee = /* @__PURE__ */ ot((A) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${A}</g>`, "wrapIcon"), ne = {
|
|
4114
|
-
prefix: "mermaid-architecture",
|
|
4115
|
-
height: 80,
|
|
4116
|
-
width: 80,
|
|
4117
|
-
icons: {
|
|
4118
|
-
database: {
|
|
4119
|
-
body: ee(
|
|
4120
|
-
'<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
|
|
4121
|
-
)
|
|
4122
|
-
},
|
|
4123
|
-
server: {
|
|
4124
|
-
body: ee(
|
|
4125
|
-
'<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>'
|
|
4126
|
-
)
|
|
4127
|
-
},
|
|
4128
|
-
disk: {
|
|
4129
|
-
body: ee(
|
|
4130
|
-
'<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>'
|
|
4131
|
-
)
|
|
4132
|
-
},
|
|
4133
|
-
internet: {
|
|
4134
|
-
body: ee(
|
|
4135
|
-
'<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
|
|
4136
|
-
)
|
|
4137
|
-
},
|
|
4138
|
-
cloud: {
|
|
4139
|
-
body: ee(
|
|
4140
|
-
'<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
|
|
4141
|
-
)
|
|
4142
|
-
},
|
|
4143
|
-
unknown: nr,
|
|
4144
|
-
blank: {
|
|
4145
|
-
body: ee("")
|
|
4146
|
-
}
|
|
4147
|
-
}
|
|
4148
|
-
}, Xr = /* @__PURE__ */ ot(async function(A, U) {
|
|
4149
|
-
const _ = Pt("padding"), k = Pt("iconSize"), T = k / 2, g = k / 6, a = g / 2;
|
|
4150
|
-
await Promise.all(
|
|
4151
|
-
U.edges().map(async (i) => {
|
|
4152
|
-
var r, e;
|
|
4153
|
-
const {
|
|
4154
|
-
source: l,
|
|
4155
|
-
sourceDir: n,
|
|
4156
|
-
sourceArrow: v,
|
|
4157
|
-
sourceGroup: t,
|
|
4158
|
-
target: s,
|
|
4159
|
-
targetDir: h,
|
|
4160
|
-
targetArrow: u,
|
|
4161
|
-
targetGroup: c,
|
|
4162
|
-
label: N
|
|
4163
|
-
} = Fe(i);
|
|
4164
|
-
let { x: d, y } = i[0].sourceEndpoint();
|
|
4165
|
-
const { x: I, y: w } = i[0].midpoint();
|
|
4166
|
-
let { x: Y, y: F } = i[0].targetEndpoint();
|
|
4167
|
-
const H = _ + 4;
|
|
4168
|
-
if (t && (Vt(n) ? d += n === "L" ? -H : H : y += n === "T" ? -H : H + 18), c && (Vt(h) ? Y += h === "L" ? -H : H : F += h === "T" ? -H : H + 18), !t && ((r = se.getNode(l)) == null ? void 0 : r.type) === "junction" && (Vt(n) ? d += n === "L" ? T : -T : y += n === "T" ? T : -T), !c && ((e = se.getNode(s)) == null ? void 0 : e.type) === "junction" && (Vt(h) ? Y += h === "L" ? T : -T : F += h === "T" ? T : -T), i[0]._private.rscratch) {
|
|
4169
|
-
const z = A.insert("g");
|
|
4170
|
-
if (z.insert("path").attr("d", `M ${d},${y} L ${I},${w} L${Y},${F} `).attr("class", "edge"), v) {
|
|
4171
|
-
const q = Vt(n) ? ae[n](d, g) : d - a, x = jt(n) ? ae[n](y, g) : y - a;
|
|
4172
|
-
z.insert("polygon").attr("points", De[n](g)).attr("transform", `translate(${q},${x})`).attr("class", "arrow");
|
|
4173
|
-
}
|
|
4174
|
-
if (u) {
|
|
4175
|
-
const q = Vt(h) ? ae[h](Y, g) : Y - a, x = jt(h) ? ae[h](F, g) : F - a;
|
|
4176
|
-
z.insert("polygon").attr("points", De[h](g)).attr("transform", `translate(${q},${x})`).attr("class", "arrow");
|
|
4177
|
-
}
|
|
4178
|
-
if (N) {
|
|
4179
|
-
const q = Ge(n, h) ? "XY" : Vt(n) ? "X" : "Y";
|
|
4180
|
-
let x = 0;
|
|
4181
|
-
q === "X" ? x = Math.abs(d - Y) : q === "Y" ? x = Math.abs(y - F) / 1.5 : x = Math.abs(d - Y) / 2;
|
|
4182
|
-
const it = z.append("g");
|
|
4183
|
-
if (await Ee(
|
|
4184
|
-
it,
|
|
4185
|
-
N,
|
|
4186
|
-
{
|
|
4187
|
-
useHtmlLabels: !1,
|
|
4188
|
-
width: x,
|
|
4189
|
-
classes: "architecture-service-label"
|
|
4190
|
-
},
|
|
4191
|
-
he()
|
|
4192
|
-
), it.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), q === "X")
|
|
4193
|
-
it.attr("transform", "translate(" + I + ", " + w + ")");
|
|
4194
|
-
else if (q === "Y")
|
|
4195
|
-
it.attr("transform", "translate(" + I + ", " + w + ") rotate(-90)");
|
|
4196
|
-
else if (q === "XY") {
|
|
4197
|
-
const o = ye(n, h);
|
|
4198
|
-
if (o && yr(o)) {
|
|
4199
|
-
const E = it.node().getBoundingClientRect(), [f, p] = Tr(o);
|
|
4200
|
-
it.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * f * p * 45})`);
|
|
4201
|
-
const m = it.node().getBoundingClientRect();
|
|
4202
|
-
it.attr(
|
|
4203
|
-
"transform",
|
|
4204
|
-
`
|
|
4205
|
-
translate(${I}, ${w - E.height / 2})
|
|
4206
|
-
translate(${f * m.width / 2}, ${p * m.height / 2})
|
|
4207
|
-
rotate(${-1 * f * p * 45}, 0, ${E.height / 2})
|
|
4208
|
-
`
|
|
4209
|
-
);
|
|
4210
|
-
}
|
|
4211
|
-
}
|
|
4212
|
-
}
|
|
4213
|
-
}
|
|
4214
|
-
})
|
|
4215
|
-
);
|
|
4216
|
-
}, "drawEdges"), Vr = /* @__PURE__ */ ot(async function(A, U) {
|
|
4217
|
-
const _ = Pt("padding") * 0.75, k = Pt("fontSize"), T = Pt("iconSize") / 2;
|
|
4218
|
-
await Promise.all(
|
|
4219
|
-
U.nodes().map(async (g) => {
|
|
4220
|
-
const a = re(g);
|
|
4221
|
-
if (a.type === "group") {
|
|
4222
|
-
const { h: i, w: r, x1: e, y1: l } = g.boundingBox();
|
|
4223
|
-
A.append("rect").attr("x", e + T).attr("y", l + T).attr("width", r).attr("height", i).attr("class", "node-bkg");
|
|
4224
|
-
const n = A.append("g");
|
|
4225
|
-
let v = e, t = l;
|
|
4226
|
-
if (a.icon) {
|
|
4227
|
-
const s = n.append("g");
|
|
4228
|
-
s.html(
|
|
4229
|
-
`<g>${await fe(a.icon, { height: _, width: _, fallbackPrefix: ne.prefix })}</g>`
|
|
4230
|
-
), s.attr(
|
|
4231
|
-
"transform",
|
|
4232
|
-
"translate(" + (v + T + 1) + ", " + (t + T + 1) + ")"
|
|
4233
|
-
), v += _, t += k / 2 - 1 - 2;
|
|
4234
|
-
}
|
|
4235
|
-
if (a.label) {
|
|
4236
|
-
const s = n.append("g");
|
|
4237
|
-
await Ee(
|
|
4238
|
-
s,
|
|
4239
|
-
a.label,
|
|
4240
|
-
{
|
|
4241
|
-
useHtmlLabels: !1,
|
|
4242
|
-
width: r,
|
|
4243
|
-
classes: "architecture-service-label"
|
|
4244
|
-
},
|
|
4245
|
-
he()
|
|
4246
|
-
), s.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), s.attr(
|
|
4247
|
-
"transform",
|
|
4248
|
-
"translate(" + (v + T + 4) + ", " + (t + T + 2) + ")"
|
|
4249
|
-
);
|
|
4250
|
-
}
|
|
4251
|
-
}
|
|
4252
|
-
})
|
|
4253
|
-
);
|
|
4254
|
-
}, "drawGroups"), zr = /* @__PURE__ */ ot(async function(A, U, _) {
|
|
4255
|
-
for (const k of _) {
|
|
4256
|
-
const T = U.append("g"), g = Pt("iconSize");
|
|
4257
|
-
if (k.title) {
|
|
4258
|
-
const e = T.append("g");
|
|
4259
|
-
await Ee(
|
|
4260
|
-
e,
|
|
4261
|
-
k.title,
|
|
4262
|
-
{
|
|
4263
|
-
useHtmlLabels: !1,
|
|
4264
|
-
width: g * 1.5,
|
|
4265
|
-
classes: "architecture-service-label"
|
|
4266
|
-
},
|
|
4267
|
-
he()
|
|
4268
|
-
), e.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), e.attr("transform", "translate(" + g / 2 + ", " + g + ")");
|
|
4269
|
-
}
|
|
4270
|
-
const a = T.append("g");
|
|
4271
|
-
if (k.icon)
|
|
4272
|
-
a.html(
|
|
4273
|
-
`<g>${await fe(k.icon, { height: g, width: g, fallbackPrefix: ne.prefix })}</g>`
|
|
4274
|
-
);
|
|
4275
|
-
else if (k.iconText) {
|
|
4276
|
-
a.html(
|
|
4277
|
-
`<g>${await fe("blank", { height: g, width: g, fallbackPrefix: ne.prefix })}</g>`
|
|
4278
|
-
);
|
|
4279
|
-
const e = a.append("g").append("foreignObject").attr("width", g).attr("height", g).append("div").attr("class", "node-icon-text").attr("style", `height: ${g}px;`).append("div").html(k.iconText), l = parseInt(
|
|
4280
|
-
window.getComputedStyle(e.node(), null).getPropertyValue("font-size").replace(/\D/g, "")
|
|
4281
|
-
) ?? 16;
|
|
4282
|
-
e.attr("style", `-webkit-line-clamp: ${Math.floor((g - 2) / l)};`);
|
|
4283
|
-
} else
|
|
4284
|
-
a.append("path").attr("class", "node-bkg").attr("id", "node-" + k.id).attr(
|
|
4285
|
-
"d",
|
|
4286
|
-
`M0 ${g} v${-g} q0,-5 5,-5 h${g} q5,0 5,5 v${g} H0 Z`
|
|
4287
|
-
);
|
|
4288
|
-
T.attr("class", "architecture-service");
|
|
4289
|
-
const { width: i, height: r } = T._groups[0][0].getBBox();
|
|
4290
|
-
k.width = i, k.height = r, A.setElementForId(k.id, T);
|
|
4291
|
-
}
|
|
4292
|
-
return 0;
|
|
4293
|
-
}, "drawServices"), Br = /* @__PURE__ */ ot(function(A, U, _) {
|
|
4294
|
-
_.forEach((k) => {
|
|
4295
|
-
const T = U.append("g"), g = Pt("iconSize");
|
|
4296
|
-
T.append("g").append("rect").attr("id", "node-" + k.id).attr("fill-opacity", "0").attr("width", g).attr("height", g), T.attr("class", "architecture-junction");
|
|
4297
|
-
const { width: a, height: i } = T._groups[0][0].getBBox();
|
|
4298
|
-
T.width = a, T.height = i, A.setElementForId(k.id, T);
|
|
4299
|
-
});
|
|
4300
|
-
}, "drawJunctions");
|
|
4301
|
-
ir([
|
|
4302
|
-
{
|
|
4303
|
-
name: ne.prefix,
|
|
4304
|
-
icons: ne
|
|
4305
|
-
}
|
|
4306
|
-
]);
|
|
4307
|
-
be.use(vr);
|
|
4308
|
-
function Se(A, U) {
|
|
4309
|
-
A.forEach((_) => {
|
|
4310
|
-
U.add({
|
|
4311
|
-
group: "nodes",
|
|
4312
|
-
data: {
|
|
4313
|
-
type: "service",
|
|
4314
|
-
id: _.id,
|
|
4315
|
-
icon: _.icon,
|
|
4316
|
-
label: _.title,
|
|
4317
|
-
parent: _.in,
|
|
4318
|
-
width: Pt("iconSize"),
|
|
4319
|
-
height: Pt("iconSize")
|
|
4320
|
-
},
|
|
4321
|
-
classes: "node-service"
|
|
4322
|
-
});
|
|
4323
|
-
});
|
|
4324
|
-
}
|
|
4325
|
-
ot(Se, "addServices");
|
|
4326
|
-
function Ye(A, U) {
|
|
4327
|
-
A.forEach((_) => {
|
|
4328
|
-
U.add({
|
|
4329
|
-
group: "nodes",
|
|
4330
|
-
data: {
|
|
4331
|
-
type: "junction",
|
|
4332
|
-
id: _.id,
|
|
4333
|
-
parent: _.in,
|
|
4334
|
-
width: Pt("iconSize"),
|
|
4335
|
-
height: Pt("iconSize")
|
|
4336
|
-
},
|
|
4337
|
-
classes: "node-junction"
|
|
4338
|
-
});
|
|
4339
|
-
});
|
|
4340
|
-
}
|
|
4341
|
-
ot(Ye, "addJunctions");
|
|
4342
|
-
function ke(A, U) {
|
|
4343
|
-
U.nodes().map((_) => {
|
|
4344
|
-
const k = re(_);
|
|
4345
|
-
k.type !== "group" && (k.x = _.position().x, k.y = _.position().y, A.getElementById(k.id).attr("transform", "translate(" + (k.x || 0) + "," + (k.y || 0) + ")"));
|
|
4346
|
-
});
|
|
4347
|
-
}
|
|
4348
|
-
ot(ke, "positionNodes");
|
|
4349
|
-
function He(A, U) {
|
|
4350
|
-
A.forEach((_) => {
|
|
4351
|
-
U.add({
|
|
4352
|
-
group: "nodes",
|
|
4353
|
-
data: {
|
|
4354
|
-
type: "group",
|
|
4355
|
-
id: _.id,
|
|
4356
|
-
icon: _.icon,
|
|
4357
|
-
label: _.title,
|
|
4358
|
-
parent: _.in
|
|
4359
|
-
},
|
|
4360
|
-
classes: "node-group"
|
|
4361
|
-
});
|
|
4362
|
-
});
|
|
4363
|
-
}
|
|
4364
|
-
ot(He, "addGroups");
|
|
4365
|
-
function Ue(A, U) {
|
|
4366
|
-
A.forEach((_) => {
|
|
4367
|
-
const { lhsId: k, rhsId: T, lhsInto: g, lhsGroup: a, rhsInto: i, lhsDir: r, rhsDir: e, rhsGroup: l, title: n } = _, v = Ge(_.lhsDir, _.rhsDir) ? "segments" : "straight", t = {
|
|
4368
|
-
id: `${k}-${T}`,
|
|
4369
|
-
label: n,
|
|
4370
|
-
source: k,
|
|
4371
|
-
sourceDir: r,
|
|
4372
|
-
sourceArrow: g,
|
|
4373
|
-
sourceGroup: a,
|
|
4374
|
-
sourceEndpoint: r === "L" ? "0 50%" : r === "R" ? "100% 50%" : r === "T" ? "50% 0" : "50% 100%",
|
|
4375
|
-
target: T,
|
|
4376
|
-
targetDir: e,
|
|
4377
|
-
targetArrow: i,
|
|
4378
|
-
targetGroup: l,
|
|
4379
|
-
targetEndpoint: e === "L" ? "0 50%" : e === "R" ? "100% 50%" : e === "T" ? "50% 0" : "50% 100%"
|
|
4380
|
-
};
|
|
4381
|
-
U.add({
|
|
4382
|
-
group: "edges",
|
|
4383
|
-
data: t,
|
|
4384
|
-
classes: v
|
|
4385
|
-
});
|
|
4386
|
-
});
|
|
4387
|
-
}
|
|
4388
|
-
ot(Ue, "addEdges");
|
|
4389
|
-
function Xe(A) {
|
|
4390
|
-
const U = A.map((T) => {
|
|
4391
|
-
const g = {}, a = {};
|
|
4392
|
-
return Object.entries(T).forEach(([i, [r, e]]) => {
|
|
4393
|
-
g[e] || (g[e] = []), a[r] || (a[r] = []), g[e].push(i), a[r].push(i);
|
|
4394
|
-
}), {
|
|
4395
|
-
horiz: Object.values(g).filter((i) => i.length > 1),
|
|
4396
|
-
vert: Object.values(a).filter((i) => i.length > 1)
|
|
4397
|
-
};
|
|
4398
|
-
}), [_, k] = U.reduce(
|
|
4399
|
-
([T, g], { horiz: a, vert: i }) => [
|
|
4400
|
-
[...T, ...a],
|
|
4401
|
-
[...g, ...i]
|
|
4402
|
-
],
|
|
4403
|
-
[[], []]
|
|
4404
|
-
);
|
|
4405
|
-
return {
|
|
4406
|
-
horizontal: _,
|
|
4407
|
-
vertical: k
|
|
4408
|
-
};
|
|
4409
|
-
}
|
|
4410
|
-
ot(Xe, "getAlignments");
|
|
4411
|
-
function Ve(A) {
|
|
4412
|
-
const U = [], _ = /* @__PURE__ */ ot((T) => `${T[0]},${T[1]}`, "posToStr"), k = /* @__PURE__ */ ot((T) => T.split(",").map((g) => parseInt(g)), "strToPos");
|
|
4413
|
-
return A.forEach((T) => {
|
|
4414
|
-
const g = Object.fromEntries(
|
|
4415
|
-
Object.entries(T).map(([e, l]) => [_(l), e])
|
|
4416
|
-
), a = [_([0, 0])], i = {}, r = {
|
|
4417
|
-
L: [-1, 0],
|
|
4418
|
-
R: [1, 0],
|
|
4419
|
-
T: [0, 1],
|
|
4420
|
-
B: [0, -1]
|
|
4421
|
-
};
|
|
4422
|
-
for (; a.length > 0; ) {
|
|
4423
|
-
const e = a.shift();
|
|
4424
|
-
if (e) {
|
|
4425
|
-
i[e] = 1;
|
|
4426
|
-
const l = g[e];
|
|
4427
|
-
if (l) {
|
|
4428
|
-
const n = k(e);
|
|
4429
|
-
Object.entries(r).forEach(([v, t]) => {
|
|
4430
|
-
const s = _([n[0] + t[0], n[1] + t[1]]), h = g[s];
|
|
4431
|
-
h && !i[s] && (a.push(s), U.push({
|
|
4432
|
-
[Ce[v]]: h,
|
|
4433
|
-
[Ce[mr(v)]]: l,
|
|
4434
|
-
gap: 1.5 * Pt("iconSize")
|
|
4435
|
-
}));
|
|
4436
|
-
});
|
|
4437
|
-
}
|
|
4438
|
-
}
|
|
4439
|
-
}
|
|
4440
|
-
}), U;
|
|
4441
|
-
}
|
|
4442
|
-
ot(Ve, "getRelativeConstraints");
|
|
4443
|
-
function ze(A, U, _, k, { spatialMaps: T }) {
|
|
4444
|
-
return new Promise((g) => {
|
|
4445
|
-
const a = er("body").append("div").attr("id", "cy").attr("style", "display:none"), i = be({
|
|
4446
|
-
container: document.getElementById("cy"),
|
|
4447
|
-
style: [
|
|
4448
|
-
{
|
|
4449
|
-
selector: "edge",
|
|
4450
|
-
style: {
|
|
4451
|
-
"curve-style": "straight",
|
|
4452
|
-
label: "data(label)",
|
|
4453
|
-
"source-endpoint": "data(sourceEndpoint)",
|
|
4454
|
-
"target-endpoint": "data(targetEndpoint)"
|
|
4455
|
-
}
|
|
4456
|
-
},
|
|
4457
|
-
{
|
|
4458
|
-
selector: "edge.segments",
|
|
4459
|
-
style: {
|
|
4460
|
-
"curve-style": "segments",
|
|
4461
|
-
"segment-weights": "0",
|
|
4462
|
-
"segment-distances": [0.5],
|
|
4463
|
-
// @ts-ignore Incorrect library types
|
|
4464
|
-
"edge-distances": "endpoints",
|
|
4465
|
-
"source-endpoint": "data(sourceEndpoint)",
|
|
4466
|
-
"target-endpoint": "data(targetEndpoint)"
|
|
4467
|
-
}
|
|
4468
|
-
},
|
|
4469
|
-
{
|
|
4470
|
-
selector: "node",
|
|
4471
|
-
style: {
|
|
4472
|
-
// @ts-ignore Incorrect library types
|
|
4473
|
-
"compound-sizing-wrt-labels": "include"
|
|
4474
|
-
}
|
|
4475
|
-
},
|
|
4476
|
-
{
|
|
4477
|
-
selector: "node[label]",
|
|
4478
|
-
style: {
|
|
4479
|
-
"text-valign": "bottom",
|
|
4480
|
-
"text-halign": "center",
|
|
4481
|
-
"font-size": `${Pt("fontSize")}px`
|
|
4482
|
-
}
|
|
4483
|
-
},
|
|
4484
|
-
{
|
|
4485
|
-
selector: ".node-service",
|
|
4486
|
-
style: {
|
|
4487
|
-
label: "data(label)",
|
|
4488
|
-
width: "data(width)",
|
|
4489
|
-
height: "data(height)"
|
|
4490
|
-
}
|
|
4491
|
-
},
|
|
4492
|
-
{
|
|
4493
|
-
selector: ".node-junction",
|
|
4494
|
-
style: {
|
|
4495
|
-
width: "data(width)",
|
|
4496
|
-
height: "data(height)"
|
|
4497
|
-
}
|
|
4498
|
-
},
|
|
4499
|
-
{
|
|
4500
|
-
selector: ".node-group",
|
|
4501
|
-
style: {
|
|
4502
|
-
// @ts-ignore Incorrect library types
|
|
4503
|
-
padding: `${Pt("padding")}px`
|
|
4504
|
-
}
|
|
4505
|
-
}
|
|
4506
|
-
]
|
|
4507
|
-
});
|
|
4508
|
-
a.remove(), He(_, i), Se(A, i), Ye(U, i), Ue(k, i);
|
|
4509
|
-
const r = Xe(T), e = Ve(T), l = i.layout({
|
|
4510
|
-
name: "fcose",
|
|
4511
|
-
quality: "proof",
|
|
4512
|
-
styleEnabled: !1,
|
|
4513
|
-
animate: !1,
|
|
4514
|
-
nodeDimensionsIncludeLabels: !1,
|
|
4515
|
-
// Adjust the edge parameters if it passes through the border of a group
|
|
4516
|
-
// Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67
|
|
4517
|
-
idealEdgeLength(n) {
|
|
4518
|
-
const [v, t] = n.connectedNodes(), { parent: s } = re(v), { parent: h } = re(t);
|
|
4519
|
-
return s === h ? 1.5 * Pt("iconSize") : 0.5 * Pt("iconSize");
|
|
4520
|
-
},
|
|
4521
|
-
edgeElasticity(n) {
|
|
4522
|
-
const [v, t] = n.connectedNodes(), { parent: s } = re(v), { parent: h } = re(t);
|
|
4523
|
-
return s === h ? 0.45 : 1e-3;
|
|
4524
|
-
},
|
|
4525
|
-
alignmentConstraint: r,
|
|
4526
|
-
relativePlacementConstraint: e
|
|
4527
|
-
});
|
|
4528
|
-
l.one("layoutstop", () => {
|
|
4529
|
-
var n;
|
|
4530
|
-
function v(t, s, h, u) {
|
|
4531
|
-
let c, N;
|
|
4532
|
-
const { x: d, y } = t, { x: I, y: w } = s;
|
|
4533
|
-
N = (u - y + (d - h) * (y - w) / (d - I)) / Math.sqrt(1 + Math.pow((y - w) / (d - I), 2)), c = Math.sqrt(Math.pow(u - y, 2) + Math.pow(h - d, 2) - Math.pow(N, 2));
|
|
4534
|
-
const Y = Math.sqrt(Math.pow(I - d, 2) + Math.pow(w - y, 2));
|
|
4535
|
-
c = c / Y;
|
|
4536
|
-
let F = (I - d) * (u - y) - (w - y) * (h - d);
|
|
4537
|
-
switch (!0) {
|
|
4538
|
-
case F >= 0:
|
|
4539
|
-
F = 1;
|
|
4540
|
-
break;
|
|
4541
|
-
case F < 0:
|
|
4542
|
-
F = -1;
|
|
4543
|
-
break;
|
|
4544
|
-
}
|
|
4545
|
-
let H = (I - d) * (h - d) + (w - y) * (u - y);
|
|
4546
|
-
switch (!0) {
|
|
4547
|
-
case H >= 0:
|
|
4548
|
-
H = 1;
|
|
4549
|
-
break;
|
|
4550
|
-
case H < 0:
|
|
4551
|
-
H = -1;
|
|
4552
|
-
break;
|
|
4553
|
-
}
|
|
4554
|
-
return N = Math.abs(N) * F, c = c * H, {
|
|
4555
|
-
distances: N,
|
|
4556
|
-
weights: c
|
|
4557
|
-
};
|
|
4558
|
-
}
|
|
4559
|
-
ot(v, "getSegmentWeights"), i.startBatch();
|
|
4560
|
-
for (const t of Object.values(i.edges()))
|
|
4561
|
-
if ((n = t.data) != null && n.call(t)) {
|
|
4562
|
-
const { x: s, y: h } = t.source().position(), { x: u, y: c } = t.target().position();
|
|
4563
|
-
if (s !== u && h !== c) {
|
|
4564
|
-
const N = t.sourceEndpoint(), d = t.targetEndpoint(), { sourceDir: y } = Fe(t), [I, w] = jt(y) ? [N.x, d.y] : [d.x, N.y], { weights: Y, distances: F } = v(N, d, I, w);
|
|
4565
|
-
t.style("segment-distances", F), t.style("segment-weights", Y);
|
|
4566
|
-
}
|
|
4567
|
-
}
|
|
4568
|
-
i.endBatch(), l.run();
|
|
4569
|
-
}), l.run(), i.ready((n) => {
|
|
4570
|
-
Re.info("Ready", n), g(i);
|
|
4571
|
-
});
|
|
4572
|
-
});
|
|
4573
|
-
}
|
|
4574
|
-
ot(ze, "layoutArchitecture");
|
|
4575
|
-
var Wr = /* @__PURE__ */ ot(async (A, U, _, k) => {
|
|
4576
|
-
const T = k.db, g = T.getServices(), a = T.getJunctions(), i = T.getGroups(), r = T.getEdges(), e = T.getDataStructures(), l = Je(U), n = l.append("g");
|
|
4577
|
-
n.attr("class", "architecture-edges");
|
|
4578
|
-
const v = l.append("g");
|
|
4579
|
-
v.attr("class", "architecture-services");
|
|
4580
|
-
const t = l.append("g");
|
|
4581
|
-
t.attr("class", "architecture-groups"), await zr(T, v, g), Br(T, v, a);
|
|
4582
|
-
const s = await ze(g, a, i, r, e);
|
|
4583
|
-
await Xr(n, s), await Vr(t, s), ke(T, s), Ke(void 0, l, Pt("padding"), Pt("useMaxWidth"));
|
|
4584
|
-
}, "draw"), $r = { draw: Wr }, Kr = {
|
|
4585
|
-
parser: kr,
|
|
4586
|
-
db: se,
|
|
4587
|
-
renderer: $r,
|
|
4588
|
-
styles: Ur
|
|
4589
|
-
};
|
|
4590
|
-
export {
|
|
4591
|
-
Kr as diagram
|
|
4592
|
-
};
|