@marimo-team/islands 0.23.17-dev9 → 0.24.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/{ConnectedDataExplorerComponent-f9vLjQiF.js → ConnectedDataExplorerComponent-BUC1MrsF.js} +24 -24
- package/dist/{ErrorBoundary-DhLqwSWA.js → ErrorBoundary-BniTEhHn.js} +7 -7
- package/dist/{ImageComparisonComponent-C3y7L3eJ.js → ImageComparisonComponent-B7b8DcJI.js} +42 -31
- package/dist/{Plot-YQOuVIei.js → Plot-eTseCFf_.js} +4 -4
- package/dist/_initCloneObject-DNUst5Cg.js +91 -0
- package/dist/abnfDiagram-N423BO3Z-DA4j92-C.js +112 -0
- package/dist/{any-language-editor-DifE-fl7.js → any-language-editor-LHl8ZmVN.js} +26 -26
- package/dist/apl-Cwo7GIH7.js +4 -0
- package/dist/{arc-CTIpFoOn.js → arc-9nABupDE.js} +2 -2
- package/dist/architecture-TIHT7OUA-DxLlkuAK.js +5 -0
- package/dist/{architectureDiagram-VXUJARFQ-DXwkyAaM.js → architectureDiagram-T3A2C74G-BBlBK1Oh.js} +327 -214
- package/dist/{arrays-sEtDRoG4.js → arrays-C56grfjL.js} +1 -1
- package/dist/asciiarmor-jrfEZ3j_.js +4 -0
- package/dist/asn1-BNEiJ4nQ.js +4 -0
- package/dist/assets/__vite-browser-external-DUz7vvG0.js +1 -0
- package/dist/assets/{worker-CDEKsBgX.js → worker-Cl1KJG2_.js} +2 -2
- package/dist/blockDiagram-VBNYF7ZC-Datz1WNn.js +3284 -0
- package/dist/brainfuck-BCunvTbd.js +4 -0
- package/dist/{button-BSm8IXRU.js → button-Dr2uAwhT.js} +9 -7
- package/dist/{c4Diagram-YG6GDRKO-B6dZC_oU.js → c4Diagram-5PPSVZJV-DTIsibpE.js} +165 -162
- package/dist/{capabilities-C6OQ5YBO.js → capabilities-BilXeZ7p.js} +2 -2
- package/dist/{channel-BN070S0F.js → channel-CuV_jmG4.js} +1 -1
- package/dist/chat-ui-o-tATfmW.js +8619 -0
- package/dist/{check-DP7U0H0G.js → check-58HHfHKy.js} +1 -1
- package/dist/chunk-2GRJ4B5K-DRayWnnu.js +68 -0
- package/dist/{chunk-QZHKN3VN-Dym5BS7y.js → chunk-2Q5K7J3B-BSLyFOHa.js} +1 -1
- package/dist/chunk-3NCLNEKW-BPlp8K7N.js +11 -0
- package/dist/chunk-4I5QYGJK-CYJC3pkC.js +260 -0
- package/dist/chunk-5FCAYU7R-C3cMIeyz.js +24 -0
- package/dist/{chunk-5FQGJX7Z-B9WoXK1R.js → chunk-5FQGJX7Z-BRZ_XYUw.js} +6 -6
- package/dist/chunk-5HE753X5-D2jFCVXb.js +34 -0
- package/dist/chunk-5JV3BV7I-B7tzprBU.js +50 -0
- package/dist/{chunk-DI55MBZ5-D4Y8yV8B.js → chunk-5RXB4S5H-DcCPfb0q.js} +373 -327
- package/dist/chunk-5TONJI2A-LRqbgPte.js +59 -0
- package/dist/{chunk-FMBD7UC4-quJmebXa.js → chunk-5VM5RSS4-ChXEBudA.js} +1 -1
- package/dist/chunk-6Q2QTUOP-zcnb3OaV.js +503 -0
- package/dist/{chunk-HN2XXSSU-Bv0QkeMr.js → chunk-7BUUIJ7U-CkIbJNZo.js} +32 -25
- package/dist/chunk-7Z6QIM7H-1j-x7ddW.js +606 -0
- package/dist/{chunk-FRFDVMJY-BHBqN-vD.js → chunk-BIQX33UG-B-BYk6sM.js} +3 -3
- package/dist/chunk-Bfp04NdC.js +25 -0
- package/dist/chunk-CQNSW5MT-DBXDKSOU.js +34 -0
- package/dist/{chunk-4F5CHEZ2-VlodlEGo.js → chunk-CYSBUYHQ-Cv-vKQV-.js} +1 -1
- package/dist/{chunk-SJTYNZTY-DnXoKWpW.js → chunk-EMLP6XTP-DCtMkXLF.js} +1 -1
- package/dist/{chunk-B4BG7PRW-B_z2FEHm.js → chunk-GF5L2VYU-esTxzELH.js} +878 -636
- package/dist/chunk-I66GZJ75-9xAsFrdW.js +3744 -0
- package/dist/chunk-J7OUQ5F2-CbNBTlFM.js +81 -0
- package/dist/chunk-JG7HCLWE-CZIm6axg.js +59 -0
- package/dist/{flowDiagram-NV44I4VS-BRhSg-ro.js → chunk-JQJVKLGR-ZALkKVji.js} +1019 -1001
- package/dist/{chunk-4BX2VUAB-iU5lQTDI.js → chunk-JWPE2WC7-C_Daz-Oc.js} +1 -1
- package/dist/{chunk-QN33PNHL-DPBNNzpR.js → chunk-KBJHAD2P-B7m9DztL.js} +3 -2
- package/dist/chunk-KEIR6QF5-aP6TmWQ-.js +21095 -0
- package/dist/{chunk-UMXZTB3W-D1uHz8MN.js → chunk-MOZMSUNE-BQi-ggQx.js} +7 -4
- package/dist/{chunk-S3R3BYOJ-BdgLc8AM.js → chunk-NSK5VX7P-BmmoJBbx.js} +320 -29
- package/dist/chunk-OSBZ3O6U-BcrmpSY_.js +22 -0
- package/dist/{chunk-TQ3KTPDO-CsDx6v37.js → chunk-QBLGF6JB-BACuPUWb.js} +3 -3
- package/dist/chunk-QR6OTTB3-C4L1dLRd.js +3762 -0
- package/dist/{chunk-B2363JML-zL3VngtH.js → chunk-R7FJI6CG-BYAXJpIb.js} +3 -3
- package/dist/chunk-RYQCIY6F-poA0Ugpr.js +243 -0
- package/dist/chunk-U6XO7XAA-I8tCjTeT.js +60 -0
- package/dist/chunk-UBXNYLIW-C8LueN5Q.js +34 -0
- package/dist/{chunk-ATLVNIR6-qFiszptQ.js → chunk-W5SLKNZC-DK-_KuKT.js} +2 -2
- package/dist/{chunk-JA3XYJ7Z-CY4CRbV5.js → chunk-WRU74C26-DLgw-V0j.js} +262 -451
- package/dist/chunk-XXDRQBXY-Dzcp3rUR.js +9 -0
- package/dist/chunk-Y2CYZVJY-DX3DSigL.js +13 -0
- package/dist/{chunk-PL6DKKU2-CAHKc95s.js → chunk-YOTPTUD7-C8qfgaz5.js} +5 -5
- package/dist/{chunk-MI3HLSF2-HGWI-8Pg.js → chunk-ZIRB5QZD-_JX1DzEJ.js} +12 -8
- package/dist/classDiagram-JCYQIIEL-D8A6ZyXv.js +32 -0
- package/dist/classDiagram-v2-OCEON4UE-DIdYl-t3.js +32 -0
- package/dist/{click-outside-container-BSIeYt4y.js → click-outside-container-BZNsAj09.js} +2 -2
- package/dist/{clike-7lgyEYRk.js → clike-CWndBX_M.js} +1 -1
- package/dist/clojure-2X0Rfij9.js +4 -0
- package/dist/cmake-DEwzCy9U.js +4 -0
- package/dist/cobol-Ck4eCoAB.js +4 -0
- package/dist/{code-block-37QAKDTI-MSxEjskJ.js → code-block-37QAKDTI-B4pWe5MI.js} +4 -4
- package/dist/coffeescript-bB1IDwhg.js +4 -0
- package/dist/{common-C3f0slQQ.js → common-DV4qU2ew.js} +797 -804
- package/dist/commonlisp-BDYrVBNC.js +4 -0
- package/dist/{compiler-runtime-CEbnTgxf.js → compiler-runtime-DsR6imPN.js} +2 -2
- package/dist/{copy-DNq8q3zw.js → copy-C7ZKMKox.js} +5 -5
- package/dist/{cose-bilkent-S5V4N54A-BYj0aL7z.js → cose-bilkent-JH36ORCC-D6iQzSi6.js} +6 -5
- package/dist/crystal-BSoiVUiH.js +4 -0
- package/dist/css-w1h9i21f.js +4 -0
- package/dist/cynefin-VYW2F7L2-DnZOHyNF.js +5 -0
- package/dist/cynefinDiagram-MW4NZA55-B1GNPS2u.js +367 -0
- package/dist/cypher-B4xzuKGP.js +4 -0
- package/dist/{cytoscape.esm-Dr8XzXWK.js → cytoscape.esm-BPa26Dup.js} +393 -334
- package/dist/d-D50Bz34p.js +4 -0
- package/dist/{dagre-By_QsQgc.js → dagre-ThTNj8pe.js} +60 -45
- package/dist/dagre-VZM6K2ZE-DEs5dfXA.js +343 -0
- package/dist/{data-grid-overlay-editor-BWRG2b_o.js → data-grid-overlay-editor-Ci7TXVf5.js} +5 -5
- package/dist/{debounce-BOD3DbfP.js → debounce-D784bpms.js} +2 -2
- package/dist/{defaultLocale-BpsHxBd7.js → defaultLocale-CMezyvMc.js} +26 -26
- package/dist/diagram-7IWD3JNH-Bdk1_wJO.js +321 -0
- package/dist/diagram-B4RE2ZJO-Be9eYLJ0.js +464 -0
- package/dist/{diagram-S2PKOQOG-CGh4OMEV.js → diagram-LBJQPF4R-BNSnzxFw.js} +26 -18
- package/dist/{diagram-PSM6KHXK-D4ftnaua.js → diagram-Q27KOJAE-NPRzyGtd.js} +68 -63
- package/dist/diagram-UB23O5K3-Dogz4itg.js +236 -0
- package/dist/diff-BMdzfXq-.js +4 -0
- package/dist/{dist-BTdrwBWP.js → dist-72nb8Uag.js} +3 -3
- package/dist/{dist-CV79CsQ0.js → dist-9PC5KxMl.js} +2 -2
- package/dist/{dist-BOMbzyb3.js → dist-Awj73yUw.js} +3 -3
- package/dist/{dist-w_gWE5Wf.js → dist-B0Ctcrt9.js} +1 -1
- package/dist/{dist-BO5HRiTf.js → dist-B1Donbpk.js} +2 -2
- package/dist/dist-BC6wzWNb.js +5 -0
- package/dist/{dist-De-GlSAs.js → dist-BJ2IUa0l.js} +15 -9
- package/dist/dist-BMd_RcOy.js +5 -0
- package/dist/dist-BZEWjN6r.js +5 -0
- package/dist/{dist-BP39XM8u.js → dist-B_K4AAkc.js} +1 -1
- package/dist/dist-BeuGjR3n.js +6 -0
- package/dist/dist-BfDQCUe6.js +5 -0
- package/dist/dist-BhNblTOV.js +8 -0
- package/dist/{dist-BPF0gTRZ.js → dist-C0ifRfXi.js} +1 -1
- package/dist/{dist-pqIwD8VD.js → dist-C3mEki35.js} +2 -2
- package/dist/{dist-LpLXa9Lb.js → dist-CNfV2vDI.js} +2 -2
- package/dist/{dist-DviUBLUp.js → dist-COcQ5Vyc.js} +4 -4
- package/dist/dist-CRCm4Fuo.js +5 -0
- package/dist/{dist-4lVIWUT3.js → dist-CSZpLb9d.js} +1 -1
- package/dist/{dist-BIEt-mlF.js → dist-CWswQBvu.js} +1 -1
- package/dist/{dist-D3bdsa1d.js → dist-CXYro_Nw.js} +4 -4
- package/dist/{dist-CRmSjkLP.js → dist-Ckfsc8C3.js} +2 -2
- package/dist/{dist-CSlJrrAw.js → dist-Cyq6Pxtv.js} +1 -1
- package/dist/{dist-JGehap7K.js → dist-D-BWPyoX.js} +5 -5
- package/dist/{dist-BCX980mU.js → dist-D-YB6j-O.js} +2 -2
- package/dist/{dist-DgjbnqTg.js → dist-D1vYHETp.js} +2 -2
- package/dist/{dist-BpeiYpG2.js → dist-D9-ePb6D.js} +2 -2
- package/dist/dist-DBPEbGkd.js +8 -0
- package/dist/{dist-C2_4pjuS.js → dist-DC409ROm.js} +1 -1
- package/dist/{dist-BdqCKQ1O.js → dist-DJRUd9aM.js} +2 -2
- package/dist/{dist-DaXJPX8F.js → dist-DLvxZEAK.js} +2 -2
- package/dist/dist-DSsl8IAI.js +5 -0
- package/dist/{dist-3NCqaWjt.js → dist-D_ulymry.js} +2 -2
- package/dist/{dist-DZwp8lro.js → dist-DgY27bJ4.js} +3 -3
- package/dist/{dist-BwhXBwMd.js → dist-DiwVZiK7.js} +1 -1
- package/dist/{dist-DwqBJ014.js → dist-DnYHhW6c.js} +2 -2
- package/dist/dist-Dx0kkrek.js +5 -0
- package/dist/{dist-DsoKosxi.js → dist-HaLHv0k5.js} +2 -3
- package/dist/dist-NKA1TU8a.js +6 -0
- package/dist/dist-ZFcsIdHj.js +8 -0
- package/dist/{dist-C18MUWTj.js → dist-iZ8-rtUy.js} +2 -2
- package/dist/{dist-DIlxLFXG.js → dist-j30bBjjN.js} +15 -15
- package/dist/{dist-SXNmlE8A.js → dist-kOCFEa1U.js} +3 -3
- package/dist/{dist-CFSb_Frm.js → dist-sxRUVPmt.js} +1 -1
- package/dist/dist-uA2RbGmY.js +5 -0
- package/dist/{dist-B2jmQKKx.js → dist-xVU82Nq7.js} +2 -2
- package/dist/dist-zSCo-xCB.js +8 -0
- package/dist/{dockerfile-B82Pkz_V.js → dockerfile-DImRFUlA.js} +1 -1
- package/dist/dtd-B9dCT0pu.js +4 -0
- package/dist/dylan-DLghDyuR.js +4 -0
- package/dist/ebnfDiagram-BXEA7PRR-CqRWkG7L.js +129 -0
- package/dist/ecl-w0qdPHDB.js +4 -0
- package/dist/eiffel-C5AWRCNP.js +4 -0
- package/dist/elm-CT8FZrOm.js +4 -0
- package/dist/{erDiagram-Q2GNP2WA-BcKAHFqF.js → erDiagram-JOGREHBK-BZMJX-Au.js} +568 -436
- package/dist/erlang-DPD-9M5g.js +4 -0
- package/dist/{error-banner-B_GQfxxD.js → error-banner-BwCLtmkH.js} +6 -6
- package/dist/{esm-CuQHjs36.js → esm-BJ4n0NUT.js} +1 -1
- package/dist/{esm-DKOv6P2M.js → esm-Dusmf6uu.js} +105 -105
- package/dist/{esm-DzZVaNH4.js → esm-QLUgkqzZ.js} +6 -6
- package/dist/eventmodeling-45OFAUF4-D8Kbnsr6.js +5 -0
- package/dist/{extends-w2_S44bV.js → extends-iFBneQO_.js} +9 -9
- package/dist/{factor-Bq2mGIHt.js → factor-BonZgUGg.js} +1 -1
- package/dist/factor-rFfeJu3r.js +4 -0
- package/dist/flowDiagram-UKHOOZJN-DqIE8_b3.js +21 -0
- package/dist/{formats-Dwq1THhr.js → formats-HSfYlcA8.js} +7 -7
- package/dist/forth-C-3AyQx4.js +4 -0
- package/dist/fortran-BSN9TeT7.js +4 -0
- package/dist/ganttDiagram-PKOTCBZU-Bc9puoXb.js +2207 -0
- package/dist/gas-DwmuvQpB.js +4 -0
- package/dist/gherkin-gmCjL-Sn.js +4 -0
- package/dist/{gitGraph-G5XIXVHT-BjTx0kww.js → gitGraph-TEB2WS4Q-DVzLmQHc.js} +2 -3
- package/dist/gitGraphDiagram-DS77QQ5N-CqKr-Dfg.js +766 -0
- package/dist/{glide-data-editor-B9K6-MJe.js → glide-data-editor-BI2i_IEE.js} +18 -18
- package/dist/graphlib-DMVIRZap.js +614 -0
- package/dist/groovy-DCjvesOy.js +4 -0
- package/dist/hasIn-synBnXn4.js +119 -0
- package/dist/haskell-C1p0D9L8.js +4 -0
- package/dist/haxe-q-fgv0zr.js +5 -0
- package/dist/{html-to-image-CZ1kLKkq.js → html-to-image-BOiFHx3u.js} +7535 -3056
- package/dist/idl-Bmg4bsnK.js +4 -0
- package/dist/{info-VBDWY6EO-CA67FznA.js → info-DKCQHKI2-BxOTqQHM.js} +2 -3
- package/dist/infoDiagram-6WML65LV-B869X2KY.js +37 -0
- package/dist/{input-C5K4VBvB.js → input-BRE2a7Ay.js} +13 -13
- package/dist/{_baseFor-4jw-lnCC.js → isArrayLikeObject-CBUaLibE.js} +96 -29
- package/dist/{isEmpty-CJJMn-QP.js → isEmpty-CgME6WRV.js} +15 -15
- package/dist/{isSymbol-CoUCgMCM.js → isSymbol-Ch3GYg4S.js} +1 -1
- package/dist/ishikawaDiagram-WSZJBQD7-BrOMFBYy.js +731 -0
- package/dist/javascript-BY5QZ-eN.js +4 -0
- package/dist/{journeyDiagram-XKPGCS4Q-DEal0aT1.js → journeyDiagram-NVQOT4AX-CTwHlsTm.js} +124 -123
- package/dist/{jsx-runtime-DebpN0FN.js → jsx-runtime-Dp_oQwaf.js} +1 -1
- package/dist/julia-DbR1YalK.js +4 -0
- package/dist/{kanban-definition-3W4ZIXB7-Dl90wENN.js → kanban-definition-27J2QSJJ-CKowzO9_.js} +51 -45
- package/dist/{katex-C4t-BmrK.js → katex-Ci33kJVq.js} +1 -1
- package/dist/{katex-Bld7b-fk.js → katex-Dp22h6yO.js} +2871 -3002
- package/dist/{label-DjoYwqmj.js → label-CMh2d8pJ.js} +6 -6
- package/dist/{line-C43FIPBd.js → line-Bc27KE1D.js} +3 -3
- package/dist/{linear-H_vsH9ao.js → linear-6pDlrp1I.js} +4 -4
- package/dist/livescript-BDUooIeL.js +4 -0
- package/dist/{loader-DX-IDS7n.js → loader-DTnbNSVZ.js} +11 -11
- package/dist/lua-CswAWSkH.js +4 -0
- package/dist/main.js +747 -752
- package/dist/map-BQ_Xp80D.js +137 -0
- package/dist/mathematica-Bw7v11B5.js +4 -0
- package/dist/mbox-j35IMz1j.js +4 -0
- package/dist/merge-CDbSrd9f.js +69 -0
- package/dist/mermaid-4DMBBIKO-BZSpTmcx.js +6 -0
- package/dist/mermaid-DpAz2sTy.js +1265 -0
- package/dist/mermaid-parser.core-BQzz3_BI.js +87 -0
- package/dist/{mhchem-EGhUZR1V.js → mhchem-BDHjke3h.js} +1 -1
- package/dist/{micromark-factory-space-CwHmg6iz.js → micromark-factory-space-Cr4NxAt3.js} +1 -1
- package/dist/{mindmap-definition-VGOIOE7T-CCDupjWW.js → mindmap-definition-FAOFIHXS-CTsi-HFj.js} +126 -80
- package/dist/mirc-Ba_RHVXO.js +4 -0
- package/dist/mllike-DbTP2dPp.js +6 -0
- package/dist/modelica-lpT3V1X6.js +4 -0
- package/dist/mscgen-BN4ZSJMx.js +6 -0
- package/dist/mumps-uI5g1A0g.js +4 -0
- package/dist/{node-sql-parser-v1Vi-Fft.js → node-sql-parser-BaLGWQe1.js} +1 -1
- package/dist/{now-Ch98bJO_.js → now-sFWt-GLC.js} +2 -2
- package/dist/{nsis-i9_sgigf.js → nsis-C68fFq_o.js} +1 -1
- package/dist/nsis-Df56GiRg.js +4 -0
- package/dist/ntriples-B3LWuG7W.js +4 -0
- package/dist/{number-overlay-editor-Ck_mc_gT.js → number-overlay-editor-CeBHRJvI.js} +3 -3
- package/dist/octave-CovfQgOx.js +4 -0
- package/dist/{once-B60G2fuJ.js → once-Boutk_9X.js} +1 -1
- package/dist/{ordinal-Bkv2-veX.js → ordinal-Bdajf2BE.js} +1 -1
- package/dist/oz-DQQAvVFb.js +4 -0
- package/dist/{packet-DYOGHKS2-Bkgofxf3.js → packet-7NZHBO7P-BG8whXXH.js} +2 -3
- package/dist/pascal-xz94P9sf.js +4 -0
- package/dist/pegDiagram-VL7TDLO6-CNpT8Sqz.js +124 -0
- package/dist/perl-aEWKE-1n.js +4 -0
- package/dist/pick-CaEWivSF.js +47 -0
- package/dist/{pie-VRWISCQL-B1AMhN_7.js → pie-RZYD4A2V-Cc_QhFbT.js} +2 -3
- package/dist/pieDiagram-7S7Q4E2Y-Ct8jRpe_.js +219 -0
- package/dist/pig-DB6DOZl7.js +4 -0
- package/dist/powershell-DM5saUx1.js +4 -0
- package/dist/{precisionRound-CnHPY_5v.js → precisionRound-BOoJTbDj.js} +1 -1
- package/dist/{process-output-bVfbcx5_.js → process-output-HrsM52f8.js} +7 -7
- package/dist/properties-BGjYQuGo.js +4 -0
- package/dist/protobuf-BPpEyPud.js +4 -0
- package/dist/{pug-BhE2JRSg.js → pug-DFPPZ3LA.js} +1 -1
- package/dist/pug-uJzB88ft.js +4 -0
- package/dist/puppet-oIm2d_Lg.js +4 -0
- package/dist/{purify.es-EnR5yhgI.js → purify.es-DR5PNXwx.js} +160 -155
- package/dist/python-WE57eUzD.js +4 -0
- package/dist/q-CR8xPodo.js +4 -0
- package/dist/{quadrantDiagram-AYHSOK5B-BqDB9tUC.js → quadrantDiagram-CIZ2JOQS-B5n_xFcF.js} +429 -401
- package/dist/r-CJdmQZNj.js +4 -0
- package/dist/{radar-ZZBFDIW7-C2b7A32s.js → radar-I7S5WNFK-OhUkecXA.js} +2 -3
- package/dist/railroad-3IZDKUUU-1CmOpo1B.js +5 -0
- package/dist/railroad-abnf-AHOZXSZD-DmH4lsDS.js +5 -0
- package/dist/railroad-ebnf-EBAXGLYW-CzK0md4e.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-DOklooKz.js +5 -0
- package/dist/railroadDiagram-AXF67PYL-BbUWbtf8.js +100 -0
- package/dist/{react-DA-nE2FX.js → react-DhGsCS90.js} +1 -1
- package/dist/{react-dom-BTJzcVJ9.js → react-dom-CmENFV8Q.js} +2 -2
- package/dist/{react-vega-BazDALhI.js → react-vega-zyfTF9SY.js} +8036 -4796
- package/dist/{requirementDiagram-UZGBJVZJ-KbVt8SPH.js → requirementDiagram-LRYGKXZP-CpoDmKSf.js} +137 -105
- package/dist/{reveal-component-CbOaZYQI.js → reveal-component-CYZAzXrV.js} +27 -28
- package/dist/rough.esm-lGyFQ0B-.js +1363 -0
- package/dist/rpm-Cm5K4RH9.js +5 -0
- package/dist/ruby-ArsuTozQ.js +4 -0
- package/dist/sankeyDiagram-W5VNT64P-D82rYiAG.js +942 -0
- package/dist/sas-DShligrE.js +4 -0
- package/dist/scheme-kDLirQL7.js +4 -0
- package/dist/sequenceDiagram-SI44F4Z6-DgVKU1s5.js +4281 -0
- package/dist/shell-CVQuWP_N.js +4 -0
- package/dist/sieve-BW-ePwnq.js +4 -0
- package/dist/sizeCapture-X5ZJPWSS-BQgxHTji.js +48 -0
- package/dist/smalltalk-DI4aAXxY.js +4 -0
- package/dist/sparql-B2sp0oiz.js +4 -0
- package/dist/{spec-CQKL_D3i.js → spec-BL1GSUUF.js} +4 -4
- package/dist/{src-DV3ha_nA.js → src-BwVZVGyf.js} +13 -22
- package/dist/{stateDiagram-FKZM4ZOC-ByOvQf2n.js → stateDiagram-OKZ733FA-Cc9BchXz.js} +61 -58
- package/dist/stateDiagram-v2-UEYNNEHI-Dd4Tuw6F.js +32 -0
- package/dist/{step-BqHnkgWE.js → step-BqVgkWtk.js} +1 -1
- package/dist/stex-D2rme5UG.js +4 -0
- package/dist/{strings-DIy9NAmg.js → strings-DMLVGXRo.js} +305 -305
- package/dist/style.css +1 -1
- package/dist/stylus-xxO-85eO.js +4 -0
- package/dist/swift-Ctg533nZ.js +4 -0
- package/dist/swimlanes-SLNWSIFB-BHvhO5uv.js +5564 -0
- package/dist/swimlanesDiagram-ULZ7WXOC-aI_zgQ8O.js +33 -0
- package/dist/{swiper-component-CEdAYjb7.js → swiper-component-Cx0cRWLk.js} +6 -6
- package/dist/tcl-phm9c5Nd.js +4 -0
- package/dist/textile-CphjAg90.js +4 -0
- package/dist/{time-Bb4A7I6a.js → time-DAJu9fnj.js} +4 -4
- package/dist/timeline-definition-Z64GVDOM-BAHuDYyA.js +1107 -0
- package/dist/{timer-BpI_FKSA.js → timer-aIIabkbI.js} +1 -1
- package/dist/{toDate-CqhBWjvO.js → toDate-BGM7kFtQ.js} +6 -6
- package/dist/toml-BUuMK772.js +4 -0
- package/dist/{tooltip-f-qR0iUx.js → tooltip-BtUxZT5h.js} +7 -7
- package/dist/treeView-QDETBFTQ-DsLN_c8p.js +5 -0
- package/dist/{treemap-GDKQZRPO-SDux0AV8.js → treemap-6X3UGDF4-K1bi3LJm.js} +2 -3
- package/dist/troff-lCtc05A3.js +4 -0
- package/dist/ttcn-CcykzBcW.js +4 -0
- package/dist/ttcn-cfg-C-XYdqpE.js +4 -0
- package/dist/turtle-CpfVZs8G.js +4 -0
- package/dist/{types-DicH9Oi0.js → types-DT8UHI5w.js} +1 -1
- package/dist/{use-vega-container-remeasure-DGNrIQSk.js → use-vega-container-remeasure-B7OD7yUY.js} +3 -3
- package/dist/{useAsyncData-CYOQb1EW.js → useAsyncData-CDcbh-Qv.js} +5 -5
- package/dist/{useDateFormatter-Bt2qr_XS.js → useDateFormatter-B_vTzxpm.js} +4 -4
- package/dist/{useDeepCompareMemoize-CSHQeQEI.js → useDeepCompareMemoize-Bj6QvwiG.js} +3 -3
- package/dist/{useIframeCapabilities-kA09ykNq.js → useIframeCapabilities-CxuXXwjj.js} +4 -4
- package/dist/{useLifecycle-CMJGqBaY.js → useLifecycle-Bw4wRj_O.js} +7 -7
- package/dist/{useTheme-DYfby65G.js → useTheme-BzEXeAR5.js} +8 -7
- package/dist/vb-VOIzXwm9.js +4 -0
- package/dist/vbscript-D0WfcnVk.js +4 -0
- package/dist/{vega-component-C7nO5zcf.js → vega-component-CJug-VdR.js} +24 -24
- package/dist/{vega-embed-container-DAQAMjiO.js → vega-embed-container-BRjjqRGz.js} +9 -9
- package/dist/{vega-loader.browser-DmpxCJqx.js → vega-loader.browser-CGb-2Kwi.js} +106 -113
- package/dist/velocity-CCrc5n-0.js +4 -0
- package/dist/vennDiagram-T6HMQDX7-CTyzMewS.js +1913 -0
- package/dist/verilog-BLFhaDBH.js +4 -0
- package/dist/vhdl-DjuqPE9b.js +4 -0
- package/dist/wardley-OPB4EBWU-CP99MvU1.js +5 -0
- package/dist/wardleyDiagram-T6FBY63Y-vcno_rbk.js +669 -0
- package/dist/webidl-Cc7RrfeK.js +4 -0
- package/dist/xquery-BiCRLnNG.js +4 -0
- package/dist/{xychartDiagram-PRI3JC2R-BSkNxYNw.js → xychartDiagram-ELKLHX3M-DyFDERhM.js} +417 -353
- package/dist/yacas-CWcjav-O.js +4 -0
- package/dist/z80-DpYS2lE7.js +4 -0
- package/dist/{zod-BUcyXSdR.js → zod-BFY2SnzC.js} +42 -43
- package/package.json +7 -7
- package/src/__mocks__/requests.ts +5 -0
- package/src/components/ai/ai-model-dropdown.tsx +2 -2
- package/src/components/app-config/user-config-form.tsx +26 -0
- package/src/components/chat/__tests__/capabilities-popover.test.tsx +38 -0
- package/src/components/chat/__tests__/chat-abort.test.ts +51 -0
- package/src/components/chat/__tests__/use-chat-controller-id.test.tsx +39 -0
- package/src/components/chat/capabilities-popover.tsx +68 -0
- package/src/components/chat/chat-abort.ts +44 -0
- package/src/components/chat/chat-display.tsx +17 -0
- package/src/components/chat/chat-panel.tsx +107 -50
- package/src/components/chat/chat-utils.ts +1 -1
- package/src/components/chat/use-chat-controller-id.ts +24 -0
- package/src/components/data-table/charts/__tests__/schemas.test.ts +35 -0
- package/src/components/data-table/charts/schemas.ts +5 -2
- package/src/components/datasets/__tests__/icons.test.ts +21 -0
- package/src/components/datasets/icons.tsx +10 -0
- package/src/components/datasources/__tests__/components.test.tsx +29 -0
- package/src/components/datasources/components.tsx +8 -3
- package/src/components/editor/actions/export-dialog/__tests__/export-dialog.test.tsx +35 -0
- package/src/components/editor/actions/export-dialog/__tests__/state.test.ts +61 -0
- package/src/components/editor/actions/export-dialog/export-command.ts +4 -9
- package/src/components/editor/actions/export-dialog/format-notice.tsx +28 -0
- package/src/components/editor/actions/export-dialog/state.ts +23 -5
- package/src/components/editor/actions/export-dialog/use-export-dialog.ts +3 -13
- package/src/components/editor/actions/useConfigActions.tsx +24 -0
- package/src/components/editor/ai/add-cell-with-ai.tsx +2 -2
- package/src/components/editor/ai/ai-completion-editor.tsx +2 -2
- package/src/components/editor/chrome/panels/outline/__tests__/useActiveOutline.test.ts +26 -0
- package/src/components/editor/chrome/wrapper/useOpenAiAssistant.ts +2 -2
- package/src/components/editor/code/__tests__/readonly-python-code.test.tsx +114 -2
- package/src/core/__tests__/mode.test.ts +85 -0
- package/src/core/ai/__tests__/config.test.tsx +96 -0
- package/src/core/ai/config.ts +16 -22
- package/src/core/ai/constants.ts +7 -0
- package/src/core/ai/staged-cells.ts +3 -0
- package/src/core/ai/state.ts +10 -0
- package/src/core/codemirror/__tests__/setup.test.ts +1 -1
- package/src/core/codemirror/cm.ts +2 -2
- package/src/core/codemirror/code-lens/__tests__/extension.test.ts +85 -6
- package/src/core/codemirror/code-lens/extension.ts +144 -47
- package/src/core/codemirror/find-replace/search-highlight.ts +8 -3
- package/src/core/codemirror/language/languages/sql/__tests__/renderers.test.tsx +44 -0
- package/src/core/codemirror/language/languages/sql/renderers.tsx +3 -3
- package/src/core/codemirror/theme/__tests__/light.test.ts +59 -123
- package/src/core/codemirror/theme/dark.ts +6 -5
- package/src/core/codemirror/theme/light.ts +6 -4
- package/src/core/config/__tests__/config-schema.test.ts +2 -0
- package/src/core/config/config-schema.ts +1 -0
- package/src/core/config/feature-flag.tsx +0 -2
- package/src/core/dom/outline.ts +25 -2
- package/src/core/hotkeys/hotkeys.ts +2 -0
- package/src/core/mode.ts +11 -9
- package/src/core/network/__tests__/api.test.ts +132 -17
- package/src/core/network/__tests__/export-filename.test.ts +43 -0
- package/src/core/network/__tests__/requests-lazy.test.ts +1 -0
- package/src/core/network/api.ts +47 -12
- package/src/core/network/export-filename.ts +37 -0
- package/src/core/network/markdown-export.ts +19 -0
- package/src/core/network/requests-network.ts +29 -5
- package/src/core/network/types.ts +4 -0
- package/src/css/app/codemirror.css +11 -7
- package/src/css/globals.css +8 -0
- package/src/plugins/impl/DataEditorPlugin.tsx +2 -9
- package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +18 -0
- package/src/plugins/impl/chat/chat-ui.tsx +51 -3
- package/src/plugins/impl/data-frames/__tests__/schema.test.ts +30 -0
- package/src/plugins/impl/data-frames/schema.ts +4 -1
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +20 -1
- package/src/plugins/impl/image-comparison/__tests__/ImageComparisonComponent.test.tsx +58 -0
- package/src/stories/theme.stories.tsx +71 -1
- package/dist/_baseUniq-B_2Hw7zG.js +0 -380
- package/dist/apl-e1B5LPEL.js +0 -4
- package/dist/architecture-7HQA4BMR-DHUrQjL4.js +0 -6
- package/dist/asciiarmor-B-gwgesP.js +0 -4
- package/dist/asn1-DF2ckRB4.js +0 -4
- package/dist/assets/__vite-browser-external-DltVXDv7.js +0 -1
- package/dist/blockDiagram-VD42YOAC-CIOjvxeD.js +0 -3131
- package/dist/brainfuck-4G-7_gq_.js +0 -4
- package/dist/chat-ui-DsZJj75A.js +0 -8369
- package/dist/chunk-55IACEB6-7h71GwyW.js +0 -8
- package/dist/chunk-ABZYJK2D-BxBDji1u.js +0 -2438
- package/dist/chunk-BNovOVIE.js +0 -28
- package/dist/chunk-CVBHYZKI-CwazXVlJ.js +0 -13
- package/dist/chunk-DR5Q36YT-5Yp2GWwR.js +0 -137
- package/dist/chunk-EXTU4WIE-BQPBhApE.js +0 -10
- package/dist/chunk-JZLCHNYA-DWIR9m5O.js +0 -4901
- package/dist/chunk-N4CR4FBY-Bw2HcMNc.js +0 -65
- package/dist/chunk-QXUST7PY-DtC2t9Mk.js +0 -498
- package/dist/chunk-TCCFYFTB-DPWJa9zL.js +0 -13948
- package/dist/chunk-TZMSLE5B-BzSHcq-K.js +0 -63
- package/dist/classDiagram-2ON5EDUG-BiQPjMNY.js +0 -30
- package/dist/classDiagram-v2-WZHVMYZB-YHdR8fqM.js +0 -30
- package/dist/clojure-CUybM11R.js +0 -4
- package/dist/clone-Q4Fqwn6q.js +0 -9
- package/dist/cmake-BPjGcuDL.js +0 -4
- package/dist/cobol-BETk_nb6.js +0 -4
- package/dist/coffeescript-CManZxXL.js +0 -4
- package/dist/commonlisp-DWkn7GW8.js +0 -4
- package/dist/crystal-CCbg5EUH.js +0 -4
- package/dist/css-By8eo-XS.js +0 -4
- package/dist/cypher-DwfHg3nP.js +0 -4
- package/dist/d-Brs1wNbw.js +0 -4
- package/dist/dagre-6UL2VRFP-DpYjBqQs.js +0 -296
- package/dist/diagram-QEK2KX5R-DVlUOgs1.js +0 -228
- package/dist/diff-DJIRmJ1g.js +0 -4
- package/dist/dist-5o9uz19x.js +0 -5
- package/dist/dist-BpDH0DEP.js +0 -5
- package/dist/dist-BpXhbQXO.js +0 -8
- package/dist/dist-ByadAk_L.js +0 -5
- package/dist/dist-CK0g7JvP.js +0 -8
- package/dist/dist-CfzCtiq2.js +0 -5
- package/dist/dist-D8JtVFrW.js +0 -8
- package/dist/dist-DK2Oocpu.js +0 -6
- package/dist/dist-DnSu977r.js +0 -5
- package/dist/dist-UmxJm6sW.js +0 -8
- package/dist/dist-aYSBQSyM.js +0 -5
- package/dist/dist-kkZ1Ztlh.js +0 -6
- package/dist/dist-ngPczwNi.js +0 -5
- package/dist/dist-wQRyxyTV.js +0 -5
- package/dist/dtd-Dyiazv4N.js +0 -4
- package/dist/dylan-D8Fcw7NA.js +0 -4
- package/dist/ecl-CjKp8Vii.js +0 -4
- package/dist/eiffel-K9ViOX5r.js +0 -4
- package/dist/elm-B5NVtRco.js +0 -4
- package/dist/erlang-BnLzgk7R.js +0 -4
- package/dist/factor-C7f9Jz5R.js +0 -4
- package/dist/flatten-Bbw7g6-K.js +0 -8
- package/dist/forth-rGM8jLao.js +0 -4
- package/dist/fortran-B3acSe0i.js +0 -4
- package/dist/ganttDiagram-JELNMOA3-CXXCN7LN.js +0 -2170
- package/dist/gas-Bb1Vmv_N.js +0 -4
- package/dist/gherkin-C9Lyidgd.js +0 -4
- package/dist/gitGraphDiagram-V2S2FVAM-BOlkMSqK.js +0 -652
- package/dist/graphlib-Ns7y5crs.js +0 -359
- package/dist/groovy-DQk6XcGH.js +0 -4
- package/dist/hasIn-Deg7jl_j.js +0 -108
- package/dist/haskell-mV0Vw9gv.js +0 -4
- package/dist/haxe-DqxN89zH.js +0 -5
- package/dist/idl-ya8W561J.js +0 -4
- package/dist/infoDiagram-HS3SLOUP-D3TyKnL_.js +0 -30
- package/dist/javascript-CgqgptVu.js +0 -4
- package/dist/julia-CFQ-HusI.js +0 -4
- package/dist/livescript-D__3TmDo.js +0 -4
- package/dist/lua-Bytcgj_W.js +0 -4
- package/dist/main-B1Jo_8pC.js +0 -4321
- package/dist/mathematica-DJhvVKvl.js +0 -4
- package/dist/mbox-IGHPCjfR.js +0 -4
- package/dist/memoize-BOtf2yFf.js +0 -17
- package/dist/merge-Be1CqGnU.js +0 -222
- package/dist/mermaid-4DMBBIKO-FXbOziy9.js +0 -6
- package/dist/mermaid-hv6IckVw.js +0 -1100
- package/dist/mermaid-parser.core-DoivvxPd.js +0 -54
- package/dist/min-Dtgc8txR.js +0 -38
- package/dist/mirc-tcwvVugm.js +0 -4
- package/dist/mllike-Dx91i62r.js +0 -6
- package/dist/modelica-_SRt-yU5.js +0 -4
- package/dist/mscgen-GZrGS9gt.js +0 -6
- package/dist/mumps-Cv3ygyod.js +0 -4
- package/dist/nsis-BU7GeGbI.js +0 -4
- package/dist/ntriples-CL-FCYXb.js +0 -4
- package/dist/octave-Dc6_3DIu.js +0 -4
- package/dist/oz-DpUAJCXf.js +0 -4
- package/dist/pascal-B17mncXs.js +0 -4
- package/dist/perl-BTpK97q9.js +0 -4
- package/dist/pick-D1Qo8s2C.js +0 -43
- package/dist/pieDiagram-ADFJNKIX-JvXG_6hk.js +0 -170
- package/dist/pig-CFb638Ap.js +0 -4
- package/dist/powershell-Cxo-_2A5.js +0 -4
- package/dist/properties-BPgT1xTB.js +0 -4
- package/dist/protobuf-BgHBaIIK.js +0 -4
- package/dist/pug-25-oS0SG.js +0 -4
- package/dist/puppet-DarIr20S.js +0 -4
- package/dist/python-BqmOsBsi.js +0 -4
- package/dist/q-D3QJCTup.js +0 -4
- package/dist/r-Cz_yBX4z.js +0 -4
- package/dist/rpm-DGOtYwAI.js +0 -5
- package/dist/ruby-DBZu4rPc.js +0 -4
- package/dist/sankeyDiagram-TZEHDZUN-DgkF38jx.js +0 -892
- package/dist/sas-Dd1D9qTq.js +0 -4
- package/dist/scheme-BmDjvTHX.js +0 -4
- package/dist/sequenceDiagram-WL72ISMW-BDmx9n95.js +0 -3652
- package/dist/shell-BL8zFSaj.js +0 -4
- package/dist/sieve-BAx2WqUP.js +0 -4
- package/dist/smalltalk-CYRzF7VV.js +0 -4
- package/dist/sparql-YWaDRO4A.js +0 -4
- package/dist/stateDiagram-v2-4FDKWEC3-C3xqeavR.js +0 -29
- package/dist/stex-B5O-env2.js +0 -4
- package/dist/stylus-lYsyLFc1.js +0 -4
- package/dist/swift-ClQz9z1n.js +0 -4
- package/dist/tcl-B3jhsfqY.js +0 -4
- package/dist/textile-Cb1Dw7Aq.js +0 -4
- package/dist/timeline-definition-IT6M3QCI-CkD_trIn.js +0 -856
- package/dist/toml-nHZhetdO.js +0 -4
- package/dist/troff-DuJAGWKH.js +0 -4
- package/dist/ttcn-BxrcwP21.js +0 -4
- package/dist/ttcn-cfg-BAg_9dcc.js +0 -4
- package/dist/turtle-zCq949as.js +0 -4
- package/dist/vb-De5hElus.js +0 -4
- package/dist/vbscript-Cypcpv4F.js +0 -4
- package/dist/velocity-Di7l-yhe.js +0 -4
- package/dist/verilog-Bzi-S3g2.js +0 -4
- package/dist/vhdl-B0ZZITaW.js +0 -4
- package/dist/webidl-0sviiRcN.js +0 -4
- package/dist/xquery-B4qMVWaB.js +0 -4
- package/dist/yacas-Jt25Fuv8.js +0 -4
- package/dist/z80-CrcbYzmp.js +0 -4
- /package/dist/{apl-99A7dLQe.js → apl-CMUKiT2b.js} +0 -0
- /package/dist/{array-O78LT16Y.js → array-CEIRxyh3.js} +0 -0
- /package/dist/{asciiarmor-DLEhpFDx.js → asciiarmor-C_r6K6db.js} +0 -0
- /package/dist/{asn1-CMrcTsT4.js → asn1-DnlnCQTu.js} +0 -0
- /package/dist/{asterisk-CqykImq7.js → asterisk-DaVJJDnV.js} +0 -0
- /package/dist/{brainfuck-ChPt5yBe.js → brainfuck-CtQoQVkV.js} +0 -0
- /package/dist/{clike-CE0fXfM_.js → clike-CIAs0ABt.js} +0 -0
- /package/dist/{clojure-QkBEMU-g.js → clojure-C6tKQYjD.js} +0 -0
- /package/dist/{cmake-CU1jX7Mo.js → cmake-D-nfcg14.js} +0 -0
- /package/dist/{cobol-DMOKzzky.js → cobol-DYTC58p9.js} +0 -0
- /package/dist/{coffeescript-DjnjLyfk.js → coffeescript-DctDWA58.js} +0 -0
- /package/dist/{colors-DmiH1bIH.js → colors-DR_aHfmQ.js} +0 -0
- /package/dist/{common-keywords-D3nPJNQP.js → common-keywords-FBrXPTcz.js} +0 -0
- /package/dist/{commonlisp-CYd9iOSe.js → commonlisp-BmvTqU5y.js} +0 -0
- /package/dist/{crystal-Dy55yoYG.js → crystal-BPIK2UMa.js} +0 -0
- /package/dist/{css-CNU8w3HJ.js → css-CDo_Lwzn.js} +0 -0
- /package/dist/{cypher-q47DGzK7.js → cypher-KztbD63v.js} +0 -0
- /package/dist/{d-jEkaLvxX.js → d-HXBWOoe9.js} +0 -0
- /package/dist/{defaultLocale-DoeErsX2.js → defaultLocale-DMZFeDB8.js} +0 -0
- /package/dist/{diff-vb2-unFN.js → diff-B9rWZH0m.js} +0 -0
- /package/dist/{dtd-C9kR-bXa.js → dtd-LtAMP5y8.js} +0 -0
- /package/dist/{duckdb-keywords-B6HYCMOT.js → duckdb-keywords-CvJhR_Yd.js} +0 -0
- /package/dist/{dylan-BLckrK-V.js → dylan-DXMK92pf.js} +0 -0
- /package/dist/{ebnf-Cnp3L9jg.js → ebnf-2D4Ctp3y.js} +0 -0
- /package/dist/{ecl-CEsf6XVg.js → ecl-Dqq8ser2.js} +0 -0
- /package/dist/{eiffel-2KGZNzx6.js → eiffel-ChExWBDx.js} +0 -0
- /package/dist/{elm-D2s3K5wF.js → elm-BMBz2xbZ.js} +0 -0
- /package/dist/{emotion-is-prop-valid.esm-DdVSF4FD.js → emotion-is-prop-valid.esm-_z-EwK5u.js} +0 -0
- /package/dist/{erlang-0PMFOndk.js → erlang-CGSDzg9P.js} +0 -0
- /package/dist/{fcl-D9nccAWI.js → fcl-Ccj8Z5Xd.js} +0 -0
- /package/dist/{forth-DG89iUsu.js → forth-vTkfR0aY.js} +0 -0
- /package/dist/{fortran-ytKsAVvu.js → fortran-CF4LAVFn.js} +0 -0
- /package/dist/{gas-Cg2Fm0N2.js → gas-mMFbQ2x4.js} +0 -0
- /package/dist/{gherkin-B87FEnZ-.js → gherkin-DLS1q0XM.js} +0 -0
- /package/dist/{groovy-Dcs08AWD.js → groovy-Zt6CNPxV.js} +0 -0
- /package/dist/{haskell-cwkOuhx6.js → haskell-kVOgzpVy.js} +0 -0
- /package/dist/{haxe-DWEo4q10.js → haxe-Bo21F6gc.js} +0 -0
- /package/dist/{http-B8jdG64J.js → http-_DVAYWoR.js} +0 -0
- /package/dist/{idl-WWQwDcRV.js → idl-B865GSM-.js} +0 -0
- /package/dist/{init-DNBbYZd_.js → init-TaqZJsBY.js} +0 -0
- /package/dist/{invariant-wRzNXIsJ.js → invariant-hOqqBz8A.js} +0 -0
- /package/dist/{javascript-BeR74dxD.js → javascript-CSLuHpxZ.js} +0 -0
- /package/dist/{julia-UlvCUYGL.js → julia-BCOLeQif.js} +0 -0
- /package/dist/{livescript-GPmFcmYV.js → livescript-DqUzLZFs.js} +0 -0
- /package/dist/{lua-DYoT_0zM.js → lua-D0ciLwkO.js} +0 -0
- /package/dist/{math-CBNc2Ib0.js → math-CTnb-N1W.js} +0 -0
- /package/dist/{mathematica-DSFIQlbG.js → mathematica-DujD1RDf.js} +0 -0
- /package/dist/{mbox-ej8lFMdL.js → mbox-8OkSQMDn.js} +0 -0
- /package/dist/{mirc-CAdIdvHQ.js → mirc-D47x8yRQ.js} +0 -0
- /package/dist/{mllike-CjTB1lHF.js → mllike-Dcfw-g6D.js} +0 -0
- /package/dist/{modelica-BB68FYMa.js → modelica-BHtr9gKR.js} +0 -0
- /package/dist/{mscgen-BkbzgGGI.js → mscgen-uZedQc_A.js} +0 -0
- /package/dist/{mumps-Cu-28E9F.js → mumps-Bc9QS1-K.js} +0 -0
- /package/dist/{nginx-C1ofKPst.js → nginx-DasThI7R.js} +0 -0
- /package/dist/{ntriples-D9cQiZxZ.js → ntriples-Clpn9Mrg.js} +0 -0
- /package/dist/{objects-De59twF-.js → objects-UzwQd5gx.js} +0 -0
- /package/dist/{octave-BvtAnPX0.js → octave-DA2esRWi.js} +0 -0
- /package/dist/{oz-COaVHk2E.js → oz-D8i-brWx.js} +0 -0
- /package/dist/{pascal-BFpqVD2x.js → pascal-Dt1a0CeN.js} +0 -0
- /package/dist/{path-DwWbhZFI.js → path-7gr7eZmp.js} +0 -0
- /package/dist/{perl-DaiORxHP.js → perl-CXy9EfRp.js} +0 -0
- /package/dist/{pig-DFzRhmsF.js → pig-DnXnrjQg.js} +0 -0
- /package/dist/{powershell-BG2LQNKN.js → powershell-BYE6u-Qk.js} +0 -0
- /package/dist/{properties-CqJJR5QY.js → properties-DlhyusaK.js} +0 -0
- /package/dist/{protobuf-WwDYV1yY.js → protobuf-DoMSrsPi.js} +0 -0
- /package/dist/{puppet-QNY3w_uN.js → puppet-DGi4idFA.js} +0 -0
- /package/dist/{python-4QrQ3Ugi.js → python-CYhALYh0.js} +0 -0
- /package/dist/{q-DhwXuxE2.js → q-Cs_qWJkU.js} +0 -0
- /package/dist/{r-Df-nkR25.js → r-DWJSQl1c.js} +0 -0
- /package/dist/{range-BOiA8qqU.js → range-Bieq5MNc.js} +0 -0
- /package/dist/{rpm-Cokue07s.js → rpm-DIip1m0n.js} +0 -0
- /package/dist/{ruby-DrYcL3qF.js → ruby-NgZGoa7Q.js} +0 -0
- /package/dist/{sas-CoiPirA5.js → sas-DEKzCzM2.js} +0 -0
- /package/dist/{scheme-CwFLjzHv.js → scheme-CBrGar2n.js} +0 -0
- /package/dist/{semaphore-C8rmHdhj.js → semaphore-P832H4YT.js} +0 -0
- /package/dist/{shell-BFV-R24I.js → shell-D7XFPOM_.js} +0 -0
- /package/dist/{sieve-CxwXF5T9.js → sieve-BOxOVQ18.js} +0 -0
- /package/dist/{simple-mode-DTaJtKPt.js → simple-mode-D-FXBgPn.js} +0 -0
- /package/dist/{smalltalk-QivVOCtX.js → smalltalk-DYK-HkUK.js} +0 -0
- /package/dist/{solr-BLvysN-c.js → solr-RZ9uTl59.js} +0 -0
- /package/dist/{sparql-nKsFk8j7.js → sparql-CU1uk9Py.js} +0 -0
- /package/dist/{spreadsheet-BWc8C2FT.js → spreadsheet-BNNUNXA2.js} +0 -0
- /package/dist/{sql-CWfUjlV1.js → sql-B4x8IkwU.js} +0 -0
- /package/dist/{stex-DtMAhV4-.js → stex-DIvyJfNO.js} +0 -0
- /package/dist/{stylus-BLKQAycn.js → stylus-BokZhKWB.js} +0 -0
- /package/dist/{swift-CJoKqiKj.js → swift-TlA42tbT.js} +0 -0
- /package/dist/{tcl-YTeYFNUc.js → tcl-C-m7N_9k.js} +0 -0
- /package/dist/{textile-C6rKQqMQ.js → textile-BWOWG894.js} +0 -0
- /package/dist/{tiddlywiki-ZXwTHGNT.js → tiddlywiki-DI0mF2WJ.js} +0 -0
- /package/dist/{tiki-C628O_u4.js → tiki-2HU6XLLn.js} +0 -0
- /package/dist/{toml-DxlPGbRy.js → toml-GapOS-6U.js} +0 -0
- /package/dist/{treemap-DY3NBr79.js → treemap-CQJ0bIDy.js} +0 -0
- /package/dist/{troff-DFCfH7Ku.js → troff-ChPXSGgg.js} +0 -0
- /package/dist/{ttcn-DAW-ERVP.js → ttcn-CGf_ktUb.js} +0 -0
- /package/dist/{ttcn-cfg-CpJ8b7EN.js → ttcn-cfg-E0kw_vEm.js} +0 -0
- /package/dist/{turtle-BneV2f8L.js → turtle-DDIYttZr.js} +0 -0
- /package/dist/{vb-D973Vxxh.js → vb-DsGz8YA-.js} +0 -0
- /package/dist/{vbscript-Dckaq3YO.js → vbscript-BfQcpKZn.js} +0 -0
- /package/dist/{velocity-DKty-GUC.js → velocity-BMi53hPb.js} +0 -0
- /package/dist/{verilog-aNaK_biA.js → verilog-B_WDxmCB.js} +0 -0
- /package/dist/{vhdl-CQuehnQy.js → vhdl-C52-TT0z.js} +0 -0
- /package/dist/{webidl-Bhg8vaMr.js → webidl-Cnphjlul.js} +0 -0
- /package/dist/{xquery-D2q16GaM.js → xquery-X_kWyOft.js} +0 -0
- /package/dist/{yacas-DHGOHnNa.js → yacas-Dpp9zAZ5.js} +0 -0
- /package/dist/{z80-BPhTmO22.js → z80-BZLZAthF.js} +0 -0
|
@@ -0,0 +1,3762 @@
|
|
|
1
|
+
import { d as handleUndefinedAttr, i as calculateTextWidth, o as decodeEntities } from "./chunk-NSK5VX7P-BmmoJBbx.js";
|
|
2
|
+
import { n as log, t as select_default } from "./src-BwVZVGyf.js";
|
|
3
|
+
import { n as __name } from "./chunk-Y2CYZVJY-DX3DSigL.js";
|
|
4
|
+
import { A as hasKatex, B as sanitizeText3, M as parseGenericTypes, T as getEffectiveHtmlLabels, b as getConfig, g as evaluate, x as getConfig2, z as sanitizeText } from "./chunk-I66GZJ75-9xAsFrdW.js";
|
|
5
|
+
import { a as userNodeOverrides, i as styles2String, r as solidStateFill, t as compileStyles } from "./chunk-W5SLKNZC-DK-_KuKT.js";
|
|
6
|
+
import { n as getSubGraphTitleMargins, t as configureLabelImages } from "./chunk-UBXNYLIW-C8LueN5Q.js";
|
|
7
|
+
import { t as getIconSVG } from "./chunk-4I5QYGJK-CYJC3pkC.js";
|
|
8
|
+
import { n as createText } from "./chunk-WRU74C26-DLgw-V0j.js";
|
|
9
|
+
import { t as at } from "./rough.esm-lGyFQ0B-.js";
|
|
10
|
+
var labelHelper = /* @__PURE__ */ __name(async (a, s, l) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
let u, d = s.useHtmlLabels || evaluate((_a = getConfig2()) == null ? void 0 : _a.htmlLabels);
|
|
13
|
+
u = l || "node default";
|
|
14
|
+
let f = a.insert("g").attr("class", u).attr("id", s.domId || s.id), p = f.insert("g").attr("class", "label").attr("style", handleUndefinedAttr(s.labelStyle)), m;
|
|
15
|
+
m = s.label === void 0 ? "" : typeof s.label == "string" ? s.label : s.label[0];
|
|
16
|
+
let v = !!s.icon || !!s.img, y = s.labelType === "markdown", b = await createText(p, sanitizeText(decodeEntities(m), getConfig2()), {
|
|
17
|
+
useHtmlLabels: d,
|
|
18
|
+
width: s.width || ((_b = getConfig2().flowchart) == null ? void 0 : _b.wrappingWidth),
|
|
19
|
+
classes: y ? "markdown-node-label" : "",
|
|
20
|
+
style: s.labelStyle,
|
|
21
|
+
addSvgBackground: v,
|
|
22
|
+
markdown: y
|
|
23
|
+
}, getConfig2()), x = b.getBBox(), S = ((s == null ? void 0 : s.padding) ?? 0) / 2;
|
|
24
|
+
if (d) {
|
|
25
|
+
let e = b.children[0], a2 = select_default(b);
|
|
26
|
+
await configureLabelImages(e, m), x = e.getBoundingClientRect(), a2.attr("width", x.width), a2.attr("height", x.height);
|
|
27
|
+
}
|
|
28
|
+
return d ? p.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")") : p.attr("transform", "translate(0, " + -x.height / 2 + ")"), s.centerLabel && p.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), p.insert("rect", ":first-child"), {
|
|
29
|
+
shapeSvg: f,
|
|
30
|
+
bbox: x,
|
|
31
|
+
halfPadding: S,
|
|
32
|
+
label: p
|
|
33
|
+
};
|
|
34
|
+
}, "labelHelper"), insertLabel = /* @__PURE__ */ __name(async (e, a, s) => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
let l = s.useHtmlLabels ?? getEffectiveHtmlLabels(getConfig2()), u = e.insert("g").attr("class", "label").attr("style", s.labelStyle || ""), d = await createText(u, sanitizeText(decodeEntities(a), getConfig2()), {
|
|
37
|
+
useHtmlLabels: l,
|
|
38
|
+
width: s.width || ((_b = (_a = getConfig2()) == null ? void 0 : _a.flowchart) == null ? void 0 : _b.wrappingWidth),
|
|
39
|
+
style: s.labelStyle,
|
|
40
|
+
addSvgBackground: !!s.icon || !!s.img
|
|
41
|
+
}), f = d.getBBox(), m = s.padding / 2;
|
|
42
|
+
if (getEffectiveHtmlLabels(getConfig2())) {
|
|
43
|
+
let e2 = d.children[0], a2 = select_default(d);
|
|
44
|
+
f = e2.getBoundingClientRect(), a2.attr("width", f.width), a2.attr("height", f.height);
|
|
45
|
+
}
|
|
46
|
+
return l ? u.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")") : u.attr("transform", "translate(0, " + -f.height / 2 + ")"), s.centerLabel && u.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), u.insert("rect", ":first-child"), {
|
|
47
|
+
shapeSvg: e,
|
|
48
|
+
bbox: f,
|
|
49
|
+
halfPadding: m,
|
|
50
|
+
label: u
|
|
51
|
+
};
|
|
52
|
+
}, "insertLabel"), updateNodeBounds = /* @__PURE__ */ __name((e, a) => {
|
|
53
|
+
let o = a.node().getBBox();
|
|
54
|
+
e.width = o.width, e.height = o.height;
|
|
55
|
+
}, "updateNodeBounds"), getNodeClasses = /* @__PURE__ */ __name((e, a) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (a || ""), "getNodeClasses");
|
|
56
|
+
function createPathFromPoints(e) {
|
|
57
|
+
let a = e.map((e2, a2) => `${a2 === 0 ? "M" : "L"}${e2.x},${e2.y}`);
|
|
58
|
+
return a.push("Z"), a.join(" ");
|
|
59
|
+
}
|
|
60
|
+
__name(createPathFromPoints, "createPathFromPoints");
|
|
61
|
+
function generateFullSineWavePoints(e, a, o, s, c, l) {
|
|
62
|
+
let u = [], d = o - e, f = s - a, p = d / l, m = 2 * Math.PI / p, h = a + f / 2;
|
|
63
|
+
for (let a2 = 0; a2 <= 50; a2++) {
|
|
64
|
+
let o2 = e + a2 / 50 * d, s2 = h + c * Math.sin(m * (o2 - e));
|
|
65
|
+
u.push({
|
|
66
|
+
x: o2,
|
|
67
|
+
y: s2
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return u;
|
|
71
|
+
}
|
|
72
|
+
__name(generateFullSineWavePoints, "generateFullSineWavePoints");
|
|
73
|
+
function generateCirclePoints(e, a, o, s, c, l) {
|
|
74
|
+
let u = [], d = c * Math.PI / 180, f = (l * Math.PI / 180 - d) / (s - 1);
|
|
75
|
+
for (let c2 = 0; c2 < s; c2++) {
|
|
76
|
+
let s2 = d + c2 * f, l2 = e + o * Math.cos(s2), p = a + o * Math.sin(s2);
|
|
77
|
+
u.push({
|
|
78
|
+
x: -l2,
|
|
79
|
+
y: -p
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return u;
|
|
83
|
+
}
|
|
84
|
+
__name(generateCirclePoints, "generateCirclePoints");
|
|
85
|
+
function mergePaths(e) {
|
|
86
|
+
let a = Array.from(e.childNodes).filter((e2) => e2.tagName === "path"), o = document.createElementNS("http://www.w3.org/2000/svg", "path"), s = a.map((e2) => e2.getAttribute("d")).filter((e2) => e2 !== null).join(" ");
|
|
87
|
+
o.setAttribute("d", s);
|
|
88
|
+
let c = a.find((e2) => e2.getAttribute("fill") !== "none"), u = a.find((e2) => e2.getAttribute("stroke") !== "none"), d = /* @__PURE__ */ __name((e2, a2) => (e2 == null ? void 0 : e2.getAttribute(a2)) ?? void 0, "getAttr");
|
|
89
|
+
if (c) {
|
|
90
|
+
let e2 = {
|
|
91
|
+
fill: d(c, "fill"),
|
|
92
|
+
"fill-opacity": d(c, "fill-opacity") ?? "1"
|
|
93
|
+
};
|
|
94
|
+
Object.entries(e2).forEach(([e3, a2]) => {
|
|
95
|
+
a2 && o.setAttribute(e3, a2);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (u) {
|
|
99
|
+
let e2 = {
|
|
100
|
+
stroke: d(u, "stroke"),
|
|
101
|
+
"stroke-width": d(u, "stroke-width") ?? "1",
|
|
102
|
+
"stroke-opacity": d(u, "stroke-opacity") ?? "1"
|
|
103
|
+
};
|
|
104
|
+
Object.entries(e2).forEach(([e3, a2]) => {
|
|
105
|
+
a2 && o.setAttribute(e3, a2);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
let f = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
109
|
+
return f.appendChild(o), f;
|
|
110
|
+
}
|
|
111
|
+
__name(mergePaths, "mergePaths");
|
|
112
|
+
var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
|
|
113
|
+
var o = e.x, s = e.y, c = a.x - o, l = a.y - s, u = e.width / 2, d = e.height / 2, f, p;
|
|
114
|
+
return Math.abs(l) * u > Math.abs(c) * d ? (l < 0 && (d = -d), f = l === 0 ? 0 : d * c / l, p = d) : (c < 0 && (u = -u), f = u, p = c === 0 ? 0 : u * l / c), {
|
|
115
|
+
x: o + f,
|
|
116
|
+
y: s + p
|
|
117
|
+
};
|
|
118
|
+
}, "intersectRect"), createLabel_default = /* @__PURE__ */ __name(async (e, a, o, s = false, c = false) => {
|
|
119
|
+
let l = a || "";
|
|
120
|
+
typeof l == "object" && (l = l[0]);
|
|
121
|
+
let u = getConfig2(), d = getEffectiveHtmlLabels(u);
|
|
122
|
+
return await createText(e, l, {
|
|
123
|
+
style: o,
|
|
124
|
+
isTitle: s,
|
|
125
|
+
useHtmlLabels: d,
|
|
126
|
+
markdown: false,
|
|
127
|
+
isNode: c,
|
|
128
|
+
width: Infinity
|
|
129
|
+
}, u);
|
|
130
|
+
}, "createLabel"), createRoundedRectPathD = /* @__PURE__ */ __name((e, a, o, s, c) => [
|
|
131
|
+
"M",
|
|
132
|
+
e + c,
|
|
133
|
+
a,
|
|
134
|
+
"H",
|
|
135
|
+
e + o - c,
|
|
136
|
+
"A",
|
|
137
|
+
c,
|
|
138
|
+
c,
|
|
139
|
+
0,
|
|
140
|
+
0,
|
|
141
|
+
1,
|
|
142
|
+
e + o,
|
|
143
|
+
a + c,
|
|
144
|
+
"V",
|
|
145
|
+
a + s - c,
|
|
146
|
+
"A",
|
|
147
|
+
c,
|
|
148
|
+
c,
|
|
149
|
+
0,
|
|
150
|
+
0,
|
|
151
|
+
1,
|
|
152
|
+
e + o - c,
|
|
153
|
+
a + s,
|
|
154
|
+
"H",
|
|
155
|
+
e + c,
|
|
156
|
+
"A",
|
|
157
|
+
c,
|
|
158
|
+
c,
|
|
159
|
+
0,
|
|
160
|
+
0,
|
|
161
|
+
1,
|
|
162
|
+
e,
|
|
163
|
+
a + s - c,
|
|
164
|
+
"V",
|
|
165
|
+
a + c,
|
|
166
|
+
"A",
|
|
167
|
+
c,
|
|
168
|
+
c,
|
|
169
|
+
0,
|
|
170
|
+
0,
|
|
171
|
+
1,
|
|
172
|
+
e + c,
|
|
173
|
+
a,
|
|
174
|
+
"Z"
|
|
175
|
+
].join(" "), "createRoundedRectPathD"), swimlane = /* @__PURE__ */ __name(async (e, a) => {
|
|
176
|
+
let o = getConfig2(), { themeVariables: l, handDrawnSeed: u } = o, { clusterBkg: d, clusterBorder: f } = l, p = f, { labelStyles: m, nodeStyles: _, borderStyles: b, backgroundStyles: x } = styles2String(a), S = e.insert("g").attr("class", "cluster swimlane " + (a.cssClasses || "")).attr("id", a.id).attr("data-id", a.id).attr("data-et", "cluster").attr("data-look", a.look), C = evaluate(o.flowchart.htmlLabels), w = a.direction === "LR", E = S.insert("g").attr("class", "cluster-label swimlane-label"), D = await createText(E, a.label, {
|
|
177
|
+
style: a.labelStyle,
|
|
178
|
+
useHtmlLabels: C,
|
|
179
|
+
isNode: true,
|
|
180
|
+
width: a.width
|
|
181
|
+
}), O = D.getBBox();
|
|
182
|
+
if (C) {
|
|
183
|
+
let e2 = D.children[0], a2 = select_default(D);
|
|
184
|
+
O = e2.getBoundingClientRect(), a2.attr("width", O.width), a2.attr("height", O.height);
|
|
185
|
+
}
|
|
186
|
+
let k = a.padding ?? 0, A = a.width <= O.width + k ? O.width + k : a.width;
|
|
187
|
+
a.width <= O.width + k ? a.diff = (A - a.width) / 2 - k : a.diff = -k;
|
|
188
|
+
let j = a.height, M = a.y - j / 2, N = a.y + j / 2, F = a.x - A / 2, I = a.swimlaneContentTop === void 0 ? M + j / 3 : a.swimlaneContentTop, L = w ? 4 : 0, R = O.height + 2 * L, z, B;
|
|
189
|
+
if (w) {
|
|
190
|
+
let e2 = Math.max(R, O.height + 2 * L), o2 = F + e2, s = Math.max(0, A - e2);
|
|
191
|
+
if (a.look === "handDrawn") {
|
|
192
|
+
let c2 = at.svg(S), l3 = userNodeOverrides(a, {
|
|
193
|
+
roughness: 0.7,
|
|
194
|
+
fill: d,
|
|
195
|
+
stroke: p,
|
|
196
|
+
fillWeight: 3,
|
|
197
|
+
seed: u
|
|
198
|
+
}), f2 = userNodeOverrides(a, {
|
|
199
|
+
roughness: 0.7,
|
|
200
|
+
fill: "none",
|
|
201
|
+
stroke: p,
|
|
202
|
+
seed: u
|
|
203
|
+
}), m2 = c2.rectangle(F, M, e2, j, l3);
|
|
204
|
+
z = S.insert(() => m2, ":first-child");
|
|
205
|
+
let h = c2.rectangle(o2, M, s, j, f2);
|
|
206
|
+
B = S.insert(() => h, ":first-child"), z.select("path:nth-child(2)").attr("style", b.join(";")), z.select("path").attr("style", x.join(";").replace("fill", "stroke"));
|
|
207
|
+
} else z = S.insert("rect", ":first-child"), B = S.insert("rect", ":first-child"), z.attr("class", "swimlane-title").attr("style", _).attr("x", F).attr("y", M).attr("width", e2).attr("height", j).attr("fill", d).attr("stroke", p), B.attr("class", "swimlane-body").attr("style", _).attr("x", o2).attr("y", M).attr("width", s).attr("height", j).attr("fill", "none").attr("stroke", p);
|
|
208
|
+
let c = F + e2 / 2, l2 = a.y;
|
|
209
|
+
E.attr("transform", `translate(${c}, ${l2}) rotate(-90) translate(${-O.width / 2}, ${-O.height / 2})`);
|
|
210
|
+
} else {
|
|
211
|
+
let e2 = Math.max(0, I - M), o2 = Math.min(R, e2), s = M + o2, c = Math.max(0, N - s), l2 = a.x - A / 2;
|
|
212
|
+
if (a.look === "handDrawn") {
|
|
213
|
+
let e3 = at.svg(S), f3 = userNodeOverrides(a, {
|
|
214
|
+
roughness: 0.7,
|
|
215
|
+
fill: d,
|
|
216
|
+
stroke: p,
|
|
217
|
+
fillWeight: 3,
|
|
218
|
+
seed: u
|
|
219
|
+
}), m3 = userNodeOverrides(a, {
|
|
220
|
+
roughness: 0.7,
|
|
221
|
+
fill: "none",
|
|
222
|
+
stroke: p,
|
|
223
|
+
seed: u
|
|
224
|
+
}), h = e3.rectangle(l2, M, A, o2, f3);
|
|
225
|
+
z = S.insert(() => h, ":first-child");
|
|
226
|
+
let g = e3.rectangle(l2, s, A, c, m3);
|
|
227
|
+
B = S.insert(() => g, ":first-child"), z.select("path:nth-child(2)").attr("style", b.join(";")), z.select("path").attr("style", x.join(";").replace("fill", "stroke"));
|
|
228
|
+
} else z = S.insert("rect", ":first-child"), B = S.insert("rect", ":first-child"), z.attr("class", "swimlane-title").attr("style", _).attr("x", l2).attr("y", M).attr("width", A).attr("height", o2).attr("fill", d).attr("stroke", p), B.attr("class", "swimlane-body").attr("style", _).attr("x", l2).attr("y", s).attr("width", A).attr("height", c).attr("fill", "none").attr("stroke", p);
|
|
229
|
+
let f2 = a.x - O.width / 2, m2 = M + (o2 - O.height) / 2;
|
|
230
|
+
E.attr("transform", `translate(${f2}, ${m2})`);
|
|
231
|
+
}
|
|
232
|
+
if (log.trace("Swimlane data ", a, JSON.stringify(a)), m) {
|
|
233
|
+
let e2 = E.select("span");
|
|
234
|
+
e2 && e2.attr("style", m);
|
|
235
|
+
}
|
|
236
|
+
return a.offsetX = 0, a.width = A, a.height = j, a.offsetY = O.height - k / 2, a.intersect = function(e2) {
|
|
237
|
+
return intersect_rect_default(a, e2);
|
|
238
|
+
}, {
|
|
239
|
+
cluster: S,
|
|
240
|
+
labelBBox: O
|
|
241
|
+
};
|
|
242
|
+
}, "swimlane"), rect = /* @__PURE__ */ __name(async (e, a) => {
|
|
243
|
+
log.info("Creating subgraph rect for ", a.id, a);
|
|
244
|
+
let o = getConfig2(), { themeVariables: l, handDrawnSeed: u } = o, { clusterBkg: d, clusterBorder: f } = l, { labelStyles: m, nodeStyles: h, borderStyles: _, backgroundStyles: b } = styles2String(a), x = e.insert("g").attr("class", "cluster " + a.cssClasses).attr("id", a.domId).attr("data-look", a.look), C = getEffectiveHtmlLabels(o), w = x.insert("g").attr("class", "cluster-label "), E;
|
|
245
|
+
E = a.labelType === "markdown" ? await createText(w, a.label, {
|
|
246
|
+
style: a.labelStyle,
|
|
247
|
+
useHtmlLabels: C,
|
|
248
|
+
isNode: true,
|
|
249
|
+
width: a.width
|
|
250
|
+
}) : await createLabel_default(w, a.label, a.labelStyle || "", false, true);
|
|
251
|
+
let D = E.getBBox();
|
|
252
|
+
if (getEffectiveHtmlLabels(o)) {
|
|
253
|
+
let e2 = E.children[0], a2 = select_default(E);
|
|
254
|
+
D = e2.getBoundingClientRect(), a2.attr("width", D.width), a2.attr("height", D.height);
|
|
255
|
+
}
|
|
256
|
+
let O = a.width <= D.width + a.padding ? D.width + a.padding : a.width;
|
|
257
|
+
a.width <= D.width + a.padding ? a.diff = (O - a.width) / 2 - a.padding : a.diff = -a.padding;
|
|
258
|
+
let k = a.height, A = a.x - O / 2, j = a.y - k / 2;
|
|
259
|
+
log.trace("Data ", a, JSON.stringify(a));
|
|
260
|
+
let M;
|
|
261
|
+
if (a.look === "handDrawn") {
|
|
262
|
+
let e2 = at.svg(x), o2 = userNodeOverrides(a, {
|
|
263
|
+
roughness: 0.7,
|
|
264
|
+
fill: d,
|
|
265
|
+
stroke: f,
|
|
266
|
+
fillWeight: 3,
|
|
267
|
+
seed: u
|
|
268
|
+
}), c = e2.path(createRoundedRectPathD(A, j, O, k, 0), o2);
|
|
269
|
+
M = x.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child"), M.select("path:nth-child(2)").attr("style", _.join(";")), M.select("path").attr("style", b.join(";").replace("fill", "stroke"));
|
|
270
|
+
} else M = x.insert("rect", ":first-child"), M.attr("style", h).attr("rx", a.rx).attr("ry", a.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
|
|
271
|
+
let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(o);
|
|
272
|
+
if (w.attr("transform", `translate(${a.x - D.width / 2}, ${a.y - a.height / 2 + N})`), m) {
|
|
273
|
+
let e2 = w.select("span");
|
|
274
|
+
e2 && e2.attr("style", m);
|
|
275
|
+
}
|
|
276
|
+
let L = M.node().getBBox();
|
|
277
|
+
return a.offsetX = 0, a.width = L.width, a.height = L.height, a.offsetY = D.height - a.padding / 2, a.intersect = function(e2) {
|
|
278
|
+
return intersect_rect_default(a, e2);
|
|
279
|
+
}, {
|
|
280
|
+
cluster: x,
|
|
281
|
+
labelBBox: D
|
|
282
|
+
};
|
|
283
|
+
}, "rect"), shapes = {
|
|
284
|
+
rect,
|
|
285
|
+
squareRect: rect,
|
|
286
|
+
roundedWithTitle: /* @__PURE__ */ __name(async (e, a) => {
|
|
287
|
+
let o = getConfig2(), { themeVariables: s, handDrawnSeed: l } = o, { altBackground: u, compositeBackground: d, compositeTitleBackground: f, nodeBorder: m } = s, h = e.insert("g").attr("class", a.cssClasses).attr("id", a.domId).attr("data-id", a.id).attr("data-look", a.look), _ = h.insert("g", ":first-child"), v = h.insert("g").attr("class", "cluster-label"), y = h.append("rect"), b = await createLabel_default(v, a.label, a.labelStyle, void 0, true), x = b.getBBox();
|
|
288
|
+
if (getEffectiveHtmlLabels(o)) {
|
|
289
|
+
let e2 = b.children[0], a2 = select_default(b);
|
|
290
|
+
x = e2.getBoundingClientRect(), a2.attr("width", x.width), a2.attr("height", x.height);
|
|
291
|
+
}
|
|
292
|
+
let S = 0 * a.padding, C = S / 2, w = (a.width <= x.width + a.padding ? x.width + a.padding : a.width) + S;
|
|
293
|
+
a.width <= x.width + a.padding ? a.diff = (w - a.width) / 2 - a.padding : a.diff = -a.padding;
|
|
294
|
+
let T = a.height + S, E = a.height + S - x.height - 6, D = a.x - w / 2, O = a.y - T / 2;
|
|
295
|
+
a.width = w;
|
|
296
|
+
let k = a.y - a.height / 2 - C + x.height + 2, A;
|
|
297
|
+
if (a.look === "handDrawn") {
|
|
298
|
+
let e2 = a.cssClasses.includes("statediagram-cluster-alt"), o2 = at.svg(h), s2 = a.rx || a.ry ? o2.path(createRoundedRectPathD(D, O, w, T, 10), {
|
|
299
|
+
roughness: 0.7,
|
|
300
|
+
fill: f,
|
|
301
|
+
fillStyle: "solid",
|
|
302
|
+
stroke: m,
|
|
303
|
+
seed: l
|
|
304
|
+
}) : o2.rectangle(D, O, w, T, { seed: l });
|
|
305
|
+
A = h.insert(() => s2, ":first-child");
|
|
306
|
+
let c = o2.rectangle(D, k, w, E, {
|
|
307
|
+
fill: e2 ? u : d,
|
|
308
|
+
fillStyle: e2 ? "hachure" : "solid",
|
|
309
|
+
stroke: m,
|
|
310
|
+
seed: l
|
|
311
|
+
});
|
|
312
|
+
A = h.insert(() => s2, ":first-child"), y = h.insert(() => c);
|
|
313
|
+
} else A = _.insert("rect", ":first-child"), A.attr("class", "outer").attr("x", D).attr("y", O).attr("width", w).attr("height", T).attr("data-look", a.look), y.attr("class", "inner").attr("x", D).attr("y", k).attr("width", w).attr("height", E);
|
|
314
|
+
return v.attr("transform", `translate(${a.x - x.width / 2}, ${O + 1 - (getEffectiveHtmlLabels(o) ? 0 : 3)})`), a.height = A.node().getBBox().height, a.offsetX = 0, a.offsetY = x.height - a.padding / 2, a.labelBBox = x, a.intersect = function(e2) {
|
|
315
|
+
return intersect_rect_default(a, e2);
|
|
316
|
+
}, {
|
|
317
|
+
cluster: h,
|
|
318
|
+
labelBBox: x
|
|
319
|
+
};
|
|
320
|
+
}, "roundedWithTitle"),
|
|
321
|
+
noteGroup: /* @__PURE__ */ __name((e, a) => {
|
|
322
|
+
let o = e.insert("g").attr("class", "note-cluster").attr("id", a.domId), s = o.insert("rect", ":first-child"), c = 0 * a.padding, l = c / 2;
|
|
323
|
+
s.attr("rx", a.rx).attr("ry", a.ry).attr("x", a.x - a.width / 2 - l).attr("y", a.y - a.height / 2 - l).attr("width", a.width + c).attr("height", a.height + c).attr("fill", "none");
|
|
324
|
+
let u = s.node().getBBox();
|
|
325
|
+
return a.width = u.width, a.height = u.height, a.intersect = function(e2) {
|
|
326
|
+
return intersect_rect_default(a, e2);
|
|
327
|
+
}, {
|
|
328
|
+
cluster: o,
|
|
329
|
+
labelBBox: {
|
|
330
|
+
width: 0,
|
|
331
|
+
height: 0
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
}, "noteGroup"),
|
|
335
|
+
divider: /* @__PURE__ */ __name((e, a) => {
|
|
336
|
+
let { themeVariables: o, handDrawnSeed: s } = getConfig2(), { nodeBorder: c } = o, l = e.insert("g").attr("class", a.cssClasses).attr("id", a.domId).attr("data-look", a.look), u = l.insert("g", ":first-child"), d = 0 * a.padding, f = a.width + d;
|
|
337
|
+
a.diff = -a.padding;
|
|
338
|
+
let p = a.height + d, m = a.x - f / 2, h = a.y - p / 2;
|
|
339
|
+
a.width = f;
|
|
340
|
+
let _;
|
|
341
|
+
if (a.look === "handDrawn") {
|
|
342
|
+
let e2 = at.svg(l).rectangle(m, h, f, p, {
|
|
343
|
+
fill: "lightgrey",
|
|
344
|
+
roughness: 0.5,
|
|
345
|
+
strokeLineDash: [5],
|
|
346
|
+
stroke: c,
|
|
347
|
+
seed: s
|
|
348
|
+
});
|
|
349
|
+
_ = l.insert(() => e2, ":first-child");
|
|
350
|
+
} else {
|
|
351
|
+
_ = u.insert("rect", ":first-child");
|
|
352
|
+
let e2 = "outer";
|
|
353
|
+
e2 = (a.look, "divider"), _.attr("class", e2).attr("x", m).attr("y", h).attr("width", f).attr("height", p).attr("data-look", a.look);
|
|
354
|
+
}
|
|
355
|
+
return a.height = _.node().getBBox().height, a.offsetX = 0, a.offsetY = 0, a.intersect = function(e2) {
|
|
356
|
+
return intersect_rect_default(a, e2);
|
|
357
|
+
}, {
|
|
358
|
+
cluster: l,
|
|
359
|
+
labelBBox: {}
|
|
360
|
+
};
|
|
361
|
+
}, "divider"),
|
|
362
|
+
kanbanSection: /* @__PURE__ */ __name(async (e, a) => {
|
|
363
|
+
log.info("Creating subgraph rect for ", a.id, a);
|
|
364
|
+
let o = getConfig2(), { themeVariables: l, handDrawnSeed: u } = o, { clusterBkg: d, clusterBorder: f } = l, { labelStyles: m, nodeStyles: h, borderStyles: _, backgroundStyles: b } = styles2String(a), x = e.insert("g").attr("class", "cluster " + a.cssClasses).attr("id", a.domId).attr("data-look", a.look), C = getEffectiveHtmlLabels(o), w = x.insert("g").attr("class", "cluster-label "), E = await createText(w, a.label, {
|
|
365
|
+
style: a.labelStyle,
|
|
366
|
+
useHtmlLabels: C,
|
|
367
|
+
isNode: true,
|
|
368
|
+
width: a.width
|
|
369
|
+
}), D = E.getBBox();
|
|
370
|
+
if (getEffectiveHtmlLabels(o)) {
|
|
371
|
+
let e2 = E.children[0], a2 = select_default(E);
|
|
372
|
+
D = e2.getBoundingClientRect(), a2.attr("width", D.width), a2.attr("height", D.height);
|
|
373
|
+
}
|
|
374
|
+
let O = a.width <= D.width + a.padding ? D.width + a.padding : a.width;
|
|
375
|
+
a.width <= D.width + a.padding ? a.diff = (O - a.width) / 2 - a.padding : a.diff = -a.padding;
|
|
376
|
+
let k = a.height, A = a.x - O / 2, j = a.y - k / 2;
|
|
377
|
+
log.trace("Data ", a, JSON.stringify(a));
|
|
378
|
+
let M;
|
|
379
|
+
if (a.look === "handDrawn") {
|
|
380
|
+
let e2 = at.svg(x), o2 = userNodeOverrides(a, {
|
|
381
|
+
roughness: 0.7,
|
|
382
|
+
fill: d,
|
|
383
|
+
stroke: f,
|
|
384
|
+
fillWeight: 4,
|
|
385
|
+
seed: u
|
|
386
|
+
}), c = e2.path(createRoundedRectPathD(A, j, O, k, a.rx), o2);
|
|
387
|
+
M = x.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child"), M.select("path:nth-child(2)").attr("style", _.join(";")), M.select("path").attr("style", b.join(";").replace("fill", "stroke"));
|
|
388
|
+
} else M = x.insert("rect", ":first-child"), M.attr("style", h).attr("rx", a.rx).attr("ry", a.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
|
|
389
|
+
let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(o);
|
|
390
|
+
if (w.attr("transform", `translate(${a.x - D.width / 2}, ${a.y - a.height / 2 + N})`), m) {
|
|
391
|
+
let e2 = w.select("span");
|
|
392
|
+
e2 && e2.attr("style", m);
|
|
393
|
+
}
|
|
394
|
+
let F = M.node().getBBox();
|
|
395
|
+
return a.offsetX = 0, a.width = F.width, a.height = F.height, a.offsetY = D.height - a.padding / 2, a.intersect = function(e2) {
|
|
396
|
+
return intersect_rect_default(a, e2);
|
|
397
|
+
}, {
|
|
398
|
+
cluster: x,
|
|
399
|
+
labelBBox: D
|
|
400
|
+
};
|
|
401
|
+
}, "kanbanSection"),
|
|
402
|
+
swimlane
|
|
403
|
+
}, clusterElems = /* @__PURE__ */ new Map(), insertCluster = /* @__PURE__ */ __name(async (e, a) => {
|
|
404
|
+
let o = await shapes[a.shape || "rect"](e, a);
|
|
405
|
+
return clusterElems.set(a.id, o), o;
|
|
406
|
+
}, "insertCluster"), clear = /* @__PURE__ */ __name(() => {
|
|
407
|
+
clusterElems = /* @__PURE__ */ new Map();
|
|
408
|
+
}, "clear");
|
|
409
|
+
function intersectNode(e, a) {
|
|
410
|
+
return e.intersect(a);
|
|
411
|
+
}
|
|
412
|
+
__name(intersectNode, "intersectNode");
|
|
413
|
+
var intersect_node_default = intersectNode;
|
|
414
|
+
function intersectEllipse(e, a, o, s) {
|
|
415
|
+
var c = e.x, l = e.y, u = c - s.x, d = l - s.y, f = Math.sqrt(a * a * d * d + o * o * u * u), p = Math.abs(a * o * u / f);
|
|
416
|
+
s.x < c && (p = -p);
|
|
417
|
+
var m = Math.abs(a * o * d / f);
|
|
418
|
+
return s.y < l && (m = -m), {
|
|
419
|
+
x: c + p,
|
|
420
|
+
y: l + m
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
__name(intersectEllipse, "intersectEllipse");
|
|
424
|
+
var intersect_ellipse_default = intersectEllipse;
|
|
425
|
+
function intersectCircle(e, a, o) {
|
|
426
|
+
return intersect_ellipse_default(e, a, a, o);
|
|
427
|
+
}
|
|
428
|
+
__name(intersectCircle, "intersectCircle");
|
|
429
|
+
var intersect_circle_default = intersectCircle;
|
|
430
|
+
function intersectLine(e, a, o, s) {
|
|
431
|
+
{
|
|
432
|
+
let c = a.y - e.y, l = e.x - a.x, u = a.x * e.y - e.x * a.y, d = c * o.x + l * o.y + u, f = c * s.x + l * s.y + u, p = 1e-6;
|
|
433
|
+
if (d !== 0 && f !== 0 && sameSign(d, f)) return;
|
|
434
|
+
let m = s.y - o.y, h = o.x - s.x, g = s.x * o.y - o.x * s.y, _ = m * e.x + h * e.y + g, v = m * a.x + h * a.y + g;
|
|
435
|
+
if (Math.abs(_) < p && Math.abs(v) < p && sameSign(_, v)) return;
|
|
436
|
+
let y = c * h - m * l;
|
|
437
|
+
if (y === 0) return;
|
|
438
|
+
let b = Math.abs(y / 2), x = l * g - h * u, S = x < 0 ? (x - b) / y : (x + b) / y;
|
|
439
|
+
return x = m * u - c * g, {
|
|
440
|
+
x: S,
|
|
441
|
+
y: x < 0 ? (x - b) / y : (x + b) / y
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
__name(intersectLine, "intersectLine");
|
|
446
|
+
function sameSign(e, a) {
|
|
447
|
+
return e * a > 0;
|
|
448
|
+
}
|
|
449
|
+
__name(sameSign, "sameSign");
|
|
450
|
+
var intersect_line_default = intersectLine;
|
|
451
|
+
function intersectPolygon(e, a, o) {
|
|
452
|
+
let s = e.x, c = e.y, l = [], u = Infinity, d = Infinity;
|
|
453
|
+
typeof a.forEach == "function" ? a.forEach(function(e2) {
|
|
454
|
+
u = Math.min(u, e2.x), d = Math.min(d, e2.y);
|
|
455
|
+
}) : (u = Math.min(u, a.x), d = Math.min(d, a.y));
|
|
456
|
+
let f = s - e.width / 2 - u, p = c - e.height / 2 - d;
|
|
457
|
+
for (let s2 = 0; s2 < a.length; s2++) {
|
|
458
|
+
let c2 = a[s2], u2 = a[s2 < a.length - 1 ? s2 + 1 : 0], d2 = intersect_line_default(e, o, {
|
|
459
|
+
x: f + c2.x,
|
|
460
|
+
y: p + c2.y
|
|
461
|
+
}, {
|
|
462
|
+
x: f + u2.x,
|
|
463
|
+
y: p + u2.y
|
|
464
|
+
});
|
|
465
|
+
d2 && l.push(d2);
|
|
466
|
+
}
|
|
467
|
+
return l.length ? (l.length > 1 && l.sort(function(e2, a2) {
|
|
468
|
+
let s2 = e2.x - o.x, c2 = e2.y - o.y, l2 = Math.sqrt(s2 * s2 + c2 * c2), u2 = a2.x - o.x, d2 = a2.y - o.y, f2 = Math.sqrt(u2 * u2 + d2 * d2);
|
|
469
|
+
return l2 < f2 ? -1 : l2 === f2 ? 0 : 1;
|
|
470
|
+
}), l[0]) : e;
|
|
471
|
+
}
|
|
472
|
+
__name(intersectPolygon, "intersectPolygon");
|
|
473
|
+
var intersect_default = {
|
|
474
|
+
node: intersect_node_default,
|
|
475
|
+
circle: intersect_circle_default,
|
|
476
|
+
ellipse: intersect_ellipse_default,
|
|
477
|
+
polygon: intersectPolygon,
|
|
478
|
+
rect: intersect_rect_default
|
|
479
|
+
};
|
|
480
|
+
function anchor(a, o) {
|
|
481
|
+
let { labelStyles: c } = styles2String(o);
|
|
482
|
+
o.labelStyle = c;
|
|
483
|
+
let l = getNodeClasses(o), u = l;
|
|
484
|
+
l || (u = "anchor");
|
|
485
|
+
let d = a.insert("g").attr("class", u).attr("id", o.domId || o.id), { cssStyles: f } = o, p = at.svg(d), m = userNodeOverrides(o, {
|
|
486
|
+
fill: "black",
|
|
487
|
+
stroke: "none",
|
|
488
|
+
fillStyle: "solid"
|
|
489
|
+
});
|
|
490
|
+
o.look !== "handDrawn" && (m.roughness = 0);
|
|
491
|
+
let h = p.circle(0, 0, 2, m), g = d.insert(() => h, ":first-child");
|
|
492
|
+
return g.attr("class", "anchor").attr("style", handleUndefinedAttr(f)), updateNodeBounds(o, g), o.intersect = function(e) {
|
|
493
|
+
return log.info("Circle intersect", o, 1, e), intersect_default.circle(o, 1, e);
|
|
494
|
+
}, d;
|
|
495
|
+
}
|
|
496
|
+
__name(anchor, "anchor");
|
|
497
|
+
function generateArcPoints(e, a, o, s, c, l, u) {
|
|
498
|
+
let d = (e + o) / 2, f = (a + s) / 2, p = Math.atan2(s - a, o - e), m = (o - e) / 2, h = (s - a) / 2, g = m / c, _ = h / l, v = Math.sqrt(g ** 2 + _ ** 2);
|
|
499
|
+
if (v > 1) throw Error("The given radii are too small to create an arc between the points.");
|
|
500
|
+
let y = Math.sqrt(1 - v ** 2), b = d + y * l * Math.sin(p) * (u ? -1 : 1), x = f - y * c * Math.cos(p) * (u ? -1 : 1), S = Math.atan2((a - x) / l, (e - b) / c), C = Math.atan2((s - x) / l, (o - b) / c) - S;
|
|
501
|
+
u && C < 0 && (C += 2 * Math.PI), !u && C > 0 && (C -= 2 * Math.PI);
|
|
502
|
+
let w = [];
|
|
503
|
+
for (let e2 = 0; e2 < 20; e2++) {
|
|
504
|
+
let a2 = S + e2 / 19 * C, o2 = b + c * Math.cos(a2), s2 = x + l * Math.sin(a2);
|
|
505
|
+
w.push({
|
|
506
|
+
x: o2,
|
|
507
|
+
y: s2
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
return w;
|
|
511
|
+
}
|
|
512
|
+
__name(generateArcPoints, "generateArcPoints");
|
|
513
|
+
function calculateArcSagitta(e, a, o) {
|
|
514
|
+
let [s, c] = [a, o].sort((e2, a2) => a2 - e2);
|
|
515
|
+
return c * (1 - Math.sqrt(1 - (e / s / 2) ** 2));
|
|
516
|
+
}
|
|
517
|
+
__name(calculateArcSagitta, "calculateArcSagitta");
|
|
518
|
+
async function bowTieRect(e, a) {
|
|
519
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
520
|
+
a.labelStyle = o;
|
|
521
|
+
let c = a.padding ?? 0, u = a.look === "neo" ? 16 : c, d = a.look === "neo" ? 12 : c, f = /* @__PURE__ */ __name((e2) => e2 + d, "calcTotalHeight"), p = /* @__PURE__ */ __name((e2) => {
|
|
522
|
+
let a2 = e2 / 2;
|
|
523
|
+
return [a2 / (2.5 + e2 / 50), a2];
|
|
524
|
+
}, "calcEllipseRadius"), { shapeSvg: m, bbox: h } = await labelHelper(e, a, getNodeClasses(a)), g = f((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : h.height), [_, b] = p(g), x = calculateArcSagitta(g, _, b), S = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : h.width) + u * 2 + x - x, C = g, { cssStyles: w } = a, T = [
|
|
525
|
+
{
|
|
526
|
+
x: S / 2,
|
|
527
|
+
y: -C / 2
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
x: -S / 2,
|
|
531
|
+
y: -C / 2
|
|
532
|
+
},
|
|
533
|
+
...generateArcPoints(-S / 2, -C / 2, -S / 2, C / 2, _, b, false),
|
|
534
|
+
{
|
|
535
|
+
x: S / 2,
|
|
536
|
+
y: C / 2
|
|
537
|
+
},
|
|
538
|
+
...generateArcPoints(S / 2, C / 2, S / 2, -C / 2, _, b, true)
|
|
539
|
+
], D = at.svg(m), j = userNodeOverrides(a, {});
|
|
540
|
+
a.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid");
|
|
541
|
+
let M = createPathFromPoints(T), N = D.path(M, j), P = m.insert(() => N, ":first-child");
|
|
542
|
+
return P.attr("class", "basic label-container outer-path"), w && a.look !== "handDrawn" && P.selectAll("path").attr("style", w), s && a.look !== "handDrawn" && P.selectAll("path").attr("style", s), P.attr("transform", `translate(${_ / 2}, 0)`), updateNodeBounds(a, P), a.intersect = function(e2) {
|
|
543
|
+
return intersect_default.polygon(a, T, e2);
|
|
544
|
+
}, m;
|
|
545
|
+
}
|
|
546
|
+
__name(bowTieRect, "bowTieRect");
|
|
547
|
+
function insertPolygonShape(e, a, o, s) {
|
|
548
|
+
return e.insert("polygon", ":first-child").attr("points", s.map(function(e2) {
|
|
549
|
+
return e2.x + "," + e2.y;
|
|
550
|
+
}).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -a / 2 + "," + o / 2 + ")");
|
|
551
|
+
}
|
|
552
|
+
__name(insertPolygonShape, "insertPolygonShape");
|
|
553
|
+
var NOTCH_SIZE = 12;
|
|
554
|
+
async function card(e, a) {
|
|
555
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
556
|
+
a.labelStyle = o;
|
|
557
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 28 : c, u = a.look === "neo" ? 24 : c, { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.width) ?? f.width) + (a.look === "neo" ? l * 2 : l + NOTCH_SIZE), m = ((a == null ? void 0 : a.height) ?? f.height) + (a.look === "neo" ? u * 2 : u), h = p, g = -m, _ = [
|
|
558
|
+
{
|
|
559
|
+
x: 0 + NOTCH_SIZE,
|
|
560
|
+
y: g
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
x: h,
|
|
564
|
+
y: g
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
x: h,
|
|
568
|
+
y: 0
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
x: 0,
|
|
572
|
+
y: 0
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
x: 0,
|
|
576
|
+
y: g + NOTCH_SIZE
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
x: 0 + NOTCH_SIZE,
|
|
580
|
+
y: g
|
|
581
|
+
}
|
|
582
|
+
], b, { cssStyles: x } = a;
|
|
583
|
+
if (a.look === "handDrawn") {
|
|
584
|
+
let e2 = at.svg(d), o2 = userNodeOverrides(a, {}), s2 = createPathFromPoints(_), c2 = e2.path(s2, o2);
|
|
585
|
+
b = d.insert(() => c2, ":first-child").attr("transform", `translate(${-p / 2}, ${m / 2})`), x && b.attr("style", x);
|
|
586
|
+
} else b = insertPolygonShape(d, p, m, _);
|
|
587
|
+
return s && b.attr("style", s), updateNodeBounds(a, b), a.intersect = function(e2) {
|
|
588
|
+
return intersect_default.polygon(a, _, e2);
|
|
589
|
+
}, d;
|
|
590
|
+
}
|
|
591
|
+
__name(card, "card");
|
|
592
|
+
function choice(e, a) {
|
|
593
|
+
let { nodeStyles: o } = styles2String(a);
|
|
594
|
+
a.label = "";
|
|
595
|
+
let s = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), { cssStyles: c } = a, l = Math.max(28, a.width ?? 0), u = [
|
|
596
|
+
{
|
|
597
|
+
x: 0,
|
|
598
|
+
y: l / 2
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
x: l / 2,
|
|
602
|
+
y: 0
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
x: 0,
|
|
606
|
+
y: -l / 2
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
x: -l / 2,
|
|
610
|
+
y: 0
|
|
611
|
+
}
|
|
612
|
+
], d = at.svg(s), f = userNodeOverrides(a, {});
|
|
613
|
+
a.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
|
|
614
|
+
let p = createPathFromPoints(u), m = d.path(p, f), h = s.insert(() => m, ":first-child");
|
|
615
|
+
return c && a.look !== "handDrawn" && h.selectAll("path").attr("style", c), o && a.look !== "handDrawn" && h.selectAll("path").attr("style", o), a.width = 28, a.height = 28, a.intersect = function(e2) {
|
|
616
|
+
return intersect_default.polygon(a, u, e2);
|
|
617
|
+
}, s;
|
|
618
|
+
}
|
|
619
|
+
__name(choice, "choice");
|
|
620
|
+
async function circle(a, o, c) {
|
|
621
|
+
let { labelStyles: l, nodeStyles: u } = styles2String(o);
|
|
622
|
+
o.labelStyle = l;
|
|
623
|
+
let { shapeSvg: d, bbox: f, halfPadding: p } = await labelHelper(a, o, getNodeClasses(o)), m = (c == null ? void 0 : c.padding) ?? p, h = o.look === "neo" ? f.width / 2 + 32 : f.width / 2 + m, g, { cssStyles: _ } = o;
|
|
624
|
+
if (o.look === "handDrawn") {
|
|
625
|
+
let a2 = at.svg(d), s = userNodeOverrides(o, {}), c2 = a2.circle(0, 0, h * 2, s);
|
|
626
|
+
g = d.insert(() => c2, ":first-child"), g.attr("class", "basic label-container").attr("style", handleUndefinedAttr(_));
|
|
627
|
+
} else g = d.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", u).attr("r", h).attr("cx", 0).attr("cy", 0);
|
|
628
|
+
return updateNodeBounds(o, g), o.calcIntersect = function(e, a2) {
|
|
629
|
+
let o2 = e.width / 2;
|
|
630
|
+
return intersect_default.circle(e, o2, a2);
|
|
631
|
+
}, o.intersect = function(e) {
|
|
632
|
+
return log.info("Circle intersect", o, h, e), intersect_default.circle(o, h, e);
|
|
633
|
+
}, d;
|
|
634
|
+
}
|
|
635
|
+
__name(circle, "circle");
|
|
636
|
+
function createLine(e) {
|
|
637
|
+
let a = Math.cos(Math.PI / 4), o = Math.sin(Math.PI / 4), s = e * 2, c = {
|
|
638
|
+
x: s / 2 * a,
|
|
639
|
+
y: s / 2 * o
|
|
640
|
+
}, l = {
|
|
641
|
+
x: -(s / 2) * a,
|
|
642
|
+
y: s / 2 * o
|
|
643
|
+
}, u = {
|
|
644
|
+
x: -(s / 2) * a,
|
|
645
|
+
y: -(s / 2) * o
|
|
646
|
+
}, d = {
|
|
647
|
+
x: s / 2 * a,
|
|
648
|
+
y: -(s / 2) * o
|
|
649
|
+
};
|
|
650
|
+
return `M ${l.x},${l.y} L ${d.x},${d.y}
|
|
651
|
+
M ${c.x},${c.y} L ${u.x},${u.y}`;
|
|
652
|
+
}
|
|
653
|
+
__name(createLine, "createLine");
|
|
654
|
+
function crossedCircle(e, a) {
|
|
655
|
+
let { labelStyles: o, nodeStyles: c } = styles2String(a);
|
|
656
|
+
a.labelStyle = o, a.label = "";
|
|
657
|
+
let l = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), u = Math.max(30, (a == null ? void 0 : a.width) ?? 0), { cssStyles: d } = a, f = at.svg(l), p = userNodeOverrides(a, {});
|
|
658
|
+
a.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
659
|
+
let m = f.circle(0, 0, u * 2, p), h = createLine(u), g = f.path(h, p), _ = l.insert(() => m, ":first-child");
|
|
660
|
+
return _.insert(() => g), _.attr("class", "outer-path"), d && a.look !== "handDrawn" && _.selectAll("path").attr("style", d), c && a.look !== "handDrawn" && _.selectAll("path").attr("style", c), updateNodeBounds(a, _), a.intersect = function(e2) {
|
|
661
|
+
return log.info("crossedCircle intersect", a, {
|
|
662
|
+
radius: u,
|
|
663
|
+
point: e2
|
|
664
|
+
}), intersect_default.circle(a, u, e2);
|
|
665
|
+
}, l;
|
|
666
|
+
}
|
|
667
|
+
__name(crossedCircle, "crossedCircle");
|
|
668
|
+
function generateCirclePoints2(e, a, o, s = 100, c = 0, l = 180) {
|
|
669
|
+
let u = [], d = c * Math.PI / 180, f = (l * Math.PI / 180 - d) / (s - 1);
|
|
670
|
+
for (let c2 = 0; c2 < s; c2++) {
|
|
671
|
+
let s2 = d + c2 * f, l2 = e + o * Math.cos(s2), p = a + o * Math.sin(s2);
|
|
672
|
+
u.push({
|
|
673
|
+
x: -l2,
|
|
674
|
+
y: -p
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
return u;
|
|
678
|
+
}
|
|
679
|
+
__name(generateCirclePoints2, "generateCirclePoints");
|
|
680
|
+
async function curlyBraceLeft(e, a) {
|
|
681
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
682
|
+
a.labelStyle = o;
|
|
683
|
+
let { shapeSvg: c, bbox: l, label: u } = await labelHelper(e, a, getNodeClasses(a)), d = a.look === "neo" ? 18 : a.padding ?? 0, f = a.look === "neo" ? 12 : a.padding ?? 0, p = l.width + d, m = l.height + f, h = Math.max(5, m * 0.1), { cssStyles: g } = a, _ = [
|
|
684
|
+
...generateCirclePoints2(p / 2, -m / 2, h, 30, -90, 0),
|
|
685
|
+
{
|
|
686
|
+
x: -p / 2 - h,
|
|
687
|
+
y: h
|
|
688
|
+
},
|
|
689
|
+
...generateCirclePoints2(p / 2 + h * 2, -h, h, 20, -180, -270),
|
|
690
|
+
...generateCirclePoints2(p / 2 + h * 2, h, h, 20, -90, -180),
|
|
691
|
+
{
|
|
692
|
+
x: -p / 2 - h,
|
|
693
|
+
y: -m / 2
|
|
694
|
+
},
|
|
695
|
+
...generateCirclePoints2(p / 2, m / 2, h, 20, 0, 90)
|
|
696
|
+
], b = [
|
|
697
|
+
{
|
|
698
|
+
x: p / 2,
|
|
699
|
+
y: -m / 2 - h
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
x: -p / 2,
|
|
703
|
+
y: -m / 2 - h
|
|
704
|
+
},
|
|
705
|
+
...generateCirclePoints2(p / 2, -m / 2, h, 20, -90, 0),
|
|
706
|
+
{
|
|
707
|
+
x: -p / 2 - h,
|
|
708
|
+
y: -h
|
|
709
|
+
},
|
|
710
|
+
...generateCirclePoints2(p / 2 + p * 0.1, -h, h, 20, -180, -270),
|
|
711
|
+
...generateCirclePoints2(p / 2 + p * 0.1, h, h, 20, -90, -180),
|
|
712
|
+
{
|
|
713
|
+
x: -p / 2 - h,
|
|
714
|
+
y: m / 2
|
|
715
|
+
},
|
|
716
|
+
...generateCirclePoints2(p / 2, m / 2, h, 20, 0, 90),
|
|
717
|
+
{
|
|
718
|
+
x: -p / 2,
|
|
719
|
+
y: m / 2 + h
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
x: p / 2,
|
|
723
|
+
y: m / 2 + h
|
|
724
|
+
}
|
|
725
|
+
], x = at.svg(c), S = userNodeOverrides(a, { fill: "none" });
|
|
726
|
+
a.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
|
|
727
|
+
let C = createPathFromPoints(_).replace("Z", ""), w = x.path(C, S), T = createPathFromPoints(b), D = x.path(T, { ...S }), j = c.insert("g", ":first-child");
|
|
728
|
+
return j.insert(() => D, ":first-child").attr("stroke-opacity", 0), j.insert(() => w, ":first-child"), j.attr("class", "text"), g && a.look !== "handDrawn" && j.selectAll("path").attr("style", g), s && a.look !== "handDrawn" && j.selectAll("path").attr("style", s), j.attr("transform", `translate(${h}, 0)`), u.attr("transform", `translate(${-p / 2 + h - (l.x - (l.left ?? 0))},${-m / 2 + (a.padding ?? 0) / 2 - (l.y - (l.top ?? 0))})`), updateNodeBounds(a, j), a.intersect = function(e2) {
|
|
729
|
+
return intersect_default.polygon(a, b, e2);
|
|
730
|
+
}, c;
|
|
731
|
+
}
|
|
732
|
+
__name(curlyBraceLeft, "curlyBraceLeft");
|
|
733
|
+
function generateCirclePoints3(e, a, o, s = 100, c = 0, l = 180) {
|
|
734
|
+
let u = [], d = c * Math.PI / 180, f = (l * Math.PI / 180 - d) / (s - 1);
|
|
735
|
+
for (let c2 = 0; c2 < s; c2++) {
|
|
736
|
+
let s2 = d + c2 * f, l2 = e + o * Math.cos(s2), p = a + o * Math.sin(s2);
|
|
737
|
+
u.push({
|
|
738
|
+
x: l2,
|
|
739
|
+
y: p
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
return u;
|
|
743
|
+
}
|
|
744
|
+
__name(generateCirclePoints3, "generateCirclePoints");
|
|
745
|
+
async function curlyBraceRight(e, a) {
|
|
746
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
747
|
+
a.labelStyle = o;
|
|
748
|
+
let { shapeSvg: c, bbox: l, label: u } = await labelHelper(e, a, getNodeClasses(a)), d = a.look === "neo" ? 18 : a.padding ?? 0, f = a.look === "neo" ? 12 : a.padding ?? 0, p = l.width + (a.look === "neo" ? d * 2 : d), m = l.height + (a.look === "neo" ? f * 2 : f), h = Math.max(5, m * 0.1), { cssStyles: g } = a, _ = [
|
|
749
|
+
...generateCirclePoints3(p / 2, -m / 2, h, 20, -90, 0),
|
|
750
|
+
{
|
|
751
|
+
x: p / 2 + h,
|
|
752
|
+
y: -h
|
|
753
|
+
},
|
|
754
|
+
...generateCirclePoints3(p / 2 + h * 2, -h, h, 20, -180, -270),
|
|
755
|
+
...generateCirclePoints3(p / 2 + h * 2, h, h, 20, -90, -180),
|
|
756
|
+
{
|
|
757
|
+
x: p / 2 + h,
|
|
758
|
+
y: m / 2
|
|
759
|
+
},
|
|
760
|
+
...generateCirclePoints3(p / 2, m / 2, h, 20, 0, 90)
|
|
761
|
+
], b = [
|
|
762
|
+
{
|
|
763
|
+
x: -p / 2,
|
|
764
|
+
y: -m / 2 - h
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
x: p / 2,
|
|
768
|
+
y: -m / 2 - h
|
|
769
|
+
},
|
|
770
|
+
...generateCirclePoints3(p / 2, -m / 2, h, 20, -90, 0),
|
|
771
|
+
{
|
|
772
|
+
x: p / 2 + h,
|
|
773
|
+
y: -h
|
|
774
|
+
},
|
|
775
|
+
...generateCirclePoints3(p / 2 + h * 2, -h, h, 20, -180, -270),
|
|
776
|
+
...generateCirclePoints3(p / 2 + h * 2, h, h, 20, -90, -180),
|
|
777
|
+
{
|
|
778
|
+
x: p / 2 + h,
|
|
779
|
+
y: m / 2
|
|
780
|
+
},
|
|
781
|
+
...generateCirclePoints3(p / 2, m / 2, h, 20, 0, 90),
|
|
782
|
+
{
|
|
783
|
+
x: p / 2,
|
|
784
|
+
y: m / 2 + h
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
x: -p / 2,
|
|
788
|
+
y: m / 2 + h
|
|
789
|
+
}
|
|
790
|
+
], x = at.svg(c), S = userNodeOverrides(a, { fill: "none" });
|
|
791
|
+
a.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
|
|
792
|
+
let C = createPathFromPoints(_).replace("Z", ""), w = x.path(C, S), T = createPathFromPoints(b), D = x.path(T, { ...S }), j = c.insert("g", ":first-child");
|
|
793
|
+
return j.insert(() => D, ":first-child").attr("stroke-opacity", 0), j.insert(() => w, ":first-child"), j.attr("class", "text"), g && a.look !== "handDrawn" && j.selectAll("path").attr("style", g), s && a.look !== "handDrawn" && j.selectAll("path").attr("style", s), j.attr("transform", `translate(${-h}, 0)`), u.attr("transform", `translate(${-p / 2 + (a.padding ?? 0) / 2 - (l.x - (l.left ?? 0))},${-m / 2 + (a.padding ?? 0) / 2 - (l.y - (l.top ?? 0))})`), updateNodeBounds(a, j), a.intersect = function(e2) {
|
|
794
|
+
return intersect_default.polygon(a, b, e2);
|
|
795
|
+
}, c;
|
|
796
|
+
}
|
|
797
|
+
__name(curlyBraceRight, "curlyBraceRight");
|
|
798
|
+
function generateCirclePoints4(e, a, o, s = 100, c = 0, l = 180) {
|
|
799
|
+
let u = [], d = c * Math.PI / 180, f = (l * Math.PI / 180 - d) / (s - 1);
|
|
800
|
+
for (let c2 = 0; c2 < s; c2++) {
|
|
801
|
+
let s2 = d + c2 * f, l2 = e + o * Math.cos(s2), p = a + o * Math.sin(s2);
|
|
802
|
+
u.push({
|
|
803
|
+
x: -l2,
|
|
804
|
+
y: -p
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
return u;
|
|
808
|
+
}
|
|
809
|
+
__name(generateCirclePoints4, "generateCirclePoints");
|
|
810
|
+
async function curlyBraces(e, a) {
|
|
811
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
812
|
+
a.labelStyle = o;
|
|
813
|
+
let { shapeSvg: c, bbox: l, label: u } = await labelHelper(e, a, getNodeClasses(a)), d = a.look === "neo" ? 18 : a.padding ?? 0, f = a.look === "neo" ? 12 : a.padding ?? 0, p = l.width + (a.look === "neo" ? d * 2 : d), m = l.height + (a.look === "neo" ? f * 2 : f), h = Math.max(5, m * 0.1), { cssStyles: g } = a, _ = [
|
|
814
|
+
...generateCirclePoints4(p / 2, -m / 2, h, 30, -90, 0),
|
|
815
|
+
{
|
|
816
|
+
x: -p / 2 - h,
|
|
817
|
+
y: h
|
|
818
|
+
},
|
|
819
|
+
...generateCirclePoints4(p / 2 + h * 2, -h, h, 20, -180, -270),
|
|
820
|
+
...generateCirclePoints4(p / 2 + h * 2, h, h, 20, -90, -180),
|
|
821
|
+
{
|
|
822
|
+
x: -p / 2 - h,
|
|
823
|
+
y: -m / 2
|
|
824
|
+
},
|
|
825
|
+
...generateCirclePoints4(p / 2, m / 2, h, 20, 0, 90)
|
|
826
|
+
], b = [
|
|
827
|
+
...generateCirclePoints4(-p / 2 + h + h / 2, -m / 2, h, 20, -90, -180),
|
|
828
|
+
{
|
|
829
|
+
x: p / 2 - h / 2,
|
|
830
|
+
y: h
|
|
831
|
+
},
|
|
832
|
+
...generateCirclePoints4(-p / 2 - h / 2, -h, h, 20, 0, 90),
|
|
833
|
+
...generateCirclePoints4(-p / 2 - h / 2, h, h, 20, -90, 0),
|
|
834
|
+
{
|
|
835
|
+
x: p / 2 - h / 2,
|
|
836
|
+
y: -h
|
|
837
|
+
},
|
|
838
|
+
...generateCirclePoints4(-p / 2 + h + h / 2, m / 2, h, 30, -180, -270)
|
|
839
|
+
], x = [
|
|
840
|
+
{
|
|
841
|
+
x: p / 2,
|
|
842
|
+
y: -m / 2 - h
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
x: -p / 2,
|
|
846
|
+
y: -m / 2 - h
|
|
847
|
+
},
|
|
848
|
+
...generateCirclePoints4(p / 2, -m / 2, h, 20, -90, 0),
|
|
849
|
+
{
|
|
850
|
+
x: -p / 2 - h,
|
|
851
|
+
y: -h
|
|
852
|
+
},
|
|
853
|
+
...generateCirclePoints4(p / 2 + h * 2, -h, h, 20, -180, -270),
|
|
854
|
+
...generateCirclePoints4(p / 2 + h * 2, h, h, 20, -90, -180),
|
|
855
|
+
{
|
|
856
|
+
x: -p / 2 - h,
|
|
857
|
+
y: m / 2
|
|
858
|
+
},
|
|
859
|
+
...generateCirclePoints4(p / 2, m / 2, h, 20, 0, 90),
|
|
860
|
+
{
|
|
861
|
+
x: -p / 2,
|
|
862
|
+
y: m / 2 + h
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
x: p / 2 - h - h / 2,
|
|
866
|
+
y: m / 2 + h
|
|
867
|
+
},
|
|
868
|
+
...generateCirclePoints4(-p / 2 + h + h / 2, -m / 2, h, 20, -90, -180),
|
|
869
|
+
{
|
|
870
|
+
x: p / 2 - h / 2,
|
|
871
|
+
y: h
|
|
872
|
+
},
|
|
873
|
+
...generateCirclePoints4(-p / 2 - h / 2, -h, h, 20, 0, 90),
|
|
874
|
+
...generateCirclePoints4(-p / 2 - h / 2, h, h, 20, -90, 0),
|
|
875
|
+
{
|
|
876
|
+
x: p / 2 - h / 2,
|
|
877
|
+
y: -h
|
|
878
|
+
},
|
|
879
|
+
...generateCirclePoints4(-p / 2 + h + h / 2, m / 2, h, 30, -180, -270)
|
|
880
|
+
], S = at.svg(c), C = userNodeOverrides(a, { fill: "none" });
|
|
881
|
+
a.look !== "handDrawn" && (C.roughness = 0, C.fillStyle = "solid");
|
|
882
|
+
let w = createPathFromPoints(_).replace("Z", ""), T = S.path(w, C), D = createPathFromPoints(b).replace("Z", ""), j = S.path(D, C), M = createPathFromPoints(x), N = S.path(M, { ...C }), P = c.insert("g", ":first-child");
|
|
883
|
+
return P.insert(() => N, ":first-child").attr("stroke-opacity", 0), P.insert(() => T, ":first-child"), P.insert(() => j, ":first-child"), P.attr("class", "text"), g && a.look !== "handDrawn" && P.selectAll("path").attr("style", g), s && a.look !== "handDrawn" && P.selectAll("path").attr("style", s), P.attr("transform", `translate(${h - h / 4}, 0)`), u.attr("transform", `translate(${-p / 2 + (a.padding ?? 0) / 2 - (l.x - (l.left ?? 0))},${-m / 2 + (a.padding ?? 0) / 2 - (l.y - (l.top ?? 0))})`), updateNodeBounds(a, P), a.intersect = function(e2) {
|
|
884
|
+
return intersect_default.polygon(a, x, e2);
|
|
885
|
+
}, c;
|
|
886
|
+
}
|
|
887
|
+
__name(curlyBraces, "curlyBraces");
|
|
888
|
+
async function curvedTrapezoid(e, a) {
|
|
889
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
890
|
+
a.labelStyle = o;
|
|
891
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 16 : c, u = a.look === "neo" ? 12 : c, { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = Math.max(20, (f.width + l * 2) * 1.25, (a == null ? void 0 : a.width) ?? 0), m = Math.max(5, f.height + u * 2, (a == null ? void 0 : a.height) ?? 0), h = m / 2, { cssStyles: g } = a, _ = at.svg(d), b = userNodeOverrides(a, {});
|
|
892
|
+
a.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
|
|
893
|
+
let x = p, S = m, C = x - h, w = S / 4, T = [
|
|
894
|
+
{
|
|
895
|
+
x: C,
|
|
896
|
+
y: 0
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
x: w,
|
|
900
|
+
y: 0
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
x: 0,
|
|
904
|
+
y: S / 2
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
x: w,
|
|
908
|
+
y: S
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
x: C,
|
|
912
|
+
y: S
|
|
913
|
+
},
|
|
914
|
+
...generateCirclePoints(-C, -S / 2, h, 50, 270, 90)
|
|
915
|
+
], D = createPathFromPoints(T), j = _.path(D, b), N = d.insert(() => j, ":first-child");
|
|
916
|
+
return N.attr("class", "basic label-container outer-path"), g && a.look !== "handDrawn" && N.selectChildren("path").attr("style", g), s && a.look !== "handDrawn" && N.selectChildren("path").attr("style", s), N.attr("transform", `translate(${-p / 2}, ${-m / 2})`), updateNodeBounds(a, N), a.intersect = function(e2) {
|
|
917
|
+
return intersect_default.polygon(a, T, e2);
|
|
918
|
+
}, d;
|
|
919
|
+
}
|
|
920
|
+
__name(curvedTrapezoid, "curvedTrapezoid");
|
|
921
|
+
var createCylinderPathD = /* @__PURE__ */ __name((e, a, o, s, c, l) => [
|
|
922
|
+
`M${e},${a + l}`,
|
|
923
|
+
`a${c},${l} 0,0,0 ${o},0`,
|
|
924
|
+
`a${c},${l} 0,0,0 ${-o},0`,
|
|
925
|
+
`l0,${s}`,
|
|
926
|
+
`a${c},${l} 0,0,0 ${o},0`,
|
|
927
|
+
`l0,${-s}`
|
|
928
|
+
].join(" "), "createCylinderPathD"), createOuterCylinderPathD = /* @__PURE__ */ __name((e, a, o, s, c, l) => [
|
|
929
|
+
`M${e},${a + l}`,
|
|
930
|
+
`M${e + o},${a + l}`,
|
|
931
|
+
`a${c},${l} 0,0,0 ${-o},0`,
|
|
932
|
+
`l0,${s}`,
|
|
933
|
+
`a${c},${l} 0,0,0 ${o},0`,
|
|
934
|
+
`l0,${-s}`
|
|
935
|
+
].join(" "), "createOuterCylinderPathD"), createInnerCylinderPathD = /* @__PURE__ */ __name((e, a, o, s, c, l) => [`M${e - o / 2},${-s / 2}`, `a${c},${l} 0,0,0 ${o},0`].join(" "), "createInnerCylinderPathD"), MIN_HEIGHT = 8, MIN_WIDTH = 8;
|
|
936
|
+
async function cylinder(a, o) {
|
|
937
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(o);
|
|
938
|
+
o.labelStyle = s;
|
|
939
|
+
let l = o.padding ?? 0, u = o.look === "neo" ? 24 : l, d = o.look === "neo" ? 24 : l;
|
|
940
|
+
if (o.width || o.height) {
|
|
941
|
+
let e = o.width ?? 0;
|
|
942
|
+
o.width = (o.width ?? 0) - d, o.width < MIN_WIDTH && (o.width = MIN_WIDTH);
|
|
943
|
+
let a2 = e / 2 / (2.5 + e / 50);
|
|
944
|
+
o.height = (o.height ?? 0) - u - a2 * 3, o.height < MIN_HEIGHT && (o.height = MIN_HEIGHT);
|
|
945
|
+
}
|
|
946
|
+
let { shapeSvg: f, bbox: p, label: m } = await labelHelper(a, o, getNodeClasses(o)), h = (o.width ? o.width : p.width) + d, g = h / 2, _ = g / (2.5 + h / 50), b = (o.height ? o.height : p.height) + u + _, x, { cssStyles: S } = o;
|
|
947
|
+
if (o.look === "handDrawn") {
|
|
948
|
+
let e = at.svg(f), a2 = createOuterCylinderPathD(0, 0, h, b, g, _), s2 = createInnerCylinderPathD(0, _, h, b, g, _), c2 = userNodeOverrides(o, {}), l2 = e.path(a2, c2), u2 = e.path(s2, userNodeOverrides(o, { fill: "none" }));
|
|
949
|
+
x = f.insert(() => u2, ":first-child"), x = f.insert(() => l2, ":first-child"), x.attr("class", "basic label-container"), S && x.attr("style", S);
|
|
950
|
+
} else {
|
|
951
|
+
let a2 = createCylinderPathD(0, 0, h, b, g, _);
|
|
952
|
+
x = f.insert("path", ":first-child").attr("d", a2).attr("class", "basic label-container outer-path").attr("style", handleUndefinedAttr(S)).attr("style", c);
|
|
953
|
+
}
|
|
954
|
+
return x.attr("label-offset-y", _), x.attr("transform", `translate(${-h / 2}, ${-(b / 2 + _)})`), updateNodeBounds(o, x), m.attr("transform", `translate(${-(p.width / 2) - (p.x - (p.left ?? 0))}, ${-(p.height / 2) + (o.padding ?? 0) / 1.5 - (p.y - (p.top ?? 0))})`), o.intersect = function(e) {
|
|
955
|
+
let a2 = intersect_default.rect(o, e), s2 = a2.x - (o.x ?? 0);
|
|
956
|
+
if (g != 0 && (Math.abs(s2) < (o.width ?? 0) / 2 || Math.abs(s2) == (o.width ?? 0) / 2 && Math.abs(a2.y - (o.y ?? 0)) > (o.height ?? 0) / 2 - _)) {
|
|
957
|
+
let c2 = _ * _ * (1 - s2 * s2 / (g * g));
|
|
958
|
+
c2 > 0 && (c2 = Math.sqrt(c2)), c2 = _ - c2, e.y - (o.y ?? 0) > 0 && (c2 = -c2), a2.y += c2;
|
|
959
|
+
}
|
|
960
|
+
return a2;
|
|
961
|
+
}, f;
|
|
962
|
+
}
|
|
963
|
+
__name(cylinder, "cylinder");
|
|
964
|
+
async function drawRect(a, o, s) {
|
|
965
|
+
let { labelStyles: c, nodeStyles: l } = styles2String(o);
|
|
966
|
+
o.labelStyle = c;
|
|
967
|
+
let { shapeSvg: u, bbox: d } = await labelHelper(a, o, getNodeClasses(o)), f = Math.max(d.width + s.labelPaddingX * 2, (o == null ? void 0 : o.width) || 0), p = Math.max(d.height + s.labelPaddingY * 2, (o == null ? void 0 : o.height) || 0), m = -f / 2, h = -p / 2, g, { rx: _, ry: b } = o, { cssStyles: x } = o;
|
|
968
|
+
if ((s == null ? void 0 : s.rx) && s.ry && (_ = s.rx, b = s.ry), o.look === "handDrawn") {
|
|
969
|
+
let a2 = at.svg(u), s2 = userNodeOverrides(o, {}), c2 = _ || b ? a2.path(createRoundedRectPathD(m, h, f, p, _ || 0), s2) : a2.rectangle(m, h, f, p, s2);
|
|
970
|
+
g = u.insert(() => c2, ":first-child"), g.attr("class", "basic label-container").attr("style", handleUndefinedAttr(x));
|
|
971
|
+
} else g = u.insert("rect", ":first-child"), g.attr("class", "basic label-container").attr("style", l).attr("rx", handleUndefinedAttr(_)).attr("ry", handleUndefinedAttr(b)).attr("x", m).attr("y", h).attr("width", f).attr("height", p);
|
|
972
|
+
return updateNodeBounds(o, g), o.calcIntersect = function(e, a2) {
|
|
973
|
+
return intersect_default.rect(e, a2);
|
|
974
|
+
}, o.intersect = function(e) {
|
|
975
|
+
return intersect_default.rect(o, e);
|
|
976
|
+
}, u;
|
|
977
|
+
}
|
|
978
|
+
__name(drawRect, "drawRect");
|
|
979
|
+
async function datastore(e, a) {
|
|
980
|
+
let { cssClasses: o, labelPaddingX: s, labelPaddingY: c, padding: l, width: u, height: d } = a, f = await drawRect(e, a, {
|
|
981
|
+
rx: 0,
|
|
982
|
+
ry: 0,
|
|
983
|
+
classes: o ?? "",
|
|
984
|
+
labelPaddingX: s ?? (l ?? 0) * 2,
|
|
985
|
+
labelPaddingY: c ?? l ?? 0
|
|
986
|
+
});
|
|
987
|
+
if (a.look === "handDrawn") {
|
|
988
|
+
let e2 = at.svg(f), o2 = userNodeOverrides(a, {}), s2 = f.select(".basic.label-container > path:nth-child(2)"), c2 = s2.node();
|
|
989
|
+
if (!c2) return f;
|
|
990
|
+
let l2 = null;
|
|
991
|
+
if (c2 instanceof SVGGraphicsElement) l2 = c2.getBBox();
|
|
992
|
+
else return f;
|
|
993
|
+
return f.insert(() => e2.line(l2.x, l2.y, l2.x + l2.width, l2.y, o2), ".basic.label-container g.label"), f.insert(() => e2.line(l2.x, l2.y + l2.height, l2.x + l2.width, l2.y + l2.height, o2), ".basic.label-container g.label"), s2.remove(), f;
|
|
994
|
+
}
|
|
995
|
+
let p = f.select(".basic.label-container"), m = (Number(p.attr("width")) || u) ?? 0, h = (Number(p.attr("height")) || d) ?? 0;
|
|
996
|
+
return m > 0 && h > 0 && p.attr("stroke-dasharray", `${m} ${h}`), f;
|
|
997
|
+
}
|
|
998
|
+
__name(datastore, "datastore");
|
|
999
|
+
async function dividedRectangle(e, a) {
|
|
1000
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
1001
|
+
a.labelStyle = o;
|
|
1002
|
+
let c = a.look === "neo" ? 16 : a.padding ?? 0, l = a.look === "neo" ? 16 : a.padding ?? 0, { shapeSvg: u, bbox: d, label: f } = await labelHelper(e, a, getNodeClasses(a)), p = d.width + c, m = d.height + l, h = m * 0.2, g = -p / 2, _ = -m / 2 - h / 2, { cssStyles: b } = a, x = at.svg(u), S = userNodeOverrides(a, {});
|
|
1003
|
+
a.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
|
|
1004
|
+
let C = [
|
|
1005
|
+
{
|
|
1006
|
+
x: g,
|
|
1007
|
+
y: _ + h
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
x: -g,
|
|
1011
|
+
y: _ + h
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
x: -g,
|
|
1015
|
+
y: -_
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
x: g,
|
|
1019
|
+
y: -_
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
x: g,
|
|
1023
|
+
y: _
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
x: -g,
|
|
1027
|
+
y: _
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
x: -g,
|
|
1031
|
+
y: _ + h
|
|
1032
|
+
}
|
|
1033
|
+
], w = x.polygon(C.map((e2) => [e2.x, e2.y]), S), T = u.insert(() => w, ":first-child");
|
|
1034
|
+
return T.attr("class", "basic label-container outer-path"), b && a.look !== "handDrawn" && T.selectAll("path").attr("style", b), s && a.look !== "handDrawn" && T.selectAll("path").attr("style", s), f.attr("transform", `translate(${g + (a.padding ?? 0) / 2 - (d.x - (d.left ?? 0))}, ${_ + h + (a.padding ?? 0) / 2 - (d.y - (d.top ?? 0))})`), updateNodeBounds(a, T), a.intersect = function(e2) {
|
|
1035
|
+
return intersect_default.rect(a, e2);
|
|
1036
|
+
}, u;
|
|
1037
|
+
}
|
|
1038
|
+
__name(dividedRectangle, "dividedRectangle");
|
|
1039
|
+
async function doublecircle(a, o) {
|
|
1040
|
+
var _a, _b;
|
|
1041
|
+
let { labelStyles: c, nodeStyles: l } = styles2String(o), u = o.look === "neo" ? 12 : 5;
|
|
1042
|
+
o.labelStyle = c;
|
|
1043
|
+
let d = o.padding ?? 0, f = o.look === "neo" ? 16 : d, { shapeSvg: p, bbox: m } = await labelHelper(a, o, getNodeClasses(o)), h = ((o == null ? void 0 : o.width) ? (o == null ? void 0 : o.width) / 2 : m.width / 2) + (f ?? 0), g = h - u, _, { cssStyles: b } = o;
|
|
1044
|
+
if (o.look === "handDrawn") {
|
|
1045
|
+
let a2 = at.svg(p), s = userNodeOverrides(o, {
|
|
1046
|
+
roughness: 0.2,
|
|
1047
|
+
strokeWidth: 2.5
|
|
1048
|
+
}), c2 = userNodeOverrides(o, {
|
|
1049
|
+
roughness: 0.2,
|
|
1050
|
+
strokeWidth: 1.5
|
|
1051
|
+
}), l2 = a2.circle(0, 0, h * 2, s), u2 = a2.circle(0, 0, g * 2, c2);
|
|
1052
|
+
_ = p.insert("g", ":first-child"), _.attr("class", handleUndefinedAttr(o.cssClasses)).attr("style", handleUndefinedAttr(b)), (_a = _.node()) == null ? void 0 : _a.appendChild(l2), (_b = _.node()) == null ? void 0 : _b.appendChild(u2);
|
|
1053
|
+
} else {
|
|
1054
|
+
_ = p.insert("g", ":first-child");
|
|
1055
|
+
let e = _.insert("circle", ":first-child"), a2 = _.insert("circle");
|
|
1056
|
+
_.attr("class", "basic label-container").attr("style", l), e.attr("class", "outer-circle").attr("style", l).attr("r", h).attr("cx", 0).attr("cy", 0), a2.attr("class", "inner-circle").attr("style", l).attr("r", g).attr("cx", 0).attr("cy", 0);
|
|
1057
|
+
}
|
|
1058
|
+
return updateNodeBounds(o, _), o.intersect = function(e) {
|
|
1059
|
+
return log.info("DoubleCircle intersect", o, h, e), intersect_default.circle(o, h, e);
|
|
1060
|
+
}, p;
|
|
1061
|
+
}
|
|
1062
|
+
__name(doublecircle, "doublecircle");
|
|
1063
|
+
function filledCircle(e, a, { config: { themeVariables: o } }) {
|
|
1064
|
+
let { labelStyles: c, nodeStyles: l } = styles2String(a);
|
|
1065
|
+
a.label = "", a.labelStyle = c;
|
|
1066
|
+
let u = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), { cssStyles: d } = a, f = at.svg(u), { nodeBorder: p } = o, m = userNodeOverrides(a, { fillStyle: "solid" });
|
|
1067
|
+
a.look !== "handDrawn" && (m.roughness = 0);
|
|
1068
|
+
let h = f.circle(0, 0, 14, m), g = u.insert(() => h, ":first-child");
|
|
1069
|
+
return g.selectAll("path").attr("style", `fill: ${p} !important;`), d && d.length > 0 && a.look !== "handDrawn" && g.selectAll("path").attr("style", d), l && a.look !== "handDrawn" && g.selectAll("path").attr("style", l), updateNodeBounds(a, g), a.intersect = function(e2) {
|
|
1070
|
+
return log.info("filledCircle intersect", a, {
|
|
1071
|
+
radius: 7,
|
|
1072
|
+
point: e2
|
|
1073
|
+
}), intersect_default.circle(a, 7, e2);
|
|
1074
|
+
}, u;
|
|
1075
|
+
}
|
|
1076
|
+
__name(filledCircle, "filledCircle");
|
|
1077
|
+
var MIN_HEIGHT2 = 10, MIN_WIDTH2 = 10;
|
|
1078
|
+
async function flippedTriangle(e, a) {
|
|
1079
|
+
let { labelStyles: o, nodeStyles: c } = styles2String(a);
|
|
1080
|
+
a.labelStyle = o;
|
|
1081
|
+
let l = a.padding ?? 0, u = a.look === "neo" ? l * 2 : l;
|
|
1082
|
+
(a.width || a.height) && (a.height = (a == null ? void 0 : a.height) ?? 0, a.height < MIN_HEIGHT2 && (a.height = MIN_HEIGHT2), a.width = ((a == null ? void 0 : a.width) ?? 0) - u - u / 2, a.width < MIN_WIDTH2 && (a.width = MIN_WIDTH2));
|
|
1083
|
+
let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : f.width) + (u ?? 0), h = (a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : m + f.height, g = h, _ = [
|
|
1084
|
+
{
|
|
1085
|
+
x: 0,
|
|
1086
|
+
y: -h
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
x: g,
|
|
1090
|
+
y: -h
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
x: g / 2,
|
|
1094
|
+
y: 0
|
|
1095
|
+
}
|
|
1096
|
+
], { cssStyles: b } = a, x = at.svg(d), S = userNodeOverrides(a, {});
|
|
1097
|
+
a.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
|
|
1098
|
+
let C = createPathFromPoints(_), w = x.path(C, S), T = d.insert(() => w, ":first-child").attr("transform", `translate(${-h / 2}, ${h / 2})`).attr("class", "outer-path");
|
|
1099
|
+
return b && a.look !== "handDrawn" && T.selectChildren("path").attr("style", b), c && a.look !== "handDrawn" && T.selectChildren("path").attr("style", c), a.width = m, a.height = h, updateNodeBounds(a, T), p.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${-h / 2 + (a.padding ?? 0) / 2 + (f.y - (f.top ?? 0))})`), a.intersect = function(e2) {
|
|
1100
|
+
return log.info("Triangle intersect", a, _, e2), intersect_default.polygon(a, _, e2);
|
|
1101
|
+
}, d;
|
|
1102
|
+
}
|
|
1103
|
+
__name(flippedTriangle, "flippedTriangle");
|
|
1104
|
+
function forkJoin(e, a, { dir: o, config: { state: s, themeVariables: c } }) {
|
|
1105
|
+
let { nodeStyles: l } = styles2String(a);
|
|
1106
|
+
a.label = "";
|
|
1107
|
+
let u = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), { cssStyles: d } = a, f = Math.max(70, (a == null ? void 0 : a.width) ?? 0), p = Math.max(10, (a == null ? void 0 : a.height) ?? 0);
|
|
1108
|
+
o === "LR" && (f = Math.max(10, (a == null ? void 0 : a.width) ?? 0), p = Math.max(70, (a == null ? void 0 : a.height) ?? 0));
|
|
1109
|
+
let m = -1 * f / 2, h = -1 * p / 2, g = at.svg(u), _ = userNodeOverrides(a, {
|
|
1110
|
+
stroke: c.lineColor,
|
|
1111
|
+
fill: c.lineColor
|
|
1112
|
+
});
|
|
1113
|
+
a.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
|
|
1114
|
+
let b = g.rectangle(m, h, f, p, _), x = u.insert(() => b, ":first-child");
|
|
1115
|
+
d && a.look !== "handDrawn" && x.selectAll("path").attr("style", d), l && a.look !== "handDrawn" && x.selectAll("path").attr("style", l), updateNodeBounds(a, x);
|
|
1116
|
+
let S = (s == null ? void 0 : s.padding) ?? 0;
|
|
1117
|
+
return a.width && a.height && (a.width += S / 2 || 0, a.height += S / 2 || 0), a.intersect = function(e2) {
|
|
1118
|
+
return intersect_default.rect(a, e2);
|
|
1119
|
+
}, u;
|
|
1120
|
+
}
|
|
1121
|
+
__name(forkJoin, "forkJoin");
|
|
1122
|
+
async function halfRoundedRectangle(e, a) {
|
|
1123
|
+
let { labelStyles: o, nodeStyles: c } = styles2String(a);
|
|
1124
|
+
a.labelStyle = o;
|
|
1125
|
+
let l = a.look === "neo" ? 16 : a.padding ?? 0, u = a.look === "neo" ? 12 : a.padding ?? 0;
|
|
1126
|
+
(a.width || a.height) && (a.height = ((a == null ? void 0 : a.height) ?? 0) - u * 2, a.height < 10 && (a.height = 10), a.width = ((a == null ? void 0 : a.width) ?? 0) - l * 2, a.width < 15 && (a.width = 15));
|
|
1127
|
+
let { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : Math.max(15, f.width)) + l * 2, m = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : Math.max(10, f.height)) + u * 2, h = m / 2, { cssStyles: g } = a, _ = at.svg(d), b = userNodeOverrides(a, {});
|
|
1128
|
+
a.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
|
|
1129
|
+
let x = [
|
|
1130
|
+
{
|
|
1131
|
+
x: -p / 2,
|
|
1132
|
+
y: -m / 2
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
x: p / 2 - h,
|
|
1136
|
+
y: -m / 2
|
|
1137
|
+
},
|
|
1138
|
+
...generateCirclePoints(-p / 2 + h, 0, h, 50, 90, 270),
|
|
1139
|
+
{
|
|
1140
|
+
x: p / 2 - h,
|
|
1141
|
+
y: m / 2
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
x: -p / 2,
|
|
1145
|
+
y: m / 2
|
|
1146
|
+
}
|
|
1147
|
+
], S = createPathFromPoints(x), C = _.path(S, b), w = d.insert(() => C, ":first-child");
|
|
1148
|
+
return w.attr("class", "basic label-container outer-path"), g && a.look !== "handDrawn" && w.selectChildren("path").attr("style", g), c && a.look !== "handDrawn" && w.selectChildren("path").attr("style", c), updateNodeBounds(a, w), a.intersect = function(e2) {
|
|
1149
|
+
return log.info("Pill intersect", a, {
|
|
1150
|
+
radius: h,
|
|
1151
|
+
point: e2
|
|
1152
|
+
}), intersect_default.polygon(a, x, e2);
|
|
1153
|
+
}, d;
|
|
1154
|
+
}
|
|
1155
|
+
__name(halfRoundedRectangle, "halfRoundedRectangle");
|
|
1156
|
+
var createHexagonPathD = /* @__PURE__ */ __name((e, a, o, s, c) => [
|
|
1157
|
+
`M${e + c},${a}`,
|
|
1158
|
+
`L${e + o - c},${a}`,
|
|
1159
|
+
`L${e + o},${a - s / 2}`,
|
|
1160
|
+
`L${e + o - c},${a - s}`,
|
|
1161
|
+
`L${e + c},${a - s}`,
|
|
1162
|
+
`L${e},${a - s / 2}`,
|
|
1163
|
+
"Z"
|
|
1164
|
+
].join(" "), "createHexagonPathD");
|
|
1165
|
+
async function hexagon(e, a) {
|
|
1166
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a), c = a.look === "neo" ? 3.5 : 4;
|
|
1167
|
+
a.labelStyle = o;
|
|
1168
|
+
let l = a.padding ?? 0, u = a.look === "neo" ? 70 : l, d = a.look === "neo" ? 32 : l;
|
|
1169
|
+
if (a.width || a.height) {
|
|
1170
|
+
let e2 = (a.height ?? 0) / c;
|
|
1171
|
+
a.width = ((a == null ? void 0 : a.width) ?? 0) - 2 * e2 - d, a.height = (a.height ?? 0) - u;
|
|
1172
|
+
}
|
|
1173
|
+
let { shapeSvg: f, bbox: p } = await labelHelper(e, a, getNodeClasses(a)), m = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : p.height) + u, h = m / c, g = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : p.width) + 2 * h + d, _ = [
|
|
1174
|
+
{
|
|
1175
|
+
x: h,
|
|
1176
|
+
y: 0
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
x: g - h,
|
|
1180
|
+
y: 0
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
x: g,
|
|
1184
|
+
y: -m / 2
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
x: g - h,
|
|
1188
|
+
y: -m
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
x: h,
|
|
1192
|
+
y: -m
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
x: 0,
|
|
1196
|
+
y: -m / 2
|
|
1197
|
+
}
|
|
1198
|
+
], b, { cssStyles: x } = a;
|
|
1199
|
+
if (a.look === "handDrawn") {
|
|
1200
|
+
let e2 = at.svg(f), o2 = userNodeOverrides(a, {}), s2 = createHexagonPathD(0, 0, g, m, h), c2 = e2.path(s2, o2);
|
|
1201
|
+
b = f.insert(() => c2, ":first-child").attr("transform", `translate(${-g / 2}, ${m / 2})`), x && b.attr("style", x);
|
|
1202
|
+
} else b = insertPolygonShape(f, g, m, _);
|
|
1203
|
+
return s && b.attr("style", s), a.width = g, a.height = m, updateNodeBounds(a, b), a.intersect = function(e2) {
|
|
1204
|
+
return intersect_default.polygon(a, _, e2);
|
|
1205
|
+
}, f;
|
|
1206
|
+
}
|
|
1207
|
+
__name(hexagon, "hexagon");
|
|
1208
|
+
async function hourglass(e, a) {
|
|
1209
|
+
let { labelStyles: o, nodeStyles: c } = styles2String(a);
|
|
1210
|
+
a.label = "", a.labelStyle = o;
|
|
1211
|
+
let { shapeSvg: l } = await labelHelper(e, a, getNodeClasses(a)), u = Math.max(30, (a == null ? void 0 : a.width) ?? 0), d = Math.max(30, (a == null ? void 0 : a.height) ?? 0), { cssStyles: f } = a, p = at.svg(l), m = userNodeOverrides(a, {});
|
|
1212
|
+
a.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
1213
|
+
let h = [
|
|
1214
|
+
{
|
|
1215
|
+
x: 0,
|
|
1216
|
+
y: 0
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
x: u,
|
|
1220
|
+
y: 0
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
x: 0,
|
|
1224
|
+
y: d
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
x: u,
|
|
1228
|
+
y: d
|
|
1229
|
+
}
|
|
1230
|
+
], g = createPathFromPoints(h), _ = p.path(g, m), b = l.insert(() => _, ":first-child");
|
|
1231
|
+
return b.attr("class", "basic label-container outer-path"), f && a.look !== "handDrawn" && b.selectChildren("path").attr("style", f), c && a.look !== "handDrawn" && b.selectChildren("path").attr("style", c), b.attr("transform", `translate(${-u / 2}, ${-d / 2})`), updateNodeBounds(a, b), a.intersect = function(e2) {
|
|
1232
|
+
return log.info("Pill intersect", a, { points: h }), intersect_default.polygon(a, h, e2);
|
|
1233
|
+
}, l;
|
|
1234
|
+
}
|
|
1235
|
+
__name(hourglass, "hourglass");
|
|
1236
|
+
async function icon(e, a, { config: { themeVariables: o, flowchart: c } }) {
|
|
1237
|
+
let { labelStyles: l } = styles2String(a);
|
|
1238
|
+
a.labelStyle = l;
|
|
1239
|
+
let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c == null ? void 0 : c.wrappingWidth;
|
|
1240
|
+
a.width = Math.max(f, p ?? 0);
|
|
1241
|
+
let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e, a, "icon-shape default"), _ = a.pos === "t", b = f, S = f, { nodeBorder: C } = o, { stylesMap: T } = compileStyles(a), D = -S / 2, k = -b / 2, A = a.label ? 8 : 0, j = at.svg(m), M = userNodeOverrides(a, {
|
|
1242
|
+
stroke: "none",
|
|
1243
|
+
fill: "none"
|
|
1244
|
+
});
|
|
1245
|
+
a.look !== "handDrawn" && (M.roughness = 0, M.fillStyle = "solid");
|
|
1246
|
+
let N = j.rectangle(D, k, S, b, M), P = Math.max(S, h.width), F = b + h.height + A, I = j.rectangle(-P / 2, -F / 2, P, F, {
|
|
1247
|
+
...M,
|
|
1248
|
+
fill: "transparent",
|
|
1249
|
+
stroke: "none"
|
|
1250
|
+
}), L = m.insert(() => N, ":first-child"), R = m.insert(() => I);
|
|
1251
|
+
if (a.icon) {
|
|
1252
|
+
let e2 = m.append("g");
|
|
1253
|
+
e2.html(`<g>${await getIconSVG(a.icon, {
|
|
1254
|
+
height: f,
|
|
1255
|
+
width: f,
|
|
1256
|
+
fallbackPrefix: ""
|
|
1257
|
+
})}</g>`);
|
|
1258
|
+
let o2 = e2.node().getBBox(), s = o2.width, c2 = o2.height, l2 = o2.x, u2 = o2.y;
|
|
1259
|
+
e2.attr("transform", `translate(${-s / 2 - l2},${_ ? h.height / 2 + A / 2 - c2 / 2 - u2 : -h.height / 2 - A / 2 - c2 / 2 - u2})`), e2.attr("style", `color: ${T.get("stroke") ?? C};`);
|
|
1260
|
+
}
|
|
1261
|
+
return g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${_ ? -F / 2 : F / 2 - h.height})`), L.attr("transform", `translate(0,${_ ? h.height / 2 + A / 2 : -h.height / 2 - A / 2})`), updateNodeBounds(a, R), a.intersect = function(e2) {
|
|
1262
|
+
if (log.info("iconSquare intersect", a, e2), !a.label) return intersect_default.rect(a, e2);
|
|
1263
|
+
let o2 = a.x ?? 0, c2 = a.y ?? 0, l2 = a.height ?? 0, u2 = [];
|
|
1264
|
+
return u2 = _ ? [
|
|
1265
|
+
{
|
|
1266
|
+
x: o2 - h.width / 2,
|
|
1267
|
+
y: c2 - l2 / 2
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
x: o2 + h.width / 2,
|
|
1271
|
+
y: c2 - l2 / 2
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
x: o2 + h.width / 2,
|
|
1275
|
+
y: c2 - l2 / 2 + h.height + A
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
x: o2 + S / 2,
|
|
1279
|
+
y: c2 - l2 / 2 + h.height + A
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
x: o2 + S / 2,
|
|
1283
|
+
y: c2 + l2 / 2
|
|
1284
|
+
},
|
|
1285
|
+
{
|
|
1286
|
+
x: o2 - S / 2,
|
|
1287
|
+
y: c2 + l2 / 2
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
x: o2 - S / 2,
|
|
1291
|
+
y: c2 - l2 / 2 + h.height + A
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
x: o2 - h.width / 2,
|
|
1295
|
+
y: c2 - l2 / 2 + h.height + A
|
|
1296
|
+
}
|
|
1297
|
+
] : [
|
|
1298
|
+
{
|
|
1299
|
+
x: o2 - S / 2,
|
|
1300
|
+
y: c2 - l2 / 2
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
x: o2 + S / 2,
|
|
1304
|
+
y: c2 - l2 / 2
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
x: o2 + S / 2,
|
|
1308
|
+
y: c2 - l2 / 2 + b
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
x: o2 + h.width / 2,
|
|
1312
|
+
y: c2 - l2 / 2 + b
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
x: o2 + h.width / 2 / 2,
|
|
1316
|
+
y: c2 + l2 / 2
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
x: o2 - h.width / 2,
|
|
1320
|
+
y: c2 + l2 / 2
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
x: o2 - h.width / 2,
|
|
1324
|
+
y: c2 - l2 / 2 + b
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
x: o2 - S / 2,
|
|
1328
|
+
y: c2 - l2 / 2 + b
|
|
1329
|
+
}
|
|
1330
|
+
], intersect_default.polygon(a, u2, e2);
|
|
1331
|
+
}, m;
|
|
1332
|
+
}
|
|
1333
|
+
__name(icon, "icon");
|
|
1334
|
+
async function iconCircle(e, a, { config: { themeVariables: o, flowchart: c } }) {
|
|
1335
|
+
let { labelStyles: l } = styles2String(a);
|
|
1336
|
+
a.labelStyle = l;
|
|
1337
|
+
let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c == null ? void 0 : c.wrappingWidth;
|
|
1338
|
+
a.width = Math.max(f, p ?? 0);
|
|
1339
|
+
let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e, a, "icon-shape default"), _ = a.label ? 8 : 0, b = a.pos === "t", { nodeBorder: S, mainBkg: C } = o, { stylesMap: T } = compileStyles(a), D = at.svg(m), k = userNodeOverrides(a, {});
|
|
1340
|
+
a.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = T.get("fill") ?? C;
|
|
1341
|
+
let A = m.append("g");
|
|
1342
|
+
a.icon && A.html(`<g>${await getIconSVG(a.icon, {
|
|
1343
|
+
height: f,
|
|
1344
|
+
width: f,
|
|
1345
|
+
fallbackPrefix: ""
|
|
1346
|
+
})}</g>`);
|
|
1347
|
+
let j = A.node().getBBox(), M = j.width, N = j.height, P = j.x, F = j.y, I = Math.max(M, N) * Math.SQRT2 + 40, L = D.circle(0, 0, I, k), R = Math.max(I, h.width), z = I + h.height + _, B = D.rectangle(-R / 2, -z / 2, R, z, {
|
|
1348
|
+
...k,
|
|
1349
|
+
fill: "transparent",
|
|
1350
|
+
stroke: "none"
|
|
1351
|
+
}), V = m.insert(() => L, ":first-child"), H = m.insert(() => B);
|
|
1352
|
+
return A.attr("transform", `translate(${-M / 2 - P},${b ? h.height / 2 + _ / 2 - N / 2 - F : -h.height / 2 - _ / 2 - N / 2 - F})`), A.attr("style", `color: ${T.get("stroke") ?? S};`), g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${b ? -z / 2 : z / 2 - h.height})`), V.attr("transform", `translate(0,${b ? h.height / 2 + _ / 2 : -h.height / 2 - _ / 2})`), updateNodeBounds(a, H), a.intersect = function(e2) {
|
|
1353
|
+
return log.info("iconSquare intersect", a, e2), intersect_default.rect(a, e2);
|
|
1354
|
+
}, m;
|
|
1355
|
+
}
|
|
1356
|
+
__name(iconCircle, "iconCircle");
|
|
1357
|
+
async function iconRounded(e, a, { config: { themeVariables: o, flowchart: c } }) {
|
|
1358
|
+
let { labelStyles: l } = styles2String(a);
|
|
1359
|
+
a.labelStyle = l;
|
|
1360
|
+
let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c == null ? void 0 : c.wrappingWidth;
|
|
1361
|
+
a.width = Math.max(f, p ?? 0);
|
|
1362
|
+
let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e, a, "icon-shape default"), b = a.pos === "t", S = f + g * 2, C = f + g * 2, { nodeBorder: T, mainBkg: D } = o, { stylesMap: k } = compileStyles(a), A = -C / 2, j = -S / 2, M = a.label ? 8 : 0, N = at.svg(m), P = userNodeOverrides(a, {});
|
|
1363
|
+
a.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid"), P.stroke = k.get("fill") ?? D;
|
|
1364
|
+
let F = N.path(createRoundedRectPathD(A, j, C, S, 5), P), L = Math.max(C, h.width), R = S + h.height + M, z = N.rectangle(-L / 2, -R / 2, L, R, {
|
|
1365
|
+
...P,
|
|
1366
|
+
fill: "transparent",
|
|
1367
|
+
stroke: "none"
|
|
1368
|
+
}), B = m.insert(() => F, ":first-child").attr("class", "icon-shape2"), V = m.insert(() => z);
|
|
1369
|
+
if (a.icon) {
|
|
1370
|
+
let e2 = m.append("g");
|
|
1371
|
+
e2.html(`<g>${await getIconSVG(a.icon, {
|
|
1372
|
+
height: f,
|
|
1373
|
+
width: f,
|
|
1374
|
+
fallbackPrefix: ""
|
|
1375
|
+
})}</g>`);
|
|
1376
|
+
let o2 = e2.node().getBBox(), s = o2.width, c2 = o2.height, l2 = o2.x, u2 = o2.y;
|
|
1377
|
+
e2.attr("transform", `translate(${-s / 2 - l2},${b ? h.height / 2 + M / 2 - c2 / 2 - u2 : -h.height / 2 - M / 2 - c2 / 2 - u2})`), e2.attr("style", `color: ${k.get("stroke") ?? T};`);
|
|
1378
|
+
}
|
|
1379
|
+
return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${b ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${b ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(a, V), a.intersect = function(e2) {
|
|
1380
|
+
if (log.info("iconSquare intersect", a, e2), !a.label) return intersect_default.rect(a, e2);
|
|
1381
|
+
let o2 = a.x ?? 0, c2 = a.y ?? 0, l2 = a.height ?? 0, u2 = [];
|
|
1382
|
+
return u2 = b ? [
|
|
1383
|
+
{
|
|
1384
|
+
x: o2 - h.width / 2,
|
|
1385
|
+
y: c2 - l2 / 2
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
x: o2 + h.width / 2,
|
|
1389
|
+
y: c2 - l2 / 2
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
x: o2 + h.width / 2,
|
|
1393
|
+
y: c2 - l2 / 2 + h.height + M
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
x: o2 + C / 2,
|
|
1397
|
+
y: c2 - l2 / 2 + h.height + M
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
x: o2 + C / 2,
|
|
1401
|
+
y: c2 + l2 / 2
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
x: o2 - C / 2,
|
|
1405
|
+
y: c2 + l2 / 2
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
x: o2 - C / 2,
|
|
1409
|
+
y: c2 - l2 / 2 + h.height + M
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
x: o2 - h.width / 2,
|
|
1413
|
+
y: c2 - l2 / 2 + h.height + M
|
|
1414
|
+
}
|
|
1415
|
+
] : [
|
|
1416
|
+
{
|
|
1417
|
+
x: o2 - C / 2,
|
|
1418
|
+
y: c2 - l2 / 2
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
x: o2 + C / 2,
|
|
1422
|
+
y: c2 - l2 / 2
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
x: o2 + C / 2,
|
|
1426
|
+
y: c2 - l2 / 2 + S
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
x: o2 + h.width / 2,
|
|
1430
|
+
y: c2 - l2 / 2 + S
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
x: o2 + h.width / 2 / 2,
|
|
1434
|
+
y: c2 + l2 / 2
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
x: o2 - h.width / 2,
|
|
1438
|
+
y: c2 + l2 / 2
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
x: o2 - h.width / 2,
|
|
1442
|
+
y: c2 - l2 / 2 + S
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
x: o2 - C / 2,
|
|
1446
|
+
y: c2 - l2 / 2 + S
|
|
1447
|
+
}
|
|
1448
|
+
], intersect_default.polygon(a, u2, e2);
|
|
1449
|
+
}, m;
|
|
1450
|
+
}
|
|
1451
|
+
__name(iconRounded, "iconRounded");
|
|
1452
|
+
async function iconSquare(e, a, { config: { themeVariables: o, flowchart: c } }) {
|
|
1453
|
+
let { labelStyles: l } = styles2String(a);
|
|
1454
|
+
a.labelStyle = l;
|
|
1455
|
+
let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c == null ? void 0 : c.wrappingWidth;
|
|
1456
|
+
a.width = Math.max(f, p ?? 0);
|
|
1457
|
+
let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e, a, "icon-shape default"), b = a.pos === "t", S = f + g * 2, C = f + g * 2, { nodeBorder: T, mainBkg: D } = o, { stylesMap: k } = compileStyles(a), A = -C / 2, j = -S / 2, M = a.label ? 8 : 0, N = at.svg(m), P = userNodeOverrides(a, {});
|
|
1458
|
+
a.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid"), P.stroke = k.get("fill") ?? D;
|
|
1459
|
+
let F = N.path(createRoundedRectPathD(A, j, C, S, 0.1), P), L = Math.max(C, h.width), R = S + h.height + M, z = N.rectangle(-L / 2, -R / 2, L, R, {
|
|
1460
|
+
...P,
|
|
1461
|
+
fill: "transparent",
|
|
1462
|
+
stroke: "none"
|
|
1463
|
+
}), B = m.insert(() => F, ":first-child"), V = m.insert(() => z);
|
|
1464
|
+
if (a.icon) {
|
|
1465
|
+
let e2 = m.append("g");
|
|
1466
|
+
e2.html(`<g>${await getIconSVG(a.icon, {
|
|
1467
|
+
height: f,
|
|
1468
|
+
width: f,
|
|
1469
|
+
fallbackPrefix: ""
|
|
1470
|
+
})}</g>`);
|
|
1471
|
+
let o2 = e2.node().getBBox(), s = o2.width, c2 = o2.height, l2 = o2.x, u2 = o2.y;
|
|
1472
|
+
e2.attr("transform", `translate(${-s / 2 - l2},${b ? h.height / 2 + M / 2 - c2 / 2 - u2 : -h.height / 2 - M / 2 - c2 / 2 - u2})`), e2.attr("style", `color: ${k.get("stroke") ?? T};`);
|
|
1473
|
+
}
|
|
1474
|
+
return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${b ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${b ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(a, V), a.intersect = function(e2) {
|
|
1475
|
+
if (log.info("iconSquare intersect", a, e2), !a.label) return intersect_default.rect(a, e2);
|
|
1476
|
+
let o2 = a.x ?? 0, c2 = a.y ?? 0, l2 = a.height ?? 0, u2 = [];
|
|
1477
|
+
return u2 = b ? [
|
|
1478
|
+
{
|
|
1479
|
+
x: o2 - h.width / 2,
|
|
1480
|
+
y: c2 - l2 / 2
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
x: o2 + h.width / 2,
|
|
1484
|
+
y: c2 - l2 / 2
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
x: o2 + h.width / 2,
|
|
1488
|
+
y: c2 - l2 / 2 + h.height + M
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
x: o2 + C / 2,
|
|
1492
|
+
y: c2 - l2 / 2 + h.height + M
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
x: o2 + C / 2,
|
|
1496
|
+
y: c2 + l2 / 2
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
x: o2 - C / 2,
|
|
1500
|
+
y: c2 + l2 / 2
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
x: o2 - C / 2,
|
|
1504
|
+
y: c2 - l2 / 2 + h.height + M
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
x: o2 - h.width / 2,
|
|
1508
|
+
y: c2 - l2 / 2 + h.height + M
|
|
1509
|
+
}
|
|
1510
|
+
] : [
|
|
1511
|
+
{
|
|
1512
|
+
x: o2 - C / 2,
|
|
1513
|
+
y: c2 - l2 / 2
|
|
1514
|
+
},
|
|
1515
|
+
{
|
|
1516
|
+
x: o2 + C / 2,
|
|
1517
|
+
y: c2 - l2 / 2
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
x: o2 + C / 2,
|
|
1521
|
+
y: c2 - l2 / 2 + S
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
x: o2 + h.width / 2,
|
|
1525
|
+
y: c2 - l2 / 2 + S
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
x: o2 + h.width / 2 / 2,
|
|
1529
|
+
y: c2 + l2 / 2
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
x: o2 - h.width / 2,
|
|
1533
|
+
y: c2 + l2 / 2
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
x: o2 - h.width / 2,
|
|
1537
|
+
y: c2 - l2 / 2 + S
|
|
1538
|
+
},
|
|
1539
|
+
{
|
|
1540
|
+
x: o2 - C / 2,
|
|
1541
|
+
y: c2 - l2 / 2 + S
|
|
1542
|
+
}
|
|
1543
|
+
], intersect_default.polygon(a, u2, e2);
|
|
1544
|
+
}, m;
|
|
1545
|
+
}
|
|
1546
|
+
__name(iconSquare, "iconSquare");
|
|
1547
|
+
async function imageSquare(e, a, { config: { flowchart: o } }) {
|
|
1548
|
+
let c = new Image();
|
|
1549
|
+
c.src = (a == null ? void 0 : a.img) ?? "", await c.decode();
|
|
1550
|
+
let l = Number(c.naturalWidth.toString().replace("px", "")), u = Number(c.naturalHeight.toString().replace("px", ""));
|
|
1551
|
+
a.imageAspectRatio = l / u;
|
|
1552
|
+
let { labelStyles: d } = styles2String(a);
|
|
1553
|
+
a.labelStyle = d;
|
|
1554
|
+
let f = o == null ? void 0 : o.wrappingWidth;
|
|
1555
|
+
a.defaultWidth = o == null ? void 0 : o.wrappingWidth;
|
|
1556
|
+
let p = Math.max(a.label ? f ?? 0 : 0, (a == null ? void 0 : a.assetWidth) ?? l), m = a.constraint === "on" && (a == null ? void 0 : a.assetHeight) ? a.assetHeight * a.imageAspectRatio : p, h = a.constraint === "on" ? m / a.imageAspectRatio : (a == null ? void 0 : a.assetHeight) ?? u;
|
|
1557
|
+
a.width = Math.max(m, f ?? 0);
|
|
1558
|
+
let { shapeSvg: g, bbox: _, label: b } = await labelHelper(e, a, "image-shape default"), x = a.pos === "t", S = -m / 2, C = -h / 2, w = a.label ? 8 : 0, T = at.svg(g), D = userNodeOverrides(a, {});
|
|
1559
|
+
a.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
|
|
1560
|
+
let k = T.rectangle(S, C, m, h, D), A = Math.max(m, _.width), j = h + _.height + w, M = T.rectangle(-A / 2, -j / 2, A, j, {
|
|
1561
|
+
...D,
|
|
1562
|
+
fill: "none",
|
|
1563
|
+
stroke: "none"
|
|
1564
|
+
}), N = g.insert(() => k, ":first-child"), P = g.insert(() => M);
|
|
1565
|
+
if (a.img) {
|
|
1566
|
+
let e2 = g.append("image");
|
|
1567
|
+
e2.attr("href", a.img), e2.attr("width", m), e2.attr("height", h), e2.attr("preserveAspectRatio", "none"), e2.attr("transform", `translate(${-m / 2},${x ? j / 2 - h : -j / 2})`);
|
|
1568
|
+
}
|
|
1569
|
+
return b.attr("transform", `translate(${-_.width / 2 - (_.x - (_.left ?? 0))},${x ? -h / 2 - _.height / 2 - w / 2 : h / 2 - _.height / 2 + w / 2})`), N.attr("transform", `translate(0,${x ? _.height / 2 + w / 2 : -_.height / 2 - w / 2})`), updateNodeBounds(a, P), a.intersect = function(e2) {
|
|
1570
|
+
if (log.info("iconSquare intersect", a, e2), !a.label) return intersect_default.rect(a, e2);
|
|
1571
|
+
let o2 = a.x ?? 0, c2 = a.y ?? 0, l2 = a.height ?? 0, u2 = [];
|
|
1572
|
+
return u2 = x ? [
|
|
1573
|
+
{
|
|
1574
|
+
x: o2 - _.width / 2,
|
|
1575
|
+
y: c2 - l2 / 2
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
x: o2 + _.width / 2,
|
|
1579
|
+
y: c2 - l2 / 2
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
x: o2 + _.width / 2,
|
|
1583
|
+
y: c2 - l2 / 2 + _.height + w
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
x: o2 + m / 2,
|
|
1587
|
+
y: c2 - l2 / 2 + _.height + w
|
|
1588
|
+
},
|
|
1589
|
+
{
|
|
1590
|
+
x: o2 + m / 2,
|
|
1591
|
+
y: c2 + l2 / 2
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
x: o2 - m / 2,
|
|
1595
|
+
y: c2 + l2 / 2
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
x: o2 - m / 2,
|
|
1599
|
+
y: c2 - l2 / 2 + _.height + w
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
x: o2 - _.width / 2,
|
|
1603
|
+
y: c2 - l2 / 2 + _.height + w
|
|
1604
|
+
}
|
|
1605
|
+
] : [
|
|
1606
|
+
{
|
|
1607
|
+
x: o2 - m / 2,
|
|
1608
|
+
y: c2 - l2 / 2
|
|
1609
|
+
},
|
|
1610
|
+
{
|
|
1611
|
+
x: o2 + m / 2,
|
|
1612
|
+
y: c2 - l2 / 2
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
x: o2 + m / 2,
|
|
1616
|
+
y: c2 - l2 / 2 + h
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
x: o2 + _.width / 2,
|
|
1620
|
+
y: c2 - l2 / 2 + h
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
x: o2 + _.width / 2 / 2,
|
|
1624
|
+
y: c2 + l2 / 2
|
|
1625
|
+
},
|
|
1626
|
+
{
|
|
1627
|
+
x: o2 - _.width / 2,
|
|
1628
|
+
y: c2 + l2 / 2
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
x: o2 - _.width / 2,
|
|
1632
|
+
y: c2 - l2 / 2 + h
|
|
1633
|
+
},
|
|
1634
|
+
{
|
|
1635
|
+
x: o2 - m / 2,
|
|
1636
|
+
y: c2 - l2 / 2 + h
|
|
1637
|
+
}
|
|
1638
|
+
], intersect_default.polygon(a, u2, e2);
|
|
1639
|
+
}, g;
|
|
1640
|
+
}
|
|
1641
|
+
__name(imageSquare, "imageSquare");
|
|
1642
|
+
async function inv_trapezoid(e, a) {
|
|
1643
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
1644
|
+
a.labelStyle = o;
|
|
1645
|
+
let c = a.padding ?? 0, l = c, u = a.look === "neo" ? c * 2 : c, { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = Math.max(f.width + (u ?? 0) * 2, (a == null ? void 0 : a.width) ?? 0), m = Math.max(f.height + (l ?? 0) * 2, (a == null ? void 0 : a.height) ?? 0), h = [
|
|
1646
|
+
{
|
|
1647
|
+
x: 0,
|
|
1648
|
+
y: 0
|
|
1649
|
+
},
|
|
1650
|
+
{
|
|
1651
|
+
x: p,
|
|
1652
|
+
y: 0
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
x: p + 3 * m / 6,
|
|
1656
|
+
y: -m
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
x: -3 * m / 6,
|
|
1660
|
+
y: -m
|
|
1661
|
+
}
|
|
1662
|
+
], g, { cssStyles: _ } = a;
|
|
1663
|
+
if (a.look === "handDrawn") {
|
|
1664
|
+
let e2 = at.svg(d), o2 = userNodeOverrides(a, {}), s2 = createPathFromPoints(h), c2 = e2.path(s2, o2);
|
|
1665
|
+
g = d.insert(() => c2, ":first-child").attr("transform", `translate(${-p / 2}, ${m / 2})`), _ && g.attr("style", _);
|
|
1666
|
+
} else g = insertPolygonShape(d, p, m, h);
|
|
1667
|
+
return s && g.attr("style", s), a.width = p, a.height = m, updateNodeBounds(a, g), a.intersect = function(e2) {
|
|
1668
|
+
return intersect_default.polygon(a, h, e2);
|
|
1669
|
+
}, d;
|
|
1670
|
+
}
|
|
1671
|
+
__name(inv_trapezoid, "inv_trapezoid");
|
|
1672
|
+
async function labelRect(e, a) {
|
|
1673
|
+
let { shapeSvg: o, bbox: s, label: c } = await labelHelper(e, a, "label"), l = o.insert("rect", ":first-child");
|
|
1674
|
+
return l.attr("width", 0.1).attr("height", 0.1), o.attr("class", "label edgeLabel"), c.attr("transform", `translate(${-(s.width / 2) - (s.x - (s.left ?? 0))}, ${-(s.height / 2) - (s.y - (s.top ?? 0))})`), updateNodeBounds(a, l), a.intersect = function(e2) {
|
|
1675
|
+
return intersect_default.rect(a, e2);
|
|
1676
|
+
}, o;
|
|
1677
|
+
}
|
|
1678
|
+
__name(labelRect, "labelRect");
|
|
1679
|
+
async function lean_left(e, a) {
|
|
1680
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
1681
|
+
a.labelStyle = o;
|
|
1682
|
+
let c = a.padding ?? 0, l = c, u = a.look === "neo" ? c * 2 : c, { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.height) ?? f.height) + l, m = ((a == null ? void 0 : a.width) ?? f.width) + u, h = [
|
|
1683
|
+
{
|
|
1684
|
+
x: 0,
|
|
1685
|
+
y: 0
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
x: m + 3 * p / 6,
|
|
1689
|
+
y: 0
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
x: m,
|
|
1693
|
+
y: -p
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
x: -(3 * p) / 6,
|
|
1697
|
+
y: -p
|
|
1698
|
+
}
|
|
1699
|
+
], g, { cssStyles: _ } = a;
|
|
1700
|
+
if (a.look === "handDrawn") {
|
|
1701
|
+
let e2 = at.svg(d), o2 = userNodeOverrides(a, {}), s2 = createPathFromPoints(h), c2 = e2.path(s2, o2);
|
|
1702
|
+
g = d.insert(() => c2, ":first-child").attr("transform", `translate(${-m / 2}, ${p / 2})`), _ && g.attr("style", _);
|
|
1703
|
+
} else g = insertPolygonShape(d, m, p, h);
|
|
1704
|
+
return s && g.attr("style", s), a.width = m, a.height = p, updateNodeBounds(a, g), a.intersect = function(e2) {
|
|
1705
|
+
return intersect_default.polygon(a, h, e2);
|
|
1706
|
+
}, d;
|
|
1707
|
+
}
|
|
1708
|
+
__name(lean_left, "lean_left");
|
|
1709
|
+
async function lean_right(e, a) {
|
|
1710
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
1711
|
+
a.labelStyle = o;
|
|
1712
|
+
let c = a.padding ?? 0, l = c, u = a.look === "neo" ? c * 2 : c, { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.height) ?? f.height) + l, m = ((a == null ? void 0 : a.width) ?? f.width) + u, h = [
|
|
1713
|
+
{
|
|
1714
|
+
x: -3 * p / 6,
|
|
1715
|
+
y: 0
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
x: m,
|
|
1719
|
+
y: 0
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
x: m + 3 * p / 6,
|
|
1723
|
+
y: -p
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
x: 0,
|
|
1727
|
+
y: -p
|
|
1728
|
+
}
|
|
1729
|
+
], g, { cssStyles: _ } = a;
|
|
1730
|
+
if (a.look === "handDrawn") {
|
|
1731
|
+
let e2 = at.svg(d), o2 = userNodeOverrides(a, {}), s2 = createPathFromPoints(h), c2 = e2.path(s2, o2);
|
|
1732
|
+
g = d.insert(() => c2, ":first-child").attr("transform", `translate(${-m / 2}, ${p / 2})`), _ && g.attr("style", _);
|
|
1733
|
+
} else g = insertPolygonShape(d, m, p, h);
|
|
1734
|
+
return s && g.attr("style", s), a.width = m, a.height = p, updateNodeBounds(a, g), a.intersect = function(e2) {
|
|
1735
|
+
return intersect_default.polygon(a, h, e2);
|
|
1736
|
+
}, d;
|
|
1737
|
+
}
|
|
1738
|
+
__name(lean_right, "lean_right");
|
|
1739
|
+
function lightningBolt(e, a) {
|
|
1740
|
+
let { labelStyles: o, nodeStyles: c } = styles2String(a);
|
|
1741
|
+
a.label = "", a.labelStyle = o;
|
|
1742
|
+
let l = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), { cssStyles: u } = a, d = Math.max(35, (a == null ? void 0 : a.width) ?? 0), f = Math.max(35, (a == null ? void 0 : a.height) ?? 0), p = [
|
|
1743
|
+
{
|
|
1744
|
+
x: d,
|
|
1745
|
+
y: 0
|
|
1746
|
+
},
|
|
1747
|
+
{
|
|
1748
|
+
x: 0,
|
|
1749
|
+
y: f + 7 / 2
|
|
1750
|
+
},
|
|
1751
|
+
{
|
|
1752
|
+
x: d - 14,
|
|
1753
|
+
y: f + 7 / 2
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
x: 0,
|
|
1757
|
+
y: 2 * f
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
x: d,
|
|
1761
|
+
y: f - 7 / 2
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
x: 14,
|
|
1765
|
+
y: f - 7 / 2
|
|
1766
|
+
}
|
|
1767
|
+
], m = at.svg(l), h = userNodeOverrides(a, {});
|
|
1768
|
+
a.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
1769
|
+
let g = createPathFromPoints(p), _ = m.path(g, h), b = l.insert(() => _, ":first-child");
|
|
1770
|
+
return b.attr("class", "outer-path"), u && a.look !== "handDrawn" && b.selectAll("path").attr("style", u), c && a.look !== "handDrawn" && b.selectAll("path").attr("style", c), b.attr("transform", `translate(-${d / 2},${-f})`), updateNodeBounds(a, b), a.intersect = function(e2) {
|
|
1771
|
+
return log.info("lightningBolt intersect", a, e2), intersect_default.polygon(a, p, e2);
|
|
1772
|
+
}, l;
|
|
1773
|
+
}
|
|
1774
|
+
__name(lightningBolt, "lightningBolt");
|
|
1775
|
+
var createCylinderPathD2 = /* @__PURE__ */ __name((e, a, o, s, c, l, u) => [
|
|
1776
|
+
`M${e},${a + l}`,
|
|
1777
|
+
`a${c},${l} 0,0,0 ${o},0`,
|
|
1778
|
+
`a${c},${l} 0,0,0 ${-o},0`,
|
|
1779
|
+
`l0,${s}`,
|
|
1780
|
+
`a${c},${l} 0,0,0 ${o},0`,
|
|
1781
|
+
`l0,${-s}`,
|
|
1782
|
+
`M${e},${a + l + u}`,
|
|
1783
|
+
`a${c},${l} 0,0,0 ${o},0`
|
|
1784
|
+
].join(" "), "createCylinderPathD"), createOuterCylinderPathD2 = /* @__PURE__ */ __name((e, a, o, s, c, l, u) => [
|
|
1785
|
+
`M${e},${a + l}`,
|
|
1786
|
+
`M${e + o},${a + l}`,
|
|
1787
|
+
`a${c},${l} 0,0,0 ${-o},0`,
|
|
1788
|
+
`l0,${s}`,
|
|
1789
|
+
`a${c},${l} 0,0,0 ${o},0`,
|
|
1790
|
+
`l0,${-s}`,
|
|
1791
|
+
`M${e},${a + l + u}`,
|
|
1792
|
+
`a${c},${l} 0,0,0 ${o},0`
|
|
1793
|
+
].join(" "), "createOuterCylinderPathD"), createInnerCylinderPathD2 = /* @__PURE__ */ __name((e, a, o, s, c, l) => [`M${e - o / 2},${-s / 2}`, `a${c},${l} 0,0,0 ${o},0`].join(" "), "createInnerCylinderPathD"), MIN_HEIGHT3 = 10, MIN_WIDTH3 = 10;
|
|
1794
|
+
async function linedCylinder(a, o) {
|
|
1795
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(o);
|
|
1796
|
+
o.labelStyle = s;
|
|
1797
|
+
let l = o.padding ?? 0, u = o.look === "neo" ? 16 : l, d = o.look === "neo" ? 24 : l;
|
|
1798
|
+
if (o.width || o.height) {
|
|
1799
|
+
let e = o.width ?? 0;
|
|
1800
|
+
o.width = (o.width ?? 0) - u, o.width < MIN_WIDTH3 && (o.width = MIN_WIDTH3);
|
|
1801
|
+
let a2 = e / 2 / (2.5 + e / 50);
|
|
1802
|
+
o.height = (o.height ?? 0) - d - a2 * 3, o.height < MIN_HEIGHT3 && (o.height = MIN_HEIGHT3);
|
|
1803
|
+
}
|
|
1804
|
+
let { shapeSvg: f, bbox: p, label: m } = await labelHelper(a, o, getNodeClasses(o)), h = ((o == null ? void 0 : o.width) ? o == null ? void 0 : o.width : p.width) + u * 2, g = h / 2, _ = g / (2.5 + h / 50), b = ((o == null ? void 0 : o.height) ? o == null ? void 0 : o.height : p.height) + _ + d * 2, x = b * 0.1, S, { cssStyles: C } = o;
|
|
1805
|
+
if (o.look === "handDrawn") {
|
|
1806
|
+
let e = at.svg(f), a2 = createOuterCylinderPathD2(0, 0, h, b, g, _, x), s2 = createInnerCylinderPathD2(0, _, h, b, g, _), c2 = userNodeOverrides(o, {}), l2 = e.path(a2, c2), u2 = e.path(s2, c2);
|
|
1807
|
+
f.insert(() => u2, ":first-child").attr("class", "line"), S = f.insert(() => l2, ":first-child"), S.attr("class", "basic label-container"), C && S.attr("style", C);
|
|
1808
|
+
} else {
|
|
1809
|
+
let a2 = createCylinderPathD2(0, 0, h, b, g, _, x);
|
|
1810
|
+
S = f.insert("path", ":first-child").attr("d", a2).attr("class", "basic label-container outer-path").attr("style", handleUndefinedAttr(C)).attr("style", c);
|
|
1811
|
+
}
|
|
1812
|
+
return S.attr("label-offset-y", _), S.attr("transform", `translate(${-h / 2}, ${-(b / 2 + _)})`), updateNodeBounds(o, S), m.attr("transform", `translate(${-(p.width / 2) - (p.x - (p.left ?? 0))}, ${-(p.height / 2) + _ - (p.y - (p.top ?? 0))})`), o.intersect = function(e) {
|
|
1813
|
+
let a2 = intersect_default.rect(o, e), s2 = a2.x - (o.x ?? 0);
|
|
1814
|
+
if (g != 0 && (Math.abs(s2) < (o.width ?? 0) / 2 || Math.abs(s2) == (o.width ?? 0) / 2 && Math.abs(a2.y - (o.y ?? 0)) > (o.height ?? 0) / 2 - _)) {
|
|
1815
|
+
let c2 = _ * _ * (1 - s2 * s2 / (g * g));
|
|
1816
|
+
c2 > 0 && (c2 = Math.sqrt(c2)), c2 = _ - c2, e.y - (o.y ?? 0) > 0 && (c2 = -c2), a2.y += c2;
|
|
1817
|
+
}
|
|
1818
|
+
return a2;
|
|
1819
|
+
}, f;
|
|
1820
|
+
}
|
|
1821
|
+
__name(linedCylinder, "linedCylinder");
|
|
1822
|
+
async function linedWaveEdgedRect(e, a) {
|
|
1823
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
1824
|
+
a.labelStyle = o;
|
|
1825
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 16 : c, u = a.look === "neo" ? 12 : c;
|
|
1826
|
+
(a.width || a.height) && (a.width = (a.width ?? 0) * 10 / 11 - l * 2, a.width < 10 && (a.width = 10), a.height = ((a == null ? void 0 : a.height) ?? 0) - u * 2, a.height < 10 && (a.height = 10));
|
|
1827
|
+
let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : f.width) + (l ?? 0) * 2, h = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : f.height) + (u ?? 0) * 2, g = a.look === "neo" ? h / 4 : h / 8, _ = h + g, { cssStyles: b } = a, x = at.svg(d), S = userNodeOverrides(a, {});
|
|
1828
|
+
a.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
|
|
1829
|
+
let C = [
|
|
1830
|
+
{
|
|
1831
|
+
x: -m / 2 - m / 2 * 0.1,
|
|
1832
|
+
y: -_ / 2
|
|
1833
|
+
},
|
|
1834
|
+
{
|
|
1835
|
+
x: -m / 2 - m / 2 * 0.1,
|
|
1836
|
+
y: _ / 2
|
|
1837
|
+
},
|
|
1838
|
+
...generateFullSineWavePoints(-m / 2 - m / 2 * 0.1, _ / 2, m / 2 + m / 2 * 0.1, _ / 2, g, 0.8),
|
|
1839
|
+
{
|
|
1840
|
+
x: m / 2 + m / 2 * 0.1,
|
|
1841
|
+
y: -_ / 2
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
x: -m / 2 - m / 2 * 0.1,
|
|
1845
|
+
y: -_ / 2
|
|
1846
|
+
},
|
|
1847
|
+
{
|
|
1848
|
+
x: -m / 2,
|
|
1849
|
+
y: -_ / 2
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
x: -m / 2,
|
|
1853
|
+
y: _ / 2 * 1.1
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
x: -m / 2,
|
|
1857
|
+
y: -_ / 2
|
|
1858
|
+
}
|
|
1859
|
+
], w = x.polygon(C.map((e2) => [e2.x, e2.y]), S), T = d.insert(() => w, ":first-child");
|
|
1860
|
+
return T.attr("class", "basic label-container outer-path"), b && a.look !== "handDrawn" && T.selectAll("path").attr("style", b), s && a.look !== "handDrawn" && T.selectAll("path").attr("style", s), T.attr("transform", `translate(0,${-g / 2})`), p.attr("transform", `translate(${-m / 2 + (a.padding ?? 0) + m / 2 * 0.1 / 2 - (f.x - (f.left ?? 0))},${-h / 2 + (a.padding ?? 0) - g / 2 - (f.y - (f.top ?? 0))})`), updateNodeBounds(a, T), a.intersect = function(e2) {
|
|
1861
|
+
return intersect_default.polygon(a, C, e2);
|
|
1862
|
+
}, d;
|
|
1863
|
+
}
|
|
1864
|
+
__name(linedWaveEdgedRect, "linedWaveEdgedRect");
|
|
1865
|
+
async function multiRect(e, a) {
|
|
1866
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
1867
|
+
a.labelStyle = o;
|
|
1868
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 16 : c, u = a.look === "neo" ? 12 : c, d = a.look === "neo" ? 10 : 5;
|
|
1869
|
+
(a.width || a.height) && (a.width = Math.max(((a == null ? void 0 : a.width) ?? 0) - l * 2 - 2 * d, 10), a.height = Math.max(((a == null ? void 0 : a.height) ?? 0) - u * 2 - 2 * d, 10));
|
|
1870
|
+
let { shapeSvg: f, bbox: p, label: m } = await labelHelper(e, a, getNodeClasses(a)), h = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : p.width) + l * 2 + 2 * d, g = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : p.height) + u * 2 + 2 * d, _ = h - 2 * d, b = g - 2 * d, x = -_ / 2, S = -b / 2, { cssStyles: C } = a, w = at.svg(f), T = userNodeOverrides(a, {}), D = [
|
|
1871
|
+
{
|
|
1872
|
+
x: x - d,
|
|
1873
|
+
y: S + d
|
|
1874
|
+
},
|
|
1875
|
+
{
|
|
1876
|
+
x: x - d,
|
|
1877
|
+
y: S + b + d
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
x: x + _ - d,
|
|
1881
|
+
y: S + b + d
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
x: x + _ - d,
|
|
1885
|
+
y: S + b
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
x: x + _,
|
|
1889
|
+
y: S + b
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
x: x + _,
|
|
1893
|
+
y: S + b - d
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
x: x + _ + d,
|
|
1897
|
+
y: S + b - d
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
x: x + _ + d,
|
|
1901
|
+
y: S - d
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
x: x + d,
|
|
1905
|
+
y: S - d
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
x: x + d,
|
|
1909
|
+
y: S
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
x,
|
|
1913
|
+
y: S
|
|
1914
|
+
},
|
|
1915
|
+
{
|
|
1916
|
+
x,
|
|
1917
|
+
y: S + d
|
|
1918
|
+
}
|
|
1919
|
+
], j = [
|
|
1920
|
+
{
|
|
1921
|
+
x,
|
|
1922
|
+
y: S + d
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
x: x + _ - d,
|
|
1926
|
+
y: S + d
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
x: x + _ - d,
|
|
1930
|
+
y: S + b
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
x: x + _,
|
|
1934
|
+
y: S + b
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
x: x + _,
|
|
1938
|
+
y: S
|
|
1939
|
+
},
|
|
1940
|
+
{
|
|
1941
|
+
x,
|
|
1942
|
+
y: S
|
|
1943
|
+
}
|
|
1944
|
+
];
|
|
1945
|
+
a.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
|
|
1946
|
+
let M = createPathFromPoints(D), P = w.path(M, T), F = createPathFromPoints(j), I = w.path(F, T);
|
|
1947
|
+
a.look !== "handDrawn" && (P = mergePaths(P), I = mergePaths(I));
|
|
1948
|
+
let L = f.insert("g", ":first-child");
|
|
1949
|
+
return L.insert(() => P), L.insert(() => I), L.attr("class", "basic label-container outer-path"), C && a.look !== "handDrawn" && L.selectAll("path").attr("style", C), s && a.look !== "handDrawn" && L.selectAll("path").attr("style", s), m.attr("transform", `translate(${-(p.width / 2) - d - (p.x - (p.left ?? 0))}, ${-(p.height / 2) + d - (p.y - (p.top ?? 0))})`), updateNodeBounds(a, L), a.intersect = function(e2) {
|
|
1950
|
+
return intersect_default.polygon(a, D, e2);
|
|
1951
|
+
}, f;
|
|
1952
|
+
}
|
|
1953
|
+
__name(multiRect, "multiRect");
|
|
1954
|
+
async function multiWaveEdgedRectangle(e, a) {
|
|
1955
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
1956
|
+
a.labelStyle = o;
|
|
1957
|
+
let { shapeSvg: c, bbox: l, label: u } = await labelHelper(e, a, getNodeClasses(a)), d = a.padding ?? 0, f = a.look === "neo" ? 16 : d, p = a.look === "neo" ? 12 : d, m = true;
|
|
1958
|
+
(a.width || a.height) && (m = false, a.width = ((a == null ? void 0 : a.width) ?? 0) - f * 2, a.height = ((a == null ? void 0 : a.height) ?? 0) - p * 3);
|
|
1959
|
+
let h = Math.max(l.width, (a == null ? void 0 : a.width) ?? 0) + f * 2, g = Math.max(l.height, (a == null ? void 0 : a.height) ?? 0) + p * 3, _ = a.look === "neo" ? g / 4 : g / 8, b = g + (m ? _ / 2 : -_ / 2), x = -h / 2, S = -b / 2, { cssStyles: C } = a, w = generateFullSineWavePoints(x - 10, S + b + 10, x + h - 10, S + b + 10, _, 0.8), T = w == null ? void 0 : w[w.length - 1], D = [
|
|
1960
|
+
{
|
|
1961
|
+
x: x - 10,
|
|
1962
|
+
y: S + 10
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
x: x - 10,
|
|
1966
|
+
y: S + b + 10
|
|
1967
|
+
},
|
|
1968
|
+
...w,
|
|
1969
|
+
{
|
|
1970
|
+
x: x + h - 10,
|
|
1971
|
+
y: T.y - 10
|
|
1972
|
+
},
|
|
1973
|
+
{
|
|
1974
|
+
x: x + h,
|
|
1975
|
+
y: T.y - 10
|
|
1976
|
+
},
|
|
1977
|
+
{
|
|
1978
|
+
x: x + h,
|
|
1979
|
+
y: T.y - 20
|
|
1980
|
+
},
|
|
1981
|
+
{
|
|
1982
|
+
x: x + h + 10,
|
|
1983
|
+
y: T.y - 20
|
|
1984
|
+
},
|
|
1985
|
+
{
|
|
1986
|
+
x: x + h + 10,
|
|
1987
|
+
y: S - 10
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
x: x + 10,
|
|
1991
|
+
y: S - 10
|
|
1992
|
+
},
|
|
1993
|
+
{
|
|
1994
|
+
x: x + 10,
|
|
1995
|
+
y: S
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
x,
|
|
1999
|
+
y: S
|
|
2000
|
+
},
|
|
2001
|
+
{
|
|
2002
|
+
x,
|
|
2003
|
+
y: S + 10
|
|
2004
|
+
}
|
|
2005
|
+
], M = [
|
|
2006
|
+
{
|
|
2007
|
+
x,
|
|
2008
|
+
y: S + 10
|
|
2009
|
+
},
|
|
2010
|
+
{
|
|
2011
|
+
x: x + h - 10,
|
|
2012
|
+
y: S + 10
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
x: x + h - 10,
|
|
2016
|
+
y: T.y - 10
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
x: x + h,
|
|
2020
|
+
y: T.y - 10
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
x: x + h,
|
|
2024
|
+
y: S
|
|
2025
|
+
},
|
|
2026
|
+
{
|
|
2027
|
+
x,
|
|
2028
|
+
y: S
|
|
2029
|
+
}
|
|
2030
|
+
], N = at.svg(c), P = userNodeOverrides(a, {});
|
|
2031
|
+
a.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid");
|
|
2032
|
+
let F = createPathFromPoints(D), I = N.path(F, P), L = createPathFromPoints(M), R = N.path(L, P), z = c.insert(() => I, ":first-child");
|
|
2033
|
+
return z.insert(() => R), z.attr("class", "basic label-container outer-path"), C && a.look !== "handDrawn" && z.selectAll("path").attr("style", C), s && a.look !== "handDrawn" && z.selectAll("path").attr("style", s), z.attr("transform", `translate(0,${-_ / 2})`), u.attr("transform", `translate(${-(l.width / 2) - 10 - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + 10 - _ / 2 - (l.y - (l.top ?? 0))})`), updateNodeBounds(a, z), a.intersect = function(e2) {
|
|
2034
|
+
return intersect_default.polygon(a, D, e2);
|
|
2035
|
+
}, c;
|
|
2036
|
+
}
|
|
2037
|
+
__name(multiWaveEdgedRectangle, "multiWaveEdgedRectangle");
|
|
2038
|
+
async function note(e, a, { config: { themeVariables: o } }) {
|
|
2039
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
2040
|
+
a.labelStyle = s, a.useHtmlLabels || getEffectiveHtmlLabels(getConfig()) || (a.centerLabel = true);
|
|
2041
|
+
let { shapeSvg: l, bbox: u, label: d } = await labelHelper(e, a, getNodeClasses(a)), f = Math.max(u.width + (a.padding ?? 0) * 2, (a == null ? void 0 : a.width) ?? 0), h = Math.max(u.height + (a.padding ?? 0) * 2, (a == null ? void 0 : a.height) ?? 0), g = -f / 2, _ = -h / 2, { cssStyles: b } = a, x = at.svg(l), S = userNodeOverrides(a, {
|
|
2042
|
+
fill: o.noteBkgColor,
|
|
2043
|
+
stroke: o.noteBorderColor
|
|
2044
|
+
});
|
|
2045
|
+
a.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
|
|
2046
|
+
let C = x.rectangle(g, _, f, h, S), w = l.insert(() => C, ":first-child");
|
|
2047
|
+
return w.attr("class", "basic label-container outer-path"), d.attr("class", "label noteLabel"), b && a.look !== "handDrawn" && w.selectAll("path").attr("style", b), c && a.look !== "handDrawn" && w.selectAll("path").attr("style", c), d.attr("transform", `translate(${-u.width / 2 - (u.x - (u.left ?? 0))}, ${-(u.height / 2) - (u.y - (u.top ?? 0))})`), updateNodeBounds(a, w), a.intersect = function(e2) {
|
|
2048
|
+
return intersect_default.rect(a, e2);
|
|
2049
|
+
}, l;
|
|
2050
|
+
}
|
|
2051
|
+
__name(note, "note");
|
|
2052
|
+
var createDecisionBoxPathD = /* @__PURE__ */ __name((e, a, o) => [
|
|
2053
|
+
`M${e + o / 2},${a}`,
|
|
2054
|
+
`L${e + o},${a - o / 2}`,
|
|
2055
|
+
`L${e + o / 2},${a - o}`,
|
|
2056
|
+
`L${e},${a - o / 2}`,
|
|
2057
|
+
"Z"
|
|
2058
|
+
].join(" "), "createDecisionBoxPathD");
|
|
2059
|
+
async function question(e, a) {
|
|
2060
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2061
|
+
a.labelStyle = o;
|
|
2062
|
+
let { shapeSvg: c, bbox: l } = await labelHelper(e, a, getNodeClasses(a)), u = l.width + (a.padding ?? 0) + (l.height + (a.padding ?? 0)), d = 0.5, f = [
|
|
2063
|
+
{
|
|
2064
|
+
x: u / 2,
|
|
2065
|
+
y: 0
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
x: u,
|
|
2069
|
+
y: -u / 2
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
x: u / 2,
|
|
2073
|
+
y: -u
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
x: 0,
|
|
2077
|
+
y: -u / 2
|
|
2078
|
+
}
|
|
2079
|
+
], p, { cssStyles: m } = a;
|
|
2080
|
+
if (a.look === "handDrawn") {
|
|
2081
|
+
let e2 = at.svg(c), o2 = userNodeOverrides(a, {}), s2 = createDecisionBoxPathD(0, 0, u), l2 = e2.path(s2, o2);
|
|
2082
|
+
p = c.insert(() => l2, ":first-child").attr("transform", `translate(${-u / 2 + d}, ${u / 2})`), m && p.attr("style", m);
|
|
2083
|
+
} else p = insertPolygonShape(c, u, u, f), p.attr("transform", `translate(${-u / 2 + d}, ${u / 2})`);
|
|
2084
|
+
return s && p.attr("style", s), updateNodeBounds(a, p), a.calcIntersect = function(e2, a2) {
|
|
2085
|
+
let o2 = e2.width, s2 = [
|
|
2086
|
+
{
|
|
2087
|
+
x: o2 / 2,
|
|
2088
|
+
y: 0
|
|
2089
|
+
},
|
|
2090
|
+
{
|
|
2091
|
+
x: o2,
|
|
2092
|
+
y: -o2 / 2
|
|
2093
|
+
},
|
|
2094
|
+
{
|
|
2095
|
+
x: o2 / 2,
|
|
2096
|
+
y: -o2
|
|
2097
|
+
},
|
|
2098
|
+
{
|
|
2099
|
+
x: 0,
|
|
2100
|
+
y: -o2 / 2
|
|
2101
|
+
}
|
|
2102
|
+
], c2 = intersect_default.polygon(e2, s2, a2);
|
|
2103
|
+
return {
|
|
2104
|
+
x: c2.x - 0.5,
|
|
2105
|
+
y: c2.y - 0.5
|
|
2106
|
+
};
|
|
2107
|
+
}, a.intersect = function(e2) {
|
|
2108
|
+
return this.calcIntersect(a, e2);
|
|
2109
|
+
}, c;
|
|
2110
|
+
}
|
|
2111
|
+
__name(question, "question");
|
|
2112
|
+
async function rect_left_inv_arrow(e, a) {
|
|
2113
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2114
|
+
a.labelStyle = o;
|
|
2115
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 21 : c ?? 0, u = a.look === "neo" ? 12 : c ?? 0, { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = ((a == null ? void 0 : a.width) ?? f.width) + (a.look === "neo" ? l * 2 : l), h = ((a == null ? void 0 : a.height) ?? f.height) + (a.look === "neo" ? u * 2 : u), g = -m / 2, _ = -h / 2, b = _ / 2, x = [
|
|
2116
|
+
{
|
|
2117
|
+
x: g + b,
|
|
2118
|
+
y: _
|
|
2119
|
+
},
|
|
2120
|
+
{
|
|
2121
|
+
x: g,
|
|
2122
|
+
y: 0
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
x: g + b,
|
|
2126
|
+
y: -_
|
|
2127
|
+
},
|
|
2128
|
+
{
|
|
2129
|
+
x: -g,
|
|
2130
|
+
y: -_
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
x: -g,
|
|
2134
|
+
y: _
|
|
2135
|
+
}
|
|
2136
|
+
], { cssStyles: S } = a, C = at.svg(d), w = userNodeOverrides(a, {});
|
|
2137
|
+
a.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
2138
|
+
let T = createPathFromPoints(x), D = C.path(T, w), j = d.insert(() => D, ":first-child");
|
|
2139
|
+
return j.attr("class", "basic label-container outer-path"), S && a.look !== "handDrawn" && j.selectAll("path").attr("style", S), s && a.look !== "handDrawn" && j.selectAll("path").attr("style", s), j.attr("transform", `translate(${-b / 2},0)`), p.attr("transform", `translate(${-b / 2 - f.width / 2 - (f.x - (f.left ?? 0))}, ${-(f.height / 2) - (f.y - (f.top ?? 0))})`), updateNodeBounds(a, j), a.intersect = function(e2) {
|
|
2140
|
+
return intersect_default.polygon(a, x, e2);
|
|
2141
|
+
}, d;
|
|
2142
|
+
}
|
|
2143
|
+
__name(rect_left_inv_arrow, "rect_left_inv_arrow");
|
|
2144
|
+
async function rectWithTitle(e, a) {
|
|
2145
|
+
let { labelStyles: o, nodeStyles: l } = styles2String(a);
|
|
2146
|
+
a.labelStyle = o;
|
|
2147
|
+
let u;
|
|
2148
|
+
u = a.cssClasses ? "node " + a.cssClasses : "node default";
|
|
2149
|
+
let d = e.insert("g").attr("class", u).attr("id", a.domId || a.id), f = d.insert("g"), m = d.insert("g").attr("class", "label").attr("style", l), h = a.description, _ = a.label, b = await createLabel_default(m, _, a.labelStyle, true, true), x = {
|
|
2150
|
+
width: 0,
|
|
2151
|
+
height: 0
|
|
2152
|
+
};
|
|
2153
|
+
if (getEffectiveHtmlLabels(getConfig2())) {
|
|
2154
|
+
let e2 = b.children[0], a2 = select_default(b);
|
|
2155
|
+
x = e2.getBoundingClientRect(), a2.attr("width", x.width), a2.attr("height", x.height);
|
|
2156
|
+
}
|
|
2157
|
+
log.info("Text 2", h);
|
|
2158
|
+
let S = h || [], C = b.getBBox(), w = await createLabel_default(m, Array.isArray(S) ? S.join("<br/>") : S, a.labelStyle, true, true), T = w.children[0], E = select_default(w);
|
|
2159
|
+
x = T.getBoundingClientRect(), E.attr("width", x.width), E.attr("height", x.height);
|
|
2160
|
+
let D = (a.padding || 0) / 2;
|
|
2161
|
+
select_default(w).attr("transform", "translate( " + (x.width > C.width ? 0 : (C.width - x.width) / 2) + ", " + (C.height + D + 5) + ")"), select_default(b).attr("transform", "translate( " + (x.width < C.width ? 0 : -(C.width - x.width) / 2) + ", 0)"), x = m.node().getBBox(), m.attr("transform", "translate(" + -x.width / 2 + ", " + (-x.height / 2 - D + 3) + ")");
|
|
2162
|
+
let k = x.width + (a.padding || 0), A = x.height + (a.padding || 0), j = -x.width / 2 - D, M = -x.height / 2 - D, N, P;
|
|
2163
|
+
if (a.look === "handDrawn") {
|
|
2164
|
+
let e2 = at.svg(d), o2 = userNodeOverrides(a, {}), c = e2.path(createRoundedRectPathD(j, M, k, A, a.rx || 0), o2), l2 = e2.line(-x.width / 2 - D, -x.height / 2 - D + C.height + D, x.width / 2 + D, -x.height / 2 - D + C.height + D, o2);
|
|
2165
|
+
P = d.insert(() => (log.debug("Rough node insert CXC", c), l2), ":first-child"), N = d.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child");
|
|
2166
|
+
} else N = f.insert("rect", ":first-child"), P = f.insert("line"), N.attr("class", "outer title-state").attr("style", l).attr("x", -x.width / 2 - D).attr("y", -x.height / 2 - D).attr("width", x.width + (a.padding || 0)).attr("height", x.height + (a.padding || 0)), P.attr("class", "divider").attr("x1", -x.width / 2 - D).attr("x2", x.width / 2 + D).attr("y1", -x.height / 2 - D + C.height + D).attr("y2", -x.height / 2 - D + C.height + D);
|
|
2167
|
+
return updateNodeBounds(a, N), a.intersect = function(e2) {
|
|
2168
|
+
return intersect_default.rect(a, e2);
|
|
2169
|
+
}, d;
|
|
2170
|
+
}
|
|
2171
|
+
__name(rectWithTitle, "rectWithTitle");
|
|
2172
|
+
async function roundedRect(e, a, { config: { themeVariables: o } }) {
|
|
2173
|
+
let s = (o == null ? void 0 : o.radius) ?? 5;
|
|
2174
|
+
return drawRect(e, a, {
|
|
2175
|
+
rx: s,
|
|
2176
|
+
ry: s,
|
|
2177
|
+
classes: "",
|
|
2178
|
+
labelPaddingX: ((a == null ? void 0 : a.padding) ?? 0) * 1,
|
|
2179
|
+
labelPaddingY: ((a == null ? void 0 : a.padding) ?? 0) * 1
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
__name(roundedRect, "roundedRect");
|
|
2183
|
+
var FRAME_WIDTH = 8;
|
|
2184
|
+
async function shadedProcess(a, o) {
|
|
2185
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(o);
|
|
2186
|
+
o.labelStyle = s;
|
|
2187
|
+
let l = o.look === "neo" ? 16 : o.padding ?? 0, u = o.look === "neo" ? 12 : o.padding ?? 0, { shapeSvg: d, bbox: f, label: p } = await labelHelper(a, o, getNodeClasses(o)), m = ((o == null ? void 0 : o.width) ?? f.width) + l * 2 + (o.look === "neo" ? FRAME_WIDTH : FRAME_WIDTH * 2), h = ((o == null ? void 0 : o.height) ?? f.height) + u * 2, g = m - FRAME_WIDTH, _ = h, b = FRAME_WIDTH - m / 2, x = -h / 2, { cssStyles: S } = o, C = at.svg(d), w = userNodeOverrides(o, {});
|
|
2188
|
+
o.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
2189
|
+
let T = [
|
|
2190
|
+
{
|
|
2191
|
+
x: b,
|
|
2192
|
+
y: x
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
x: b + g,
|
|
2196
|
+
y: x
|
|
2197
|
+
},
|
|
2198
|
+
{
|
|
2199
|
+
x: b + g,
|
|
2200
|
+
y: x + _
|
|
2201
|
+
},
|
|
2202
|
+
{
|
|
2203
|
+
x: b - FRAME_WIDTH,
|
|
2204
|
+
y: x + _
|
|
2205
|
+
},
|
|
2206
|
+
{
|
|
2207
|
+
x: b - FRAME_WIDTH,
|
|
2208
|
+
y: x
|
|
2209
|
+
},
|
|
2210
|
+
{
|
|
2211
|
+
x: b,
|
|
2212
|
+
y: x
|
|
2213
|
+
},
|
|
2214
|
+
{
|
|
2215
|
+
x: b,
|
|
2216
|
+
y: x + _
|
|
2217
|
+
}
|
|
2218
|
+
], D = C.polygon(T.map((e) => [e.x, e.y]), w), A = d.insert(() => D, ":first-child");
|
|
2219
|
+
return A.attr("class", "basic label-container outer-path").attr("style", handleUndefinedAttr(S)), c && o.look !== "handDrawn" && A.selectAll("path").attr("style", c), S && o.look !== "handDrawn" && A.selectAll("path").attr("style", c), p.attr("transform", `translate(${FRAME_WIDTH / 2 - f.width / 2 - (f.x - (f.left ?? 0))}, ${-(f.height / 2) - (f.y - (f.top ?? 0))})`), updateNodeBounds(o, A), o.intersect = function(e) {
|
|
2220
|
+
return intersect_default.rect(o, e);
|
|
2221
|
+
}, d;
|
|
2222
|
+
}
|
|
2223
|
+
__name(shadedProcess, "shadedProcess");
|
|
2224
|
+
async function slopedRect(e, a) {
|
|
2225
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2226
|
+
a.labelStyle = o;
|
|
2227
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 16 : c, u = a.look === "neo" ? 12 : c;
|
|
2228
|
+
(a.width || a.height) && (a.width = Math.max(((a == null ? void 0 : a.width) ?? 0) - l * 2, 10), a.height = Math.max(((a == null ? void 0 : a.height) ?? 0) / 1.5 - u * 2, 10));
|
|
2229
|
+
let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : f.width) + l * 2, h = (((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : f.height) + u * 2) * 1.5, g = m, _ = h / 1.5, b = -g / 2, x = -_ / 2, { cssStyles: S } = a, C = at.svg(d), w = userNodeOverrides(a, {});
|
|
2230
|
+
a.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
2231
|
+
let T = [
|
|
2232
|
+
{
|
|
2233
|
+
x: b,
|
|
2234
|
+
y: x
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
x: b,
|
|
2238
|
+
y: x + _
|
|
2239
|
+
},
|
|
2240
|
+
{
|
|
2241
|
+
x: b + g,
|
|
2242
|
+
y: x + _
|
|
2243
|
+
},
|
|
2244
|
+
{
|
|
2245
|
+
x: b + g,
|
|
2246
|
+
y: x - _ / 2
|
|
2247
|
+
}
|
|
2248
|
+
], D = createPathFromPoints(T), j = C.path(D, w), M = d.insert(() => j, ":first-child");
|
|
2249
|
+
return M.attr("class", "basic label-container outer-path"), S && a.look !== "handDrawn" && M.selectChildren("path").attr("style", S), s && a.look !== "handDrawn" && M.selectChildren("path").attr("style", s), M.attr("transform", `translate(0, ${_ / 4})`), p.attr("transform", `translate(${-g / 2 + (a.padding ?? 0) - (f.x - (f.left ?? 0))}, ${-_ / 4 + (a.padding ?? 0) - (f.y - (f.top ?? 0))})`), updateNodeBounds(a, M), a.intersect = function(e2) {
|
|
2250
|
+
return intersect_default.polygon(a, T, e2);
|
|
2251
|
+
}, d;
|
|
2252
|
+
}
|
|
2253
|
+
__name(slopedRect, "slopedRect");
|
|
2254
|
+
async function squareRect2(e, a) {
|
|
2255
|
+
let o = a.padding ?? 0, s = a.look === "neo" ? 16 : o * 2, c = a.look === "neo" ? 12 : o;
|
|
2256
|
+
return drawRect(e, a, {
|
|
2257
|
+
rx: 0,
|
|
2258
|
+
ry: 0,
|
|
2259
|
+
classes: "",
|
|
2260
|
+
labelPaddingX: a.labelPaddingX ?? s,
|
|
2261
|
+
labelPaddingY: c
|
|
2262
|
+
});
|
|
2263
|
+
}
|
|
2264
|
+
__name(squareRect2, "squareRect");
|
|
2265
|
+
async function stadium(e, a) {
|
|
2266
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2267
|
+
a.labelStyle = o;
|
|
2268
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 20 : c, u = a.look === "neo" ? 12 : c, { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = f.height + (a.look === "neo" ? u * 2 : u), m = f.width + p / 4 + (a.look === "neo" ? l * 2 : l), h = p / 2, { cssStyles: g } = a, _ = at.svg(d), b = userNodeOverrides(a, {});
|
|
2269
|
+
a.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
|
|
2270
|
+
let x = [
|
|
2271
|
+
{
|
|
2272
|
+
x: -m / 2 + h,
|
|
2273
|
+
y: -p / 2
|
|
2274
|
+
},
|
|
2275
|
+
{
|
|
2276
|
+
x: m / 2 - h,
|
|
2277
|
+
y: -p / 2
|
|
2278
|
+
},
|
|
2279
|
+
...generateCirclePoints(-m / 2 + h, 0, h, 50, 90, 270),
|
|
2280
|
+
{
|
|
2281
|
+
x: m / 2 - h,
|
|
2282
|
+
y: p / 2
|
|
2283
|
+
},
|
|
2284
|
+
...generateCirclePoints(m / 2 - h, 0, h, 50, 270, 450)
|
|
2285
|
+
], S = createPathFromPoints(x), C = _.path(S, b), w = d.insert(() => C, ":first-child");
|
|
2286
|
+
return w.attr("class", "basic label-container outer-path"), g && a.look !== "handDrawn" && w.selectChildren("path").attr("style", g), s && a.look !== "handDrawn" && w.selectChildren("path").attr("style", s), updateNodeBounds(a, w), a.intersect = function(e2) {
|
|
2287
|
+
return intersect_default.polygon(a, x, e2);
|
|
2288
|
+
}, d;
|
|
2289
|
+
}
|
|
2290
|
+
__name(stadium, "stadium");
|
|
2291
|
+
async function state(e, a) {
|
|
2292
|
+
return drawRect(e, a, {
|
|
2293
|
+
rx: a.look === "neo" ? 3 : 5,
|
|
2294
|
+
ry: a.look === "neo" ? 3 : 5,
|
|
2295
|
+
classes: "flowchart-node"
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
__name(state, "state");
|
|
2299
|
+
function stateEnd(e, a, { config: { themeVariables: o } }) {
|
|
2300
|
+
var _a, _b;
|
|
2301
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
2302
|
+
a.labelStyle = s;
|
|
2303
|
+
let { cssStyles: l } = a, { lineColor: u, stateBorder: d, nodeBorder: f, nodeShadow: p } = o;
|
|
2304
|
+
(a.width || a.height) && ((a.width ?? 0) < 14 && (a.width = 14), (a.height ?? 0) < 14 && (a.height = 14)), a.width || (a.width = 14), a.height || (a.height = 14);
|
|
2305
|
+
let m = e.insert("g").attr("class", "node default").attr("id", a.domId ?? a.id), h = at.svg(m), g = userNodeOverrides(a, {});
|
|
2306
|
+
a.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
|
|
2307
|
+
let _ = h.circle(0, 0, a.width, {
|
|
2308
|
+
...g,
|
|
2309
|
+
stroke: u,
|
|
2310
|
+
strokeWidth: 2
|
|
2311
|
+
}), b = d ?? f, x = (a.width ?? 0) * 5 / 14, S = h.circle(0, 0, x, {
|
|
2312
|
+
...g,
|
|
2313
|
+
fill: b,
|
|
2314
|
+
stroke: b,
|
|
2315
|
+
strokeWidth: 2,
|
|
2316
|
+
fillStyle: "solid"
|
|
2317
|
+
}), C = m.insert(() => _, ":first-child");
|
|
2318
|
+
if (C.insert(() => S), a.look !== "handDrawn" && C.attr("class", "outer-path"), l && C.selectAll("path").attr("style", l), c && C.selectAll("path").attr("style", c), a.width < 25 && p && a.look !== "handDrawn") {
|
|
2319
|
+
let a2 = ((_b = (_a = e.node()) == null ? void 0 : _a.ownerSVGElement) == null ? void 0 : _b.id) ?? "", o2 = a2 ? `${a2}-drop-shadow-small` : "drop-shadow-small";
|
|
2320
|
+
C.attr("style", `filter:url(#${o2})`);
|
|
2321
|
+
}
|
|
2322
|
+
return updateNodeBounds(a, C), a.intersect = function(e2) {
|
|
2323
|
+
return intersect_default.circle(a, (a.width ?? 0) / 2, e2);
|
|
2324
|
+
}, m;
|
|
2325
|
+
}
|
|
2326
|
+
__name(stateEnd, "stateEnd");
|
|
2327
|
+
function stateStart(e, a, { config: { themeVariables: o } }) {
|
|
2328
|
+
var _a, _b;
|
|
2329
|
+
let { lineColor: s, nodeShadow: c } = o;
|
|
2330
|
+
(a.width || a.height) && ((a.width ?? 0) < 14 && (a.width = 14), (a.height ?? 0) < 14 && (a.height = 14)), a.width || (a.width = 14), a.height || (a.height = 14);
|
|
2331
|
+
let l = e.insert("g").attr("class", "node default").attr("id", a.domId || a.id), u;
|
|
2332
|
+
if (a.look === "handDrawn") {
|
|
2333
|
+
let e2 = at.svg(l).circle(0, 0, a.width, solidStateFill(s));
|
|
2334
|
+
u = l.insert(() => e2), u.attr("class", "state-start").attr("r", (a.width ?? 7) / 2).attr("width", a.width ?? 14).attr("height", a.height ?? 14);
|
|
2335
|
+
} else u = l.insert("circle", ":first-child"), u.attr("class", "state-start").attr("r", (a.width ?? 7) / 2).attr("width", a.width ?? 14).attr("height", a.height ?? 14);
|
|
2336
|
+
if (a.width < 25 && c && a.look !== "handDrawn") {
|
|
2337
|
+
let a2 = ((_b = (_a = e.node()) == null ? void 0 : _a.ownerSVGElement) == null ? void 0 : _b.id) ?? "", o2 = a2 ? `${a2}-drop-shadow-small` : "drop-shadow-small";
|
|
2338
|
+
u.attr("style", `filter:url(#${o2})`);
|
|
2339
|
+
}
|
|
2340
|
+
return updateNodeBounds(a, u), a.intersect = function(e2) {
|
|
2341
|
+
return intersect_default.circle(a, (a.width ?? 7) / 2, e2);
|
|
2342
|
+
}, l;
|
|
2343
|
+
}
|
|
2344
|
+
__name(stateStart, "stateStart");
|
|
2345
|
+
var FRAME_WIDTH2 = 8;
|
|
2346
|
+
async function subroutine(a, o) {
|
|
2347
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(o);
|
|
2348
|
+
o.labelStyle = s;
|
|
2349
|
+
let l = (o == null ? void 0 : o.padding) ?? 8, u = o.look === "neo" ? 28 : l, d = o.look === "neo" ? 12 : l, { shapeSvg: f, bbox: p } = await labelHelper(a, o, getNodeClasses(o)), m = ((o == null ? void 0 : o.width) ?? p.width) + 2 * FRAME_WIDTH2 + u, h = ((o == null ? void 0 : o.height) ?? p.height) + d, g = m - 2 * FRAME_WIDTH2, _ = h, b = -m / 2, x = -h / 2, S = [
|
|
2350
|
+
{
|
|
2351
|
+
x: 0,
|
|
2352
|
+
y: 0
|
|
2353
|
+
},
|
|
2354
|
+
{
|
|
2355
|
+
x: g,
|
|
2356
|
+
y: 0
|
|
2357
|
+
},
|
|
2358
|
+
{
|
|
2359
|
+
x: g,
|
|
2360
|
+
y: -_
|
|
2361
|
+
},
|
|
2362
|
+
{
|
|
2363
|
+
x: 0,
|
|
2364
|
+
y: -_
|
|
2365
|
+
},
|
|
2366
|
+
{
|
|
2367
|
+
x: 0,
|
|
2368
|
+
y: 0
|
|
2369
|
+
},
|
|
2370
|
+
{
|
|
2371
|
+
x: -8,
|
|
2372
|
+
y: 0
|
|
2373
|
+
},
|
|
2374
|
+
{
|
|
2375
|
+
x: g + 8,
|
|
2376
|
+
y: 0
|
|
2377
|
+
},
|
|
2378
|
+
{
|
|
2379
|
+
x: g + 8,
|
|
2380
|
+
y: -_
|
|
2381
|
+
},
|
|
2382
|
+
{
|
|
2383
|
+
x: -8,
|
|
2384
|
+
y: -_
|
|
2385
|
+
},
|
|
2386
|
+
{
|
|
2387
|
+
x: -8,
|
|
2388
|
+
y: 0
|
|
2389
|
+
}
|
|
2390
|
+
];
|
|
2391
|
+
if (o.look === "handDrawn") {
|
|
2392
|
+
let a2 = at.svg(f), s2 = userNodeOverrides(o, {}), c2 = a2.rectangle(b, x, g + 16, _, s2), l2 = a2.line(b + FRAME_WIDTH2, x, b + FRAME_WIDTH2, x + _, s2), u2 = a2.line(b + FRAME_WIDTH2 + g, x, b + FRAME_WIDTH2 + g, x + _, s2);
|
|
2393
|
+
f.insert(() => l2, ":first-child"), f.insert(() => u2, ":first-child");
|
|
2394
|
+
let d2 = f.insert(() => c2, ":first-child"), { cssStyles: p2 } = o;
|
|
2395
|
+
d2.attr("class", "basic label-container").attr("style", handleUndefinedAttr(p2)), updateNodeBounds(o, d2);
|
|
2396
|
+
} else {
|
|
2397
|
+
let e = insertPolygonShape(f, g, _, S);
|
|
2398
|
+
c && e.attr("style", c), updateNodeBounds(o, e);
|
|
2399
|
+
}
|
|
2400
|
+
return o.intersect = function(e) {
|
|
2401
|
+
return intersect_default.polygon(o, S, e);
|
|
2402
|
+
}, f;
|
|
2403
|
+
}
|
|
2404
|
+
__name(subroutine, "subroutine");
|
|
2405
|
+
var TAG_RATIO = 0.2;
|
|
2406
|
+
async function taggedRect(e, a) {
|
|
2407
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2408
|
+
a.labelStyle = o;
|
|
2409
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 16 : c, u = a.look === "neo" ? 12 : c;
|
|
2410
|
+
(a.width || a.height) && (a.height = Math.max(((a == null ? void 0 : a.height) ?? 0) - u * 2, 10), a.width = Math.max(((a == null ? void 0 : a.width) ?? 0) - l * 2 - TAG_RATIO * (a.height + u * 2), 10));
|
|
2411
|
+
let { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : f.height) + u * 2, m = TAG_RATIO * p, h = TAG_RATIO * p, g = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : f.width) + l * 2 + m - m, _ = p, b = -g / 2, x = -_ / 2, { cssStyles: S } = a, C = at.svg(d), w = userNodeOverrides(a, {}), T = [
|
|
2412
|
+
{
|
|
2413
|
+
x: b - m / 2,
|
|
2414
|
+
y: x
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
x: b + g + m / 2,
|
|
2418
|
+
y: x
|
|
2419
|
+
},
|
|
2420
|
+
{
|
|
2421
|
+
x: b + g + m / 2,
|
|
2422
|
+
y: x + _
|
|
2423
|
+
},
|
|
2424
|
+
{
|
|
2425
|
+
x: b - m / 2,
|
|
2426
|
+
y: x + _
|
|
2427
|
+
}
|
|
2428
|
+
], D = [
|
|
2429
|
+
{
|
|
2430
|
+
x: b + g - m / 2,
|
|
2431
|
+
y: x + _
|
|
2432
|
+
},
|
|
2433
|
+
{
|
|
2434
|
+
x: b + g + m / 2,
|
|
2435
|
+
y: x + _
|
|
2436
|
+
},
|
|
2437
|
+
{
|
|
2438
|
+
x: b + g + m / 2,
|
|
2439
|
+
y: x + _ - h
|
|
2440
|
+
}
|
|
2441
|
+
];
|
|
2442
|
+
a.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
2443
|
+
let j = createPathFromPoints(T), M = C.path(j, w), N = createPathFromPoints(D), P = C.path(N, {
|
|
2444
|
+
...w,
|
|
2445
|
+
fillStyle: "solid"
|
|
2446
|
+
}), F = d.insert(() => P, ":first-child");
|
|
2447
|
+
return F.insert(() => M, ":first-child"), F.attr("class", "basic label-container outer-path"), S && a.look !== "handDrawn" && F.selectAll("path").attr("style", S), s && a.look !== "handDrawn" && F.selectAll("path").attr("style", s), updateNodeBounds(a, F), a.intersect = function(e2) {
|
|
2448
|
+
return intersect_default.polygon(a, T, e2);
|
|
2449
|
+
}, d;
|
|
2450
|
+
}
|
|
2451
|
+
__name(taggedRect, "taggedRect");
|
|
2452
|
+
async function taggedWaveEdgedRectangle(e, a) {
|
|
2453
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2454
|
+
a.labelStyle = o;
|
|
2455
|
+
let { shapeSvg: c, bbox: l, label: u } = await labelHelper(e, a, getNodeClasses(a)), d = Math.max(l.width + (a.padding ?? 0) * 2, (a == null ? void 0 : a.width) ?? 0), f = Math.max(l.height + (a.padding ?? 0) * 2, (a == null ? void 0 : a.height) ?? 0), p = f / 8, m = 0.2 * d, h = 0.2 * f, g = f + p, { cssStyles: _ } = a, b = at.svg(c), x = userNodeOverrides(a, {});
|
|
2456
|
+
a.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
|
|
2457
|
+
let S = [
|
|
2458
|
+
{
|
|
2459
|
+
x: -d / 2 - d / 2 * 0.1,
|
|
2460
|
+
y: g / 2
|
|
2461
|
+
},
|
|
2462
|
+
...generateFullSineWavePoints(-d / 2 - d / 2 * 0.1, g / 2, d / 2 + d / 2 * 0.1, g / 2, p, 0.8),
|
|
2463
|
+
{
|
|
2464
|
+
x: d / 2 + d / 2 * 0.1,
|
|
2465
|
+
y: -g / 2
|
|
2466
|
+
},
|
|
2467
|
+
{
|
|
2468
|
+
x: -d / 2 - d / 2 * 0.1,
|
|
2469
|
+
y: -g / 2
|
|
2470
|
+
}
|
|
2471
|
+
], C = -d / 2 + d / 2 * 0.1, w = -g / 2 - h * 0.4, T = [
|
|
2472
|
+
{
|
|
2473
|
+
x: C + d - m,
|
|
2474
|
+
y: (w + f) * 1.3
|
|
2475
|
+
},
|
|
2476
|
+
{
|
|
2477
|
+
x: C + d,
|
|
2478
|
+
y: w + f - h
|
|
2479
|
+
},
|
|
2480
|
+
{
|
|
2481
|
+
x: C + d,
|
|
2482
|
+
y: (w + f) * 0.9
|
|
2483
|
+
},
|
|
2484
|
+
...generateFullSineWavePoints(C + d, (w + f) * 1.25, C + d - m, (w + f) * 1.3, -f * 0.02, 0.5)
|
|
2485
|
+
], D = createPathFromPoints(S), M = b.path(D, x), N = createPathFromPoints(T), P = b.path(N, {
|
|
2486
|
+
...x,
|
|
2487
|
+
fillStyle: "solid"
|
|
2488
|
+
}), F = c.insert(() => P, ":first-child");
|
|
2489
|
+
return F.insert(() => M, ":first-child"), F.attr("class", "basic label-container outer-path"), _ && a.look !== "handDrawn" && F.selectAll("path").attr("style", _), s && a.look !== "handDrawn" && F.selectAll("path").attr("style", s), F.attr("transform", `translate(0,${-p / 2})`), u.attr("transform", `translate(${-d / 2 + (a.padding ?? 0) - (l.x - (l.left ?? 0))},${-f / 2 + (a.padding ?? 0) - p / 2 - (l.y - (l.top ?? 0))})`), updateNodeBounds(a, F), a.intersect = function(e2) {
|
|
2490
|
+
return intersect_default.polygon(a, S, e2);
|
|
2491
|
+
}, c;
|
|
2492
|
+
}
|
|
2493
|
+
__name(taggedWaveEdgedRectangle, "taggedWaveEdgedRectangle");
|
|
2494
|
+
async function text(e, a) {
|
|
2495
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2496
|
+
a.labelStyle = o;
|
|
2497
|
+
let { shapeSvg: c, bbox: l } = await labelHelper(e, a, getNodeClasses(a)), u = Math.max(l.width + (a.padding ?? 0), (a == null ? void 0 : a.width) || 0), d = Math.max(l.height + (a.padding ?? 0), (a == null ? void 0 : a.height) || 0), f = -u / 2, p = -d / 2, m = c.insert("rect", ":first-child");
|
|
2498
|
+
return m.attr("class", "text").attr("style", s).attr("rx", 0).attr("ry", 0).attr("x", f).attr("y", p).attr("width", u).attr("height", d), updateNodeBounds(a, m), a.intersect = function(e2) {
|
|
2499
|
+
return intersect_default.rect(a, e2);
|
|
2500
|
+
}, c;
|
|
2501
|
+
}
|
|
2502
|
+
__name(text, "text");
|
|
2503
|
+
var createCylinderPathD3 = /* @__PURE__ */ __name((e, a, o, s, c, l) => `M${e},${a}
|
|
2504
|
+
a${c},${l} 0,0,1 0,${-s}
|
|
2505
|
+
l${o},0
|
|
2506
|
+
a${c},${l} 0,0,1 0,${s}
|
|
2507
|
+
M${o},${-s}
|
|
2508
|
+
a${c},${l} 0,0,0 0,${s}
|
|
2509
|
+
l${-o},0`, "createCylinderPathD"), createOuterCylinderPathD3 = /* @__PURE__ */ __name((e, a, o, s, c, l) => [
|
|
2510
|
+
`M${e},${a}`,
|
|
2511
|
+
`M${e + o},${a}`,
|
|
2512
|
+
`a${c},${l} 0,0,0 0,${-s}`,
|
|
2513
|
+
`l${-o},0`,
|
|
2514
|
+
`a${c},${l} 0,0,0 0,${s}`,
|
|
2515
|
+
`l${o},0`
|
|
2516
|
+
].join(" "), "createOuterCylinderPathD"), createInnerCylinderPathD3 = /* @__PURE__ */ __name((e, a, o, s, c, l) => [`M${e + o / 2},${-s / 2}`, `a${c},${l} 0,0,0 0,${s}`].join(" "), "createInnerCylinderPathD"), MIN_HEIGHT4 = 5, MIN_WIDTH4 = 10;
|
|
2517
|
+
async function tiltedCylinder(a, o) {
|
|
2518
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(o);
|
|
2519
|
+
o.labelStyle = s;
|
|
2520
|
+
let l = o.padding ?? 0, u = o.look === "neo" ? 12 : l / 2;
|
|
2521
|
+
if (o.width || o.height) {
|
|
2522
|
+
let e = o.height ?? 0;
|
|
2523
|
+
o.height = (o.height ?? 0) - u, o.height < MIN_HEIGHT4 && (o.height = MIN_HEIGHT4);
|
|
2524
|
+
let a2 = e / 2 / (2.5 + e / 50);
|
|
2525
|
+
o.width = (o.width ?? 0) - u - a2 * 3, o.width < MIN_WIDTH4 && (o.width = MIN_WIDTH4);
|
|
2526
|
+
}
|
|
2527
|
+
let { shapeSvg: d, bbox: f, label: p } = await labelHelper(a, o, getNodeClasses(o)), m = (o.height ? o.height : f.height) + u, h = m / 2, g = h / (2.5 + m / 50), _ = (o.width ? o.width : f.width) + g + u, { cssStyles: b } = o, x;
|
|
2528
|
+
if (o.look === "handDrawn") {
|
|
2529
|
+
let e = at.svg(d), a2 = createOuterCylinderPathD3(0, 0, _, m, g, h), s2 = createInnerCylinderPathD3(0, 0, _, m, g, h), c2 = e.path(a2, userNodeOverrides(o, {})), l2 = e.path(s2, userNodeOverrides(o, { fill: "none" }));
|
|
2530
|
+
x = d.insert(() => l2, ":first-child"), x = d.insert(() => c2, ":first-child"), x.attr("class", "basic label-container"), b && x.attr("style", b);
|
|
2531
|
+
} else {
|
|
2532
|
+
let a2 = createCylinderPathD3(0, 0, _, m, g, h);
|
|
2533
|
+
x = d.insert("path", ":first-child").attr("d", a2).attr("class", "basic label-container").attr("style", handleUndefinedAttr(b)).attr("style", c), x.attr("class", "basic label-container outer-path"), b && x.selectAll("path").attr("style", b), c && x.selectAll("path").attr("style", c);
|
|
2534
|
+
}
|
|
2535
|
+
return x.attr("label-offset-x", g), x.attr("transform", `translate(${-_ / 2}, ${m / 2} )`), p.attr("transform", `translate(${-(f.width / 2) - g - (f.x - (f.left ?? 0))}, ${-(f.height / 2) - (f.y - (f.top ?? 0))})`), updateNodeBounds(o, x), o.intersect = function(e) {
|
|
2536
|
+
let a2 = intersect_default.rect(o, e), s2 = a2.y - (o.y ?? 0);
|
|
2537
|
+
if (h != 0 && (Math.abs(s2) < (o.height ?? 0) / 2 || Math.abs(s2) == (o.height ?? 0) / 2 && Math.abs(a2.x - (o.x ?? 0)) > (o.width ?? 0) / 2 - g)) {
|
|
2538
|
+
let c2 = g * g * (1 - s2 * s2 / (h * h));
|
|
2539
|
+
c2 != 0 && (c2 = Math.sqrt(Math.abs(c2))), c2 = g - c2, e.x - (o.x ?? 0) > 0 && (c2 = -c2), a2.x += c2;
|
|
2540
|
+
}
|
|
2541
|
+
return a2;
|
|
2542
|
+
}, d;
|
|
2543
|
+
}
|
|
2544
|
+
__name(tiltedCylinder, "tiltedCylinder");
|
|
2545
|
+
async function trapezoid(e, a) {
|
|
2546
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2547
|
+
a.labelStyle = o;
|
|
2548
|
+
let c = a.padding ?? 0, l = (a.look, c), u = a.look === "neo" ? c * 2 : c, { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.height) ?? f.height) + l, m = ((a == null ? void 0 : a.width) ?? f.width) + u, h = [
|
|
2549
|
+
{
|
|
2550
|
+
x: -3 * p / 6,
|
|
2551
|
+
y: 0
|
|
2552
|
+
},
|
|
2553
|
+
{
|
|
2554
|
+
x: m + 3 * p / 6,
|
|
2555
|
+
y: 0
|
|
2556
|
+
},
|
|
2557
|
+
{
|
|
2558
|
+
x: m,
|
|
2559
|
+
y: -p
|
|
2560
|
+
},
|
|
2561
|
+
{
|
|
2562
|
+
x: 0,
|
|
2563
|
+
y: -p
|
|
2564
|
+
}
|
|
2565
|
+
], g, { cssStyles: _ } = a;
|
|
2566
|
+
if (a.look === "handDrawn") {
|
|
2567
|
+
let e2 = at.svg(d), o2 = userNodeOverrides(a, {}), s2 = createPathFromPoints(h), c2 = e2.path(s2, o2);
|
|
2568
|
+
g = d.insert(() => c2, ":first-child").attr("transform", `translate(${-m / 2}, ${p / 2})`), _ && g.attr("style", _);
|
|
2569
|
+
} else g = insertPolygonShape(d, m, p, h);
|
|
2570
|
+
return s && g.attr("style", s), a.width = m, a.height = p, updateNodeBounds(a, g), a.intersect = function(e2) {
|
|
2571
|
+
return intersect_default.polygon(a, h, e2);
|
|
2572
|
+
}, d;
|
|
2573
|
+
}
|
|
2574
|
+
__name(trapezoid, "trapezoid");
|
|
2575
|
+
async function trapezoidalPentagon(e, a) {
|
|
2576
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2577
|
+
a.labelStyle = o;
|
|
2578
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 16 : c, u = a.look === "neo" ? 12 : c;
|
|
2579
|
+
(a.width || a.height) && (a.height = (a.height ?? 0) - u * 2, a.height < 5 && (a.height = 5), a.width = (a.width ?? 0) - l * 2, a.width < 15 && (a.width = 15));
|
|
2580
|
+
let { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : f.width) + l * 2, m = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : f.height) + u * 2, { cssStyles: h } = a, g = at.svg(d), _ = userNodeOverrides(a, {});
|
|
2581
|
+
a.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
|
|
2582
|
+
let b = [
|
|
2583
|
+
{
|
|
2584
|
+
x: -p / 2 * 0.8,
|
|
2585
|
+
y: -m / 2
|
|
2586
|
+
},
|
|
2587
|
+
{
|
|
2588
|
+
x: p / 2 * 0.8,
|
|
2589
|
+
y: -m / 2
|
|
2590
|
+
},
|
|
2591
|
+
{
|
|
2592
|
+
x: p / 2,
|
|
2593
|
+
y: -m / 2 * 0.6
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
x: p / 2,
|
|
2597
|
+
y: m / 2
|
|
2598
|
+
},
|
|
2599
|
+
{
|
|
2600
|
+
x: -p / 2,
|
|
2601
|
+
y: m / 2
|
|
2602
|
+
},
|
|
2603
|
+
{
|
|
2604
|
+
x: -p / 2,
|
|
2605
|
+
y: -m / 2 * 0.6
|
|
2606
|
+
}
|
|
2607
|
+
], x = createPathFromPoints(b), S = g.path(x, _), C = d.insert(() => S, ":first-child");
|
|
2608
|
+
return C.attr("class", "basic label-container outer-path"), h && a.look !== "handDrawn" && C.selectChildren("path").attr("style", h), s && a.look !== "handDrawn" && C.selectChildren("path").attr("style", s), updateNodeBounds(a, C), a.intersect = function(e2) {
|
|
2609
|
+
return intersect_default.polygon(a, b, e2);
|
|
2610
|
+
}, d;
|
|
2611
|
+
}
|
|
2612
|
+
__name(trapezoidalPentagon, "trapezoidalPentagon");
|
|
2613
|
+
var MIN_HEIGHT5 = 10, MIN_WIDTH5 = 10;
|
|
2614
|
+
async function triangle(e, a) {
|
|
2615
|
+
var _a;
|
|
2616
|
+
let { labelStyles: o, nodeStyles: c } = styles2String(a);
|
|
2617
|
+
a.labelStyle = o;
|
|
2618
|
+
let l = a.padding ?? 0, u = a.look === "neo" ? l * 2 : l;
|
|
2619
|
+
(a.width || a.height) && (a.width = (((a == null ? void 0 : a.width) ?? 0) - u) / 2, a.width < MIN_WIDTH5 && (a.width = MIN_WIDTH5), a.height = (a == null ? void 0 : a.height) ?? 0, a.height < MIN_HEIGHT5 && (a.height = MIN_HEIGHT5));
|
|
2620
|
+
let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = evaluate((_a = getConfig2().flowchart) == null ? void 0 : _a.htmlLabels), _ = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : f.width) + u, b = (a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : _ + f.height, x = b, S = [
|
|
2621
|
+
{
|
|
2622
|
+
x: 0,
|
|
2623
|
+
y: 0
|
|
2624
|
+
},
|
|
2625
|
+
{
|
|
2626
|
+
x,
|
|
2627
|
+
y: 0
|
|
2628
|
+
},
|
|
2629
|
+
{
|
|
2630
|
+
x: x / 2,
|
|
2631
|
+
y: -b
|
|
2632
|
+
}
|
|
2633
|
+
], { cssStyles: C } = a, w = at.svg(d), T = userNodeOverrides(a, {});
|
|
2634
|
+
a.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
|
|
2635
|
+
let D = createPathFromPoints(S), j = w.path(D, T), M = d.insert(() => j, ":first-child").attr("transform", `translate(${-b / 2}, ${b / 2})`).attr("class", "outer-path");
|
|
2636
|
+
return C && a.look !== "handDrawn" && M.selectChildren("path").attr("style", C), c && a.look !== "handDrawn" && M.selectChildren("path").attr("style", c), a.width = _, a.height = b, updateNodeBounds(a, M), p.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${b / 2 - (f.height + (a.padding ?? 0) / (m ? 2 : 1) - (f.y - (f.top ?? 0)))})`), a.intersect = function(e2) {
|
|
2637
|
+
return log.info("Triangle intersect", a, S, e2), intersect_default.polygon(a, S, e2);
|
|
2638
|
+
}, d;
|
|
2639
|
+
}
|
|
2640
|
+
__name(triangle, "triangle");
|
|
2641
|
+
async function waveEdgedRectangle(e, a) {
|
|
2642
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2643
|
+
a.labelStyle = o;
|
|
2644
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 16 : c, u = a.look === "neo" ? 12 : c, d = true;
|
|
2645
|
+
(a.width || a.height) && (d = false, a.width = ((a == null ? void 0 : a.width) ?? 0) - l * 2, a.width < 10 && (a.width = 10), a.height = ((a == null ? void 0 : a.height) ?? 0) - u * 2, a.height < 10 && (a.height = 10));
|
|
2646
|
+
let { shapeSvg: f, bbox: p, label: m } = await labelHelper(e, a, getNodeClasses(a)), h = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : p.width) + (l ?? 0) * 2, g = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : p.height) + (u ?? 0) * 2, _ = a.look === "neo" ? g / 4 : g / 8, b = g + (d ? _ : -_), { cssStyles: x } = a, S = 14 - h, C = S > 0 ? S / 2 : 0, w = at.svg(f), T = userNodeOverrides(a, {});
|
|
2647
|
+
a.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
|
|
2648
|
+
let D = [
|
|
2649
|
+
{
|
|
2650
|
+
x: -h / 2 - C,
|
|
2651
|
+
y: b / 2
|
|
2652
|
+
},
|
|
2653
|
+
...generateFullSineWavePoints(-h / 2 - C, b / 2, h / 2 + C, b / 2, _, 0.8),
|
|
2654
|
+
{
|
|
2655
|
+
x: h / 2 + C,
|
|
2656
|
+
y: -b / 2
|
|
2657
|
+
},
|
|
2658
|
+
{
|
|
2659
|
+
x: -h / 2 - C,
|
|
2660
|
+
y: -b / 2
|
|
2661
|
+
}
|
|
2662
|
+
], M = createPathFromPoints(D), N = w.path(M, T), P = f.insert(() => N, ":first-child");
|
|
2663
|
+
return P.attr("class", "basic label-container outer-path"), x && a.look !== "handDrawn" && P.selectAll("path").attr("style", x), s && a.look !== "handDrawn" && P.selectAll("path").attr("style", s), P.attr("transform", `translate(0,${-_ / 2})`), m.attr("transform", `translate(${-h / 2 + (a.padding ?? 0) - (p.x - (p.left ?? 0))},${-g / 2 + (a.padding ?? 0) - _ - (p.y - (p.top ?? 0))})`), updateNodeBounds(a, P), a.intersect = function(e2) {
|
|
2664
|
+
return intersect_default.polygon(a, D, e2);
|
|
2665
|
+
}, f;
|
|
2666
|
+
}
|
|
2667
|
+
__name(waveEdgedRectangle, "waveEdgedRectangle");
|
|
2668
|
+
async function waveRectangle(e, a) {
|
|
2669
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2670
|
+
a.labelStyle = o;
|
|
2671
|
+
let c = a.padding ?? 0, l = a.look === "neo" ? 16 : c, u = a.look === "neo" ? 20 : c;
|
|
2672
|
+
if (a.width || a.height) {
|
|
2673
|
+
a.width = (a == null ? void 0 : a.width) ?? 0, a.width < 20 && (a.width = 20), a.height = (a == null ? void 0 : a.height) ?? 0, a.height < 10 && (a.height = 10);
|
|
2674
|
+
let e2 = Math.min(a.height * 0.2, a.height / 4);
|
|
2675
|
+
a.height = Math.ceil(a.height - u - 20 / 9 * e2), a.width -= l * 2;
|
|
2676
|
+
}
|
|
2677
|
+
let { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : f.width) + l * 2, m = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : f.height) + u, h = m / 8, g = m + h * 2, { cssStyles: _ } = a, b = at.svg(d), x = userNodeOverrides(a, {});
|
|
2678
|
+
a.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
|
|
2679
|
+
let S = [
|
|
2680
|
+
{
|
|
2681
|
+
x: -p / 2,
|
|
2682
|
+
y: g / 2
|
|
2683
|
+
},
|
|
2684
|
+
...generateFullSineWavePoints(-p / 2, g / 2, p / 2, g / 2, h, 1),
|
|
2685
|
+
{
|
|
2686
|
+
x: p / 2,
|
|
2687
|
+
y: -g / 2
|
|
2688
|
+
},
|
|
2689
|
+
...generateFullSineWavePoints(p / 2, -g / 2, -p / 2, -g / 2, h, -1)
|
|
2690
|
+
], C = createPathFromPoints(S), w = b.path(C, x), T = d.insert(() => w, ":first-child");
|
|
2691
|
+
return T.attr("class", "basic label-container"), _ && a.look !== "handDrawn" && T.selectAll("path").attr("style", _), s && a.look !== "handDrawn" && T.selectAll("path").attr("style", s), updateNodeBounds(a, T), a.intersect = function(e2) {
|
|
2692
|
+
return intersect_default.polygon(a, S, e2);
|
|
2693
|
+
}, d;
|
|
2694
|
+
}
|
|
2695
|
+
__name(waveRectangle, "waveRectangle");
|
|
2696
|
+
var rectOffset = 10;
|
|
2697
|
+
async function windowPane(e, a) {
|
|
2698
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
2699
|
+
a.labelStyle = o;
|
|
2700
|
+
let c = a.look === "neo" ? 16 : a.padding ?? 0, l = a.look === "neo" ? 12 : a.padding ?? 0;
|
|
2701
|
+
(a.width || a.height) && (a.width = Math.max(((a == null ? void 0 : a.width) ?? 0) - c * 2 - rectOffset, 10), a.height = Math.max(((a == null ? void 0 : a.height) ?? 0) - l * 2 - rectOffset, 10));
|
|
2702
|
+
let { shapeSvg: u, bbox: d, label: f } = await labelHelper(e, a, getNodeClasses(a)), p = ((a == null ? void 0 : a.width) ? a == null ? void 0 : a.width : d.width) + c * 2 + rectOffset, m = ((a == null ? void 0 : a.height) ? a == null ? void 0 : a.height : d.height) + l * 2 + rectOffset, h = p - rectOffset, g = m - rectOffset, _ = -h / 2, b = -g / 2, { cssStyles: x } = a, S = at.svg(u), C = userNodeOverrides(a, {}), w = [
|
|
2703
|
+
{
|
|
2704
|
+
x: _ - rectOffset,
|
|
2705
|
+
y: b - rectOffset
|
|
2706
|
+
},
|
|
2707
|
+
{
|
|
2708
|
+
x: _ - rectOffset,
|
|
2709
|
+
y: b + g
|
|
2710
|
+
},
|
|
2711
|
+
{
|
|
2712
|
+
x: _ + h,
|
|
2713
|
+
y: b + g
|
|
2714
|
+
},
|
|
2715
|
+
{
|
|
2716
|
+
x: _ + h,
|
|
2717
|
+
y: b - rectOffset
|
|
2718
|
+
}
|
|
2719
|
+
], T = `M${_ - rectOffset},${b - rectOffset} L${_ + h},${b - rectOffset} L${_ + h},${b + g} L${_ - rectOffset},${b + g} L${_ - rectOffset},${b - rectOffset}
|
|
2720
|
+
M${_ - rectOffset},${b} L${_ + h},${b}
|
|
2721
|
+
M${_},${b - rectOffset} L${_},${b + g}`;
|
|
2722
|
+
a.look !== "handDrawn" && (C.roughness = 0, C.fillStyle = "solid");
|
|
2723
|
+
let D = S.path(T, C), A = u.insert(() => D, ":first-child");
|
|
2724
|
+
return A.attr("transform", `translate(${rectOffset / 2}, ${rectOffset / 2})`), A.attr("class", "basic label-container outer-path"), x && a.look !== "handDrawn" && A.selectAll("path").attr("style", x), s && a.look !== "handDrawn" && A.selectAll("path").attr("style", s), f.attr("transform", `translate(${-(d.width / 2) + rectOffset / 2 - (d.x - (d.left ?? 0))}, ${-(d.height / 2) + rectOffset / 2 - (d.y - (d.top ?? 0))})`), updateNodeBounds(a, A), a.intersect = function(e2) {
|
|
2725
|
+
return intersect_default.polygon(a, w, e2);
|
|
2726
|
+
}, u;
|
|
2727
|
+
}
|
|
2728
|
+
__name(windowPane, "windowPane");
|
|
2729
|
+
var COLOR_THEMES = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), REDUX_THEMES = /* @__PURE__ */ new Set([
|
|
2730
|
+
"redux",
|
|
2731
|
+
"redux-dark",
|
|
2732
|
+
"redux-color",
|
|
2733
|
+
"redux-dark-color"
|
|
2734
|
+
]);
|
|
2735
|
+
async function erBox(e, o) {
|
|
2736
|
+
var _a, _b, _c, _d, _e;
|
|
2737
|
+
let s = o;
|
|
2738
|
+
s.alias && (o.label = s.alias);
|
|
2739
|
+
let { theme: l, themeVariables: u } = getConfig(), { rowEven: d, rowOdd: f, nodeBorder: p, borderColorArray: g } = u;
|
|
2740
|
+
if (o.look === "handDrawn") {
|
|
2741
|
+
let { themeVariables: a } = getConfig(), { background: s2 } = a;
|
|
2742
|
+
await erBox(e, {
|
|
2743
|
+
...o,
|
|
2744
|
+
id: o.id + "-background",
|
|
2745
|
+
domId: (o.domId || o.id) + "-background",
|
|
2746
|
+
look: "default",
|
|
2747
|
+
cssStyles: ["stroke: none", `fill: ${s2}`]
|
|
2748
|
+
});
|
|
2749
|
+
}
|
|
2750
|
+
let _ = getConfig();
|
|
2751
|
+
o.useHtmlLabels = _.htmlLabels;
|
|
2752
|
+
let b = ((_a = _.er) == null ? void 0 : _a.diagramPadding) ?? 10, x = ((_b = _.er) == null ? void 0 : _b.entityPadding) ?? 6, { cssStyles: S } = o, { labelStyles: C, nodeStyles: w } = styles2String(o);
|
|
2753
|
+
if (s.attributes.length === 0 && o.label) {
|
|
2754
|
+
let c = {
|
|
2755
|
+
rx: 0,
|
|
2756
|
+
ry: 0,
|
|
2757
|
+
labelPaddingX: b,
|
|
2758
|
+
labelPaddingY: b * 1.5,
|
|
2759
|
+
classes: ""
|
|
2760
|
+
};
|
|
2761
|
+
calculateTextWidth(o.label, _) + c.labelPaddingX * 2 < _.er.minEntityWidth && (o.width = _.er.minEntityWidth);
|
|
2762
|
+
let u2 = await drawRect(e, o, c);
|
|
2763
|
+
if (l != null && COLOR_THEMES.has(l)) {
|
|
2764
|
+
let e2 = s.colorIndex ?? 0;
|
|
2765
|
+
u2.attr("data-color-id", `color-${e2 % g.length}`);
|
|
2766
|
+
}
|
|
2767
|
+
if (!evaluate(_.htmlLabels)) {
|
|
2768
|
+
let e2 = u2.select("text"), a = (_c = e2.node()) == null ? void 0 : _c.getBBox();
|
|
2769
|
+
e2.attr("transform", `translate(${-a.width / 2}, 0)`);
|
|
2770
|
+
}
|
|
2771
|
+
return u2;
|
|
2772
|
+
}
|
|
2773
|
+
_.htmlLabels || (b *= 1.25, x *= 1.25);
|
|
2774
|
+
let T = getNodeClasses(o);
|
|
2775
|
+
T || (T = "node default");
|
|
2776
|
+
let E = e.insert("g").attr("class", T).attr("id", o.domId || o.id), D = await addText(E, o.label ?? "", _, 0, 0, ["name"], C);
|
|
2777
|
+
D.height += x;
|
|
2778
|
+
let A = 0, j = [], M = [], N = 0, P = 0, F = 0, I = 0, L = true, R = true;
|
|
2779
|
+
for (let e2 of s.attributes) {
|
|
2780
|
+
let a = await addText(E, e2.type, _, 0, A, ["attribute-type"], C);
|
|
2781
|
+
N = Math.max(N, a.width + b);
|
|
2782
|
+
let o2 = await addText(E, e2.name, _, 0, A, ["attribute-name"], C);
|
|
2783
|
+
P = Math.max(P, o2.width + b);
|
|
2784
|
+
let s2 = await addText(E, e2.keys.join(), _, 0, A, ["attribute-keys"], C);
|
|
2785
|
+
F = Math.max(F, s2.width + b);
|
|
2786
|
+
let c = await addText(E, e2.comment, _, 0, A, ["attribute-comment"], C);
|
|
2787
|
+
I = Math.max(I, c.width + b);
|
|
2788
|
+
let l2 = Math.max(a.height, o2.height, s2.height, c.height) + x;
|
|
2789
|
+
M.push({
|
|
2790
|
+
yOffset: A,
|
|
2791
|
+
rowHeight: l2
|
|
2792
|
+
}), A += l2;
|
|
2793
|
+
}
|
|
2794
|
+
let z = 4;
|
|
2795
|
+
F <= b && (L = false, F = 0, z--), I <= b && (R = false, I = 0, z--);
|
|
2796
|
+
let B = E.node().getBBox();
|
|
2797
|
+
if (D.width + b * 2 - (N + P + F + I) > 0) {
|
|
2798
|
+
let e2 = D.width + b * 2 - (N + P + F + I);
|
|
2799
|
+
N += e2 / z, P += e2 / z, F > 0 && (F += e2 / z), I > 0 && (I += e2 / z);
|
|
2800
|
+
}
|
|
2801
|
+
let V = N + P + F + I, H = at.svg(E), U = userNodeOverrides(o, {});
|
|
2802
|
+
o.look !== "handDrawn" && (U.roughness = 0, U.fillStyle = "solid");
|
|
2803
|
+
let W = 0;
|
|
2804
|
+
M.length > 0 && (W = M.reduce((e2, a) => e2 + ((a == null ? void 0 : a.rowHeight) ?? 0), 0));
|
|
2805
|
+
let G = Math.max(B.width + b * 2, (o == null ? void 0 : o.width) || 0, V), K = Math.max((W ?? 0) + D.height, (o == null ? void 0 : o.height) || 0), q = -G / 2, J = -K / 2;
|
|
2806
|
+
if (E.selectAll("g:not(:first-child)").each((e2, a, o2) => {
|
|
2807
|
+
let s2 = select_default(o2[a]), l2 = s2.attr("transform"), u2 = 0, d2 = 0;
|
|
2808
|
+
if (l2) {
|
|
2809
|
+
let e3 = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l2);
|
|
2810
|
+
e3 && (u2 = parseFloat(e3[1]), d2 = parseFloat(e3[2]), s2.attr("class").includes("attribute-name") ? u2 += N : s2.attr("class").includes("attribute-keys") ? u2 += N + P : s2.attr("class").includes("attribute-comment") && (u2 += N + P + F));
|
|
2811
|
+
}
|
|
2812
|
+
s2.attr("transform", `translate(${q + b / 2 + u2}, ${d2 + J + D.height + x / 2})`);
|
|
2813
|
+
}), E.select(".name").attr("transform", "translate(" + -D.width / 2 + ", " + (J + x / 2) + ")"), l != null && COLOR_THEMES.has(l)) {
|
|
2814
|
+
let e2 = s.colorIndex ?? 0;
|
|
2815
|
+
E.attr("data-color-id", `color-${e2 % g.length}`);
|
|
2816
|
+
}
|
|
2817
|
+
let Y = H.rectangle(q, J, G, K, U), X = E.insert(() => Y, ":first-child").attr("class", "outer-path").attr("style", S.join(""));
|
|
2818
|
+
j.push(0);
|
|
2819
|
+
for (let [e2, a] of M.entries()) {
|
|
2820
|
+
let o2 = (e2 + 1) % 2 == 0 && a.yOffset !== 0, s2 = H.rectangle(q, D.height + J + (a == null ? void 0 : a.yOffset), G, a == null ? void 0 : a.rowHeight, {
|
|
2821
|
+
...U,
|
|
2822
|
+
fill: o2 ? d : f,
|
|
2823
|
+
stroke: p
|
|
2824
|
+
});
|
|
2825
|
+
E.insert(() => s2, "g.label").attr("style", S.join("")).attr("class", `row-rect-${o2 ? "even" : "odd"}`);
|
|
2826
|
+
}
|
|
2827
|
+
let Z = 1e-4, Q = lineToPolygon(q, D.height + J, G + q, D.height + J, Z), $ = H.polygon(Q.map((e2) => [e2.x, e2.y]), U);
|
|
2828
|
+
if (E.insert(() => $).attr("class", "divider"), Q = lineToPolygon(N + q, D.height + J, N + q, K + J, Z), $ = H.polygon(Q.map((e2) => [e2.x, e2.y]), U), E.insert(() => $).attr("class", "divider"), L) {
|
|
2829
|
+
let e2 = N + P + q;
|
|
2830
|
+
Q = lineToPolygon(e2, D.height + J, e2, K + J, Z), $ = H.polygon(Q.map((e3) => [e3.x, e3.y]), U), E.insert(() => $).attr("class", "divider");
|
|
2831
|
+
}
|
|
2832
|
+
if (R) {
|
|
2833
|
+
let e2 = N + P + F + q;
|
|
2834
|
+
Q = lineToPolygon(e2, D.height + J, e2, K + J, Z), $ = H.polygon(Q.map((e3) => [e3.x, e3.y]), U), E.insert(() => $).attr("class", "divider");
|
|
2835
|
+
}
|
|
2836
|
+
for (let e2 of j) {
|
|
2837
|
+
let a = D.height + J + e2;
|
|
2838
|
+
Q = lineToPolygon(q, a, G + q, a, Z), $ = H.polygon(Q.map((e3) => [e3.x, e3.y]), U), E.insert(() => $).attr("class", "divider");
|
|
2839
|
+
}
|
|
2840
|
+
if (updateNodeBounds(o, X), w && o.look !== "handDrawn") if (l != null && REDUX_THEMES.has(l)) E.selectAll("path").attr("style", w);
|
|
2841
|
+
else {
|
|
2842
|
+
let e2 = (_e = (_d = w.split(";")) == null ? void 0 : _d.filter((e3) => e3.includes("stroke"))) == null ? void 0 : _e.map((e3) => `${e3}`).join("; ");
|
|
2843
|
+
E.selectAll("path").attr("style", e2 ?? ""), E.selectAll(".row-rect-even path").attr("style", w);
|
|
2844
|
+
}
|
|
2845
|
+
return o.intersect = function(e2) {
|
|
2846
|
+
return intersect_default.rect(o, e2);
|
|
2847
|
+
}, E;
|
|
2848
|
+
}
|
|
2849
|
+
__name(erBox, "erBox");
|
|
2850
|
+
async function addText(e, o, s, l = 0, u = 0, d = [], p = "") {
|
|
2851
|
+
let m = e.insert("g").attr("class", `label ${d.join(" ")}`).attr("transform", `translate(${l}, ${u})`).attr("style", p);
|
|
2852
|
+
o !== parseGenericTypes(o) && (o = parseGenericTypes(o), o = o.replaceAll("<", "<").replaceAll(">", ">"));
|
|
2853
|
+
let g = m.node().appendChild(await createText(m, o, {
|
|
2854
|
+
width: calculateTextWidth(o, s) + 100,
|
|
2855
|
+
style: p,
|
|
2856
|
+
useHtmlLabels: s.htmlLabels
|
|
2857
|
+
}, s));
|
|
2858
|
+
if (o.includes("<") || o.includes(">")) {
|
|
2859
|
+
let e2 = g.children[0];
|
|
2860
|
+
for (e2.textContent = e2.textContent.replaceAll("<", "<").replaceAll(">", ">"); e2.childNodes[0]; ) e2 = e2.childNodes[0], e2.textContent = e2.textContent.replaceAll("<", "<").replaceAll(">", ">");
|
|
2861
|
+
}
|
|
2862
|
+
let _ = g.getBBox();
|
|
2863
|
+
if (evaluate(s.htmlLabels)) {
|
|
2864
|
+
let e2 = g.children[0];
|
|
2865
|
+
e2.style.textAlign = "start";
|
|
2866
|
+
let a = select_default(g);
|
|
2867
|
+
_ = e2.getBoundingClientRect(), a.attr("width", _.width), a.attr("height", _.height);
|
|
2868
|
+
}
|
|
2869
|
+
return _;
|
|
2870
|
+
}
|
|
2871
|
+
__name(addText, "addText");
|
|
2872
|
+
function lineToPolygon(e, a, o, s, c) {
|
|
2873
|
+
return e === o ? [
|
|
2874
|
+
{
|
|
2875
|
+
x: e - c / 2,
|
|
2876
|
+
y: a
|
|
2877
|
+
},
|
|
2878
|
+
{
|
|
2879
|
+
x: e + c / 2,
|
|
2880
|
+
y: a
|
|
2881
|
+
},
|
|
2882
|
+
{
|
|
2883
|
+
x: o + c / 2,
|
|
2884
|
+
y: s
|
|
2885
|
+
},
|
|
2886
|
+
{
|
|
2887
|
+
x: o - c / 2,
|
|
2888
|
+
y: s
|
|
2889
|
+
}
|
|
2890
|
+
] : [
|
|
2891
|
+
{
|
|
2892
|
+
x: e,
|
|
2893
|
+
y: a - c / 2
|
|
2894
|
+
},
|
|
2895
|
+
{
|
|
2896
|
+
x: e,
|
|
2897
|
+
y: a + c / 2
|
|
2898
|
+
},
|
|
2899
|
+
{
|
|
2900
|
+
x: o,
|
|
2901
|
+
y: s + c / 2
|
|
2902
|
+
},
|
|
2903
|
+
{
|
|
2904
|
+
x: o,
|
|
2905
|
+
y: s - c / 2
|
|
2906
|
+
}
|
|
2907
|
+
];
|
|
2908
|
+
}
|
|
2909
|
+
__name(lineToPolygon, "lineToPolygon");
|
|
2910
|
+
async function textHelper(e, a, o, s, c = o.class.padding ?? 12) {
|
|
2911
|
+
let l = s ? 0 : 3, u = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId || a.id), d = null, f = null, p = null, m = null, h = 0, g = 0, _ = 0;
|
|
2912
|
+
if (d = u.insert("g").attr("class", "annotation-group text"), a.annotations.length > 0) {
|
|
2913
|
+
let e2 = a.annotations[0];
|
|
2914
|
+
await addText2(d, { text: `\xAB${e2}\xBB` }, 0), h = d.node().getBBox().height;
|
|
2915
|
+
}
|
|
2916
|
+
f = u.insert("g").attr("class", "label-group text"), await addText2(f, a, 0, ["font-weight: bolder"]);
|
|
2917
|
+
let v = f.node().getBBox();
|
|
2918
|
+
g = v.height, p = u.insert("g").attr("class", "members-group text");
|
|
2919
|
+
let y = 0;
|
|
2920
|
+
for (let e2 of a.members) {
|
|
2921
|
+
let a2 = await addText2(p, e2, y, [e2.parseClassifier()]);
|
|
2922
|
+
y += a2 + l;
|
|
2923
|
+
}
|
|
2924
|
+
_ = p.node().getBBox().height, _ <= 0 && (_ = c / 2), m = u.insert("g").attr("class", "methods-group text");
|
|
2925
|
+
let b = 0;
|
|
2926
|
+
for (let e2 of a.methods) {
|
|
2927
|
+
let a2 = await addText2(m, e2, b, [e2.parseClassifier()]);
|
|
2928
|
+
b += a2 + l;
|
|
2929
|
+
}
|
|
2930
|
+
let x = u.node().getBBox();
|
|
2931
|
+
if (d !== null) {
|
|
2932
|
+
let e2 = d.node().getBBox();
|
|
2933
|
+
d.attr("transform", `translate(${-e2.width / 2})`);
|
|
2934
|
+
}
|
|
2935
|
+
return f.attr("transform", `translate(${-v.width / 2}, ${h})`), x = u.node().getBBox(), p.attr("transform", `translate(0, ${h + g + c * 2})`), x = u.node().getBBox(), m.attr("transform", `translate(0, ${h + g + (_ ? _ + c * 4 : c * 2)})`), x = u.node().getBBox(), {
|
|
2936
|
+
shapeSvg: u,
|
|
2937
|
+
bbox: x
|
|
2938
|
+
};
|
|
2939
|
+
}
|
|
2940
|
+
__name(textHelper, "textHelper");
|
|
2941
|
+
async function addText2(e, s, f, p = []) {
|
|
2942
|
+
let g = e.insert("g").attr("class", "label").attr("style", p.join("; ")), _ = getConfig(), v = "useHtmlLabels" in s ? s.useHtmlLabels : evaluate(_.htmlLabels) ?? true, y = "";
|
|
2943
|
+
y = "text" in s ? s.text : s.label, !v && y.startsWith("\\") && (y = y.substring(1)), hasKatex(y) && (v = true);
|
|
2944
|
+
let b = await createText(g, sanitizeText3(decodeEntities(y)), {
|
|
2945
|
+
width: calculateTextWidth(y, _) + 50,
|
|
2946
|
+
classes: "markdown-node-label",
|
|
2947
|
+
useHtmlLabels: v
|
|
2948
|
+
}, _), x, S = 1;
|
|
2949
|
+
if (v) {
|
|
2950
|
+
let e2 = b.children[0], a = select_default(b);
|
|
2951
|
+
S = e2.innerHTML.split("<br>").length, e2.innerHTML.includes("</math>") && (S += e2.innerHTML.split("<mrow>").length - 1);
|
|
2952
|
+
let o = e2.getElementsByTagName("img");
|
|
2953
|
+
if (o) {
|
|
2954
|
+
let e3 = y.replace(/<img[^>]*>/g, "").trim() === "";
|
|
2955
|
+
await Promise.all([...o].map((a2) => new Promise((o2) => {
|
|
2956
|
+
function s2() {
|
|
2957
|
+
var _a;
|
|
2958
|
+
if (a2.style.display = "flex", a2.style.flexDirection = "column", e3) {
|
|
2959
|
+
let e4 = ((_a = _.fontSize) == null ? void 0 : _a.toString()) ?? window.getComputedStyle(document.body).fontSize, o3 = parseInt(e4, 10) * 5 + "px";
|
|
2960
|
+
a2.style.minWidth = o3, a2.style.maxWidth = o3;
|
|
2961
|
+
} else a2.style.width = "100%";
|
|
2962
|
+
o2(a2);
|
|
2963
|
+
}
|
|
2964
|
+
__name(s2, "setupImage"), setTimeout(() => {
|
|
2965
|
+
a2.complete && s2();
|
|
2966
|
+
}), a2.addEventListener("error", s2), a2.addEventListener("load", s2);
|
|
2967
|
+
})));
|
|
2968
|
+
}
|
|
2969
|
+
x = e2.getBoundingClientRect(), a.attr("width", x.width), a.attr("height", x.height);
|
|
2970
|
+
} else {
|
|
2971
|
+
p.includes("font-weight: bolder") && select_default(b).selectAll("tspan").attr("font-weight", ""), S = b.children.length;
|
|
2972
|
+
let e2 = b.children[0];
|
|
2973
|
+
(b.textContent === "" || b.textContent.includes(">")) && (e2.textContent = y[0] + y.substring(1).replaceAll(">", ">").replaceAll("<", "<").trim(), y[1] === " " && (e2.textContent = e2.textContent[0] + " " + e2.textContent.substring(1))), e2.textContent === "undefined" && (e2.textContent = ""), x = b.getBBox();
|
|
2974
|
+
}
|
|
2975
|
+
return g.attr("transform", "translate(0," + (-x.height / (2 * S) + f) + ")"), x.height;
|
|
2976
|
+
}
|
|
2977
|
+
__name(addText2, "addText");
|
|
2978
|
+
async function classBox(e, a) {
|
|
2979
|
+
var _a, _b;
|
|
2980
|
+
let o = getConfig2(), { themeVariables: s } = o, { useGradient: l } = s, u = o.class.padding ?? 12, d = u, f = a.useHtmlLabels ?? evaluate(o.htmlLabels) ?? true, p = a;
|
|
2981
|
+
p.annotations = p.annotations ?? [], p.members = p.members ?? [], p.methods = p.methods ?? [];
|
|
2982
|
+
let { shapeSvg: m, bbox: _ } = await textHelper(e, a, o, f, d), { labelStyles: b, nodeStyles: x } = styles2String(a);
|
|
2983
|
+
a.labelStyle = b, a.cssStyles = p.styles || "";
|
|
2984
|
+
let S = ((_a = p.styles) == null ? void 0 : _a.join(";")) || x || "";
|
|
2985
|
+
a.cssStyles || (a.cssStyles = S.replaceAll("!important", "").split(";"));
|
|
2986
|
+
let C = p.members.length === 0 && p.methods.length === 0 && !((_b = o.class) == null ? void 0 : _b.hideEmptyMembersBox), w = at.svg(m), T = userNodeOverrides(a, {});
|
|
2987
|
+
a.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
|
|
2988
|
+
let E = Math.max(a.width ?? 0, _.width), D = Math.max(a.height ?? 0, _.height), k = (a.height ?? 0) > _.height;
|
|
2989
|
+
p.members.length === 0 && p.methods.length === 0 ? D += d : p.members.length > 0 && p.methods.length === 0 && (D += d * 2);
|
|
2990
|
+
let A = -E / 2, j = -D / 2, M = C ? u * 2 : p.members.length === 0 && p.methods.length === 0 ? -u : 0;
|
|
2991
|
+
k && (M = u * 2);
|
|
2992
|
+
let N = w.rectangle(A - u, j - u - (C ? u : p.members.length === 0 && p.methods.length === 0 ? -u / 2 : 0), E + 2 * u, D + 2 * u + M, T), P = m.insert(() => N, ":first-child");
|
|
2993
|
+
P.attr("class", "basic label-container outer-path");
|
|
2994
|
+
let F = P.node().getBBox(), I = m.select(".annotation-group").node().getBBox().height - (C ? u / 2 : 0) || 0, L = m.select(".label-group").node().getBBox().height - (C ? u / 2 : 0) || 0, R = m.select(".members-group").node().getBBox().height - (C ? u / 2 : 0) || 0, z = (I + L + j + u - (j - u - (C ? u : p.members.length === 0 && p.methods.length === 0 ? -u / 2 : 0))) / 2;
|
|
2995
|
+
if (m.selectAll(".text").each((e2, a2, s2) => {
|
|
2996
|
+
var _a2, _b2;
|
|
2997
|
+
let l2 = select_default(s2[a2]), h = l2.attr("transform"), g = 0;
|
|
2998
|
+
if (h) {
|
|
2999
|
+
let e3 = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(h);
|
|
3000
|
+
e3 && (g = parseFloat(e3[2]));
|
|
3001
|
+
}
|
|
3002
|
+
let _2 = g + j + u - (C ? u : p.members.length === 0 && p.methods.length === 0 ? -u / 2 : 0);
|
|
3003
|
+
if (l2.attr("class").includes("methods-group")) {
|
|
3004
|
+
let e3 = Math.max(R, d / 2);
|
|
3005
|
+
_2 = k ? Math.max(z, I + L + e3 + j + d * 2 + u) + d * 2 : I + L + e3 + j + d * 4 + u;
|
|
3006
|
+
}
|
|
3007
|
+
p.members.length === 0 && p.methods.length === 0 && ((_a2 = o.class) == null ? void 0 : _a2.hideEmptyMembersBox) && (_2 = p.annotations.length > 0 ? g - d : g), f || (_2 -= 4);
|
|
3008
|
+
let v = A;
|
|
3009
|
+
(l2.attr("class").includes("label-group") || l2.attr("class").includes("annotation-group")) && (v = -((_b2 = l2.node()) == null ? void 0 : _b2.getBBox().width) / 2 || 0, m.selectAll("text").each(function(e3, a3, o2) {
|
|
3010
|
+
window.getComputedStyle(o2[a3]).textAnchor === "middle" && (v = 0);
|
|
3011
|
+
})), l2.attr("transform", `translate(${v}, ${_2})`);
|
|
3012
|
+
}), p.members.length > 0 || p.methods.length > 0 || C) {
|
|
3013
|
+
let e2 = I + L + j + u, o2 = w.line(F.x, e2, F.x + F.width, e2 + 1e-3, T);
|
|
3014
|
+
m.insert(() => o2).attr("class", `divider${a.look === "neo" && !l ? " neo-line" : ""}`).attr("style", S);
|
|
3015
|
+
}
|
|
3016
|
+
if (C || p.members.length > 0 || p.methods.length > 0) {
|
|
3017
|
+
let e2 = I + L + R + j + d * 2 + u, o2 = w.line(F.x, k ? Math.max(z, e2) : e2, F.x + F.width, (k ? Math.max(z, e2) : e2) + 1e-3, T);
|
|
3018
|
+
m.insert(() => o2).attr("class", `divider${a.look === "neo" && !l ? " neo-line" : ""}`).attr("style", S);
|
|
3019
|
+
}
|
|
3020
|
+
if (p.look !== "handDrawn" && m.selectAll("path").attr("style", S), P.select(":nth-child(2)").attr("style", S), m.selectAll(".divider").select("path").attr("style", S), a.labelStyle ? m.selectAll("span").attr("style", a.labelStyle) : m.selectAll("span").attr("style", S), !f) {
|
|
3021
|
+
let e2 = RegExp(/color\s*:\s*([^;]*)/), a2 = e2.exec(S);
|
|
3022
|
+
if (a2) {
|
|
3023
|
+
let e3 = a2[0].replace("color", "fill");
|
|
3024
|
+
m.selectAll("tspan").attr("style", e3);
|
|
3025
|
+
} else if (b) {
|
|
3026
|
+
let a3 = e2.exec(b);
|
|
3027
|
+
if (a3) {
|
|
3028
|
+
let e3 = a3[0].replace("color", "fill");
|
|
3029
|
+
m.selectAll("tspan").attr("style", e3);
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
return updateNodeBounds(a, P), a.intersect = function(e2) {
|
|
3034
|
+
return intersect_default.rect(a, e2);
|
|
3035
|
+
}, m;
|
|
3036
|
+
}
|
|
3037
|
+
__name(classBox, "classBox");
|
|
3038
|
+
async function requirementBox(e, a) {
|
|
3039
|
+
var _a, _b;
|
|
3040
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
3041
|
+
a.labelStyle = o;
|
|
3042
|
+
let l = a, u = a, d = "verifyMethod" in a, f = getNodeClasses(a), { themeVariables: p } = getConfig2(), { borderColorArray: m, requirementEdgeLabelBackground: h } = p, _ = e.insert("g").attr("class", f).attr("id", a.domId ?? a.id), b;
|
|
3043
|
+
b = d ? await addText3(_, `<<${l.type}>>`, 0, a.labelStyle) : await addText3(_, "<<Element>>", 0, a.labelStyle);
|
|
3044
|
+
let x = b, S = await addText3(_, l.name, x, a.labelStyle + "; font-weight: bold;");
|
|
3045
|
+
if (x += S + 20, d) {
|
|
3046
|
+
let e2 = await addText3(_, `${l.requirementId ? `ID: ${l.requirementId}` : ""}`, x, a.labelStyle);
|
|
3047
|
+
x += e2;
|
|
3048
|
+
let o2 = await addText3(_, `${l.text ? `Text: ${l.text}` : ""}`, x, a.labelStyle);
|
|
3049
|
+
x += o2;
|
|
3050
|
+
let s2 = await addText3(_, `${l.risk ? `Risk: ${l.risk}` : ""}`, x, a.labelStyle);
|
|
3051
|
+
x += s2, await addText3(_, `${l.verifyMethod ? `Verification: ${l.verifyMethod}` : ""}`, x, a.labelStyle);
|
|
3052
|
+
} else {
|
|
3053
|
+
let e2 = await addText3(_, `${u.type ? `Type: ${u.type}` : ""}`, x, a.labelStyle);
|
|
3054
|
+
x += e2, await addText3(_, `${u.docRef ? `Doc Ref: ${u.docRef}` : ""}`, x, a.labelStyle);
|
|
3055
|
+
}
|
|
3056
|
+
let C = (((_a = _.node()) == null ? void 0 : _a.getBBox().width) ?? 200) + 20, w = (((_b = _.node()) == null ? void 0 : _b.getBBox().height) ?? 200) + 20, T = -C / 2, E = -w / 2, D = at.svg(_), A = userNodeOverrides(a, {});
|
|
3057
|
+
a.look !== "handDrawn" && (A.roughness = 0, A.fillStyle = "solid");
|
|
3058
|
+
let j = D.rectangle(T, E, C, w, A), M = _.insert(() => j, ":first-child");
|
|
3059
|
+
if (M.attr("class", "basic label-container outer-path").attr("style", s), m == null ? void 0 : m.length) {
|
|
3060
|
+
let e2 = a.colorIndex ?? 0;
|
|
3061
|
+
_.attr("data-color-id", `color-${e2 % m.length}`);
|
|
3062
|
+
}
|
|
3063
|
+
if (_.selectAll(".label").each((e2, a2, o2) => {
|
|
3064
|
+
let s2 = select_default(o2[a2]), l2 = s2.attr("transform"), u2 = 0, d2 = 0;
|
|
3065
|
+
if (l2) {
|
|
3066
|
+
let e3 = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l2);
|
|
3067
|
+
e3 && (u2 = parseFloat(e3[1]), d2 = parseFloat(e3[2]));
|
|
3068
|
+
}
|
|
3069
|
+
let f2 = d2 - w / 2, p2 = T + 20 / 2;
|
|
3070
|
+
(a2 === 0 || a2 === 1) && (p2 = u2), s2.attr("transform", `translate(${p2}, ${f2 + 20})`);
|
|
3071
|
+
}), x > b + S + 20) {
|
|
3072
|
+
let e2 = E + b + S + 20, o2;
|
|
3073
|
+
if (a.look === "neo") {
|
|
3074
|
+
let a2 = 1e-3, s2 = [
|
|
3075
|
+
[T, e2],
|
|
3076
|
+
[T + C, e2],
|
|
3077
|
+
[T + C, e2 + a2],
|
|
3078
|
+
[T, e2 + a2]
|
|
3079
|
+
];
|
|
3080
|
+
o2 = D.polygon(s2, A);
|
|
3081
|
+
} else o2 = D.line(T, e2, T + C, e2, A);
|
|
3082
|
+
_.insert(() => o2).attr("class", "divider");
|
|
3083
|
+
}
|
|
3084
|
+
return updateNodeBounds(a, M), a.intersect = function(e2) {
|
|
3085
|
+
return intersect_default.rect(a, e2);
|
|
3086
|
+
}, s && a.look !== "handDrawn" && (h || (m == null ? void 0 : m.length)) && _.selectAll("path").attr("style", s), _;
|
|
3087
|
+
}
|
|
3088
|
+
__name(requirementBox, "requirementBox");
|
|
3089
|
+
async function addText3(e, s, l, u = "") {
|
|
3090
|
+
if (s === "") return 0;
|
|
3091
|
+
let f = e.insert("g").attr("class", "label").attr("style", u), p = getConfig2(), m = p.htmlLabels ?? true, h = await createText(f, sanitizeText3(decodeEntities(s)), {
|
|
3092
|
+
width: calculateTextWidth(s, p) + 50,
|
|
3093
|
+
classes: "markdown-node-label",
|
|
3094
|
+
useHtmlLabels: m,
|
|
3095
|
+
style: u
|
|
3096
|
+
}, p), _;
|
|
3097
|
+
if (m) {
|
|
3098
|
+
let e2 = h.children[0], a = select_default(h);
|
|
3099
|
+
_ = e2.getBoundingClientRect(), a.attr("width", _.width), a.attr("height", _.height);
|
|
3100
|
+
} else {
|
|
3101
|
+
let e2 = h.children[0];
|
|
3102
|
+
for (let a of e2.children) u && a.setAttribute("style", u);
|
|
3103
|
+
_ = h.getBBox(), _.height += 6;
|
|
3104
|
+
}
|
|
3105
|
+
return f.attr("transform", `translate(${-_.width / 2},${-_.height / 2 + l})`), _.height;
|
|
3106
|
+
}
|
|
3107
|
+
__name(addText3, "addText");
|
|
3108
|
+
var colorFromPriority = /* @__PURE__ */ __name((e) => {
|
|
3109
|
+
switch (e) {
|
|
3110
|
+
case "Very High":
|
|
3111
|
+
return "red";
|
|
3112
|
+
case "High":
|
|
3113
|
+
return "orange";
|
|
3114
|
+
case "Medium":
|
|
3115
|
+
return null;
|
|
3116
|
+
case "Low":
|
|
3117
|
+
return "blue";
|
|
3118
|
+
case "Very Low":
|
|
3119
|
+
return "lightblue";
|
|
3120
|
+
}
|
|
3121
|
+
}, "colorFromPriority");
|
|
3122
|
+
async function kanbanItem(e, a, { config: o }) {
|
|
3123
|
+
var _a, _b;
|
|
3124
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
3125
|
+
a.labelStyle = s || "";
|
|
3126
|
+
let l = a.width;
|
|
3127
|
+
a.width = (a.width ?? 200) - 10;
|
|
3128
|
+
let { shapeSvg: u, bbox: d, label: f } = await labelHelper(e, a, getNodeClasses(a)), p = a.padding || 10, m = "", h;
|
|
3129
|
+
"ticket" in a && a.ticket && ((_a = o == null ? void 0 : o.kanban) == null ? void 0 : _a.ticketBaseUrl) && (m = (_b = o == null ? void 0 : o.kanban) == null ? void 0 : _b.ticketBaseUrl.replace("#TICKET#", a.ticket), h = u.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", m).attr("target", "_blank"));
|
|
3130
|
+
let g = {
|
|
3131
|
+
useHtmlLabels: a.useHtmlLabels,
|
|
3132
|
+
labelStyle: a.labelStyle || "",
|
|
3133
|
+
width: a.width,
|
|
3134
|
+
img: a.img,
|
|
3135
|
+
padding: a.padding || 8,
|
|
3136
|
+
centerLabel: false
|
|
3137
|
+
}, _, b;
|
|
3138
|
+
h ? { label: _, bbox: b } = await insertLabel(h, "ticket" in a && a.ticket || "", g) : { label: _, bbox: b } = await insertLabel(u, "ticket" in a && a.ticket || "", g);
|
|
3139
|
+
let { label: x, bbox: S } = await insertLabel(u, "assigned" in a && a.assigned || "", g);
|
|
3140
|
+
a.width = l;
|
|
3141
|
+
let C = (a == null ? void 0 : a.width) || 0, w = Math.max(b.height, S.height) / 2, T = Math.max(d.height + 20, (a == null ? void 0 : a.height) || 0) + w, A = -C / 2, j = -T / 2;
|
|
3142
|
+
f.attr("transform", "translate(" + (p - C / 2) + ", " + (-w - d.height / 2) + ")"), _.attr("transform", "translate(" + (p - C / 2) + ", " + (-w + d.height / 2) + ")"), x.attr("transform", "translate(" + (p + C / 2 - S.width - 20) + ", " + (-w + d.height / 2) + ")");
|
|
3143
|
+
let M, { rx: N, ry: P } = a, { cssStyles: F } = a;
|
|
3144
|
+
if (a.look === "handDrawn") {
|
|
3145
|
+
let e2 = at.svg(u), o2 = userNodeOverrides(a, {}), s2 = N || P ? e2.path(createRoundedRectPathD(A, j, C, T, N || 0), o2) : e2.rectangle(A, j, C, T, o2);
|
|
3146
|
+
M = u.insert(() => s2, ":first-child"), M.attr("class", "basic label-container").attr("style", F || null);
|
|
3147
|
+
} else {
|
|
3148
|
+
M = u.insert("rect", ":first-child"), M.attr("class", "basic label-container __APA__").attr("style", c).attr("rx", N ?? 5).attr("ry", P ?? 5).attr("x", A).attr("y", j).attr("width", C).attr("height", T);
|
|
3149
|
+
let e2 = "priority" in a && a.priority;
|
|
3150
|
+
if (e2) {
|
|
3151
|
+
let a2 = u.append("line"), o2 = A + 2, s2 = j + Math.floor((N ?? 0) / 2), c2 = j + T - Math.floor((N ?? 0) / 2);
|
|
3152
|
+
a2.attr("x1", o2).attr("y1", s2).attr("x2", o2).attr("y2", c2).attr("stroke-width", "4").attr("stroke", colorFromPriority(e2));
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
return updateNodeBounds(a, M), a.height = T, a.intersect = function(e2) {
|
|
3156
|
+
return intersect_default.rect(a, e2);
|
|
3157
|
+
}, u;
|
|
3158
|
+
}
|
|
3159
|
+
__name(kanbanItem, "kanbanItem");
|
|
3160
|
+
async function bang(a, o) {
|
|
3161
|
+
let { labelStyles: c, nodeStyles: l } = styles2String(o);
|
|
3162
|
+
o.labelStyle = c;
|
|
3163
|
+
let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await labelHelper(a, o, getNodeClasses(o)), m = d.width + 10 * f, h = d.height + 8 * f, g = 0.15 * m, { cssStyles: _ } = o, b = d.width + 20, x = d.height + 20, S = Math.max(m, b), C = Math.max(h, x);
|
|
3164
|
+
p.attr("transform", `translate(${-d.width / 2}, ${-d.height / 2})`);
|
|
3165
|
+
let w, T = `M0 0
|
|
3166
|
+
a${g},${g} 1 0,0 ${S * 0.25},${-1 * C * 0.1}
|
|
3167
|
+
a${g},${g} 1 0,0 ${S * 0.25},0
|
|
3168
|
+
a${g},${g} 1 0,0 ${S * 0.25},0
|
|
3169
|
+
a${g},${g} 1 0,0 ${S * 0.25},${C * 0.1}
|
|
3170
|
+
|
|
3171
|
+
a${g},${g} 1 0,0 ${S * 0.15},${C * 0.33}
|
|
3172
|
+
a${g * 0.8},${g * 0.8} 1 0,0 0,${C * 0.34}
|
|
3173
|
+
a${g},${g} 1 0,0 ${-1 * S * 0.15},${C * 0.33}
|
|
3174
|
+
|
|
3175
|
+
a${g},${g} 1 0,0 ${-1 * S * 0.25},${C * 0.15}
|
|
3176
|
+
a${g},${g} 1 0,0 ${-1 * S * 0.25},0
|
|
3177
|
+
a${g},${g} 1 0,0 ${-1 * S * 0.25},0
|
|
3178
|
+
a${g},${g} 1 0,0 ${-1 * S * 0.25},${-1 * C * 0.15}
|
|
3179
|
+
|
|
3180
|
+
a${g},${g} 1 0,0 ${-1 * S * 0.1},${-1 * C * 0.33}
|
|
3181
|
+
a${g * 0.8},${g * 0.8} 1 0,0 0,${-1 * C * 0.34}
|
|
3182
|
+
a${g},${g} 1 0,0 ${S * 0.1},${-1 * C * 0.33}
|
|
3183
|
+
H0 V0 Z`;
|
|
3184
|
+
if (o.look === "handDrawn") {
|
|
3185
|
+
let a2 = at.svg(u), s = userNodeOverrides(o, {}), c2 = a2.path(T, s);
|
|
3186
|
+
w = u.insert(() => c2, ":first-child"), w.attr("class", "basic label-container").attr("style", handleUndefinedAttr(_));
|
|
3187
|
+
} else w = u.insert("path", ":first-child").attr("class", "basic label-container").attr("style", l).attr("d", T);
|
|
3188
|
+
return w.attr("transform", `translate(${-S / 2}, ${-C / 2})`), updateNodeBounds(o, w), o.calcIntersect = function(e, a2) {
|
|
3189
|
+
return intersect_default.rect(e, a2);
|
|
3190
|
+
}, o.intersect = function(e) {
|
|
3191
|
+
return log.info("Bang intersect", o, e), intersect_default.rect(o, e);
|
|
3192
|
+
}, u;
|
|
3193
|
+
}
|
|
3194
|
+
__name(bang, "bang");
|
|
3195
|
+
async function cloud(a, o) {
|
|
3196
|
+
let { labelStyles: c, nodeStyles: l } = styles2String(o);
|
|
3197
|
+
o.labelStyle = c;
|
|
3198
|
+
let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await labelHelper(a, o, getNodeClasses(o)), m = d.width + 2 * f, h = d.height + 2 * f, g = 0.15 * m, _ = 0.25 * m, b = 0.35 * m, x = 0.2 * m, { cssStyles: S } = o, C, w = `M0 0
|
|
3199
|
+
a${g},${g} 0 0,1 ${m * 0.25},${-1 * m * 0.1}
|
|
3200
|
+
a${b},${b} 1 0,1 ${m * 0.4},${-1 * m * 0.1}
|
|
3201
|
+
a${_},${_} 1 0,1 ${m * 0.35},${m * 0.2}
|
|
3202
|
+
|
|
3203
|
+
a${g},${g} 1 0,1 ${m * 0.15},${h * 0.35}
|
|
3204
|
+
a${x},${x} 1 0,1 ${-1 * m * 0.15},${h * 0.65}
|
|
3205
|
+
|
|
3206
|
+
a${_},${g} 1 0,1 ${-1 * m * 0.25},${m * 0.15}
|
|
3207
|
+
a${b},${b} 1 0,1 ${-1 * m * 0.5},0
|
|
3208
|
+
a${g},${g} 1 0,1 ${-1 * m * 0.25},${-1 * m * 0.15}
|
|
3209
|
+
|
|
3210
|
+
a${g},${g} 1 0,1 ${-1 * m * 0.1},${-1 * h * 0.35}
|
|
3211
|
+
a${x},${x} 1 0,1 ${m * 0.1},${-1 * h * 0.65}
|
|
3212
|
+
H0 V0 Z`;
|
|
3213
|
+
if (o.look === "handDrawn") {
|
|
3214
|
+
let a2 = at.svg(u), s = userNodeOverrides(o, {}), c2 = a2.path(w, s);
|
|
3215
|
+
C = u.insert(() => c2, ":first-child"), C.attr("class", "basic label-container").attr("style", handleUndefinedAttr(S));
|
|
3216
|
+
} else C = u.insert("path", ":first-child").attr("class", "basic label-container").attr("style", l).attr("d", w);
|
|
3217
|
+
return p.attr("transform", `translate(${-d.width / 2}, ${-d.height / 2})`), C.attr("transform", `translate(${-m / 2}, ${-h / 2})`), updateNodeBounds(o, C), o.calcIntersect = function(e, a2) {
|
|
3218
|
+
return intersect_default.rect(e, a2);
|
|
3219
|
+
}, o.intersect = function(e) {
|
|
3220
|
+
return log.info("Cloud intersect", o, e), intersect_default.rect(o, e);
|
|
3221
|
+
}, u;
|
|
3222
|
+
}
|
|
3223
|
+
__name(cloud, "cloud");
|
|
3224
|
+
async function defaultMindmapNode(e, a) {
|
|
3225
|
+
let { labelStyles: o, nodeStyles: s } = styles2String(a);
|
|
3226
|
+
a.labelStyle = o;
|
|
3227
|
+
let { shapeSvg: c, bbox: l, halfPadding: u, label: d } = await labelHelper(e, a, getNodeClasses(a)), f = l.width + 8 * u, p = l.height + 2 * u, m = a.look === "neo" ? `
|
|
3228
|
+
M${-f / 2} ${p / 2 - 5}
|
|
3229
|
+
v${-p + 10}
|
|
3230
|
+
q0,-5 5,-5
|
|
3231
|
+
h${f - 10}
|
|
3232
|
+
q5,0 5,5
|
|
3233
|
+
v${p - 5}
|
|
3234
|
+
H${-f / 2}
|
|
3235
|
+
Z
|
|
3236
|
+
` : `
|
|
3237
|
+
M${-f / 2} ${p / 2 - 5}
|
|
3238
|
+
v${-p + 10}
|
|
3239
|
+
q0,-5 5,-5
|
|
3240
|
+
h${f - 10}
|
|
3241
|
+
q5,0 5,5
|
|
3242
|
+
v${p - 10}
|
|
3243
|
+
q0,5 -5,5
|
|
3244
|
+
h${-(f - 10)}
|
|
3245
|
+
q-5,0 -5,-5
|
|
3246
|
+
Z
|
|
3247
|
+
`;
|
|
3248
|
+
if (!a.domId) throw Error(`defaultMindmapNode: node "${a.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);
|
|
3249
|
+
let h = c.append("path").attr("id", a.domId).attr("class", "node-bkg node-" + a.type).attr("style", s).attr("d", m);
|
|
3250
|
+
return c.append("line").attr("class", "node-line-").attr("x1", -f / 2).attr("y1", p / 2).attr("x2", f / 2).attr("y2", p / 2), d.attr("transform", `translate(${-l.width / 2}, ${-l.height / 2})`), c.append(() => d.node()), updateNodeBounds(a, h), a.calcIntersect = function(e2, a2) {
|
|
3251
|
+
return intersect_default.rect(e2, a2);
|
|
3252
|
+
}, a.intersect = function(e2) {
|
|
3253
|
+
return intersect_default.rect(a, e2);
|
|
3254
|
+
}, c;
|
|
3255
|
+
}
|
|
3256
|
+
__name(defaultMindmapNode, "defaultMindmapNode");
|
|
3257
|
+
async function mindmapCircle(e, a) {
|
|
3258
|
+
return circle(e, a, { padding: a.padding ?? 0 });
|
|
3259
|
+
}
|
|
3260
|
+
__name(mindmapCircle, "mindmapCircle");
|
|
3261
|
+
var shapesDefs = [
|
|
3262
|
+
{
|
|
3263
|
+
semanticName: "Process",
|
|
3264
|
+
name: "Rectangle",
|
|
3265
|
+
shortName: "rect",
|
|
3266
|
+
description: "Standard process shape",
|
|
3267
|
+
aliases: [
|
|
3268
|
+
"proc",
|
|
3269
|
+
"process",
|
|
3270
|
+
"rectangle"
|
|
3271
|
+
],
|
|
3272
|
+
internalAliases: ["squareRect"],
|
|
3273
|
+
handler: squareRect2
|
|
3274
|
+
},
|
|
3275
|
+
{
|
|
3276
|
+
semanticName: "Event",
|
|
3277
|
+
name: "Rounded Rectangle",
|
|
3278
|
+
shortName: "rounded",
|
|
3279
|
+
description: "Represents an event",
|
|
3280
|
+
aliases: ["event"],
|
|
3281
|
+
internalAliases: ["roundedRect"],
|
|
3282
|
+
handler: roundedRect
|
|
3283
|
+
},
|
|
3284
|
+
{
|
|
3285
|
+
semanticName: "Terminal Point",
|
|
3286
|
+
name: "Stadium",
|
|
3287
|
+
shortName: "stadium",
|
|
3288
|
+
description: "Terminal point",
|
|
3289
|
+
aliases: ["terminal", "pill"],
|
|
3290
|
+
handler: stadium
|
|
3291
|
+
},
|
|
3292
|
+
{
|
|
3293
|
+
semanticName: "Subprocess",
|
|
3294
|
+
name: "Framed Rectangle",
|
|
3295
|
+
shortName: "fr-rect",
|
|
3296
|
+
description: "Subprocess",
|
|
3297
|
+
aliases: [
|
|
3298
|
+
"subprocess",
|
|
3299
|
+
"subproc",
|
|
3300
|
+
"framed-rectangle",
|
|
3301
|
+
"subroutine"
|
|
3302
|
+
],
|
|
3303
|
+
handler: subroutine
|
|
3304
|
+
},
|
|
3305
|
+
{
|
|
3306
|
+
semanticName: "Database",
|
|
3307
|
+
name: "Cylinder",
|
|
3308
|
+
shortName: "cyl",
|
|
3309
|
+
description: "Database storage",
|
|
3310
|
+
aliases: [
|
|
3311
|
+
"db",
|
|
3312
|
+
"database",
|
|
3313
|
+
"cylinder"
|
|
3314
|
+
],
|
|
3315
|
+
handler: cylinder
|
|
3316
|
+
},
|
|
3317
|
+
{
|
|
3318
|
+
semanticName: "Data Store",
|
|
3319
|
+
name: "Data Store",
|
|
3320
|
+
shortName: "datastore",
|
|
3321
|
+
description: "Data flow diagram data store",
|
|
3322
|
+
aliases: ["data-store"],
|
|
3323
|
+
handler: datastore
|
|
3324
|
+
},
|
|
3325
|
+
{
|
|
3326
|
+
semanticName: "Start",
|
|
3327
|
+
name: "Circle",
|
|
3328
|
+
shortName: "circle",
|
|
3329
|
+
description: "Starting point",
|
|
3330
|
+
aliases: ["circ"],
|
|
3331
|
+
handler: circle
|
|
3332
|
+
},
|
|
3333
|
+
{
|
|
3334
|
+
semanticName: "Bang",
|
|
3335
|
+
name: "Bang",
|
|
3336
|
+
shortName: "bang",
|
|
3337
|
+
description: "Bang",
|
|
3338
|
+
aliases: ["bang"],
|
|
3339
|
+
handler: bang
|
|
3340
|
+
},
|
|
3341
|
+
{
|
|
3342
|
+
semanticName: "Cloud",
|
|
3343
|
+
name: "Cloud",
|
|
3344
|
+
shortName: "cloud",
|
|
3345
|
+
description: "cloud",
|
|
3346
|
+
aliases: ["cloud"],
|
|
3347
|
+
handler: cloud
|
|
3348
|
+
},
|
|
3349
|
+
{
|
|
3350
|
+
semanticName: "Decision",
|
|
3351
|
+
name: "Diamond",
|
|
3352
|
+
shortName: "diam",
|
|
3353
|
+
description: "Decision-making step",
|
|
3354
|
+
aliases: [
|
|
3355
|
+
"decision",
|
|
3356
|
+
"diamond",
|
|
3357
|
+
"question"
|
|
3358
|
+
],
|
|
3359
|
+
handler: question
|
|
3360
|
+
},
|
|
3361
|
+
{
|
|
3362
|
+
semanticName: "Prepare Conditional",
|
|
3363
|
+
name: "Hexagon",
|
|
3364
|
+
shortName: "hex",
|
|
3365
|
+
description: "Preparation or condition step",
|
|
3366
|
+
aliases: ["hexagon", "prepare"],
|
|
3367
|
+
handler: hexagon
|
|
3368
|
+
},
|
|
3369
|
+
{
|
|
3370
|
+
semanticName: "Data Input/Output",
|
|
3371
|
+
name: "Lean Right",
|
|
3372
|
+
shortName: "lean-r",
|
|
3373
|
+
description: "Represents input or output",
|
|
3374
|
+
aliases: ["lean-right", "in-out"],
|
|
3375
|
+
internalAliases: ["lean_right"],
|
|
3376
|
+
handler: lean_right
|
|
3377
|
+
},
|
|
3378
|
+
{
|
|
3379
|
+
semanticName: "Data Input/Output",
|
|
3380
|
+
name: "Lean Left",
|
|
3381
|
+
shortName: "lean-l",
|
|
3382
|
+
description: "Represents output or input",
|
|
3383
|
+
aliases: ["lean-left", "out-in"],
|
|
3384
|
+
internalAliases: ["lean_left"],
|
|
3385
|
+
handler: lean_left
|
|
3386
|
+
},
|
|
3387
|
+
{
|
|
3388
|
+
semanticName: "Priority Action",
|
|
3389
|
+
name: "Trapezoid Base Bottom",
|
|
3390
|
+
shortName: "trap-b",
|
|
3391
|
+
description: "Priority action",
|
|
3392
|
+
aliases: [
|
|
3393
|
+
"priority",
|
|
3394
|
+
"trapezoid-bottom",
|
|
3395
|
+
"trapezoid"
|
|
3396
|
+
],
|
|
3397
|
+
handler: trapezoid
|
|
3398
|
+
},
|
|
3399
|
+
{
|
|
3400
|
+
semanticName: "Manual Operation",
|
|
3401
|
+
name: "Trapezoid Base Top",
|
|
3402
|
+
shortName: "trap-t",
|
|
3403
|
+
description: "Represents a manual task",
|
|
3404
|
+
aliases: [
|
|
3405
|
+
"manual",
|
|
3406
|
+
"trapezoid-top",
|
|
3407
|
+
"inv-trapezoid"
|
|
3408
|
+
],
|
|
3409
|
+
internalAliases: ["inv_trapezoid"],
|
|
3410
|
+
handler: inv_trapezoid
|
|
3411
|
+
},
|
|
3412
|
+
{
|
|
3413
|
+
semanticName: "Stop",
|
|
3414
|
+
name: "Double Circle",
|
|
3415
|
+
shortName: "dbl-circ",
|
|
3416
|
+
description: "Represents a stop point",
|
|
3417
|
+
aliases: ["double-circle"],
|
|
3418
|
+
internalAliases: ["doublecircle"],
|
|
3419
|
+
handler: doublecircle
|
|
3420
|
+
},
|
|
3421
|
+
{
|
|
3422
|
+
semanticName: "Text Block",
|
|
3423
|
+
name: "Text Block",
|
|
3424
|
+
shortName: "text",
|
|
3425
|
+
description: "Text block",
|
|
3426
|
+
handler: text
|
|
3427
|
+
},
|
|
3428
|
+
{
|
|
3429
|
+
semanticName: "Card",
|
|
3430
|
+
name: "Notched Rectangle",
|
|
3431
|
+
shortName: "notch-rect",
|
|
3432
|
+
description: "Represents a card",
|
|
3433
|
+
aliases: ["card", "notched-rectangle"],
|
|
3434
|
+
handler: card
|
|
3435
|
+
},
|
|
3436
|
+
{
|
|
3437
|
+
semanticName: "Lined/Shaded Process",
|
|
3438
|
+
name: "Lined Rectangle",
|
|
3439
|
+
shortName: "lin-rect",
|
|
3440
|
+
description: "Lined process shape",
|
|
3441
|
+
aliases: [
|
|
3442
|
+
"lined-rectangle",
|
|
3443
|
+
"lined-process",
|
|
3444
|
+
"lin-proc",
|
|
3445
|
+
"shaded-process"
|
|
3446
|
+
],
|
|
3447
|
+
handler: shadedProcess
|
|
3448
|
+
},
|
|
3449
|
+
{
|
|
3450
|
+
semanticName: "Start",
|
|
3451
|
+
name: "Small Circle",
|
|
3452
|
+
shortName: "sm-circ",
|
|
3453
|
+
description: "Small starting point",
|
|
3454
|
+
aliases: ["start", "small-circle"],
|
|
3455
|
+
internalAliases: ["stateStart"],
|
|
3456
|
+
handler: stateStart
|
|
3457
|
+
},
|
|
3458
|
+
{
|
|
3459
|
+
semanticName: "Stop",
|
|
3460
|
+
name: "Framed Circle",
|
|
3461
|
+
shortName: "fr-circ",
|
|
3462
|
+
description: "Stop point",
|
|
3463
|
+
aliases: ["stop", "framed-circle"],
|
|
3464
|
+
internalAliases: ["stateEnd"],
|
|
3465
|
+
handler: stateEnd
|
|
3466
|
+
},
|
|
3467
|
+
{
|
|
3468
|
+
semanticName: "Fork/Join",
|
|
3469
|
+
name: "Filled Rectangle",
|
|
3470
|
+
shortName: "fork",
|
|
3471
|
+
description: "Fork or join in process flow",
|
|
3472
|
+
aliases: ["join"],
|
|
3473
|
+
internalAliases: ["forkJoin"],
|
|
3474
|
+
handler: forkJoin
|
|
3475
|
+
},
|
|
3476
|
+
{
|
|
3477
|
+
semanticName: "Collate",
|
|
3478
|
+
name: "Hourglass",
|
|
3479
|
+
shortName: "hourglass",
|
|
3480
|
+
description: "Represents a collate operation",
|
|
3481
|
+
aliases: ["hourglass", "collate"],
|
|
3482
|
+
handler: hourglass
|
|
3483
|
+
},
|
|
3484
|
+
{
|
|
3485
|
+
semanticName: "Comment",
|
|
3486
|
+
name: "Curly Brace",
|
|
3487
|
+
shortName: "brace",
|
|
3488
|
+
description: "Adds a comment",
|
|
3489
|
+
aliases: ["comment", "brace-l"],
|
|
3490
|
+
handler: curlyBraceLeft
|
|
3491
|
+
},
|
|
3492
|
+
{
|
|
3493
|
+
semanticName: "Comment Right",
|
|
3494
|
+
name: "Curly Brace",
|
|
3495
|
+
shortName: "brace-r",
|
|
3496
|
+
description: "Adds a comment",
|
|
3497
|
+
handler: curlyBraceRight
|
|
3498
|
+
},
|
|
3499
|
+
{
|
|
3500
|
+
semanticName: "Comment with braces on both sides",
|
|
3501
|
+
name: "Curly Braces",
|
|
3502
|
+
shortName: "braces",
|
|
3503
|
+
description: "Adds a comment",
|
|
3504
|
+
handler: curlyBraces
|
|
3505
|
+
},
|
|
3506
|
+
{
|
|
3507
|
+
semanticName: "Com Link",
|
|
3508
|
+
name: "Lightning Bolt",
|
|
3509
|
+
shortName: "bolt",
|
|
3510
|
+
description: "Communication link",
|
|
3511
|
+
aliases: ["com-link", "lightning-bolt"],
|
|
3512
|
+
handler: lightningBolt
|
|
3513
|
+
},
|
|
3514
|
+
{
|
|
3515
|
+
semanticName: "Document",
|
|
3516
|
+
name: "Document",
|
|
3517
|
+
shortName: "doc",
|
|
3518
|
+
description: "Represents a document",
|
|
3519
|
+
aliases: ["doc", "document"],
|
|
3520
|
+
handler: waveEdgedRectangle
|
|
3521
|
+
},
|
|
3522
|
+
{
|
|
3523
|
+
semanticName: "Delay",
|
|
3524
|
+
name: "Half-Rounded Rectangle",
|
|
3525
|
+
shortName: "delay",
|
|
3526
|
+
description: "Represents a delay",
|
|
3527
|
+
aliases: ["half-rounded-rectangle"],
|
|
3528
|
+
handler: halfRoundedRectangle
|
|
3529
|
+
},
|
|
3530
|
+
{
|
|
3531
|
+
semanticName: "Direct Access Storage",
|
|
3532
|
+
name: "Horizontal Cylinder",
|
|
3533
|
+
shortName: "h-cyl",
|
|
3534
|
+
description: "Direct access storage",
|
|
3535
|
+
aliases: ["das", "horizontal-cylinder"],
|
|
3536
|
+
handler: tiltedCylinder
|
|
3537
|
+
},
|
|
3538
|
+
{
|
|
3539
|
+
semanticName: "Disk Storage",
|
|
3540
|
+
name: "Lined Cylinder",
|
|
3541
|
+
shortName: "lin-cyl",
|
|
3542
|
+
description: "Disk storage",
|
|
3543
|
+
aliases: ["disk", "lined-cylinder"],
|
|
3544
|
+
handler: linedCylinder
|
|
3545
|
+
},
|
|
3546
|
+
{
|
|
3547
|
+
semanticName: "Display",
|
|
3548
|
+
name: "Curved Trapezoid",
|
|
3549
|
+
shortName: "curv-trap",
|
|
3550
|
+
description: "Represents a display",
|
|
3551
|
+
aliases: ["curved-trapezoid", "display"],
|
|
3552
|
+
handler: curvedTrapezoid
|
|
3553
|
+
},
|
|
3554
|
+
{
|
|
3555
|
+
semanticName: "Divided Process",
|
|
3556
|
+
name: "Divided Rectangle",
|
|
3557
|
+
shortName: "div-rect",
|
|
3558
|
+
description: "Divided process shape",
|
|
3559
|
+
aliases: [
|
|
3560
|
+
"div-proc",
|
|
3561
|
+
"divided-rectangle",
|
|
3562
|
+
"divided-process"
|
|
3563
|
+
],
|
|
3564
|
+
handler: dividedRectangle
|
|
3565
|
+
},
|
|
3566
|
+
{
|
|
3567
|
+
semanticName: "Extract",
|
|
3568
|
+
name: "Triangle",
|
|
3569
|
+
shortName: "tri",
|
|
3570
|
+
description: "Extraction process",
|
|
3571
|
+
aliases: ["extract", "triangle"],
|
|
3572
|
+
handler: triangle
|
|
3573
|
+
},
|
|
3574
|
+
{
|
|
3575
|
+
semanticName: "Internal Storage",
|
|
3576
|
+
name: "Window Pane",
|
|
3577
|
+
shortName: "win-pane",
|
|
3578
|
+
description: "Internal storage",
|
|
3579
|
+
aliases: ["internal-storage", "window-pane"],
|
|
3580
|
+
handler: windowPane
|
|
3581
|
+
},
|
|
3582
|
+
{
|
|
3583
|
+
semanticName: "Junction",
|
|
3584
|
+
name: "Filled Circle",
|
|
3585
|
+
shortName: "f-circ",
|
|
3586
|
+
description: "Junction point",
|
|
3587
|
+
aliases: ["junction", "filled-circle"],
|
|
3588
|
+
handler: filledCircle
|
|
3589
|
+
},
|
|
3590
|
+
{
|
|
3591
|
+
semanticName: "Loop Limit",
|
|
3592
|
+
name: "Trapezoidal Pentagon",
|
|
3593
|
+
shortName: "notch-pent",
|
|
3594
|
+
description: "Loop limit step",
|
|
3595
|
+
aliases: ["loop-limit", "notched-pentagon"],
|
|
3596
|
+
handler: trapezoidalPentagon
|
|
3597
|
+
},
|
|
3598
|
+
{
|
|
3599
|
+
semanticName: "Manual File",
|
|
3600
|
+
name: "Flipped Triangle",
|
|
3601
|
+
shortName: "flip-tri",
|
|
3602
|
+
description: "Manual file operation",
|
|
3603
|
+
aliases: ["manual-file", "flipped-triangle"],
|
|
3604
|
+
handler: flippedTriangle
|
|
3605
|
+
},
|
|
3606
|
+
{
|
|
3607
|
+
semanticName: "Manual Input",
|
|
3608
|
+
name: "Sloped Rectangle",
|
|
3609
|
+
shortName: "sl-rect",
|
|
3610
|
+
description: "Manual input step",
|
|
3611
|
+
aliases: ["manual-input", "sloped-rectangle"],
|
|
3612
|
+
handler: slopedRect
|
|
3613
|
+
},
|
|
3614
|
+
{
|
|
3615
|
+
semanticName: "Multi-Document",
|
|
3616
|
+
name: "Stacked Document",
|
|
3617
|
+
shortName: "docs",
|
|
3618
|
+
description: "Multiple documents",
|
|
3619
|
+
aliases: [
|
|
3620
|
+
"documents",
|
|
3621
|
+
"st-doc",
|
|
3622
|
+
"stacked-document"
|
|
3623
|
+
],
|
|
3624
|
+
handler: multiWaveEdgedRectangle
|
|
3625
|
+
},
|
|
3626
|
+
{
|
|
3627
|
+
semanticName: "Multi-Process",
|
|
3628
|
+
name: "Stacked Rectangle",
|
|
3629
|
+
shortName: "st-rect",
|
|
3630
|
+
description: "Multiple processes",
|
|
3631
|
+
aliases: [
|
|
3632
|
+
"procs",
|
|
3633
|
+
"processes",
|
|
3634
|
+
"stacked-rectangle"
|
|
3635
|
+
],
|
|
3636
|
+
handler: multiRect
|
|
3637
|
+
},
|
|
3638
|
+
{
|
|
3639
|
+
semanticName: "Stored Data",
|
|
3640
|
+
name: "Bow Tie Rectangle",
|
|
3641
|
+
shortName: "bow-rect",
|
|
3642
|
+
description: "Stored data",
|
|
3643
|
+
aliases: ["stored-data", "bow-tie-rectangle"],
|
|
3644
|
+
handler: bowTieRect
|
|
3645
|
+
},
|
|
3646
|
+
{
|
|
3647
|
+
semanticName: "Summary",
|
|
3648
|
+
name: "Crossed Circle",
|
|
3649
|
+
shortName: "cross-circ",
|
|
3650
|
+
description: "Summary",
|
|
3651
|
+
aliases: ["summary", "crossed-circle"],
|
|
3652
|
+
handler: crossedCircle
|
|
3653
|
+
},
|
|
3654
|
+
{
|
|
3655
|
+
semanticName: "Tagged Document",
|
|
3656
|
+
name: "Tagged Document",
|
|
3657
|
+
shortName: "tag-doc",
|
|
3658
|
+
description: "Tagged document",
|
|
3659
|
+
aliases: ["tag-doc", "tagged-document"],
|
|
3660
|
+
handler: taggedWaveEdgedRectangle
|
|
3661
|
+
},
|
|
3662
|
+
{
|
|
3663
|
+
semanticName: "Tagged Process",
|
|
3664
|
+
name: "Tagged Rectangle",
|
|
3665
|
+
shortName: "tag-rect",
|
|
3666
|
+
description: "Tagged process",
|
|
3667
|
+
aliases: [
|
|
3668
|
+
"tagged-rectangle",
|
|
3669
|
+
"tag-proc",
|
|
3670
|
+
"tagged-process"
|
|
3671
|
+
],
|
|
3672
|
+
handler: taggedRect
|
|
3673
|
+
},
|
|
3674
|
+
{
|
|
3675
|
+
semanticName: "Paper Tape",
|
|
3676
|
+
name: "Flag",
|
|
3677
|
+
shortName: "flag",
|
|
3678
|
+
description: "Paper tape",
|
|
3679
|
+
aliases: ["paper-tape"],
|
|
3680
|
+
handler: waveRectangle
|
|
3681
|
+
},
|
|
3682
|
+
{
|
|
3683
|
+
semanticName: "Odd",
|
|
3684
|
+
name: "Odd",
|
|
3685
|
+
shortName: "odd",
|
|
3686
|
+
description: "Odd shape",
|
|
3687
|
+
internalAliases: ["rect_left_inv_arrow"],
|
|
3688
|
+
handler: rect_left_inv_arrow
|
|
3689
|
+
},
|
|
3690
|
+
{
|
|
3691
|
+
semanticName: "Lined Document",
|
|
3692
|
+
name: "Lined Document",
|
|
3693
|
+
shortName: "lin-doc",
|
|
3694
|
+
description: "Lined document",
|
|
3695
|
+
aliases: ["lined-document"],
|
|
3696
|
+
handler: linedWaveEdgedRect
|
|
3697
|
+
}
|
|
3698
|
+
], shapes2 = (/* @__PURE__ */ __name(() => {
|
|
3699
|
+
let e = {
|
|
3700
|
+
state,
|
|
3701
|
+
choice,
|
|
3702
|
+
note,
|
|
3703
|
+
rectWithTitle,
|
|
3704
|
+
labelRect,
|
|
3705
|
+
iconSquare,
|
|
3706
|
+
iconCircle,
|
|
3707
|
+
icon,
|
|
3708
|
+
iconRounded,
|
|
3709
|
+
imageSquare,
|
|
3710
|
+
anchor,
|
|
3711
|
+
kanbanItem,
|
|
3712
|
+
mindmapCircle,
|
|
3713
|
+
defaultMindmapNode,
|
|
3714
|
+
classBox,
|
|
3715
|
+
erBox,
|
|
3716
|
+
requirementBox
|
|
3717
|
+
}, a = [...Object.entries(e), ...shapesDefs.flatMap((e2) => [
|
|
3718
|
+
e2.shortName,
|
|
3719
|
+
..."aliases" in e2 ? e2.aliases : [],
|
|
3720
|
+
..."internalAliases" in e2 ? e2.internalAliases : []
|
|
3721
|
+
].map((a2) => [a2, e2.handler]))];
|
|
3722
|
+
return Object.fromEntries(a);
|
|
3723
|
+
}, "generateShapeMap"))();
|
|
3724
|
+
function isValidShape(e) {
|
|
3725
|
+
return e in shapes2;
|
|
3726
|
+
}
|
|
3727
|
+
__name(isValidShape, "isValidShape");
|
|
3728
|
+
var nodeElems = /* @__PURE__ */ new Map();
|
|
3729
|
+
async function insertNode(a, o, s) {
|
|
3730
|
+
let c, l;
|
|
3731
|
+
o.shape === "rect" && (o.rx && o.ry ? o.shape = "roundedRect" : o.shape = "squareRect");
|
|
3732
|
+
let u = o.shape ? shapes2[o.shape] : void 0;
|
|
3733
|
+
if (!u) throw Error(`No such shape: ${o.shape}. Please check your syntax.`);
|
|
3734
|
+
if (o.link) {
|
|
3735
|
+
let e;
|
|
3736
|
+
s.config.securityLevel === "sandbox" ? e = "_top" : o.linkTarget && (e = o.linkTarget || "_blank"), c = a.insert("svg:a").attr("xlink:href", o.link).attr("target", e ?? null), l = await u(c, o, s);
|
|
3737
|
+
} else l = await u(a, o, s), c = l;
|
|
3738
|
+
return c.attr("data-look", handleUndefinedAttr(o.look)), o.tooltip && l.attr("title", o.tooltip), nodeElems.set(o.id, c), o.haveCallback && c.attr("class", c.attr("class") + " clickable"), c;
|
|
3739
|
+
}
|
|
3740
|
+
__name(insertNode, "insertNode");
|
|
3741
|
+
var setNodeElem = /* @__PURE__ */ __name((e, a) => {
|
|
3742
|
+
nodeElems.set(a.id, e);
|
|
3743
|
+
}, "setNodeElem"), clear2 = /* @__PURE__ */ __name(() => {
|
|
3744
|
+
nodeElems.clear();
|
|
3745
|
+
}, "clear"), positionNode = /* @__PURE__ */ __name((e) => {
|
|
3746
|
+
let a = nodeElems.get(e.id);
|
|
3747
|
+
log.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
|
|
3748
|
+
let o = e.diff || 0;
|
|
3749
|
+
return e.clusterNode ? a.attr("transform", "translate(" + (e.x + o - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : a.attr("transform", "translate(" + e.x + ", " + e.y + ")"), o;
|
|
3750
|
+
}, "positionNode");
|
|
3751
|
+
export {
|
|
3752
|
+
insertNode as a,
|
|
3753
|
+
positionNode as c,
|
|
3754
|
+
insertCluster as i,
|
|
3755
|
+
setNodeElem as l,
|
|
3756
|
+
clear2 as n,
|
|
3757
|
+
isValidShape as o,
|
|
3758
|
+
createLabel_default as r,
|
|
3759
|
+
labelHelper as s,
|
|
3760
|
+
clear as t,
|
|
3761
|
+
updateNodeBounds as u
|
|
3762
|
+
};
|