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