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