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