ranui 0.2.1-alpha.1 → 0.2.1-alpha.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/abnfDiagram-VRR7QNED-CH_pIv_l.cjs +1 -0
- package/dist/abnfDiagram-VRR7QNED-CTsqwzwi.js +95 -0
- package/dist/arc-D25LhgTs.cjs +1 -0
- package/dist/arc-DRPGof21.js +82 -0
- package/dist/architecture-TIHT7OUA-BbBd15_y.cjs +1 -0
- package/dist/architecture-TIHT7OUA-pbFO1xSx.js +5 -0
- package/dist/architectureDiagram-ZJ3FMSHR-8mjyXr-w.js +4279 -0
- package/dist/architectureDiagram-ZJ3FMSHR-D_jWFFZx.cjs +36 -0
- package/dist/array-By5736M5.js +7 -0
- package/dist/array-C3cbN3GY.cjs +1 -0
- package/dist/blockDiagram-677ZJIJ3-3F79MOSt.js +3321 -0
- package/dist/blockDiagram-677ZJIJ3-Cx35khWe.cjs +132 -0
- package/dist/builder.d.ts +2 -2
- package/dist/builder.js +39 -34
- package/dist/{builtin-D9djWkCE.js → builtin-BkM0LLof.js} +83 -76
- package/dist/button-D0zcnKnG.js +117 -0
- package/dist/button.js +1 -1
- package/dist/c4Diagram-LMCZKHZV-Cxn_gqu_.js +3064 -0
- package/dist/c4Diagram-LMCZKHZV-TRNb3Gvl.cjs +10 -0
- package/dist/{card-CqJa4Q_v.js → card-CygMndQS.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/channel-C9WSNwcS.cjs +1 -0
- package/dist/channel-k5-UxdcV.js +5 -0
- package/dist/{checkbox-CThC9-vy.js → checkbox-D5om9aJO.js} +10 -10
- package/dist/checkbox.js +1 -1
- package/dist/chunk-2Q5K7J3B-CTMy5FII.cjs +1 -0
- package/dist/chunk-2Q5K7J3B-DlFVJRAn.js +15 -0
- package/dist/chunk-32BRIVSS-BXVdG_nV.cjs +1 -0
- package/dist/chunk-32BRIVSS-jAuAwMVV.js +68 -0
- package/dist/chunk-52WLFC77-BChUrU24.cjs +10 -0
- package/dist/chunk-52WLFC77-wpL7en7e.js +630 -0
- package/dist/chunk-5VM5RSS4-Cni2Ogq2.js +19 -0
- package/dist/chunk-5VM5RSS4-DudUFQ_Z.cjs +15 -0
- package/dist/chunk-7BUUIJ7U-9hiBbc7O.js +87 -0
- package/dist/chunk-7BUUIJ7U-DMv_UkjI.cjs +1 -0
- package/dist/chunk-C7G6YPKG-CA-DNpvI.js +71 -0
- package/dist/chunk-C7G6YPKG-CKEeW9TM.cjs +1 -0
- package/dist/chunk-EX3LRPZG-BCmf0iDq.js +2137 -0
- package/dist/chunk-EX3LRPZG-DbfbNdXo.cjs +231 -0
- package/dist/chunk-FWX5IMBZ-D11-gbhc.cjs +1 -0
- package/dist/chunk-FWX5IMBZ-DZ5VYvm5.js +60 -0
- package/dist/chunk-HOUHSVGY-BGB3dOvI.cjs +1 -0
- package/dist/chunk-HOUHSVGY-DRQcQeMT.js +268 -0
- package/dist/chunk-ICXQ74PX-BbT9JaEW.cjs +2 -0
- package/dist/chunk-ICXQ74PX-DR8rL-xF.js +1377 -0
- package/dist/chunk-JWPE2WC7-CGEmUMMZ.js +8 -0
- package/dist/chunk-JWPE2WC7-D8EnWK1B.cjs +1 -0
- package/dist/chunk-KEIR6QF5-B2Op7cFH.js +22155 -0
- package/dist/chunk-KEIR6QF5-C4fcHpY0.cjs +161 -0
- package/dist/chunk-MOJQB5TN-BC46HDyu.js +516 -0
- package/dist/chunk-MOJQB5TN-oOeq982_.cjs +88 -0
- package/dist/chunk-OGEWGWER-BV51ll2w.js +33 -0
- package/dist/chunk-OGEWGWER-DX8sW1dT.cjs +1 -0
- package/dist/chunk-PUDLZKDR-48YaqVoF.cjs +156 -0
- package/dist/chunk-PUDLZKDR-NdMR0Ft5.js +4282 -0
- package/dist/chunk-Q4XR5HBZ-3BHjjc9u.js +1709 -0
- package/dist/chunk-Q4XR5HBZ-aBnPq509.cjs +70 -0
- package/dist/chunk-RYQCIY6F-BER2T9t0.js +246 -0
- package/dist/chunk-RYQCIY6F-DVRzSnsI.cjs +1 -0
- package/dist/chunk-V7JOEXUC-Cr_hr02u.js +3467 -0
- package/dist/chunk-V7JOEXUC-DHizzTla.cjs +206 -0
- package/dist/chunk-VAUOI2AC-DfQf5L2_.cjs +1 -0
- package/dist/chunk-VAUOI2AC-izt0o4id.js +11 -0
- package/dist/chunk-VR4S4FIN-CJi5okl4.js +26 -0
- package/dist/chunk-VR4S4FIN-KiwnPF31.cjs +1 -0
- package/dist/chunk-WYO6CB5R-DDHkKowO.js +4535 -0
- package/dist/chunk-WYO6CB5R-u4mJNOcO.cjs +127 -0
- package/dist/chunk-XXDRQBXY-BB1i_53q.js +9 -0
- package/dist/chunk-XXDRQBXY-C8VGLZmt.cjs +1 -0
- package/dist/chunk-Y2CYZVJY-0JxdZxki.js +13 -0
- package/dist/chunk-Y2CYZVJY-DPaYLFFP.cjs +1 -0
- package/dist/chunk-ZGVPDNZ5-6uMbTJXy.js +3841 -0
- package/dist/chunk-ZGVPDNZ5-Cw5_HJba.cjs +62 -0
- package/dist/chunk-ZIRB5QZD-C7OH2FI2.js +1280 -0
- package/dist/chunk-ZIRB5QZD-aLu-4ITN.cjs +32 -0
- package/dist/classDiagram-OUVF2IWQ-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-OUVF2IWQ-Df0ghim9.js +30 -0
- package/dist/classDiagram-v2-EOCWNBFH-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-Df0ghim9.js +30 -0
- package/dist/{colorpicker-XNxDRcQ-.js → colorpicker-qWnaTlYX.js} +8 -8
- package/dist/colorpicker.js +1 -1
- package/dist/components/glass/index.d.ts +52 -0
- package/dist/components/icon/core-icons.d.ts +13 -0
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/mermaid/index.d.ts +52 -0
- package/dist/components/modal/index.d.ts +9 -0
- package/dist/content-Rry-U6ir.js +39 -0
- package/dist/content.js +5 -0
- package/dist/cose-bilkent-JH36ORCC-BUxFTdey.cjs +1 -0
- package/dist/cose-bilkent-JH36ORCC-DTwvJlGw.js +2353 -0
- package/dist/cynefin-VYW2F7L2-6c1GOGXW.cjs +1 -0
- package/dist/cynefin-VYW2F7L2-ALQKF7N6.js +5 -0
- package/dist/cynefinDiagram-TSTJHNR4-Bjt4QTVh.js +355 -0
- package/dist/cynefinDiagram-TSTJHNR4-ISDORSxO.cjs +62 -0
- package/dist/cytoscape.esm-CFq1_DTa.js +18906 -0
- package/dist/cytoscape.esm-pygMw4dR.cjs +321 -0
- package/dist/dagre-D1-W1tt6.cjs +1 -0
- package/dist/dagre-D8GLTwuf.js +1578 -0
- package/dist/dagre-VKFMJZFB-DXI69qAN.cjs +4 -0
- package/dist/dagre-VKFMJZFB-Dfku86Az.js +341 -0
- package/dist/defaultLocale-0M_kMcEH.js +184 -0
- package/dist/defaultLocale-DSqtvhxg.cjs +1 -0
- package/dist/diagram-FQU43EPY-BAiRt5eL.cjs +3 -0
- package/dist/diagram-FQU43EPY-BvQ5jmVn.js +452 -0
- package/dist/diagram-G47NLZAW-DGnmEa8u.cjs +24 -0
- package/dist/diagram-G47NLZAW-DT2BBA0T.js +498 -0
- package/dist/diagram-NH7WQ7WH-DxgkStA3.cjs +24 -0
- package/dist/diagram-NH7WQ7WH-W7jg4Vh8.js +135 -0
- package/dist/diagram-OA4YK3LP-DkvFII73.cjs +30 -0
- package/dist/diagram-OA4YK3LP-jU--aqQl.js +317 -0
- package/dist/diagram-WEI45ONY-C_Qhf4ny.js +215 -0
- package/dist/diagram-WEI45ONY-XvzRFmmY.cjs +41 -0
- package/dist/dist-C0Fwsvsq.js +70 -0
- package/dist/dist-C20XxSsP.cjs +1 -0
- package/dist/{dropdown-CCvsambb.js → dropdown-DzdAR1nI.js} +4 -4
- package/dist/dropdown.js +1 -1
- package/dist/ebnfDiagram-CCIWWBDH-Cu8bAlhC.cjs +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-Gnr20Oc1.js +112 -0
- package/dist/erDiagram-Q63AITRT-CxLSa9Yv.cjs +85 -0
- package/dist/erDiagram-Q63AITRT-D0Hh9b-W.js +1822 -0
- package/dist/eventmodeling-45OFAUF4-C6VXxUn1.cjs +1 -0
- package/dist/eventmodeling-45OFAUF4-DMpGs2yI.js +5 -0
- package/dist/factory-BkvRcCOx.js +482 -0
- package/dist/flowDiagram-23GEKE2U-B6gASEYG.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-BY4wE2vw.js +19 -0
- package/dist/{form-Ceq3uJzz.js → form-CUJpeQ7Q.js} +5 -5
- package/dist/form.js +1 -1
- package/dist/ganttDiagram-NO4QXBWP-B40Eabk0.js +3125 -0
- package/dist/ganttDiagram-NO4QXBWP-DZT79qJr.cjs +292 -0
- package/dist/gitGraph-TEB2WS4Q-BbtF3MDr.cjs +1 -0
- package/dist/gitGraph-TEB2WS4Q-D6Ru11Cs.js +5 -0
- package/dist/gitGraphDiagram-IHSO6WYX-BUJNSssA.js +754 -0
- package/dist/gitGraphDiagram-IHSO6WYX-DW06165m.cjs +106 -0
- package/dist/glass-Bj1Zf8Hy.js +115 -0
- package/dist/glass.js +5 -0
- package/dist/graphlib-CCKThIKP.js +1104 -0
- package/dist/graphlib-Du-578Js.cjs +1 -0
- package/dist/{icon-C_ENrJ3F.js → icon-CtlZJISZ.js} +77 -25
- package/dist/icon.js +1 -1
- package/dist/icons.js +1 -1
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/content.iife.js +1 -0
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/glass.iife.js +1 -0
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/mermaid.iife.js +3535 -0
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +1 -1
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/{image-B7MBI5n_.js → image-ILZNlaGc.js} +4 -4
- package/dist/image.js +1 -1
- package/dist/index.cjs +38 -37
- package/dist/index.d.ts +8 -0
- package/dist/index.iife.js +3623 -88
- package/dist/index.js +88 -84
- package/dist/info-DKCQHKI2-DNOtUIin.cjs +1 -0
- package/dist/info-DKCQHKI2-Df7h9MSE.js +5 -0
- package/dist/infoDiagram-FWYZ7A6U-C8dZc-Ki.cjs +2 -0
- package/dist/infoDiagram-FWYZ7A6U-Dc0m9qAx.js +21 -0
- package/dist/init-1VpIn1S3.js +16 -0
- package/dist/init-CbDwVtpO.cjs +1 -0
- package/dist/{input-RNqdEHPf.js → input-CDH6zY9I.js} +6 -6
- package/dist/input.js +1 -1
- package/dist/ishikawaDiagram-FXEZZL3T-BugNyysB.cjs +70 -0
- package/dist/ishikawaDiagram-FXEZZL3T-DuFtHOmf.js +742 -0
- package/dist/journeyDiagram-5HDEW3XC-Bshelnhq.js +928 -0
- package/dist/journeyDiagram-5HDEW3XC-ItmURvA2.cjs +139 -0
- package/dist/kanban-definition-HUTT4EX6-BL512R2A.cjs +89 -0
- package/dist/kanban-definition-HUTT4EX6-Dogv2paU.js +1050 -0
- package/dist/katex-Cq3Y8cmK.cjs +257 -0
- package/dist/katex-Pg2EqTH0.js +23485 -0
- package/dist/line-BIPmUVxO.js +33 -0
- package/dist/line-CAB5QHC6.cjs +1 -0
- package/dist/linear-B2AM4ZBe.js +259 -0
- package/dist/linear-CSAfNEpl.cjs +1 -0
- package/dist/{link-DURZzd7u.js → link-BCrmHvXP.js} +3 -3
- package/dist/link.js +1 -1
- package/dist/{loading-B9MFI03l.js → loading-DJWGih1g.js} +4 -4
- package/dist/loading.js +1 -1
- package/dist/map-BC2bk_rV.cjs +1 -0
- package/dist/map-DMSWkcq6.js +208 -0
- package/dist/{math-CudIwEXZ.js → math-DRmkEDSQ.js} +4 -4
- package/dist/math.js +1 -1
- package/dist/mermaid-CMhm7npE.js +261 -0
- package/dist/mermaid-parser.core-DYumW1vq.cjs +6 -0
- package/dist/mermaid-parser.core-uIDZYuBu.js +654 -0
- package/dist/mermaid.core-B2d5lQW2.js +1085 -0
- package/dist/mermaid.core-a1hgpWfs.cjs +10 -0
- package/dist/mermaid.js +5 -0
- package/dist/{message-DW7qWpEm.js → message-BpYJBvYn.js} +6 -6
- package/dist/message.js +1 -1
- package/dist/mindmap-definition-LN4V7U3C-DYZgIZym.cjs +96 -0
- package/dist/mindmap-definition-LN4V7U3C-f7s5ZePP.js +1070 -0
- package/dist/{modal-CrvGKL2B.js → modal-BeQlDYDP.js} +40 -24
- package/dist/modal.js +1 -1
- package/dist/ordinal-BMN81JG2.js +64 -0
- package/dist/ordinal-BplLHIij.cjs +1 -0
- package/dist/packet-7NZHBO7P-4PLslLZJ.js +5 -0
- package/dist/packet-7NZHBO7P-DeyLCrSn.cjs +1 -0
- package/dist/path-Bja5PoYn.js +82 -0
- package/dist/path-DmfWsuKi.cjs +1 -0
- package/dist/pegDiagram-2B236MQR-B-Xeh55J.js +107 -0
- package/dist/pegDiagram-2B236MQR-Bo5Nj40u.cjs +1 -0
- package/dist/pie-RZYD4A2V-DBE9a8Kz.js +5 -0
- package/dist/pie-RZYD4A2V-pDNZ2ZyB.cjs +1 -0
- package/dist/pieDiagram-ENE6RG2P-BkSiP4iu.cjs +39 -0
- package/dist/pieDiagram-ENE6RG2P-CVSE95zc.js +207 -0
- package/dist/{player-BKQaaT7o.js → player-CQ4e3Yeo.js} +196 -195
- package/dist/player.js +1 -1
- package/dist/{popover-CvYIVgUS.js → popover-eZMnL1F3.js} +22 -54
- package/dist/popover.js +1 -1
- package/dist/{progress-C6jctsFH.js → progress-DyHgW4Ep.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/quadrantDiagram-ABIIQ3AL-BDmdDGsh.cjs +7 -0
- package/dist/quadrantDiagram-ABIIQ3AL-TJ8FmqES.js +2058 -0
- package/dist/{radar-BUb4EzmG.js → radar-D21Rccap.js} +5 -5
- package/dist/radar-I7S5WNFK-CY5ycn2a.cjs +1 -0
- package/dist/radar-I7S5WNFK-DFTxtd_t.js +5 -0
- package/dist/radar.js +1 -1
- package/dist/railroad-3IZDKUUU-DALJwv16.js +5 -0
- package/dist/railroad-3IZDKUUU-DGzXHqt7.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-BCIHdSw6.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-CntW2udQ.js +5 -0
- package/dist/railroad-ebnf-EBAXGLYW-4vFZrfHF.cjs +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-s_1ZOb_9.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-CaM5A0Ml.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-D_oFW1Bo.cjs +1 -0
- package/dist/railroadDiagram-RFXS5EU6-0lS5wYI7.js +83 -0
- package/dist/railroadDiagram-RFXS5EU6-DJKAtnQk.cjs +1 -0
- package/dist/ranui.css +1 -1
- package/dist/requirementDiagram-TGXJPOKE-Bg701bNl.cjs +84 -0
- package/dist/requirementDiagram-TGXJPOKE-viCQLyJd.js +2301 -0
- package/dist/rolldown-runtime-9ZSF5uba.js +16 -0
- package/dist/rolldown-runtime-CAnuVJ4g.cjs +1 -0
- package/dist/rough.esm-BWe9E0Nz.js +1387 -0
- package/dist/rough.esm-BfSi6CZE.cjs +1 -0
- package/dist/{route-Djrf9UR_.js → route-pR5P4ann.js} +10 -10
- package/dist/route.js +1 -1
- package/dist/{router-BU2KhtxV.js → router-CewzSH7O.js} +5 -5
- package/dist/router.js +1 -1
- package/dist/sankeyDiagram-HTMAVEWB-CV6_AuMF.js +974 -0
- package/dist/sankeyDiagram-HTMAVEWB-K-nGMsuS.cjs +40 -0
- package/dist/{scratch-CO4I2dIa.js → scratch-BFVsgl-7.js} +2 -2
- package/dist/scratch.js +1 -1
- package/dist/{section-CsUkp8bv.js → section-DSPCsIxv.js} +2 -2
- package/dist/section.js +1 -1
- package/dist/{select-Dn26ajJZ.js → select-B58nMfB1.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/sequenceDiagram-DBY2YBRQ-4GdkLnUr.cjs +162 -0
- package/dist/sequenceDiagram-DBY2YBRQ-B9WNesh2.js +4326 -0
- package/dist/sizeCapture-X5ZJPWSS-BUY3-n09.cjs +1 -0
- package/dist/sizeCapture-X5ZJPWSS-D7rGsqTl.js +48 -0
- package/dist/{skeleton-BuMLhvzQ.js → skeleton-DoHYMsTn.js} +5 -5
- package/dist/skeleton.js +1 -1
- package/dist/src-C9EhKhbk.cjs +1 -0
- package/dist/src-DtRLxcYO.js +2104 -0
- package/dist/stateDiagram-2N3HPSRC-B7VpgjJu.cjs +1 -0
- package/dist/stateDiagram-2N3HPSRC-DxH4BMSh.js +237 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CQv7GIaO.cjs +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CWfn6e7n.js +30 -0
- package/dist/swimlanes-5IMT3BWC-DcADNGpg.js +5258 -0
- package/dist/swimlanes-5IMT3BWC-o-MjdPlw.cjs +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-D-rmAGky.cjs +8 -0
- package/dist/swimlanesDiagram-G3AALYLV-DDtDtl1L.js +31 -0
- package/dist/{tab-40fDkuox.js → tab-BRPdZ9Ws.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-F4Pd7JtC.js → tabpane-Owf72hw_.js} +5 -5
- package/dist/tabpane.js +1 -1
- package/dist/{theme-switch-B09egc6h.js → theme-switch-CZDIIonc.js} +4 -4
- package/dist/theme-switch.js +1 -1
- package/dist/timeline-definition-FHXFAJF6-C80VjPLh.js +1119 -0
- package/dist/timeline-definition-FHXFAJF6-DOwvOb3S.cjs +120 -0
- package/dist/treeView-QDETBFTQ-B1Ejxfpg.cjs +1 -0
- package/dist/treeView-QDETBFTQ-vTKOZls1.js +5 -0
- package/dist/treemap-6X3UGDF4-D0FeO_NX.cjs +1 -0
- package/dist/treemap-6X3UGDF4-Ddzv6Gqd.js +5 -0
- package/dist/utils/builder/core.d.ts +133 -3
- package/dist/utils/builder/index.d.ts +1 -1
- package/dist/{utils-DBfrRFoE.js → utils-D1iZnChu.js} +38 -31
- package/dist/vennDiagram-L72KCM5P-BYHB7OW8.js +1955 -0
- package/dist/vennDiagram-L72KCM5P-CidVJK6y.cjs +34 -0
- package/dist/wardley-OPB4EBWU-C1hXbbD4.cjs +1 -0
- package/dist/wardley-OPB4EBWU-DBgFLc64.js +5 -0
- package/dist/wardleyDiagram-EHGQE667--ubmCaWM.js +652 -0
- package/dist/wardleyDiagram-EHGQE667-K6ckkRZS.cjs +78 -0
- package/dist/xychartDiagram-FW5EYKEG-CzdokxrM.cjs +7 -0
- package/dist/xychartDiagram-FW5EYKEG-DLqWcTPt.js +2154 -0
- package/docs/BUILDER.md +155 -2
- package/package.json +7 -1
- package/dist/button-BfYw0fes.js +0 -117
- package/dist/factory-DCrO37si.js +0 -334
|
@@ -0,0 +1,2353 @@
|
|
|
1
|
+
import { n as st, t as $ } from "./rolldown-runtime-9ZSF5uba.js";
|
|
2
|
+
import { n as B } from "./chunk-Y2CYZVJY-0JxdZxki.js";
|
|
3
|
+
import { m as k, p as ot } from "./src-DtRLxcYO.js";
|
|
4
|
+
import { t as K } from "./cytoscape.esm-CFq1_DTa.js";
|
|
5
|
+
var Q = /* @__PURE__ */ $(((w, _) => {
|
|
6
|
+
(function(O, y) {
|
|
7
|
+
typeof w == "object" && typeof _ == "object" ? _.exports = y() : typeof define == "function" && define.amd ? define([], y) : typeof w == "object" ? w.layoutBase = y() : O.layoutBase = y();
|
|
8
|
+
})(w, function() {
|
|
9
|
+
return (function(N) {
|
|
10
|
+
var O = {};
|
|
11
|
+
function y(n) {
|
|
12
|
+
if (O[n]) return O[n].exports;
|
|
13
|
+
var e = O[n] = {
|
|
14
|
+
i: n,
|
|
15
|
+
l: !1,
|
|
16
|
+
exports: {}
|
|
17
|
+
};
|
|
18
|
+
return N[n].call(e.exports, e, e.exports, y), e.l = !0, e.exports;
|
|
19
|
+
}
|
|
20
|
+
return y.m = N, y.c = O, y.i = function(n) {
|
|
21
|
+
return n;
|
|
22
|
+
}, y.d = function(n, e, t) {
|
|
23
|
+
y.o(n, e) || Object.defineProperty(n, e, {
|
|
24
|
+
configurable: !1,
|
|
25
|
+
enumerable: !0,
|
|
26
|
+
get: t
|
|
27
|
+
});
|
|
28
|
+
}, y.n = function(n) {
|
|
29
|
+
var e = n && n.__esModule ? function() {
|
|
30
|
+
return n.default;
|
|
31
|
+
} : function() {
|
|
32
|
+
return n;
|
|
33
|
+
};
|
|
34
|
+
return y.d(e, "a", e), e;
|
|
35
|
+
}, y.o = function(n, e) {
|
|
36
|
+
return Object.prototype.hasOwnProperty.call(n, e);
|
|
37
|
+
}, y.p = "", y(y.s = 26);
|
|
38
|
+
})([
|
|
39
|
+
(function(N, O, y) {
|
|
40
|
+
"use strict";
|
|
41
|
+
function n() {
|
|
42
|
+
}
|
|
43
|
+
n.QUALITY = 1, n.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, n.DEFAULT_INCREMENTAL = !1, n.DEFAULT_ANIMATION_ON_LAYOUT = !0, n.DEFAULT_ANIMATION_DURING_LAYOUT = !1, n.DEFAULT_ANIMATION_PERIOD = 50, n.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, n.DEFAULT_GRAPH_MARGIN = 15, n.NODE_DIMENSIONS_INCLUDE_LABELS = !1, n.SIMPLE_NODE_SIZE = 40, n.SIMPLE_NODE_HALF_SIZE = n.SIMPLE_NODE_SIZE / 2, n.EMPTY_COMPOUND_NODE_SIZE = 40, n.MIN_EDGE_LENGTH = 1, n.WORLD_BOUNDARY = 1e6, n.INITIAL_WORLD_BOUNDARY = n.WORLD_BOUNDARY / 1e3, n.WORLD_CENTER_X = 1200, n.WORLD_CENTER_Y = 900, N.exports = n;
|
|
44
|
+
}),
|
|
45
|
+
(function(N, O, y) {
|
|
46
|
+
"use strict";
|
|
47
|
+
var n = y(2), e = y(8), t = y(9);
|
|
48
|
+
function r(o, i, v) {
|
|
49
|
+
n.call(this, v), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = v, this.bendpoints = [], this.source = o, this.target = i;
|
|
50
|
+
}
|
|
51
|
+
r.prototype = Object.create(n.prototype);
|
|
52
|
+
for (var a in n) r[a] = n[a];
|
|
53
|
+
r.prototype.getSource = function() {
|
|
54
|
+
return this.source;
|
|
55
|
+
}, r.prototype.getTarget = function() {
|
|
56
|
+
return this.target;
|
|
57
|
+
}, r.prototype.isInterGraph = function() {
|
|
58
|
+
return this.isInterGraph;
|
|
59
|
+
}, r.prototype.getLength = function() {
|
|
60
|
+
return this.length;
|
|
61
|
+
}, r.prototype.isOverlapingSourceAndTarget = function() {
|
|
62
|
+
return this.isOverlapingSourceAndTarget;
|
|
63
|
+
}, r.prototype.getBendpoints = function() {
|
|
64
|
+
return this.bendpoints;
|
|
65
|
+
}, r.prototype.getLca = function() {
|
|
66
|
+
return this.lca;
|
|
67
|
+
}, r.prototype.getSourceInLca = function() {
|
|
68
|
+
return this.sourceInLca;
|
|
69
|
+
}, r.prototype.getTargetInLca = function() {
|
|
70
|
+
return this.targetInLca;
|
|
71
|
+
}, r.prototype.getOtherEnd = function(o) {
|
|
72
|
+
if (this.source === o) return this.target;
|
|
73
|
+
if (this.target === o) return this.source;
|
|
74
|
+
throw "Node is not incident with this edge";
|
|
75
|
+
}, r.prototype.getOtherEndInGraph = function(o, i) {
|
|
76
|
+
for (var v = this.getOtherEnd(o), s = i.getGraphManager().getRoot(); ; ) {
|
|
77
|
+
if (v.getOwner() == i) return v;
|
|
78
|
+
if (v.getOwner() == s) break;
|
|
79
|
+
v = v.getOwner().getParent();
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}, r.prototype.updateLength = function() {
|
|
83
|
+
var o = new Array(4);
|
|
84
|
+
this.isOverlapingSourceAndTarget = e.getIntersection(this.target.getRect(), this.source.getRect(), o), this.isOverlapingSourceAndTarget || (this.lengthX = o[0] - o[2], this.lengthY = o[1] - o[3], Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
|
|
85
|
+
}, r.prototype.updateLengthSimple = function() {
|
|
86
|
+
this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
|
|
87
|
+
}, N.exports = r;
|
|
88
|
+
}),
|
|
89
|
+
(function(N, O, y) {
|
|
90
|
+
"use strict";
|
|
91
|
+
function n(e) {
|
|
92
|
+
this.vGraphObject = e;
|
|
93
|
+
}
|
|
94
|
+
N.exports = n;
|
|
95
|
+
}),
|
|
96
|
+
(function(N, O, y) {
|
|
97
|
+
"use strict";
|
|
98
|
+
var n = y(2), e = y(10), t = y(13), r = y(0), a = y(16), o = y(4);
|
|
99
|
+
function i(s, l, g, p) {
|
|
100
|
+
g == null && p == null && (p = l), n.call(this, p), s.graphManager != null && (s = s.graphManager), this.estimatedSize = e.MIN_VALUE, this.inclusionTreeDepth = e.MAX_VALUE, this.vGraphObject = p, this.edges = [], this.graphManager = s, g != null && l != null ? this.rect = new t(l.x, l.y, g.width, g.height) : this.rect = new t();
|
|
101
|
+
}
|
|
102
|
+
i.prototype = Object.create(n.prototype);
|
|
103
|
+
for (var v in n) i[v] = n[v];
|
|
104
|
+
i.prototype.getEdges = function() {
|
|
105
|
+
return this.edges;
|
|
106
|
+
}, i.prototype.getChild = function() {
|
|
107
|
+
return this.child;
|
|
108
|
+
}, i.prototype.getOwner = function() {
|
|
109
|
+
return this.owner;
|
|
110
|
+
}, i.prototype.getWidth = function() {
|
|
111
|
+
return this.rect.width;
|
|
112
|
+
}, i.prototype.setWidth = function(s) {
|
|
113
|
+
this.rect.width = s;
|
|
114
|
+
}, i.prototype.getHeight = function() {
|
|
115
|
+
return this.rect.height;
|
|
116
|
+
}, i.prototype.setHeight = function(s) {
|
|
117
|
+
this.rect.height = s;
|
|
118
|
+
}, i.prototype.getCenterX = function() {
|
|
119
|
+
return this.rect.x + this.rect.width / 2;
|
|
120
|
+
}, i.prototype.getCenterY = function() {
|
|
121
|
+
return this.rect.y + this.rect.height / 2;
|
|
122
|
+
}, i.prototype.getCenter = function() {
|
|
123
|
+
return new o(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
|
|
124
|
+
}, i.prototype.getLocation = function() {
|
|
125
|
+
return new o(this.rect.x, this.rect.y);
|
|
126
|
+
}, i.prototype.getRect = function() {
|
|
127
|
+
return this.rect;
|
|
128
|
+
}, i.prototype.getDiagonal = function() {
|
|
129
|
+
return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
|
|
130
|
+
}, i.prototype.getHalfTheDiagonal = function() {
|
|
131
|
+
return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
|
|
132
|
+
}, i.prototype.setRect = function(s, l) {
|
|
133
|
+
this.rect.x = s.x, this.rect.y = s.y, this.rect.width = l.width, this.rect.height = l.height;
|
|
134
|
+
}, i.prototype.setCenter = function(s, l) {
|
|
135
|
+
this.rect.x = s - this.rect.width / 2, this.rect.y = l - this.rect.height / 2;
|
|
136
|
+
}, i.prototype.setLocation = function(s, l) {
|
|
137
|
+
this.rect.x = s, this.rect.y = l;
|
|
138
|
+
}, i.prototype.moveBy = function(s, l) {
|
|
139
|
+
this.rect.x += s, this.rect.y += l;
|
|
140
|
+
}, i.prototype.getEdgeListToNode = function(s) {
|
|
141
|
+
var l = [], g = this;
|
|
142
|
+
return g.edges.forEach(function(p) {
|
|
143
|
+
if (p.target == s) {
|
|
144
|
+
if (p.source != g) throw "Incorrect edge source!";
|
|
145
|
+
l.push(p);
|
|
146
|
+
}
|
|
147
|
+
}), l;
|
|
148
|
+
}, i.prototype.getEdgesBetween = function(s) {
|
|
149
|
+
var l = [], g = this;
|
|
150
|
+
return g.edges.forEach(function(p) {
|
|
151
|
+
if (!(p.source == g || p.target == g)) throw "Incorrect edge source and/or target";
|
|
152
|
+
(p.target == s || p.source == s) && l.push(p);
|
|
153
|
+
}), l;
|
|
154
|
+
}, i.prototype.getNeighborsList = function() {
|
|
155
|
+
var s = /* @__PURE__ */ new Set(), l = this;
|
|
156
|
+
return l.edges.forEach(function(g) {
|
|
157
|
+
if (g.source == l) s.add(g.target);
|
|
158
|
+
else {
|
|
159
|
+
if (g.target != l) throw "Incorrect incidency!";
|
|
160
|
+
s.add(g.source);
|
|
161
|
+
}
|
|
162
|
+
}), s;
|
|
163
|
+
}, i.prototype.withChildren = function() {
|
|
164
|
+
var s = /* @__PURE__ */ new Set(), l, g;
|
|
165
|
+
if (s.add(this), this.child != null)
|
|
166
|
+
for (var p = this.child.getNodes(), E = 0; E < p.length; E++)
|
|
167
|
+
l = p[E], g = l.withChildren(), g.forEach(function(d) {
|
|
168
|
+
s.add(d);
|
|
169
|
+
});
|
|
170
|
+
return s;
|
|
171
|
+
}, i.prototype.getNoOfChildren = function() {
|
|
172
|
+
var s = 0, l;
|
|
173
|
+
if (this.child == null) s = 1;
|
|
174
|
+
else
|
|
175
|
+
for (var g = this.child.getNodes(), p = 0; p < g.length; p++)
|
|
176
|
+
l = g[p], s += l.getNoOfChildren();
|
|
177
|
+
return s == 0 && (s = 1), s;
|
|
178
|
+
}, i.prototype.getEstimatedSize = function() {
|
|
179
|
+
if (this.estimatedSize == e.MIN_VALUE) throw "assert failed";
|
|
180
|
+
return this.estimatedSize;
|
|
181
|
+
}, i.prototype.calcEstimatedSize = function() {
|
|
182
|
+
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);
|
|
183
|
+
}, i.prototype.scatter = function() {
|
|
184
|
+
var s, l, g = -r.INITIAL_WORLD_BOUNDARY, p = r.INITIAL_WORLD_BOUNDARY;
|
|
185
|
+
s = r.WORLD_CENTER_X + a.nextDouble() * (p - g) + g;
|
|
186
|
+
var E = -r.INITIAL_WORLD_BOUNDARY, d = r.INITIAL_WORLD_BOUNDARY;
|
|
187
|
+
l = r.WORLD_CENTER_Y + a.nextDouble() * (d - E) + E, this.rect.x = s, this.rect.y = l;
|
|
188
|
+
}, i.prototype.updateBounds = function() {
|
|
189
|
+
if (this.getChild() == null) throw "assert failed";
|
|
190
|
+
if (this.getChild().getNodes().length != 0) {
|
|
191
|
+
var s = this.getChild();
|
|
192
|
+
if (s.updateBounds(!0), this.rect.x = s.getLeft(), this.rect.y = s.getTop(), this.setWidth(s.getRight() - s.getLeft()), this.setHeight(s.getBottom() - s.getTop()), r.NODE_DIMENSIONS_INCLUDE_LABELS) {
|
|
193
|
+
var l = s.getRight() - s.getLeft(), g = s.getBottom() - s.getTop();
|
|
194
|
+
this.labelWidth > l && (this.rect.x -= (this.labelWidth - l) / 2, this.setWidth(this.labelWidth)), this.labelHeight > g && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - g) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - g), this.setHeight(this.labelHeight));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}, i.prototype.getInclusionTreeDepth = function() {
|
|
198
|
+
if (this.inclusionTreeDepth == e.MAX_VALUE) throw "assert failed";
|
|
199
|
+
return this.inclusionTreeDepth;
|
|
200
|
+
}, i.prototype.transform = function(s) {
|
|
201
|
+
var l = this.rect.x;
|
|
202
|
+
l > r.WORLD_BOUNDARY ? l = r.WORLD_BOUNDARY : l < -r.WORLD_BOUNDARY && (l = -r.WORLD_BOUNDARY);
|
|
203
|
+
var g = this.rect.y;
|
|
204
|
+
g > r.WORLD_BOUNDARY ? g = r.WORLD_BOUNDARY : g < -r.WORLD_BOUNDARY && (g = -r.WORLD_BOUNDARY);
|
|
205
|
+
var p = new o(l, g), E = s.inverseTransformPoint(p);
|
|
206
|
+
this.setLocation(E.x, E.y);
|
|
207
|
+
}, i.prototype.getLeft = function() {
|
|
208
|
+
return this.rect.x;
|
|
209
|
+
}, i.prototype.getRight = function() {
|
|
210
|
+
return this.rect.x + this.rect.width;
|
|
211
|
+
}, i.prototype.getTop = function() {
|
|
212
|
+
return this.rect.y;
|
|
213
|
+
}, i.prototype.getBottom = function() {
|
|
214
|
+
return this.rect.y + this.rect.height;
|
|
215
|
+
}, i.prototype.getParent = function() {
|
|
216
|
+
return this.owner == null ? null : this.owner.getParent();
|
|
217
|
+
}, N.exports = i;
|
|
218
|
+
}),
|
|
219
|
+
(function(N, O, y) {
|
|
220
|
+
"use strict";
|
|
221
|
+
function n(e, t) {
|
|
222
|
+
e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
|
|
223
|
+
}
|
|
224
|
+
n.prototype.getX = function() {
|
|
225
|
+
return this.x;
|
|
226
|
+
}, n.prototype.getY = function() {
|
|
227
|
+
return this.y;
|
|
228
|
+
}, n.prototype.setX = function(e) {
|
|
229
|
+
this.x = e;
|
|
230
|
+
}, n.prototype.setY = function(e) {
|
|
231
|
+
this.y = e;
|
|
232
|
+
}, n.prototype.getDifference = function(e) {
|
|
233
|
+
return new DimensionD(this.x - e.x, this.y - e.y);
|
|
234
|
+
}, n.prototype.getCopy = function() {
|
|
235
|
+
return new n(this.x, this.y);
|
|
236
|
+
}, n.prototype.translate = function(e) {
|
|
237
|
+
return this.x += e.width, this.y += e.height, this;
|
|
238
|
+
}, N.exports = n;
|
|
239
|
+
}),
|
|
240
|
+
(function(N, O, y) {
|
|
241
|
+
"use strict";
|
|
242
|
+
var n = y(2), e = y(10), t = y(0), r = y(6), a = y(3), o = y(1), i = y(13), v = y(12), s = y(11);
|
|
243
|
+
function l(p, E, d) {
|
|
244
|
+
n.call(this, d), this.estimatedSize = e.MIN_VALUE, this.margin = t.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = p, E != null && E instanceof r ? this.graphManager = E : E != null && E instanceof Layout && (this.graphManager = E.graphManager);
|
|
245
|
+
}
|
|
246
|
+
l.prototype = Object.create(n.prototype);
|
|
247
|
+
for (var g in n) l[g] = n[g];
|
|
248
|
+
l.prototype.getNodes = function() {
|
|
249
|
+
return this.nodes;
|
|
250
|
+
}, l.prototype.getEdges = function() {
|
|
251
|
+
return this.edges;
|
|
252
|
+
}, l.prototype.getGraphManager = function() {
|
|
253
|
+
return this.graphManager;
|
|
254
|
+
}, l.prototype.getParent = function() {
|
|
255
|
+
return this.parent;
|
|
256
|
+
}, l.prototype.getLeft = function() {
|
|
257
|
+
return this.left;
|
|
258
|
+
}, l.prototype.getRight = function() {
|
|
259
|
+
return this.right;
|
|
260
|
+
}, l.prototype.getTop = function() {
|
|
261
|
+
return this.top;
|
|
262
|
+
}, l.prototype.getBottom = function() {
|
|
263
|
+
return this.bottom;
|
|
264
|
+
}, l.prototype.isConnected = function() {
|
|
265
|
+
return this.isConnected;
|
|
266
|
+
}, l.prototype.add = function(p, E, d) {
|
|
267
|
+
if (E == null && d == null) {
|
|
268
|
+
var u = p;
|
|
269
|
+
if (this.graphManager == null) throw "Graph has no graph mgr!";
|
|
270
|
+
if (this.getNodes().indexOf(u) > -1) throw "Node already in graph!";
|
|
271
|
+
return u.owner = this, this.getNodes().push(u), u;
|
|
272
|
+
} else {
|
|
273
|
+
var D = p;
|
|
274
|
+
if (!(this.getNodes().indexOf(E) > -1 && this.getNodes().indexOf(d) > -1)) throw "Source or target not in graph!";
|
|
275
|
+
if (!(E.owner == d.owner && E.owner == this)) throw "Both owners must be this graph!";
|
|
276
|
+
return E.owner != d.owner ? null : (D.source = E, D.target = d, D.isInterGraph = !1, this.getEdges().push(D), E.edges.push(D), d != E && d.edges.push(D), D);
|
|
277
|
+
}
|
|
278
|
+
}, l.prototype.remove = function(p) {
|
|
279
|
+
var E = p;
|
|
280
|
+
if (p instanceof a) {
|
|
281
|
+
if (E == null) throw "Node is null!";
|
|
282
|
+
if (!(E.owner != null && E.owner == this)) throw "Owner graph is invalid!";
|
|
283
|
+
if (this.graphManager == null) throw "Owner graph manager is invalid!";
|
|
284
|
+
for (var d = E.edges.slice(), u, D = d.length, L = 0; L < D; L++)
|
|
285
|
+
u = d[L], u.isInterGraph ? this.graphManager.remove(u) : u.source.owner.remove(u);
|
|
286
|
+
var I = this.nodes.indexOf(E);
|
|
287
|
+
if (I == -1) throw "Node not in owner node list!";
|
|
288
|
+
this.nodes.splice(I, 1);
|
|
289
|
+
} else if (p instanceof o) {
|
|
290
|
+
var u = p;
|
|
291
|
+
if (u == null) throw "Edge is null!";
|
|
292
|
+
if (!(u.source != null && u.target != null)) throw "Source and/or target is null!";
|
|
293
|
+
if (!(u.source.owner != null && u.target.owner != null && u.source.owner == this && u.target.owner == this)) throw "Source and/or target owner is invalid!";
|
|
294
|
+
var h = u.source.edges.indexOf(u), c = u.target.edges.indexOf(u);
|
|
295
|
+
if (!(h > -1 && c > -1)) throw "Source and/or target doesn't know this edge!";
|
|
296
|
+
u.source.edges.splice(h, 1), u.target != u.source && u.target.edges.splice(c, 1);
|
|
297
|
+
var I = u.source.owner.getEdges().indexOf(u);
|
|
298
|
+
if (I == -1) throw "Not in owner's edge list!";
|
|
299
|
+
u.source.owner.getEdges().splice(I, 1);
|
|
300
|
+
}
|
|
301
|
+
}, l.prototype.updateLeftTop = function() {
|
|
302
|
+
for (var p = e.MAX_VALUE, E = e.MAX_VALUE, d, u, D, L = this.getNodes(), I = L.length, h = 0; h < I; h++) {
|
|
303
|
+
var c = L[h];
|
|
304
|
+
d = c.getTop(), u = c.getLeft(), p > d && (p = d), E > u && (E = u);
|
|
305
|
+
}
|
|
306
|
+
return p == e.MAX_VALUE ? null : (L[0].getParent().paddingLeft != null ? D = L[0].getParent().paddingLeft : D = this.margin, this.left = E - D, this.top = p - D, new v(this.left, this.top));
|
|
307
|
+
}, l.prototype.updateBounds = function(p) {
|
|
308
|
+
for (var E = e.MAX_VALUE, d = -e.MAX_VALUE, u = e.MAX_VALUE, D = -e.MAX_VALUE, L, I, h, c, f, T = this.nodes, A = T.length, M = 0; M < A; M++) {
|
|
309
|
+
var m = T[M];
|
|
310
|
+
p && m.child != null && m.updateBounds(), L = m.getLeft(), I = m.getRight(), h = m.getTop(), c = m.getBottom(), E > L && (E = L), d < I && (d = I), u > h && (u = h), D < c && (D = c);
|
|
311
|
+
}
|
|
312
|
+
var R = new i(E, u, d - E, D - u);
|
|
313
|
+
E == e.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), T[0].getParent().paddingLeft != null ? f = T[0].getParent().paddingLeft : f = this.margin, this.left = R.x - f, this.right = R.x + R.width + f, this.top = R.y - f, this.bottom = R.y + R.height + f;
|
|
314
|
+
}, l.calculateBounds = function(p) {
|
|
315
|
+
for (var E = e.MAX_VALUE, d = -e.MAX_VALUE, u = e.MAX_VALUE, D = -e.MAX_VALUE, L, I, h, c, f = p.length, T = 0; T < f; T++) {
|
|
316
|
+
var A = p[T];
|
|
317
|
+
L = A.getLeft(), I = A.getRight(), h = A.getTop(), c = A.getBottom(), E > L && (E = L), d < I && (d = I), u > h && (u = h), D < c && (D = c);
|
|
318
|
+
}
|
|
319
|
+
return new i(E, u, d - E, D - u);
|
|
320
|
+
}, l.prototype.getInclusionTreeDepth = function() {
|
|
321
|
+
return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
|
|
322
|
+
}, l.prototype.getEstimatedSize = function() {
|
|
323
|
+
if (this.estimatedSize == e.MIN_VALUE) throw "assert failed";
|
|
324
|
+
return this.estimatedSize;
|
|
325
|
+
}, l.prototype.calcEstimatedSize = function() {
|
|
326
|
+
for (var p = 0, E = this.nodes, d = E.length, u = 0; u < d; u++) {
|
|
327
|
+
var D = E[u];
|
|
328
|
+
p += D.calcEstimatedSize();
|
|
329
|
+
}
|
|
330
|
+
return p == 0 ? this.estimatedSize = t.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = p / Math.sqrt(this.nodes.length), this.estimatedSize;
|
|
331
|
+
}, l.prototype.updateConnected = function() {
|
|
332
|
+
var p = this;
|
|
333
|
+
if (this.nodes.length == 0) {
|
|
334
|
+
this.isConnected = !0;
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
var E = new s(), d = /* @__PURE__ */ new Set(), u = this.nodes[0], D, L;
|
|
338
|
+
for (u.withChildren().forEach(function(f) {
|
|
339
|
+
E.push(f), d.add(f);
|
|
340
|
+
}); E.length !== 0; ) {
|
|
341
|
+
u = E.shift(), D = u.getEdges();
|
|
342
|
+
for (var I = D.length, h = 0; h < I; h++)
|
|
343
|
+
L = D[h].getOtherEndInGraph(u, this), L != null && !d.has(L) && L.withChildren().forEach(function(f) {
|
|
344
|
+
E.push(f), d.add(f);
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
if (this.isConnected = !1, d.size >= this.nodes.length) {
|
|
348
|
+
var c = 0;
|
|
349
|
+
d.forEach(function(f) {
|
|
350
|
+
f.owner == p && c++;
|
|
351
|
+
}), c == this.nodes.length && (this.isConnected = !0);
|
|
352
|
+
}
|
|
353
|
+
}, N.exports = l;
|
|
354
|
+
}),
|
|
355
|
+
(function(N, O, y) {
|
|
356
|
+
"use strict";
|
|
357
|
+
var n, e = y(1);
|
|
358
|
+
function t(r) {
|
|
359
|
+
n = y(5), this.layout = r, this.graphs = [], this.edges = [];
|
|
360
|
+
}
|
|
361
|
+
t.prototype.addRoot = function() {
|
|
362
|
+
var r = this.layout.newGraph(), a = this.layout.newNode(null), o = this.add(r, a);
|
|
363
|
+
return this.setRootGraph(o), this.rootGraph;
|
|
364
|
+
}, t.prototype.add = function(r, a, o, i, v) {
|
|
365
|
+
if (o == null && i == null && v == null) {
|
|
366
|
+
if (r == null) throw "Graph is null!";
|
|
367
|
+
if (a == null) throw "Parent node is null!";
|
|
368
|
+
if (this.graphs.indexOf(r) > -1) throw "Graph already in this graph mgr!";
|
|
369
|
+
if (this.graphs.push(r), r.parent != null) throw "Already has a parent!";
|
|
370
|
+
if (a.child != null) throw "Already has a child!";
|
|
371
|
+
return r.parent = a, a.child = r, r;
|
|
372
|
+
} else {
|
|
373
|
+
v = o, i = a, o = r;
|
|
374
|
+
var s = i.getOwner(), l = v.getOwner();
|
|
375
|
+
if (!(s != null && s.getGraphManager() == this)) throw "Source not in this graph mgr!";
|
|
376
|
+
if (!(l != null && l.getGraphManager() == this)) throw "Target not in this graph mgr!";
|
|
377
|
+
if (s == l)
|
|
378
|
+
return o.isInterGraph = !1, s.add(o, i, v);
|
|
379
|
+
if (o.isInterGraph = !0, o.source = i, o.target = v, this.edges.indexOf(o) > -1) throw "Edge already in inter-graph edge list!";
|
|
380
|
+
if (this.edges.push(o), !(o.source != null && o.target != null)) throw "Edge source and/or target is null!";
|
|
381
|
+
if (!(o.source.edges.indexOf(o) == -1 && o.target.edges.indexOf(o) == -1)) throw "Edge already in source and/or target incidency list!";
|
|
382
|
+
return o.source.edges.push(o), o.target.edges.push(o), o;
|
|
383
|
+
}
|
|
384
|
+
}, t.prototype.remove = function(r) {
|
|
385
|
+
if (r instanceof n) {
|
|
386
|
+
var a = r;
|
|
387
|
+
if (a.getGraphManager() != this) throw "Graph not in this graph mgr";
|
|
388
|
+
if (!(a == this.rootGraph || a.parent != null && a.parent.graphManager == this)) throw "Invalid parent node!";
|
|
389
|
+
var o = [];
|
|
390
|
+
o = o.concat(a.getEdges());
|
|
391
|
+
for (var i, v = o.length, s = 0; s < v; s++)
|
|
392
|
+
i = o[s], a.remove(i);
|
|
393
|
+
var l = [];
|
|
394
|
+
l = l.concat(a.getNodes());
|
|
395
|
+
var g;
|
|
396
|
+
v = l.length;
|
|
397
|
+
for (var s = 0; s < v; s++)
|
|
398
|
+
g = l[s], a.remove(g);
|
|
399
|
+
a == this.rootGraph && this.setRootGraph(null);
|
|
400
|
+
var p = this.graphs.indexOf(a);
|
|
401
|
+
this.graphs.splice(p, 1), a.parent = null;
|
|
402
|
+
} else if (r instanceof e) {
|
|
403
|
+
if (i = r, i == null) throw "Edge is null!";
|
|
404
|
+
if (!i.isInterGraph) throw "Not an inter-graph edge!";
|
|
405
|
+
if (!(i.source != null && i.target != null)) throw "Source and/or target is null!";
|
|
406
|
+
if (!(i.source.edges.indexOf(i) != -1 && i.target.edges.indexOf(i) != -1)) throw "Source and/or target doesn't know this edge!";
|
|
407
|
+
var p = i.source.edges.indexOf(i);
|
|
408
|
+
if (i.source.edges.splice(p, 1), p = i.target.edges.indexOf(i), i.target.edges.splice(p, 1), !(i.source.owner != null && i.source.owner.getGraphManager() != null)) throw "Edge owner graph or owner graph manager is null!";
|
|
409
|
+
if (i.source.owner.getGraphManager().edges.indexOf(i) == -1) throw "Not in owner graph manager's edge list!";
|
|
410
|
+
var p = i.source.owner.getGraphManager().edges.indexOf(i);
|
|
411
|
+
i.source.owner.getGraphManager().edges.splice(p, 1);
|
|
412
|
+
}
|
|
413
|
+
}, t.prototype.updateBounds = function() {
|
|
414
|
+
this.rootGraph.updateBounds(!0);
|
|
415
|
+
}, t.prototype.getGraphs = function() {
|
|
416
|
+
return this.graphs;
|
|
417
|
+
}, t.prototype.getAllNodes = function() {
|
|
418
|
+
if (this.allNodes == null) {
|
|
419
|
+
for (var r = [], a = this.getGraphs(), o = a.length, i = 0; i < o; i++) r = r.concat(a[i].getNodes());
|
|
420
|
+
this.allNodes = r;
|
|
421
|
+
}
|
|
422
|
+
return this.allNodes;
|
|
423
|
+
}, t.prototype.resetAllNodes = function() {
|
|
424
|
+
this.allNodes = null;
|
|
425
|
+
}, t.prototype.resetAllEdges = function() {
|
|
426
|
+
this.allEdges = null;
|
|
427
|
+
}, t.prototype.resetAllNodesToApplyGravitation = function() {
|
|
428
|
+
this.allNodesToApplyGravitation = null;
|
|
429
|
+
}, t.prototype.getAllEdges = function() {
|
|
430
|
+
if (this.allEdges == null) {
|
|
431
|
+
var r = [], a = this.getGraphs();
|
|
432
|
+
a.length;
|
|
433
|
+
for (var o = 0; o < a.length; o++) r = r.concat(a[o].getEdges());
|
|
434
|
+
r = r.concat(this.edges), this.allEdges = r;
|
|
435
|
+
}
|
|
436
|
+
return this.allEdges;
|
|
437
|
+
}, t.prototype.getAllNodesToApplyGravitation = function() {
|
|
438
|
+
return this.allNodesToApplyGravitation;
|
|
439
|
+
}, t.prototype.setAllNodesToApplyGravitation = function(r) {
|
|
440
|
+
if (this.allNodesToApplyGravitation != null) throw "assert failed";
|
|
441
|
+
this.allNodesToApplyGravitation = r;
|
|
442
|
+
}, t.prototype.getRoot = function() {
|
|
443
|
+
return this.rootGraph;
|
|
444
|
+
}, t.prototype.setRootGraph = function(r) {
|
|
445
|
+
if (r.getGraphManager() != this) throw "Root not in this graph mgr!";
|
|
446
|
+
this.rootGraph = r, r.parent == null && (r.parent = this.layout.newNode("Root node"));
|
|
447
|
+
}, t.prototype.getLayout = function() {
|
|
448
|
+
return this.layout;
|
|
449
|
+
}, t.prototype.isOneAncestorOfOther = function(r, a) {
|
|
450
|
+
if (!(r != null && a != null)) throw "assert failed";
|
|
451
|
+
if (r == a) return !0;
|
|
452
|
+
var o = r.getOwner(), i;
|
|
453
|
+
do {
|
|
454
|
+
if (i = o.getParent(), i == null) break;
|
|
455
|
+
if (i == a) return !0;
|
|
456
|
+
if (o = i.getOwner(), o == null) break;
|
|
457
|
+
} while (!0);
|
|
458
|
+
o = a.getOwner();
|
|
459
|
+
do {
|
|
460
|
+
if (i = o.getParent(), i == null) break;
|
|
461
|
+
if (i == r) return !0;
|
|
462
|
+
if (o = i.getOwner(), o == null) break;
|
|
463
|
+
} while (!0);
|
|
464
|
+
return !1;
|
|
465
|
+
}, t.prototype.calcLowestCommonAncestors = function() {
|
|
466
|
+
for (var r, a, o, i, v, s = this.getAllEdges(), l = s.length, g = 0; g < l; g++) {
|
|
467
|
+
if (r = s[g], a = r.source, o = r.target, r.lca = null, r.sourceInLca = a, r.targetInLca = o, a == o) {
|
|
468
|
+
r.lca = a.getOwner();
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
for (i = a.getOwner(); r.lca == null; ) {
|
|
472
|
+
for (r.targetInLca = o, v = o.getOwner(); r.lca == null; ) {
|
|
473
|
+
if (v == i) {
|
|
474
|
+
r.lca = v;
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
if (v == this.rootGraph) break;
|
|
478
|
+
if (r.lca != null) throw "assert failed";
|
|
479
|
+
r.targetInLca = v.getParent(), v = r.targetInLca.getOwner();
|
|
480
|
+
}
|
|
481
|
+
if (i == this.rootGraph) break;
|
|
482
|
+
r.lca == null && (r.sourceInLca = i.getParent(), i = r.sourceInLca.getOwner());
|
|
483
|
+
}
|
|
484
|
+
if (r.lca == null) throw "assert failed";
|
|
485
|
+
}
|
|
486
|
+
}, t.prototype.calcLowestCommonAncestor = function(r, a) {
|
|
487
|
+
if (r == a) return r.getOwner();
|
|
488
|
+
var o = r.getOwner();
|
|
489
|
+
do {
|
|
490
|
+
if (o == null) break;
|
|
491
|
+
var i = a.getOwner();
|
|
492
|
+
do {
|
|
493
|
+
if (i == null) break;
|
|
494
|
+
if (i == o) return i;
|
|
495
|
+
i = i.getParent().getOwner();
|
|
496
|
+
} while (!0);
|
|
497
|
+
o = o.getParent().getOwner();
|
|
498
|
+
} while (!0);
|
|
499
|
+
return o;
|
|
500
|
+
}, t.prototype.calcInclusionTreeDepths = function(r, a) {
|
|
501
|
+
r == null && a == null && (r = this.rootGraph, a = 1);
|
|
502
|
+
for (var o, i = r.getNodes(), v = i.length, s = 0; s < v; s++)
|
|
503
|
+
o = i[s], o.inclusionTreeDepth = a, o.child != null && this.calcInclusionTreeDepths(o.child, a + 1);
|
|
504
|
+
}, t.prototype.includesInvalidEdge = function() {
|
|
505
|
+
for (var r, a = this.edges.length, o = 0; o < a; o++)
|
|
506
|
+
if (r = this.edges[o], this.isOneAncestorOfOther(r.source, r.target)) return !0;
|
|
507
|
+
return !1;
|
|
508
|
+
}, N.exports = t;
|
|
509
|
+
}),
|
|
510
|
+
(function(N, O, y) {
|
|
511
|
+
"use strict";
|
|
512
|
+
var n = y(0);
|
|
513
|
+
function e() {
|
|
514
|
+
}
|
|
515
|
+
for (var t in n) e[t] = n[t];
|
|
516
|
+
e.MAX_ITERATIONS = 2500, e.DEFAULT_EDGE_LENGTH = 50, e.DEFAULT_SPRING_STRENGTH = 0.45, e.DEFAULT_REPULSION_STRENGTH = 4500, e.DEFAULT_GRAVITY_STRENGTH = 0.4, e.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, e.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, e.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, e.COOLING_ADAPTATION_FACTOR = 0.33, e.ADAPTATION_LOWER_NODE_LIMIT = 1e3, e.ADAPTATION_UPPER_NODE_LIMIT = 5e3, e.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, e.MAX_NODE_DISPLACEMENT = e.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, e.MIN_REPULSION_DIST = e.DEFAULT_EDGE_LENGTH / 10, e.CONVERGENCE_CHECK_PERIOD = 100, e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, e.MIN_EDGE_LENGTH = 1, e.GRID_CALCULATION_CHECK_PERIOD = 10, N.exports = e;
|
|
517
|
+
}),
|
|
518
|
+
(function(N, O, y) {
|
|
519
|
+
"use strict";
|
|
520
|
+
var n = y(12);
|
|
521
|
+
function e() {
|
|
522
|
+
}
|
|
523
|
+
e.calcSeparationAmount = function(t, r, a, o) {
|
|
524
|
+
if (!t.intersects(r)) throw "assert failed";
|
|
525
|
+
var i = new Array(2);
|
|
526
|
+
this.decideDirectionsForOverlappingNodes(t, r, i), a[0] = Math.min(t.getRight(), r.getRight()) - Math.max(t.x, r.x), a[1] = Math.min(t.getBottom(), r.getBottom()) - Math.max(t.y, r.y), t.getX() <= r.getX() && t.getRight() >= r.getRight() ? a[0] += Math.min(r.getX() - t.getX(), t.getRight() - r.getRight()) : r.getX() <= t.getX() && r.getRight() >= t.getRight() && (a[0] += Math.min(t.getX() - r.getX(), r.getRight() - t.getRight())), t.getY() <= r.getY() && t.getBottom() >= r.getBottom() ? a[1] += Math.min(r.getY() - t.getY(), t.getBottom() - r.getBottom()) : r.getY() <= t.getY() && r.getBottom() >= t.getBottom() && (a[1] += Math.min(t.getY() - r.getY(), r.getBottom() - t.getBottom()));
|
|
527
|
+
var v = Math.abs((r.getCenterY() - t.getCenterY()) / (r.getCenterX() - t.getCenterX()));
|
|
528
|
+
r.getCenterY() === t.getCenterY() && r.getCenterX() === t.getCenterX() && (v = 1);
|
|
529
|
+
var s = v * a[0], l = a[1] / v;
|
|
530
|
+
a[0] < l ? l = a[0] : s = a[1], a[0] = -1 * i[0] * (l / 2 + o), a[1] = -1 * i[1] * (s / 2 + o);
|
|
531
|
+
}, e.decideDirectionsForOverlappingNodes = function(t, r, a) {
|
|
532
|
+
t.getCenterX() < r.getCenterX() ? a[0] = -1 : a[0] = 1, t.getCenterY() < r.getCenterY() ? a[1] = -1 : a[1] = 1;
|
|
533
|
+
}, e.getIntersection2 = function(t, r, a) {
|
|
534
|
+
var o = t.getCenterX(), i = t.getCenterY(), v = r.getCenterX(), s = r.getCenterY();
|
|
535
|
+
if (t.intersects(r))
|
|
536
|
+
return a[0] = o, a[1] = i, a[2] = v, a[3] = s, !0;
|
|
537
|
+
var l = t.getX(), g = t.getY(), p = t.getRight(), E = t.getX(), d = t.getBottom(), u = t.getRight(), D = t.getWidthHalf(), L = t.getHeightHalf(), I = r.getX(), h = r.getY(), c = r.getRight(), f = r.getX(), T = r.getBottom(), A = r.getRight(), M = r.getWidthHalf(), m = r.getHeightHalf(), R = !1, C = !1;
|
|
538
|
+
if (o === v) {
|
|
539
|
+
if (i > s)
|
|
540
|
+
return a[0] = o, a[1] = g, a[2] = v, a[3] = T, !1;
|
|
541
|
+
if (i < s)
|
|
542
|
+
return a[0] = o, a[1] = d, a[2] = v, a[3] = h, !1;
|
|
543
|
+
} else if (i === s) {
|
|
544
|
+
if (o > v)
|
|
545
|
+
return a[0] = l, a[1] = i, a[2] = c, a[3] = s, !1;
|
|
546
|
+
if (o < v)
|
|
547
|
+
return a[0] = p, a[1] = i, a[2] = I, a[3] = s, !1;
|
|
548
|
+
} else {
|
|
549
|
+
var x = t.height / t.width, F = r.height / r.width, G = (s - i) / (v - o), X = void 0, U = void 0, S = void 0, Y = void 0, P = void 0, b = void 0;
|
|
550
|
+
if (-x === G ? o > v ? (a[0] = E, a[1] = d, R = !0) : (a[0] = p, a[1] = g, R = !0) : x === G && (o > v ? (a[0] = l, a[1] = g, R = !0) : (a[0] = u, a[1] = d, R = !0)), -F === G ? v > o ? (a[2] = f, a[3] = T, C = !0) : (a[2] = c, a[3] = h, C = !0) : F === G && (v > o ? (a[2] = I, a[3] = h, C = !0) : (a[2] = A, a[3] = T, C = !0)), R && C) return !1;
|
|
551
|
+
if (o > v ? i > s ? (X = this.getCardinalDirection(x, G, 4), U = this.getCardinalDirection(F, G, 2)) : (X = this.getCardinalDirection(-x, G, 3), U = this.getCardinalDirection(-F, G, 1)) : i > s ? (X = this.getCardinalDirection(-x, G, 1), U = this.getCardinalDirection(-F, G, 3)) : (X = this.getCardinalDirection(x, G, 2), U = this.getCardinalDirection(F, G, 4)), !R) switch (X) {
|
|
552
|
+
case 1:
|
|
553
|
+
Y = g, S = o + -L / G, a[0] = S, a[1] = Y;
|
|
554
|
+
break;
|
|
555
|
+
case 2:
|
|
556
|
+
S = u, Y = i + D * G, a[0] = S, a[1] = Y;
|
|
557
|
+
break;
|
|
558
|
+
case 3:
|
|
559
|
+
Y = d, S = o + L / G, a[0] = S, a[1] = Y;
|
|
560
|
+
break;
|
|
561
|
+
case 4:
|
|
562
|
+
S = E, Y = i + -D * G, a[0] = S, a[1] = Y;
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
if (!C) switch (U) {
|
|
566
|
+
case 1:
|
|
567
|
+
b = h, P = v + -m / G, a[2] = P, a[3] = b;
|
|
568
|
+
break;
|
|
569
|
+
case 2:
|
|
570
|
+
P = A, b = s + M * G, a[2] = P, a[3] = b;
|
|
571
|
+
break;
|
|
572
|
+
case 3:
|
|
573
|
+
b = T, P = v + m / G, a[2] = P, a[3] = b;
|
|
574
|
+
break;
|
|
575
|
+
case 4:
|
|
576
|
+
P = f, b = s + -M * G, a[2] = P, a[3] = b;
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return !1;
|
|
581
|
+
}, e.getCardinalDirection = function(t, r, a) {
|
|
582
|
+
return t > r ? a : 1 + a % 4;
|
|
583
|
+
}, e.getIntersection = function(t, r, a, o) {
|
|
584
|
+
if (o == null) return this.getIntersection2(t, r, a);
|
|
585
|
+
var i = t.x, v = t.y, s = r.x, l = r.y, g = a.x, p = a.y, E = o.x, d = o.y, u = void 0, D = void 0, L = void 0, I = void 0, h = void 0, c = void 0, f = void 0, T = void 0, A = void 0;
|
|
586
|
+
return L = l - v, h = i - s, f = s * v - i * l, I = d - p, c = g - E, T = E * p - g * d, A = L * c - I * h, A === 0 ? null : (u = (h * T - c * f) / A, D = (I * f - L * T) / A, new n(u, D));
|
|
587
|
+
}, e.angleOfVector = function(t, r, a, o) {
|
|
588
|
+
var i = void 0;
|
|
589
|
+
return t !== a ? (i = Math.atan((o - r) / (a - t)), a < t ? i += Math.PI : o < r && (i += this.TWO_PI)) : o < r ? i = this.ONE_AND_HALF_PI : i = this.HALF_PI, i;
|
|
590
|
+
}, e.doIntersect = function(t, r, a, o) {
|
|
591
|
+
var i = t.x, v = t.y, s = r.x, l = r.y, g = a.x, p = a.y, E = o.x, d = o.y, u = (s - i) * (d - p) - (E - g) * (l - v);
|
|
592
|
+
if (u === 0) return !1;
|
|
593
|
+
var D = ((d - p) * (E - i) + (g - E) * (d - v)) / u, L = ((v - l) * (E - i) + (s - i) * (d - v)) / u;
|
|
594
|
+
return 0 < D && D < 1 && 0 < L && L < 1;
|
|
595
|
+
}, e.HALF_PI = 0.5 * Math.PI, e.ONE_AND_HALF_PI = 1.5 * Math.PI, e.TWO_PI = 2 * Math.PI, e.THREE_PI = 3 * Math.PI, N.exports = e;
|
|
596
|
+
}),
|
|
597
|
+
(function(N, O, y) {
|
|
598
|
+
"use strict";
|
|
599
|
+
function n() {
|
|
600
|
+
}
|
|
601
|
+
n.sign = function(e) {
|
|
602
|
+
return e > 0 ? 1 : e < 0 ? -1 : 0;
|
|
603
|
+
}, n.floor = function(e) {
|
|
604
|
+
return e < 0 ? Math.ceil(e) : Math.floor(e);
|
|
605
|
+
}, n.ceil = function(e) {
|
|
606
|
+
return e < 0 ? Math.floor(e) : Math.ceil(e);
|
|
607
|
+
}, N.exports = n;
|
|
608
|
+
}),
|
|
609
|
+
(function(N, O, y) {
|
|
610
|
+
"use strict";
|
|
611
|
+
function n() {
|
|
612
|
+
}
|
|
613
|
+
n.MAX_VALUE = 2147483647, n.MIN_VALUE = -2147483648, N.exports = n;
|
|
614
|
+
}),
|
|
615
|
+
(function(N, O, y) {
|
|
616
|
+
"use strict";
|
|
617
|
+
var n = /* @__PURE__ */ (function() {
|
|
618
|
+
function o(i, v) {
|
|
619
|
+
for (var s = 0; s < v.length; s++) {
|
|
620
|
+
var l = v[s];
|
|
621
|
+
l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(i, l.key, l);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return function(i, v, s) {
|
|
625
|
+
return v && o(i.prototype, v), s && o(i, s), i;
|
|
626
|
+
};
|
|
627
|
+
})();
|
|
628
|
+
function e(o, i) {
|
|
629
|
+
if (!(o instanceof i)) throw new TypeError("Cannot call a class as a function");
|
|
630
|
+
}
|
|
631
|
+
var t = function(i) {
|
|
632
|
+
return {
|
|
633
|
+
value: i,
|
|
634
|
+
next: null,
|
|
635
|
+
prev: null
|
|
636
|
+
};
|
|
637
|
+
}, r = function(i, v, s, l) {
|
|
638
|
+
return i !== null ? i.next = v : l.head = v, s !== null ? s.prev = v : l.tail = v, v.prev = i, v.next = s, l.length++, v;
|
|
639
|
+
}, a = function(i, v) {
|
|
640
|
+
var s = i.prev, l = i.next;
|
|
641
|
+
return s !== null ? s.next = l : v.head = l, l !== null ? l.prev = s : v.tail = s, i.prev = i.next = null, v.length--, i;
|
|
642
|
+
};
|
|
643
|
+
N.exports = (function() {
|
|
644
|
+
function o(i) {
|
|
645
|
+
var v = this;
|
|
646
|
+
e(this, o), this.length = 0, this.head = null, this.tail = null, i?.forEach(function(s) {
|
|
647
|
+
return v.push(s);
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
return n(o, [
|
|
651
|
+
{
|
|
652
|
+
key: "size",
|
|
653
|
+
value: function() {
|
|
654
|
+
return this.length;
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
key: "insertBefore",
|
|
659
|
+
value: function(v, s) {
|
|
660
|
+
return r(s.prev, t(v), s, this);
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
key: "insertAfter",
|
|
665
|
+
value: function(v, s) {
|
|
666
|
+
return r(s, t(v), s.next, this);
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
key: "insertNodeBefore",
|
|
671
|
+
value: function(v, s) {
|
|
672
|
+
return r(s.prev, v, s, this);
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
key: "insertNodeAfter",
|
|
677
|
+
value: function(v, s) {
|
|
678
|
+
return r(s, v, s.next, this);
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
key: "push",
|
|
683
|
+
value: function(v) {
|
|
684
|
+
return r(this.tail, t(v), null, this);
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
key: "unshift",
|
|
689
|
+
value: function(v) {
|
|
690
|
+
return r(null, t(v), this.head, this);
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
key: "remove",
|
|
695
|
+
value: function(v) {
|
|
696
|
+
return a(v, this);
|
|
697
|
+
}
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
key: "pop",
|
|
701
|
+
value: function() {
|
|
702
|
+
return a(this.tail, this).value;
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
key: "popNode",
|
|
707
|
+
value: function() {
|
|
708
|
+
return a(this.tail, this);
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
key: "shift",
|
|
713
|
+
value: function() {
|
|
714
|
+
return a(this.head, this).value;
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
key: "shiftNode",
|
|
719
|
+
value: function() {
|
|
720
|
+
return a(this.head, this);
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
key: "get_object_at",
|
|
725
|
+
value: function(v) {
|
|
726
|
+
if (v <= this.length()) {
|
|
727
|
+
for (var s = 1, l = this.head; s < v; )
|
|
728
|
+
l = l.next, s++;
|
|
729
|
+
return l.value;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
key: "set_object_at",
|
|
735
|
+
value: function(v, s) {
|
|
736
|
+
if (v <= this.length()) {
|
|
737
|
+
for (var l = 1, g = this.head; l < v; )
|
|
738
|
+
g = g.next, l++;
|
|
739
|
+
g.value = s;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
]), o;
|
|
744
|
+
})();
|
|
745
|
+
}),
|
|
746
|
+
(function(N, O, y) {
|
|
747
|
+
"use strict";
|
|
748
|
+
function n(e, t, r) {
|
|
749
|
+
this.x = null, this.y = null, e == null && t == null && r == null ? (this.x = 0, this.y = 0) : typeof e == "number" && typeof t == "number" && r == null ? (this.x = e, this.y = t) : e.constructor.name == "Point" && t == null && r == null && (r = e, this.x = r.x, this.y = r.y);
|
|
750
|
+
}
|
|
751
|
+
n.prototype.getX = function() {
|
|
752
|
+
return this.x;
|
|
753
|
+
}, n.prototype.getY = function() {
|
|
754
|
+
return this.y;
|
|
755
|
+
}, n.prototype.getLocation = function() {
|
|
756
|
+
return new n(this.x, this.y);
|
|
757
|
+
}, n.prototype.setLocation = function(e, t, r) {
|
|
758
|
+
e.constructor.name == "Point" && t == null && r == null ? (r = e, this.setLocation(r.x, r.y)) : typeof e == "number" && typeof t == "number" && r == null && (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : (this.x = Math.floor(e + 0.5), this.y = Math.floor(t + 0.5)));
|
|
759
|
+
}, n.prototype.move = function(e, t) {
|
|
760
|
+
this.x = e, this.y = t;
|
|
761
|
+
}, n.prototype.translate = function(e, t) {
|
|
762
|
+
this.x += e, this.y += t;
|
|
763
|
+
}, n.prototype.equals = function(e) {
|
|
764
|
+
if (e.constructor.name == "Point") {
|
|
765
|
+
var t = e;
|
|
766
|
+
return this.x == t.x && this.y == t.y;
|
|
767
|
+
}
|
|
768
|
+
return this == e;
|
|
769
|
+
}, n.prototype.toString = function() {
|
|
770
|
+
return new n().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
|
|
771
|
+
}, N.exports = n;
|
|
772
|
+
}),
|
|
773
|
+
(function(N, O, y) {
|
|
774
|
+
"use strict";
|
|
775
|
+
function n(e, t, r, a) {
|
|
776
|
+
this.x = 0, this.y = 0, this.width = 0, this.height = 0, e != null && t != null && r != null && a != null && (this.x = e, this.y = t, this.width = r, this.height = a);
|
|
777
|
+
}
|
|
778
|
+
n.prototype.getX = function() {
|
|
779
|
+
return this.x;
|
|
780
|
+
}, n.prototype.setX = function(e) {
|
|
781
|
+
this.x = e;
|
|
782
|
+
}, n.prototype.getY = function() {
|
|
783
|
+
return this.y;
|
|
784
|
+
}, n.prototype.setY = function(e) {
|
|
785
|
+
this.y = e;
|
|
786
|
+
}, n.prototype.getWidth = function() {
|
|
787
|
+
return this.width;
|
|
788
|
+
}, n.prototype.setWidth = function(e) {
|
|
789
|
+
this.width = e;
|
|
790
|
+
}, n.prototype.getHeight = function() {
|
|
791
|
+
return this.height;
|
|
792
|
+
}, n.prototype.setHeight = function(e) {
|
|
793
|
+
this.height = e;
|
|
794
|
+
}, n.prototype.getRight = function() {
|
|
795
|
+
return this.x + this.width;
|
|
796
|
+
}, n.prototype.getBottom = function() {
|
|
797
|
+
return this.y + this.height;
|
|
798
|
+
}, n.prototype.intersects = function(e) {
|
|
799
|
+
return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
|
|
800
|
+
}, n.prototype.getCenterX = function() {
|
|
801
|
+
return this.x + this.width / 2;
|
|
802
|
+
}, n.prototype.getMinX = function() {
|
|
803
|
+
return this.getX();
|
|
804
|
+
}, n.prototype.getMaxX = function() {
|
|
805
|
+
return this.getX() + this.width;
|
|
806
|
+
}, n.prototype.getCenterY = function() {
|
|
807
|
+
return this.y + this.height / 2;
|
|
808
|
+
}, n.prototype.getMinY = function() {
|
|
809
|
+
return this.getY();
|
|
810
|
+
}, n.prototype.getMaxY = function() {
|
|
811
|
+
return this.getY() + this.height;
|
|
812
|
+
}, n.prototype.getWidthHalf = function() {
|
|
813
|
+
return this.width / 2;
|
|
814
|
+
}, n.prototype.getHeightHalf = function() {
|
|
815
|
+
return this.height / 2;
|
|
816
|
+
}, N.exports = n;
|
|
817
|
+
}),
|
|
818
|
+
(function(N, O, y) {
|
|
819
|
+
"use strict";
|
|
820
|
+
var n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
821
|
+
return typeof t;
|
|
822
|
+
} : function(t) {
|
|
823
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
824
|
+
};
|
|
825
|
+
function e() {
|
|
826
|
+
}
|
|
827
|
+
e.lastID = 0, e.createID = function(t) {
|
|
828
|
+
return e.isPrimitive(t) ? t : (t.uniqueID != null || (t.uniqueID = e.getString(), e.lastID++), t.uniqueID);
|
|
829
|
+
}, e.getString = function(t) {
|
|
830
|
+
return t == null && (t = e.lastID), "Object#" + t;
|
|
831
|
+
}, e.isPrimitive = function(t) {
|
|
832
|
+
var r = typeof t > "u" ? "undefined" : n(t);
|
|
833
|
+
return t == null || r != "object" && r != "function";
|
|
834
|
+
}, N.exports = e;
|
|
835
|
+
}),
|
|
836
|
+
(function(N, O, y) {
|
|
837
|
+
"use strict";
|
|
838
|
+
function n(g) {
|
|
839
|
+
if (Array.isArray(g)) {
|
|
840
|
+
for (var p = 0, E = Array(g.length); p < g.length; p++) E[p] = g[p];
|
|
841
|
+
return E;
|
|
842
|
+
} else return Array.from(g);
|
|
843
|
+
}
|
|
844
|
+
var e = y(0), t = y(6), r = y(3), a = y(1), o = y(5), i = y(4), v = y(17), s = y(27);
|
|
845
|
+
function l(g) {
|
|
846
|
+
s.call(this), this.layoutQuality = e.QUALITY, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = e.DEFAULT_INCREMENTAL, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new t(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, g != null && (this.isRemoteUse = g);
|
|
847
|
+
}
|
|
848
|
+
l.RANDOM_SEED = 1, l.prototype = Object.create(s.prototype), l.prototype.getGraphManager = function() {
|
|
849
|
+
return this.graphManager;
|
|
850
|
+
}, l.prototype.getAllNodes = function() {
|
|
851
|
+
return this.graphManager.getAllNodes();
|
|
852
|
+
}, l.prototype.getAllEdges = function() {
|
|
853
|
+
return this.graphManager.getAllEdges();
|
|
854
|
+
}, l.prototype.getAllNodesToApplyGravitation = function() {
|
|
855
|
+
return this.graphManager.getAllNodesToApplyGravitation();
|
|
856
|
+
}, l.prototype.newGraphManager = function() {
|
|
857
|
+
var g = new t(this);
|
|
858
|
+
return this.graphManager = g, g;
|
|
859
|
+
}, l.prototype.newGraph = function(g) {
|
|
860
|
+
return new o(null, this.graphManager, g);
|
|
861
|
+
}, l.prototype.newNode = function(g) {
|
|
862
|
+
return new r(this.graphManager, g);
|
|
863
|
+
}, l.prototype.newEdge = function(g) {
|
|
864
|
+
return new a(null, null, g);
|
|
865
|
+
}, l.prototype.checkLayoutSuccess = function() {
|
|
866
|
+
return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
|
|
867
|
+
}, l.prototype.runLayout = function() {
|
|
868
|
+
this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
|
|
869
|
+
var g;
|
|
870
|
+
return this.checkLayoutSuccess() ? g = !1 : g = this.layout(), e.ANIMATE === "during" ? !1 : (g && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, g);
|
|
871
|
+
}, l.prototype.doPostLayout = function() {
|
|
872
|
+
this.incremental || this.transform(), this.update();
|
|
873
|
+
}, l.prototype.update2 = function() {
|
|
874
|
+
if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
|
|
875
|
+
for (var g = this.graphManager.getAllEdges(), p = 0; p < g.length; p++) g[p];
|
|
876
|
+
for (var E = this.graphManager.getRoot().getNodes(), p = 0; p < E.length; p++) E[p];
|
|
877
|
+
this.update(this.graphManager.getRoot());
|
|
878
|
+
}
|
|
879
|
+
}, l.prototype.update = function(g) {
|
|
880
|
+
if (g == null) this.update2();
|
|
881
|
+
else if (g instanceof r) {
|
|
882
|
+
var p = g;
|
|
883
|
+
if (p.getChild() != null)
|
|
884
|
+
for (var E = p.getChild().getNodes(), d = 0; d < E.length; d++) update(E[d]);
|
|
885
|
+
p.vGraphObject != null && p.vGraphObject.update(p);
|
|
886
|
+
} else if (g instanceof a) {
|
|
887
|
+
var u = g;
|
|
888
|
+
u.vGraphObject != null && u.vGraphObject.update(u);
|
|
889
|
+
} else if (g instanceof o) {
|
|
890
|
+
var D = g;
|
|
891
|
+
D.vGraphObject != null && D.vGraphObject.update(D);
|
|
892
|
+
}
|
|
893
|
+
}, l.prototype.initParameters = function() {
|
|
894
|
+
this.isSubLayout || (this.layoutQuality = e.QUALITY, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = e.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
|
|
895
|
+
}, l.prototype.transform = function(g) {
|
|
896
|
+
if (g == null) this.transform(new i(0, 0));
|
|
897
|
+
else {
|
|
898
|
+
var p = new v(), E = this.graphManager.getRoot().updateLeftTop();
|
|
899
|
+
if (E != null) {
|
|
900
|
+
p.setWorldOrgX(g.x), p.setWorldOrgY(g.y), p.setDeviceOrgX(E.x), p.setDeviceOrgY(E.y);
|
|
901
|
+
for (var d = this.getAllNodes(), u, D = 0; D < d.length; D++)
|
|
902
|
+
u = d[D], u.transform(p);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}, l.prototype.positionNodesRandomly = function(g) {
|
|
906
|
+
if (g == null)
|
|
907
|
+
this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
|
|
908
|
+
else
|
|
909
|
+
for (var p, E, d = g.getNodes(), u = 0; u < d.length; u++)
|
|
910
|
+
p = d[u], E = p.getChild(), E == null || E.getNodes().length == 0 ? p.scatter() : (this.positionNodesRandomly(E), p.updateBounds());
|
|
911
|
+
}, l.prototype.getFlatForest = function() {
|
|
912
|
+
for (var g = [], p = !0, E = this.graphManager.getRoot().getNodes(), d = !0, u = 0; u < E.length; u++) E[u].getChild() != null && (d = !1);
|
|
913
|
+
if (!d) return g;
|
|
914
|
+
var D = /* @__PURE__ */ new Set(), L = [], I = /* @__PURE__ */ new Map(), h = [];
|
|
915
|
+
for (h = h.concat(E); h.length > 0 && p; ) {
|
|
916
|
+
for (L.push(h[0]); L.length > 0 && p; ) {
|
|
917
|
+
var c = L[0];
|
|
918
|
+
L.splice(0, 1), D.add(c);
|
|
919
|
+
for (var f = c.getEdges(), u = 0; u < f.length; u++) {
|
|
920
|
+
var T = f[u].getOtherEnd(c);
|
|
921
|
+
if (I.get(c) != T) if (!D.has(T))
|
|
922
|
+
L.push(T), I.set(T, c);
|
|
923
|
+
else {
|
|
924
|
+
p = !1;
|
|
925
|
+
break;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
if (!p) g = [];
|
|
930
|
+
else {
|
|
931
|
+
var A = [].concat(n(D));
|
|
932
|
+
g.push(A);
|
|
933
|
+
for (var u = 0; u < A.length; u++) {
|
|
934
|
+
var M = A[u], m = h.indexOf(M);
|
|
935
|
+
m > -1 && h.splice(m, 1);
|
|
936
|
+
}
|
|
937
|
+
D = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Map();
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
return g;
|
|
941
|
+
}, l.prototype.createDummyNodesForBendpoints = function(g) {
|
|
942
|
+
for (var p = [], E = g.source, d = this.graphManager.calcLowestCommonAncestor(g.source, g.target), u = 0; u < g.bendpoints.length; u++) {
|
|
943
|
+
var D = this.newNode(null);
|
|
944
|
+
D.setRect(new Point(0, 0), new Dimension(1, 1)), d.add(D);
|
|
945
|
+
var L = this.newEdge(null);
|
|
946
|
+
this.graphManager.add(L, E, D), p.add(D), E = D;
|
|
947
|
+
}
|
|
948
|
+
var L = this.newEdge(null);
|
|
949
|
+
return this.graphManager.add(L, E, g.target), this.edgeToDummyNodes.set(g, p), g.isInterGraph() ? this.graphManager.remove(g) : d.remove(g), p;
|
|
950
|
+
}, l.prototype.createBendpointsFromDummyNodes = function() {
|
|
951
|
+
var g = [];
|
|
952
|
+
g = g.concat(this.graphManager.getAllEdges()), g = [].concat(n(this.edgeToDummyNodes.keys())).concat(g);
|
|
953
|
+
for (var p = 0; p < g.length; p++) {
|
|
954
|
+
var E = g[p];
|
|
955
|
+
if (E.bendpoints.length > 0) {
|
|
956
|
+
for (var d = this.edgeToDummyNodes.get(E), u = 0; u < d.length; u++) {
|
|
957
|
+
var D = d[u], L = new i(D.getCenterX(), D.getCenterY()), I = E.bendpoints.get(u);
|
|
958
|
+
I.x = L.x, I.y = L.y, D.getOwner().remove(D);
|
|
959
|
+
}
|
|
960
|
+
this.graphManager.add(E, E.source, E.target);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
}, l.transform = function(g, p, E, d) {
|
|
964
|
+
if (E != null && d != null) {
|
|
965
|
+
var u = p;
|
|
966
|
+
if (g <= 50) {
|
|
967
|
+
var D = p / E;
|
|
968
|
+
u -= (p - D) / 50 * (50 - g);
|
|
969
|
+
} else {
|
|
970
|
+
var L = p * d;
|
|
971
|
+
u += (L - p) / 50 * (g - 50);
|
|
972
|
+
}
|
|
973
|
+
return u;
|
|
974
|
+
} else {
|
|
975
|
+
var I, h;
|
|
976
|
+
return g <= 50 ? (I = 9 * p / 500, h = p / 10) : (I = 9 * p / 50, h = -8 * p), I * g + h;
|
|
977
|
+
}
|
|
978
|
+
}, l.findCenterOfTree = function(g) {
|
|
979
|
+
var p = [];
|
|
980
|
+
p = p.concat(g);
|
|
981
|
+
var E = [], d = /* @__PURE__ */ new Map(), u = !1, D = null;
|
|
982
|
+
(p.length == 1 || p.length == 2) && (u = !0, D = p[0]);
|
|
983
|
+
for (var L = 0; L < p.length; L++) {
|
|
984
|
+
var I = p[L], h = I.getNeighborsList().size;
|
|
985
|
+
d.set(I, I.getNeighborsList().size), h == 1 && E.push(I);
|
|
986
|
+
}
|
|
987
|
+
var c = [];
|
|
988
|
+
for (c = c.concat(E); !u; ) {
|
|
989
|
+
var f = [];
|
|
990
|
+
f = f.concat(c), c = [];
|
|
991
|
+
for (var L = 0; L < p.length; L++) {
|
|
992
|
+
var I = p[L], T = p.indexOf(I);
|
|
993
|
+
T >= 0 && p.splice(T, 1), I.getNeighborsList().forEach(function(m) {
|
|
994
|
+
if (E.indexOf(m) < 0) {
|
|
995
|
+
var R = d.get(m) - 1;
|
|
996
|
+
R == 1 && c.push(m), d.set(m, R);
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
E = E.concat(c), (p.length == 1 || p.length == 2) && (u = !0, D = p[0]);
|
|
1001
|
+
}
|
|
1002
|
+
return D;
|
|
1003
|
+
}, l.prototype.setGraphManager = function(g) {
|
|
1004
|
+
this.graphManager = g;
|
|
1005
|
+
}, N.exports = l;
|
|
1006
|
+
}),
|
|
1007
|
+
(function(N, O, y) {
|
|
1008
|
+
"use strict";
|
|
1009
|
+
function n() {
|
|
1010
|
+
}
|
|
1011
|
+
n.seed = 1, n.x = 0, n.nextDouble = function() {
|
|
1012
|
+
return n.x = Math.sin(n.seed++) * 1e4, n.x - Math.floor(n.x);
|
|
1013
|
+
}, N.exports = n;
|
|
1014
|
+
}),
|
|
1015
|
+
(function(N, O, y) {
|
|
1016
|
+
"use strict";
|
|
1017
|
+
var n = y(4);
|
|
1018
|
+
function e(t, r) {
|
|
1019
|
+
this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
|
|
1020
|
+
}
|
|
1021
|
+
e.prototype.getWorldOrgX = function() {
|
|
1022
|
+
return this.lworldOrgX;
|
|
1023
|
+
}, e.prototype.setWorldOrgX = function(t) {
|
|
1024
|
+
this.lworldOrgX = t;
|
|
1025
|
+
}, e.prototype.getWorldOrgY = function() {
|
|
1026
|
+
return this.lworldOrgY;
|
|
1027
|
+
}, e.prototype.setWorldOrgY = function(t) {
|
|
1028
|
+
this.lworldOrgY = t;
|
|
1029
|
+
}, e.prototype.getWorldExtX = function() {
|
|
1030
|
+
return this.lworldExtX;
|
|
1031
|
+
}, e.prototype.setWorldExtX = function(t) {
|
|
1032
|
+
this.lworldExtX = t;
|
|
1033
|
+
}, e.prototype.getWorldExtY = function() {
|
|
1034
|
+
return this.lworldExtY;
|
|
1035
|
+
}, e.prototype.setWorldExtY = function(t) {
|
|
1036
|
+
this.lworldExtY = t;
|
|
1037
|
+
}, e.prototype.getDeviceOrgX = function() {
|
|
1038
|
+
return this.ldeviceOrgX;
|
|
1039
|
+
}, e.prototype.setDeviceOrgX = function(t) {
|
|
1040
|
+
this.ldeviceOrgX = t;
|
|
1041
|
+
}, e.prototype.getDeviceOrgY = function() {
|
|
1042
|
+
return this.ldeviceOrgY;
|
|
1043
|
+
}, e.prototype.setDeviceOrgY = function(t) {
|
|
1044
|
+
this.ldeviceOrgY = t;
|
|
1045
|
+
}, e.prototype.getDeviceExtX = function() {
|
|
1046
|
+
return this.ldeviceExtX;
|
|
1047
|
+
}, e.prototype.setDeviceExtX = function(t) {
|
|
1048
|
+
this.ldeviceExtX = t;
|
|
1049
|
+
}, e.prototype.getDeviceExtY = function() {
|
|
1050
|
+
return this.ldeviceExtY;
|
|
1051
|
+
}, e.prototype.setDeviceExtY = function(t) {
|
|
1052
|
+
this.ldeviceExtY = t;
|
|
1053
|
+
}, e.prototype.transformX = function(t) {
|
|
1054
|
+
var r = 0, a = this.lworldExtX;
|
|
1055
|
+
return a != 0 && (r = this.ldeviceOrgX + (t - this.lworldOrgX) * this.ldeviceExtX / a), r;
|
|
1056
|
+
}, e.prototype.transformY = function(t) {
|
|
1057
|
+
var r = 0, a = this.lworldExtY;
|
|
1058
|
+
return a != 0 && (r = this.ldeviceOrgY + (t - this.lworldOrgY) * this.ldeviceExtY / a), r;
|
|
1059
|
+
}, e.prototype.inverseTransformX = function(t) {
|
|
1060
|
+
var r = 0, a = this.ldeviceExtX;
|
|
1061
|
+
return a != 0 && (r = this.lworldOrgX + (t - this.ldeviceOrgX) * this.lworldExtX / a), r;
|
|
1062
|
+
}, e.prototype.inverseTransformY = function(t) {
|
|
1063
|
+
var r = 0, a = this.ldeviceExtY;
|
|
1064
|
+
return a != 0 && (r = this.lworldOrgY + (t - this.ldeviceOrgY) * this.lworldExtY / a), r;
|
|
1065
|
+
}, e.prototype.inverseTransformPoint = function(t) {
|
|
1066
|
+
return new n(this.inverseTransformX(t.x), this.inverseTransformY(t.y));
|
|
1067
|
+
}, N.exports = e;
|
|
1068
|
+
}),
|
|
1069
|
+
(function(N, O, y) {
|
|
1070
|
+
"use strict";
|
|
1071
|
+
function n(s) {
|
|
1072
|
+
if (Array.isArray(s)) {
|
|
1073
|
+
for (var l = 0, g = Array(s.length); l < s.length; l++) g[l] = s[l];
|
|
1074
|
+
return g;
|
|
1075
|
+
} else return Array.from(s);
|
|
1076
|
+
}
|
|
1077
|
+
var e = y(15), t = y(7), r = y(0), a = y(8), o = y(9);
|
|
1078
|
+
function i() {
|
|
1079
|
+
e.call(this), this.useSmartIdealEdgeLengthCalculation = t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = t.DEFAULT_EDGE_LENGTH, this.springConstant = t.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = t.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = t.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = t.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * t.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = t.MAX_ITERATIONS;
|
|
1080
|
+
}
|
|
1081
|
+
i.prototype = Object.create(e.prototype);
|
|
1082
|
+
for (var v in e) i[v] = e[v];
|
|
1083
|
+
i.prototype.initParameters = function() {
|
|
1084
|
+
e.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
|
|
1085
|
+
}, i.prototype.calcIdealEdgeLengths = function() {
|
|
1086
|
+
for (var s, l, g, p, E, d, u = this.getGraphManager().getAllEdges(), D = 0; D < u.length; D++)
|
|
1087
|
+
s = u[D], s.idealLength = this.idealEdgeLength, s.isInterGraph && (g = s.getSource(), p = s.getTarget(), E = s.getSourceInLca().getEstimatedSize(), d = s.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (s.idealLength += E + d - 2 * r.SIMPLE_NODE_SIZE), l = s.getLca().getInclusionTreeDepth(), s.idealLength += t.DEFAULT_EDGE_LENGTH * t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (g.getInclusionTreeDepth() + p.getInclusionTreeDepth() - 2 * l));
|
|
1088
|
+
}, i.prototype.initSpringEmbedder = function() {
|
|
1089
|
+
var s = this.getAllNodes().length;
|
|
1090
|
+
this.incremental ? (s > t.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * t.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - t.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (s > t.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(t.COOLING_ADAPTATION_FACTOR, 1 - (s - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * (1 - t.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
|
|
1091
|
+
}, i.prototype.calcSpringForces = function() {
|
|
1092
|
+
for (var s = this.getAllEdges(), l, g = 0; g < s.length; g++)
|
|
1093
|
+
l = s[g], this.calcSpringForce(l, l.idealLength);
|
|
1094
|
+
}, i.prototype.calcRepulsionForces = function() {
|
|
1095
|
+
var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, g, p, E, d, u = this.getAllNodes(), D;
|
|
1096
|
+
if (this.useFRGridVariant)
|
|
1097
|
+
for (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && s && this.updateGrid(), D = /* @__PURE__ */ new Set(), g = 0; g < u.length; g++)
|
|
1098
|
+
E = u[g], this.calculateRepulsionForceOfANode(E, D, s, l), D.add(E);
|
|
1099
|
+
else for (g = 0; g < u.length; g++)
|
|
1100
|
+
for (E = u[g], p = g + 1; p < u.length; p++)
|
|
1101
|
+
d = u[p], E.getOwner() == d.getOwner() && this.calcRepulsionForce(E, d);
|
|
1102
|
+
}, i.prototype.calcGravitationalForces = function() {
|
|
1103
|
+
for (var s, l = this.getAllNodesToApplyGravitation(), g = 0; g < l.length; g++)
|
|
1104
|
+
s = l[g], this.calcGravitationalForce(s);
|
|
1105
|
+
}, i.prototype.moveNodes = function() {
|
|
1106
|
+
for (var s = this.getAllNodes(), l, g = 0; g < s.length; g++)
|
|
1107
|
+
l = s[g], l.move();
|
|
1108
|
+
}, i.prototype.calcSpringForce = function(s, l) {
|
|
1109
|
+
var g = s.getSource(), p = s.getTarget(), E, d, u, D;
|
|
1110
|
+
if (this.uniformLeafNodeSizes && g.getChild() == null && p.getChild() == null) s.updateLengthSimple();
|
|
1111
|
+
else if (s.updateLength(), s.isOverlapingSourceAndTarget) return;
|
|
1112
|
+
E = s.getLength(), E != 0 && (d = this.springConstant * (E - l), u = d * (s.lengthX / E), D = d * (s.lengthY / E), g.springForceX += u, g.springForceY += D, p.springForceX -= u, p.springForceY -= D);
|
|
1113
|
+
}, i.prototype.calcRepulsionForce = function(s, l) {
|
|
1114
|
+
var g = s.getRect(), p = l.getRect(), E = new Array(2), d = new Array(4), u, D, L, I, h, c, f;
|
|
1115
|
+
if (g.intersects(p)) {
|
|
1116
|
+
a.calcSeparationAmount(g, p, E, t.DEFAULT_EDGE_LENGTH / 2), c = 2 * E[0], f = 2 * E[1];
|
|
1117
|
+
var T = s.noOfChildren * l.noOfChildren / (s.noOfChildren + l.noOfChildren);
|
|
1118
|
+
s.repulsionForceX -= T * c, s.repulsionForceY -= T * f, l.repulsionForceX += T * c, l.repulsionForceY += T * f;
|
|
1119
|
+
} else
|
|
1120
|
+
this.uniformLeafNodeSizes && s.getChild() == null && l.getChild() == null ? (u = p.getCenterX() - g.getCenterX(), D = p.getCenterY() - g.getCenterY()) : (a.getIntersection(g, p, d), u = d[2] - d[0], D = d[3] - d[1]), Math.abs(u) < t.MIN_REPULSION_DIST && (u = o.sign(u) * t.MIN_REPULSION_DIST), Math.abs(D) < t.MIN_REPULSION_DIST && (D = o.sign(D) * t.MIN_REPULSION_DIST), L = u * u + D * D, I = Math.sqrt(L), h = this.repulsionConstant * s.noOfChildren * l.noOfChildren / L, c = h * u / I, f = h * D / I, s.repulsionForceX -= c, s.repulsionForceY -= f, l.repulsionForceX += c, l.repulsionForceY += f;
|
|
1121
|
+
}, i.prototype.calcGravitationalForce = function(s) {
|
|
1122
|
+
var l, g, p, E, d, u, D, L;
|
|
1123
|
+
l = s.getOwner(), g = (l.getRight() + l.getLeft()) / 2, p = (l.getTop() + l.getBottom()) / 2, E = s.getCenterX() - g, d = s.getCenterY() - p, u = Math.abs(E) + s.getWidth() / 2, D = Math.abs(d) + s.getHeight() / 2, s.getOwner() == this.graphManager.getRoot() ? (L = l.getEstimatedSize() * this.gravityRangeFactor, (u > L || D > L) && (s.gravitationForceX = -this.gravityConstant * E, s.gravitationForceY = -this.gravityConstant * d)) : (L = l.getEstimatedSize() * this.compoundGravityRangeFactor, (u > L || D > L) && (s.gravitationForceX = -this.gravityConstant * E * this.compoundGravityConstant, s.gravitationForceY = -this.gravityConstant * d * this.compoundGravityConstant));
|
|
1124
|
+
}, i.prototype.isConverged = function() {
|
|
1125
|
+
var s, l = !1;
|
|
1126
|
+
return this.totalIterations > this.maxIterations / 3 && (l = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), s = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, s || l;
|
|
1127
|
+
}, i.prototype.animate = function() {
|
|
1128
|
+
this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
|
|
1129
|
+
}, i.prototype.calcNoOfChildrenForAllNodes = function() {
|
|
1130
|
+
for (var s, l = this.graphManager.getAllNodes(), g = 0; g < l.length; g++)
|
|
1131
|
+
s = l[g], s.noOfChildren = s.getNoOfChildren();
|
|
1132
|
+
}, i.prototype.calcGrid = function(s) {
|
|
1133
|
+
var l = 0, g = 0;
|
|
1134
|
+
l = parseInt(Math.ceil((s.getRight() - s.getLeft()) / this.repulsionRange)), g = parseInt(Math.ceil((s.getBottom() - s.getTop()) / this.repulsionRange));
|
|
1135
|
+
for (var p = new Array(l), E = 0; E < l; E++) p[E] = new Array(g);
|
|
1136
|
+
for (var E = 0; E < l; E++) for (var d = 0; d < g; d++) p[E][d] = new Array();
|
|
1137
|
+
return p;
|
|
1138
|
+
}, i.prototype.addNodeToGrid = function(s, l, g) {
|
|
1139
|
+
var p = 0, E = 0, d = 0, u = 0;
|
|
1140
|
+
p = parseInt(Math.floor((s.getRect().x - l) / this.repulsionRange)), E = parseInt(Math.floor((s.getRect().width + s.getRect().x - l) / this.repulsionRange)), d = parseInt(Math.floor((s.getRect().y - g) / this.repulsionRange)), u = parseInt(Math.floor((s.getRect().height + s.getRect().y - g) / this.repulsionRange));
|
|
1141
|
+
for (var D = p; D <= E; D++) for (var L = d; L <= u; L++)
|
|
1142
|
+
this.grid[D][L].push(s), s.setGridCoordinates(p, E, d, u);
|
|
1143
|
+
}, i.prototype.updateGrid = function() {
|
|
1144
|
+
var s, l, g = this.getAllNodes();
|
|
1145
|
+
for (this.grid = this.calcGrid(this.graphManager.getRoot()), s = 0; s < g.length; s++)
|
|
1146
|
+
l = g[s], this.addNodeToGrid(l, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
|
|
1147
|
+
}, i.prototype.calculateRepulsionForceOfANode = function(s, l, g, p) {
|
|
1148
|
+
if (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && g || p) {
|
|
1149
|
+
var E = /* @__PURE__ */ new Set();
|
|
1150
|
+
s.surrounding = new Array();
|
|
1151
|
+
for (var d, u = this.grid, D = s.startX - 1; D < s.finishX + 2; D++) for (var L = s.startY - 1; L < s.finishY + 2; L++) if (!(D < 0 || L < 0 || D >= u.length || L >= u[0].length)) {
|
|
1152
|
+
for (var I = 0; I < u[D][L].length; I++)
|
|
1153
|
+
if (d = u[D][L][I], !(s.getOwner() != d.getOwner() || s == d) && !l.has(d) && !E.has(d)) {
|
|
1154
|
+
var h = Math.abs(s.getCenterX() - d.getCenterX()) - (s.getWidth() / 2 + d.getWidth() / 2), c = Math.abs(s.getCenterY() - d.getCenterY()) - (s.getHeight() / 2 + d.getHeight() / 2);
|
|
1155
|
+
h <= this.repulsionRange && c <= this.repulsionRange && E.add(d);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
s.surrounding = [].concat(n(E));
|
|
1159
|
+
}
|
|
1160
|
+
for (D = 0; D < s.surrounding.length; D++) this.calcRepulsionForce(s, s.surrounding[D]);
|
|
1161
|
+
}, i.prototype.calcRepulsionRange = function() {
|
|
1162
|
+
return 0;
|
|
1163
|
+
}, N.exports = i;
|
|
1164
|
+
}),
|
|
1165
|
+
(function(N, O, y) {
|
|
1166
|
+
"use strict";
|
|
1167
|
+
var n = y(1), e = y(7);
|
|
1168
|
+
function t(a, o, i) {
|
|
1169
|
+
n.call(this, a, o, i), this.idealLength = e.DEFAULT_EDGE_LENGTH;
|
|
1170
|
+
}
|
|
1171
|
+
t.prototype = Object.create(n.prototype);
|
|
1172
|
+
for (var r in n) t[r] = n[r];
|
|
1173
|
+
N.exports = t;
|
|
1174
|
+
}),
|
|
1175
|
+
(function(N, O, y) {
|
|
1176
|
+
"use strict";
|
|
1177
|
+
var n = y(3);
|
|
1178
|
+
function e(r, a, o, i) {
|
|
1179
|
+
n.call(this, r, a, o, i), 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 = [];
|
|
1180
|
+
}
|
|
1181
|
+
e.prototype = Object.create(n.prototype);
|
|
1182
|
+
for (var t in n) e[t] = n[t];
|
|
1183
|
+
e.prototype.setGridCoordinates = function(r, a, o, i) {
|
|
1184
|
+
this.startX = r, this.finishX = a, this.startY = o, this.finishY = i;
|
|
1185
|
+
}, N.exports = e;
|
|
1186
|
+
}),
|
|
1187
|
+
(function(N, O, y) {
|
|
1188
|
+
"use strict";
|
|
1189
|
+
function n(e, t) {
|
|
1190
|
+
this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
|
|
1191
|
+
}
|
|
1192
|
+
n.prototype.getWidth = function() {
|
|
1193
|
+
return this.width;
|
|
1194
|
+
}, n.prototype.setWidth = function(e) {
|
|
1195
|
+
this.width = e;
|
|
1196
|
+
}, n.prototype.getHeight = function() {
|
|
1197
|
+
return this.height;
|
|
1198
|
+
}, n.prototype.setHeight = function(e) {
|
|
1199
|
+
this.height = e;
|
|
1200
|
+
}, N.exports = n;
|
|
1201
|
+
}),
|
|
1202
|
+
(function(N, O, y) {
|
|
1203
|
+
"use strict";
|
|
1204
|
+
var n = y(14);
|
|
1205
|
+
function e() {
|
|
1206
|
+
this.map = {}, this.keys = [];
|
|
1207
|
+
}
|
|
1208
|
+
e.prototype.put = function(t, r) {
|
|
1209
|
+
var a = n.createID(t);
|
|
1210
|
+
this.contains(a) || (this.map[a] = r, this.keys.push(t));
|
|
1211
|
+
}, e.prototype.contains = function(t) {
|
|
1212
|
+
return n.createID(t), this.map[t] != null;
|
|
1213
|
+
}, e.prototype.get = function(t) {
|
|
1214
|
+
var r = n.createID(t);
|
|
1215
|
+
return this.map[r];
|
|
1216
|
+
}, e.prototype.keySet = function() {
|
|
1217
|
+
return this.keys;
|
|
1218
|
+
}, N.exports = e;
|
|
1219
|
+
}),
|
|
1220
|
+
(function(N, O, y) {
|
|
1221
|
+
"use strict";
|
|
1222
|
+
var n = y(14);
|
|
1223
|
+
function e() {
|
|
1224
|
+
this.set = {};
|
|
1225
|
+
}
|
|
1226
|
+
e.prototype.add = function(t) {
|
|
1227
|
+
var r = n.createID(t);
|
|
1228
|
+
this.contains(r) || (this.set[r] = t);
|
|
1229
|
+
}, e.prototype.remove = function(t) {
|
|
1230
|
+
delete this.set[n.createID(t)];
|
|
1231
|
+
}, e.prototype.clear = function() {
|
|
1232
|
+
this.set = {};
|
|
1233
|
+
}, e.prototype.contains = function(t) {
|
|
1234
|
+
return this.set[n.createID(t)] == t;
|
|
1235
|
+
}, e.prototype.isEmpty = function() {
|
|
1236
|
+
return this.size() === 0;
|
|
1237
|
+
}, e.prototype.size = function() {
|
|
1238
|
+
return Object.keys(this.set).length;
|
|
1239
|
+
}, e.prototype.addAllTo = function(t) {
|
|
1240
|
+
for (var r = Object.keys(this.set), a = r.length, o = 0; o < a; o++) t.push(this.set[r[o]]);
|
|
1241
|
+
}, e.prototype.size = function() {
|
|
1242
|
+
return Object.keys(this.set).length;
|
|
1243
|
+
}, e.prototype.addAll = function(t) {
|
|
1244
|
+
for (var r = t.length, a = 0; a < r; a++) {
|
|
1245
|
+
var o = t[a];
|
|
1246
|
+
this.add(o);
|
|
1247
|
+
}
|
|
1248
|
+
}, N.exports = e;
|
|
1249
|
+
}),
|
|
1250
|
+
(function(N, O, y) {
|
|
1251
|
+
"use strict";
|
|
1252
|
+
var n = /* @__PURE__ */ (function() {
|
|
1253
|
+
function r(a, o) {
|
|
1254
|
+
for (var i = 0; i < o.length; i++) {
|
|
1255
|
+
var v = o[i];
|
|
1256
|
+
v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(a, v.key, v);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
return function(a, o, i) {
|
|
1260
|
+
return o && r(a.prototype, o), i && r(a, i), a;
|
|
1261
|
+
};
|
|
1262
|
+
})();
|
|
1263
|
+
function e(r, a) {
|
|
1264
|
+
if (!(r instanceof a)) throw new TypeError("Cannot call a class as a function");
|
|
1265
|
+
}
|
|
1266
|
+
var t = y(11);
|
|
1267
|
+
N.exports = (function() {
|
|
1268
|
+
function r(a, o) {
|
|
1269
|
+
e(this, r), (o !== null || o !== void 0) && (this.compareFunction = this._defaultCompareFunction);
|
|
1270
|
+
var i = void 0;
|
|
1271
|
+
a instanceof t ? i = a.size() : i = a.length, this._quicksort(a, 0, i - 1);
|
|
1272
|
+
}
|
|
1273
|
+
return n(r, [
|
|
1274
|
+
{
|
|
1275
|
+
key: "_quicksort",
|
|
1276
|
+
value: function(o, i, v) {
|
|
1277
|
+
if (i < v) {
|
|
1278
|
+
var s = this._partition(o, i, v);
|
|
1279
|
+
this._quicksort(o, i, s), this._quicksort(o, s + 1, v);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
key: "_partition",
|
|
1285
|
+
value: function(o, i, v) {
|
|
1286
|
+
for (var s = this._get(o, i), l = i, g = v; ; ) {
|
|
1287
|
+
for (; this.compareFunction(s, this._get(o, g)); ) g--;
|
|
1288
|
+
for (; this.compareFunction(this._get(o, l), s); ) l++;
|
|
1289
|
+
if (l < g)
|
|
1290
|
+
this._swap(o, l, g), l++, g--;
|
|
1291
|
+
else return g;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
key: "_get",
|
|
1297
|
+
value: function(o, i) {
|
|
1298
|
+
return o instanceof t ? o.get_object_at(i) : o[i];
|
|
1299
|
+
}
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
key: "_set",
|
|
1303
|
+
value: function(o, i, v) {
|
|
1304
|
+
o instanceof t ? o.set_object_at(i, v) : o[i] = v;
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
key: "_swap",
|
|
1309
|
+
value: function(o, i, v) {
|
|
1310
|
+
var s = this._get(o, i);
|
|
1311
|
+
this._set(o, i, this._get(o, v)), this._set(o, v, s);
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
key: "_defaultCompareFunction",
|
|
1316
|
+
value: function(o, i) {
|
|
1317
|
+
return i > o;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
]), r;
|
|
1321
|
+
})();
|
|
1322
|
+
}),
|
|
1323
|
+
(function(N, O, y) {
|
|
1324
|
+
"use strict";
|
|
1325
|
+
var n = /* @__PURE__ */ (function() {
|
|
1326
|
+
function t(r, a) {
|
|
1327
|
+
for (var o = 0; o < a.length; o++) {
|
|
1328
|
+
var i = a[o];
|
|
1329
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(r, i.key, i);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
return function(r, a, o) {
|
|
1333
|
+
return a && t(r.prototype, a), o && t(r, o), r;
|
|
1334
|
+
};
|
|
1335
|
+
})();
|
|
1336
|
+
function e(t, r) {
|
|
1337
|
+
if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function");
|
|
1338
|
+
}
|
|
1339
|
+
N.exports = (function() {
|
|
1340
|
+
function t(r, a) {
|
|
1341
|
+
var o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, v = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
|
|
1342
|
+
e(this, t), this.sequence1 = r, this.sequence2 = a, this.match_score = o, this.mismatch_penalty = i, this.gap_penalty = v, this.iMax = r.length + 1, this.jMax = a.length + 1, this.grid = new Array(this.iMax);
|
|
1343
|
+
for (var s = 0; s < this.iMax; s++) {
|
|
1344
|
+
this.grid[s] = new Array(this.jMax);
|
|
1345
|
+
for (var l = 0; l < this.jMax; l++) this.grid[s][l] = 0;
|
|
1346
|
+
}
|
|
1347
|
+
this.tracebackGrid = new Array(this.iMax);
|
|
1348
|
+
for (var g = 0; g < this.iMax; g++) {
|
|
1349
|
+
this.tracebackGrid[g] = new Array(this.jMax);
|
|
1350
|
+
for (var p = 0; p < this.jMax; p++) this.tracebackGrid[g][p] = [
|
|
1351
|
+
null,
|
|
1352
|
+
null,
|
|
1353
|
+
null
|
|
1354
|
+
];
|
|
1355
|
+
}
|
|
1356
|
+
this.alignments = [], this.score = -1, this.computeGrids();
|
|
1357
|
+
}
|
|
1358
|
+
return n(t, [
|
|
1359
|
+
{
|
|
1360
|
+
key: "getScore",
|
|
1361
|
+
value: function() {
|
|
1362
|
+
return this.score;
|
|
1363
|
+
}
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
key: "getAlignments",
|
|
1367
|
+
value: function() {
|
|
1368
|
+
return this.alignments;
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
key: "computeGrids",
|
|
1373
|
+
value: function() {
|
|
1374
|
+
for (var a = 1; a < this.jMax; a++)
|
|
1375
|
+
this.grid[0][a] = this.grid[0][a - 1] + this.gap_penalty, this.tracebackGrid[0][a] = [
|
|
1376
|
+
!1,
|
|
1377
|
+
!1,
|
|
1378
|
+
!0
|
|
1379
|
+
];
|
|
1380
|
+
for (var o = 1; o < this.iMax; o++)
|
|
1381
|
+
this.grid[o][0] = this.grid[o - 1][0] + this.gap_penalty, this.tracebackGrid[o][0] = [
|
|
1382
|
+
!1,
|
|
1383
|
+
!0,
|
|
1384
|
+
!1
|
|
1385
|
+
];
|
|
1386
|
+
for (var i = 1; i < this.iMax; i++) for (var v = 1; v < this.jMax; v++) {
|
|
1387
|
+
var s = void 0;
|
|
1388
|
+
this.sequence1[i - 1] === this.sequence2[v - 1] ? s = this.grid[i - 1][v - 1] + this.match_score : s = this.grid[i - 1][v - 1] + this.mismatch_penalty;
|
|
1389
|
+
var l = this.grid[i - 1][v] + this.gap_penalty, g = this.grid[i][v - 1] + this.gap_penalty, p = [
|
|
1390
|
+
s,
|
|
1391
|
+
l,
|
|
1392
|
+
g
|
|
1393
|
+
], E = this.arrayAllMaxIndexes(p);
|
|
1394
|
+
this.grid[i][v] = p[E[0]], this.tracebackGrid[i][v] = [
|
|
1395
|
+
E.includes(0),
|
|
1396
|
+
E.includes(1),
|
|
1397
|
+
E.includes(2)
|
|
1398
|
+
];
|
|
1399
|
+
}
|
|
1400
|
+
this.score = this.grid[this.iMax - 1][this.jMax - 1];
|
|
1401
|
+
}
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
key: "alignmentTraceback",
|
|
1405
|
+
value: function() {
|
|
1406
|
+
var a = [];
|
|
1407
|
+
for (a.push({
|
|
1408
|
+
pos: [this.sequence1.length, this.sequence2.length],
|
|
1409
|
+
seq1: "",
|
|
1410
|
+
seq2: ""
|
|
1411
|
+
}); a[0]; ) {
|
|
1412
|
+
var o = a[0], i = this.tracebackGrid[o.pos[0]][o.pos[1]];
|
|
1413
|
+
i[0] && a.push({
|
|
1414
|
+
pos: [o.pos[0] - 1, o.pos[1] - 1],
|
|
1415
|
+
seq1: this.sequence1[o.pos[0] - 1] + o.seq1,
|
|
1416
|
+
seq2: this.sequence2[o.pos[1] - 1] + o.seq2
|
|
1417
|
+
}), i[1] && a.push({
|
|
1418
|
+
pos: [o.pos[0] - 1, o.pos[1]],
|
|
1419
|
+
seq1: this.sequence1[o.pos[0] - 1] + o.seq1,
|
|
1420
|
+
seq2: "-" + o.seq2
|
|
1421
|
+
}), i[2] && a.push({
|
|
1422
|
+
pos: [o.pos[0], o.pos[1] - 1],
|
|
1423
|
+
seq1: "-" + o.seq1,
|
|
1424
|
+
seq2: this.sequence2[o.pos[1] - 1] + o.seq2
|
|
1425
|
+
}), o.pos[0] === 0 && o.pos[1] === 0 && this.alignments.push({
|
|
1426
|
+
sequence1: o.seq1,
|
|
1427
|
+
sequence2: o.seq2
|
|
1428
|
+
}), a.shift();
|
|
1429
|
+
}
|
|
1430
|
+
return this.alignments;
|
|
1431
|
+
}
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
key: "getAllIndexes",
|
|
1435
|
+
value: function(a, o) {
|
|
1436
|
+
for (var i = [], v = -1; (v = a.indexOf(o, v + 1)) !== -1; ) i.push(v);
|
|
1437
|
+
return i;
|
|
1438
|
+
}
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
key: "arrayAllMaxIndexes",
|
|
1442
|
+
value: function(a) {
|
|
1443
|
+
return this.getAllIndexes(a, Math.max.apply(null, a));
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
]), t;
|
|
1447
|
+
})();
|
|
1448
|
+
}),
|
|
1449
|
+
(function(N, O, y) {
|
|
1450
|
+
"use strict";
|
|
1451
|
+
var n = function() {
|
|
1452
|
+
};
|
|
1453
|
+
n.FDLayout = y(18), n.FDLayoutConstants = y(7), n.FDLayoutEdge = y(19), n.FDLayoutNode = y(20), n.DimensionD = y(21), n.HashMap = y(22), n.HashSet = y(23), n.IGeometry = y(8), n.IMath = y(9), n.Integer = y(10), n.Point = y(12), n.PointD = y(4), n.RandomSeed = y(16), n.RectangleD = y(13), n.Transform = y(17), n.UniqueIDGeneretor = y(14), n.Quicksort = y(24), n.LinkedList = y(11), n.LGraphObject = y(2), n.LGraph = y(5), n.LEdge = y(1), n.LGraphManager = y(6), n.LNode = y(3), n.Layout = y(15), n.LayoutConstants = y(0), n.NeedlemanWunsch = y(25), N.exports = n;
|
|
1454
|
+
}),
|
|
1455
|
+
(function(N, O, y) {
|
|
1456
|
+
"use strict";
|
|
1457
|
+
function n() {
|
|
1458
|
+
this.listeners = [];
|
|
1459
|
+
}
|
|
1460
|
+
var e = n.prototype;
|
|
1461
|
+
e.addListener = function(t, r) {
|
|
1462
|
+
this.listeners.push({
|
|
1463
|
+
event: t,
|
|
1464
|
+
callback: r
|
|
1465
|
+
});
|
|
1466
|
+
}, e.removeListener = function(t, r) {
|
|
1467
|
+
for (var a = this.listeners.length; a >= 0; a--) {
|
|
1468
|
+
var o = this.listeners[a];
|
|
1469
|
+
o.event === t && o.callback === r && this.listeners.splice(a, 1);
|
|
1470
|
+
}
|
|
1471
|
+
}, e.emit = function(t, r) {
|
|
1472
|
+
for (var a = 0; a < this.listeners.length; a++) {
|
|
1473
|
+
var o = this.listeners[a];
|
|
1474
|
+
t === o.event && o.callback(r);
|
|
1475
|
+
}
|
|
1476
|
+
}, N.exports = n;
|
|
1477
|
+
})
|
|
1478
|
+
]);
|
|
1479
|
+
});
|
|
1480
|
+
})), j = /* @__PURE__ */ $(((w, _) => {
|
|
1481
|
+
(function(O, y) {
|
|
1482
|
+
typeof w == "object" && typeof _ == "object" ? _.exports = y(Q()) : typeof define == "function" && define.amd ? define(["layout-base"], y) : typeof w == "object" ? w.coseBase = y(Q()) : O.coseBase = y(O.layoutBase);
|
|
1483
|
+
})(w, function(N) {
|
|
1484
|
+
return (function(O) {
|
|
1485
|
+
var y = {};
|
|
1486
|
+
function n(e) {
|
|
1487
|
+
if (y[e]) return y[e].exports;
|
|
1488
|
+
var t = y[e] = {
|
|
1489
|
+
i: e,
|
|
1490
|
+
l: !1,
|
|
1491
|
+
exports: {}
|
|
1492
|
+
};
|
|
1493
|
+
return O[e].call(t.exports, t, t.exports, n), t.l = !0, t.exports;
|
|
1494
|
+
}
|
|
1495
|
+
return n.m = O, n.c = y, n.i = function(e) {
|
|
1496
|
+
return e;
|
|
1497
|
+
}, n.d = function(e, t, r) {
|
|
1498
|
+
n.o(e, t) || Object.defineProperty(e, t, {
|
|
1499
|
+
configurable: !1,
|
|
1500
|
+
enumerable: !0,
|
|
1501
|
+
get: r
|
|
1502
|
+
});
|
|
1503
|
+
}, n.n = function(e) {
|
|
1504
|
+
var t = e && e.__esModule ? function() {
|
|
1505
|
+
return e.default;
|
|
1506
|
+
} : function() {
|
|
1507
|
+
return e;
|
|
1508
|
+
};
|
|
1509
|
+
return n.d(t, "a", t), t;
|
|
1510
|
+
}, n.o = function(e, t) {
|
|
1511
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
1512
|
+
}, n.p = "", n(n.s = 7);
|
|
1513
|
+
})([
|
|
1514
|
+
(function(O, y) {
|
|
1515
|
+
O.exports = N;
|
|
1516
|
+
}),
|
|
1517
|
+
(function(O, y, n) {
|
|
1518
|
+
"use strict";
|
|
1519
|
+
var e = n(0).FDLayoutConstants;
|
|
1520
|
+
function t() {
|
|
1521
|
+
}
|
|
1522
|
+
for (var r in e) t[r] = e[r];
|
|
1523
|
+
t.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, t.DEFAULT_RADIAL_SEPARATION = e.DEFAULT_EDGE_LENGTH, t.DEFAULT_COMPONENT_SEPERATION = 60, t.TILE = !0, t.TILING_PADDING_VERTICAL = 10, t.TILING_PADDING_HORIZONTAL = 10, t.TREE_REDUCTION_ON_INCREMENTAL = !1, O.exports = t;
|
|
1524
|
+
}),
|
|
1525
|
+
(function(O, y, n) {
|
|
1526
|
+
"use strict";
|
|
1527
|
+
var e = n(0).FDLayoutEdge;
|
|
1528
|
+
function t(a, o, i) {
|
|
1529
|
+
e.call(this, a, o, i);
|
|
1530
|
+
}
|
|
1531
|
+
t.prototype = Object.create(e.prototype);
|
|
1532
|
+
for (var r in e) t[r] = e[r];
|
|
1533
|
+
O.exports = t;
|
|
1534
|
+
}),
|
|
1535
|
+
(function(O, y, n) {
|
|
1536
|
+
"use strict";
|
|
1537
|
+
var e = n(0).LGraph;
|
|
1538
|
+
function t(a, o, i) {
|
|
1539
|
+
e.call(this, a, o, i);
|
|
1540
|
+
}
|
|
1541
|
+
t.prototype = Object.create(e.prototype);
|
|
1542
|
+
for (var r in e) t[r] = e[r];
|
|
1543
|
+
O.exports = t;
|
|
1544
|
+
}),
|
|
1545
|
+
(function(O, y, n) {
|
|
1546
|
+
"use strict";
|
|
1547
|
+
var e = n(0).LGraphManager;
|
|
1548
|
+
function t(a) {
|
|
1549
|
+
e.call(this, a);
|
|
1550
|
+
}
|
|
1551
|
+
t.prototype = Object.create(e.prototype);
|
|
1552
|
+
for (var r in e) t[r] = e[r];
|
|
1553
|
+
O.exports = t;
|
|
1554
|
+
}),
|
|
1555
|
+
(function(O, y, n) {
|
|
1556
|
+
"use strict";
|
|
1557
|
+
var e = n(0).FDLayoutNode, t = n(0).IMath;
|
|
1558
|
+
function r(o, i, v, s) {
|
|
1559
|
+
e.call(this, o, i, v, s);
|
|
1560
|
+
}
|
|
1561
|
+
r.prototype = Object.create(e.prototype);
|
|
1562
|
+
for (var a in e) r[a] = e[a];
|
|
1563
|
+
r.prototype.move = function() {
|
|
1564
|
+
var o = this.graphManager.getLayout();
|
|
1565
|
+
this.displacementX = o.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = o.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > o.coolingFactor * o.maxNodeDisplacement && (this.displacementX = o.coolingFactor * o.maxNodeDisplacement * t.sign(this.displacementX)), Math.abs(this.displacementY) > o.coolingFactor * o.maxNodeDisplacement && (this.displacementY = o.coolingFactor * o.maxNodeDisplacement * t.sign(this.displacementY)), this.child == null ? this.moveBy(this.displacementX, this.displacementY) : this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), o.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0;
|
|
1566
|
+
}, r.prototype.propogateDisplacementToChildren = function(o, i) {
|
|
1567
|
+
for (var v = this.getChild().getNodes(), s, l = 0; l < v.length; l++)
|
|
1568
|
+
s = v[l], s.getChild() == null ? (s.moveBy(o, i), s.displacementX += o, s.displacementY += i) : s.propogateDisplacementToChildren(o, i);
|
|
1569
|
+
}, r.prototype.setPred1 = function(o) {
|
|
1570
|
+
this.pred1 = o;
|
|
1571
|
+
}, r.prototype.getPred1 = function() {
|
|
1572
|
+
return pred1;
|
|
1573
|
+
}, r.prototype.getPred2 = function() {
|
|
1574
|
+
return pred2;
|
|
1575
|
+
}, r.prototype.setNext = function(o) {
|
|
1576
|
+
this.next = o;
|
|
1577
|
+
}, r.prototype.getNext = function() {
|
|
1578
|
+
return next;
|
|
1579
|
+
}, r.prototype.setProcessed = function(o) {
|
|
1580
|
+
this.processed = o;
|
|
1581
|
+
}, r.prototype.isProcessed = function() {
|
|
1582
|
+
return processed;
|
|
1583
|
+
}, O.exports = r;
|
|
1584
|
+
}),
|
|
1585
|
+
(function(O, y, n) {
|
|
1586
|
+
"use strict";
|
|
1587
|
+
var e = n(0).FDLayout, t = n(4), r = n(3), a = n(5), o = n(2), i = n(1), v = n(0).FDLayoutConstants, s = n(0).LayoutConstants, l = n(0).Point, g = n(0).PointD, p = n(0).Layout, E = n(0).Integer, d = n(0).IGeometry, u = n(0).LGraph, D = n(0).Transform;
|
|
1588
|
+
function L() {
|
|
1589
|
+
e.call(this), this.toBeTiled = {};
|
|
1590
|
+
}
|
|
1591
|
+
L.prototype = Object.create(e.prototype);
|
|
1592
|
+
for (var I in e) L[I] = e[I];
|
|
1593
|
+
L.prototype.newGraphManager = function() {
|
|
1594
|
+
var h = new t(this);
|
|
1595
|
+
return this.graphManager = h, h;
|
|
1596
|
+
}, L.prototype.newGraph = function(h) {
|
|
1597
|
+
return new r(null, this.graphManager, h);
|
|
1598
|
+
}, L.prototype.newNode = function(h) {
|
|
1599
|
+
return new a(this.graphManager, h);
|
|
1600
|
+
}, L.prototype.newEdge = function(h) {
|
|
1601
|
+
return new o(null, null, h);
|
|
1602
|
+
}, L.prototype.initParameters = function() {
|
|
1603
|
+
e.prototype.initParameters.call(this, arguments), this.isSubLayout || (i.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = i.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = v.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = v.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = v.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = v.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = v.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / v.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = v.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
|
|
1604
|
+
}, L.prototype.layout = function() {
|
|
1605
|
+
return s.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
|
|
1606
|
+
}, L.prototype.classicLayout = function() {
|
|
1607
|
+
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) {
|
|
1608
|
+
if (i.TREE_REDUCTION_ON_INCREMENTAL) {
|
|
1609
|
+
this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
|
|
1610
|
+
var c = new Set(this.getAllNodes()), f = this.nodesWithGravity.filter(function(M) {
|
|
1611
|
+
return c.has(M);
|
|
1612
|
+
});
|
|
1613
|
+
this.graphManager.setAllNodesToApplyGravitation(f);
|
|
1614
|
+
}
|
|
1615
|
+
} else {
|
|
1616
|
+
var h = this.getFlatForest();
|
|
1617
|
+
if (h.length > 0) this.positionNodesRadially(h);
|
|
1618
|
+
else {
|
|
1619
|
+
this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
|
|
1620
|
+
var c = new Set(this.getAllNodes()), f = this.nodesWithGravity.filter(function(T) {
|
|
1621
|
+
return c.has(T);
|
|
1622
|
+
});
|
|
1623
|
+
this.graphManager.setAllNodesToApplyGravitation(f), this.positionNodesRandomly();
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
|
|
1627
|
+
}, L.prototype.tick = function() {
|
|
1628
|
+
if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
|
|
1629
|
+
else return !0;
|
|
1630
|
+
if (this.totalIterations % v.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
|
|
1631
|
+
if (this.isConverged()) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
|
|
1632
|
+
else return !0;
|
|
1633
|
+
this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
|
|
1634
|
+
}
|
|
1635
|
+
if (this.isTreeGrowing) {
|
|
1636
|
+
if (this.growTreeIterations % 10 == 0) if (this.prunedNodesAll.length > 0) {
|
|
1637
|
+
this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
|
|
1638
|
+
var h = new Set(this.getAllNodes()), c = this.nodesWithGravity.filter(function(A) {
|
|
1639
|
+
return h.has(A);
|
|
1640
|
+
});
|
|
1641
|
+
this.graphManager.setAllNodesToApplyGravitation(c), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = v.DEFAULT_COOLING_FACTOR_INCREMENTAL;
|
|
1642
|
+
} else
|
|
1643
|
+
this.isTreeGrowing = !1, this.isGrowthFinished = !0;
|
|
1644
|
+
this.growTreeIterations++;
|
|
1645
|
+
}
|
|
1646
|
+
if (this.isGrowthFinished) {
|
|
1647
|
+
if (this.isConverged()) return !0;
|
|
1648
|
+
this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = v.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
|
|
1649
|
+
}
|
|
1650
|
+
var f = !this.isTreeGrowing && !this.isGrowthFinished, T = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
|
|
1651
|
+
return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(f, T), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
|
|
1652
|
+
}, L.prototype.getPositionsData = function() {
|
|
1653
|
+
for (var h = this.graphManager.getAllNodes(), c = {}, f = 0; f < h.length; f++) {
|
|
1654
|
+
var T = h[f].rect, A = h[f].id;
|
|
1655
|
+
c[A] = {
|
|
1656
|
+
id: A,
|
|
1657
|
+
x: T.getCenterX(),
|
|
1658
|
+
y: T.getCenterY(),
|
|
1659
|
+
w: T.width,
|
|
1660
|
+
h: T.height
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
return c;
|
|
1664
|
+
}, L.prototype.runSpringEmbedder = function() {
|
|
1665
|
+
this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
|
|
1666
|
+
var h = !1;
|
|
1667
|
+
if (v.ANIMATE === "during") this.emit("layoutstarted");
|
|
1668
|
+
else {
|
|
1669
|
+
for (; !h; ) h = this.tick();
|
|
1670
|
+
this.graphManager.updateBounds();
|
|
1671
|
+
}
|
|
1672
|
+
}, L.prototype.calculateNodesToApplyGravitationTo = function() {
|
|
1673
|
+
var h = [], c, f = this.graphManager.getGraphs(), T = f.length, A;
|
|
1674
|
+
for (A = 0; A < T; A++)
|
|
1675
|
+
c = f[A], c.updateConnected(), c.isConnected || (h = h.concat(c.getNodes()));
|
|
1676
|
+
return h;
|
|
1677
|
+
}, L.prototype.createBendpoints = function() {
|
|
1678
|
+
var h = [];
|
|
1679
|
+
h = h.concat(this.graphManager.getAllEdges());
|
|
1680
|
+
var c = /* @__PURE__ */ new Set(), f;
|
|
1681
|
+
for (f = 0; f < h.length; f++) {
|
|
1682
|
+
var T = h[f];
|
|
1683
|
+
if (!c.has(T)) {
|
|
1684
|
+
var A = T.getSource(), M = T.getTarget();
|
|
1685
|
+
if (A == M)
|
|
1686
|
+
T.getBendpoints().push(new g()), T.getBendpoints().push(new g()), this.createDummyNodesForBendpoints(T), c.add(T);
|
|
1687
|
+
else {
|
|
1688
|
+
var m = [];
|
|
1689
|
+
if (m = m.concat(A.getEdgeListToNode(M)), m = m.concat(M.getEdgeListToNode(A)), !c.has(m[0])) {
|
|
1690
|
+
if (m.length > 1) {
|
|
1691
|
+
var R;
|
|
1692
|
+
for (R = 0; R < m.length; R++) {
|
|
1693
|
+
var C = m[R];
|
|
1694
|
+
C.getBendpoints().push(new g()), this.createDummyNodesForBendpoints(C);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
m.forEach(function(x) {
|
|
1698
|
+
c.add(x);
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
if (c.size == h.length) break;
|
|
1704
|
+
}
|
|
1705
|
+
}, L.prototype.positionNodesRadially = function(h) {
|
|
1706
|
+
for (var c = new l(0, 0), f = Math.ceil(Math.sqrt(h.length)), T = 0, A = 0, M = 0, m = new g(0, 0), R = 0; R < h.length; R++) {
|
|
1707
|
+
R % f == 0 && (M = 0, A = T, R != 0 && (A += i.DEFAULT_COMPONENT_SEPERATION), T = 0);
|
|
1708
|
+
var C = h[R], x = p.findCenterOfTree(C);
|
|
1709
|
+
c.x = M, c.y = A, m = L.radialLayout(C, x, c), m.y > T && (T = Math.floor(m.y)), M = Math.floor(m.x + i.DEFAULT_COMPONENT_SEPERATION);
|
|
1710
|
+
}
|
|
1711
|
+
this.transform(new g(s.WORLD_CENTER_X - m.x / 2, s.WORLD_CENTER_Y - m.y / 2));
|
|
1712
|
+
}, L.radialLayout = function(h, c, f) {
|
|
1713
|
+
var T = Math.max(this.maxDiagonalInTree(h), i.DEFAULT_RADIAL_SEPARATION);
|
|
1714
|
+
L.branchRadialLayout(c, null, 0, 359, 0, T);
|
|
1715
|
+
var A = u.calculateBounds(h), M = new D();
|
|
1716
|
+
M.setDeviceOrgX(A.getMinX()), M.setDeviceOrgY(A.getMinY()), M.setWorldOrgX(f.x), M.setWorldOrgY(f.y);
|
|
1717
|
+
for (var m = 0; m < h.length; m++) h[m].transform(M);
|
|
1718
|
+
var R = new g(A.getMaxX(), A.getMaxY());
|
|
1719
|
+
return M.inverseTransformPoint(R);
|
|
1720
|
+
}, L.branchRadialLayout = function(h, c, f, T, A, M) {
|
|
1721
|
+
var m = (T - f + 1) / 2;
|
|
1722
|
+
m < 0 && (m += 180);
|
|
1723
|
+
var R = (m + f) % 360 * d.TWO_PI / 360, C = A * Math.cos(R), x = A * Math.sin(R);
|
|
1724
|
+
h.setCenter(C, x);
|
|
1725
|
+
var F = [];
|
|
1726
|
+
F = F.concat(h.getEdges());
|
|
1727
|
+
var G = F.length;
|
|
1728
|
+
c != null && G--;
|
|
1729
|
+
for (var X = 0, U = F.length, S, Y = h.getEdgesBetween(c); Y.length > 1; ) {
|
|
1730
|
+
var P = Y[0];
|
|
1731
|
+
Y.splice(0, 1);
|
|
1732
|
+
var b = F.indexOf(P);
|
|
1733
|
+
b >= 0 && F.splice(b, 1), U--, G--;
|
|
1734
|
+
}
|
|
1735
|
+
c != null ? S = (F.indexOf(Y[0]) + 1) % U : S = 0;
|
|
1736
|
+
for (var V = Math.abs(T - f) / G, H = S; X != G; H = ++H % U) {
|
|
1737
|
+
var W = F[H].getOtherEnd(h);
|
|
1738
|
+
if (W != c) {
|
|
1739
|
+
var Z = (f + X * V) % 360, nt = (Z + V) % 360;
|
|
1740
|
+
L.branchRadialLayout(W, h, Z, nt, A + M, M), X++;
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
}, L.maxDiagonalInTree = function(h) {
|
|
1744
|
+
for (var c = E.MIN_VALUE, f = 0; f < h.length; f++) {
|
|
1745
|
+
var T = h[f].getDiagonal();
|
|
1746
|
+
T > c && (c = T);
|
|
1747
|
+
}
|
|
1748
|
+
return c;
|
|
1749
|
+
}, L.prototype.calcRepulsionRange = function() {
|
|
1750
|
+
return 2 * (this.level + 1) * this.idealEdgeLength;
|
|
1751
|
+
}, L.prototype.groupZeroDegreeMembers = function() {
|
|
1752
|
+
var h = this, c = {};
|
|
1753
|
+
this.memberGroups = {}, this.idToDummyNode = {};
|
|
1754
|
+
for (var f = [], T = this.graphManager.getAllNodes(), A = 0; A < T.length; A++) {
|
|
1755
|
+
var M = T[A], m = M.getParent();
|
|
1756
|
+
this.getNodeDegreeWithChildren(M) === 0 && (m.id == null || !this.getToBeTiled(m)) && f.push(M);
|
|
1757
|
+
}
|
|
1758
|
+
for (var A = 0; A < f.length; A++) {
|
|
1759
|
+
var M = f[A], R = M.getParent().id;
|
|
1760
|
+
typeof c[R] > "u" && (c[R] = []), c[R] = c[R].concat(M);
|
|
1761
|
+
}
|
|
1762
|
+
Object.keys(c).forEach(function(C) {
|
|
1763
|
+
if (c[C].length > 1) {
|
|
1764
|
+
var x = "DummyCompound_" + C;
|
|
1765
|
+
h.memberGroups[x] = c[C];
|
|
1766
|
+
var F = c[C][0].getParent(), G = new a(h.graphManager);
|
|
1767
|
+
G.id = x, G.paddingLeft = F.paddingLeft || 0, G.paddingRight = F.paddingRight || 0, G.paddingBottom = F.paddingBottom || 0, G.paddingTop = F.paddingTop || 0, h.idToDummyNode[x] = G;
|
|
1768
|
+
var X = h.getGraphManager().add(h.newGraph(), G), U = F.getChild();
|
|
1769
|
+
U.add(G);
|
|
1770
|
+
for (var S = 0; S < c[C].length; S++) {
|
|
1771
|
+
var Y = c[C][S];
|
|
1772
|
+
U.remove(Y), X.add(Y);
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
});
|
|
1776
|
+
}, L.prototype.clearCompounds = function() {
|
|
1777
|
+
var h = {}, c = {};
|
|
1778
|
+
this.performDFSOnCompounds();
|
|
1779
|
+
for (var f = 0; f < this.compoundOrder.length; f++)
|
|
1780
|
+
c[this.compoundOrder[f].id] = this.compoundOrder[f], h[this.compoundOrder[f].id] = [].concat(this.compoundOrder[f].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[f].getChild()), this.compoundOrder[f].child = null;
|
|
1781
|
+
this.graphManager.resetAllNodes(), this.tileCompoundMembers(h, c);
|
|
1782
|
+
}, L.prototype.clearZeroDegreeMembers = function() {
|
|
1783
|
+
var h = this, c = this.tiledZeroDegreePack = [];
|
|
1784
|
+
Object.keys(this.memberGroups).forEach(function(f) {
|
|
1785
|
+
var T = h.idToDummyNode[f];
|
|
1786
|
+
c[f] = h.tileNodes(h.memberGroups[f], T.paddingLeft + T.paddingRight), T.rect.width = c[f].width, T.rect.height = c[f].height;
|
|
1787
|
+
});
|
|
1788
|
+
}, L.prototype.repopulateCompounds = function() {
|
|
1789
|
+
for (var h = this.compoundOrder.length - 1; h >= 0; h--) {
|
|
1790
|
+
var c = this.compoundOrder[h], f = c.id, T = c.paddingLeft, A = c.paddingTop;
|
|
1791
|
+
this.adjustLocations(this.tiledMemberPack[f], c.rect.x, c.rect.y, T, A);
|
|
1792
|
+
}
|
|
1793
|
+
}, L.prototype.repopulateZeroDegreeMembers = function() {
|
|
1794
|
+
var h = this, c = this.tiledZeroDegreePack;
|
|
1795
|
+
Object.keys(c).forEach(function(f) {
|
|
1796
|
+
var T = h.idToDummyNode[f], A = T.paddingLeft, M = T.paddingTop;
|
|
1797
|
+
h.adjustLocations(c[f], T.rect.x, T.rect.y, A, M);
|
|
1798
|
+
});
|
|
1799
|
+
}, L.prototype.getToBeTiled = function(h) {
|
|
1800
|
+
var c = h.id;
|
|
1801
|
+
if (this.toBeTiled[c] != null) return this.toBeTiled[c];
|
|
1802
|
+
var f = h.getChild();
|
|
1803
|
+
if (f == null)
|
|
1804
|
+
return this.toBeTiled[c] = !1, !1;
|
|
1805
|
+
for (var T = f.getNodes(), A = 0; A < T.length; A++) {
|
|
1806
|
+
var M = T[A];
|
|
1807
|
+
if (this.getNodeDegree(M) > 0)
|
|
1808
|
+
return this.toBeTiled[c] = !1, !1;
|
|
1809
|
+
if (M.getChild() == null) {
|
|
1810
|
+
this.toBeTiled[M.id] = !1;
|
|
1811
|
+
continue;
|
|
1812
|
+
}
|
|
1813
|
+
if (!this.getToBeTiled(M))
|
|
1814
|
+
return this.toBeTiled[c] = !1, !1;
|
|
1815
|
+
}
|
|
1816
|
+
return this.toBeTiled[c] = !0, !0;
|
|
1817
|
+
}, L.prototype.getNodeDegree = function(h) {
|
|
1818
|
+
h.id;
|
|
1819
|
+
for (var c = h.getEdges(), f = 0, T = 0; T < c.length; T++) {
|
|
1820
|
+
var A = c[T];
|
|
1821
|
+
A.getSource().id !== A.getTarget().id && (f = f + 1);
|
|
1822
|
+
}
|
|
1823
|
+
return f;
|
|
1824
|
+
}, L.prototype.getNodeDegreeWithChildren = function(h) {
|
|
1825
|
+
var c = this.getNodeDegree(h);
|
|
1826
|
+
if (h.getChild() == null) return c;
|
|
1827
|
+
for (var f = h.getChild().getNodes(), T = 0; T < f.length; T++) {
|
|
1828
|
+
var A = f[T];
|
|
1829
|
+
c += this.getNodeDegreeWithChildren(A);
|
|
1830
|
+
}
|
|
1831
|
+
return c;
|
|
1832
|
+
}, L.prototype.performDFSOnCompounds = function() {
|
|
1833
|
+
this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
|
|
1834
|
+
}, L.prototype.fillCompexOrderByDFS = function(h) {
|
|
1835
|
+
for (var c = 0; c < h.length; c++) {
|
|
1836
|
+
var f = h[c];
|
|
1837
|
+
f.getChild() != null && this.fillCompexOrderByDFS(f.getChild().getNodes()), this.getToBeTiled(f) && this.compoundOrder.push(f);
|
|
1838
|
+
}
|
|
1839
|
+
}, L.prototype.adjustLocations = function(h, c, f, T, A) {
|
|
1840
|
+
c += T, f += A;
|
|
1841
|
+
for (var M = c, m = 0; m < h.rows.length; m++) {
|
|
1842
|
+
var R = h.rows[m];
|
|
1843
|
+
c = M;
|
|
1844
|
+
for (var C = 0, x = 0; x < R.length; x++) {
|
|
1845
|
+
var F = R[x];
|
|
1846
|
+
F.rect.x = c, F.rect.y = f, c += F.rect.width + h.horizontalPadding, F.rect.height > C && (C = F.rect.height);
|
|
1847
|
+
}
|
|
1848
|
+
f += C + h.verticalPadding;
|
|
1849
|
+
}
|
|
1850
|
+
}, L.prototype.tileCompoundMembers = function(h, c) {
|
|
1851
|
+
var f = this;
|
|
1852
|
+
this.tiledMemberPack = [], Object.keys(h).forEach(function(T) {
|
|
1853
|
+
var A = c[T];
|
|
1854
|
+
f.tiledMemberPack[T] = f.tileNodes(h[T], A.paddingLeft + A.paddingRight), A.rect.width = f.tiledMemberPack[T].width, A.rect.height = f.tiledMemberPack[T].height;
|
|
1855
|
+
});
|
|
1856
|
+
}, L.prototype.tileNodes = function(h, c) {
|
|
1857
|
+
var f = {
|
|
1858
|
+
rows: [],
|
|
1859
|
+
rowWidth: [],
|
|
1860
|
+
rowHeight: [],
|
|
1861
|
+
width: 0,
|
|
1862
|
+
height: c,
|
|
1863
|
+
verticalPadding: i.TILING_PADDING_VERTICAL,
|
|
1864
|
+
horizontalPadding: i.TILING_PADDING_HORIZONTAL
|
|
1865
|
+
};
|
|
1866
|
+
h.sort(function(M, m) {
|
|
1867
|
+
return M.rect.width * M.rect.height > m.rect.width * m.rect.height ? -1 : M.rect.width * M.rect.height < m.rect.width * m.rect.height ? 1 : 0;
|
|
1868
|
+
});
|
|
1869
|
+
for (var T = 0; T < h.length; T++) {
|
|
1870
|
+
var A = h[T];
|
|
1871
|
+
f.rows.length == 0 ? this.insertNodeToRow(f, A, 0, c) : this.canAddHorizontal(f, A.rect.width, A.rect.height) ? this.insertNodeToRow(f, A, this.getShortestRowIndex(f), c) : this.insertNodeToRow(f, A, f.rows.length, c), this.shiftToLastRow(f);
|
|
1872
|
+
}
|
|
1873
|
+
return f;
|
|
1874
|
+
}, L.prototype.insertNodeToRow = function(h, c, f, T) {
|
|
1875
|
+
var A = T;
|
|
1876
|
+
f == h.rows.length && (h.rows.push([]), h.rowWidth.push(A), h.rowHeight.push(0));
|
|
1877
|
+
var M = h.rowWidth[f] + c.rect.width;
|
|
1878
|
+
h.rows[f].length > 0 && (M += h.horizontalPadding), h.rowWidth[f] = M, h.width < M && (h.width = M);
|
|
1879
|
+
var m = c.rect.height;
|
|
1880
|
+
f > 0 && (m += h.verticalPadding);
|
|
1881
|
+
var R = 0;
|
|
1882
|
+
m > h.rowHeight[f] && (R = h.rowHeight[f], h.rowHeight[f] = m, R = h.rowHeight[f] - R), h.height += R, h.rows[f].push(c);
|
|
1883
|
+
}, L.prototype.getShortestRowIndex = function(h) {
|
|
1884
|
+
for (var c = -1, f = Number.MAX_VALUE, T = 0; T < h.rows.length; T++) h.rowWidth[T] < f && (c = T, f = h.rowWidth[T]);
|
|
1885
|
+
return c;
|
|
1886
|
+
}, L.prototype.getLongestRowIndex = function(h) {
|
|
1887
|
+
for (var c = -1, f = Number.MIN_VALUE, T = 0; T < h.rows.length; T++) h.rowWidth[T] > f && (c = T, f = h.rowWidth[T]);
|
|
1888
|
+
return c;
|
|
1889
|
+
}, L.prototype.canAddHorizontal = function(h, c, f) {
|
|
1890
|
+
var T = this.getShortestRowIndex(h);
|
|
1891
|
+
if (T < 0) return !0;
|
|
1892
|
+
var A = h.rowWidth[T];
|
|
1893
|
+
if (A + h.horizontalPadding + c <= h.width) return !0;
|
|
1894
|
+
var M = 0;
|
|
1895
|
+
h.rowHeight[T] < f && T > 0 && (M = f + h.verticalPadding - h.rowHeight[T]);
|
|
1896
|
+
var m;
|
|
1897
|
+
h.width - A >= c + h.horizontalPadding ? m = (h.height + M) / (A + c + h.horizontalPadding) : m = (h.height + M) / h.width, M = f + h.verticalPadding;
|
|
1898
|
+
var R;
|
|
1899
|
+
return h.width < c ? R = (h.height + M) / c : R = (h.height + M) / h.width, R < 1 && (R = 1 / R), m < 1 && (m = 1 / m), m < R;
|
|
1900
|
+
}, L.prototype.shiftToLastRow = function(h) {
|
|
1901
|
+
var c = this.getLongestRowIndex(h), f = h.rowWidth.length - 1, T = h.rows[c], A = T[T.length - 1], M = A.width + h.horizontalPadding;
|
|
1902
|
+
if (h.width - h.rowWidth[f] > M && c != f) {
|
|
1903
|
+
T.splice(-1, 1), h.rows[f].push(A), h.rowWidth[c] = h.rowWidth[c] - M, h.rowWidth[f] = h.rowWidth[f] + M, h.width = h.rowWidth[instance.getLongestRowIndex(h)];
|
|
1904
|
+
for (var m = Number.MIN_VALUE, R = 0; R < T.length; R++) T[R].height > m && (m = T[R].height);
|
|
1905
|
+
c > 0 && (m += h.verticalPadding);
|
|
1906
|
+
var C = h.rowHeight[c] + h.rowHeight[f];
|
|
1907
|
+
h.rowHeight[c] = m, h.rowHeight[f] < A.height + h.verticalPadding && (h.rowHeight[f] = A.height + h.verticalPadding);
|
|
1908
|
+
var x = h.rowHeight[c] + h.rowHeight[f];
|
|
1909
|
+
h.height += x - C, this.shiftToLastRow(h);
|
|
1910
|
+
}
|
|
1911
|
+
}, L.prototype.tilingPreLayout = function() {
|
|
1912
|
+
i.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
|
|
1913
|
+
}, L.prototype.tilingPostLayout = function() {
|
|
1914
|
+
i.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
|
|
1915
|
+
}, L.prototype.reduceTrees = function() {
|
|
1916
|
+
for (var h = [], c = !0, f; c; ) {
|
|
1917
|
+
var T = this.graphManager.getAllNodes(), A = [];
|
|
1918
|
+
c = !1;
|
|
1919
|
+
for (var M = 0; M < T.length; M++)
|
|
1920
|
+
f = T[M], f.getEdges().length == 1 && !f.getEdges()[0].isInterGraph && f.getChild() == null && (A.push([
|
|
1921
|
+
f,
|
|
1922
|
+
f.getEdges()[0],
|
|
1923
|
+
f.getOwner()
|
|
1924
|
+
]), c = !0);
|
|
1925
|
+
if (c == !0) {
|
|
1926
|
+
for (var m = [], R = 0; R < A.length; R++) A[R][0].getEdges().length == 1 && (m.push(A[R]), A[R][0].getOwner().remove(A[R][0]));
|
|
1927
|
+
h.push(m), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
this.prunedNodesAll = h;
|
|
1931
|
+
}, L.prototype.growTree = function(h) {
|
|
1932
|
+
for (var c = h[h.length - 1], f, T = 0; T < c.length; T++)
|
|
1933
|
+
f = c[T], this.findPlaceforPrunedNode(f), f[2].add(f[0]), f[2].add(f[1], f[1].source, f[1].target);
|
|
1934
|
+
h.splice(h.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
|
|
1935
|
+
}, L.prototype.findPlaceforPrunedNode = function(h) {
|
|
1936
|
+
var c, f, T = h[0];
|
|
1937
|
+
T == h[1].source ? f = h[1].target : f = h[1].source;
|
|
1938
|
+
var A = f.startX, M = f.finishX, m = f.startY, R = f.finishY, C = [
|
|
1939
|
+
0,
|
|
1940
|
+
0,
|
|
1941
|
+
0,
|
|
1942
|
+
0
|
|
1943
|
+
];
|
|
1944
|
+
if (m > 0) for (var x = A; x <= M; x++) C[0] += this.grid[x][m - 1].length + this.grid[x][m].length - 1;
|
|
1945
|
+
if (M < this.grid.length - 1) for (var x = m; x <= R; x++) C[1] += this.grid[M + 1][x].length + this.grid[M][x].length - 1;
|
|
1946
|
+
if (R < this.grid[0].length - 1) for (var x = A; x <= M; x++) C[2] += this.grid[x][R + 1].length + this.grid[x][R].length - 1;
|
|
1947
|
+
if (A > 0) for (var x = m; x <= R; x++) C[3] += this.grid[A - 1][x].length + this.grid[A][x].length - 1;
|
|
1948
|
+
for (var F = E.MAX_VALUE, G, X, U = 0; U < C.length; U++) C[U] < F ? (F = C[U], G = 1, X = U) : C[U] == F && G++;
|
|
1949
|
+
if (G == 3 && F == 0)
|
|
1950
|
+
C[0] == 0 && C[1] == 0 && C[2] == 0 ? c = 1 : C[0] == 0 && C[1] == 0 && C[3] == 0 ? c = 0 : C[0] == 0 && C[2] == 0 && C[3] == 0 ? c = 3 : C[1] == 0 && C[2] == 0 && C[3] == 0 && (c = 2);
|
|
1951
|
+
else if (G == 2 && F == 0) {
|
|
1952
|
+
var S = Math.floor(Math.random() * 2);
|
|
1953
|
+
C[0] == 0 && C[1] == 0 ? S == 0 ? c = 0 : c = 1 : C[0] == 0 && C[2] == 0 ? S == 0 ? c = 0 : c = 2 : C[0] == 0 && C[3] == 0 ? S == 0 ? c = 0 : c = 3 : C[1] == 0 && C[2] == 0 ? S == 0 ? c = 1 : c = 2 : C[1] == 0 && C[3] == 0 ? S == 0 ? c = 1 : c = 3 : S == 0 ? c = 2 : c = 3;
|
|
1954
|
+
} else if (G == 4 && F == 0) {
|
|
1955
|
+
var S = Math.floor(Math.random() * 4);
|
|
1956
|
+
c = S;
|
|
1957
|
+
} else c = X;
|
|
1958
|
+
c == 0 ? T.setCenter(f.getCenterX(), f.getCenterY() - f.getHeight() / 2 - v.DEFAULT_EDGE_LENGTH - T.getHeight() / 2) : c == 1 ? T.setCenter(f.getCenterX() + f.getWidth() / 2 + v.DEFAULT_EDGE_LENGTH + T.getWidth() / 2, f.getCenterY()) : c == 2 ? T.setCenter(f.getCenterX(), f.getCenterY() + f.getHeight() / 2 + v.DEFAULT_EDGE_LENGTH + T.getHeight() / 2) : T.setCenter(f.getCenterX() - f.getWidth() / 2 - v.DEFAULT_EDGE_LENGTH - T.getWidth() / 2, f.getCenterY());
|
|
1959
|
+
}, O.exports = L;
|
|
1960
|
+
}),
|
|
1961
|
+
(function(O, y, n) {
|
|
1962
|
+
"use strict";
|
|
1963
|
+
var e = {};
|
|
1964
|
+
e.layoutBase = n(0), e.CoSEConstants = n(1), e.CoSEEdge = n(2), e.CoSEGraph = n(3), e.CoSEGraphManager = n(4), e.CoSELayout = n(6), e.CoSENode = n(5), O.exports = e;
|
|
1965
|
+
})
|
|
1966
|
+
]);
|
|
1967
|
+
});
|
|
1968
|
+
})), at = /* @__PURE__ */ $(((w, _) => {
|
|
1969
|
+
(function(O, y) {
|
|
1970
|
+
typeof w == "object" && typeof _ == "object" ? _.exports = y(j()) : typeof define == "function" && define.amd ? define(["cose-base"], y) : typeof w == "object" ? w.cytoscapeCoseBilkent = y(j()) : O.cytoscapeCoseBilkent = y(O.coseBase);
|
|
1971
|
+
})(w, function(N) {
|
|
1972
|
+
return (function(O) {
|
|
1973
|
+
var y = {};
|
|
1974
|
+
function n(e) {
|
|
1975
|
+
if (y[e]) return y[e].exports;
|
|
1976
|
+
var t = y[e] = {
|
|
1977
|
+
i: e,
|
|
1978
|
+
l: !1,
|
|
1979
|
+
exports: {}
|
|
1980
|
+
};
|
|
1981
|
+
return O[e].call(t.exports, t, t.exports, n), t.l = !0, t.exports;
|
|
1982
|
+
}
|
|
1983
|
+
return n.m = O, n.c = y, n.i = function(e) {
|
|
1984
|
+
return e;
|
|
1985
|
+
}, n.d = function(e, t, r) {
|
|
1986
|
+
n.o(e, t) || Object.defineProperty(e, t, {
|
|
1987
|
+
configurable: !1,
|
|
1988
|
+
enumerable: !0,
|
|
1989
|
+
get: r
|
|
1990
|
+
});
|
|
1991
|
+
}, n.n = function(e) {
|
|
1992
|
+
var t = e && e.__esModule ? function() {
|
|
1993
|
+
return e.default;
|
|
1994
|
+
} : function() {
|
|
1995
|
+
return e;
|
|
1996
|
+
};
|
|
1997
|
+
return n.d(t, "a", t), t;
|
|
1998
|
+
}, n.o = function(e, t) {
|
|
1999
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
2000
|
+
}, n.p = "", n(n.s = 1);
|
|
2001
|
+
})([(function(O, y) {
|
|
2002
|
+
O.exports = N;
|
|
2003
|
+
}), (function(O, y, n) {
|
|
2004
|
+
"use strict";
|
|
2005
|
+
var e = n(0).layoutBase.LayoutConstants, t = n(0).layoutBase.FDLayoutConstants, r = n(0).CoSEConstants, a = n(0).CoSELayout, o = n(0).CoSENode, i = n(0).layoutBase.PointD, v = n(0).layoutBase.DimensionD, s = {
|
|
2006
|
+
ready: function() {
|
|
2007
|
+
},
|
|
2008
|
+
stop: function() {
|
|
2009
|
+
},
|
|
2010
|
+
quality: "default",
|
|
2011
|
+
nodeDimensionsIncludeLabels: !1,
|
|
2012
|
+
refresh: 30,
|
|
2013
|
+
fit: !0,
|
|
2014
|
+
padding: 10,
|
|
2015
|
+
randomize: !0,
|
|
2016
|
+
nodeRepulsion: 4500,
|
|
2017
|
+
idealEdgeLength: 50,
|
|
2018
|
+
edgeElasticity: 0.45,
|
|
2019
|
+
nestingFactor: 0.1,
|
|
2020
|
+
gravity: 0.25,
|
|
2021
|
+
numIter: 2500,
|
|
2022
|
+
tile: !0,
|
|
2023
|
+
animate: "end",
|
|
2024
|
+
animationDuration: 500,
|
|
2025
|
+
tilingPaddingVertical: 10,
|
|
2026
|
+
tilingPaddingHorizontal: 10,
|
|
2027
|
+
gravityRangeCompound: 1.5,
|
|
2028
|
+
gravityCompound: 1,
|
|
2029
|
+
gravityRange: 3.8,
|
|
2030
|
+
initialEnergyOnIncremental: 0.5
|
|
2031
|
+
};
|
|
2032
|
+
function l(d, u) {
|
|
2033
|
+
var D = {};
|
|
2034
|
+
for (var L in d) D[L] = d[L];
|
|
2035
|
+
for (var L in u) D[L] = u[L];
|
|
2036
|
+
return D;
|
|
2037
|
+
}
|
|
2038
|
+
function g(d) {
|
|
2039
|
+
this.options = l(s, d), p(this.options);
|
|
2040
|
+
}
|
|
2041
|
+
var p = function(u) {
|
|
2042
|
+
u.nodeRepulsion != null && (r.DEFAULT_REPULSION_STRENGTH = t.DEFAULT_REPULSION_STRENGTH = u.nodeRepulsion), u.idealEdgeLength != null && (r.DEFAULT_EDGE_LENGTH = t.DEFAULT_EDGE_LENGTH = u.idealEdgeLength), u.edgeElasticity != null && (r.DEFAULT_SPRING_STRENGTH = t.DEFAULT_SPRING_STRENGTH = u.edgeElasticity), u.nestingFactor != null && (r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = u.nestingFactor), u.gravity != null && (r.DEFAULT_GRAVITY_STRENGTH = t.DEFAULT_GRAVITY_STRENGTH = u.gravity), u.numIter != null && (r.MAX_ITERATIONS = t.MAX_ITERATIONS = u.numIter), u.gravityRange != null && (r.DEFAULT_GRAVITY_RANGE_FACTOR = t.DEFAULT_GRAVITY_RANGE_FACTOR = u.gravityRange), u.gravityCompound != null && (r.DEFAULT_COMPOUND_GRAVITY_STRENGTH = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH = u.gravityCompound), u.gravityRangeCompound != null && (r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = u.gravityRangeCompound), u.initialEnergyOnIncremental != null && (r.DEFAULT_COOLING_FACTOR_INCREMENTAL = t.DEFAULT_COOLING_FACTOR_INCREMENTAL = u.initialEnergyOnIncremental), u.quality == "draft" ? e.QUALITY = 0 : u.quality == "proof" ? e.QUALITY = 2 : e.QUALITY = 1, r.NODE_DIMENSIONS_INCLUDE_LABELS = t.NODE_DIMENSIONS_INCLUDE_LABELS = e.NODE_DIMENSIONS_INCLUDE_LABELS = u.nodeDimensionsIncludeLabels, r.DEFAULT_INCREMENTAL = t.DEFAULT_INCREMENTAL = e.DEFAULT_INCREMENTAL = !u.randomize, r.ANIMATE = t.ANIMATE = e.ANIMATE = u.animate, r.TILE = u.tile, r.TILING_PADDING_VERTICAL = typeof u.tilingPaddingVertical == "function" ? u.tilingPaddingVertical.call() : u.tilingPaddingVertical, r.TILING_PADDING_HORIZONTAL = typeof u.tilingPaddingHorizontal == "function" ? u.tilingPaddingHorizontal.call() : u.tilingPaddingHorizontal;
|
|
2043
|
+
};
|
|
2044
|
+
g.prototype.run = function() {
|
|
2045
|
+
var d, u, D = this.options;
|
|
2046
|
+
this.idToLNode = {};
|
|
2047
|
+
var L = this.layout = new a(), I = this;
|
|
2048
|
+
I.stopped = !1, this.cy = this.options.cy, this.cy.trigger({
|
|
2049
|
+
type: "layoutstart",
|
|
2050
|
+
layout: this
|
|
2051
|
+
});
|
|
2052
|
+
var h = L.newGraphManager();
|
|
2053
|
+
this.gm = h;
|
|
2054
|
+
var c = this.options.eles.nodes(), f = this.options.eles.edges();
|
|
2055
|
+
this.root = h.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(c), L);
|
|
2056
|
+
for (var T = 0; T < f.length; T++) {
|
|
2057
|
+
var A = f[T], M = this.idToLNode[A.data("source")], m = this.idToLNode[A.data("target")];
|
|
2058
|
+
if (M !== m && M.getEdgesBetween(m).length == 0) {
|
|
2059
|
+
var R = h.add(L.newEdge(), M, m);
|
|
2060
|
+
R.id = A.id();
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
var C = function(G, X) {
|
|
2064
|
+
typeof G == "number" && (G = X);
|
|
2065
|
+
var U = G.data("id"), S = I.idToLNode[U];
|
|
2066
|
+
return {
|
|
2067
|
+
x: S.getRect().getCenterX(),
|
|
2068
|
+
y: S.getRect().getCenterY()
|
|
2069
|
+
};
|
|
2070
|
+
}, x = function F() {
|
|
2071
|
+
for (var G = function() {
|
|
2072
|
+
D.fit && D.cy.fit(D.eles, D.padding), d || (d = !0, I.cy.one("layoutready", D.ready), I.cy.trigger({
|
|
2073
|
+
type: "layoutready",
|
|
2074
|
+
layout: I
|
|
2075
|
+
}));
|
|
2076
|
+
}, X = I.options.refresh, U, S = 0; S < X && !U; S++) U = I.stopped || I.layout.tick();
|
|
2077
|
+
if (U) {
|
|
2078
|
+
L.checkLayoutSuccess() && !L.isSubLayout && L.doPostLayout(), L.tilingPostLayout && L.tilingPostLayout(), L.isLayoutFinished = !0, I.options.eles.nodes().positions(C), G(), I.cy.one("layoutstop", I.options.stop), I.cy.trigger({
|
|
2079
|
+
type: "layoutstop",
|
|
2080
|
+
layout: I
|
|
2081
|
+
}), u && cancelAnimationFrame(u), d = !1;
|
|
2082
|
+
return;
|
|
2083
|
+
}
|
|
2084
|
+
var Y = I.layout.getPositionsData();
|
|
2085
|
+
D.eles.nodes().positions(function(P, b) {
|
|
2086
|
+
if (typeof P == "number" && (P = b), !P.isParent()) {
|
|
2087
|
+
for (var V = P.id(), H = Y[V], W = P; H == null && (H = Y[W.data("parent")] || Y["DummyCompound_" + W.data("parent")], Y[V] = H, W = W.parent()[0], W != null); )
|
|
2088
|
+
;
|
|
2089
|
+
return H != null ? {
|
|
2090
|
+
x: H.x,
|
|
2091
|
+
y: H.y
|
|
2092
|
+
} : {
|
|
2093
|
+
x: P.position("x"),
|
|
2094
|
+
y: P.position("y")
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
}), G(), u = requestAnimationFrame(F);
|
|
2098
|
+
};
|
|
2099
|
+
return L.addListener("layoutstarted", function() {
|
|
2100
|
+
I.options.animate === "during" && (u = requestAnimationFrame(x));
|
|
2101
|
+
}), L.runLayout(), this.options.animate !== "during" && (I.options.eles.nodes().not(":parent").layoutPositions(I, I.options, C), d = !1), this;
|
|
2102
|
+
}, g.prototype.getTopMostNodes = function(d) {
|
|
2103
|
+
for (var u = {}, D = 0; D < d.length; D++) u[d[D].id()] = !0;
|
|
2104
|
+
return d.filter(function(L, I) {
|
|
2105
|
+
typeof L == "number" && (L = I);
|
|
2106
|
+
for (var h = L.parent()[0]; h != null; ) {
|
|
2107
|
+
if (u[h.id()]) return !1;
|
|
2108
|
+
h = h.parent()[0];
|
|
2109
|
+
}
|
|
2110
|
+
return !0;
|
|
2111
|
+
});
|
|
2112
|
+
}, g.prototype.processChildrenList = function(d, u, D) {
|
|
2113
|
+
for (var L = u.length, I = 0; I < L; I++) {
|
|
2114
|
+
var h = u[I], c = h.children(), f, T = h.layoutDimensions({ nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels });
|
|
2115
|
+
if (h.outerWidth() != null && h.outerHeight() != null ? f = d.add(new o(D.graphManager, new i(h.position("x") - T.w / 2, h.position("y") - T.h / 2), new v(parseFloat(T.w), parseFloat(T.h)))) : f = d.add(new o(this.graphManager)), f.id = h.data("id"), f.paddingLeft = parseInt(h.css("padding")), f.paddingTop = parseInt(h.css("padding")), f.paddingRight = parseInt(h.css("padding")), f.paddingBottom = parseInt(h.css("padding")), this.options.nodeDimensionsIncludeLabels && h.isParent()) {
|
|
2116
|
+
var A = h.boundingBox({
|
|
2117
|
+
includeLabels: !0,
|
|
2118
|
+
includeNodes: !1
|
|
2119
|
+
}).w, M = h.boundingBox({
|
|
2120
|
+
includeLabels: !0,
|
|
2121
|
+
includeNodes: !1
|
|
2122
|
+
}).h, m = h.css("text-halign");
|
|
2123
|
+
f.labelWidth = A, f.labelHeight = M, f.labelPos = m;
|
|
2124
|
+
}
|
|
2125
|
+
if (this.idToLNode[h.data("id")] = f, isNaN(f.rect.x) && (f.rect.x = 0), isNaN(f.rect.y) && (f.rect.y = 0), c != null && c.length > 0) {
|
|
2126
|
+
var R = D.getGraphManager().add(D.newGraph(), f);
|
|
2127
|
+
this.processChildrenList(R, c, D);
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
}, g.prototype.stop = function() {
|
|
2131
|
+
return this.stopped = !0, this;
|
|
2132
|
+
};
|
|
2133
|
+
var E = function(u) {
|
|
2134
|
+
u("layout", "cose-bilkent", g);
|
|
2135
|
+
};
|
|
2136
|
+
typeof cytoscape < "u" && E(cytoscape), O.exports = E;
|
|
2137
|
+
})]);
|
|
2138
|
+
});
|
|
2139
|
+
})), ht = /* @__PURE__ */ st(at(), 1);
|
|
2140
|
+
K.use(ht.default);
|
|
2141
|
+
function J(w, _) {
|
|
2142
|
+
w.forEach((N) => {
|
|
2143
|
+
const O = {
|
|
2144
|
+
id: N.id,
|
|
2145
|
+
labelText: N.label,
|
|
2146
|
+
height: N.height,
|
|
2147
|
+
width: N.width,
|
|
2148
|
+
padding: N.padding ?? 0
|
|
2149
|
+
};
|
|
2150
|
+
Object.keys(N).forEach((y) => {
|
|
2151
|
+
[
|
|
2152
|
+
"id",
|
|
2153
|
+
"label",
|
|
2154
|
+
"height",
|
|
2155
|
+
"width",
|
|
2156
|
+
"padding",
|
|
2157
|
+
"x",
|
|
2158
|
+
"y"
|
|
2159
|
+
].includes(y) || (O[y] = N[y]);
|
|
2160
|
+
}), _.add({
|
|
2161
|
+
group: "nodes",
|
|
2162
|
+
data: O,
|
|
2163
|
+
position: {
|
|
2164
|
+
x: N.x ?? 0,
|
|
2165
|
+
y: N.y ?? 0
|
|
2166
|
+
}
|
|
2167
|
+
});
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
B(J, "addNodes");
|
|
2171
|
+
function q(w, _) {
|
|
2172
|
+
w.forEach((N) => {
|
|
2173
|
+
const O = {
|
|
2174
|
+
id: N.id,
|
|
2175
|
+
source: N.start,
|
|
2176
|
+
target: N.end
|
|
2177
|
+
};
|
|
2178
|
+
Object.keys(N).forEach((y) => {
|
|
2179
|
+
[
|
|
2180
|
+
"id",
|
|
2181
|
+
"start",
|
|
2182
|
+
"end"
|
|
2183
|
+
].includes(y) || (O[y] = N[y]);
|
|
2184
|
+
}), _.add({
|
|
2185
|
+
group: "edges",
|
|
2186
|
+
data: O
|
|
2187
|
+
});
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
B(q, "addEdges");
|
|
2191
|
+
function z(w) {
|
|
2192
|
+
return new Promise((_) => {
|
|
2193
|
+
const N = ot("body").append("div").attr("id", "cy").attr("style", "display:none"), O = K({
|
|
2194
|
+
container: document.getElementById("cy"),
|
|
2195
|
+
style: [{
|
|
2196
|
+
selector: "edge",
|
|
2197
|
+
style: { "curve-style": "bezier" }
|
|
2198
|
+
}]
|
|
2199
|
+
});
|
|
2200
|
+
N.remove(), J(w.nodes, O), q(w.edges, O), O.nodes().forEach(function(y) {
|
|
2201
|
+
y.layoutDimensions = () => {
|
|
2202
|
+
const n = y.data();
|
|
2203
|
+
return {
|
|
2204
|
+
w: n.width,
|
|
2205
|
+
h: n.height
|
|
2206
|
+
};
|
|
2207
|
+
};
|
|
2208
|
+
}), O.layout({
|
|
2209
|
+
name: "cose-bilkent",
|
|
2210
|
+
quality: "proof",
|
|
2211
|
+
styleEnabled: !1,
|
|
2212
|
+
animate: !1
|
|
2213
|
+
}).run(), O.ready((y) => {
|
|
2214
|
+
k.info("Cytoscape ready", y), _(O);
|
|
2215
|
+
});
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
B(z, "createCytoscapeInstance");
|
|
2219
|
+
function tt(w) {
|
|
2220
|
+
return w.nodes().map((_) => {
|
|
2221
|
+
const N = _.data(), O = _.position(), y = {
|
|
2222
|
+
id: N.id,
|
|
2223
|
+
x: O.x,
|
|
2224
|
+
y: O.y
|
|
2225
|
+
};
|
|
2226
|
+
return Object.keys(N).forEach((n) => {
|
|
2227
|
+
n !== "id" && (y[n] = N[n]);
|
|
2228
|
+
}), y;
|
|
2229
|
+
});
|
|
2230
|
+
}
|
|
2231
|
+
B(tt, "extractPositionedNodes");
|
|
2232
|
+
function et(w) {
|
|
2233
|
+
return w.edges().map((_) => {
|
|
2234
|
+
const N = _.data(), O = _._private.rscratch, y = {
|
|
2235
|
+
id: N.id,
|
|
2236
|
+
source: N.source,
|
|
2237
|
+
target: N.target,
|
|
2238
|
+
startX: O.startX,
|
|
2239
|
+
startY: O.startY,
|
|
2240
|
+
midX: O.midX,
|
|
2241
|
+
midY: O.midY,
|
|
2242
|
+
endX: O.endX,
|
|
2243
|
+
endY: O.endY
|
|
2244
|
+
};
|
|
2245
|
+
return Object.keys(N).forEach((n) => {
|
|
2246
|
+
[
|
|
2247
|
+
"id",
|
|
2248
|
+
"source",
|
|
2249
|
+
"target"
|
|
2250
|
+
].includes(n) || (y[n] = N[n]);
|
|
2251
|
+
}), y;
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
B(et, "extractPositionedEdges");
|
|
2255
|
+
async function rt(w, _) {
|
|
2256
|
+
k.debug("Starting cose-bilkent layout algorithm");
|
|
2257
|
+
try {
|
|
2258
|
+
it(w);
|
|
2259
|
+
const N = await z(w), O = tt(N), y = et(N);
|
|
2260
|
+
return k.debug(`Layout completed: ${O.length} nodes, ${y.length} edges`), {
|
|
2261
|
+
nodes: O,
|
|
2262
|
+
edges: y
|
|
2263
|
+
};
|
|
2264
|
+
} catch (N) {
|
|
2265
|
+
throw k.error("Error in cose-bilkent layout algorithm:", N), N;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
B(rt, "executeCoseBilkentLayout");
|
|
2269
|
+
function it(w) {
|
|
2270
|
+
if (!w) throw new Error("Layout data is required");
|
|
2271
|
+
if (!w.config) throw new Error("Configuration is required in layout data");
|
|
2272
|
+
if (!w.rootNode) throw new Error("Root node is required");
|
|
2273
|
+
if (!w.nodes || !Array.isArray(w.nodes)) throw new Error("No nodes found in layout data");
|
|
2274
|
+
if (!Array.isArray(w.edges)) throw new Error("Edges array is required in layout data");
|
|
2275
|
+
return !0;
|
|
2276
|
+
}
|
|
2277
|
+
B(it, "validateLayoutData");
|
|
2278
|
+
var ct = /* @__PURE__ */ B(async (w, _, { insertCluster: N, insertEdge: O, insertEdgeLabel: y, insertMarkers: n, insertNode: e, log: t, positionEdgeLabel: r }, { algorithm: a }) => {
|
|
2279
|
+
const o = {}, i = {}, v = _.select("g");
|
|
2280
|
+
n(v, w.markers, w.type, w.diagramId);
|
|
2281
|
+
const s = v.insert("g").attr("class", "subgraphs"), l = v.insert("g").attr("class", "edgePaths"), g = v.insert("g").attr("class", "edgeLabels"), p = v.insert("g").attr("class", "nodes");
|
|
2282
|
+
t.debug("Inserting nodes into DOM for dimension calculation"), await Promise.all(w.nodes.map(async (d) => {
|
|
2283
|
+
if (d.isGroup) {
|
|
2284
|
+
const u = { ...d };
|
|
2285
|
+
i[d.id] = u, o[d.id] = u, await N(s, d);
|
|
2286
|
+
} else {
|
|
2287
|
+
const u = { ...d };
|
|
2288
|
+
o[d.id] = u;
|
|
2289
|
+
const D = await e(p, d, {
|
|
2290
|
+
config: w.config,
|
|
2291
|
+
dir: w.direction || "TB"
|
|
2292
|
+
}), L = D.node().getBBox();
|
|
2293
|
+
u.width = L.width, u.height = L.height, u.domId = D, t.debug(`Node ${d.id} dimensions: ${L.width}x${L.height}`);
|
|
2294
|
+
}
|
|
2295
|
+
})), t.debug("Running cose-bilkent layout algorithm");
|
|
2296
|
+
const E = await rt({
|
|
2297
|
+
...w,
|
|
2298
|
+
nodes: w.nodes.map((d) => {
|
|
2299
|
+
const u = o[d.id];
|
|
2300
|
+
return {
|
|
2301
|
+
...d,
|
|
2302
|
+
width: u.width,
|
|
2303
|
+
height: u.height
|
|
2304
|
+
};
|
|
2305
|
+
})
|
|
2306
|
+
}, w.config);
|
|
2307
|
+
t.debug("Positioning nodes based on layout results"), E.nodes.forEach((d) => {
|
|
2308
|
+
const u = o[d.id];
|
|
2309
|
+
u?.domId && (u.domId.attr("transform", `translate(${d.x}, ${d.y})`), u.x = d.x, u.y = d.y, t.debug(`Positioned node ${u.id} at center (${d.x}, ${d.y})`));
|
|
2310
|
+
}), E.edges.forEach((d) => {
|
|
2311
|
+
const u = w.edges.find((D) => D.id === d.id);
|
|
2312
|
+
u && (u.points = [
|
|
2313
|
+
{
|
|
2314
|
+
x: d.startX,
|
|
2315
|
+
y: d.startY
|
|
2316
|
+
},
|
|
2317
|
+
{
|
|
2318
|
+
x: d.midX,
|
|
2319
|
+
y: d.midY
|
|
2320
|
+
},
|
|
2321
|
+
{
|
|
2322
|
+
x: d.endX,
|
|
2323
|
+
y: d.endY
|
|
2324
|
+
}
|
|
2325
|
+
]);
|
|
2326
|
+
}), t.debug("Inserting and positioning edges"), await Promise.all(w.edges.map(async (d) => {
|
|
2327
|
+
await y(g, d);
|
|
2328
|
+
const u = o[d.start ?? ""], D = o[d.end ?? ""];
|
|
2329
|
+
if (u && D) {
|
|
2330
|
+
const L = E.edges.find((I) => I.id === d.id);
|
|
2331
|
+
if (L) {
|
|
2332
|
+
t.debug("APA01 positionedEdge", L);
|
|
2333
|
+
const I = { ...d };
|
|
2334
|
+
r(I, O(l, I, i, w.type, u, D, w.diagramId));
|
|
2335
|
+
} else {
|
|
2336
|
+
const I = {
|
|
2337
|
+
...d,
|
|
2338
|
+
points: [{
|
|
2339
|
+
x: u.x || 0,
|
|
2340
|
+
y: u.y || 0
|
|
2341
|
+
}, {
|
|
2342
|
+
x: D.x || 0,
|
|
2343
|
+
y: D.y || 0
|
|
2344
|
+
}]
|
|
2345
|
+
};
|
|
2346
|
+
r(I, O(l, I, i, w.type, u, D, w.diagramId));
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
})), t.debug("Cose-bilkent rendering completed");
|
|
2350
|
+
}, "render");
|
|
2351
|
+
export {
|
|
2352
|
+
ct as render
|
|
2353
|
+
};
|