@pi-outpost/embed 0.32.4 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{abnfDiagram-VCTEODGH-SjZtzoAs.cjs → abnfDiagram-YUKMZFIV-CgM8_qF6.cjs} +1 -1
- package/dist/{abnfDiagram-VCTEODGH-BX4P82Y6.js → abnfDiagram-YUKMZFIV-dNHR2FX4.js} +5 -5
- package/dist/architecture-WOLXFQ4H-DupyKILn.cjs +1 -0
- package/dist/architecture-WOLXFQ4H-X4ZWxzi-.js +3 -0
- package/dist/{architectureDiagram-5GKGNRK7-BRdxCCja.js → architectureDiagram-47P4ROYG-C_rUoWaO.js} +31 -31
- package/dist/{architectureDiagram-5GKGNRK7-wrDPdf3y.cjs → architectureDiagram-47P4ROYG-bflaQP1L.cjs} +3 -3
- package/dist/{blockDiagram-OSKFZWR5-Boo8WJyt.cjs → blockDiagram-E7TT5TSB-BKw9FE2U.cjs} +19 -8
- package/dist/{blockDiagram-OSKFZWR5-B1pU8Z2f.js → blockDiagram-E7TT5TSB-CEa2A5E9.js} +217 -193
- package/dist/c4Diagram-CRA5TL53-C-PuMGA5.cjs +38 -0
- package/dist/{c4Diagram-7LVT6UL2-WfERxhw2.js → c4Diagram-CRA5TL53-CtJh9DsO.js} +283 -273
- package/dist/channel-BjC1TKrU.cjs +1 -0
- package/dist/{channel-Cf_XiG-0.js → channel-DCXZw5aW.js} +1 -1
- package/dist/{chunk-OSK3NFVY-BUXOUgUl.js → chunk-2BW5OAIV-DWtmlmt_.js} +178 -154
- package/dist/chunk-2BW5OAIV-FkhgcL6B.cjs +10 -0
- package/dist/{chunk-75Z2AOVW-DoA8rENV.js → chunk-3YJQHVM4-BNbfg-7y.js} +235 -231
- package/dist/chunk-3YJQHVM4-ChvNe1M8.cjs +2 -0
- package/dist/chunk-4EA7E6EY-3OELTJ93.cjs +1 -0
- package/dist/{chunk-P2QGCYS3-BoMkrMIF.js → chunk-4EA7E6EY-B5P7n2an.js} +6 -6
- package/dist/{chunk-F27PBJKO-s9M3oGHp.js → chunk-7TKQ45FW-CD1KuemG.js} +2 -2
- package/dist/{chunk-F27PBJKO-3UPgzIlN.cjs → chunk-7TKQ45FW-Djscho_M.cjs} +1 -1
- package/dist/{chunk-SVP7TREG-CTKSOFlx.cjs → chunk-AW2ZBBNX-C4uNh90t.cjs} +3 -3
- package/dist/{chunk-SVP7TREG-weNUySou.js → chunk-AW2ZBBNX-CVsDDdv5.js} +33 -33
- package/dist/{chunk-GVQU2GXP-iZT_vNLp.cjs → chunk-DBDB3WZW-DSRcln4l.cjs} +1 -1
- package/dist/{chunk-GVQU2GXP-BhLneNgJ.js → chunk-DBDB3WZW-DpEOsLsQ.js} +3 -3
- package/dist/chunk-DUW6YSOI-2RXTEh_8.cjs +1 -0
- package/dist/chunk-DUW6YSOI-CVhxvrBO.js +10 -0
- package/dist/{chunk-GMAD6QVW-DZ2r0pLj.js → chunk-E2ZNV5FY-Bu796yUY.js} +354 -361
- package/dist/chunk-E2ZNV5FY-DIRTchKA.cjs +72 -0
- package/dist/chunk-EU5HNXII-DNBbmfcI.cjs +213 -0
- package/dist/{chunk-3NF5O7KM-DQV4G__C.js → chunk-EU5HNXII-DW-QTb0f.js} +426 -357
- package/dist/chunk-FVRAUYC3-Crqd-lTD.cjs +1 -0
- package/dist/chunk-FVRAUYC3-tiT7dtx-.js +356 -0
- package/dist/{chunk-PWAF6VOD-9dCi1q-p.js → chunk-HJ2JQQFS-CgYTXthn.js} +2 -2
- package/dist/{chunk-PWAF6VOD-CZZKCekP.cjs → chunk-HJ2JQQFS-DnrogIdt.cjs} +1 -1
- package/dist/chunk-HTAEGDNF-D4u24-lD.js +236 -0
- package/dist/chunk-HTAEGDNF-I4JlqwMr.cjs +1 -0
- package/dist/chunk-J5ZVWO5B-CK5HGA-t.cjs +1 -0
- package/dist/chunk-J5ZVWO5B-DEP-pB-1.js +12 -0
- package/dist/{chunk-POPQ4Y6H-BRQPB1-9.cjs → chunk-KQW6MTUR-C_XQxsme.cjs} +1 -1
- package/dist/{chunk-POPQ4Y6H-vLTNjxsT.js → chunk-KQW6MTUR-c0XOjr_c.js} +2 -2
- package/dist/chunk-NGNAAXSQ-DM0DL2MX.js +19836 -0
- package/dist/chunk-NGNAAXSQ-kHtfTQLE.cjs +136 -0
- package/dist/chunk-NTY3LDVX-CvRtOCpm.js +363 -0
- package/dist/chunk-NTY3LDVX-DBVRlnMJ.cjs +1 -0
- package/dist/chunk-VPRB5NB3-CT204jN6.cjs +129 -0
- package/dist/{chunk-DU6HZSFF-BW30DVuW.js → chunk-VPRB5NB3-DJh7spRO.js} +791 -611
- package/dist/chunk-XC4XBNZT-BTUjiQhE.cjs +62 -0
- package/dist/{chunk-4HAMMTFA-C2YXJpQw.js → chunk-XC4XBNZT-CSiWBPH9.js} +1378 -1079
- package/dist/classDiagram-v2-K4WV4PDN-BndXIwai.cjs +217 -0
- package/dist/{chunk-HLEWEB6X-BrzeadBj.js → classDiagram-v2-K4WV4PDN-C39xKke0.js} +254 -214
- package/dist/{conversationExport-QWEGKkKB.js → conversationExport-0aa7tXBv.js} +2 -2
- package/dist/{conversationExport-D2ekPeYe.cjs → conversationExport-BVHvnvh5.cjs} +1 -1
- package/dist/conversationHistory-CNfOwM8H.cjs +287 -0
- package/dist/{conversationHistory-BylZCAb1.js → conversationHistory-D-hT7EvD.js} +9066 -6513
- package/dist/cynefin-EF2NZ3EQ-BB_WO8YQ.js +3 -0
- package/dist/cynefin-EF2NZ3EQ-Du3-s5Z7.cjs +1 -0
- package/dist/{cynefinDiagram-5FMLGOSQ-GvGZco52.cjs → cynefinDiagram-3GCD6N5R-Bmvj-sQO.cjs} +1 -1
- package/dist/{cynefinDiagram-5FMLGOSQ-BEFzUfsd.js → cynefinDiagram-3GCD6N5R-C2CRSeJl.js} +14 -14
- package/dist/dagre-W4DXFKR2-ECmxkO0T.js +2356 -0
- package/dist/dagre-W4DXFKR2-aPKdYPEj.cjs +4 -0
- package/dist/diagram-2UJZ2QOL-B1JKtFHG.cjs +200 -0
- package/dist/diagram-2UJZ2QOL-CJRsGDwn.js +5081 -0
- package/dist/{diagram-VX7I27RA-Bx9fEhR0.cjs → diagram-OVF4WLC6-CwZeVpHT.cjs} +1 -1
- package/dist/{diagram-VX7I27RA-BK8jsKkD.js → diagram-OVF4WLC6-D6r6aTeO.js} +61 -61
- package/dist/{diagram-S7CK7UJ4-BH8mrGrv.js → diagram-PFPMY2P6-BpOJbdZ5.js} +15 -15
- package/dist/{diagram-S7CK7UJ4-BA67ZpiO.cjs → diagram-PFPMY2P6-DlLbGc_k.cjs} +3 -3
- package/dist/{diagram-Z3DM3KII-jy895UiZ.cjs → diagram-UMYRVEAY-BE-t_ZdV.cjs} +1 -1
- package/dist/{diagram-Z3DM3KII-CqouFf3D.js → diagram-UMYRVEAY-blW7NpUU.js} +14 -14
- package/dist/{diagram-UQ7AKVKN-Bvz7faiB.js → diagram-YEKJPTXX-BOgf87BN.js} +15 -15
- package/dist/{diagram-UQ7AKVKN-OteiyKD9.cjs → diagram-YEKJPTXX-CeQjir5H.cjs} +2 -2
- package/dist/diagram-ZIFT7M5P-BHePHmHl.cjs +3 -0
- package/dist/{diagram-VSXAHHWV-l9f6spkp.js → diagram-ZIFT7M5P-CZOnEYez.js} +40 -25
- package/dist/{docxExport-DK8uhXvT.js → docxExport-Cyk5ToUi.js} +1 -1
- package/dist/{docxExport-Dt55TJ2h.cjs → docxExport-DF-PXilo.cjs} +1 -1
- package/dist/{ebnfDiagram-PWID7BFC-Bwmmg23f.js → ebnfDiagram-VR2GEFS7-Cr0a3Ho_.js} +5 -5
- package/dist/{ebnfDiagram-PWID7BFC-BQZKHpUr.cjs → ebnfDiagram-VR2GEFS7-cgyTJ-Xs.cjs} +1 -1
- package/dist/elk-IJKZMXRS-NO3xNT-V.cjs +27 -0
- package/dist/elk-IJKZMXRS-V31is6hS.js +47984 -0
- package/dist/{erDiagram-2YWLMYGG-RTHTTqyH.js → erDiagram-O2IAPWRE-CP06GjjM.js} +60 -56
- package/dist/{erDiagram-2YWLMYGG-CuEEIv1I.cjs → erDiagram-O2IAPWRE-CnkFrABC.cjs} +13 -13
- package/dist/eventmodeling-K75KTNOO-CMoz0K5S.js +3 -0
- package/dist/eventmodeling-K75KTNOO-DZdZrgwl.cjs +1 -0
- package/dist/flowDiagram-OXPTDLAJ-BdYr7Idm.cjs +1 -0
- package/dist/flowDiagram-OXPTDLAJ-R_xf7pNW.js +16 -0
- package/dist/{ganttDiagram-EL5Y4UJY-PTWIufq8.cjs → ganttDiagram-R7TSEDQI-Jhax10tw.cjs} +3 -3
- package/dist/{ganttDiagram-EL5Y4UJY-BTvevd1z.js → ganttDiagram-R7TSEDQI-y1bDU8Ba.js} +103 -92
- package/dist/gitGraph-VSP46ZUC-DoTshgkY.js +3 -0
- package/dist/gitGraph-VSP46ZUC-lawIO6K6.cjs +1 -0
- package/dist/{gitGraphDiagram-WWUBYQGX-D5yozoaq.cjs → gitGraphDiagram-XJZIOB7I-CLZLQcPk.cjs} +5 -5
- package/dist/{gitGraphDiagram-WWUBYQGX-Bh9F7wif.js → gitGraphDiagram-XJZIOB7I-CYZa0-Ct.js} +45 -45
- package/dist/info-OHQRW6UA-DPTZOb30.js +3 -0
- package/dist/info-OHQRW6UA-deop1PPz.cjs +1 -0
- package/dist/infoDiagram-5W2HQ5XZ-D8fJK3ph.cjs +2 -0
- package/dist/{infoDiagram-FKFFQAWI-D6en39j4.js → infoDiagram-5W2HQ5XZ-Dw_D4zI1.js} +5 -5
- package/dist/{ishikawaDiagram-5VMMS53U-CvVqTWku.js → ishikawaDiagram-K3B6WC7H-BeLiZFVY.js} +25 -25
- package/dist/{ishikawaDiagram-5VMMS53U-DN23jmFw.cjs → ishikawaDiagram-K3B6WC7H-DtjgiZAB.cjs} +2 -2
- package/dist/{journeyDiagram-EYS64GPL-CqhBN0KZ.js → journeyDiagram-COXZFDF6-B-qvdudB.js} +31 -31
- package/dist/{journeyDiagram-EYS64GPL-Co9rp-Q1.cjs → journeyDiagram-COXZFDF6-Dge2AV0B.cjs} +4 -4
- package/dist/{kanban-definition-UXKFOSKX-DzKPVjAq.cjs → kanban-definition-P3RFRI5V-C02YfFZv.cjs} +4 -4
- package/dist/{kanban-definition-UXKFOSKX-CWx_Y40t.js → kanban-definition-P3RFRI5V-D0XAXDl8.js} +42 -42
- package/dist/{line-D6gR53Af.cjs → line-5eGinYgh.cjs} +1 -1
- package/dist/{line-CwYnx9Ke.js → line-BTenwQwq.js} +1 -1
- package/dist/loadReferencedImage-C60bzMNm.cjs +1 -0
- package/dist/{loadReferencedImage-BKEDAhWQ.js → loadReferencedImage-XQS67fhR.js} +3 -1
- package/dist/mermaid-parser.core-BHBS1DqP.cjs +6 -0
- package/dist/{mermaid-parser.core-DLNlSmfj.js → mermaid-parser.core-CI12FMcX.js} +163 -163
- package/dist/mermaid.core-4MZ-Iwu7.cjs +43 -0
- package/dist/{mermaid.core-DI1iFk6G.js → mermaid.core-BJkDCzqA.js} +875 -1150
- package/dist/{mindmap-definition-THT77NOG-Bo3D8RRT.cjs → mindmap-definition-LZFPQGKD-CXV1hV3a.cjs} +3 -3
- package/dist/{mindmap-definition-THT77NOG-B9hdpQgy.js → mindmap-definition-LZFPQGKD-gYumvdwo.js} +78 -78
- package/dist/packet-JDAUHWVQ-Bcik24Kz.js +3 -0
- package/dist/packet-JDAUHWVQ-CrY7ylWJ.cjs +1 -0
- package/dist/{pegDiagram-XKGWAZYB-Cx-wZf4B.cjs → pegDiagram-BGZESJAR-BICf3jMN.cjs} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-CIBfY2Ob.js → pegDiagram-BGZESJAR-Dw9pRv5d.js} +5 -5
- package/dist/pi-outpost-embed.cjs +9 -10
- package/dist/pi-outpost-embed.js +2833 -2786
- package/dist/pie-XZMESJXO-BYQC-ufi.js +3 -0
- package/dist/pie-XZMESJXO-WjCBboSE.cjs +1 -0
- package/dist/{pieDiagram-E7YTZNPT-BC-pW4cK.cjs → pieDiagram-CAPJLFHJ-CF8cTQpC.cjs} +2 -2
- package/dist/{pieDiagram-E7YTZNPT-SG9oy_nV.js → pieDiagram-CAPJLFHJ-uz37FR9I.js} +18 -18
- package/dist/{quadrantDiagram-AXDQQJYC-C65HQ6gT.js → quadrantDiagram-GDMTTRAM-C4rt8LIh.js} +40 -40
- package/dist/{quadrantDiagram-AXDQQJYC-zPfqM9Q4.cjs → quadrantDiagram-GDMTTRAM-D9SYFJ_P.cjs} +2 -2
- package/dist/radar-ABXABTNO-BoQ7hH7Z.cjs +1 -0
- package/dist/radar-ABXABTNO-MxbyaZja.js +3 -0
- package/dist/railroad-I3PHUGI6-DckUArT-.js +3 -0
- package/dist/railroad-I3PHUGI6-DuGTlHry.cjs +1 -0
- package/dist/railroad-abnf-LNEFI6M7-DmAJaMEu.js +3 -0
- package/dist/railroad-abnf-LNEFI6M7-DoWf9u55.cjs +1 -0
- package/dist/railroad-ebnf-DWYD2UWJ-Bf05ZyW1.cjs +1 -0
- package/dist/railroad-ebnf-DWYD2UWJ-CS2AUYSv.js +3 -0
- package/dist/railroad-peg-JR7BVNR7-B-nctVbV.js +3 -0
- package/dist/railroad-peg-JR7BVNR7-CcV5KH4m.cjs +1 -0
- package/dist/{railroadDiagram-O6MQD6OU-3JsgWyLe.cjs → railroadDiagram-SM67HX2B-GgesxX7v.cjs} +1 -1
- package/dist/{railroadDiagram-O6MQD6OU-DLBEWyaH.js → railroadDiagram-SM67HX2B-T5SG0kEf.js} +5 -5
- package/dist/{requirementDiagram-IS5BZ75X-DwrHgMzq.js → requirementDiagram-X7JNWC4A-BEeCszC1.js} +49 -45
- package/dist/{requirementDiagram-IS5BZ75X-D1BMLxZg.cjs → requirementDiagram-X7JNWC4A-BVzf-VRr.cjs} +11 -11
- package/dist/{sankeyDiagram-P5KCCOFB-D5BHxcxB.cjs → sankeyDiagram-UM26HJRW-CdBXqklJ.cjs} +3 -3
- package/dist/{sankeyDiagram-P5KCCOFB-CcT0ZbW6.js → sankeyDiagram-UM26HJRW-DLDVzhPm.js} +16 -16
- package/dist/{sequenceDiagram-WJ2MYXX4-DM6BpXMT.js → sequenceDiagram-ZO4K6R2Y-B8wM6a-A.js} +704 -619
- package/dist/sequenceDiagram-ZO4K6R2Y-ytX57BES.cjs +169 -0
- package/dist/stateDiagram-v2-TBUQTH76-BTuAbG28.cjs +291 -0
- package/dist/{chunk-ZLD2IHE6-CqnVd2rq.js → stateDiagram-v2-TBUQTH76-PRnBJSrY.js} +271 -174
- package/dist/swimlanes-N4OXWK64-41SBE_L2.cjs +1 -0
- package/dist/{swimlanes-V6O3JKXN-BR7rwPmC.js → swimlanes-N4OXWK64-DipLcZla.js} +1006 -1219
- package/dist/swimlanesDiagram-K3J5GTZL-D6tIMgkj.cjs +8 -0
- package/dist/swimlanesDiagram-K3J5GTZL-_MehEHMi.js +27 -0
- package/dist/timeline-definition-YOQAKGHF-D_LWHCSA.cjs +120 -0
- package/dist/{timeline-definition-24CTP7MA-BQmq-H07.js → timeline-definition-YOQAKGHF-h8_spxIb.js} +210 -206
- package/dist/treeView-D4JQ5SDB-C3ticT1s.cjs +1 -0
- package/dist/treeView-D4JQ5SDB-CEuRf8gK.js +3 -0
- package/dist/treemap-SAJKECNS-BwIfwvl-.cjs +1 -0
- package/dist/treemap-SAJKECNS-DiC0668-.js +3 -0
- package/dist/usecaseDiagram-VIAY4XPW-DCfwvERR.js +7187 -0
- package/dist/usecaseDiagram-VIAY4XPW-PJHZiyJN.cjs +328 -0
- package/dist/{vennDiagram-4TSXK5OY-BdzbrV6i.js → vennDiagram-BLWOH2XV-_zHkfDVB.js} +43 -43
- package/dist/{vennDiagram-4TSXK5OY-D5MMYyff.cjs → vennDiagram-BLWOH2XV-niExkaFk.cjs} +3 -3
- package/dist/wardley-7MLQ67FV-BoIyQQ0E.cjs +1 -0
- package/dist/wardley-7MLQ67FV-CFF6IT1d.js +3 -0
- package/dist/{wardleyDiagram-VM6X3IG4-Ccz1enMd.js → wardleyDiagram-YMQ3BMBF-BKvQkiZP.js} +17 -17
- package/dist/{wardleyDiagram-VM6X3IG4-DzZNzmB8.cjs → wardleyDiagram-YMQ3BMBF-btlDrKA6.cjs} +3 -3
- package/dist/xychartDiagram-TAQBALBS-CkNZcyIi.cjs +7 -0
- package/dist/{xychartDiagram-S5SC5T6Z-B-sQkN_B.js → xychartDiagram-TAQBALBS-DlfKpBG9.js} +34 -30
- package/package.json +2 -2
- package/dist/architecture-7GRP2DOG-BtgYGXkq.cjs +0 -1
- package/dist/architecture-7GRP2DOG-DBQ9eYgM.js +0 -3
- package/dist/c4Diagram-7LVT6UL2-BCrC0RQo.cjs +0 -38
- package/dist/channel-DcrLLvcO.cjs +0 -1
- package/dist/chunk-3NF5O7KM-B-DpUW2r.cjs +0 -168
- package/dist/chunk-4HAMMTFA-CtkrBT7X.cjs +0 -62
- package/dist/chunk-75Z2AOVW-DOXS9ORa.cjs +0 -2
- package/dist/chunk-DU6HZSFF-3Hhp3Fo5.cjs +0 -127
- package/dist/chunk-FOHPRMQF-BNNbqxGX.js +0 -21456
- package/dist/chunk-FOHPRMQF-tmTlwTeH.cjs +0 -161
- package/dist/chunk-GMAD6QVW-B6uvB_wz.cjs +0 -72
- package/dist/chunk-HLEWEB6X-aqFoPl02.cjs +0 -206
- package/dist/chunk-L3NEJ4N5-BaR_9rF3.js +0 -245
- package/dist/chunk-L3NEJ4N5-vW3qRjIb.cjs +0 -1
- package/dist/chunk-OSK3NFVY-DU2FGOlI.cjs +0 -10
- package/dist/chunk-P2QGCYS3-DWeL9spl.cjs +0 -1
- package/dist/chunk-ZLD2IHE6-BZxKwfuv.cjs +0 -231
- package/dist/classDiagram-CYGNFDIV-CQLOfBmz.cjs +0 -1
- package/dist/classDiagram-CYGNFDIV-DsnY_WNO.js +0 -30
- package/dist/classDiagram-v2-TLXNO2FR-CQLOfBmz.cjs +0 -1
- package/dist/classDiagram-v2-TLXNO2FR-DeNpu9ZP.js +0 -30
- package/dist/conversationHistory-BmpdU77I.cjs +0 -286
- package/dist/cynefin-OW5HDTMX-BmLJra-4.cjs +0 -1
- package/dist/cynefin-OW5HDTMX-CfYr_cVN.js +0 -3
- package/dist/dagre-BMKbPnPh.js +0 -1934
- package/dist/dagre-EEW2OxRU.cjs +0 -1
- package/dist/dagre-OS7QT2EB-BtJ6v_Nc.js +0 -425
- package/dist/dagre-OS7QT2EB-DFi6nnZc.cjs +0 -4
- package/dist/diagram-VSXAHHWV-BjsZz1JJ.cjs +0 -3
- package/dist/eventmodeling-NTZA5JFV-D57pc07U.cjs +0 -1
- package/dist/eventmodeling-NTZA5JFV-DUbGOrrF.js +0 -3
- package/dist/flowDiagram-T62WH6J4-YyzE7N5Z.cjs +0 -1
- package/dist/flowDiagram-T62WH6J4-ptBWC6KI.js +0 -16
- package/dist/gitGraph-4MIJSDKK-CY4IuhXZ.js +0 -3
- package/dist/gitGraph-4MIJSDKK-D97vaDci.cjs +0 -1
- package/dist/info-A6RAGUB7-Cx39sHYM.js +0 -3
- package/dist/info-A6RAGUB7-DT06-FB3.cjs +0 -1
- package/dist/infoDiagram-FKFFQAWI-NPtQF4vB.cjs +0 -2
- package/dist/loadReferencedImage-DlRgJ4vm.cjs +0 -1
- package/dist/mermaid-parser.core-CBiDgMLi.cjs +0 -6
- package/dist/mermaid.core-B3QcBB1O.cjs +0 -43
- package/dist/packet-AYTQ26CC-BGX2McoE.cjs +0 -1
- package/dist/packet-AYTQ26CC-IgkU2VYK.js +0 -3
- package/dist/pie-WAS4IAKB-CEyPj3UJ.cjs +0 -1
- package/dist/pie-WAS4IAKB-odE0A7fM.js +0 -3
- package/dist/radar-RG4KPBEZ-ClYJNseM.cjs +0 -1
- package/dist/radar-RG4KPBEZ-DqbNqlJH.js +0 -3
- package/dist/railroad-74A4TZTK-Dzt4afqg.js +0 -3
- package/dist/railroad-74A4TZTK-hSKcr2y6.cjs +0 -1
- package/dist/railroad-abnf-HS5TGJTU-gq2RybTO.js +0 -3
- package/dist/railroad-abnf-HS5TGJTU-irEXz0eI.cjs +0 -1
- package/dist/railroad-ebnf-LZEXJU2U-CG19A1Xj.cjs +0 -1
- package/dist/railroad-ebnf-LZEXJU2U-D-pNpFrj.js +0 -3
- package/dist/railroad-peg-WCYAUIDC-BLdK3QCV.cjs +0 -1
- package/dist/railroad-peg-WCYAUIDC-Bo7wfe--.js +0 -3
- package/dist/sequenceDiagram-WJ2MYXX4-DlVJIIIl.cjs +0 -162
- package/dist/stateDiagram-XQSTLZYL-BhzcW44q.js +0 -220
- package/dist/stateDiagram-XQSTLZYL-mSOJx_Wv.cjs +0 -1
- package/dist/stateDiagram-v2-IH3M54BS-BE5CXOTu.js +0 -30
- package/dist/stateDiagram-v2-IH3M54BS-DAa6SuH4.cjs +0 -1
- package/dist/swimlanes-V6O3JKXN-BooYLGtP.cjs +0 -1
- package/dist/swimlanesDiagram-JKAHXJPX-BaMCBEUQ.cjs +0 -8
- package/dist/swimlanesDiagram-JKAHXJPX-lIPwQ8Mc.js +0 -30
- package/dist/timeline-definition-24CTP7MA-D6sSmprF.cjs +0 -120
- package/dist/treeView-Q6P3EWNA-BmkQxkVU.cjs +0 -1
- package/dist/treeView-Q6P3EWNA-CPEEGmNv.js +0 -3
- package/dist/treemap-WGGIJYW6-CGULpntJ.js +0 -3
- package/dist/treemap-WGGIJYW6-Dmi9HAR8.cjs +0 -1
- package/dist/wardley-WFR3VGLG-9zHZLKh9.js +0 -3
- package/dist/wardley-WFR3VGLG-B6YvLPJA.cjs +0 -1
- package/dist/xychartDiagram-S5SC5T6Z-BOsjfYJh.cjs +0 -7
|
@@ -1,291 +1,78 @@
|
|
|
1
1
|
import { n as e } from "./chunk-Y2CYZVJY-CwsV_8W4.js";
|
|
2
2
|
import { m as t } from "./src-Dkp7vqs8.js";
|
|
3
|
-
import "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
let t = [];
|
|
17
|
-
for (let n = 0; n < e.length - 1; n++) t.push({
|
|
18
|
-
a: e[n],
|
|
19
|
-
b: e[n + 1]
|
|
20
|
-
});
|
|
21
|
-
return t;
|
|
22
|
-
}
|
|
23
|
-
e(s, "buildSegmentList");
|
|
24
|
-
function c(e, t, n, r) {
|
|
25
|
-
let i = t.x - e.x, a = t.y - e.y, s = r.x - n.x, c = r.y - n.y, l = i * c - a * s;
|
|
26
|
-
if (l === 0) return null;
|
|
27
|
-
let u = n.x - e.x, d = n.y - e.y, f = (u * c - d * s) / l, p = (u * a - d * i) / l;
|
|
28
|
-
return f <= o || f >= 1 - o || p <= o || p >= 1 - o ? null : {
|
|
29
|
-
point: {
|
|
30
|
-
x: e.x + f * i,
|
|
31
|
-
y: e.y + f * a
|
|
32
|
-
},
|
|
33
|
-
tA: f,
|
|
34
|
-
tB: p
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
e(c, "segmentIntersection");
|
|
38
|
-
function l(e) {
|
|
39
|
-
return Math.abs(e.b.x - e.a.x) >= Math.abs(e.b.y - e.a.y);
|
|
40
|
-
}
|
|
41
|
-
e(l, "isHorizontalSeg");
|
|
42
|
-
function u(e) {
|
|
43
|
-
let t = [];
|
|
44
|
-
for (let n = 0; n < e.length; n++) {
|
|
45
|
-
let r = e[n], i = s(r.points);
|
|
46
|
-
for (let a = n + 1; a < e.length; a++) {
|
|
47
|
-
let n = e[a], o = s(n.points);
|
|
48
|
-
for (let [e, a] of i.entries()) for (let [i, s] of o.entries()) {
|
|
49
|
-
let o = c(a.a, a.b, s.a, s.b);
|
|
50
|
-
if (!o) continue;
|
|
51
|
-
let u = l(a);
|
|
52
|
-
u !== l(s) && u ? t.push({
|
|
53
|
-
jumpEdgeId: r.id,
|
|
54
|
-
otherEdgeId: n.id,
|
|
55
|
-
segIndex: e,
|
|
56
|
-
t: o.tA,
|
|
57
|
-
point: o.point
|
|
58
|
-
}) : t.push({
|
|
59
|
-
jumpEdgeId: n.id,
|
|
60
|
-
otherEdgeId: r.id,
|
|
61
|
-
segIndex: i,
|
|
62
|
-
t: o.tB,
|
|
63
|
-
point: o.point
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return t;
|
|
69
|
-
}
|
|
70
|
-
e(u, "findEdgeIntersections");
|
|
71
|
-
function d(e) {
|
|
72
|
-
return `${Math.round(e * 1e3) / 1e3}`;
|
|
73
|
-
}
|
|
74
|
-
e(d, "fmt");
|
|
75
|
-
function f(e) {
|
|
76
|
-
return `${d(e.x)},${d(e.y)}`;
|
|
77
|
-
}
|
|
78
|
-
e(f, "pointToString");
|
|
79
|
-
function p(e) {
|
|
80
|
-
let t = e.b.x - e.a.x, n = e.b.y - e.a.y;
|
|
81
|
-
return Math.abs(t) >= Math.abs(n) ? +(t >= 0) : +(n >= 0);
|
|
82
|
-
}
|
|
83
|
-
e(p, "getArcSweepFlag");
|
|
84
|
-
var m = .001;
|
|
85
|
-
function h(e, t) {
|
|
86
|
-
if (e.length < 2) return e.map((e) => ({ ...e }));
|
|
87
|
-
let r = e.map((e) => ({ ...e })), i = t.arrowTypeStart && n[t.arrowTypeStart];
|
|
88
|
-
if (i) {
|
|
89
|
-
let t = e[0], n = e[1], a = Math.atan2(n.y - t.y, n.x - t.x);
|
|
90
|
-
r[0].x = t.x + i * Math.cos(a), r[0].y = t.y + i * Math.sin(a);
|
|
91
|
-
}
|
|
92
|
-
let a = t.arrowTypeEnd && n[t.arrowTypeEnd];
|
|
93
|
-
if (a) {
|
|
94
|
-
let t = e.length, n = e[t - 2], i = e[t - 1], o = Math.atan2(i.y - n.y, i.x - n.x);
|
|
95
|
-
r[t - 1].x = i.x - a * Math.cos(o), r[t - 1].y = i.y - a * Math.sin(o);
|
|
96
|
-
}
|
|
97
|
-
return r;
|
|
98
|
-
}
|
|
99
|
-
e(h, "applyMarkerOffsets");
|
|
100
|
-
function g(e, t, n, r, i) {
|
|
101
|
-
let a = e.point.x, o = e.point.y, s = {
|
|
102
|
-
x: a - t * e.r,
|
|
103
|
-
y: o - n * e.r
|
|
104
|
-
}, c = {
|
|
105
|
-
x: a + t * e.r,
|
|
106
|
-
y: o + n * e.r
|
|
107
|
-
}, l = [`L${f(s)}`];
|
|
108
|
-
return i === "arc" ? l.push(`A${d(e.r)},${d(e.r)} 0 0 ${r} ${f(c)}`) : l.push(`M${f(c)}`), l;
|
|
109
|
-
}
|
|
110
|
-
e(g, "emitJump");
|
|
111
|
-
function _(e, t, n, r) {
|
|
112
|
-
let i = t.x - e.x, o = t.y - e.y, s = n.x - t.x, c = n.y - t.y, l = Math.hypot(i, o), u = Math.hypot(s, c);
|
|
113
|
-
if (l < a || u < a) return null;
|
|
114
|
-
let d = i / l, f = o / l, p = s / u, m = c / u, h = d * p + f * m, g = Math.acos(Math.max(-1, Math.min(1, h)));
|
|
115
|
-
if (g < a || Math.abs(Math.PI - g) < a) return null;
|
|
116
|
-
let _ = Math.min(r / Math.sin(g / 2), l / 2, u / 2);
|
|
117
|
-
return {
|
|
118
|
-
startX: t.x - d * _,
|
|
119
|
-
startY: t.y - f * _,
|
|
120
|
-
endX: t.x + p * _,
|
|
121
|
-
endY: t.y + m * _,
|
|
122
|
-
ctrlX: t.x,
|
|
123
|
-
ctrlY: t.y,
|
|
124
|
-
cutLen: _
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
e(_, "computeRoundedCorner");
|
|
128
|
-
function v(e, t, n) {
|
|
129
|
-
let r = e.points;
|
|
130
|
-
if (r.length < 2) return "";
|
|
131
|
-
let a = h(r, e), o = e.curve === "rounded", c = s(a), l = /* @__PURE__ */ new Map();
|
|
132
|
-
for (let e of t) {
|
|
133
|
-
let t = c[e.segIndex];
|
|
134
|
-
if (!t) continue;
|
|
135
|
-
let r = Math.hypot(t.b.x - t.a.x, t.b.y - t.a.y), i = l.get(e.segIndex) ?? [];
|
|
136
|
-
i.push({
|
|
137
|
-
t: e.t,
|
|
138
|
-
point: e.point,
|
|
139
|
-
d: e.t * r,
|
|
140
|
-
r: n.jumpRadius
|
|
141
|
-
}), l.set(e.segIndex, i);
|
|
142
|
-
}
|
|
143
|
-
let u = [`M${f(a[0])}`];
|
|
144
|
-
for (let e = 0; e < c.length; e++) {
|
|
145
|
-
let t = c[e], r = Math.hypot(t.b.x - t.a.x, t.b.y - t.a.y), s = r === 0 ? 0 : (t.b.x - t.a.x) / r, h = r === 0 ? 0 : (t.b.y - t.a.y) / r, v = p(t), y = 0;
|
|
146
|
-
if (o && e > 0) {
|
|
147
|
-
let t = _(a[e - 1], a[e], a[e + 1] ?? a[e], i);
|
|
148
|
-
t && (y = t.cutLen);
|
|
149
|
-
}
|
|
150
|
-
let b = r, x = null;
|
|
151
|
-
o && e < c.length - 1 && (x = _(a[e], a[e + 1], a[e + 2] ?? a[e + 1], i), x && (b = r - x.cutLen));
|
|
152
|
-
let S = [...l.get(e) ?? []].sort((e, t) => e.t - t.t);
|
|
153
|
-
for (let e of S) e.r = Math.min(e.r, e.d - y, b - e.d);
|
|
154
|
-
for (let e = 0; e < S.length - 1; e++) {
|
|
155
|
-
let t = S[e + 1].d - S[e].d;
|
|
156
|
-
if (S[e].r + S[e + 1].r > t) {
|
|
157
|
-
let n = t / 2;
|
|
158
|
-
S[e].r = Math.min(S[e].r, n), S[e + 1].r = Math.min(S[e + 1].r, n);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
for (let e of S) e.r < m || u.push(...g(e, s, h, v, n.jumpStyle));
|
|
162
|
-
o && x ? (u.push(`L${d(x.startX)},${d(x.startY)}`), u.push(`Q${d(x.ctrlX)},${d(x.ctrlY)} ${d(x.endX)},${d(x.endY)}`)) : u.push(`L${f(t.b)}`);
|
|
163
|
-
}
|
|
164
|
-
return u.join(" ");
|
|
165
|
-
}
|
|
166
|
-
e(v, "rewriteEdgePath");
|
|
167
|
-
function y(e) {
|
|
168
|
-
return /^[\d\s+,.LMelm-]*$/.test(e);
|
|
169
|
-
}
|
|
170
|
-
e(y, "isStraightPath");
|
|
171
|
-
function b(e) {
|
|
172
|
-
return !e || e === "linear" || e === "rounded" || e === "step" || e === "stepBefore" || e === "stepAfter";
|
|
173
|
-
}
|
|
174
|
-
e(b, "curveSupportsLineHops");
|
|
175
|
-
function x(e) {
|
|
176
|
-
if (!e) return null;
|
|
177
|
-
try {
|
|
178
|
-
let t = typeof atob == "function" ? atob(e) : Buffer.from(e, "base64").toString(), n = JSON.parse(t);
|
|
179
|
-
if (!Array.isArray(n)) return null;
|
|
180
|
-
let r = [];
|
|
181
|
-
for (let e of n) e && typeof e.x == "number" && typeof e.y == "number" && r.push({
|
|
182
|
-
x: e.x,
|
|
183
|
-
y: e.y
|
|
184
|
-
});
|
|
185
|
-
return r.length >= 2 ? r : null;
|
|
186
|
-
} catch {
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
e(x, "decodeDataPoints");
|
|
191
|
-
function S(e, t, n) {
|
|
192
|
-
if (!n.enabled) return;
|
|
193
|
-
let r = e.node();
|
|
194
|
-
if (!r) return;
|
|
195
|
-
let i = /* @__PURE__ */ new Map();
|
|
196
|
-
for (let e of t) i.set(e.id, e);
|
|
197
|
-
let a = [], o = /* @__PURE__ */ new Map();
|
|
198
|
-
for (let e of t) {
|
|
199
|
-
let t = typeof CSS < "u" && CSS.escape ? CSS.escape(e.id) : e.id, n = r.querySelector(`path[data-id="${t}"]`);
|
|
200
|
-
if (!n) continue;
|
|
201
|
-
o.set(e.id, n);
|
|
202
|
-
let i = x(n.getAttribute("data-points")) ?? e.points;
|
|
203
|
-
a.push({
|
|
204
|
-
...e,
|
|
205
|
-
points: i
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
let s = u(a);
|
|
209
|
-
if (s.length === 0) return;
|
|
210
|
-
let c = /* @__PURE__ */ new Map();
|
|
211
|
-
for (let e of s) {
|
|
212
|
-
let t = c.get(e.jumpEdgeId) ?? [];
|
|
213
|
-
t.push(e), c.set(e.jumpEdgeId, t);
|
|
214
|
-
}
|
|
215
|
-
for (let e of a) {
|
|
216
|
-
let t = c.get(e.id);
|
|
217
|
-
if (!t || t.length === 0) continue;
|
|
218
|
-
let r = i.get(e.id)?.curve;
|
|
219
|
-
if (r !== void 0 && !b(r)) continue;
|
|
220
|
-
let a = o.get(e.id);
|
|
221
|
-
if (!a || r === void 0 && !y(a.getAttribute("d") ?? "")) continue;
|
|
222
|
-
let s = a.getAttribute("style") ?? "", l = /stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s), u = l ? Number.parseFloat(l[1]) : null, d = l ? Number.parseFloat(l[2]) : null, f = v(e, t, n);
|
|
223
|
-
if (a.setAttribute("d", f), u !== null && d !== null && typeof a.getTotalLength == "function") {
|
|
224
|
-
let e = a.getTotalLength(), t = `0 ${u} ${Math.max(0, e - u - d)} ${d}`, n = s.replace(/stroke-dasharray\s*:[^;]*;?/g, `stroke-dasharray: ${t};`).replace(/;\s*;+/g, ";");
|
|
225
|
-
a.setAttribute("style", n);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
e(S, "applyLineJumpsToSvg");
|
|
230
|
-
function C(e, { measure: t }) {
|
|
3
|
+
import "./chunk-VPRB5NB3-DJh7spRO.js";
|
|
4
|
+
import "./chunk-3YJQHVM4-BNbfg-7y.js";
|
|
5
|
+
import "./chunk-HJ2JQQFS-CgYTXthn.js";
|
|
6
|
+
import "./chunk-E2ZNV5FY-Bu796yUY.js";
|
|
7
|
+
import "./chunk-4EA7E6EY-B5P7n2an.js";
|
|
8
|
+
import "./chunk-XC4XBNZT-CSiWBPH9.js";
|
|
9
|
+
import "./chunk-DBDB3WZW-DpEOsLsQ.js";
|
|
10
|
+
import "./chunk-2BW5OAIV-DWtmlmt_.js";
|
|
11
|
+
import "./chunk-NTY3LDVX-CvRtOCpm.js";
|
|
12
|
+
import { r as n } from "./chunk-FVRAUYC3-tiT7dtx-.js";
|
|
13
|
+
import { t as r } from "./chunk-HTAEGDNF-D4u24-lD.js";
|
|
14
|
+
//#region ../node_modules/mermaid/dist/chunks/mermaid.core/swimlanes-N4OXWK64.mjs
|
|
15
|
+
function i(e, { measure: t }) {
|
|
231
16
|
let n = e.config?.swimlane?.lineHops;
|
|
232
17
|
if (n === !1) return;
|
|
233
|
-
let
|
|
18
|
+
let i = n === "gap" ? "gap" : "arc", a = e.edges.filter((e) => Array.isArray(e.points) && e.points.length >= 2).map((e) => ({
|
|
234
19
|
id: e.id,
|
|
235
20
|
points: e.points,
|
|
236
21
|
curve: e.curve,
|
|
237
22
|
arrowTypeStart: e.arrowTypeStart,
|
|
238
23
|
arrowTypeEnd: e.arrowTypeEnd
|
|
239
24
|
}));
|
|
240
|
-
|
|
25
|
+
r(t.groups.edgePaths, a, {
|
|
241
26
|
enabled: !0,
|
|
242
27
|
jumpRadius: 6,
|
|
243
|
-
jumpStyle:
|
|
28
|
+
jumpStyle: i
|
|
244
29
|
});
|
|
245
30
|
}
|
|
246
|
-
e(
|
|
247
|
-
var
|
|
248
|
-
function
|
|
249
|
-
return Math.max(e.padding ??
|
|
31
|
+
e(i, "applySwimlaneLineJumps");
|
|
32
|
+
var a = "__swimlane_default__", o = 21, s = 20;
|
|
33
|
+
function c(e) {
|
|
34
|
+
return Math.max(e.padding ?? s, s);
|
|
250
35
|
}
|
|
251
|
-
e(
|
|
252
|
-
function
|
|
36
|
+
e(c, "topLaneHorizontalPadding");
|
|
37
|
+
function l(e) {
|
|
253
38
|
let { x: t, y: n, width: r, height: i } = e, a = e.swimlaneContentTop;
|
|
254
39
|
if (typeof t != "number" || typeof n != "number" || typeof r != "number" || typeof i != "number" || typeof a != "number" || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(a) || r <= 0 || i <= 0) {
|
|
255
40
|
delete e.groupTitleRect;
|
|
256
41
|
return;
|
|
257
42
|
}
|
|
258
|
-
let
|
|
259
|
-
if (
|
|
43
|
+
let s = n - i / 2, c = Math.min(a, n + i / 2), l = s + Math.min(o, Math.max(0, c - s));
|
|
44
|
+
if (l <= s) {
|
|
260
45
|
delete e.groupTitleRect;
|
|
261
46
|
return;
|
|
262
47
|
}
|
|
263
48
|
e.groupTitleRect = {
|
|
264
49
|
left: t - r / 2,
|
|
265
50
|
right: t + r / 2,
|
|
266
|
-
top:
|
|
267
|
-
bottom:
|
|
51
|
+
top: s,
|
|
52
|
+
bottom: l
|
|
268
53
|
};
|
|
269
54
|
}
|
|
270
|
-
e(
|
|
271
|
-
function
|
|
55
|
+
e(l, "assignTopLaneTitleRect");
|
|
56
|
+
function u(e) {
|
|
272
57
|
let t = e.direction, n = e.nodes ??= [];
|
|
273
58
|
for (let n of e.nodes ?? []) n.isGroup && !n.parentId && (n.shape = "swimlane", t && (n.direction = t));
|
|
274
59
|
let r = n.filter((e) => !e.isGroup && !e.parentId);
|
|
275
60
|
if (r.length === 0) return;
|
|
276
|
-
let i = n.find((e) => e.id ===
|
|
61
|
+
let i = n.find((e) => e.id === a);
|
|
277
62
|
i ? i.isGroup && (i.shape = "swimlane", t && (i.direction = t)) : (i = {
|
|
278
|
-
id:
|
|
63
|
+
id: a,
|
|
279
64
|
label: "",
|
|
280
65
|
isGroup: !0,
|
|
281
66
|
shape: "swimlane",
|
|
282
67
|
padding: 20,
|
|
68
|
+
look: e.config?.look,
|
|
69
|
+
colorIndex: n.reduce((e, t) => Math.max(e, t.colorIndex ?? -1), -1) + 1,
|
|
283
70
|
...t ? { direction: t } : {}
|
|
284
71
|
}, n.push(i));
|
|
285
|
-
for (let e of r) e.parentId =
|
|
72
|
+
for (let e of r) e.parentId = a;
|
|
286
73
|
}
|
|
287
|
-
e(
|
|
288
|
-
function
|
|
74
|
+
e(u, "prepareLayoutForSwimlanes");
|
|
75
|
+
function d(e) {
|
|
289
76
|
let t = /* @__PURE__ */ new Map();
|
|
290
77
|
for (let n of e.nodes ?? []) t.set(n.id, n);
|
|
291
78
|
let n = [];
|
|
@@ -306,9 +93,9 @@ function A(e) {
|
|
|
306
93
|
nodeById: t
|
|
307
94
|
};
|
|
308
95
|
}
|
|
309
|
-
e(
|
|
310
|
-
function
|
|
311
|
-
let { layout: i } = e, a = e.nodeById, o = r?.layerGap ?? 100, s = r?.nodeGap ?? 40,
|
|
96
|
+
e(d, "toGraphView");
|
|
97
|
+
function f(e, t, n, r) {
|
|
98
|
+
let { layout: i } = e, a = e.nodeById, o = r?.layerGap ?? 100, s = r?.nodeGap ?? 40, u = 0;
|
|
312
99
|
for (let e of t.layers) {
|
|
313
100
|
let t = 0;
|
|
314
101
|
for (let r of e) {
|
|
@@ -317,25 +104,25 @@ function j(e, t, n, r) {
|
|
|
317
104
|
t++;
|
|
318
105
|
continue;
|
|
319
106
|
}
|
|
320
|
-
e.layer =
|
|
321
|
-
let i = n.x[r] ?? t * s,
|
|
322
|
-
e.x = i, e.y =
|
|
107
|
+
e.layer = u, e.order = t;
|
|
108
|
+
let i = n.x[r] ?? t * s, c = n.y[r] ?? u * o;
|
|
109
|
+
e.x = i, e.y = c, t++;
|
|
323
110
|
}
|
|
324
|
-
|
|
111
|
+
u++;
|
|
325
112
|
}
|
|
326
|
-
let
|
|
327
|
-
for (let e of
|
|
113
|
+
let d = i.nodes ?? [], f = /* @__PURE__ */ new Map(), p = [];
|
|
114
|
+
for (let e of d) {
|
|
328
115
|
if (!e?.isGroup) continue;
|
|
329
|
-
e.parentId ||
|
|
330
|
-
let t =
|
|
116
|
+
e.parentId || p.push(e);
|
|
117
|
+
let t = d.filter((t) => t.parentId === e.id), r = Infinity, i = -Infinity, a = Infinity, o = -Infinity;
|
|
331
118
|
for (let e of t) {
|
|
332
119
|
let t = e.x ?? n.x[e.id], s = e.y ?? n.y[e.id], c = e.width ?? 0, l = e.height ?? 0;
|
|
333
120
|
t != null && s != null && (r = Math.min(r, t - c / 2), i = Math.max(i, t + c / 2), a = Math.min(a, s - l / 2), o = Math.max(o, s + l / 2));
|
|
334
121
|
}
|
|
335
122
|
if (r === Infinity || a === Infinity) e.x = e.x ?? 0, e.y = e.y ?? 0, e.width = e.width ?? 0, e.height = e.height ?? 0;
|
|
336
123
|
else {
|
|
337
|
-
let t = e.padding ?? 20, n = e.parentId ? t : 2 *
|
|
338
|
-
e.x = d, e.y =
|
|
124
|
+
let t = e.padding ?? 20, n = e.parentId ? t : 2 * c(e), s = t, l = Math.max(0, i - r) + n, u = Math.max(0, o - a) + s, d = (r + i) / 2, p = (a + o) / 2;
|
|
125
|
+
e.x = d, e.y = p, e.width = l, e.height = u, f.set(e.id, {
|
|
339
126
|
minX: r,
|
|
340
127
|
maxX: i,
|
|
341
128
|
minY: a,
|
|
@@ -343,64 +130,64 @@ function j(e, t, n, r) {
|
|
|
343
130
|
});
|
|
344
131
|
}
|
|
345
132
|
}
|
|
346
|
-
if (
|
|
133
|
+
if (p.length > 0 && f.size > 0) {
|
|
347
134
|
let e = Infinity, t = -Infinity, n = 0;
|
|
348
|
-
for (let r of
|
|
135
|
+
for (let r of p) {
|
|
349
136
|
let i = r.padding ?? 20;
|
|
350
137
|
i > n && (n = i);
|
|
351
|
-
let a =
|
|
138
|
+
let a = f.get(r.id);
|
|
352
139
|
a && (e = Math.min(e, a.minY), t = Math.max(t, a.maxY));
|
|
353
140
|
}
|
|
354
141
|
if (e !== Infinity && t !== -Infinity) {
|
|
355
142
|
let r = Math.max(0, t - e) + 2 * Math.max(n, 36), i = (e + t) / 2;
|
|
356
|
-
for (let t of
|
|
357
|
-
let a = [...
|
|
143
|
+
for (let t of p) t.y = i, t.height = r, t.swimlaneContentTop = e;
|
|
144
|
+
let a = [...p].sort((e, t) => (e.x ?? 0) - (t.x ?? 0)), o = [], s = [], u = [];
|
|
358
145
|
for (let e of a) {
|
|
359
|
-
let t =
|
|
146
|
+
let t = f.get(e.id);
|
|
360
147
|
if (!t) continue;
|
|
361
|
-
let n = Math.max(0, t.maxX - t.minX) + 2 *
|
|
362
|
-
o.push(e.id), s.push(r),
|
|
148
|
+
let n = Math.max(0, t.maxX - t.minX) + 2 * c(e), r = (t.minX + t.maxX) / 2;
|
|
149
|
+
o.push(e.id), s.push(r), u.push(n);
|
|
363
150
|
}
|
|
364
|
-
let
|
|
365
|
-
if (
|
|
151
|
+
let d = o.length;
|
|
152
|
+
if (d > 0) {
|
|
366
153
|
let e = /* @__PURE__ */ new Map();
|
|
367
|
-
if (
|
|
154
|
+
if (d === 1) e.set(o[0], u[0]);
|
|
368
155
|
else {
|
|
369
156
|
let t = [];
|
|
370
|
-
for (let e = 0; e <
|
|
371
|
-
let n = Array(
|
|
157
|
+
for (let e = 0; e < d - 1; e++) t.push(s[e + 1] - s[e]);
|
|
158
|
+
let n = Array(d);
|
|
372
159
|
n[0] = 0;
|
|
373
|
-
for (let e = 0; e <
|
|
160
|
+
for (let e = 0; e < d - 1; e++) n[e + 1] = 2 * t[e] - n[e];
|
|
374
161
|
let r = 0, i = Infinity;
|
|
375
|
-
for (let e = 0; e <
|
|
376
|
-
let t =
|
|
162
|
+
for (let e = 0; e < d; e++) {
|
|
163
|
+
let t = u[e];
|
|
377
164
|
e % 2 == 0 ? r = Math.max(r, t - n[e]) : i = Math.min(i, n[e] - t);
|
|
378
165
|
}
|
|
379
166
|
let a = r;
|
|
380
167
|
a = r <= i ? (r + i) / 2 : r;
|
|
381
|
-
for (let t = 0; t <
|
|
382
|
-
let r = n[t] + (t % 2 == 0 ? a : -a), i = Math.max(
|
|
168
|
+
for (let t = 0; t < d; t++) {
|
|
169
|
+
let r = n[t] + (t % 2 == 0 ? a : -a), i = Math.max(u[t], r);
|
|
383
170
|
e.set(o[t], i);
|
|
384
171
|
}
|
|
385
172
|
}
|
|
386
|
-
for (let t of
|
|
173
|
+
for (let t of p) {
|
|
387
174
|
let n = e.get(t.id);
|
|
388
|
-
n != null && (t.width = n),
|
|
175
|
+
n != null && (t.width = n), l(t);
|
|
389
176
|
}
|
|
390
177
|
}
|
|
391
178
|
}
|
|
392
179
|
}
|
|
393
180
|
}
|
|
394
|
-
e(
|
|
395
|
-
var
|
|
396
|
-
function
|
|
181
|
+
e(f, "writeBackToLayoutData");
|
|
182
|
+
var p = "[EdgeLabelNodes]";
|
|
183
|
+
function m(e) {
|
|
397
184
|
let n = [], r = [], i = /* @__PURE__ */ new Map();
|
|
398
185
|
for (let t of e.nodes) i.set(t.id, t);
|
|
399
186
|
for (let a of e.edges) {
|
|
400
187
|
if (!a.label || a.label.length === 0 || a.isLayoutOnly || a.labelNodeId) continue;
|
|
401
188
|
let e = a.start ? i.get(a.start) : void 0, o = a.end ? i.get(a.end) : void 0;
|
|
402
189
|
if (!e || !o) {
|
|
403
|
-
t.warn(
|
|
190
|
+
t.warn(p, `Edge ${a.id} has missing source or target node`);
|
|
404
191
|
continue;
|
|
405
192
|
}
|
|
406
193
|
let s = `edge-label-${a.start}-${a.end}-${a.id}`, c = e.parentId === o.parentId ? e.parentId : o.parentId, l = {
|
|
@@ -441,20 +228,20 @@ function te(e) {
|
|
|
441
228
|
edges: o
|
|
442
229
|
};
|
|
443
230
|
}
|
|
444
|
-
e(
|
|
445
|
-
var
|
|
446
|
-
function
|
|
231
|
+
e(m, "createEdgeLabelNodes");
|
|
232
|
+
var h = .001;
|
|
233
|
+
function g(e) {
|
|
447
234
|
let t = e.x ?? 0, n = e.y ?? 0, r = e.width ?? 0, i = e.height ?? 0;
|
|
448
235
|
return r > 0 && i > 0 ? {
|
|
449
236
|
cx: t,
|
|
450
237
|
cy: n,
|
|
451
|
-
rect:
|
|
238
|
+
rect: P(t, n, r, i)
|
|
452
239
|
} : void 0;
|
|
453
240
|
}
|
|
454
|
-
e(
|
|
455
|
-
function
|
|
241
|
+
e(g, "measuredNodeRect");
|
|
242
|
+
function _(e) {
|
|
456
243
|
if (e.isGroup) return;
|
|
457
|
-
let t =
|
|
244
|
+
let t = g(e);
|
|
458
245
|
if (t) return {
|
|
459
246
|
id: String(e.id ?? ""),
|
|
460
247
|
cx: t.cx,
|
|
@@ -462,39 +249,39 @@ function N(e) {
|
|
|
462
249
|
rect: t.rect
|
|
463
250
|
};
|
|
464
251
|
}
|
|
465
|
-
e(
|
|
466
|
-
function
|
|
252
|
+
e(_, "nodeBoundsInfoFor");
|
|
253
|
+
function v(e, t, n = h) {
|
|
467
254
|
return Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) < n;
|
|
468
255
|
}
|
|
469
|
-
e(
|
|
470
|
-
function
|
|
256
|
+
e(v, "samePoint");
|
|
257
|
+
function y(e, t, n = h) {
|
|
471
258
|
return Math.abs(e.x - t.x) < n;
|
|
472
259
|
}
|
|
473
|
-
e(
|
|
474
|
-
function
|
|
260
|
+
e(y, "sameX");
|
|
261
|
+
function b(e, t, n = h) {
|
|
475
262
|
return Math.abs(e.y - t.y) < n;
|
|
476
263
|
}
|
|
477
|
-
e(
|
|
478
|
-
function
|
|
479
|
-
return
|
|
264
|
+
e(b, "sameY");
|
|
265
|
+
function x(e, t, n = h) {
|
|
266
|
+
return b(e, t, n) && Math.abs(e.x - t.x) > n;
|
|
480
267
|
}
|
|
481
|
-
e(
|
|
482
|
-
function
|
|
483
|
-
return
|
|
268
|
+
e(x, "isHorizontalSegment");
|
|
269
|
+
function S(e, t, n = h) {
|
|
270
|
+
return y(e, t, n) && Math.abs(e.y - t.y) > n;
|
|
484
271
|
}
|
|
485
|
-
e(
|
|
486
|
-
function
|
|
272
|
+
e(S, "isVerticalSegment");
|
|
273
|
+
function C(e, t, n, r) {
|
|
487
274
|
return Math.max(0, Math.min(Math.max(e, t), Math.max(n, r)) - Math.max(Math.min(e, t), Math.min(n, r)));
|
|
488
275
|
}
|
|
489
|
-
e(
|
|
490
|
-
function
|
|
491
|
-
return e.horizontal && t.horizontal &&
|
|
276
|
+
e(C, "overlapLength");
|
|
277
|
+
function w(e, t, n = h) {
|
|
278
|
+
return e.horizontal && t.horizontal && b(e.a, t.a, n) ? C(e.a.x, e.b.x, t.a.x, t.b.x) : e.vertical && t.vertical && y(e.a, t.a, n) ? C(e.a.y, e.b.y, t.a.y, t.b.y) : 0;
|
|
492
279
|
}
|
|
493
|
-
e(
|
|
494
|
-
function
|
|
280
|
+
e(w, "sameAxisSegmentOverlapLength");
|
|
281
|
+
function T(e, t = h) {
|
|
495
282
|
let n = [];
|
|
496
283
|
for (let r = 0; r < e.length - 1; r++) {
|
|
497
|
-
let i = e[r], a = e[r + 1], o =
|
|
284
|
+
let i = e[r], a = e[r + 1], o = x(i, a, t), s = S(i, a, t);
|
|
498
285
|
(o || s) && n.push({
|
|
499
286
|
index: r,
|
|
500
287
|
a: i,
|
|
@@ -505,35 +292,35 @@ function re(e, t = M) {
|
|
|
505
292
|
}
|
|
506
293
|
return n;
|
|
507
294
|
}
|
|
508
|
-
e(
|
|
509
|
-
function
|
|
510
|
-
let n =
|
|
295
|
+
e(T, "orthogonalSegmentsForPoints");
|
|
296
|
+
function E(e, t = h) {
|
|
297
|
+
let n = T(e, t), r = 0;
|
|
511
298
|
for (let e = 1; e < n.length; e++) n[e - 1].horizontal !== n[e].horizontal && r++;
|
|
512
299
|
return r;
|
|
513
300
|
}
|
|
514
|
-
e(
|
|
515
|
-
function
|
|
301
|
+
e(E, "countOrthogonalBends");
|
|
302
|
+
function D(e, t = h) {
|
|
516
303
|
let n = [];
|
|
517
304
|
for (let r of e) {
|
|
518
305
|
let e = n.length > 0 ? n[n.length - 1] : void 0;
|
|
519
|
-
(!e || !
|
|
306
|
+
(!e || !v(e, r, t)) && n.push({
|
|
520
307
|
x: r.x,
|
|
521
308
|
y: r.y
|
|
522
309
|
});
|
|
523
310
|
}
|
|
524
311
|
return n;
|
|
525
312
|
}
|
|
526
|
-
e(
|
|
527
|
-
function
|
|
313
|
+
e(D, "dedupeConsecutivePoints");
|
|
314
|
+
function O(e, t = h) {
|
|
528
315
|
if (!e || e.length !== 4) return;
|
|
529
316
|
let [n, r, i, a] = e;
|
|
530
|
-
return
|
|
317
|
+
return x(n, r, t) && S(r, i, t) && x(i, a, t) ? {
|
|
531
318
|
kind: "HVH",
|
|
532
319
|
p0: n,
|
|
533
320
|
p1: r,
|
|
534
321
|
p2: i,
|
|
535
322
|
p3: a
|
|
536
|
-
} :
|
|
323
|
+
} : S(n, r, t) && x(r, i, t) && S(i, a, t) ? {
|
|
537
324
|
kind: "VHV",
|
|
538
325
|
p0: n,
|
|
539
326
|
p1: r,
|
|
@@ -541,25 +328,25 @@ function ie(e, t = M) {
|
|
|
541
328
|
p3: a
|
|
542
329
|
} : void 0;
|
|
543
330
|
}
|
|
544
|
-
e(
|
|
545
|
-
function
|
|
331
|
+
e(O, "classifyThreeSegmentRoute");
|
|
332
|
+
function k(e, t, n, r = 0) {
|
|
546
333
|
let i = Math.min(e.x, t.x), a = Math.max(e.x, t.x), o = Math.min(e.y, t.y), s = Math.max(e.y, t.y);
|
|
547
334
|
return a > n.left - r && i < n.right + r && s > n.top - r && o < n.bottom + r;
|
|
548
335
|
}
|
|
549
|
-
e(
|
|
550
|
-
function
|
|
336
|
+
e(k, "segmentBoundsOverlapRect");
|
|
337
|
+
function A(e, t, n = 0) {
|
|
551
338
|
return e.x > t.left + n && e.x < t.right - n && e.y > t.top + n && e.y < t.bottom - n;
|
|
552
339
|
}
|
|
553
|
-
e(
|
|
554
|
-
function
|
|
340
|
+
e(A, "pointInsideRect");
|
|
341
|
+
function j(e, t) {
|
|
555
342
|
return e.left <= t.left && e.right >= t.right && e.top <= t.top && e.bottom >= t.bottom;
|
|
556
343
|
}
|
|
557
|
-
e(
|
|
558
|
-
function
|
|
344
|
+
e(j, "rectContainsRect");
|
|
345
|
+
function M(e, t) {
|
|
559
346
|
return e.left < t.right && e.right > t.left && e.top < t.bottom && e.bottom > t.top;
|
|
560
347
|
}
|
|
561
|
-
e(
|
|
562
|
-
function
|
|
348
|
+
e(M, "rectsOverlap");
|
|
349
|
+
function N(e, t) {
|
|
563
350
|
return {
|
|
564
351
|
left: e.left - t,
|
|
565
352
|
right: e.right + t,
|
|
@@ -567,8 +354,8 @@ function oe(e, t) {
|
|
|
567
354
|
bottom: e.bottom + t
|
|
568
355
|
};
|
|
569
356
|
}
|
|
570
|
-
e(
|
|
571
|
-
function
|
|
357
|
+
e(N, "inflateRect");
|
|
358
|
+
function P(e, t, n, r) {
|
|
572
359
|
return {
|
|
573
360
|
left: e - n / 2,
|
|
574
361
|
right: e + n / 2,
|
|
@@ -576,12 +363,12 @@ function se(e, t, n, r) {
|
|
|
576
363
|
bottom: t + r / 2
|
|
577
364
|
};
|
|
578
365
|
}
|
|
579
|
-
e(
|
|
580
|
-
function
|
|
581
|
-
return
|
|
366
|
+
e(P, "rectFromCenterSize");
|
|
367
|
+
function F(e) {
|
|
368
|
+
return g(e)?.rect;
|
|
582
369
|
}
|
|
583
|
-
e(
|
|
584
|
-
function
|
|
370
|
+
e(F, "rectOfNodeBounds");
|
|
371
|
+
function I(e, t) {
|
|
585
372
|
switch (t) {
|
|
586
373
|
case "top": return {
|
|
587
374
|
x: e.cx,
|
|
@@ -601,12 +388,12 @@ function ce(e, t) {
|
|
|
601
388
|
};
|
|
602
389
|
}
|
|
603
390
|
}
|
|
604
|
-
e(
|
|
605
|
-
function
|
|
391
|
+
e(I, "portForRectSide");
|
|
392
|
+
function ee(e, t, n, r, i, a = h) {
|
|
606
393
|
let o = t === "left" || t === "right", s = r === "left" || r === "right";
|
|
607
394
|
if (o && s) {
|
|
608
395
|
if (t === "right" && r === "left" && e.x < n.x || t === "left" && r === "right" && e.x > n.x) {
|
|
609
|
-
if (
|
|
396
|
+
if (b(e, n, a)) return [e, n];
|
|
610
397
|
let t = (e.x + n.x) / 2;
|
|
611
398
|
return [
|
|
612
399
|
e,
|
|
@@ -622,7 +409,7 @@ function le(e, t, n, r, i, a = M) {
|
|
|
622
409
|
];
|
|
623
410
|
}
|
|
624
411
|
if (t === r) {
|
|
625
|
-
if (
|
|
412
|
+
if (b(e, n, a)) return;
|
|
626
413
|
let r = t === "left" ? Math.min(e.x, n.x) - i : Math.max(e.x, n.x) + i;
|
|
627
414
|
return [
|
|
628
415
|
e,
|
|
@@ -641,7 +428,7 @@ function le(e, t, n, r, i, a = M) {
|
|
|
641
428
|
}
|
|
642
429
|
if (!o && !s) {
|
|
643
430
|
if (t === r) {
|
|
644
|
-
if (
|
|
431
|
+
if (y(e, n, a)) return;
|
|
645
432
|
let r = t === "top" ? Math.min(e.y, n.y) - i : Math.max(e.y, n.y) + i;
|
|
646
433
|
return [
|
|
647
434
|
e,
|
|
@@ -657,7 +444,7 @@ function le(e, t, n, r, i, a = M) {
|
|
|
657
444
|
];
|
|
658
445
|
}
|
|
659
446
|
if (!(t === "bottom" && r === "top" && e.y < n.y || t === "top" && r === "bottom" && e.y > n.y)) return;
|
|
660
|
-
if (
|
|
447
|
+
if (y(e, n, a)) return [e, n];
|
|
661
448
|
let o = (e.y + n.y) / 2;
|
|
662
449
|
return [
|
|
663
450
|
e,
|
|
@@ -693,8 +480,8 @@ function le(e, t, n, r, i, a = M) {
|
|
|
693
480
|
n
|
|
694
481
|
] : void 0;
|
|
695
482
|
}
|
|
696
|
-
e(
|
|
697
|
-
function
|
|
483
|
+
e(ee, "buildOrthogonalPortPath");
|
|
484
|
+
function L(e, t, n, r) {
|
|
698
485
|
return t === "left" || t === "right" ? [
|
|
699
486
|
e,
|
|
700
487
|
{
|
|
@@ -719,12 +506,12 @@ function ue(e, t, n, r) {
|
|
|
719
506
|
n
|
|
720
507
|
];
|
|
721
508
|
}
|
|
722
|
-
e(
|
|
723
|
-
function
|
|
509
|
+
e(L, "buildSameSideTrackPath");
|
|
510
|
+
function R(e) {
|
|
724
511
|
let t = /* @__PURE__ */ new Map(), n = [];
|
|
725
512
|
for (let r of e) {
|
|
726
513
|
if (r.isEdgeLabel) continue;
|
|
727
|
-
let e =
|
|
514
|
+
let e = _(r);
|
|
728
515
|
e && (t.set(e.id, e), n.push({
|
|
729
516
|
id: e.id,
|
|
730
517
|
rect: e.rect
|
|
@@ -735,11 +522,11 @@ function de(e) {
|
|
|
735
522
|
realNodeRects: n
|
|
736
523
|
};
|
|
737
524
|
}
|
|
738
|
-
e(
|
|
739
|
-
function
|
|
525
|
+
e(R, "collectRealNodeBounds");
|
|
526
|
+
function z(e) {
|
|
740
527
|
let t = [], n = [];
|
|
741
528
|
for (let r of e) {
|
|
742
|
-
let e =
|
|
529
|
+
let e = _(r);
|
|
743
530
|
if (!e) continue;
|
|
744
531
|
let i = {
|
|
745
532
|
id: e.id,
|
|
@@ -752,21 +539,21 @@ function q(e) {
|
|
|
752
539
|
labelNodeRects: n
|
|
753
540
|
};
|
|
754
541
|
}
|
|
755
|
-
e(
|
|
756
|
-
function
|
|
542
|
+
e(z, "collectNodeRectEntries");
|
|
543
|
+
function te(e, { includeEdgeLabels: t = !0 } = {}) {
|
|
757
544
|
let n = [];
|
|
758
545
|
for (let r of e) {
|
|
759
546
|
if (r.isGroup || !t && r.isEdgeLabel) continue;
|
|
760
547
|
let e = r.x ?? 0, i = r.y ?? 0, a = r.width ?? 0, o = r.height ?? 0;
|
|
761
548
|
n.push({
|
|
762
549
|
nodeId: r.id,
|
|
763
|
-
...
|
|
550
|
+
...P(e, i, a, o)
|
|
764
551
|
});
|
|
765
552
|
}
|
|
766
553
|
return n;
|
|
767
554
|
}
|
|
768
|
-
e(
|
|
769
|
-
function
|
|
555
|
+
e(te, "collectLayoutNodeRects");
|
|
556
|
+
function ne(e, t, n = h) {
|
|
770
557
|
let r = e.start, i = e.end;
|
|
771
558
|
if (!r || !i) return;
|
|
772
559
|
let a = t.get(r), o = t.get(i);
|
|
@@ -779,14 +566,14 @@ function pe(e, t, n = M) {
|
|
|
779
566
|
collinearY: Math.abs(a.cy - o.cy) < n
|
|
780
567
|
};
|
|
781
568
|
}
|
|
782
|
-
e(
|
|
783
|
-
function
|
|
784
|
-
for (let a of n) if (!r.includes(a.id) &&
|
|
569
|
+
e(ne, "getNodePairGeometry");
|
|
570
|
+
function B(e, t, n, r = [], i = 0) {
|
|
571
|
+
for (let a of n) if (!r.includes(a.id) && k(e, t, a.rect, -i)) return !0;
|
|
785
572
|
return !1;
|
|
786
573
|
}
|
|
787
|
-
e(
|
|
788
|
-
function
|
|
789
|
-
let o =
|
|
574
|
+
e(B, "segmentHitsAnyRect");
|
|
575
|
+
function re(e, t, n, r, i = h, a = 1e-6) {
|
|
576
|
+
let o = b(e, t, i), s = y(e, t, i), c = b(n, r, i), l = y(n, r, i);
|
|
790
577
|
if (o && c || s && l || !(o || s) || !(c || l)) return !1;
|
|
791
578
|
let u = o ? {
|
|
792
579
|
a: e,
|
|
@@ -800,31 +587,31 @@ function me(e, t, n, r, i = M, a = 1e-6) {
|
|
|
800
587
|
} : {
|
|
801
588
|
a: n,
|
|
802
589
|
b: r
|
|
803
|
-
}, f = u.a.y, p = Math.min(u.a.x, u.b.x), m = Math.max(u.a.x, u.b.x),
|
|
804
|
-
if (
|
|
805
|
-
let
|
|
806
|
-
return !(
|
|
807
|
-
}
|
|
808
|
-
e(
|
|
809
|
-
function
|
|
810
|
-
let a =
|
|
811
|
-
return o && c &&
|
|
812
|
-
}
|
|
813
|
-
e(
|
|
814
|
-
function
|
|
590
|
+
}, f = u.a.y, p = Math.min(u.a.x, u.b.x), m = Math.max(u.a.x, u.b.x), g = d.a.x, _ = Math.min(d.a.y, d.b.y), v = Math.max(d.a.y, d.b.y);
|
|
591
|
+
if (g < p || g > m || f < _ || f > v) return !1;
|
|
592
|
+
let x = Math.abs(g - u.a.x) < a && Math.abs(f - u.a.y) < a || Math.abs(g - u.b.x) < a && Math.abs(f - u.b.y) < a, S = Math.abs(g - d.a.x) < a && Math.abs(f - d.a.y) < a || Math.abs(g - d.b.x) < a && Math.abs(f - d.b.y) < a;
|
|
593
|
+
return !(x && S);
|
|
594
|
+
}
|
|
595
|
+
e(re, "orthogonalSegmentsCross");
|
|
596
|
+
function ie(e, t, n, r, i = h) {
|
|
597
|
+
let a = b(e, t, i), o = y(e, t, i), s = b(n, r, i), c = y(n, r, i);
|
|
598
|
+
return o && c && y(e, n, i) ? C(e.y, t.y, n.y, r.y) > i : a && s && b(e, n, i) ? C(e.x, t.x, n.x, r.x) > i : !1;
|
|
599
|
+
}
|
|
600
|
+
e(ie, "sameAxisSegmentsOverlap");
|
|
601
|
+
function ae(e, t, n, r, { epsilon: i = h, skipDegenerateOther: a = !1 } = {}) {
|
|
815
602
|
for (let o of n) {
|
|
816
603
|
if (o === r || o.isLayoutOnly) continue;
|
|
817
604
|
let n = o.points;
|
|
818
605
|
if (!(!n || n.length < 2)) for (let r = 0; r < n.length - 1; r++) {
|
|
819
606
|
let o = n[r], s = n[r + 1];
|
|
820
|
-
if (!(a &&
|
|
607
|
+
if (!(a && v(o, s, i)) && (re(e, t, o, s, i) || ie(e, t, o, s, i))) return !0;
|
|
821
608
|
}
|
|
822
609
|
}
|
|
823
610
|
return !1;
|
|
824
611
|
}
|
|
825
|
-
e(
|
|
826
|
-
function
|
|
827
|
-
let a =
|
|
612
|
+
e(ae, "segmentConflictsWithAnyEdge");
|
|
613
|
+
function V(e, t, n, r, i = h) {
|
|
614
|
+
let a = b(e, t, i), o = y(e, t, i), s = b(n, r, i), c = y(n, r, i);
|
|
828
615
|
if (!(a && c || o && s)) return !1;
|
|
829
616
|
let l = a ? {
|
|
830
617
|
a: e,
|
|
@@ -838,29 +625,29 @@ function _e(e, t, n, r, i = M) {
|
|
|
838
625
|
} : {
|
|
839
626
|
a: e,
|
|
840
627
|
b: t
|
|
841
|
-
}, d = l.a.y, f = Math.min(l.a.x, l.b.x), p = Math.max(l.a.x, l.b.x), m = u.a.x,
|
|
842
|
-
return m > f + i && m < p - i && d >
|
|
628
|
+
}, d = l.a.y, f = Math.min(l.a.x, l.b.x), p = Math.max(l.a.x, l.b.x), m = u.a.x, g = Math.min(u.a.y, u.b.y), _ = Math.max(u.a.y, u.b.y);
|
|
629
|
+
return m > f + i && m < p - i && d > g + i && d < _ - i;
|
|
843
630
|
}
|
|
844
|
-
e(
|
|
845
|
-
function
|
|
631
|
+
e(V, "orthogonalSegmentsStrictlyCross");
|
|
632
|
+
function oe(e, t, n) {
|
|
846
633
|
let r = Math.min(t, n), i = Math.max(t, n);
|
|
847
|
-
return e > r +
|
|
634
|
+
return e > r + h && e < i - h;
|
|
848
635
|
}
|
|
849
|
-
e(
|
|
850
|
-
function
|
|
851
|
-
return
|
|
636
|
+
e(oe, "strictlyBetween");
|
|
637
|
+
function H(e, t, n) {
|
|
638
|
+
return y(e, t) && y(t, n) ? oe(t.y, e.y, n.y) : b(e, t) && b(t, n) ? oe(t.x, e.x, n.x) : !1;
|
|
852
639
|
}
|
|
853
|
-
e(
|
|
854
|
-
function
|
|
640
|
+
e(H, "isCollinearIntermediate");
|
|
641
|
+
function U(e) {
|
|
855
642
|
let t = !1, n = [];
|
|
856
643
|
for (let r = 0; r < e.length; r++) {
|
|
857
644
|
let i = n[n.length - 1], a = e[r], o = r + 1 < e.length ? e[r + 1] : void 0;
|
|
858
645
|
if (i && o) {
|
|
859
|
-
if (
|
|
646
|
+
if (v(i, o)) {
|
|
860
647
|
r++, t = !0;
|
|
861
648
|
continue;
|
|
862
649
|
}
|
|
863
|
-
if (
|
|
650
|
+
if (H(i, a, o)) {
|
|
864
651
|
t = !0;
|
|
865
652
|
continue;
|
|
866
653
|
}
|
|
@@ -872,13 +659,13 @@ function be(e) {
|
|
|
872
659
|
changed: t
|
|
873
660
|
};
|
|
874
661
|
}
|
|
875
|
-
e(
|
|
876
|
-
function
|
|
662
|
+
e(U, "simplifyPolylineOnce");
|
|
663
|
+
function W(e) {
|
|
877
664
|
let t = [e[0]];
|
|
878
665
|
for (let n = 1; n < e.length; n++) {
|
|
879
666
|
let r = t[t.length - 1], i = e[n];
|
|
880
|
-
if (!
|
|
881
|
-
let e = t.length >= 2 ? t[t.length - 2] : void 0, n = e &&
|
|
667
|
+
if (!y(r, i) && !b(r, i)) {
|
|
668
|
+
let e = t.length >= 2 ? t[t.length - 2] : void 0, n = e && y(e, r) ? {
|
|
882
669
|
x: r.x,
|
|
883
670
|
y: i.y
|
|
884
671
|
} : {
|
|
@@ -892,40 +679,40 @@ function xe(e) {
|
|
|
892
679
|
let n = [];
|
|
893
680
|
for (let e of t) {
|
|
894
681
|
let t = n[n.length - 1];
|
|
895
|
-
(!t || !
|
|
682
|
+
(!t || !v(t, e)) && n.push(e);
|
|
896
683
|
}
|
|
897
684
|
return n;
|
|
898
685
|
}
|
|
899
|
-
e(
|
|
900
|
-
function
|
|
686
|
+
e(W, "orthogonalizePolyline");
|
|
687
|
+
function G(e) {
|
|
901
688
|
if (e.length < 3) return e;
|
|
902
689
|
let t = [...e];
|
|
903
690
|
for (let e = 0; e < 32; e++) {
|
|
904
|
-
let e =
|
|
691
|
+
let e = U(t);
|
|
905
692
|
if (t = e.points, !e.changed) break;
|
|
906
693
|
}
|
|
907
694
|
return t;
|
|
908
695
|
}
|
|
909
|
-
e(
|
|
910
|
-
var
|
|
911
|
-
function
|
|
696
|
+
e(G, "simplifyPolyline");
|
|
697
|
+
var K = .001, se = .5, ce = 4;
|
|
698
|
+
function le(e, t, n) {
|
|
912
699
|
let r = e;
|
|
913
700
|
if (r.isLayoutOnly || !r.points || r.points.length < n) return;
|
|
914
701
|
let i = r.start ? t.get(r.start) : void 0, a = r.end ? t.get(r.end) : void 0;
|
|
915
702
|
return {
|
|
916
703
|
edge: r,
|
|
917
704
|
points: r.points,
|
|
918
|
-
srcRect: i ?
|
|
919
|
-
dstRect: a ?
|
|
705
|
+
srcRect: i ? F(i) : void 0,
|
|
706
|
+
dstRect: a ? F(a) : void 0
|
|
920
707
|
};
|
|
921
708
|
}
|
|
922
|
-
e(
|
|
923
|
-
function
|
|
924
|
-
if (
|
|
709
|
+
e(le, "endpointContextFor");
|
|
710
|
+
function ue(e, t, n) {
|
|
711
|
+
if (b(e, t, K)) return {
|
|
925
712
|
x: e.x < n.left ? n.left : n.right,
|
|
926
713
|
y: e.y
|
|
927
714
|
};
|
|
928
|
-
if (
|
|
715
|
+
if (y(e, t, K)) {
|
|
929
716
|
let t = e.y < n.top ? n.top : n.bottom;
|
|
930
717
|
return {
|
|
931
718
|
x: e.x,
|
|
@@ -937,35 +724,35 @@ function Ee(e, t, n) {
|
|
|
937
724
|
y: Math.min(n.bottom, Math.max(n.top, e.y))
|
|
938
725
|
};
|
|
939
726
|
}
|
|
940
|
-
e(
|
|
941
|
-
function
|
|
727
|
+
e(ue, "segmentEnterPoint");
|
|
728
|
+
function de(e, t, n) {
|
|
942
729
|
let r = n ? 1 : -1, i = n ? 0 : e.length - 1;
|
|
943
|
-
for (; i >= 0 && i < e.length &&
|
|
730
|
+
for (; i >= 0 && i < e.length && A(e[i], t, se);) i += r;
|
|
944
731
|
if (i < 0 || i >= e.length) return e;
|
|
945
732
|
let a = i - r;
|
|
946
733
|
if (a < 0 || a >= e.length) return e;
|
|
947
|
-
let o =
|
|
734
|
+
let o = ue(e[i], e[a], t);
|
|
948
735
|
return n ? [o, ...e.slice(i)] : [...e.slice(0, i + 1), o];
|
|
949
736
|
}
|
|
950
|
-
e(
|
|
951
|
-
function
|
|
737
|
+
e(de, "clipEndpoint");
|
|
738
|
+
function q(e, t) {
|
|
952
739
|
for (let n of e) {
|
|
953
|
-
let e =
|
|
740
|
+
let e = le(n, t, 2);
|
|
954
741
|
if (!e) continue;
|
|
955
742
|
let r = [...e.points];
|
|
956
|
-
e.srcRect && (r =
|
|
743
|
+
e.srcRect && (r = de(r, e.srcRect, !0)), e.dstRect && (r = de(r, e.dstRect, !1)), r = G(W(r)), r = xe(r, e.srcRect, e.dstRect), e.edge.points = G(W(r));
|
|
957
744
|
}
|
|
958
745
|
}
|
|
959
|
-
e(
|
|
960
|
-
function
|
|
961
|
-
if (
|
|
962
|
-
if (t.y < n.top -
|
|
746
|
+
e(q, "clipEdgeEndpointsToNodeBoundaries");
|
|
747
|
+
function J(e, t, n, r = !1) {
|
|
748
|
+
if (b(e, t, K)) {
|
|
749
|
+
if (t.y < n.top - K || t.y > n.bottom + K) return t;
|
|
963
750
|
if (r) {
|
|
964
|
-
if (e.x < n.left -
|
|
751
|
+
if (e.x < n.left - K) return {
|
|
965
752
|
x: n.left,
|
|
966
753
|
y: e.y
|
|
967
754
|
};
|
|
968
|
-
if (e.x > n.right +
|
|
755
|
+
if (e.x > n.right + K) return {
|
|
969
756
|
x: n.right,
|
|
970
757
|
y: e.y
|
|
971
758
|
};
|
|
@@ -975,14 +762,14 @@ function ke(e, t, n, r = !1) {
|
|
|
975
762
|
y: e.y
|
|
976
763
|
};
|
|
977
764
|
}
|
|
978
|
-
if (
|
|
979
|
-
if (t.x < n.left -
|
|
765
|
+
if (y(e, t, K)) {
|
|
766
|
+
if (t.x < n.left - K || t.x > n.right + K) return t;
|
|
980
767
|
if (r) {
|
|
981
|
-
if (e.y < n.top -
|
|
768
|
+
if (e.y < n.top - K) return {
|
|
982
769
|
x: e.x,
|
|
983
770
|
y: n.top
|
|
984
771
|
};
|
|
985
|
-
if (e.y > n.bottom +
|
|
772
|
+
if (e.y > n.bottom + K) return {
|
|
986
773
|
x: e.x,
|
|
987
774
|
y: n.bottom
|
|
988
775
|
};
|
|
@@ -995,18 +782,18 @@ function ke(e, t, n, r = !1) {
|
|
|
995
782
|
}
|
|
996
783
|
return t;
|
|
997
784
|
}
|
|
998
|
-
e(
|
|
999
|
-
function
|
|
785
|
+
e(J, "snapEndpointToBoundary");
|
|
786
|
+
function fe(e, t, n) {
|
|
1000
787
|
let r = e[t];
|
|
1001
788
|
for (let i = t + n; i >= 0 && i < e.length; i += n) {
|
|
1002
789
|
let t = e[i];
|
|
1003
|
-
if (!
|
|
790
|
+
if (!v(t, r, K)) return t;
|
|
1004
791
|
}
|
|
1005
792
|
return e[t + n];
|
|
1006
793
|
}
|
|
1007
|
-
e(
|
|
1008
|
-
function
|
|
1009
|
-
let n = e +
|
|
794
|
+
e(fe, "firstDistinctAdjacent");
|
|
795
|
+
function pe(e, t) {
|
|
796
|
+
let n = e + ce, r = t - ce;
|
|
1010
797
|
return n <= r ? {
|
|
1011
798
|
lo: n,
|
|
1012
799
|
hi: r
|
|
@@ -1015,50 +802,50 @@ function je(e, t) {
|
|
|
1015
802
|
hi: (e + t) / 2
|
|
1016
803
|
};
|
|
1017
804
|
}
|
|
1018
|
-
e(
|
|
1019
|
-
function
|
|
1020
|
-
let { lo: r, hi: i } =
|
|
805
|
+
e(pe, "cornerClearanceRange");
|
|
806
|
+
function me(e, t, n) {
|
|
807
|
+
let { lo: r, hi: i } = pe(t, n);
|
|
1021
808
|
return Math.min(i, Math.max(r, e));
|
|
1022
809
|
}
|
|
1023
|
-
e(
|
|
1024
|
-
function
|
|
810
|
+
e(me, "clampToCornerClearance");
|
|
811
|
+
function he(e) {
|
|
1025
812
|
let t = Math.max(...e.map((e) => e.lo)), n = Math.min(...e.map((e) => e.hi));
|
|
1026
813
|
if (!(t > n)) return {
|
|
1027
814
|
lo: t,
|
|
1028
815
|
hi: n
|
|
1029
816
|
};
|
|
1030
817
|
}
|
|
1031
|
-
e(
|
|
1032
|
-
function
|
|
1033
|
-
return t === "left" || t === "right" ?
|
|
1034
|
-
}
|
|
1035
|
-
e(
|
|
1036
|
-
function
|
|
1037
|
-
let r = e.y >= n.top -
|
|
1038
|
-
if (
|
|
1039
|
-
if (Math.abs(e.x - n.left) <
|
|
1040
|
-
if (Math.abs(e.x - n.right) <
|
|
818
|
+
e(he, "intersectRanges");
|
|
819
|
+
function ge(e, t) {
|
|
820
|
+
return t === "left" || t === "right" ? pe(e.top, e.bottom) : pe(e.left, e.right);
|
|
821
|
+
}
|
|
822
|
+
e(ge, "clearanceRangeForSide");
|
|
823
|
+
function _e(e, t, n) {
|
|
824
|
+
let r = e.y >= n.top - K && e.y <= n.bottom + K, i = e.x >= n.left - K && e.x <= n.right + K;
|
|
825
|
+
if (b(e, t, K) && r) {
|
|
826
|
+
if (Math.abs(e.x - n.left) < K) return "left";
|
|
827
|
+
if (Math.abs(e.x - n.right) < K) return "right";
|
|
1041
828
|
}
|
|
1042
|
-
if (
|
|
1043
|
-
if (Math.abs(e.y - n.top) <
|
|
1044
|
-
if (Math.abs(e.y - n.bottom) <
|
|
829
|
+
if (y(e, t, K) && i) {
|
|
830
|
+
if (Math.abs(e.y - n.top) < K) return "top";
|
|
831
|
+
if (Math.abs(e.y - n.bottom) < K) return "bottom";
|
|
1045
832
|
}
|
|
1046
833
|
}
|
|
1047
|
-
e(
|
|
1048
|
-
function
|
|
834
|
+
e(_e, "terminalSideForSegment");
|
|
835
|
+
function ve(e) {
|
|
1049
836
|
return e === "left" || e === "right";
|
|
1050
837
|
}
|
|
1051
|
-
e(
|
|
1052
|
-
function
|
|
1053
|
-
let a = [], o = n ?
|
|
1054
|
-
return n && o &&
|
|
838
|
+
e(ve, "isHorizontalSide");
|
|
839
|
+
function ye(e, t, n, r, i) {
|
|
840
|
+
let a = [], o = n ? _e(e, t, n) : void 0, s = r ? _e(t, e, r) : void 0;
|
|
841
|
+
return n && o && ve(o) === i && a.push(ge(n, o)), r && s && ve(s) === i && a.push(ge(r, s)), a.length > 0 ? he(a) : void 0;
|
|
1055
842
|
}
|
|
1056
|
-
e(
|
|
1057
|
-
function
|
|
1058
|
-
let a =
|
|
843
|
+
e(ye, "straightClearanceRange");
|
|
844
|
+
function be(e, t, n, r, i) {
|
|
845
|
+
let a = ye(e, t, n, r, i);
|
|
1059
846
|
if (!a) return;
|
|
1060
847
|
let o = i ? e.y : e.x, s = Math.min(a.hi, Math.max(a.lo, o));
|
|
1061
|
-
if (!(Math.abs(s - o) <
|
|
848
|
+
if (!(Math.abs(s - o) < K)) return i ? [{
|
|
1062
849
|
x: e.x,
|
|
1063
850
|
y: s
|
|
1064
851
|
}, {
|
|
@@ -1072,97 +859,97 @@ function Re(e, t, n, r, i) {
|
|
|
1072
859
|
y: t.y
|
|
1073
860
|
}];
|
|
1074
861
|
}
|
|
1075
|
-
e(
|
|
1076
|
-
function
|
|
862
|
+
e(be, "clearStraightEndpointCornerAxis");
|
|
863
|
+
function xe(e, t, n) {
|
|
1077
864
|
if (e.length !== 2) return e;
|
|
1078
865
|
let [r, i] = e;
|
|
1079
|
-
return
|
|
866
|
+
return b(r, i, K) ? be(r, i, t, n, !0) ?? e : y(r, i, K) ? be(r, i, t, n, !1) ?? e : e;
|
|
1080
867
|
}
|
|
1081
|
-
e(
|
|
1082
|
-
function
|
|
1083
|
-
return
|
|
868
|
+
e(xe, "clearStraightEndpointCornerConnections");
|
|
869
|
+
function Se(e, t, n) {
|
|
870
|
+
return ve(n) ? {
|
|
1084
871
|
x: e.x,
|
|
1085
|
-
y:
|
|
872
|
+
y: me(e.y, t.top, t.bottom)
|
|
1086
873
|
} : {
|
|
1087
|
-
x:
|
|
874
|
+
x: me(e.x, t.left, t.right),
|
|
1088
875
|
y: e.y
|
|
1089
876
|
};
|
|
1090
877
|
}
|
|
1091
|
-
e(
|
|
1092
|
-
function
|
|
878
|
+
e(Se, "cornerClearedEndpoint");
|
|
879
|
+
function Ce(e, t, n, r, i, a) {
|
|
1093
880
|
let o = e.map((e) => ({ ...e }));
|
|
1094
881
|
for (let s = t; s >= 0 && s < e.length; s += n) {
|
|
1095
882
|
let t = e[s];
|
|
1096
|
-
if (a && !
|
|
883
|
+
if (a && !b(t, r, K) || !a && !y(t, r, K)) break;
|
|
1097
884
|
a ? o[s].y = i.y : o[s].x = i.x;
|
|
1098
885
|
}
|
|
1099
886
|
return o;
|
|
1100
887
|
}
|
|
1101
|
-
e(
|
|
1102
|
-
function
|
|
888
|
+
e(Ce, "moveCollinearEndpointRun");
|
|
889
|
+
function we(e, t, n) {
|
|
1103
890
|
if (e.length < 2) return e;
|
|
1104
|
-
let r = n ? 0 : e.length - 1, i = n ? 1 : -1, a = e[r], o =
|
|
891
|
+
let r = n ? 0 : e.length - 1, i = n ? 1 : -1, a = e[r], o = fe(e, r, i);
|
|
1105
892
|
if (!o) return e;
|
|
1106
|
-
let s =
|
|
893
|
+
let s = _e(a, o, t);
|
|
1107
894
|
if (!s) return e;
|
|
1108
|
-
let c =
|
|
1109
|
-
return
|
|
1110
|
-
}
|
|
1111
|
-
e(
|
|
1112
|
-
function
|
|
1113
|
-
let r = Math.min(e.x, t.x) >= n.left -
|
|
1114
|
-
if (Math.abs(e.y - n.top) <
|
|
1115
|
-
if (Math.abs(e.y - n.bottom) <
|
|
1116
|
-
if (Math.abs(e.x - n.left) <
|
|
1117
|
-
if (Math.abs(e.x - n.right) <
|
|
1118
|
-
}
|
|
1119
|
-
e(
|
|
1120
|
-
function
|
|
895
|
+
let c = ve(s), l = Se(a, t, s);
|
|
896
|
+
return v(a, l, K) ? e : Ce(e, r, i, a, l, c);
|
|
897
|
+
}
|
|
898
|
+
e(we, "clearEndpointCornerConnection");
|
|
899
|
+
function Te(e, t, n) {
|
|
900
|
+
let r = Math.min(e.x, t.x) >= n.left - K && Math.max(e.x, t.x) <= n.right + K, i = Math.min(e.y, t.y) >= n.top - K && Math.max(e.y, t.y) <= n.bottom + K;
|
|
901
|
+
if (Math.abs(e.y - n.top) < K && Math.abs(t.y - n.top) < K && r) return "top";
|
|
902
|
+
if (Math.abs(e.y - n.bottom) < K && Math.abs(t.y - n.bottom) < K && r) return "bottom";
|
|
903
|
+
if (Math.abs(e.x - n.left) < K && Math.abs(t.x - n.left) < K && i) return "left";
|
|
904
|
+
if (Math.abs(e.x - n.right) < K && Math.abs(t.x - n.right) < K && i) return "right";
|
|
905
|
+
}
|
|
906
|
+
e(Te, "borderSideForSegment");
|
|
907
|
+
function Ee(e, t, n, r) {
|
|
1121
908
|
switch (e) {
|
|
1122
|
-
case "top": return
|
|
1123
|
-
case "bottom": return
|
|
1124
|
-
case "left": return
|
|
1125
|
-
case "right": return
|
|
909
|
+
case "top": return y(t, n, K) && n.y < r.top - K;
|
|
910
|
+
case "bottom": return y(t, n, K) && n.y > r.bottom + K;
|
|
911
|
+
case "left": return b(t, n, K) && n.x < r.left - K;
|
|
912
|
+
case "right": return b(t, n, K) && n.x > r.right + K;
|
|
1126
913
|
}
|
|
1127
914
|
}
|
|
1128
|
-
e(
|
|
1129
|
-
function
|
|
915
|
+
e(Ee, "leavesOutward");
|
|
916
|
+
function De(e, t, n) {
|
|
1130
917
|
if (e.length < 3) return e;
|
|
1131
918
|
if (n) {
|
|
1132
|
-
let n =
|
|
1133
|
-
return n &&
|
|
919
|
+
let n = Te(e[0], e[1], t);
|
|
920
|
+
return n && Ee(n, e[1], e[2], t) ? e.slice(1) : e;
|
|
1134
921
|
}
|
|
1135
|
-
let r = e.length - 1, i =
|
|
1136
|
-
return i &&
|
|
922
|
+
let r = e.length - 1, i = Te(e[r - 1], e[r], t);
|
|
923
|
+
return i && Ee(i, e[r - 1], e[r - 2], t) ? e.slice(0, r) : e;
|
|
1137
924
|
}
|
|
1138
|
-
e(
|
|
1139
|
-
function
|
|
925
|
+
e(De, "collapseOwnBorderStub");
|
|
926
|
+
function Oe(e, t, n) {
|
|
1140
927
|
let r = e;
|
|
1141
928
|
if (t) {
|
|
1142
|
-
let e =
|
|
929
|
+
let e = fe(r, 0, 1);
|
|
1143
930
|
if (e) {
|
|
1144
|
-
let n =
|
|
931
|
+
let n = J(e, r[0], t);
|
|
1145
932
|
n !== r[0] && (r = [n, ...r.slice(1)]);
|
|
1146
933
|
}
|
|
1147
|
-
r =
|
|
934
|
+
r = De(r, t, !0);
|
|
1148
935
|
}
|
|
1149
936
|
if (n) {
|
|
1150
|
-
let e = r.length - 1, t =
|
|
937
|
+
let e = r.length - 1, t = fe(r, e, -1);
|
|
1151
938
|
if (t) {
|
|
1152
|
-
let i =
|
|
939
|
+
let i = J(t, r[e], n, !0);
|
|
1153
940
|
i !== r[e] && (r = [...r.slice(0, e), i]);
|
|
1154
941
|
}
|
|
1155
|
-
r =
|
|
942
|
+
r = De(r, n, !1);
|
|
1156
943
|
}
|
|
1157
|
-
let i =
|
|
1158
|
-
return i !== r || r.length === 2 ? i : (t && (r =
|
|
944
|
+
let i = xe(r, t, n);
|
|
945
|
+
return i !== r || r.length === 2 ? i : (t && (r = we(r, t, !0)), n && (r = we(r, n, !1)), r);
|
|
1159
946
|
}
|
|
1160
|
-
e(
|
|
1161
|
-
function
|
|
947
|
+
e(Oe, "snapAndCollapseEndpoints");
|
|
948
|
+
function ke(e, t) {
|
|
1162
949
|
for (let n of e) {
|
|
1163
|
-
let e =
|
|
950
|
+
let e = le(n, t, 2);
|
|
1164
951
|
if (!e) continue;
|
|
1165
|
-
let r =
|
|
952
|
+
let r = Oe(D(e.points, K), e.srcRect, e.dstRect);
|
|
1166
953
|
if (r.length < 3) {
|
|
1167
954
|
e.edge.points = r;
|
|
1168
955
|
continue;
|
|
@@ -1177,12 +964,12 @@ function qe(e, t) {
|
|
|
1177
964
|
e.edge.points = i;
|
|
1178
965
|
}
|
|
1179
966
|
}
|
|
1180
|
-
e(
|
|
1181
|
-
function
|
|
967
|
+
e(ke, "prepareEdgeEndpointsForRenderer");
|
|
968
|
+
function Ae(e) {
|
|
1182
969
|
return new Map(e.map((e) => [e.id, e]));
|
|
1183
970
|
}
|
|
1184
|
-
e(
|
|
1185
|
-
function
|
|
971
|
+
e(Ae, "buildNodeMap");
|
|
972
|
+
function je(e, t) {
|
|
1186
973
|
let n = e.parentId, r = null;
|
|
1187
974
|
for (; n;) {
|
|
1188
975
|
let e = t.get(n);
|
|
@@ -1191,8 +978,8 @@ function Ye(e, t) {
|
|
|
1191
978
|
}
|
|
1192
979
|
return r;
|
|
1193
980
|
}
|
|
1194
|
-
e(
|
|
1195
|
-
function
|
|
981
|
+
e(je, "resolveTopLevelGroupId");
|
|
982
|
+
function Me(e, t) {
|
|
1196
983
|
let n = 0, r = e.parentId;
|
|
1197
984
|
for (; r;) {
|
|
1198
985
|
let e = t.get(r);
|
|
@@ -1201,8 +988,8 @@ function Xe(e, t) {
|
|
|
1201
988
|
}
|
|
1202
989
|
return n;
|
|
1203
990
|
}
|
|
1204
|
-
e(
|
|
1205
|
-
function
|
|
991
|
+
e(Me, "groupDepth");
|
|
992
|
+
function Ne(e) {
|
|
1206
993
|
let t = Infinity, n = -Infinity, r = Infinity, i = -Infinity;
|
|
1207
994
|
for (let a of e) {
|
|
1208
995
|
let e = a.x, o = a.y;
|
|
@@ -1217,21 +1004,21 @@ function Ze(e) {
|
|
|
1217
1004
|
maxY: i
|
|
1218
1005
|
};
|
|
1219
1006
|
}
|
|
1220
|
-
e(
|
|
1221
|
-
function
|
|
1007
|
+
e(Ne, "boundsForChildren");
|
|
1008
|
+
function Pe(e, t) {
|
|
1222
1009
|
let n = e.padding ?? 20;
|
|
1223
1010
|
e.x = (t.minX + t.maxX) / 2, e.y = (t.minY + t.maxY) / 2, e.width = Math.max(0, t.maxX - t.minX) + n, e.height = Math.max(0, t.maxY - t.minY) + n;
|
|
1224
1011
|
}
|
|
1225
|
-
e(
|
|
1226
|
-
function
|
|
1227
|
-
let t =
|
|
1012
|
+
e(Pe, "applyGroupBounds");
|
|
1013
|
+
function Fe(e) {
|
|
1014
|
+
let t = Ae(e), n = e.filter((e) => e.isGroup && e.parentId).sort((e, n) => Me(n, t) - Me(e, t));
|
|
1228
1015
|
for (let t of n) {
|
|
1229
|
-
let n =
|
|
1230
|
-
n &&
|
|
1016
|
+
let n = Ne(e.filter((e) => e.parentId === t.id));
|
|
1017
|
+
n && Pe(t, n);
|
|
1231
1018
|
}
|
|
1232
1019
|
}
|
|
1233
|
-
e(
|
|
1234
|
-
function
|
|
1020
|
+
e(Fe, "recomputeNestedGroupBounds");
|
|
1021
|
+
function Ie(t, n) {
|
|
1235
1022
|
let r = t.nodes ?? [], i = t.edges ?? [], a = r.filter((e) => !e.isGroup), o = Infinity, s = -Infinity;
|
|
1236
1023
|
for (let e of a) {
|
|
1237
1024
|
let t = e[n];
|
|
@@ -1256,12 +1043,12 @@ function et(t, n) {
|
|
|
1256
1043
|
for (let e of i) for (let t of e.points ?? []) t[n] = c(t[n]);
|
|
1257
1044
|
return !0;
|
|
1258
1045
|
}
|
|
1259
|
-
e(
|
|
1260
|
-
function
|
|
1261
|
-
return !(e.nodes ?? []).some((e) => !e.isGroup) ||
|
|
1046
|
+
e(Ie, "mirrorAxis");
|
|
1047
|
+
function Le(e) {
|
|
1048
|
+
return !(e.nodes ?? []).some((e) => !e.isGroup) || Ie(e, "y");
|
|
1262
1049
|
}
|
|
1263
|
-
e(
|
|
1264
|
-
function
|
|
1050
|
+
e(Le, "applyBtDirectionTransform");
|
|
1051
|
+
function Re(e, t = "LR") {
|
|
1265
1052
|
let n = e.nodes ?? [], r = e.edges ?? [], i = n.filter((e) => !e.isGroup), a = Infinity, o = Infinity;
|
|
1266
1053
|
for (let e of i) {
|
|
1267
1054
|
let t = e.x ?? 0, n = e.y ?? 0;
|
|
@@ -1279,13 +1066,13 @@ function nt(e, t = "LR") {
|
|
|
1279
1066
|
let e = t.x, n = (t.y - o) * d + 36, r = e - a;
|
|
1280
1067
|
t.x = n, t.y = r;
|
|
1281
1068
|
}
|
|
1282
|
-
|
|
1069
|
+
Fe(n);
|
|
1283
1070
|
let f = n.filter((e) => e.isGroup && !e.parentId);
|
|
1284
|
-
if (f.length === 0) return t === "RL" &&
|
|
1285
|
-
let p =
|
|
1071
|
+
if (f.length === 0) return t === "RL" && Ie(e, "x"), !0;
|
|
1072
|
+
let p = Ae(n), m = /* @__PURE__ */ new Map();
|
|
1286
1073
|
for (let e of n) {
|
|
1287
1074
|
if (e.isGroup) continue;
|
|
1288
|
-
let t =
|
|
1075
|
+
let t = je(e, p);
|
|
1289
1076
|
if (!t) continue;
|
|
1290
1077
|
let n = m.get(t) ?? [];
|
|
1291
1078
|
n.push(e), m.set(t, n);
|
|
@@ -1297,7 +1084,7 @@ function nt(e, t = "LR") {
|
|
|
1297
1084
|
}
|
|
1298
1085
|
let g = [], _ = Infinity, v = -Infinity;
|
|
1299
1086
|
for (let e of f) {
|
|
1300
|
-
let t =
|
|
1087
|
+
let t = Ne(m.get(e.id) ?? []);
|
|
1301
1088
|
t && (_ = Math.min(_, t.minX), v = Math.max(v, t.maxX), g.push({
|
|
1302
1089
|
lane: e,
|
|
1303
1090
|
contentTop: t.minY,
|
|
@@ -1323,34 +1110,34 @@ function nt(e, t = "LR") {
|
|
|
1323
1110
|
bottom: r
|
|
1324
1111
|
};
|
|
1325
1112
|
}
|
|
1326
|
-
return t === "RL" &&
|
|
1113
|
+
return t === "RL" && Ie(e, "x"), !0;
|
|
1327
1114
|
}
|
|
1328
|
-
e(
|
|
1329
|
-
var
|
|
1115
|
+
e(Re, "applyLrDirectionTransform");
|
|
1116
|
+
var ze = 1e-6, Be = 8, Ve = [
|
|
1330
1117
|
0,
|
|
1331
|
-
|
|
1332
|
-
-
|
|
1333
|
-
2 *
|
|
1334
|
-
-2 *
|
|
1118
|
+
Be,
|
|
1119
|
+
-Be,
|
|
1120
|
+
2 * Be,
|
|
1121
|
+
-2 * Be
|
|
1335
1122
|
];
|
|
1336
|
-
function
|
|
1337
|
-
let { nodeInfoById: n, realNodeRects: r } =
|
|
1123
|
+
function He(e, t) {
|
|
1124
|
+
let { nodeInfoById: n, realNodeRects: r } = R(t);
|
|
1338
1125
|
for (let t of e) {
|
|
1339
1126
|
if (t.isLayoutOnly) continue;
|
|
1340
1127
|
let i = t.points;
|
|
1341
1128
|
if (!i || i.length < 4) continue;
|
|
1342
|
-
let a =
|
|
1129
|
+
let a = O(D(i, ze), ze);
|
|
1343
1130
|
if (!a) continue;
|
|
1344
|
-
let { p3: o } = a, s = a.kind === "HVH", c =
|
|
1131
|
+
let { p3: o } = a, s = a.kind === "HVH", c = ne(t, n, ze);
|
|
1345
1132
|
if (!c) continue;
|
|
1346
1133
|
let { srcId: l, dstId: u, srcInfo: d, dstInfo: f, collinearX: p, collinearY: m } = c;
|
|
1347
1134
|
if (p || m) continue;
|
|
1348
1135
|
let h, g = d.rect;
|
|
1349
|
-
for (let n of
|
|
1136
|
+
for (let n of Ve) {
|
|
1350
1137
|
let i, a, c;
|
|
1351
1138
|
if (s) {
|
|
1352
1139
|
let e = f.cy > d.cy ? g.bottom : g.top, t = d.cx + n;
|
|
1353
|
-
if (t <= g.left +
|
|
1140
|
+
if (t <= g.left + ze || t >= g.right - ze) continue;
|
|
1354
1141
|
i = {
|
|
1355
1142
|
x: t,
|
|
1356
1143
|
y: e
|
|
@@ -1363,7 +1150,7 @@ function ot(e, t) {
|
|
|
1363
1150
|
};
|
|
1364
1151
|
} else {
|
|
1365
1152
|
let e = f.cx > d.cx ? g.right : g.left, t = d.cy + n;
|
|
1366
|
-
if (t <= g.top +
|
|
1153
|
+
if (t <= g.top + ze || t >= g.bottom - ze) continue;
|
|
1367
1154
|
i = {
|
|
1368
1155
|
x: e,
|
|
1369
1156
|
y: t
|
|
@@ -1375,16 +1162,16 @@ function ot(e, t) {
|
|
|
1375
1162
|
y: o.y
|
|
1376
1163
|
};
|
|
1377
1164
|
}
|
|
1378
|
-
let p =
|
|
1379
|
-
if (p && m || !p &&
|
|
1380
|
-
let _ = !p &&
|
|
1381
|
-
epsilon:
|
|
1165
|
+
let p = v(i, a, ze), m = v(a, c, ze);
|
|
1166
|
+
if (p && m || !p && B(i, a, r, [l], 1) || !m && B(a, c, r, [u], 1)) continue;
|
|
1167
|
+
let _ = !p && ae(i, a, e, t, {
|
|
1168
|
+
epsilon: ze,
|
|
1382
1169
|
skipDegenerateOther: !0
|
|
1383
|
-
}),
|
|
1384
|
-
epsilon:
|
|
1170
|
+
}), y = !m && ae(a, c, e, t, {
|
|
1171
|
+
epsilon: ze,
|
|
1385
1172
|
skipDegenerateOther: !0
|
|
1386
1173
|
});
|
|
1387
|
-
if (!(_ ||
|
|
1174
|
+
if (!(_ || y)) {
|
|
1388
1175
|
h = p ? [a, c] : m ? [i, a] : [
|
|
1389
1176
|
i,
|
|
1390
1177
|
a,
|
|
@@ -1396,83 +1183,83 @@ function ot(e, t) {
|
|
|
1396
1183
|
h && (t.points = h);
|
|
1397
1184
|
}
|
|
1398
1185
|
}
|
|
1399
|
-
e(
|
|
1400
|
-
function
|
|
1401
|
-
let r = .001, { realNodeRects: i, labelNodeRects: a } =
|
|
1186
|
+
e(He, "portSwapToLShape");
|
|
1187
|
+
function Ue(t, n) {
|
|
1188
|
+
let r = .001, { realNodeRects: i, labelNodeRects: a } = z(n.values());
|
|
1402
1189
|
for (let o of t) {
|
|
1403
1190
|
if (o.isLayoutOnly) continue;
|
|
1404
1191
|
let s = o.points;
|
|
1405
1192
|
if (!s || s.length < 4) continue;
|
|
1406
|
-
let c =
|
|
1193
|
+
let c = D(s, r);
|
|
1407
1194
|
if (c.length < 4) continue;
|
|
1408
1195
|
let l = c.length - 1, u = c[l], d = c[l - 1], f = c[l - 2], p = u.x - d.x, m = u.y - d.y, h = Math.hypot(p, m);
|
|
1409
1196
|
if (h >= 10 || h < r) continue;
|
|
1410
1197
|
let g = d.x - f.x, _ = d.y - f.y;
|
|
1411
1198
|
if (Math.hypot(g, _) < r) continue;
|
|
1412
|
-
let v =
|
|
1413
|
-
if (!(v &&
|
|
1414
|
-
let
|
|
1415
|
-
if (!
|
|
1416
|
-
let
|
|
1417
|
-
if (!
|
|
1418
|
-
let
|
|
1419
|
-
if (
|
|
1199
|
+
let v = x(d, u, r), C = S(d, u, r), w = x(f, d, r), T = S(f, d, r);
|
|
1200
|
+
if (!(v && T || C && w)) continue;
|
|
1201
|
+
let E = o.end, O = o.start, k = E ? n.get(E) : void 0;
|
|
1202
|
+
if (!k) continue;
|
|
1203
|
+
let j = k.x ?? 0, M = k.y ?? 0, N = F(k);
|
|
1204
|
+
if (!N) continue;
|
|
1205
|
+
let P, I;
|
|
1206
|
+
if (T) {
|
|
1420
1207
|
let e = _ < 0;
|
|
1421
|
-
|
|
1422
|
-
x:
|
|
1208
|
+
P = {
|
|
1209
|
+
x: j,
|
|
1423
1210
|
y: f.y
|
|
1424
|
-
},
|
|
1425
|
-
x:
|
|
1426
|
-
y: e ?
|
|
1211
|
+
}, I = {
|
|
1212
|
+
x: j,
|
|
1213
|
+
y: e ? N.bottom : N.top
|
|
1427
1214
|
};
|
|
1428
1215
|
} else {
|
|
1429
1216
|
let e = g > 0;
|
|
1430
|
-
|
|
1217
|
+
P = {
|
|
1431
1218
|
x: f.x,
|
|
1432
|
-
y:
|
|
1433
|
-
},
|
|
1434
|
-
x: e ?
|
|
1435
|
-
y:
|
|
1219
|
+
y: M
|
|
1220
|
+
}, I = {
|
|
1221
|
+
x: e ? N.right : N.left,
|
|
1222
|
+
y: M
|
|
1436
1223
|
};
|
|
1437
1224
|
}
|
|
1438
|
-
if (
|
|
1439
|
-
if (
|
|
1440
|
-
let e = n.get(
|
|
1441
|
-
if (t &&
|
|
1225
|
+
if (B(P, I, i, E ? [E] : [], -2) || B(P, I, a, [], -2)) continue;
|
|
1226
|
+
if (O) {
|
|
1227
|
+
let e = n.get(O), t = e ? F(e) : void 0;
|
|
1228
|
+
if (t && A(P, t, 2)) continue;
|
|
1442
1229
|
}
|
|
1443
|
-
let
|
|
1444
|
-
for (let e = 0; e < c.length - 1; e++)
|
|
1445
|
-
let
|
|
1230
|
+
let ee = /* @__PURE__ */ e((e, t) => `${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`, "ownSegmentKey"), L = /* @__PURE__ */ new Set();
|
|
1231
|
+
for (let e = 0; e < c.length - 1; e++) L.add(ee(c[e], c[e + 1]));
|
|
1232
|
+
let R = /* @__PURE__ */ e((e, n) => {
|
|
1446
1233
|
for (let i of t) {
|
|
1447
1234
|
if (i === o || i.isLayoutOnly) continue;
|
|
1448
1235
|
let t = i.points;
|
|
1449
1236
|
if (!(!t || t.length < 2)) for (let i = 0; i < t.length - 1; i++) {
|
|
1450
1237
|
let a = t[i], o = t[i + 1];
|
|
1451
|
-
if (!
|
|
1238
|
+
if (!L.has(ee(a, o)) && V(e, n, a, o, r)) return !0;
|
|
1452
1239
|
}
|
|
1453
1240
|
}
|
|
1454
1241
|
return !1;
|
|
1455
1242
|
}, "segmentCrossesOtherEdge");
|
|
1456
|
-
if (
|
|
1243
|
+
if (R(P, I)) continue;
|
|
1457
1244
|
if (l - 3 >= 0) {
|
|
1458
|
-
let e = c[l - 3], t = [
|
|
1459
|
-
if (
|
|
1245
|
+
let e = c[l - 3], t = [O, E].filter((e) => !!e);
|
|
1246
|
+
if (B(e, P, i, t, -2) || R(e, P)) continue;
|
|
1460
1247
|
}
|
|
1461
|
-
let
|
|
1248
|
+
let z = [
|
|
1462
1249
|
...c.slice(0, l - 2),
|
|
1463
|
-
|
|
1464
|
-
|
|
1250
|
+
P,
|
|
1251
|
+
I
|
|
1465
1252
|
];
|
|
1466
|
-
o.points =
|
|
1467
|
-
let
|
|
1468
|
-
if (
|
|
1469
|
-
let e = n.get(
|
|
1253
|
+
o.points = z;
|
|
1254
|
+
let te = o.labelNodeId;
|
|
1255
|
+
if (te) {
|
|
1256
|
+
let e = n.get(te);
|
|
1470
1257
|
if (e) {
|
|
1471
1258
|
let t = e.width ?? 0, n = e.height ?? 0;
|
|
1472
1259
|
if (t > 0 && n > 0) {
|
|
1473
1260
|
let i, a, o = -1;
|
|
1474
|
-
for (let e = 0; e <
|
|
1475
|
-
let s =
|
|
1261
|
+
for (let e = 0; e < z.length - 1; e++) {
|
|
1262
|
+
let s = z[e], c = z[e + 1], l = Math.hypot(c.x - s.x, c.y - s.y), u = b(s, c, r), d = y(s, c, r);
|
|
1476
1263
|
(u && l >= t + 2 || d && l >= n + 2) && l > o && (o = l, i = (s.x + c.x) / 2, a = (s.y + c.y) / 2);
|
|
1477
1264
|
}
|
|
1478
1265
|
i !== void 0 && a !== void 0 && (e.x = i, e.y = a);
|
|
@@ -1481,9 +1268,9 @@ function st(t, n) {
|
|
|
1481
1268
|
}
|
|
1482
1269
|
}
|
|
1483
1270
|
}
|
|
1484
|
-
e(
|
|
1485
|
-
var
|
|
1486
|
-
function
|
|
1271
|
+
e(Ue, "collapseShortTerminalStub");
|
|
1272
|
+
var Y = .001, X = 8, Z = T, We = /* @__PURE__ */ e((e, t) => y(e, t, Y) || b(e, t, Y), "orthogonallyAligned");
|
|
1273
|
+
function Ge(t, n) {
|
|
1487
1274
|
let r = /* @__PURE__ */ e((e, t) => {
|
|
1488
1275
|
let n = e.x ?? 0, r = e.y ?? 0, i = t.x - n, a = t.y - r, o = (e.width ?? 0) / 2, s = (e.height ?? 0) / 2;
|
|
1489
1276
|
return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), {
|
|
@@ -1494,12 +1281,12 @@ function lt(t, n) {
|
|
|
1494
1281
|
y: r + (i === 0 ? 0 : o * a / i)
|
|
1495
1282
|
});
|
|
1496
1283
|
}, "rectIntersect"), i = /* @__PURE__ */ e((e, t) => {
|
|
1497
|
-
let i =
|
|
1284
|
+
let i = D(e.points ?? []);
|
|
1498
1285
|
if (i.length < 2) return;
|
|
1499
|
-
let a = t ? e.start : e.end, o = a ? n.get(a) : void 0, s = o ?
|
|
1286
|
+
let a = t ? e.start : e.end, o = a ? n.get(a) : void 0, s = o ? F(o) : void 0;
|
|
1500
1287
|
if (!o || !a || !s) return;
|
|
1501
1288
|
let c = t ? i[0] : i[i.length - 1], l = t ? i[1] : i[i.length - 2], u = r(o, c), d = c;
|
|
1502
|
-
if (
|
|
1289
|
+
if (We(l, u) && (d = l), y(u, d, Y)) return {
|
|
1503
1290
|
edge: e,
|
|
1504
1291
|
edgeId: String(e.id ?? ""),
|
|
1505
1292
|
nodeId: a,
|
|
@@ -1512,7 +1299,7 @@ function lt(t, n) {
|
|
|
1512
1299
|
railEnd: d,
|
|
1513
1300
|
rect: s
|
|
1514
1301
|
};
|
|
1515
|
-
if (
|
|
1302
|
+
if (b(u, d, Y)) return {
|
|
1516
1303
|
edge: e,
|
|
1517
1304
|
edgeId: String(e.id ?? ""),
|
|
1518
1305
|
nodeId: a,
|
|
@@ -1525,14 +1312,14 @@ function lt(t, n) {
|
|
|
1525
1312
|
railEnd: d,
|
|
1526
1313
|
rect: s
|
|
1527
1314
|
};
|
|
1528
|
-
}, "terminalLaneFor"), a = /* @__PURE__ */ e((e, t) => Math.max(0, Math.min(e.max, t.max) - Math.max(e.min, t.min)), "projectedOverlapLength"), o = /* @__PURE__ */ e((e, t) => e.nodeId !== t.nodeId || e.orientation !== t.orientation ? !1 : e.orientation === "H" ? (Math.abs(e.boundary.x - e.rect.left) < 1 || Math.abs(e.boundary.x - e.rect.right) < 1) &&
|
|
1315
|
+
}, "terminalLaneFor"), a = /* @__PURE__ */ e((e, t) => Math.max(0, Math.min(e.max, t.max) - Math.max(e.min, t.min)), "projectedOverlapLength"), o = /* @__PURE__ */ e((e, t) => e.nodeId !== t.nodeId || e.orientation !== t.orientation ? !1 : e.orientation === "H" ? (Math.abs(e.boundary.x - e.rect.left) < 1 || Math.abs(e.boundary.x - e.rect.right) < 1) && y(e.boundary, t.boundary, 1) : (Math.abs(e.boundary.y - e.rect.top) < 1 || Math.abs(e.boundary.y - e.rect.bottom) < 1) && b(e.boundary, t.boundary, 1), "sameTerminalFace"), s = /* @__PURE__ */ e((e, t) => e.nodeId !== t.nodeId || e.orientation !== t.orientation ? !1 : a(e, t) >= X && Math.abs(e.coord - t.coord) < .5, "exactTerminalLaneConflict"), c = /* @__PURE__ */ e((e, t) => {
|
|
1529
1316
|
if (e.nodeId !== t.nodeId || e.orientation !== t.orientation || e.orientation !== "H" || e.atStart === t.atStart) return !1;
|
|
1530
1317
|
let n = a(e, t);
|
|
1531
|
-
if (n <
|
|
1318
|
+
if (n < X) return !1;
|
|
1532
1319
|
let r = e.rect.bottom - e.rect.top;
|
|
1533
1320
|
return n < r || n > 2 * r ? !1 : o(e, t) && Math.abs(e.coord - t.coord) < 16;
|
|
1534
1321
|
}, "nearTerminalLaneConflict"), l = /* @__PURE__ */ e((t, n) => {
|
|
1535
|
-
let r =
|
|
1322
|
+
let r = D(t.edge.points ?? []);
|
|
1536
1323
|
if (r.length < 2) return;
|
|
1537
1324
|
let i = t.orientation === "V" ? {
|
|
1538
1325
|
x: t.boundary.x + n,
|
|
@@ -1547,28 +1334,28 @@ function lt(t, n) {
|
|
|
1547
1334
|
x: t.railEnd.x,
|
|
1548
1335
|
y: t.railEnd.y + n
|
|
1549
1336
|
};
|
|
1550
|
-
if (!(/* @__PURE__ */ e(() => Math.abs(t.boundary.y - t.rect.top) < 1 || Math.abs(t.boundary.y - t.rect.bottom) < 1 ?
|
|
1337
|
+
if (!(/* @__PURE__ */ e(() => Math.abs(t.boundary.y - t.rect.top) < 1 || Math.abs(t.boundary.y - t.rect.bottom) < 1 ? b(i, t.boundary, Y) && i.x >= t.rect.left + 1 && i.x <= t.rect.right - 1 : Math.abs(t.boundary.x - t.rect.left) < 1 || Math.abs(t.boundary.x - t.rect.right) < 1 ? y(i, t.boundary, Y) && i.y >= t.rect.top + 1 && i.y <= t.rect.bottom - 1 : !1, "boundaryStaysOnSameFace"))()) return;
|
|
1551
1338
|
if (t.atStart) {
|
|
1552
|
-
let e = r.length > 1 &&
|
|
1553
|
-
return o && !
|
|
1339
|
+
let e = r.length > 1 && v(r[1], t.railEnd, Y), n = r.slice(e ? 2 : 1), o = n[0];
|
|
1340
|
+
return o && !We(o, a) ? void 0 : [
|
|
1554
1341
|
i,
|
|
1555
1342
|
a,
|
|
1556
1343
|
...n
|
|
1557
1344
|
];
|
|
1558
1345
|
}
|
|
1559
|
-
let o = r.length > 1 &&
|
|
1560
|
-
if (!(c && !
|
|
1346
|
+
let o = r.length > 1 && v(r[r.length - 2], t.railEnd, Y), s = r.slice(0, o ? -2 : -1), c = s[s.length - 1];
|
|
1347
|
+
if (!(c && !We(c, a))) return [
|
|
1561
1348
|
...s,
|
|
1562
1349
|
a,
|
|
1563
1350
|
i
|
|
1564
1351
|
];
|
|
1565
1352
|
}, "shiftedCandidate"), u = /* @__PURE__ */ e((e) => {
|
|
1566
|
-
let t = e.edge, r =
|
|
1353
|
+
let t = e.edge, r = D(t.points ?? []);
|
|
1567
1354
|
if (r.length !== 2) return !1;
|
|
1568
1355
|
let i = t.start, a = t.end, o = i ? n.get(i) : void 0, s = a ? n.get(a) : void 0;
|
|
1569
1356
|
if (!o || !s) return !1;
|
|
1570
1357
|
let c = o.x ?? 0, l = o.y ?? 0, u = s.x ?? 0, d = s.y ?? 0, [f, p] = r;
|
|
1571
|
-
return
|
|
1358
|
+
return b(f, p, Y) && Math.abs(l - d) < 1 && Math.abs(c - u) > 1 || y(f, p, Y) && Math.abs(c - u) < 1 && Math.abs(l - d) > 1;
|
|
1572
1359
|
}, "laneIsStraightCollinearConnector"), d = [
|
|
1573
1360
|
-7,
|
|
1574
1361
|
7,
|
|
@@ -1605,32 +1392,32 @@ function lt(t, n) {
|
|
|
1605
1392
|
if (!n) return;
|
|
1606
1393
|
}
|
|
1607
1394
|
}
|
|
1608
|
-
e(
|
|
1609
|
-
function
|
|
1610
|
-
let { realNodeRects: r, labelNodeRects: i } =
|
|
1611
|
-
let a = e.start, o = e.end, s =
|
|
1395
|
+
e(Ge, "separateSharedRenderedTerminalLanes");
|
|
1396
|
+
function Ke(t, n) {
|
|
1397
|
+
let { realNodeRects: r, labelNodeRects: i } = z(n.values()), a = /* @__PURE__ */ e((e, n) => {
|
|
1398
|
+
let a = e.start, o = e.end, s = Z(n);
|
|
1612
1399
|
if (s.length !== n.length - 1) return !1;
|
|
1613
1400
|
let c = [a, o].filter((e) => !!e);
|
|
1614
|
-
for (let e of s) if (
|
|
1401
|
+
for (let e of s) if (B(e.a, e.b, r, c, -2) || B(e.a, e.b, i, [], -2)) return !1;
|
|
1615
1402
|
for (let n of t) {
|
|
1616
1403
|
if (n === e || n.isLayoutOnly) continue;
|
|
1617
1404
|
let t = n.points;
|
|
1618
1405
|
if (!(!t || t.length < 2)) {
|
|
1619
|
-
for (let e of s) for (let n of
|
|
1406
|
+
for (let e of s) for (let n of Z(D(t))) if (w(e, n, .5) >= X || V(e.a, e.b, n.a, n.b, Y)) return !1;
|
|
1620
1407
|
}
|
|
1621
1408
|
}
|
|
1622
1409
|
return !0;
|
|
1623
1410
|
}, "candidateIsSafe"), o = /* @__PURE__ */ e((e, t) => {
|
|
1624
1411
|
if (t + 4 >= e.length) return;
|
|
1625
|
-
let n = e[t], r = e[t + 1], i = e[t + 2], a = e[t + 3], o = e[t + 4], s =
|
|
1626
|
-
if (s || c) return
|
|
1412
|
+
let n = e[t], r = e[t + 1], i = e[t + 2], a = e[t + 3], o = e[t + 4], s = x(n, r) && S(r, i) && x(i, a) && S(a, o) && y(n, a, Y) && y(n, o, Y) && y(r, i, Y) && (r.x - n.x) * (a.x - i.x) < 0, c = S(n, r) && x(r, i) && S(i, a) && x(a, o) && b(n, a, Y) && b(n, o, Y) && b(r, i, Y) && (r.y - n.y) * (a.y - i.y) < 0;
|
|
1413
|
+
if (s || c) return D([
|
|
1627
1414
|
...e.slice(0, t + 1),
|
|
1628
1415
|
o,
|
|
1629
1416
|
...e.slice(t + 5)
|
|
1630
1417
|
]);
|
|
1631
1418
|
if (t + 5 >= e.length) return;
|
|
1632
|
-
let l = e[t + 5], u =
|
|
1633
|
-
if (!(!u && !d)) return
|
|
1419
|
+
let l = e[t + 5], u = S(n, r) && x(r, i) && S(i, a) && x(a, o) && S(o, l) && y(n, o, Y) && y(n, l, Y) && y(i, a, Y) && (i.x - r.x) * (o.x - a.x) < 0, d = x(n, r) && S(r, i) && x(i, a) && S(a, o) && x(o, l) && b(n, o, Y) && b(n, l, Y) && b(i, a, Y) && (i.y - r.y) * (o.y - a.y) < 0;
|
|
1420
|
+
if (!(!u && !d)) return D([
|
|
1634
1421
|
...e.slice(0, t + 1),
|
|
1635
1422
|
l,
|
|
1636
1423
|
...e.slice(t + 6)
|
|
@@ -1640,7 +1427,7 @@ function ut(t, n) {
|
|
|
1640
1427
|
let e = !1;
|
|
1641
1428
|
for (let n of t) {
|
|
1642
1429
|
if (n.isLayoutOnly) continue;
|
|
1643
|
-
let t =
|
|
1430
|
+
let t = D(n.points ?? []);
|
|
1644
1431
|
for (let r = 0; r <= t.length - 5; r++) {
|
|
1645
1432
|
let i = o(t, r);
|
|
1646
1433
|
if (!(!i || !a(n, i))) {
|
|
@@ -1653,20 +1440,20 @@ function ut(t, n) {
|
|
|
1653
1440
|
if (!e) return;
|
|
1654
1441
|
}
|
|
1655
1442
|
}
|
|
1656
|
-
e(
|
|
1657
|
-
function
|
|
1658
|
-
let { realNodeRects: r, labelNodeRects: i } =
|
|
1443
|
+
e(Ke, "collapseRedundantRectangularDoglegs");
|
|
1444
|
+
function qe(t, n) {
|
|
1445
|
+
let { realNodeRects: r, labelNodeRects: i } = z(n.values()), a = t.filter((e) => !e.isLayoutOnly), o = /* @__PURE__ */ e((e, t, n) => D(e === t ? n ?? [] : e.points ?? []), "pointsFor"), s = /* @__PURE__ */ e((e, t) => {
|
|
1659
1446
|
let n = 0;
|
|
1660
1447
|
for (let r = 0; r < a.length; r++) {
|
|
1661
|
-
let i =
|
|
1448
|
+
let i = Z(o(a[r], e, t));
|
|
1662
1449
|
for (let s = r + 1; s < a.length; s++) {
|
|
1663
|
-
let r =
|
|
1664
|
-
for (let e of i) for (let t of r)
|
|
1450
|
+
let r = Z(o(a[s], e, t));
|
|
1451
|
+
for (let e of i) for (let t of r) V(e.a, e.b, t.a, t.b, Y) && n++;
|
|
1665
1452
|
}
|
|
1666
1453
|
}
|
|
1667
1454
|
return n;
|
|
1668
1455
|
}, "strictCrossingCount"), c = /* @__PURE__ */ e((e) => {
|
|
1669
|
-
let t =
|
|
1456
|
+
let t = Z(e);
|
|
1670
1457
|
if (t.length !== 3) return;
|
|
1671
1458
|
let n = t[1];
|
|
1672
1459
|
if (t[0].horizontal !== n.horizontal && t[2].horizontal !== n.horizontal) return {
|
|
@@ -1680,21 +1467,21 @@ function dt(t, n) {
|
|
|
1680
1467
|
return r.filter((e) => {
|
|
1681
1468
|
if (n.includes(e.id)) return !1;
|
|
1682
1469
|
let r = e.rect;
|
|
1683
|
-
return t.horizontal ?
|
|
1470
|
+
return t.horizontal ? C(t.a.x, t.b.x, r.left, r.right) >= X && t.a.y >= r.top - 2 && t.a.y <= r.bottom + 2 : C(t.a.y, t.b.y, r.top, r.bottom) >= X && t.a.x >= r.left - 2 && t.a.x <= r.right + 2;
|
|
1684
1471
|
});
|
|
1685
1472
|
}, "blockingRectsFor"), u = /* @__PURE__ */ e((e, t, n) => {
|
|
1686
1473
|
let r = e.map((e) => ({ ...e }));
|
|
1687
1474
|
if (t.horizontal) r[t.index].y = n, r[t.index + 1].y = n;
|
|
1688
1475
|
else if (t.vertical) r[t.index].x = n, r[t.index + 1].x = n;
|
|
1689
1476
|
else return;
|
|
1690
|
-
let i =
|
|
1691
|
-
return
|
|
1477
|
+
let i = G(D(r));
|
|
1478
|
+
return Z(i).length === i.length - 1 ? i : void 0;
|
|
1692
1479
|
}, "candidateByMovingRail"), d = /* @__PURE__ */ e((e, t, n) => {
|
|
1693
|
-
let c = [e.start, e.end].filter((e) => !!e), l =
|
|
1480
|
+
let c = [e.start, e.end].filter((e) => !!e), l = Z(t);
|
|
1694
1481
|
if (l.length !== t.length - 1) return !1;
|
|
1695
|
-
for (let e of l) if (
|
|
1482
|
+
for (let e of l) if (B(e.a, e.b, r, c, -2) || B(e.a, e.b, i, [], -2)) return !1;
|
|
1696
1483
|
for (let t of a) if (t !== e) {
|
|
1697
|
-
for (let e of l) for (let n of
|
|
1484
|
+
for (let e of l) for (let n of Z(o(t))) if (w(e, n, .5) >= X) return !1;
|
|
1698
1485
|
}
|
|
1699
1486
|
return s(e, t) <= n;
|
|
1700
1487
|
}, "candidateIsSafe");
|
|
@@ -1718,8 +1505,8 @@ function dt(t, n) {
|
|
|
1718
1505
|
if (!t) return;
|
|
1719
1506
|
}
|
|
1720
1507
|
}
|
|
1721
|
-
e(
|
|
1722
|
-
function
|
|
1508
|
+
e(qe, "liftObstacleHuggingSameSideRails");
|
|
1509
|
+
function Je(t, n) {
|
|
1723
1510
|
let r = /* @__PURE__ */ e((e) => {
|
|
1724
1511
|
let t = e.groupTitleRect;
|
|
1725
1512
|
if (!(!t || typeof t.left != "number" || typeof t.right != "number" || typeof t.top != "number" || typeof t.bottom != "number" || !Number.isFinite(t.left) || !Number.isFinite(t.right) || !Number.isFinite(t.top) || !Number.isFinite(t.bottom) || t.right <= t.left || t.bottom <= t.top)) return {
|
|
@@ -1742,16 +1529,16 @@ function ft(t, n) {
|
|
|
1742
1529
|
}, "topLaneTitleFor"), a = /* @__PURE__ */ e((e, t) => {
|
|
1743
1530
|
if (!e.horizontal) return !1;
|
|
1744
1531
|
let n = e.a.y;
|
|
1745
|
-
return n <= t.top +
|
|
1532
|
+
return n <= t.top + Y || n >= t.bottom - Y ? !1 : C(e.a.x, e.b.x, t.left, t.right) >= X;
|
|
1746
1533
|
}, "horizontalSegmentIntersectsTitle"), o = [...n.values()].map(i).filter((e) => !!e);
|
|
1747
1534
|
if (o.length === 0) return;
|
|
1748
1535
|
let s = 0;
|
|
1749
1536
|
for (let e of t) {
|
|
1750
1537
|
if (e.isLayoutOnly) continue;
|
|
1751
|
-
let t =
|
|
1752
|
-
for (let e of
|
|
1538
|
+
let t = D(e.points ?? []);
|
|
1539
|
+
for (let e of Z(t)) for (let t of o) a(e, t.rect) && (s = Math.max(s, t.rect.bottom - e.a.y + 4));
|
|
1753
1540
|
}
|
|
1754
|
-
if (!(s <=
|
|
1541
|
+
if (!(s <= Y)) for (let e of o) {
|
|
1755
1542
|
let t = e.node.y, n = e.node.height;
|
|
1756
1543
|
typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || n <= 0 || (e.node.y = t - s / 2, e.node.height = n + s, e.node.groupTitleRect = {
|
|
1757
1544
|
...e.rect,
|
|
@@ -1760,8 +1547,8 @@ function ft(t, n) {
|
|
|
1760
1547
|
});
|
|
1761
1548
|
}
|
|
1762
1549
|
}
|
|
1763
|
-
e(
|
|
1764
|
-
function
|
|
1550
|
+
e(Je, "liftTopLaneTitleBandsAboveRails");
|
|
1551
|
+
function Ye(t, n) {
|
|
1765
1552
|
let r = /* @__PURE__ */ e((e) => {
|
|
1766
1553
|
let t = e.groupTitleRect;
|
|
1767
1554
|
if (!(!t || typeof t.left != "number" || typeof t.right != "number" || typeof t.top != "number" || typeof t.bottom != "number" || !Number.isFinite(t.left) || !Number.isFinite(t.right) || !Number.isFinite(t.top) || !Number.isFinite(t.bottom) || t.right <= t.left || t.bottom <= t.top)) return {
|
|
@@ -1782,24 +1569,24 @@ function pt(t, n) {
|
|
|
1782
1569
|
}, "leftLaneTitleFor"), a = /* @__PURE__ */ e((e, t) => {
|
|
1783
1570
|
if (!e.vertical) return !1;
|
|
1784
1571
|
let n = e.a.x;
|
|
1785
|
-
return n <= t.left +
|
|
1572
|
+
return n <= t.left + Y || n >= t.right - Y ? !1 : C(e.a.y, e.b.y, t.top, t.bottom) >= X;
|
|
1786
1573
|
}, "verticalSegmentIntersectsTitle"), o = /* @__PURE__ */ e((e, t) => {
|
|
1787
1574
|
if (!e.horizontal) return !1;
|
|
1788
1575
|
let n = e.a.y;
|
|
1789
|
-
return n <= t.top +
|
|
1576
|
+
return n <= t.top + Y || n >= t.bottom - Y ? !1 : C(e.a.x, e.b.x, t.left, t.right) >= X;
|
|
1790
1577
|
}, "horizontalSegmentIntersectsTitle"), s = [...n.values()].map(i).filter((e) => !!e);
|
|
1791
1578
|
if (s.length === 0) return;
|
|
1792
1579
|
let c = 0;
|
|
1793
1580
|
for (let e of t) {
|
|
1794
1581
|
if (e.isLayoutOnly) continue;
|
|
1795
|
-
let t =
|
|
1796
|
-
for (let e of
|
|
1582
|
+
let t = D(e.points ?? []);
|
|
1583
|
+
for (let e of Z(t)) for (let t of s) if (a(e, t.rect)) c = Math.max(c, t.rect.right - e.a.x + 4);
|
|
1797
1584
|
else if (o(e, t.rect)) {
|
|
1798
1585
|
let n = Math.min(e.a.x, e.b.x);
|
|
1799
1586
|
c = Math.max(c, t.rect.right - n + 4);
|
|
1800
1587
|
}
|
|
1801
1588
|
}
|
|
1802
|
-
if (!(c <=
|
|
1589
|
+
if (!(c <= Y)) for (let e of s) {
|
|
1803
1590
|
let t = e.node.x, n = e.node.width;
|
|
1804
1591
|
typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || n <= 0 || (e.node.x = t - c / 2, e.node.width = n + c, e.node.groupTitleRect = {
|
|
1805
1592
|
...e.rect,
|
|
@@ -1808,23 +1595,23 @@ function pt(t, n) {
|
|
|
1808
1595
|
});
|
|
1809
1596
|
}
|
|
1810
1597
|
}
|
|
1811
|
-
e(
|
|
1812
|
-
function
|
|
1813
|
-
let { realNodeRects: r } =
|
|
1598
|
+
e(Ye, "shiftLeftLaneTitleBandsLeftOfRails");
|
|
1599
|
+
function Xe(t, n) {
|
|
1600
|
+
let { realNodeRects: r } = z(n.values()), i = t.filter((e) => !e.isLayoutOnly), a = /* @__PURE__ */ e((e, t = /* @__PURE__ */ new Map()) => D(t.get(e) ?? e.points ?? []), "replacementPointsFor"), o = /* @__PURE__ */ e((e = /* @__PURE__ */ new Map()) => {
|
|
1814
1601
|
let t = 0;
|
|
1815
1602
|
for (let n = 0; n < i.length; n++) {
|
|
1816
|
-
let r =
|
|
1603
|
+
let r = Z(a(i[n], e));
|
|
1817
1604
|
for (let o = n + 1; o < i.length; o++) {
|
|
1818
|
-
let n =
|
|
1819
|
-
for (let e of r) for (let r of n)
|
|
1605
|
+
let n = Z(a(i[o], e));
|
|
1606
|
+
for (let e of r) for (let r of n) V(e.a, e.b, r.a, r.b, Y) && t++;
|
|
1820
1607
|
}
|
|
1821
1608
|
}
|
|
1822
1609
|
return t;
|
|
1823
|
-
}, "crossingCount"), s = /* @__PURE__ */ e((e = /* @__PURE__ */ new Map()) => i.reduce((t, n) => t +
|
|
1610
|
+
}, "crossingCount"), s = /* @__PURE__ */ e((e = /* @__PURE__ */ new Map()) => i.reduce((t, n) => t + E(a(n, e)), 0), "totalBends"), c = /* @__PURE__ */ e((e) => {
|
|
1824
1611
|
let t = a(e);
|
|
1825
1612
|
if (t.length < 4) return;
|
|
1826
1613
|
let n = t[t.length - 2], r = t[t.length - 1];
|
|
1827
|
-
if (!(!
|
|
1614
|
+
if (!(!x(n, r, Y) && !S(n, r, Y))) return {
|
|
1828
1615
|
tailStart: n,
|
|
1829
1616
|
terminal: r
|
|
1830
1617
|
};
|
|
@@ -1832,30 +1619,30 @@ function mt(t, n) {
|
|
|
1832
1619
|
let n = a(e);
|
|
1833
1620
|
if (n.length < 3) return;
|
|
1834
1621
|
let r = n[0], i = n[1], o;
|
|
1835
|
-
if (
|
|
1622
|
+
if (x(r, i, Y)) o = {
|
|
1836
1623
|
x: i.x,
|
|
1837
1624
|
y: t.tailStart.y
|
|
1838
1625
|
};
|
|
1839
|
-
else if (
|
|
1626
|
+
else if (S(r, i, Y)) o = {
|
|
1840
1627
|
x: t.tailStart.x,
|
|
1841
1628
|
y: i.y
|
|
1842
1629
|
};
|
|
1843
1630
|
else return;
|
|
1844
|
-
let s =
|
|
1631
|
+
let s = G(D([
|
|
1845
1632
|
r,
|
|
1846
1633
|
i,
|
|
1847
1634
|
o,
|
|
1848
1635
|
t.tailStart,
|
|
1849
1636
|
t.terminal
|
|
1850
1637
|
]));
|
|
1851
|
-
return
|
|
1638
|
+
return Z(s).length === s.length - 1 ? s : void 0;
|
|
1852
1639
|
}, "candidateWithDestinationTail"), u = /* @__PURE__ */ e((e, t) => {
|
|
1853
1640
|
let n = [e.start, e.end].filter((e) => !!e);
|
|
1854
|
-
for (let e of
|
|
1641
|
+
for (let e of Z(t)) if (B(e.a, e.b, r, n, -2)) return !0;
|
|
1855
1642
|
return !1;
|
|
1856
1643
|
}, "pathHasNodeHit"), d = /* @__PURE__ */ e((e, t, n) => {
|
|
1857
1644
|
for (let r of i) if (r !== e) {
|
|
1858
|
-
for (let e of
|
|
1645
|
+
for (let e of Z(t)) for (let t of Z(a(r, n))) if (w(e, t, .5) >= X) return !0;
|
|
1859
1646
|
}
|
|
1860
1647
|
return !1;
|
|
1861
1648
|
}, "pathHasSharedTrack"), f = /* @__PURE__ */ e((e, t, n) => !u(e, t) && !d(e, t, n), "candidateIsSafe"), p = /* @__PURE__ */ e(() => {
|
|
@@ -1886,20 +1673,20 @@ function mt(t, n) {
|
|
|
1886
1673
|
for (let [e, t] of n) e.points = t;
|
|
1887
1674
|
}
|
|
1888
1675
|
}
|
|
1889
|
-
e(
|
|
1890
|
-
function
|
|
1891
|
-
let { realNodeRects: r, labelNodeRects: i } =
|
|
1676
|
+
e(Xe, "swapDestinationTerminalTailsToReduceCrossings");
|
|
1677
|
+
function Ze(t, n) {
|
|
1678
|
+
let { realNodeRects: r, labelNodeRects: i } = z(n.values()), a = t.filter((e) => !e.isLayoutOnly), o = /* @__PURE__ */ e((e, t = /* @__PURE__ */ new Map()) => D(t.get(e) ?? e.points ?? []), "replacementPointsFor"), s = /* @__PURE__ */ e((e = /* @__PURE__ */ new Map()) => {
|
|
1892
1679
|
let t = 0;
|
|
1893
1680
|
for (let n = 0; n < a.length; n++) {
|
|
1894
|
-
let r =
|
|
1681
|
+
let r = Z(o(a[n], e));
|
|
1895
1682
|
for (let i = n + 1; i < a.length; i++) {
|
|
1896
|
-
let n =
|
|
1897
|
-
for (let e of r) for (let r of n)
|
|
1683
|
+
let n = Z(o(a[i], e));
|
|
1684
|
+
for (let e of r) for (let r of n) V(e.a, e.b, r.a, r.b, Y) && t++;
|
|
1898
1685
|
}
|
|
1899
1686
|
}
|
|
1900
1687
|
return t;
|
|
1901
|
-
}, "strictCrossingCount"), c = /* @__PURE__ */ e((e = /* @__PURE__ */ new Map()) => a.reduce((t, n) => t +
|
|
1902
|
-
let t = e.start, r = e.end, i = t ? n.get(t) : void 0, a = r ? n.get(r) : void 0, o = i ?
|
|
1688
|
+
}, "strictCrossingCount"), c = /* @__PURE__ */ e((e = /* @__PURE__ */ new Map()) => a.reduce((t, n) => t + E(o(n, e)), 0), "totalBends"), l = /* @__PURE__ */ e((e) => {
|
|
1689
|
+
let t = e.start, r = e.end, i = t ? n.get(t) : void 0, a = r ? n.get(r) : void 0, o = i ? F(i) : void 0, s = a ? F(a) : void 0;
|
|
1903
1690
|
return o && s ? {
|
|
1904
1691
|
src: o,
|
|
1905
1692
|
dst: s
|
|
@@ -1909,7 +1696,7 @@ function ht(t, n) {
|
|
|
1909
1696
|
let r = l(e);
|
|
1910
1697
|
if (r) {
|
|
1911
1698
|
if (n.vertical) {
|
|
1912
|
-
let i = n.a.x, a = Math.min(r.src.left, r.dst.left), o = Math.max(r.src.right, r.dst.right), s = i < a -
|
|
1699
|
+
let i = n.a.x, a = Math.min(r.src.left, r.dst.left), o = Math.max(r.src.right, r.dst.right), s = i < a - Y ? "left" : i > o + Y ? "right" : void 0;
|
|
1913
1700
|
return s ? {
|
|
1914
1701
|
edge: e,
|
|
1915
1702
|
points: t,
|
|
@@ -1922,7 +1709,7 @@ function ht(t, n) {
|
|
|
1922
1709
|
} : void 0;
|
|
1923
1710
|
}
|
|
1924
1711
|
if (n.horizontal) {
|
|
1925
|
-
let i = n.a.y, a = Math.min(r.src.top, r.dst.top), o = Math.max(r.src.bottom, r.dst.bottom), s = i < a -
|
|
1712
|
+
let i = n.a.y, a = Math.min(r.src.top, r.dst.top), o = Math.max(r.src.bottom, r.dst.bottom), s = i < a - Y ? "top" : i > o + Y ? "bottom" : void 0;
|
|
1926
1713
|
return s ? {
|
|
1927
1714
|
edge: e,
|
|
1928
1715
|
points: t,
|
|
@@ -1939,13 +1726,13 @@ function ht(t, n) {
|
|
|
1939
1726
|
let e = [];
|
|
1940
1727
|
for (let t of a) {
|
|
1941
1728
|
let n = o(t);
|
|
1942
|
-
for (let r of
|
|
1729
|
+
for (let r of Z(n)) {
|
|
1943
1730
|
let i = u(t, n, r);
|
|
1944
1731
|
i && e.push(i);
|
|
1945
1732
|
}
|
|
1946
1733
|
}
|
|
1947
1734
|
return e;
|
|
1948
|
-
}, "collectExternalRails"), f = /* @__PURE__ */ e((e, t) => e.edge !== t.edge && e.axis === t.axis && e.side === t.side &&
|
|
1735
|
+
}, "collectExternalRails"), f = /* @__PURE__ */ e((e, t) => e.edge !== t.edge && e.axis === t.axis && e.side === t.side && C(e.min, e.max, t.min, t.max) >= X, "railsInteract"), p = /* @__PURE__ */ e((e) => {
|
|
1949
1736
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
1950
1737
|
for (let r of e) {
|
|
1951
1738
|
if (n.has(r)) continue;
|
|
@@ -1960,7 +1747,7 @@ function ht(t, n) {
|
|
|
1960
1747
|
return t;
|
|
1961
1748
|
}, "connectedComponents"), m = /* @__PURE__ */ e((e) => {
|
|
1962
1749
|
let t = [];
|
|
1963
|
-
for (let n of e) t.some((e) => Math.abs(e - n.coord) <
|
|
1750
|
+
for (let n of e) t.some((e) => Math.abs(e - n.coord) < Y) || t.push(n.coord);
|
|
1964
1751
|
for (; t.length < e.length;) {
|
|
1965
1752
|
let n = Math.min(...t), r = Math.max(...t), i = e[0].side;
|
|
1966
1753
|
t.push(i === "left" || i === "top" ? n - 12 * (e.length - t.length) : r + 12 * (e.length - t.length));
|
|
@@ -1971,7 +1758,7 @@ function ht(t, n) {
|
|
|
1971
1758
|
if (t.length <= 6) {
|
|
1972
1759
|
let a = Array(r.length).fill(!1), o = [], s = /* @__PURE__ */ e(() => {
|
|
1973
1760
|
if (o.length === t.length) {
|
|
1974
|
-
o.some((e, t) => Math.abs(e - n[t]) >=
|
|
1761
|
+
o.some((e, t) => Math.abs(e - n[t]) >= Y) && i.push([...o]);
|
|
1975
1762
|
return;
|
|
1976
1763
|
}
|
|
1977
1764
|
for (let [e, t] of r.entries()) a[e] || (a[e] = !0, o.push(t), s(), o.pop(), a[e] = !1);
|
|
@@ -1994,23 +1781,23 @@ function ht(t, n) {
|
|
|
1994
1781
|
}
|
|
1995
1782
|
let r = /* @__PURE__ */ new Map();
|
|
1996
1783
|
for (let [e, t] of n) {
|
|
1997
|
-
let n =
|
|
1998
|
-
if (
|
|
1784
|
+
let n = G(D(t));
|
|
1785
|
+
if (Z(n).length !== n.length - 1) return;
|
|
1999
1786
|
r.set(e, n);
|
|
2000
1787
|
}
|
|
2001
1788
|
return r;
|
|
2002
1789
|
}, "replacementsForAssignment"), _ = /* @__PURE__ */ e((e) => {
|
|
2003
1790
|
for (let [t, n] of e) {
|
|
2004
1791
|
let e = [t.start, t.end].filter((e) => !!e);
|
|
2005
|
-
for (let t of
|
|
1792
|
+
for (let t of Z(n)) if (B(t.a, t.b, r, e, -2) || B(t.a, t.b, i, [], -2)) return !1;
|
|
2006
1793
|
}
|
|
2007
1794
|
for (let t = 0; t < a.length; t++) {
|
|
2008
|
-
let n = a[t], r = e.has(n), i =
|
|
1795
|
+
let n = a[t], r = e.has(n), i = Z(o(n, e));
|
|
2009
1796
|
for (let n = t + 1; n < a.length; n++) {
|
|
2010
1797
|
let t = a[n];
|
|
2011
1798
|
if (!r && !e.has(t)) continue;
|
|
2012
|
-
let s =
|
|
2013
|
-
for (let e of i) for (let t of s) if (
|
|
1799
|
+
let s = Z(o(t, e));
|
|
1800
|
+
for (let e of i) for (let t of s) if (w(e, t, .5) >= X) return !1;
|
|
2014
1801
|
}
|
|
2015
1802
|
}
|
|
2016
1803
|
return !0;
|
|
@@ -2031,43 +1818,43 @@ function ht(t, n) {
|
|
|
2031
1818
|
for (let [e, n] of t) e.points = n;
|
|
2032
1819
|
}
|
|
2033
1820
|
}
|
|
2034
|
-
e(
|
|
2035
|
-
function
|
|
2036
|
-
let { realNodeRects: r, labelNodeRects: i } =
|
|
1821
|
+
e(Ze, "reassignCrossingExternalRailChannels");
|
|
1822
|
+
function Qe(t, n) {
|
|
1823
|
+
let { realNodeRects: r, labelNodeRects: i } = z(n.values()), a = t.filter((e) => !e.isLayoutOnly), o = /* @__PURE__ */ e((e, t, n) => D(e === t ? n ?? [] : e.points ?? []), "pointsFor"), s = /* @__PURE__ */ e((e) => Z(e).reduce((e, t) => {
|
|
2037
1824
|
let n = t.a.x - t.b.x, r = t.a.y - t.b.y;
|
|
2038
1825
|
return e + Math.hypot(n, r);
|
|
2039
1826
|
}, 0), "pathLength"), c = /* @__PURE__ */ e((e, t) => {
|
|
2040
1827
|
let n = 0;
|
|
2041
1828
|
for (let r = 0; r < a.length; r++) {
|
|
2042
|
-
let i =
|
|
1829
|
+
let i = Z(o(a[r], e, t));
|
|
2043
1830
|
for (let s = r + 1; s < a.length; s++) {
|
|
2044
|
-
let r =
|
|
2045
|
-
for (let e of i) for (let t of r)
|
|
1831
|
+
let r = Z(o(a[s], e, t));
|
|
1832
|
+
for (let e of i) for (let t of r) V(e.a, e.b, t.a, t.b, Y) && n++;
|
|
2046
1833
|
}
|
|
2047
1834
|
}
|
|
2048
1835
|
return n;
|
|
2049
1836
|
}, "strictCrossingCount"), l = /* @__PURE__ */ e((e, t) => {
|
|
2050
1837
|
if (e.horizontal) {
|
|
2051
1838
|
let n = e.a.y;
|
|
2052
|
-
return (Math.abs(n - t.top) < 1 || Math.abs(n - t.bottom) < 1) &&
|
|
1839
|
+
return (Math.abs(n - t.top) < 1 || Math.abs(n - t.bottom) < 1) && C(e.a.x, e.b.x, t.left, t.right) >= X;
|
|
2053
1840
|
}
|
|
2054
1841
|
if (e.vertical) {
|
|
2055
1842
|
let n = e.a.x;
|
|
2056
|
-
return (Math.abs(n - t.left) < 1 || Math.abs(n - t.right) < 1) &&
|
|
1843
|
+
return (Math.abs(n - t.left) < 1 || Math.abs(n - t.right) < 1) && C(e.a.y, e.b.y, t.top, t.bottom) >= X;
|
|
2057
1844
|
}
|
|
2058
1845
|
return !1;
|
|
2059
1846
|
}, "segmentRunsAlongRectBorder"), u = /* @__PURE__ */ e((e) => {
|
|
2060
1847
|
let t = [e.start, e.end].filter((e) => !!e), r = [];
|
|
2061
1848
|
for (let e of t) {
|
|
2062
|
-
let t = n.get(e), i = t ?
|
|
1849
|
+
let t = n.get(e), i = t ? F(t) : void 0;
|
|
2063
1850
|
i && r.push(i);
|
|
2064
1851
|
}
|
|
2065
1852
|
return r;
|
|
2066
1853
|
}, "endpointRectsFor"), d = /* @__PURE__ */ e((e, t) => {
|
|
2067
1854
|
if (t + 3 >= e.length) return [];
|
|
2068
|
-
let n = e[t], r = e[t + 1], i = e[t + 2], a = e[t + 3], o =
|
|
1855
|
+
let n = e[t], r = e[t + 1], i = e[t + 2], a = e[t + 3], o = x(n, r, Y) && S(r, i, Y) && x(i, a, Y), s = S(n, r, Y) && x(r, i, Y) && S(i, a, Y);
|
|
2069
1856
|
if (!o && !s || !(o ? Math.sign(r.x - n.x) !== Math.sign(a.x - i.x) : Math.sign(r.y - n.y) !== Math.sign(a.y - i.y))) return [];
|
|
2070
|
-
let c =
|
|
1857
|
+
let c = y(n, a, Y) || b(n, a, Y) ? [] : [{
|
|
2071
1858
|
x: n.x,
|
|
2072
1859
|
y: a.y
|
|
2073
1860
|
}, {
|
|
@@ -2078,26 +1865,26 @@ function gt(t, n) {
|
|
|
2078
1865
|
n,
|
|
2079
1866
|
...e.slice(t + 3)
|
|
2080
1867
|
]), u = /* @__PURE__ */ new Set();
|
|
2081
|
-
return l.map((e) =>
|
|
2082
|
-
if (
|
|
1868
|
+
return l.map((e) => G(D(e))).filter((e) => {
|
|
1869
|
+
if (Z(e).length !== e.length - 1 || !e.some((e) => v(e, a, Y))) return !1;
|
|
2083
1870
|
let t = e.map((e) => `${e.x.toFixed(3)},${e.y.toFixed(3)}`).join("|");
|
|
2084
1871
|
return !u.has(t) && (u.add(t), !0);
|
|
2085
1872
|
});
|
|
2086
1873
|
}, "shortcutCandidatesAt"), f = /* @__PURE__ */ e((e, t, n) => {
|
|
2087
1874
|
let s = [e.start, e.end].filter((e) => !!e), d = u(e);
|
|
2088
|
-
for (let e of
|
|
1875
|
+
for (let e of Z(t)) if (B(e.a, e.b, r, s, -2) || B(e.a, e.b, i, [], -2) || d.some((t) => l(e, t))) return !1;
|
|
2089
1876
|
for (let n of a) if (n !== e) {
|
|
2090
|
-
for (let e of
|
|
1877
|
+
for (let e of Z(t)) for (let t of Z(o(n))) if (w(e, t, .5) >= X) return !1;
|
|
2091
1878
|
}
|
|
2092
1879
|
return c(e, t) <= n;
|
|
2093
1880
|
}, "candidateIsSafe");
|
|
2094
1881
|
for (let e = 0; e < 8; e++) {
|
|
2095
1882
|
let e = c(), t, n, r = e, i = Infinity, l = Infinity;
|
|
2096
1883
|
for (let u of a) {
|
|
2097
|
-
let a = o(u), p =
|
|
1884
|
+
let a = o(u), p = E(a, Y), m = s(a);
|
|
2098
1885
|
for (let o = 0; o <= a.length - 4; o++) for (let h of d(a, o)) {
|
|
2099
|
-
let a =
|
|
2100
|
-
if (!(a < p || a === p && o < m -
|
|
1886
|
+
let a = E(h, Y), o = s(h);
|
|
1887
|
+
if (!(a < p || a === p && o < m - Y) || !f(u, h, e)) continue;
|
|
2101
1888
|
let d = c(u, h);
|
|
2102
1889
|
d > r || d === r && (a > i || a === i && o >= l) || (t = u, n = h, r = d, i = a, l = o);
|
|
2103
1890
|
}
|
|
@@ -2106,12 +1893,12 @@ function gt(t, n) {
|
|
|
2106
1893
|
t.points = n;
|
|
2107
1894
|
}
|
|
2108
1895
|
}
|
|
2109
|
-
e(
|
|
2110
|
-
function
|
|
1896
|
+
e(Qe, "shortcutRedundantOrthogonalJogs");
|
|
1897
|
+
function $e(t, n) {
|
|
2111
1898
|
let r = [];
|
|
2112
1899
|
for (let e of n.values()) {
|
|
2113
1900
|
if (e.isGroup || e.isEdgeLabel) continue;
|
|
2114
|
-
let t = e.x ?? 0, n = e.y ?? 0, i =
|
|
1901
|
+
let t = e.x ?? 0, n = e.y ?? 0, i = F(e);
|
|
2115
1902
|
i && r.push({
|
|
2116
1903
|
id: String(e.id ?? ""),
|
|
2117
1904
|
cx: t,
|
|
@@ -2137,11 +1924,11 @@ function _t(t, n) {
|
|
|
2137
1924
|
let t = e === "left" || e === "top" ? -1 : 1, n = [];
|
|
2138
1925
|
for (let r = 0; r <= 2; r++) n.push(s[e] + t * 20 * r);
|
|
2139
1926
|
return n;
|
|
2140
|
-
}, "outwardTracksForSide"), d = /* @__PURE__ */ e((e, t = /* @__PURE__ */ new Map()) =>
|
|
1927
|
+
}, "outwardTracksForSide"), d = /* @__PURE__ */ e((e, t = /* @__PURE__ */ new Map()) => D(t.get(e) ?? e.points ?? []), "replacementPointsFor"), f = /* @__PURE__ */ e((e, t) => {
|
|
2141
1928
|
let n = 0;
|
|
2142
|
-
for (let r of e) for (let e of t)
|
|
1929
|
+
for (let r of e) for (let e of t) V(r.a, r.b, e.a, e.b, Y) && n++;
|
|
2143
1930
|
return n;
|
|
2144
|
-
}, "crossingCountBetweenSegments"), p = /* @__PURE__ */ e((e, t) => f(
|
|
1931
|
+
}, "crossingCountBetweenSegments"), p = /* @__PURE__ */ e((e, t) => f(Z(e), Z(t)), "crossingCountBetweenPaths"), m = /* @__PURE__ */ e((t = /* @__PURE__ */ new Map()) => {
|
|
2145
1932
|
let n = 0, r = [], i = /* @__PURE__ */ new Set(), a = [], o = /* @__PURE__ */ e((e) => {
|
|
2146
1933
|
i.has(e) || (i.add(e), a.push(e));
|
|
2147
1934
|
}, "addEdge");
|
|
@@ -2208,34 +1995,34 @@ function _t(t, n) {
|
|
|
2208
1995
|
let t = /* @__PURE__ */ new Map();
|
|
2209
1996
|
for (let n of e.pairs) t.set(n.first, (t.get(n.first) ?? 0) + n.count), t.set(n.second, (t.get(n.second) ?? 0) + n.count);
|
|
2210
1997
|
return t;
|
|
2211
|
-
}, "currentCrossingsByEdge"),
|
|
1998
|
+
}, "currentCrossingsByEdge"), C = /* @__PURE__ */ e((e) => e.slice(1).reduce((t, n, r) => {
|
|
2212
1999
|
let i = e[r];
|
|
2213
2000
|
return t + Math.abs(n.x - i.x) + Math.abs(n.y - i.y);
|
|
2214
|
-
}, 0), "pathLength"),
|
|
2215
|
-
let r =
|
|
2001
|
+
}, 0), "pathLength"), T = /* @__PURE__ */ e((e = /* @__PURE__ */ new Map()) => c.reduce((t, n) => t + E(d(n, e)), 0), "totalBends"), O = /* @__PURE__ */ e((e = /* @__PURE__ */ new Map()) => c.reduce((t, n) => t + C(d(n, e)), 0), "totalLength"), k = /* @__PURE__ */ e((e, t, n = /* @__PURE__ */ new Map()) => {
|
|
2002
|
+
let r = Z(t);
|
|
2216
2003
|
for (let t of c) if (t !== e) {
|
|
2217
|
-
for (let e of r) for (let r of
|
|
2004
|
+
for (let e of r) for (let r of Z(d(t, n))) if (w(e, r, .5) >= X) return !0;
|
|
2218
2005
|
}
|
|
2219
2006
|
return !1;
|
|
2220
|
-
}, "pathHasSegmentConflict"),
|
|
2007
|
+
}, "pathHasSegmentConflict"), A = /* @__PURE__ */ e((e, t) => {
|
|
2221
2008
|
let n = [e.start, e.end].filter((e) => !!e);
|
|
2222
|
-
for (let e of
|
|
2009
|
+
for (let e of Z(t)) if (B(e.a, e.b, a, n, -2)) return !0;
|
|
2223
2010
|
return !1;
|
|
2224
|
-
}, "pathHitsNode"),
|
|
2225
|
-
let n =
|
|
2226
|
-
|
|
2227
|
-
}, "pushOrthogonalCandidate"),
|
|
2011
|
+
}, "pathHitsNode"), j = /* @__PURE__ */ e((e, t) => {
|
|
2012
|
+
let n = G(D(t));
|
|
2013
|
+
Z(n).length === n.length - 1 && e.push(n);
|
|
2014
|
+
}, "pushOrthogonalCandidate"), M = /* @__PURE__ */ e((e) => e === "left" || e === "right", "sideIsHorizontal"), N = /* @__PURE__ */ e((e, t, n) => {
|
|
2228
2015
|
switch (t) {
|
|
2229
2016
|
case "left": return Math.min(e.x, n.x) - 20;
|
|
2230
2017
|
case "right": return Math.max(e.x, n.x) + 20;
|
|
2231
2018
|
case "top": return Math.min(e.y, n.y) - 20;
|
|
2232
2019
|
case "bottom": return Math.max(e.y, n.y) + 20;
|
|
2233
2020
|
}
|
|
2234
|
-
}, "localTrackForSameSide"),
|
|
2235
|
-
let i = n === "left" || n === "top" ? -1 : 1, a = [
|
|
2236
|
-
for (let o of a) for (let a = 0; a <= 2; a++)
|
|
2237
|
-
}, "addSameSideCandidates"),
|
|
2238
|
-
for (let a of u(n)) for (let n of u(i))
|
|
2021
|
+
}, "localTrackForSameSide"), P = /* @__PURE__ */ e((e, t, n, r) => {
|
|
2022
|
+
let i = n === "left" || n === "top" ? -1 : 1, a = [N(t, n, r), s[n]];
|
|
2023
|
+
for (let o of a) for (let a = 0; a <= 2; a++) j(e, L(t, n, r, o + i * 20 * a));
|
|
2024
|
+
}, "addSameSideCandidates"), R = /* @__PURE__ */ e((e, t, n, r, i) => {
|
|
2025
|
+
for (let a of u(n)) for (let n of u(i)) j(e, [
|
|
2239
2026
|
t,
|
|
2240
2027
|
{
|
|
2241
2028
|
x: a,
|
|
@@ -2251,8 +2038,8 @@ function _t(t, n) {
|
|
|
2251
2038
|
},
|
|
2252
2039
|
r
|
|
2253
2040
|
]);
|
|
2254
|
-
}, "addHorizontalToVerticalCandidates"),
|
|
2255
|
-
for (let a of u(n)) for (let n of u(i))
|
|
2041
|
+
}, "addHorizontalToVerticalCandidates"), z = /* @__PURE__ */ e((e, t, n, r, i) => {
|
|
2042
|
+
for (let a of u(n)) for (let n of u(i)) j(e, [
|
|
2256
2043
|
t,
|
|
2257
2044
|
{
|
|
2258
2045
|
x: t.x,
|
|
@@ -2268,9 +2055,9 @@ function _t(t, n) {
|
|
|
2268
2055
|
},
|
|
2269
2056
|
r
|
|
2270
2057
|
]);
|
|
2271
|
-
}, "addVerticalToHorizontalCandidates"),
|
|
2058
|
+
}, "addVerticalToHorizontalCandidates"), te = /* @__PURE__ */ e((e, t, n, r, i) => {
|
|
2272
2059
|
let a = [...u("top"), ...u("bottom")];
|
|
2273
|
-
for (let o of u(n)) for (let n of u(i)) for (let i of a)
|
|
2060
|
+
for (let o of u(n)) for (let n of u(i)) for (let i of a) j(e, [
|
|
2274
2061
|
t,
|
|
2275
2062
|
{
|
|
2276
2063
|
x: o,
|
|
@@ -2290,9 +2077,9 @@ function _t(t, n) {
|
|
|
2290
2077
|
},
|
|
2291
2078
|
r
|
|
2292
2079
|
]);
|
|
2293
|
-
}, "addHorizontalPairCandidates"),
|
|
2080
|
+
}, "addHorizontalPairCandidates"), ne = /* @__PURE__ */ e((e, t, n, r, i) => {
|
|
2294
2081
|
let a = [...u("left"), ...u("right")];
|
|
2295
|
-
for (let o of u(n)) for (let n of u(i)) for (let i of a)
|
|
2082
|
+
for (let o of u(n)) for (let n of u(i)) for (let i of a) j(e, [
|
|
2296
2083
|
t,
|
|
2297
2084
|
{
|
|
2298
2085
|
x: t.x,
|
|
@@ -2312,23 +2099,23 @@ function _t(t, n) {
|
|
|
2312
2099
|
},
|
|
2313
2100
|
r
|
|
2314
2101
|
]);
|
|
2315
|
-
}, "addVerticalPairCandidates"),
|
|
2102
|
+
}, "addVerticalPairCandidates"), re = /* @__PURE__ */ e((e) => {
|
|
2316
2103
|
let t = /* @__PURE__ */ new Set();
|
|
2317
|
-
return e.map((e) =>
|
|
2104
|
+
return e.map((e) => D(e)).filter((e) => {
|
|
2318
2105
|
let n = e.map((e) => `${e.x.toFixed(3)},${e.y.toFixed(3)}`).join("|");
|
|
2319
2106
|
return t.has(n) || e.length < 2 ? !1 : (t.add(n), !0);
|
|
2320
2107
|
});
|
|
2321
|
-
}, "dedupeCandidatePaths"),
|
|
2322
|
-
let i = [], a =
|
|
2323
|
-
a &&
|
|
2324
|
-
let o =
|
|
2325
|
-
return o && !s ?
|
|
2326
|
-
}, "buildCandidatesForSides"),
|
|
2108
|
+
}, "dedupeCandidatePaths"), ie = /* @__PURE__ */ e((e, t, n, r) => {
|
|
2109
|
+
let i = [], a = ee(e, t, n, r, 20, Y);
|
|
2110
|
+
a && j(i, a), t === r && P(i, e, t, n);
|
|
2111
|
+
let o = M(t), s = M(r);
|
|
2112
|
+
return o && !s ? R(i, e, t, n, r) : !o && s ? z(i, e, t, n, r) : o ? te(i, e, t, n, r) : ne(i, e, t, n, r), re(i);
|
|
2113
|
+
}, "buildCandidatesForSides"), ae = /* @__PURE__ */ e((e, t, n, r) => {
|
|
2327
2114
|
let i = [...u("left"), ...u("right")], a = [...u("top"), ...u("bottom")];
|
|
2328
2115
|
for (let s of o) {
|
|
2329
|
-
let o =
|
|
2116
|
+
let o = I(r, s), c = s === "top" || s === "bottom" ? u(s) : a;
|
|
2330
2117
|
for (let r of i) {
|
|
2331
|
-
|
|
2118
|
+
j(e, [
|
|
2332
2119
|
t,
|
|
2333
2120
|
n,
|
|
2334
2121
|
{
|
|
@@ -2341,7 +2128,7 @@ function _t(t, n) {
|
|
|
2341
2128
|
},
|
|
2342
2129
|
o
|
|
2343
2130
|
]);
|
|
2344
|
-
for (let i of c)
|
|
2131
|
+
for (let i of c) j(e, [
|
|
2345
2132
|
t,
|
|
2346
2133
|
n,
|
|
2347
2134
|
{
|
|
@@ -2360,12 +2147,12 @@ function _t(t, n) {
|
|
|
2360
2147
|
]);
|
|
2361
2148
|
}
|
|
2362
2149
|
}
|
|
2363
|
-
}, "addVerticalDepartureOuterTrackCandidates"),
|
|
2150
|
+
}, "addVerticalDepartureOuterTrackCandidates"), oe = /* @__PURE__ */ e((e, t, n, r) => {
|
|
2364
2151
|
let i = [...u("left"), ...u("right")], a = [...u("top"), ...u("bottom")];
|
|
2365
2152
|
for (let s of o) {
|
|
2366
|
-
let o =
|
|
2153
|
+
let o = I(r, s), c = s === "left" || s === "right" ? u(s) : i;
|
|
2367
2154
|
for (let r of a) {
|
|
2368
|
-
|
|
2155
|
+
j(e, [
|
|
2369
2156
|
t,
|
|
2370
2157
|
n,
|
|
2371
2158
|
{
|
|
@@ -2378,7 +2165,7 @@ function _t(t, n) {
|
|
|
2378
2165
|
},
|
|
2379
2166
|
o
|
|
2380
2167
|
]);
|
|
2381
|
-
for (let i of c)
|
|
2168
|
+
for (let i of c) j(e, [
|
|
2382
2169
|
t,
|
|
2383
2170
|
n,
|
|
2384
2171
|
{
|
|
@@ -2397,88 +2184,88 @@ function _t(t, n) {
|
|
|
2397
2184
|
]);
|
|
2398
2185
|
}
|
|
2399
2186
|
}
|
|
2400
|
-
}, "addHorizontalDepartureOuterTrackCandidates"),
|
|
2187
|
+
}, "addHorizontalDepartureOuterTrackCandidates"), H = /* @__PURE__ */ e((e) => {
|
|
2401
2188
|
let t = e.start, n = e.end, r = n ? i.get(n) : void 0;
|
|
2402
2189
|
if (!t || !r) return [];
|
|
2403
|
-
let a =
|
|
2190
|
+
let a = D(e.points ?? []);
|
|
2404
2191
|
if (a.length < 4) return [];
|
|
2405
2192
|
let o = a[0], s = a[1], c = [];
|
|
2406
|
-
return
|
|
2407
|
-
}, "terminalPreservingOuterTrackCandidates"),
|
|
2193
|
+
return S(o, s, Y) ? ae(c, o, s, r) : x(o, s, Y) && oe(c, o, s, r), c;
|
|
2194
|
+
}, "terminalPreservingOuterTrackCandidates"), U = /* @__PURE__ */ e((e) => {
|
|
2408
2195
|
let t = e.start, n = e.end, r = t ? i.get(t) : void 0, a = n ? i.get(n) : void 0;
|
|
2409
2196
|
if (!r || !a) return [];
|
|
2410
2197
|
let s = [];
|
|
2411
2198
|
for (let e of o) {
|
|
2412
|
-
let t =
|
|
2413
|
-
for (let n of o) s.push(...
|
|
2199
|
+
let t = I(r, e);
|
|
2200
|
+
for (let n of o) s.push(...ie(t, e, I(a, n), n));
|
|
2414
2201
|
}
|
|
2415
|
-
return s.push(...
|
|
2416
|
-
}, "candidatePathsFor"),
|
|
2202
|
+
return s.push(...H(e)), s;
|
|
2203
|
+
}, "candidatePathsFor"), W = /* @__PURE__ */ e(() => new Map(c.map((e) => [e, Z(d(e))])), "currentSegmentsByEdge"), K = /* @__PURE__ */ e((e, t, n) => {
|
|
2417
2204
|
let r = /* @__PURE__ */ new Set();
|
|
2418
2205
|
for (let i of c) {
|
|
2419
2206
|
if (i === e) continue;
|
|
2420
|
-
let a = n.get(i) ??
|
|
2421
|
-
t.some((e) => a.some((t) =>
|
|
2207
|
+
let a = n.get(i) ?? Z(d(i));
|
|
2208
|
+
t.some((e) => a.some((t) => w(e, t, .5) >= X)) && r.add(i);
|
|
2422
2209
|
}
|
|
2423
2210
|
return r;
|
|
2424
|
-
}, "sharedTrackConflictsFor"),
|
|
2211
|
+
}, "sharedTrackConflictsFor"), se = /* @__PURE__ */ e((e, t, n, r) => {
|
|
2425
2212
|
let i = /* @__PURE__ */ new Set();
|
|
2426
|
-
return
|
|
2427
|
-
if (
|
|
2213
|
+
return U(e).map((e) => G(D(e))).filter((t) => {
|
|
2214
|
+
if (A(e, t)) return !1;
|
|
2428
2215
|
let n = t.map((e) => `${e.x.toFixed(3)},${e.y.toFixed(3)}`).join("|");
|
|
2429
2216
|
return i.has(n) || t.length < 2 ? !1 : (i.add(n), !0);
|
|
2430
2217
|
}).map((i) => {
|
|
2431
|
-
let a =
|
|
2432
|
-
for (let t of c) t !== e && (o += f(a, n.get(t) ??
|
|
2218
|
+
let a = Z(i), o = 0;
|
|
2219
|
+
for (let t of c) t !== e && (o += f(a, n.get(t) ?? Z(d(t))));
|
|
2433
2220
|
return {
|
|
2434
2221
|
candidate: i,
|
|
2435
2222
|
candidateSegments: a,
|
|
2436
2223
|
crossings: t.count - (r.get(e) ?? 0) + o,
|
|
2437
|
-
bends:
|
|
2438
|
-
totalBends:
|
|
2439
|
-
length:
|
|
2224
|
+
bends: E(i, Y),
|
|
2225
|
+
totalBends: E(i),
|
|
2226
|
+
length: C(i)
|
|
2440
2227
|
};
|
|
2441
2228
|
}).filter(({ crossings: e }) => e <= t.count).sort((e, t) => e.crossings - t.crossings || e.bends - t.bends || e.length - t.length).slice(0, 48).map((t) => ({
|
|
2442
2229
|
path: t.candidate,
|
|
2443
2230
|
segments: t.candidateSegments,
|
|
2444
|
-
sharedTrackConflicts:
|
|
2231
|
+
sharedTrackConflicts: K(e, t.candidateSegments, n),
|
|
2445
2232
|
totalBends: t.totalBends,
|
|
2446
2233
|
length: t.length
|
|
2447
2234
|
}));
|
|
2448
|
-
}, "pairCandidatesFor"),
|
|
2235
|
+
}, "pairCandidatesFor"), ce = /* @__PURE__ */ e((e, t, n, r, i, a) => {
|
|
2449
2236
|
let o = 0;
|
|
2450
2237
|
for (let n of e.pairs) (n.first === t || n.second === t || n.first === r || n.second === r) && (o += n.count);
|
|
2451
2238
|
let s = f(n.segments, i.segments);
|
|
2452
2239
|
for (let e of c) {
|
|
2453
2240
|
if (e === t || e === r) continue;
|
|
2454
|
-
let o = a.get(e) ??
|
|
2241
|
+
let o = a.get(e) ?? Z(d(e));
|
|
2455
2242
|
s += f(n.segments, o) + f(i.segments, o);
|
|
2456
2243
|
}
|
|
2457
2244
|
return e.count - o + s;
|
|
2458
|
-
}, "pairCrossingCount"),
|
|
2245
|
+
}, "pairCrossingCount"), le = /* @__PURE__ */ e((e, t) => {
|
|
2459
2246
|
for (let n of e.sharedTrackConflicts) if (n !== t) return !1;
|
|
2460
2247
|
return !0;
|
|
2461
|
-
}, "conflictsOnlyWith"),
|
|
2462
|
-
let a =
|
|
2248
|
+
}, "conflictsOnlyWith"), ue = /* @__PURE__ */ e((e, t) => e.segments.some((e) => t.segments.some((t) => w(e, t, .5) >= X)), "candidatesShareTrack"), de = /* @__PURE__ */ e((e, t, n, r) => le(t, n.edge) && le(r, e.edge) && !ue(t, r), "pairCandidatesAreCompatible"), q = /* @__PURE__ */ e((e, t, n, r, i) => {
|
|
2249
|
+
let a = ce(e.current, t.edge, n, r.edge, i, e.baseSegments);
|
|
2463
2250
|
if (!(a >= e.current.count)) return {
|
|
2464
2251
|
replacements: /* @__PURE__ */ new Map([[t.edge, n.path], [r.edge, i.path]]),
|
|
2465
2252
|
crossings: a,
|
|
2466
2253
|
bends: e.currentBends - (e.baseBendsByEdge.get(t.edge) ?? 0) - (e.baseBendsByEdge.get(r.edge) ?? 0) + n.totalBends + i.totalBends,
|
|
2467
2254
|
length: e.currentLength - (e.baseLengthByEdge.get(t.edge) ?? 0) - (e.baseLengthByEdge.get(r.edge) ?? 0) + n.length + i.length
|
|
2468
2255
|
};
|
|
2469
|
-
}, "scorePairReplacement"),
|
|
2256
|
+
}, "scorePairReplacement"), J = /* @__PURE__ */ e((e, t) => e.crossings < t.crossings || e.crossings === t.crossings && (e.bends < t.bends || e.bends === t.bends && e.length < t.length), "pairScoreIsBetter"), fe = /* @__PURE__ */ e((e, t, n, r) => {
|
|
2470
2257
|
let i = r;
|
|
2471
2258
|
for (let r of t.candidates) for (let a of n.candidates) {
|
|
2472
|
-
if (!
|
|
2473
|
-
let o =
|
|
2474
|
-
o &&
|
|
2259
|
+
if (!de(t, r, n, a)) continue;
|
|
2260
|
+
let o = q(e, t, r, n, a);
|
|
2261
|
+
o && J(o, i) && (i = o);
|
|
2475
2262
|
}
|
|
2476
2263
|
return i;
|
|
2477
|
-
}, "bestScoreForOptionPair"),
|
|
2478
|
-
let t =
|
|
2264
|
+
}, "bestScoreForOptionPair"), pe = /* @__PURE__ */ e((e) => {
|
|
2265
|
+
let t = T(), n = O(), r = W(), i = b(e), a = new Map(c.map((e) => [e, E(d(e))])), o = new Map(c.map((e) => [e, C(d(e))])), s = /* @__PURE__ */ new Map(), l = v(e);
|
|
2479
2266
|
for (let t of l) for (let n of t) {
|
|
2480
2267
|
if (s.has(n)) continue;
|
|
2481
|
-
let t =
|
|
2268
|
+
let t = se(n, e, r, i);
|
|
2482
2269
|
t.length > 0 && s.set(n, {
|
|
2483
2270
|
edge: n,
|
|
2484
2271
|
candidates: t
|
|
@@ -2503,7 +2290,7 @@ function _t(t, n) {
|
|
|
2503
2290
|
let t = r[e];
|
|
2504
2291
|
for (let i = e + 1; i < r.length; i++) {
|
|
2505
2292
|
let e = r[i];
|
|
2506
|
-
!n.has(t.edge) && !n.has(e.edge) || (u =
|
|
2293
|
+
!n.has(t.edge) && !n.has(e.edge) || (u = fe(f, t, e, u));
|
|
2507
2294
|
}
|
|
2508
2295
|
}
|
|
2509
2296
|
}
|
|
@@ -2514,9 +2301,9 @@ function _t(t, n) {
|
|
|
2514
2301
|
if (t === 0) return;
|
|
2515
2302
|
let n, r, i = t, a = Infinity;
|
|
2516
2303
|
for (let o of e.edges) {
|
|
2517
|
-
let s =
|
|
2518
|
-
for (let c of
|
|
2519
|
-
let l =
|
|
2304
|
+
let s = E(d(o), Y);
|
|
2305
|
+
for (let c of U(o)) {
|
|
2306
|
+
let l = A(o, c), u = !l && k(o, c), d = y(e, o, c), f = E(c, Y);
|
|
2520
2307
|
l || u || (d < t || d === t && f < s) && (d > i || d === i && f >= a || (n = o, r = c, i = d, a = f));
|
|
2521
2308
|
}
|
|
2522
2309
|
}
|
|
@@ -2524,15 +2311,15 @@ function _t(t, n) {
|
|
|
2524
2311
|
n.points = r;
|
|
2525
2312
|
continue;
|
|
2526
2313
|
}
|
|
2527
|
-
let o =
|
|
2314
|
+
let o = pe(e);
|
|
2528
2315
|
if (!o) return;
|
|
2529
2316
|
for (let [e, t] of o) e.points = t;
|
|
2530
2317
|
}
|
|
2531
2318
|
}
|
|
2532
|
-
e(
|
|
2533
|
-
var
|
|
2534
|
-
function
|
|
2535
|
-
let { nodeInfoById: r, realNodeRects: i } =
|
|
2319
|
+
e($e, "resolveRenderedOrthogonalCrossings");
|
|
2320
|
+
var et = .001, tt = 8;
|
|
2321
|
+
function nt(t, n) {
|
|
2322
|
+
let { nodeInfoById: r, realNodeRects: i } = R(n), a = [
|
|
2536
2323
|
"top",
|
|
2537
2324
|
"bottom",
|
|
2538
2325
|
"left",
|
|
@@ -2543,27 +2330,27 @@ function bt(t, n) {
|
|
|
2543
2330
|
left: Math.min(...i.map((e) => e.rect.left)) - 20,
|
|
2544
2331
|
right: Math.max(...i.map((e) => e.rect.right)) + 20
|
|
2545
2332
|
}, s = /* @__PURE__ */ e((e, t, n, r) => {
|
|
2546
|
-
let i = [], a =
|
|
2547
|
-
return a && i.push(a), t === r && i.push(
|
|
2333
|
+
let i = [], a = ee(e, t, n, r, 20, et);
|
|
2334
|
+
return a && i.push(a), t === r && i.push(L(e, t, n, o[t])), i;
|
|
2548
2335
|
}, "buildOrthogonalPathCandidates"), c = /* @__PURE__ */ e((e, t) => {
|
|
2549
2336
|
for (let n = 0; n < e.length - 1; n++) {
|
|
2550
2337
|
let r = e[n], a = e[n + 1];
|
|
2551
|
-
if (
|
|
2338
|
+
if (B(r, a, i, t, 1)) return !0;
|
|
2552
2339
|
}
|
|
2553
2340
|
return !1;
|
|
2554
2341
|
}, "pathHitsNode"), l = /* @__PURE__ */ e((e, n, r = !1) => {
|
|
2555
|
-
let i = 0, a =
|
|
2342
|
+
let i = 0, a = T(e, et), o = n.start, s = n.end;
|
|
2556
2343
|
for (let e of t) {
|
|
2557
2344
|
if (e === n || e.isLayoutOnly) continue;
|
|
2558
2345
|
let t = e.start, c = e.end;
|
|
2559
2346
|
if (!r && o && s && (t === o || t === s || c === o || c === s)) continue;
|
|
2560
2347
|
let l = e.points;
|
|
2561
|
-
if (!(!l || l.length < 2)) for (let e of a) for (let t of
|
|
2562
|
-
if (
|
|
2348
|
+
if (!(!l || l.length < 2)) for (let e of a) for (let t of T(l, et)) {
|
|
2349
|
+
if (re(e.a, e.b, t.a, t.b, et, et)) {
|
|
2563
2350
|
i++;
|
|
2564
2351
|
continue;
|
|
2565
2352
|
}
|
|
2566
|
-
|
|
2353
|
+
w(e, t, et) >= tt && i++;
|
|
2567
2354
|
}
|
|
2568
2355
|
}
|
|
2569
2356
|
return i;
|
|
@@ -2596,7 +2383,7 @@ function bt(t, n) {
|
|
|
2596
2383
|
if (e.isLayoutOnly) continue;
|
|
2597
2384
|
let t = e.points;
|
|
2598
2385
|
if (!t || t.length < 2) continue;
|
|
2599
|
-
let n =
|
|
2386
|
+
let n = E(t, et);
|
|
2600
2387
|
if (n < 4) continue;
|
|
2601
2388
|
let i = e.start, o = e.end;
|
|
2602
2389
|
if (!i || !o) continue;
|
|
@@ -2605,13 +2392,13 @@ function bt(t, n) {
|
|
|
2605
2392
|
let g = e.id ?? "", _ = l(t, e, !0), v = l(t, e), y, b = _, x = n;
|
|
2606
2393
|
for (let t of a) {
|
|
2607
2394
|
if (p(i, t, g)) continue;
|
|
2608
|
-
let n =
|
|
2395
|
+
let n = I(m, t);
|
|
2609
2396
|
for (let r of a) {
|
|
2610
2397
|
if (p(o, r, g)) continue;
|
|
2611
|
-
let a =
|
|
2398
|
+
let a = I(h, r);
|
|
2612
2399
|
for (let u of s(n, t, a, r)) {
|
|
2613
2400
|
if (c(u, [i, o])) continue;
|
|
2614
|
-
let t =
|
|
2401
|
+
let t = E(u, et);
|
|
2615
2402
|
if (_ > 0) {
|
|
2616
2403
|
let n = l(u, e, !0);
|
|
2617
2404
|
if (n > b || n === b && t >= x) continue;
|
|
@@ -2631,27 +2418,27 @@ function bt(t, n) {
|
|
|
2631
2418
|
}
|
|
2632
2419
|
}
|
|
2633
2420
|
}
|
|
2634
|
-
e(
|
|
2635
|
-
var
|
|
2636
|
-
function
|
|
2421
|
+
e(nt, "simplifyDetouredEdges");
|
|
2422
|
+
var Q = .001, rt = 10, it = 7;
|
|
2423
|
+
function at(e, t) {
|
|
2637
2424
|
let n = t ? 0 : e.length - 1, r = t ? 1 : -1, i = e[n], a = e[n + r];
|
|
2638
2425
|
if (!i || !a) return;
|
|
2639
2426
|
let o = a.x - i.x, s = a.y - i.y;
|
|
2640
|
-
if (!(Math.abs(o) + Math.abs(s) <
|
|
2641
|
-
if (Math.abs(s) <=
|
|
2642
|
-
let e = i.x + Math.sign(o) *
|
|
2427
|
+
if (!(Math.abs(o) + Math.abs(s) < Q)) {
|
|
2428
|
+
if (Math.abs(s) <= Q) {
|
|
2429
|
+
let e = i.x + Math.sign(o) * rt;
|
|
2643
2430
|
return {
|
|
2644
2431
|
left: Math.min(i.x, e),
|
|
2645
2432
|
right: Math.max(i.x, e),
|
|
2646
|
-
top: i.y -
|
|
2647
|
-
bottom: i.y +
|
|
2433
|
+
top: i.y - it,
|
|
2434
|
+
bottom: i.y + it
|
|
2648
2435
|
};
|
|
2649
2436
|
}
|
|
2650
|
-
if (Math.abs(o) <=
|
|
2651
|
-
let e = i.y + Math.sign(s) *
|
|
2437
|
+
if (Math.abs(o) <= Q) {
|
|
2438
|
+
let e = i.y + Math.sign(s) * rt;
|
|
2652
2439
|
return {
|
|
2653
|
-
left: i.x -
|
|
2654
|
-
right: i.x +
|
|
2440
|
+
left: i.x - it,
|
|
2441
|
+
right: i.x + it,
|
|
2655
2442
|
top: Math.min(i.y, e),
|
|
2656
2443
|
bottom: Math.max(i.y, e)
|
|
2657
2444
|
};
|
|
@@ -2664,8 +2451,8 @@ function wt(e, t) {
|
|
|
2664
2451
|
};
|
|
2665
2452
|
}
|
|
2666
2453
|
}
|
|
2667
|
-
e(
|
|
2668
|
-
function
|
|
2454
|
+
e(at, "markerClearanceRectFor");
|
|
2455
|
+
function ot(e) {
|
|
2669
2456
|
return {
|
|
2670
2457
|
left: Math.min(e.left, e.right),
|
|
2671
2458
|
right: Math.max(e.left, e.right),
|
|
@@ -2673,13 +2460,13 @@ function Tt(e) {
|
|
|
2673
2460
|
bottom: Math.max(e.top, e.bottom)
|
|
2674
2461
|
};
|
|
2675
2462
|
}
|
|
2676
|
-
e(
|
|
2677
|
-
function
|
|
2678
|
-
let n =
|
|
2679
|
-
return [
|
|
2463
|
+
e(ot, "normalizeRect");
|
|
2464
|
+
function st(e, t) {
|
|
2465
|
+
let n = D(t);
|
|
2466
|
+
return [at(n, !0), at(n, !1)].some((t) => t && M(e, ot(t)));
|
|
2680
2467
|
}
|
|
2681
|
-
e(
|
|
2682
|
-
function
|
|
2468
|
+
e(st, "labelOverlapsOwnMarker");
|
|
2469
|
+
function ct(t, n) {
|
|
2683
2470
|
let r = [];
|
|
2684
2471
|
for (let e of t) {
|
|
2685
2472
|
if (e.isLayoutOnly) continue;
|
|
@@ -2694,7 +2481,7 @@ function Dt(t, n) {
|
|
|
2694
2481
|
for (let e of n.values()) {
|
|
2695
2482
|
let t = e.isGroup, n = e.parentId;
|
|
2696
2483
|
if (t && !n) {
|
|
2697
|
-
let t =
|
|
2484
|
+
let t = F(e);
|
|
2698
2485
|
t && a.push({
|
|
2699
2486
|
id: e.id,
|
|
2700
2487
|
rect: t
|
|
@@ -2702,23 +2489,23 @@ function Dt(t, n) {
|
|
|
2702
2489
|
continue;
|
|
2703
2490
|
}
|
|
2704
2491
|
if (t || e.isEdgeLabel) continue;
|
|
2705
|
-
let r =
|
|
2492
|
+
let r = F(e);
|
|
2706
2493
|
r && i.push({
|
|
2707
2494
|
nodeId: e.id,
|
|
2708
2495
|
rect: r
|
|
2709
2496
|
});
|
|
2710
2497
|
}
|
|
2711
2498
|
let o = /* @__PURE__ */ e((e, t) => {
|
|
2712
|
-
let n =
|
|
2713
|
-
for (let { nodeId: t, rect: r } of i) if (t !== e &&
|
|
2499
|
+
let n = N(t, 3);
|
|
2500
|
+
for (let { nodeId: t, rect: r } of i) if (t !== e && M(n, r)) return !0;
|
|
2714
2501
|
return !1;
|
|
2715
2502
|
}, "labelOverlapsForeignNode"), s = /* @__PURE__ */ e((e, t) => {
|
|
2716
|
-
let n =
|
|
2717
|
-
for (let t of r) if (t.edgeId !== e &&
|
|
2503
|
+
let n = N(t, 3);
|
|
2504
|
+
for (let t of r) if (t.edgeId !== e && k(t.p1, t.p2, n)) return !0;
|
|
2718
2505
|
return !1;
|
|
2719
2506
|
}, "labelOverlapsForeignEdge"), c = /* @__PURE__ */ e((e, t, n) => o(e, n) || s(t, n), "labelOverlapsAnything"), l = [], u = /* @__PURE__ */ e((e) => {
|
|
2720
|
-
for (let { id: t, rect: n } of a) if (
|
|
2721
|
-
}, "findContainingLane"), d = /* @__PURE__ */ e((e, t) => l.some((n) => n.labelId !== e &&
|
|
2507
|
+
for (let { id: t, rect: n } of a) if (j(n, e)) return t;
|
|
2508
|
+
}, "findContainingLane"), d = /* @__PURE__ */ e((e, t) => l.some((n) => n.labelId !== e && M(t, n.rect)), "overlapsPlacedLabel");
|
|
2722
2509
|
for (let r of t) {
|
|
2723
2510
|
if (r.isLayoutOnly) continue;
|
|
2724
2511
|
let t = r.labelNodeId;
|
|
@@ -2732,10 +2519,10 @@ function Dt(t, n) {
|
|
|
2732
2519
|
let h = [];
|
|
2733
2520
|
for (let e = 0; e < f.length - 1; e++) {
|
|
2734
2521
|
let t = f[e], n = f[e + 1], r = Math.abs(t.x - n.x), i = Math.abs(t.y - n.y);
|
|
2735
|
-
r <
|
|
2522
|
+
r < Q && i < Q || r >= Q && i >= Q || h.push({
|
|
2736
2523
|
idx: e,
|
|
2737
2524
|
length: r + i,
|
|
2738
|
-
orientation: r >=
|
|
2525
|
+
orientation: r >= Q ? "horizontal" : "vertical",
|
|
2739
2526
|
midX: (t.x + n.x) / 2,
|
|
2740
2527
|
midY: (t.y + n.y) / 2
|
|
2741
2528
|
});
|
|
@@ -2762,8 +2549,8 @@ function Dt(t, n) {
|
|
|
2762
2549
|
midX: n.x + (r.x - n.x) * t,
|
|
2763
2550
|
midY: n.y + (r.y - n.y) * t
|
|
2764
2551
|
};
|
|
2765
|
-
}, "anchorAtT"), w = /* @__PURE__ */ e((e, t, n) => Math.min(n, Math.max(t, e)), "clamp"), T = /* @__PURE__ */ e((e, t) => e.midX >= t.left -
|
|
2766
|
-
let t =
|
|
2552
|
+
}, "anchorAtT"), w = /* @__PURE__ */ e((e, t, n) => Math.min(n, Math.max(t, e)), "clamp"), T = /* @__PURE__ */ e((e, t) => e.midX >= t.left - Q && e.midX <= t.right + Q && e.midY >= t.top - Q && e.midY <= t.bottom + Q, "pointInsideRectInclusive"), E = /* @__PURE__ */ e((e) => {
|
|
2553
|
+
let t = P(e.midX, e.midY, p, m), n = u(t);
|
|
2767
2554
|
if (n) return {
|
|
2768
2555
|
laneId: n,
|
|
2769
2556
|
anchor: e,
|
|
@@ -2776,7 +2563,7 @@ function Dt(t, n) {
|
|
|
2776
2563
|
let l = {
|
|
2777
2564
|
midX: w(e.midX, i, o),
|
|
2778
2565
|
midY: w(e.midY, s, c)
|
|
2779
|
-
}, d =
|
|
2566
|
+
}, d = P(l.midX, l.midY, p, m);
|
|
2780
2567
|
return T(e, d) ? {
|
|
2781
2568
|
laneId: r.id,
|
|
2782
2569
|
anchor: l,
|
|
@@ -2786,11 +2573,11 @@ function Dt(t, n) {
|
|
|
2786
2573
|
let n = (e.orientation === "horizontal" ? p / 2 : m / 2) + 12;
|
|
2787
2574
|
if (e === b) {
|
|
2788
2575
|
let r = f[e.idx];
|
|
2789
|
-
if (D(e, t, r) +
|
|
2576
|
+
if (D(e, t, r) + Q < n) return !1;
|
|
2790
2577
|
}
|
|
2791
2578
|
if (e === x) {
|
|
2792
2579
|
let r = f[e.idx + 1];
|
|
2793
|
-
if (D(e, t, r) +
|
|
2580
|
+
if (D(e, t, r) + Q < n) return !1;
|
|
2794
2581
|
}
|
|
2795
2582
|
return !0;
|
|
2796
2583
|
}, "labelClearsTerminalEndpoints"), k = /* @__PURE__ */ e((e) => {
|
|
@@ -2799,7 +2586,7 @@ function Dt(t, n) {
|
|
|
2799
2586
|
let i = C(e, n);
|
|
2800
2587
|
if (!O(e, i)) continue;
|
|
2801
2588
|
let a = E(i);
|
|
2802
|
-
if (a && !
|
|
2589
|
+
if (a && !st(a.rect, f) && !d(t, a.rect) && !c(t, r.id, a.rect)) return {
|
|
2803
2590
|
laneId: a.laneId,
|
|
2804
2591
|
anchor: a.anchor
|
|
2805
2592
|
};
|
|
@@ -2813,7 +2600,7 @@ function Dt(t, n) {
|
|
|
2813
2600
|
};
|
|
2814
2601
|
if (n && !O(e, a)) continue;
|
|
2815
2602
|
let c = E(a);
|
|
2816
|
-
if (c && !
|
|
2603
|
+
if (c && !st(c.rect, f) && !d(t, c.rect) && !o(t, c.rect) && (i || !s(r.id, c.rect))) return {
|
|
2817
2604
|
laneId: c.laneId,
|
|
2818
2605
|
anchor: c.anchor
|
|
2819
2606
|
};
|
|
@@ -2821,7 +2608,7 @@ function Dt(t, n) {
|
|
|
2821
2608
|
}, "findLaneContainingFallback"), j = k(_) ?? (_.length < h.length ? k(h) : void 0) ?? A(h, !0) ?? A(h, !1) ?? A(h, !1, !0);
|
|
2822
2609
|
if (j) {
|
|
2823
2610
|
i.x = j.anchor.midX, i.y = j.anchor.midY, i.parentId = j.laneId;
|
|
2824
|
-
let e =
|
|
2611
|
+
let e = P(j.anchor.midX, j.anchor.midY, p, m), n = l.findIndex((e) => e.labelId === t);
|
|
2825
2612
|
n >= 0 ? l[n] = {
|
|
2826
2613
|
labelId: t,
|
|
2827
2614
|
rect: e
|
|
@@ -2832,14 +2619,14 @@ function Dt(t, n) {
|
|
|
2832
2619
|
}
|
|
2833
2620
|
}
|
|
2834
2621
|
}
|
|
2835
|
-
e(
|
|
2836
|
-
var
|
|
2837
|
-
function
|
|
2622
|
+
e(ct, "anchorLabelsToPolyline");
|
|
2623
|
+
var lt = 1e-6, ut = 4, dt = 3;
|
|
2624
|
+
function ft(e, t) {
|
|
2838
2625
|
return e < t ? `${e}::${t}` : `${t}::${e}`;
|
|
2839
2626
|
}
|
|
2840
|
-
e(
|
|
2841
|
-
function
|
|
2842
|
-
let { nodeInfoById: r, realNodeRects: i } =
|
|
2627
|
+
e(ft, "pairKey");
|
|
2628
|
+
function pt(t, n) {
|
|
2629
|
+
let { nodeInfoById: r, realNodeRects: i } = R(n), a = /* @__PURE__ */ new Map();
|
|
2843
2630
|
for (let e of n) {
|
|
2844
2631
|
let t = e.id;
|
|
2845
2632
|
if (!e.isGroup && e.isEdgeLabel) {
|
|
@@ -2851,7 +2638,7 @@ function Mt(t, n) {
|
|
|
2851
2638
|
}
|
|
2852
2639
|
}
|
|
2853
2640
|
let o = /* @__PURE__ */ e((n, r, i, o) => {
|
|
2854
|
-
let s =
|
|
2641
|
+
let s = ft(r, i), c = 0, l = /* @__PURE__ */ e((e) => {
|
|
2855
2642
|
if (!e) return;
|
|
2856
2643
|
let t = a.get(e);
|
|
2857
2644
|
if (!t) return;
|
|
@@ -2862,15 +2649,15 @@ function Mt(t, n) {
|
|
|
2862
2649
|
for (let e of t) {
|
|
2863
2650
|
if (e === n || e.isLayoutOnly) continue;
|
|
2864
2651
|
let t = e.start, r = e.end;
|
|
2865
|
-
!t || !r ||
|
|
2652
|
+
!t || !r || ft(t, r) === s && l(e.labelNodeId);
|
|
2866
2653
|
}
|
|
2867
|
-
return c > 0 ? c +
|
|
2654
|
+
return c > 0 ? c + dt : 0;
|
|
2868
2655
|
}, "labelClearanceFor");
|
|
2869
2656
|
for (let e of t) {
|
|
2870
2657
|
if (e.isLayoutOnly) continue;
|
|
2871
2658
|
let n = e.points;
|
|
2872
|
-
if (!
|
|
2873
|
-
let a =
|
|
2659
|
+
if (!O(n, lt)) continue;
|
|
2660
|
+
let a = ne(e, r, lt);
|
|
2874
2661
|
if (!a) continue;
|
|
2875
2662
|
let { srcId: s, dstId: c, srcInfo: l, dstInfo: u, collinearX: d, collinearY: f } = a;
|
|
2876
2663
|
if (d === f) continue;
|
|
@@ -2894,8 +2681,8 @@ function Mt(t, n) {
|
|
|
2894
2681
|
y: u.cy
|
|
2895
2682
|
};
|
|
2896
2683
|
}
|
|
2897
|
-
if (
|
|
2898
|
-
let h = o(e, s, c, d ? "x" : "y"), g = h >
|
|
2684
|
+
if (B(p, m, i, [s, c], 1)) continue;
|
|
2685
|
+
let h = o(e, s, c, d ? "x" : "y"), g = h > ut ? h : ut, _ = [
|
|
2899
2686
|
0,
|
|
2900
2687
|
g,
|
|
2901
2688
|
-g
|
|
@@ -2905,16 +2692,16 @@ function Mt(t, n) {
|
|
|
2905
2692
|
if (d) {
|
|
2906
2693
|
if (r.x += n, a.x += n, r.x <= l.rect.left || r.x >= l.rect.right || a.x <= u.rect.left || a.x >= u.rect.right) continue;
|
|
2907
2694
|
} else if (r.y += n, a.y += n, r.y <= l.rect.top || r.y >= l.rect.bottom || a.y <= u.rect.top || a.y >= u.rect.bottom) continue;
|
|
2908
|
-
if (!
|
|
2695
|
+
if (!B(r, a, i, [s, c], 1) && !ae(r, a, t, e, { epsilon: lt })) {
|
|
2909
2696
|
e.points = [r, a];
|
|
2910
2697
|
break;
|
|
2911
2698
|
}
|
|
2912
2699
|
}
|
|
2913
2700
|
}
|
|
2914
2701
|
}
|
|
2915
|
-
e(
|
|
2916
|
-
function
|
|
2917
|
-
let r = .001, { realNodeRects: i, labelNodeRects: a } =
|
|
2702
|
+
e(pt, "straightenCollinearSiblingDetours");
|
|
2703
|
+
function mt(t, n) {
|
|
2704
|
+
let r = .001, { realNodeRects: i, labelNodeRects: a } = z(n.values()), o = /* @__PURE__ */ e((e, t) => T(t, r).map((n) => ({
|
|
2918
2705
|
...n,
|
|
2919
2706
|
edge: e,
|
|
2920
2707
|
interior: n.index >= 1 && n.index <= t.length - 3
|
|
@@ -2923,24 +2710,24 @@ function Nt(t, n) {
|
|
|
2923
2710
|
for (let n of t) {
|
|
2924
2711
|
if (n.isLayoutOnly) continue;
|
|
2925
2712
|
let t = n.points;
|
|
2926
|
-
!t || t.length < 2 || e.push(...o(n,
|
|
2713
|
+
!t || t.length < 2 || e.push(...o(n, D(t)));
|
|
2927
2714
|
}
|
|
2928
2715
|
return e;
|
|
2929
|
-
}, "allSegments"), c = /* @__PURE__ */ e((e, t) => e.horizontal && t.horizontal ?
|
|
2716
|
+
}, "allSegments"), c = /* @__PURE__ */ e((e, t) => e.horizontal && t.horizontal ? C(e.a.x, e.b.x, t.a.x, t.b.x) >= 8 && Math.abs(e.a.y - t.a.y) < 7 : e.vertical && t.vertical ? C(e.a.y, e.b.y, t.a.y, t.b.y) >= 8 && Math.abs(e.a.x - t.a.x) < 7 : !1, "hasCrowdedParallelTrack"), l = /* @__PURE__ */ e((e, n) => {
|
|
2930
2717
|
let s = e.start, l = e.end, u = o(e, n);
|
|
2931
2718
|
if (u.length !== n.length - 1) return !1;
|
|
2932
2719
|
let d = [s, l].filter((e) => !!e), f = e.labelNodeId ? [e.labelNodeId] : [];
|
|
2933
|
-
for (let e of u) if (
|
|
2720
|
+
for (let e of u) if (B(e.a, e.b, i, d, -2) || B(e.a, e.b, a, f, -2)) return !1;
|
|
2934
2721
|
for (let n of t) {
|
|
2935
2722
|
if (n === e || n.isLayoutOnly) continue;
|
|
2936
2723
|
let t = n.points;
|
|
2937
2724
|
if (!(!t || t.length < 2)) {
|
|
2938
|
-
for (let e of u) for (let i of o(n,
|
|
2725
|
+
for (let e of u) for (let i of o(n, D(t))) if (c(e, i) || V(e.a, e.b, i.a, i.b, r)) return !1;
|
|
2939
2726
|
}
|
|
2940
2727
|
}
|
|
2941
2728
|
return !0;
|
|
2942
2729
|
}, "candidateIsSafe"), u = /* @__PURE__ */ e((e, t) => {
|
|
2943
|
-
let n =
|
|
2730
|
+
let n = D(e.edge.points ?? []);
|
|
2944
2731
|
if (n.length < 4 || e.index >= n.length - 1) return;
|
|
2945
2732
|
let r = n.map((e) => ({ ...e }));
|
|
2946
2733
|
if (e.horizontal) r[e.index].y += t, r[e.index + 1].y += t;
|
|
@@ -2951,9 +2738,9 @@ function Nt(t, n) {
|
|
|
2951
2738
|
x: e.x ?? (t.left + t.right) / 2,
|
|
2952
2739
|
y: e.y ?? (t.top + t.bottom) / 2
|
|
2953
2740
|
}), "nodeCenter"), f = /* @__PURE__ */ e((e) => {
|
|
2954
|
-
let t = e.edge, r =
|
|
2741
|
+
let t = e.edge, r = D(t.points ?? []);
|
|
2955
2742
|
if (r.length !== 4 || e.index !== 1) return;
|
|
2956
|
-
let i = t.start ? n.get(t.start) : void 0, a = t.end ? n.get(t.end) : void 0, o = i ?
|
|
2743
|
+
let i = t.start ? n.get(t.start) : void 0, a = t.end ? n.get(t.end) : void 0, o = i ? F(i) : void 0, s = a ? F(a) : void 0, c = r.slice(e.index + 2);
|
|
2957
2744
|
if (!(!i || !a || !o || !s || c.length === 0)) return {
|
|
2958
2745
|
sourceCenter: d(i, o),
|
|
2959
2746
|
targetCenter: d(a, s),
|
|
@@ -2964,7 +2751,7 @@ function Nt(t, n) {
|
|
|
2964
2751
|
let s = i.y >= n.y, c = s ? a.bottom : a.top, l = c + (s ? 20 : -20);
|
|
2965
2752
|
if (s && e.b.y <= l + r || !s && e.b.y >= l - r) return;
|
|
2966
2753
|
let u = e.a.x + t;
|
|
2967
|
-
return
|
|
2754
|
+
return D([
|
|
2968
2755
|
{
|
|
2969
2756
|
x: n.x,
|
|
2970
2757
|
y: c
|
|
@@ -2987,7 +2774,7 @@ function Nt(t, n) {
|
|
|
2987
2774
|
let s = i.x >= n.x, c = s ? a.right : a.left, l = c + (s ? 20 : -20);
|
|
2988
2775
|
if (s && e.b.x <= l + r || !s && e.b.x >= l - r) return;
|
|
2989
2776
|
let u = e.a.y + t;
|
|
2990
|
-
return
|
|
2777
|
+
return D([
|
|
2991
2778
|
{
|
|
2992
2779
|
x: c,
|
|
2993
2780
|
y: n.y
|
|
@@ -3045,25 +2832,25 @@ function Nt(t, n) {
|
|
|
3045
2832
|
if (!t) return;
|
|
3046
2833
|
}
|
|
3047
2834
|
}
|
|
3048
|
-
e(
|
|
3049
|
-
function
|
|
2835
|
+
e(mt, "nudgeSharedInteriorSubpaths");
|
|
2836
|
+
function ht(e, t, n, r) {
|
|
3050
2837
|
let i = t.x - e.x, a = t.y - e.y, o = r.x - n.x, s = r.y - n.y, c = i * s - a * o;
|
|
3051
2838
|
if (Math.abs(c) < 1e-10) return !1;
|
|
3052
2839
|
let l = n.x - e.x, u = n.y - e.y, d = (l * s - u * o) / c, f = (l * a - u * i) / c, p = .01;
|
|
3053
2840
|
return d > p && d < .99 && f > p && f < .99;
|
|
3054
2841
|
}
|
|
3055
|
-
e(
|
|
3056
|
-
function
|
|
2842
|
+
e(ht, "segmentsIntersect");
|
|
2843
|
+
function gt(e) {
|
|
3057
2844
|
let n = e.nodes ?? [], r = e.edges ?? [], i = [];
|
|
3058
2845
|
if (!r.length || !n.length) return i;
|
|
3059
|
-
let a =
|
|
2846
|
+
let a = te(n), o = [];
|
|
3060
2847
|
for (let e of r) {
|
|
3061
2848
|
if (e.isLayoutOnly) continue;
|
|
3062
2849
|
let t = e.points;
|
|
3063
2850
|
if (!t || t.length < 2) continue;
|
|
3064
2851
|
let n = e.start, r = e.end, s = e.labelNodeId, c = e.id ?? `${n}->${r}`;
|
|
3065
2852
|
for (let e of a) if (e.nodeId !== n && e.nodeId !== r && !(s && e.nodeId === s)) {
|
|
3066
|
-
for (let n = 0; n < t.length - 1; n++) if (
|
|
2853
|
+
for (let n = 0; n < t.length - 1; n++) if (k(t[n], t[n + 1], e, -1)) {
|
|
3067
2854
|
i.push({
|
|
3068
2855
|
type: "edge-node-overlap",
|
|
3069
2856
|
edgeId: c,
|
|
@@ -3084,7 +2871,7 @@ function Ft(e) {
|
|
|
3084
2871
|
let s = /* @__PURE__ */ new Set();
|
|
3085
2872
|
for (let e = 0; e < o.length; e++) for (let t = e + 1; t < o.length; t++) {
|
|
3086
2873
|
let n = o[e], r = o[t];
|
|
3087
|
-
if (n.edgeId !== r.edgeId && n.start !== r.start && n.start !== r.end && n.end !== r.start && n.end !== r.end &&
|
|
2874
|
+
if (n.edgeId !== r.edgeId && n.start !== r.start && n.start !== r.end && n.end !== r.start && n.end !== r.end && ht(n.p1, n.p2, r.p1, r.p2)) {
|
|
3088
2875
|
let e = n.edgeId < r.edgeId ? `${n.edgeId}|${r.edgeId}` : `${r.edgeId}|${n.edgeId}`;
|
|
3089
2876
|
s.has(e) || (s.add(e), i.push({
|
|
3090
2877
|
type: "edge-edge-crossing",
|
|
@@ -3101,26 +2888,26 @@ function Ft(e) {
|
|
|
3101
2888
|
}
|
|
3102
2889
|
return i;
|
|
3103
2890
|
}
|
|
3104
|
-
e(
|
|
3105
|
-
function
|
|
2891
|
+
e(gt, "validateSwimlanesLayout");
|
|
2892
|
+
function _t(t, n) {
|
|
3106
2893
|
let r = t.nodes ?? [], i = t.edges ?? [], a = r.filter((e) => !e.isGroup);
|
|
3107
|
-
if ((n === "LR" || n === "RL") && a.length > 0 && !
|
|
2894
|
+
if ((n === "LR" || n === "RL") && a.length > 0 && !Re(t, n) || n === "BT" && a.length > 0 && !Le(t)) return;
|
|
3108
2895
|
for (let e of i) {
|
|
3109
2896
|
if (e.isLayoutOnly) continue;
|
|
3110
2897
|
let t = e.points;
|
|
3111
|
-
!t || t.length < 2 || (e.points =
|
|
2898
|
+
!t || t.length < 2 || (e.points = G(W(t)));
|
|
3112
2899
|
}
|
|
3113
|
-
|
|
2900
|
+
nt(i, r), pt(i, r), He(i, r);
|
|
3114
2901
|
let o = /* @__PURE__ */ new Map();
|
|
3115
2902
|
for (let e of r) o.set(String(e.id), e);
|
|
3116
|
-
|
|
2903
|
+
ct(i, o), q(i, o), Ue(i, o), mt(i, o), Ge(i, o), Ke(i, o), qe(i, o), Xe(i, o);
|
|
3117
2904
|
let s = /* @__PURE__ */ e(() => {
|
|
3118
|
-
|
|
2905
|
+
$e(i, o), Ze(i, o), Qe(i, o), ct(i, o), ke(i, o), qe(i, o), ct(i, o), ke(i, o);
|
|
3119
2906
|
}, "finalizeRenderedEdges");
|
|
3120
|
-
s(),
|
|
2907
|
+
s(), mt(i, o), s(), Je(i, o), Ye(i, o), Je(i, o), Ye(i, o);
|
|
3121
2908
|
}
|
|
3122
|
-
e(
|
|
3123
|
-
function
|
|
2909
|
+
e(_t, "postProcessSwimlaneLayout");
|
|
2910
|
+
function vt(e) {
|
|
3124
2911
|
let t = new Map(e.nodeById), n = /* @__PURE__ */ new Set(), r = [];
|
|
3125
2912
|
for (let i of e.edges) {
|
|
3126
2913
|
if (!t.has(i.src) || !t.has(i.dst)) continue;
|
|
@@ -3134,36 +2921,36 @@ function Lt(e) {
|
|
|
3134
2921
|
nodeById: t
|
|
3135
2922
|
};
|
|
3136
2923
|
}
|
|
3137
|
-
e(
|
|
3138
|
-
function
|
|
2924
|
+
e(vt, "normalizeGraph");
|
|
2925
|
+
function yt(e, t) {
|
|
3139
2926
|
return e.edges.filter((e) => e.dst === t);
|
|
3140
2927
|
}
|
|
3141
|
-
e(
|
|
3142
|
-
function
|
|
2928
|
+
e(yt, "incoming");
|
|
2929
|
+
function bt(e) {
|
|
3143
2930
|
let t = /* @__PURE__ */ new Map();
|
|
3144
2931
|
for (let n of e.nodes) t.set(n, []);
|
|
3145
2932
|
for (let n of e.edges) t.get(n.src).push(n.dst);
|
|
3146
2933
|
return t;
|
|
3147
2934
|
}
|
|
3148
|
-
e(
|
|
3149
|
-
function
|
|
3150
|
-
let t =
|
|
2935
|
+
e(bt, "buildSuccessorMap");
|
|
2936
|
+
function xt(e) {
|
|
2937
|
+
let t = bt(e);
|
|
3151
2938
|
for (let e of t.values()) e.sort((e, t) => e.localeCompare(t));
|
|
3152
2939
|
return t;
|
|
3153
2940
|
}
|
|
3154
|
-
e(
|
|
3155
|
-
function
|
|
2941
|
+
e(xt, "buildSortedSuccessorMap");
|
|
2942
|
+
function St(e) {
|
|
3156
2943
|
let t = /* @__PURE__ */ new Map();
|
|
3157
2944
|
for (let n of e.nodes) t.set(n, 0);
|
|
3158
2945
|
for (let n of e.edges) t.set(n.dst, (t.get(n.dst) ?? 0) + 1);
|
|
3159
2946
|
return t;
|
|
3160
2947
|
}
|
|
3161
|
-
e(
|
|
3162
|
-
function
|
|
2948
|
+
e(St, "buildInDegreeMap");
|
|
2949
|
+
function Ct(e) {
|
|
3163
2950
|
return [...e.entries()].filter(([, e]) => e === 0).map(([e]) => e).sort((e, t) => e.localeCompare(t));
|
|
3164
2951
|
}
|
|
3165
|
-
e(
|
|
3166
|
-
function
|
|
2952
|
+
e(Ct, "sortedZeroInDegreeNodes");
|
|
2953
|
+
function wt(e, t = () => !0) {
|
|
3167
2954
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
3168
2955
|
for (let t of e.nodes) n.set(t, []), r.set(t, []);
|
|
3169
2956
|
for (let i of e.edges) t(i) && (r.get(i.src).push(i.dst), n.get(i.dst).push(i.src));
|
|
@@ -3172,17 +2959,17 @@ function Ut(e, t = () => !0) {
|
|
|
3172
2959
|
succs: r
|
|
3173
2960
|
};
|
|
3174
2961
|
}
|
|
3175
|
-
e(
|
|
3176
|
-
function
|
|
2962
|
+
e(wt, "buildPredecessorSuccessorMaps");
|
|
2963
|
+
function Tt(e, t, n, r) {
|
|
3177
2964
|
let i = 0;
|
|
3178
2965
|
for (let t of e.nodes) r?.skipGroups && e.nodeById.get(t)?.isGroup || (i = Math.max(i, n[t] ?? 0));
|
|
3179
2966
|
let a = Array.from({ length: i + 1 }, () => []);
|
|
3180
2967
|
for (let i of t) r?.skipGroups && e.nodeById.get(i)?.isGroup || a[Math.max(0, n[i] ?? 0)].push(i);
|
|
3181
2968
|
return a;
|
|
3182
2969
|
}
|
|
3183
|
-
e(
|
|
3184
|
-
function
|
|
3185
|
-
let t =
|
|
2970
|
+
e(Tt, "buildLayersFromRanks");
|
|
2971
|
+
function Et(e) {
|
|
2972
|
+
let t = St(e), n = Ct(t), r = [], i = xt(e);
|
|
3186
2973
|
for (; n.length;) {
|
|
3187
2974
|
let e = n.shift();
|
|
3188
2975
|
r.push(e);
|
|
@@ -3194,14 +2981,14 @@ function Gt(e) {
|
|
|
3194
2981
|
}
|
|
3195
2982
|
return r.length === e.nodes.length ? r : null;
|
|
3196
2983
|
}
|
|
3197
|
-
e(
|
|
3198
|
-
function
|
|
2984
|
+
e(Et, "topoSortIfAcyclic");
|
|
2985
|
+
function Dt(e) {
|
|
3199
2986
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
3200
2987
|
for (let r of e) t.set(r, n), n++;
|
|
3201
2988
|
return t;
|
|
3202
2989
|
}
|
|
3203
|
-
e(
|
|
3204
|
-
function
|
|
2990
|
+
e(Dt, "buildLayerIndex");
|
|
2991
|
+
function Ot(t) {
|
|
3205
2992
|
let n = Array(t.length), r = /* @__PURE__ */ e((e, i) => {
|
|
3206
2993
|
if (i - e <= 1) return 0;
|
|
3207
2994
|
let a = e + i >> 1, o = r(e, a) + r(a, i), s = e, c = a, l = e;
|
|
@@ -3211,9 +2998,9 @@ function qt(t) {
|
|
|
3211
2998
|
}, "count");
|
|
3212
2999
|
return r(0, t.length);
|
|
3213
3000
|
}
|
|
3214
|
-
e(
|
|
3215
|
-
function
|
|
3216
|
-
let n =
|
|
3001
|
+
e(Ot, "countInversions");
|
|
3002
|
+
function kt(t) {
|
|
3003
|
+
let n = vt(t), r = /* @__PURE__ */ new Map();
|
|
3217
3004
|
for (let e of n.nodes) r.set(e, []);
|
|
3218
3005
|
for (let e of n.edges) r.get(e.src).push(e);
|
|
3219
3006
|
for (let e of r.values()) e.sort((e, t) => e.dst === t.dst ? e.id.localeCompare(t.id) : e.dst.localeCompare(t.dst));
|
|
@@ -3226,9 +3013,9 @@ function Jt(t) {
|
|
|
3226
3013
|
i[e] === 0 ? o(e) : i[e] === 1 && a.push(t);
|
|
3227
3014
|
}
|
|
3228
3015
|
i[e] = 2;
|
|
3229
|
-
}, "dfs"), s = [...n.nodes
|
|
3230
|
-
for (let e of
|
|
3231
|
-
let
|
|
3016
|
+
}, "dfs"), s = St(n), c = [...n.nodes.filter((e) => (s.get(e) ?? 0) === 0), ...n.nodes.filter((e) => (s.get(e) ?? 0) !== 0)];
|
|
3017
|
+
for (let e of c) i[e] === 0 && o(e);
|
|
3018
|
+
let l = new Set(a.map((e) => `${e.id}:${e.src}->${e.dst}`)), u = n.edges.map((e) => l.has(`${e.id}:${e.src}->${e.dst}`) ? {
|
|
3232
3019
|
id: e.id,
|
|
3233
3020
|
src: e.dst,
|
|
3234
3021
|
dst: e.src,
|
|
@@ -3238,15 +3025,15 @@ function Jt(t) {
|
|
|
3238
3025
|
return {
|
|
3239
3026
|
acyclic: {
|
|
3240
3027
|
nodes: [...n.nodes],
|
|
3241
|
-
edges:
|
|
3028
|
+
edges: u,
|
|
3242
3029
|
layout: n.layout,
|
|
3243
3030
|
nodeById: new Map(n.nodeById)
|
|
3244
3031
|
},
|
|
3245
3032
|
reversed: a
|
|
3246
3033
|
};
|
|
3247
3034
|
}
|
|
3248
|
-
e(
|
|
3249
|
-
function
|
|
3035
|
+
e(kt, "removeCycles_DFS");
|
|
3036
|
+
function At(t) {
|
|
3250
3037
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ e((e) => {
|
|
3251
3038
|
if (n.has(e)) return n.get(e);
|
|
3252
3039
|
let i = t.nodeById.get(e);
|
|
@@ -3259,46 +3046,46 @@ function Yt(t) {
|
|
|
3259
3046
|
for (let e of t.nodes) r(e);
|
|
3260
3047
|
return n;
|
|
3261
3048
|
}
|
|
3262
|
-
e(
|
|
3263
|
-
function
|
|
3264
|
-
let t =
|
|
3049
|
+
e(At, "buildTopLaneMap");
|
|
3050
|
+
function jt(e) {
|
|
3051
|
+
let t = At(e);
|
|
3265
3052
|
return (e) => t.get(e) ?? null;
|
|
3266
3053
|
}
|
|
3267
|
-
e(
|
|
3268
|
-
function
|
|
3054
|
+
e(jt, "createTopLaneResolver");
|
|
3055
|
+
function Mt(e) {
|
|
3269
3056
|
let t = [];
|
|
3270
3057
|
for (let n of e.layout.nodes ?? []) n.isGroup && !n.parentId && t.push(n.id);
|
|
3271
3058
|
return [...new Set(t)].reverse();
|
|
3272
3059
|
}
|
|
3273
|
-
e(
|
|
3274
|
-
function
|
|
3275
|
-
let n =
|
|
3060
|
+
e(Mt, "buildTopLaneOrder");
|
|
3061
|
+
function Nt(e, t) {
|
|
3062
|
+
let n = Mt(e);
|
|
3276
3063
|
if (!t || t.length === 0) return n;
|
|
3277
3064
|
let r = new Set(n), i = /* @__PURE__ */ new Set(), a = [];
|
|
3278
3065
|
for (let e of t) !r.has(e) || i.has(e) || (i.add(e), a.push(e));
|
|
3279
3066
|
for (let e of n) i.has(e) || a.push(e);
|
|
3280
3067
|
return a;
|
|
3281
3068
|
}
|
|
3282
|
-
e(
|
|
3283
|
-
var
|
|
3069
|
+
e(Nt, "resolveTopLaneOrder");
|
|
3070
|
+
var Pt = { EPSILON: 1e-6 }, Ft = {
|
|
3284
3071
|
GRAVITY_ITERATIONS: 8,
|
|
3285
3072
|
MAX_CROSSING_OPTIMIZATION_PASSES: 4,
|
|
3286
3073
|
DEFAULT_COMPACT_SINGLE_INPUT: !0
|
|
3287
|
-
},
|
|
3074
|
+
}, It = {
|
|
3288
3075
|
DEFAULT_LAYER_GAP: 100,
|
|
3289
3076
|
DEFAULT_NODE_GAP: 40
|
|
3290
3077
|
};
|
|
3291
|
-
function
|
|
3292
|
-
let r =
|
|
3078
|
+
function Lt(t, n) {
|
|
3079
|
+
let r = vt(t), i = n?.laneOf ?? (() => null), a = n?.rankHint, { preds: o } = wt(r);
|
|
3293
3080
|
for (let e of o.values()) e.sort((e, t) => e.localeCompare(t));
|
|
3294
|
-
let s =
|
|
3081
|
+
let s = Et(r) ?? [...r.nodes].sort((e, t) => e.localeCompare(t)), c = /* @__PURE__ */ new Map();
|
|
3295
3082
|
for (let [e, t] of s.entries()) c.set(t, e);
|
|
3296
3083
|
let l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
3297
3084
|
for (let e of r.nodes) u.set(e, []);
|
|
3298
3085
|
for (let e of s) {
|
|
3299
3086
|
let t = (o.get(e) ?? []).filter((e) => l.has(e));
|
|
3300
3087
|
if (t.length > 0) {
|
|
3301
|
-
let n =
|
|
3088
|
+
let n = Rt(e, t, {
|
|
3302
3089
|
laneOf: i,
|
|
3303
3090
|
rankHint: a,
|
|
3304
3091
|
topoIndex: c
|
|
@@ -3312,9 +3099,9 @@ function nn(t, n) {
|
|
|
3312
3099
|
let f = [...d].sort((e, t) => {
|
|
3313
3100
|
let n = c.get(e) ?? 0, r = c.get(t) ?? 0;
|
|
3314
3101
|
return n === r ? e.localeCompare(t) : n - r;
|
|
3315
|
-
}), p =
|
|
3102
|
+
}), p = zt(r), m = /* @__PURE__ */ new Map();
|
|
3316
3103
|
for (let [e, t] of p.entries()) m.set(e, [...t].sort((e, t) => e.localeCompare(t)));
|
|
3317
|
-
let h =
|
|
3104
|
+
let h = Bt(m), g = Vt(m), _ = /* @__PURE__ */ new Map();
|
|
3318
3105
|
for (let e of r.nodes) _.set(e, []);
|
|
3319
3106
|
for (let e of g) for (let t of e.nodes) {
|
|
3320
3107
|
let n = _.get(t);
|
|
@@ -3342,8 +3129,8 @@ function nn(t, n) {
|
|
|
3342
3129
|
topologicalOrder: s
|
|
3343
3130
|
};
|
|
3344
3131
|
}
|
|
3345
|
-
e(
|
|
3346
|
-
function
|
|
3132
|
+
e(Lt, "buildDrivingTree");
|
|
3133
|
+
function Rt(e, t, n) {
|
|
3347
3134
|
let r = n.laneOf(e);
|
|
3348
3135
|
return [...t].sort((e, t) => {
|
|
3349
3136
|
let i = n.laneOf(e), a = n.laneOf(t), o = i != null && i === r;
|
|
@@ -3354,15 +3141,15 @@ function rn(e, t, n) {
|
|
|
3354
3141
|
return l === u ? e.localeCompare(t) : l - u;
|
|
3355
3142
|
})[0];
|
|
3356
3143
|
}
|
|
3357
|
-
e(
|
|
3358
|
-
function
|
|
3144
|
+
e(Rt, "chooseParent");
|
|
3145
|
+
function zt(e) {
|
|
3359
3146
|
let t = /* @__PURE__ */ new Map();
|
|
3360
3147
|
for (let n of e.nodes) t.set(n, /* @__PURE__ */ new Set());
|
|
3361
3148
|
for (let n of e.edges) t.get(n.src).add(n.dst), t.get(n.dst).add(n.src);
|
|
3362
3149
|
return t;
|
|
3363
3150
|
}
|
|
3364
|
-
e(
|
|
3365
|
-
function
|
|
3151
|
+
e(zt, "buildAdjacency");
|
|
3152
|
+
function Bt(e) {
|
|
3366
3153
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
3367
3154
|
for (let r of e.keys()) {
|
|
3368
3155
|
if (t.has(r)) continue;
|
|
@@ -3378,17 +3165,17 @@ function on(e) {
|
|
|
3378
3165
|
}
|
|
3379
3166
|
return t;
|
|
3380
3167
|
}
|
|
3381
|
-
e(
|
|
3382
|
-
function
|
|
3168
|
+
e(Bt, "assignComponents");
|
|
3169
|
+
function Vt(t) {
|
|
3383
3170
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = [], a = [], o = 0, s = /* @__PURE__ */ e((e, c) => {
|
|
3384
3171
|
n.set(e, ++o), r.set(e, o);
|
|
3385
|
-
for (let l of t.get(e) ?? []) l !== c && (n.has(l) ? (n.get(l) ?? 0) < (n.get(e) ?? 0) && (i.push([e, l]), r.set(e, Math.min(r.get(e) ?? o, n.get(l) ?? o))) : (i.push([e, l]), s(l, e), r.set(e, Math.min(r.get(e) ?? o, r.get(l) ?? o)), (r.get(l) ?? 0) >= (n.get(e) ?? 0) && a.push(
|
|
3172
|
+
for (let l of t.get(e) ?? []) l !== c && (n.has(l) ? (n.get(l) ?? 0) < (n.get(e) ?? 0) && (i.push([e, l]), r.set(e, Math.min(r.get(e) ?? o, n.get(l) ?? o))) : (i.push([e, l]), s(l, e), r.set(e, Math.min(r.get(e) ?? o, r.get(l) ?? o)), (r.get(l) ?? 0) >= (n.get(e) ?? 0) && a.push(Ht(e, l, i, a.length))));
|
|
3386
3173
|
}, "visit");
|
|
3387
3174
|
for (let e of t.keys()) n.has(e) || s(e, null);
|
|
3388
3175
|
return a;
|
|
3389
3176
|
}
|
|
3390
|
-
e(
|
|
3391
|
-
function
|
|
3177
|
+
e(Vt, "computeBlocks");
|
|
3178
|
+
function Ht(e, t, n, r) {
|
|
3392
3179
|
let i = [], a = /* @__PURE__ */ new Set();
|
|
3393
3180
|
for (; n.length > 0;) {
|
|
3394
3181
|
let r = n.pop();
|
|
@@ -3400,8 +3187,8 @@ function cn(e, t, n, r) {
|
|
|
3400
3187
|
nodes: [...a]
|
|
3401
3188
|
};
|
|
3402
3189
|
}
|
|
3403
|
-
e(
|
|
3404
|
-
function
|
|
3190
|
+
e(Ht, "popBlock");
|
|
3191
|
+
function Ut(t, n, r) {
|
|
3405
3192
|
let i = [...t.nodes], a = /* @__PURE__ */ new Map();
|
|
3406
3193
|
for (let [e, t] of i.entries()) a.set(t, e);
|
|
3407
3194
|
let o = i.length, s = Array(o).fill(-1), c = Array(o).fill(0), l = [], u = /* @__PURE__ */ new Set();
|
|
@@ -3474,11 +3261,11 @@ function ln(t, n, r) {
|
|
|
3474
3261
|
for (let e of i) _.has(e) || v(e);
|
|
3475
3262
|
return h;
|
|
3476
3263
|
}
|
|
3477
|
-
e(
|
|
3478
|
-
function
|
|
3264
|
+
e(Ut, "computeSubtreeCrossCounts");
|
|
3265
|
+
function Wt(t, n, r) {
|
|
3479
3266
|
let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ e((e) => {
|
|
3480
3267
|
let t = r[e] ?? 0, o = [...n.get(e) ?? []];
|
|
3481
|
-
o.sort(
|
|
3268
|
+
o.sort(Gt(r));
|
|
3482
3269
|
for (let e of o) {
|
|
3483
3270
|
a(e);
|
|
3484
3271
|
let n = i.get(e);
|
|
@@ -3489,15 +3276,15 @@ function un(t, n, r) {
|
|
|
3489
3276
|
for (let e of t) a(e);
|
|
3490
3277
|
return i;
|
|
3491
3278
|
}
|
|
3492
|
-
e(
|
|
3493
|
-
function
|
|
3279
|
+
e(Wt, "annotateMinimumLayers");
|
|
3280
|
+
function Gt(e) {
|
|
3494
3281
|
return (t, n) => {
|
|
3495
3282
|
let r = e[t] ?? 0, i = e[n] ?? 0;
|
|
3496
3283
|
return r === i ? t.localeCompare(n) : r - i;
|
|
3497
3284
|
};
|
|
3498
3285
|
}
|
|
3499
|
-
e(
|
|
3500
|
-
function
|
|
3286
|
+
e(Gt, "compareByRankThenId");
|
|
3287
|
+
function Kt(t, n, r, i) {
|
|
3501
3288
|
let a = 0;
|
|
3502
3289
|
for (let e of n) {
|
|
3503
3290
|
let t = r[e] ?? 0;
|
|
@@ -3517,8 +3304,8 @@ function fn(t, n, r, i) {
|
|
|
3517
3304
|
}
|
|
3518
3305
|
return o;
|
|
3519
3306
|
}
|
|
3520
|
-
e(
|
|
3521
|
-
function
|
|
3307
|
+
e(Kt, "emitNodesInTreeOrder");
|
|
3308
|
+
function qt(e) {
|
|
3522
3309
|
let t = [];
|
|
3523
3310
|
for (let n of e) {
|
|
3524
3311
|
let e = /* @__PURE__ */ new Set(), r = [];
|
|
@@ -3527,8 +3314,8 @@ function pn(e) {
|
|
|
3527
3314
|
}
|
|
3528
3315
|
return t;
|
|
3529
3316
|
}
|
|
3530
|
-
e(
|
|
3531
|
-
function
|
|
3317
|
+
e(qt, "deduplicateLayers");
|
|
3318
|
+
function Jt(e, t, n, r) {
|
|
3532
3319
|
return (i) => {
|
|
3533
3320
|
let a = e.get(i) ?? [];
|
|
3534
3321
|
if (a.length === 0) return [];
|
|
@@ -3548,24 +3335,24 @@ function mn(e, t, n, r) {
|
|
|
3548
3335
|
}), [...s.map((e) => e.child), ...c];
|
|
3549
3336
|
};
|
|
3550
3337
|
}
|
|
3551
|
-
e(
|
|
3552
|
-
function
|
|
3553
|
-
let r =
|
|
3338
|
+
e(Jt, "createChildOrderer");
|
|
3339
|
+
function Yt(e, t, n) {
|
|
3340
|
+
let r = Lt(e, {
|
|
3554
3341
|
rankHint: t,
|
|
3555
3342
|
laneOf: n
|
|
3556
3343
|
}), { children: i, roots: a } = r;
|
|
3557
3344
|
for (let t of e.nodes) i.has(t) || i.set(t, []);
|
|
3558
|
-
let o =
|
|
3559
|
-
return l =
|
|
3345
|
+
let o = Ut(e, t, r), s = [...a].sort(Gt(t)), c = Jt(i, t, o, Wt(s, i, t)), l = Kt(s, e.nodes, t, c);
|
|
3346
|
+
return l = qt(l), l;
|
|
3560
3347
|
}
|
|
3561
|
-
e(
|
|
3562
|
-
function
|
|
3563
|
-
let r = new Set(e), i = new Set(t), a =
|
|
3348
|
+
e(Yt, "buildMultitreeLayerOrder");
|
|
3349
|
+
function Xt(e, t, n) {
|
|
3350
|
+
let r = new Set(e), i = new Set(t), a = Dt(t), o = [];
|
|
3564
3351
|
for (let e of n) r.has(e.src) && i.has(e.dst) && o.push(a.get(e.dst));
|
|
3565
|
-
return
|
|
3352
|
+
return Ot(o);
|
|
3566
3353
|
}
|
|
3567
|
-
e(
|
|
3568
|
-
function
|
|
3354
|
+
e(Xt, "countCrossingsBetweenAdjacent");
|
|
3355
|
+
function Zt(e, t, n) {
|
|
3569
3356
|
let r = [];
|
|
3570
3357
|
for (let e of t) {
|
|
3571
3358
|
let t = n[e.src], i = n[e.dst];
|
|
@@ -3580,12 +3367,12 @@ function _n(e, t, n) {
|
|
|
3580
3367
|
});
|
|
3581
3368
|
}
|
|
3582
3369
|
let i = 0;
|
|
3583
|
-
for (let t = 0; t + 1 < e.length; t++) i +=
|
|
3370
|
+
for (let t = 0; t + 1 < e.length; t++) i += Xt(e[t], e[t + 1], r);
|
|
3584
3371
|
return i;
|
|
3585
3372
|
}
|
|
3586
|
-
e(
|
|
3587
|
-
function
|
|
3588
|
-
let n = { ...t }, { preds: r } =
|
|
3373
|
+
e(Zt, "totalCrossings");
|
|
3374
|
+
function Qt(e, t) {
|
|
3375
|
+
let n = { ...t }, { preds: r } = wt(e), i = jt(e), a = Zt(Yt(e, n, i), e.edges, n), o = Ft.MAX_CROSSING_OPTIMIZATION_PASSES;
|
|
3589
3376
|
for (let t = 0; t < o; t++) {
|
|
3590
3377
|
let t = !1, o = [...e.nodes].sort((e, t) => (n[t] ?? 0) - (n[e] ?? 0));
|
|
3591
3378
|
for (let s of o) {
|
|
@@ -3596,16 +3383,16 @@ function vn(e, t) {
|
|
|
3596
3383
|
if (c >= o) continue;
|
|
3597
3384
|
let l = o;
|
|
3598
3385
|
n[s] = c;
|
|
3599
|
-
let u =
|
|
3386
|
+
let u = Zt(Yt(e, n, i), e.edges, n);
|
|
3600
3387
|
u < a ? (a = u, t = !0) : n[s] = l;
|
|
3601
3388
|
}
|
|
3602
3389
|
if (!t) break;
|
|
3603
3390
|
}
|
|
3604
3391
|
return n;
|
|
3605
3392
|
}
|
|
3606
|
-
e(
|
|
3607
|
-
function
|
|
3608
|
-
let n =
|
|
3393
|
+
e(Qt, "optimizeRanksByCrossings");
|
|
3394
|
+
function $t(e, t) {
|
|
3395
|
+
let n = jt(e), r = [...e.nodes].sort((e, n) => (t[e] ?? 0) - (t[n] ?? 0) || e.localeCompare(n));
|
|
3609
3396
|
for (let i of r) {
|
|
3610
3397
|
let r = n(i);
|
|
3611
3398
|
if (!r) continue;
|
|
@@ -3630,11 +3417,11 @@ function yn(e, t) {
|
|
|
3630
3417
|
p !== u && (t[i] = p);
|
|
3631
3418
|
}
|
|
3632
3419
|
}
|
|
3633
|
-
e(
|
|
3634
|
-
function
|
|
3635
|
-
let n =
|
|
3420
|
+
e($t, "adjustCrossLaneSources");
|
|
3421
|
+
function en(e, t) {
|
|
3422
|
+
let n = vt(e), r = Et(n) ?? [...n.nodes].sort(), i = t?.compactSingleInput ?? !1, a = jt(n), o = /* @__PURE__ */ Object.create(null);
|
|
3636
3423
|
for (let e of r) {
|
|
3637
|
-
let r =
|
|
3424
|
+
let r = yt(n, e), s = t?.ignoreCrossLaneEdges ? r.filter((t) => {
|
|
3638
3425
|
let n = a(t.src), r = a(e);
|
|
3639
3426
|
return !n || !r || n === r;
|
|
3640
3427
|
}) : r;
|
|
@@ -3648,30 +3435,30 @@ function bn(e, t) {
|
|
|
3648
3435
|
o[e] = t === -Infinity ? 0 : t;
|
|
3649
3436
|
}
|
|
3650
3437
|
}
|
|
3651
|
-
return (t?.optimizeRanksByCrossings ?? !1) && (o =
|
|
3652
|
-
layers:
|
|
3438
|
+
return (t?.optimizeRanksByCrossings ?? !1) && (o = Qt(n, o)), t?.ignoreCrossLaneEdges && $t(n, o), {
|
|
3439
|
+
layers: Yt(n, o, a),
|
|
3653
3440
|
rankOf: o,
|
|
3654
3441
|
dummy: /* @__PURE__ */ new Set()
|
|
3655
3442
|
};
|
|
3656
3443
|
}
|
|
3657
|
-
e(
|
|
3658
|
-
function
|
|
3659
|
-
let r =
|
|
3444
|
+
e(en, "assignLayers_LongestPath");
|
|
3445
|
+
function tn(t, n) {
|
|
3446
|
+
let r = vt(t), i = { ...en(r, {
|
|
3660
3447
|
compactSingleInput: n?.compactSingleInput,
|
|
3661
3448
|
ignoreCrossLaneEdges: n?.ignoreCrossLaneEdges,
|
|
3662
3449
|
optimizeRanksByCrossings: n?.optimizeRanksByCrossings
|
|
3663
|
-
}).rankOf }, a =
|
|
3450
|
+
}).rankOf }, a = jt(r), { preds: o, succs: s } = wt(r, (e) => {
|
|
3664
3451
|
if (n?.ignoreCrossLaneEdges) {
|
|
3665
3452
|
let t = a(e.src), n = a(e.dst);
|
|
3666
3453
|
if (t && n && t !== n) return !1;
|
|
3667
3454
|
}
|
|
3668
3455
|
return !0;
|
|
3669
|
-
}), c =
|
|
3456
|
+
}), c = Et(r) ?? [...r.nodes], l = [...c].reverse(), u = /* @__PURE__ */ e((e, t) => {
|
|
3670
3457
|
let n = 0;
|
|
3671
3458
|
for (let t of o.get(e) ?? []) n = Math.max(n, (i[t] ?? 0) + 1);
|
|
3672
3459
|
let r = Infinity, a = s.get(e) ?? [];
|
|
3673
3460
|
return a.length > 0 && (r = Math.min(...a.map((e) => (i[e] ?? 0) - 1))), Number.isFinite(r) || (r = Math.max(n, t)), Math.min(Math.max(t, n), r);
|
|
3674
|
-
}, "clampFeasible"), d =
|
|
3461
|
+
}, "clampFeasible"), d = Ft.GRAVITY_ITERATIONS, f = /* @__PURE__ */ e((e) => {
|
|
3675
3462
|
let t = !1;
|
|
3676
3463
|
for (let n of e) {
|
|
3677
3464
|
let e = o.get(n) ?? [], r = s.get(n) ?? [];
|
|
@@ -3698,14 +3485,14 @@ function xn(t, n) {
|
|
|
3698
3485
|
}
|
|
3699
3486
|
}
|
|
3700
3487
|
return {
|
|
3701
|
-
layers:
|
|
3488
|
+
layers: Tt(r, c, i),
|
|
3702
3489
|
rankOf: i,
|
|
3703
3490
|
dummy: /* @__PURE__ */ new Set()
|
|
3704
3491
|
};
|
|
3705
3492
|
}
|
|
3706
|
-
e(
|
|
3707
|
-
function
|
|
3708
|
-
let t =
|
|
3493
|
+
e(tn, "assignLayers_Gravity");
|
|
3494
|
+
function nn(e) {
|
|
3495
|
+
let t = St(e), n = xt(e), r = Ct(t), i = [];
|
|
3709
3496
|
for (; r.length > 0;) {
|
|
3710
3497
|
let e = [];
|
|
3711
3498
|
for (let a of r) {
|
|
@@ -3716,12 +3503,12 @@ function Sn(e) {
|
|
|
3716
3503
|
}
|
|
3717
3504
|
return i.length === e.nodes.length ? i : null;
|
|
3718
3505
|
}
|
|
3719
|
-
e(
|
|
3720
|
-
function
|
|
3721
|
-
let r =
|
|
3506
|
+
e(nn, "topoSortByGenerationIfAcyclic");
|
|
3507
|
+
function rn(t, n) {
|
|
3508
|
+
let r = vt(t), i = n?.direction === "LR" ? nn(r) ?? [...r.nodes].sort() : Et(r) ?? [...r.nodes].sort(), a = jt(r), o = /* @__PURE__ */ e((e) => a(e) ?? e, "laneOf"), s = /* @__PURE__ */ Object.create(null), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ e((e, t) => n?.ignoreCrossLaneEdges ?? !0 ? +(o(e) === o(t)) : 1, "edgeWeight");
|
|
3722
3509
|
for (let e of i) {
|
|
3723
3510
|
if (r.nodeById.get(e)?.isGroup) continue;
|
|
3724
|
-
let t =
|
|
3511
|
+
let t = yt(r, e), n = 0;
|
|
3725
3512
|
if (t.length > 0) for (let r of t) {
|
|
3726
3513
|
let t = r.src, i = s[t] ?? 0;
|
|
3727
3514
|
n = Math.max(n, i + l(t, e));
|
|
@@ -3730,14 +3517,14 @@ function Cn(t, n) {
|
|
|
3730
3517
|
s[e] = u, c.set(i, u + 1);
|
|
3731
3518
|
}
|
|
3732
3519
|
return {
|
|
3733
|
-
layers:
|
|
3520
|
+
layers: Tt(r, i, s, { skipGroups: !0 }),
|
|
3734
3521
|
rankOf: s,
|
|
3735
3522
|
dummy: /* @__PURE__ */ new Set()
|
|
3736
3523
|
};
|
|
3737
3524
|
}
|
|
3738
|
-
e(
|
|
3739
|
-
function
|
|
3740
|
-
let r =
|
|
3525
|
+
e(rn, "assignLayers_LaneAwareCompact");
|
|
3526
|
+
function an(t, n) {
|
|
3527
|
+
let r = vt(n), { rankOf: i } = t, a = t.layers.map((e) => [...e]), o = new Set(t.dummy ? [...t.dummy] : []), s = 0, c = new Map(r.nodeById), l = /* @__PURE__ */ e((e) => {
|
|
3741
3528
|
let t = `placeholder-${s++}`, n = {
|
|
3742
3529
|
id: t,
|
|
3743
3530
|
isGroup: !1,
|
|
@@ -3789,49 +3576,49 @@ function wn(t, n) {
|
|
|
3789
3576
|
graphWithDummies: f
|
|
3790
3577
|
};
|
|
3791
3578
|
}
|
|
3792
|
-
e(
|
|
3793
|
-
function
|
|
3579
|
+
e(an, "makeProperLayering");
|
|
3580
|
+
function on(e) {
|
|
3794
3581
|
let t = e.length;
|
|
3795
3582
|
if (t === 0) return Infinity;
|
|
3796
3583
|
let n = [...e].sort((e, t) => e - t);
|
|
3797
3584
|
return t % 2 == 1 ? n[(t - 1) / 2] : .5 * (n[t / 2 - 1] + n[t / 2]);
|
|
3798
3585
|
}
|
|
3799
|
-
e(
|
|
3800
|
-
function
|
|
3586
|
+
e(on, "median");
|
|
3587
|
+
function sn(e) {
|
|
3801
3588
|
return e.length === 0 ? Infinity : e.reduce((e, t) => e + t, 0) / e.length;
|
|
3802
3589
|
}
|
|
3803
|
-
e(
|
|
3804
|
-
function
|
|
3590
|
+
e(sn, "barycenter");
|
|
3591
|
+
function cn(e, t, n, r) {
|
|
3805
3592
|
let i = /* @__PURE__ */ new Map();
|
|
3806
3593
|
for (let t of e) i.set(t, []);
|
|
3807
3594
|
for (let e of n) r === "down" ? t.has(e.src) && i.has(e.dst) && i.get(e.dst).push(t.get(e.src)) : t.has(e.dst) && i.has(e.src) && i.get(e.src).push(t.get(e.dst));
|
|
3808
3595
|
return i;
|
|
3809
3596
|
}
|
|
3810
|
-
e(
|
|
3811
|
-
function
|
|
3597
|
+
e(cn, "neighborPositionsFor");
|
|
3598
|
+
function ln(e, t, n) {
|
|
3812
3599
|
let r = n.get(e) ?? 0, i = n.get(t) ?? 0;
|
|
3813
3600
|
return r === i ? e.localeCompare(t) : r - i;
|
|
3814
3601
|
}
|
|
3815
|
-
e(
|
|
3816
|
-
function
|
|
3817
|
-
let r = new Set(e), i = new Set(t), a =
|
|
3602
|
+
e(ln, "currentOrderTieBreak");
|
|
3603
|
+
function un(e, t, n) {
|
|
3604
|
+
let r = new Set(e), i = new Set(t), a = Dt(e), o = Dt(t), s = [];
|
|
3818
3605
|
for (let e of n) r.has(e.src) && i.has(e.dst) && s.push({
|
|
3819
3606
|
u: a.get(e.src),
|
|
3820
3607
|
v: o.get(e.dst)
|
|
3821
3608
|
});
|
|
3822
|
-
return s.sort((e, t) => e.u === t.u ? e.v - t.v : e.u - t.u),
|
|
3609
|
+
return s.sort((e, t) => e.u === t.u ? e.v - t.v : e.u - t.u), Ot(s.map((e) => e.v));
|
|
3823
3610
|
}
|
|
3824
|
-
e(
|
|
3825
|
-
function
|
|
3611
|
+
e(un, "countCrossingsBetweenAdjacent");
|
|
3612
|
+
function dn(e, t, n) {
|
|
3826
3613
|
return [...e].sort((e, r) => {
|
|
3827
|
-
let i =
|
|
3828
|
-
return i === a ?
|
|
3614
|
+
let i = on(t.get(e) ?? []), a = on(t.get(r) ?? []);
|
|
3615
|
+
return i === a ? ln(e, r, n) : isFinite(i) ? isFinite(a) ? i - a : -1 : 1;
|
|
3829
3616
|
});
|
|
3830
3617
|
}
|
|
3831
|
-
e(
|
|
3832
|
-
function
|
|
3833
|
-
let o =
|
|
3834
|
-
if (!i || !a || a.length === 0) return
|
|
3618
|
+
e(dn, "sortByHeuristic");
|
|
3619
|
+
function fn(e, t, n, r, i, a) {
|
|
3620
|
+
let o = Dt(e), s = Dt(t), c = cn(t, o, n, r);
|
|
3621
|
+
if (!i || !a || a.length === 0) return dn(t, c, s);
|
|
3835
3622
|
let l = /* @__PURE__ */ new Map();
|
|
3836
3623
|
for (let e of t) {
|
|
3837
3624
|
let t = i(e), n = l.get(t) ?? [];
|
|
@@ -3841,16 +3628,16 @@ function jn(e, t, n, r, i, a) {
|
|
|
3841
3628
|
for (let e of a) {
|
|
3842
3629
|
let t = l.get(e);
|
|
3843
3630
|
if (!t || t.length === 0) continue;
|
|
3844
|
-
let n =
|
|
3631
|
+
let n = dn(t, c, s);
|
|
3845
3632
|
u.push(...n);
|
|
3846
3633
|
}
|
|
3847
3634
|
let d = l.get(null);
|
|
3848
3635
|
if (d && d.length > 0) {
|
|
3849
|
-
let e =
|
|
3636
|
+
let e = dn(d, c, s);
|
|
3850
3637
|
for (let t of e) {
|
|
3851
|
-
let e =
|
|
3638
|
+
let e = sn(c.get(t) ?? []), n = u.length;
|
|
3852
3639
|
if (isFinite(e)) {
|
|
3853
|
-
for (let [t, r] of u.entries()) if (e <
|
|
3640
|
+
for (let [t, r] of u.entries()) if (e < sn(c.get(r) ?? [])) {
|
|
3854
3641
|
n = t;
|
|
3855
3642
|
break;
|
|
3856
3643
|
}
|
|
@@ -3860,11 +3647,11 @@ function jn(e, t, n, r, i, a) {
|
|
|
3860
3647
|
}
|
|
3861
3648
|
return u;
|
|
3862
3649
|
}
|
|
3863
|
-
e(
|
|
3864
|
-
function
|
|
3650
|
+
e(fn, "reorderLayer");
|
|
3651
|
+
function pn(t, n, r, i, a) {
|
|
3865
3652
|
let o = [...n], s = new Set(t), c = new Set(n), l = i ? new Set(i) : null, u = r.filter((e) => s.has(e.src) && c.has(e.dst)), d = l ? r.filter((e) => c.has(e.src) && l.has(e.dst)) : void 0, f = /* @__PURE__ */ e((e) => {
|
|
3866
|
-
let n =
|
|
3867
|
-
return d && i && (n +=
|
|
3653
|
+
let n = un(t, e, u);
|
|
3654
|
+
return d && i && (n += un(e, i, d)), n;
|
|
3868
3655
|
}, "crossingScore"), p = a ? /* @__PURE__ */ new Map() : null;
|
|
3869
3656
|
if (a && p) for (let e of n) p.set(e, a(e));
|
|
3870
3657
|
let m = !0, h = f(o);
|
|
@@ -3880,18 +3667,18 @@ function Mn(t, n, r, i, a) {
|
|
|
3880
3667
|
}
|
|
3881
3668
|
return o;
|
|
3882
3669
|
}
|
|
3883
|
-
e(
|
|
3884
|
-
function
|
|
3885
|
-
let r = e.layers.map((e) => [...e]), i = t.edges, a =
|
|
3670
|
+
e(pn, "transposeImprove");
|
|
3671
|
+
function mn(e, t, n) {
|
|
3672
|
+
let r = e.layers.map((e) => [...e]), i = t.edges, a = jt(t), o = Nt(t, n?.laneOrder);
|
|
3886
3673
|
for (let e = 0; e < 3; e++) {
|
|
3887
|
-
for (let e = 1; e < r.length; e++) r[e] =
|
|
3888
|
-
for (let e = r.length - 2; e >= 0; e--) r[e] =
|
|
3674
|
+
for (let e = 1; e < r.length; e++) r[e] = fn(r[e - 1], r[e], i, "down", a, o), r[e] = pn(r[e - 1], r[e], i, r[e + 1], a);
|
|
3675
|
+
for (let e = r.length - 2; e >= 0; e--) r[e] = fn(r[e + 1], r[e], i, "up", a, o), r[e] = pn(r[e + 1], r[e], i, r[e - 1], a);
|
|
3889
3676
|
}
|
|
3890
3677
|
return { layers: r };
|
|
3891
3678
|
}
|
|
3892
|
-
e(
|
|
3893
|
-
function
|
|
3894
|
-
let i = r?.layerGap ??
|
|
3679
|
+
e(mn, "orderLayers");
|
|
3680
|
+
function hn(t, n, r) {
|
|
3681
|
+
let i = r?.layerGap ?? It.DEFAULT_LAYER_GAP, a = r?.nodeGap ?? It.DEFAULT_NODE_GAP, o = r?.laneGap ?? a * 2, s = r?.direction ?? "TB", c = s === "LR" || s === "RL", l = t.layers, u = /* @__PURE__ */ Object.create(null), d = /* @__PURE__ */ Object.create(null), f = /* @__PURE__ */ e((e) => n.nodeById.get(e), "getNode"), p = /* @__PURE__ */ e((e) => f(e)?.width ?? 0, "getWidth"), m = /* @__PURE__ */ e((e) => f(e)?.height ?? 0, "getHeight"), h = jt(n), g = Nt(n, r?.laneOrder), _ = l.map((e) => e.reduce((e, t) => Math.max(e, m(t)), 0)), v = [];
|
|
3895
3682
|
if (c) for (let e = 0; e + 1 < l.length; e++) {
|
|
3896
3683
|
let t = l[e].reduce((e, t) => Math.max(e, p(t)), 0), n = l[e + 1].reduce((e, t) => Math.max(e, p(t)), 0), r = _[e], a = _[e + 1], o = r / 2 + a / 2, s = (t + n) / 2, c = Math.max(0, s - o - i);
|
|
3897
3684
|
v.push(c);
|
|
@@ -3967,15 +3754,15 @@ function Pn(t, n, r) {
|
|
|
3967
3754
|
y: d
|
|
3968
3755
|
};
|
|
3969
3756
|
}
|
|
3970
|
-
e(
|
|
3971
|
-
var
|
|
3972
|
-
function
|
|
3757
|
+
e(hn, "assignCoordinates");
|
|
3758
|
+
var gn = 8;
|
|
3759
|
+
function _n(e) {
|
|
3973
3760
|
let t = 2166136261;
|
|
3974
3761
|
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
3975
3762
|
return t >>> 0;
|
|
3976
3763
|
}
|
|
3977
|
-
e(
|
|
3978
|
-
function
|
|
3764
|
+
e(_n, "hashString");
|
|
3765
|
+
function vn(e) {
|
|
3979
3766
|
let t = e >>> 0;
|
|
3980
3767
|
return () => {
|
|
3981
3768
|
t += 1831565813;
|
|
@@ -3983,23 +3770,23 @@ function Ln(e) {
|
|
|
3983
3770
|
return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
3984
3771
|
};
|
|
3985
3772
|
}
|
|
3986
|
-
e(
|
|
3987
|
-
function
|
|
3988
|
-
let n = [...e], r =
|
|
3773
|
+
e(vn, "mulberry32");
|
|
3774
|
+
function yn(e, t) {
|
|
3775
|
+
let n = [...e], r = vn(t);
|
|
3989
3776
|
for (let e = n.length - 1; e > 0; e--) {
|
|
3990
3777
|
let t = Math.floor(r() * (e + 1));
|
|
3991
3778
|
[n[e], n[t]] = [n[t], n[e]];
|
|
3992
3779
|
}
|
|
3993
3780
|
return n;
|
|
3994
3781
|
}
|
|
3995
|
-
e(
|
|
3996
|
-
function
|
|
3782
|
+
e(yn, "deterministicShuffle");
|
|
3783
|
+
function bn(e, t) {
|
|
3997
3784
|
let n = 0;
|
|
3998
3785
|
for (let [r, i] of e.entries()) n += Math.abs(r - (t.get(i) ?? r));
|
|
3999
3786
|
return n;
|
|
4000
3787
|
}
|
|
4001
|
-
e(
|
|
4002
|
-
function
|
|
3788
|
+
e(bn, "sourceDistance");
|
|
3789
|
+
function xn(e, t) {
|
|
4003
3790
|
let n = /* @__PURE__ */ new Map();
|
|
4004
3791
|
for (let [t, r] of e.entries()) n.set(r, t);
|
|
4005
3792
|
let r = 0;
|
|
@@ -4009,11 +3796,11 @@ function Bn(e, t) {
|
|
|
4009
3796
|
}
|
|
4010
3797
|
return r;
|
|
4011
3798
|
}
|
|
4012
|
-
e(
|
|
4013
|
-
function
|
|
4014
|
-
let t =
|
|
3799
|
+
e(xn, "laneArrangementCost");
|
|
3800
|
+
function Sn(e) {
|
|
3801
|
+
let t = Mt(e);
|
|
4015
3802
|
if (t.length < 2) return [];
|
|
4016
|
-
let n = new Map(t.map((e, t) => [e, t])), r =
|
|
3803
|
+
let n = new Map(t.map((e, t) => [e, t])), r = jt(e), i = /* @__PURE__ */ new Map();
|
|
4017
3804
|
for (let t of e.layout.edges ?? []) {
|
|
4018
3805
|
if (t.isLayoutOnly) continue;
|
|
4019
3806
|
let a = typeof t.start == "string" ? t.start : void 0, o = typeof t.end == "string" ? t.end : void 0;
|
|
@@ -4031,56 +3818,56 @@ function Vn(e) {
|
|
|
4031
3818
|
}
|
|
4032
3819
|
return [...i.values()];
|
|
4033
3820
|
}
|
|
4034
|
-
e(
|
|
4035
|
-
function
|
|
4036
|
-
let r = [...e], i =
|
|
3821
|
+
e(Sn, "buildWeightedLaneEdges");
|
|
3822
|
+
function Cn(e, t, n) {
|
|
3823
|
+
let r = [...e], i = xn(r, t), a = !0, o = 0, s = Math.max(1, r.length);
|
|
4037
3824
|
for (; a && o < s;) {
|
|
4038
3825
|
a = !1, o++;
|
|
4039
3826
|
for (let e = 0; e + 1 < r.length; e++) {
|
|
4040
3827
|
[r[e], r[e + 1]] = [r[e + 1], r[e]];
|
|
4041
|
-
let n =
|
|
3828
|
+
let n = xn(r, t);
|
|
4042
3829
|
n < i ? (i = n, a = !0) : [r[e], r[e + 1]] = [r[e + 1], r[e]];
|
|
4043
3830
|
}
|
|
4044
3831
|
}
|
|
4045
3832
|
return {
|
|
4046
3833
|
order: r,
|
|
4047
3834
|
cost: i,
|
|
4048
|
-
sourceDistance:
|
|
3835
|
+
sourceDistance: bn(r, n)
|
|
4049
3836
|
};
|
|
4050
3837
|
}
|
|
4051
|
-
e(
|
|
4052
|
-
function
|
|
3838
|
+
e(Cn, "greedySwitch");
|
|
3839
|
+
function wn(e, t) {
|
|
4053
3840
|
return e.cost === t.cost ? e.sourceDistance < t.sourceDistance : e.cost < t.cost;
|
|
4054
3841
|
}
|
|
4055
|
-
e(
|
|
4056
|
-
function
|
|
3842
|
+
e(wn, "isBetterCandidate");
|
|
3843
|
+
function Tn(e, t, n) {
|
|
4057
3844
|
let r = [...t].sort((e, t) => e.a === t.a ? e.b.localeCompare(t.b) : e.a.localeCompare(t.a)).map(({ a: e, b: t, weight: n }) => `${e}:${t}:${n}`).join("|");
|
|
4058
|
-
return
|
|
3845
|
+
return _n(`${e.join("|")}#${r}#${n}`);
|
|
4059
3846
|
}
|
|
4060
|
-
e(
|
|
4061
|
-
function
|
|
4062
|
-
let n =
|
|
3847
|
+
e(Tn, "seedForRestart");
|
|
3848
|
+
function En(e, t = {}) {
|
|
3849
|
+
let n = Mt(e);
|
|
4063
3850
|
if (n.length < 2) return n;
|
|
4064
|
-
let r =
|
|
3851
|
+
let r = Sn(e);
|
|
4065
3852
|
if (r.length === 0) return n;
|
|
4066
|
-
let i = new Map(n.map((e, t) => [e, t])), a =
|
|
3853
|
+
let i = new Map(n.map((e, t) => [e, t])), a = Cn(n, r, i), o = Math.max(0, t.restarts ?? gn);
|
|
4067
3854
|
for (let e = 0; e < o; e++) {
|
|
4068
|
-
let t =
|
|
4069
|
-
|
|
3855
|
+
let t = Cn(yn(n, Tn(n, r, e)), r, i);
|
|
3856
|
+
wn(t, a) && (a = t);
|
|
4070
3857
|
}
|
|
4071
3858
|
return a.order;
|
|
4072
3859
|
}
|
|
4073
|
-
e(
|
|
4074
|
-
function
|
|
4075
|
-
let n = t?.ignoreCrossLaneEdges ?? !0, r = t?.optimizeRanksByCrossings ?? !0, i =
|
|
4076
|
-
compactSingleInput: t?.compactSingleInput ??
|
|
3860
|
+
e(En, "optimizeTopLaneOrder");
|
|
3861
|
+
function Dn(e, t) {
|
|
3862
|
+
let n = t?.ignoreCrossLaneEdges ?? !0, r = t?.optimizeRanksByCrossings ?? !0, i = vt(e), a = t?.automaticLaneOrdering ? En(i, { restarts: gn }) : void 0, o = kt(i), s = o.acyclic, { layering: c, graphWithDummies: l } = an(n ? rn(s, {
|
|
3863
|
+
compactSingleInput: t?.compactSingleInput ?? Ft.DEFAULT_COMPACT_SINGLE_INPUT,
|
|
4077
3864
|
ignoreCrossLaneEdges: !0,
|
|
4078
3865
|
direction: t?.direction
|
|
4079
|
-
}) :
|
|
4080
|
-
compactSingleInput: t?.compactSingleInput ??
|
|
3866
|
+
}) : tn(s, {
|
|
3867
|
+
compactSingleInput: t?.compactSingleInput ?? Ft.DEFAULT_COMPACT_SINGLE_INPUT,
|
|
4081
3868
|
ignoreCrossLaneEdges: !1,
|
|
4082
3869
|
optimizeRanksByCrossings: r
|
|
4083
|
-
}), s), u =
|
|
3870
|
+
}), s), u = mn(c, l, { laneOrder: a }), d = hn(u, l, {
|
|
4084
3871
|
layerGap: t?.layerGap,
|
|
4085
3872
|
nodeGap: t?.nodeGap,
|
|
4086
3873
|
direction: t?.direction,
|
|
@@ -4094,18 +3881,18 @@ function Kn(e, t) {
|
|
|
4094
3881
|
coordinates: d
|
|
4095
3882
|
};
|
|
4096
3883
|
}
|
|
4097
|
-
e(
|
|
4098
|
-
var $ =
|
|
4099
|
-
function
|
|
3884
|
+
e(Dn, "sugiyamaLayout");
|
|
3885
|
+
var $ = Pt.EPSILON, On = 8, kn = 15, An = 15, jn = 25, Mn = 20, Nn = 10;
|
|
3886
|
+
function Pn(e, t, n) {
|
|
4100
3887
|
let r = e.x ?? 0, i = e.y ?? 0, a = t.x - r, o = t.y - i, s = Math.abs(a), c = Math.abs(o);
|
|
4101
3888
|
return s < $ && c < $ ? n : c > $ && c * 3 >= s ? o > 0 ? "bottom" : "top" : s > $ ? a > 0 ? "right" : "left" : n;
|
|
4102
3889
|
}
|
|
4103
|
-
e(
|
|
4104
|
-
function
|
|
3890
|
+
e(Pn, "chooseOrthogonalSide");
|
|
3891
|
+
function Fn(e, t) {
|
|
4105
3892
|
return Math.abs(e.to - t.from) < $ || Math.abs(e.to - t.to) < $ ? e.to : e.from;
|
|
4106
3893
|
}
|
|
4107
|
-
e(
|
|
4108
|
-
function
|
|
3894
|
+
e(Fn, "sharedLineEndpointCoord");
|
|
3895
|
+
function In(e, t) {
|
|
4109
3896
|
return e.orient === "vertical" ? {
|
|
4110
3897
|
x: e.coord,
|
|
4111
3898
|
y: t
|
|
@@ -4114,8 +3901,8 @@ function tr(e, t) {
|
|
|
4114
3901
|
y: e.coord
|
|
4115
3902
|
};
|
|
4116
3903
|
}
|
|
4117
|
-
e(
|
|
4118
|
-
function
|
|
3904
|
+
e(In, "pointOnLine");
|
|
3905
|
+
function Ln(t, n) {
|
|
4119
3906
|
let r = t.nodes ?? [], i = t.edges ?? [], a = [];
|
|
4120
3907
|
for (let e of i) e.isLayoutOnly || a.push({
|
|
4121
3908
|
...e,
|
|
@@ -4131,7 +3918,7 @@ function nr(t, n) {
|
|
|
4131
3918
|
i(t);
|
|
4132
3919
|
}
|
|
4133
3920
|
let d = r.filter((e) => !e.isGroup && !e.isEdgeLabel).map((e) => {
|
|
4134
|
-
let t = e.width ?? 10, n = e.height ?? 10, r = e.x ?? 0, i = e.y ?? 0, a =
|
|
3921
|
+
let t = e.width ?? 10, n = e.height ?? 10, r = e.x ?? 0, i = e.y ?? 0, a = On;
|
|
4135
3922
|
return {
|
|
4136
3923
|
nodeId: e.id,
|
|
4137
3924
|
minX: r - t / 2 - a,
|
|
@@ -4170,7 +3957,7 @@ function nr(t, n) {
|
|
|
4170
3957
|
y: a
|
|
4171
3958
|
};
|
|
4172
3959
|
}
|
|
4173
|
-
}, "portForSide"), m = /* @__PURE__ */ e((e, t, n) => p(e,
|
|
3960
|
+
}, "portForSide"), m = /* @__PURE__ */ e((e, t, n) => p(e, Pn(e, t, n ? "bottom" : "top")), "getOrthogonalPort"), h = [], g = [], _ = /* @__PURE__ */ new Set(), v = 1e3, y = /* @__PURE__ */ e((e, t, n) => {
|
|
4174
3961
|
if (h.length === 0) return 0;
|
|
4175
3962
|
let r = Math.abs(t.y - n.y) < $, i = Math.abs(t.x - n.x) < $;
|
|
4176
3963
|
if (!r && !i) return 0;
|
|
@@ -4208,7 +3995,7 @@ function nr(t, n) {
|
|
|
4208
3995
|
return !!d.find((c) => n && c.nodeId === n || r && c.nodeId === r ? !1 : Math.abs(e.x - t.x) > $ ? c.minY < e.y && c.maxY > e.y && c.maxX > i && c.minX < a : c.minX < e.x && c.maxX > e.x && c.maxY > o && c.minY < s);
|
|
4209
3996
|
}, "isSegmentBlocked"), S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
4210
3997
|
for (let e of a) !e.start || !e.end || e.start === e.end || (C.set(e.start, (C.get(e.start) ?? 0) + 1), C.set(e.end, (C.get(e.end) ?? 0) + 1));
|
|
4211
|
-
let w = /* @__PURE__ */ e((e, t) =>
|
|
3998
|
+
let w = /* @__PURE__ */ e((e, t) => Pn(e, t, "bottom"), "determineSide"), T = /* @__PURE__ */ new Map();
|
|
4212
3999
|
for (let [e, t] of a.entries()) {
|
|
4213
4000
|
if (!t.start || !t.end || t.start === t.end || t.points && t.points.length > 0) continue;
|
|
4214
4001
|
let n = o.get(t.start), r = o.get(t.end);
|
|
@@ -4252,11 +4039,11 @@ function nr(t, n) {
|
|
|
4252
4039
|
let j = /* @__PURE__ */ e((e) => {
|
|
4253
4040
|
let t = e?.shape;
|
|
4254
4041
|
return t === "question" || t === "diamond";
|
|
4255
|
-
}, "isDiamondNode"),
|
|
4256
|
-
for (let e of T.values())
|
|
4042
|
+
}, "isDiamondNode"), M = /* @__PURE__ */ new Map();
|
|
4043
|
+
for (let e of T.values()) M.has(e.dstId) || M.set(e.dstId, /* @__PURE__ */ new Set()), M.get(e.dstId).add(e.dstSide);
|
|
4257
4044
|
for (let e of T.values()) {
|
|
4258
4045
|
if (!j(o.get(e.srcId))) continue;
|
|
4259
|
-
let t =
|
|
4046
|
+
let t = M.get(e.srcId);
|
|
4260
4047
|
if (!t?.has(e.srcSide)) continue;
|
|
4261
4048
|
let n = D(e);
|
|
4262
4049
|
if (t.has(n) || (k.get(A(e.srcId, n)) ?? 0) > 0) continue;
|
|
@@ -4275,7 +4062,7 @@ function nr(t, n) {
|
|
|
4275
4062
|
oppositeCoord: f
|
|
4276
4063
|
});
|
|
4277
4064
|
}
|
|
4278
|
-
let
|
|
4065
|
+
let N = /* @__PURE__ */ new Map();
|
|
4279
4066
|
for (let [e, t] of S) {
|
|
4280
4067
|
if (t.length < 2) continue;
|
|
4281
4068
|
t.sort((e, t) => e.oppositeCoord - t.oppositeCoord);
|
|
@@ -4284,24 +4071,24 @@ function nr(t, n) {
|
|
|
4284
4071
|
let c = i === "left" || i === "right" ? s.height ?? 10 : s.width ?? 10, l = s.shape, u = l === "question" || l === "diamond" ? c * .3 : c, d = Math.min(20, Math.max(8, u / (t.length + 1))), f = -(d * (t.length - 1)) / 2;
|
|
4285
4072
|
for (let [e, n] of t.entries()) {
|
|
4286
4073
|
let t = f + e * d, r = `${n.edgeIdx}:${a}`;
|
|
4287
|
-
|
|
4074
|
+
N.set(r, t);
|
|
4288
4075
|
}
|
|
4289
4076
|
}
|
|
4290
|
-
let
|
|
4077
|
+
let P = /* @__PURE__ */ e((e) => !!a[e]?.labelNodeId, "edgeHasLabelNode"), F = /* @__PURE__ */ e((e, t) => e ? (S.get(`${e}:${t}:src`) ?? []).some(({ edgeIdx: e }) => P(e)) || (S.get(`${e}:${t}:dst`) ?? []).some(({ edgeIdx: e }) => P(e)) : !1, "faceHasLabelNode"), I = /* @__PURE__ */ e((e, t, n) => t === "top" || t === "bottom" ? {
|
|
4291
4078
|
x: e.x + n,
|
|
4292
4079
|
y: e.y
|
|
4293
4080
|
} : {
|
|
4294
4081
|
x: e.x,
|
|
4295
4082
|
y: e.y + n
|
|
4296
|
-
}, "applyPortOffset"),
|
|
4083
|
+
}, "applyPortOffset"), ee = /* @__PURE__ */ e((e, t, n) => {
|
|
4297
4084
|
let r = T.get(e), i = {
|
|
4298
4085
|
x: n.x ?? 0,
|
|
4299
4086
|
y: n.y ?? 0
|
|
4300
4087
|
}, a = {
|
|
4301
4088
|
x: t.x ?? 0,
|
|
4302
4089
|
y: t.y ?? 0
|
|
4303
|
-
}, o = r?.srcSide ?? w(t, i), s = r?.dstSide ?? w(n, a), c = r ? p(t, r.srcSide) : m(t, i, !0), l = r ? p(n, r.dstSide) : m(n, a, !1), u =
|
|
4304
|
-
return u !== void 0 && (c =
|
|
4090
|
+
}, o = r?.srcSide ?? w(t, i), s = r?.dstSide ?? w(n, a), c = r ? p(t, r.srcSide) : m(t, i, !0), l = r ? p(n, r.dstSide) : m(n, a, !1), u = N.get(`${e}:src`), d = N.get(`${e}:dst`);
|
|
4091
|
+
return u !== void 0 && (c = I(c, o, u)), d !== void 0 && (l = I(l, s, d)), {
|
|
4305
4092
|
pSrcPort: c,
|
|
4306
4093
|
pDstPort: l,
|
|
4307
4094
|
srcSide: o,
|
|
@@ -4313,8 +4100,8 @@ function nr(t, n) {
|
|
|
4313
4100
|
if (g[t] = [], !n.start || !n.end || n.points && n.points.length > 0 || n.start === n.end) continue;
|
|
4314
4101
|
let r = o.get(n.start), i = o.get(n.end);
|
|
4315
4102
|
if (!r || !i) continue;
|
|
4316
|
-
let { pSrcPort: s, pDstPort: u, srcSide: p, dstSide: m } =
|
|
4317
|
-
w ? v.y = s.y > (r.y ?? 0) ? s.y +
|
|
4103
|
+
let { pSrcPort: s, pDstPort: u, srcSide: p, dstSide: m } = ee(t, r, i), v = { ...s }, b = { ...u }, w = p === "top" || p === "bottom", T = m === "top" || m === "bottom";
|
|
4104
|
+
w ? v.y = s.y > (r.y ?? 0) ? s.y + Mn : s.y - Mn : v.x = s.x > (r.x ?? 0) ? s.x + Mn : s.x - Mn, T ? b.y = u.y > (i.y ?? 0) ? u.y + Mn : u.y - Mn : b.x = u.x > (i.x ?? 0) ? u.x + Mn : u.x - Mn;
|
|
4318
4105
|
let E = /* @__PURE__ */ e((e, t) => {
|
|
4319
4106
|
for (let n of d) if (!t.includes(n.nodeId) && e.x > n.minX && e.x < n.maxX && e.y > n.minY && e.y < n.maxY) return {
|
|
4320
4107
|
inside: !0,
|
|
@@ -4325,15 +4112,15 @@ function nr(t, n) {
|
|
|
4325
4112
|
if (i) {
|
|
4326
4113
|
let i = e.y > (t.y ?? 0);
|
|
4327
4114
|
return {
|
|
4328
|
-
x: (n.x ?? 0) >= e.x ? r.maxX +
|
|
4329
|
-
y: i ? r.maxY +
|
|
4115
|
+
x: (n.x ?? 0) >= e.x ? r.maxX + kn : r.minX - kn,
|
|
4116
|
+
y: i ? r.maxY + An : r.minY - An,
|
|
4330
4117
|
leavesPositiveSide: i
|
|
4331
4118
|
};
|
|
4332
4119
|
}
|
|
4333
4120
|
let a = e.x > (t.x ?? 0), o = (n.y ?? 0) >= e.y;
|
|
4334
4121
|
return {
|
|
4335
|
-
x: a ? r.maxX +
|
|
4336
|
-
y: o ? r.maxY +
|
|
4122
|
+
x: a ? r.maxX + kn : r.minX - kn,
|
|
4123
|
+
y: o ? r.maxY + An : r.minY - An,
|
|
4337
4124
|
leavesPositiveSide: a
|
|
4338
4125
|
};
|
|
4339
4126
|
}, "obstacleDetour"), O = [], k = [n.start, n.end], A = E(v, k);
|
|
@@ -4342,7 +4129,7 @@ function nr(t, n) {
|
|
|
4342
4129
|
if (w) {
|
|
4343
4130
|
let t = D(s, r, i, e, !0);
|
|
4344
4131
|
v.x = t.x, v.y = t.y;
|
|
4345
|
-
let n = t.leavesPositiveSide ? Math.min(e.minY - 2, s.y +
|
|
4132
|
+
let n = t.leavesPositiveSide ? Math.min(e.minY - 2, s.y + Mn) : Math.max(e.maxY + 2, s.y - Mn);
|
|
4346
4133
|
O = [
|
|
4347
4134
|
{
|
|
4348
4135
|
x: s.x,
|
|
@@ -4358,7 +4145,7 @@ function nr(t, n) {
|
|
|
4358
4145
|
}
|
|
4359
4146
|
];
|
|
4360
4147
|
} else {
|
|
4361
|
-
let t = D(s, r, i, e, !1), n = t.leavesPositiveSide ? Math.min(e.minX - 2, s.x +
|
|
4148
|
+
let t = D(s, r, i, e, !1), n = t.leavesPositiveSide ? Math.min(e.minX - 2, s.x + Mn) : Math.max(e.maxX + 2, s.x - Mn);
|
|
4362
4149
|
v.x = t.x, v.y = t.y, O = [
|
|
4363
4150
|
{
|
|
4364
4151
|
x: n,
|
|
@@ -4375,9 +4162,9 @@ function nr(t, n) {
|
|
|
4375
4162
|
];
|
|
4376
4163
|
}
|
|
4377
4164
|
}
|
|
4378
|
-
let j = [],
|
|
4379
|
-
if (
|
|
4380
|
-
let e =
|
|
4165
|
+
let j = [], M = E(b, k);
|
|
4166
|
+
if (M.inside && M.obstacle) {
|
|
4167
|
+
let e = M.obstacle;
|
|
4381
4168
|
if (T) {
|
|
4382
4169
|
let t = D(u, i, r, e, !0);
|
|
4383
4170
|
b.x = t.x, b.y = t.y, j = [{
|
|
@@ -4399,7 +4186,7 @@ function nr(t, n) {
|
|
|
4399
4186
|
}
|
|
4400
4187
|
}
|
|
4401
4188
|
if (O.length === 0 && j.length === 0) {
|
|
4402
|
-
let e =
|
|
4189
|
+
let e = kn, r = Math.abs(v.x - b.x) < e, i = Math.abs(v.y - b.y) < e, a = N.get(`${t}:src`) !== void 0 || N.get(`${t}:dst`) !== void 0, o = (S.get(`${n.start ?? ""}:${p}:src`)?.length ?? 0) + (S.get(`${n.start ?? ""}:${p}:dst`)?.length ?? 0), c = (S.get(`${n.end ?? ""}:${m}:src`)?.length ?? 0) + (S.get(`${n.end ?? ""}:${m}:dst`)?.length ?? 0), l = o > 1 || c > 1, d = C.get(n.start ?? "") ?? 0, f = C.get(n.end ?? "") ?? 0, g = o > 1 && F(n.start, p) || c > 1 && F(n.end, m);
|
|
4403
4190
|
if ((r || i) && !a && (!l || l && !g && (o <= 1 || d <= 2) && (c <= 1 || f <= 2)) && !x(s, u, n.start, n.end)) {
|
|
4404
4191
|
n.points = [
|
|
4405
4192
|
{ ...s },
|
|
@@ -4428,52 +4215,52 @@ function nr(t, n) {
|
|
|
4428
4215
|
}
|
|
4429
4216
|
}
|
|
4430
4217
|
v.x = f("vertical", v.x, v.y, v.y).coord, b.x = f("vertical", b.x, b.y, b.y).coord;
|
|
4431
|
-
let
|
|
4218
|
+
let P = Math.min(v.x, b.x) - 50, I = Math.max(v.x, b.x) + 50, L = Math.min(v.y, b.y) - 50, R = Math.max(v.y, b.y) + 50;
|
|
4432
4219
|
for (let e of d) {
|
|
4433
4220
|
let t = Math.min(v.x, b.x), n = Math.max(v.x, b.x), r = Math.min(v.y, b.y), i = Math.max(v.y, b.y);
|
|
4434
|
-
e.minX < n && e.maxX > t && e.minY < i && e.maxY > r && (
|
|
4221
|
+
e.minX < n && e.maxX > t && e.minY < i && e.maxY > r && (P = Math.min(P, e.minX - jn), I = Math.max(I, e.maxX + jn), L = Math.min(L, e.minY - jn), R = Math.max(R, e.maxY + jn));
|
|
4435
4222
|
}
|
|
4436
4223
|
for (let e of d) {
|
|
4437
|
-
if (e.maxX <
|
|
4438
|
-
let t =
|
|
4439
|
-
f("horizontal", e.minY - t,
|
|
4440
|
-
let n =
|
|
4441
|
-
f("vertical", e.minX - n,
|
|
4442
|
-
}
|
|
4443
|
-
f("horizontal", v.y,
|
|
4444
|
-
let
|
|
4445
|
-
|
|
4224
|
+
if (e.maxX < P || e.minX > I || e.maxY < L || e.minY > R) continue;
|
|
4225
|
+
let t = kn;
|
|
4226
|
+
f("horizontal", e.minY - t, P, I), f("horizontal", e.maxY + t, P, I);
|
|
4227
|
+
let n = An;
|
|
4228
|
+
f("vertical", e.minX - n, L, R), f("vertical", e.maxX + n, L, R);
|
|
4229
|
+
}
|
|
4230
|
+
f("horizontal", v.y, P, I), f("horizontal", b.y, P, I);
|
|
4231
|
+
let z = c.filter((e) => e.orientation === "horizontal" && e.coord >= L && e.coord <= R), te = c.filter((e) => e.orientation === "vertical" && e.coord >= P && e.coord <= I), ne = /* @__PURE__ */ e((e, t) => `${e.toFixed(1)},${t.toFixed(1)}`, "getKey"), B = ne(v.x, v.y), re = ne(b.x, b.y), ie = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Set(), H = [];
|
|
4232
|
+
ie.set(B, 0), V.set(B, "n"), H.push({
|
|
4446
4233
|
key: B,
|
|
4447
4234
|
f: Math.hypot(b.x - v.x, b.y - v.y),
|
|
4448
4235
|
pt: v
|
|
4449
|
-
}),
|
|
4450
|
-
let
|
|
4236
|
+
}), oe.add(B);
|
|
4237
|
+
let U = [], W = /* @__PURE__ */ e((e, t) => x(e, t, n.start, n.end), "checkSegmentBlocked"), G = {
|
|
4451
4238
|
x: b.x,
|
|
4452
4239
|
y: v.y
|
|
4453
|
-
},
|
|
4240
|
+
}, K = W(v, G), se = W(G, b), ce = K || se, le = {
|
|
4454
4241
|
x: v.x,
|
|
4455
4242
|
y: b.y
|
|
4456
|
-
}, ue =
|
|
4457
|
-
if (ce ? ue || de || (
|
|
4243
|
+
}, ue = W(v, le), de = W(le, b);
|
|
4244
|
+
if (ce ? ue || de || (U = Math.abs(v.x - b.x) < $ ? [v, b] : [
|
|
4458
4245
|
v,
|
|
4459
4246
|
le,
|
|
4460
4247
|
b
|
|
4461
|
-
]) :
|
|
4248
|
+
]) : U = Math.abs(v.y - b.y) < $ || Math.abs(v.x - b.x) < $ ? [v, b] : [
|
|
4462
4249
|
v,
|
|
4463
|
-
|
|
4250
|
+
G,
|
|
4464
4251
|
b
|
|
4465
|
-
],
|
|
4466
|
-
|
|
4467
|
-
let e =
|
|
4468
|
-
if (
|
|
4252
|
+
], U.length === 0) for (; H.length > 0;) {
|
|
4253
|
+
H.sort((e, t) => e.f - t.f);
|
|
4254
|
+
let e = H.shift();
|
|
4255
|
+
if (oe.delete(e.key), e.key === re) {
|
|
4469
4256
|
let e = re, t = b;
|
|
4470
|
-
for (
|
|
4471
|
-
let n =
|
|
4472
|
-
|
|
4257
|
+
for (U = [t]; ae.has(e);) {
|
|
4258
|
+
let n = ae.get(e);
|
|
4259
|
+
U.unshift(n), t = n, e = ne(n.x, n.y);
|
|
4473
4260
|
}
|
|
4474
4261
|
break;
|
|
4475
4262
|
}
|
|
4476
|
-
let r = e.pt.x, i = e.pt.y, a =
|
|
4263
|
+
let r = e.pt.x, i = e.pt.y, a = te.sort((e, t) => e.coord - t.coord), o = a.findIndex((e) => Math.abs(e.coord - r) < 1), s = z.sort((e, t) => e.coord - t.coord), c = s.findIndex((e) => Math.abs(e.coord - i) < 1), l = [];
|
|
4477
4264
|
o > 0 && l.push({
|
|
4478
4265
|
x: a[o - 1].coord,
|
|
4479
4266
|
y: i
|
|
@@ -4490,37 +4277,37 @@ function nr(t, n) {
|
|
|
4490
4277
|
for (let a of l) {
|
|
4491
4278
|
let o = Math.min(r, a.x), s = Math.max(r, a.x), c = Math.min(i, a.y), l = Math.max(i, a.y);
|
|
4492
4279
|
if (d.some((e) => e.nodeId === n.start || e.nodeId === n.end ? !1 : o === s ? e.minX < r && e.maxX > r && e.maxY > c && e.minY < l : e.minY < i && e.maxY > i && e.maxX > o && e.minX < s)) continue;
|
|
4493
|
-
let u =
|
|
4280
|
+
let u = ne(a.x, a.y), f = Math.abs(a.x - r) + Math.abs(a.y - i), p = y(t, e.pt, a), m = 0, h = b.x - v.x, g = b.y - v.y, _ = a.x - r, x = a.y - i;
|
|
4494
4281
|
(g > 10 && x < -5 || g < -10 && x > 5) && (m = Math.abs(x) * 100), (h > 10 && _ < -5 || h < -10 && _ > 5) && (m += Math.abs(_) * 50);
|
|
4495
|
-
let S = 0, C =
|
|
4282
|
+
let S = 0, C = V.get(e.key) ?? "n", w = Math.abs(_) > $ ? "h" : "v";
|
|
4496
4283
|
C !== "n" && C !== w && (S = 50);
|
|
4497
|
-
let T = f + p + m + S, E = (
|
|
4498
|
-
if (E < (
|
|
4499
|
-
if (
|
|
4284
|
+
let T = f + p + m + S, E = (ie.get(e.key) ?? Infinity) + T, D = Math.abs(b.x - a.x) + Math.abs(b.y - a.y);
|
|
4285
|
+
if (E < (ie.get(u) ?? Infinity)) {
|
|
4286
|
+
if (ae.set(u, e.pt), ie.set(u, E), V.set(u, w), !oe.has(u)) H.push({
|
|
4500
4287
|
key: u,
|
|
4501
4288
|
f: E + D,
|
|
4502
4289
|
pt: a
|
|
4503
|
-
}),
|
|
4290
|
+
}), oe.add(u);
|
|
4504
4291
|
else {
|
|
4505
|
-
let e =
|
|
4506
|
-
e !== -1 && (
|
|
4292
|
+
let e = H.findIndex((e) => e.key === u);
|
|
4293
|
+
e !== -1 && (H[e].f = E + D);
|
|
4507
4294
|
}
|
|
4508
4295
|
}
|
|
4509
4296
|
}
|
|
4510
4297
|
}
|
|
4511
|
-
if (
|
|
4298
|
+
if (U.length === 0 && (U = [
|
|
4512
4299
|
v,
|
|
4513
4300
|
{
|
|
4514
4301
|
x: v.x,
|
|
4515
4302
|
y: b.y
|
|
4516
4303
|
},
|
|
4517
4304
|
b
|
|
4518
|
-
]),
|
|
4519
|
-
let t =
|
|
4520
|
-
for (let e of
|
|
4305
|
+
]), U.length > 4) {
|
|
4306
|
+
let t = U[0], n = U[U.length - 1], r = Math.min(t.x, n.x), i = Math.max(t.x, n.x), a = Math.min(t.y, n.y), o = Math.max(t.y, n.y);
|
|
4307
|
+
for (let e of U) r = Math.min(r, e.x), i = Math.max(i, e.x), a = Math.min(a, e.y), o = Math.max(o, e.y);
|
|
4521
4308
|
let s = i > Math.max(t.x, n.x), c = r < Math.min(t.x, n.x);
|
|
4522
4309
|
if (l) {
|
|
4523
|
-
let e =
|
|
4310
|
+
let e = An;
|
|
4524
4311
|
if (s) {
|
|
4525
4312
|
let r = Math.max(t.x, n.x), a = Math.min(t.y, n.y), o = Math.max(t.y, n.y), s = d.filter((e) => e.minX < r && e.maxX > r && e.minY < o && e.maxY > a);
|
|
4526
4313
|
if (s.length > 0) {
|
|
@@ -4556,7 +4343,7 @@ function nr(t, n) {
|
|
|
4556
4343
|
t.length > 0 && (a = t);
|
|
4557
4344
|
}
|
|
4558
4345
|
if (a.length === 0) return n.y;
|
|
4559
|
-
let o =
|
|
4346
|
+
let o = kn;
|
|
4560
4347
|
if (r) {
|
|
4561
4348
|
let e = Math.max(...a.map((e) => e.maxY)) + o;
|
|
4562
4349
|
if (e < n.y - $) return e;
|
|
@@ -4575,7 +4362,7 @@ function nr(t, n) {
|
|
|
4575
4362
|
}, o = {
|
|
4576
4363
|
x: n.x,
|
|
4577
4364
|
y: r
|
|
4578
|
-
}, s =
|
|
4365
|
+
}, s = W(t, i), c = W(i, a), l = W(a, o), d = r !== n.y && W(o, n);
|
|
4579
4366
|
return !s && !c && !l && !d ? Math.abs(r - n.y) < $ ? [
|
|
4580
4367
|
t,
|
|
4581
4368
|
i,
|
|
@@ -4589,12 +4376,12 @@ function nr(t, n) {
|
|
|
4589
4376
|
n
|
|
4590
4377
|
] : null;
|
|
4591
4378
|
}, "trySimplifyWithDetourX"), p = s && !c ? f(i) : c && !s ? f(r) : null;
|
|
4592
|
-
p && (
|
|
4379
|
+
p && (U = p);
|
|
4593
4380
|
}
|
|
4594
4381
|
let q = [
|
|
4595
4382
|
s,
|
|
4596
4383
|
...O,
|
|
4597
|
-
...
|
|
4384
|
+
...U,
|
|
4598
4385
|
...j.reverse(),
|
|
4599
4386
|
u
|
|
4600
4387
|
];
|
|
@@ -4608,32 +4395,32 @@ function nr(t, n) {
|
|
|
4608
4395
|
r !== 0 && r === i && Math.abs(t.y - n.y) > Math.abs(e.y - n.y) && q.splice(-2, 1);
|
|
4609
4396
|
}
|
|
4610
4397
|
}
|
|
4611
|
-
let
|
|
4398
|
+
let J = [q[0]];
|
|
4612
4399
|
for (let e = 1; e < q.length - 1; e++) {
|
|
4613
4400
|
if (e === 1) {
|
|
4614
|
-
|
|
4401
|
+
J.push(q[e]);
|
|
4615
4402
|
continue;
|
|
4616
4403
|
}
|
|
4617
|
-
let t =
|
|
4404
|
+
let t = J[J.length - 1], n = q[e], r = q[e + 1];
|
|
4618
4405
|
if (Math.abs(t.y - n.y) < $ && Math.abs(n.y - r.y) < $) {
|
|
4619
4406
|
if (n.x > t.x != r.x > n.x) {
|
|
4620
|
-
|
|
4407
|
+
J.push(n);
|
|
4621
4408
|
continue;
|
|
4622
4409
|
}
|
|
4623
4410
|
continue;
|
|
4624
4411
|
}
|
|
4625
4412
|
if (Math.abs(t.x - n.x) < $ && Math.abs(n.x - r.x) < $) {
|
|
4626
4413
|
if (n.y > t.y != r.y > n.y) {
|
|
4627
|
-
|
|
4414
|
+
J.push(n);
|
|
4628
4415
|
continue;
|
|
4629
4416
|
}
|
|
4630
4417
|
continue;
|
|
4631
4418
|
}
|
|
4632
|
-
|
|
4419
|
+
J.push(n);
|
|
4633
4420
|
}
|
|
4634
|
-
|
|
4635
|
-
for (let e = 0; e <
|
|
4636
|
-
let n =
|
|
4421
|
+
J.push(q[q.length - 1]);
|
|
4422
|
+
for (let e = 0; e < J.length - 1; e++) {
|
|
4423
|
+
let n = J[e], r = J[e + 1], i = Math.abs(n.x - r.x) < $ ? "vertical" : "horizontal", a = i === "vertical" ? n.x : n.y, o = i === "vertical" ? Math.min(n.y, r.y) : Math.min(n.x, r.x), s = i === "vertical" ? Math.max(n.y, r.y) : Math.max(n.x, r.x), c = f(i, a, o, s), l = {
|
|
4637
4424
|
edgeIndex: t,
|
|
4638
4425
|
segmentIndex: e,
|
|
4639
4426
|
orientation: i,
|
|
@@ -4654,8 +4441,8 @@ function nr(t, n) {
|
|
|
4654
4441
|
});
|
|
4655
4442
|
}
|
|
4656
4443
|
}
|
|
4657
|
-
let
|
|
4658
|
-
let i = !r.segments.some((n) => (n.edgeIndex !== t.edgeIndex || n.segmentIndex !== t.segmentIndex) &&
|
|
4444
|
+
let L = /* @__PURE__ */ e((e, t) => e.from < t.to && t.from < e.to, "segmentsOverlap"), R = /* @__PURE__ */ e((e, t, n, r) => {
|
|
4445
|
+
let i = !r.segments.some((n) => (n.edgeIndex !== t.edgeIndex || n.segmentIndex !== t.segmentIndex) && L(n, e)), a = !n.segments.some((n) => (n.edgeIndex !== e.edgeIndex || n.segmentIndex !== e.segmentIndex) && L(n, t));
|
|
4659
4446
|
return i && a ? (e.trackIndex = r.index, t.trackIndex = n.index, n.segments = [...n.segments.filter((t) => t.edgeIndex !== e.edgeIndex || t.segmentIndex !== e.segmentIndex), {
|
|
4660
4447
|
edgeIndex: t.edgeIndex,
|
|
4661
4448
|
segmentIndex: t.segmentIndex,
|
|
@@ -4667,14 +4454,14 @@ function nr(t, n) {
|
|
|
4667
4454
|
from: e.from,
|
|
4668
4455
|
to: e.to
|
|
4669
4456
|
}], !0) : !1;
|
|
4670
|
-
}, "trySwapSegmentsAcrossTracks"),
|
|
4457
|
+
}, "trySwapSegmentsAcrossTracks"), z = /* @__PURE__ */ e((e) => {
|
|
4671
4458
|
let t = e.tracks.length;
|
|
4672
4459
|
return e.tracks[t] = {
|
|
4673
4460
|
index: t,
|
|
4674
4461
|
coord: e.coord,
|
|
4675
4462
|
segments: []
|
|
4676
4463
|
}, t;
|
|
4677
|
-
}, "createNewTrack"),
|
|
4464
|
+
}, "createNewTrack"), te = /* @__PURE__ */ e((e, t) => {
|
|
4678
4465
|
let n = e.pipe.tracks[e.trackIndex];
|
|
4679
4466
|
n.segments = n.segments.filter((t) => t.edgeIndex !== e.edgeIndex || t.segmentIndex !== e.segmentIndex), e.trackIndex = t, e.pipe.tracks[t].segments.push({
|
|
4680
4467
|
edgeIndex: e.edgeIndex,
|
|
@@ -4682,11 +4469,11 @@ function nr(t, n) {
|
|
|
4682
4469
|
from: e.from,
|
|
4683
4470
|
to: e.to
|
|
4684
4471
|
});
|
|
4685
|
-
}, "moveSegmentToTrack"),
|
|
4472
|
+
}, "moveSegmentToTrack"), ne = /* @__PURE__ */ e((e, t) => {
|
|
4686
4473
|
let n = g[e.edgeIndex];
|
|
4687
4474
|
for (let r of n) {
|
|
4688
4475
|
let n = h[r];
|
|
4689
|
-
n.pipe === e.pipe &&
|
|
4476
|
+
n.pipe === e.pipe && te(n, t);
|
|
4690
4477
|
}
|
|
4691
4478
|
}, "moveSegmentChainToTrack"), B = /* @__PURE__ */ e((e) => {
|
|
4692
4479
|
let t = g[e.edgeIndex], n = t.indexOf(h.indexOf(e)), r = [];
|
|
@@ -4695,26 +4482,26 @@ function nr(t, n) {
|
|
|
4695
4482
|
if (e.orientation === t.orientation) return !1;
|
|
4696
4483
|
let n = e.orientation === "horizontal" ? e : t, r = e.orientation === "horizontal" ? t : e;
|
|
4697
4484
|
return r.pipe.coord > n.from && r.pipe.coord < n.to && n.pipe.coord > r.from && n.pipe.coord < r.to;
|
|
4698
|
-
}, "haveAnyCrossing"),
|
|
4699
|
-
for (let n of e.tracks) if (!n.segments.some((e) => (e.edgeIndex !== t.edgeIndex || e.segmentIndex !== t.segmentIndex) &&
|
|
4485
|
+
}, "haveAnyCrossing"), ie = /* @__PURE__ */ e((e, t) => {
|
|
4486
|
+
for (let n of e.tracks) if (!n.segments.some((e) => (e.edgeIndex !== t.edgeIndex || e.segmentIndex !== t.segmentIndex) && L(e, t))) return n.index;
|
|
4700
4487
|
return -1;
|
|
4701
|
-
}, "findAvailableTrack"),
|
|
4702
|
-
if (e.trackIndex === t.trackIndex) return
|
|
4488
|
+
}, "findAvailableTrack"), ae = /* @__PURE__ */ e((e, t) => {
|
|
4489
|
+
if (e.trackIndex === t.trackIndex) return L(e, t);
|
|
4703
4490
|
let n = B(e), r = B(t);
|
|
4704
4491
|
return n.some((e) => r.some((t) => re(e, t)));
|
|
4705
|
-
}, "segmentsConflict"),
|
|
4706
|
-
if (
|
|
4707
|
-
let r =
|
|
4708
|
-
n(t, r === -1 ?
|
|
4709
|
-
}, "resolveTrackConflict"),
|
|
4492
|
+
}, "segmentsConflict"), V = /* @__PURE__ */ e((e, t, n) => {
|
|
4493
|
+
if (R(e, t, e.pipe.tracks[e.trackIndex], t.pipe.tracks[t.trackIndex])) return;
|
|
4494
|
+
let r = ie(e.pipe, t);
|
|
4495
|
+
n(t, r === -1 ? z(e.pipe) : r);
|
|
4496
|
+
}, "resolveTrackConflict"), oe = /* @__PURE__ */ e((e) => {
|
|
4710
4497
|
let t = 0;
|
|
4711
4498
|
for (let n = 0; n < e.length; n++) for (let r = n + 1; r < e.length; r++) {
|
|
4712
4499
|
let i = e[n], a = e[r];
|
|
4713
|
-
i.pipe === a.pipe &&
|
|
4500
|
+
i.pipe === a.pipe && ae(i, a) && (t++, V(i, a, ne));
|
|
4714
4501
|
}
|
|
4715
4502
|
return t;
|
|
4716
|
-
}, "resolveHandleConflicts"),
|
|
4717
|
-
if (
|
|
4503
|
+
}, "resolveHandleConflicts"), H = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ e((e) => {
|
|
4504
|
+
if (H.has(e)) return H.get(e);
|
|
4718
4505
|
let t = g[e];
|
|
4719
4506
|
if (t.length === 0) {
|
|
4720
4507
|
let t = {
|
|
@@ -4723,7 +4510,7 @@ function nr(t, n) {
|
|
|
4723
4510
|
base: 0,
|
|
4724
4511
|
delta: 0
|
|
4725
4512
|
};
|
|
4726
|
-
return
|
|
4513
|
+
return H.set(e, t), t;
|
|
4727
4514
|
}
|
|
4728
4515
|
let n = h[t[0]].pipe.coord, r = n;
|
|
4729
4516
|
for (let e = 1; e < t.length; e++) {
|
|
@@ -4740,8 +4527,8 @@ function nr(t, n) {
|
|
|
4740
4527
|
base: n,
|
|
4741
4528
|
delta: r - n
|
|
4742
4529
|
};
|
|
4743
|
-
return
|
|
4744
|
-
}, "getDestInfo"),
|
|
4530
|
+
return H.set(e, a), a;
|
|
4531
|
+
}, "getDestInfo"), W = /* @__PURE__ */ e(() => {
|
|
4745
4532
|
let t = 0, n = /* @__PURE__ */ new Map();
|
|
4746
4533
|
for (let [e, t] of a.entries()) g[e].length !== 0 && t.start && (n.has(t.start) || n.set(t.start, []), n.get(t.start).push(e));
|
|
4747
4534
|
let r = /* @__PURE__ */ e((e) => {
|
|
@@ -4754,7 +4541,7 @@ function nr(t, n) {
|
|
|
4754
4541
|
}, "getEdgeDistance");
|
|
4755
4542
|
for (let e of n.values()) {
|
|
4756
4543
|
e.sort((e, t) => {
|
|
4757
|
-
let n =
|
|
4544
|
+
let n = U(e), i = U(t);
|
|
4758
4545
|
if (Math.abs(n.deviation - i.deviation) > 1) return n.deviation - i.deviation;
|
|
4759
4546
|
if (Math.abs(n.dest - i.dest) > 1) return n.dest - i.dest;
|
|
4760
4547
|
let a = r(e), o = r(t);
|
|
@@ -4771,10 +4558,10 @@ function nr(t, n) {
|
|
|
4771
4558
|
return 0;
|
|
4772
4559
|
});
|
|
4773
4560
|
let n = e.map((e) => h[g[e][0]]);
|
|
4774
|
-
t +=
|
|
4561
|
+
t += oe(n);
|
|
4775
4562
|
}
|
|
4776
4563
|
return t;
|
|
4777
|
-
}, "fixSourceHandleCrossings"),
|
|
4564
|
+
}, "fixSourceHandleCrossings"), G = /* @__PURE__ */ e(() => {
|
|
4778
4565
|
let t = 0, n = /* @__PURE__ */ new Map();
|
|
4779
4566
|
for (let [e, t] of a.entries()) g[e].length !== 0 && t.end && (n.has(t.end) || n.set(t.end, []), n.get(t.end).push(e));
|
|
4780
4567
|
for (let r of n.values()) {
|
|
@@ -4788,10 +4575,10 @@ function nr(t, n) {
|
|
|
4788
4575
|
return Math.abs(i - a) > .1 ? i - a : t - n;
|
|
4789
4576
|
});
|
|
4790
4577
|
let n = r.map((e) => h[g[e][g[e].length - 1]]);
|
|
4791
|
-
t +=
|
|
4578
|
+
t += oe(n);
|
|
4792
4579
|
}
|
|
4793
4580
|
return t;
|
|
4794
|
-
}, "fixTargetHandleCrossings"),
|
|
4581
|
+
}, "fixTargetHandleCrossings"), K = /* @__PURE__ */ e(() => {
|
|
4795
4582
|
let e = 0;
|
|
4796
4583
|
for (let t of c) {
|
|
4797
4584
|
let n = [];
|
|
@@ -4802,15 +4589,15 @@ function nr(t, n) {
|
|
|
4802
4589
|
n.sort((e, t) => e.edgeIndex - t.edgeIndex || e.segmentIndex - t.segmentIndex);
|
|
4803
4590
|
for (let t = 0; t < n.length; t++) for (let r = t + 1; r < n.length; r++) {
|
|
4804
4591
|
let i = n[t], a = n[r];
|
|
4805
|
-
|
|
4592
|
+
ae(i, a) && (e++, V(i, a, te));
|
|
4806
4593
|
}
|
|
4807
4594
|
}
|
|
4808
4595
|
return e;
|
|
4809
|
-
}, "fixPipeCrossings"),
|
|
4810
|
-
for (;
|
|
4596
|
+
}, "fixPipeCrossings"), se = 0;
|
|
4597
|
+
for (; se < 10;) {
|
|
4811
4598
|
let e = 0;
|
|
4812
|
-
if (e +=
|
|
4813
|
-
|
|
4599
|
+
if (e += W(), e += G(), e += K(), e === 0) break;
|
|
4600
|
+
se++;
|
|
4814
4601
|
}
|
|
4815
4602
|
let ce = /* @__PURE__ */ new Map();
|
|
4816
4603
|
for (let t of c) {
|
|
@@ -4840,7 +4627,7 @@ function nr(t, n) {
|
|
|
4840
4627
|
n.forEach((e) => r.add(e.trackIndex));
|
|
4841
4628
|
let i = /* @__PURE__ */ new Map();
|
|
4842
4629
|
n.forEach((e) => {
|
|
4843
|
-
let t =
|
|
4630
|
+
let t = U(e.edgeIndex);
|
|
4844
4631
|
i.set(e.trackIndex, (i.get(e.trackIndex) ?? 0) + t.delta);
|
|
4845
4632
|
});
|
|
4846
4633
|
let a = [...r].filter((e) => (i.get(e) ?? 0) < -1), o = [...r].filter((e) => (i.get(e) ?? 0) > 1), s = [...r].filter((e) => Math.abs(i.get(e) ?? 0) <= 1);
|
|
@@ -4851,7 +4638,7 @@ function nr(t, n) {
|
|
|
4851
4638
|
ce.set(`${e.edgeIndex}-${e.segmentIndex}`, n);
|
|
4852
4639
|
});
|
|
4853
4640
|
}, "assignCoord"), l = 0;
|
|
4854
|
-
for (let e of a) l++, c(e, t.coord - l *
|
|
4641
|
+
for (let e of a) l++, c(e, t.coord - l * Nn);
|
|
4855
4642
|
if (s.length === 0 && r.size > 0) {
|
|
4856
4643
|
let e = [...r].sort((e, t) => Math.abs(i.get(e) ?? 0) - Math.abs(i.get(t) ?? 0))[0], t = a.indexOf(e);
|
|
4857
4644
|
t !== -1 && a.splice(t, 1);
|
|
@@ -4863,18 +4650,18 @@ function nr(t, n) {
|
|
|
4863
4650
|
if (u === 0) c(e, t.coord);
|
|
4864
4651
|
else {
|
|
4865
4652
|
let n = u % 2 == 1 ? 1 : -1, r = Math.ceil(u / 2);
|
|
4866
|
-
c(e, t.coord + n * r *
|
|
4653
|
+
c(e, t.coord + n * r * Nn * .5);
|
|
4867
4654
|
}
|
|
4868
4655
|
u++;
|
|
4869
4656
|
}
|
|
4870
4657
|
let d = 0;
|
|
4871
|
-
for (let e of o) d++, c(e, t.coord + d *
|
|
4658
|
+
for (let e of o) d++, c(e, t.coord + d * Nn);
|
|
4872
4659
|
}
|
|
4873
4660
|
}
|
|
4874
4661
|
for (let [e, t] of a.entries()) {
|
|
4875
4662
|
let n = g[e] ?? [];
|
|
4876
4663
|
if (n.length === 0) continue;
|
|
4877
|
-
let r = [], { pSrcPort: i, pDstPort: a } =
|
|
4664
|
+
let r = [], { pSrcPort: i, pDstPort: a } = ee(e, o.get(t.start), o.get(t.end)), s = n.map((e) => {
|
|
4878
4665
|
let t = h[e], n = ce.get(`${t.edgeIndex}-${t.segmentIndex}`) ?? t.pipe.coord;
|
|
4879
4666
|
return {
|
|
4880
4667
|
orient: t.orientation,
|
|
@@ -4886,15 +4673,15 @@ function nr(t, n) {
|
|
|
4886
4673
|
r.push(i);
|
|
4887
4674
|
for (let e = 0; e < s.length; e++) {
|
|
4888
4675
|
let t = s[e], n = r[r.length - 1], i = t.orient === "vertical" ? n.y : n.x, a = t.orient === "vertical" ? n.x : n.y, o = s[e + 1], c = e < s.length - 1;
|
|
4889
|
-
if (Math.abs(a - t.coord) > $ && r.push(
|
|
4676
|
+
if (Math.abs(a - t.coord) > $ && r.push(In(t, i)), c && o.orient === t.orient) {
|
|
4890
4677
|
if (Math.abs(t.coord - o.coord) > $) {
|
|
4891
|
-
let e = t.orient === "vertical" ? (i + o.from) / 2 :
|
|
4892
|
-
r.push(
|
|
4893
|
-
} else (e === 0 || e === s.length - 2) && r.push(
|
|
4894
|
-
} else if (c) r.push(
|
|
4678
|
+
let e = t.orient === "vertical" ? (i + o.from) / 2 : Fn(t, o);
|
|
4679
|
+
r.push(In(t, e), In(o, e));
|
|
4680
|
+
} else (e === 0 || e === s.length - 2) && r.push(In(t, Fn(t, o)));
|
|
4681
|
+
} else if (c) r.push(In(t, o.coord));
|
|
4895
4682
|
else {
|
|
4896
4683
|
let e = Math.abs(t.from - i) < Math.abs(t.to - i) ? t.to : t.from;
|
|
4897
|
-
r.push(
|
|
4684
|
+
r.push(In(t, e));
|
|
4898
4685
|
}
|
|
4899
4686
|
}
|
|
4900
4687
|
let c = r[r.length - 1];
|
|
@@ -4940,13 +4727,13 @@ function nr(t, n) {
|
|
|
4940
4727
|
}
|
|
4941
4728
|
return t;
|
|
4942
4729
|
}
|
|
4943
|
-
e(
|
|
4944
|
-
function
|
|
4730
|
+
e(Ln, "routeEdgesOrthogonal");
|
|
4731
|
+
function Rn(e) {
|
|
4945
4732
|
return e.direction ?? "TB";
|
|
4946
4733
|
}
|
|
4947
|
-
e(
|
|
4948
|
-
function
|
|
4949
|
-
let t =
|
|
4734
|
+
e(Rn, "getSwimlaneDirection");
|
|
4735
|
+
function zn(e) {
|
|
4736
|
+
let t = d(e), n = e.config.flowchart?.nodeSpacing ?? 40, r = e.config.flowchart?.rankSpacing ?? 100, i = e.config.swimlane?.ignoreCrossLaneEdges ?? !0, a = e.config.swimlane?.optimizeRanksByCrossings ?? !0, o = e.config.swimlane?.automaticLaneOrdering ?? !1, s = Rn(e), { ordered: c, coordinates: l } = Dn(t, {
|
|
4950
4737
|
nodeGap: n,
|
|
4951
4738
|
layerGap: r,
|
|
4952
4739
|
ignoreCrossLaneEdges: i,
|
|
@@ -4954,26 +4741,26 @@ function ir(e) {
|
|
|
4954
4741
|
automaticLaneOrdering: o,
|
|
4955
4742
|
direction: s
|
|
4956
4743
|
});
|
|
4957
|
-
|
|
4744
|
+
f(t, c, l, {
|
|
4958
4745
|
nodeGap: n,
|
|
4959
4746
|
layerGap: r
|
|
4960
4747
|
});
|
|
4961
4748
|
for (let t of e.edges ?? []) delete t.points;
|
|
4962
|
-
|
|
4749
|
+
Ln(e, s);
|
|
4963
4750
|
for (let t of e.edges ?? []) (!t.curve || t.curve === "basis") && (t.curve = "rounded");
|
|
4964
|
-
return
|
|
4751
|
+
return _t(e, s), gt(e), s;
|
|
4965
4752
|
}
|
|
4966
|
-
e(
|
|
4967
|
-
function
|
|
4968
|
-
|
|
4969
|
-
let t =
|
|
4753
|
+
e(zn, "runSwimlaneLayoutCore");
|
|
4754
|
+
function Bn(e) {
|
|
4755
|
+
u(e);
|
|
4756
|
+
let t = m(e);
|
|
4970
4757
|
e.nodes = t.nodes, e.edges = t.edges;
|
|
4971
4758
|
}
|
|
4972
|
-
e(
|
|
4973
|
-
var
|
|
4974
|
-
prepareLayout:
|
|
4975
|
-
runLayoutCore:
|
|
4976
|
-
afterPaint:
|
|
4759
|
+
e(Bn, "prepareSwimlaneLayout");
|
|
4760
|
+
var Vn = n({
|
|
4761
|
+
prepareLayout: Bn,
|
|
4762
|
+
runLayoutCore: zn,
|
|
4763
|
+
afterPaint: i
|
|
4977
4764
|
});
|
|
4978
4765
|
//#endregion
|
|
4979
|
-
export {
|
|
4766
|
+
export { Vn as render };
|