@kong-ui-public/documentation 1.7.3-pr.3596.41e70338d.0 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arc-DZdQjcG8-CduayE88.js +79 -0
- package/dist/architectureDiagram-3BPJPVTR-By_DXDyu-U3MSLbOU.js +4065 -0
- package/dist/astro-D8QEIUE9-nzvtSwAQ.js +18 -0
- package/dist/blockDiagram-GPEHLZMM-9Cp9Hbl7-CKP-SiVG.js +3268 -0
- package/dist/c-GOwUpV7U-DMPKLUI8.js +4 -0
- package/dist/c4Diagram-AAUBKEIU-ftdwlfdB-D3A61SdV.js +3035 -0
- package/dist/catppuccin-latte-BcV8jije-D8pvGdu1.js +4 -0
- package/dist/channel-DM9j7IFL-DxqBUxfY.js +5 -0
- package/dist/chunk-2J33WTMH-CBbjVzWb-0og4LHQ-.js +24 -0
- package/dist/chunk-4BX2VUAB-C_NnimAy--QQ0Db2V.js +8 -0
- package/dist/chunk-55IACEB6-DZn1aNO0-A3zOZ7dT.js +8 -0
- package/dist/chunk-727SXJPM-B2_6_WLv-Bs3CxHaX.js +3445 -0
- package/dist/chunk-AQP2D5EJ-DEAEiJjW-DTbwZT8N.js +2096 -0
- package/dist/chunk-FMBD7UC4-D_tZ4Dxg-DwjoPGUH.js +19 -0
- package/dist/chunk-ND2GUHAM-Duw3k8MU-HmrdHLJ9.js +65 -0
- package/dist/chunk-QZHKN3VN-DN6nBdn0-BvQOETVz.js +12 -0
- package/dist/classDiagram-4FO5ZUOK-Du5qFrfN-BqXc0etQ.js +17 -0
- package/dist/classDiagram-v2-Q7XG4LA2-DM6zutfc-BqXc0etQ.js +17 -0
- package/dist/cose-bilkent-S5V4N54A-0ZumbVgj-0z7CQbIH.js +2260 -0
- package/dist/csharp-Cy04UeDC-OaGPefhL.js +4 -0
- package/dist/css-CJQ-rcMF-B_2PRTA_.js +4 -0
- package/dist/csv-Bx_Umlp--BPWcOTV4.js +4 -0
- package/dist/cytoscape.esm-BDIiOYYO-C1jMBhD8.js +18220 -0
- package/dist/dagre-BM42HDAG-qMWMsyLb-DGMrq3i3.js +288 -0
- package/dist/dagre-DJxg_nfI-hVOVexz-.js +1687 -0
- package/dist/defaultLocale-mtMQ0U8A-D6jPixjH.js +182 -0
- package/dist/diagram-2AECGRRQ-B2gF_dHe-Bv_EpxRz.js +210 -0
- package/dist/diagram-5GNKFQAL-DJ9WwRrD-WVvm0Icu.js +99 -0
- package/dist/diagram-KO2AKTUF-RfkqD-VW-yyAds1Qq.js +439 -0
- package/dist/diagram-LMA3HP47-Ct7s9hIt-Dy6f9BAO.js +127 -0
- package/dist/diagram-OG6HWLK6-BSYJ2CoI-ckmfat-L.js +475 -0
- package/dist/diff-DZRtXnMG-DenOJuyV.js +4 -0
- package/dist/docker-DQBBDNmU-xX8PDoIv.js +4 -0
- package/dist/documentation.es.js +7 -0
- package/dist/documentation.umd.js +3474 -0
- package/dist/erDiagram-TEJ5UH35-BudwiSYX-bVzp1Kjr.js +1773 -0
- package/dist/flowDiagram-I6XJVG4X-B23Smlxp-ClHvdCdJ.js +4258 -0
- package/dist/ganttDiagram-6RSMTGT7-C-i89z_P-t5UAyRM5.js +3099 -0
- package/dist/git-commit-BOgnKaZ8-Csu8eMzs.js +5 -0
- package/dist/git-rebase-0v-YFIjP-D701iWbX.js +5 -0
- package/dist/gitGraphDiagram-PVQCEYII-DpVfXnUD-Cg3smOdz.js +734 -0
- package/dist/go-DpaXbCNA-DqSXHrGo.js +4 -0
- package/dist/graphlib-D2YdGpuK-CnQPmzkS.js +1071 -0
- package/dist/graphql-BSO8hVnT-C6Okg5tI.js +14 -0
- package/dist/haml-DizLz-gS-BWwS-eha.js +10 -0
- package/dist/handlebars-tnt1-4s--xVtJSIx5.js +14 -0
- package/dist/haskell-BDLr0yXS-BlmVjKNy.js +4 -0
- package/dist/html-DdIT5Pi9-C35UyBqr.js +10 -0
- package/dist/html-derivative-BHAKSQcK-BChKhjnv.js +5 -0
- package/dist/http-DRk-iX-V-DQ76ihB0.js +14 -0
- package/dist/index-DfVKdDwj.js +40029 -0
- package/dist/infoDiagram-5YYISTIA-CDUwzFql-Bmthmcp4.js +18 -0
- package/dist/ini-D-uG5DCC-70PBzbbb.js +4 -0
- package/dist/init-8lPFe2y8-B2MlpiqM.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-MfYdx0rK-cbltssua.js +728 -0
- package/dist/java-CQQr73XR-D6YBp1XX.js +4 -0
- package/dist/javascript-CXmFGv-C-BRPKgr3C.js +4 -0
- package/dist/journeyDiagram-JHISSGLW-C_udOPtJ-BjAvgSAR.js +908 -0
- package/dist/json-BXFRNzj8-D8uacQj0.js +4 -0
- package/dist/json5-B5-J7v9w-Biib5ALh.js +4 -0
- package/dist/jsonc-CeA7x8NU-BZEKkMok.js +4 -0
- package/dist/jsonl-BBlxch9W-BG2V-IA2.js +4 -0
- package/dist/jsx-DucQCby8-Cl0AMtmu.js +4 -0
- package/dist/kanban-definition-UN3LZRKU-C1Su-UOY-DZ93dsWZ.js +1028 -0
- package/dist/katex-D7tFlpqA-BOSQxXe1.js +22315 -0
- package/dist/kotlin-CDXyBjvc-Dy_91eL4.js +4 -0
- package/dist/latex-COX74REd-l1quglTx.js +5 -0
- package/dist/less-QqooI0UQ-tcNg8M2_.js +4 -0
- package/dist/linear-1MXhYum8-9C1jno9G.js +255 -0
- package/dist/liquid-CsynDTV--Bdhb3gsJ.js +14 -0
- package/dist/lua-B3xrKnOz-Coo0MCwO.js +5 -0
- package/dist/make-eFBmESRY-CrUl7LOH.js +4 -0
- package/dist/markdown-DkQv9NwM-Bcqt-5kX.js +4 -0
- package/dist/material-theme-darker-Bp7Jj852-DMHCIvq5.js +4 -0
- package/dist/mdc-BK-Z5Xv--aFc-Oyv5.js +12 -0
- package/dist/mdx-CjbEMaEg-CK6jOqmu.js +4 -0
- package/dist/mermaid-Ccfpee4A-BgbNnQO5.js +4 -0
- package/dist/mindmap-definition-RKZ34NQL-MuSV765K-Kub1iXFv.js +1026 -0
- package/dist/nginx-DQrs__jO-BS9Jcr4V.js +5 -0
- package/dist/objective-c-CXg1TPY9-C809HPrX.js +4 -0
- package/dist/ordinal-D9ksOc8y-2hZwLyEk.js +63 -0
- package/dist/pascal-C6L9Tn1x-a8whuidZ.js +4 -0
- package/dist/perl-Dbi-SlHs-DsZjIGqU.js +16 -0
- package/dist/php-J5w8HAya-DnRg4f-g.js +18 -0
- package/dist/pieDiagram-4H26LBE5-TgFp7J6_-i6NxP3Xz.js +153 -0
- package/dist/plsql-Ba_yrVwL-BJoF2Vrf.js +4 -0
- package/dist/postcss-Bsoc__IZ-DaHMm3XW.js +4 -0
- package/dist/powershell-CKvM5hOe-Box9VSDW.js +4 -0
- package/dist/proto-iweZN-Ks-w0B_itsp.js +4 -0
- package/dist/pug-DUPsoXbW-BFHDRSax.js +12 -0
- package/dist/python-MxhgNM12-D_5pfY__.js +4 -0
- package/dist/quadrantDiagram-W4KKPZXB-DKPne3o_-DXLHqRuR.js +2046 -0
- package/dist/r-CoGPXt5G-BrbXTU3W.js +4 -0
- package/dist/reg-CHAl2UuA-bHAwx9Pm.js +4 -0
- package/dist/requirementDiagram-4Y6WPE33-vh8uUAp_-CHtsISxP.js +2281 -0
- package/dist/rst-D-Zcnz0t-C3PGnqgH.js +20 -0
- package/dist/ruby-CQp7mk0v-B3KpG-9E.js +46 -0
- package/dist/rust-W9HETclW-CaZtBt24.js +4 -0
- package/dist/sankeyDiagram-5OEKKPKP-Cgs6W_El-D7GZyd8n.js +946 -0
- package/dist/sass-DzGfEb5u-pslLeRRb.js +4 -0
- package/dist/scss-cWHTb1-d-DN6jMR75.js +5 -0
- package/dist/sequenceDiagram-3UESZ5HK-C5F57Dkt-BW1Hb7UW.js +4266 -0
- package/dist/shellscript-BvJBBLP1-BtH46UX7.js +4 -0
- package/dist/shellsession-CXHk-hsk-D-2JR5oU.js +5 -0
- package/dist/splunk-TtOhH_8h-BP8P7eWt.js +4 -0
- package/dist/sql-B-h_q34g-uWwuAxg_.js +4 -0
- package/dist/ssh-config-B7jk1vQp-BB1rrGb9.js +4 -0
- package/dist/stateDiagram-AJRCARHV-09dUKG6Y-Dm2a1vNu.js +210 -0
- package/dist/stateDiagram-v2-BHNVJYJU-CWqmRt12-DbWzZ-j-.js +16 -0
- package/dist/style.css +1 -0
- package/dist/stylus-Ccd_7r3J-DAu5PNZ9.js +4 -0
- package/dist/svelte-CYqtuUsn-Cf97VB5J.js +14 -0
- package/dist/swift-CzsQqA0L-BPF2ddNF.js +4 -0
- package/dist/timeline-definition-PNZ67QCA-CCndyx0V-B5CT96H-.js +1095 -0
- package/dist/toml-CRTROHRr-DjT9Bjqu.js +4 -0
- package/dist/tsx-CE8dfKwK-B-5hSr15.js +4 -0
- package/dist/twig-Bst4uh7S-C3aA9tng.js +18 -0
- package/dist/types/components/DiscardChangesPrompt.vue.d.ts +35 -0
- package/dist/types/components/DiscardChangesPrompt.vue.d.ts.map +1 -0
- package/dist/types/components/DocumentationContent.vue.d.ts +186 -0
- package/dist/types/components/DocumentationContent.vue.d.ts.map +1 -0
- package/dist/types/components/DocumentationDisplay.vue.d.ts +105 -0
- package/dist/types/components/DocumentationDisplay.vue.d.ts.map +1 -0
- package/dist/types/components/DocumentationPageEmptyState.vue.d.ts +31 -0
- package/dist/types/components/DocumentationPageEmptyState.vue.d.ts.map +1 -0
- package/dist/types/components/ProductDocumentModal.vue.d.ts +72 -0
- package/dist/types/components/ProductDocumentModal.vue.d.ts.map +1 -0
- package/dist/types/composables/index.d.ts +6 -0
- package/dist/types/composables/index.d.ts.map +1 -0
- package/dist/types/composables/useI18n.d.ts +9 -0
- package/dist/types/composables/useI18n.d.ts.map +1 -0
- package/dist/types/external-links.d.ts +5 -0
- package/dist/types/external-links.d.ts.map +1 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/types/helpers.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/document-list.d.ts +28 -0
- package/dist/types/types/document-list.d.ts.map +1 -0
- package/dist/types/types/document-modal.d.ts +8 -0
- package/dist/types/types/document-modal.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/typescript-8ogSSNer-B0ag8pir.js +4 -0
- package/dist/v-NeSnRB8V-CYSa2rJN.js +4 -0
- package/dist/vb-Dz72yc4q-B6FpM2Kc.js +4 -0
- package/dist/vennDiagram-CIIHVFJN-DQfKxM3L-qUaKEl7l.js +1889 -0
- package/dist/viml-DB1flIhL-BeYQ8dZh.js +4 -0
- package/dist/vue-Bq4JA_WT-CGBUDahs.js +22 -0
- package/dist/vue-html-BygQzR-9-BPez-Otx.js +5 -0
- package/dist/wardley-L42UT6IY-BjAkE_cs-C-giFqos.js +20731 -0
- package/dist/wardleyDiagram-YWT4CUSO-Bf9L2NsL-DXPF2Ee9.js +639 -0
- package/dist/wasm-BmZuu1vu-CfuK9YWP.js +4 -0
- package/dist/wgsl-D-vNyw6e-C2IZ7ENh.js +4 -0
- package/dist/xml-juAhGoTG-khG3jjDl.js +5 -0
- package/dist/xsl-CHgyQG2O-CiMa9sUf.js +5 -0
- package/dist/xychartDiagram-2RQKCTM6-ChNH3q1U-a59DsJDA.js +2055 -0
- package/dist/yaml-BK_xXVzk-X78l_Ibz.js +4 -0
- package/package.json +3 -3
|
@@ -0,0 +1,4065 @@
|
|
|
1
|
+
import { p as gt, a0 as Ue, au as Xe, g as _e, Z as ce, aD as ue, b6 as de, c as ze, q as Be, I as Ve, U as We, W as je, f as $e, i as qe, K as Ze, G as Ke, H as Je, s as Qe, o as ti, F as ei, u as ii, M as fe, b7 as ri, b8 as oi } from "./index-DfVKdDwj.js";
|
|
2
|
+
import { t as ni } from "./chunk-4BX2VUAB-C_NnimAy--QQ0Db2V.js";
|
|
3
|
+
import { r as ai } from "./wardley-L42UT6IY-BjAkE_cs-C-giFqos.js";
|
|
4
|
+
import { K as xe } from "./cytoscape.esm-BDIiOYYO-C1jMBhD8.js";
|
|
5
|
+
var Ae = /* @__PURE__ */ fe(((M, _) => {
|
|
6
|
+
(function(A, D) {
|
|
7
|
+
typeof M == "object" && typeof _ == "object" ? _.exports = D() : typeof define == "function" && define.amd ? define([], D) : typeof M == "object" ? M.layoutBase = D() : A.layoutBase = D();
|
|
8
|
+
})(M, function() {
|
|
9
|
+
return (function(A) {
|
|
10
|
+
var D = {};
|
|
11
|
+
function N(f) {
|
|
12
|
+
if (D[f]) return D[f].exports;
|
|
13
|
+
var o = D[f] = {
|
|
14
|
+
i: f,
|
|
15
|
+
l: !1,
|
|
16
|
+
exports: {}
|
|
17
|
+
};
|
|
18
|
+
return A[f].call(o.exports, o, o.exports, N), o.l = !0, o.exports;
|
|
19
|
+
}
|
|
20
|
+
return N.m = A, N.c = D, N.i = function(f) {
|
|
21
|
+
return f;
|
|
22
|
+
}, N.d = function(f, o, r) {
|
|
23
|
+
N.o(f, o) || Object.defineProperty(f, o, {
|
|
24
|
+
configurable: !1,
|
|
25
|
+
enumerable: !0,
|
|
26
|
+
get: r
|
|
27
|
+
});
|
|
28
|
+
}, N.n = function(f) {
|
|
29
|
+
var o = f && f.__esModule ? function() {
|
|
30
|
+
return f.default;
|
|
31
|
+
} : function() {
|
|
32
|
+
return f;
|
|
33
|
+
};
|
|
34
|
+
return N.d(o, "a", o), o;
|
|
35
|
+
}, N.o = function(f, o) {
|
|
36
|
+
return Object.prototype.hasOwnProperty.call(f, o);
|
|
37
|
+
}, N.p = "", N(N.s = 28);
|
|
38
|
+
})([
|
|
39
|
+
(function(A, D, N) {
|
|
40
|
+
function f() {
|
|
41
|
+
}
|
|
42
|
+
f.QUALITY = 1, f.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, f.DEFAULT_INCREMENTAL = !1, f.DEFAULT_ANIMATION_ON_LAYOUT = !0, f.DEFAULT_ANIMATION_DURING_LAYOUT = !1, f.DEFAULT_ANIMATION_PERIOD = 50, f.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, f.DEFAULT_GRAPH_MARGIN = 15, f.NODE_DIMENSIONS_INCLUDE_LABELS = !1, f.SIMPLE_NODE_SIZE = 40, f.SIMPLE_NODE_HALF_SIZE = f.SIMPLE_NODE_SIZE / 2, f.EMPTY_COMPOUND_NODE_SIZE = 40, f.MIN_EDGE_LENGTH = 1, f.WORLD_BOUNDARY = 1e6, f.INITIAL_WORLD_BOUNDARY = f.WORLD_BOUNDARY / 1e3, f.WORLD_CENTER_X = 1200, f.WORLD_CENTER_Y = 900, A.exports = f;
|
|
43
|
+
}),
|
|
44
|
+
(function(A, D, N) {
|
|
45
|
+
var f = N(2), o = N(8), r = N(9);
|
|
46
|
+
function t(l, i, p) {
|
|
47
|
+
f.call(this, p), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = p, this.bendpoints = [], this.source = l, this.target = i;
|
|
48
|
+
}
|
|
49
|
+
for (var e in t.prototype = Object.create(f.prototype), f) t[e] = f[e];
|
|
50
|
+
t.prototype.getSource = function() {
|
|
51
|
+
return this.source;
|
|
52
|
+
}, t.prototype.getTarget = function() {
|
|
53
|
+
return this.target;
|
|
54
|
+
}, t.prototype.isInterGraph = function() {
|
|
55
|
+
return this.isInterGraph;
|
|
56
|
+
}, t.prototype.getLength = function() {
|
|
57
|
+
return this.length;
|
|
58
|
+
}, t.prototype.isOverlapingSourceAndTarget = function() {
|
|
59
|
+
return this.isOverlapingSourceAndTarget;
|
|
60
|
+
}, t.prototype.getBendpoints = function() {
|
|
61
|
+
return this.bendpoints;
|
|
62
|
+
}, t.prototype.getLca = function() {
|
|
63
|
+
return this.lca;
|
|
64
|
+
}, t.prototype.getSourceInLca = function() {
|
|
65
|
+
return this.sourceInLca;
|
|
66
|
+
}, t.prototype.getTargetInLca = function() {
|
|
67
|
+
return this.targetInLca;
|
|
68
|
+
}, t.prototype.getOtherEnd = function(l) {
|
|
69
|
+
if (this.source === l) return this.target;
|
|
70
|
+
if (this.target === l) return this.source;
|
|
71
|
+
throw "Node is not incident with this edge";
|
|
72
|
+
}, t.prototype.getOtherEndInGraph = function(l, i) {
|
|
73
|
+
for (var p = this.getOtherEnd(l), a = i.getGraphManager().getRoot(); ; ) {
|
|
74
|
+
if (p.getOwner() == i) return p;
|
|
75
|
+
if (p.getOwner() == a) break;
|
|
76
|
+
p = p.getOwner().getParent();
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}, t.prototype.updateLength = function() {
|
|
80
|
+
var l = [
|
|
81
|
+
,
|
|
82
|
+
,
|
|
83
|
+
,
|
|
84
|
+
,
|
|
85
|
+
];
|
|
86
|
+
this.isOverlapingSourceAndTarget = o.getIntersection(this.target.getRect(), this.source.getRect(), l), this.isOverlapingSourceAndTarget || (this.lengthX = l[0] - l[2], this.lengthY = l[1] - l[3], Math.abs(this.lengthX) < 1 && (this.lengthX = r.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = r.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
|
|
87
|
+
}, t.prototype.updateLengthSimple = function() {
|
|
88
|
+
this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = r.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = r.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
|
|
89
|
+
}, A.exports = t;
|
|
90
|
+
}),
|
|
91
|
+
(function(A, D, N) {
|
|
92
|
+
function f(o) {
|
|
93
|
+
this.vGraphObject = o;
|
|
94
|
+
}
|
|
95
|
+
A.exports = f;
|
|
96
|
+
}),
|
|
97
|
+
(function(A, D, N) {
|
|
98
|
+
var f = N(2), o = N(10), r = N(13), t = N(0), e = N(16), l = N(5);
|
|
99
|
+
function i(a, n, g, h) {
|
|
100
|
+
g == null && h == null && (h = n), f.call(this, h), a.graphManager != null && (a = a.graphManager), this.estimatedSize = o.MIN_VALUE, this.inclusionTreeDepth = o.MAX_VALUE, this.vGraphObject = h, this.edges = [], this.graphManager = a, g != null && n != null ? this.rect = new r(n.x, n.y, g.width, g.height) : this.rect = new r();
|
|
101
|
+
}
|
|
102
|
+
for (var p in i.prototype = Object.create(f.prototype), f) i[p] = f[p];
|
|
103
|
+
i.prototype.getEdges = function() {
|
|
104
|
+
return this.edges;
|
|
105
|
+
}, i.prototype.getChild = function() {
|
|
106
|
+
return this.child;
|
|
107
|
+
}, i.prototype.getOwner = function() {
|
|
108
|
+
return this.owner;
|
|
109
|
+
}, i.prototype.getWidth = function() {
|
|
110
|
+
return this.rect.width;
|
|
111
|
+
}, i.prototype.setWidth = function(a) {
|
|
112
|
+
this.rect.width = a;
|
|
113
|
+
}, i.prototype.getHeight = function() {
|
|
114
|
+
return this.rect.height;
|
|
115
|
+
}, i.prototype.setHeight = function(a) {
|
|
116
|
+
this.rect.height = a;
|
|
117
|
+
}, i.prototype.getCenterX = function() {
|
|
118
|
+
return this.rect.x + this.rect.width / 2;
|
|
119
|
+
}, i.prototype.getCenterY = function() {
|
|
120
|
+
return this.rect.y + this.rect.height / 2;
|
|
121
|
+
}, i.prototype.getCenter = function() {
|
|
122
|
+
return new l(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
|
|
123
|
+
}, i.prototype.getLocation = function() {
|
|
124
|
+
return new l(this.rect.x, this.rect.y);
|
|
125
|
+
}, i.prototype.getRect = function() {
|
|
126
|
+
return this.rect;
|
|
127
|
+
}, i.prototype.getDiagonal = function() {
|
|
128
|
+
return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
|
|
129
|
+
}, i.prototype.getHalfTheDiagonal = function() {
|
|
130
|
+
return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
|
|
131
|
+
}, i.prototype.setRect = function(a, n) {
|
|
132
|
+
this.rect.x = a.x, this.rect.y = a.y, this.rect.width = n.width, this.rect.height = n.height;
|
|
133
|
+
}, i.prototype.setCenter = function(a, n) {
|
|
134
|
+
this.rect.x = a - this.rect.width / 2, this.rect.y = n - this.rect.height / 2;
|
|
135
|
+
}, i.prototype.setLocation = function(a, n) {
|
|
136
|
+
this.rect.x = a, this.rect.y = n;
|
|
137
|
+
}, i.prototype.moveBy = function(a, n) {
|
|
138
|
+
this.rect.x += a, this.rect.y += n;
|
|
139
|
+
}, i.prototype.getEdgeListToNode = function(a) {
|
|
140
|
+
var n = [], g = this;
|
|
141
|
+
return g.edges.forEach(function(h) {
|
|
142
|
+
if (h.target == a) {
|
|
143
|
+
if (h.source != g) throw "Incorrect edge source!";
|
|
144
|
+
n.push(h);
|
|
145
|
+
}
|
|
146
|
+
}), n;
|
|
147
|
+
}, i.prototype.getEdgesBetween = function(a) {
|
|
148
|
+
var n = [], g = this;
|
|
149
|
+
return g.edges.forEach(function(h) {
|
|
150
|
+
if (!(h.source == g || h.target == g)) throw "Incorrect edge source and/or target";
|
|
151
|
+
(h.target == a || h.source == a) && n.push(h);
|
|
152
|
+
}), n;
|
|
153
|
+
}, i.prototype.getNeighborsList = function() {
|
|
154
|
+
var a = /* @__PURE__ */ new Set(), n = this;
|
|
155
|
+
return n.edges.forEach(function(g) {
|
|
156
|
+
if (g.source == n) a.add(g.target);
|
|
157
|
+
else {
|
|
158
|
+
if (g.target != n) throw "Incorrect incidency!";
|
|
159
|
+
a.add(g.source);
|
|
160
|
+
}
|
|
161
|
+
}), a;
|
|
162
|
+
}, i.prototype.withChildren = function() {
|
|
163
|
+
var a = /* @__PURE__ */ new Set(), n, g;
|
|
164
|
+
if (a.add(this), this.child != null) for (var h = this.child.getNodes(), c = 0; c < h.length; c++) n = h[c], g = n.withChildren(), g.forEach(function(d) {
|
|
165
|
+
a.add(d);
|
|
166
|
+
});
|
|
167
|
+
return a;
|
|
168
|
+
}, i.prototype.getNoOfChildren = function() {
|
|
169
|
+
var a = 0, n;
|
|
170
|
+
if (this.child == null) a = 1;
|
|
171
|
+
else for (var g = this.child.getNodes(), h = 0; h < g.length; h++) n = g[h], a += n.getNoOfChildren();
|
|
172
|
+
return a == 0 && (a = 1), a;
|
|
173
|
+
}, i.prototype.getEstimatedSize = function() {
|
|
174
|
+
if (this.estimatedSize == o.MIN_VALUE) throw "assert failed";
|
|
175
|
+
return this.estimatedSize;
|
|
176
|
+
}, i.prototype.calcEstimatedSize = function() {
|
|
177
|
+
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);
|
|
178
|
+
}, i.prototype.scatter = function() {
|
|
179
|
+
var a, n, g = -t.INITIAL_WORLD_BOUNDARY, h = t.INITIAL_WORLD_BOUNDARY;
|
|
180
|
+
a = t.WORLD_CENTER_X + e.nextDouble() * (h - g) + g;
|
|
181
|
+
var c = -t.INITIAL_WORLD_BOUNDARY, d = t.INITIAL_WORLD_BOUNDARY;
|
|
182
|
+
n = t.WORLD_CENTER_Y + e.nextDouble() * (d - c) + c, this.rect.x = a, this.rect.y = n;
|
|
183
|
+
}, i.prototype.updateBounds = function() {
|
|
184
|
+
if (this.getChild() == null) throw "assert failed";
|
|
185
|
+
if (this.getChild().getNodes().length != 0) {
|
|
186
|
+
var a = this.getChild();
|
|
187
|
+
if (a.updateBounds(!0), this.rect.x = a.getLeft(), this.rect.y = a.getTop(), this.setWidth(a.getRight() - a.getLeft()), this.setHeight(a.getBottom() - a.getTop()), t.NODE_DIMENSIONS_INCLUDE_LABELS) {
|
|
188
|
+
var n = a.getRight() - a.getLeft(), g = a.getBottom() - a.getTop();
|
|
189
|
+
this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(n + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > n ? (this.rect.x -= (this.labelWidth - n) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(n + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(g + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > g ? (this.rect.y -= (this.labelHeight - g) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(g + this.labelHeight));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}, i.prototype.getInclusionTreeDepth = function() {
|
|
193
|
+
if (this.inclusionTreeDepth == o.MAX_VALUE) throw "assert failed";
|
|
194
|
+
return this.inclusionTreeDepth;
|
|
195
|
+
}, i.prototype.transform = function(a) {
|
|
196
|
+
var n = this.rect.x;
|
|
197
|
+
n > t.WORLD_BOUNDARY ? n = t.WORLD_BOUNDARY : n < -t.WORLD_BOUNDARY && (n = -t.WORLD_BOUNDARY);
|
|
198
|
+
var g = this.rect.y;
|
|
199
|
+
g > t.WORLD_BOUNDARY ? g = t.WORLD_BOUNDARY : g < -t.WORLD_BOUNDARY && (g = -t.WORLD_BOUNDARY);
|
|
200
|
+
var h = new l(n, g), c = a.inverseTransformPoint(h);
|
|
201
|
+
this.setLocation(c.x, c.y);
|
|
202
|
+
}, i.prototype.getLeft = function() {
|
|
203
|
+
return this.rect.x;
|
|
204
|
+
}, i.prototype.getRight = function() {
|
|
205
|
+
return this.rect.x + this.rect.width;
|
|
206
|
+
}, i.prototype.getTop = function() {
|
|
207
|
+
return this.rect.y;
|
|
208
|
+
}, i.prototype.getBottom = function() {
|
|
209
|
+
return this.rect.y + this.rect.height;
|
|
210
|
+
}, i.prototype.getParent = function() {
|
|
211
|
+
return this.owner == null ? null : this.owner.getParent();
|
|
212
|
+
}, A.exports = i;
|
|
213
|
+
}),
|
|
214
|
+
(function(A, D, N) {
|
|
215
|
+
var f = N(0);
|
|
216
|
+
function o() {
|
|
217
|
+
}
|
|
218
|
+
for (var r in f) o[r] = f[r];
|
|
219
|
+
o.MAX_ITERATIONS = 2500, o.DEFAULT_EDGE_LENGTH = 50, o.DEFAULT_SPRING_STRENGTH = 0.45, o.DEFAULT_REPULSION_STRENGTH = 4500, o.DEFAULT_GRAVITY_STRENGTH = 0.4, o.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, o.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, o.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, o.COOLING_ADAPTATION_FACTOR = 0.33, o.ADAPTATION_LOWER_NODE_LIMIT = 1e3, o.ADAPTATION_UPPER_NODE_LIMIT = 5e3, o.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, o.MAX_NODE_DISPLACEMENT = o.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, o.MIN_REPULSION_DIST = o.DEFAULT_EDGE_LENGTH / 10, o.CONVERGENCE_CHECK_PERIOD = 100, o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, o.MIN_EDGE_LENGTH = 1, o.GRID_CALCULATION_CHECK_PERIOD = 10, A.exports = o;
|
|
220
|
+
}),
|
|
221
|
+
(function(A, D, N) {
|
|
222
|
+
function f(o, r) {
|
|
223
|
+
o == null && r == null ? (this.x = 0, this.y = 0) : (this.x = o, this.y = r);
|
|
224
|
+
}
|
|
225
|
+
f.prototype.getX = function() {
|
|
226
|
+
return this.x;
|
|
227
|
+
}, f.prototype.getY = function() {
|
|
228
|
+
return this.y;
|
|
229
|
+
}, f.prototype.setX = function(o) {
|
|
230
|
+
this.x = o;
|
|
231
|
+
}, f.prototype.setY = function(o) {
|
|
232
|
+
this.y = o;
|
|
233
|
+
}, f.prototype.getDifference = function(o) {
|
|
234
|
+
return new DimensionD(this.x - o.x, this.y - o.y);
|
|
235
|
+
}, f.prototype.getCopy = function() {
|
|
236
|
+
return new f(this.x, this.y);
|
|
237
|
+
}, f.prototype.translate = function(o) {
|
|
238
|
+
return this.x += o.width, this.y += o.height, this;
|
|
239
|
+
}, A.exports = f;
|
|
240
|
+
}),
|
|
241
|
+
(function(A, D, N) {
|
|
242
|
+
var f = N(2), o = N(10), r = N(0), t = N(7), e = N(3), l = N(1), i = N(13), p = N(12), a = N(11);
|
|
243
|
+
function n(h, c, d) {
|
|
244
|
+
f.call(this, d), this.estimatedSize = o.MIN_VALUE, this.margin = r.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = h, c != null && c instanceof t ? this.graphManager = c : c != null && c instanceof Layout && (this.graphManager = c.graphManager);
|
|
245
|
+
}
|
|
246
|
+
for (var g in n.prototype = Object.create(f.prototype), f) n[g] = f[g];
|
|
247
|
+
n.prototype.getNodes = function() {
|
|
248
|
+
return this.nodes;
|
|
249
|
+
}, n.prototype.getEdges = function() {
|
|
250
|
+
return this.edges;
|
|
251
|
+
}, n.prototype.getGraphManager = function() {
|
|
252
|
+
return this.graphManager;
|
|
253
|
+
}, n.prototype.getParent = function() {
|
|
254
|
+
return this.parent;
|
|
255
|
+
}, n.prototype.getLeft = function() {
|
|
256
|
+
return this.left;
|
|
257
|
+
}, n.prototype.getRight = function() {
|
|
258
|
+
return this.right;
|
|
259
|
+
}, n.prototype.getTop = function() {
|
|
260
|
+
return this.top;
|
|
261
|
+
}, n.prototype.getBottom = function() {
|
|
262
|
+
return this.bottom;
|
|
263
|
+
}, n.prototype.isConnected = function() {
|
|
264
|
+
return this.isConnected;
|
|
265
|
+
}, n.prototype.add = function(h, c, d) {
|
|
266
|
+
if (c == null && d == null) {
|
|
267
|
+
var v = h;
|
|
268
|
+
if (this.graphManager == null) throw "Graph has no graph mgr!";
|
|
269
|
+
if (this.getNodes().indexOf(v) > -1) throw "Node already in graph!";
|
|
270
|
+
return v.owner = this, this.getNodes().push(v), v;
|
|
271
|
+
} else {
|
|
272
|
+
var T = h;
|
|
273
|
+
if (!(this.getNodes().indexOf(c) > -1 && this.getNodes().indexOf(d) > -1)) throw "Source or target not in graph!";
|
|
274
|
+
if (!(c.owner == d.owner && c.owner == this)) throw "Both owners must be this graph!";
|
|
275
|
+
return c.owner == d.owner ? (T.source = c, T.target = d, T.isInterGraph = !1, this.getEdges().push(T), c.edges.push(T), d != c && d.edges.push(T), T) : null;
|
|
276
|
+
}
|
|
277
|
+
}, n.prototype.remove = function(h) {
|
|
278
|
+
var c = h;
|
|
279
|
+
if (h instanceof e) {
|
|
280
|
+
if (c == null) throw "Node is null!";
|
|
281
|
+
if (!(c.owner != null && c.owner == this)) throw "Owner graph is invalid!";
|
|
282
|
+
if (this.graphManager == null) throw "Owner graph manager is invalid!";
|
|
283
|
+
for (var d = c.edges.slice(), v, T = d.length, L = 0; L < T; L++) v = d[L], v.isInterGraph ? this.graphManager.remove(v) : v.source.owner.remove(v);
|
|
284
|
+
var F = this.nodes.indexOf(c);
|
|
285
|
+
if (F == -1) throw "Node not in owner node list!";
|
|
286
|
+
this.nodes.splice(F, 1);
|
|
287
|
+
} else if (h instanceof l) {
|
|
288
|
+
var v = h;
|
|
289
|
+
if (v == null) throw "Edge is null!";
|
|
290
|
+
if (!(v.source != null && v.target != null)) throw "Source and/or target is null!";
|
|
291
|
+
if (!(v.source.owner != null && v.target.owner != null && v.source.owner == this && v.target.owner == this)) throw "Source and/or target owner is invalid!";
|
|
292
|
+
var S = v.source.edges.indexOf(v), P = v.target.edges.indexOf(v);
|
|
293
|
+
if (!(S > -1 && P > -1)) throw "Source and/or target doesn't know this edge!";
|
|
294
|
+
v.source.edges.splice(S, 1), v.target != v.source && v.target.edges.splice(P, 1);
|
|
295
|
+
var F = v.source.owner.getEdges().indexOf(v);
|
|
296
|
+
if (F == -1) throw "Not in owner's edge list!";
|
|
297
|
+
v.source.owner.getEdges().splice(F, 1);
|
|
298
|
+
}
|
|
299
|
+
}, n.prototype.updateLeftTop = function() {
|
|
300
|
+
for (var h = o.MAX_VALUE, c = o.MAX_VALUE, d, v, T, L = this.getNodes(), F = L.length, S = 0; S < F; S++) {
|
|
301
|
+
var P = L[S];
|
|
302
|
+
d = P.getTop(), v = P.getLeft(), h > d && (h = d), c > v && (c = v);
|
|
303
|
+
}
|
|
304
|
+
return h == o.MAX_VALUE ? null : (T = L[0].getParent().paddingLeft == null ? this.margin : L[0].getParent().paddingLeft, this.left = c - T, this.top = h - T, new p(this.left, this.top));
|
|
305
|
+
}, n.prototype.updateBounds = function(h) {
|
|
306
|
+
for (var c = o.MAX_VALUE, d = -o.MAX_VALUE, v = o.MAX_VALUE, T = -o.MAX_VALUE, L, F, S, P, U, Z = this.nodes, x = Z.length, K = 0; K < x; K++) {
|
|
307
|
+
var s = Z[K];
|
|
308
|
+
h && s.child != null && s.updateBounds(), L = s.getLeft(), F = s.getRight(), S = s.getTop(), P = s.getBottom(), c > L && (c = L), d < F && (d = F), v > S && (v = S), T < P && (T = P);
|
|
309
|
+
}
|
|
310
|
+
var E = new i(c, v, d - c, T - v);
|
|
311
|
+
c == o.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), U = Z[0].getParent().paddingLeft == null ? this.margin : Z[0].getParent().paddingLeft, this.left = E.x - U, this.right = E.x + E.width + U, this.top = E.y - U, this.bottom = E.y + E.height + U;
|
|
312
|
+
}, n.calculateBounds = function(h) {
|
|
313
|
+
for (var c = o.MAX_VALUE, d = -o.MAX_VALUE, v = o.MAX_VALUE, T = -o.MAX_VALUE, L, F, S, P, U = h.length, Z = 0; Z < U; Z++) {
|
|
314
|
+
var x = h[Z];
|
|
315
|
+
L = x.getLeft(), F = x.getRight(), S = x.getTop(), P = x.getBottom(), c > L && (c = L), d < F && (d = F), v > S && (v = S), T < P && (T = P);
|
|
316
|
+
}
|
|
317
|
+
return new i(c, v, d - c, T - v);
|
|
318
|
+
}, n.prototype.getInclusionTreeDepth = function() {
|
|
319
|
+
return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
|
|
320
|
+
}, n.prototype.getEstimatedSize = function() {
|
|
321
|
+
if (this.estimatedSize == o.MIN_VALUE) throw "assert failed";
|
|
322
|
+
return this.estimatedSize;
|
|
323
|
+
}, n.prototype.calcEstimatedSize = function() {
|
|
324
|
+
for (var h = 0, c = this.nodes, d = c.length, v = 0; v < d; v++) {
|
|
325
|
+
var T = c[v];
|
|
326
|
+
h += T.calcEstimatedSize();
|
|
327
|
+
}
|
|
328
|
+
return h == 0 ? this.estimatedSize = r.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = h / Math.sqrt(this.nodes.length), this.estimatedSize;
|
|
329
|
+
}, n.prototype.updateConnected = function() {
|
|
330
|
+
var h = this;
|
|
331
|
+
if (this.nodes.length == 0) {
|
|
332
|
+
this.isConnected = !0;
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
var c = new a(), d = /* @__PURE__ */ new Set(), v = this.nodes[0], T, L;
|
|
336
|
+
for (v.withChildren().forEach(function(U) {
|
|
337
|
+
c.push(U), d.add(U);
|
|
338
|
+
}); c.length !== 0; ) {
|
|
339
|
+
v = c.shift(), T = v.getEdges();
|
|
340
|
+
for (var F = T.length, S = 0; S < F; S++) L = T[S].getOtherEndInGraph(v, this), L != null && !d.has(L) && L.withChildren().forEach(function(U) {
|
|
341
|
+
c.push(U), d.add(U);
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
if (this.isConnected = !1, d.size >= this.nodes.length) {
|
|
345
|
+
var P = 0;
|
|
346
|
+
d.forEach(function(U) {
|
|
347
|
+
U.owner == h && P++;
|
|
348
|
+
}), P == this.nodes.length && (this.isConnected = !0);
|
|
349
|
+
}
|
|
350
|
+
}, A.exports = n;
|
|
351
|
+
}),
|
|
352
|
+
(function(A, D, N) {
|
|
353
|
+
var f, o = N(1);
|
|
354
|
+
function r(t) {
|
|
355
|
+
f = N(6), this.layout = t, this.graphs = [], this.edges = [];
|
|
356
|
+
}
|
|
357
|
+
r.prototype.addRoot = function() {
|
|
358
|
+
var t = this.layout.newGraph(), e = this.layout.newNode(null), l = this.add(t, e);
|
|
359
|
+
return this.setRootGraph(l), this.rootGraph;
|
|
360
|
+
}, r.prototype.add = function(t, e, l, i, p) {
|
|
361
|
+
if (l == null && i == null && p == null) {
|
|
362
|
+
if (t == null) throw "Graph is null!";
|
|
363
|
+
if (e == null) throw "Parent node is null!";
|
|
364
|
+
if (this.graphs.indexOf(t) > -1) throw "Graph already in this graph mgr!";
|
|
365
|
+
if (this.graphs.push(t), t.parent != null) throw "Already has a parent!";
|
|
366
|
+
if (e.child != null) throw "Already has a child!";
|
|
367
|
+
return t.parent = e, e.child = t, t;
|
|
368
|
+
} else {
|
|
369
|
+
p = l, i = e, l = t;
|
|
370
|
+
var a = i.getOwner(), n = p.getOwner();
|
|
371
|
+
if (!(a != null && a.getGraphManager() == this)) throw "Source not in this graph mgr!";
|
|
372
|
+
if (!(n != null && n.getGraphManager() == this)) throw "Target not in this graph mgr!";
|
|
373
|
+
if (a == n) return l.isInterGraph = !1, a.add(l, i, p);
|
|
374
|
+
if (l.isInterGraph = !0, l.source = i, l.target = p, this.edges.indexOf(l) > -1) throw "Edge already in inter-graph edge list!";
|
|
375
|
+
if (this.edges.push(l), !(l.source != null && l.target != null)) throw "Edge source and/or target is null!";
|
|
376
|
+
if (!(l.source.edges.indexOf(l) == -1 && l.target.edges.indexOf(l) == -1)) throw "Edge already in source and/or target incidency list!";
|
|
377
|
+
return l.source.edges.push(l), l.target.edges.push(l), l;
|
|
378
|
+
}
|
|
379
|
+
}, r.prototype.remove = function(t) {
|
|
380
|
+
if (t instanceof f) {
|
|
381
|
+
var e = t;
|
|
382
|
+
if (e.getGraphManager() != this) throw "Graph not in this graph mgr";
|
|
383
|
+
if (!(e == this.rootGraph || e.parent != null && e.parent.graphManager == this)) throw "Invalid parent node!";
|
|
384
|
+
var l = [];
|
|
385
|
+
l = l.concat(e.getEdges());
|
|
386
|
+
for (var i, p = l.length, a = 0; a < p; a++) i = l[a], e.remove(i);
|
|
387
|
+
var n = [];
|
|
388
|
+
n = n.concat(e.getNodes());
|
|
389
|
+
var g;
|
|
390
|
+
p = n.length;
|
|
391
|
+
for (var a = 0; a < p; a++) g = n[a], e.remove(g);
|
|
392
|
+
e == this.rootGraph && this.setRootGraph(null);
|
|
393
|
+
var h = this.graphs.indexOf(e);
|
|
394
|
+
this.graphs.splice(h, 1), e.parent = null;
|
|
395
|
+
} else if (t instanceof o) {
|
|
396
|
+
if (i = t, i == null) throw "Edge is null!";
|
|
397
|
+
if (!i.isInterGraph) throw "Not an inter-graph edge!";
|
|
398
|
+
if (!(i.source != null && i.target != null)) throw "Source and/or target is null!";
|
|
399
|
+
if (!(i.source.edges.indexOf(i) != -1 && i.target.edges.indexOf(i) != -1)) throw "Source and/or target doesn't know this edge!";
|
|
400
|
+
var h = i.source.edges.indexOf(i);
|
|
401
|
+
if (i.source.edges.splice(h, 1), h = i.target.edges.indexOf(i), i.target.edges.splice(h, 1), !(i.source.owner != null && i.source.owner.getGraphManager() != null)) throw "Edge owner graph or owner graph manager is null!";
|
|
402
|
+
if (i.source.owner.getGraphManager().edges.indexOf(i) == -1) throw "Not in owner graph manager's edge list!";
|
|
403
|
+
var h = i.source.owner.getGraphManager().edges.indexOf(i);
|
|
404
|
+
i.source.owner.getGraphManager().edges.splice(h, 1);
|
|
405
|
+
}
|
|
406
|
+
}, r.prototype.updateBounds = function() {
|
|
407
|
+
this.rootGraph.updateBounds(!0);
|
|
408
|
+
}, r.prototype.getGraphs = function() {
|
|
409
|
+
return this.graphs;
|
|
410
|
+
}, r.prototype.getAllNodes = function() {
|
|
411
|
+
if (this.allNodes == null) {
|
|
412
|
+
for (var t = [], e = this.getGraphs(), l = e.length, i = 0; i < l; i++) t = t.concat(e[i].getNodes());
|
|
413
|
+
this.allNodes = t;
|
|
414
|
+
}
|
|
415
|
+
return this.allNodes;
|
|
416
|
+
}, r.prototype.resetAllNodes = function() {
|
|
417
|
+
this.allNodes = null;
|
|
418
|
+
}, r.prototype.resetAllEdges = function() {
|
|
419
|
+
this.allEdges = null;
|
|
420
|
+
}, r.prototype.resetAllNodesToApplyGravitation = function() {
|
|
421
|
+
this.allNodesToApplyGravitation = null;
|
|
422
|
+
}, r.prototype.getAllEdges = function() {
|
|
423
|
+
if (this.allEdges == null) {
|
|
424
|
+
var t = [], e = this.getGraphs();
|
|
425
|
+
e.length;
|
|
426
|
+
for (var l = 0; l < e.length; l++) t = t.concat(e[l].getEdges());
|
|
427
|
+
t = t.concat(this.edges), this.allEdges = t;
|
|
428
|
+
}
|
|
429
|
+
return this.allEdges;
|
|
430
|
+
}, r.prototype.getAllNodesToApplyGravitation = function() {
|
|
431
|
+
return this.allNodesToApplyGravitation;
|
|
432
|
+
}, r.prototype.setAllNodesToApplyGravitation = function(t) {
|
|
433
|
+
if (this.allNodesToApplyGravitation != null) throw "assert failed";
|
|
434
|
+
this.allNodesToApplyGravitation = t;
|
|
435
|
+
}, r.prototype.getRoot = function() {
|
|
436
|
+
return this.rootGraph;
|
|
437
|
+
}, r.prototype.setRootGraph = function(t) {
|
|
438
|
+
if (t.getGraphManager() != this) throw "Root not in this graph mgr!";
|
|
439
|
+
this.rootGraph = t, t.parent ??= this.layout.newNode("Root node");
|
|
440
|
+
}, r.prototype.getLayout = function() {
|
|
441
|
+
return this.layout;
|
|
442
|
+
}, r.prototype.isOneAncestorOfOther = function(t, e) {
|
|
443
|
+
if (!(t != null && e != null)) throw "assert failed";
|
|
444
|
+
if (t == e) return !0;
|
|
445
|
+
var l = t.getOwner(), i;
|
|
446
|
+
do {
|
|
447
|
+
if (i = l.getParent(), i == null) break;
|
|
448
|
+
if (i == e) return !0;
|
|
449
|
+
if (l = i.getOwner(), l == null) break;
|
|
450
|
+
} while (!0);
|
|
451
|
+
l = e.getOwner();
|
|
452
|
+
do {
|
|
453
|
+
if (i = l.getParent(), i == null) break;
|
|
454
|
+
if (i == t) return !0;
|
|
455
|
+
if (l = i.getOwner(), l == null) break;
|
|
456
|
+
} while (!0);
|
|
457
|
+
return !1;
|
|
458
|
+
}, r.prototype.calcLowestCommonAncestors = function() {
|
|
459
|
+
for (var t, e, l, i, p, a = this.getAllEdges(), n = a.length, g = 0; g < n; g++) {
|
|
460
|
+
if (t = a[g], e = t.source, l = t.target, t.lca = null, t.sourceInLca = e, t.targetInLca = l, e == l) {
|
|
461
|
+
t.lca = e.getOwner();
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
for (i = e.getOwner(); t.lca == null; ) {
|
|
465
|
+
for (t.targetInLca = l, p = l.getOwner(); t.lca == null; ) {
|
|
466
|
+
if (p == i) {
|
|
467
|
+
t.lca = p;
|
|
468
|
+
break;
|
|
469
|
+
}
|
|
470
|
+
if (p == this.rootGraph) break;
|
|
471
|
+
if (t.lca != null) throw "assert failed";
|
|
472
|
+
t.targetInLca = p.getParent(), p = t.targetInLca.getOwner();
|
|
473
|
+
}
|
|
474
|
+
if (i == this.rootGraph) break;
|
|
475
|
+
t.lca ?? (t.sourceInLca = i.getParent(), i = t.sourceInLca.getOwner());
|
|
476
|
+
}
|
|
477
|
+
if (t.lca == null) throw "assert failed";
|
|
478
|
+
}
|
|
479
|
+
}, r.prototype.calcLowestCommonAncestor = function(t, e) {
|
|
480
|
+
if (t == e) return t.getOwner();
|
|
481
|
+
var l = t.getOwner();
|
|
482
|
+
do {
|
|
483
|
+
if (l == null) break;
|
|
484
|
+
var i = e.getOwner();
|
|
485
|
+
do {
|
|
486
|
+
if (i == null) break;
|
|
487
|
+
if (i == l) return i;
|
|
488
|
+
i = i.getParent().getOwner();
|
|
489
|
+
} while (!0);
|
|
490
|
+
l = l.getParent().getOwner();
|
|
491
|
+
} while (!0);
|
|
492
|
+
return l;
|
|
493
|
+
}, r.prototype.calcInclusionTreeDepths = function(t, e) {
|
|
494
|
+
t == null && e == null && (t = this.rootGraph, e = 1);
|
|
495
|
+
for (var l, i = t.getNodes(), p = i.length, a = 0; a < p; a++) l = i[a], l.inclusionTreeDepth = e, l.child != null && this.calcInclusionTreeDepths(l.child, e + 1);
|
|
496
|
+
}, r.prototype.includesInvalidEdge = function() {
|
|
497
|
+
for (var t, e = [], l = this.edges.length, i = 0; i < l; i++) t = this.edges[i], this.isOneAncestorOfOther(t.source, t.target) && e.push(t);
|
|
498
|
+
for (var i = 0; i < e.length; i++) this.remove(e[i]);
|
|
499
|
+
return !1;
|
|
500
|
+
}, A.exports = r;
|
|
501
|
+
}),
|
|
502
|
+
(function(A, D, N) {
|
|
503
|
+
var f = N(12);
|
|
504
|
+
function o() {
|
|
505
|
+
}
|
|
506
|
+
o.calcSeparationAmount = function(r, t, e, l) {
|
|
507
|
+
if (!r.intersects(t)) throw "assert failed";
|
|
508
|
+
var i = [, ,];
|
|
509
|
+
this.decideDirectionsForOverlappingNodes(r, t, i), e[0] = Math.min(r.getRight(), t.getRight()) - Math.max(r.x, t.x), e[1] = Math.min(r.getBottom(), t.getBottom()) - Math.max(r.y, t.y), r.getX() <= t.getX() && r.getRight() >= t.getRight() ? e[0] += Math.min(t.getX() - r.getX(), r.getRight() - t.getRight()) : t.getX() <= r.getX() && t.getRight() >= r.getRight() && (e[0] += Math.min(r.getX() - t.getX(), t.getRight() - r.getRight())), r.getY() <= t.getY() && r.getBottom() >= t.getBottom() ? e[1] += Math.min(t.getY() - r.getY(), r.getBottom() - t.getBottom()) : t.getY() <= r.getY() && t.getBottom() >= r.getBottom() && (e[1] += Math.min(r.getY() - t.getY(), t.getBottom() - r.getBottom()));
|
|
510
|
+
var p = Math.abs((t.getCenterY() - r.getCenterY()) / (t.getCenterX() - r.getCenterX()));
|
|
511
|
+
t.getCenterY() === r.getCenterY() && t.getCenterX() === r.getCenterX() && (p = 1);
|
|
512
|
+
var a = p * e[0], n = e[1] / p;
|
|
513
|
+
e[0] < n ? n = e[0] : a = e[1], e[0] = -1 * i[0] * (n / 2 + l), e[1] = -1 * i[1] * (a / 2 + l);
|
|
514
|
+
}, o.decideDirectionsForOverlappingNodes = function(r, t, e) {
|
|
515
|
+
r.getCenterX() < t.getCenterX() ? e[0] = -1 : e[0] = 1, r.getCenterY() < t.getCenterY() ? e[1] = -1 : e[1] = 1;
|
|
516
|
+
}, o.getIntersection2 = function(r, t, e) {
|
|
517
|
+
var l = r.getCenterX(), i = r.getCenterY(), p = t.getCenterX(), a = t.getCenterY();
|
|
518
|
+
if (r.intersects(t)) return e[0] = l, e[1] = i, e[2] = p, e[3] = a, !0;
|
|
519
|
+
var n = r.getX(), g = r.getY(), h = r.getRight(), c = r.getX(), d = r.getBottom(), v = r.getRight(), T = r.getWidthHalf(), L = r.getHeightHalf(), F = t.getX(), S = t.getY(), P = t.getRight(), U = t.getX(), Z = t.getBottom(), x = t.getRight(), K = t.getWidthHalf(), s = t.getHeightHalf(), E = !1, u = !1;
|
|
520
|
+
if (l === p) {
|
|
521
|
+
if (i > a) return e[0] = l, e[1] = g, e[2] = p, e[3] = Z, !1;
|
|
522
|
+
if (i < a) return e[0] = l, e[1] = d, e[2] = p, e[3] = S, !1;
|
|
523
|
+
} else if (i === a) {
|
|
524
|
+
if (l > p) return e[0] = n, e[1] = i, e[2] = P, e[3] = a, !1;
|
|
525
|
+
if (l < p) return e[0] = h, e[1] = i, e[2] = F, e[3] = a, !1;
|
|
526
|
+
} else {
|
|
527
|
+
var m = r.height / r.width, y = t.height / t.width, C = (a - i) / (p - l), w = void 0, R = void 0, G = void 0, b = void 0, k = void 0, W = void 0;
|
|
528
|
+
if (-m === C ? l > p ? (e[0] = c, e[1] = d, E = !0) : (e[0] = h, e[1] = g, E = !0) : m === C && (l > p ? (e[0] = n, e[1] = g, E = !0) : (e[0] = v, e[1] = d, E = !0)), -y === C ? p > l ? (e[2] = U, e[3] = Z, u = !0) : (e[2] = P, e[3] = S, u = !0) : y === C && (p > l ? (e[2] = F, e[3] = S, u = !0) : (e[2] = x, e[3] = Z, u = !0)), E && u) return !1;
|
|
529
|
+
if (l > p ? i > a ? (w = this.getCardinalDirection(m, C, 4), R = this.getCardinalDirection(y, C, 2)) : (w = this.getCardinalDirection(-m, C, 3), R = this.getCardinalDirection(-y, C, 1)) : i > a ? (w = this.getCardinalDirection(-m, C, 1), R = this.getCardinalDirection(-y, C, 3)) : (w = this.getCardinalDirection(m, C, 2), R = this.getCardinalDirection(y, C, 4)), !E) switch (w) {
|
|
530
|
+
case 1:
|
|
531
|
+
b = g, G = l + -L / C, e[0] = G, e[1] = b;
|
|
532
|
+
break;
|
|
533
|
+
case 2:
|
|
534
|
+
G = v, b = i + T * C, e[0] = G, e[1] = b;
|
|
535
|
+
break;
|
|
536
|
+
case 3:
|
|
537
|
+
b = d, G = l + L / C, e[0] = G, e[1] = b;
|
|
538
|
+
break;
|
|
539
|
+
case 4:
|
|
540
|
+
G = c, b = i + -T * C, e[0] = G, e[1] = b;
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
if (!u) switch (R) {
|
|
544
|
+
case 1:
|
|
545
|
+
W = S, k = p + -s / C, e[2] = k, e[3] = W;
|
|
546
|
+
break;
|
|
547
|
+
case 2:
|
|
548
|
+
k = x, W = a + K * C, e[2] = k, e[3] = W;
|
|
549
|
+
break;
|
|
550
|
+
case 3:
|
|
551
|
+
W = Z, k = p + s / C, e[2] = k, e[3] = W;
|
|
552
|
+
break;
|
|
553
|
+
case 4:
|
|
554
|
+
k = U, W = a + -K * C, e[2] = k, e[3] = W;
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return !1;
|
|
559
|
+
}, o.getCardinalDirection = function(r, t, e) {
|
|
560
|
+
return r > t ? e : 1 + e % 4;
|
|
561
|
+
}, o.getIntersection = function(r, t, e, l) {
|
|
562
|
+
if (l == null) return this.getIntersection2(r, t, e);
|
|
563
|
+
var i = r.x, p = r.y, a = t.x, n = t.y, g = e.x, h = e.y, c = l.x, d = l.y, v = void 0, T = void 0, L = void 0, F = void 0, S = void 0, P = void 0, U = void 0, Z = void 0, x = void 0;
|
|
564
|
+
return L = n - p, S = i - a, U = a * p - i * n, F = d - h, P = g - c, Z = c * h - g * d, x = L * P - F * S, x === 0 ? null : (v = (S * Z - P * U) / x, T = (F * U - L * Z) / x, new f(v, T));
|
|
565
|
+
}, o.angleOfVector = function(r, t, e, l) {
|
|
566
|
+
var i = void 0;
|
|
567
|
+
return r === e ? i = l < t ? this.ONE_AND_HALF_PI : this.HALF_PI : (i = Math.atan((l - t) / (e - r)), e < r ? i += Math.PI : l < t && (i += this.TWO_PI)), i;
|
|
568
|
+
}, o.doIntersect = function(r, t, e, l) {
|
|
569
|
+
var i = r.x, p = r.y, a = t.x, n = t.y, g = e.x, h = e.y, c = l.x, d = l.y, v = (a - i) * (d - h) - (c - g) * (n - p);
|
|
570
|
+
if (v === 0) return !1;
|
|
571
|
+
var T = ((d - h) * (c - i) + (g - c) * (d - p)) / v, L = ((p - n) * (c - i) + (a - i) * (d - p)) / v;
|
|
572
|
+
return 0 < T && T < 1 && 0 < L && L < 1;
|
|
573
|
+
}, o.findCircleLineIntersections = function(r, t, e, l, i, p, a) {
|
|
574
|
+
var n = (e - r) * (e - r) + (l - t) * (l - t), g = 2 * ((r - i) * (e - r) + (t - p) * (l - t)), h = (r - i) * (r - i) + (t - p) * (t - p) - a * a;
|
|
575
|
+
if (g * g - 4 * n * h >= 0) {
|
|
576
|
+
var c = (-g + Math.sqrt(g * g - 4 * n * h)) / (2 * n), d = (-g - Math.sqrt(g * g - 4 * n * h)) / (2 * n);
|
|
577
|
+
return c >= 0 && c <= 1 ? [c] : d >= 0 && d <= 1 ? [d] : null;
|
|
578
|
+
} else return null;
|
|
579
|
+
}, o.HALF_PI = 0.5 * Math.PI, o.ONE_AND_HALF_PI = 1.5 * Math.PI, o.TWO_PI = 2 * Math.PI, o.THREE_PI = 3 * Math.PI, A.exports = o;
|
|
580
|
+
}),
|
|
581
|
+
(function(A, D, N) {
|
|
582
|
+
function f() {
|
|
583
|
+
}
|
|
584
|
+
f.sign = function(o) {
|
|
585
|
+
return o > 0 ? 1 : o < 0 ? -1 : 0;
|
|
586
|
+
}, f.floor = function(o) {
|
|
587
|
+
return o < 0 ? Math.ceil(o) : Math.floor(o);
|
|
588
|
+
}, f.ceil = function(o) {
|
|
589
|
+
return o < 0 ? Math.floor(o) : Math.ceil(o);
|
|
590
|
+
}, A.exports = f;
|
|
591
|
+
}),
|
|
592
|
+
(function(A, D, N) {
|
|
593
|
+
function f() {
|
|
594
|
+
}
|
|
595
|
+
f.MAX_VALUE = 2147483647, f.MIN_VALUE = -2147483648, A.exports = f;
|
|
596
|
+
}),
|
|
597
|
+
(function(A, D, N) {
|
|
598
|
+
var f = /* @__PURE__ */ (function() {
|
|
599
|
+
function l(i, p) {
|
|
600
|
+
for (var a = 0; a < p.length; a++) {
|
|
601
|
+
var n = p[a];
|
|
602
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(i, n.key, n);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return function(i, p, a) {
|
|
606
|
+
return p && l(i.prototype, p), a && l(i, a), i;
|
|
607
|
+
};
|
|
608
|
+
})();
|
|
609
|
+
function o(l, i) {
|
|
610
|
+
if (!(l instanceof i)) throw TypeError("Cannot call a class as a function");
|
|
611
|
+
}
|
|
612
|
+
var r = function(l) {
|
|
613
|
+
return {
|
|
614
|
+
value: l,
|
|
615
|
+
next: null,
|
|
616
|
+
prev: null
|
|
617
|
+
};
|
|
618
|
+
}, t = function(l, i, p, a) {
|
|
619
|
+
return l === null ? a.head = i : l.next = i, p === null ? a.tail = i : p.prev = i, i.prev = l, i.next = p, a.length++, i;
|
|
620
|
+
}, e = function(l, i) {
|
|
621
|
+
var p = l.prev, a = l.next;
|
|
622
|
+
return p === null ? i.head = a : p.next = a, a === null ? i.tail = p : a.prev = p, l.prev = l.next = null, i.length--, l;
|
|
623
|
+
};
|
|
624
|
+
A.exports = (function() {
|
|
625
|
+
function l(i) {
|
|
626
|
+
var p = this;
|
|
627
|
+
o(this, l), this.length = 0, this.head = null, this.tail = null, i?.forEach(function(a) {
|
|
628
|
+
return p.push(a);
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
return f(l, [
|
|
632
|
+
{
|
|
633
|
+
key: "size",
|
|
634
|
+
value: function() {
|
|
635
|
+
return this.length;
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
key: "insertBefore",
|
|
640
|
+
value: function(i, p) {
|
|
641
|
+
return t(p.prev, r(i), p, this);
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
key: "insertAfter",
|
|
646
|
+
value: function(i, p) {
|
|
647
|
+
return t(p, r(i), p.next, this);
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
key: "insertNodeBefore",
|
|
652
|
+
value: function(i, p) {
|
|
653
|
+
return t(p.prev, i, p, this);
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
key: "insertNodeAfter",
|
|
658
|
+
value: function(i, p) {
|
|
659
|
+
return t(p, i, p.next, this);
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
key: "push",
|
|
664
|
+
value: function(i) {
|
|
665
|
+
return t(this.tail, r(i), null, this);
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
key: "unshift",
|
|
670
|
+
value: function(i) {
|
|
671
|
+
return t(null, r(i), this.head, this);
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
key: "remove",
|
|
676
|
+
value: function(i) {
|
|
677
|
+
return e(i, this);
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
key: "pop",
|
|
682
|
+
value: function() {
|
|
683
|
+
return e(this.tail, this).value;
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
key: "popNode",
|
|
688
|
+
value: function() {
|
|
689
|
+
return e(this.tail, this);
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
key: "shift",
|
|
694
|
+
value: function() {
|
|
695
|
+
return e(this.head, this).value;
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
key: "shiftNode",
|
|
700
|
+
value: function() {
|
|
701
|
+
return e(this.head, this);
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
key: "get_object_at",
|
|
706
|
+
value: function(i) {
|
|
707
|
+
if (i <= this.length()) {
|
|
708
|
+
for (var p = 1, a = this.head; p < i; ) a = a.next, p++;
|
|
709
|
+
return a.value;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
key: "set_object_at",
|
|
715
|
+
value: function(i, p) {
|
|
716
|
+
if (i <= this.length()) {
|
|
717
|
+
for (var a = 1, n = this.head; a < i; ) n = n.next, a++;
|
|
718
|
+
n.value = p;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
]), l;
|
|
723
|
+
})();
|
|
724
|
+
}),
|
|
725
|
+
(function(A, D, N) {
|
|
726
|
+
function f(o, r, t) {
|
|
727
|
+
this.x = null, this.y = null, o == null && r == null && t == null ? (this.x = 0, this.y = 0) : typeof o == "number" && typeof r == "number" && t == null ? (this.x = o, this.y = r) : o.constructor.name == "Point" && r == null && t == null && (t = o, this.x = t.x, this.y = t.y);
|
|
728
|
+
}
|
|
729
|
+
f.prototype.getX = function() {
|
|
730
|
+
return this.x;
|
|
731
|
+
}, f.prototype.getY = function() {
|
|
732
|
+
return this.y;
|
|
733
|
+
}, f.prototype.getLocation = function() {
|
|
734
|
+
return new f(this.x, this.y);
|
|
735
|
+
}, f.prototype.setLocation = function(o, r, t) {
|
|
736
|
+
o.constructor.name == "Point" && r == null && t == null ? (t = o, this.setLocation(t.x, t.y)) : typeof o == "number" && typeof r == "number" && t == null && (parseInt(o) == o && parseInt(r) == r ? this.move(o, r) : (this.x = Math.floor(o + 0.5), this.y = Math.floor(r + 0.5)));
|
|
737
|
+
}, f.prototype.move = function(o, r) {
|
|
738
|
+
this.x = o, this.y = r;
|
|
739
|
+
}, f.prototype.translate = function(o, r) {
|
|
740
|
+
this.x += o, this.y += r;
|
|
741
|
+
}, f.prototype.equals = function(o) {
|
|
742
|
+
if (o.constructor.name == "Point") {
|
|
743
|
+
var r = o;
|
|
744
|
+
return this.x == r.x && this.y == r.y;
|
|
745
|
+
}
|
|
746
|
+
return this == o;
|
|
747
|
+
}, f.prototype.toString = function() {
|
|
748
|
+
return new f().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
|
|
749
|
+
}, A.exports = f;
|
|
750
|
+
}),
|
|
751
|
+
(function(A, D, N) {
|
|
752
|
+
function f(o, r, t, e) {
|
|
753
|
+
this.x = 0, this.y = 0, this.width = 0, this.height = 0, o != null && r != null && t != null && e != null && (this.x = o, this.y = r, this.width = t, this.height = e);
|
|
754
|
+
}
|
|
755
|
+
f.prototype.getX = function() {
|
|
756
|
+
return this.x;
|
|
757
|
+
}, f.prototype.setX = function(o) {
|
|
758
|
+
this.x = o;
|
|
759
|
+
}, f.prototype.getY = function() {
|
|
760
|
+
return this.y;
|
|
761
|
+
}, f.prototype.setY = function(o) {
|
|
762
|
+
this.y = o;
|
|
763
|
+
}, f.prototype.getWidth = function() {
|
|
764
|
+
return this.width;
|
|
765
|
+
}, f.prototype.setWidth = function(o) {
|
|
766
|
+
this.width = o;
|
|
767
|
+
}, f.prototype.getHeight = function() {
|
|
768
|
+
return this.height;
|
|
769
|
+
}, f.prototype.setHeight = function(o) {
|
|
770
|
+
this.height = o;
|
|
771
|
+
}, f.prototype.getRight = function() {
|
|
772
|
+
return this.x + this.width;
|
|
773
|
+
}, f.prototype.getBottom = function() {
|
|
774
|
+
return this.y + this.height;
|
|
775
|
+
}, f.prototype.intersects = function(o) {
|
|
776
|
+
return !(this.getRight() < o.x || this.getBottom() < o.y || o.getRight() < this.x || o.getBottom() < this.y);
|
|
777
|
+
}, f.prototype.getCenterX = function() {
|
|
778
|
+
return this.x + this.width / 2;
|
|
779
|
+
}, f.prototype.getMinX = function() {
|
|
780
|
+
return this.getX();
|
|
781
|
+
}, f.prototype.getMaxX = function() {
|
|
782
|
+
return this.getX() + this.width;
|
|
783
|
+
}, f.prototype.getCenterY = function() {
|
|
784
|
+
return this.y + this.height / 2;
|
|
785
|
+
}, f.prototype.getMinY = function() {
|
|
786
|
+
return this.getY();
|
|
787
|
+
}, f.prototype.getMaxY = function() {
|
|
788
|
+
return this.getY() + this.height;
|
|
789
|
+
}, f.prototype.getWidthHalf = function() {
|
|
790
|
+
return this.width / 2;
|
|
791
|
+
}, f.prototype.getHeightHalf = function() {
|
|
792
|
+
return this.height / 2;
|
|
793
|
+
}, A.exports = f;
|
|
794
|
+
}),
|
|
795
|
+
(function(A, D, N) {
|
|
796
|
+
var f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
|
|
797
|
+
return typeof r;
|
|
798
|
+
} : function(r) {
|
|
799
|
+
return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
|
|
800
|
+
};
|
|
801
|
+
function o() {
|
|
802
|
+
}
|
|
803
|
+
o.lastID = 0, o.createID = function(r) {
|
|
804
|
+
return o.isPrimitive(r) ? r : (r.uniqueID == null && (r.uniqueID = o.getString(), o.lastID++), r.uniqueID);
|
|
805
|
+
}, o.getString = function(r) {
|
|
806
|
+
return r ??= o.lastID, "Object#" + r;
|
|
807
|
+
}, o.isPrimitive = function(r) {
|
|
808
|
+
var t = r === void 0 ? "undefined" : f(r);
|
|
809
|
+
return r == null || t != "object" && t != "function";
|
|
810
|
+
}, A.exports = o;
|
|
811
|
+
}),
|
|
812
|
+
(function(A, D, N) {
|
|
813
|
+
function f(g) {
|
|
814
|
+
if (Array.isArray(g)) {
|
|
815
|
+
for (var h = 0, c = Array(g.length); h < g.length; h++) c[h] = g[h];
|
|
816
|
+
return c;
|
|
817
|
+
} else return Array.from(g);
|
|
818
|
+
}
|
|
819
|
+
var o = N(0), r = N(7), t = N(3), e = N(1), l = N(6), i = N(5), p = N(17), a = N(29);
|
|
820
|
+
function n(g) {
|
|
821
|
+
a.call(this), this.layoutQuality = o.QUALITY, this.createBendsAsNeeded = o.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = o.DEFAULT_INCREMENTAL, this.animationOnLayout = o.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = o.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = o.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = o.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new r(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, g != null && (this.isRemoteUse = g);
|
|
822
|
+
}
|
|
823
|
+
n.RANDOM_SEED = 1, n.prototype = Object.create(a.prototype), n.prototype.getGraphManager = function() {
|
|
824
|
+
return this.graphManager;
|
|
825
|
+
}, n.prototype.getAllNodes = function() {
|
|
826
|
+
return this.graphManager.getAllNodes();
|
|
827
|
+
}, n.prototype.getAllEdges = function() {
|
|
828
|
+
return this.graphManager.getAllEdges();
|
|
829
|
+
}, n.prototype.getAllNodesToApplyGravitation = function() {
|
|
830
|
+
return this.graphManager.getAllNodesToApplyGravitation();
|
|
831
|
+
}, n.prototype.newGraphManager = function() {
|
|
832
|
+
var g = new r(this);
|
|
833
|
+
return this.graphManager = g, g;
|
|
834
|
+
}, n.prototype.newGraph = function(g) {
|
|
835
|
+
return new l(null, this.graphManager, g);
|
|
836
|
+
}, n.prototype.newNode = function(g) {
|
|
837
|
+
return new t(this.graphManager, g);
|
|
838
|
+
}, n.prototype.newEdge = function(g) {
|
|
839
|
+
return new e(null, null, g);
|
|
840
|
+
}, n.prototype.checkLayoutSuccess = function() {
|
|
841
|
+
return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
|
|
842
|
+
}, n.prototype.runLayout = function() {
|
|
843
|
+
this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
|
|
844
|
+
var g = this.checkLayoutSuccess() ? !1 : this.layout();
|
|
845
|
+
return o.ANIMATE === "during" ? !1 : (g && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, g);
|
|
846
|
+
}, n.prototype.doPostLayout = function() {
|
|
847
|
+
this.incremental || this.transform(), this.update();
|
|
848
|
+
}, n.prototype.update2 = function() {
|
|
849
|
+
if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
|
|
850
|
+
for (var g = this.graphManager.getAllEdges(), h = 0; h < g.length; h++) g[h];
|
|
851
|
+
for (var c = this.graphManager.getRoot().getNodes(), h = 0; h < c.length; h++) c[h];
|
|
852
|
+
this.update(this.graphManager.getRoot());
|
|
853
|
+
}
|
|
854
|
+
}, n.prototype.update = function(g) {
|
|
855
|
+
if (g == null) this.update2();
|
|
856
|
+
else if (g instanceof t) {
|
|
857
|
+
var h = g;
|
|
858
|
+
if (h.getChild() != null) for (var c = h.getChild().getNodes(), d = 0; d < c.length; d++) update(c[d]);
|
|
859
|
+
h.vGraphObject != null && h.vGraphObject.update(h);
|
|
860
|
+
} else if (g instanceof e) {
|
|
861
|
+
var v = g;
|
|
862
|
+
v.vGraphObject != null && v.vGraphObject.update(v);
|
|
863
|
+
} else if (g instanceof l) {
|
|
864
|
+
var T = g;
|
|
865
|
+
T.vGraphObject != null && T.vGraphObject.update(T);
|
|
866
|
+
}
|
|
867
|
+
}, n.prototype.initParameters = function() {
|
|
868
|
+
this.isSubLayout || (this.layoutQuality = o.QUALITY, this.animationDuringLayout = o.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = o.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = o.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = o.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = o.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = o.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
|
|
869
|
+
}, n.prototype.transform = function(g) {
|
|
870
|
+
if (g == null) this.transform(new i(0, 0));
|
|
871
|
+
else {
|
|
872
|
+
var h = new p(), c = this.graphManager.getRoot().updateLeftTop();
|
|
873
|
+
if (c != null) {
|
|
874
|
+
h.setWorldOrgX(g.x), h.setWorldOrgY(g.y), h.setDeviceOrgX(c.x), h.setDeviceOrgY(c.y);
|
|
875
|
+
for (var d = this.getAllNodes(), v, T = 0; T < d.length; T++) v = d[T], v.transform(h);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}, n.prototype.positionNodesRandomly = function(g) {
|
|
879
|
+
if (g == null) this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
|
|
880
|
+
else for (var h, c, d = g.getNodes(), v = 0; v < d.length; v++) h = d[v], c = h.getChild(), c == null || c.getNodes().length == 0 ? h.scatter() : (this.positionNodesRandomly(c), h.updateBounds());
|
|
881
|
+
}, n.prototype.getFlatForest = function() {
|
|
882
|
+
for (var g = [], h = !0, c = this.graphManager.getRoot().getNodes(), d = !0, v = 0; v < c.length; v++) c[v].getChild() != null && (d = !1);
|
|
883
|
+
if (!d) return g;
|
|
884
|
+
var T = /* @__PURE__ */ new Set(), L = [], F = /* @__PURE__ */ new Map(), S = [];
|
|
885
|
+
for (S = S.concat(c); S.length > 0 && h; ) {
|
|
886
|
+
for (L.push(S[0]); L.length > 0 && h; ) {
|
|
887
|
+
var P = L[0];
|
|
888
|
+
L.splice(0, 1), T.add(P);
|
|
889
|
+
for (var U = P.getEdges(), v = 0; v < U.length; v++) {
|
|
890
|
+
var Z = U[v].getOtherEnd(P);
|
|
891
|
+
if (F.get(P) != Z) if (!T.has(Z)) L.push(Z), F.set(Z, P);
|
|
892
|
+
else {
|
|
893
|
+
h = !1;
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
if (!h) g = [];
|
|
899
|
+
else {
|
|
900
|
+
var x = [].concat(f(T));
|
|
901
|
+
g.push(x);
|
|
902
|
+
for (var v = 0; v < x.length; v++) {
|
|
903
|
+
var K = x[v], s = S.indexOf(K);
|
|
904
|
+
s > -1 && S.splice(s, 1);
|
|
905
|
+
}
|
|
906
|
+
T = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Map();
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
return g;
|
|
910
|
+
}, n.prototype.createDummyNodesForBendpoints = function(g) {
|
|
911
|
+
for (var h = [], c = g.source, d = this.graphManager.calcLowestCommonAncestor(g.source, g.target), v = 0; v < g.bendpoints.length; v++) {
|
|
912
|
+
var T = this.newNode(null);
|
|
913
|
+
T.setRect(new Point(0, 0), new Dimension(1, 1)), d.add(T);
|
|
914
|
+
var L = this.newEdge(null);
|
|
915
|
+
this.graphManager.add(L, c, T), h.add(T), c = T;
|
|
916
|
+
}
|
|
917
|
+
var L = this.newEdge(null);
|
|
918
|
+
return this.graphManager.add(L, c, g.target), this.edgeToDummyNodes.set(g, h), g.isInterGraph() ? this.graphManager.remove(g) : d.remove(g), h;
|
|
919
|
+
}, n.prototype.createBendpointsFromDummyNodes = function() {
|
|
920
|
+
var g = [];
|
|
921
|
+
g = g.concat(this.graphManager.getAllEdges()), g = [].concat(f(this.edgeToDummyNodes.keys()), g);
|
|
922
|
+
for (var h = 0; h < g.length; h++) {
|
|
923
|
+
var c = g[h];
|
|
924
|
+
if (c.bendpoints.length > 0) {
|
|
925
|
+
for (var d = this.edgeToDummyNodes.get(c), v = 0; v < d.length; v++) {
|
|
926
|
+
var T = d[v], L = new i(T.getCenterX(), T.getCenterY()), F = c.bendpoints.get(v);
|
|
927
|
+
F.x = L.x, F.y = L.y, T.getOwner().remove(T);
|
|
928
|
+
}
|
|
929
|
+
this.graphManager.add(c, c.source, c.target);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}, n.transform = function(g, h, c, d) {
|
|
933
|
+
if (c != null && d != null) {
|
|
934
|
+
var v = h;
|
|
935
|
+
if (g <= 50) {
|
|
936
|
+
var T = h / c;
|
|
937
|
+
v -= (h - T) / 50 * (50 - g);
|
|
938
|
+
} else {
|
|
939
|
+
var L = h * d;
|
|
940
|
+
v += (L - h) / 50 * (g - 50);
|
|
941
|
+
}
|
|
942
|
+
return v;
|
|
943
|
+
} else {
|
|
944
|
+
var F, S;
|
|
945
|
+
return g <= 50 ? (F = 9 * h / 500, S = h / 10) : (F = 9 * h / 50, S = -8 * h), F * g + S;
|
|
946
|
+
}
|
|
947
|
+
}, n.findCenterOfTree = function(g) {
|
|
948
|
+
var h = [];
|
|
949
|
+
h = h.concat(g);
|
|
950
|
+
var c = [], d = /* @__PURE__ */ new Map(), v = !1, T = null;
|
|
951
|
+
(h.length == 1 || h.length == 2) && (v = !0, T = h[0]);
|
|
952
|
+
for (var L = 0; L < h.length; L++) {
|
|
953
|
+
var F = h[L], S = F.getNeighborsList().size;
|
|
954
|
+
d.set(F, F.getNeighborsList().size), S == 1 && c.push(F);
|
|
955
|
+
}
|
|
956
|
+
var P = [];
|
|
957
|
+
for (P = P.concat(c); !v; ) {
|
|
958
|
+
var U = [];
|
|
959
|
+
U = U.concat(P), P = [];
|
|
960
|
+
for (var L = 0; L < h.length; L++) {
|
|
961
|
+
var F = h[L], Z = h.indexOf(F);
|
|
962
|
+
Z >= 0 && h.splice(Z, 1), F.getNeighborsList().forEach(function(s) {
|
|
963
|
+
if (c.indexOf(s) < 0) {
|
|
964
|
+
var E = d.get(s) - 1;
|
|
965
|
+
E == 1 && P.push(s), d.set(s, E);
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
c = c.concat(P), (h.length == 1 || h.length == 2) && (v = !0, T = h[0]);
|
|
970
|
+
}
|
|
971
|
+
return T;
|
|
972
|
+
}, n.prototype.setGraphManager = function(g) {
|
|
973
|
+
this.graphManager = g;
|
|
974
|
+
}, A.exports = n;
|
|
975
|
+
}),
|
|
976
|
+
(function(A, D, N) {
|
|
977
|
+
function f() {
|
|
978
|
+
}
|
|
979
|
+
f.seed = 1, f.x = 0, f.nextDouble = function() {
|
|
980
|
+
return f.x = Math.sin(f.seed++) * 1e4, f.x - Math.floor(f.x);
|
|
981
|
+
}, A.exports = f;
|
|
982
|
+
}),
|
|
983
|
+
(function(A, D, N) {
|
|
984
|
+
var f = N(5);
|
|
985
|
+
function o(r, t) {
|
|
986
|
+
this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
|
|
987
|
+
}
|
|
988
|
+
o.prototype.getWorldOrgX = function() {
|
|
989
|
+
return this.lworldOrgX;
|
|
990
|
+
}, o.prototype.setWorldOrgX = function(r) {
|
|
991
|
+
this.lworldOrgX = r;
|
|
992
|
+
}, o.prototype.getWorldOrgY = function() {
|
|
993
|
+
return this.lworldOrgY;
|
|
994
|
+
}, o.prototype.setWorldOrgY = function(r) {
|
|
995
|
+
this.lworldOrgY = r;
|
|
996
|
+
}, o.prototype.getWorldExtX = function() {
|
|
997
|
+
return this.lworldExtX;
|
|
998
|
+
}, o.prototype.setWorldExtX = function(r) {
|
|
999
|
+
this.lworldExtX = r;
|
|
1000
|
+
}, o.prototype.getWorldExtY = function() {
|
|
1001
|
+
return this.lworldExtY;
|
|
1002
|
+
}, o.prototype.setWorldExtY = function(r) {
|
|
1003
|
+
this.lworldExtY = r;
|
|
1004
|
+
}, o.prototype.getDeviceOrgX = function() {
|
|
1005
|
+
return this.ldeviceOrgX;
|
|
1006
|
+
}, o.prototype.setDeviceOrgX = function(r) {
|
|
1007
|
+
this.ldeviceOrgX = r;
|
|
1008
|
+
}, o.prototype.getDeviceOrgY = function() {
|
|
1009
|
+
return this.ldeviceOrgY;
|
|
1010
|
+
}, o.prototype.setDeviceOrgY = function(r) {
|
|
1011
|
+
this.ldeviceOrgY = r;
|
|
1012
|
+
}, o.prototype.getDeviceExtX = function() {
|
|
1013
|
+
return this.ldeviceExtX;
|
|
1014
|
+
}, o.prototype.setDeviceExtX = function(r) {
|
|
1015
|
+
this.ldeviceExtX = r;
|
|
1016
|
+
}, o.prototype.getDeviceExtY = function() {
|
|
1017
|
+
return this.ldeviceExtY;
|
|
1018
|
+
}, o.prototype.setDeviceExtY = function(r) {
|
|
1019
|
+
this.ldeviceExtY = r;
|
|
1020
|
+
}, o.prototype.transformX = function(r) {
|
|
1021
|
+
var t = 0, e = this.lworldExtX;
|
|
1022
|
+
return e != 0 && (t = this.ldeviceOrgX + (r - this.lworldOrgX) * this.ldeviceExtX / e), t;
|
|
1023
|
+
}, o.prototype.transformY = function(r) {
|
|
1024
|
+
var t = 0, e = this.lworldExtY;
|
|
1025
|
+
return e != 0 && (t = this.ldeviceOrgY + (r - this.lworldOrgY) * this.ldeviceExtY / e), t;
|
|
1026
|
+
}, o.prototype.inverseTransformX = function(r) {
|
|
1027
|
+
var t = 0, e = this.ldeviceExtX;
|
|
1028
|
+
return e != 0 && (t = this.lworldOrgX + (r - this.ldeviceOrgX) * this.lworldExtX / e), t;
|
|
1029
|
+
}, o.prototype.inverseTransformY = function(r) {
|
|
1030
|
+
var t = 0, e = this.ldeviceExtY;
|
|
1031
|
+
return e != 0 && (t = this.lworldOrgY + (r - this.ldeviceOrgY) * this.lworldExtY / e), t;
|
|
1032
|
+
}, o.prototype.inverseTransformPoint = function(r) {
|
|
1033
|
+
return new f(this.inverseTransformX(r.x), this.inverseTransformY(r.y));
|
|
1034
|
+
}, A.exports = o;
|
|
1035
|
+
}),
|
|
1036
|
+
(function(A, D, N) {
|
|
1037
|
+
function f(a) {
|
|
1038
|
+
if (Array.isArray(a)) {
|
|
1039
|
+
for (var n = 0, g = Array(a.length); n < a.length; n++) g[n] = a[n];
|
|
1040
|
+
return g;
|
|
1041
|
+
} else return Array.from(a);
|
|
1042
|
+
}
|
|
1043
|
+
var o = N(15), r = N(4), t = N(0), e = N(8), l = N(9);
|
|
1044
|
+
function i() {
|
|
1045
|
+
o.call(this), this.useSmartIdealEdgeLengthCalculation = r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = r.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = r.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = r.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * r.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = r.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = r.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = r.MAX_ITERATIONS;
|
|
1046
|
+
}
|
|
1047
|
+
for (var p in i.prototype = Object.create(o.prototype), o) i[p] = o[p];
|
|
1048
|
+
i.prototype.initParameters = function() {
|
|
1049
|
+
o.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
|
|
1050
|
+
}, i.prototype.calcIdealEdgeLengths = function() {
|
|
1051
|
+
for (var a, n, g, h, c, d, v, T = this.getGraphManager().getAllEdges(), L = 0; L < T.length; L++) a = T[L], n = a.idealLength, a.isInterGraph && (h = a.getSource(), c = a.getTarget(), d = a.getSourceInLca().getEstimatedSize(), v = a.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (a.idealLength += d + v - 2 * t.SIMPLE_NODE_SIZE), g = a.getLca().getInclusionTreeDepth(), a.idealLength += n * r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (h.getInclusionTreeDepth() + c.getInclusionTreeDepth() - 2 * g));
|
|
1052
|
+
}, i.prototype.initSpringEmbedder = function() {
|
|
1053
|
+
var a = this.getAllNodes().length;
|
|
1054
|
+
this.incremental ? (a > r.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * r.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (a - r.ADAPTATION_LOWER_NODE_LIMIT) / (r.ADAPTATION_UPPER_NODE_LIMIT - r.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - r.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = r.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (a > r.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(r.COOLING_ADAPTATION_FACTOR, 1 - (a - r.ADAPTATION_LOWER_NODE_LIMIT) / (r.ADAPTATION_UPPER_NODE_LIMIT - r.ADAPTATION_LOWER_NODE_LIMIT) * (1 - r.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = r.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * r.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
|
|
1055
|
+
}, i.prototype.calcSpringForces = function() {
|
|
1056
|
+
for (var a = this.getAllEdges(), n, g = 0; g < a.length; g++) n = a[g], this.calcSpringForce(n, n.idealLength);
|
|
1057
|
+
}, i.prototype.calcRepulsionForces = function() {
|
|
1058
|
+
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, g, h, c, d, v = this.getAllNodes(), T;
|
|
1059
|
+
if (this.useFRGridVariant) for (this.totalIterations % r.GRID_CALCULATION_CHECK_PERIOD == 1 && a && this.updateGrid(), T = /* @__PURE__ */ new Set(), g = 0; g < v.length; g++) c = v[g], this.calculateRepulsionForceOfANode(c, T, a, n), T.add(c);
|
|
1060
|
+
else for (g = 0; g < v.length; g++) for (c = v[g], h = g + 1; h < v.length; h++) d = v[h], c.getOwner() == d.getOwner() && this.calcRepulsionForce(c, d);
|
|
1061
|
+
}, i.prototype.calcGravitationalForces = function() {
|
|
1062
|
+
for (var a, n = this.getAllNodesToApplyGravitation(), g = 0; g < n.length; g++) a = n[g], this.calcGravitationalForce(a);
|
|
1063
|
+
}, i.prototype.moveNodes = function() {
|
|
1064
|
+
for (var a = this.getAllNodes(), n, g = 0; g < a.length; g++) n = a[g], n.move();
|
|
1065
|
+
}, i.prototype.calcSpringForce = function(a, n) {
|
|
1066
|
+
var g = a.getSource(), h = a.getTarget(), c, d, v, T;
|
|
1067
|
+
if (this.uniformLeafNodeSizes && g.getChild() == null && h.getChild() == null) a.updateLengthSimple();
|
|
1068
|
+
else if (a.updateLength(), a.isOverlapingSourceAndTarget) return;
|
|
1069
|
+
c = a.getLength(), c != 0 && (d = a.edgeElasticity * (c - n), v = d * (a.lengthX / c), T = d * (a.lengthY / c), g.springForceX += v, g.springForceY += T, h.springForceX -= v, h.springForceY -= T);
|
|
1070
|
+
}, i.prototype.calcRepulsionForce = function(a, n) {
|
|
1071
|
+
var g = a.getRect(), h = n.getRect(), c = [, ,], d = [
|
|
1072
|
+
,
|
|
1073
|
+
,
|
|
1074
|
+
,
|
|
1075
|
+
,
|
|
1076
|
+
], v, T, L, F, S, P, U;
|
|
1077
|
+
if (g.intersects(h)) {
|
|
1078
|
+
e.calcSeparationAmount(g, h, c, r.DEFAULT_EDGE_LENGTH / 2), P = 2 * c[0], U = 2 * c[1];
|
|
1079
|
+
var Z = a.noOfChildren * n.noOfChildren / (a.noOfChildren + n.noOfChildren);
|
|
1080
|
+
a.repulsionForceX -= Z * P, a.repulsionForceY -= Z * U, n.repulsionForceX += Z * P, n.repulsionForceY += Z * U;
|
|
1081
|
+
} else this.uniformLeafNodeSizes && a.getChild() == null && n.getChild() == null ? (v = h.getCenterX() - g.getCenterX(), T = h.getCenterY() - g.getCenterY()) : (e.getIntersection(g, h, d), v = d[2] - d[0], T = d[3] - d[1]), Math.abs(v) < r.MIN_REPULSION_DIST && (v = l.sign(v) * r.MIN_REPULSION_DIST), Math.abs(T) < r.MIN_REPULSION_DIST && (T = l.sign(T) * r.MIN_REPULSION_DIST), L = v * v + T * T, F = Math.sqrt(L), S = (a.nodeRepulsion / 2 + n.nodeRepulsion / 2) * a.noOfChildren * n.noOfChildren / L, P = S * v / F, U = S * T / F, a.repulsionForceX -= P, a.repulsionForceY -= U, n.repulsionForceX += P, n.repulsionForceY += U;
|
|
1082
|
+
}, i.prototype.calcGravitationalForce = function(a) {
|
|
1083
|
+
var n = a.getOwner(), g = (n.getRight() + n.getLeft()) / 2, h = (n.getTop() + n.getBottom()) / 2, c = a.getCenterX() - g, d = a.getCenterY() - h, v = Math.abs(c) + a.getWidth() / 2, T = Math.abs(d) + a.getHeight() / 2, L;
|
|
1084
|
+
a.getOwner() == this.graphManager.getRoot() ? (L = n.getEstimatedSize() * this.gravityRangeFactor, (v > L || T > L) && (a.gravitationForceX = -this.gravityConstant * c, a.gravitationForceY = -this.gravityConstant * d)) : (L = n.getEstimatedSize() * this.compoundGravityRangeFactor, (v > L || T > L) && (a.gravitationForceX = -this.gravityConstant * c * this.compoundGravityConstant, a.gravitationForceY = -this.gravityConstant * d * this.compoundGravityConstant));
|
|
1085
|
+
}, i.prototype.isConverged = function() {
|
|
1086
|
+
var a, n = !1;
|
|
1087
|
+
return this.totalIterations > this.maxIterations / 3 && (n = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), a = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, a || n;
|
|
1088
|
+
}, i.prototype.animate = function() {
|
|
1089
|
+
this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
|
|
1090
|
+
}, i.prototype.calcNoOfChildrenForAllNodes = function() {
|
|
1091
|
+
for (var a, n = this.graphManager.getAllNodes(), g = 0; g < n.length; g++) a = n[g], a.noOfChildren = a.getNoOfChildren();
|
|
1092
|
+
}, i.prototype.calcGrid = function(a) {
|
|
1093
|
+
var n = 0, g = 0;
|
|
1094
|
+
n = parseInt(Math.ceil((a.getRight() - a.getLeft()) / this.repulsionRange)), g = parseInt(Math.ceil((a.getBottom() - a.getTop()) / this.repulsionRange));
|
|
1095
|
+
for (var h = Array(n), c = 0; c < n; c++) h[c] = Array(g);
|
|
1096
|
+
for (var c = 0; c < n; c++) for (var d = 0; d < g; d++) h[c][d] = [];
|
|
1097
|
+
return h;
|
|
1098
|
+
}, i.prototype.addNodeToGrid = function(a, n, g) {
|
|
1099
|
+
var h = 0, c = 0, d = 0, v = 0;
|
|
1100
|
+
h = parseInt(Math.floor((a.getRect().x - n) / this.repulsionRange)), c = parseInt(Math.floor((a.getRect().width + a.getRect().x - n) / this.repulsionRange)), d = parseInt(Math.floor((a.getRect().y - g) / this.repulsionRange)), v = parseInt(Math.floor((a.getRect().height + a.getRect().y - g) / this.repulsionRange));
|
|
1101
|
+
for (var T = h; T <= c; T++) for (var L = d; L <= v; L++) this.grid[T][L].push(a), a.setGridCoordinates(h, c, d, v);
|
|
1102
|
+
}, i.prototype.updateGrid = function() {
|
|
1103
|
+
var a, n, g = this.getAllNodes();
|
|
1104
|
+
for (this.grid = this.calcGrid(this.graphManager.getRoot()), a = 0; a < g.length; a++) n = g[a], this.addNodeToGrid(n, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
|
|
1105
|
+
}, i.prototype.calculateRepulsionForceOfANode = function(a, n, g, h) {
|
|
1106
|
+
if (this.totalIterations % r.GRID_CALCULATION_CHECK_PERIOD == 1 && g || h) {
|
|
1107
|
+
var c = /* @__PURE__ */ new Set();
|
|
1108
|
+
a.surrounding = [];
|
|
1109
|
+
for (var d, v = this.grid, T = a.startX - 1; T < a.finishX + 2; T++) for (var L = a.startY - 1; L < a.finishY + 2; L++) if (!(T < 0 || L < 0 || T >= v.length || L >= v[0].length)) {
|
|
1110
|
+
for (var F = 0; F < v[T][L].length; F++) if (d = v[T][L][F], !(a.getOwner() != d.getOwner() || a == d) && !n.has(d) && !c.has(d)) {
|
|
1111
|
+
var S = Math.abs(a.getCenterX() - d.getCenterX()) - (a.getWidth() / 2 + d.getWidth() / 2), P = Math.abs(a.getCenterY() - d.getCenterY()) - (a.getHeight() / 2 + d.getHeight() / 2);
|
|
1112
|
+
S <= this.repulsionRange && P <= this.repulsionRange && c.add(d);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
a.surrounding = [].concat(f(c));
|
|
1116
|
+
}
|
|
1117
|
+
for (T = 0; T < a.surrounding.length; T++) this.calcRepulsionForce(a, a.surrounding[T]);
|
|
1118
|
+
}, i.prototype.calcRepulsionRange = function() {
|
|
1119
|
+
return 0;
|
|
1120
|
+
}, A.exports = i;
|
|
1121
|
+
}),
|
|
1122
|
+
(function(A, D, N) {
|
|
1123
|
+
var f = N(1), o = N(4);
|
|
1124
|
+
function r(e, l, i) {
|
|
1125
|
+
f.call(this, e, l, i), this.idealLength = o.DEFAULT_EDGE_LENGTH, this.edgeElasticity = o.DEFAULT_SPRING_STRENGTH;
|
|
1126
|
+
}
|
|
1127
|
+
for (var t in r.prototype = Object.create(f.prototype), f) r[t] = f[t];
|
|
1128
|
+
A.exports = r;
|
|
1129
|
+
}),
|
|
1130
|
+
(function(A, D, N) {
|
|
1131
|
+
var f = N(3), o = N(4);
|
|
1132
|
+
function r(e, l, i, p) {
|
|
1133
|
+
f.call(this, e, l, i, p), this.nodeRepulsion = o.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 = [];
|
|
1134
|
+
}
|
|
1135
|
+
for (var t in r.prototype = Object.create(f.prototype), f) r[t] = f[t];
|
|
1136
|
+
r.prototype.setGridCoordinates = function(e, l, i, p) {
|
|
1137
|
+
this.startX = e, this.finishX = l, this.startY = i, this.finishY = p;
|
|
1138
|
+
}, A.exports = r;
|
|
1139
|
+
}),
|
|
1140
|
+
(function(A, D, N) {
|
|
1141
|
+
function f(o, r) {
|
|
1142
|
+
this.width = 0, this.height = 0, o !== null && r !== null && (this.height = r, this.width = o);
|
|
1143
|
+
}
|
|
1144
|
+
f.prototype.getWidth = function() {
|
|
1145
|
+
return this.width;
|
|
1146
|
+
}, f.prototype.setWidth = function(o) {
|
|
1147
|
+
this.width = o;
|
|
1148
|
+
}, f.prototype.getHeight = function() {
|
|
1149
|
+
return this.height;
|
|
1150
|
+
}, f.prototype.setHeight = function(o) {
|
|
1151
|
+
this.height = o;
|
|
1152
|
+
}, A.exports = f;
|
|
1153
|
+
}),
|
|
1154
|
+
(function(A, D, N) {
|
|
1155
|
+
var f = N(14);
|
|
1156
|
+
function o() {
|
|
1157
|
+
this.map = {}, this.keys = [];
|
|
1158
|
+
}
|
|
1159
|
+
o.prototype.put = function(r, t) {
|
|
1160
|
+
var e = f.createID(r);
|
|
1161
|
+
this.contains(e) || (this.map[e] = t, this.keys.push(r));
|
|
1162
|
+
}, o.prototype.contains = function(r) {
|
|
1163
|
+
return f.createID(r), this.map[r] != null;
|
|
1164
|
+
}, o.prototype.get = function(r) {
|
|
1165
|
+
var t = f.createID(r);
|
|
1166
|
+
return this.map[t];
|
|
1167
|
+
}, o.prototype.keySet = function() {
|
|
1168
|
+
return this.keys;
|
|
1169
|
+
}, A.exports = o;
|
|
1170
|
+
}),
|
|
1171
|
+
(function(A, D, N) {
|
|
1172
|
+
var f = N(14);
|
|
1173
|
+
function o() {
|
|
1174
|
+
this.set = {};
|
|
1175
|
+
}
|
|
1176
|
+
o.prototype.add = function(r) {
|
|
1177
|
+
var t = f.createID(r);
|
|
1178
|
+
this.contains(t) || (this.set[t] = r);
|
|
1179
|
+
}, o.prototype.remove = function(r) {
|
|
1180
|
+
delete this.set[f.createID(r)];
|
|
1181
|
+
}, o.prototype.clear = function() {
|
|
1182
|
+
this.set = {};
|
|
1183
|
+
}, o.prototype.contains = function(r) {
|
|
1184
|
+
return this.set[f.createID(r)] == r;
|
|
1185
|
+
}, o.prototype.isEmpty = function() {
|
|
1186
|
+
return this.size() === 0;
|
|
1187
|
+
}, o.prototype.size = function() {
|
|
1188
|
+
return Object.keys(this.set).length;
|
|
1189
|
+
}, o.prototype.addAllTo = function(r) {
|
|
1190
|
+
for (var t = Object.keys(this.set), e = t.length, l = 0; l < e; l++) r.push(this.set[t[l]]);
|
|
1191
|
+
}, o.prototype.size = function() {
|
|
1192
|
+
return Object.keys(this.set).length;
|
|
1193
|
+
}, o.prototype.addAll = function(r) {
|
|
1194
|
+
for (var t = r.length, e = 0; e < t; e++) {
|
|
1195
|
+
var l = r[e];
|
|
1196
|
+
this.add(l);
|
|
1197
|
+
}
|
|
1198
|
+
}, A.exports = o;
|
|
1199
|
+
}),
|
|
1200
|
+
(function(A, D, N) {
|
|
1201
|
+
function f() {
|
|
1202
|
+
}
|
|
1203
|
+
f.multMat = function(o, r) {
|
|
1204
|
+
for (var t = [], e = 0; e < o.length; e++) {
|
|
1205
|
+
t[e] = [];
|
|
1206
|
+
for (var l = 0; l < r[0].length; l++) {
|
|
1207
|
+
t[e][l] = 0;
|
|
1208
|
+
for (var i = 0; i < o[0].length; i++) t[e][l] += o[e][i] * r[i][l];
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
return t;
|
|
1212
|
+
}, f.transpose = function(o) {
|
|
1213
|
+
for (var r = [], t = 0; t < o[0].length; t++) {
|
|
1214
|
+
r[t] = [];
|
|
1215
|
+
for (var e = 0; e < o.length; e++) r[t][e] = o[e][t];
|
|
1216
|
+
}
|
|
1217
|
+
return r;
|
|
1218
|
+
}, f.multCons = function(o, r) {
|
|
1219
|
+
for (var t = [], e = 0; e < o.length; e++) t[e] = o[e] * r;
|
|
1220
|
+
return t;
|
|
1221
|
+
}, f.minusOp = function(o, r) {
|
|
1222
|
+
for (var t = [], e = 0; e < o.length; e++) t[e] = o[e] - r[e];
|
|
1223
|
+
return t;
|
|
1224
|
+
}, f.dotProduct = function(o, r) {
|
|
1225
|
+
for (var t = 0, e = 0; e < o.length; e++) t += o[e] * r[e];
|
|
1226
|
+
return t;
|
|
1227
|
+
}, f.mag = function(o) {
|
|
1228
|
+
return Math.sqrt(this.dotProduct(o, o));
|
|
1229
|
+
}, f.normalize = function(o) {
|
|
1230
|
+
for (var r = [], t = this.mag(o), e = 0; e < o.length; e++) r[e] = o[e] / t;
|
|
1231
|
+
return r;
|
|
1232
|
+
}, f.multGamma = function(o) {
|
|
1233
|
+
for (var r = [], t = 0, e = 0; e < o.length; e++) t += o[e];
|
|
1234
|
+
t *= -1 / o.length;
|
|
1235
|
+
for (var l = 0; l < o.length; l++) r[l] = t + o[l];
|
|
1236
|
+
return r;
|
|
1237
|
+
}, f.multL = function(o, r, t) {
|
|
1238
|
+
for (var e = [], l = [], i = [], p = 0; p < r[0].length; p++) {
|
|
1239
|
+
for (var a = 0, n = 0; n < r.length; n++) a += -0.5 * r[n][p] * o[n];
|
|
1240
|
+
l[p] = a;
|
|
1241
|
+
}
|
|
1242
|
+
for (var g = 0; g < t.length; g++) {
|
|
1243
|
+
for (var h = 0, c = 0; c < t.length; c++) h += t[g][c] * l[c];
|
|
1244
|
+
i[g] = h;
|
|
1245
|
+
}
|
|
1246
|
+
for (var d = 0; d < r.length; d++) {
|
|
1247
|
+
for (var v = 0, T = 0; T < r[0].length; T++) v += r[d][T] * i[T];
|
|
1248
|
+
e[d] = v;
|
|
1249
|
+
}
|
|
1250
|
+
return e;
|
|
1251
|
+
}, A.exports = f;
|
|
1252
|
+
}),
|
|
1253
|
+
(function(A, D, N) {
|
|
1254
|
+
var f = /* @__PURE__ */ (function() {
|
|
1255
|
+
function t(e, l) {
|
|
1256
|
+
for (var i = 0; i < l.length; i++) {
|
|
1257
|
+
var p = l[i];
|
|
1258
|
+
p.enumerable = p.enumerable || !1, p.configurable = !0, "value" in p && (p.writable = !0), Object.defineProperty(e, p.key, p);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
return function(e, l, i) {
|
|
1262
|
+
return l && t(e.prototype, l), i && t(e, i), e;
|
|
1263
|
+
};
|
|
1264
|
+
})();
|
|
1265
|
+
function o(t, e) {
|
|
1266
|
+
if (!(t instanceof e)) throw TypeError("Cannot call a class as a function");
|
|
1267
|
+
}
|
|
1268
|
+
var r = N(11);
|
|
1269
|
+
A.exports = (function() {
|
|
1270
|
+
function t(e, l) {
|
|
1271
|
+
o(this, t), (l !== null || l !== void 0) && (this.compareFunction = this._defaultCompareFunction);
|
|
1272
|
+
var i = void 0;
|
|
1273
|
+
i = e instanceof r ? e.size() : e.length, this._quicksort(e, 0, i - 1);
|
|
1274
|
+
}
|
|
1275
|
+
return f(t, [
|
|
1276
|
+
{
|
|
1277
|
+
key: "_quicksort",
|
|
1278
|
+
value: function(e, l, i) {
|
|
1279
|
+
if (l < i) {
|
|
1280
|
+
var p = this._partition(e, l, i);
|
|
1281
|
+
this._quicksort(e, l, p), this._quicksort(e, p + 1, i);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
key: "_partition",
|
|
1287
|
+
value: function(e, l, i) {
|
|
1288
|
+
for (var p = this._get(e, l), a = l, n = i; ; ) {
|
|
1289
|
+
for (; this.compareFunction(p, this._get(e, n)); ) n--;
|
|
1290
|
+
for (; this.compareFunction(this._get(e, a), p); ) a++;
|
|
1291
|
+
if (a < n) this._swap(e, a, n), a++, n--;
|
|
1292
|
+
else return n;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
key: "_get",
|
|
1298
|
+
value: function(e, l) {
|
|
1299
|
+
return e instanceof r ? e.get_object_at(l) : e[l];
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
key: "_set",
|
|
1304
|
+
value: function(e, l, i) {
|
|
1305
|
+
e instanceof r ? e.set_object_at(l, i) : e[l] = i;
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
key: "_swap",
|
|
1310
|
+
value: function(e, l, i) {
|
|
1311
|
+
var p = this._get(e, l);
|
|
1312
|
+
this._set(e, l, this._get(e, i)), this._set(e, i, p);
|
|
1313
|
+
}
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
key: "_defaultCompareFunction",
|
|
1317
|
+
value: function(e, l) {
|
|
1318
|
+
return l > e;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
]), t;
|
|
1322
|
+
})();
|
|
1323
|
+
}),
|
|
1324
|
+
(function(A, D, N) {
|
|
1325
|
+
function f() {
|
|
1326
|
+
}
|
|
1327
|
+
f.svd = function(o) {
|
|
1328
|
+
this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = o.length, this.n = o[0].length;
|
|
1329
|
+
var r = Math.min(this.m, this.n);
|
|
1330
|
+
this.s = (function(Tt) {
|
|
1331
|
+
for (var Nt = []; Tt-- > 0; ) Nt.push(0);
|
|
1332
|
+
return Nt;
|
|
1333
|
+
})(Math.min(this.m + 1, this.n)), this.U = (function(Tt) {
|
|
1334
|
+
return (function Nt(Mt) {
|
|
1335
|
+
if (Mt.length == 0) return 0;
|
|
1336
|
+
for (var Pt = [], Xt = 0; Xt < Mt[0]; Xt++) Pt.push(Nt(Mt.slice(1)));
|
|
1337
|
+
return Pt;
|
|
1338
|
+
})(Tt);
|
|
1339
|
+
})([this.m, r]), this.V = (function(Tt) {
|
|
1340
|
+
return (function Nt(Mt) {
|
|
1341
|
+
if (Mt.length == 0) return 0;
|
|
1342
|
+
for (var Pt = [], Xt = 0; Xt < Mt[0]; Xt++) Pt.push(Nt(Mt.slice(1)));
|
|
1343
|
+
return Pt;
|
|
1344
|
+
})(Tt);
|
|
1345
|
+
})([this.n, this.n]);
|
|
1346
|
+
for (var t = (function(Tt) {
|
|
1347
|
+
for (var Nt = []; Tt-- > 0; ) Nt.push(0);
|
|
1348
|
+
return Nt;
|
|
1349
|
+
})(this.n), e = (function(Tt) {
|
|
1350
|
+
for (var Nt = []; Tt-- > 0; ) Nt.push(0);
|
|
1351
|
+
return Nt;
|
|
1352
|
+
})(this.m), l = !0, i = !0, p = Math.min(this.m - 1, this.n), a = Math.max(0, Math.min(this.n - 2, this.m)), n = 0; n < Math.max(p, a); n++) {
|
|
1353
|
+
if (n < p) {
|
|
1354
|
+
this.s[n] = 0;
|
|
1355
|
+
for (var g = n; g < this.m; g++) this.s[n] = f.hypot(this.s[n], o[g][n]);
|
|
1356
|
+
if (this.s[n] !== 0) {
|
|
1357
|
+
o[n][n] < 0 && (this.s[n] = -this.s[n]);
|
|
1358
|
+
for (var h = n; h < this.m; h++) o[h][n] /= this.s[n];
|
|
1359
|
+
o[n][n] += 1;
|
|
1360
|
+
}
|
|
1361
|
+
this.s[n] = -this.s[n];
|
|
1362
|
+
}
|
|
1363
|
+
for (var c = n + 1; c < this.n; c++) {
|
|
1364
|
+
if (/* @__PURE__ */ (function(Tt, Nt) {
|
|
1365
|
+
return Tt && Nt;
|
|
1366
|
+
})(n < p, this.s[n] !== 0)) {
|
|
1367
|
+
for (var d = 0, v = n; v < this.m; v++) d += o[v][n] * o[v][c];
|
|
1368
|
+
d = -d / o[n][n];
|
|
1369
|
+
for (var T = n; T < this.m; T++) o[T][c] += d * o[T][n];
|
|
1370
|
+
}
|
|
1371
|
+
t[c] = o[n][c];
|
|
1372
|
+
}
|
|
1373
|
+
if (/* @__PURE__ */ (function(Tt, Nt) {
|
|
1374
|
+
return Tt && Nt;
|
|
1375
|
+
})(l, n < p)) for (var L = n; L < this.m; L++) this.U[L][n] = o[L][n];
|
|
1376
|
+
if (n < a) {
|
|
1377
|
+
t[n] = 0;
|
|
1378
|
+
for (var F = n + 1; F < this.n; F++) t[n] = f.hypot(t[n], t[F]);
|
|
1379
|
+
if (t[n] !== 0) {
|
|
1380
|
+
t[n + 1] < 0 && (t[n] = -t[n]);
|
|
1381
|
+
for (var S = n + 1; S < this.n; S++) t[S] /= t[n];
|
|
1382
|
+
t[n + 1] += 1;
|
|
1383
|
+
}
|
|
1384
|
+
if (t[n] = -t[n], /* @__PURE__ */ (function(Tt, Nt) {
|
|
1385
|
+
return Tt && Nt;
|
|
1386
|
+
})(n + 1 < this.m, t[n] !== 0)) {
|
|
1387
|
+
for (var P = n + 1; P < this.m; P++) e[P] = 0;
|
|
1388
|
+
for (var U = n + 1; U < this.n; U++) for (var Z = n + 1; Z < this.m; Z++) e[Z] += t[U] * o[Z][U];
|
|
1389
|
+
for (var x = n + 1; x < this.n; x++) for (var K = -t[x] / t[n + 1], s = n + 1; s < this.m; s++) o[s][x] += K * e[s];
|
|
1390
|
+
}
|
|
1391
|
+
if (i) for (var E = n + 1; E < this.n; E++) this.V[E][n] = t[E];
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
var u = Math.min(this.n, this.m + 1);
|
|
1395
|
+
if (p < this.n && (this.s[p] = o[p][p]), this.m < u && (this.s[u - 1] = 0), a + 1 < u && (t[a] = o[a][u - 1]), t[u - 1] = 0, l) {
|
|
1396
|
+
for (var m = p; m < r; m++) {
|
|
1397
|
+
for (var y = 0; y < this.m; y++) this.U[y][m] = 0;
|
|
1398
|
+
this.U[m][m] = 1;
|
|
1399
|
+
}
|
|
1400
|
+
for (var C = p - 1; C >= 0; C--) if (this.s[C] !== 0) {
|
|
1401
|
+
for (var w = C + 1; w < r; w++) {
|
|
1402
|
+
for (var R = 0, G = C; G < this.m; G++) R += this.U[G][C] * this.U[G][w];
|
|
1403
|
+
R = -R / this.U[C][C];
|
|
1404
|
+
for (var b = C; b < this.m; b++) this.U[b][w] += R * this.U[b][C];
|
|
1405
|
+
}
|
|
1406
|
+
for (var k = C; k < this.m; k++) this.U[k][C] = -this.U[k][C];
|
|
1407
|
+
this.U[C][C] = 1 + this.U[C][C];
|
|
1408
|
+
for (var W = 0; W < C - 1; W++) this.U[W][C] = 0;
|
|
1409
|
+
} else {
|
|
1410
|
+
for (var J = 0; J < this.m; J++) this.U[J][C] = 0;
|
|
1411
|
+
this.U[C][C] = 1;
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
if (i) for (var H = this.n - 1; H >= 0; H--) {
|
|
1415
|
+
if (/* @__PURE__ */ (function(Tt, Nt) {
|
|
1416
|
+
return Tt && Nt;
|
|
1417
|
+
})(H < a, t[H] !== 0)) for (var z = H + 1; z < r; z++) {
|
|
1418
|
+
for (var O = 0, B = H + 1; B < this.n; B++) O += this.V[B][H] * this.V[B][z];
|
|
1419
|
+
O = -O / this.V[H + 1][H];
|
|
1420
|
+
for (var et = H + 1; et < this.n; et++) this.V[et][z] += O * this.V[et][H];
|
|
1421
|
+
}
|
|
1422
|
+
for (var X = 0; X < this.n; X++) this.V[X][H] = 0;
|
|
1423
|
+
this.V[H][H] = 1;
|
|
1424
|
+
}
|
|
1425
|
+
for (var V = u - 1, lt = 0, at = 2 ** -52, Lt = 2 ** -966; u > 0; ) {
|
|
1426
|
+
var j = void 0, pt = void 0;
|
|
1427
|
+
for (j = u - 2; j >= -1 && j !== -1; j--) if (Math.abs(t[j]) <= Lt + at * (Math.abs(this.s[j]) + Math.abs(this.s[j + 1]))) {
|
|
1428
|
+
t[j] = 0;
|
|
1429
|
+
break;
|
|
1430
|
+
}
|
|
1431
|
+
if (j === u - 2) pt = 4;
|
|
1432
|
+
else {
|
|
1433
|
+
var yt = void 0;
|
|
1434
|
+
for (yt = u - 1; yt >= j && yt !== j; yt--) {
|
|
1435
|
+
var Bt = (yt === u ? 0 : Math.abs(t[yt])) + (yt === j + 1 ? 0 : Math.abs(t[yt - 1]));
|
|
1436
|
+
if (Math.abs(this.s[yt]) <= Lt + at * Bt) {
|
|
1437
|
+
this.s[yt] = 0;
|
|
1438
|
+
break;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
yt === j ? pt = 3 : yt === u - 1 ? pt = 1 : (pt = 2, j = yt);
|
|
1442
|
+
}
|
|
1443
|
+
switch (j++, pt) {
|
|
1444
|
+
case 1:
|
|
1445
|
+
var Yt = t[u - 2];
|
|
1446
|
+
t[u - 2] = 0;
|
|
1447
|
+
for (var _t = u - 2; _t >= j; _t--) {
|
|
1448
|
+
var xt = f.hypot(this.s[_t], Yt), kt = this.s[_t] / xt, Ut = Yt / xt;
|
|
1449
|
+
if (this.s[_t] = xt, _t !== j && (Yt = -Ut * t[_t - 1], t[_t - 1] = kt * t[_t - 1]), i) for (var Rt = 0; Rt < this.n; Rt++) xt = kt * this.V[Rt][_t] + Ut * this.V[Rt][u - 1], this.V[Rt][u - 1] = -Ut * this.V[Rt][_t] + kt * this.V[Rt][u - 1], this.V[Rt][_t] = xt;
|
|
1450
|
+
}
|
|
1451
|
+
break;
|
|
1452
|
+
case 2:
|
|
1453
|
+
var Vt = t[j - 1];
|
|
1454
|
+
t[j - 1] = 0;
|
|
1455
|
+
for (var Gt = j; Gt < u; Gt++) {
|
|
1456
|
+
var st = f.hypot(this.s[Gt], Vt), ot = this.s[Gt] / st, ct = Vt / st;
|
|
1457
|
+
if (this.s[Gt] = st, Vt = -ct * t[Gt], t[Gt] = ot * t[Gt], l) for (var I = 0; I < this.m; I++) st = ot * this.U[I][Gt] + ct * this.U[I][j - 1], this.U[I][j - 1] = -ct * this.U[I][Gt] + ot * this.U[I][j - 1], this.U[I][Gt] = st;
|
|
1458
|
+
}
|
|
1459
|
+
break;
|
|
1460
|
+
case 3:
|
|
1461
|
+
var Y = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[u - 1]), Math.abs(this.s[u - 2])), Math.abs(t[u - 2])), Math.abs(this.s[j])), Math.abs(t[j])), q = this.s[u - 1] / Y, $ = this.s[u - 2] / Y, tt = t[u - 2] / Y, Et = this.s[j] / Y, mt = t[j] / Y, it = (($ + q) * ($ - q) + tt * tt) / 2, ft = q * tt * (q * tt), It = 0;
|
|
1462
|
+
/* @__PURE__ */ (function(Tt, Nt) {
|
|
1463
|
+
return Tt || Nt;
|
|
1464
|
+
})(it !== 0, ft !== 0) && (It = Math.sqrt(it * it + ft), it < 0 && (It = -It), It = ft / (it + It));
|
|
1465
|
+
for (var wt = (Et + q) * (Et - q) + It, vt = Et * mt, ht = j; ht < u - 1; ht++) {
|
|
1466
|
+
var dt = f.hypot(wt, vt), Q = wt / dt, ut = vt / dt;
|
|
1467
|
+
if (ht !== j && (t[ht - 1] = dt), wt = Q * this.s[ht] + ut * t[ht], t[ht] = Q * t[ht] - ut * this.s[ht], vt = ut * this.s[ht + 1], this.s[ht + 1] = Q * this.s[ht + 1], i) for (var At = 0; At < this.n; At++) dt = Q * this.V[At][ht] + ut * this.V[At][ht + 1], this.V[At][ht + 1] = -ut * this.V[At][ht] + Q * this.V[At][ht + 1], this.V[At][ht] = dt;
|
|
1468
|
+
if (dt = f.hypot(wt, vt), Q = wt / dt, ut = vt / dt, this.s[ht] = dt, wt = Q * t[ht] + ut * this.s[ht + 1], this.s[ht + 1] = -ut * t[ht] + Q * this.s[ht + 1], vt = ut * t[ht + 1], t[ht + 1] = Q * t[ht + 1], l && ht < this.m - 1) for (var rt = 0; rt < this.m; rt++) dt = Q * this.U[rt][ht] + ut * this.U[rt][ht + 1], this.U[rt][ht + 1] = -ut * this.U[rt][ht] + Q * this.U[rt][ht + 1], this.U[rt][ht] = dt;
|
|
1469
|
+
}
|
|
1470
|
+
t[u - 2] = wt, lt += 1;
|
|
1471
|
+
break;
|
|
1472
|
+
case 4:
|
|
1473
|
+
if (this.s[j] <= 0 && (this.s[j] = this.s[j] < 0 ? -this.s[j] : 0, i)) for (var bt = 0; bt <= V; bt++) this.V[bt][j] = -this.V[bt][j];
|
|
1474
|
+
for (; j < V && !(this.s[j] >= this.s[j + 1]); ) {
|
|
1475
|
+
var Ot = this.s[j];
|
|
1476
|
+
if (this.s[j] = this.s[j + 1], this.s[j + 1] = Ot, i && j < this.n - 1) for (var Dt = 0; Dt < this.n; Dt++) Ot = this.V[Dt][j + 1], this.V[Dt][j + 1] = this.V[Dt][j], this.V[Dt][j] = Ot;
|
|
1477
|
+
if (l && j < this.m - 1) for (var Ft = 0; Ft < this.m; Ft++) Ot = this.U[Ft][j + 1], this.U[Ft][j + 1] = this.U[Ft][j], this.U[Ft][j] = Ot;
|
|
1478
|
+
j++;
|
|
1479
|
+
}
|
|
1480
|
+
lt = 0, u--;
|
|
1481
|
+
break;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
return {
|
|
1485
|
+
U: this.U,
|
|
1486
|
+
V: this.V,
|
|
1487
|
+
S: this.s
|
|
1488
|
+
};
|
|
1489
|
+
}, f.hypot = function(o, r) {
|
|
1490
|
+
var t = void 0;
|
|
1491
|
+
return Math.abs(o) > Math.abs(r) ? (t = r / o, t = Math.abs(o) * Math.sqrt(1 + t * t)) : r == 0 ? t = 0 : (t = o / r, t = Math.abs(r) * Math.sqrt(1 + t * t)), t;
|
|
1492
|
+
}, A.exports = f;
|
|
1493
|
+
}),
|
|
1494
|
+
(function(A, D, N) {
|
|
1495
|
+
var f = /* @__PURE__ */ (function() {
|
|
1496
|
+
function r(t, e) {
|
|
1497
|
+
for (var l = 0; l < e.length; l++) {
|
|
1498
|
+
var i = e[l];
|
|
1499
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
return function(t, e, l) {
|
|
1503
|
+
return e && r(t.prototype, e), l && r(t, l), t;
|
|
1504
|
+
};
|
|
1505
|
+
})();
|
|
1506
|
+
function o(r, t) {
|
|
1507
|
+
if (!(r instanceof t)) throw TypeError("Cannot call a class as a function");
|
|
1508
|
+
}
|
|
1509
|
+
A.exports = (function() {
|
|
1510
|
+
function r(t, e) {
|
|
1511
|
+
var l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, p = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
|
|
1512
|
+
o(this, r), this.sequence1 = t, this.sequence2 = e, this.match_score = l, this.mismatch_penalty = i, this.gap_penalty = p, this.iMax = t.length + 1, this.jMax = e.length + 1, this.grid = Array(this.iMax);
|
|
1513
|
+
for (var a = 0; a < this.iMax; a++) {
|
|
1514
|
+
this.grid[a] = Array(this.jMax);
|
|
1515
|
+
for (var n = 0; n < this.jMax; n++) this.grid[a][n] = 0;
|
|
1516
|
+
}
|
|
1517
|
+
this.tracebackGrid = Array(this.iMax);
|
|
1518
|
+
for (var g = 0; g < this.iMax; g++) {
|
|
1519
|
+
this.tracebackGrid[g] = Array(this.jMax);
|
|
1520
|
+
for (var h = 0; h < this.jMax; h++) this.tracebackGrid[g][h] = [
|
|
1521
|
+
null,
|
|
1522
|
+
null,
|
|
1523
|
+
null
|
|
1524
|
+
];
|
|
1525
|
+
}
|
|
1526
|
+
this.alignments = [], this.score = -1, this.computeGrids();
|
|
1527
|
+
}
|
|
1528
|
+
return f(r, [
|
|
1529
|
+
{
|
|
1530
|
+
key: "getScore",
|
|
1531
|
+
value: function() {
|
|
1532
|
+
return this.score;
|
|
1533
|
+
}
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
key: "getAlignments",
|
|
1537
|
+
value: function() {
|
|
1538
|
+
return this.alignments;
|
|
1539
|
+
}
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
key: "computeGrids",
|
|
1543
|
+
value: function() {
|
|
1544
|
+
for (var t = 1; t < this.jMax; t++) this.grid[0][t] = this.grid[0][t - 1] + this.gap_penalty, this.tracebackGrid[0][t] = [
|
|
1545
|
+
!1,
|
|
1546
|
+
!1,
|
|
1547
|
+
!0
|
|
1548
|
+
];
|
|
1549
|
+
for (var e = 1; e < this.iMax; e++) this.grid[e][0] = this.grid[e - 1][0] + this.gap_penalty, this.tracebackGrid[e][0] = [
|
|
1550
|
+
!1,
|
|
1551
|
+
!0,
|
|
1552
|
+
!1
|
|
1553
|
+
];
|
|
1554
|
+
for (var l = 1; l < this.iMax; l++) for (var i = 1; i < this.jMax; i++) {
|
|
1555
|
+
var p = void 0;
|
|
1556
|
+
p = this.sequence1[l - 1] === this.sequence2[i - 1] ? this.grid[l - 1][i - 1] + this.match_score : this.grid[l - 1][i - 1] + this.mismatch_penalty;
|
|
1557
|
+
var a = this.grid[l - 1][i] + this.gap_penalty, n = this.grid[l][i - 1] + this.gap_penalty, g = [
|
|
1558
|
+
p,
|
|
1559
|
+
a,
|
|
1560
|
+
n
|
|
1561
|
+
], h = this.arrayAllMaxIndexes(g);
|
|
1562
|
+
this.grid[l][i] = g[h[0]], this.tracebackGrid[l][i] = [
|
|
1563
|
+
h.includes(0),
|
|
1564
|
+
h.includes(1),
|
|
1565
|
+
h.includes(2)
|
|
1566
|
+
];
|
|
1567
|
+
}
|
|
1568
|
+
this.score = this.grid[this.iMax - 1][this.jMax - 1];
|
|
1569
|
+
}
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
key: "alignmentTraceback",
|
|
1573
|
+
value: function() {
|
|
1574
|
+
var t = [];
|
|
1575
|
+
for (t.push({
|
|
1576
|
+
pos: [this.sequence1.length, this.sequence2.length],
|
|
1577
|
+
seq1: "",
|
|
1578
|
+
seq2: ""
|
|
1579
|
+
}); t[0]; ) {
|
|
1580
|
+
var e = t[0], l = this.tracebackGrid[e.pos[0]][e.pos[1]];
|
|
1581
|
+
l[0] && t.push({
|
|
1582
|
+
pos: [e.pos[0] - 1, e.pos[1] - 1],
|
|
1583
|
+
seq1: this.sequence1[e.pos[0] - 1] + e.seq1,
|
|
1584
|
+
seq2: this.sequence2[e.pos[1] - 1] + e.seq2
|
|
1585
|
+
}), l[1] && t.push({
|
|
1586
|
+
pos: [e.pos[0] - 1, e.pos[1]],
|
|
1587
|
+
seq1: this.sequence1[e.pos[0] - 1] + e.seq1,
|
|
1588
|
+
seq2: "-" + e.seq2
|
|
1589
|
+
}), l[2] && t.push({
|
|
1590
|
+
pos: [e.pos[0], e.pos[1] - 1],
|
|
1591
|
+
seq1: "-" + e.seq1,
|
|
1592
|
+
seq2: this.sequence2[e.pos[1] - 1] + e.seq2
|
|
1593
|
+
}), e.pos[0] === 0 && e.pos[1] === 0 && this.alignments.push({
|
|
1594
|
+
sequence1: e.seq1,
|
|
1595
|
+
sequence2: e.seq2
|
|
1596
|
+
}), t.shift();
|
|
1597
|
+
}
|
|
1598
|
+
return this.alignments;
|
|
1599
|
+
}
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
key: "getAllIndexes",
|
|
1603
|
+
value: function(t, e) {
|
|
1604
|
+
for (var l = [], i = -1; (i = t.indexOf(e, i + 1)) !== -1; ) l.push(i);
|
|
1605
|
+
return l;
|
|
1606
|
+
}
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
key: "arrayAllMaxIndexes",
|
|
1610
|
+
value: function(t) {
|
|
1611
|
+
return this.getAllIndexes(t, Math.max.apply(null, t));
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
]), r;
|
|
1615
|
+
})();
|
|
1616
|
+
}),
|
|
1617
|
+
(function(A, D, N) {
|
|
1618
|
+
var f = function() {
|
|
1619
|
+
};
|
|
1620
|
+
f.FDLayout = N(18), f.FDLayoutConstants = N(4), f.FDLayoutEdge = N(19), f.FDLayoutNode = N(20), f.DimensionD = N(21), f.HashMap = N(22), f.HashSet = N(23), f.IGeometry = N(8), f.IMath = N(9), f.Integer = N(10), f.Point = N(12), f.PointD = N(5), f.RandomSeed = N(16), f.RectangleD = N(13), f.Transform = N(17), f.UniqueIDGeneretor = N(14), f.Quicksort = N(25), f.LinkedList = N(11), f.LGraphObject = N(2), f.LGraph = N(6), f.LEdge = N(1), f.LGraphManager = N(7), f.LNode = N(3), f.Layout = N(15), f.LayoutConstants = N(0), f.NeedlemanWunsch = N(27), f.Matrix = N(24), f.SVD = N(26), A.exports = f;
|
|
1621
|
+
}),
|
|
1622
|
+
(function(A, D, N) {
|
|
1623
|
+
function f() {
|
|
1624
|
+
this.listeners = [];
|
|
1625
|
+
}
|
|
1626
|
+
var o = f.prototype;
|
|
1627
|
+
o.addListener = function(r, t) {
|
|
1628
|
+
this.listeners.push({
|
|
1629
|
+
event: r,
|
|
1630
|
+
callback: t
|
|
1631
|
+
});
|
|
1632
|
+
}, o.removeListener = function(r, t) {
|
|
1633
|
+
for (var e = this.listeners.length; e >= 0; e--) {
|
|
1634
|
+
var l = this.listeners[e];
|
|
1635
|
+
l.event === r && l.callback === t && this.listeners.splice(e, 1);
|
|
1636
|
+
}
|
|
1637
|
+
}, o.emit = function(r, t) {
|
|
1638
|
+
for (var e = 0; e < this.listeners.length; e++) {
|
|
1639
|
+
var l = this.listeners[e];
|
|
1640
|
+
r === l.event && l.callback(t);
|
|
1641
|
+
}
|
|
1642
|
+
}, A.exports = f;
|
|
1643
|
+
})
|
|
1644
|
+
]);
|
|
1645
|
+
});
|
|
1646
|
+
})), Ce = /* @__PURE__ */ fe(((M, _) => {
|
|
1647
|
+
(function(A, D) {
|
|
1648
|
+
typeof M == "object" && typeof _ == "object" ? _.exports = D(Ae()) : typeof define == "function" && define.amd ? define(["layout-base"], D) : typeof M == "object" ? M.coseBase = D(Ae()) : A.coseBase = D(A.layoutBase);
|
|
1649
|
+
})(M, function(A) {
|
|
1650
|
+
return (() => {
|
|
1651
|
+
var D = {
|
|
1652
|
+
45: ((o, r, t) => {
|
|
1653
|
+
var e = {};
|
|
1654
|
+
e.layoutBase = t(551), e.CoSEConstants = t(806), e.CoSEEdge = t(767), e.CoSEGraph = t(880), e.CoSEGraphManager = t(578), e.CoSELayout = t(765), e.CoSENode = t(991), e.ConstraintHandler = t(902), o.exports = e;
|
|
1655
|
+
}),
|
|
1656
|
+
806: ((o, r, t) => {
|
|
1657
|
+
var e = t(551).FDLayoutConstants;
|
|
1658
|
+
function l() {
|
|
1659
|
+
}
|
|
1660
|
+
for (var i in e) l[i] = e[i];
|
|
1661
|
+
l.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, l.DEFAULT_RADIAL_SEPARATION = e.DEFAULT_EDGE_LENGTH, l.DEFAULT_COMPONENT_SEPERATION = 60, l.TILE = !0, l.TILING_PADDING_VERTICAL = 10, l.TILING_PADDING_HORIZONTAL = 10, l.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, l.ENFORCE_CONSTRAINTS = !0, l.APPLY_LAYOUT = !0, l.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, l.TREE_REDUCTION_ON_INCREMENTAL = !0, l.PURE_INCREMENTAL = l.DEFAULT_INCREMENTAL, o.exports = l;
|
|
1662
|
+
}),
|
|
1663
|
+
767: ((o, r, t) => {
|
|
1664
|
+
var e = t(551).FDLayoutEdge;
|
|
1665
|
+
function l(p, a, n) {
|
|
1666
|
+
e.call(this, p, a, n);
|
|
1667
|
+
}
|
|
1668
|
+
for (var i in l.prototype = Object.create(e.prototype), e) l[i] = e[i];
|
|
1669
|
+
o.exports = l;
|
|
1670
|
+
}),
|
|
1671
|
+
880: ((o, r, t) => {
|
|
1672
|
+
var e = t(551).LGraph;
|
|
1673
|
+
function l(p, a, n) {
|
|
1674
|
+
e.call(this, p, a, n);
|
|
1675
|
+
}
|
|
1676
|
+
for (var i in l.prototype = Object.create(e.prototype), e) l[i] = e[i];
|
|
1677
|
+
o.exports = l;
|
|
1678
|
+
}),
|
|
1679
|
+
578: ((o, r, t) => {
|
|
1680
|
+
var e = t(551).LGraphManager;
|
|
1681
|
+
function l(p) {
|
|
1682
|
+
e.call(this, p);
|
|
1683
|
+
}
|
|
1684
|
+
for (var i in l.prototype = Object.create(e.prototype), e) l[i] = e[i];
|
|
1685
|
+
o.exports = l;
|
|
1686
|
+
}),
|
|
1687
|
+
765: ((o, r, t) => {
|
|
1688
|
+
var e = t(551).FDLayout, l = t(578), i = t(880), p = t(991), a = t(767), n = t(806), g = t(902), h = t(551).FDLayoutConstants, c = t(551).LayoutConstants, d = t(551).Point, v = t(551).PointD, T = t(551).DimensionD, L = t(551).Layout, F = t(551).Integer, S = t(551).IGeometry, P = t(551).LGraph, U = t(551).Transform, Z = t(551).LinkedList;
|
|
1689
|
+
function x() {
|
|
1690
|
+
e.call(this), this.toBeTiled = {}, this.constraints = {};
|
|
1691
|
+
}
|
|
1692
|
+
for (var K in x.prototype = Object.create(e.prototype), e) x[K] = e[K];
|
|
1693
|
+
x.prototype.newGraphManager = function() {
|
|
1694
|
+
var s = new l(this);
|
|
1695
|
+
return this.graphManager = s, s;
|
|
1696
|
+
}, x.prototype.newGraph = function(s) {
|
|
1697
|
+
return new i(null, this.graphManager, s);
|
|
1698
|
+
}, x.prototype.newNode = function(s) {
|
|
1699
|
+
return new p(this.graphManager, s);
|
|
1700
|
+
}, x.prototype.newEdge = function(s) {
|
|
1701
|
+
return new a(null, null, s);
|
|
1702
|
+
}, x.prototype.initParameters = function() {
|
|
1703
|
+
e.prototype.initParameters.call(this, arguments), this.isSubLayout || (n.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = n.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = h.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = h.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = h.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1);
|
|
1704
|
+
}, x.prototype.initSpringEmbedder = function() {
|
|
1705
|
+
e.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / h.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = 0.04, this.coolingAdjuster = 1;
|
|
1706
|
+
}, x.prototype.layout = function() {
|
|
1707
|
+
return c.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
|
|
1708
|
+
}, x.prototype.classicLayout = function() {
|
|
1709
|
+
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) {
|
|
1710
|
+
var s = this.getFlatForest();
|
|
1711
|
+
if (s.length > 0) this.positionNodesRadially(s);
|
|
1712
|
+
else {
|
|
1713
|
+
this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
|
|
1714
|
+
var E = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(m) {
|
|
1715
|
+
return E.has(m);
|
|
1716
|
+
});
|
|
1717
|
+
this.graphManager.setAllNodesToApplyGravitation(u), this.positionNodesRandomly();
|
|
1718
|
+
}
|
|
1719
|
+
} else if (n.TREE_REDUCTION_ON_INCREMENTAL) {
|
|
1720
|
+
this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
|
|
1721
|
+
var E = new Set(this.getAllNodes()), u = this.nodesWithGravity.filter(function(C) {
|
|
1722
|
+
return E.has(C);
|
|
1723
|
+
});
|
|
1724
|
+
this.graphManager.setAllNodesToApplyGravitation(u);
|
|
1725
|
+
}
|
|
1726
|
+
return Object.keys(this.constraints).length > 0 && (g.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), n.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
|
|
1727
|
+
}, x.prototype.tick = function() {
|
|
1728
|
+
if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
|
|
1729
|
+
else return !0;
|
|
1730
|
+
if (this.totalIterations % h.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
|
|
1731
|
+
if (this.isConverged()) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
|
|
1732
|
+
else return !0;
|
|
1733
|
+
this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - 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));
|
|
1734
|
+
}
|
|
1735
|
+
if (this.isTreeGrowing) {
|
|
1736
|
+
if (this.growTreeIterations % 10 == 0) if (this.prunedNodesAll.length > 0) {
|
|
1737
|
+
this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
|
|
1738
|
+
var s = new Set(this.getAllNodes()), E = this.nodesWithGravity.filter(function(y) {
|
|
1739
|
+
return s.has(y);
|
|
1740
|
+
});
|
|
1741
|
+
this.graphManager.setAllNodesToApplyGravitation(E), this.graphManager.updateBounds(), this.updateGrid(), n.PURE_INCREMENTAL ? this.coolingFactor = h.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = h.DEFAULT_COOLING_FACTOR_INCREMENTAL;
|
|
1742
|
+
} else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
|
|
1743
|
+
this.growTreeIterations++;
|
|
1744
|
+
}
|
|
1745
|
+
if (this.isGrowthFinished) {
|
|
1746
|
+
if (this.isConverged()) return !0;
|
|
1747
|
+
this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), n.PURE_INCREMENTAL ? this.coolingFactor = h.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : this.coolingFactor = h.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
|
|
1748
|
+
}
|
|
1749
|
+
var u = !this.isTreeGrowing && !this.isGrowthFinished, m = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
|
|
1750
|
+
return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(u, m), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
|
|
1751
|
+
}, x.prototype.getPositionsData = function() {
|
|
1752
|
+
for (var s = this.graphManager.getAllNodes(), E = {}, u = 0; u < s.length; u++) {
|
|
1753
|
+
var m = s[u].rect, y = s[u].id;
|
|
1754
|
+
E[y] = {
|
|
1755
|
+
id: y,
|
|
1756
|
+
x: m.getCenterX(),
|
|
1757
|
+
y: m.getCenterY(),
|
|
1758
|
+
w: m.width,
|
|
1759
|
+
h: m.height
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
return E;
|
|
1763
|
+
}, x.prototype.runSpringEmbedder = function() {
|
|
1764
|
+
this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
|
|
1765
|
+
var s = !1;
|
|
1766
|
+
if (h.ANIMATE === "during") this.emit("layoutstarted");
|
|
1767
|
+
else {
|
|
1768
|
+
for (; !s; ) s = this.tick();
|
|
1769
|
+
this.graphManager.updateBounds();
|
|
1770
|
+
}
|
|
1771
|
+
}, x.prototype.moveNodes = function() {
|
|
1772
|
+
for (var s = this.getAllNodes(), E, u = 0; u < s.length; u++) E = s[u], E.calculateDisplacement();
|
|
1773
|
+
Object.keys(this.constraints).length > 0 && this.updateDisplacements();
|
|
1774
|
+
for (var u = 0; u < s.length; u++) E = s[u], E.move();
|
|
1775
|
+
}, x.prototype.initConstraintVariables = function() {
|
|
1776
|
+
var s = this;
|
|
1777
|
+
this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
|
|
1778
|
+
for (var E = this.graphManager.getAllNodes(), u = 0; u < E.length; u++) {
|
|
1779
|
+
var m = E[u];
|
|
1780
|
+
this.idToNodeMap.set(m.id, m);
|
|
1781
|
+
}
|
|
1782
|
+
var y = function O(B) {
|
|
1783
|
+
for (var et = B.getChild().getNodes(), X, V = 0, lt = 0; lt < et.length; lt++) X = et[lt], X.getChild() == null ? s.fixedNodeSet.has(X.id) && (V += 100) : V += O(X);
|
|
1784
|
+
return V;
|
|
1785
|
+
};
|
|
1786
|
+
if (this.constraints.fixedNodeConstraint) {
|
|
1787
|
+
this.constraints.fixedNodeConstraint.forEach(function(O) {
|
|
1788
|
+
s.fixedNodeSet.add(O.nodeId);
|
|
1789
|
+
});
|
|
1790
|
+
for (var E = this.graphManager.getAllNodes(), m, u = 0; u < E.length; u++) if (m = E[u], m.getChild() != null) {
|
|
1791
|
+
var C = y(m);
|
|
1792
|
+
C > 0 && (m.fixedNodeWeight = C);
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
if (this.constraints.relativePlacementConstraint) {
|
|
1796
|
+
var w = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
|
|
1797
|
+
if (this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(), this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(), this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(), this.fixedNodesOnVertical = /* @__PURE__ */ new Set(), this.fixedNodeSet.forEach(function(O) {
|
|
1798
|
+
s.fixedNodesOnHorizontal.add(O), s.fixedNodesOnVertical.add(O);
|
|
1799
|
+
}), this.constraints.alignmentConstraint) {
|
|
1800
|
+
if (this.constraints.alignmentConstraint.vertical) for (var G = this.constraints.alignmentConstraint.vertical, u = 0; u < G.length; u++) this.dummyToNodeForVerticalAlignment.set("dummy" + u, []), G[u].forEach(function(B) {
|
|
1801
|
+
w.set(B, "dummy" + u), s.dummyToNodeForVerticalAlignment.get("dummy" + u).push(B), s.fixedNodeSet.has(B) && s.fixedNodesOnHorizontal.add("dummy" + u);
|
|
1802
|
+
});
|
|
1803
|
+
if (this.constraints.alignmentConstraint.horizontal) for (var b = this.constraints.alignmentConstraint.horizontal, u = 0; u < b.length; u++) this.dummyToNodeForHorizontalAlignment.set("dummy" + u, []), b[u].forEach(function(B) {
|
|
1804
|
+
R.set(B, "dummy" + u), s.dummyToNodeForHorizontalAlignment.get("dummy" + u).push(B), s.fixedNodeSet.has(B) && s.fixedNodesOnVertical.add("dummy" + u);
|
|
1805
|
+
});
|
|
1806
|
+
}
|
|
1807
|
+
if (n.RELAX_MOVEMENT_ON_CONSTRAINTS) this.shuffle = function(O) {
|
|
1808
|
+
var B, et, X;
|
|
1809
|
+
for (X = O.length - 1; X >= 2 * O.length / 3; X--) B = Math.floor(Math.random() * (X + 1)), et = O[X], O[X] = O[B], O[B] = et;
|
|
1810
|
+
return O;
|
|
1811
|
+
}, this.nodesInRelativeHorizontal = [], this.nodesInRelativeVertical = [], this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(), this.constraints.relativePlacementConstraint.forEach(function(O) {
|
|
1812
|
+
if (O.left) {
|
|
1813
|
+
var B = w.has(O.left) ? w.get(O.left) : O.left, et = w.has(O.right) ? w.get(O.right) : O.right;
|
|
1814
|
+
s.nodesInRelativeHorizontal.includes(B) || (s.nodesInRelativeHorizontal.push(B), s.nodeToRelativeConstraintMapHorizontal.set(B, []), s.dummyToNodeForVerticalAlignment.has(B) ? s.nodeToTempPositionMapHorizontal.set(B, s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()) : s.nodeToTempPositionMapHorizontal.set(B, s.idToNodeMap.get(B).getCenterX())), s.nodesInRelativeHorizontal.includes(et) || (s.nodesInRelativeHorizontal.push(et), s.nodeToRelativeConstraintMapHorizontal.set(et, []), s.dummyToNodeForVerticalAlignment.has(et) ? s.nodeToTempPositionMapHorizontal.set(et, s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(et)[0]).getCenterX()) : s.nodeToTempPositionMapHorizontal.set(et, s.idToNodeMap.get(et).getCenterX())), s.nodeToRelativeConstraintMapHorizontal.get(B).push({
|
|
1815
|
+
right: et,
|
|
1816
|
+
gap: O.gap
|
|
1817
|
+
}), s.nodeToRelativeConstraintMapHorizontal.get(et).push({
|
|
1818
|
+
left: B,
|
|
1819
|
+
gap: O.gap
|
|
1820
|
+
});
|
|
1821
|
+
} else {
|
|
1822
|
+
var X = R.has(O.top) ? R.get(O.top) : O.top, V = R.has(O.bottom) ? R.get(O.bottom) : O.bottom;
|
|
1823
|
+
s.nodesInRelativeVertical.includes(X) || (s.nodesInRelativeVertical.push(X), s.nodeToRelativeConstraintMapVertical.set(X, []), s.dummyToNodeForHorizontalAlignment.has(X) ? s.nodeToTempPositionMapVertical.set(X, s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(X)[0]).getCenterY()) : s.nodeToTempPositionMapVertical.set(X, s.idToNodeMap.get(X).getCenterY())), s.nodesInRelativeVertical.includes(V) || (s.nodesInRelativeVertical.push(V), s.nodeToRelativeConstraintMapVertical.set(V, []), s.dummyToNodeForHorizontalAlignment.has(V) ? s.nodeToTempPositionMapVertical.set(V, s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(V)[0]).getCenterY()) : s.nodeToTempPositionMapVertical.set(V, s.idToNodeMap.get(V).getCenterY())), s.nodeToRelativeConstraintMapVertical.get(X).push({
|
|
1824
|
+
bottom: V,
|
|
1825
|
+
gap: O.gap
|
|
1826
|
+
}), s.nodeToRelativeConstraintMapVertical.get(V).push({
|
|
1827
|
+
top: X,
|
|
1828
|
+
gap: O.gap
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
});
|
|
1832
|
+
else {
|
|
1833
|
+
var k = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map();
|
|
1834
|
+
this.constraints.relativePlacementConstraint.forEach(function(O) {
|
|
1835
|
+
if (O.left) {
|
|
1836
|
+
var B = w.has(O.left) ? w.get(O.left) : O.left, et = w.has(O.right) ? w.get(O.right) : O.right;
|
|
1837
|
+
k.has(B) ? k.get(B).push(et) : k.set(B, [et]), k.has(et) ? k.get(et).push(B) : k.set(et, [B]);
|
|
1838
|
+
} else {
|
|
1839
|
+
var X = R.has(O.top) ? R.get(O.top) : O.top, V = R.has(O.bottom) ? R.get(O.bottom) : O.bottom;
|
|
1840
|
+
W.has(X) ? W.get(X).push(V) : W.set(X, [V]), W.has(V) ? W.get(V).push(X) : W.set(V, [X]);
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
var J = function(O, B) {
|
|
1844
|
+
var et = [], X = [], V = new Z(), lt = /* @__PURE__ */ new Set(), at = 0;
|
|
1845
|
+
return O.forEach(function(Lt, j) {
|
|
1846
|
+
if (!lt.has(j)) {
|
|
1847
|
+
et[at] = [], X[at] = !1;
|
|
1848
|
+
var pt = j;
|
|
1849
|
+
for (V.push(pt), lt.add(pt), et[at].push(pt); V.length != 0; ) pt = V.shift(), B.has(pt) && (X[at] = !0), O.get(pt).forEach(function(yt) {
|
|
1850
|
+
lt.has(yt) || (V.push(yt), lt.add(yt), et[at].push(yt));
|
|
1851
|
+
});
|
|
1852
|
+
at++;
|
|
1853
|
+
}
|
|
1854
|
+
}), {
|
|
1855
|
+
components: et,
|
|
1856
|
+
isFixed: X
|
|
1857
|
+
};
|
|
1858
|
+
}, H = J(k, s.fixedNodesOnHorizontal);
|
|
1859
|
+
this.componentsOnHorizontal = H.components, this.fixedComponentsOnHorizontal = H.isFixed;
|
|
1860
|
+
var z = J(W, s.fixedNodesOnVertical);
|
|
1861
|
+
this.componentsOnVertical = z.components, this.fixedComponentsOnVertical = z.isFixed;
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
}, x.prototype.updateDisplacements = function() {
|
|
1865
|
+
var s = this;
|
|
1866
|
+
if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(z) {
|
|
1867
|
+
var O = s.idToNodeMap.get(z.nodeId);
|
|
1868
|
+
O.displacementX = 0, O.displacementY = 0;
|
|
1869
|
+
}), this.constraints.alignmentConstraint) {
|
|
1870
|
+
if (this.constraints.alignmentConstraint.vertical) for (var E = this.constraints.alignmentConstraint.vertical, u = 0; u < E.length; u++) {
|
|
1871
|
+
for (var m = 0, y = 0; y < E[u].length; y++) {
|
|
1872
|
+
if (this.fixedNodeSet.has(E[u][y])) {
|
|
1873
|
+
m = 0;
|
|
1874
|
+
break;
|
|
1875
|
+
}
|
|
1876
|
+
m += this.idToNodeMap.get(E[u][y]).displacementX;
|
|
1877
|
+
}
|
|
1878
|
+
for (var C = m / E[u].length, y = 0; y < E[u].length; y++) this.idToNodeMap.get(E[u][y]).displacementX = C;
|
|
1879
|
+
}
|
|
1880
|
+
if (this.constraints.alignmentConstraint.horizontal) for (var w = this.constraints.alignmentConstraint.horizontal, u = 0; u < w.length; u++) {
|
|
1881
|
+
for (var R = 0, y = 0; y < w[u].length; y++) {
|
|
1882
|
+
if (this.fixedNodeSet.has(w[u][y])) {
|
|
1883
|
+
R = 0;
|
|
1884
|
+
break;
|
|
1885
|
+
}
|
|
1886
|
+
R += this.idToNodeMap.get(w[u][y]).displacementY;
|
|
1887
|
+
}
|
|
1888
|
+
for (var G = R / w[u].length, y = 0; y < w[u].length; y++) this.idToNodeMap.get(w[u][y]).displacementY = G;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
if (this.constraints.relativePlacementConstraint) if (n.RELAX_MOVEMENT_ON_CONSTRAINTS) this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(z) {
|
|
1892
|
+
if (!s.fixedNodesOnHorizontal.has(z)) {
|
|
1893
|
+
var O = 0;
|
|
1894
|
+
O = s.dummyToNodeForVerticalAlignment.has(z) ? s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(z)[0]).displacementX : s.idToNodeMap.get(z).displacementX, s.nodeToRelativeConstraintMapHorizontal.get(z).forEach(function(B) {
|
|
1895
|
+
if (B.right) {
|
|
1896
|
+
var et = s.nodeToTempPositionMapHorizontal.get(B.right) - s.nodeToTempPositionMapHorizontal.get(z) - O;
|
|
1897
|
+
et < B.gap && (O -= B.gap - et);
|
|
1898
|
+
} else {
|
|
1899
|
+
var et = s.nodeToTempPositionMapHorizontal.get(z) - s.nodeToTempPositionMapHorizontal.get(B.left) + O;
|
|
1900
|
+
et < B.gap && (O += B.gap - et);
|
|
1901
|
+
}
|
|
1902
|
+
}), s.nodeToTempPositionMapHorizontal.set(z, s.nodeToTempPositionMapHorizontal.get(z) + O), s.dummyToNodeForVerticalAlignment.has(z) ? s.dummyToNodeForVerticalAlignment.get(z).forEach(function(B) {
|
|
1903
|
+
s.idToNodeMap.get(B).displacementX = O;
|
|
1904
|
+
}) : s.idToNodeMap.get(z).displacementX = O;
|
|
1905
|
+
}
|
|
1906
|
+
}), this.nodesInRelativeVertical.forEach(function(z) {
|
|
1907
|
+
if (!s.fixedNodesOnHorizontal.has(z)) {
|
|
1908
|
+
var O = 0;
|
|
1909
|
+
O = s.dummyToNodeForHorizontalAlignment.has(z) ? s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(z)[0]).displacementY : s.idToNodeMap.get(z).displacementY, s.nodeToRelativeConstraintMapVertical.get(z).forEach(function(B) {
|
|
1910
|
+
if (B.bottom) {
|
|
1911
|
+
var et = s.nodeToTempPositionMapVertical.get(B.bottom) - s.nodeToTempPositionMapVertical.get(z) - O;
|
|
1912
|
+
et < B.gap && (O -= B.gap - et);
|
|
1913
|
+
} else {
|
|
1914
|
+
var et = s.nodeToTempPositionMapVertical.get(z) - s.nodeToTempPositionMapVertical.get(B.top) + O;
|
|
1915
|
+
et < B.gap && (O += B.gap - et);
|
|
1916
|
+
}
|
|
1917
|
+
}), s.nodeToTempPositionMapVertical.set(z, s.nodeToTempPositionMapVertical.get(z) + O), s.dummyToNodeForHorizontalAlignment.has(z) ? s.dummyToNodeForHorizontalAlignment.get(z).forEach(function(B) {
|
|
1918
|
+
s.idToNodeMap.get(B).displacementY = O;
|
|
1919
|
+
}) : s.idToNodeMap.get(z).displacementY = O;
|
|
1920
|
+
}
|
|
1921
|
+
});
|
|
1922
|
+
else {
|
|
1923
|
+
for (var u = 0; u < this.componentsOnHorizontal.length; u++) {
|
|
1924
|
+
var b = this.componentsOnHorizontal[u];
|
|
1925
|
+
if (this.fixedComponentsOnHorizontal[u]) for (var y = 0; y < b.length; y++) this.dummyToNodeForVerticalAlignment.has(b[y]) ? this.dummyToNodeForVerticalAlignment.get(b[y]).forEach(function(B) {
|
|
1926
|
+
s.idToNodeMap.get(B).displacementX = 0;
|
|
1927
|
+
}) : this.idToNodeMap.get(b[y]).displacementX = 0;
|
|
1928
|
+
else {
|
|
1929
|
+
for (var k = 0, W = 0, y = 0; y < b.length; y++) if (this.dummyToNodeForVerticalAlignment.has(b[y])) {
|
|
1930
|
+
var J = this.dummyToNodeForVerticalAlignment.get(b[y]);
|
|
1931
|
+
k += J.length * this.idToNodeMap.get(J[0]).displacementX, W += J.length;
|
|
1932
|
+
} else k += this.idToNodeMap.get(b[y]).displacementX, W++;
|
|
1933
|
+
for (var H = k / W, y = 0; y < b.length; y++) this.dummyToNodeForVerticalAlignment.has(b[y]) ? this.dummyToNodeForVerticalAlignment.get(b[y]).forEach(function(B) {
|
|
1934
|
+
s.idToNodeMap.get(B).displacementX = H;
|
|
1935
|
+
}) : this.idToNodeMap.get(b[y]).displacementX = H;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
for (var u = 0; u < this.componentsOnVertical.length; u++) {
|
|
1939
|
+
var b = this.componentsOnVertical[u];
|
|
1940
|
+
if (this.fixedComponentsOnVertical[u]) for (var y = 0; y < b.length; y++) this.dummyToNodeForHorizontalAlignment.has(b[y]) ? this.dummyToNodeForHorizontalAlignment.get(b[y]).forEach(function(et) {
|
|
1941
|
+
s.idToNodeMap.get(et).displacementY = 0;
|
|
1942
|
+
}) : this.idToNodeMap.get(b[y]).displacementY = 0;
|
|
1943
|
+
else {
|
|
1944
|
+
for (var k = 0, W = 0, y = 0; y < b.length; y++) if (this.dummyToNodeForHorizontalAlignment.has(b[y])) {
|
|
1945
|
+
var J = this.dummyToNodeForHorizontalAlignment.get(b[y]);
|
|
1946
|
+
k += J.length * this.idToNodeMap.get(J[0]).displacementY, W += J.length;
|
|
1947
|
+
} else k += this.idToNodeMap.get(b[y]).displacementY, W++;
|
|
1948
|
+
for (var H = k / W, y = 0; y < b.length; y++) this.dummyToNodeForHorizontalAlignment.has(b[y]) ? this.dummyToNodeForHorizontalAlignment.get(b[y]).forEach(function(X) {
|
|
1949
|
+
s.idToNodeMap.get(X).displacementY = H;
|
|
1950
|
+
}) : this.idToNodeMap.get(b[y]).displacementY = H;
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
}, x.prototype.calculateNodesToApplyGravitationTo = function() {
|
|
1955
|
+
var s = [], E, u = this.graphManager.getGraphs(), m = u.length, y;
|
|
1956
|
+
for (y = 0; y < m; y++) E = u[y], E.updateConnected(), E.isConnected || (s = s.concat(E.getNodes()));
|
|
1957
|
+
return s;
|
|
1958
|
+
}, x.prototype.createBendpoints = function() {
|
|
1959
|
+
var s = [];
|
|
1960
|
+
s = s.concat(this.graphManager.getAllEdges());
|
|
1961
|
+
var E = /* @__PURE__ */ new Set(), u;
|
|
1962
|
+
for (u = 0; u < s.length; u++) {
|
|
1963
|
+
var m = s[u];
|
|
1964
|
+
if (!E.has(m)) {
|
|
1965
|
+
var y = m.getSource(), C = m.getTarget();
|
|
1966
|
+
if (y == C) m.getBendpoints().push(new v()), m.getBendpoints().push(new v()), this.createDummyNodesForBendpoints(m), E.add(m);
|
|
1967
|
+
else {
|
|
1968
|
+
var w = [];
|
|
1969
|
+
if (w = w.concat(y.getEdgeListToNode(C)), w = w.concat(C.getEdgeListToNode(y)), !E.has(w[0])) {
|
|
1970
|
+
if (w.length > 1) {
|
|
1971
|
+
var R;
|
|
1972
|
+
for (R = 0; R < w.length; R++) {
|
|
1973
|
+
var G = w[R];
|
|
1974
|
+
G.getBendpoints().push(new v()), this.createDummyNodesForBendpoints(G);
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
w.forEach(function(b) {
|
|
1978
|
+
E.add(b);
|
|
1979
|
+
});
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
if (E.size == s.length) break;
|
|
1984
|
+
}
|
|
1985
|
+
}, x.prototype.positionNodesRadially = function(s) {
|
|
1986
|
+
for (var E = new d(0, 0), u = Math.ceil(Math.sqrt(s.length)), m = 0, y = 0, C = 0, w = new v(0, 0), R = 0; R < s.length; R++) {
|
|
1987
|
+
R % u == 0 && (C = 0, y = m, R != 0 && (y += n.DEFAULT_COMPONENT_SEPERATION), m = 0);
|
|
1988
|
+
var G = s[R], b = L.findCenterOfTree(G);
|
|
1989
|
+
E.x = C, E.y = y, w = x.radialLayout(G, b, E), w.y > m && (m = Math.floor(w.y)), C = Math.floor(w.x + n.DEFAULT_COMPONENT_SEPERATION);
|
|
1990
|
+
}
|
|
1991
|
+
this.transform(new v(c.WORLD_CENTER_X - w.x / 2, c.WORLD_CENTER_Y - w.y / 2));
|
|
1992
|
+
}, x.radialLayout = function(s, E, u) {
|
|
1993
|
+
var m = Math.max(this.maxDiagonalInTree(s), n.DEFAULT_RADIAL_SEPARATION);
|
|
1994
|
+
x.branchRadialLayout(E, null, 0, 359, 0, m);
|
|
1995
|
+
var y = P.calculateBounds(s), C = new U();
|
|
1996
|
+
C.setDeviceOrgX(y.getMinX()), C.setDeviceOrgY(y.getMinY()), C.setWorldOrgX(u.x), C.setWorldOrgY(u.y);
|
|
1997
|
+
for (var w = 0; w < s.length; w++) s[w].transform(C);
|
|
1998
|
+
var R = new v(y.getMaxX(), y.getMaxY());
|
|
1999
|
+
return C.inverseTransformPoint(R);
|
|
2000
|
+
}, x.branchRadialLayout = function(s, E, u, m, y, C) {
|
|
2001
|
+
var w = (m - u + 1) / 2;
|
|
2002
|
+
w < 0 && (w += 180);
|
|
2003
|
+
var R = (w + u) % 360 * S.TWO_PI / 360, G = y * Math.cos(R), b = y * Math.sin(R);
|
|
2004
|
+
s.setCenter(G, b);
|
|
2005
|
+
var k = [];
|
|
2006
|
+
k = k.concat(s.getEdges());
|
|
2007
|
+
var W = k.length;
|
|
2008
|
+
E != null && W--;
|
|
2009
|
+
for (var J = 0, H = k.length, z, O = s.getEdgesBetween(E); O.length > 1; ) {
|
|
2010
|
+
var B = O[0];
|
|
2011
|
+
O.splice(0, 1);
|
|
2012
|
+
var et = k.indexOf(B);
|
|
2013
|
+
et >= 0 && k.splice(et, 1), H--, W--;
|
|
2014
|
+
}
|
|
2015
|
+
z = E == null ? 0 : (k.indexOf(O[0]) + 1) % H;
|
|
2016
|
+
for (var X = Math.abs(m - u) / W, V = z; J != W; V = ++V % H) {
|
|
2017
|
+
var lt = k[V].getOtherEnd(s);
|
|
2018
|
+
if (lt != E) {
|
|
2019
|
+
var at = (u + J * X) % 360, Lt = (at + X) % 360;
|
|
2020
|
+
x.branchRadialLayout(lt, s, at, Lt, y + C, C), J++;
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
}, x.maxDiagonalInTree = function(s) {
|
|
2024
|
+
for (var E = F.MIN_VALUE, u = 0; u < s.length; u++) {
|
|
2025
|
+
var m = s[u].getDiagonal();
|
|
2026
|
+
m > E && (E = m);
|
|
2027
|
+
}
|
|
2028
|
+
return E;
|
|
2029
|
+
}, x.prototype.calcRepulsionRange = function() {
|
|
2030
|
+
return 2 * (this.level + 1) * this.idealEdgeLength;
|
|
2031
|
+
}, x.prototype.groupZeroDegreeMembers = function() {
|
|
2032
|
+
var s = this, E = {};
|
|
2033
|
+
this.memberGroups = {}, this.idToDummyNode = {};
|
|
2034
|
+
for (var u = [], m = this.graphManager.getAllNodes(), y = 0; y < m.length; y++) {
|
|
2035
|
+
var C = m[y], w = C.getParent();
|
|
2036
|
+
this.getNodeDegreeWithChildren(C) === 0 && (w.id == null || !this.getToBeTiled(w)) && u.push(C);
|
|
2037
|
+
}
|
|
2038
|
+
for (var y = 0; y < u.length; y++) {
|
|
2039
|
+
var C = u[y], R = C.getParent().id;
|
|
2040
|
+
E[R] === void 0 && (E[R] = []), E[R] = E[R].concat(C);
|
|
2041
|
+
}
|
|
2042
|
+
Object.keys(E).forEach(function(G) {
|
|
2043
|
+
if (E[G].length > 1) {
|
|
2044
|
+
var b = "DummyCompound_" + G;
|
|
2045
|
+
s.memberGroups[b] = E[G];
|
|
2046
|
+
var k = E[G][0].getParent(), W = new p(s.graphManager);
|
|
2047
|
+
W.id = b, W.paddingLeft = k.paddingLeft || 0, W.paddingRight = k.paddingRight || 0, W.paddingBottom = k.paddingBottom || 0, W.paddingTop = k.paddingTop || 0, s.idToDummyNode[b] = W;
|
|
2048
|
+
var J = s.getGraphManager().add(s.newGraph(), W), H = k.getChild();
|
|
2049
|
+
H.add(W);
|
|
2050
|
+
for (var z = 0; z < E[G].length; z++) {
|
|
2051
|
+
var O = E[G][z];
|
|
2052
|
+
H.remove(O), J.add(O);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
});
|
|
2056
|
+
}, x.prototype.clearCompounds = function() {
|
|
2057
|
+
var s = {}, E = {};
|
|
2058
|
+
this.performDFSOnCompounds();
|
|
2059
|
+
for (var u = 0; u < this.compoundOrder.length; u++) E[this.compoundOrder[u].id] = this.compoundOrder[u], s[this.compoundOrder[u].id] = [].concat(this.compoundOrder[u].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[u].getChild()), this.compoundOrder[u].child = null;
|
|
2060
|
+
this.graphManager.resetAllNodes(), this.tileCompoundMembers(s, E);
|
|
2061
|
+
}, x.prototype.clearZeroDegreeMembers = function() {
|
|
2062
|
+
var s = this, E = this.tiledZeroDegreePack = [];
|
|
2063
|
+
Object.keys(this.memberGroups).forEach(function(u) {
|
|
2064
|
+
var m = s.idToDummyNode[u];
|
|
2065
|
+
if (E[u] = s.tileNodes(s.memberGroups[u], m.paddingLeft + m.paddingRight), m.rect.width = E[u].width, m.rect.height = E[u].height, m.setCenter(E[u].centerX, E[u].centerY), m.labelMarginLeft = 0, m.labelMarginTop = 0, n.NODE_DIMENSIONS_INCLUDE_LABELS) {
|
|
2066
|
+
var y = m.rect.width, C = m.rect.height;
|
|
2067
|
+
m.labelWidth && (m.labelPosHorizontal == "left" ? (m.rect.x -= m.labelWidth, m.setWidth(y + m.labelWidth), m.labelMarginLeft = m.labelWidth) : m.labelPosHorizontal == "center" && m.labelWidth > y ? (m.rect.x -= (m.labelWidth - y) / 2, m.setWidth(m.labelWidth), m.labelMarginLeft = (m.labelWidth - y) / 2) : m.labelPosHorizontal == "right" && m.setWidth(y + m.labelWidth)), m.labelHeight && (m.labelPosVertical == "top" ? (m.rect.y -= m.labelHeight, m.setHeight(C + m.labelHeight), m.labelMarginTop = m.labelHeight) : m.labelPosVertical == "center" && m.labelHeight > C ? (m.rect.y -= (m.labelHeight - C) / 2, m.setHeight(m.labelHeight), m.labelMarginTop = (m.labelHeight - C) / 2) : m.labelPosVertical == "bottom" && m.setHeight(C + m.labelHeight));
|
|
2068
|
+
}
|
|
2069
|
+
});
|
|
2070
|
+
}, x.prototype.repopulateCompounds = function() {
|
|
2071
|
+
for (var s = this.compoundOrder.length - 1; s >= 0; s--) {
|
|
2072
|
+
var E = this.compoundOrder[s], u = E.id, m = E.paddingLeft, y = E.paddingTop, C = E.labelMarginLeft, w = E.labelMarginTop;
|
|
2073
|
+
this.adjustLocations(this.tiledMemberPack[u], E.rect.x, E.rect.y, m, y, C, w);
|
|
2074
|
+
}
|
|
2075
|
+
}, x.prototype.repopulateZeroDegreeMembers = function() {
|
|
2076
|
+
var s = this, E = this.tiledZeroDegreePack;
|
|
2077
|
+
Object.keys(E).forEach(function(u) {
|
|
2078
|
+
var m = s.idToDummyNode[u], y = m.paddingLeft, C = m.paddingTop, w = m.labelMarginLeft, R = m.labelMarginTop;
|
|
2079
|
+
s.adjustLocations(E[u], m.rect.x, m.rect.y, y, C, w, R);
|
|
2080
|
+
});
|
|
2081
|
+
}, x.prototype.getToBeTiled = function(s) {
|
|
2082
|
+
var E = s.id;
|
|
2083
|
+
if (this.toBeTiled[E] != null) return this.toBeTiled[E];
|
|
2084
|
+
var u = s.getChild();
|
|
2085
|
+
if (u == null) return this.toBeTiled[E] = !1, !1;
|
|
2086
|
+
for (var m = u.getNodes(), y = 0; y < m.length; y++) {
|
|
2087
|
+
var C = m[y];
|
|
2088
|
+
if (this.getNodeDegree(C) > 0) return this.toBeTiled[E] = !1, !1;
|
|
2089
|
+
if (C.getChild() == null) {
|
|
2090
|
+
this.toBeTiled[C.id] = !1;
|
|
2091
|
+
continue;
|
|
2092
|
+
}
|
|
2093
|
+
if (!this.getToBeTiled(C)) return this.toBeTiled[E] = !1, !1;
|
|
2094
|
+
}
|
|
2095
|
+
return this.toBeTiled[E] = !0, !0;
|
|
2096
|
+
}, x.prototype.getNodeDegree = function(s) {
|
|
2097
|
+
s.id;
|
|
2098
|
+
for (var E = s.getEdges(), u = 0, m = 0; m < E.length; m++) {
|
|
2099
|
+
var y = E[m];
|
|
2100
|
+
y.getSource().id !== y.getTarget().id && (u += 1);
|
|
2101
|
+
}
|
|
2102
|
+
return u;
|
|
2103
|
+
}, x.prototype.getNodeDegreeWithChildren = function(s) {
|
|
2104
|
+
var E = this.getNodeDegree(s);
|
|
2105
|
+
if (s.getChild() == null) return E;
|
|
2106
|
+
for (var u = s.getChild().getNodes(), m = 0; m < u.length; m++) {
|
|
2107
|
+
var y = u[m];
|
|
2108
|
+
E += this.getNodeDegreeWithChildren(y);
|
|
2109
|
+
}
|
|
2110
|
+
return E;
|
|
2111
|
+
}, x.prototype.performDFSOnCompounds = function() {
|
|
2112
|
+
this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
|
|
2113
|
+
}, x.prototype.fillCompexOrderByDFS = function(s) {
|
|
2114
|
+
for (var E = 0; E < s.length; E++) {
|
|
2115
|
+
var u = s[E];
|
|
2116
|
+
u.getChild() != null && this.fillCompexOrderByDFS(u.getChild().getNodes()), this.getToBeTiled(u) && this.compoundOrder.push(u);
|
|
2117
|
+
}
|
|
2118
|
+
}, x.prototype.adjustLocations = function(s, E, u, m, y, C, w) {
|
|
2119
|
+
E += m + C, u += y + w;
|
|
2120
|
+
for (var R = E, G = 0; G < s.rows.length; G++) {
|
|
2121
|
+
var b = s.rows[G];
|
|
2122
|
+
E = R;
|
|
2123
|
+
for (var k = 0, W = 0; W < b.length; W++) {
|
|
2124
|
+
var J = b[W];
|
|
2125
|
+
J.rect.x = E, J.rect.y = u, E += J.rect.width + s.horizontalPadding, J.rect.height > k && (k = J.rect.height);
|
|
2126
|
+
}
|
|
2127
|
+
u += k + s.verticalPadding;
|
|
2128
|
+
}
|
|
2129
|
+
}, x.prototype.tileCompoundMembers = function(s, E) {
|
|
2130
|
+
var u = this;
|
|
2131
|
+
this.tiledMemberPack = [], Object.keys(s).forEach(function(m) {
|
|
2132
|
+
var y = E[m];
|
|
2133
|
+
if (u.tiledMemberPack[m] = u.tileNodes(s[m], y.paddingLeft + y.paddingRight), y.rect.width = u.tiledMemberPack[m].width, y.rect.height = u.tiledMemberPack[m].height, y.setCenter(u.tiledMemberPack[m].centerX, u.tiledMemberPack[m].centerY), y.labelMarginLeft = 0, y.labelMarginTop = 0, n.NODE_DIMENSIONS_INCLUDE_LABELS) {
|
|
2134
|
+
var C = y.rect.width, w = y.rect.height;
|
|
2135
|
+
y.labelWidth && (y.labelPosHorizontal == "left" ? (y.rect.x -= y.labelWidth, y.setWidth(C + y.labelWidth), y.labelMarginLeft = y.labelWidth) : y.labelPosHorizontal == "center" && y.labelWidth > C ? (y.rect.x -= (y.labelWidth - C) / 2, y.setWidth(y.labelWidth), y.labelMarginLeft = (y.labelWidth - C) / 2) : y.labelPosHorizontal == "right" && y.setWidth(C + y.labelWidth)), y.labelHeight && (y.labelPosVertical == "top" ? (y.rect.y -= y.labelHeight, y.setHeight(w + y.labelHeight), y.labelMarginTop = y.labelHeight) : y.labelPosVertical == "center" && y.labelHeight > w ? (y.rect.y -= (y.labelHeight - w) / 2, y.setHeight(y.labelHeight), y.labelMarginTop = (y.labelHeight - w) / 2) : y.labelPosVertical == "bottom" && y.setHeight(w + y.labelHeight));
|
|
2136
|
+
}
|
|
2137
|
+
});
|
|
2138
|
+
}, x.prototype.tileNodes = function(s, E) {
|
|
2139
|
+
var u = this.tileNodesByFavoringDim(s, E, !0), m = this.tileNodesByFavoringDim(s, E, !1), y = this.getOrgRatio(u);
|
|
2140
|
+
return this.getOrgRatio(m) < y ? m : u;
|
|
2141
|
+
}, x.prototype.getOrgRatio = function(s) {
|
|
2142
|
+
var E = s.width / s.height;
|
|
2143
|
+
return E < 1 && (E = 1 / E), E;
|
|
2144
|
+
}, x.prototype.calcIdealRowWidth = function(s, E) {
|
|
2145
|
+
var u = n.TILING_PADDING_VERTICAL, m = n.TILING_PADDING_HORIZONTAL, y = s.length, C = 0, w = 0, R = 0;
|
|
2146
|
+
s.forEach(function(z) {
|
|
2147
|
+
C += z.getWidth(), w += z.getHeight(), z.getWidth() > R && (R = z.getWidth());
|
|
2148
|
+
});
|
|
2149
|
+
var G = C / y, b = w / y, k = (u - m) ** 2 + 4 * (G + m) * (b + u) * y, W = (m - u + Math.sqrt(k)) / (2 * (G + m)), J;
|
|
2150
|
+
E ? (J = Math.ceil(W), J == W && J++) : J = Math.floor(W);
|
|
2151
|
+
var H = J * (G + m) - m;
|
|
2152
|
+
return R > H && (H = R), H += m * 2, H;
|
|
2153
|
+
}, x.prototype.tileNodesByFavoringDim = function(s, E, u) {
|
|
2154
|
+
var m = n.TILING_PADDING_VERTICAL, y = n.TILING_PADDING_HORIZONTAL, C = n.TILING_COMPARE_BY, w = {
|
|
2155
|
+
rows: [],
|
|
2156
|
+
rowWidth: [],
|
|
2157
|
+
rowHeight: [],
|
|
2158
|
+
width: 0,
|
|
2159
|
+
height: E,
|
|
2160
|
+
verticalPadding: m,
|
|
2161
|
+
horizontalPadding: y,
|
|
2162
|
+
centerX: 0,
|
|
2163
|
+
centerY: 0
|
|
2164
|
+
};
|
|
2165
|
+
C && (w.idealRowWidth = this.calcIdealRowWidth(s, u));
|
|
2166
|
+
var R = function(z) {
|
|
2167
|
+
return z.rect.width * z.rect.height;
|
|
2168
|
+
}, G = function(z, O) {
|
|
2169
|
+
return R(O) - R(z);
|
|
2170
|
+
};
|
|
2171
|
+
s.sort(function(z, O) {
|
|
2172
|
+
var B = G;
|
|
2173
|
+
return w.idealRowWidth ? (B = C, B(z.id, O.id)) : B(z, O);
|
|
2174
|
+
});
|
|
2175
|
+
for (var b = 0, k = 0, W = 0; W < s.length; W++) {
|
|
2176
|
+
var J = s[W];
|
|
2177
|
+
b += J.getCenterX(), k += J.getCenterY();
|
|
2178
|
+
}
|
|
2179
|
+
w.centerX = b / s.length, w.centerY = k / s.length;
|
|
2180
|
+
for (var W = 0; W < s.length; W++) {
|
|
2181
|
+
var J = s[W];
|
|
2182
|
+
if (w.rows.length == 0) this.insertNodeToRow(w, J, 0, E);
|
|
2183
|
+
else if (this.canAddHorizontal(w, J.rect.width, J.rect.height)) {
|
|
2184
|
+
var H = w.rows.length - 1;
|
|
2185
|
+
w.idealRowWidth || (H = this.getShortestRowIndex(w)), this.insertNodeToRow(w, J, H, E);
|
|
2186
|
+
} else this.insertNodeToRow(w, J, w.rows.length, E);
|
|
2187
|
+
this.shiftToLastRow(w);
|
|
2188
|
+
}
|
|
2189
|
+
return w;
|
|
2190
|
+
}, x.prototype.insertNodeToRow = function(s, E, u, m) {
|
|
2191
|
+
var y = m;
|
|
2192
|
+
u == s.rows.length && (s.rows.push([]), s.rowWidth.push(y), s.rowHeight.push(0));
|
|
2193
|
+
var C = s.rowWidth[u] + E.rect.width;
|
|
2194
|
+
s.rows[u].length > 0 && (C += s.horizontalPadding), s.rowWidth[u] = C, s.width < C && (s.width = C);
|
|
2195
|
+
var w = E.rect.height;
|
|
2196
|
+
u > 0 && (w += s.verticalPadding);
|
|
2197
|
+
var R = 0;
|
|
2198
|
+
w > s.rowHeight[u] && (R = s.rowHeight[u], s.rowHeight[u] = w, R = s.rowHeight[u] - R), s.height += R, s.rows[u].push(E);
|
|
2199
|
+
}, x.prototype.getShortestRowIndex = function(s) {
|
|
2200
|
+
for (var E = -1, u = Number.MAX_VALUE, m = 0; m < s.rows.length; m++) s.rowWidth[m] < u && (E = m, u = s.rowWidth[m]);
|
|
2201
|
+
return E;
|
|
2202
|
+
}, x.prototype.getLongestRowIndex = function(s) {
|
|
2203
|
+
for (var E = -1, u = Number.MIN_VALUE, m = 0; m < s.rows.length; m++) s.rowWidth[m] > u && (E = m, u = s.rowWidth[m]);
|
|
2204
|
+
return E;
|
|
2205
|
+
}, x.prototype.canAddHorizontal = function(s, E, u) {
|
|
2206
|
+
if (s.idealRowWidth) {
|
|
2207
|
+
var m = s.rows.length - 1;
|
|
2208
|
+
return s.rowWidth[m] + E + s.horizontalPadding <= s.idealRowWidth;
|
|
2209
|
+
}
|
|
2210
|
+
var y = this.getShortestRowIndex(s);
|
|
2211
|
+
if (y < 0) return !0;
|
|
2212
|
+
var C = s.rowWidth[y];
|
|
2213
|
+
if (C + s.horizontalPadding + E <= s.width) return !0;
|
|
2214
|
+
var w = 0;
|
|
2215
|
+
s.rowHeight[y] < u && y > 0 && (w = u + s.verticalPadding - s.rowHeight[y]);
|
|
2216
|
+
var R = s.width - C >= E + s.horizontalPadding ? (s.height + w) / (C + E + s.horizontalPadding) : (s.height + w) / s.width;
|
|
2217
|
+
w = u + s.verticalPadding;
|
|
2218
|
+
var G = s.width < E ? (s.height + w) / E : (s.height + w) / s.width;
|
|
2219
|
+
return G < 1 && (G = 1 / G), R < 1 && (R = 1 / R), R < G;
|
|
2220
|
+
}, x.prototype.shiftToLastRow = function(s) {
|
|
2221
|
+
var E = this.getLongestRowIndex(s), u = s.rowWidth.length - 1, m = s.rows[E], y = m[m.length - 1], C = y.width + s.horizontalPadding;
|
|
2222
|
+
if (s.width - s.rowWidth[u] > C && E != u) {
|
|
2223
|
+
m.splice(-1, 1), s.rows[u].push(y), s.rowWidth[E] = s.rowWidth[E] - C, s.rowWidth[u] = s.rowWidth[u] + C, s.width = s.rowWidth[instance.getLongestRowIndex(s)];
|
|
2224
|
+
for (var w = Number.MIN_VALUE, R = 0; R < m.length; R++) m[R].height > w && (w = m[R].height);
|
|
2225
|
+
E > 0 && (w += s.verticalPadding);
|
|
2226
|
+
var G = s.rowHeight[E] + s.rowHeight[u];
|
|
2227
|
+
s.rowHeight[E] = w, s.rowHeight[u] < y.height + s.verticalPadding && (s.rowHeight[u] = y.height + s.verticalPadding);
|
|
2228
|
+
var b = s.rowHeight[E] + s.rowHeight[u];
|
|
2229
|
+
s.height += b - G, this.shiftToLastRow(s);
|
|
2230
|
+
}
|
|
2231
|
+
}, x.prototype.tilingPreLayout = function() {
|
|
2232
|
+
n.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
|
|
2233
|
+
}, x.prototype.tilingPostLayout = function() {
|
|
2234
|
+
n.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
|
|
2235
|
+
}, x.prototype.reduceTrees = function() {
|
|
2236
|
+
for (var s = [], E = !0, u; E; ) {
|
|
2237
|
+
var m = this.graphManager.getAllNodes(), y = [];
|
|
2238
|
+
E = !1;
|
|
2239
|
+
for (var C = 0; C < m.length; C++) if (u = m[C], u.getEdges().length == 1 && !u.getEdges()[0].isInterGraph && u.getChild() == null) {
|
|
2240
|
+
if (n.PURE_INCREMENTAL) {
|
|
2241
|
+
var w = u.getEdges()[0].getOtherEnd(u), R = new T(u.getCenterX() - w.getCenterX(), u.getCenterY() - w.getCenterY());
|
|
2242
|
+
y.push([
|
|
2243
|
+
u,
|
|
2244
|
+
u.getEdges()[0],
|
|
2245
|
+
u.getOwner(),
|
|
2246
|
+
R
|
|
2247
|
+
]);
|
|
2248
|
+
} else y.push([
|
|
2249
|
+
u,
|
|
2250
|
+
u.getEdges()[0],
|
|
2251
|
+
u.getOwner()
|
|
2252
|
+
]);
|
|
2253
|
+
E = !0;
|
|
2254
|
+
}
|
|
2255
|
+
if (E == 1) {
|
|
2256
|
+
for (var G = [], b = 0; b < y.length; b++) y[b][0].getEdges().length == 1 && (G.push(y[b]), y[b][0].getOwner().remove(y[b][0]));
|
|
2257
|
+
s.push(G), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
this.prunedNodesAll = s;
|
|
2261
|
+
}, x.prototype.growTree = function(s) {
|
|
2262
|
+
for (var E = s[s.length - 1], u, m = 0; m < E.length; m++) u = E[m], this.findPlaceforPrunedNode(u), u[2].add(u[0]), u[2].add(u[1], u[1].source, u[1].target);
|
|
2263
|
+
s.splice(s.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
|
|
2264
|
+
}, x.prototype.findPlaceforPrunedNode = function(s) {
|
|
2265
|
+
var E, u, m = s[0];
|
|
2266
|
+
if (u = m == s[1].source ? s[1].target : s[1].source, n.PURE_INCREMENTAL) m.setCenter(u.getCenterX() + s[3].getWidth(), u.getCenterY() + s[3].getHeight());
|
|
2267
|
+
else {
|
|
2268
|
+
var y = u.startX, C = u.finishX, w = u.startY, R = u.finishY, G = [
|
|
2269
|
+
0,
|
|
2270
|
+
0,
|
|
2271
|
+
0,
|
|
2272
|
+
0
|
|
2273
|
+
];
|
|
2274
|
+
if (w > 0) for (var b = y; b <= C; b++) G[0] += this.grid[b][w - 1].length + this.grid[b][w].length - 1;
|
|
2275
|
+
if (C < this.grid.length - 1) for (var b = w; b <= R; b++) G[1] += this.grid[C + 1][b].length + this.grid[C][b].length - 1;
|
|
2276
|
+
if (R < this.grid[0].length - 1) for (var b = y; b <= C; b++) G[2] += this.grid[b][R + 1].length + this.grid[b][R].length - 1;
|
|
2277
|
+
if (y > 0) for (var b = w; b <= R; b++) G[3] += this.grid[y - 1][b].length + this.grid[y][b].length - 1;
|
|
2278
|
+
for (var k = F.MAX_VALUE, W, J, H = 0; H < G.length; H++) G[H] < k ? (k = G[H], W = 1, J = H) : G[H] == k && W++;
|
|
2279
|
+
if (W == 3 && k == 0) G[0] == 0 && G[1] == 0 && G[2] == 0 ? E = 1 : G[0] == 0 && G[1] == 0 && G[3] == 0 ? E = 0 : G[0] == 0 && G[2] == 0 && G[3] == 0 ? E = 3 : G[1] == 0 && G[2] == 0 && G[3] == 0 && (E = 2);
|
|
2280
|
+
else if (W == 2 && k == 0) {
|
|
2281
|
+
var z = Math.floor(Math.random() * 2);
|
|
2282
|
+
E = G[0] == 0 && G[1] == 0 ? z == 0 ? 0 : 1 : G[0] == 0 && G[2] == 0 ? z == 0 ? 0 : 2 : G[0] == 0 && G[3] == 0 ? z == 0 ? 0 : 3 : G[1] == 0 && G[2] == 0 ? z == 0 ? 1 : 2 : G[1] == 0 && G[3] == 0 ? z == 0 ? 1 : 3 : z == 0 ? 2 : 3;
|
|
2283
|
+
} else if (W == 4 && k == 0) {
|
|
2284
|
+
var z = Math.floor(Math.random() * 4);
|
|
2285
|
+
E = z;
|
|
2286
|
+
} else E = J;
|
|
2287
|
+
E == 0 ? m.setCenter(u.getCenterX(), u.getCenterY() - u.getHeight() / 2 - h.DEFAULT_EDGE_LENGTH - m.getHeight() / 2) : E == 1 ? m.setCenter(u.getCenterX() + u.getWidth() / 2 + h.DEFAULT_EDGE_LENGTH + m.getWidth() / 2, u.getCenterY()) : E == 2 ? m.setCenter(u.getCenterX(), u.getCenterY() + u.getHeight() / 2 + h.DEFAULT_EDGE_LENGTH + m.getHeight() / 2) : m.setCenter(u.getCenterX() - u.getWidth() / 2 - h.DEFAULT_EDGE_LENGTH - m.getWidth() / 2, u.getCenterY());
|
|
2288
|
+
}
|
|
2289
|
+
}, o.exports = x;
|
|
2290
|
+
}),
|
|
2291
|
+
991: ((o, r, t) => {
|
|
2292
|
+
var e = t(551).FDLayoutNode, l = t(551).IMath;
|
|
2293
|
+
function i(a, n, g, h) {
|
|
2294
|
+
e.call(this, a, n, g, h);
|
|
2295
|
+
}
|
|
2296
|
+
for (var p in i.prototype = Object.create(e.prototype), e) i[p] = e[p];
|
|
2297
|
+
i.prototype.calculateDisplacement = function() {
|
|
2298
|
+
var a = this.graphManager.getLayout();
|
|
2299
|
+
this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += a.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += a.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += a.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += a.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > a.coolingFactor * a.maxNodeDisplacement && (this.displacementX = a.coolingFactor * a.maxNodeDisplacement * l.sign(this.displacementX)), Math.abs(this.displacementY) > a.coolingFactor * a.maxNodeDisplacement && (this.displacementY = a.coolingFactor * a.maxNodeDisplacement * l.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
|
|
2300
|
+
}, i.prototype.propogateDisplacementToChildren = function(a, n) {
|
|
2301
|
+
for (var g = this.getChild().getNodes(), h, c = 0; c < g.length; c++) h = g[c], h.getChild() == null ? (h.displacementX += a, h.displacementY += n) : h.propogateDisplacementToChildren(a, n);
|
|
2302
|
+
}, i.prototype.move = function() {
|
|
2303
|
+
var a = this.graphManager.getLayout();
|
|
2304
|
+
(this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), a.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;
|
|
2305
|
+
}, i.prototype.setPred1 = function(a) {
|
|
2306
|
+
this.pred1 = a;
|
|
2307
|
+
}, i.prototype.getPred1 = function() {
|
|
2308
|
+
return pred1;
|
|
2309
|
+
}, i.prototype.getPred2 = function() {
|
|
2310
|
+
return pred2;
|
|
2311
|
+
}, i.prototype.setNext = function(a) {
|
|
2312
|
+
this.next = a;
|
|
2313
|
+
}, i.prototype.getNext = function() {
|
|
2314
|
+
return next;
|
|
2315
|
+
}, i.prototype.setProcessed = function(a) {
|
|
2316
|
+
this.processed = a;
|
|
2317
|
+
}, i.prototype.isProcessed = function() {
|
|
2318
|
+
return processed;
|
|
2319
|
+
}, o.exports = i;
|
|
2320
|
+
}),
|
|
2321
|
+
902: ((o, r, t) => {
|
|
2322
|
+
function e(g) {
|
|
2323
|
+
if (Array.isArray(g)) {
|
|
2324
|
+
for (var h = 0, c = Array(g.length); h < g.length; h++) c[h] = g[h];
|
|
2325
|
+
return c;
|
|
2326
|
+
} else return Array.from(g);
|
|
2327
|
+
}
|
|
2328
|
+
var l = t(806), i = t(551).LinkedList, p = t(551).Matrix, a = t(551).SVD;
|
|
2329
|
+
function n() {
|
|
2330
|
+
}
|
|
2331
|
+
n.handleConstraints = function(g) {
|
|
2332
|
+
var h = {};
|
|
2333
|
+
h.fixedNodeConstraint = g.constraints.fixedNodeConstraint, h.alignmentConstraint = g.constraints.alignmentConstraint, h.relativePlacementConstraint = g.constraints.relativePlacementConstraint;
|
|
2334
|
+
for (var c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), v = [], T = [], L = g.getAllNodes(), F = 0, S = 0; S < L.length; S++) {
|
|
2335
|
+
var P = L[S];
|
|
2336
|
+
P.getChild() ?? (d.set(P.id, F++), v.push(P.getCenterX()), T.push(P.getCenterY()), c.set(P.id, P));
|
|
2337
|
+
}
|
|
2338
|
+
h.relativePlacementConstraint && h.relativePlacementConstraint.forEach(function(I) {
|
|
2339
|
+
!I.gap && I.gap != 0 && (I.left ? I.gap = l.DEFAULT_EDGE_LENGTH + c.get(I.left).getWidth() / 2 + c.get(I.right).getWidth() / 2 : I.gap = l.DEFAULT_EDGE_LENGTH + c.get(I.top).getHeight() / 2 + c.get(I.bottom).getHeight() / 2);
|
|
2340
|
+
});
|
|
2341
|
+
var U = function(I, Y) {
|
|
2342
|
+
return {
|
|
2343
|
+
x: I.x - Y.x,
|
|
2344
|
+
y: I.y - Y.y
|
|
2345
|
+
};
|
|
2346
|
+
}, Z = function(I) {
|
|
2347
|
+
var Y = 0, q = 0;
|
|
2348
|
+
return I.forEach(function($) {
|
|
2349
|
+
Y += v[d.get($)], q += T[d.get($)];
|
|
2350
|
+
}), {
|
|
2351
|
+
x: Y / I.size,
|
|
2352
|
+
y: q / I.size
|
|
2353
|
+
};
|
|
2354
|
+
}, x = function(I, Y, q, $, tt) {
|
|
2355
|
+
function Et(dt, Q) {
|
|
2356
|
+
var ut = new Set(dt), At = !0, rt = !1, bt = void 0;
|
|
2357
|
+
try {
|
|
2358
|
+
for (var Ot = Q[Symbol.iterator](), Dt; !(At = (Dt = Ot.next()).done); At = !0) {
|
|
2359
|
+
var Ft = Dt.value;
|
|
2360
|
+
ut.add(Ft);
|
|
2361
|
+
}
|
|
2362
|
+
} catch (Tt) {
|
|
2363
|
+
rt = !0, bt = Tt;
|
|
2364
|
+
} finally {
|
|
2365
|
+
try {
|
|
2366
|
+
!At && Ot.return && Ot.return();
|
|
2367
|
+
} finally {
|
|
2368
|
+
if (rt) throw bt;
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
return ut;
|
|
2372
|
+
}
|
|
2373
|
+
var mt = /* @__PURE__ */ new Map();
|
|
2374
|
+
I.forEach(function(dt, Q) {
|
|
2375
|
+
mt.set(Q, 0);
|
|
2376
|
+
}), I.forEach(function(dt, Q) {
|
|
2377
|
+
dt.forEach(function(ut) {
|
|
2378
|
+
mt.set(ut.id, mt.get(ut.id) + 1);
|
|
2379
|
+
});
|
|
2380
|
+
});
|
|
2381
|
+
var it = /* @__PURE__ */ new Map(), ft = /* @__PURE__ */ new Map(), It = new i();
|
|
2382
|
+
mt.forEach(function(dt, Q) {
|
|
2383
|
+
dt == 0 ? (It.push(Q), q || (Y == "horizontal" ? it.set(Q, d.has(Q) ? v[d.get(Q)] : $.get(Q)) : it.set(Q, d.has(Q) ? T[d.get(Q)] : $.get(Q)))) : it.set(Q, -1 / 0), q && ft.set(Q, /* @__PURE__ */ new Set([Q]));
|
|
2384
|
+
}), q && tt.forEach(function(dt) {
|
|
2385
|
+
var Q = [];
|
|
2386
|
+
if (dt.forEach(function(rt) {
|
|
2387
|
+
q.has(rt) && Q.push(rt);
|
|
2388
|
+
}), Q.length > 0) {
|
|
2389
|
+
var ut = 0;
|
|
2390
|
+
Q.forEach(function(rt) {
|
|
2391
|
+
Y == "horizontal" ? (it.set(rt, d.has(rt) ? v[d.get(rt)] : $.get(rt)), ut += it.get(rt)) : (it.set(rt, d.has(rt) ? T[d.get(rt)] : $.get(rt)), ut += it.get(rt));
|
|
2392
|
+
}), ut /= Q.length, dt.forEach(function(rt) {
|
|
2393
|
+
q.has(rt) || it.set(rt, ut);
|
|
2394
|
+
});
|
|
2395
|
+
} else {
|
|
2396
|
+
var At = 0;
|
|
2397
|
+
dt.forEach(function(rt) {
|
|
2398
|
+
Y == "horizontal" ? At += d.has(rt) ? v[d.get(rt)] : $.get(rt) : At += d.has(rt) ? T[d.get(rt)] : $.get(rt);
|
|
2399
|
+
}), At /= dt.length, dt.forEach(function(rt) {
|
|
2400
|
+
it.set(rt, At);
|
|
2401
|
+
});
|
|
2402
|
+
}
|
|
2403
|
+
});
|
|
2404
|
+
for (var wt = function() {
|
|
2405
|
+
var dt = It.shift();
|
|
2406
|
+
I.get(dt).forEach(function(Q) {
|
|
2407
|
+
if (it.get(Q.id) < it.get(dt) + Q.gap) if (q && q.has(Q.id)) {
|
|
2408
|
+
var ut = void 0;
|
|
2409
|
+
if (ut = Y == "horizontal" ? d.has(Q.id) ? v[d.get(Q.id)] : $.get(Q.id) : d.has(Q.id) ? T[d.get(Q.id)] : $.get(Q.id), it.set(Q.id, ut), ut < it.get(dt) + Q.gap) {
|
|
2410
|
+
var At = it.get(dt) + Q.gap - ut;
|
|
2411
|
+
ft.get(dt).forEach(function(rt) {
|
|
2412
|
+
it.set(rt, it.get(rt) - At);
|
|
2413
|
+
});
|
|
2414
|
+
}
|
|
2415
|
+
} else it.set(Q.id, it.get(dt) + Q.gap);
|
|
2416
|
+
mt.set(Q.id, mt.get(Q.id) - 1), mt.get(Q.id) == 0 && It.push(Q.id), q && ft.set(Q.id, Et(ft.get(dt), ft.get(Q.id)));
|
|
2417
|
+
});
|
|
2418
|
+
}; It.length != 0; ) wt();
|
|
2419
|
+
if (q) {
|
|
2420
|
+
var vt = /* @__PURE__ */ new Set();
|
|
2421
|
+
I.forEach(function(dt, Q) {
|
|
2422
|
+
dt.length == 0 && vt.add(Q);
|
|
2423
|
+
});
|
|
2424
|
+
var ht = [];
|
|
2425
|
+
ft.forEach(function(dt, Q) {
|
|
2426
|
+
if (vt.has(Q)) {
|
|
2427
|
+
var ut = !1, At = !0, rt = !1, bt = void 0;
|
|
2428
|
+
try {
|
|
2429
|
+
for (var Ot = dt[Symbol.iterator](), Dt; !(At = (Dt = Ot.next()).done); At = !0) {
|
|
2430
|
+
var Ft = Dt.value;
|
|
2431
|
+
q.has(Ft) && (ut = !0);
|
|
2432
|
+
}
|
|
2433
|
+
} catch (Mt) {
|
|
2434
|
+
rt = !0, bt = Mt;
|
|
2435
|
+
} finally {
|
|
2436
|
+
try {
|
|
2437
|
+
!At && Ot.return && Ot.return();
|
|
2438
|
+
} finally {
|
|
2439
|
+
if (rt) throw bt;
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
if (!ut) {
|
|
2443
|
+
var Tt = !1, Nt = void 0;
|
|
2444
|
+
ht.forEach(function(Mt, Pt) {
|
|
2445
|
+
Mt.has([].concat(e(dt))[0]) && (Tt = !0, Nt = Pt);
|
|
2446
|
+
}), Tt ? dt.forEach(function(Mt) {
|
|
2447
|
+
ht[Nt].add(Mt);
|
|
2448
|
+
}) : ht.push(new Set(dt));
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
}), ht.forEach(function(dt, Q) {
|
|
2452
|
+
var ut = 1 / 0, At = 1 / 0, rt = -1 / 0, bt = -1 / 0, Ot = !0, Dt = !1, Ft = void 0;
|
|
2453
|
+
try {
|
|
2454
|
+
for (var Tt = dt[Symbol.iterator](), Nt; !(Ot = (Nt = Tt.next()).done); Ot = !0) {
|
|
2455
|
+
var Mt = Nt.value, Pt = void 0;
|
|
2456
|
+
Pt = Y == "horizontal" ? d.has(Mt) ? v[d.get(Mt)] : $.get(Mt) : d.has(Mt) ? T[d.get(Mt)] : $.get(Mt);
|
|
2457
|
+
var Xt = it.get(Mt);
|
|
2458
|
+
Pt < ut && (ut = Pt), Pt > rt && (rt = Pt), Xt < At && (At = Xt), Xt > bt && (bt = Xt);
|
|
2459
|
+
}
|
|
2460
|
+
} catch ($t) {
|
|
2461
|
+
Dt = !0, Ft = $t;
|
|
2462
|
+
} finally {
|
|
2463
|
+
try {
|
|
2464
|
+
!Ot && Tt.return && Tt.return();
|
|
2465
|
+
} finally {
|
|
2466
|
+
if (Dt) throw Ft;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
var ne = (ut + rt) / 2 - (At + bt) / 2, ee = !0, qt = !1, Zt = void 0;
|
|
2470
|
+
try {
|
|
2471
|
+
for (var jt = dt[Symbol.iterator](), Kt; !(ee = (Kt = jt.next()).done); ee = !0) {
|
|
2472
|
+
var re = Kt.value;
|
|
2473
|
+
it.set(re, it.get(re) + ne);
|
|
2474
|
+
}
|
|
2475
|
+
} catch ($t) {
|
|
2476
|
+
qt = !0, Zt = $t;
|
|
2477
|
+
} finally {
|
|
2478
|
+
try {
|
|
2479
|
+
!ee && jt.return && jt.return();
|
|
2480
|
+
} finally {
|
|
2481
|
+
if (qt) throw Zt;
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
return it;
|
|
2487
|
+
}, K = function(I) {
|
|
2488
|
+
var Y = 0, q = 0, $ = 0, tt = 0;
|
|
2489
|
+
if (I.forEach(function(ft) {
|
|
2490
|
+
ft.left ? v[d.get(ft.left)] - v[d.get(ft.right)] >= 0 ? Y++ : q++ : T[d.get(ft.top)] - T[d.get(ft.bottom)] >= 0 ? $++ : tt++;
|
|
2491
|
+
}), Y > q && $ > tt) for (var Et = 0; Et < d.size; Et++) v[Et] = -1 * v[Et], T[Et] = -1 * T[Et];
|
|
2492
|
+
else if (Y > q) for (var mt = 0; mt < d.size; mt++) v[mt] = -1 * v[mt];
|
|
2493
|
+
else if ($ > tt) for (var it = 0; it < d.size; it++) T[it] = -1 * T[it];
|
|
2494
|
+
}, s = function(I) {
|
|
2495
|
+
var Y = [], q = new i(), $ = /* @__PURE__ */ new Set(), tt = 0;
|
|
2496
|
+
return I.forEach(function(Et, mt) {
|
|
2497
|
+
if (!$.has(mt)) {
|
|
2498
|
+
Y[tt] = [];
|
|
2499
|
+
var it = mt;
|
|
2500
|
+
for (q.push(it), $.add(it), Y[tt].push(it); q.length != 0; ) it = q.shift(), I.get(it).forEach(function(ft) {
|
|
2501
|
+
$.has(ft.id) || (q.push(ft.id), $.add(ft.id), Y[tt].push(ft.id));
|
|
2502
|
+
});
|
|
2503
|
+
tt++;
|
|
2504
|
+
}
|
|
2505
|
+
}), Y;
|
|
2506
|
+
}, E = function(I) {
|
|
2507
|
+
var Y = /* @__PURE__ */ new Map();
|
|
2508
|
+
return I.forEach(function(q, $) {
|
|
2509
|
+
Y.set($, []);
|
|
2510
|
+
}), I.forEach(function(q, $) {
|
|
2511
|
+
q.forEach(function(tt) {
|
|
2512
|
+
Y.get($).push(tt), Y.get(tt.id).push({
|
|
2513
|
+
id: $,
|
|
2514
|
+
gap: tt.gap,
|
|
2515
|
+
direction: tt.direction
|
|
2516
|
+
});
|
|
2517
|
+
});
|
|
2518
|
+
}), Y;
|
|
2519
|
+
}, u = function(I) {
|
|
2520
|
+
var Y = /* @__PURE__ */ new Map();
|
|
2521
|
+
return I.forEach(function(q, $) {
|
|
2522
|
+
Y.set($, []);
|
|
2523
|
+
}), I.forEach(function(q, $) {
|
|
2524
|
+
q.forEach(function(tt) {
|
|
2525
|
+
Y.get(tt.id).push({
|
|
2526
|
+
id: $,
|
|
2527
|
+
gap: tt.gap,
|
|
2528
|
+
direction: tt.direction
|
|
2529
|
+
});
|
|
2530
|
+
});
|
|
2531
|
+
}), Y;
|
|
2532
|
+
}, m = [], y = [], C = !1, w = !1, R = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), k = [];
|
|
2533
|
+
if (h.fixedNodeConstraint && h.fixedNodeConstraint.forEach(function(I) {
|
|
2534
|
+
R.add(I.nodeId);
|
|
2535
|
+
}), h.relativePlacementConstraint && (h.relativePlacementConstraint.forEach(function(I) {
|
|
2536
|
+
I.left ? (G.has(I.left) ? G.get(I.left).push({
|
|
2537
|
+
id: I.right,
|
|
2538
|
+
gap: I.gap,
|
|
2539
|
+
direction: "horizontal"
|
|
2540
|
+
}) : G.set(I.left, [{
|
|
2541
|
+
id: I.right,
|
|
2542
|
+
gap: I.gap,
|
|
2543
|
+
direction: "horizontal"
|
|
2544
|
+
}]), G.has(I.right) || G.set(I.right, [])) : (G.has(I.top) ? G.get(I.top).push({
|
|
2545
|
+
id: I.bottom,
|
|
2546
|
+
gap: I.gap,
|
|
2547
|
+
direction: "vertical"
|
|
2548
|
+
}) : G.set(I.top, [{
|
|
2549
|
+
id: I.bottom,
|
|
2550
|
+
gap: I.gap,
|
|
2551
|
+
direction: "vertical"
|
|
2552
|
+
}]), G.has(I.bottom) || G.set(I.bottom, []));
|
|
2553
|
+
}), b = E(G), k = s(b)), l.TRANSFORM_ON_CONSTRAINT_HANDLING) {
|
|
2554
|
+
if (h.fixedNodeConstraint && h.fixedNodeConstraint.length > 1) h.fixedNodeConstraint.forEach(function(I, Y) {
|
|
2555
|
+
m[Y] = [I.position.x, I.position.y], y[Y] = [v[d.get(I.nodeId)], T[d.get(I.nodeId)]];
|
|
2556
|
+
}), C = !0;
|
|
2557
|
+
else if (h.alignmentConstraint) (function() {
|
|
2558
|
+
var I = 0;
|
|
2559
|
+
if (h.alignmentConstraint.vertical) {
|
|
2560
|
+
for (var Y = h.alignmentConstraint.vertical, q = function(it) {
|
|
2561
|
+
var ft = /* @__PURE__ */ new Set();
|
|
2562
|
+
Y[it].forEach(function(vt) {
|
|
2563
|
+
ft.add(vt);
|
|
2564
|
+
});
|
|
2565
|
+
var It = new Set([].concat(e(ft)).filter(function(vt) {
|
|
2566
|
+
return R.has(vt);
|
|
2567
|
+
})), wt = void 0;
|
|
2568
|
+
wt = It.size > 0 ? v[d.get(It.values().next().value)] : Z(ft).x, Y[it].forEach(function(vt) {
|
|
2569
|
+
m[I] = [wt, T[d.get(vt)]], y[I] = [v[d.get(vt)], T[d.get(vt)]], I++;
|
|
2570
|
+
});
|
|
2571
|
+
}, $ = 0; $ < Y.length; $++) q($);
|
|
2572
|
+
C = !0;
|
|
2573
|
+
}
|
|
2574
|
+
if (h.alignmentConstraint.horizontal) {
|
|
2575
|
+
for (var tt = h.alignmentConstraint.horizontal, Et = function(it) {
|
|
2576
|
+
var ft = /* @__PURE__ */ new Set();
|
|
2577
|
+
tt[it].forEach(function(vt) {
|
|
2578
|
+
ft.add(vt);
|
|
2579
|
+
});
|
|
2580
|
+
var It = new Set([].concat(e(ft)).filter(function(vt) {
|
|
2581
|
+
return R.has(vt);
|
|
2582
|
+
})), wt = void 0;
|
|
2583
|
+
wt = It.size > 0 ? v[d.get(It.values().next().value)] : Z(ft).y, tt[it].forEach(function(vt) {
|
|
2584
|
+
m[I] = [v[d.get(vt)], wt], y[I] = [v[d.get(vt)], T[d.get(vt)]], I++;
|
|
2585
|
+
});
|
|
2586
|
+
}, mt = 0; mt < tt.length; mt++) Et(mt);
|
|
2587
|
+
C = !0;
|
|
2588
|
+
}
|
|
2589
|
+
h.relativePlacementConstraint && (w = !0);
|
|
2590
|
+
})();
|
|
2591
|
+
else if (h.relativePlacementConstraint) {
|
|
2592
|
+
for (var W = 0, J = 0, H = 0; H < k.length; H++) k[H].length > W && (W = k[H].length, J = H);
|
|
2593
|
+
if (W < b.size / 2) K(h.relativePlacementConstraint), C = !1, w = !1;
|
|
2594
|
+
else {
|
|
2595
|
+
var z = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), B = [];
|
|
2596
|
+
k[J].forEach(function(I) {
|
|
2597
|
+
G.get(I).forEach(function(Y) {
|
|
2598
|
+
Y.direction == "horizontal" ? (z.has(I) ? z.get(I).push(Y) : z.set(I, [Y]), z.has(Y.id) || z.set(Y.id, []), B.push({
|
|
2599
|
+
left: I,
|
|
2600
|
+
right: Y.id
|
|
2601
|
+
})) : (O.has(I) ? O.get(I).push(Y) : O.set(I, [Y]), O.has(Y.id) || O.set(Y.id, []), B.push({
|
|
2602
|
+
top: I,
|
|
2603
|
+
bottom: Y.id
|
|
2604
|
+
}));
|
|
2605
|
+
});
|
|
2606
|
+
}), K(B), w = !1;
|
|
2607
|
+
var et = x(z, "horizontal"), X = x(O, "vertical");
|
|
2608
|
+
k[J].forEach(function(I, Y) {
|
|
2609
|
+
y[Y] = [v[d.get(I)], T[d.get(I)]], m[Y] = [], et.has(I) ? m[Y][0] = et.get(I) : m[Y][0] = v[d.get(I)], X.has(I) ? m[Y][1] = X.get(I) : m[Y][1] = T[d.get(I)];
|
|
2610
|
+
}), C = !0;
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
if (C) {
|
|
2614
|
+
for (var V = void 0, lt = p.transpose(m), at = p.transpose(y), Lt = 0; Lt < lt.length; Lt++) lt[Lt] = p.multGamma(lt[Lt]), at[Lt] = p.multGamma(at[Lt]);
|
|
2615
|
+
var j = p.multMat(lt, p.transpose(at)), pt = a.svd(j);
|
|
2616
|
+
V = p.multMat(pt.V, p.transpose(pt.U));
|
|
2617
|
+
for (var yt = 0; yt < d.size; yt++) {
|
|
2618
|
+
var Bt = [v[yt], T[yt]], Yt = [V[0][0], V[1][0]], _t = [V[0][1], V[1][1]];
|
|
2619
|
+
v[yt] = p.dotProduct(Bt, Yt), T[yt] = p.dotProduct(Bt, _t);
|
|
2620
|
+
}
|
|
2621
|
+
w && K(h.relativePlacementConstraint);
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
if (l.ENFORCE_CONSTRAINTS) {
|
|
2625
|
+
if (h.fixedNodeConstraint && h.fixedNodeConstraint.length > 0) {
|
|
2626
|
+
var xt = {
|
|
2627
|
+
x: 0,
|
|
2628
|
+
y: 0
|
|
2629
|
+
};
|
|
2630
|
+
h.fixedNodeConstraint.forEach(function(I, Y) {
|
|
2631
|
+
var q = {
|
|
2632
|
+
x: v[d.get(I.nodeId)],
|
|
2633
|
+
y: T[d.get(I.nodeId)]
|
|
2634
|
+
}, $ = I.position, tt = U($, q);
|
|
2635
|
+
xt.x += tt.x, xt.y += tt.y;
|
|
2636
|
+
}), xt.x /= h.fixedNodeConstraint.length, xt.y /= h.fixedNodeConstraint.length, v.forEach(function(I, Y) {
|
|
2637
|
+
v[Y] += xt.x;
|
|
2638
|
+
}), T.forEach(function(I, Y) {
|
|
2639
|
+
T[Y] += xt.y;
|
|
2640
|
+
}), h.fixedNodeConstraint.forEach(function(I) {
|
|
2641
|
+
v[d.get(I.nodeId)] = I.position.x, T[d.get(I.nodeId)] = I.position.y;
|
|
2642
|
+
});
|
|
2643
|
+
}
|
|
2644
|
+
if (h.alignmentConstraint) {
|
|
2645
|
+
if (h.alignmentConstraint.vertical) for (var kt = h.alignmentConstraint.vertical, Ut = function(I) {
|
|
2646
|
+
var Y = /* @__PURE__ */ new Set();
|
|
2647
|
+
kt[I].forEach(function(tt) {
|
|
2648
|
+
Y.add(tt);
|
|
2649
|
+
});
|
|
2650
|
+
var q = new Set([].concat(e(Y)).filter(function(tt) {
|
|
2651
|
+
return R.has(tt);
|
|
2652
|
+
})), $ = void 0;
|
|
2653
|
+
$ = q.size > 0 ? v[d.get(q.values().next().value)] : Z(Y).x, Y.forEach(function(tt) {
|
|
2654
|
+
R.has(tt) || (v[d.get(tt)] = $);
|
|
2655
|
+
});
|
|
2656
|
+
}, Rt = 0; Rt < kt.length; Rt++) Ut(Rt);
|
|
2657
|
+
if (h.alignmentConstraint.horizontal) for (var Vt = h.alignmentConstraint.horizontal, Gt = function(I) {
|
|
2658
|
+
var Y = /* @__PURE__ */ new Set();
|
|
2659
|
+
Vt[I].forEach(function(tt) {
|
|
2660
|
+
Y.add(tt);
|
|
2661
|
+
});
|
|
2662
|
+
var q = new Set([].concat(e(Y)).filter(function(tt) {
|
|
2663
|
+
return R.has(tt);
|
|
2664
|
+
})), $ = void 0;
|
|
2665
|
+
$ = q.size > 0 ? T[d.get(q.values().next().value)] : Z(Y).y, Y.forEach(function(tt) {
|
|
2666
|
+
R.has(tt) || (T[d.get(tt)] = $);
|
|
2667
|
+
});
|
|
2668
|
+
}, st = 0; st < Vt.length; st++) Gt(st);
|
|
2669
|
+
}
|
|
2670
|
+
h.relativePlacementConstraint && (function() {
|
|
2671
|
+
var I = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), Et = /* @__PURE__ */ new Map(), mt = /* @__PURE__ */ new Set(), it = /* @__PURE__ */ new Set();
|
|
2672
|
+
if (R.forEach(function(nt) {
|
|
2673
|
+
mt.add(nt), it.add(nt);
|
|
2674
|
+
}), h.alignmentConstraint) {
|
|
2675
|
+
if (h.alignmentConstraint.vertical) for (var ft = h.alignmentConstraint.vertical, It = function(nt) {
|
|
2676
|
+
q.set("dummy" + nt, []), ft[nt].forEach(function(Ct) {
|
|
2677
|
+
I.set(Ct, "dummy" + nt), q.get("dummy" + nt).push(Ct), R.has(Ct) && mt.add("dummy" + nt);
|
|
2678
|
+
}), tt.set("dummy" + nt, v[d.get(ft[nt][0])]);
|
|
2679
|
+
}, wt = 0; wt < ft.length; wt++) It(wt);
|
|
2680
|
+
if (h.alignmentConstraint.horizontal) for (var vt = h.alignmentConstraint.horizontal, ht = function(nt) {
|
|
2681
|
+
$.set("dummy" + nt, []), vt[nt].forEach(function(Ct) {
|
|
2682
|
+
Y.set(Ct, "dummy" + nt), $.get("dummy" + nt).push(Ct), R.has(Ct) && it.add("dummy" + nt);
|
|
2683
|
+
}), Et.set("dummy" + nt, T[d.get(vt[nt][0])]);
|
|
2684
|
+
}, dt = 0; dt < vt.length; dt++) ht(dt);
|
|
2685
|
+
}
|
|
2686
|
+
var Q = /* @__PURE__ */ new Map(), ut = /* @__PURE__ */ new Map(), At = function(nt) {
|
|
2687
|
+
G.get(nt).forEach(function(Ct) {
|
|
2688
|
+
var Ht = void 0, zt = void 0;
|
|
2689
|
+
Ct.direction == "horizontal" ? (Ht = I.get(nt) ? I.get(nt) : nt, zt = I.get(Ct.id) ? {
|
|
2690
|
+
id: I.get(Ct.id),
|
|
2691
|
+
gap: Ct.gap,
|
|
2692
|
+
direction: Ct.direction
|
|
2693
|
+
} : Ct, Q.has(Ht) ? Q.get(Ht).push(zt) : Q.set(Ht, [zt]), Q.has(zt.id) || Q.set(zt.id, [])) : (Ht = Y.get(nt) ? Y.get(nt) : nt, zt = Y.get(Ct.id) ? {
|
|
2694
|
+
id: Y.get(Ct.id),
|
|
2695
|
+
gap: Ct.gap,
|
|
2696
|
+
direction: Ct.direction
|
|
2697
|
+
} : Ct, ut.has(Ht) ? ut.get(Ht).push(zt) : ut.set(Ht, [zt]), ut.has(zt.id) || ut.set(zt.id, []));
|
|
2698
|
+
});
|
|
2699
|
+
}, rt = !0, bt = !1, Ot = void 0;
|
|
2700
|
+
try {
|
|
2701
|
+
for (var Dt = G.keys()[Symbol.iterator](), Ft; !(rt = (Ft = Dt.next()).done); rt = !0) {
|
|
2702
|
+
var Tt = Ft.value;
|
|
2703
|
+
At(Tt);
|
|
2704
|
+
}
|
|
2705
|
+
} catch (nt) {
|
|
2706
|
+
bt = !0, Ot = nt;
|
|
2707
|
+
} finally {
|
|
2708
|
+
try {
|
|
2709
|
+
!rt && Dt.return && Dt.return();
|
|
2710
|
+
} finally {
|
|
2711
|
+
if (bt) throw Ot;
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
var Nt = E(Q), Mt = E(ut), Pt = s(Nt), Xt = s(Mt), ne = u(Q), ee = u(ut), qt = [], Zt = [];
|
|
2715
|
+
Pt.forEach(function(nt, Ct) {
|
|
2716
|
+
qt[Ct] = [], nt.forEach(function(Ht) {
|
|
2717
|
+
ne.get(Ht).length == 0 && qt[Ct].push(Ht);
|
|
2718
|
+
});
|
|
2719
|
+
}), Xt.forEach(function(nt, Ct) {
|
|
2720
|
+
Zt[Ct] = [], nt.forEach(function(Ht) {
|
|
2721
|
+
ee.get(Ht).length == 0 && Zt[Ct].push(Ht);
|
|
2722
|
+
});
|
|
2723
|
+
});
|
|
2724
|
+
var jt = x(Q, "horizontal", mt, tt, qt), Kt = x(ut, "vertical", it, Et, Zt), re = function(nt) {
|
|
2725
|
+
q.get(nt) ? q.get(nt).forEach(function(Ct) {
|
|
2726
|
+
v[d.get(Ct)] = jt.get(nt);
|
|
2727
|
+
}) : v[d.get(nt)] = jt.get(nt);
|
|
2728
|
+
}, $t = !0, ve = !1, ye = void 0;
|
|
2729
|
+
try {
|
|
2730
|
+
for (var ae = jt.keys()[Symbol.iterator](), me; !($t = (me = ae.next()).done); $t = !0) {
|
|
2731
|
+
var se = me.value;
|
|
2732
|
+
re(se);
|
|
2733
|
+
}
|
|
2734
|
+
} catch (nt) {
|
|
2735
|
+
ve = !0, ye = nt;
|
|
2736
|
+
} finally {
|
|
2737
|
+
try {
|
|
2738
|
+
!$t && ae.return && ae.return();
|
|
2739
|
+
} finally {
|
|
2740
|
+
if (ve) throw ye;
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
var He = function(nt) {
|
|
2744
|
+
$.get(nt) ? $.get(nt).forEach(function(Ct) {
|
|
2745
|
+
T[d.get(Ct)] = Kt.get(nt);
|
|
2746
|
+
}) : T[d.get(nt)] = Kt.get(nt);
|
|
2747
|
+
}, he = !0, Ee = !1, Te = void 0;
|
|
2748
|
+
try {
|
|
2749
|
+
for (var le = Kt.keys()[Symbol.iterator](), Ne; !(he = (Ne = le.next()).done); he = !0) {
|
|
2750
|
+
var se = Ne.value;
|
|
2751
|
+
He(se);
|
|
2752
|
+
}
|
|
2753
|
+
} catch (nt) {
|
|
2754
|
+
Ee = !0, Te = nt;
|
|
2755
|
+
} finally {
|
|
2756
|
+
try {
|
|
2757
|
+
!he && le.return && le.return();
|
|
2758
|
+
} finally {
|
|
2759
|
+
if (Ee) throw Te;
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
})();
|
|
2763
|
+
}
|
|
2764
|
+
for (var ot = 0; ot < L.length; ot++) {
|
|
2765
|
+
var ct = L[ot];
|
|
2766
|
+
ct.getChild() ?? ct.setCenter(v[d.get(ct.id)], T[d.get(ct.id)]);
|
|
2767
|
+
}
|
|
2768
|
+
}, o.exports = n;
|
|
2769
|
+
}),
|
|
2770
|
+
551: ((o) => {
|
|
2771
|
+
o.exports = A;
|
|
2772
|
+
})
|
|
2773
|
+
}, N = {};
|
|
2774
|
+
function f(o) {
|
|
2775
|
+
var r = N[o];
|
|
2776
|
+
if (r !== void 0) return r.exports;
|
|
2777
|
+
var t = N[o] = { exports: {} };
|
|
2778
|
+
return D[o](t, t.exports, f), t.exports;
|
|
2779
|
+
}
|
|
2780
|
+
return f(45);
|
|
2781
|
+
})();
|
|
2782
|
+
});
|
|
2783
|
+
})), si = /* @__PURE__ */ ii((/* @__PURE__ */ fe(((M, _) => {
|
|
2784
|
+
(function(A, D) {
|
|
2785
|
+
typeof M == "object" && typeof _ == "object" ? _.exports = D(Ce()) : typeof define == "function" && define.amd ? define(["cose-base"], D) : typeof M == "object" ? M.cytoscapeFcose = D(Ce()) : A.cytoscapeFcose = D(A.coseBase);
|
|
2786
|
+
})(M, function(A) {
|
|
2787
|
+
return (() => {
|
|
2788
|
+
var D = {
|
|
2789
|
+
658: ((o) => {
|
|
2790
|
+
o.exports = Object.assign == null ? function(r) {
|
|
2791
|
+
return [...arguments].slice(1).forEach(function(t) {
|
|
2792
|
+
Object.keys(t).forEach(function(e) {
|
|
2793
|
+
return r[e] = t[e];
|
|
2794
|
+
});
|
|
2795
|
+
}), r;
|
|
2796
|
+
} : Object.assign.bind(Object);
|
|
2797
|
+
}),
|
|
2798
|
+
548: ((o, r, t) => {
|
|
2799
|
+
var e = /* @__PURE__ */ (function() {
|
|
2800
|
+
function p(a, n) {
|
|
2801
|
+
var g = [], h = !0, c = !1, d = void 0;
|
|
2802
|
+
try {
|
|
2803
|
+
for (var v = a[Symbol.iterator](), T; !(h = (T = v.next()).done) && (g.push(T.value), !(n && g.length === n)); h = !0) ;
|
|
2804
|
+
} catch (L) {
|
|
2805
|
+
c = !0, d = L;
|
|
2806
|
+
} finally {
|
|
2807
|
+
try {
|
|
2808
|
+
!h && v.return && v.return();
|
|
2809
|
+
} finally {
|
|
2810
|
+
if (c) throw d;
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
return g;
|
|
2814
|
+
}
|
|
2815
|
+
return function(a, n) {
|
|
2816
|
+
if (Array.isArray(a)) return a;
|
|
2817
|
+
if (Symbol.iterator in Object(a)) return p(a, n);
|
|
2818
|
+
throw TypeError("Invalid attempt to destructure non-iterable instance");
|
|
2819
|
+
};
|
|
2820
|
+
})(), l = t(140).layoutBase.LinkedList, i = {};
|
|
2821
|
+
i.getTopMostNodes = function(p) {
|
|
2822
|
+
for (var a = {}, n = 0; n < p.length; n++) a[p[n].id()] = !0;
|
|
2823
|
+
return p.filter(function(g, h) {
|
|
2824
|
+
typeof g == "number" && (g = h);
|
|
2825
|
+
for (var c = g.parent()[0]; c != null; ) {
|
|
2826
|
+
if (a[c.id()]) return !1;
|
|
2827
|
+
c = c.parent()[0];
|
|
2828
|
+
}
|
|
2829
|
+
return !0;
|
|
2830
|
+
});
|
|
2831
|
+
}, i.connectComponents = function(p, a, n, g) {
|
|
2832
|
+
var h = new l(), c = /* @__PURE__ */ new Set(), d = [], v = void 0, T = void 0, L = void 0, F = !1, S = 1, P = [], U = [], Z = function() {
|
|
2833
|
+
var x = p.collection();
|
|
2834
|
+
U.push(x);
|
|
2835
|
+
var K = n[0], s = p.collection();
|
|
2836
|
+
s.merge(K).merge(K.descendants().intersection(a)), d.push(K), s.forEach(function(m) {
|
|
2837
|
+
h.push(m), c.add(m), x.merge(m);
|
|
2838
|
+
});
|
|
2839
|
+
for (var E = function() {
|
|
2840
|
+
K = h.shift();
|
|
2841
|
+
var m = p.collection();
|
|
2842
|
+
K.neighborhood().nodes().forEach(function(w) {
|
|
2843
|
+
a.intersection(K.edgesWith(w)).length > 0 && m.merge(w);
|
|
2844
|
+
});
|
|
2845
|
+
for (var y = 0; y < m.length; y++) {
|
|
2846
|
+
var C = m[y];
|
|
2847
|
+
v = n.intersection(C.union(C.ancestors())), v != null && !c.has(v[0]) && v.union(v.descendants()).forEach(function(w) {
|
|
2848
|
+
h.push(w), c.add(w), x.merge(w), n.has(w) && d.push(w);
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2851
|
+
}; h.length != 0; ) E();
|
|
2852
|
+
if (x.forEach(function(m) {
|
|
2853
|
+
a.intersection(m.connectedEdges()).forEach(function(y) {
|
|
2854
|
+
x.has(y.source()) && x.has(y.target()) && x.merge(y);
|
|
2855
|
+
});
|
|
2856
|
+
}), d.length == n.length && (F = !0), !F || F && S > 1) {
|
|
2857
|
+
T = d[0], L = T.connectedEdges().length, d.forEach(function(m) {
|
|
2858
|
+
m.connectedEdges().length < L && (L = m.connectedEdges().length, T = m);
|
|
2859
|
+
}), P.push(T.id());
|
|
2860
|
+
var u = p.collection();
|
|
2861
|
+
u.merge(d[0]), d.forEach(function(m) {
|
|
2862
|
+
u.merge(m);
|
|
2863
|
+
}), d = [], n = n.difference(u), S++;
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
do
|
|
2867
|
+
Z();
|
|
2868
|
+
while (!F);
|
|
2869
|
+
return g && P.length > 0 && g.set("dummy" + (g.size + 1), P), U;
|
|
2870
|
+
}, i.relocateComponent = function(p, a, n) {
|
|
2871
|
+
if (!n.fixedNodeConstraint) {
|
|
2872
|
+
var g = 1 / 0, h = -1 / 0, c = 1 / 0, d = -1 / 0;
|
|
2873
|
+
if (n.quality == "draft") {
|
|
2874
|
+
var v = !0, T = !1, L = void 0;
|
|
2875
|
+
try {
|
|
2876
|
+
for (var F = a.nodeIndexes[Symbol.iterator](), S; !(v = (S = F.next()).done); v = !0) {
|
|
2877
|
+
var P = S.value, U = e(P, 2), Z = U[0], x = U[1], K = n.cy.getElementById(Z);
|
|
2878
|
+
if (K) {
|
|
2879
|
+
var s = K.boundingBox(), E = a.xCoords[x] - s.w / 2, u = a.xCoords[x] + s.w / 2, m = a.yCoords[x] - s.h / 2, y = a.yCoords[x] + s.h / 2;
|
|
2880
|
+
E < g && (g = E), u > h && (h = u), m < c && (c = m), y > d && (d = y);
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
} catch (b) {
|
|
2884
|
+
T = !0, L = b;
|
|
2885
|
+
} finally {
|
|
2886
|
+
try {
|
|
2887
|
+
!v && F.return && F.return();
|
|
2888
|
+
} finally {
|
|
2889
|
+
if (T) throw L;
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
var C = p.x - (h + g) / 2, w = p.y - (d + c) / 2;
|
|
2893
|
+
a.xCoords = a.xCoords.map(function(b) {
|
|
2894
|
+
return b + C;
|
|
2895
|
+
}), a.yCoords = a.yCoords.map(function(b) {
|
|
2896
|
+
return b + w;
|
|
2897
|
+
});
|
|
2898
|
+
} else {
|
|
2899
|
+
Object.keys(a).forEach(function(b) {
|
|
2900
|
+
var k = a[b], W = k.getRect().x, J = k.getRect().x + k.getRect().width, H = k.getRect().y, z = k.getRect().y + k.getRect().height;
|
|
2901
|
+
W < g && (g = W), J > h && (h = J), H < c && (c = H), z > d && (d = z);
|
|
2902
|
+
});
|
|
2903
|
+
var R = p.x - (h + g) / 2, G = p.y - (d + c) / 2;
|
|
2904
|
+
Object.keys(a).forEach(function(b) {
|
|
2905
|
+
var k = a[b];
|
|
2906
|
+
k.setCenter(k.getCenterX() + R, k.getCenterY() + G);
|
|
2907
|
+
});
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
}, i.calcBoundingBox = function(p, a, n, g) {
|
|
2911
|
+
for (var h = 9007199254740991, c = -9007199254740991, d = 9007199254740991, v = -9007199254740991, T = void 0, L = void 0, F = void 0, S = void 0, P = p.descendants().not(":parent"), U = P.length, Z = 0; Z < U; Z++) {
|
|
2912
|
+
var x = P[Z];
|
|
2913
|
+
T = a[g.get(x.id())] - x.width() / 2, L = a[g.get(x.id())] + x.width() / 2, F = n[g.get(x.id())] - x.height() / 2, S = n[g.get(x.id())] + x.height() / 2, h > T && (h = T), c < L && (c = L), d > F && (d = F), v < S && (v = S);
|
|
2914
|
+
}
|
|
2915
|
+
var K = {};
|
|
2916
|
+
return K.topLeftX = h, K.topLeftY = d, K.width = c - h, K.height = v - d, K;
|
|
2917
|
+
}, i.calcParentsWithoutChildren = function(p, a) {
|
|
2918
|
+
var n = p.collection();
|
|
2919
|
+
return a.nodes(":parent").forEach(function(g) {
|
|
2920
|
+
var h = !1;
|
|
2921
|
+
g.children().forEach(function(c) {
|
|
2922
|
+
c.css("display") != "none" && (h = !0);
|
|
2923
|
+
}), h || n.merge(g);
|
|
2924
|
+
}), n;
|
|
2925
|
+
}, o.exports = i;
|
|
2926
|
+
}),
|
|
2927
|
+
816: ((o, r, t) => {
|
|
2928
|
+
var e = t(548), l = t(140).CoSELayout, i = t(140).CoSENode, p = t(140).layoutBase.PointD, a = t(140).layoutBase.DimensionD, n = t(140).layoutBase.LayoutConstants, g = t(140).layoutBase.FDLayoutConstants, h = t(140).CoSEConstants;
|
|
2929
|
+
o.exports = { coseLayout: function(c, d) {
|
|
2930
|
+
var v = c.cy, T = c.eles, L = T.nodes(), F = T.edges(), S = void 0, P = void 0, U = void 0, Z = {};
|
|
2931
|
+
c.randomize && (S = d.nodeIndexes, P = d.xCoords, U = d.yCoords);
|
|
2932
|
+
var x = function(w) {
|
|
2933
|
+
return typeof w == "function";
|
|
2934
|
+
}, K = function(w, R) {
|
|
2935
|
+
return x(w) ? w(R) : w;
|
|
2936
|
+
}, s = e.calcParentsWithoutChildren(v, T), E = function w(R, G, b, k) {
|
|
2937
|
+
for (var W = G.length, J = 0; J < W; J++) {
|
|
2938
|
+
var H = G[J], z = null;
|
|
2939
|
+
H.intersection(s).length == 0 && (z = H.children());
|
|
2940
|
+
var O = void 0, B = H.layoutDimensions({ nodeDimensionsIncludeLabels: k.nodeDimensionsIncludeLabels });
|
|
2941
|
+
if (H.outerWidth() != null && H.outerHeight() != null) if (k.randomize) if (!H.isParent()) O = R.add(new i(b.graphManager, new p(P[S.get(H.id())] - B.w / 2, U[S.get(H.id())] - B.h / 2), new a(parseFloat(B.w), parseFloat(B.h))));
|
|
2942
|
+
else {
|
|
2943
|
+
var et = e.calcBoundingBox(H, P, U, S);
|
|
2944
|
+
O = H.intersection(s).length == 0 ? R.add(new i(b.graphManager, new p(et.topLeftX, et.topLeftY), new a(et.width, et.height))) : R.add(new i(b.graphManager, new p(et.topLeftX, et.topLeftY), new a(parseFloat(B.w), parseFloat(B.h))));
|
|
2945
|
+
}
|
|
2946
|
+
else O = R.add(new i(b.graphManager, new p(H.position("x") - B.w / 2, H.position("y") - B.h / 2), new a(parseFloat(B.w), parseFloat(B.h))));
|
|
2947
|
+
else O = R.add(new i(this.graphManager));
|
|
2948
|
+
if (O.id = H.data("id"), O.nodeRepulsion = K(k.nodeRepulsion, H), O.paddingLeft = parseInt(H.css("padding")), O.paddingTop = parseInt(H.css("padding")), O.paddingRight = parseInt(H.css("padding")), O.paddingBottom = parseInt(H.css("padding")), k.nodeDimensionsIncludeLabels && (O.labelWidth = H.boundingBox({
|
|
2949
|
+
includeLabels: !0,
|
|
2950
|
+
includeNodes: !1,
|
|
2951
|
+
includeOverlays: !1
|
|
2952
|
+
}).w, O.labelHeight = H.boundingBox({
|
|
2953
|
+
includeLabels: !0,
|
|
2954
|
+
includeNodes: !1,
|
|
2955
|
+
includeOverlays: !1
|
|
2956
|
+
}).h, O.labelPosVertical = H.css("text-valign"), O.labelPosHorizontal = H.css("text-halign")), Z[H.data("id")] = O, isNaN(O.rect.x) && (O.rect.x = 0), isNaN(O.rect.y) && (O.rect.y = 0), z != null && z.length > 0) {
|
|
2957
|
+
var X = void 0;
|
|
2958
|
+
X = b.getGraphManager().add(b.newGraph(), O), w(X, z, b, k);
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
}, u = function(w, R, G) {
|
|
2962
|
+
for (var b = 0, k = 0, W = 0; W < G.length; W++) {
|
|
2963
|
+
var J = G[W], H = Z[J.data("source")], z = Z[J.data("target")];
|
|
2964
|
+
if (H && z && H !== z && H.getEdgesBetween(z).length == 0) {
|
|
2965
|
+
var O = R.add(w.newEdge(), H, z);
|
|
2966
|
+
O.id = J.id(), O.idealLength = K(c.idealEdgeLength, J), O.edgeElasticity = K(c.edgeElasticity, J), b += O.idealLength, k++;
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
c.idealEdgeLength != null && (k > 0 ? h.DEFAULT_EDGE_LENGTH = g.DEFAULT_EDGE_LENGTH = b / k : x(c.idealEdgeLength) ? h.DEFAULT_EDGE_LENGTH = g.DEFAULT_EDGE_LENGTH = 50 : h.DEFAULT_EDGE_LENGTH = g.DEFAULT_EDGE_LENGTH = c.idealEdgeLength, h.MIN_REPULSION_DIST = g.MIN_REPULSION_DIST = g.DEFAULT_EDGE_LENGTH / 10, h.DEFAULT_RADIAL_SEPARATION = g.DEFAULT_EDGE_LENGTH);
|
|
2970
|
+
}, m = function(w, R) {
|
|
2971
|
+
R.fixedNodeConstraint && (w.constraints.fixedNodeConstraint = R.fixedNodeConstraint), R.alignmentConstraint && (w.constraints.alignmentConstraint = R.alignmentConstraint), R.relativePlacementConstraint && (w.constraints.relativePlacementConstraint = R.relativePlacementConstraint);
|
|
2972
|
+
};
|
|
2973
|
+
c.nestingFactor != null && (h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = c.nestingFactor), c.gravity != null && (h.DEFAULT_GRAVITY_STRENGTH = g.DEFAULT_GRAVITY_STRENGTH = c.gravity), c.numIter != null && (h.MAX_ITERATIONS = g.MAX_ITERATIONS = c.numIter), c.gravityRange != null && (h.DEFAULT_GRAVITY_RANGE_FACTOR = g.DEFAULT_GRAVITY_RANGE_FACTOR = c.gravityRange), c.gravityCompound != null && (h.DEFAULT_COMPOUND_GRAVITY_STRENGTH = g.DEFAULT_COMPOUND_GRAVITY_STRENGTH = c.gravityCompound), c.gravityRangeCompound != null && (h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = c.gravityRangeCompound), c.initialEnergyOnIncremental != null && (h.DEFAULT_COOLING_FACTOR_INCREMENTAL = g.DEFAULT_COOLING_FACTOR_INCREMENTAL = c.initialEnergyOnIncremental), c.tilingCompareBy != null && (h.TILING_COMPARE_BY = c.tilingCompareBy), c.quality == "proof" ? n.QUALITY = 2 : n.QUALITY = 0, h.NODE_DIMENSIONS_INCLUDE_LABELS = g.NODE_DIMENSIONS_INCLUDE_LABELS = n.NODE_DIMENSIONS_INCLUDE_LABELS = c.nodeDimensionsIncludeLabels, h.DEFAULT_INCREMENTAL = g.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = !c.randomize, h.ANIMATE = g.ANIMATE = n.ANIMATE = c.animate, h.TILE = c.tile, h.TILING_PADDING_VERTICAL = typeof c.tilingPaddingVertical == "function" ? c.tilingPaddingVertical.call() : c.tilingPaddingVertical, h.TILING_PADDING_HORIZONTAL = typeof c.tilingPaddingHorizontal == "function" ? c.tilingPaddingHorizontal.call() : c.tilingPaddingHorizontal, h.DEFAULT_INCREMENTAL = g.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = !0, h.PURE_INCREMENTAL = !c.randomize, n.DEFAULT_UNIFORM_LEAF_NODE_SIZES = c.uniformNodeDimensions, c.step == "transformed" && (h.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, h.ENFORCE_CONSTRAINTS = !1, h.APPLY_LAYOUT = !1), c.step == "enforced" && (h.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, h.ENFORCE_CONSTRAINTS = !0, h.APPLY_LAYOUT = !1), c.step == "cose" && (h.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, h.ENFORCE_CONSTRAINTS = !1, h.APPLY_LAYOUT = !0), c.step == "all" && (c.randomize ? h.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : h.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, h.ENFORCE_CONSTRAINTS = !0, h.APPLY_LAYOUT = !0), c.fixedNodeConstraint || c.alignmentConstraint || c.relativePlacementConstraint ? h.TREE_REDUCTION_ON_INCREMENTAL = !1 : h.TREE_REDUCTION_ON_INCREMENTAL = !0;
|
|
2974
|
+
var y = new l(), C = y.newGraphManager();
|
|
2975
|
+
return E(C.addRoot(), e.getTopMostNodes(L), y, c), u(y, C, F), m(y, c), y.runLayout(), Z;
|
|
2976
|
+
} };
|
|
2977
|
+
}),
|
|
2978
|
+
212: ((o, r, t) => {
|
|
2979
|
+
var e = /* @__PURE__ */ (function() {
|
|
2980
|
+
function h(c, d) {
|
|
2981
|
+
for (var v = 0; v < d.length; v++) {
|
|
2982
|
+
var T = d[v];
|
|
2983
|
+
T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(c, T.key, T);
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
return function(c, d, v) {
|
|
2987
|
+
return d && h(c.prototype, d), v && h(c, v), c;
|
|
2988
|
+
};
|
|
2989
|
+
})();
|
|
2990
|
+
function l(h, c) {
|
|
2991
|
+
if (!(h instanceof c)) throw TypeError("Cannot call a class as a function");
|
|
2992
|
+
}
|
|
2993
|
+
var i = t(658), p = t(548), a = t(657).spectralLayout, n = t(816).coseLayout, g = Object.freeze({
|
|
2994
|
+
quality: "default",
|
|
2995
|
+
randomize: !0,
|
|
2996
|
+
animate: !0,
|
|
2997
|
+
animationDuration: 1e3,
|
|
2998
|
+
animationEasing: void 0,
|
|
2999
|
+
fit: !0,
|
|
3000
|
+
padding: 30,
|
|
3001
|
+
nodeDimensionsIncludeLabels: !1,
|
|
3002
|
+
uniformNodeDimensions: !1,
|
|
3003
|
+
packComponents: !0,
|
|
3004
|
+
step: "all",
|
|
3005
|
+
samplingType: !0,
|
|
3006
|
+
sampleSize: 25,
|
|
3007
|
+
nodeSeparation: 75,
|
|
3008
|
+
piTol: 1e-7,
|
|
3009
|
+
nodeRepulsion: function(h) {
|
|
3010
|
+
return 4500;
|
|
3011
|
+
},
|
|
3012
|
+
idealEdgeLength: function(h) {
|
|
3013
|
+
return 50;
|
|
3014
|
+
},
|
|
3015
|
+
edgeElasticity: function(h) {
|
|
3016
|
+
return 0.45;
|
|
3017
|
+
},
|
|
3018
|
+
nestingFactor: 0.1,
|
|
3019
|
+
gravity: 0.25,
|
|
3020
|
+
numIter: 2500,
|
|
3021
|
+
tile: !0,
|
|
3022
|
+
tilingCompareBy: void 0,
|
|
3023
|
+
tilingPaddingVertical: 10,
|
|
3024
|
+
tilingPaddingHorizontal: 10,
|
|
3025
|
+
gravityRangeCompound: 1.5,
|
|
3026
|
+
gravityCompound: 1,
|
|
3027
|
+
gravityRange: 3.8,
|
|
3028
|
+
initialEnergyOnIncremental: 0.3,
|
|
3029
|
+
fixedNodeConstraint: void 0,
|
|
3030
|
+
alignmentConstraint: void 0,
|
|
3031
|
+
relativePlacementConstraint: void 0,
|
|
3032
|
+
ready: function() {
|
|
3033
|
+
},
|
|
3034
|
+
stop: function() {
|
|
3035
|
+
}
|
|
3036
|
+
});
|
|
3037
|
+
o.exports = (function() {
|
|
3038
|
+
function h(c) {
|
|
3039
|
+
l(this, h), this.options = i({}, g, c);
|
|
3040
|
+
}
|
|
3041
|
+
return e(h, [{
|
|
3042
|
+
key: "run",
|
|
3043
|
+
value: function() {
|
|
3044
|
+
var c = this, d = this.options, v = d.cy, T = d.eles, L = [], F = [], S = void 0, P = [];
|
|
3045
|
+
d.fixedNodeConstraint && (!Array.isArray(d.fixedNodeConstraint) || d.fixedNodeConstraint.length == 0) && (d.fixedNodeConstraint = void 0), d.alignmentConstraint && (d.alignmentConstraint.vertical && (!Array.isArray(d.alignmentConstraint.vertical) || d.alignmentConstraint.vertical.length == 0) && (d.alignmentConstraint.vertical = void 0), d.alignmentConstraint.horizontal && (!Array.isArray(d.alignmentConstraint.horizontal) || d.alignmentConstraint.horizontal.length == 0) && (d.alignmentConstraint.horizontal = void 0)), d.relativePlacementConstraint && (!Array.isArray(d.relativePlacementConstraint) || d.relativePlacementConstraint.length == 0) && (d.relativePlacementConstraint = void 0), (d.fixedNodeConstraint || d.alignmentConstraint || d.relativePlacementConstraint) && (d.tile = !1, d.packComponents = !1);
|
|
3046
|
+
var U = void 0, Z = !1;
|
|
3047
|
+
if (v.layoutUtilities && d.packComponents && (U = v.layoutUtilities("get"), U ||= v.layoutUtilities(), Z = !0), T.nodes().length > 0) if (Z) {
|
|
3048
|
+
var x = p.getTopMostNodes(d.eles.nodes());
|
|
3049
|
+
if (S = p.connectComponents(v, d.eles, x), S.forEach(function(X) {
|
|
3050
|
+
var V = X.boundingBox();
|
|
3051
|
+
P.push({
|
|
3052
|
+
x: V.x1 + V.w / 2,
|
|
3053
|
+
y: V.y1 + V.h / 2
|
|
3054
|
+
});
|
|
3055
|
+
}), d.randomize && S.forEach(function(X) {
|
|
3056
|
+
d.eles = X, L.push(a(d));
|
|
3057
|
+
}), d.quality == "default" || d.quality == "proof") {
|
|
3058
|
+
var K = v.collection();
|
|
3059
|
+
if (d.tile) {
|
|
3060
|
+
var s = /* @__PURE__ */ new Map(), E = [], u = [], m = 0, y = {
|
|
3061
|
+
nodeIndexes: s,
|
|
3062
|
+
xCoords: E,
|
|
3063
|
+
yCoords: u
|
|
3064
|
+
}, C = [];
|
|
3065
|
+
if (S.forEach(function(X, V) {
|
|
3066
|
+
X.edges().length == 0 && (X.nodes().forEach(function(lt, at) {
|
|
3067
|
+
K.merge(X.nodes()[at]), lt.isParent() || (y.nodeIndexes.set(X.nodes()[at].id(), m++), y.xCoords.push(X.nodes()[0].position().x), y.yCoords.push(X.nodes()[0].position().y));
|
|
3068
|
+
}), C.push(V));
|
|
3069
|
+
}), K.length > 1) {
|
|
3070
|
+
var w = K.boundingBox();
|
|
3071
|
+
P.push({
|
|
3072
|
+
x: w.x1 + w.w / 2,
|
|
3073
|
+
y: w.y1 + w.h / 2
|
|
3074
|
+
}), S.push(K), L.push(y);
|
|
3075
|
+
for (var R = C.length - 1; R >= 0; R--) S.splice(C[R], 1), L.splice(C[R], 1), P.splice(C[R], 1);
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3078
|
+
S.forEach(function(X, V) {
|
|
3079
|
+
d.eles = X, F.push(n(d, L[V])), p.relocateComponent(P[V], F[V], d);
|
|
3080
|
+
});
|
|
3081
|
+
} else S.forEach(function(X, V) {
|
|
3082
|
+
p.relocateComponent(P[V], L[V], d);
|
|
3083
|
+
});
|
|
3084
|
+
var G = /* @__PURE__ */ new Set();
|
|
3085
|
+
if (S.length > 1) {
|
|
3086
|
+
var b = [], k = T.filter(function(X) {
|
|
3087
|
+
return X.css("display") == "none";
|
|
3088
|
+
});
|
|
3089
|
+
S.forEach(function(X, V) {
|
|
3090
|
+
var lt = void 0;
|
|
3091
|
+
if (d.quality == "draft" && (lt = L[V].nodeIndexes), X.nodes().not(k).length > 0) {
|
|
3092
|
+
var at = {};
|
|
3093
|
+
at.edges = [], at.nodes = [];
|
|
3094
|
+
var Lt = void 0;
|
|
3095
|
+
X.nodes().not(k).forEach(function(j) {
|
|
3096
|
+
if (d.quality == "draft") if (!j.isParent()) Lt = lt.get(j.id()), at.nodes.push({
|
|
3097
|
+
x: L[V].xCoords[Lt] - j.boundingbox().w / 2,
|
|
3098
|
+
y: L[V].yCoords[Lt] - j.boundingbox().h / 2,
|
|
3099
|
+
width: j.boundingbox().w,
|
|
3100
|
+
height: j.boundingbox().h
|
|
3101
|
+
});
|
|
3102
|
+
else {
|
|
3103
|
+
var pt = p.calcBoundingBox(j, L[V].xCoords, L[V].yCoords, lt);
|
|
3104
|
+
at.nodes.push({
|
|
3105
|
+
x: pt.topLeftX,
|
|
3106
|
+
y: pt.topLeftY,
|
|
3107
|
+
width: pt.width,
|
|
3108
|
+
height: pt.height
|
|
3109
|
+
});
|
|
3110
|
+
}
|
|
3111
|
+
else F[V][j.id()] && at.nodes.push({
|
|
3112
|
+
x: F[V][j.id()].getLeft(),
|
|
3113
|
+
y: F[V][j.id()].getTop(),
|
|
3114
|
+
width: F[V][j.id()].getWidth(),
|
|
3115
|
+
height: F[V][j.id()].getHeight()
|
|
3116
|
+
});
|
|
3117
|
+
}), X.edges().forEach(function(j) {
|
|
3118
|
+
var pt = j.source(), yt = j.target();
|
|
3119
|
+
if (pt.css("display") != "none" && yt.css("display") != "none") if (d.quality == "draft") {
|
|
3120
|
+
var Bt = lt.get(pt.id()), Yt = lt.get(yt.id()), _t = [], xt = [];
|
|
3121
|
+
if (pt.isParent()) {
|
|
3122
|
+
var kt = p.calcBoundingBox(pt, L[V].xCoords, L[V].yCoords, lt);
|
|
3123
|
+
_t.push(kt.topLeftX + kt.width / 2), _t.push(kt.topLeftY + kt.height / 2);
|
|
3124
|
+
} else _t.push(L[V].xCoords[Bt]), _t.push(L[V].yCoords[Bt]);
|
|
3125
|
+
if (yt.isParent()) {
|
|
3126
|
+
var Ut = p.calcBoundingBox(yt, L[V].xCoords, L[V].yCoords, lt);
|
|
3127
|
+
xt.push(Ut.topLeftX + Ut.width / 2), xt.push(Ut.topLeftY + Ut.height / 2);
|
|
3128
|
+
} else xt.push(L[V].xCoords[Yt]), xt.push(L[V].yCoords[Yt]);
|
|
3129
|
+
at.edges.push({
|
|
3130
|
+
startX: _t[0],
|
|
3131
|
+
startY: _t[1],
|
|
3132
|
+
endX: xt[0],
|
|
3133
|
+
endY: xt[1]
|
|
3134
|
+
});
|
|
3135
|
+
} else F[V][pt.id()] && F[V][yt.id()] && at.edges.push({
|
|
3136
|
+
startX: F[V][pt.id()].getCenterX(),
|
|
3137
|
+
startY: F[V][pt.id()].getCenterY(),
|
|
3138
|
+
endX: F[V][yt.id()].getCenterX(),
|
|
3139
|
+
endY: F[V][yt.id()].getCenterY()
|
|
3140
|
+
});
|
|
3141
|
+
}), at.nodes.length > 0 && (b.push(at), G.add(V));
|
|
3142
|
+
}
|
|
3143
|
+
});
|
|
3144
|
+
var W = U.packComponents(b, d.randomize).shifts;
|
|
3145
|
+
if (d.quality == "draft") L.forEach(function(X, V) {
|
|
3146
|
+
var lt = X.xCoords.map(function(Lt) {
|
|
3147
|
+
return Lt + W[V].dx;
|
|
3148
|
+
}), at = X.yCoords.map(function(Lt) {
|
|
3149
|
+
return Lt + W[V].dy;
|
|
3150
|
+
});
|
|
3151
|
+
X.xCoords = lt, X.yCoords = at;
|
|
3152
|
+
});
|
|
3153
|
+
else {
|
|
3154
|
+
var J = 0;
|
|
3155
|
+
G.forEach(function(X) {
|
|
3156
|
+
Object.keys(F[X]).forEach(function(V) {
|
|
3157
|
+
var lt = F[X][V];
|
|
3158
|
+
lt.setCenter(lt.getCenterX() + W[J].dx, lt.getCenterY() + W[J].dy);
|
|
3159
|
+
}), J++;
|
|
3160
|
+
});
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
} else {
|
|
3164
|
+
var H = d.eles.boundingBox();
|
|
3165
|
+
if (P.push({
|
|
3166
|
+
x: H.x1 + H.w / 2,
|
|
3167
|
+
y: H.y1 + H.h / 2
|
|
3168
|
+
}), d.randomize) {
|
|
3169
|
+
var z = a(d);
|
|
3170
|
+
L.push(z);
|
|
3171
|
+
}
|
|
3172
|
+
d.quality == "default" || d.quality == "proof" ? (F.push(n(d, L[0])), p.relocateComponent(P[0], F[0], d)) : p.relocateComponent(P[0], L[0], d);
|
|
3173
|
+
}
|
|
3174
|
+
var O = function(X, V) {
|
|
3175
|
+
if (d.quality == "default" || d.quality == "proof") {
|
|
3176
|
+
typeof X == "number" && (X = V);
|
|
3177
|
+
var lt = void 0, at = void 0, Lt = X.data("id");
|
|
3178
|
+
return F.forEach(function(pt) {
|
|
3179
|
+
Lt in pt && (lt = {
|
|
3180
|
+
x: pt[Lt].getRect().getCenterX(),
|
|
3181
|
+
y: pt[Lt].getRect().getCenterY()
|
|
3182
|
+
}, at = pt[Lt]);
|
|
3183
|
+
}), d.nodeDimensionsIncludeLabels && (at.labelWidth && (at.labelPosHorizontal == "left" ? lt.x += at.labelWidth / 2 : at.labelPosHorizontal == "right" && (lt.x -= at.labelWidth / 2)), at.labelHeight && (at.labelPosVertical == "top" ? lt.y += at.labelHeight / 2 : at.labelPosVertical == "bottom" && (lt.y -= at.labelHeight / 2))), lt ??= {
|
|
3184
|
+
x: X.position("x"),
|
|
3185
|
+
y: X.position("y")
|
|
3186
|
+
}, {
|
|
3187
|
+
x: lt.x,
|
|
3188
|
+
y: lt.y
|
|
3189
|
+
};
|
|
3190
|
+
} else {
|
|
3191
|
+
var j = void 0;
|
|
3192
|
+
return L.forEach(function(pt) {
|
|
3193
|
+
var yt = pt.nodeIndexes.get(X.id());
|
|
3194
|
+
yt != null && (j = {
|
|
3195
|
+
x: pt.xCoords[yt],
|
|
3196
|
+
y: pt.yCoords[yt]
|
|
3197
|
+
});
|
|
3198
|
+
}), j ??= {
|
|
3199
|
+
x: X.position("x"),
|
|
3200
|
+
y: X.position("y")
|
|
3201
|
+
}, {
|
|
3202
|
+
x: j.x,
|
|
3203
|
+
y: j.y
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
};
|
|
3207
|
+
if (d.quality == "default" || d.quality == "proof" || d.randomize) {
|
|
3208
|
+
var B = p.calcParentsWithoutChildren(v, T), et = T.filter(function(X) {
|
|
3209
|
+
return X.css("display") == "none";
|
|
3210
|
+
});
|
|
3211
|
+
d.eles = T.not(et), T.nodes().not(":parent").not(et).layoutPositions(c, d, O), B.length > 0 && B.forEach(function(X) {
|
|
3212
|
+
X.position(O(X));
|
|
3213
|
+
});
|
|
3214
|
+
} else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
|
|
3215
|
+
}
|
|
3216
|
+
}]), h;
|
|
3217
|
+
})();
|
|
3218
|
+
}),
|
|
3219
|
+
657: ((o, r, t) => {
|
|
3220
|
+
var e = t(548), l = t(140).layoutBase.Matrix, i = t(140).layoutBase.SVD;
|
|
3221
|
+
o.exports = { spectralLayout: function(p) {
|
|
3222
|
+
var a = p.cy, n = p.eles, g = n.nodes(), h = n.nodes(":parent"), c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), T = [], L = [], F = [], S = [], P = [], U = [], Z = [], x = [], K = void 0, s = 1e8, E = 1e-9, u = p.piTol, m = p.samplingType, y = p.nodeSeparation, C = void 0, w = function() {
|
|
3223
|
+
for (var st = 0, ot = 0, ct = !1; ot < C; ) {
|
|
3224
|
+
st = Math.floor(Math.random() * K), ct = !1;
|
|
3225
|
+
for (var I = 0; I < ot; I++) if (S[I] == st) {
|
|
3226
|
+
ct = !0;
|
|
3227
|
+
break;
|
|
3228
|
+
}
|
|
3229
|
+
if (!ct) S[ot] = st, ot++;
|
|
3230
|
+
else continue;
|
|
3231
|
+
}
|
|
3232
|
+
}, R = function(st, ot, ct) {
|
|
3233
|
+
for (var I = [], Y = 0, q = 0, $ = 0, tt = void 0, Et = [], mt = 0, it = 1, ft = 0; ft < K; ft++) Et[ft] = s;
|
|
3234
|
+
for (I[q] = st, Et[st] = 0; q >= Y; ) {
|
|
3235
|
+
$ = I[Y++];
|
|
3236
|
+
for (var It = T[$], wt = 0; wt < It.length; wt++) tt = d.get(It[wt]), Et[tt] == s && (Et[tt] = Et[$] + 1, I[++q] = tt);
|
|
3237
|
+
U[$][ot] = Et[$] * y;
|
|
3238
|
+
}
|
|
3239
|
+
if (ct) {
|
|
3240
|
+
for (var vt = 0; vt < K; vt++) U[vt][ot] < P[vt] && (P[vt] = U[vt][ot]);
|
|
3241
|
+
for (var ht = 0; ht < K; ht++) P[ht] > mt && (mt = P[ht], it = ht);
|
|
3242
|
+
}
|
|
3243
|
+
return it;
|
|
3244
|
+
}, G = function(st) {
|
|
3245
|
+
var ot = void 0;
|
|
3246
|
+
if (st) {
|
|
3247
|
+
ot = Math.floor(Math.random() * K);
|
|
3248
|
+
for (var ct = 0; ct < K; ct++) P[ct] = s;
|
|
3249
|
+
for (var I = 0; I < C; I++) S[I] = ot, ot = R(ot, I, st);
|
|
3250
|
+
} else {
|
|
3251
|
+
w();
|
|
3252
|
+
for (var Y = 0; Y < C; Y++) R(S[Y], Y, st);
|
|
3253
|
+
}
|
|
3254
|
+
for (var q = 0; q < K; q++) for (var $ = 0; $ < C; $++) U[q][$] *= U[q][$];
|
|
3255
|
+
for (var tt = 0; tt < C; tt++) Z[tt] = [];
|
|
3256
|
+
for (var Et = 0; Et < C; Et++) for (var mt = 0; mt < C; mt++) Z[Et][mt] = U[S[mt]][Et];
|
|
3257
|
+
}, b = function() {
|
|
3258
|
+
for (var st = i.svd(Z), ot = st.S, ct = st.U, I = st.V, Y = ot[0] * ot[0] * ot[0], q = [], $ = 0; $ < C; $++) {
|
|
3259
|
+
q[$] = [];
|
|
3260
|
+
for (var tt = 0; tt < C; tt++) q[$][tt] = 0, $ == tt && (q[$][tt] = ot[$] / (ot[$] * ot[$] + Y / (ot[$] * ot[$])));
|
|
3261
|
+
}
|
|
3262
|
+
x = l.multMat(l.multMat(I, q), l.transpose(ct));
|
|
3263
|
+
}, k = function() {
|
|
3264
|
+
for (var st = void 0, ot = void 0, ct = [], I = [], Y = [], q = [], $ = 0; $ < K; $++) ct[$] = Math.random(), I[$] = Math.random();
|
|
3265
|
+
ct = l.normalize(ct), I = l.normalize(I);
|
|
3266
|
+
for (var tt = 0, Et = E, mt = E, it = void 0; ; ) {
|
|
3267
|
+
tt++;
|
|
3268
|
+
for (var ft = 0; ft < K; ft++) Y[ft] = ct[ft];
|
|
3269
|
+
if (ct = l.multGamma(l.multL(l.multGamma(Y), U, x)), st = l.dotProduct(Y, ct), ct = l.normalize(ct), Et = l.dotProduct(Y, ct), it = Math.abs(Et / mt), it <= 1 + u && it >= 1) break;
|
|
3270
|
+
mt = Et;
|
|
3271
|
+
}
|
|
3272
|
+
for (var It = 0; It < K; It++) Y[It] = ct[It];
|
|
3273
|
+
for (tt = 0, mt = E; ; ) {
|
|
3274
|
+
tt++;
|
|
3275
|
+
for (var wt = 0; wt < K; wt++) q[wt] = I[wt];
|
|
3276
|
+
if (q = l.minusOp(q, l.multCons(Y, l.dotProduct(Y, q))), I = l.multGamma(l.multL(l.multGamma(q), U, x)), ot = l.dotProduct(q, I), I = l.normalize(I), Et = l.dotProduct(q, I), it = Math.abs(Et / mt), it <= 1 + u && it >= 1) break;
|
|
3277
|
+
mt = Et;
|
|
3278
|
+
}
|
|
3279
|
+
for (var vt = 0; vt < K; vt++) q[vt] = I[vt];
|
|
3280
|
+
L = l.multCons(Y, Math.sqrt(Math.abs(st))), F = l.multCons(q, Math.sqrt(Math.abs(ot)));
|
|
3281
|
+
};
|
|
3282
|
+
e.connectComponents(a, n, e.getTopMostNodes(g), c), h.forEach(function(st) {
|
|
3283
|
+
e.connectComponents(a, n, e.getTopMostNodes(st.descendants().intersection(n)), c);
|
|
3284
|
+
});
|
|
3285
|
+
for (var W = 0, J = 0; J < g.length; J++) g[J].isParent() || d.set(g[J].id(), W++);
|
|
3286
|
+
var H = !0, z = !1, O = void 0;
|
|
3287
|
+
try {
|
|
3288
|
+
for (var B = c.keys()[Symbol.iterator](), et; !(H = (et = B.next()).done); H = !0) {
|
|
3289
|
+
var X = et.value;
|
|
3290
|
+
d.set(X, W++);
|
|
3291
|
+
}
|
|
3292
|
+
} catch (st) {
|
|
3293
|
+
z = !0, O = st;
|
|
3294
|
+
} finally {
|
|
3295
|
+
try {
|
|
3296
|
+
!H && B.return && B.return();
|
|
3297
|
+
} finally {
|
|
3298
|
+
if (z) throw O;
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3301
|
+
for (var V = 0; V < d.size; V++) T[V] = [];
|
|
3302
|
+
h.forEach(function(st) {
|
|
3303
|
+
for (var ot = st.children().intersection(n); ot.nodes(":childless").length == 0; ) ot = ot.nodes()[0].children().intersection(n);
|
|
3304
|
+
var ct = 0, I = ot.nodes(":childless")[0].connectedEdges().length;
|
|
3305
|
+
ot.nodes(":childless").forEach(function(Y, q) {
|
|
3306
|
+
Y.connectedEdges().length < I && (I = Y.connectedEdges().length, ct = q);
|
|
3307
|
+
}), v.set(st.id(), ot.nodes(":childless")[ct].id());
|
|
3308
|
+
}), g.forEach(function(st) {
|
|
3309
|
+
var ot = void 0;
|
|
3310
|
+
ot = st.isParent() ? d.get(v.get(st.id())) : d.get(st.id()), st.neighborhood().nodes().forEach(function(ct) {
|
|
3311
|
+
n.intersection(st.edgesWith(ct)).length > 0 && (ct.isParent() ? T[ot].push(v.get(ct.id())) : T[ot].push(ct.id()));
|
|
3312
|
+
});
|
|
3313
|
+
});
|
|
3314
|
+
var lt = function(st) {
|
|
3315
|
+
var ot = d.get(st), ct = void 0;
|
|
3316
|
+
c.get(st).forEach(function(I) {
|
|
3317
|
+
ct = a.getElementById(I).isParent() ? v.get(I) : I, T[ot].push(ct), T[d.get(ct)].push(st);
|
|
3318
|
+
});
|
|
3319
|
+
}, at = !0, Lt = !1, j = void 0;
|
|
3320
|
+
try {
|
|
3321
|
+
for (var pt = c.keys()[Symbol.iterator](), yt; !(at = (yt = pt.next()).done); at = !0) {
|
|
3322
|
+
var Bt = yt.value;
|
|
3323
|
+
lt(Bt);
|
|
3324
|
+
}
|
|
3325
|
+
} catch (st) {
|
|
3326
|
+
Lt = !0, j = st;
|
|
3327
|
+
} finally {
|
|
3328
|
+
try {
|
|
3329
|
+
!at && pt.return && pt.return();
|
|
3330
|
+
} finally {
|
|
3331
|
+
if (Lt) throw j;
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
K = d.size;
|
|
3335
|
+
var Yt = void 0;
|
|
3336
|
+
if (K > 2) {
|
|
3337
|
+
C = K < p.sampleSize ? K : p.sampleSize;
|
|
3338
|
+
for (var _t = 0; _t < K; _t++) U[_t] = [];
|
|
3339
|
+
for (var xt = 0; xt < C; xt++) x[xt] = [];
|
|
3340
|
+
return p.quality == "draft" || p.step == "all" ? (G(m), b(), k(), Yt = {
|
|
3341
|
+
nodeIndexes: d,
|
|
3342
|
+
xCoords: L,
|
|
3343
|
+
yCoords: F
|
|
3344
|
+
}) : (d.forEach(function(st, ot) {
|
|
3345
|
+
L.push(a.getElementById(ot).position("x")), F.push(a.getElementById(ot).position("y"));
|
|
3346
|
+
}), Yt = {
|
|
3347
|
+
nodeIndexes: d,
|
|
3348
|
+
xCoords: L,
|
|
3349
|
+
yCoords: F
|
|
3350
|
+
}), Yt;
|
|
3351
|
+
} else {
|
|
3352
|
+
var kt = d.keys(), Ut = a.getElementById(kt.next().value), Rt = Ut.position(), Vt = Ut.outerWidth();
|
|
3353
|
+
if (L.push(Rt.x), F.push(Rt.y), K == 2) {
|
|
3354
|
+
var Gt = a.getElementById(kt.next().value).outerWidth();
|
|
3355
|
+
L.push(Rt.x + Vt / 2 + Gt / 2 + p.idealEdgeLength), F.push(Rt.y);
|
|
3356
|
+
}
|
|
3357
|
+
return Yt = {
|
|
3358
|
+
nodeIndexes: d,
|
|
3359
|
+
xCoords: L,
|
|
3360
|
+
yCoords: F
|
|
3361
|
+
}, Yt;
|
|
3362
|
+
}
|
|
3363
|
+
} };
|
|
3364
|
+
}),
|
|
3365
|
+
579: ((o, r, t) => {
|
|
3366
|
+
var e = t(212), l = function(i) {
|
|
3367
|
+
i && i("layout", "fcose", e);
|
|
3368
|
+
};
|
|
3369
|
+
typeof cytoscape < "u" && l(cytoscape), o.exports = l;
|
|
3370
|
+
}),
|
|
3371
|
+
140: ((o) => {
|
|
3372
|
+
o.exports = A;
|
|
3373
|
+
})
|
|
3374
|
+
}, N = {};
|
|
3375
|
+
function f(o) {
|
|
3376
|
+
var r = N[o];
|
|
3377
|
+
if (r !== void 0) return r.exports;
|
|
3378
|
+
var t = N[o] = { exports: {} };
|
|
3379
|
+
return D[o](t, t.exports, f), t.exports;
|
|
3380
|
+
}
|
|
3381
|
+
return f(579);
|
|
3382
|
+
})();
|
|
3383
|
+
});
|
|
3384
|
+
})))()), Le = {
|
|
3385
|
+
L: "left",
|
|
3386
|
+
R: "right",
|
|
3387
|
+
T: "top",
|
|
3388
|
+
B: "bottom"
|
|
3389
|
+
}, we = {
|
|
3390
|
+
L: /* @__PURE__ */ gt((M) => `${M},${M / 2} 0,${M} 0,0`, "L"),
|
|
3391
|
+
R: /* @__PURE__ */ gt((M) => `0,${M / 2} ${M},0 ${M},${M}`, "R"),
|
|
3392
|
+
T: /* @__PURE__ */ gt((M) => `0,0 ${M},0 ${M / 2},${M}`, "T"),
|
|
3393
|
+
B: /* @__PURE__ */ gt((M) => `${M / 2},0 ${M},${M} 0,${M}`, "B")
|
|
3394
|
+
}, oe = {
|
|
3395
|
+
L: /* @__PURE__ */ gt((M, _) => M - _ + 2, "L"),
|
|
3396
|
+
R: /* @__PURE__ */ gt((M, _) => M - 2, "R"),
|
|
3397
|
+
T: /* @__PURE__ */ gt((M, _) => M - _ + 2, "T"),
|
|
3398
|
+
B: /* @__PURE__ */ gt((M, _) => M - 2, "B")
|
|
3399
|
+
}, hi = /* @__PURE__ */ gt(function(M) {
|
|
3400
|
+
return St(M) ? M === "L" ? "R" : "L" : M === "T" ? "B" : "T";
|
|
3401
|
+
}, "getOppositeArchitectureDirection"), Ie = /* @__PURE__ */ gt(function(M) {
|
|
3402
|
+
let _ = M;
|
|
3403
|
+
return _ === "L" || _ === "R" || _ === "T" || _ === "B";
|
|
3404
|
+
}, "isArchitectureDirection"), St = /* @__PURE__ */ gt(function(M) {
|
|
3405
|
+
let _ = M;
|
|
3406
|
+
return _ === "L" || _ === "R";
|
|
3407
|
+
}, "isArchitectureDirectionX"), Wt = /* @__PURE__ */ gt(function(M) {
|
|
3408
|
+
let _ = M;
|
|
3409
|
+
return _ === "T" || _ === "B";
|
|
3410
|
+
}, "isArchitectureDirectionY"), pe = /* @__PURE__ */ gt(function(M, _) {
|
|
3411
|
+
let A = St(M) && Wt(_), D = Wt(M) && St(_);
|
|
3412
|
+
return A || D;
|
|
3413
|
+
}, "isArchitectureDirectionXY"), li = /* @__PURE__ */ gt(function(M) {
|
|
3414
|
+
let _ = M[0], A = M[1], D = St(_) && Wt(A), N = Wt(_) && St(A);
|
|
3415
|
+
return D || N;
|
|
3416
|
+
}, "isArchitecturePairXY"), di = /* @__PURE__ */ gt(function(M) {
|
|
3417
|
+
return M !== "LL" && M !== "RR" && M !== "TT" && M !== "BB";
|
|
3418
|
+
}, "isValidArchitectureDirectionPair"), ge = /* @__PURE__ */ gt(function(M, _) {
|
|
3419
|
+
let A = `${M}${_}`;
|
|
3420
|
+
return di(A) ? A : void 0;
|
|
3421
|
+
}, "getArchitectureDirectionPair"), gi = /* @__PURE__ */ gt(function([M, _], A) {
|
|
3422
|
+
let D = A[0], N = A[1];
|
|
3423
|
+
return St(D) ? Wt(N) ? [M + (D === "L" ? -1 : 1), _ + (N === "T" ? 1 : -1)] : [M + (D === "L" ? -1 : 1), _] : St(N) ? [M + (N === "L" ? 1 : -1), _ + (D === "T" ? 1 : -1)] : [M, _ + (D === "T" ? 1 : -1)];
|
|
3424
|
+
}, "shiftPositionByArchitectureDirectionPair"), ci = /* @__PURE__ */ gt(function(M) {
|
|
3425
|
+
return M === "LT" || M === "TL" ? [1, 1] : M === "BL" || M === "LB" ? [1, -1] : M === "BR" || M === "RB" ? [-1, -1] : [-1, 1];
|
|
3426
|
+
}, "getArchitectureDirectionXYFactors"), ui = /* @__PURE__ */ gt(function(M, _) {
|
|
3427
|
+
return pe(M, _) ? "bend" : St(M) ? "horizontal" : "vertical";
|
|
3428
|
+
}, "getArchitectureDirectionAlignment"), fi = /* @__PURE__ */ gt(function(M) {
|
|
3429
|
+
return M.type === "service";
|
|
3430
|
+
}, "isArchitectureService"), pi = /* @__PURE__ */ gt(function(M) {
|
|
3431
|
+
return M.type === "junction";
|
|
3432
|
+
}, "isArchitectureJunction"), Me = /* @__PURE__ */ gt((M) => M.data(), "edgeData"), Qt = /* @__PURE__ */ gt((M) => M.data(), "nodeData"), vi = ei.architecture, te, Oe = (te = class {
|
|
3433
|
+
constructor() {
|
|
3434
|
+
this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.elements = {}, this.diagramId = "", this.setAccTitle = We, this.getAccTitle = je, this.setDiagramTitle = $e, this.getDiagramTitle = qe, this.getAccDescription = Ze, this.setAccDescription = Ke, this.clear();
|
|
3435
|
+
}
|
|
3436
|
+
setDiagramId(_) {
|
|
3437
|
+
this.diagramId = _;
|
|
3438
|
+
}
|
|
3439
|
+
getDiagramId() {
|
|
3440
|
+
return this.diagramId;
|
|
3441
|
+
}
|
|
3442
|
+
clear() {
|
|
3443
|
+
this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.dataStructures = void 0, this.elements = {}, this.diagramId = "", Je();
|
|
3444
|
+
}
|
|
3445
|
+
addService({ id: _, icon: A, in: D, title: N, iconText: f }) {
|
|
3446
|
+
if (this.registeredIds[_] !== void 0) throw Error(`The service id [${_}] is already in use by another ${this.registeredIds[_]}`);
|
|
3447
|
+
if (D !== void 0) {
|
|
3448
|
+
if (_ === D) throw Error(`The service [${_}] cannot be placed within itself`);
|
|
3449
|
+
if (this.registeredIds[D] === void 0) throw Error(`The service [${_}]'s parent does not exist. Please make sure the parent is created before this service`);
|
|
3450
|
+
if (this.registeredIds[D] === "node") throw Error(`The service [${_}]'s parent is not a group`);
|
|
3451
|
+
}
|
|
3452
|
+
this.registeredIds[_] = "node", this.nodes[_] = {
|
|
3453
|
+
id: _,
|
|
3454
|
+
type: "service",
|
|
3455
|
+
icon: A,
|
|
3456
|
+
iconText: f,
|
|
3457
|
+
title: N,
|
|
3458
|
+
edges: [],
|
|
3459
|
+
in: D
|
|
3460
|
+
};
|
|
3461
|
+
}
|
|
3462
|
+
getServices() {
|
|
3463
|
+
return Object.values(this.nodes).filter(fi);
|
|
3464
|
+
}
|
|
3465
|
+
addJunction({ id: _, in: A }) {
|
|
3466
|
+
if (this.registeredIds[_] !== void 0) throw Error(`The junction id [${_}] is already in use by another ${this.registeredIds[_]}`);
|
|
3467
|
+
if (A !== void 0) {
|
|
3468
|
+
if (_ === A) throw Error(`The junction [${_}] cannot be placed within itself`);
|
|
3469
|
+
if (this.registeredIds[A] === void 0) throw Error(`The junction [${_}]'s parent does not exist. Please make sure the parent is created before this junction`);
|
|
3470
|
+
if (this.registeredIds[A] === "node") throw Error(`The junction [${_}]'s parent is not a group`);
|
|
3471
|
+
}
|
|
3472
|
+
this.registeredIds[_] = "node", this.nodes[_] = {
|
|
3473
|
+
id: _,
|
|
3474
|
+
type: "junction",
|
|
3475
|
+
edges: [],
|
|
3476
|
+
in: A
|
|
3477
|
+
};
|
|
3478
|
+
}
|
|
3479
|
+
getJunctions() {
|
|
3480
|
+
return Object.values(this.nodes).filter(pi);
|
|
3481
|
+
}
|
|
3482
|
+
getNodes() {
|
|
3483
|
+
return Object.values(this.nodes);
|
|
3484
|
+
}
|
|
3485
|
+
getNode(_) {
|
|
3486
|
+
return this.nodes[_] ?? null;
|
|
3487
|
+
}
|
|
3488
|
+
addGroup({ id: _, icon: A, in: D, title: N }) {
|
|
3489
|
+
if (this.registeredIds?.[_] !== void 0) throw Error(`The group id [${_}] is already in use by another ${this.registeredIds[_]}`);
|
|
3490
|
+
if (D !== void 0) {
|
|
3491
|
+
if (_ === D) throw Error(`The group [${_}] cannot be placed within itself`);
|
|
3492
|
+
if (this.registeredIds?.[D] === void 0) throw Error(`The group [${_}]'s parent does not exist. Please make sure the parent is created before this group`);
|
|
3493
|
+
if (this.registeredIds?.[D] === "node") throw Error(`The group [${_}]'s parent is not a group`);
|
|
3494
|
+
}
|
|
3495
|
+
this.registeredIds[_] = "group", this.groups[_] = {
|
|
3496
|
+
id: _,
|
|
3497
|
+
icon: A,
|
|
3498
|
+
title: N,
|
|
3499
|
+
in: D
|
|
3500
|
+
};
|
|
3501
|
+
}
|
|
3502
|
+
getGroups() {
|
|
3503
|
+
return Object.values(this.groups);
|
|
3504
|
+
}
|
|
3505
|
+
addEdge({ lhsId: _, rhsId: A, lhsDir: D, rhsDir: N, lhsInto: f, rhsInto: o, lhsGroup: r, rhsGroup: t, title: e }) {
|
|
3506
|
+
if (!Ie(D)) throw Error(`Invalid direction given for left hand side of edge ${_}--${A}. Expected (L,R,T,B) got ${String(D)}`);
|
|
3507
|
+
if (!Ie(N)) throw Error(`Invalid direction given for right hand side of edge ${_}--${A}. Expected (L,R,T,B) got ${String(N)}`);
|
|
3508
|
+
if (this.nodes[_] === void 0 && this.groups[_] === void 0) throw Error(`The left-hand id [${_}] does not yet exist. Please create the service/group before declaring an edge to it.`);
|
|
3509
|
+
if (this.nodes[A] === void 0 && this.groups[A] === void 0) throw Error(`The right-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`);
|
|
3510
|
+
let l = this.nodes[_].in, i = this.nodes[A].in;
|
|
3511
|
+
if (r && l && i && l == i) throw Error(`The left-hand id [${_}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);
|
|
3512
|
+
if (t && l && i && l == i) throw Error(`The right-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);
|
|
3513
|
+
let p = {
|
|
3514
|
+
lhsId: _,
|
|
3515
|
+
lhsDir: D,
|
|
3516
|
+
lhsInto: f,
|
|
3517
|
+
lhsGroup: r,
|
|
3518
|
+
rhsId: A,
|
|
3519
|
+
rhsDir: N,
|
|
3520
|
+
rhsInto: o,
|
|
3521
|
+
rhsGroup: t,
|
|
3522
|
+
title: e
|
|
3523
|
+
};
|
|
3524
|
+
this.edges.push(p), this.nodes[_] && this.nodes[A] && (this.nodes[_].edges.push(this.edges[this.edges.length - 1]), this.nodes[A].edges.push(this.edges[this.edges.length - 1]));
|
|
3525
|
+
}
|
|
3526
|
+
getEdges() {
|
|
3527
|
+
return this.edges;
|
|
3528
|
+
}
|
|
3529
|
+
getDataStructures() {
|
|
3530
|
+
if (this.dataStructures === void 0) {
|
|
3531
|
+
let _ = {}, A = Object.entries(this.nodes).reduce((t, [e, l]) => (t[e] = l.edges.reduce((i, p) => {
|
|
3532
|
+
let a = this.getNode(p.lhsId)?.in, n = this.getNode(p.rhsId)?.in;
|
|
3533
|
+
if (a && n && a !== n) {
|
|
3534
|
+
let g = ui(p.lhsDir, p.rhsDir);
|
|
3535
|
+
g !== "bend" && (_[a] ??= {}, _[a][n] = g, _[n] ??= {}, _[n][a] = g);
|
|
3536
|
+
}
|
|
3537
|
+
if (p.lhsId === e) {
|
|
3538
|
+
let g = ge(p.lhsDir, p.rhsDir);
|
|
3539
|
+
g && (i[g] = p.rhsId);
|
|
3540
|
+
} else {
|
|
3541
|
+
let g = ge(p.rhsDir, p.lhsDir);
|
|
3542
|
+
g && (i[g] = p.lhsId);
|
|
3543
|
+
}
|
|
3544
|
+
return i;
|
|
3545
|
+
}, {}), t), {}), D = Object.keys(A)[0], N = { [D]: 1 }, f = Object.keys(A).reduce((t, e) => e === D ? t : {
|
|
3546
|
+
...t,
|
|
3547
|
+
[e]: 1
|
|
3548
|
+
}, {}), o = /* @__PURE__ */ gt((t) => {
|
|
3549
|
+
let e = { [t]: [0, 0] }, l = [t];
|
|
3550
|
+
for (; l.length > 0; ) {
|
|
3551
|
+
let i = l.shift();
|
|
3552
|
+
if (i) {
|
|
3553
|
+
N[i] = 1, delete f[i];
|
|
3554
|
+
let p = A[i], [a, n] = e[i];
|
|
3555
|
+
Object.entries(p).forEach(([g, h]) => {
|
|
3556
|
+
N[h] || (e[h] = gi([a, n], g), l.push(h));
|
|
3557
|
+
});
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
return e;
|
|
3561
|
+
}, "BFS"), r = [o(D)];
|
|
3562
|
+
for (; Object.keys(f).length > 0; ) r.push(o(Object.keys(f)[0]));
|
|
3563
|
+
this.dataStructures = {
|
|
3564
|
+
adjList: A,
|
|
3565
|
+
spatialMaps: r,
|
|
3566
|
+
groupAlignments: _
|
|
3567
|
+
};
|
|
3568
|
+
}
|
|
3569
|
+
return this.dataStructures;
|
|
3570
|
+
}
|
|
3571
|
+
setElementForId(_, A) {
|
|
3572
|
+
this.elements[_] = A;
|
|
3573
|
+
}
|
|
3574
|
+
getElementById(_) {
|
|
3575
|
+
return this.elements[_];
|
|
3576
|
+
}
|
|
3577
|
+
getConfig() {
|
|
3578
|
+
return Qe({
|
|
3579
|
+
...vi,
|
|
3580
|
+
...ti().architecture
|
|
3581
|
+
});
|
|
3582
|
+
}
|
|
3583
|
+
getConfigField(_) {
|
|
3584
|
+
return this.getConfig()[_];
|
|
3585
|
+
}
|
|
3586
|
+
}, gt(te, "ArchitectureDB"), te), yi = /* @__PURE__ */ gt((M, _) => {
|
|
3587
|
+
ni(M, _), M.groups.map((A) => _.addGroup(A)), M.services.map((A) => _.addService({
|
|
3588
|
+
...A,
|
|
3589
|
+
type: "service"
|
|
3590
|
+
})), M.junctions.map((A) => _.addJunction({
|
|
3591
|
+
...A,
|
|
3592
|
+
type: "junction"
|
|
3593
|
+
})), M.edges.map((A) => _.addEdge(A));
|
|
3594
|
+
}, "populateDb"), De = {
|
|
3595
|
+
parser: { yy: void 0 },
|
|
3596
|
+
parse: /* @__PURE__ */ gt(async (M) => {
|
|
3597
|
+
let _ = await ai("architecture", M);
|
|
3598
|
+
_e.debug(_);
|
|
3599
|
+
let A = De.parser?.yy;
|
|
3600
|
+
if (!(A instanceof Oe)) throw Error("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.");
|
|
3601
|
+
yi(_, A);
|
|
3602
|
+
}, "parse")
|
|
3603
|
+
}, mi = /* @__PURE__ */ gt((M) => `
|
|
3604
|
+
.edge {
|
|
3605
|
+
stroke-width: ${M.archEdgeWidth};
|
|
3606
|
+
stroke: ${M.archEdgeColor};
|
|
3607
|
+
fill: none;
|
|
3608
|
+
}
|
|
3609
|
+
|
|
3610
|
+
.arrow {
|
|
3611
|
+
fill: ${M.archEdgeArrowColor};
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
.node-bkg {
|
|
3615
|
+
fill: none;
|
|
3616
|
+
stroke: ${M.archGroupBorderColor};
|
|
3617
|
+
stroke-width: ${M.archGroupBorderWidth};
|
|
3618
|
+
stroke-dasharray: 8;
|
|
3619
|
+
}
|
|
3620
|
+
.node-icon-text {
|
|
3621
|
+
display: flex;
|
|
3622
|
+
align-items: center;
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3625
|
+
.node-icon-text > div {
|
|
3626
|
+
color: #fff;
|
|
3627
|
+
margin: 1px;
|
|
3628
|
+
height: fit-content;
|
|
3629
|
+
text-align: center;
|
|
3630
|
+
overflow: hidden;
|
|
3631
|
+
display: -webkit-box;
|
|
3632
|
+
-webkit-box-orient: vertical;
|
|
3633
|
+
}
|
|
3634
|
+
`, "getStyles"), Jt = /* @__PURE__ */ gt((M) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${M}</g>`, "wrapIcon"), ie = {
|
|
3635
|
+
prefix: "mermaid-architecture",
|
|
3636
|
+
height: 80,
|
|
3637
|
+
width: 80,
|
|
3638
|
+
icons: {
|
|
3639
|
+
database: { body: Jt('<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;"/>') },
|
|
3640
|
+
server: { body: Jt('<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>') },
|
|
3641
|
+
disk: { body: Jt('<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;"/>') },
|
|
3642
|
+
internet: { body: Jt('<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;"/>') },
|
|
3643
|
+
cloud: { body: Jt('<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;"/>') },
|
|
3644
|
+
unknown: oi,
|
|
3645
|
+
blank: { body: Jt("") }
|
|
3646
|
+
}
|
|
3647
|
+
}, Ei = /* @__PURE__ */ gt(async function(M, _, A, D) {
|
|
3648
|
+
let N = A.getConfigField("padding"), f = A.getConfigField("iconSize"), o = f / 2, r = f / 6, t = r / 2;
|
|
3649
|
+
await Promise.all(_.edges().map(async (e) => {
|
|
3650
|
+
let { source: l, sourceDir: i, sourceArrow: p, sourceGroup: a, target: n, targetDir: g, targetArrow: h, targetGroup: c, label: d } = Me(e), { x: v, y: T } = e[0].sourceEndpoint(), { x: L, y: F } = e[0].midpoint(), { x: S, y: P } = e[0].targetEndpoint(), U = N + 4;
|
|
3651
|
+
if (a && (St(i) ? v += i === "L" ? -U : U : T += i === "T" ? -U : U + 18), c && (St(g) ? S += g === "L" ? -U : U : P += g === "T" ? -U : U + 18), !a && A.getNode(l)?.type === "junction" && (St(i) ? v += i === "L" ? o : -o : T += i === "T" ? o : -o), !c && A.getNode(n)?.type === "junction" && (St(g) ? S += g === "L" ? o : -o : P += g === "T" ? o : -o), e[0]._private.rscratch) {
|
|
3652
|
+
let Z = M.insert("g");
|
|
3653
|
+
if (Z.insert("path").attr("d", `M ${v},${T} L ${L},${F} L${S},${P} `).attr("class", "edge").attr("id", `${D}-${Ve(l, n, { prefix: "L" })}`), p) {
|
|
3654
|
+
let x = St(i) ? oe[i](v, r) : v - t, K = Wt(i) ? oe[i](T, r) : T - t;
|
|
3655
|
+
Z.insert("polygon").attr("points", we[i](r)).attr("transform", `translate(${x},${K})`).attr("class", "arrow");
|
|
3656
|
+
}
|
|
3657
|
+
if (h) {
|
|
3658
|
+
let x = St(g) ? oe[g](S, r) : S - t, K = Wt(g) ? oe[g](P, r) : P - t;
|
|
3659
|
+
Z.insert("polygon").attr("points", we[g](r)).attr("transform", `translate(${x},${K})`).attr("class", "arrow");
|
|
3660
|
+
}
|
|
3661
|
+
if (d) {
|
|
3662
|
+
let x = pe(i, g) ? "XY" : St(i) ? "X" : "Y", K = 0;
|
|
3663
|
+
K = x === "X" ? Math.abs(v - S) : x === "Y" ? Math.abs(T - P) / 1.5 : Math.abs(v - S) / 2;
|
|
3664
|
+
let s = Z.append("g");
|
|
3665
|
+
if (await ue(s, d, {
|
|
3666
|
+
useHtmlLabels: !1,
|
|
3667
|
+
width: K,
|
|
3668
|
+
classes: "architecture-service-label"
|
|
3669
|
+
}, ce()), s.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), x === "X") s.attr("transform", "translate(" + L + ", " + F + ")");
|
|
3670
|
+
else if (x === "Y") s.attr("transform", "translate(" + L + ", " + F + ") rotate(-90)");
|
|
3671
|
+
else if (x === "XY") {
|
|
3672
|
+
let E = ge(i, g);
|
|
3673
|
+
if (E && li(E)) {
|
|
3674
|
+
let u = s.node().getBoundingClientRect(), [m, y] = ci(E);
|
|
3675
|
+
s.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * m * y * 45})`);
|
|
3676
|
+
let C = s.node().getBoundingClientRect();
|
|
3677
|
+
s.attr("transform", `
|
|
3678
|
+
translate(${L}, ${F - u.height / 2})
|
|
3679
|
+
translate(${m * C.width / 2}, ${y * C.height / 2})
|
|
3680
|
+
rotate(${-1 * m * y * 45}, 0, ${u.height / 2})
|
|
3681
|
+
`);
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3686
|
+
}));
|
|
3687
|
+
}, "drawEdges"), Ti = /* @__PURE__ */ gt(async function(M, _, A, D) {
|
|
3688
|
+
let N = A.getConfigField("padding") * 0.75, f = A.getConfigField("fontSize"), o = A.getConfigField("iconSize") / 2;
|
|
3689
|
+
await Promise.all(_.nodes().map(async (r) => {
|
|
3690
|
+
let t = Qt(r);
|
|
3691
|
+
if (t.type === "group") {
|
|
3692
|
+
let { h: e, w: l, x1: i, y1: p } = r.boundingBox(), a = M.append("rect");
|
|
3693
|
+
a.attr("id", `${D}-group-${t.id}`).attr("x", i + o).attr("y", p + o).attr("width", l).attr("height", e).attr("class", "node-bkg");
|
|
3694
|
+
let n = M.append("g"), g = i, h = p;
|
|
3695
|
+
if (t.icon) {
|
|
3696
|
+
let c = n.append("g");
|
|
3697
|
+
c.html(`<g>${await de(t.icon, {
|
|
3698
|
+
height: N,
|
|
3699
|
+
width: N,
|
|
3700
|
+
fallbackPrefix: ie.prefix
|
|
3701
|
+
})}</g>`), c.attr("transform", "translate(" + (g + o + 1) + ", " + (h + o + 1) + ")"), g += N, h += f / 2 - 1 - 2;
|
|
3702
|
+
}
|
|
3703
|
+
if (t.label) {
|
|
3704
|
+
let c = n.append("g");
|
|
3705
|
+
await ue(c, t.label, {
|
|
3706
|
+
useHtmlLabels: !1,
|
|
3707
|
+
width: l,
|
|
3708
|
+
classes: "architecture-service-label"
|
|
3709
|
+
}, ce()), c.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), c.attr("transform", "translate(" + (g + o + 4) + ", " + (h + o + 2) + ")");
|
|
3710
|
+
}
|
|
3711
|
+
A.setElementForId(t.id, a);
|
|
3712
|
+
}
|
|
3713
|
+
}));
|
|
3714
|
+
}, "drawGroups"), Ni = /* @__PURE__ */ gt(async function(M, _, A, D) {
|
|
3715
|
+
let N = ce();
|
|
3716
|
+
for (let f of A) {
|
|
3717
|
+
let o = _.append("g"), r = M.getConfigField("iconSize");
|
|
3718
|
+
if (f.title) {
|
|
3719
|
+
let i = o.append("g");
|
|
3720
|
+
await ue(i, f.title, {
|
|
3721
|
+
useHtmlLabels: !1,
|
|
3722
|
+
width: r * 1.5,
|
|
3723
|
+
classes: "architecture-service-label"
|
|
3724
|
+
}, N), i.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), i.attr("transform", "translate(" + r / 2 + ", " + r + ")");
|
|
3725
|
+
}
|
|
3726
|
+
let t = o.append("g");
|
|
3727
|
+
if (f.icon) t.html(`<g>${await de(f.icon, {
|
|
3728
|
+
height: r,
|
|
3729
|
+
width: r,
|
|
3730
|
+
fallbackPrefix: ie.prefix
|
|
3731
|
+
})}</g>`);
|
|
3732
|
+
else if (f.iconText) {
|
|
3733
|
+
t.html(`<g>${await de("blank", {
|
|
3734
|
+
height: r,
|
|
3735
|
+
width: r,
|
|
3736
|
+
fallbackPrefix: ie.prefix
|
|
3737
|
+
})}</g>`);
|
|
3738
|
+
let i = t.append("g").append("foreignObject").attr("width", r).attr("height", r).append("div").attr("class", "node-icon-text").attr("style", `height: ${r}px;`).append("div").html(ze(f.iconText, N)), p = parseInt(window.getComputedStyle(i.node(), null).getPropertyValue("font-size").replace(/\D/g, "")) ?? 16;
|
|
3739
|
+
i.attr("style", `-webkit-line-clamp: ${Math.floor((r - 2) / p)};`);
|
|
3740
|
+
} else t.append("path").attr("class", "node-bkg").attr("id", `${D}-node-${f.id}`).attr("d", `M0,${r} V5 Q0,0 5,0 H${r - 5} Q${r},0 ${r},5 V${r} Z`);
|
|
3741
|
+
o.attr("id", `${D}-service-${f.id}`).attr("class", "architecture-service");
|
|
3742
|
+
let { width: e, height: l } = o.node().getBBox();
|
|
3743
|
+
f.width = e, f.height = l, M.setElementForId(f.id, o);
|
|
3744
|
+
}
|
|
3745
|
+
return 0;
|
|
3746
|
+
}, "drawServices"), Ai = /* @__PURE__ */ gt(function(M, _, A, D) {
|
|
3747
|
+
A.forEach((N) => {
|
|
3748
|
+
let f = _.append("g"), o = M.getConfigField("iconSize");
|
|
3749
|
+
f.append("g").append("rect").attr("id", `${D}-node-${N.id}`).attr("fill-opacity", "0").attr("width", o).attr("height", o), f.attr("class", "architecture-junction");
|
|
3750
|
+
let { width: r, height: t } = f._groups[0][0].getBBox();
|
|
3751
|
+
f.width = r, f.height = t, M.setElementForId(N.id, f);
|
|
3752
|
+
});
|
|
3753
|
+
}, "drawJunctions");
|
|
3754
|
+
ri([{
|
|
3755
|
+
name: ie.prefix,
|
|
3756
|
+
icons: ie
|
|
3757
|
+
}]), xe.use(si.default);
|
|
3758
|
+
function Re(M, _, A) {
|
|
3759
|
+
M.forEach((D) => {
|
|
3760
|
+
_.add({
|
|
3761
|
+
group: "nodes",
|
|
3762
|
+
data: {
|
|
3763
|
+
type: "service",
|
|
3764
|
+
id: D.id,
|
|
3765
|
+
icon: D.icon,
|
|
3766
|
+
label: D.title,
|
|
3767
|
+
parent: D.in,
|
|
3768
|
+
width: A.getConfigField("iconSize"),
|
|
3769
|
+
height: A.getConfigField("iconSize")
|
|
3770
|
+
},
|
|
3771
|
+
classes: "node-service"
|
|
3772
|
+
});
|
|
3773
|
+
});
|
|
3774
|
+
}
|
|
3775
|
+
gt(Re, "addServices");
|
|
3776
|
+
function be(M, _, A) {
|
|
3777
|
+
M.forEach((D) => {
|
|
3778
|
+
_.add({
|
|
3779
|
+
group: "nodes",
|
|
3780
|
+
data: {
|
|
3781
|
+
type: "junction",
|
|
3782
|
+
id: D.id,
|
|
3783
|
+
parent: D.in,
|
|
3784
|
+
width: A.getConfigField("iconSize"),
|
|
3785
|
+
height: A.getConfigField("iconSize")
|
|
3786
|
+
},
|
|
3787
|
+
classes: "node-junction"
|
|
3788
|
+
});
|
|
3789
|
+
});
|
|
3790
|
+
}
|
|
3791
|
+
gt(be, "addJunctions");
|
|
3792
|
+
function Fe(M, _) {
|
|
3793
|
+
_.nodes().map((A) => {
|
|
3794
|
+
let D = Qt(A);
|
|
3795
|
+
D.type !== "group" && (D.x = A.position().x, D.y = A.position().y, M.getElementById(D.id).attr("transform", "translate(" + (D.x || 0) + "," + (D.y || 0) + ")"));
|
|
3796
|
+
});
|
|
3797
|
+
}
|
|
3798
|
+
gt(Fe, "positionNodes");
|
|
3799
|
+
function Ge(M, _) {
|
|
3800
|
+
M.forEach((A) => {
|
|
3801
|
+
_.add({
|
|
3802
|
+
group: "nodes",
|
|
3803
|
+
data: {
|
|
3804
|
+
type: "group",
|
|
3805
|
+
id: A.id,
|
|
3806
|
+
icon: A.icon,
|
|
3807
|
+
label: A.title,
|
|
3808
|
+
parent: A.in
|
|
3809
|
+
},
|
|
3810
|
+
classes: "node-group"
|
|
3811
|
+
});
|
|
3812
|
+
});
|
|
3813
|
+
}
|
|
3814
|
+
gt(Ge, "addGroups");
|
|
3815
|
+
function Pe(M, _) {
|
|
3816
|
+
M.forEach((A) => {
|
|
3817
|
+
let { lhsId: D, rhsId: N, lhsInto: f, lhsGroup: o, rhsInto: r, lhsDir: t, rhsDir: e, rhsGroup: l, title: i } = A, p = pe(A.lhsDir, A.rhsDir) ? "segments" : "straight", a = {
|
|
3818
|
+
id: `${D}-${N}`,
|
|
3819
|
+
label: i,
|
|
3820
|
+
source: D,
|
|
3821
|
+
sourceDir: t,
|
|
3822
|
+
sourceArrow: f,
|
|
3823
|
+
sourceGroup: o,
|
|
3824
|
+
sourceEndpoint: t === "L" ? "0 50%" : t === "R" ? "100% 50%" : t === "T" ? "50% 0" : "50% 100%",
|
|
3825
|
+
target: N,
|
|
3826
|
+
targetDir: e,
|
|
3827
|
+
targetArrow: r,
|
|
3828
|
+
targetGroup: l,
|
|
3829
|
+
targetEndpoint: e === "L" ? "0 50%" : e === "R" ? "100% 50%" : e === "T" ? "50% 0" : "50% 100%"
|
|
3830
|
+
};
|
|
3831
|
+
_.add({
|
|
3832
|
+
group: "edges",
|
|
3833
|
+
data: a,
|
|
3834
|
+
classes: p
|
|
3835
|
+
});
|
|
3836
|
+
});
|
|
3837
|
+
}
|
|
3838
|
+
gt(Pe, "addEdges");
|
|
3839
|
+
function Se(M, _, A) {
|
|
3840
|
+
let D = /* @__PURE__ */ gt((o, r) => Object.entries(o).reduce((t, [e, l]) => {
|
|
3841
|
+
let i = 0, p = Object.entries(l);
|
|
3842
|
+
if (p.length === 1) return t[e] = p[0][1], t;
|
|
3843
|
+
for (let a = 0; a < p.length - 1; a++) for (let n = a + 1; n < p.length; n++) {
|
|
3844
|
+
let [g, h] = p[a], [c, d] = p[n];
|
|
3845
|
+
if (A[g]?.[c] === r) t[e] ??= [], t[e] = [
|
|
3846
|
+
...t[e],
|
|
3847
|
+
...h,
|
|
3848
|
+
...d
|
|
3849
|
+
];
|
|
3850
|
+
else if (g === "default" || c === "default") t[e] ??= [], t[e] = [
|
|
3851
|
+
...t[e],
|
|
3852
|
+
...h,
|
|
3853
|
+
...d
|
|
3854
|
+
];
|
|
3855
|
+
else {
|
|
3856
|
+
let v = `${e}-${i++}`;
|
|
3857
|
+
t[v] = h;
|
|
3858
|
+
let T = `${e}-${i++}`;
|
|
3859
|
+
t[T] = d;
|
|
3860
|
+
}
|
|
3861
|
+
}
|
|
3862
|
+
return t;
|
|
3863
|
+
}, {}), "flattenAlignments"), [N, f] = _.map((o) => {
|
|
3864
|
+
let r = {}, t = {};
|
|
3865
|
+
return Object.entries(o).forEach(([e, [l, i]]) => {
|
|
3866
|
+
let p = M.getNode(e)?.in ?? "default";
|
|
3867
|
+
r[i] ??= {}, r[i][p] ??= [], r[i][p].push(e), t[l] ??= {}, t[l][p] ??= [], t[l][p].push(e);
|
|
3868
|
+
}), {
|
|
3869
|
+
horiz: Object.values(D(r, "horizontal")).filter((e) => e.length > 1),
|
|
3870
|
+
vert: Object.values(D(t, "vertical")).filter((e) => e.length > 1)
|
|
3871
|
+
};
|
|
3872
|
+
}).reduce(([o, r], { horiz: t, vert: e }) => [[...o, ...t], [...r, ...e]], [[], []]);
|
|
3873
|
+
return {
|
|
3874
|
+
horizontal: N,
|
|
3875
|
+
vertical: f
|
|
3876
|
+
};
|
|
3877
|
+
}
|
|
3878
|
+
gt(Se, "getAlignments");
|
|
3879
|
+
function Ye(M, _) {
|
|
3880
|
+
let A = [], D = /* @__PURE__ */ gt((f) => `${f[0]},${f[1]}`, "posToStr"), N = /* @__PURE__ */ gt((f) => f.split(",").map((o) => parseInt(o)), "strToPos");
|
|
3881
|
+
return M.forEach((f) => {
|
|
3882
|
+
let o = Object.fromEntries(Object.entries(f).map(([l, i]) => [D(i), l])), r = [D([0, 0])], t = {}, e = {
|
|
3883
|
+
L: [-1, 0],
|
|
3884
|
+
R: [1, 0],
|
|
3885
|
+
T: [0, 1],
|
|
3886
|
+
B: [0, -1]
|
|
3887
|
+
};
|
|
3888
|
+
for (; r.length > 0; ) {
|
|
3889
|
+
let l = r.shift();
|
|
3890
|
+
if (l) {
|
|
3891
|
+
t[l] = 1;
|
|
3892
|
+
let i = o[l];
|
|
3893
|
+
if (i) {
|
|
3894
|
+
let p = N(l);
|
|
3895
|
+
Object.entries(e).forEach(([a, n]) => {
|
|
3896
|
+
let g = D([p[0] + n[0], p[1] + n[1]]), h = o[g];
|
|
3897
|
+
h && !t[g] && (r.push(g), A.push({
|
|
3898
|
+
[Le[a]]: h,
|
|
3899
|
+
[Le[hi(a)]]: i,
|
|
3900
|
+
gap: 1.5 * _.getConfigField("iconSize")
|
|
3901
|
+
}));
|
|
3902
|
+
});
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3906
|
+
}), A;
|
|
3907
|
+
}
|
|
3908
|
+
gt(Ye, "getRelativeConstraints");
|
|
3909
|
+
function ke(M, _, A, D, N, { spatialMaps: f, groupAlignments: o }) {
|
|
3910
|
+
return new Promise((r) => {
|
|
3911
|
+
let t = Be("body").append("div").attr("id", "cy").attr("style", "display:none"), e = xe({
|
|
3912
|
+
container: document.getElementById("cy"),
|
|
3913
|
+
style: [
|
|
3914
|
+
{
|
|
3915
|
+
selector: "edge",
|
|
3916
|
+
style: {
|
|
3917
|
+
"curve-style": "straight",
|
|
3918
|
+
"source-endpoint": "data(sourceEndpoint)",
|
|
3919
|
+
"target-endpoint": "data(targetEndpoint)"
|
|
3920
|
+
}
|
|
3921
|
+
},
|
|
3922
|
+
{
|
|
3923
|
+
selector: "edge[label]",
|
|
3924
|
+
style: { label: "data(label)" }
|
|
3925
|
+
},
|
|
3926
|
+
{
|
|
3927
|
+
selector: "edge.segments",
|
|
3928
|
+
style: {
|
|
3929
|
+
"curve-style": "segments",
|
|
3930
|
+
"segment-weights": "0",
|
|
3931
|
+
"segment-distances": [0.5],
|
|
3932
|
+
"edge-distances": "endpoints",
|
|
3933
|
+
"source-endpoint": "data(sourceEndpoint)",
|
|
3934
|
+
"target-endpoint": "data(targetEndpoint)"
|
|
3935
|
+
}
|
|
3936
|
+
},
|
|
3937
|
+
{
|
|
3938
|
+
selector: "node",
|
|
3939
|
+
style: { "compound-sizing-wrt-labels": "include" }
|
|
3940
|
+
},
|
|
3941
|
+
{
|
|
3942
|
+
selector: "node[label]",
|
|
3943
|
+
style: {
|
|
3944
|
+
"text-valign": "bottom",
|
|
3945
|
+
"text-halign": "center",
|
|
3946
|
+
"font-size": `${N.getConfigField("fontSize")}px`
|
|
3947
|
+
}
|
|
3948
|
+
},
|
|
3949
|
+
{
|
|
3950
|
+
selector: ".node-service",
|
|
3951
|
+
style: {
|
|
3952
|
+
label: "data(label)",
|
|
3953
|
+
width: "data(width)",
|
|
3954
|
+
height: "data(height)"
|
|
3955
|
+
}
|
|
3956
|
+
},
|
|
3957
|
+
{
|
|
3958
|
+
selector: ".node-junction",
|
|
3959
|
+
style: {
|
|
3960
|
+
width: "data(width)",
|
|
3961
|
+
height: "data(height)"
|
|
3962
|
+
}
|
|
3963
|
+
},
|
|
3964
|
+
{
|
|
3965
|
+
selector: ".node-group",
|
|
3966
|
+
style: { padding: `${N.getConfigField("padding")}px` }
|
|
3967
|
+
}
|
|
3968
|
+
],
|
|
3969
|
+
layout: {
|
|
3970
|
+
name: "grid",
|
|
3971
|
+
boundingBox: {
|
|
3972
|
+
x1: 0,
|
|
3973
|
+
x2: 100,
|
|
3974
|
+
y1: 0,
|
|
3975
|
+
y2: 100
|
|
3976
|
+
}
|
|
3977
|
+
}
|
|
3978
|
+
});
|
|
3979
|
+
t.remove(), Ge(A, e), Re(M, e, N), be(_, e, N), Pe(D, e);
|
|
3980
|
+
let l = Se(N, f, o), i = Ye(f, N), p = N.getConfigField("iconSize"), a = N.getConfigField("idealEdgeLengthMultiplier") * p, n = 0.5 * p, g = N.getConfigField("edgeElasticity"), h = e.layout({
|
|
3981
|
+
name: "fcose",
|
|
3982
|
+
quality: "proof",
|
|
3983
|
+
randomize: N.getConfigField("randomize"),
|
|
3984
|
+
nodeSeparation: N.getConfigField("nodeSeparation"),
|
|
3985
|
+
numIter: N.getConfigField("numIter"),
|
|
3986
|
+
styleEnabled: !1,
|
|
3987
|
+
animate: !1,
|
|
3988
|
+
nodeDimensionsIncludeLabels: !1,
|
|
3989
|
+
idealEdgeLength(c) {
|
|
3990
|
+
let [d, v] = c.connectedNodes(), { parent: T } = Qt(d), { parent: L } = Qt(v);
|
|
3991
|
+
return T === L ? a : n;
|
|
3992
|
+
},
|
|
3993
|
+
edgeElasticity(c) {
|
|
3994
|
+
let [d, v] = c.connectedNodes(), { parent: T } = Qt(d), { parent: L } = Qt(v);
|
|
3995
|
+
return T === L ? g : 1e-3;
|
|
3996
|
+
},
|
|
3997
|
+
alignmentConstraint: l,
|
|
3998
|
+
relativePlacementConstraint: i
|
|
3999
|
+
});
|
|
4000
|
+
h.one("layoutstop", () => {
|
|
4001
|
+
function c(d, v, T, L) {
|
|
4002
|
+
let F, S, { x: P, y: U } = d, { x: Z, y: x } = v;
|
|
4003
|
+
S = (L - U + (P - T) * (U - x) / (P - Z)) / Math.sqrt(1 + ((U - x) / (P - Z)) ** 2), F = Math.sqrt((L - U) ** 2 + (T - P) ** 2 - S ** 2);
|
|
4004
|
+
let K = Math.sqrt((Z - P) ** 2 + (x - U) ** 2);
|
|
4005
|
+
F /= K;
|
|
4006
|
+
let s = (Z - P) * (L - U) - (x - U) * (T - P);
|
|
4007
|
+
switch (!0) {
|
|
4008
|
+
case s >= 0:
|
|
4009
|
+
s = 1;
|
|
4010
|
+
break;
|
|
4011
|
+
case s < 0:
|
|
4012
|
+
s = -1;
|
|
4013
|
+
break;
|
|
4014
|
+
}
|
|
4015
|
+
let E = (Z - P) * (T - P) + (x - U) * (L - U);
|
|
4016
|
+
switch (!0) {
|
|
4017
|
+
case E >= 0:
|
|
4018
|
+
E = 1;
|
|
4019
|
+
break;
|
|
4020
|
+
case E < 0:
|
|
4021
|
+
E = -1;
|
|
4022
|
+
break;
|
|
4023
|
+
}
|
|
4024
|
+
return S = Math.abs(S) * s, F *= E, {
|
|
4025
|
+
distances: S,
|
|
4026
|
+
weights: F
|
|
4027
|
+
};
|
|
4028
|
+
}
|
|
4029
|
+
gt(c, "getSegmentWeights"), e.startBatch();
|
|
4030
|
+
for (let d of Object.values(e.edges())) if (d.data?.()) {
|
|
4031
|
+
let { x: v, y: T } = d.source().position(), { x: L, y: F } = d.target().position();
|
|
4032
|
+
if (v !== L && T !== F) {
|
|
4033
|
+
let S = d.sourceEndpoint(), P = d.targetEndpoint(), { sourceDir: U } = Me(d), [Z, x] = Wt(U) ? [S.x, P.y] : [P.x, S.y], { weights: K, distances: s } = c(S, P, Z, x);
|
|
4034
|
+
d.style("segment-distances", s), d.style("segment-weights", K);
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4037
|
+
e.endBatch(), h.run();
|
|
4038
|
+
}), h.run(), e.ready((c) => {
|
|
4039
|
+
_e.info("Ready", c), r(e);
|
|
4040
|
+
});
|
|
4041
|
+
});
|
|
4042
|
+
}
|
|
4043
|
+
gt(ke, "layoutArchitecture");
|
|
4044
|
+
var _i = {
|
|
4045
|
+
parser: De,
|
|
4046
|
+
get db() {
|
|
4047
|
+
return new Oe();
|
|
4048
|
+
},
|
|
4049
|
+
renderer: { draw: /* @__PURE__ */ gt(async (M, _, A, D) => {
|
|
4050
|
+
let N = D.db;
|
|
4051
|
+
N.setDiagramId(_);
|
|
4052
|
+
let f = N.getServices(), o = N.getJunctions(), r = N.getGroups(), t = N.getEdges(), e = N.getDataStructures(), l = Ue(_), i = l.append("g");
|
|
4053
|
+
i.attr("class", "architecture-edges");
|
|
4054
|
+
let p = l.append("g");
|
|
4055
|
+
p.attr("class", "architecture-services");
|
|
4056
|
+
let a = l.append("g");
|
|
4057
|
+
a.attr("class", "architecture-groups"), await Ni(N, p, f, _), Ai(N, p, o, _);
|
|
4058
|
+
let n = await ke(f, o, r, t, N, e);
|
|
4059
|
+
await Ei(i, n, N, _), await Ti(a, n, N, _), Fe(N, n), Xe(void 0, l, N.getConfigField("padding"), N.getConfigField("useMaxWidth"));
|
|
4060
|
+
}, "draw") },
|
|
4061
|
+
styles: mi
|
|
4062
|
+
};
|
|
4063
|
+
export {
|
|
4064
|
+
_i as diagram
|
|
4065
|
+
};
|