bg-editor 0.0.7 → 0.0.9

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.
Files changed (59) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/umo-editor.js +90031 -7
  3. package/package.json +21 -1
  4. package/dist/_baseUniq-CK68Es8H.js +0 -473
  5. package/dist/arc-cD-4ba7d.js +0 -84
  6. package/dist/architecture-U656AL7Q-jxTBuJdN.js +0 -6
  7. package/dist/architectureDiagram-VXUJARFQ-D3XlpFhb.js +0 -4660
  8. package/dist/blockDiagram-VD42YOAC-BslbvMOG.js +0 -2262
  9. package/dist/c4Diagram-YG6GDRKO-DD3uWYPM.js +0 -1581
  10. package/dist/channel-DjTSKqWx.js +0 -6
  11. package/dist/chunk-4BX2VUAB-lfhsh4gk.js +0 -9
  12. package/dist/chunk-55IACEB6-O42zw0MT.js +0 -9
  13. package/dist/chunk-B4BG7PRW-CAose2Ox.js +0 -1376
  14. package/dist/chunk-DI55MBZ5-DkOlwdzs.js +0 -1371
  15. package/dist/chunk-FMBD7UC4-XviEvZms.js +0 -20
  16. package/dist/chunk-QN33PNHL-CNGSzgpw.js +0 -20
  17. package/dist/chunk-QZHKN3VN-CRgLUJXR.js +0 -16
  18. package/dist/chunk-TZMSLE5B-BkHNUxTN.js +0 -65
  19. package/dist/classDiagram-2ON5EDUG-Cakz_SCw.js +0 -17
  20. package/dist/classDiagram-v2-WZHVMYZB-Cakz_SCw.js +0 -17
  21. package/dist/clone-CIrbb4_D.js +0 -9
  22. package/dist/cose-bilkent-S5V4N54A-EoSlB5N_.js +0 -2606
  23. package/dist/cytoscape.esm-DoU_GB5M.js +0 -18732
  24. package/dist/dagre-6UL2VRFP-BPH1NIvl.js +0 -444
  25. package/dist/defaultLocale-DEnRyJdC.js +0 -172
  26. package/dist/diagram-PSM6KHXK-DCRoLhFv.js +0 -396
  27. package/dist/diagram-QEK2KX5R-2gxFpsCA.js +0 -218
  28. package/dist/diagram-S2PKOQOG-BIPpN2G8.js +0 -143
  29. package/dist/erDiagram-Q2GNP2WA-pfb2dpnp.js +0 -842
  30. package/dist/flowDiagram-NV44I4VS-Dv631-Fh.js +0 -1621
  31. package/dist/ganttDiagram-LVOFAZNH-BOKYXijK.js +0 -2500
  32. package/dist/gitGraph-F6HP7TQM-CRerkbyh.js +0 -6
  33. package/dist/gitGraphDiagram-NY62KEGX-CgO9x7O1.js +0 -700
  34. package/dist/graph-CG-rVaun.js +0 -382
  35. package/dist/index-LPeu-5gp.js +0 -164788
  36. package/dist/info-NVLQJR56-CZcMDuD4.js +0 -6
  37. package/dist/infoDiagram-ER5ION4S-CpfjxDXT.js +0 -25
  38. package/dist/init-Dbt-6wo9.js +0 -17
  39. package/dist/journeyDiagram-XKPGCS4Q-D4m1xk_j.js +0 -837
  40. package/dist/kanban-definition-3W4ZIXB7-GUMW-GDO.js +0 -719
  41. package/dist/layout-C7pGfQvF.js +0 -1416
  42. package/dist/linear-CQdBpz9H.js +0 -260
  43. package/dist/mermaid-parser.core-C3Lk4un7.js +0 -14143
  44. package/dist/min-D7xNMq31.js +0 -39
  45. package/dist/mindmap-definition-VGOIOE7T-GfQh2q9s.js +0 -784
  46. package/dist/ordinal-mgyNSFm_.js +0 -62
  47. package/dist/packet-BFZMPI3H-DughJE3g.js +0 -6
  48. package/dist/pie-7BOR55EZ-B1py7mee.js +0 -6
  49. package/dist/pieDiagram-ADFJNKIX-DENmX4xL.js +0 -162
  50. package/dist/quadrantDiagram-AYHSOK5B-BFVycH-W.js +0 -1023
  51. package/dist/radar-NHE76QYJ-DuTW4rXt.js +0 -6
  52. package/dist/requirementDiagram-UZGBJVZJ-f8rb43Mp.js +0 -851
  53. package/dist/sankeyDiagram-TZEHDZUN-CUN0tZ5p.js +0 -811
  54. package/dist/sequenceDiagram-WL72ISMW-7X4nul9T.js +0 -2512
  55. package/dist/stateDiagram-FKZM4ZOC-CypL793K.js +0 -264
  56. package/dist/stateDiagram-v2-4FDKWEC3-D5vS5FM5.js +0 -17
  57. package/dist/timeline-definition-IT6M3QCI-B_WOoOGO.js +0 -798
  58. package/dist/treemap-KMMF4GRG-BzINyJBJ.js +0 -6
  59. package/dist/xychartDiagram-PRI3JC2R-Llw16NDY.js +0 -1341
@@ -1,2606 +0,0 @@
1
- import "./style.css";
2
- import { aH as $, aI as lt, _ as V, l as k, d as gt } from "./index-LPeu-5gp.js";
3
- import { c as J } from "./cytoscape.esm-DoU_GB5M.js";
4
- var tt = { exports: {} }, Z = { exports: {} }, Q = { exports: {} }, q;
5
- function ut() {
6
- return q || (q = 1, function(G, b) {
7
- (function(I, L) {
8
- G.exports = L();
9
- })($, function() {
10
- return (
11
- /******/
12
- function(N) {
13
- var I = {};
14
- function L(o) {
15
- if (I[o])
16
- return I[o].exports;
17
- var e = I[o] = {
18
- /******/
19
- i: o,
20
- /******/
21
- l: !1,
22
- /******/
23
- exports: {}
24
- /******/
25
- };
26
- return N[o].call(e.exports, e, e.exports, L), e.l = !0, e.exports;
27
- }
28
- return L.m = N, L.c = I, L.i = function(o) {
29
- return o;
30
- }, L.d = function(o, e, t) {
31
- L.o(o, e) || Object.defineProperty(o, e, {
32
- /******/
33
- configurable: !1,
34
- /******/
35
- enumerable: !0,
36
- /******/
37
- get: t
38
- /******/
39
- });
40
- }, L.n = function(o) {
41
- var e = o && o.__esModule ? (
42
- /******/
43
- function() {
44
- return o.default;
45
- }
46
- ) : (
47
- /******/
48
- function() {
49
- return o;
50
- }
51
- );
52
- return L.d(e, "a", e), e;
53
- }, L.o = function(o, e) {
54
- return Object.prototype.hasOwnProperty.call(o, e);
55
- }, L.p = "", L(L.s = 26);
56
- }([
57
- /* 0 */
58
- /***/
59
- function(N, I, L) {
60
- function o() {
61
- }
62
- o.QUALITY = 1, o.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, o.DEFAULT_INCREMENTAL = !1, o.DEFAULT_ANIMATION_ON_LAYOUT = !0, o.DEFAULT_ANIMATION_DURING_LAYOUT = !1, o.DEFAULT_ANIMATION_PERIOD = 50, o.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, o.DEFAULT_GRAPH_MARGIN = 15, o.NODE_DIMENSIONS_INCLUDE_LABELS = !1, o.SIMPLE_NODE_SIZE = 40, o.SIMPLE_NODE_HALF_SIZE = o.SIMPLE_NODE_SIZE / 2, o.EMPTY_COMPOUND_NODE_SIZE = 40, o.MIN_EDGE_LENGTH = 1, o.WORLD_BOUNDARY = 1e6, o.INITIAL_WORLD_BOUNDARY = o.WORLD_BOUNDARY / 1e3, o.WORLD_CENTER_X = 1200, o.WORLD_CENTER_Y = 900, N.exports = o;
63
- },
64
- /* 1 */
65
- /***/
66
- function(N, I, L) {
67
- var o = L(2), e = L(8), t = L(9);
68
- function i(g, n, d) {
69
- o.call(this, d), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = d, this.bendpoints = [], this.source = g, this.target = n;
70
- }
71
- i.prototype = Object.create(o.prototype);
72
- for (var l in o)
73
- i[l] = o[l];
74
- i.prototype.getSource = function() {
75
- return this.source;
76
- }, i.prototype.getTarget = function() {
77
- return this.target;
78
- }, i.prototype.isInterGraph = function() {
79
- return this.isInterGraph;
80
- }, i.prototype.getLength = function() {
81
- return this.length;
82
- }, i.prototype.isOverlapingSourceAndTarget = function() {
83
- return this.isOverlapingSourceAndTarget;
84
- }, i.prototype.getBendpoints = function() {
85
- return this.bendpoints;
86
- }, i.prototype.getLca = function() {
87
- return this.lca;
88
- }, i.prototype.getSourceInLca = function() {
89
- return this.sourceInLca;
90
- }, i.prototype.getTargetInLca = function() {
91
- return this.targetInLca;
92
- }, i.prototype.getOtherEnd = function(g) {
93
- if (this.source === g)
94
- return this.target;
95
- if (this.target === g)
96
- return this.source;
97
- throw "Node is not incident with this edge";
98
- }, i.prototype.getOtherEndInGraph = function(g, n) {
99
- for (var d = this.getOtherEnd(g), r = n.getGraphManager().getRoot(); ; ) {
100
- if (d.getOwner() == n)
101
- return d;
102
- if (d.getOwner() == r)
103
- break;
104
- d = d.getOwner().getParent();
105
- }
106
- return null;
107
- }, i.prototype.updateLength = function() {
108
- var g = new Array(4);
109
- this.isOverlapingSourceAndTarget = e.getIntersection(this.target.getRect(), this.source.getRect(), g), this.isOverlapingSourceAndTarget || (this.lengthX = g[0] - g[2], this.lengthY = g[1] - g[3], Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
110
- }, i.prototype.updateLengthSimple = function() {
111
- this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
112
- }, N.exports = i;
113
- },
114
- /* 2 */
115
- /***/
116
- function(N, I, L) {
117
- function o(e) {
118
- this.vGraphObject = e;
119
- }
120
- N.exports = o;
121
- },
122
- /* 3 */
123
- /***/
124
- function(N, I, L) {
125
- var o = L(2), e = L(10), t = L(13), i = L(0), l = L(16), g = L(4);
126
- function n(r, h, a, p) {
127
- a == null && p == null && (p = h), o.call(this, p), r.graphManager != null && (r = r.graphManager), this.estimatedSize = e.MIN_VALUE, this.inclusionTreeDepth = e.MAX_VALUE, this.vGraphObject = p, this.edges = [], this.graphManager = r, a != null && h != null ? this.rect = new t(h.x, h.y, a.width, a.height) : this.rect = new t();
128
- }
129
- n.prototype = Object.create(o.prototype);
130
- for (var d in o)
131
- n[d] = o[d];
132
- n.prototype.getEdges = function() {
133
- return this.edges;
134
- }, n.prototype.getChild = function() {
135
- return this.child;
136
- }, n.prototype.getOwner = function() {
137
- return this.owner;
138
- }, n.prototype.getWidth = function() {
139
- return this.rect.width;
140
- }, n.prototype.setWidth = function(r) {
141
- this.rect.width = r;
142
- }, n.prototype.getHeight = function() {
143
- return this.rect.height;
144
- }, n.prototype.setHeight = function(r) {
145
- this.rect.height = r;
146
- }, n.prototype.getCenterX = function() {
147
- return this.rect.x + this.rect.width / 2;
148
- }, n.prototype.getCenterY = function() {
149
- return this.rect.y + this.rect.height / 2;
150
- }, n.prototype.getCenter = function() {
151
- return new g(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
152
- }, n.prototype.getLocation = function() {
153
- return new g(this.rect.x, this.rect.y);
154
- }, n.prototype.getRect = function() {
155
- return this.rect;
156
- }, n.prototype.getDiagonal = function() {
157
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
158
- }, n.prototype.getHalfTheDiagonal = function() {
159
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
160
- }, n.prototype.setRect = function(r, h) {
161
- this.rect.x = r.x, this.rect.y = r.y, this.rect.width = h.width, this.rect.height = h.height;
162
- }, n.prototype.setCenter = function(r, h) {
163
- this.rect.x = r - this.rect.width / 2, this.rect.y = h - this.rect.height / 2;
164
- }, n.prototype.setLocation = function(r, h) {
165
- this.rect.x = r, this.rect.y = h;
166
- }, n.prototype.moveBy = function(r, h) {
167
- this.rect.x += r, this.rect.y += h;
168
- }, n.prototype.getEdgeListToNode = function(r) {
169
- var h = [], a = this;
170
- return a.edges.forEach(function(p) {
171
- if (p.target == r) {
172
- if (p.source != a) throw "Incorrect edge source!";
173
- h.push(p);
174
- }
175
- }), h;
176
- }, n.prototype.getEdgesBetween = function(r) {
177
- var h = [], a = this;
178
- return a.edges.forEach(function(p) {
179
- if (!(p.source == a || p.target == a)) throw "Incorrect edge source and/or target";
180
- (p.target == r || p.source == r) && h.push(p);
181
- }), h;
182
- }, n.prototype.getNeighborsList = function() {
183
- var r = /* @__PURE__ */ new Set(), h = this;
184
- return h.edges.forEach(function(a) {
185
- if (a.source == h)
186
- r.add(a.target);
187
- else {
188
- if (a.target != h)
189
- throw "Incorrect incidency!";
190
- r.add(a.source);
191
- }
192
- }), r;
193
- }, n.prototype.withChildren = function() {
194
- var r = /* @__PURE__ */ new Set(), h, a;
195
- if (r.add(this), this.child != null)
196
- for (var p = this.child.getNodes(), v = 0; v < p.length; v++)
197
- h = p[v], a = h.withChildren(), a.forEach(function(D) {
198
- r.add(D);
199
- });
200
- return r;
201
- }, n.prototype.getNoOfChildren = function() {
202
- var r = 0, h;
203
- if (this.child == null)
204
- r = 1;
205
- else
206
- for (var a = this.child.getNodes(), p = 0; p < a.length; p++)
207
- h = a[p], r += h.getNoOfChildren();
208
- return r == 0 && (r = 1), r;
209
- }, n.prototype.getEstimatedSize = function() {
210
- if (this.estimatedSize == e.MIN_VALUE)
211
- throw "assert failed";
212
- return this.estimatedSize;
213
- }, n.prototype.calcEstimatedSize = function() {
214
- 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);
215
- }, n.prototype.scatter = function() {
216
- var r, h, a = -i.INITIAL_WORLD_BOUNDARY, p = i.INITIAL_WORLD_BOUNDARY;
217
- r = i.WORLD_CENTER_X + l.nextDouble() * (p - a) + a;
218
- var v = -i.INITIAL_WORLD_BOUNDARY, D = i.INITIAL_WORLD_BOUNDARY;
219
- h = i.WORLD_CENTER_Y + l.nextDouble() * (D - v) + v, this.rect.x = r, this.rect.y = h;
220
- }, n.prototype.updateBounds = function() {
221
- if (this.getChild() == null)
222
- throw "assert failed";
223
- if (this.getChild().getNodes().length != 0) {
224
- var r = this.getChild();
225
- if (r.updateBounds(!0), this.rect.x = r.getLeft(), this.rect.y = r.getTop(), this.setWidth(r.getRight() - r.getLeft()), this.setHeight(r.getBottom() - r.getTop()), i.NODE_DIMENSIONS_INCLUDE_LABELS) {
226
- var h = r.getRight() - r.getLeft(), a = r.getBottom() - r.getTop();
227
- this.labelWidth > h && (this.rect.x -= (this.labelWidth - h) / 2, this.setWidth(this.labelWidth)), this.labelHeight > a && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - a) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - a), this.setHeight(this.labelHeight));
228
- }
229
- }
230
- }, n.prototype.getInclusionTreeDepth = function() {
231
- if (this.inclusionTreeDepth == e.MAX_VALUE)
232
- throw "assert failed";
233
- return this.inclusionTreeDepth;
234
- }, n.prototype.transform = function(r) {
235
- var h = this.rect.x;
236
- h > i.WORLD_BOUNDARY ? h = i.WORLD_BOUNDARY : h < -i.WORLD_BOUNDARY && (h = -i.WORLD_BOUNDARY);
237
- var a = this.rect.y;
238
- a > i.WORLD_BOUNDARY ? a = i.WORLD_BOUNDARY : a < -i.WORLD_BOUNDARY && (a = -i.WORLD_BOUNDARY);
239
- var p = new g(h, a), v = r.inverseTransformPoint(p);
240
- this.setLocation(v.x, v.y);
241
- }, n.prototype.getLeft = function() {
242
- return this.rect.x;
243
- }, n.prototype.getRight = function() {
244
- return this.rect.x + this.rect.width;
245
- }, n.prototype.getTop = function() {
246
- return this.rect.y;
247
- }, n.prototype.getBottom = function() {
248
- return this.rect.y + this.rect.height;
249
- }, n.prototype.getParent = function() {
250
- return this.owner == null ? null : this.owner.getParent();
251
- }, N.exports = n;
252
- },
253
- /* 4 */
254
- /***/
255
- function(N, I, L) {
256
- function o(e, t) {
257
- e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
258
- }
259
- o.prototype.getX = function() {
260
- return this.x;
261
- }, o.prototype.getY = function() {
262
- return this.y;
263
- }, o.prototype.setX = function(e) {
264
- this.x = e;
265
- }, o.prototype.setY = function(e) {
266
- this.y = e;
267
- }, o.prototype.getDifference = function(e) {
268
- return new DimensionD(this.x - e.x, this.y - e.y);
269
- }, o.prototype.getCopy = function() {
270
- return new o(this.x, this.y);
271
- }, o.prototype.translate = function(e) {
272
- return this.x += e.width, this.y += e.height, this;
273
- }, N.exports = o;
274
- },
275
- /* 5 */
276
- /***/
277
- function(N, I, L) {
278
- var o = L(2), e = L(10), t = L(0), i = L(6), l = L(3), g = L(1), n = L(13), d = L(12), r = L(11);
279
- function h(p, v, D) {
280
- o.call(this, D), this.estimatedSize = e.MIN_VALUE, this.margin = t.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = p, v != null && v instanceof i ? this.graphManager = v : v != null && v instanceof Layout && (this.graphManager = v.graphManager);
281
- }
282
- h.prototype = Object.create(o.prototype);
283
- for (var a in o)
284
- h[a] = o[a];
285
- h.prototype.getNodes = function() {
286
- return this.nodes;
287
- }, h.prototype.getEdges = function() {
288
- return this.edges;
289
- }, h.prototype.getGraphManager = function() {
290
- return this.graphManager;
291
- }, h.prototype.getParent = function() {
292
- return this.parent;
293
- }, h.prototype.getLeft = function() {
294
- return this.left;
295
- }, h.prototype.getRight = function() {
296
- return this.right;
297
- }, h.prototype.getTop = function() {
298
- return this.top;
299
- }, h.prototype.getBottom = function() {
300
- return this.bottom;
301
- }, h.prototype.isConnected = function() {
302
- return this.isConnected;
303
- }, h.prototype.add = function(p, v, D) {
304
- if (v == null && D == null) {
305
- var u = p;
306
- if (this.graphManager == null)
307
- throw "Graph has no graph mgr!";
308
- if (this.getNodes().indexOf(u) > -1)
309
- throw "Node already in graph!";
310
- return u.owner = this, this.getNodes().push(u), u;
311
- } else {
312
- var T = p;
313
- if (!(this.getNodes().indexOf(v) > -1 && this.getNodes().indexOf(D) > -1))
314
- throw "Source or target not in graph!";
315
- if (!(v.owner == D.owner && v.owner == this))
316
- throw "Both owners must be this graph!";
317
- return v.owner != D.owner ? null : (T.source = v, T.target = D, T.isInterGraph = !1, this.getEdges().push(T), v.edges.push(T), D != v && D.edges.push(T), T);
318
- }
319
- }, h.prototype.remove = function(p) {
320
- var v = p;
321
- if (p instanceof l) {
322
- if (v == null)
323
- throw "Node is null!";
324
- if (!(v.owner != null && v.owner == this))
325
- throw "Owner graph is invalid!";
326
- if (this.graphManager == null)
327
- throw "Owner graph manager is invalid!";
328
- for (var D = v.edges.slice(), u, T = D.length, y = 0; y < T; y++)
329
- u = D[y], u.isInterGraph ? this.graphManager.remove(u) : u.source.owner.remove(u);
330
- var O = this.nodes.indexOf(v);
331
- if (O == -1)
332
- throw "Node not in owner node list!";
333
- this.nodes.splice(O, 1);
334
- } else if (p instanceof g) {
335
- var u = p;
336
- if (u == null)
337
- throw "Edge is null!";
338
- if (!(u.source != null && u.target != null))
339
- throw "Source and/or target is null!";
340
- if (!(u.source.owner != null && u.target.owner != null && u.source.owner == this && u.target.owner == this))
341
- throw "Source and/or target owner is invalid!";
342
- var s = u.source.edges.indexOf(u), f = u.target.edges.indexOf(u);
343
- if (!(s > -1 && f > -1))
344
- throw "Source and/or target doesn't know this edge!";
345
- u.source.edges.splice(s, 1), u.target != u.source && u.target.edges.splice(f, 1);
346
- var O = u.source.owner.getEdges().indexOf(u);
347
- if (O == -1)
348
- throw "Not in owner's edge list!";
349
- u.source.owner.getEdges().splice(O, 1);
350
- }
351
- }, h.prototype.updateLeftTop = function() {
352
- for (var p = e.MAX_VALUE, v = e.MAX_VALUE, D, u, T, y = this.getNodes(), O = y.length, s = 0; s < O; s++) {
353
- var f = y[s];
354
- D = f.getTop(), u = f.getLeft(), p > D && (p = D), v > u && (v = u);
355
- }
356
- return p == e.MAX_VALUE ? null : (y[0].getParent().paddingLeft != null ? T = y[0].getParent().paddingLeft : T = this.margin, this.left = v - T, this.top = p - T, new d(this.left, this.top));
357
- }, h.prototype.updateBounds = function(p) {
358
- for (var v = e.MAX_VALUE, D = -e.MAX_VALUE, u = e.MAX_VALUE, T = -e.MAX_VALUE, y, O, s, f, c, E = this.nodes, A = E.length, m = 0; m < A; m++) {
359
- var R = E[m];
360
- p && R.child != null && R.updateBounds(), y = R.getLeft(), O = R.getRight(), s = R.getTop(), f = R.getBottom(), v > y && (v = y), D < O && (D = O), u > s && (u = s), T < f && (T = f);
361
- }
362
- var C = new n(v, u, D - v, T - u);
363
- v == e.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), E[0].getParent().paddingLeft != null ? c = E[0].getParent().paddingLeft : c = this.margin, this.left = C.x - c, this.right = C.x + C.width + c, this.top = C.y - c, this.bottom = C.y + C.height + c;
364
- }, h.calculateBounds = function(p) {
365
- for (var v = e.MAX_VALUE, D = -e.MAX_VALUE, u = e.MAX_VALUE, T = -e.MAX_VALUE, y, O, s, f, c = p.length, E = 0; E < c; E++) {
366
- var A = p[E];
367
- y = A.getLeft(), O = A.getRight(), s = A.getTop(), f = A.getBottom(), v > y && (v = y), D < O && (D = O), u > s && (u = s), T < f && (T = f);
368
- }
369
- var m = new n(v, u, D - v, T - u);
370
- return m;
371
- }, h.prototype.getInclusionTreeDepth = function() {
372
- return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
373
- }, h.prototype.getEstimatedSize = function() {
374
- if (this.estimatedSize == e.MIN_VALUE)
375
- throw "assert failed";
376
- return this.estimatedSize;
377
- }, h.prototype.calcEstimatedSize = function() {
378
- for (var p = 0, v = this.nodes, D = v.length, u = 0; u < D; u++) {
379
- var T = v[u];
380
- p += T.calcEstimatedSize();
381
- }
382
- return p == 0 ? this.estimatedSize = t.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = p / Math.sqrt(this.nodes.length), this.estimatedSize;
383
- }, h.prototype.updateConnected = function() {
384
- var p = this;
385
- if (this.nodes.length == 0) {
386
- this.isConnected = !0;
387
- return;
388
- }
389
- var v = new r(), D = /* @__PURE__ */ new Set(), u = this.nodes[0], T, y, O = u.withChildren();
390
- for (O.forEach(function(m) {
391
- v.push(m), D.add(m);
392
- }); v.length !== 0; ) {
393
- u = v.shift(), T = u.getEdges();
394
- for (var s = T.length, f = 0; f < s; f++) {
395
- var c = T[f];
396
- if (y = c.getOtherEndInGraph(u, this), y != null && !D.has(y)) {
397
- var E = y.withChildren();
398
- E.forEach(function(m) {
399
- v.push(m), D.add(m);
400
- });
401
- }
402
- }
403
- }
404
- if (this.isConnected = !1, D.size >= this.nodes.length) {
405
- var A = 0;
406
- D.forEach(function(m) {
407
- m.owner == p && A++;
408
- }), A == this.nodes.length && (this.isConnected = !0);
409
- }
410
- }, N.exports = h;
411
- },
412
- /* 6 */
413
- /***/
414
- function(N, I, L) {
415
- var o, e = L(1);
416
- function t(i) {
417
- o = L(5), this.layout = i, this.graphs = [], this.edges = [];
418
- }
419
- t.prototype.addRoot = function() {
420
- var i = this.layout.newGraph(), l = this.layout.newNode(null), g = this.add(i, l);
421
- return this.setRootGraph(g), this.rootGraph;
422
- }, t.prototype.add = function(i, l, g, n, d) {
423
- if (g == null && n == null && d == null) {
424
- if (i == null)
425
- throw "Graph is null!";
426
- if (l == null)
427
- throw "Parent node is null!";
428
- if (this.graphs.indexOf(i) > -1)
429
- throw "Graph already in this graph mgr!";
430
- if (this.graphs.push(i), i.parent != null)
431
- throw "Already has a parent!";
432
- if (l.child != null)
433
- throw "Already has a child!";
434
- return i.parent = l, l.child = i, i;
435
- } else {
436
- d = g, n = l, g = i;
437
- var r = n.getOwner(), h = d.getOwner();
438
- if (!(r != null && r.getGraphManager() == this))
439
- throw "Source not in this graph mgr!";
440
- if (!(h != null && h.getGraphManager() == this))
441
- throw "Target not in this graph mgr!";
442
- if (r == h)
443
- return g.isInterGraph = !1, r.add(g, n, d);
444
- if (g.isInterGraph = !0, g.source = n, g.target = d, this.edges.indexOf(g) > -1)
445
- throw "Edge already in inter-graph edge list!";
446
- if (this.edges.push(g), !(g.source != null && g.target != null))
447
- throw "Edge source and/or target is null!";
448
- if (!(g.source.edges.indexOf(g) == -1 && g.target.edges.indexOf(g) == -1))
449
- throw "Edge already in source and/or target incidency list!";
450
- return g.source.edges.push(g), g.target.edges.push(g), g;
451
- }
452
- }, t.prototype.remove = function(i) {
453
- if (i instanceof o) {
454
- var l = i;
455
- if (l.getGraphManager() != this)
456
- throw "Graph not in this graph mgr";
457
- if (!(l == this.rootGraph || l.parent != null && l.parent.graphManager == this))
458
- throw "Invalid parent node!";
459
- var g = [];
460
- g = g.concat(l.getEdges());
461
- for (var n, d = g.length, r = 0; r < d; r++)
462
- n = g[r], l.remove(n);
463
- var h = [];
464
- h = h.concat(l.getNodes());
465
- var a;
466
- d = h.length;
467
- for (var r = 0; r < d; r++)
468
- a = h[r], l.remove(a);
469
- l == this.rootGraph && this.setRootGraph(null);
470
- var p = this.graphs.indexOf(l);
471
- this.graphs.splice(p, 1), l.parent = null;
472
- } else if (i instanceof e) {
473
- if (n = i, n == null)
474
- throw "Edge is null!";
475
- if (!n.isInterGraph)
476
- throw "Not an inter-graph edge!";
477
- if (!(n.source != null && n.target != null))
478
- throw "Source and/or target is null!";
479
- if (!(n.source.edges.indexOf(n) != -1 && n.target.edges.indexOf(n) != -1))
480
- throw "Source and/or target doesn't know this edge!";
481
- var p = n.source.edges.indexOf(n);
482
- if (n.source.edges.splice(p, 1), p = n.target.edges.indexOf(n), n.target.edges.splice(p, 1), !(n.source.owner != null && n.source.owner.getGraphManager() != null))
483
- throw "Edge owner graph or owner graph manager is null!";
484
- if (n.source.owner.getGraphManager().edges.indexOf(n) == -1)
485
- throw "Not in owner graph manager's edge list!";
486
- var p = n.source.owner.getGraphManager().edges.indexOf(n);
487
- n.source.owner.getGraphManager().edges.splice(p, 1);
488
- }
489
- }, t.prototype.updateBounds = function() {
490
- this.rootGraph.updateBounds(!0);
491
- }, t.prototype.getGraphs = function() {
492
- return this.graphs;
493
- }, t.prototype.getAllNodes = function() {
494
- if (this.allNodes == null) {
495
- for (var i = [], l = this.getGraphs(), g = l.length, n = 0; n < g; n++)
496
- i = i.concat(l[n].getNodes());
497
- this.allNodes = i;
498
- }
499
- return this.allNodes;
500
- }, t.prototype.resetAllNodes = function() {
501
- this.allNodes = null;
502
- }, t.prototype.resetAllEdges = function() {
503
- this.allEdges = null;
504
- }, t.prototype.resetAllNodesToApplyGravitation = function() {
505
- this.allNodesToApplyGravitation = null;
506
- }, t.prototype.getAllEdges = function() {
507
- if (this.allEdges == null) {
508
- var i = [], l = this.getGraphs();
509
- l.length;
510
- for (var g = 0; g < l.length; g++)
511
- i = i.concat(l[g].getEdges());
512
- i = i.concat(this.edges), this.allEdges = i;
513
- }
514
- return this.allEdges;
515
- }, t.prototype.getAllNodesToApplyGravitation = function() {
516
- return this.allNodesToApplyGravitation;
517
- }, t.prototype.setAllNodesToApplyGravitation = function(i) {
518
- if (this.allNodesToApplyGravitation != null)
519
- throw "assert failed";
520
- this.allNodesToApplyGravitation = i;
521
- }, t.prototype.getRoot = function() {
522
- return this.rootGraph;
523
- }, t.prototype.setRootGraph = function(i) {
524
- if (i.getGraphManager() != this)
525
- throw "Root not in this graph mgr!";
526
- this.rootGraph = i, i.parent == null && (i.parent = this.layout.newNode("Root node"));
527
- }, t.prototype.getLayout = function() {
528
- return this.layout;
529
- }, t.prototype.isOneAncestorOfOther = function(i, l) {
530
- if (!(i != null && l != null))
531
- throw "assert failed";
532
- if (i == l)
533
- return !0;
534
- var g = i.getOwner(), n;
535
- do {
536
- if (n = g.getParent(), n == null)
537
- break;
538
- if (n == l)
539
- return !0;
540
- if (g = n.getOwner(), g == null)
541
- break;
542
- } while (!0);
543
- g = l.getOwner();
544
- do {
545
- if (n = g.getParent(), n == null)
546
- break;
547
- if (n == i)
548
- return !0;
549
- if (g = n.getOwner(), g == null)
550
- break;
551
- } while (!0);
552
- return !1;
553
- }, t.prototype.calcLowestCommonAncestors = function() {
554
- for (var i, l, g, n, d, r = this.getAllEdges(), h = r.length, a = 0; a < h; a++) {
555
- if (i = r[a], l = i.source, g = i.target, i.lca = null, i.sourceInLca = l, i.targetInLca = g, l == g) {
556
- i.lca = l.getOwner();
557
- continue;
558
- }
559
- for (n = l.getOwner(); i.lca == null; ) {
560
- for (i.targetInLca = g, d = g.getOwner(); i.lca == null; ) {
561
- if (d == n) {
562
- i.lca = d;
563
- break;
564
- }
565
- if (d == this.rootGraph)
566
- break;
567
- if (i.lca != null)
568
- throw "assert failed";
569
- i.targetInLca = d.getParent(), d = i.targetInLca.getOwner();
570
- }
571
- if (n == this.rootGraph)
572
- break;
573
- i.lca == null && (i.sourceInLca = n.getParent(), n = i.sourceInLca.getOwner());
574
- }
575
- if (i.lca == null)
576
- throw "assert failed";
577
- }
578
- }, t.prototype.calcLowestCommonAncestor = function(i, l) {
579
- if (i == l)
580
- return i.getOwner();
581
- var g = i.getOwner();
582
- do {
583
- if (g == null)
584
- break;
585
- var n = l.getOwner();
586
- do {
587
- if (n == null)
588
- break;
589
- if (n == g)
590
- return n;
591
- n = n.getParent().getOwner();
592
- } while (!0);
593
- g = g.getParent().getOwner();
594
- } while (!0);
595
- return g;
596
- }, t.prototype.calcInclusionTreeDepths = function(i, l) {
597
- i == null && l == null && (i = this.rootGraph, l = 1);
598
- for (var g, n = i.getNodes(), d = n.length, r = 0; r < d; r++)
599
- g = n[r], g.inclusionTreeDepth = l, g.child != null && this.calcInclusionTreeDepths(g.child, l + 1);
600
- }, t.prototype.includesInvalidEdge = function() {
601
- for (var i, l = this.edges.length, g = 0; g < l; g++)
602
- if (i = this.edges[g], this.isOneAncestorOfOther(i.source, i.target))
603
- return !0;
604
- return !1;
605
- }, N.exports = t;
606
- },
607
- /* 7 */
608
- /***/
609
- function(N, I, L) {
610
- var o = L(0);
611
- function e() {
612
- }
613
- for (var t in o)
614
- e[t] = o[t];
615
- e.MAX_ITERATIONS = 2500, e.DEFAULT_EDGE_LENGTH = 50, e.DEFAULT_SPRING_STRENGTH = 0.45, e.DEFAULT_REPULSION_STRENGTH = 4500, e.DEFAULT_GRAVITY_STRENGTH = 0.4, e.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, e.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, e.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, e.COOLING_ADAPTATION_FACTOR = 0.33, e.ADAPTATION_LOWER_NODE_LIMIT = 1e3, e.ADAPTATION_UPPER_NODE_LIMIT = 5e3, e.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, e.MAX_NODE_DISPLACEMENT = e.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, e.MIN_REPULSION_DIST = e.DEFAULT_EDGE_LENGTH / 10, e.CONVERGENCE_CHECK_PERIOD = 100, e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, e.MIN_EDGE_LENGTH = 1, e.GRID_CALCULATION_CHECK_PERIOD = 10, N.exports = e;
616
- },
617
- /* 8 */
618
- /***/
619
- function(N, I, L) {
620
- var o = L(12);
621
- function e() {
622
- }
623
- e.calcSeparationAmount = function(t, i, l, g) {
624
- if (!t.intersects(i))
625
- throw "assert failed";
626
- var n = new Array(2);
627
- this.decideDirectionsForOverlappingNodes(t, i, n), l[0] = Math.min(t.getRight(), i.getRight()) - Math.max(t.x, i.x), l[1] = Math.min(t.getBottom(), i.getBottom()) - Math.max(t.y, i.y), t.getX() <= i.getX() && t.getRight() >= i.getRight() ? l[0] += Math.min(i.getX() - t.getX(), t.getRight() - i.getRight()) : i.getX() <= t.getX() && i.getRight() >= t.getRight() && (l[0] += Math.min(t.getX() - i.getX(), i.getRight() - t.getRight())), t.getY() <= i.getY() && t.getBottom() >= i.getBottom() ? l[1] += Math.min(i.getY() - t.getY(), t.getBottom() - i.getBottom()) : i.getY() <= t.getY() && i.getBottom() >= t.getBottom() && (l[1] += Math.min(t.getY() - i.getY(), i.getBottom() - t.getBottom()));
628
- var d = Math.abs((i.getCenterY() - t.getCenterY()) / (i.getCenterX() - t.getCenterX()));
629
- i.getCenterY() === t.getCenterY() && i.getCenterX() === t.getCenterX() && (d = 1);
630
- var r = d * l[0], h = l[1] / d;
631
- l[0] < h ? h = l[0] : r = l[1], l[0] = -1 * n[0] * (h / 2 + g), l[1] = -1 * n[1] * (r / 2 + g);
632
- }, e.decideDirectionsForOverlappingNodes = function(t, i, l) {
633
- t.getCenterX() < i.getCenterX() ? l[0] = -1 : l[0] = 1, t.getCenterY() < i.getCenterY() ? l[1] = -1 : l[1] = 1;
634
- }, e.getIntersection2 = function(t, i, l) {
635
- var g = t.getCenterX(), n = t.getCenterY(), d = i.getCenterX(), r = i.getCenterY();
636
- if (t.intersects(i))
637
- return l[0] = g, l[1] = n, l[2] = d, l[3] = r, !0;
638
- var h = t.getX(), a = t.getY(), p = t.getRight(), v = t.getX(), D = t.getBottom(), u = t.getRight(), T = t.getWidthHalf(), y = t.getHeightHalf(), O = i.getX(), s = i.getY(), f = i.getRight(), c = i.getX(), E = i.getBottom(), A = i.getRight(), m = i.getWidthHalf(), R = i.getHeightHalf(), C = !1, M = !1;
639
- if (g === d) {
640
- if (n > r)
641
- return l[0] = g, l[1] = a, l[2] = d, l[3] = E, !1;
642
- if (n < r)
643
- return l[0] = g, l[1] = D, l[2] = d, l[3] = s, !1;
644
- } else if (n === r) {
645
- if (g > d)
646
- return l[0] = h, l[1] = n, l[2] = f, l[3] = r, !1;
647
- if (g < d)
648
- return l[0] = p, l[1] = n, l[2] = O, l[3] = r, !1;
649
- } else {
650
- var S = t.height / t.width, Y = i.height / i.width, w = (r - n) / (d - g), x = void 0, F = void 0, U = void 0, P = void 0, _ = void 0, X = void 0;
651
- if (-S === w ? g > d ? (l[0] = v, l[1] = D, C = !0) : (l[0] = p, l[1] = a, C = !0) : S === w && (g > d ? (l[0] = h, l[1] = a, C = !0) : (l[0] = u, l[1] = D, C = !0)), -Y === w ? d > g ? (l[2] = c, l[3] = E, M = !0) : (l[2] = f, l[3] = s, M = !0) : Y === w && (d > g ? (l[2] = O, l[3] = s, M = !0) : (l[2] = A, l[3] = E, M = !0)), C && M)
652
- return !1;
653
- if (g > d ? n > r ? (x = this.getCardinalDirection(S, w, 4), F = this.getCardinalDirection(Y, w, 2)) : (x = this.getCardinalDirection(-S, w, 3), F = this.getCardinalDirection(-Y, w, 1)) : n > r ? (x = this.getCardinalDirection(-S, w, 1), F = this.getCardinalDirection(-Y, w, 3)) : (x = this.getCardinalDirection(S, w, 2), F = this.getCardinalDirection(Y, w, 4)), !C)
654
- switch (x) {
655
- case 1:
656
- P = a, U = g + -y / w, l[0] = U, l[1] = P;
657
- break;
658
- case 2:
659
- U = u, P = n + T * w, l[0] = U, l[1] = P;
660
- break;
661
- case 3:
662
- P = D, U = g + y / w, l[0] = U, l[1] = P;
663
- break;
664
- case 4:
665
- U = v, P = n + -T * w, l[0] = U, l[1] = P;
666
- break;
667
- }
668
- if (!M)
669
- switch (F) {
670
- case 1:
671
- X = s, _ = d + -R / w, l[2] = _, l[3] = X;
672
- break;
673
- case 2:
674
- _ = A, X = r + m * w, l[2] = _, l[3] = X;
675
- break;
676
- case 3:
677
- X = E, _ = d + R / w, l[2] = _, l[3] = X;
678
- break;
679
- case 4:
680
- _ = c, X = r + -m * w, l[2] = _, l[3] = X;
681
- break;
682
- }
683
- }
684
- return !1;
685
- }, e.getCardinalDirection = function(t, i, l) {
686
- return t > i ? l : 1 + l % 4;
687
- }, e.getIntersection = function(t, i, l, g) {
688
- if (g == null)
689
- return this.getIntersection2(t, i, l);
690
- var n = t.x, d = t.y, r = i.x, h = i.y, a = l.x, p = l.y, v = g.x, D = g.y, u = void 0, T = void 0, y = void 0, O = void 0, s = void 0, f = void 0, c = void 0, E = void 0, A = void 0;
691
- return y = h - d, s = n - r, c = r * d - n * h, O = D - p, f = a - v, E = v * p - a * D, A = y * f - O * s, A === 0 ? null : (u = (s * E - f * c) / A, T = (O * c - y * E) / A, new o(u, T));
692
- }, e.angleOfVector = function(t, i, l, g) {
693
- var n = void 0;
694
- return t !== l ? (n = Math.atan((g - i) / (l - t)), l < t ? n += Math.PI : g < i && (n += this.TWO_PI)) : g < i ? n = this.ONE_AND_HALF_PI : n = this.HALF_PI, n;
695
- }, e.doIntersect = function(t, i, l, g) {
696
- var n = t.x, d = t.y, r = i.x, h = i.y, a = l.x, p = l.y, v = g.x, D = g.y, u = (r - n) * (D - p) - (v - a) * (h - d);
697
- if (u === 0)
698
- return !1;
699
- var T = ((D - p) * (v - n) + (a - v) * (D - d)) / u, y = ((d - h) * (v - n) + (r - n) * (D - d)) / u;
700
- return 0 < T && T < 1 && 0 < y && y < 1;
701
- }, e.HALF_PI = 0.5 * Math.PI, e.ONE_AND_HALF_PI = 1.5 * Math.PI, e.TWO_PI = 2 * Math.PI, e.THREE_PI = 3 * Math.PI, N.exports = e;
702
- },
703
- /* 9 */
704
- /***/
705
- function(N, I, L) {
706
- function o() {
707
- }
708
- o.sign = function(e) {
709
- return e > 0 ? 1 : e < 0 ? -1 : 0;
710
- }, o.floor = function(e) {
711
- return e < 0 ? Math.ceil(e) : Math.floor(e);
712
- }, o.ceil = function(e) {
713
- return e < 0 ? Math.floor(e) : Math.ceil(e);
714
- }, N.exports = o;
715
- },
716
- /* 10 */
717
- /***/
718
- function(N, I, L) {
719
- function o() {
720
- }
721
- o.MAX_VALUE = 2147483647, o.MIN_VALUE = -2147483648, N.exports = o;
722
- },
723
- /* 11 */
724
- /***/
725
- function(N, I, L) {
726
- var o = /* @__PURE__ */ function() {
727
- function n(d, r) {
728
- for (var h = 0; h < r.length; h++) {
729
- var a = r[h];
730
- a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(d, a.key, a);
731
- }
732
- }
733
- return function(d, r, h) {
734
- return r && n(d.prototype, r), h && n(d, h), d;
735
- };
736
- }();
737
- function e(n, d) {
738
- if (!(n instanceof d))
739
- throw new TypeError("Cannot call a class as a function");
740
- }
741
- var t = function(d) {
742
- return { value: d, next: null, prev: null };
743
- }, i = function(d, r, h, a) {
744
- return d !== null ? d.next = r : a.head = r, h !== null ? h.prev = r : a.tail = r, r.prev = d, r.next = h, a.length++, r;
745
- }, l = function(d, r) {
746
- var h = d.prev, a = d.next;
747
- return h !== null ? h.next = a : r.head = a, a !== null ? a.prev = h : r.tail = h, d.prev = d.next = null, r.length--, d;
748
- }, g = function() {
749
- function n(d) {
750
- var r = this;
751
- e(this, n), this.length = 0, this.head = null, this.tail = null, d?.forEach(function(h) {
752
- return r.push(h);
753
- });
754
- }
755
- return o(n, [{
756
- key: "size",
757
- value: function() {
758
- return this.length;
759
- }
760
- }, {
761
- key: "insertBefore",
762
- value: function(r, h) {
763
- return i(h.prev, t(r), h, this);
764
- }
765
- }, {
766
- key: "insertAfter",
767
- value: function(r, h) {
768
- return i(h, t(r), h.next, this);
769
- }
770
- }, {
771
- key: "insertNodeBefore",
772
- value: function(r, h) {
773
- return i(h.prev, r, h, this);
774
- }
775
- }, {
776
- key: "insertNodeAfter",
777
- value: function(r, h) {
778
- return i(h, r, h.next, this);
779
- }
780
- }, {
781
- key: "push",
782
- value: function(r) {
783
- return i(this.tail, t(r), null, this);
784
- }
785
- }, {
786
- key: "unshift",
787
- value: function(r) {
788
- return i(null, t(r), this.head, this);
789
- }
790
- }, {
791
- key: "remove",
792
- value: function(r) {
793
- return l(r, this);
794
- }
795
- }, {
796
- key: "pop",
797
- value: function() {
798
- return l(this.tail, this).value;
799
- }
800
- }, {
801
- key: "popNode",
802
- value: function() {
803
- return l(this.tail, this);
804
- }
805
- }, {
806
- key: "shift",
807
- value: function() {
808
- return l(this.head, this).value;
809
- }
810
- }, {
811
- key: "shiftNode",
812
- value: function() {
813
- return l(this.head, this);
814
- }
815
- }, {
816
- key: "get_object_at",
817
- value: function(r) {
818
- if (r <= this.length()) {
819
- for (var h = 1, a = this.head; h < r; )
820
- a = a.next, h++;
821
- return a.value;
822
- }
823
- }
824
- }, {
825
- key: "set_object_at",
826
- value: function(r, h) {
827
- if (r <= this.length()) {
828
- for (var a = 1, p = this.head; a < r; )
829
- p = p.next, a++;
830
- p.value = h;
831
- }
832
- }
833
- }]), n;
834
- }();
835
- N.exports = g;
836
- },
837
- /* 12 */
838
- /***/
839
- function(N, I, L) {
840
- function o(e, t, i) {
841
- this.x = null, this.y = null, e == null && t == null && i == null ? (this.x = 0, this.y = 0) : typeof e == "number" && typeof t == "number" && i == null ? (this.x = e, this.y = t) : e.constructor.name == "Point" && t == null && i == null && (i = e, this.x = i.x, this.y = i.y);
842
- }
843
- o.prototype.getX = function() {
844
- return this.x;
845
- }, o.prototype.getY = function() {
846
- return this.y;
847
- }, o.prototype.getLocation = function() {
848
- return new o(this.x, this.y);
849
- }, o.prototype.setLocation = function(e, t, i) {
850
- e.constructor.name == "Point" && t == null && i == null ? (i = e, this.setLocation(i.x, i.y)) : typeof e == "number" && typeof t == "number" && i == null && (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : (this.x = Math.floor(e + 0.5), this.y = Math.floor(t + 0.5)));
851
- }, o.prototype.move = function(e, t) {
852
- this.x = e, this.y = t;
853
- }, o.prototype.translate = function(e, t) {
854
- this.x += e, this.y += t;
855
- }, o.prototype.equals = function(e) {
856
- if (e.constructor.name == "Point") {
857
- var t = e;
858
- return this.x == t.x && this.y == t.y;
859
- }
860
- return this == e;
861
- }, o.prototype.toString = function() {
862
- return new o().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
863
- }, N.exports = o;
864
- },
865
- /* 13 */
866
- /***/
867
- function(N, I, L) {
868
- function o(e, t, i, l) {
869
- this.x = 0, this.y = 0, this.width = 0, this.height = 0, e != null && t != null && i != null && l != null && (this.x = e, this.y = t, this.width = i, this.height = l);
870
- }
871
- o.prototype.getX = function() {
872
- return this.x;
873
- }, o.prototype.setX = function(e) {
874
- this.x = e;
875
- }, o.prototype.getY = function() {
876
- return this.y;
877
- }, o.prototype.setY = function(e) {
878
- this.y = e;
879
- }, o.prototype.getWidth = function() {
880
- return this.width;
881
- }, o.prototype.setWidth = function(e) {
882
- this.width = e;
883
- }, o.prototype.getHeight = function() {
884
- return this.height;
885
- }, o.prototype.setHeight = function(e) {
886
- this.height = e;
887
- }, o.prototype.getRight = function() {
888
- return this.x + this.width;
889
- }, o.prototype.getBottom = function() {
890
- return this.y + this.height;
891
- }, o.prototype.intersects = function(e) {
892
- return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
893
- }, o.prototype.getCenterX = function() {
894
- return this.x + this.width / 2;
895
- }, o.prototype.getMinX = function() {
896
- return this.getX();
897
- }, o.prototype.getMaxX = function() {
898
- return this.getX() + this.width;
899
- }, o.prototype.getCenterY = function() {
900
- return this.y + this.height / 2;
901
- }, o.prototype.getMinY = function() {
902
- return this.getY();
903
- }, o.prototype.getMaxY = function() {
904
- return this.getY() + this.height;
905
- }, o.prototype.getWidthHalf = function() {
906
- return this.width / 2;
907
- }, o.prototype.getHeightHalf = function() {
908
- return this.height / 2;
909
- }, N.exports = o;
910
- },
911
- /* 14 */
912
- /***/
913
- function(N, I, L) {
914
- var o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
915
- return typeof t;
916
- } : function(t) {
917
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
918
- };
919
- function e() {
920
- }
921
- e.lastID = 0, e.createID = function(t) {
922
- return e.isPrimitive(t) ? t : (t.uniqueID != null || (t.uniqueID = e.getString(), e.lastID++), t.uniqueID);
923
- }, e.getString = function(t) {
924
- return t == null && (t = e.lastID), "Object#" + t;
925
- }, e.isPrimitive = function(t) {
926
- var i = typeof t > "u" ? "undefined" : o(t);
927
- return t == null || i != "object" && i != "function";
928
- }, N.exports = e;
929
- },
930
- /* 15 */
931
- /***/
932
- function(N, I, L) {
933
- function o(a) {
934
- if (Array.isArray(a)) {
935
- for (var p = 0, v = Array(a.length); p < a.length; p++)
936
- v[p] = a[p];
937
- return v;
938
- } else
939
- return Array.from(a);
940
- }
941
- var e = L(0), t = L(6), i = L(3), l = L(1), g = L(5), n = L(4), d = L(17), r = L(27);
942
- function h(a) {
943
- r.call(this), this.layoutQuality = e.QUALITY, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = e.DEFAULT_INCREMENTAL, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new t(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, a != null && (this.isRemoteUse = a);
944
- }
945
- h.RANDOM_SEED = 1, h.prototype = Object.create(r.prototype), h.prototype.getGraphManager = function() {
946
- return this.graphManager;
947
- }, h.prototype.getAllNodes = function() {
948
- return this.graphManager.getAllNodes();
949
- }, h.prototype.getAllEdges = function() {
950
- return this.graphManager.getAllEdges();
951
- }, h.prototype.getAllNodesToApplyGravitation = function() {
952
- return this.graphManager.getAllNodesToApplyGravitation();
953
- }, h.prototype.newGraphManager = function() {
954
- var a = new t(this);
955
- return this.graphManager = a, a;
956
- }, h.prototype.newGraph = function(a) {
957
- return new g(null, this.graphManager, a);
958
- }, h.prototype.newNode = function(a) {
959
- return new i(this.graphManager, a);
960
- }, h.prototype.newEdge = function(a) {
961
- return new l(null, null, a);
962
- }, h.prototype.checkLayoutSuccess = function() {
963
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
964
- }, h.prototype.runLayout = function() {
965
- this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
966
- var a;
967
- return this.checkLayoutSuccess() ? a = !1 : a = this.layout(), e.ANIMATE === "during" ? !1 : (a && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, a);
968
- }, h.prototype.doPostLayout = function() {
969
- this.incremental || this.transform(), this.update();
970
- }, h.prototype.update2 = function() {
971
- if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
972
- for (var a = this.graphManager.getAllEdges(), p = 0; p < a.length; p++)
973
- a[p];
974
- for (var v = this.graphManager.getRoot().getNodes(), p = 0; p < v.length; p++)
975
- v[p];
976
- this.update(this.graphManager.getRoot());
977
- }
978
- }, h.prototype.update = function(a) {
979
- if (a == null)
980
- this.update2();
981
- else if (a instanceof i) {
982
- var p = a;
983
- if (p.getChild() != null)
984
- for (var v = p.getChild().getNodes(), D = 0; D < v.length; D++)
985
- update(v[D]);
986
- if (p.vGraphObject != null) {
987
- var u = p.vGraphObject;
988
- u.update(p);
989
- }
990
- } else if (a instanceof l) {
991
- var T = a;
992
- if (T.vGraphObject != null) {
993
- var y = T.vGraphObject;
994
- y.update(T);
995
- }
996
- } else if (a instanceof g) {
997
- var O = a;
998
- if (O.vGraphObject != null) {
999
- var s = O.vGraphObject;
1000
- s.update(O);
1001
- }
1002
- }
1003
- }, h.prototype.initParameters = function() {
1004
- this.isSubLayout || (this.layoutQuality = e.QUALITY, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = e.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
1005
- }, h.prototype.transform = function(a) {
1006
- if (a == null)
1007
- this.transform(new n(0, 0));
1008
- else {
1009
- var p = new d(), v = this.graphManager.getRoot().updateLeftTop();
1010
- if (v != null) {
1011
- p.setWorldOrgX(a.x), p.setWorldOrgY(a.y), p.setDeviceOrgX(v.x), p.setDeviceOrgY(v.y);
1012
- for (var D = this.getAllNodes(), u, T = 0; T < D.length; T++)
1013
- u = D[T], u.transform(p);
1014
- }
1015
- }
1016
- }, h.prototype.positionNodesRandomly = function(a) {
1017
- if (a == null)
1018
- this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
1019
- else
1020
- for (var p, v, D = a.getNodes(), u = 0; u < D.length; u++)
1021
- p = D[u], v = p.getChild(), v == null || v.getNodes().length == 0 ? p.scatter() : (this.positionNodesRandomly(v), p.updateBounds());
1022
- }, h.prototype.getFlatForest = function() {
1023
- for (var a = [], p = !0, v = this.graphManager.getRoot().getNodes(), D = !0, u = 0; u < v.length; u++)
1024
- v[u].getChild() != null && (D = !1);
1025
- if (!D)
1026
- return a;
1027
- var T = /* @__PURE__ */ new Set(), y = [], O = /* @__PURE__ */ new Map(), s = [];
1028
- for (s = s.concat(v); s.length > 0 && p; ) {
1029
- for (y.push(s[0]); y.length > 0 && p; ) {
1030
- var f = y[0];
1031
- y.splice(0, 1), T.add(f);
1032
- for (var c = f.getEdges(), u = 0; u < c.length; u++) {
1033
- var E = c[u].getOtherEnd(f);
1034
- if (O.get(f) != E)
1035
- if (!T.has(E))
1036
- y.push(E), O.set(E, f);
1037
- else {
1038
- p = !1;
1039
- break;
1040
- }
1041
- }
1042
- }
1043
- if (!p)
1044
- a = [];
1045
- else {
1046
- var A = [].concat(o(T));
1047
- a.push(A);
1048
- for (var u = 0; u < A.length; u++) {
1049
- var m = A[u], R = s.indexOf(m);
1050
- R > -1 && s.splice(R, 1);
1051
- }
1052
- T = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Map();
1053
- }
1054
- }
1055
- return a;
1056
- }, h.prototype.createDummyNodesForBendpoints = function(a) {
1057
- for (var p = [], v = a.source, D = this.graphManager.calcLowestCommonAncestor(a.source, a.target), u = 0; u < a.bendpoints.length; u++) {
1058
- var T = this.newNode(null);
1059
- T.setRect(new Point(0, 0), new Dimension(1, 1)), D.add(T);
1060
- var y = this.newEdge(null);
1061
- this.graphManager.add(y, v, T), p.add(T), v = T;
1062
- }
1063
- var y = this.newEdge(null);
1064
- return this.graphManager.add(y, v, a.target), this.edgeToDummyNodes.set(a, p), a.isInterGraph() ? this.graphManager.remove(a) : D.remove(a), p;
1065
- }, h.prototype.createBendpointsFromDummyNodes = function() {
1066
- var a = [];
1067
- a = a.concat(this.graphManager.getAllEdges()), a = [].concat(o(this.edgeToDummyNodes.keys())).concat(a);
1068
- for (var p = 0; p < a.length; p++) {
1069
- var v = a[p];
1070
- if (v.bendpoints.length > 0) {
1071
- for (var D = this.edgeToDummyNodes.get(v), u = 0; u < D.length; u++) {
1072
- var T = D[u], y = new n(T.getCenterX(), T.getCenterY()), O = v.bendpoints.get(u);
1073
- O.x = y.x, O.y = y.y, T.getOwner().remove(T);
1074
- }
1075
- this.graphManager.add(v, v.source, v.target);
1076
- }
1077
- }
1078
- }, h.transform = function(a, p, v, D) {
1079
- if (v != null && D != null) {
1080
- var u = p;
1081
- if (a <= 50) {
1082
- var T = p / v;
1083
- u -= (p - T) / 50 * (50 - a);
1084
- } else {
1085
- var y = p * D;
1086
- u += (y - p) / 50 * (a - 50);
1087
- }
1088
- return u;
1089
- } else {
1090
- var O, s;
1091
- return a <= 50 ? (O = 9 * p / 500, s = p / 10) : (O = 9 * p / 50, s = -8 * p), O * a + s;
1092
- }
1093
- }, h.findCenterOfTree = function(a) {
1094
- var p = [];
1095
- p = p.concat(a);
1096
- var v = [], D = /* @__PURE__ */ new Map(), u = !1, T = null;
1097
- (p.length == 1 || p.length == 2) && (u = !0, T = p[0]);
1098
- for (var y = 0; y < p.length; y++) {
1099
- var O = p[y], s = O.getNeighborsList().size;
1100
- D.set(O, O.getNeighborsList().size), s == 1 && v.push(O);
1101
- }
1102
- var f = [];
1103
- for (f = f.concat(v); !u; ) {
1104
- var c = [];
1105
- c = c.concat(f), f = [];
1106
- for (var y = 0; y < p.length; y++) {
1107
- var O = p[y], E = p.indexOf(O);
1108
- E >= 0 && p.splice(E, 1);
1109
- var A = O.getNeighborsList();
1110
- A.forEach(function(C) {
1111
- if (v.indexOf(C) < 0) {
1112
- var M = D.get(C), S = M - 1;
1113
- S == 1 && f.push(C), D.set(C, S);
1114
- }
1115
- });
1116
- }
1117
- v = v.concat(f), (p.length == 1 || p.length == 2) && (u = !0, T = p[0]);
1118
- }
1119
- return T;
1120
- }, h.prototype.setGraphManager = function(a) {
1121
- this.graphManager = a;
1122
- }, N.exports = h;
1123
- },
1124
- /* 16 */
1125
- /***/
1126
- function(N, I, L) {
1127
- function o() {
1128
- }
1129
- o.seed = 1, o.x = 0, o.nextDouble = function() {
1130
- return o.x = Math.sin(o.seed++) * 1e4, o.x - Math.floor(o.x);
1131
- }, N.exports = o;
1132
- },
1133
- /* 17 */
1134
- /***/
1135
- function(N, I, L) {
1136
- var o = L(4);
1137
- function e(t, i) {
1138
- this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1139
- }
1140
- e.prototype.getWorldOrgX = function() {
1141
- return this.lworldOrgX;
1142
- }, e.prototype.setWorldOrgX = function(t) {
1143
- this.lworldOrgX = t;
1144
- }, e.prototype.getWorldOrgY = function() {
1145
- return this.lworldOrgY;
1146
- }, e.prototype.setWorldOrgY = function(t) {
1147
- this.lworldOrgY = t;
1148
- }, e.prototype.getWorldExtX = function() {
1149
- return this.lworldExtX;
1150
- }, e.prototype.setWorldExtX = function(t) {
1151
- this.lworldExtX = t;
1152
- }, e.prototype.getWorldExtY = function() {
1153
- return this.lworldExtY;
1154
- }, e.prototype.setWorldExtY = function(t) {
1155
- this.lworldExtY = t;
1156
- }, e.prototype.getDeviceOrgX = function() {
1157
- return this.ldeviceOrgX;
1158
- }, e.prototype.setDeviceOrgX = function(t) {
1159
- this.ldeviceOrgX = t;
1160
- }, e.prototype.getDeviceOrgY = function() {
1161
- return this.ldeviceOrgY;
1162
- }, e.prototype.setDeviceOrgY = function(t) {
1163
- this.ldeviceOrgY = t;
1164
- }, e.prototype.getDeviceExtX = function() {
1165
- return this.ldeviceExtX;
1166
- }, e.prototype.setDeviceExtX = function(t) {
1167
- this.ldeviceExtX = t;
1168
- }, e.prototype.getDeviceExtY = function() {
1169
- return this.ldeviceExtY;
1170
- }, e.prototype.setDeviceExtY = function(t) {
1171
- this.ldeviceExtY = t;
1172
- }, e.prototype.transformX = function(t) {
1173
- var i = 0, l = this.lworldExtX;
1174
- return l != 0 && (i = this.ldeviceOrgX + (t - this.lworldOrgX) * this.ldeviceExtX / l), i;
1175
- }, e.prototype.transformY = function(t) {
1176
- var i = 0, l = this.lworldExtY;
1177
- return l != 0 && (i = this.ldeviceOrgY + (t - this.lworldOrgY) * this.ldeviceExtY / l), i;
1178
- }, e.prototype.inverseTransformX = function(t) {
1179
- var i = 0, l = this.ldeviceExtX;
1180
- return l != 0 && (i = this.lworldOrgX + (t - this.ldeviceOrgX) * this.lworldExtX / l), i;
1181
- }, e.prototype.inverseTransformY = function(t) {
1182
- var i = 0, l = this.ldeviceExtY;
1183
- return l != 0 && (i = this.lworldOrgY + (t - this.ldeviceOrgY) * this.lworldExtY / l), i;
1184
- }, e.prototype.inverseTransformPoint = function(t) {
1185
- var i = new o(this.inverseTransformX(t.x), this.inverseTransformY(t.y));
1186
- return i;
1187
- }, N.exports = e;
1188
- },
1189
- /* 18 */
1190
- /***/
1191
- function(N, I, L) {
1192
- function o(r) {
1193
- if (Array.isArray(r)) {
1194
- for (var h = 0, a = Array(r.length); h < r.length; h++)
1195
- a[h] = r[h];
1196
- return a;
1197
- } else
1198
- return Array.from(r);
1199
- }
1200
- var e = L(15), t = L(7), i = L(0), l = L(8), g = L(9);
1201
- function n() {
1202
- e.call(this), this.useSmartIdealEdgeLengthCalculation = t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = t.DEFAULT_EDGE_LENGTH, this.springConstant = t.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = t.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = t.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = t.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * t.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = t.MAX_ITERATIONS;
1203
- }
1204
- n.prototype = Object.create(e.prototype);
1205
- for (var d in e)
1206
- n[d] = e[d];
1207
- n.prototype.initParameters = function() {
1208
- e.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1209
- }, n.prototype.calcIdealEdgeLengths = function() {
1210
- for (var r, h, a, p, v, D, u = this.getGraphManager().getAllEdges(), T = 0; T < u.length; T++)
1211
- r = u[T], r.idealLength = this.idealEdgeLength, r.isInterGraph && (a = r.getSource(), p = r.getTarget(), v = r.getSourceInLca().getEstimatedSize(), D = r.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (r.idealLength += v + D - 2 * i.SIMPLE_NODE_SIZE), h = r.getLca().getInclusionTreeDepth(), r.idealLength += t.DEFAULT_EDGE_LENGTH * t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (a.getInclusionTreeDepth() + p.getInclusionTreeDepth() - 2 * h));
1212
- }, n.prototype.initSpringEmbedder = function() {
1213
- var r = this.getAllNodes().length;
1214
- this.incremental ? (r > t.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * t.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (r - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - t.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (r > t.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(t.COOLING_ADAPTATION_FACTOR, 1 - (r - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * (1 - t.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1215
- }, n.prototype.calcSpringForces = function() {
1216
- for (var r = this.getAllEdges(), h, a = 0; a < r.length; a++)
1217
- h = r[a], this.calcSpringForce(h, h.idealLength);
1218
- }, n.prototype.calcRepulsionForces = function() {
1219
- var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, a, p, v, D, u = this.getAllNodes(), T;
1220
- if (this.useFRGridVariant)
1221
- for (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && r && this.updateGrid(), T = /* @__PURE__ */ new Set(), a = 0; a < u.length; a++)
1222
- v = u[a], this.calculateRepulsionForceOfANode(v, T, r, h), T.add(v);
1223
- else
1224
- for (a = 0; a < u.length; a++)
1225
- for (v = u[a], p = a + 1; p < u.length; p++)
1226
- D = u[p], v.getOwner() == D.getOwner() && this.calcRepulsionForce(v, D);
1227
- }, n.prototype.calcGravitationalForces = function() {
1228
- for (var r, h = this.getAllNodesToApplyGravitation(), a = 0; a < h.length; a++)
1229
- r = h[a], this.calcGravitationalForce(r);
1230
- }, n.prototype.moveNodes = function() {
1231
- for (var r = this.getAllNodes(), h, a = 0; a < r.length; a++)
1232
- h = r[a], h.move();
1233
- }, n.prototype.calcSpringForce = function(r, h) {
1234
- var a = r.getSource(), p = r.getTarget(), v, D, u, T;
1235
- if (this.uniformLeafNodeSizes && a.getChild() == null && p.getChild() == null)
1236
- r.updateLengthSimple();
1237
- else if (r.updateLength(), r.isOverlapingSourceAndTarget)
1238
- return;
1239
- v = r.getLength(), v != 0 && (D = this.springConstant * (v - h), u = D * (r.lengthX / v), T = D * (r.lengthY / v), a.springForceX += u, a.springForceY += T, p.springForceX -= u, p.springForceY -= T);
1240
- }, n.prototype.calcRepulsionForce = function(r, h) {
1241
- var a = r.getRect(), p = h.getRect(), v = new Array(2), D = new Array(4), u, T, y, O, s, f, c;
1242
- if (a.intersects(p)) {
1243
- l.calcSeparationAmount(a, p, v, t.DEFAULT_EDGE_LENGTH / 2), f = 2 * v[0], c = 2 * v[1];
1244
- var E = r.noOfChildren * h.noOfChildren / (r.noOfChildren + h.noOfChildren);
1245
- r.repulsionForceX -= E * f, r.repulsionForceY -= E * c, h.repulsionForceX += E * f, h.repulsionForceY += E * c;
1246
- } else
1247
- this.uniformLeafNodeSizes && r.getChild() == null && h.getChild() == null ? (u = p.getCenterX() - a.getCenterX(), T = p.getCenterY() - a.getCenterY()) : (l.getIntersection(a, p, D), u = D[2] - D[0], T = D[3] - D[1]), Math.abs(u) < t.MIN_REPULSION_DIST && (u = g.sign(u) * t.MIN_REPULSION_DIST), Math.abs(T) < t.MIN_REPULSION_DIST && (T = g.sign(T) * t.MIN_REPULSION_DIST), y = u * u + T * T, O = Math.sqrt(y), s = this.repulsionConstant * r.noOfChildren * h.noOfChildren / y, f = s * u / O, c = s * T / O, r.repulsionForceX -= f, r.repulsionForceY -= c, h.repulsionForceX += f, h.repulsionForceY += c;
1248
- }, n.prototype.calcGravitationalForce = function(r) {
1249
- var h, a, p, v, D, u, T, y;
1250
- h = r.getOwner(), a = (h.getRight() + h.getLeft()) / 2, p = (h.getTop() + h.getBottom()) / 2, v = r.getCenterX() - a, D = r.getCenterY() - p, u = Math.abs(v) + r.getWidth() / 2, T = Math.abs(D) + r.getHeight() / 2, r.getOwner() == this.graphManager.getRoot() ? (y = h.getEstimatedSize() * this.gravityRangeFactor, (u > y || T > y) && (r.gravitationForceX = -this.gravityConstant * v, r.gravitationForceY = -this.gravityConstant * D)) : (y = h.getEstimatedSize() * this.compoundGravityRangeFactor, (u > y || T > y) && (r.gravitationForceX = -this.gravityConstant * v * this.compoundGravityConstant, r.gravitationForceY = -this.gravityConstant * D * this.compoundGravityConstant));
1251
- }, n.prototype.isConverged = function() {
1252
- var r, h = !1;
1253
- return this.totalIterations > this.maxIterations / 3 && (h = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), r = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, r || h;
1254
- }, n.prototype.animate = function() {
1255
- this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1256
- }, n.prototype.calcNoOfChildrenForAllNodes = function() {
1257
- for (var r, h = this.graphManager.getAllNodes(), a = 0; a < h.length; a++)
1258
- r = h[a], r.noOfChildren = r.getNoOfChildren();
1259
- }, n.prototype.calcGrid = function(r) {
1260
- var h = 0, a = 0;
1261
- h = parseInt(Math.ceil((r.getRight() - r.getLeft()) / this.repulsionRange)), a = parseInt(Math.ceil((r.getBottom() - r.getTop()) / this.repulsionRange));
1262
- for (var p = new Array(h), v = 0; v < h; v++)
1263
- p[v] = new Array(a);
1264
- for (var v = 0; v < h; v++)
1265
- for (var D = 0; D < a; D++)
1266
- p[v][D] = new Array();
1267
- return p;
1268
- }, n.prototype.addNodeToGrid = function(r, h, a) {
1269
- var p = 0, v = 0, D = 0, u = 0;
1270
- p = parseInt(Math.floor((r.getRect().x - h) / this.repulsionRange)), v = parseInt(Math.floor((r.getRect().width + r.getRect().x - h) / this.repulsionRange)), D = parseInt(Math.floor((r.getRect().y - a) / this.repulsionRange)), u = parseInt(Math.floor((r.getRect().height + r.getRect().y - a) / this.repulsionRange));
1271
- for (var T = p; T <= v; T++)
1272
- for (var y = D; y <= u; y++)
1273
- this.grid[T][y].push(r), r.setGridCoordinates(p, v, D, u);
1274
- }, n.prototype.updateGrid = function() {
1275
- var r, h, a = this.getAllNodes();
1276
- for (this.grid = this.calcGrid(this.graphManager.getRoot()), r = 0; r < a.length; r++)
1277
- h = a[r], this.addNodeToGrid(h, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1278
- }, n.prototype.calculateRepulsionForceOfANode = function(r, h, a, p) {
1279
- if (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && a || p) {
1280
- var v = /* @__PURE__ */ new Set();
1281
- r.surrounding = new Array();
1282
- for (var D, u = this.grid, T = r.startX - 1; T < r.finishX + 2; T++)
1283
- for (var y = r.startY - 1; y < r.finishY + 2; y++)
1284
- if (!(T < 0 || y < 0 || T >= u.length || y >= u[0].length)) {
1285
- for (var O = 0; O < u[T][y].length; O++)
1286
- if (D = u[T][y][O], !(r.getOwner() != D.getOwner() || r == D) && !h.has(D) && !v.has(D)) {
1287
- var s = Math.abs(r.getCenterX() - D.getCenterX()) - (r.getWidth() / 2 + D.getWidth() / 2), f = Math.abs(r.getCenterY() - D.getCenterY()) - (r.getHeight() / 2 + D.getHeight() / 2);
1288
- s <= this.repulsionRange && f <= this.repulsionRange && v.add(D);
1289
- }
1290
- }
1291
- r.surrounding = [].concat(o(v));
1292
- }
1293
- for (T = 0; T < r.surrounding.length; T++)
1294
- this.calcRepulsionForce(r, r.surrounding[T]);
1295
- }, n.prototype.calcRepulsionRange = function() {
1296
- return 0;
1297
- }, N.exports = n;
1298
- },
1299
- /* 19 */
1300
- /***/
1301
- function(N, I, L) {
1302
- var o = L(1), e = L(7);
1303
- function t(l, g, n) {
1304
- o.call(this, l, g, n), this.idealLength = e.DEFAULT_EDGE_LENGTH;
1305
- }
1306
- t.prototype = Object.create(o.prototype);
1307
- for (var i in o)
1308
- t[i] = o[i];
1309
- N.exports = t;
1310
- },
1311
- /* 20 */
1312
- /***/
1313
- function(N, I, L) {
1314
- var o = L(3);
1315
- function e(i, l, g, n) {
1316
- o.call(this, i, l, g, n), 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 = [];
1317
- }
1318
- e.prototype = Object.create(o.prototype);
1319
- for (var t in o)
1320
- e[t] = o[t];
1321
- e.prototype.setGridCoordinates = function(i, l, g, n) {
1322
- this.startX = i, this.finishX = l, this.startY = g, this.finishY = n;
1323
- }, N.exports = e;
1324
- },
1325
- /* 21 */
1326
- /***/
1327
- function(N, I, L) {
1328
- function o(e, t) {
1329
- this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
1330
- }
1331
- o.prototype.getWidth = function() {
1332
- return this.width;
1333
- }, o.prototype.setWidth = function(e) {
1334
- this.width = e;
1335
- }, o.prototype.getHeight = function() {
1336
- return this.height;
1337
- }, o.prototype.setHeight = function(e) {
1338
- this.height = e;
1339
- }, N.exports = o;
1340
- },
1341
- /* 22 */
1342
- /***/
1343
- function(N, I, L) {
1344
- var o = L(14);
1345
- function e() {
1346
- this.map = {}, this.keys = [];
1347
- }
1348
- e.prototype.put = function(t, i) {
1349
- var l = o.createID(t);
1350
- this.contains(l) || (this.map[l] = i, this.keys.push(t));
1351
- }, e.prototype.contains = function(t) {
1352
- return o.createID(t), this.map[t] != null;
1353
- }, e.prototype.get = function(t) {
1354
- var i = o.createID(t);
1355
- return this.map[i];
1356
- }, e.prototype.keySet = function() {
1357
- return this.keys;
1358
- }, N.exports = e;
1359
- },
1360
- /* 23 */
1361
- /***/
1362
- function(N, I, L) {
1363
- var o = L(14);
1364
- function e() {
1365
- this.set = {};
1366
- }
1367
- e.prototype.add = function(t) {
1368
- var i = o.createID(t);
1369
- this.contains(i) || (this.set[i] = t);
1370
- }, e.prototype.remove = function(t) {
1371
- delete this.set[o.createID(t)];
1372
- }, e.prototype.clear = function() {
1373
- this.set = {};
1374
- }, e.prototype.contains = function(t) {
1375
- return this.set[o.createID(t)] == t;
1376
- }, e.prototype.isEmpty = function() {
1377
- return this.size() === 0;
1378
- }, e.prototype.size = function() {
1379
- return Object.keys(this.set).length;
1380
- }, e.prototype.addAllTo = function(t) {
1381
- for (var i = Object.keys(this.set), l = i.length, g = 0; g < l; g++)
1382
- t.push(this.set[i[g]]);
1383
- }, e.prototype.size = function() {
1384
- return Object.keys(this.set).length;
1385
- }, e.prototype.addAll = function(t) {
1386
- for (var i = t.length, l = 0; l < i; l++) {
1387
- var g = t[l];
1388
- this.add(g);
1389
- }
1390
- }, N.exports = e;
1391
- },
1392
- /* 24 */
1393
- /***/
1394
- function(N, I, L) {
1395
- var o = /* @__PURE__ */ function() {
1396
- function l(g, n) {
1397
- for (var d = 0; d < n.length; d++) {
1398
- var r = n[d];
1399
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(g, r.key, r);
1400
- }
1401
- }
1402
- return function(g, n, d) {
1403
- return n && l(g.prototype, n), d && l(g, d), g;
1404
- };
1405
- }();
1406
- function e(l, g) {
1407
- if (!(l instanceof g))
1408
- throw new TypeError("Cannot call a class as a function");
1409
- }
1410
- var t = L(11), i = function() {
1411
- function l(g, n) {
1412
- e(this, l), (n !== null || n !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1413
- var d = void 0;
1414
- g instanceof t ? d = g.size() : d = g.length, this._quicksort(g, 0, d - 1);
1415
- }
1416
- return o(l, [{
1417
- key: "_quicksort",
1418
- value: function(n, d, r) {
1419
- if (d < r) {
1420
- var h = this._partition(n, d, r);
1421
- this._quicksort(n, d, h), this._quicksort(n, h + 1, r);
1422
- }
1423
- }
1424
- }, {
1425
- key: "_partition",
1426
- value: function(n, d, r) {
1427
- for (var h = this._get(n, d), a = d, p = r; ; ) {
1428
- for (; this.compareFunction(h, this._get(n, p)); )
1429
- p--;
1430
- for (; this.compareFunction(this._get(n, a), h); )
1431
- a++;
1432
- if (a < p)
1433
- this._swap(n, a, p), a++, p--;
1434
- else return p;
1435
- }
1436
- }
1437
- }, {
1438
- key: "_get",
1439
- value: function(n, d) {
1440
- return n instanceof t ? n.get_object_at(d) : n[d];
1441
- }
1442
- }, {
1443
- key: "_set",
1444
- value: function(n, d, r) {
1445
- n instanceof t ? n.set_object_at(d, r) : n[d] = r;
1446
- }
1447
- }, {
1448
- key: "_swap",
1449
- value: function(n, d, r) {
1450
- var h = this._get(n, d);
1451
- this._set(n, d, this._get(n, r)), this._set(n, r, h);
1452
- }
1453
- }, {
1454
- key: "_defaultCompareFunction",
1455
- value: function(n, d) {
1456
- return d > n;
1457
- }
1458
- }]), l;
1459
- }();
1460
- N.exports = i;
1461
- },
1462
- /* 25 */
1463
- /***/
1464
- function(N, I, L) {
1465
- var o = /* @__PURE__ */ function() {
1466
- function i(l, g) {
1467
- for (var n = 0; n < g.length; n++) {
1468
- var d = g[n];
1469
- d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(l, d.key, d);
1470
- }
1471
- }
1472
- return function(l, g, n) {
1473
- return g && i(l.prototype, g), n && i(l, n), l;
1474
- };
1475
- }();
1476
- function e(i, l) {
1477
- if (!(i instanceof l))
1478
- throw new TypeError("Cannot call a class as a function");
1479
- }
1480
- var t = function() {
1481
- function i(l, g) {
1482
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, d = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1483
- e(this, i), this.sequence1 = l, this.sequence2 = g, this.match_score = n, this.mismatch_penalty = d, this.gap_penalty = r, this.iMax = l.length + 1, this.jMax = g.length + 1, this.grid = new Array(this.iMax);
1484
- for (var h = 0; h < this.iMax; h++) {
1485
- this.grid[h] = new Array(this.jMax);
1486
- for (var a = 0; a < this.jMax; a++)
1487
- this.grid[h][a] = 0;
1488
- }
1489
- this.tracebackGrid = new Array(this.iMax);
1490
- for (var p = 0; p < this.iMax; p++) {
1491
- this.tracebackGrid[p] = new Array(this.jMax);
1492
- for (var v = 0; v < this.jMax; v++)
1493
- this.tracebackGrid[p][v] = [null, null, null];
1494
- }
1495
- this.alignments = [], this.score = -1, this.computeGrids();
1496
- }
1497
- return o(i, [{
1498
- key: "getScore",
1499
- value: function() {
1500
- return this.score;
1501
- }
1502
- }, {
1503
- key: "getAlignments",
1504
- value: function() {
1505
- return this.alignments;
1506
- }
1507
- // Main dynamic programming procedure
1508
- }, {
1509
- key: "computeGrids",
1510
- value: function() {
1511
- for (var g = 1; g < this.jMax; g++)
1512
- this.grid[0][g] = this.grid[0][g - 1] + this.gap_penalty, this.tracebackGrid[0][g] = [!1, !1, !0];
1513
- for (var n = 1; n < this.iMax; n++)
1514
- this.grid[n][0] = this.grid[n - 1][0] + this.gap_penalty, this.tracebackGrid[n][0] = [!1, !0, !1];
1515
- for (var d = 1; d < this.iMax; d++)
1516
- for (var r = 1; r < this.jMax; r++) {
1517
- var h = void 0;
1518
- this.sequence1[d - 1] === this.sequence2[r - 1] ? h = this.grid[d - 1][r - 1] + this.match_score : h = this.grid[d - 1][r - 1] + this.mismatch_penalty;
1519
- var a = this.grid[d - 1][r] + this.gap_penalty, p = this.grid[d][r - 1] + this.gap_penalty, v = [h, a, p], D = this.arrayAllMaxIndexes(v);
1520
- this.grid[d][r] = v[D[0]], this.tracebackGrid[d][r] = [D.includes(0), D.includes(1), D.includes(2)];
1521
- }
1522
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
1523
- }
1524
- // Gets all possible valid sequence combinations
1525
- }, {
1526
- key: "alignmentTraceback",
1527
- value: function() {
1528
- var g = [];
1529
- for (g.push({
1530
- pos: [this.sequence1.length, this.sequence2.length],
1531
- seq1: "",
1532
- seq2: ""
1533
- }); g[0]; ) {
1534
- var n = g[0], d = this.tracebackGrid[n.pos[0]][n.pos[1]];
1535
- d[0] && g.push({
1536
- pos: [n.pos[0] - 1, n.pos[1] - 1],
1537
- seq1: this.sequence1[n.pos[0] - 1] + n.seq1,
1538
- seq2: this.sequence2[n.pos[1] - 1] + n.seq2
1539
- }), d[1] && g.push({
1540
- pos: [n.pos[0] - 1, n.pos[1]],
1541
- seq1: this.sequence1[n.pos[0] - 1] + n.seq1,
1542
- seq2: "-" + n.seq2
1543
- }), d[2] && g.push({
1544
- pos: [n.pos[0], n.pos[1] - 1],
1545
- seq1: "-" + n.seq1,
1546
- seq2: this.sequence2[n.pos[1] - 1] + n.seq2
1547
- }), n.pos[0] === 0 && n.pos[1] === 0 && this.alignments.push({
1548
- sequence1: n.seq1,
1549
- sequence2: n.seq2
1550
- }), g.shift();
1551
- }
1552
- return this.alignments;
1553
- }
1554
- // Helper Functions
1555
- }, {
1556
- key: "getAllIndexes",
1557
- value: function(g, n) {
1558
- for (var d = [], r = -1; (r = g.indexOf(n, r + 1)) !== -1; )
1559
- d.push(r);
1560
- return d;
1561
- }
1562
- }, {
1563
- key: "arrayAllMaxIndexes",
1564
- value: function(g) {
1565
- return this.getAllIndexes(g, Math.max.apply(null, g));
1566
- }
1567
- }]), i;
1568
- }();
1569
- N.exports = t;
1570
- },
1571
- /* 26 */
1572
- /***/
1573
- function(N, I, L) {
1574
- var o = function() {
1575
- };
1576
- o.FDLayout = L(18), o.FDLayoutConstants = L(7), o.FDLayoutEdge = L(19), o.FDLayoutNode = L(20), o.DimensionD = L(21), o.HashMap = L(22), o.HashSet = L(23), o.IGeometry = L(8), o.IMath = L(9), o.Integer = L(10), o.Point = L(12), o.PointD = L(4), o.RandomSeed = L(16), o.RectangleD = L(13), o.Transform = L(17), o.UniqueIDGeneretor = L(14), o.Quicksort = L(24), o.LinkedList = L(11), o.LGraphObject = L(2), o.LGraph = L(5), o.LEdge = L(1), o.LGraphManager = L(6), o.LNode = L(3), o.Layout = L(15), o.LayoutConstants = L(0), o.NeedlemanWunsch = L(25), N.exports = o;
1577
- },
1578
- /* 27 */
1579
- /***/
1580
- function(N, I, L) {
1581
- function o() {
1582
- this.listeners = [];
1583
- }
1584
- var e = o.prototype;
1585
- e.addListener = function(t, i) {
1586
- this.listeners.push({
1587
- event: t,
1588
- callback: i
1589
- });
1590
- }, e.removeListener = function(t, i) {
1591
- for (var l = this.listeners.length; l >= 0; l--) {
1592
- var g = this.listeners[l];
1593
- g.event === t && g.callback === i && this.listeners.splice(l, 1);
1594
- }
1595
- }, e.emit = function(t, i) {
1596
- for (var l = 0; l < this.listeners.length; l++) {
1597
- var g = this.listeners[l];
1598
- t === g.event && g.callback(i);
1599
- }
1600
- }, N.exports = o;
1601
- }
1602
- /******/
1603
- ])
1604
- );
1605
- });
1606
- }(Q)), Q.exports;
1607
- }
1608
- var z;
1609
- function ft() {
1610
- return z || (z = 1, function(G, b) {
1611
- (function(I, L) {
1612
- G.exports = L(ut());
1613
- })($, function(N) {
1614
- return (
1615
- /******/
1616
- function(I) {
1617
- var L = {};
1618
- function o(e) {
1619
- if (L[e])
1620
- return L[e].exports;
1621
- var t = L[e] = {
1622
- /******/
1623
- i: e,
1624
- /******/
1625
- l: !1,
1626
- /******/
1627
- exports: {}
1628
- /******/
1629
- };
1630
- return I[e].call(t.exports, t, t.exports, o), t.l = !0, t.exports;
1631
- }
1632
- return o.m = I, o.c = L, o.i = function(e) {
1633
- return e;
1634
- }, o.d = function(e, t, i) {
1635
- o.o(e, t) || Object.defineProperty(e, t, {
1636
- /******/
1637
- configurable: !1,
1638
- /******/
1639
- enumerable: !0,
1640
- /******/
1641
- get: i
1642
- /******/
1643
- });
1644
- }, o.n = function(e) {
1645
- var t = e && e.__esModule ? (
1646
- /******/
1647
- function() {
1648
- return e.default;
1649
- }
1650
- ) : (
1651
- /******/
1652
- function() {
1653
- return e;
1654
- }
1655
- );
1656
- return o.d(t, "a", t), t;
1657
- }, o.o = function(e, t) {
1658
- return Object.prototype.hasOwnProperty.call(e, t);
1659
- }, o.p = "", o(o.s = 7);
1660
- }([
1661
- /* 0 */
1662
- /***/
1663
- function(I, L) {
1664
- I.exports = N;
1665
- },
1666
- /* 1 */
1667
- /***/
1668
- function(I, L, o) {
1669
- var e = o(0).FDLayoutConstants;
1670
- function t() {
1671
- }
1672
- for (var i in e)
1673
- t[i] = e[i];
1674
- t.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, t.DEFAULT_RADIAL_SEPARATION = e.DEFAULT_EDGE_LENGTH, t.DEFAULT_COMPONENT_SEPERATION = 60, t.TILE = !0, t.TILING_PADDING_VERTICAL = 10, t.TILING_PADDING_HORIZONTAL = 10, t.TREE_REDUCTION_ON_INCREMENTAL = !1, I.exports = t;
1675
- },
1676
- /* 2 */
1677
- /***/
1678
- function(I, L, o) {
1679
- var e = o(0).FDLayoutEdge;
1680
- function t(l, g, n) {
1681
- e.call(this, l, g, n);
1682
- }
1683
- t.prototype = Object.create(e.prototype);
1684
- for (var i in e)
1685
- t[i] = e[i];
1686
- I.exports = t;
1687
- },
1688
- /* 3 */
1689
- /***/
1690
- function(I, L, o) {
1691
- var e = o(0).LGraph;
1692
- function t(l, g, n) {
1693
- e.call(this, l, g, n);
1694
- }
1695
- t.prototype = Object.create(e.prototype);
1696
- for (var i in e)
1697
- t[i] = e[i];
1698
- I.exports = t;
1699
- },
1700
- /* 4 */
1701
- /***/
1702
- function(I, L, o) {
1703
- var e = o(0).LGraphManager;
1704
- function t(l) {
1705
- e.call(this, l);
1706
- }
1707
- t.prototype = Object.create(e.prototype);
1708
- for (var i in e)
1709
- t[i] = e[i];
1710
- I.exports = t;
1711
- },
1712
- /* 5 */
1713
- /***/
1714
- function(I, L, o) {
1715
- var e = o(0).FDLayoutNode, t = o(0).IMath;
1716
- function i(g, n, d, r) {
1717
- e.call(this, g, n, d, r);
1718
- }
1719
- i.prototype = Object.create(e.prototype);
1720
- for (var l in e)
1721
- i[l] = e[l];
1722
- i.prototype.move = function() {
1723
- var g = this.graphManager.getLayout();
1724
- this.displacementX = g.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = g.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > g.coolingFactor * g.maxNodeDisplacement && (this.displacementX = g.coolingFactor * g.maxNodeDisplacement * t.sign(this.displacementX)), Math.abs(this.displacementY) > g.coolingFactor * g.maxNodeDisplacement && (this.displacementY = g.coolingFactor * g.maxNodeDisplacement * t.sign(this.displacementY)), this.child == null ? this.moveBy(this.displacementX, this.displacementY) : this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), g.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;
1725
- }, i.prototype.propogateDisplacementToChildren = function(g, n) {
1726
- for (var d = this.getChild().getNodes(), r, h = 0; h < d.length; h++)
1727
- r = d[h], r.getChild() == null ? (r.moveBy(g, n), r.displacementX += g, r.displacementY += n) : r.propogateDisplacementToChildren(g, n);
1728
- }, i.prototype.setPred1 = function(g) {
1729
- this.pred1 = g;
1730
- }, i.prototype.getPred1 = function() {
1731
- return pred1;
1732
- }, i.prototype.getPred2 = function() {
1733
- return pred2;
1734
- }, i.prototype.setNext = function(g) {
1735
- this.next = g;
1736
- }, i.prototype.getNext = function() {
1737
- return next;
1738
- }, i.prototype.setProcessed = function(g) {
1739
- this.processed = g;
1740
- }, i.prototype.isProcessed = function() {
1741
- return processed;
1742
- }, I.exports = i;
1743
- },
1744
- /* 6 */
1745
- /***/
1746
- function(I, L, o) {
1747
- var e = o(0).FDLayout, t = o(4), i = o(3), l = o(5), g = o(2), n = o(1), d = o(0).FDLayoutConstants, r = o(0).LayoutConstants, h = o(0).Point, a = o(0).PointD, p = o(0).Layout, v = o(0).Integer, D = o(0).IGeometry, u = o(0).LGraph, T = o(0).Transform;
1748
- function y() {
1749
- e.call(this), this.toBeTiled = {};
1750
- }
1751
- y.prototype = Object.create(e.prototype);
1752
- for (var O in e)
1753
- y[O] = e[O];
1754
- y.prototype.newGraphManager = function() {
1755
- var s = new t(this);
1756
- return this.graphManager = s, s;
1757
- }, y.prototype.newGraph = function(s) {
1758
- return new i(null, this.graphManager, s);
1759
- }, y.prototype.newNode = function(s) {
1760
- return new l(this.graphManager, s);
1761
- }, y.prototype.newEdge = function(s) {
1762
- return new g(null, null, s);
1763
- }, y.prototype.initParameters = function() {
1764
- e.prototype.initParameters.call(this, arguments), this.isSubLayout || (n.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = n.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = d.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = d.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = d.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = d.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = d.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / d.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = d.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1765
- }, y.prototype.layout = function() {
1766
- var s = r.DEFAULT_CREATE_BENDS_AS_NEEDED;
1767
- return s && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1768
- }, y.prototype.classicLayout = function() {
1769
- 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) {
1770
- if (n.TREE_REDUCTION_ON_INCREMENTAL) {
1771
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1772
- var f = new Set(this.getAllNodes()), c = this.nodesWithGravity.filter(function(m) {
1773
- return f.has(m);
1774
- });
1775
- this.graphManager.setAllNodesToApplyGravitation(c);
1776
- }
1777
- } else {
1778
- var s = this.getFlatForest();
1779
- if (s.length > 0)
1780
- this.positionNodesRadially(s);
1781
- else {
1782
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1783
- var f = new Set(this.getAllNodes()), c = this.nodesWithGravity.filter(function(E) {
1784
- return f.has(E);
1785
- });
1786
- this.graphManager.setAllNodesToApplyGravitation(c), this.positionNodesRandomly();
1787
- }
1788
- }
1789
- return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
1790
- }, y.prototype.tick = function() {
1791
- if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
1792
- if (this.prunedNodesAll.length > 0)
1793
- this.isTreeGrowing = !0;
1794
- else
1795
- return !0;
1796
- if (this.totalIterations % d.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1797
- if (this.isConverged())
1798
- if (this.prunedNodesAll.length > 0)
1799
- this.isTreeGrowing = !0;
1800
- else
1801
- return !0;
1802
- 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));
1803
- }
1804
- if (this.isTreeGrowing) {
1805
- if (this.growTreeIterations % 10 == 0)
1806
- if (this.prunedNodesAll.length > 0) {
1807
- this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1808
- var s = new Set(this.getAllNodes()), f = this.nodesWithGravity.filter(function(A) {
1809
- return s.has(A);
1810
- });
1811
- this.graphManager.setAllNodesToApplyGravitation(f), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = d.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1812
- } else
1813
- this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1814
- this.growTreeIterations++;
1815
- }
1816
- if (this.isGrowthFinished) {
1817
- if (this.isConverged())
1818
- return !0;
1819
- this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = d.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1820
- }
1821
- var c = !this.isTreeGrowing && !this.isGrowthFinished, E = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1822
- return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(c, E), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1823
- }, y.prototype.getPositionsData = function() {
1824
- for (var s = this.graphManager.getAllNodes(), f = {}, c = 0; c < s.length; c++) {
1825
- var E = s[c].rect, A = s[c].id;
1826
- f[A] = {
1827
- id: A,
1828
- x: E.getCenterX(),
1829
- y: E.getCenterY(),
1830
- w: E.width,
1831
- h: E.height
1832
- };
1833
- }
1834
- return f;
1835
- }, y.prototype.runSpringEmbedder = function() {
1836
- this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1837
- var s = !1;
1838
- if (d.ANIMATE === "during")
1839
- this.emit("layoutstarted");
1840
- else {
1841
- for (; !s; )
1842
- s = this.tick();
1843
- this.graphManager.updateBounds();
1844
- }
1845
- }, y.prototype.calculateNodesToApplyGravitationTo = function() {
1846
- var s = [], f, c = this.graphManager.getGraphs(), E = c.length, A;
1847
- for (A = 0; A < E; A++)
1848
- f = c[A], f.updateConnected(), f.isConnected || (s = s.concat(f.getNodes()));
1849
- return s;
1850
- }, y.prototype.createBendpoints = function() {
1851
- var s = [];
1852
- s = s.concat(this.graphManager.getAllEdges());
1853
- var f = /* @__PURE__ */ new Set(), c;
1854
- for (c = 0; c < s.length; c++) {
1855
- var E = s[c];
1856
- if (!f.has(E)) {
1857
- var A = E.getSource(), m = E.getTarget();
1858
- if (A == m)
1859
- E.getBendpoints().push(new a()), E.getBendpoints().push(new a()), this.createDummyNodesForBendpoints(E), f.add(E);
1860
- else {
1861
- var R = [];
1862
- if (R = R.concat(A.getEdgeListToNode(m)), R = R.concat(m.getEdgeListToNode(A)), !f.has(R[0])) {
1863
- if (R.length > 1) {
1864
- var C;
1865
- for (C = 0; C < R.length; C++) {
1866
- var M = R[C];
1867
- M.getBendpoints().push(new a()), this.createDummyNodesForBendpoints(M);
1868
- }
1869
- }
1870
- R.forEach(function(S) {
1871
- f.add(S);
1872
- });
1873
- }
1874
- }
1875
- }
1876
- if (f.size == s.length)
1877
- break;
1878
- }
1879
- }, y.prototype.positionNodesRadially = function(s) {
1880
- for (var f = new h(0, 0), c = Math.ceil(Math.sqrt(s.length)), E = 0, A = 0, m = 0, R = new a(0, 0), C = 0; C < s.length; C++) {
1881
- C % c == 0 && (m = 0, A = E, C != 0 && (A += n.DEFAULT_COMPONENT_SEPERATION), E = 0);
1882
- var M = s[C], S = p.findCenterOfTree(M);
1883
- f.x = m, f.y = A, R = y.radialLayout(M, S, f), R.y > E && (E = Math.floor(R.y)), m = Math.floor(R.x + n.DEFAULT_COMPONENT_SEPERATION);
1884
- }
1885
- this.transform(new a(r.WORLD_CENTER_X - R.x / 2, r.WORLD_CENTER_Y - R.y / 2));
1886
- }, y.radialLayout = function(s, f, c) {
1887
- var E = Math.max(this.maxDiagonalInTree(s), n.DEFAULT_RADIAL_SEPARATION);
1888
- y.branchRadialLayout(f, null, 0, 359, 0, E);
1889
- var A = u.calculateBounds(s), m = new T();
1890
- m.setDeviceOrgX(A.getMinX()), m.setDeviceOrgY(A.getMinY()), m.setWorldOrgX(c.x), m.setWorldOrgY(c.y);
1891
- for (var R = 0; R < s.length; R++) {
1892
- var C = s[R];
1893
- C.transform(m);
1894
- }
1895
- var M = new a(A.getMaxX(), A.getMaxY());
1896
- return m.inverseTransformPoint(M);
1897
- }, y.branchRadialLayout = function(s, f, c, E, A, m) {
1898
- var R = (E - c + 1) / 2;
1899
- R < 0 && (R += 180);
1900
- var C = (R + c) % 360, M = C * D.TWO_PI / 360, S = A * Math.cos(M), Y = A * Math.sin(M);
1901
- s.setCenter(S, Y);
1902
- var w = [];
1903
- w = w.concat(s.getEdges());
1904
- var x = w.length;
1905
- f != null && x--;
1906
- for (var F = 0, U = w.length, P, _ = s.getEdgesBetween(f); _.length > 1; ) {
1907
- var X = _[0];
1908
- _.splice(0, 1);
1909
- var H = w.indexOf(X);
1910
- H >= 0 && w.splice(H, 1), U--, x--;
1911
- }
1912
- f != null ? P = (w.indexOf(_[0]) + 1) % U : P = 0;
1913
- for (var W = Math.abs(E - c) / x, B = P; F != x; B = ++B % U) {
1914
- var K = w[B].getOtherEnd(s);
1915
- if (K != f) {
1916
- var j = (c + F * W) % 360, ht = (j + W) % 360;
1917
- y.branchRadialLayout(K, s, j, ht, A + m, m), F++;
1918
- }
1919
- }
1920
- }, y.maxDiagonalInTree = function(s) {
1921
- for (var f = v.MIN_VALUE, c = 0; c < s.length; c++) {
1922
- var E = s[c], A = E.getDiagonal();
1923
- A > f && (f = A);
1924
- }
1925
- return f;
1926
- }, y.prototype.calcRepulsionRange = function() {
1927
- return 2 * (this.level + 1) * this.idealEdgeLength;
1928
- }, y.prototype.groupZeroDegreeMembers = function() {
1929
- var s = this, f = {};
1930
- this.memberGroups = {}, this.idToDummyNode = {};
1931
- for (var c = [], E = this.graphManager.getAllNodes(), A = 0; A < E.length; A++) {
1932
- var m = E[A], R = m.getParent();
1933
- this.getNodeDegreeWithChildren(m) === 0 && (R.id == null || !this.getToBeTiled(R)) && c.push(m);
1934
- }
1935
- for (var A = 0; A < c.length; A++) {
1936
- var m = c[A], C = m.getParent().id;
1937
- typeof f[C] > "u" && (f[C] = []), f[C] = f[C].concat(m);
1938
- }
1939
- Object.keys(f).forEach(function(M) {
1940
- if (f[M].length > 1) {
1941
- var S = "DummyCompound_" + M;
1942
- s.memberGroups[S] = f[M];
1943
- var Y = f[M][0].getParent(), w = new l(s.graphManager);
1944
- w.id = S, w.paddingLeft = Y.paddingLeft || 0, w.paddingRight = Y.paddingRight || 0, w.paddingBottom = Y.paddingBottom || 0, w.paddingTop = Y.paddingTop || 0, s.idToDummyNode[S] = w;
1945
- var x = s.getGraphManager().add(s.newGraph(), w), F = Y.getChild();
1946
- F.add(w);
1947
- for (var U = 0; U < f[M].length; U++) {
1948
- var P = f[M][U];
1949
- F.remove(P), x.add(P);
1950
- }
1951
- }
1952
- });
1953
- }, y.prototype.clearCompounds = function() {
1954
- var s = {}, f = {};
1955
- this.performDFSOnCompounds();
1956
- for (var c = 0; c < this.compoundOrder.length; c++)
1957
- f[this.compoundOrder[c].id] = this.compoundOrder[c], s[this.compoundOrder[c].id] = [].concat(this.compoundOrder[c].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[c].getChild()), this.compoundOrder[c].child = null;
1958
- this.graphManager.resetAllNodes(), this.tileCompoundMembers(s, f);
1959
- }, y.prototype.clearZeroDegreeMembers = function() {
1960
- var s = this, f = this.tiledZeroDegreePack = [];
1961
- Object.keys(this.memberGroups).forEach(function(c) {
1962
- var E = s.idToDummyNode[c];
1963
- f[c] = s.tileNodes(s.memberGroups[c], E.paddingLeft + E.paddingRight), E.rect.width = f[c].width, E.rect.height = f[c].height;
1964
- });
1965
- }, y.prototype.repopulateCompounds = function() {
1966
- for (var s = this.compoundOrder.length - 1; s >= 0; s--) {
1967
- var f = this.compoundOrder[s], c = f.id, E = f.paddingLeft, A = f.paddingTop;
1968
- this.adjustLocations(this.tiledMemberPack[c], f.rect.x, f.rect.y, E, A);
1969
- }
1970
- }, y.prototype.repopulateZeroDegreeMembers = function() {
1971
- var s = this, f = this.tiledZeroDegreePack;
1972
- Object.keys(f).forEach(function(c) {
1973
- var E = s.idToDummyNode[c], A = E.paddingLeft, m = E.paddingTop;
1974
- s.adjustLocations(f[c], E.rect.x, E.rect.y, A, m);
1975
- });
1976
- }, y.prototype.getToBeTiled = function(s) {
1977
- var f = s.id;
1978
- if (this.toBeTiled[f] != null)
1979
- return this.toBeTiled[f];
1980
- var c = s.getChild();
1981
- if (c == null)
1982
- return this.toBeTiled[f] = !1, !1;
1983
- for (var E = c.getNodes(), A = 0; A < E.length; A++) {
1984
- var m = E[A];
1985
- if (this.getNodeDegree(m) > 0)
1986
- return this.toBeTiled[f] = !1, !1;
1987
- if (m.getChild() == null) {
1988
- this.toBeTiled[m.id] = !1;
1989
- continue;
1990
- }
1991
- if (!this.getToBeTiled(m))
1992
- return this.toBeTiled[f] = !1, !1;
1993
- }
1994
- return this.toBeTiled[f] = !0, !0;
1995
- }, y.prototype.getNodeDegree = function(s) {
1996
- s.id;
1997
- for (var f = s.getEdges(), c = 0, E = 0; E < f.length; E++) {
1998
- var A = f[E];
1999
- A.getSource().id !== A.getTarget().id && (c = c + 1);
2000
- }
2001
- return c;
2002
- }, y.prototype.getNodeDegreeWithChildren = function(s) {
2003
- var f = this.getNodeDegree(s);
2004
- if (s.getChild() == null)
2005
- return f;
2006
- for (var c = s.getChild().getNodes(), E = 0; E < c.length; E++) {
2007
- var A = c[E];
2008
- f += this.getNodeDegreeWithChildren(A);
2009
- }
2010
- return f;
2011
- }, y.prototype.performDFSOnCompounds = function() {
2012
- this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2013
- }, y.prototype.fillCompexOrderByDFS = function(s) {
2014
- for (var f = 0; f < s.length; f++) {
2015
- var c = s[f];
2016
- c.getChild() != null && this.fillCompexOrderByDFS(c.getChild().getNodes()), this.getToBeTiled(c) && this.compoundOrder.push(c);
2017
- }
2018
- }, y.prototype.adjustLocations = function(s, f, c, E, A) {
2019
- f += E, c += A;
2020
- for (var m = f, R = 0; R < s.rows.length; R++) {
2021
- var C = s.rows[R];
2022
- f = m;
2023
- for (var M = 0, S = 0; S < C.length; S++) {
2024
- var Y = C[S];
2025
- Y.rect.x = f, Y.rect.y = c, f += Y.rect.width + s.horizontalPadding, Y.rect.height > M && (M = Y.rect.height);
2026
- }
2027
- c += M + s.verticalPadding;
2028
- }
2029
- }, y.prototype.tileCompoundMembers = function(s, f) {
2030
- var c = this;
2031
- this.tiledMemberPack = [], Object.keys(s).forEach(function(E) {
2032
- var A = f[E];
2033
- c.tiledMemberPack[E] = c.tileNodes(s[E], A.paddingLeft + A.paddingRight), A.rect.width = c.tiledMemberPack[E].width, A.rect.height = c.tiledMemberPack[E].height;
2034
- });
2035
- }, y.prototype.tileNodes = function(s, f) {
2036
- var c = n.TILING_PADDING_VERTICAL, E = n.TILING_PADDING_HORIZONTAL, A = {
2037
- rows: [],
2038
- rowWidth: [],
2039
- rowHeight: [],
2040
- width: 0,
2041
- height: f,
2042
- // assume minHeight equals to minWidth
2043
- verticalPadding: c,
2044
- horizontalPadding: E
2045
- };
2046
- s.sort(function(C, M) {
2047
- return C.rect.width * C.rect.height > M.rect.width * M.rect.height ? -1 : C.rect.width * C.rect.height < M.rect.width * M.rect.height ? 1 : 0;
2048
- });
2049
- for (var m = 0; m < s.length; m++) {
2050
- var R = s[m];
2051
- A.rows.length == 0 ? this.insertNodeToRow(A, R, 0, f) : this.canAddHorizontal(A, R.rect.width, R.rect.height) ? this.insertNodeToRow(A, R, this.getShortestRowIndex(A), f) : this.insertNodeToRow(A, R, A.rows.length, f), this.shiftToLastRow(A);
2052
- }
2053
- return A;
2054
- }, y.prototype.insertNodeToRow = function(s, f, c, E) {
2055
- var A = E;
2056
- if (c == s.rows.length) {
2057
- var m = [];
2058
- s.rows.push(m), s.rowWidth.push(A), s.rowHeight.push(0);
2059
- }
2060
- var R = s.rowWidth[c] + f.rect.width;
2061
- s.rows[c].length > 0 && (R += s.horizontalPadding), s.rowWidth[c] = R, s.width < R && (s.width = R);
2062
- var C = f.rect.height;
2063
- c > 0 && (C += s.verticalPadding);
2064
- var M = 0;
2065
- C > s.rowHeight[c] && (M = s.rowHeight[c], s.rowHeight[c] = C, M = s.rowHeight[c] - M), s.height += M, s.rows[c].push(f);
2066
- }, y.prototype.getShortestRowIndex = function(s) {
2067
- for (var f = -1, c = Number.MAX_VALUE, E = 0; E < s.rows.length; E++)
2068
- s.rowWidth[E] < c && (f = E, c = s.rowWidth[E]);
2069
- return f;
2070
- }, y.prototype.getLongestRowIndex = function(s) {
2071
- for (var f = -1, c = Number.MIN_VALUE, E = 0; E < s.rows.length; E++)
2072
- s.rowWidth[E] > c && (f = E, c = s.rowWidth[E]);
2073
- return f;
2074
- }, y.prototype.canAddHorizontal = function(s, f, c) {
2075
- var E = this.getShortestRowIndex(s);
2076
- if (E < 0)
2077
- return !0;
2078
- var A = s.rowWidth[E];
2079
- if (A + s.horizontalPadding + f <= s.width) return !0;
2080
- var m = 0;
2081
- s.rowHeight[E] < c && E > 0 && (m = c + s.verticalPadding - s.rowHeight[E]);
2082
- var R;
2083
- s.width - A >= f + s.horizontalPadding ? R = (s.height + m) / (A + f + s.horizontalPadding) : R = (s.height + m) / s.width, m = c + s.verticalPadding;
2084
- var C;
2085
- return s.width < f ? C = (s.height + m) / f : C = (s.height + m) / s.width, C < 1 && (C = 1 / C), R < 1 && (R = 1 / R), R < C;
2086
- }, y.prototype.shiftToLastRow = function(s) {
2087
- var f = this.getLongestRowIndex(s), c = s.rowWidth.length - 1, E = s.rows[f], A = E[E.length - 1], m = A.width + s.horizontalPadding;
2088
- if (s.width - s.rowWidth[c] > m && f != c) {
2089
- E.splice(-1, 1), s.rows[c].push(A), s.rowWidth[f] = s.rowWidth[f] - m, s.rowWidth[c] = s.rowWidth[c] + m, s.width = s.rowWidth[instance.getLongestRowIndex(s)];
2090
- for (var R = Number.MIN_VALUE, C = 0; C < E.length; C++)
2091
- E[C].height > R && (R = E[C].height);
2092
- f > 0 && (R += s.verticalPadding);
2093
- var M = s.rowHeight[f] + s.rowHeight[c];
2094
- s.rowHeight[f] = R, s.rowHeight[c] < A.height + s.verticalPadding && (s.rowHeight[c] = A.height + s.verticalPadding);
2095
- var S = s.rowHeight[f] + s.rowHeight[c];
2096
- s.height += S - M, this.shiftToLastRow(s);
2097
- }
2098
- }, y.prototype.tilingPreLayout = function() {
2099
- n.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2100
- }, y.prototype.tilingPostLayout = function() {
2101
- n.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2102
- }, y.prototype.reduceTrees = function() {
2103
- for (var s = [], f = !0, c; f; ) {
2104
- var E = this.graphManager.getAllNodes(), A = [];
2105
- f = !1;
2106
- for (var m = 0; m < E.length; m++)
2107
- c = E[m], c.getEdges().length == 1 && !c.getEdges()[0].isInterGraph && c.getChild() == null && (A.push([c, c.getEdges()[0], c.getOwner()]), f = !0);
2108
- if (f == !0) {
2109
- for (var R = [], C = 0; C < A.length; C++)
2110
- A[C][0].getEdges().length == 1 && (R.push(A[C]), A[C][0].getOwner().remove(A[C][0]));
2111
- s.push(R), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2112
- }
2113
- }
2114
- this.prunedNodesAll = s;
2115
- }, y.prototype.growTree = function(s) {
2116
- for (var f = s.length, c = s[f - 1], E, A = 0; A < c.length; A++)
2117
- E = c[A], this.findPlaceforPrunedNode(E), E[2].add(E[0]), E[2].add(E[1], E[1].source, E[1].target);
2118
- s.splice(s.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2119
- }, y.prototype.findPlaceforPrunedNode = function(s) {
2120
- var f, c, E = s[0];
2121
- E == s[1].source ? c = s[1].target : c = s[1].source;
2122
- var A = c.startX, m = c.finishX, R = c.startY, C = c.finishY, M = 0, S = 0, Y = 0, w = 0, x = [M, Y, S, w];
2123
- if (R > 0)
2124
- for (var F = A; F <= m; F++)
2125
- x[0] += this.grid[F][R - 1].length + this.grid[F][R].length - 1;
2126
- if (m < this.grid.length - 1)
2127
- for (var F = R; F <= C; F++)
2128
- x[1] += this.grid[m + 1][F].length + this.grid[m][F].length - 1;
2129
- if (C < this.grid[0].length - 1)
2130
- for (var F = A; F <= m; F++)
2131
- x[2] += this.grid[F][C + 1].length + this.grid[F][C].length - 1;
2132
- if (A > 0)
2133
- for (var F = R; F <= C; F++)
2134
- x[3] += this.grid[A - 1][F].length + this.grid[A][F].length - 1;
2135
- for (var U = v.MAX_VALUE, P, _, X = 0; X < x.length; X++)
2136
- x[X] < U ? (U = x[X], P = 1, _ = X) : x[X] == U && P++;
2137
- if (P == 3 && U == 0)
2138
- x[0] == 0 && x[1] == 0 && x[2] == 0 ? f = 1 : x[0] == 0 && x[1] == 0 && x[3] == 0 ? f = 0 : x[0] == 0 && x[2] == 0 && x[3] == 0 ? f = 3 : x[1] == 0 && x[2] == 0 && x[3] == 0 && (f = 2);
2139
- else if (P == 2 && U == 0) {
2140
- var H = Math.floor(Math.random() * 2);
2141
- x[0] == 0 && x[1] == 0 ? H == 0 ? f = 0 : f = 1 : x[0] == 0 && x[2] == 0 ? H == 0 ? f = 0 : f = 2 : x[0] == 0 && x[3] == 0 ? H == 0 ? f = 0 : f = 3 : x[1] == 0 && x[2] == 0 ? H == 0 ? f = 1 : f = 2 : x[1] == 0 && x[3] == 0 ? H == 0 ? f = 1 : f = 3 : H == 0 ? f = 2 : f = 3;
2142
- } else if (P == 4 && U == 0) {
2143
- var H = Math.floor(Math.random() * 4);
2144
- f = H;
2145
- } else
2146
- f = _;
2147
- f == 0 ? E.setCenter(c.getCenterX(), c.getCenterY() - c.getHeight() / 2 - d.DEFAULT_EDGE_LENGTH - E.getHeight() / 2) : f == 1 ? E.setCenter(c.getCenterX() + c.getWidth() / 2 + d.DEFAULT_EDGE_LENGTH + E.getWidth() / 2, c.getCenterY()) : f == 2 ? E.setCenter(c.getCenterX(), c.getCenterY() + c.getHeight() / 2 + d.DEFAULT_EDGE_LENGTH + E.getHeight() / 2) : E.setCenter(c.getCenterX() - c.getWidth() / 2 - d.DEFAULT_EDGE_LENGTH - E.getWidth() / 2, c.getCenterY());
2148
- }, I.exports = y;
2149
- },
2150
- /* 7 */
2151
- /***/
2152
- function(I, L, o) {
2153
- var e = {};
2154
- e.layoutBase = o(0), e.CoSEConstants = o(1), e.CoSEEdge = o(2), e.CoSEGraph = o(3), e.CoSEGraphManager = o(4), e.CoSELayout = o(6), e.CoSENode = o(5), I.exports = e;
2155
- }
2156
- /******/
2157
- ])
2158
- );
2159
- });
2160
- }(Z)), Z.exports;
2161
- }
2162
- (function(G, b) {
2163
- (function(I, L) {
2164
- G.exports = L(ft());
2165
- })($, function(N) {
2166
- return (
2167
- /******/
2168
- function(I) {
2169
- var L = {};
2170
- function o(e) {
2171
- if (L[e])
2172
- return L[e].exports;
2173
- var t = L[e] = {
2174
- /******/
2175
- i: e,
2176
- /******/
2177
- l: !1,
2178
- /******/
2179
- exports: {}
2180
- /******/
2181
- };
2182
- return I[e].call(t.exports, t, t.exports, o), t.l = !0, t.exports;
2183
- }
2184
- return o.m = I, o.c = L, o.i = function(e) {
2185
- return e;
2186
- }, o.d = function(e, t, i) {
2187
- o.o(e, t) || Object.defineProperty(e, t, {
2188
- /******/
2189
- configurable: !1,
2190
- /******/
2191
- enumerable: !0,
2192
- /******/
2193
- get: i
2194
- /******/
2195
- });
2196
- }, o.n = function(e) {
2197
- var t = e && e.__esModule ? (
2198
- /******/
2199
- function() {
2200
- return e.default;
2201
- }
2202
- ) : (
2203
- /******/
2204
- function() {
2205
- return e;
2206
- }
2207
- );
2208
- return o.d(t, "a", t), t;
2209
- }, o.o = function(e, t) {
2210
- return Object.prototype.hasOwnProperty.call(e, t);
2211
- }, o.p = "", o(o.s = 1);
2212
- }([
2213
- /* 0 */
2214
- /***/
2215
- function(I, L) {
2216
- I.exports = N;
2217
- },
2218
- /* 1 */
2219
- /***/
2220
- function(I, L, o) {
2221
- var e = o(0).layoutBase.LayoutConstants, t = o(0).layoutBase.FDLayoutConstants, i = o(0).CoSEConstants, l = o(0).CoSELayout, g = o(0).CoSENode, n = o(0).layoutBase.PointD, d = o(0).layoutBase.DimensionD, r = {
2222
- // Called on `layoutready`
2223
- ready: function() {
2224
- },
2225
- // Called on `layoutstop`
2226
- stop: function() {
2227
- },
2228
- // 'draft', 'default' or 'proof"
2229
- // - 'draft' fast cooling rate
2230
- // - 'default' moderate cooling rate
2231
- // - "proof" slow cooling rate
2232
- quality: "default",
2233
- // include labels in node dimensions
2234
- nodeDimensionsIncludeLabels: !1,
2235
- // number of ticks per frame; higher is faster but more jerky
2236
- refresh: 30,
2237
- // Whether to fit the network view after when done
2238
- fit: !0,
2239
- // Padding on fit
2240
- padding: 10,
2241
- // Whether to enable incremental mode
2242
- randomize: !0,
2243
- // Node repulsion (non overlapping) multiplier
2244
- nodeRepulsion: 4500,
2245
- // Ideal edge (non nested) length
2246
- idealEdgeLength: 50,
2247
- // Divisor to compute edge forces
2248
- edgeElasticity: 0.45,
2249
- // Nesting factor (multiplier) to compute ideal edge length for nested edges
2250
- nestingFactor: 0.1,
2251
- // Gravity force (constant)
2252
- gravity: 0.25,
2253
- // Maximum number of iterations to perform
2254
- numIter: 2500,
2255
- // For enabling tiling
2256
- tile: !0,
2257
- // Type of layout animation. The option set is {'during', 'end', false}
2258
- animate: "end",
2259
- // Duration for animate:end
2260
- animationDuration: 500,
2261
- // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
2262
- tilingPaddingVertical: 10,
2263
- // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
2264
- tilingPaddingHorizontal: 10,
2265
- // Gravity range (constant) for compounds
2266
- gravityRangeCompound: 1.5,
2267
- // Gravity force (constant) for compounds
2268
- gravityCompound: 1,
2269
- // Gravity range (constant)
2270
- gravityRange: 3.8,
2271
- // Initial cooling factor for incremental layout
2272
- initialEnergyOnIncremental: 0.5
2273
- };
2274
- function h(D, u) {
2275
- var T = {};
2276
- for (var y in D)
2277
- T[y] = D[y];
2278
- for (var y in u)
2279
- T[y] = u[y];
2280
- return T;
2281
- }
2282
- function a(D) {
2283
- this.options = h(r, D), p(this.options);
2284
- }
2285
- var p = function(u) {
2286
- u.nodeRepulsion != null && (i.DEFAULT_REPULSION_STRENGTH = t.DEFAULT_REPULSION_STRENGTH = u.nodeRepulsion), u.idealEdgeLength != null && (i.DEFAULT_EDGE_LENGTH = t.DEFAULT_EDGE_LENGTH = u.idealEdgeLength), u.edgeElasticity != null && (i.DEFAULT_SPRING_STRENGTH = t.DEFAULT_SPRING_STRENGTH = u.edgeElasticity), u.nestingFactor != null && (i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = u.nestingFactor), u.gravity != null && (i.DEFAULT_GRAVITY_STRENGTH = t.DEFAULT_GRAVITY_STRENGTH = u.gravity), u.numIter != null && (i.MAX_ITERATIONS = t.MAX_ITERATIONS = u.numIter), u.gravityRange != null && (i.DEFAULT_GRAVITY_RANGE_FACTOR = t.DEFAULT_GRAVITY_RANGE_FACTOR = u.gravityRange), u.gravityCompound != null && (i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH = u.gravityCompound), u.gravityRangeCompound != null && (i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = u.gravityRangeCompound), u.initialEnergyOnIncremental != null && (i.DEFAULT_COOLING_FACTOR_INCREMENTAL = t.DEFAULT_COOLING_FACTOR_INCREMENTAL = u.initialEnergyOnIncremental), u.quality == "draft" ? e.QUALITY = 0 : u.quality == "proof" ? e.QUALITY = 2 : e.QUALITY = 1, i.NODE_DIMENSIONS_INCLUDE_LABELS = t.NODE_DIMENSIONS_INCLUDE_LABELS = e.NODE_DIMENSIONS_INCLUDE_LABELS = u.nodeDimensionsIncludeLabels, i.DEFAULT_INCREMENTAL = t.DEFAULT_INCREMENTAL = e.DEFAULT_INCREMENTAL = !u.randomize, i.ANIMATE = t.ANIMATE = e.ANIMATE = u.animate, i.TILE = u.tile, i.TILING_PADDING_VERTICAL = typeof u.tilingPaddingVertical == "function" ? u.tilingPaddingVertical.call() : u.tilingPaddingVertical, i.TILING_PADDING_HORIZONTAL = typeof u.tilingPaddingHorizontal == "function" ? u.tilingPaddingHorizontal.call() : u.tilingPaddingHorizontal;
2287
- };
2288
- a.prototype.run = function() {
2289
- var D, u, T = this.options;
2290
- this.idToLNode = {};
2291
- var y = this.layout = new l(), O = this;
2292
- O.stopped = !1, this.cy = this.options.cy, this.cy.trigger({ type: "layoutstart", layout: this });
2293
- var s = y.newGraphManager();
2294
- this.gm = s;
2295
- var f = this.options.eles.nodes(), c = this.options.eles.edges();
2296
- this.root = s.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(f), y);
2297
- for (var E = 0; E < c.length; E++) {
2298
- var A = c[E], m = this.idToLNode[A.data("source")], R = this.idToLNode[A.data("target")];
2299
- if (m !== R && m.getEdgesBetween(R).length == 0) {
2300
- var C = s.add(y.newEdge(), m, R);
2301
- C.id = A.id();
2302
- }
2303
- }
2304
- var M = function(w, x) {
2305
- typeof w == "number" && (w = x);
2306
- var F = w.data("id"), U = O.idToLNode[F];
2307
- return {
2308
- x: U.getRect().getCenterX(),
2309
- y: U.getRect().getCenterY()
2310
- };
2311
- }, S = function Y() {
2312
- for (var w = function() {
2313
- T.fit && T.cy.fit(T.eles, T.padding), D || (D = !0, O.cy.one("layoutready", T.ready), O.cy.trigger({ type: "layoutready", layout: O }));
2314
- }, x = O.options.refresh, F, U = 0; U < x && !F; U++)
2315
- F = O.stopped || O.layout.tick();
2316
- if (F) {
2317
- y.checkLayoutSuccess() && !y.isSubLayout && y.doPostLayout(), y.tilingPostLayout && y.tilingPostLayout(), y.isLayoutFinished = !0, O.options.eles.nodes().positions(M), w(), O.cy.one("layoutstop", O.options.stop), O.cy.trigger({ type: "layoutstop", layout: O }), u && cancelAnimationFrame(u), D = !1;
2318
- return;
2319
- }
2320
- var P = O.layout.getPositionsData();
2321
- T.eles.nodes().positions(function(_, X) {
2322
- if (typeof _ == "number" && (_ = X), !_.isParent()) {
2323
- for (var H = _.id(), W = P[H], B = _; W == null && (W = P[B.data("parent")] || P["DummyCompound_" + B.data("parent")], P[H] = W, B = B.parent()[0], B != null); )
2324
- ;
2325
- return W != null ? {
2326
- x: W.x,
2327
- y: W.y
2328
- } : {
2329
- x: _.position("x"),
2330
- y: _.position("y")
2331
- };
2332
- }
2333
- }), w(), u = requestAnimationFrame(Y);
2334
- };
2335
- return y.addListener("layoutstarted", function() {
2336
- O.options.animate === "during" && (u = requestAnimationFrame(S));
2337
- }), y.runLayout(), this.options.animate !== "during" && (O.options.eles.nodes().not(":parent").layoutPositions(O, O.options, M), D = !1), this;
2338
- }, a.prototype.getTopMostNodes = function(D) {
2339
- for (var u = {}, T = 0; T < D.length; T++)
2340
- u[D[T].id()] = !0;
2341
- var y = D.filter(function(O, s) {
2342
- typeof O == "number" && (O = s);
2343
- for (var f = O.parent()[0]; f != null; ) {
2344
- if (u[f.id()])
2345
- return !1;
2346
- f = f.parent()[0];
2347
- }
2348
- return !0;
2349
- });
2350
- return y;
2351
- }, a.prototype.processChildrenList = function(D, u, T) {
2352
- for (var y = u.length, O = 0; O < y; O++) {
2353
- var s = u[O], f = s.children(), c, E = s.layoutDimensions({
2354
- nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels
2355
- });
2356
- if (s.outerWidth() != null && s.outerHeight() != null ? c = D.add(new g(T.graphManager, new n(s.position("x") - E.w / 2, s.position("y") - E.h / 2), new d(parseFloat(E.w), parseFloat(E.h)))) : c = D.add(new g(this.graphManager)), c.id = s.data("id"), c.paddingLeft = parseInt(s.css("padding")), c.paddingTop = parseInt(s.css("padding")), c.paddingRight = parseInt(s.css("padding")), c.paddingBottom = parseInt(s.css("padding")), this.options.nodeDimensionsIncludeLabels && s.isParent()) {
2357
- var A = s.boundingBox({ includeLabels: !0, includeNodes: !1 }).w, m = s.boundingBox({ includeLabels: !0, includeNodes: !1 }).h, R = s.css("text-halign");
2358
- c.labelWidth = A, c.labelHeight = m, c.labelPos = R;
2359
- }
2360
- if (this.idToLNode[s.data("id")] = c, isNaN(c.rect.x) && (c.rect.x = 0), isNaN(c.rect.y) && (c.rect.y = 0), f != null && f.length > 0) {
2361
- var C;
2362
- C = T.getGraphManager().add(T.newGraph(), c), this.processChildrenList(C, f, T);
2363
- }
2364
- }
2365
- }, a.prototype.stop = function() {
2366
- return this.stopped = !0, this;
2367
- };
2368
- var v = function(u) {
2369
- u("layout", "cose-bilkent", a);
2370
- };
2371
- typeof cytoscape < "u" && v(cytoscape), I.exports = v;
2372
- }
2373
- /******/
2374
- ])
2375
- );
2376
- });
2377
- })(tt);
2378
- var ct = tt.exports;
2379
- const pt = /* @__PURE__ */ lt(ct);
2380
- J.use(pt);
2381
- function et(G, b) {
2382
- G.forEach((N) => {
2383
- const I = {
2384
- id: N.id,
2385
- labelText: N.label,
2386
- height: N.height,
2387
- width: N.width,
2388
- padding: N.padding ?? 0
2389
- };
2390
- Object.keys(N).forEach((L) => {
2391
- ["id", "label", "height", "width", "padding", "x", "y"].includes(L) || (I[L] = N[L]);
2392
- }), b.add({
2393
- group: "nodes",
2394
- data: I,
2395
- position: {
2396
- x: N.x ?? 0,
2397
- y: N.y ?? 0
2398
- }
2399
- });
2400
- });
2401
- }
2402
- V(et, "addNodes");
2403
- function rt(G, b) {
2404
- G.forEach((N) => {
2405
- const I = {
2406
- id: N.id,
2407
- source: N.start,
2408
- target: N.end
2409
- };
2410
- Object.keys(N).forEach((L) => {
2411
- ["id", "start", "end"].includes(L) || (I[L] = N[L]);
2412
- }), b.add({
2413
- group: "edges",
2414
- data: I
2415
- });
2416
- });
2417
- }
2418
- V(rt, "addEdges");
2419
- function it(G) {
2420
- return new Promise((b) => {
2421
- const N = gt("body").append("div").attr("id", "cy").attr("style", "display:none"), I = J({
2422
- container: document.getElementById("cy"),
2423
- // container to render in
2424
- style: [
2425
- {
2426
- selector: "edge",
2427
- style: {
2428
- "curve-style": "bezier"
2429
- }
2430
- }
2431
- ]
2432
- });
2433
- N.remove(), et(G.nodes, I), rt(G.edges, I), I.nodes().forEach(function(o) {
2434
- o.layoutDimensions = () => {
2435
- const e = o.data();
2436
- return { w: e.width, h: e.height };
2437
- };
2438
- });
2439
- const L = {
2440
- name: "cose-bilkent",
2441
- // @ts-ignore Types for cose-bilkent are not correct?
2442
- quality: "proof",
2443
- styleEnabled: !1,
2444
- animate: !1
2445
- };
2446
- I.layout(L).run(), I.ready((o) => {
2447
- k.info("Cytoscape ready", o), b(I);
2448
- });
2449
- });
2450
- }
2451
- V(it, "createCytoscapeInstance");
2452
- function nt(G) {
2453
- return G.nodes().map((b) => {
2454
- const N = b.data(), I = b.position(), L = {
2455
- id: N.id,
2456
- x: I.x,
2457
- y: I.y
2458
- };
2459
- return Object.keys(N).forEach((o) => {
2460
- o !== "id" && (L[o] = N[o]);
2461
- }), L;
2462
- });
2463
- }
2464
- V(nt, "extractPositionedNodes");
2465
- function ot(G) {
2466
- return G.edges().map((b) => {
2467
- const N = b.data(), I = b._private.rscratch, L = {
2468
- id: N.id,
2469
- source: N.source,
2470
- target: N.target,
2471
- startX: I.startX,
2472
- startY: I.startY,
2473
- midX: I.midX,
2474
- midY: I.midY,
2475
- endX: I.endX,
2476
- endY: I.endY
2477
- };
2478
- return Object.keys(N).forEach((o) => {
2479
- ["id", "source", "target"].includes(o) || (L[o] = N[o]);
2480
- }), L;
2481
- });
2482
- }
2483
- V(ot, "extractPositionedEdges");
2484
- async function st(G, b) {
2485
- k.debug("Starting cose-bilkent layout algorithm");
2486
- try {
2487
- at(G);
2488
- const N = await it(G), I = nt(N), L = ot(N);
2489
- return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`), {
2490
- nodes: I,
2491
- edges: L
2492
- };
2493
- } catch (N) {
2494
- throw k.error("Error in cose-bilkent layout algorithm:", N), N;
2495
- }
2496
- }
2497
- V(st, "executeCoseBilkentLayout");
2498
- function at(G) {
2499
- if (!G)
2500
- throw new Error("Layout data is required");
2501
- if (!G.config)
2502
- throw new Error("Configuration is required in layout data");
2503
- if (!G.rootNode)
2504
- throw new Error("Root node is required");
2505
- if (!G.nodes || !Array.isArray(G.nodes))
2506
- throw new Error("No nodes found in layout data");
2507
- if (!Array.isArray(G.edges))
2508
- throw new Error("Edges array is required in layout data");
2509
- return !0;
2510
- }
2511
- V(at, "validateLayoutData");
2512
- var dt = /* @__PURE__ */ V(async (G, b, {
2513
- insertCluster: N,
2514
- insertEdge: I,
2515
- insertEdgeLabel: L,
2516
- insertMarkers: o,
2517
- insertNode: e,
2518
- log: t,
2519
- positionEdgeLabel: i
2520
- }, { algorithm: l }) => {
2521
- const g = {}, n = {}, d = b.select("g");
2522
- o(d, G.markers, G.type, G.diagramId);
2523
- const r = d.insert("g").attr("class", "subgraphs"), h = d.insert("g").attr("class", "edgePaths"), a = d.insert("g").attr("class", "edgeLabels"), p = d.insert("g").attr("class", "nodes");
2524
- t.debug("Inserting nodes into DOM for dimension calculation"), await Promise.all(
2525
- G.nodes.map(async (u) => {
2526
- if (u.isGroup) {
2527
- const T = { ...u };
2528
- n[u.id] = T, g[u.id] = T, await N(r, u);
2529
- } else {
2530
- const T = { ...u };
2531
- g[u.id] = T;
2532
- const y = await e(p, u, {
2533
- config: G.config,
2534
- dir: G.direction || "TB"
2535
- }), O = y.node().getBBox();
2536
- T.width = O.width, T.height = O.height, T.domId = y, t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`);
2537
- }
2538
- })
2539
- ), t.debug("Running cose-bilkent layout algorithm");
2540
- const v = {
2541
- ...G,
2542
- nodes: G.nodes.map((u) => {
2543
- const T = g[u.id];
2544
- return {
2545
- ...u,
2546
- width: T.width,
2547
- height: T.height
2548
- };
2549
- })
2550
- }, D = await st(v, G.config);
2551
- t.debug("Positioning nodes based on layout results"), D.nodes.forEach((u) => {
2552
- const T = g[u.id];
2553
- T?.domId && (T.domId.attr(
2554
- "transform",
2555
- `translate(${u.x}, ${u.y})`
2556
- ), T.x = u.x, T.y = u.y, t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`));
2557
- }), D.edges.forEach((u) => {
2558
- const T = G.edges.find((y) => y.id === u.id);
2559
- T && (T.points = [
2560
- { x: u.startX, y: u.startY },
2561
- { x: u.midX, y: u.midY },
2562
- { x: u.endX, y: u.endY }
2563
- ]);
2564
- }), t.debug("Inserting and positioning edges"), await Promise.all(
2565
- G.edges.map(async (u) => {
2566
- await L(a, u);
2567
- const T = g[u.start ?? ""], y = g[u.end ?? ""];
2568
- if (T && y) {
2569
- const O = D.edges.find((s) => s.id === u.id);
2570
- if (O) {
2571
- t.debug("APA01 positionedEdge", O);
2572
- const s = { ...u }, f = I(
2573
- h,
2574
- s,
2575
- n,
2576
- G.type,
2577
- T,
2578
- y,
2579
- G.diagramId
2580
- );
2581
- i(s, f);
2582
- } else {
2583
- const s = {
2584
- ...u,
2585
- points: [
2586
- { x: T.x || 0, y: T.y || 0 },
2587
- { x: y.x || 0, y: y.y || 0 }
2588
- ]
2589
- }, f = I(
2590
- h,
2591
- s,
2592
- n,
2593
- G.type,
2594
- T,
2595
- y,
2596
- G.diagramId
2597
- );
2598
- i(s, f);
2599
- }
2600
- }
2601
- })
2602
- ), t.debug("Cose-bilkent rendering completed");
2603
- }, "render"), Lt = dt;
2604
- export {
2605
- Lt as render
2606
- };