ranui 0.2.0-alpha.7 → 0.2.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/abnfDiagram-VRR7QNED-CH_pIv_l.cjs +1 -0
- package/dist/abnfDiagram-VRR7QNED-CTsqwzwi.js +95 -0
- package/dist/arc-D25LhgTs.cjs +1 -0
- package/dist/arc-DRPGof21.js +82 -0
- package/dist/architecture-TIHT7OUA-BbBd15_y.cjs +1 -0
- package/dist/architecture-TIHT7OUA-pbFO1xSx.js +5 -0
- package/dist/architectureDiagram-ZJ3FMSHR-8mjyXr-w.js +4279 -0
- package/dist/architectureDiagram-ZJ3FMSHR-D_jWFFZx.cjs +36 -0
- package/dist/array-By5736M5.js +7 -0
- package/dist/array-C3cbN3GY.cjs +1 -0
- package/dist/arrow-down-Bi5kqUrX.js +12 -0
- package/dist/blockDiagram-677ZJIJ3-3F79MOSt.js +3321 -0
- package/dist/blockDiagram-677ZJIJ3-Cx35khWe.cjs +132 -0
- package/dist/builder.d.ts +4 -4
- package/dist/builder.js +39 -30
- package/dist/builtin-BkM0LLof.js +416 -0
- package/dist/button-D0zcnKnG.js +117 -0
- package/dist/button.js +1 -1
- package/dist/c4Diagram-LMCZKHZV-Cxn_gqu_.js +3064 -0
- package/dist/c4Diagram-LMCZKHZV-TRNb3Gvl.cjs +10 -0
- package/dist/{card-BVvXX6KM.js → card-CygMndQS.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/channel-C9WSNwcS.cjs +1 -0
- package/dist/channel-k5-UxdcV.js +5 -0
- package/dist/{checkbox-BtoX9X2Z.js → checkbox-D5om9aJO.js} +10 -10
- package/dist/checkbox.js +1 -1
- package/dist/chunk-2Q5K7J3B-CTMy5FII.cjs +1 -0
- package/dist/chunk-2Q5K7J3B-DlFVJRAn.js +15 -0
- package/dist/chunk-32BRIVSS-BXVdG_nV.cjs +1 -0
- package/dist/chunk-32BRIVSS-jAuAwMVV.js +68 -0
- package/dist/chunk-52WLFC77-BChUrU24.cjs +10 -0
- package/dist/chunk-52WLFC77-wpL7en7e.js +630 -0
- package/dist/chunk-5VM5RSS4-Cni2Ogq2.js +19 -0
- package/dist/chunk-5VM5RSS4-DudUFQ_Z.cjs +15 -0
- package/dist/chunk-7BUUIJ7U-9hiBbc7O.js +87 -0
- package/dist/chunk-7BUUIJ7U-DMv_UkjI.cjs +1 -0
- package/dist/chunk-C7G6YPKG-CA-DNpvI.js +71 -0
- package/dist/chunk-C7G6YPKG-CKEeW9TM.cjs +1 -0
- package/dist/chunk-EX3LRPZG-BCmf0iDq.js +2137 -0
- package/dist/chunk-EX3LRPZG-DbfbNdXo.cjs +231 -0
- package/dist/chunk-FWX5IMBZ-D11-gbhc.cjs +1 -0
- package/dist/chunk-FWX5IMBZ-DZ5VYvm5.js +60 -0
- package/dist/chunk-HOUHSVGY-BGB3dOvI.cjs +1 -0
- package/dist/chunk-HOUHSVGY-DRQcQeMT.js +268 -0
- package/dist/chunk-ICXQ74PX-BbT9JaEW.cjs +2 -0
- package/dist/chunk-ICXQ74PX-DR8rL-xF.js +1377 -0
- package/dist/chunk-JWPE2WC7-CGEmUMMZ.js +8 -0
- package/dist/chunk-JWPE2WC7-D8EnWK1B.cjs +1 -0
- package/dist/chunk-KEIR6QF5-B2Op7cFH.js +22155 -0
- package/dist/chunk-KEIR6QF5-C4fcHpY0.cjs +161 -0
- package/dist/chunk-MOJQB5TN-BC46HDyu.js +516 -0
- package/dist/chunk-MOJQB5TN-oOeq982_.cjs +88 -0
- package/dist/chunk-OGEWGWER-BV51ll2w.js +33 -0
- package/dist/chunk-OGEWGWER-DX8sW1dT.cjs +1 -0
- package/dist/chunk-PUDLZKDR-48YaqVoF.cjs +156 -0
- package/dist/chunk-PUDLZKDR-NdMR0Ft5.js +4282 -0
- package/dist/chunk-Q4XR5HBZ-3BHjjc9u.js +1709 -0
- package/dist/chunk-Q4XR5HBZ-aBnPq509.cjs +70 -0
- package/dist/chunk-RYQCIY6F-BER2T9t0.js +246 -0
- package/dist/chunk-RYQCIY6F-DVRzSnsI.cjs +1 -0
- package/dist/chunk-V7JOEXUC-Cr_hr02u.js +3467 -0
- package/dist/chunk-V7JOEXUC-DHizzTla.cjs +206 -0
- package/dist/chunk-VAUOI2AC-DfQf5L2_.cjs +1 -0
- package/dist/chunk-VAUOI2AC-izt0o4id.js +11 -0
- package/dist/chunk-VR4S4FIN-CJi5okl4.js +26 -0
- package/dist/chunk-VR4S4FIN-KiwnPF31.cjs +1 -0
- package/dist/chunk-WYO6CB5R-DDHkKowO.js +4535 -0
- package/dist/chunk-WYO6CB5R-u4mJNOcO.cjs +127 -0
- package/dist/chunk-XXDRQBXY-BB1i_53q.js +9 -0
- package/dist/chunk-XXDRQBXY-C8VGLZmt.cjs +1 -0
- package/dist/chunk-Y2CYZVJY-0JxdZxki.js +13 -0
- package/dist/chunk-Y2CYZVJY-DPaYLFFP.cjs +1 -0
- package/dist/chunk-ZGVPDNZ5-6uMbTJXy.js +3841 -0
- package/dist/chunk-ZGVPDNZ5-Cw5_HJba.cjs +62 -0
- package/dist/chunk-ZIRB5QZD-C7OH2FI2.js +1280 -0
- package/dist/chunk-ZIRB5QZD-aLu-4ITN.cjs +32 -0
- package/dist/classDiagram-OUVF2IWQ-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-OUVF2IWQ-Df0ghim9.js +30 -0
- package/dist/classDiagram-v2-EOCWNBFH-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-Df0ghim9.js +30 -0
- package/dist/{colorpicker-Dukms7ET.js → colorpicker-qWnaTlYX.js} +9 -10
- package/dist/colorpicker.js +1 -1
- package/dist/components/colorpicker/index.d.ts +3 -3
- package/dist/components/glass/index.d.ts +52 -0
- package/dist/components/icon/builtin.d.ts +9 -0
- package/dist/components/icon/core-icons.d.ts +13 -0
- package/dist/components/icon/index.d.ts +8 -0
- package/dist/components/mermaid/index.d.ts +52 -0
- package/dist/components/modal/index.d.ts +9 -0
- package/dist/components/route/index.d.ts +10 -4
- package/dist/components/router/index.d.ts +3 -0
- package/dist/content-Rry-U6ir.js +39 -0
- package/dist/content.js +5 -0
- package/dist/cose-bilkent-JH36ORCC-BUxFTdey.cjs +1 -0
- package/dist/cose-bilkent-JH36ORCC-DTwvJlGw.js +2353 -0
- package/dist/cynefin-VYW2F7L2-6c1GOGXW.cjs +1 -0
- package/dist/cynefin-VYW2F7L2-ALQKF7N6.js +5 -0
- package/dist/cynefinDiagram-TSTJHNR4-Bjt4QTVh.js +355 -0
- package/dist/cynefinDiagram-TSTJHNR4-ISDORSxO.cjs +62 -0
- package/dist/cytoscape.esm-CFq1_DTa.js +18906 -0
- package/dist/cytoscape.esm-pygMw4dR.cjs +321 -0
- package/dist/dagre-D1-W1tt6.cjs +1 -0
- package/dist/dagre-D8GLTwuf.js +1578 -0
- package/dist/dagre-VKFMJZFB-DXI69qAN.cjs +4 -0
- package/dist/dagre-VKFMJZFB-Dfku86Az.js +341 -0
- package/dist/defaultLocale-0M_kMcEH.js +184 -0
- package/dist/defaultLocale-DSqtvhxg.cjs +1 -0
- package/dist/diagram-FQU43EPY-BAiRt5eL.cjs +3 -0
- package/dist/diagram-FQU43EPY-BvQ5jmVn.js +452 -0
- package/dist/diagram-G47NLZAW-DGnmEa8u.cjs +24 -0
- package/dist/diagram-G47NLZAW-DT2BBA0T.js +498 -0
- package/dist/diagram-NH7WQ7WH-DxgkStA3.cjs +24 -0
- package/dist/diagram-NH7WQ7WH-W7jg4Vh8.js +135 -0
- package/dist/diagram-OA4YK3LP-DkvFII73.cjs +30 -0
- package/dist/diagram-OA4YK3LP-jU--aqQl.js +317 -0
- package/dist/diagram-WEI45ONY-C_Qhf4ny.js +215 -0
- package/dist/diagram-WEI45ONY-XvzRFmmY.cjs +41 -0
- package/dist/dist-C0Fwsvsq.js +70 -0
- package/dist/dist-C20XxSsP.cjs +1 -0
- package/dist/{dropdown-BYS1Trdu.js → dropdown-DzdAR1nI.js} +4 -4
- package/dist/dropdown.js +1 -1
- package/dist/ebnfDiagram-CCIWWBDH-Cu8bAlhC.cjs +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-Gnr20Oc1.js +112 -0
- package/dist/erDiagram-Q63AITRT-CxLSa9Yv.cjs +85 -0
- package/dist/erDiagram-Q63AITRT-D0Hh9b-W.js +1822 -0
- package/dist/eventmodeling-45OFAUF4-C6VXxUn1.cjs +1 -0
- package/dist/eventmodeling-45OFAUF4-DMpGs2yI.js +5 -0
- package/dist/factory-BkvRcCOx.js +482 -0
- package/dist/flowDiagram-23GEKE2U-B6gASEYG.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-BY4wE2vw.js +19 -0
- package/dist/{form-BsB5JhS4.js → form-CUJpeQ7Q.js} +5 -5
- package/dist/form.js +1 -1
- package/dist/ganttDiagram-NO4QXBWP-B40Eabk0.js +3125 -0
- package/dist/ganttDiagram-NO4QXBWP-DZT79qJr.cjs +292 -0
- package/dist/gitGraph-TEB2WS4Q-BbtF3MDr.cjs +1 -0
- package/dist/gitGraph-TEB2WS4Q-D6Ru11Cs.js +5 -0
- package/dist/gitGraphDiagram-IHSO6WYX-BUJNSssA.js +754 -0
- package/dist/gitGraphDiagram-IHSO6WYX-DW06165m.cjs +106 -0
- package/dist/glass-Bj1Zf8Hy.js +115 -0
- package/dist/glass.js +5 -0
- package/dist/graphlib-CCKThIKP.js +1104 -0
- package/dist/graphlib-Du-578Js.cjs +1 -0
- package/dist/{icon-pfolda2m.js → icon-CtlZJISZ.js} +110 -21
- package/dist/icon.js +4 -3
- package/dist/icons.js +5 -0
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/content.iife.js +1 -0
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/glass.iife.js +1 -0
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/mermaid.iife.js +3535 -0
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/{image-BXpKQ9sU.js → image-ILZNlaGc.js} +4 -4
- package/dist/image.js +1 -1
- package/dist/index.cjs +257 -23
- package/dist/index.d.ts +11 -1
- package/dist/index.iife.js +3842 -74
- package/dist/index.js +86 -78
- package/dist/info-DKCQHKI2-DNOtUIin.cjs +1 -0
- package/dist/info-DKCQHKI2-Df7h9MSE.js +5 -0
- package/dist/infoDiagram-FWYZ7A6U-C8dZc-Ki.cjs +2 -0
- package/dist/infoDiagram-FWYZ7A6U-Dc0m9qAx.js +21 -0
- package/dist/init-1VpIn1S3.js +16 -0
- package/dist/init-CbDwVtpO.cjs +1 -0
- package/dist/{input-BMMM60e6.js → input-CDH6zY9I.js} +6 -6
- package/dist/input.js +1 -1
- package/dist/ishikawaDiagram-FXEZZL3T-BugNyysB.cjs +70 -0
- package/dist/ishikawaDiagram-FXEZZL3T-DuFtHOmf.js +742 -0
- package/dist/journeyDiagram-5HDEW3XC-Bshelnhq.js +928 -0
- package/dist/journeyDiagram-5HDEW3XC-ItmURvA2.cjs +139 -0
- package/dist/kanban-definition-HUTT4EX6-BL512R2A.cjs +89 -0
- package/dist/kanban-definition-HUTT4EX6-Dogv2paU.js +1050 -0
- package/dist/katex-Cq3Y8cmK.cjs +257 -0
- package/dist/katex-Pg2EqTH0.js +23485 -0
- package/dist/line-BIPmUVxO.js +33 -0
- package/dist/line-CAB5QHC6.cjs +1 -0
- package/dist/linear-B2AM4ZBe.js +259 -0
- package/dist/linear-CSAfNEpl.cjs +1 -0
- package/dist/{link-DURZzd7u.js → link-BCrmHvXP.js} +3 -3
- package/dist/link.js +1 -1
- package/dist/{loading-BScjyeVm.js → loading-DJWGih1g.js} +4 -4
- package/dist/loading.js +1 -1
- package/dist/map-BC2bk_rV.cjs +1 -0
- package/dist/map-DMSWkcq6.js +208 -0
- package/dist/{math-IjzOAwnA.js → math-DRmkEDSQ.js} +4 -4
- package/dist/math.js +1 -1
- package/dist/mermaid-CMhm7npE.js +261 -0
- package/dist/mermaid-parser.core-DYumW1vq.cjs +6 -0
- package/dist/mermaid-parser.core-uIDZYuBu.js +654 -0
- package/dist/mermaid.core-B2d5lQW2.js +1085 -0
- package/dist/mermaid.core-a1hgpWfs.cjs +10 -0
- package/dist/mermaid.js +5 -0
- package/dist/{message-CLpuP8HY.js → message-BpYJBvYn.js} +36 -51
- package/dist/message.js +1 -1
- package/dist/mindmap-definition-LN4V7U3C-DYZgIZym.cjs +96 -0
- package/dist/mindmap-definition-LN4V7U3C-f7s5ZePP.js +1070 -0
- package/dist/{modal-DOTpABRe.js → modal-BeQlDYDP.js} +40 -24
- package/dist/modal.js +1 -1
- package/dist/ordinal-BMN81JG2.js +64 -0
- package/dist/ordinal-BplLHIij.cjs +1 -0
- package/dist/packet-7NZHBO7P-4PLslLZJ.js +5 -0
- package/dist/packet-7NZHBO7P-DeyLCrSn.cjs +1 -0
- package/dist/path-Bja5PoYn.js +82 -0
- package/dist/path-DmfWsuKi.cjs +1 -0
- package/dist/pegDiagram-2B236MQR-B-Xeh55J.js +107 -0
- package/dist/pegDiagram-2B236MQR-Bo5Nj40u.cjs +1 -0
- package/dist/pie-RZYD4A2V-DBE9a8Kz.js +5 -0
- package/dist/pie-RZYD4A2V-pDNZ2ZyB.cjs +1 -0
- package/dist/pieDiagram-ENE6RG2P-BkSiP4iu.cjs +39 -0
- package/dist/pieDiagram-ENE6RG2P-CVSE95zc.js +207 -0
- package/dist/{player-5olrw-qB.js → player-CQ4e3Yeo.js} +196 -195
- package/dist/player.js +1 -1
- package/dist/{popover-DRUQjdPs.js → popover-eZMnL1F3.js} +22 -54
- package/dist/popover.js +1 -1
- package/dist/{progress-BIEXYYd2.js → progress-DyHgW4Ep.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/quadrantDiagram-ABIIQ3AL-BDmdDGsh.cjs +7 -0
- package/dist/quadrantDiagram-ABIIQ3AL-TJ8FmqES.js +2058 -0
- package/dist/{radar-DAF95_Mj.js → radar-D21Rccap.js} +5 -5
- package/dist/radar-I7S5WNFK-CY5ycn2a.cjs +1 -0
- package/dist/radar-I7S5WNFK-DFTxtd_t.js +5 -0
- package/dist/radar.js +1 -1
- package/dist/railroad-3IZDKUUU-DALJwv16.js +5 -0
- package/dist/railroad-3IZDKUUU-DGzXHqt7.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-BCIHdSw6.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-CntW2udQ.js +5 -0
- package/dist/railroad-ebnf-EBAXGLYW-4vFZrfHF.cjs +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-s_1ZOb_9.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-CaM5A0Ml.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-D_oFW1Bo.cjs +1 -0
- package/dist/railroadDiagram-RFXS5EU6-0lS5wYI7.js +83 -0
- package/dist/railroadDiagram-RFXS5EU6-DJKAtnQk.cjs +1 -0
- package/dist/ranui.css +1 -1
- package/dist/requirementDiagram-TGXJPOKE-Bg701bNl.cjs +84 -0
- package/dist/requirementDiagram-TGXJPOKE-viCQLyJd.js +2301 -0
- package/dist/rolldown-runtime-9ZSF5uba.js +16 -0
- package/dist/rolldown-runtime-CAnuVJ4g.cjs +1 -0
- package/dist/rough.esm-BWe9E0Nz.js +1387 -0
- package/dist/rough.esm-BfSi6CZE.cjs +1 -0
- package/dist/route-pR5P4ann.js +116 -0
- package/dist/route.js +1 -1
- package/dist/{router-B9rCrWXm.js → router-CewzSH7O.js} +23 -18
- package/dist/router.js +1 -1
- package/dist/sankeyDiagram-HTMAVEWB-CV6_AuMF.js +974 -0
- package/dist/sankeyDiagram-HTMAVEWB-K-nGMsuS.cjs +40 -0
- package/dist/{scratch-QlPyy1f4.js → scratch-BFVsgl-7.js} +2 -2
- package/dist/scratch.js +1 -1
- package/dist/{section-D0qMm9KM.js → section-DSPCsIxv.js} +2 -2
- package/dist/section.js +1 -1
- package/dist/{select-aAaWoveE.js → select-B58nMfB1.js} +16 -23
- package/dist/select.js +1 -1
- package/dist/sequenceDiagram-DBY2YBRQ-4GdkLnUr.cjs +162 -0
- package/dist/sequenceDiagram-DBY2YBRQ-B9WNesh2.js +4326 -0
- package/dist/sizeCapture-X5ZJPWSS-BUY3-n09.cjs +1 -0
- package/dist/sizeCapture-X5ZJPWSS-D7rGsqTl.js +48 -0
- package/dist/{skeleton-CFqQmKyt.js → skeleton-DoHYMsTn.js} +5 -5
- package/dist/skeleton.js +1 -1
- package/dist/src-C9EhKhbk.cjs +1 -0
- package/dist/src-DtRLxcYO.js +2104 -0
- package/dist/stateDiagram-2N3HPSRC-B7VpgjJu.cjs +1 -0
- package/dist/stateDiagram-2N3HPSRC-DxH4BMSh.js +237 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CQv7GIaO.cjs +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CWfn6e7n.js +30 -0
- package/dist/swimlanes-5IMT3BWC-DcADNGpg.js +5258 -0
- package/dist/swimlanes-5IMT3BWC-o-MjdPlw.cjs +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-D-rmAGky.cjs +8 -0
- package/dist/swimlanesDiagram-G3AALYLV-DDtDtl1L.js +31 -0
- package/dist/{tab-CiF2YPck.js → tab-BRPdZ9Ws.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-B-m3xwqu.js → tabpane-Owf72hw_.js} +5 -5
- package/dist/tabpane.js +1 -1
- package/dist/test/unit/icon.builtin.test.d.ts +1 -0
- package/dist/test/unit/utils.colorpicker.reconnect.test.d.ts +1 -0
- package/dist/test/unit/utils.route.lazy.test.d.ts +1 -0
- package/dist/test/unit/utils.router.match.test.d.ts +1 -0
- package/dist/test/unit/utils.signal.owner.test.d.ts +1 -0
- package/dist/{theme-switch-B09egc6h.js → theme-switch-CZDIIonc.js} +4 -4
- package/dist/theme-switch.js +1 -1
- package/dist/timeline-definition-FHXFAJF6-C80VjPLh.js +1119 -0
- package/dist/timeline-definition-FHXFAJF6-DOwvOb3S.cjs +120 -0
- package/dist/treeView-QDETBFTQ-B1Ejxfpg.cjs +1 -0
- package/dist/treeView-QDETBFTQ-vTKOZls1.js +5 -0
- package/dist/treemap-6X3UGDF4-D0FeO_NX.cjs +1 -0
- package/dist/treemap-6X3UGDF4-Ddzv6Gqd.js +5 -0
- package/dist/utils/builder/core.d.ts +153 -16
- package/dist/utils/builder/factory.d.ts +1 -1
- package/dist/utils/builder/index.d.ts +3 -3
- package/dist/utils/builder/signal.d.ts +93 -64
- package/dist/utils/router/index.d.ts +13 -3
- package/dist/utils/router.js +95 -54
- package/dist/utils/theme.d.ts +1 -1
- package/dist/{utils-DBfrRFoE.js → utils-D1iZnChu.js} +38 -31
- package/dist/vennDiagram-L72KCM5P-BYHB7OW8.js +1955 -0
- package/dist/vennDiagram-L72KCM5P-CidVJK6y.cjs +34 -0
- package/dist/wardley-OPB4EBWU-C1hXbbD4.cjs +1 -0
- package/dist/wardley-OPB4EBWU-DBgFLc64.js +5 -0
- package/dist/wardleyDiagram-EHGQE667--ubmCaWM.js +652 -0
- package/dist/wardleyDiagram-EHGQE667-K6ckkRZS.cjs +78 -0
- package/dist/warning-circle-fill-Cz0qu7AH.js +23 -0
- package/dist/xychartDiagram-FW5EYKEG-CzdokxrM.cjs +7 -0
- package/dist/xychartDiagram-FW5EYKEG-DLqWcTPt.js +2154 -0
- package/docs/BUILDER.md +383 -0
- package/docs/COMPONENTS.md +21 -3
- package/package.json +31 -3
- package/dist/button-Be_uHDZG.js +0 -117
- package/dist/factory-BdsO0dEW.js +0 -165
- package/dist/route-MQZpn2BP.js +0 -88
- package/dist/signal-CSSZxlK5.js +0 -57
|
@@ -0,0 +1,3841 @@
|
|
|
1
|
+
import { n as $ } from "./chunk-Y2CYZVJY-0JxdZxki.js";
|
|
2
|
+
import { m as F, p as U } from "./src-DtRLxcYO.js";
|
|
3
|
+
import { A as Ps, B as sa, M as jt, T as it, b as Pt, g as mt, x as J, z as ea } from "./chunk-WYO6CB5R-DDHkKowO.js";
|
|
4
|
+
import { a as Nt, r as Ct, u as K } from "./chunk-ICXQ74PX-DR8rL-xF.js";
|
|
5
|
+
import { t as Rt } from "./chunk-HOUHSVGY-DRQcQeMT.js";
|
|
6
|
+
import { n as gt } from "./chunk-Q4XR5HBZ-3BHjjc9u.js";
|
|
7
|
+
import { n as ia, t as Ds } from "./chunk-OGEWGWER-BV51ll2w.js";
|
|
8
|
+
import { a as H, i as W, r as Bs, t as At } from "./chunk-C7G6YPKG-CA-DNpvI.js";
|
|
9
|
+
import { t as I } from "./rough.esm-BWe9E0Nz.js";
|
|
10
|
+
var _ = /* @__PURE__ */ $(async (d, t, g) => {
|
|
11
|
+
let h;
|
|
12
|
+
const r = t.useHtmlLabels || mt(J()?.htmlLabels);
|
|
13
|
+
g ? h = g : h = "node default";
|
|
14
|
+
const l = d.insert("g").attr("class", h).attr("id", t.domId || t.id), f = l.insert("g").attr("class", "label").attr("style", K(t.labelStyle));
|
|
15
|
+
let i;
|
|
16
|
+
t.label === void 0 ? i = "" : i = typeof t.label == "string" ? t.label : t.label[0];
|
|
17
|
+
const n = !!t.icon || !!t.img, e = t.labelType === "markdown", a = await gt(f, ea(Nt(i), J()), {
|
|
18
|
+
useHtmlLabels: r,
|
|
19
|
+
width: t.width || J().flowchart?.wrappingWidth,
|
|
20
|
+
classes: e ? "markdown-node-label" : "",
|
|
21
|
+
style: t.labelStyle,
|
|
22
|
+
addSvgBackground: n,
|
|
23
|
+
markdown: e
|
|
24
|
+
}, J());
|
|
25
|
+
let s = a.getBBox();
|
|
26
|
+
const o = (t?.padding ?? 0) / 2;
|
|
27
|
+
if (r) {
|
|
28
|
+
const c = a.children[0], y = U(a);
|
|
29
|
+
await Ds(c, i), s = c.getBoundingClientRect(), y.attr("width", s.width), y.attr("height", s.height);
|
|
30
|
+
}
|
|
31
|
+
return r ? f.attr("transform", "translate(" + -s.width / 2 + ", " + -s.height / 2 + ")") : f.attr("transform", "translate(0, " + -s.height / 2 + ")"), t.centerLabel && f.attr("transform", "translate(" + -s.width / 2 + ", " + -s.height / 2 + ")"), f.insert("rect", ":first-child"), {
|
|
32
|
+
shapeSvg: l,
|
|
33
|
+
bbox: s,
|
|
34
|
+
halfPadding: o,
|
|
35
|
+
label: f
|
|
36
|
+
};
|
|
37
|
+
}, "labelHelper"), Lt = /* @__PURE__ */ $(async (d, t, g) => {
|
|
38
|
+
const h = g.useHtmlLabels ?? it(J()), r = d.insert("g").attr("class", "label").attr("style", g.labelStyle || ""), l = await gt(r, ea(Nt(t), J()), {
|
|
39
|
+
useHtmlLabels: h,
|
|
40
|
+
width: g.width || J()?.flowchart?.wrappingWidth,
|
|
41
|
+
style: g.labelStyle,
|
|
42
|
+
addSvgBackground: !!g.icon || !!g.img
|
|
43
|
+
});
|
|
44
|
+
let f = l.getBBox();
|
|
45
|
+
const i = g.padding / 2;
|
|
46
|
+
if (it(J())) {
|
|
47
|
+
const n = l.children[0], e = U(l);
|
|
48
|
+
f = n.getBoundingClientRect(), e.attr("width", f.width), e.attr("height", f.height);
|
|
49
|
+
}
|
|
50
|
+
return h ? r.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")") : r.attr("transform", "translate(0, " + -f.height / 2 + ")"), g.centerLabel && r.attr("transform", "translate(" + -f.width / 2 + ", " + -f.height / 2 + ")"), r.insert("rect", ":first-child"), {
|
|
51
|
+
shapeSvg: d,
|
|
52
|
+
bbox: f,
|
|
53
|
+
halfPadding: i,
|
|
54
|
+
label: r
|
|
55
|
+
};
|
|
56
|
+
}, "insertLabel"), E = /* @__PURE__ */ $((d, t) => {
|
|
57
|
+
const g = t.node().getBBox();
|
|
58
|
+
d.width = g.width, d.height = g.height;
|
|
59
|
+
}, "updateNodeBounds"), Y = /* @__PURE__ */ $((d, t) => (d.look === "handDrawn" ? "rough-node" : "node") + " " + d.cssClasses + " " + (t || ""), "getNodeClasses");
|
|
60
|
+
function j(d) {
|
|
61
|
+
const t = d.map((g, h) => `${h === 0 ? "M" : "L"}${g.x},${g.y}`);
|
|
62
|
+
return t.push("Z"), t.join(" ");
|
|
63
|
+
}
|
|
64
|
+
$(j, "createPathFromPoints");
|
|
65
|
+
function pt(d, t, g, h, r, l) {
|
|
66
|
+
const f = [], n = g - d, e = h - t, a = n / l, s = 2 * Math.PI / a, o = t + e / 2;
|
|
67
|
+
for (let c = 0; c <= 50; c++) {
|
|
68
|
+
const y = d + c / 50 * n, p = o + r * Math.sin(s * (y - d));
|
|
69
|
+
f.push({
|
|
70
|
+
x: y,
|
|
71
|
+
y: p
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return f;
|
|
75
|
+
}
|
|
76
|
+
$(pt, "generateFullSineWavePoints");
|
|
77
|
+
function Dt(d, t, g, h, r, l) {
|
|
78
|
+
const f = [], i = r * Math.PI / 180, n = (l * Math.PI / 180 - i) / (h - 1);
|
|
79
|
+
for (let e = 0; e < h; e++) {
|
|
80
|
+
const a = i + e * n, s = d + g * Math.cos(a), o = t + g * Math.sin(a);
|
|
81
|
+
f.push({
|
|
82
|
+
x: -s,
|
|
83
|
+
y: -o
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return f;
|
|
87
|
+
}
|
|
88
|
+
$(Dt, "generateCirclePoints");
|
|
89
|
+
function Wt(d) {
|
|
90
|
+
const t = Array.from(d.childNodes).filter((n) => n.tagName === "path"), g = document.createElementNS("http://www.w3.org/2000/svg", "path"), h = t.map((n) => n.getAttribute("d")).filter((n) => n !== null).join(" ");
|
|
91
|
+
g.setAttribute("d", h);
|
|
92
|
+
const r = t.find((n) => n.getAttribute("fill") !== "none"), l = t.find((n) => n.getAttribute("stroke") !== "none"), f = /* @__PURE__ */ $((n, e) => n?.getAttribute(e) ?? void 0, "getAttr");
|
|
93
|
+
if (r) {
|
|
94
|
+
const n = {
|
|
95
|
+
fill: f(r, "fill"),
|
|
96
|
+
"fill-opacity": f(r, "fill-opacity") ?? "1"
|
|
97
|
+
};
|
|
98
|
+
Object.entries(n).forEach(([e, a]) => {
|
|
99
|
+
a && g.setAttribute(e, a);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (l) {
|
|
103
|
+
const n = {
|
|
104
|
+
stroke: f(l, "stroke"),
|
|
105
|
+
"stroke-width": f(l, "stroke-width") ?? "1",
|
|
106
|
+
"stroke-opacity": f(l, "stroke-opacity") ?? "1"
|
|
107
|
+
};
|
|
108
|
+
Object.entries(n).forEach(([e, a]) => {
|
|
109
|
+
a && g.setAttribute(e, a);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const i = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
113
|
+
return i.appendChild(g), i;
|
|
114
|
+
}
|
|
115
|
+
$(Wt, "mergePaths");
|
|
116
|
+
var wt = /* @__PURE__ */ $((d, t) => {
|
|
117
|
+
var g = d.x, h = d.y, r = t.x - g, l = t.y - h, f = d.width / 2, i = d.height / 2, n, e;
|
|
118
|
+
return Math.abs(l) * f > Math.abs(r) * i ? (l < 0 && (i = -i), n = l === 0 ? 0 : i * r / l, e = i) : (r < 0 && (f = -f), n = f, e = r === 0 ? 0 : f * l / r), {
|
|
119
|
+
x: g + n,
|
|
120
|
+
y: h + e
|
|
121
|
+
};
|
|
122
|
+
}, "intersectRect"), Mt = /* @__PURE__ */ $(async (d, t, g, h = !1, r = !1) => {
|
|
123
|
+
let l = t || "";
|
|
124
|
+
typeof l == "object" && (l = l[0]);
|
|
125
|
+
const f = J(), i = it(f);
|
|
126
|
+
return await gt(d, l, {
|
|
127
|
+
style: g,
|
|
128
|
+
isTitle: h,
|
|
129
|
+
useHtmlLabels: i,
|
|
130
|
+
markdown: !1,
|
|
131
|
+
isNode: r,
|
|
132
|
+
width: Number.POSITIVE_INFINITY
|
|
133
|
+
}, f);
|
|
134
|
+
}, "createLabel"), dt = /* @__PURE__ */ $((d, t, g, h, r) => [
|
|
135
|
+
"M",
|
|
136
|
+
d + r,
|
|
137
|
+
t,
|
|
138
|
+
"H",
|
|
139
|
+
d + g - r,
|
|
140
|
+
"A",
|
|
141
|
+
r,
|
|
142
|
+
r,
|
|
143
|
+
0,
|
|
144
|
+
0,
|
|
145
|
+
1,
|
|
146
|
+
d + g,
|
|
147
|
+
t + r,
|
|
148
|
+
"V",
|
|
149
|
+
t + h - r,
|
|
150
|
+
"A",
|
|
151
|
+
r,
|
|
152
|
+
r,
|
|
153
|
+
0,
|
|
154
|
+
0,
|
|
155
|
+
1,
|
|
156
|
+
d + g - r,
|
|
157
|
+
t + h,
|
|
158
|
+
"H",
|
|
159
|
+
d + r,
|
|
160
|
+
"A",
|
|
161
|
+
r,
|
|
162
|
+
r,
|
|
163
|
+
0,
|
|
164
|
+
0,
|
|
165
|
+
1,
|
|
166
|
+
d,
|
|
167
|
+
t + h - r,
|
|
168
|
+
"V",
|
|
169
|
+
t + r,
|
|
170
|
+
"A",
|
|
171
|
+
r,
|
|
172
|
+
r,
|
|
173
|
+
0,
|
|
174
|
+
0,
|
|
175
|
+
1,
|
|
176
|
+
d + r,
|
|
177
|
+
t,
|
|
178
|
+
"Z"
|
|
179
|
+
].join(" "), "createRoundedRectPathD"), Ms = /* @__PURE__ */ $(async (d, t) => {
|
|
180
|
+
const g = J(), { themeVariables: h, handDrawnSeed: r } = g, { clusterBkg: l, clusterBorder: f } = h, i = f, { labelStyles: n, nodeStyles: e, borderStyles: a, backgroundStyles: s } = W(t), o = d.insert("g").attr("class", "cluster swimlane " + (t.cssClasses || "")).attr("id", t.id).attr("data-id", t.id).attr("data-et", "cluster").attr("data-look", t.look), c = mt(g.flowchart.htmlLabels), y = t.direction === "LR", p = o.insert("g").attr("class", "cluster-label swimlane-label"), w = await gt(p, t.label, {
|
|
181
|
+
style: t.labelStyle,
|
|
182
|
+
useHtmlLabels: c,
|
|
183
|
+
isNode: !0,
|
|
184
|
+
width: t.width
|
|
185
|
+
});
|
|
186
|
+
let u = w.getBBox();
|
|
187
|
+
if (c) {
|
|
188
|
+
const N = w.children[0], M = U(w);
|
|
189
|
+
u = N.getBoundingClientRect(), M.attr("width", u.width), M.attr("height", u.height);
|
|
190
|
+
}
|
|
191
|
+
const m = t.padding ?? 0, x = t.width <= u.width + m ? u.width + m : t.width;
|
|
192
|
+
t.width <= u.width + m ? t.diff = (x - t.width) / 2 - m : t.diff = -m;
|
|
193
|
+
const S = t.height, b = t.y - S / 2, D = t.y + S / 2, k = t.x - x / 2, v = t.swimlaneContentTop !== void 0 ? t.swimlaneContentTop : b + S / 3, B = y ? 4 : 0, A = u.height + 2 * B;
|
|
194
|
+
let L, X;
|
|
195
|
+
if (y) {
|
|
196
|
+
const N = Math.max(A, u.height + 2 * B), M = k + N, P = Math.max(0, x - N);
|
|
197
|
+
if (t.look === "handDrawn") {
|
|
198
|
+
const G = I.svg(o), z = H(t, {
|
|
199
|
+
roughness: 0.7,
|
|
200
|
+
fill: l,
|
|
201
|
+
stroke: i,
|
|
202
|
+
fillWeight: 3,
|
|
203
|
+
seed: r
|
|
204
|
+
}), V = H(t, {
|
|
205
|
+
roughness: 0.7,
|
|
206
|
+
fill: "none",
|
|
207
|
+
stroke: i,
|
|
208
|
+
seed: r
|
|
209
|
+
}), rt = G.rectangle(k, b, N, S, z);
|
|
210
|
+
L = o.insert(() => rt, ":first-child");
|
|
211
|
+
const st = G.rectangle(M, b, P, S, V);
|
|
212
|
+
X = o.insert(() => st, ":first-child"), L.select("path:nth-child(2)").attr("style", a.join(";")), L.select("path").attr("style", s.join(";").replace("fill", "stroke"));
|
|
213
|
+
} else
|
|
214
|
+
L = o.insert("rect", ":first-child"), X = o.insert("rect", ":first-child"), L.attr("class", "swimlane-title").attr("style", e).attr("x", k).attr("y", b).attr("width", N).attr("height", S).attr("fill", l).attr("stroke", i), X.attr("class", "swimlane-body").attr("style", e).attr("x", M).attr("y", b).attr("width", P).attr("height", S).attr("fill", "none").attr("stroke", i);
|
|
215
|
+
const T = k + N / 2, C = t.y;
|
|
216
|
+
p.attr("transform", `translate(${T}, ${C}) rotate(-90) translate(${-u.width / 2}, ${-u.height / 2})`);
|
|
217
|
+
} else {
|
|
218
|
+
const N = Math.max(0, v - b), M = Math.min(A, N), P = b + M, T = Math.max(0, D - P), C = t.x - x / 2;
|
|
219
|
+
if (t.look === "handDrawn") {
|
|
220
|
+
const V = I.svg(o), rt = H(t, {
|
|
221
|
+
roughness: 0.7,
|
|
222
|
+
fill: l,
|
|
223
|
+
stroke: i,
|
|
224
|
+
fillWeight: 3,
|
|
225
|
+
seed: r
|
|
226
|
+
}), st = H(t, {
|
|
227
|
+
roughness: 0.7,
|
|
228
|
+
fill: "none",
|
|
229
|
+
stroke: i,
|
|
230
|
+
seed: r
|
|
231
|
+
}), nt = V.rectangle(C, b, x, M, rt);
|
|
232
|
+
L = o.insert(() => nt, ":first-child");
|
|
233
|
+
const at = V.rectangle(C, P, x, T, st);
|
|
234
|
+
X = o.insert(() => at, ":first-child"), L.select("path:nth-child(2)").attr("style", a.join(";")), L.select("path").attr("style", s.join(";").replace("fill", "stroke"));
|
|
235
|
+
} else
|
|
236
|
+
L = o.insert("rect", ":first-child"), X = o.insert("rect", ":first-child"), L.attr("class", "swimlane-title").attr("style", e).attr("x", C).attr("y", b).attr("width", x).attr("height", M).attr("fill", l).attr("stroke", i), X.attr("class", "swimlane-body").attr("style", e).attr("x", C).attr("y", P).attr("width", x).attr("height", T).attr("fill", "none").attr("stroke", i);
|
|
237
|
+
const G = t.x - u.width / 2, z = b + (M - u.height) / 2;
|
|
238
|
+
p.attr("transform", `translate(${G}, ${z})`);
|
|
239
|
+
}
|
|
240
|
+
if (F.trace("Swimlane data ", t, JSON.stringify(t)), n) {
|
|
241
|
+
const N = p.select("span");
|
|
242
|
+
N && N.attr("style", n);
|
|
243
|
+
}
|
|
244
|
+
return t.offsetX = 0, t.width = x, t.height = S, t.offsetY = u.height - m / 2, t.intersect = function(N) {
|
|
245
|
+
return wt(t, N);
|
|
246
|
+
}, {
|
|
247
|
+
cluster: o,
|
|
248
|
+
labelBBox: u
|
|
249
|
+
};
|
|
250
|
+
}, "swimlane"), Gt = /* @__PURE__ */ $(async (d, t) => {
|
|
251
|
+
F.info("Creating subgraph rect for ", t.id, t);
|
|
252
|
+
const g = J(), { themeVariables: h, handDrawnSeed: r } = g, { clusterBkg: l, clusterBorder: f } = h, { labelStyles: i, nodeStyles: n, borderStyles: e, backgroundStyles: a } = W(t), s = d.insert("g").attr("class", "cluster " + t.cssClasses).attr("id", t.domId).attr("data-look", t.look), o = it(g), c = s.insert("g").attr("class", "cluster-label ");
|
|
253
|
+
let y;
|
|
254
|
+
t.labelType === "markdown" ? y = await gt(c, t.label, {
|
|
255
|
+
style: t.labelStyle,
|
|
256
|
+
useHtmlLabels: o,
|
|
257
|
+
isNode: !0,
|
|
258
|
+
width: t.width
|
|
259
|
+
}) : y = await Mt(c, t.label, t.labelStyle || "", !1, !0);
|
|
260
|
+
let p = y.getBBox();
|
|
261
|
+
if (it(g)) {
|
|
262
|
+
const k = y.children[0], v = U(y);
|
|
263
|
+
p = k.getBoundingClientRect(), v.attr("width", p.width), v.attr("height", p.height);
|
|
264
|
+
}
|
|
265
|
+
const w = t.width <= p.width + t.padding ? p.width + t.padding : t.width;
|
|
266
|
+
t.width <= p.width + t.padding ? t.diff = (w - t.width) / 2 - t.padding : t.diff = -t.padding;
|
|
267
|
+
const u = t.height, m = t.x - w / 2, x = t.y - u / 2;
|
|
268
|
+
F.trace("Data ", t, JSON.stringify(t));
|
|
269
|
+
let S;
|
|
270
|
+
if (t.look === "handDrawn") {
|
|
271
|
+
const k = I.svg(s), v = H(t, {
|
|
272
|
+
roughness: 0.7,
|
|
273
|
+
fill: l,
|
|
274
|
+
stroke: f,
|
|
275
|
+
fillWeight: 3,
|
|
276
|
+
seed: r
|
|
277
|
+
}), B = k.path(dt(m, x, w, u, 0), v);
|
|
278
|
+
S = s.insert(() => (F.debug("Rough node insert CXC", B), B), ":first-child"), S.select("path:nth-child(2)").attr("style", e.join(";")), S.select("path").attr("style", a.join(";").replace("fill", "stroke"));
|
|
279
|
+
} else
|
|
280
|
+
S = s.insert("rect", ":first-child"), S.attr("style", n).attr("rx", t.rx).attr("ry", t.ry).attr("x", m).attr("y", x).attr("width", w).attr("height", u);
|
|
281
|
+
const { subGraphTitleTopMargin: b } = ia(g);
|
|
282
|
+
if (c.attr("transform", `translate(${t.x - p.width / 2}, ${t.y - t.height / 2 + b})`), i) {
|
|
283
|
+
const k = c.select("span");
|
|
284
|
+
k && k.attr("style", i);
|
|
285
|
+
}
|
|
286
|
+
const D = S.node().getBBox();
|
|
287
|
+
return t.offsetX = 0, t.width = D.width, t.height = D.height, t.offsetY = p.height - t.padding / 2, t.intersect = function(k) {
|
|
288
|
+
return wt(t, k);
|
|
289
|
+
}, {
|
|
290
|
+
cluster: s,
|
|
291
|
+
labelBBox: p
|
|
292
|
+
};
|
|
293
|
+
}, "rect"), Ns = {
|
|
294
|
+
rect: Gt,
|
|
295
|
+
squareRect: Gt,
|
|
296
|
+
roundedWithTitle: /* @__PURE__ */ $(async (d, t) => {
|
|
297
|
+
const g = J(), { themeVariables: h, handDrawnSeed: r } = g, { altBackground: l, compositeBackground: f, compositeTitleBackground: i, nodeBorder: n } = h, e = d.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-id", t.id).attr("data-look", t.look), a = e.insert("g", ":first-child"), s = e.insert("g").attr("class", "cluster-label");
|
|
298
|
+
let o = e.append("rect");
|
|
299
|
+
const c = await Mt(s, t.label, t.labelStyle, void 0, !0);
|
|
300
|
+
let y = c.getBBox();
|
|
301
|
+
if (it(g)) {
|
|
302
|
+
const v = c.children[0], B = U(c);
|
|
303
|
+
y = v.getBoundingClientRect(), B.attr("width", y.width), B.attr("height", y.height);
|
|
304
|
+
}
|
|
305
|
+
const p = 0 * t.padding, w = p / 2, u = (t.width <= y.width + t.padding ? y.width + t.padding : t.width) + p;
|
|
306
|
+
t.width <= y.width + t.padding ? t.diff = (u - t.width) / 2 - t.padding : t.diff = -t.padding;
|
|
307
|
+
const m = t.height + p, x = t.height + p - y.height - 6, S = t.x - u / 2, b = t.y - m / 2;
|
|
308
|
+
t.width = u;
|
|
309
|
+
const D = t.y - t.height / 2 - w + y.height + 2;
|
|
310
|
+
let k;
|
|
311
|
+
if (t.look === "handDrawn") {
|
|
312
|
+
const v = t.cssClasses.includes("statediagram-cluster-alt"), B = I.svg(e), A = t.rx || t.ry ? B.path(dt(S, b, u, m, 10), {
|
|
313
|
+
roughness: 0.7,
|
|
314
|
+
fill: i,
|
|
315
|
+
fillStyle: "solid",
|
|
316
|
+
stroke: n,
|
|
317
|
+
seed: r
|
|
318
|
+
}) : B.rectangle(S, b, u, m, { seed: r });
|
|
319
|
+
k = e.insert(() => A, ":first-child");
|
|
320
|
+
const L = B.rectangle(S, D, u, x, {
|
|
321
|
+
fill: v ? l : f,
|
|
322
|
+
fillStyle: v ? "hachure" : "solid",
|
|
323
|
+
stroke: n,
|
|
324
|
+
seed: r
|
|
325
|
+
});
|
|
326
|
+
k = e.insert(() => A, ":first-child"), o = e.insert(() => L);
|
|
327
|
+
} else
|
|
328
|
+
k = a.insert("rect", ":first-child"), k.attr("class", "outer").attr("x", S).attr("y", b).attr("width", u).attr("height", m).attr("data-look", t.look), o.attr("class", "inner").attr("x", S).attr("y", D).attr("width", u).attr("height", x);
|
|
329
|
+
return s.attr("transform", `translate(${t.x - y.width / 2}, ${b + 1 - (it(g) ? 0 : 3)})`), t.height = k.node().getBBox().height, t.offsetX = 0, t.offsetY = y.height - t.padding / 2, t.labelBBox = y, t.intersect = function(v) {
|
|
330
|
+
return wt(t, v);
|
|
331
|
+
}, {
|
|
332
|
+
cluster: e,
|
|
333
|
+
labelBBox: y
|
|
334
|
+
};
|
|
335
|
+
}, "roundedWithTitle"),
|
|
336
|
+
noteGroup: /* @__PURE__ */ $((d, t) => {
|
|
337
|
+
const g = d.insert("g").attr("class", "note-cluster").attr("id", t.domId), h = g.insert("rect", ":first-child"), r = 0 * t.padding, l = r / 2;
|
|
338
|
+
h.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - l).attr("y", t.y - t.height / 2 - l).attr("width", t.width + r).attr("height", t.height + r).attr("fill", "none");
|
|
339
|
+
const f = h.node().getBBox();
|
|
340
|
+
return t.width = f.width, t.height = f.height, t.intersect = function(i) {
|
|
341
|
+
return wt(t, i);
|
|
342
|
+
}, {
|
|
343
|
+
cluster: g,
|
|
344
|
+
labelBBox: {
|
|
345
|
+
width: 0,
|
|
346
|
+
height: 0
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}, "noteGroup"),
|
|
350
|
+
divider: /* @__PURE__ */ $((d, t) => {
|
|
351
|
+
const { themeVariables: g, handDrawnSeed: h } = J(), { nodeBorder: r } = g, l = d.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-look", t.look), f = l.insert("g", ":first-child"), i = 0 * t.padding, n = t.width + i;
|
|
352
|
+
t.diff = -t.padding;
|
|
353
|
+
const e = t.height + i, a = t.x - n / 2, s = t.y - e / 2;
|
|
354
|
+
t.width = n;
|
|
355
|
+
let o;
|
|
356
|
+
if (t.look === "handDrawn") {
|
|
357
|
+
const c = I.svg(l).rectangle(a, s, n, e, {
|
|
358
|
+
fill: "lightgrey",
|
|
359
|
+
roughness: 0.5,
|
|
360
|
+
strokeLineDash: [5],
|
|
361
|
+
stroke: r,
|
|
362
|
+
seed: h
|
|
363
|
+
});
|
|
364
|
+
o = l.insert(() => c, ":first-child");
|
|
365
|
+
} else {
|
|
366
|
+
o = f.insert("rect", ":first-child");
|
|
367
|
+
let c = "outer";
|
|
368
|
+
t.look, c = "divider", o.attr("class", c).attr("x", a).attr("y", s).attr("width", n).attr("height", e).attr("data-look", t.look);
|
|
369
|
+
}
|
|
370
|
+
return t.height = o.node().getBBox().height, t.offsetX = 0, t.offsetY = 0, t.intersect = function(c) {
|
|
371
|
+
return wt(t, c);
|
|
372
|
+
}, {
|
|
373
|
+
cluster: l,
|
|
374
|
+
labelBBox: {}
|
|
375
|
+
};
|
|
376
|
+
}, "divider"),
|
|
377
|
+
kanbanSection: /* @__PURE__ */ $(async (d, t) => {
|
|
378
|
+
F.info("Creating subgraph rect for ", t.id, t);
|
|
379
|
+
const g = J(), { themeVariables: h, handDrawnSeed: r } = g, { clusterBkg: l, clusterBorder: f } = h, { labelStyles: i, nodeStyles: n, borderStyles: e, backgroundStyles: a } = W(t), s = d.insert("g").attr("class", "cluster " + t.cssClasses).attr("id", t.domId).attr("data-look", t.look), o = it(g), c = s.insert("g").attr("class", "cluster-label "), y = await gt(c, t.label, {
|
|
380
|
+
style: t.labelStyle,
|
|
381
|
+
useHtmlLabels: o,
|
|
382
|
+
isNode: !0,
|
|
383
|
+
width: t.width
|
|
384
|
+
});
|
|
385
|
+
let p = y.getBBox();
|
|
386
|
+
if (it(g)) {
|
|
387
|
+
const k = y.children[0], v = U(y);
|
|
388
|
+
p = k.getBoundingClientRect(), v.attr("width", p.width), v.attr("height", p.height);
|
|
389
|
+
}
|
|
390
|
+
const w = t.width <= p.width + t.padding ? p.width + t.padding : t.width;
|
|
391
|
+
t.width <= p.width + t.padding ? t.diff = (w - t.width) / 2 - t.padding : t.diff = -t.padding;
|
|
392
|
+
const u = t.height, m = t.x - w / 2, x = t.y - u / 2;
|
|
393
|
+
F.trace("Data ", t, JSON.stringify(t));
|
|
394
|
+
let S;
|
|
395
|
+
if (t.look === "handDrawn") {
|
|
396
|
+
const k = I.svg(s), v = H(t, {
|
|
397
|
+
roughness: 0.7,
|
|
398
|
+
fill: l,
|
|
399
|
+
stroke: f,
|
|
400
|
+
fillWeight: 4,
|
|
401
|
+
seed: r
|
|
402
|
+
}), B = k.path(dt(m, x, w, u, t.rx), v);
|
|
403
|
+
S = s.insert(() => (F.debug("Rough node insert CXC", B), B), ":first-child"), S.select("path:nth-child(2)").attr("style", e.join(";")), S.select("path").attr("style", a.join(";").replace("fill", "stroke"));
|
|
404
|
+
} else
|
|
405
|
+
S = s.insert("rect", ":first-child"), S.attr("style", n).attr("rx", t.rx).attr("ry", t.ry).attr("x", m).attr("y", x).attr("width", w).attr("height", u);
|
|
406
|
+
const { subGraphTitleTopMargin: b } = ia(g);
|
|
407
|
+
if (c.attr("transform", `translate(${t.x - p.width / 2}, ${t.y - t.height / 2 + b})`), i) {
|
|
408
|
+
const k = c.select("span");
|
|
409
|
+
k && k.attr("style", i);
|
|
410
|
+
}
|
|
411
|
+
const D = S.node().getBBox();
|
|
412
|
+
return t.offsetX = 0, t.width = D.width, t.height = D.height, t.offsetY = p.height - t.padding / 2, t.intersect = function(k) {
|
|
413
|
+
return wt(t, k);
|
|
414
|
+
}, {
|
|
415
|
+
cluster: s,
|
|
416
|
+
labelBBox: p
|
|
417
|
+
};
|
|
418
|
+
}, "kanbanSection"),
|
|
419
|
+
swimlane: Ms
|
|
420
|
+
}, la = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ $(async (d, t) => {
|
|
421
|
+
const g = await Ns[t.shape || "rect"](d, t);
|
|
422
|
+
return la.set(t.id, g), g;
|
|
423
|
+
}, "insertCluster"), le = /* @__PURE__ */ $(() => {
|
|
424
|
+
la = /* @__PURE__ */ new Map();
|
|
425
|
+
}, "clear");
|
|
426
|
+
function ra(d, t) {
|
|
427
|
+
return d.intersect(t);
|
|
428
|
+
}
|
|
429
|
+
$(ra, "intersectNode");
|
|
430
|
+
var Cs = ra;
|
|
431
|
+
function na(d, t, g, h) {
|
|
432
|
+
var r = d.x, l = d.y, f = r - h.x, i = l - h.y, n = Math.sqrt(t * t * i * i + g * g * f * f), e = Math.abs(t * g * f / n);
|
|
433
|
+
h.x < r && (e = -e);
|
|
434
|
+
var a = Math.abs(t * g * i / n);
|
|
435
|
+
return h.y < l && (a = -a), {
|
|
436
|
+
x: r + e,
|
|
437
|
+
y: l + a
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
$(na, "intersectEllipse");
|
|
441
|
+
var ca = na;
|
|
442
|
+
function oa(d, t, g) {
|
|
443
|
+
return ca(d, t, t, g);
|
|
444
|
+
}
|
|
445
|
+
$(oa, "intersectCircle");
|
|
446
|
+
var Rs = oa;
|
|
447
|
+
function ha(d, t, g, h) {
|
|
448
|
+
{
|
|
449
|
+
const r = t.y - d.y, l = d.x - t.x, f = t.x * d.y - d.x * t.y, i = r * g.x + l * g.y + f, n = r * h.x + l * h.y + f, e = 1e-6;
|
|
450
|
+
if (i !== 0 && n !== 0 && Et(i, n)) return;
|
|
451
|
+
const a = h.y - g.y, s = g.x - h.x, o = h.x * g.y - g.x * h.y, c = a * d.x + s * d.y + o, y = a * t.x + s * t.y + o;
|
|
452
|
+
if (Math.abs(c) < e && Math.abs(y) < e && Et(c, y)) return;
|
|
453
|
+
const p = r * s - a * l;
|
|
454
|
+
if (p === 0) return;
|
|
455
|
+
const w = Math.abs(p / 2);
|
|
456
|
+
let u = l * o - s * f;
|
|
457
|
+
const m = u < 0 ? (u - w) / p : (u + w) / p;
|
|
458
|
+
return u = a * f - r * o, {
|
|
459
|
+
x: m,
|
|
460
|
+
y: u < 0 ? (u - w) / p : (u + w) / p
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
$(ha, "intersectLine");
|
|
465
|
+
function Et(d, t) {
|
|
466
|
+
return d * t > 0;
|
|
467
|
+
}
|
|
468
|
+
$(Et, "sameSign");
|
|
469
|
+
var As = ha;
|
|
470
|
+
function ga(d, t, g) {
|
|
471
|
+
let h = d.x, r = d.y, l = [], f = Number.POSITIVE_INFINITY, i = Number.POSITIVE_INFINITY;
|
|
472
|
+
typeof t.forEach == "function" ? t.forEach(function(a) {
|
|
473
|
+
f = Math.min(f, a.x), i = Math.min(i, a.y);
|
|
474
|
+
}) : (f = Math.min(f, t.x), i = Math.min(i, t.y));
|
|
475
|
+
let n = h - d.width / 2 - f, e = r - d.height / 2 - i;
|
|
476
|
+
for (let a = 0; a < t.length; a++) {
|
|
477
|
+
let s = t[a], o = t[a < t.length - 1 ? a + 1 : 0], c = As(d, g, {
|
|
478
|
+
x: n + s.x,
|
|
479
|
+
y: e + s.y
|
|
480
|
+
}, {
|
|
481
|
+
x: n + o.x,
|
|
482
|
+
y: e + o.y
|
|
483
|
+
});
|
|
484
|
+
c && l.push(c);
|
|
485
|
+
}
|
|
486
|
+
return l.length ? (l.length > 1 && l.sort(function(a, s) {
|
|
487
|
+
let o = a.x - g.x, c = a.y - g.y, y = Math.sqrt(o * o + c * c), p = s.x - g.x, w = s.y - g.y, u = Math.sqrt(p * p + w * w);
|
|
488
|
+
return y < u ? -1 : y === u ? 0 : 1;
|
|
489
|
+
}), l[0]) : d;
|
|
490
|
+
}
|
|
491
|
+
$(ga, "intersectPolygon");
|
|
492
|
+
var R = {
|
|
493
|
+
node: Cs,
|
|
494
|
+
circle: Rs,
|
|
495
|
+
ellipse: ca,
|
|
496
|
+
polygon: ga,
|
|
497
|
+
rect: wt
|
|
498
|
+
};
|
|
499
|
+
function fa(d, t) {
|
|
500
|
+
const { labelStyles: g } = W(t);
|
|
501
|
+
t.labelStyle = g;
|
|
502
|
+
const h = Y(t);
|
|
503
|
+
let r = h;
|
|
504
|
+
h || (r = "anchor");
|
|
505
|
+
const l = d.insert("g").attr("class", r).attr("id", t.domId || t.id), f = 1, { cssStyles: i } = t, n = I.svg(l), e = H(t, {
|
|
506
|
+
fill: "black",
|
|
507
|
+
stroke: "none",
|
|
508
|
+
fillStyle: "solid"
|
|
509
|
+
});
|
|
510
|
+
t.look !== "handDrawn" && (e.roughness = 0);
|
|
511
|
+
const a = n.circle(0, 0, f * 2, e), s = l.insert(() => a, ":first-child");
|
|
512
|
+
return s.attr("class", "anchor").attr("style", K(i)), E(t, s), t.intersect = function(o) {
|
|
513
|
+
return F.info("Circle intersect", t, f, o), R.circle(t, f, o);
|
|
514
|
+
}, l;
|
|
515
|
+
}
|
|
516
|
+
$(fa, "anchor");
|
|
517
|
+
function Xt(d, t, g, h, r, l, f) {
|
|
518
|
+
const n = (d + g) / 2, e = (t + h) / 2, a = Math.atan2(h - t, g - d), s = (g - d) / 2, o = (h - t) / 2, c = s / r, y = o / l, p = Math.sqrt(c ** 2 + y ** 2);
|
|
519
|
+
if (p > 1) throw new Error("The given radii are too small to create an arc between the points.");
|
|
520
|
+
const w = Math.sqrt(1 - p ** 2), u = n + w * l * Math.sin(a) * (f ? -1 : 1), m = e - w * r * Math.cos(a) * (f ? -1 : 1), x = Math.atan2((t - m) / l, (d - u) / r);
|
|
521
|
+
let S = Math.atan2((h - m) / l, (g - u) / r) - x;
|
|
522
|
+
f && S < 0 && (S += 2 * Math.PI), !f && S > 0 && (S -= 2 * Math.PI);
|
|
523
|
+
const b = [];
|
|
524
|
+
for (let D = 0; D < 20; D++) {
|
|
525
|
+
const k = x + D / 19 * S, v = u + r * Math.cos(k), B = m + l * Math.sin(k);
|
|
526
|
+
b.push({
|
|
527
|
+
x: v,
|
|
528
|
+
y: B
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
return b;
|
|
532
|
+
}
|
|
533
|
+
$(Xt, "generateArcPoints");
|
|
534
|
+
function ya(d, t, g) {
|
|
535
|
+
const [h, r] = [t, g].sort((l, f) => f - l);
|
|
536
|
+
return r * (1 - Math.sqrt(1 - (d / h / 2) ** 2));
|
|
537
|
+
}
|
|
538
|
+
$(ya, "calculateArcSagitta");
|
|
539
|
+
async function pa(d, t) {
|
|
540
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
541
|
+
t.labelStyle = g;
|
|
542
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 12 : r, i = /* @__PURE__ */ $((v) => v + f, "calcTotalHeight"), n = /* @__PURE__ */ $((v) => {
|
|
543
|
+
const B = v / 2;
|
|
544
|
+
return [B / (2.5 + v / 50), B];
|
|
545
|
+
}, "calcEllipseRadius"), { shapeSvg: e, bbox: a } = await _(d, t, Y(t)), s = i(t?.height ? t?.height : a.height), [o, c] = n(s), y = ya(s, o, c), p = (t?.width ? t?.width : a.width) + l * 2 + y - y, w = s, { cssStyles: u } = t, m = [
|
|
546
|
+
{
|
|
547
|
+
x: p / 2,
|
|
548
|
+
y: -w / 2
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
x: -p / 2,
|
|
552
|
+
y: -w / 2
|
|
553
|
+
},
|
|
554
|
+
...Xt(-p / 2, -w / 2, -p / 2, w / 2, o, c, !1),
|
|
555
|
+
{
|
|
556
|
+
x: p / 2,
|
|
557
|
+
y: w / 2
|
|
558
|
+
},
|
|
559
|
+
...Xt(p / 2, w / 2, p / 2, -w / 2, o, c, !0)
|
|
560
|
+
], x = I.svg(e), S = H(t, {});
|
|
561
|
+
t.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
|
|
562
|
+
const b = j(m), D = x.path(b, S), k = e.insert(() => D, ":first-child");
|
|
563
|
+
return k.attr("class", "basic label-container outer-path"), u && t.look !== "handDrawn" && k.selectAll("path").attr("style", u), h && t.look !== "handDrawn" && k.selectAll("path").attr("style", h), k.attr("transform", `translate(${o / 2}, 0)`), E(t, k), t.intersect = function(v) {
|
|
564
|
+
return R.polygon(t, m, v);
|
|
565
|
+
}, e;
|
|
566
|
+
}
|
|
567
|
+
$(pa, "bowTieRect");
|
|
568
|
+
function ft(d, t, g, h) {
|
|
569
|
+
return d.insert("polygon", ":first-child").attr("points", h.map(function(r) {
|
|
570
|
+
return r.x + "," + r.y;
|
|
571
|
+
}).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + g / 2 + ")");
|
|
572
|
+
}
|
|
573
|
+
$(ft, "insertPolygonShape");
|
|
574
|
+
var Bt = 12;
|
|
575
|
+
async function da(d, t) {
|
|
576
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
577
|
+
t.labelStyle = g;
|
|
578
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 28 : r, f = t.look === "neo" ? 24 : r, { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = (t?.width ?? n.width) + (t.look === "neo" ? l * 2 : l + Bt), a = (t?.height ?? n.height) + (t.look === "neo" ? f * 2 : f), s = 0, o = e, c = -a, y = 0, p = [
|
|
579
|
+
{
|
|
580
|
+
x: s + Bt,
|
|
581
|
+
y: c
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
x: o,
|
|
585
|
+
y: c
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
x: o,
|
|
589
|
+
y
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
x: s,
|
|
593
|
+
y
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
x: s,
|
|
597
|
+
y: c + Bt
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
x: s + Bt,
|
|
601
|
+
y: c
|
|
602
|
+
}
|
|
603
|
+
];
|
|
604
|
+
let w;
|
|
605
|
+
const { cssStyles: u } = t;
|
|
606
|
+
if (t.look === "handDrawn") {
|
|
607
|
+
const m = I.svg(i), x = H(t, {}), S = j(p), b = m.path(S, x);
|
|
608
|
+
w = i.insert(() => b, ":first-child").attr("transform", `translate(${-e / 2}, ${a / 2})`), u && w.attr("style", u);
|
|
609
|
+
} else w = ft(i, e, a, p);
|
|
610
|
+
return h && w.attr("style", h), E(t, w), t.intersect = function(m) {
|
|
611
|
+
return R.polygon(t, p, m);
|
|
612
|
+
}, i;
|
|
613
|
+
}
|
|
614
|
+
$(da, "card");
|
|
615
|
+
function ua(d, t) {
|
|
616
|
+
const { nodeStyles: g } = W(t);
|
|
617
|
+
t.label = "";
|
|
618
|
+
const h = d.insert("g").attr("class", Y(t)).attr("id", t.domId ?? t.id), { cssStyles: r } = t, l = Math.max(28, t.width ?? 0), f = [
|
|
619
|
+
{
|
|
620
|
+
x: 0,
|
|
621
|
+
y: l / 2
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
x: l / 2,
|
|
625
|
+
y: 0
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
x: 0,
|
|
629
|
+
y: -l / 2
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
x: -l / 2,
|
|
633
|
+
y: 0
|
|
634
|
+
}
|
|
635
|
+
], i = I.svg(h), n = H(t, {});
|
|
636
|
+
t.look !== "handDrawn" && (n.roughness = 0, n.fillStyle = "solid");
|
|
637
|
+
const e = j(f), a = i.path(e, n), s = h.insert(() => a, ":first-child");
|
|
638
|
+
return r && t.look !== "handDrawn" && s.selectAll("path").attr("style", r), g && t.look !== "handDrawn" && s.selectAll("path").attr("style", g), t.width = 28, t.height = 28, t.intersect = function(o) {
|
|
639
|
+
return R.polygon(t, f, o);
|
|
640
|
+
}, h;
|
|
641
|
+
}
|
|
642
|
+
$(ua, "choice");
|
|
643
|
+
async function Yt(d, t, g) {
|
|
644
|
+
const { labelStyles: h, nodeStyles: r } = W(t);
|
|
645
|
+
t.labelStyle = h;
|
|
646
|
+
const { shapeSvg: l, bbox: f, halfPadding: i } = await _(d, t, Y(t)), n = 16, e = g?.padding ?? i, a = t.look === "neo" ? f.width / 2 + n * 2 : f.width / 2 + e;
|
|
647
|
+
let s;
|
|
648
|
+
const { cssStyles: o } = t;
|
|
649
|
+
if (t.look === "handDrawn") {
|
|
650
|
+
const c = I.svg(l), y = H(t, {}), p = c.circle(0, 0, a * 2, y);
|
|
651
|
+
s = l.insert(() => p, ":first-child"), s.attr("class", "basic label-container").attr("style", K(o));
|
|
652
|
+
} else s = l.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", r).attr("r", a).attr("cx", 0).attr("cy", 0);
|
|
653
|
+
return E(t, s), t.calcIntersect = function(c, y) {
|
|
654
|
+
const p = c.width / 2;
|
|
655
|
+
return R.circle(c, p, y);
|
|
656
|
+
}, t.intersect = function(c) {
|
|
657
|
+
return F.info("Circle intersect", t, a, c), R.circle(t, a, c);
|
|
658
|
+
}, l;
|
|
659
|
+
}
|
|
660
|
+
$(Yt, "circle");
|
|
661
|
+
function wa(d) {
|
|
662
|
+
const t = Math.cos(Math.PI / 4), g = Math.sin(Math.PI / 4), h = d * 2, r = {
|
|
663
|
+
x: h / 2 * t,
|
|
664
|
+
y: h / 2 * g
|
|
665
|
+
}, l = {
|
|
666
|
+
x: -(h / 2) * t,
|
|
667
|
+
y: h / 2 * g
|
|
668
|
+
}, f = {
|
|
669
|
+
x: -(h / 2) * t,
|
|
670
|
+
y: -(h / 2) * g
|
|
671
|
+
}, i = {
|
|
672
|
+
x: h / 2 * t,
|
|
673
|
+
y: -(h / 2) * g
|
|
674
|
+
};
|
|
675
|
+
return `M ${l.x},${l.y} L ${i.x},${i.y}
|
|
676
|
+
M ${r.x},${r.y} L ${f.x},${f.y}`;
|
|
677
|
+
}
|
|
678
|
+
$(wa, "createLine");
|
|
679
|
+
function ma(d, t) {
|
|
680
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
681
|
+
t.labelStyle = g, t.label = "";
|
|
682
|
+
const r = d.insert("g").attr("class", Y(t)).attr("id", t.domId ?? t.id), l = Math.max(30, t?.width ?? 0), { cssStyles: f } = t, i = I.svg(r), n = H(t, {});
|
|
683
|
+
t.look !== "handDrawn" && (n.roughness = 0, n.fillStyle = "solid");
|
|
684
|
+
const e = i.circle(0, 0, l * 2, n), a = wa(l), s = i.path(a, n), o = r.insert(() => e, ":first-child");
|
|
685
|
+
return o.insert(() => s), o.attr("class", "outer-path"), f && t.look !== "handDrawn" && o.selectAll("path").attr("style", f), h && t.look !== "handDrawn" && o.selectAll("path").attr("style", h), E(t, o), t.intersect = function(c) {
|
|
686
|
+
return F.info("crossedCircle intersect", t, {
|
|
687
|
+
radius: l,
|
|
688
|
+
point: c
|
|
689
|
+
}), R.circle(t, l, c);
|
|
690
|
+
}, r;
|
|
691
|
+
}
|
|
692
|
+
$(ma, "crossedCircle");
|
|
693
|
+
function ot(d, t, g, h = 100, r = 0, l = 180) {
|
|
694
|
+
const f = [], i = r * Math.PI / 180, n = (l * Math.PI / 180 - i) / (h - 1);
|
|
695
|
+
for (let e = 0; e < h; e++) {
|
|
696
|
+
const a = i + e * n, s = d + g * Math.cos(a), o = t + g * Math.sin(a);
|
|
697
|
+
f.push({
|
|
698
|
+
x: -s,
|
|
699
|
+
y: -o
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
return f;
|
|
703
|
+
}
|
|
704
|
+
$(ot, "generateCirclePoints");
|
|
705
|
+
async function xa(d, t) {
|
|
706
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
707
|
+
t.labelStyle = g;
|
|
708
|
+
const { shapeSvg: r, bbox: l, label: f } = await _(d, t, Y(t)), i = t.look === "neo" ? 18 : t.padding ?? 0, n = t.look === "neo" ? 12 : t.padding ?? 0, e = l.width + i, a = l.height + n, s = Math.max(5, a * 0.1), { cssStyles: o } = t, c = [
|
|
709
|
+
...ot(e / 2, -a / 2, s, 30, -90, 0),
|
|
710
|
+
{
|
|
711
|
+
x: -e / 2 - s,
|
|
712
|
+
y: s
|
|
713
|
+
},
|
|
714
|
+
...ot(e / 2 + s * 2, -s, s, 20, -180, -270),
|
|
715
|
+
...ot(e / 2 + s * 2, s, s, 20, -90, -180),
|
|
716
|
+
{
|
|
717
|
+
x: -e / 2 - s,
|
|
718
|
+
y: -a / 2
|
|
719
|
+
},
|
|
720
|
+
...ot(e / 2, a / 2, s, 20, 0, 90)
|
|
721
|
+
], y = [
|
|
722
|
+
{
|
|
723
|
+
x: e / 2,
|
|
724
|
+
y: -a / 2 - s
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
x: -e / 2,
|
|
728
|
+
y: -a / 2 - s
|
|
729
|
+
},
|
|
730
|
+
...ot(e / 2, -a / 2, s, 20, -90, 0),
|
|
731
|
+
{
|
|
732
|
+
x: -e / 2 - s,
|
|
733
|
+
y: -s
|
|
734
|
+
},
|
|
735
|
+
...ot(e / 2 + e * 0.1, -s, s, 20, -180, -270),
|
|
736
|
+
...ot(e / 2 + e * 0.1, s, s, 20, -90, -180),
|
|
737
|
+
{
|
|
738
|
+
x: -e / 2 - s,
|
|
739
|
+
y: a / 2
|
|
740
|
+
},
|
|
741
|
+
...ot(e / 2, a / 2, s, 20, 0, 90),
|
|
742
|
+
{
|
|
743
|
+
x: -e / 2,
|
|
744
|
+
y: a / 2 + s
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
x: e / 2,
|
|
748
|
+
y: a / 2 + s
|
|
749
|
+
}
|
|
750
|
+
], p = I.svg(r), w = H(t, { fill: "none" });
|
|
751
|
+
t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
752
|
+
const u = j(c).replace("Z", ""), m = p.path(u, w), x = j(y), S = p.path(x, { ...w }), b = r.insert("g", ":first-child");
|
|
753
|
+
return b.insert(() => S, ":first-child").attr("stroke-opacity", 0), b.insert(() => m, ":first-child"), b.attr("class", "text"), o && t.look !== "handDrawn" && b.selectAll("path").attr("style", o), h && t.look !== "handDrawn" && b.selectAll("path").attr("style", h), b.attr("transform", `translate(${s}, 0)`), f.attr("transform", `translate(${-e / 2 + s - (l.x - (l.left ?? 0))},${-a / 2 + (t.padding ?? 0) / 2 - (l.y - (l.top ?? 0))})`), E(t, b), t.intersect = function(D) {
|
|
754
|
+
return R.polygon(t, y, D);
|
|
755
|
+
}, r;
|
|
756
|
+
}
|
|
757
|
+
$(xa, "curlyBraceLeft");
|
|
758
|
+
function ht(d, t, g, h = 100, r = 0, l = 180) {
|
|
759
|
+
const f = [], i = r * Math.PI / 180, n = (l * Math.PI / 180 - i) / (h - 1);
|
|
760
|
+
for (let e = 0; e < h; e++) {
|
|
761
|
+
const a = i + e * n, s = d + g * Math.cos(a), o = t + g * Math.sin(a);
|
|
762
|
+
f.push({
|
|
763
|
+
x: s,
|
|
764
|
+
y: o
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
return f;
|
|
768
|
+
}
|
|
769
|
+
$(ht, "generateCirclePoints");
|
|
770
|
+
async function ba(d, t) {
|
|
771
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
772
|
+
t.labelStyle = g;
|
|
773
|
+
const { shapeSvg: r, bbox: l, label: f } = await _(d, t, Y(t)), i = t.look === "neo" ? 18 : t.padding ?? 0, n = t.look === "neo" ? 12 : t.padding ?? 0, e = l.width + (t.look === "neo" ? i * 2 : i), a = l.height + (t.look === "neo" ? n * 2 : n), s = Math.max(5, a * 0.1), { cssStyles: o } = t, c = [
|
|
774
|
+
...ht(e / 2, -a / 2, s, 20, -90, 0),
|
|
775
|
+
{
|
|
776
|
+
x: e / 2 + s,
|
|
777
|
+
y: -s
|
|
778
|
+
},
|
|
779
|
+
...ht(e / 2 + s * 2, -s, s, 20, -180, -270),
|
|
780
|
+
...ht(e / 2 + s * 2, s, s, 20, -90, -180),
|
|
781
|
+
{
|
|
782
|
+
x: e / 2 + s,
|
|
783
|
+
y: a / 2
|
|
784
|
+
},
|
|
785
|
+
...ht(e / 2, a / 2, s, 20, 0, 90)
|
|
786
|
+
], y = [
|
|
787
|
+
{
|
|
788
|
+
x: -e / 2,
|
|
789
|
+
y: -a / 2 - s
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
x: e / 2,
|
|
793
|
+
y: -a / 2 - s
|
|
794
|
+
},
|
|
795
|
+
...ht(e / 2, -a / 2, s, 20, -90, 0),
|
|
796
|
+
{
|
|
797
|
+
x: e / 2 + s,
|
|
798
|
+
y: -s
|
|
799
|
+
},
|
|
800
|
+
...ht(e / 2 + s * 2, -s, s, 20, -180, -270),
|
|
801
|
+
...ht(e / 2 + s * 2, s, s, 20, -90, -180),
|
|
802
|
+
{
|
|
803
|
+
x: e / 2 + s,
|
|
804
|
+
y: a / 2
|
|
805
|
+
},
|
|
806
|
+
...ht(e / 2, a / 2, s, 20, 0, 90),
|
|
807
|
+
{
|
|
808
|
+
x: e / 2,
|
|
809
|
+
y: a / 2 + s
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
x: -e / 2,
|
|
813
|
+
y: a / 2 + s
|
|
814
|
+
}
|
|
815
|
+
], p = I.svg(r), w = H(t, { fill: "none" });
|
|
816
|
+
t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
817
|
+
const u = j(c).replace("Z", ""), m = p.path(u, w), x = j(y), S = p.path(x, { ...w }), b = r.insert("g", ":first-child");
|
|
818
|
+
return b.insert(() => S, ":first-child").attr("stroke-opacity", 0), b.insert(() => m, ":first-child"), b.attr("class", "text"), o && t.look !== "handDrawn" && b.selectAll("path").attr("style", o), h && t.look !== "handDrawn" && b.selectAll("path").attr("style", h), b.attr("transform", `translate(${-s}, 0)`), f.attr("transform", `translate(${-e / 2 + (t.padding ?? 0) / 2 - (l.x - (l.left ?? 0))},${-a / 2 + (t.padding ?? 0) / 2 - (l.y - (l.top ?? 0))})`), E(t, b), t.intersect = function(D) {
|
|
819
|
+
return R.polygon(t, y, D);
|
|
820
|
+
}, r;
|
|
821
|
+
}
|
|
822
|
+
$(ba, "curlyBraceRight");
|
|
823
|
+
function Q(d, t, g, h = 100, r = 0, l = 180) {
|
|
824
|
+
const f = [], i = r * Math.PI / 180, n = (l * Math.PI / 180 - i) / (h - 1);
|
|
825
|
+
for (let e = 0; e < h; e++) {
|
|
826
|
+
const a = i + e * n, s = d + g * Math.cos(a), o = t + g * Math.sin(a);
|
|
827
|
+
f.push({
|
|
828
|
+
x: -s,
|
|
829
|
+
y: -o
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
return f;
|
|
833
|
+
}
|
|
834
|
+
$(Q, "generateCirclePoints");
|
|
835
|
+
async function Sa(d, t) {
|
|
836
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
837
|
+
t.labelStyle = g;
|
|
838
|
+
const { shapeSvg: r, bbox: l, label: f } = await _(d, t, Y(t)), i = t.look === "neo" ? 18 : t.padding ?? 0, n = t.look === "neo" ? 12 : t.padding ?? 0, e = l.width + (t.look === "neo" ? i * 2 : i), a = l.height + (t.look === "neo" ? n * 2 : n), s = Math.max(5, a * 0.1), { cssStyles: o } = t, c = [
|
|
839
|
+
...Q(e / 2, -a / 2, s, 30, -90, 0),
|
|
840
|
+
{
|
|
841
|
+
x: -e / 2 - s,
|
|
842
|
+
y: s
|
|
843
|
+
},
|
|
844
|
+
...Q(e / 2 + s * 2, -s, s, 20, -180, -270),
|
|
845
|
+
...Q(e / 2 + s * 2, s, s, 20, -90, -180),
|
|
846
|
+
{
|
|
847
|
+
x: -e / 2 - s,
|
|
848
|
+
y: -a / 2
|
|
849
|
+
},
|
|
850
|
+
...Q(e / 2, a / 2, s, 20, 0, 90)
|
|
851
|
+
], y = [
|
|
852
|
+
...Q(-e / 2 + s + s / 2, -a / 2, s, 20, -90, -180),
|
|
853
|
+
{
|
|
854
|
+
x: e / 2 - s / 2,
|
|
855
|
+
y: s
|
|
856
|
+
},
|
|
857
|
+
...Q(-e / 2 - s / 2, -s, s, 20, 0, 90),
|
|
858
|
+
...Q(-e / 2 - s / 2, s, s, 20, -90, 0),
|
|
859
|
+
{
|
|
860
|
+
x: e / 2 - s / 2,
|
|
861
|
+
y: -s
|
|
862
|
+
},
|
|
863
|
+
...Q(-e / 2 + s + s / 2, a / 2, s, 30, -180, -270)
|
|
864
|
+
], p = [
|
|
865
|
+
{
|
|
866
|
+
x: e / 2,
|
|
867
|
+
y: -a / 2 - s
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
x: -e / 2,
|
|
871
|
+
y: -a / 2 - s
|
|
872
|
+
},
|
|
873
|
+
...Q(e / 2, -a / 2, s, 20, -90, 0),
|
|
874
|
+
{
|
|
875
|
+
x: -e / 2 - s,
|
|
876
|
+
y: -s
|
|
877
|
+
},
|
|
878
|
+
...Q(e / 2 + s * 2, -s, s, 20, -180, -270),
|
|
879
|
+
...Q(e / 2 + s * 2, s, s, 20, -90, -180),
|
|
880
|
+
{
|
|
881
|
+
x: -e / 2 - s,
|
|
882
|
+
y: a / 2
|
|
883
|
+
},
|
|
884
|
+
...Q(e / 2, a / 2, s, 20, 0, 90),
|
|
885
|
+
{
|
|
886
|
+
x: -e / 2,
|
|
887
|
+
y: a / 2 + s
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
x: e / 2 - s - s / 2,
|
|
891
|
+
y: a / 2 + s
|
|
892
|
+
},
|
|
893
|
+
...Q(-e / 2 + s + s / 2, -a / 2, s, 20, -90, -180),
|
|
894
|
+
{
|
|
895
|
+
x: e / 2 - s / 2,
|
|
896
|
+
y: s
|
|
897
|
+
},
|
|
898
|
+
...Q(-e / 2 - s / 2, -s, s, 20, 0, 90),
|
|
899
|
+
...Q(-e / 2 - s / 2, s, s, 20, -90, 0),
|
|
900
|
+
{
|
|
901
|
+
x: e / 2 - s / 2,
|
|
902
|
+
y: -s
|
|
903
|
+
},
|
|
904
|
+
...Q(-e / 2 + s + s / 2, a / 2, s, 30, -180, -270)
|
|
905
|
+
], w = I.svg(r), u = H(t, { fill: "none" });
|
|
906
|
+
t.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
|
|
907
|
+
const m = j(c).replace("Z", ""), x = w.path(m, u), S = j(y).replace("Z", ""), b = w.path(S, u), D = j(p), k = w.path(D, { ...u }), v = r.insert("g", ":first-child");
|
|
908
|
+
return v.insert(() => k, ":first-child").attr("stroke-opacity", 0), v.insert(() => x, ":first-child"), v.insert(() => b, ":first-child"), v.attr("class", "text"), o && t.look !== "handDrawn" && v.selectAll("path").attr("style", o), h && t.look !== "handDrawn" && v.selectAll("path").attr("style", h), v.attr("transform", `translate(${s - s / 4}, 0)`), f.attr("transform", `translate(${-e / 2 + (t.padding ?? 0) / 2 - (l.x - (l.left ?? 0))},${-a / 2 + (t.padding ?? 0) / 2 - (l.y - (l.top ?? 0))})`), E(t, v), t.intersect = function(B) {
|
|
909
|
+
return R.polygon(t, p, B);
|
|
910
|
+
}, r;
|
|
911
|
+
}
|
|
912
|
+
$(Sa, "curlyBraces");
|
|
913
|
+
async function $a(d, t) {
|
|
914
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
915
|
+
t.labelStyle = g;
|
|
916
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 12 : r, i = 20, n = 5, { shapeSvg: e, bbox: a } = await _(d, t, Y(t)), s = Math.max(i, (a.width + l * 2) * 1.25, t?.width ?? 0), o = Math.max(n, a.height + f * 2, t?.height ?? 0), c = o / 2, { cssStyles: y } = t, p = I.svg(e), w = H(t, {});
|
|
917
|
+
t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
918
|
+
const u = s, m = o, x = u - c, S = m / 4, b = [
|
|
919
|
+
{
|
|
920
|
+
x,
|
|
921
|
+
y: 0
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
x: S,
|
|
925
|
+
y: 0
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
x: 0,
|
|
929
|
+
y: m / 2
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
x: S,
|
|
933
|
+
y: m
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
x,
|
|
937
|
+
y: m
|
|
938
|
+
},
|
|
939
|
+
...Dt(-x, -m / 2, c, 50, 270, 90)
|
|
940
|
+
], D = j(b), k = p.path(D, w), v = e.insert(() => k, ":first-child");
|
|
941
|
+
return v.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && v.selectChildren("path").attr("style", y), h && t.look !== "handDrawn" && v.selectChildren("path").attr("style", h), v.attr("transform", `translate(${-s / 2}, ${-o / 2})`), E(t, v), t.intersect = function(B) {
|
|
942
|
+
return R.polygon(t, b, B);
|
|
943
|
+
}, e;
|
|
944
|
+
}
|
|
945
|
+
$($a, "curvedTrapezoid");
|
|
946
|
+
var Hs = /* @__PURE__ */ $((d, t, g, h, r, l) => [
|
|
947
|
+
`M${d},${t + l}`,
|
|
948
|
+
`a${r},${l} 0,0,0 ${g},0`,
|
|
949
|
+
`a${r},${l} 0,0,0 ${-g},0`,
|
|
950
|
+
`l0,${h}`,
|
|
951
|
+
`a${r},${l} 0,0,0 ${g},0`,
|
|
952
|
+
`l0,${-h}`
|
|
953
|
+
].join(" "), "createCylinderPathD"), Is = /* @__PURE__ */ $((d, t, g, h, r, l) => [
|
|
954
|
+
`M${d},${t + l}`,
|
|
955
|
+
`M${d + g},${t + l}`,
|
|
956
|
+
`a${r},${l} 0,0,0 ${-g},0`,
|
|
957
|
+
`l0,${h}`,
|
|
958
|
+
`a${r},${l} 0,0,0 ${g},0`,
|
|
959
|
+
`l0,${-h}`
|
|
960
|
+
].join(" "), "createOuterCylinderPathD"), Ls = /* @__PURE__ */ $((d, t, g, h, r, l) => [`M${d - g / 2},${-h / 2}`, `a${r},${l} 0,0,0 ${g},0`].join(" "), "createInnerCylinderPathD"), qt = 8, Ft = 8;
|
|
961
|
+
async function ka(d, t) {
|
|
962
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
963
|
+
t.labelStyle = g;
|
|
964
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 24 : r, f = t.look === "neo" ? 24 : r;
|
|
965
|
+
if (t.width || t.height) {
|
|
966
|
+
const w = t.width ?? 0;
|
|
967
|
+
t.width = (t.width ?? 0) - f, t.width < Ft && (t.width = Ft);
|
|
968
|
+
const u = w / 2 / (2.5 + w / 50);
|
|
969
|
+
t.height = (t.height ?? 0) - l - u * 3, t.height < qt && (t.height = qt);
|
|
970
|
+
}
|
|
971
|
+
const { shapeSvg: i, bbox: n, label: e } = await _(d, t, Y(t)), a = (t.width ? t.width : n.width) + f, s = a / 2, o = s / (2.5 + a / 50), c = (t.height ? t.height : n.height) + l + o;
|
|
972
|
+
let y;
|
|
973
|
+
const { cssStyles: p } = t;
|
|
974
|
+
if (t.look === "handDrawn") {
|
|
975
|
+
const w = I.svg(i), u = Is(0, 0, a, c, s, o), m = Ls(0, o, a, c, s, o), x = H(t, {}), S = w.path(u, x), b = w.path(m, H(t, { fill: "none" }));
|
|
976
|
+
y = i.insert(() => b, ":first-child"), y = i.insert(() => S, ":first-child"), y.attr("class", "basic label-container"), p && y.attr("style", p);
|
|
977
|
+
} else {
|
|
978
|
+
const w = Hs(0, 0, a, c, s, o);
|
|
979
|
+
y = i.insert("path", ":first-child").attr("d", w).attr("class", "basic label-container outer-path").attr("style", K(p)).attr("style", h);
|
|
980
|
+
}
|
|
981
|
+
return y.attr("label-offset-y", o), y.attr("transform", `translate(${-a / 2}, ${-(c / 2 + o)})`), E(t, y), e.attr("transform", `translate(${-(n.width / 2) - (n.x - (n.left ?? 0))}, ${-(n.height / 2) + (t.padding ?? 0) / 1.5 - (n.y - (n.top ?? 0))})`), t.intersect = function(w) {
|
|
982
|
+
const u = R.rect(t, w), m = u.x - (t.x ?? 0);
|
|
983
|
+
if (s != 0 && (Math.abs(m) < (t.width ?? 0) / 2 || Math.abs(m) == (t.width ?? 0) / 2 && Math.abs(u.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - o)) {
|
|
984
|
+
let x = o * o * (1 - m * m / (s * s));
|
|
985
|
+
x > 0 && (x = Math.sqrt(x)), x = o - x, w.y - (t.y ?? 0) > 0 && (x = -x), u.y += x;
|
|
986
|
+
}
|
|
987
|
+
return u;
|
|
988
|
+
}, i;
|
|
989
|
+
}
|
|
990
|
+
$(ka, "cylinder");
|
|
991
|
+
async function $t(d, t, g) {
|
|
992
|
+
const { labelStyles: h, nodeStyles: r } = W(t);
|
|
993
|
+
t.labelStyle = h;
|
|
994
|
+
const { shapeSvg: l, bbox: f } = await _(d, t, Y(t)), i = Math.max(f.width + g.labelPaddingX * 2, t?.width || 0), n = Math.max(f.height + g.labelPaddingY * 2, t?.height || 0), e = -i / 2, a = -n / 2;
|
|
995
|
+
let s, { rx: o, ry: c } = t;
|
|
996
|
+
const { cssStyles: y } = t;
|
|
997
|
+
if (g?.rx && g.ry && (o = g.rx, c = g.ry), t.look === "handDrawn") {
|
|
998
|
+
const p = I.svg(l), w = H(t, {}), u = o || c ? p.path(dt(e, a, i, n, o || 0), w) : p.rectangle(e, a, i, n, w);
|
|
999
|
+
s = l.insert(() => u, ":first-child"), s.attr("class", "basic label-container").attr("style", K(y));
|
|
1000
|
+
} else
|
|
1001
|
+
s = l.insert("rect", ":first-child"), s.attr("class", "basic label-container").attr("style", r).attr("rx", K(o)).attr("ry", K(c)).attr("x", e).attr("y", a).attr("width", i).attr("height", n);
|
|
1002
|
+
return E(t, s), t.calcIntersect = function(p, w) {
|
|
1003
|
+
return R.rect(p, w);
|
|
1004
|
+
}, t.intersect = function(p) {
|
|
1005
|
+
return R.rect(t, p);
|
|
1006
|
+
}, l;
|
|
1007
|
+
}
|
|
1008
|
+
$($t, "drawRect");
|
|
1009
|
+
async function va(d, t) {
|
|
1010
|
+
const { cssClasses: g, labelPaddingX: h, labelPaddingY: r, padding: l, width: f, height: i } = t, n = await $t(d, t, {
|
|
1011
|
+
rx: 0,
|
|
1012
|
+
ry: 0,
|
|
1013
|
+
classes: g ?? "",
|
|
1014
|
+
labelPaddingX: h ?? (l ?? 0) * 2,
|
|
1015
|
+
labelPaddingY: r ?? l ?? 0
|
|
1016
|
+
});
|
|
1017
|
+
if (t.look === "handDrawn") {
|
|
1018
|
+
const o = I.svg(n), c = H(t, {}), y = n.select(".basic.label-container > path:nth-child(2)"), p = y.node();
|
|
1019
|
+
if (!p) return n;
|
|
1020
|
+
let w = null;
|
|
1021
|
+
if (p instanceof SVGGraphicsElement) w = p.getBBox();
|
|
1022
|
+
else return n;
|
|
1023
|
+
return n.insert(() => o.line(w.x, w.y, w.x + w.width, w.y, c), ".basic.label-container g.label"), n.insert(() => o.line(w.x, w.y + w.height, w.x + w.width, w.y + w.height, c), ".basic.label-container g.label"), y.remove(), n;
|
|
1024
|
+
}
|
|
1025
|
+
const e = n.select(".basic.label-container"), a = (Number(e.attr("width")) || f) ?? 0, s = (Number(e.attr("height")) || i) ?? 0;
|
|
1026
|
+
return a > 0 && s > 0 && e.attr("stroke-dasharray", `${a} ${s}`), n;
|
|
1027
|
+
}
|
|
1028
|
+
$(va, "datastore");
|
|
1029
|
+
async function Pa(d, t) {
|
|
1030
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1031
|
+
t.labelStyle = g;
|
|
1032
|
+
const r = t.look === "neo" ? 16 : t.padding ?? 0, l = t.look === "neo" ? 16 : t.padding ?? 0, { shapeSvg: f, bbox: i, label: n } = await _(d, t, Y(t)), e = i.width + r, a = i.height + l, s = a * 0.2, o = -e / 2, c = -a / 2 - s / 2, { cssStyles: y } = t, p = I.svg(f), w = H(t, {});
|
|
1033
|
+
t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
1034
|
+
const u = [
|
|
1035
|
+
{
|
|
1036
|
+
x: o,
|
|
1037
|
+
y: c + s
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
x: -o,
|
|
1041
|
+
y: c + s
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
x: -o,
|
|
1045
|
+
y: -c
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
x: o,
|
|
1049
|
+
y: -c
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
x: o,
|
|
1053
|
+
y: c
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
x: -o,
|
|
1057
|
+
y: c
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
x: -o,
|
|
1061
|
+
y: c + s
|
|
1062
|
+
}
|
|
1063
|
+
], m = p.polygon(u.map((S) => [S.x, S.y]), w), x = f.insert(() => m, ":first-child");
|
|
1064
|
+
return x.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && x.selectAll("path").attr("style", y), h && t.look !== "handDrawn" && x.selectAll("path").attr("style", h), n.attr("transform", `translate(${o + (t.padding ?? 0) / 2 - (i.x - (i.left ?? 0))}, ${c + s + (t.padding ?? 0) / 2 - (i.y - (i.top ?? 0))})`), E(t, x), t.intersect = function(S) {
|
|
1065
|
+
return R.rect(t, S);
|
|
1066
|
+
}, f;
|
|
1067
|
+
}
|
|
1068
|
+
$(Pa, "dividedRectangle");
|
|
1069
|
+
async function Da(d, t) {
|
|
1070
|
+
const { labelStyles: g, nodeStyles: h } = W(t), r = t.look === "neo" ? 12 : 5;
|
|
1071
|
+
t.labelStyle = g;
|
|
1072
|
+
const l = t.padding ?? 0, f = t.look === "neo" ? 16 : l, { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = (t?.width ? t?.width / 2 : n.width / 2) + (f ?? 0), a = e - r;
|
|
1073
|
+
let s;
|
|
1074
|
+
const { cssStyles: o } = t;
|
|
1075
|
+
if (t.look === "handDrawn") {
|
|
1076
|
+
const c = I.svg(i), y = H(t, {
|
|
1077
|
+
roughness: 0.2,
|
|
1078
|
+
strokeWidth: 2.5
|
|
1079
|
+
}), p = H(t, {
|
|
1080
|
+
roughness: 0.2,
|
|
1081
|
+
strokeWidth: 1.5
|
|
1082
|
+
}), w = c.circle(0, 0, e * 2, y), u = c.circle(0, 0, a * 2, p);
|
|
1083
|
+
s = i.insert("g", ":first-child"), s.attr("class", K(t.cssClasses)).attr("style", K(o)), s.node()?.appendChild(w), s.node()?.appendChild(u);
|
|
1084
|
+
} else {
|
|
1085
|
+
s = i.insert("g", ":first-child");
|
|
1086
|
+
const c = s.insert("circle", ":first-child"), y = s.insert("circle");
|
|
1087
|
+
s.attr("class", "basic label-container").attr("style", h), c.attr("class", "outer-circle").attr("style", h).attr("r", e).attr("cx", 0).attr("cy", 0), y.attr("class", "inner-circle").attr("style", h).attr("r", a).attr("cx", 0).attr("cy", 0);
|
|
1088
|
+
}
|
|
1089
|
+
return E(t, s), t.intersect = function(c) {
|
|
1090
|
+
return F.info("DoubleCircle intersect", t, e, c), R.circle(t, e, c);
|
|
1091
|
+
}, i;
|
|
1092
|
+
}
|
|
1093
|
+
$(Da, "doublecircle");
|
|
1094
|
+
function Ba(d, t, { config: { themeVariables: g } }) {
|
|
1095
|
+
const { labelStyles: h, nodeStyles: r } = W(t);
|
|
1096
|
+
t.label = "", t.labelStyle = h;
|
|
1097
|
+
const l = d.insert("g").attr("class", Y(t)).attr("id", t.domId ?? t.id), f = 7, { cssStyles: i } = t, n = I.svg(l), { nodeBorder: e } = g, a = H(t, { fillStyle: "solid" });
|
|
1098
|
+
t.look !== "handDrawn" && (a.roughness = 0);
|
|
1099
|
+
const s = n.circle(0, 0, f * 2, a), o = l.insert(() => s, ":first-child");
|
|
1100
|
+
return o.selectAll("path").attr("style", `fill: ${e} !important;`), i && i.length > 0 && t.look !== "handDrawn" && o.selectAll("path").attr("style", i), r && t.look !== "handDrawn" && o.selectAll("path").attr("style", r), E(t, o), t.intersect = function(c) {
|
|
1101
|
+
return F.info("filledCircle intersect", t, {
|
|
1102
|
+
radius: f,
|
|
1103
|
+
point: c
|
|
1104
|
+
}), R.circle(t, f, c);
|
|
1105
|
+
}, l;
|
|
1106
|
+
}
|
|
1107
|
+
$(Ba, "filledCircle");
|
|
1108
|
+
var zt = 10, Vt = 10;
|
|
1109
|
+
async function Ma(d, t) {
|
|
1110
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1111
|
+
t.labelStyle = g;
|
|
1112
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? r * 2 : r;
|
|
1113
|
+
(t.width || t.height) && (t.height = t?.height ?? 0, t.height < zt && (t.height = zt), t.width = (t?.width ?? 0) - l - l / 2, t.width < Vt && (t.width = Vt));
|
|
1114
|
+
const { shapeSvg: f, bbox: i, label: n } = await _(d, t, Y(t)), e = (t?.width ? t?.width : i.width) + (l ?? 0), a = t?.height ? t?.height : e + i.height, s = a, o = [
|
|
1115
|
+
{
|
|
1116
|
+
x: 0,
|
|
1117
|
+
y: -a
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
x: s,
|
|
1121
|
+
y: -a
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
x: s / 2,
|
|
1125
|
+
y: 0
|
|
1126
|
+
}
|
|
1127
|
+
], { cssStyles: c } = t, y = I.svg(f), p = H(t, {});
|
|
1128
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
1129
|
+
const w = j(o), u = y.path(w, p), m = f.insert(() => u, ":first-child").attr("transform", `translate(${-a / 2}, ${a / 2})`).attr("class", "outer-path");
|
|
1130
|
+
return c && t.look !== "handDrawn" && m.selectChildren("path").attr("style", c), h && t.look !== "handDrawn" && m.selectChildren("path").attr("style", h), t.width = e, t.height = a, E(t, m), n.attr("transform", `translate(${-i.width / 2 - (i.x - (i.left ?? 0))}, ${-a / 2 + (t.padding ?? 0) / 2 + (i.y - (i.top ?? 0))})`), t.intersect = function(x) {
|
|
1131
|
+
return F.info("Triangle intersect", t, o, x), R.polygon(t, o, x);
|
|
1132
|
+
}, f;
|
|
1133
|
+
}
|
|
1134
|
+
$(Ma, "flippedTriangle");
|
|
1135
|
+
function Na(d, t, { dir: g, config: { state: h, themeVariables: r } }) {
|
|
1136
|
+
const { nodeStyles: l } = W(t);
|
|
1137
|
+
t.label = "";
|
|
1138
|
+
const f = d.insert("g").attr("class", Y(t)).attr("id", t.domId ?? t.id), { cssStyles: i } = t;
|
|
1139
|
+
let n = Math.max(70, t?.width ?? 0), e = Math.max(10, t?.height ?? 0);
|
|
1140
|
+
g === "LR" && (n = Math.max(10, t?.width ?? 0), e = Math.max(70, t?.height ?? 0));
|
|
1141
|
+
const a = -1 * n / 2, s = -1 * e / 2, o = I.svg(f), c = H(t, {
|
|
1142
|
+
stroke: r.lineColor,
|
|
1143
|
+
fill: r.lineColor
|
|
1144
|
+
});
|
|
1145
|
+
t.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
|
|
1146
|
+
const y = o.rectangle(a, s, n, e, c), p = f.insert(() => y, ":first-child");
|
|
1147
|
+
i && t.look !== "handDrawn" && p.selectAll("path").attr("style", i), l && t.look !== "handDrawn" && p.selectAll("path").attr("style", l), E(t, p);
|
|
1148
|
+
const w = h?.padding ?? 0;
|
|
1149
|
+
return t.width && t.height && (t.width += w / 2 || 0, t.height += w / 2 || 0), t.intersect = function(u) {
|
|
1150
|
+
return R.rect(t, u);
|
|
1151
|
+
}, f;
|
|
1152
|
+
}
|
|
1153
|
+
$(Na, "forkJoin");
|
|
1154
|
+
async function Ca(d, t) {
|
|
1155
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1156
|
+
t.labelStyle = g;
|
|
1157
|
+
const r = 15, l = 10, f = t.look === "neo" ? 16 : t.padding ?? 0, i = t.look === "neo" ? 12 : t.padding ?? 0;
|
|
1158
|
+
(t.width || t.height) && (t.height = (t?.height ?? 0) - i * 2, t.height < l && (t.height = l), t.width = (t?.width ?? 0) - f * 2, t.width < r && (t.width = r));
|
|
1159
|
+
const { shapeSvg: n, bbox: e } = await _(d, t, Y(t)), a = (t?.width ? t?.width : Math.max(r, e.width)) + f * 2, s = (t?.height ? t?.height : Math.max(l, e.height)) + i * 2, o = s / 2, { cssStyles: c } = t, y = I.svg(n), p = H(t, {});
|
|
1160
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
1161
|
+
const w = [
|
|
1162
|
+
{
|
|
1163
|
+
x: -a / 2,
|
|
1164
|
+
y: -s / 2
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
x: a / 2 - o,
|
|
1168
|
+
y: -s / 2
|
|
1169
|
+
},
|
|
1170
|
+
...Dt(-a / 2 + o, 0, o, 50, 90, 270),
|
|
1171
|
+
{
|
|
1172
|
+
x: a / 2 - o,
|
|
1173
|
+
y: s / 2
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
x: -a / 2,
|
|
1177
|
+
y: s / 2
|
|
1178
|
+
}
|
|
1179
|
+
], u = j(w), m = y.path(u, p), x = n.insert(() => m, ":first-child");
|
|
1180
|
+
return x.attr("class", "basic label-container outer-path"), c && t.look !== "handDrawn" && x.selectChildren("path").attr("style", c), h && t.look !== "handDrawn" && x.selectChildren("path").attr("style", h), E(t, x), t.intersect = function(S) {
|
|
1181
|
+
return F.info("Pill intersect", t, {
|
|
1182
|
+
radius: o,
|
|
1183
|
+
point: S
|
|
1184
|
+
}), R.polygon(t, w, S);
|
|
1185
|
+
}, n;
|
|
1186
|
+
}
|
|
1187
|
+
$(Ca, "halfRoundedRectangle");
|
|
1188
|
+
var Ts = /* @__PURE__ */ $((d, t, g, h, r) => [
|
|
1189
|
+
`M${d + r},${t}`,
|
|
1190
|
+
`L${d + g - r},${t}`,
|
|
1191
|
+
`L${d + g},${t - h / 2}`,
|
|
1192
|
+
`L${d + g - r},${t - h}`,
|
|
1193
|
+
`L${d + r},${t - h}`,
|
|
1194
|
+
`L${d},${t - h / 2}`,
|
|
1195
|
+
"Z"
|
|
1196
|
+
].join(" "), "createHexagonPathD");
|
|
1197
|
+
async function Ra(d, t) {
|
|
1198
|
+
const { labelStyles: g, nodeStyles: h } = W(t), r = t.look === "neo" ? 3.5 : 4;
|
|
1199
|
+
t.labelStyle = g;
|
|
1200
|
+
const l = t.padding ?? 0, f = 70, i = 32, n = t.look === "neo" ? f : l, e = t.look === "neo" ? i : l;
|
|
1201
|
+
if (t.width || t.height) {
|
|
1202
|
+
const m = (t.height ?? 0) / r;
|
|
1203
|
+
t.width = (t?.width ?? 0) - 2 * m - e, t.height = (t.height ?? 0) - n;
|
|
1204
|
+
}
|
|
1205
|
+
const { shapeSvg: a, bbox: s } = await _(d, t, Y(t)), o = (t?.height ? t?.height : s.height) + n, c = o / r, y = (t?.width ? t?.width : s.width) + 2 * c + e, p = [
|
|
1206
|
+
{
|
|
1207
|
+
x: c,
|
|
1208
|
+
y: 0
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
x: y - c,
|
|
1212
|
+
y: 0
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
x: y,
|
|
1216
|
+
y: -o / 2
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
x: y - c,
|
|
1220
|
+
y: -o
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
x: c,
|
|
1224
|
+
y: -o
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
x: 0,
|
|
1228
|
+
y: -o / 2
|
|
1229
|
+
}
|
|
1230
|
+
];
|
|
1231
|
+
let w;
|
|
1232
|
+
const { cssStyles: u } = t;
|
|
1233
|
+
if (t.look === "handDrawn") {
|
|
1234
|
+
const m = I.svg(a), x = H(t, {}), S = Ts(0, 0, y, o, c), b = m.path(S, x);
|
|
1235
|
+
w = a.insert(() => b, ":first-child").attr("transform", `translate(${-y / 2}, ${o / 2})`), u && w.attr("style", u);
|
|
1236
|
+
} else w = ft(a, y, o, p);
|
|
1237
|
+
return h && w.attr("style", h), t.width = y, t.height = o, E(t, w), t.intersect = function(m) {
|
|
1238
|
+
return R.polygon(t, p, m);
|
|
1239
|
+
}, a;
|
|
1240
|
+
}
|
|
1241
|
+
$(Ra, "hexagon");
|
|
1242
|
+
async function Aa(d, t) {
|
|
1243
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1244
|
+
t.label = "", t.labelStyle = g;
|
|
1245
|
+
const { shapeSvg: r } = await _(d, t, Y(t)), l = Math.max(30, t?.width ?? 0), f = Math.max(30, t?.height ?? 0), { cssStyles: i } = t, n = I.svg(r), e = H(t, {});
|
|
1246
|
+
t.look !== "handDrawn" && (e.roughness = 0, e.fillStyle = "solid");
|
|
1247
|
+
const a = [
|
|
1248
|
+
{
|
|
1249
|
+
x: 0,
|
|
1250
|
+
y: 0
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
x: l,
|
|
1254
|
+
y: 0
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
x: 0,
|
|
1258
|
+
y: f
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
x: l,
|
|
1262
|
+
y: f
|
|
1263
|
+
}
|
|
1264
|
+
], s = j(a), o = n.path(s, e), c = r.insert(() => o, ":first-child");
|
|
1265
|
+
return c.attr("class", "basic label-container outer-path"), i && t.look !== "handDrawn" && c.selectChildren("path").attr("style", i), h && t.look !== "handDrawn" && c.selectChildren("path").attr("style", h), c.attr("transform", `translate(${-l / 2}, ${-f / 2})`), E(t, c), t.intersect = function(y) {
|
|
1266
|
+
return F.info("Pill intersect", t, { points: a }), R.polygon(t, a, y);
|
|
1267
|
+
}, r;
|
|
1268
|
+
}
|
|
1269
|
+
$(Aa, "hourglass");
|
|
1270
|
+
async function Ha(d, t, { config: { themeVariables: g, flowchart: h } }) {
|
|
1271
|
+
const { labelStyles: r } = W(t);
|
|
1272
|
+
t.labelStyle = r;
|
|
1273
|
+
const l = t.assetHeight ?? 48, f = t.assetWidth ?? 48, i = Math.max(l, f), n = h?.wrappingWidth;
|
|
1274
|
+
t.width = Math.max(i, n ?? 0);
|
|
1275
|
+
const { shapeSvg: e, bbox: a, label: s } = await _(d, t, "icon-shape default"), o = t.pos === "t", c = i, y = i, { nodeBorder: p } = g, { stylesMap: w } = At(t), u = -y / 2, m = -c / 2, x = t.label ? 8 : 0, S = I.svg(e), b = H(t, {
|
|
1276
|
+
stroke: "none",
|
|
1277
|
+
fill: "none"
|
|
1278
|
+
});
|
|
1279
|
+
t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
|
|
1280
|
+
const D = S.rectangle(u, m, y, c, b), k = Math.max(y, a.width), v = c + a.height + x, B = S.rectangle(-k / 2, -v / 2, k, v, {
|
|
1281
|
+
...b,
|
|
1282
|
+
fill: "transparent",
|
|
1283
|
+
stroke: "none"
|
|
1284
|
+
}), A = e.insert(() => D, ":first-child"), L = e.insert(() => B);
|
|
1285
|
+
if (t.icon) {
|
|
1286
|
+
const X = e.append("g");
|
|
1287
|
+
X.html(`<g>${await Rt(t.icon, {
|
|
1288
|
+
height: i,
|
|
1289
|
+
width: i,
|
|
1290
|
+
fallbackPrefix: ""
|
|
1291
|
+
})}</g>`);
|
|
1292
|
+
const N = X.node().getBBox(), M = N.width, P = N.height, T = N.x, C = N.y;
|
|
1293
|
+
X.attr("transform", `translate(${-M / 2 - T},${o ? a.height / 2 + x / 2 - P / 2 - C : -a.height / 2 - x / 2 - P / 2 - C})`), X.attr("style", `color: ${w.get("stroke") ?? p};`);
|
|
1294
|
+
}
|
|
1295
|
+
return s.attr("transform", `translate(${-a.width / 2 - (a.x - (a.left ?? 0))},${o ? -v / 2 : v / 2 - a.height})`), A.attr("transform", `translate(0,${o ? a.height / 2 + x / 2 : -a.height / 2 - x / 2})`), E(t, L), t.intersect = function(X) {
|
|
1296
|
+
if (F.info("iconSquare intersect", t, X), !t.label) return R.rect(t, X);
|
|
1297
|
+
const N = t.x ?? 0, M = t.y ?? 0, P = t.height ?? 0;
|
|
1298
|
+
let T = [];
|
|
1299
|
+
return o ? T = [
|
|
1300
|
+
{
|
|
1301
|
+
x: N - a.width / 2,
|
|
1302
|
+
y: M - P / 2
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
x: N + a.width / 2,
|
|
1306
|
+
y: M - P / 2
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
x: N + a.width / 2,
|
|
1310
|
+
y: M - P / 2 + a.height + x
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
x: N + y / 2,
|
|
1314
|
+
y: M - P / 2 + a.height + x
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
x: N + y / 2,
|
|
1318
|
+
y: M + P / 2
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
x: N - y / 2,
|
|
1322
|
+
y: M + P / 2
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
x: N - y / 2,
|
|
1326
|
+
y: M - P / 2 + a.height + x
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
x: N - a.width / 2,
|
|
1330
|
+
y: M - P / 2 + a.height + x
|
|
1331
|
+
}
|
|
1332
|
+
] : T = [
|
|
1333
|
+
{
|
|
1334
|
+
x: N - y / 2,
|
|
1335
|
+
y: M - P / 2
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
x: N + y / 2,
|
|
1339
|
+
y: M - P / 2
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
x: N + y / 2,
|
|
1343
|
+
y: M - P / 2 + c
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
x: N + a.width / 2,
|
|
1347
|
+
y: M - P / 2 + c
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
x: N + a.width / 2 / 2,
|
|
1351
|
+
y: M + P / 2
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
x: N - a.width / 2,
|
|
1355
|
+
y: M + P / 2
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
x: N - a.width / 2,
|
|
1359
|
+
y: M - P / 2 + c
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
x: N - y / 2,
|
|
1363
|
+
y: M - P / 2 + c
|
|
1364
|
+
}
|
|
1365
|
+
], R.polygon(t, T, X);
|
|
1366
|
+
}, e;
|
|
1367
|
+
}
|
|
1368
|
+
$(Ha, "icon");
|
|
1369
|
+
async function Ia(d, t, { config: { themeVariables: g, flowchart: h } }) {
|
|
1370
|
+
const { labelStyles: r } = W(t);
|
|
1371
|
+
t.labelStyle = r;
|
|
1372
|
+
const l = t.assetHeight ?? 48, f = t.assetWidth ?? 48, i = Math.max(l, f), n = h?.wrappingWidth;
|
|
1373
|
+
t.width = Math.max(i, n ?? 0);
|
|
1374
|
+
const { shapeSvg: e, bbox: a, label: s } = await _(d, t, "icon-shape default"), o = 20, c = t.label ? 8 : 0, y = t.pos === "t", { nodeBorder: p, mainBkg: w } = g, { stylesMap: u } = At(t), m = I.svg(e), x = H(t, {});
|
|
1375
|
+
t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid"), x.stroke = u.get("fill") ?? w;
|
|
1376
|
+
const S = e.append("g");
|
|
1377
|
+
t.icon && S.html(`<g>${await Rt(t.icon, {
|
|
1378
|
+
height: i,
|
|
1379
|
+
width: i,
|
|
1380
|
+
fallbackPrefix: ""
|
|
1381
|
+
})}</g>`);
|
|
1382
|
+
const b = S.node().getBBox(), D = b.width, k = b.height, v = b.x, B = b.y, A = Math.max(D, k) * Math.SQRT2 + o * 2, L = m.circle(0, 0, A, x), X = Math.max(A, a.width), N = A + a.height + c, M = m.rectangle(-X / 2, -N / 2, X, N, {
|
|
1383
|
+
...x,
|
|
1384
|
+
fill: "transparent",
|
|
1385
|
+
stroke: "none"
|
|
1386
|
+
}), P = e.insert(() => L, ":first-child"), T = e.insert(() => M);
|
|
1387
|
+
return S.attr("transform", `translate(${-D / 2 - v},${y ? a.height / 2 + c / 2 - k / 2 - B : -a.height / 2 - c / 2 - k / 2 - B})`), S.attr("style", `color: ${u.get("stroke") ?? p};`), s.attr("transform", `translate(${-a.width / 2 - (a.x - (a.left ?? 0))},${y ? -N / 2 : N / 2 - a.height})`), P.attr("transform", `translate(0,${y ? a.height / 2 + c / 2 : -a.height / 2 - c / 2})`), E(t, T), t.intersect = function(C) {
|
|
1388
|
+
return F.info("iconSquare intersect", t, C), R.rect(t, C);
|
|
1389
|
+
}, e;
|
|
1390
|
+
}
|
|
1391
|
+
$(Ia, "iconCircle");
|
|
1392
|
+
async function La(d, t, { config: { themeVariables: g, flowchart: h } }) {
|
|
1393
|
+
const { labelStyles: r } = W(t);
|
|
1394
|
+
t.labelStyle = r;
|
|
1395
|
+
const l = t.assetHeight ?? 48, f = t.assetWidth ?? 48, i = Math.max(l, f), n = h?.wrappingWidth;
|
|
1396
|
+
t.width = Math.max(i, n ?? 0);
|
|
1397
|
+
const { shapeSvg: e, bbox: a, halfPadding: s, label: o } = await _(d, t, "icon-shape default"), c = t.pos === "t", y = i + s * 2, p = i + s * 2, { nodeBorder: w, mainBkg: u } = g, { stylesMap: m } = At(t), x = -p / 2, S = -y / 2, b = t.label ? 8 : 0, D = I.svg(e), k = H(t, {});
|
|
1398
|
+
t.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = m.get("fill") ?? u;
|
|
1399
|
+
const v = D.path(dt(x, S, p, y, 5), k), B = Math.max(p, a.width), A = y + a.height + b, L = D.rectangle(-B / 2, -A / 2, B, A, {
|
|
1400
|
+
...k,
|
|
1401
|
+
fill: "transparent",
|
|
1402
|
+
stroke: "none"
|
|
1403
|
+
}), X = e.insert(() => v, ":first-child").attr("class", "icon-shape2"), N = e.insert(() => L);
|
|
1404
|
+
if (t.icon) {
|
|
1405
|
+
const M = e.append("g");
|
|
1406
|
+
M.html(`<g>${await Rt(t.icon, {
|
|
1407
|
+
height: i,
|
|
1408
|
+
width: i,
|
|
1409
|
+
fallbackPrefix: ""
|
|
1410
|
+
})}</g>`);
|
|
1411
|
+
const P = M.node().getBBox(), T = P.width, C = P.height, G = P.x, z = P.y;
|
|
1412
|
+
M.attr("transform", `translate(${-T / 2 - G},${c ? a.height / 2 + b / 2 - C / 2 - z : -a.height / 2 - b / 2 - C / 2 - z})`), M.attr("style", `color: ${m.get("stroke") ?? w};`);
|
|
1413
|
+
}
|
|
1414
|
+
return o.attr("transform", `translate(${-a.width / 2 - (a.x - (a.left ?? 0))},${c ? -A / 2 : A / 2 - a.height})`), X.attr("transform", `translate(0,${c ? a.height / 2 + b / 2 : -a.height / 2 - b / 2})`), E(t, N), t.intersect = function(M) {
|
|
1415
|
+
if (F.info("iconSquare intersect", t, M), !t.label) return R.rect(t, M);
|
|
1416
|
+
const P = t.x ?? 0, T = t.y ?? 0, C = t.height ?? 0;
|
|
1417
|
+
let G = [];
|
|
1418
|
+
return c ? G = [
|
|
1419
|
+
{
|
|
1420
|
+
x: P - a.width / 2,
|
|
1421
|
+
y: T - C / 2
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
x: P + a.width / 2,
|
|
1425
|
+
y: T - C / 2
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
x: P + a.width / 2,
|
|
1429
|
+
y: T - C / 2 + a.height + b
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
x: P + p / 2,
|
|
1433
|
+
y: T - C / 2 + a.height + b
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
x: P + p / 2,
|
|
1437
|
+
y: T + C / 2
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
x: P - p / 2,
|
|
1441
|
+
y: T + C / 2
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
x: P - p / 2,
|
|
1445
|
+
y: T - C / 2 + a.height + b
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
x: P - a.width / 2,
|
|
1449
|
+
y: T - C / 2 + a.height + b
|
|
1450
|
+
}
|
|
1451
|
+
] : G = [
|
|
1452
|
+
{
|
|
1453
|
+
x: P - p / 2,
|
|
1454
|
+
y: T - C / 2
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
x: P + p / 2,
|
|
1458
|
+
y: T - C / 2
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
x: P + p / 2,
|
|
1462
|
+
y: T - C / 2 + y
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
x: P + a.width / 2,
|
|
1466
|
+
y: T - C / 2 + y
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
x: P + a.width / 2 / 2,
|
|
1470
|
+
y: T + C / 2
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
x: P - a.width / 2,
|
|
1474
|
+
y: T + C / 2
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
x: P - a.width / 2,
|
|
1478
|
+
y: T - C / 2 + y
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
x: P - p / 2,
|
|
1482
|
+
y: T - C / 2 + y
|
|
1483
|
+
}
|
|
1484
|
+
], R.polygon(t, G, M);
|
|
1485
|
+
}, e;
|
|
1486
|
+
}
|
|
1487
|
+
$(La, "iconRounded");
|
|
1488
|
+
async function Ta(d, t, { config: { themeVariables: g, flowchart: h } }) {
|
|
1489
|
+
const { labelStyles: r } = W(t);
|
|
1490
|
+
t.labelStyle = r;
|
|
1491
|
+
const l = t.assetHeight ?? 48, f = t.assetWidth ?? 48, i = Math.max(l, f), n = h?.wrappingWidth;
|
|
1492
|
+
t.width = Math.max(i, n ?? 0);
|
|
1493
|
+
const { shapeSvg: e, bbox: a, halfPadding: s, label: o } = await _(d, t, "icon-shape default"), c = t.pos === "t", y = i + s * 2, p = i + s * 2, { nodeBorder: w, mainBkg: u } = g, { stylesMap: m } = At(t), x = -p / 2, S = -y / 2, b = t.label ? 8 : 0, D = I.svg(e), k = H(t, {});
|
|
1494
|
+
t.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = m.get("fill") ?? u;
|
|
1495
|
+
const v = D.path(dt(x, S, p, y, 0.1), k), B = Math.max(p, a.width), A = y + a.height + b, L = D.rectangle(-B / 2, -A / 2, B, A, {
|
|
1496
|
+
...k,
|
|
1497
|
+
fill: "transparent",
|
|
1498
|
+
stroke: "none"
|
|
1499
|
+
}), X = e.insert(() => v, ":first-child"), N = e.insert(() => L);
|
|
1500
|
+
if (t.icon) {
|
|
1501
|
+
const M = e.append("g");
|
|
1502
|
+
M.html(`<g>${await Rt(t.icon, {
|
|
1503
|
+
height: i,
|
|
1504
|
+
width: i,
|
|
1505
|
+
fallbackPrefix: ""
|
|
1506
|
+
})}</g>`);
|
|
1507
|
+
const P = M.node().getBBox(), T = P.width, C = P.height, G = P.x, z = P.y;
|
|
1508
|
+
M.attr("transform", `translate(${-T / 2 - G},${c ? a.height / 2 + b / 2 - C / 2 - z : -a.height / 2 - b / 2 - C / 2 - z})`), M.attr("style", `color: ${m.get("stroke") ?? w};`);
|
|
1509
|
+
}
|
|
1510
|
+
return o.attr("transform", `translate(${-a.width / 2 - (a.x - (a.left ?? 0))},${c ? -A / 2 : A / 2 - a.height})`), X.attr("transform", `translate(0,${c ? a.height / 2 + b / 2 : -a.height / 2 - b / 2})`), E(t, N), t.intersect = function(M) {
|
|
1511
|
+
if (F.info("iconSquare intersect", t, M), !t.label) return R.rect(t, M);
|
|
1512
|
+
const P = t.x ?? 0, T = t.y ?? 0, C = t.height ?? 0;
|
|
1513
|
+
let G = [];
|
|
1514
|
+
return c ? G = [
|
|
1515
|
+
{
|
|
1516
|
+
x: P - a.width / 2,
|
|
1517
|
+
y: T - C / 2
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
x: P + a.width / 2,
|
|
1521
|
+
y: T - C / 2
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
x: P + a.width / 2,
|
|
1525
|
+
y: T - C / 2 + a.height + b
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
x: P + p / 2,
|
|
1529
|
+
y: T - C / 2 + a.height + b
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
x: P + p / 2,
|
|
1533
|
+
y: T + C / 2
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
x: P - p / 2,
|
|
1537
|
+
y: T + C / 2
|
|
1538
|
+
},
|
|
1539
|
+
{
|
|
1540
|
+
x: P - p / 2,
|
|
1541
|
+
y: T - C / 2 + a.height + b
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
x: P - a.width / 2,
|
|
1545
|
+
y: T - C / 2 + a.height + b
|
|
1546
|
+
}
|
|
1547
|
+
] : G = [
|
|
1548
|
+
{
|
|
1549
|
+
x: P - p / 2,
|
|
1550
|
+
y: T - C / 2
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
x: P + p / 2,
|
|
1554
|
+
y: T - C / 2
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
x: P + p / 2,
|
|
1558
|
+
y: T - C / 2 + y
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
x: P + a.width / 2,
|
|
1562
|
+
y: T - C / 2 + y
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
x: P + a.width / 2 / 2,
|
|
1566
|
+
y: T + C / 2
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
x: P - a.width / 2,
|
|
1570
|
+
y: T + C / 2
|
|
1571
|
+
},
|
|
1572
|
+
{
|
|
1573
|
+
x: P - a.width / 2,
|
|
1574
|
+
y: T - C / 2 + y
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
x: P - p / 2,
|
|
1578
|
+
y: T - C / 2 + y
|
|
1579
|
+
}
|
|
1580
|
+
], R.polygon(t, G, M);
|
|
1581
|
+
}, e;
|
|
1582
|
+
}
|
|
1583
|
+
$(Ta, "iconSquare");
|
|
1584
|
+
async function Wa(d, t, { config: { flowchart: g } }) {
|
|
1585
|
+
const h = new Image();
|
|
1586
|
+
h.src = t?.img ?? "", await h.decode();
|
|
1587
|
+
const r = Number(h.naturalWidth.toString().replace("px", "")), l = Number(h.naturalHeight.toString().replace("px", ""));
|
|
1588
|
+
t.imageAspectRatio = r / l;
|
|
1589
|
+
const { labelStyles: f } = W(t);
|
|
1590
|
+
t.labelStyle = f;
|
|
1591
|
+
const i = g?.wrappingWidth;
|
|
1592
|
+
t.defaultWidth = g?.wrappingWidth;
|
|
1593
|
+
const n = Math.max(t.label ? i ?? 0 : 0, t?.assetWidth ?? r), e = t.constraint === "on" && t?.assetHeight ? t.assetHeight * t.imageAspectRatio : n, a = t.constraint === "on" ? e / t.imageAspectRatio : t?.assetHeight ?? l;
|
|
1594
|
+
t.width = Math.max(e, i ?? 0);
|
|
1595
|
+
const { shapeSvg: s, bbox: o, label: c } = await _(d, t, "image-shape default"), y = t.pos === "t", p = -e / 2, w = -a / 2, u = t.label ? 8 : 0, m = I.svg(s), x = H(t, {});
|
|
1596
|
+
t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
|
|
1597
|
+
const S = m.rectangle(p, w, e, a, x), b = Math.max(e, o.width), D = a + o.height + u, k = m.rectangle(-b / 2, -D / 2, b, D, {
|
|
1598
|
+
...x,
|
|
1599
|
+
fill: "none",
|
|
1600
|
+
stroke: "none"
|
|
1601
|
+
}), v = s.insert(() => S, ":first-child"), B = s.insert(() => k);
|
|
1602
|
+
if (t.img) {
|
|
1603
|
+
const A = s.append("image");
|
|
1604
|
+
A.attr("href", t.img), A.attr("width", e), A.attr("height", a), A.attr("preserveAspectRatio", "none"), A.attr("transform", `translate(${-e / 2},${y ? D / 2 - a : -D / 2})`);
|
|
1605
|
+
}
|
|
1606
|
+
return c.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))},${y ? -a / 2 - o.height / 2 - u / 2 : a / 2 - o.height / 2 + u / 2})`), v.attr("transform", `translate(0,${y ? o.height / 2 + u / 2 : -o.height / 2 - u / 2})`), E(t, B), t.intersect = function(A) {
|
|
1607
|
+
if (F.info("iconSquare intersect", t, A), !t.label) return R.rect(t, A);
|
|
1608
|
+
const L = t.x ?? 0, X = t.y ?? 0, N = t.height ?? 0;
|
|
1609
|
+
let M = [];
|
|
1610
|
+
return y ? M = [
|
|
1611
|
+
{
|
|
1612
|
+
x: L - o.width / 2,
|
|
1613
|
+
y: X - N / 2
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
x: L + o.width / 2,
|
|
1617
|
+
y: X - N / 2
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
x: L + o.width / 2,
|
|
1621
|
+
y: X - N / 2 + o.height + u
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
x: L + e / 2,
|
|
1625
|
+
y: X - N / 2 + o.height + u
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
x: L + e / 2,
|
|
1629
|
+
y: X + N / 2
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
x: L - e / 2,
|
|
1633
|
+
y: X + N / 2
|
|
1634
|
+
},
|
|
1635
|
+
{
|
|
1636
|
+
x: L - e / 2,
|
|
1637
|
+
y: X - N / 2 + o.height + u
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
x: L - o.width / 2,
|
|
1641
|
+
y: X - N / 2 + o.height + u
|
|
1642
|
+
}
|
|
1643
|
+
] : M = [
|
|
1644
|
+
{
|
|
1645
|
+
x: L - e / 2,
|
|
1646
|
+
y: X - N / 2
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
x: L + e / 2,
|
|
1650
|
+
y: X - N / 2
|
|
1651
|
+
},
|
|
1652
|
+
{
|
|
1653
|
+
x: L + e / 2,
|
|
1654
|
+
y: X - N / 2 + a
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
x: L + o.width / 2,
|
|
1658
|
+
y: X - N / 2 + a
|
|
1659
|
+
},
|
|
1660
|
+
{
|
|
1661
|
+
x: L + o.width / 2 / 2,
|
|
1662
|
+
y: X + N / 2
|
|
1663
|
+
},
|
|
1664
|
+
{
|
|
1665
|
+
x: L - o.width / 2,
|
|
1666
|
+
y: X + N / 2
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
x: L - o.width / 2,
|
|
1670
|
+
y: X - N / 2 + a
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
x: L - e / 2,
|
|
1674
|
+
y: X - N / 2 + a
|
|
1675
|
+
}
|
|
1676
|
+
], R.polygon(t, M, A);
|
|
1677
|
+
}, s;
|
|
1678
|
+
}
|
|
1679
|
+
$(Wa, "imageSquare");
|
|
1680
|
+
async function Ea(d, t) {
|
|
1681
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1682
|
+
t.labelStyle = g;
|
|
1683
|
+
const r = t.padding ?? 0, l = r, f = t.look === "neo" ? r * 2 : r, { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = Math.max(n.width + (f ?? 0) * 2, t?.width ?? 0), a = Math.max(n.height + (l ?? 0) * 2, t?.height ?? 0), s = [
|
|
1684
|
+
{
|
|
1685
|
+
x: 0,
|
|
1686
|
+
y: 0
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
x: e,
|
|
1690
|
+
y: 0
|
|
1691
|
+
},
|
|
1692
|
+
{
|
|
1693
|
+
x: e + 3 * a / 6,
|
|
1694
|
+
y: -a
|
|
1695
|
+
},
|
|
1696
|
+
{
|
|
1697
|
+
x: -3 * a / 6,
|
|
1698
|
+
y: -a
|
|
1699
|
+
}
|
|
1700
|
+
];
|
|
1701
|
+
let o;
|
|
1702
|
+
const { cssStyles: c } = t;
|
|
1703
|
+
if (t.look === "handDrawn") {
|
|
1704
|
+
const y = I.svg(i), p = H(t, {}), w = j(s), u = y.path(w, p);
|
|
1705
|
+
o = i.insert(() => u, ":first-child").attr("transform", `translate(${-e / 2}, ${a / 2})`), c && o.attr("style", c);
|
|
1706
|
+
} else o = ft(i, e, a, s);
|
|
1707
|
+
return h && o.attr("style", h), t.width = e, t.height = a, E(t, o), t.intersect = function(y) {
|
|
1708
|
+
return R.polygon(t, s, y);
|
|
1709
|
+
}, i;
|
|
1710
|
+
}
|
|
1711
|
+
$(Ea, "inv_trapezoid");
|
|
1712
|
+
async function Xa(d, t) {
|
|
1713
|
+
const { shapeSvg: g, bbox: h, label: r } = await _(d, t, "label"), l = g.insert("rect", ":first-child");
|
|
1714
|
+
return l.attr("width", 0.1).attr("height", 0.1), g.attr("class", "label edgeLabel"), r.attr("transform", `translate(${-(h.width / 2) - (h.x - (h.left ?? 0))}, ${-(h.height / 2) - (h.y - (h.top ?? 0))})`), E(t, l), t.intersect = function(f) {
|
|
1715
|
+
return R.rect(t, f);
|
|
1716
|
+
}, g;
|
|
1717
|
+
}
|
|
1718
|
+
$(Xa, "labelRect");
|
|
1719
|
+
async function Ya(d, t) {
|
|
1720
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1721
|
+
t.labelStyle = g;
|
|
1722
|
+
const r = t.padding ?? 0, l = r, f = t.look === "neo" ? r * 2 : r, { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = (t?.height ?? n.height) + l, a = (t?.width ?? n.width) + f, s = [
|
|
1723
|
+
{
|
|
1724
|
+
x: 0,
|
|
1725
|
+
y: 0
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
x: a + 3 * e / 6,
|
|
1729
|
+
y: 0
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
x: a,
|
|
1733
|
+
y: -e
|
|
1734
|
+
},
|
|
1735
|
+
{
|
|
1736
|
+
x: -(3 * e) / 6,
|
|
1737
|
+
y: -e
|
|
1738
|
+
}
|
|
1739
|
+
];
|
|
1740
|
+
let o;
|
|
1741
|
+
const { cssStyles: c } = t;
|
|
1742
|
+
if (t.look === "handDrawn") {
|
|
1743
|
+
const y = I.svg(i), p = H(t, {}), w = j(s), u = y.path(w, p);
|
|
1744
|
+
o = i.insert(() => u, ":first-child").attr("transform", `translate(${-a / 2}, ${e / 2})`), c && o.attr("style", c);
|
|
1745
|
+
} else o = ft(i, a, e, s);
|
|
1746
|
+
return h && o.attr("style", h), t.width = a, t.height = e, E(t, o), t.intersect = function(y) {
|
|
1747
|
+
return R.polygon(t, s, y);
|
|
1748
|
+
}, i;
|
|
1749
|
+
}
|
|
1750
|
+
$(Ya, "lean_left");
|
|
1751
|
+
async function _a(d, t) {
|
|
1752
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1753
|
+
t.labelStyle = g;
|
|
1754
|
+
const r = t.padding ?? 0, l = r, f = t.look === "neo" ? r * 2 : r, { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = (t?.height ?? n.height) + l, a = (t?.width ?? n.width) + f, s = [
|
|
1755
|
+
{
|
|
1756
|
+
x: -3 * e / 6,
|
|
1757
|
+
y: 0
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
x: a,
|
|
1761
|
+
y: 0
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
x: a + 3 * e / 6,
|
|
1765
|
+
y: -e
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
x: 0,
|
|
1769
|
+
y: -e
|
|
1770
|
+
}
|
|
1771
|
+
];
|
|
1772
|
+
let o;
|
|
1773
|
+
const { cssStyles: c } = t;
|
|
1774
|
+
if (t.look === "handDrawn") {
|
|
1775
|
+
const y = I.svg(i), p = H(t, {}), w = j(s), u = y.path(w, p);
|
|
1776
|
+
o = i.insert(() => u, ":first-child").attr("transform", `translate(${-a / 2}, ${e / 2})`), c && o.attr("style", c);
|
|
1777
|
+
} else o = ft(i, a, e, s);
|
|
1778
|
+
return h && o.attr("style", h), t.width = a, t.height = e, E(t, o), t.intersect = function(y) {
|
|
1779
|
+
return R.polygon(t, s, y);
|
|
1780
|
+
}, i;
|
|
1781
|
+
}
|
|
1782
|
+
$(_a, "lean_right");
|
|
1783
|
+
function Oa(d, t) {
|
|
1784
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1785
|
+
t.label = "", t.labelStyle = g;
|
|
1786
|
+
const r = d.insert("g").attr("class", Y(t)).attr("id", t.domId ?? t.id), { cssStyles: l } = t, f = Math.max(35, t?.width ?? 0), i = Math.max(35, t?.height ?? 0), n = 7, e = [
|
|
1787
|
+
{
|
|
1788
|
+
x: f,
|
|
1789
|
+
y: 0
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
x: 0,
|
|
1793
|
+
y: i + n / 2
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
x: f - 2 * n,
|
|
1797
|
+
y: i + n / 2
|
|
1798
|
+
},
|
|
1799
|
+
{
|
|
1800
|
+
x: 0,
|
|
1801
|
+
y: 2 * i
|
|
1802
|
+
},
|
|
1803
|
+
{
|
|
1804
|
+
x: f,
|
|
1805
|
+
y: i - n / 2
|
|
1806
|
+
},
|
|
1807
|
+
{
|
|
1808
|
+
x: 2 * n,
|
|
1809
|
+
y: i - n / 2
|
|
1810
|
+
}
|
|
1811
|
+
], a = I.svg(r), s = H(t, {});
|
|
1812
|
+
t.look !== "handDrawn" && (s.roughness = 0, s.fillStyle = "solid");
|
|
1813
|
+
const o = j(e), c = a.path(o, s), y = r.insert(() => c, ":first-child");
|
|
1814
|
+
return y.attr("class", "outer-path"), l && t.look !== "handDrawn" && y.selectAll("path").attr("style", l), h && t.look !== "handDrawn" && y.selectAll("path").attr("style", h), y.attr("transform", `translate(-${f / 2},${-i})`), E(t, y), t.intersect = function(p) {
|
|
1815
|
+
return F.info("lightningBolt intersect", t, p), R.polygon(t, e, p);
|
|
1816
|
+
}, r;
|
|
1817
|
+
}
|
|
1818
|
+
$(Oa, "lightningBolt");
|
|
1819
|
+
var Ws = /* @__PURE__ */ $((d, t, g, h, r, l, f) => [
|
|
1820
|
+
`M${d},${t + l}`,
|
|
1821
|
+
`a${r},${l} 0,0,0 ${g},0`,
|
|
1822
|
+
`a${r},${l} 0,0,0 ${-g},0`,
|
|
1823
|
+
`l0,${h}`,
|
|
1824
|
+
`a${r},${l} 0,0,0 ${g},0`,
|
|
1825
|
+
`l0,${-h}`,
|
|
1826
|
+
`M${d},${t + l + f}`,
|
|
1827
|
+
`a${r},${l} 0,0,0 ${g},0`
|
|
1828
|
+
].join(" "), "createCylinderPathD"), Es = /* @__PURE__ */ $((d, t, g, h, r, l, f) => [
|
|
1829
|
+
`M${d},${t + l}`,
|
|
1830
|
+
`M${d + g},${t + l}`,
|
|
1831
|
+
`a${r},${l} 0,0,0 ${-g},0`,
|
|
1832
|
+
`l0,${h}`,
|
|
1833
|
+
`a${r},${l} 0,0,0 ${g},0`,
|
|
1834
|
+
`l0,${-h}`,
|
|
1835
|
+
`M${d},${t + l + f}`,
|
|
1836
|
+
`a${r},${l} 0,0,0 ${g},0`
|
|
1837
|
+
].join(" "), "createOuterCylinderPathD"), Xs = /* @__PURE__ */ $((d, t, g, h, r, l) => [`M${d - g / 2},${-h / 2}`, `a${r},${l} 0,0,0 ${g},0`].join(" "), "createInnerCylinderPathD"), Zt = 10, Jt = 10;
|
|
1838
|
+
async function ja(d, t) {
|
|
1839
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1840
|
+
t.labelStyle = g;
|
|
1841
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 24 : r;
|
|
1842
|
+
if (t.width || t.height) {
|
|
1843
|
+
const u = t.width ?? 0;
|
|
1844
|
+
t.width = (t.width ?? 0) - l, t.width < Jt && (t.width = Jt);
|
|
1845
|
+
const m = u / 2 / (2.5 + u / 50);
|
|
1846
|
+
t.height = (t.height ?? 0) - f - m * 3, t.height < Zt && (t.height = Zt);
|
|
1847
|
+
}
|
|
1848
|
+
const { shapeSvg: i, bbox: n, label: e } = await _(d, t, Y(t)), a = (t?.width ? t?.width : n.width) + l * 2, s = a / 2, o = s / (2.5 + a / 50), c = (t?.height ? t?.height : n.height) + o + f * 2, y = c * 0.1;
|
|
1849
|
+
let p;
|
|
1850
|
+
const { cssStyles: w } = t;
|
|
1851
|
+
if (t.look === "handDrawn") {
|
|
1852
|
+
const u = I.svg(i), m = Es(0, 0, a, c, s, o, y), x = Xs(0, o, a, c, s, o), S = H(t, {}), b = u.path(m, S), D = u.path(x, S);
|
|
1853
|
+
i.insert(() => D, ":first-child").attr("class", "line"), p = i.insert(() => b, ":first-child"), p.attr("class", "basic label-container"), w && p.attr("style", w);
|
|
1854
|
+
} else {
|
|
1855
|
+
const u = Ws(0, 0, a, c, s, o, y);
|
|
1856
|
+
p = i.insert("path", ":first-child").attr("d", u).attr("class", "basic label-container outer-path").attr("style", K(w)).attr("style", h);
|
|
1857
|
+
}
|
|
1858
|
+
return p.attr("label-offset-y", o), p.attr("transform", `translate(${-a / 2}, ${-(c / 2 + o)})`), E(t, p), e.attr("transform", `translate(${-(n.width / 2) - (n.x - (n.left ?? 0))}, ${-(n.height / 2) + o - (n.y - (n.top ?? 0))})`), t.intersect = function(u) {
|
|
1859
|
+
const m = R.rect(t, u), x = m.x - (t.x ?? 0);
|
|
1860
|
+
if (s != 0 && (Math.abs(x) < (t.width ?? 0) / 2 || Math.abs(x) == (t.width ?? 0) / 2 && Math.abs(m.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - o)) {
|
|
1861
|
+
let S = o * o * (1 - x * x / (s * s));
|
|
1862
|
+
S > 0 && (S = Math.sqrt(S)), S = o - S, u.y - (t.y ?? 0) > 0 && (S = -S), m.y += S;
|
|
1863
|
+
}
|
|
1864
|
+
return m;
|
|
1865
|
+
}, i;
|
|
1866
|
+
}
|
|
1867
|
+
$(ja, "linedCylinder");
|
|
1868
|
+
async function Ga(d, t) {
|
|
1869
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1870
|
+
t.labelStyle = g;
|
|
1871
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 12 : r;
|
|
1872
|
+
(t.width || t.height) && (t.width = (t.width ?? 0) * 10 / 11 - l * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - f * 2, t.height < 10 && (t.height = 10));
|
|
1873
|
+
const { shapeSvg: i, bbox: n, label: e } = await _(d, t, Y(t)), a = (t?.width ? t?.width : n.width) + (l ?? 0) * 2, s = (t?.height ? t?.height : n.height) + (f ?? 0) * 2, o = t.look === "neo" ? s / 4 : s / 8, c = s + o, { cssStyles: y } = t, p = I.svg(i), w = H(t, {});
|
|
1874
|
+
t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
1875
|
+
const u = [
|
|
1876
|
+
{
|
|
1877
|
+
x: -a / 2 - a / 2 * 0.1,
|
|
1878
|
+
y: -c / 2
|
|
1879
|
+
},
|
|
1880
|
+
{
|
|
1881
|
+
x: -a / 2 - a / 2 * 0.1,
|
|
1882
|
+
y: c / 2
|
|
1883
|
+
},
|
|
1884
|
+
...pt(-a / 2 - a / 2 * 0.1, c / 2, a / 2 + a / 2 * 0.1, c / 2, o, 0.8),
|
|
1885
|
+
{
|
|
1886
|
+
x: a / 2 + a / 2 * 0.1,
|
|
1887
|
+
y: -c / 2
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
x: -a / 2 - a / 2 * 0.1,
|
|
1891
|
+
y: -c / 2
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
x: -a / 2,
|
|
1895
|
+
y: -c / 2
|
|
1896
|
+
},
|
|
1897
|
+
{
|
|
1898
|
+
x: -a / 2,
|
|
1899
|
+
y: c / 2 * 1.1
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
x: -a / 2,
|
|
1903
|
+
y: -c / 2
|
|
1904
|
+
}
|
|
1905
|
+
], m = p.polygon(u.map((S) => [S.x, S.y]), w), x = i.insert(() => m, ":first-child");
|
|
1906
|
+
return x.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && x.selectAll("path").attr("style", y), h && t.look !== "handDrawn" && x.selectAll("path").attr("style", h), x.attr("transform", `translate(0,${-o / 2})`), e.attr("transform", `translate(${-a / 2 + (t.padding ?? 0) + a / 2 * 0.1 / 2 - (n.x - (n.left ?? 0))},${-s / 2 + (t.padding ?? 0) - o / 2 - (n.y - (n.top ?? 0))})`), E(t, x), t.intersect = function(S) {
|
|
1907
|
+
return R.polygon(t, u, S);
|
|
1908
|
+
}, i;
|
|
1909
|
+
}
|
|
1910
|
+
$(Ga, "linedWaveEdgedRect");
|
|
1911
|
+
async function qa(d, t) {
|
|
1912
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
1913
|
+
t.labelStyle = g;
|
|
1914
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 12 : r, i = t.look === "neo" ? 10 : 5;
|
|
1915
|
+
(t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - l * 2 - 2 * i, 10), t.height = Math.max((t?.height ?? 0) - f * 2 - 2 * i, 10));
|
|
1916
|
+
const { shapeSvg: n, bbox: e, label: a } = await _(d, t, Y(t)), s = (t?.width ? t?.width : e.width) + l * 2 + 2 * i, o = (t?.height ? t?.height : e.height) + f * 2 + 2 * i, c = s - 2 * i, y = o - 2 * i, p = -c / 2, w = -y / 2, { cssStyles: u } = t, m = I.svg(n), x = H(t, {}), S = [
|
|
1917
|
+
{
|
|
1918
|
+
x: p - i,
|
|
1919
|
+
y: w + i
|
|
1920
|
+
},
|
|
1921
|
+
{
|
|
1922
|
+
x: p - i,
|
|
1923
|
+
y: w + y + i
|
|
1924
|
+
},
|
|
1925
|
+
{
|
|
1926
|
+
x: p + c - i,
|
|
1927
|
+
y: w + y + i
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
x: p + c - i,
|
|
1931
|
+
y: w + y
|
|
1932
|
+
},
|
|
1933
|
+
{
|
|
1934
|
+
x: p + c,
|
|
1935
|
+
y: w + y
|
|
1936
|
+
},
|
|
1937
|
+
{
|
|
1938
|
+
x: p + c,
|
|
1939
|
+
y: w + y - i
|
|
1940
|
+
},
|
|
1941
|
+
{
|
|
1942
|
+
x: p + c + i,
|
|
1943
|
+
y: w + y - i
|
|
1944
|
+
},
|
|
1945
|
+
{
|
|
1946
|
+
x: p + c + i,
|
|
1947
|
+
y: w - i
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
x: p + i,
|
|
1951
|
+
y: w - i
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
x: p + i,
|
|
1955
|
+
y: w
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
x: p,
|
|
1959
|
+
y: w
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
x: p,
|
|
1963
|
+
y: w + i
|
|
1964
|
+
}
|
|
1965
|
+
], b = [
|
|
1966
|
+
{
|
|
1967
|
+
x: p,
|
|
1968
|
+
y: w + i
|
|
1969
|
+
},
|
|
1970
|
+
{
|
|
1971
|
+
x: p + c - i,
|
|
1972
|
+
y: w + i
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
x: p + c - i,
|
|
1976
|
+
y: w + y
|
|
1977
|
+
},
|
|
1978
|
+
{
|
|
1979
|
+
x: p + c,
|
|
1980
|
+
y: w + y
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
x: p + c,
|
|
1984
|
+
y: w
|
|
1985
|
+
},
|
|
1986
|
+
{
|
|
1987
|
+
x: p,
|
|
1988
|
+
y: w
|
|
1989
|
+
}
|
|
1990
|
+
];
|
|
1991
|
+
t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
|
|
1992
|
+
const D = j(S);
|
|
1993
|
+
let k = m.path(D, x);
|
|
1994
|
+
const v = j(b);
|
|
1995
|
+
let B = m.path(v, x);
|
|
1996
|
+
t.look !== "handDrawn" && (k = Wt(k), B = Wt(B));
|
|
1997
|
+
const A = n.insert("g", ":first-child");
|
|
1998
|
+
return A.insert(() => k), A.insert(() => B), A.attr("class", "basic label-container outer-path"), u && t.look !== "handDrawn" && A.selectAll("path").attr("style", u), h && t.look !== "handDrawn" && A.selectAll("path").attr("style", h), a.attr("transform", `translate(${-(e.width / 2) - i - (e.x - (e.left ?? 0))}, ${-(e.height / 2) + i - (e.y - (e.top ?? 0))})`), E(t, A), t.intersect = function(L) {
|
|
1999
|
+
return R.polygon(t, S, L);
|
|
2000
|
+
}, n;
|
|
2001
|
+
}
|
|
2002
|
+
$(qa, "multiRect");
|
|
2003
|
+
async function Fa(d, t) {
|
|
2004
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2005
|
+
t.labelStyle = g;
|
|
2006
|
+
const { shapeSvg: r, bbox: l, label: f } = await _(d, t, Y(t)), i = t.padding ?? 0, n = t.look === "neo" ? 16 : i, e = t.look === "neo" ? 12 : i;
|
|
2007
|
+
let a = !0;
|
|
2008
|
+
(t.width || t.height) && (a = !1, t.width = (t?.width ?? 0) - n * 2, t.height = (t?.height ?? 0) - e * 3);
|
|
2009
|
+
const s = Math.max(l.width, t?.width ?? 0) + n * 2, o = Math.max(l.height, t?.height ?? 0) + e * 3, c = t.look === "neo" ? o / 4 : o / 8, y = o + (a ? c / 2 : -c / 2), p = -s / 2, w = -y / 2, u = 10, { cssStyles: m } = t, x = pt(p - u, w + y + u, p + s - u, w + y + u, c, 0.8), S = x?.[x.length - 1], b = [
|
|
2010
|
+
{
|
|
2011
|
+
x: p - u,
|
|
2012
|
+
y: w + u
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
x: p - u,
|
|
2016
|
+
y: w + y + u
|
|
2017
|
+
},
|
|
2018
|
+
...x,
|
|
2019
|
+
{
|
|
2020
|
+
x: p + s - u,
|
|
2021
|
+
y: S.y - u
|
|
2022
|
+
},
|
|
2023
|
+
{
|
|
2024
|
+
x: p + s,
|
|
2025
|
+
y: S.y - u
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
x: p + s,
|
|
2029
|
+
y: S.y - 2 * u
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
x: p + s + u,
|
|
2033
|
+
y: S.y - 2 * u
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
x: p + s + u,
|
|
2037
|
+
y: w - u
|
|
2038
|
+
},
|
|
2039
|
+
{
|
|
2040
|
+
x: p + u,
|
|
2041
|
+
y: w - u
|
|
2042
|
+
},
|
|
2043
|
+
{
|
|
2044
|
+
x: p + u,
|
|
2045
|
+
y: w
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
x: p,
|
|
2049
|
+
y: w
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
x: p,
|
|
2053
|
+
y: w + u
|
|
2054
|
+
}
|
|
2055
|
+
], D = [
|
|
2056
|
+
{
|
|
2057
|
+
x: p,
|
|
2058
|
+
y: w + u
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
x: p + s - u,
|
|
2062
|
+
y: w + u
|
|
2063
|
+
},
|
|
2064
|
+
{
|
|
2065
|
+
x: p + s - u,
|
|
2066
|
+
y: S.y - u
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
x: p + s,
|
|
2070
|
+
y: S.y - u
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
x: p + s,
|
|
2074
|
+
y: w
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
x: p,
|
|
2078
|
+
y: w
|
|
2079
|
+
}
|
|
2080
|
+
], k = I.svg(r), v = H(t, {});
|
|
2081
|
+
t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
|
|
2082
|
+
const B = j(b), A = k.path(B, v), L = j(D), X = k.path(L, v), N = r.insert(() => A, ":first-child");
|
|
2083
|
+
return N.insert(() => X), N.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && N.selectAll("path").attr("style", m), h && t.look !== "handDrawn" && N.selectAll("path").attr("style", h), N.attr("transform", `translate(0,${-c / 2})`), f.attr("transform", `translate(${-(l.width / 2) - u - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + u - c / 2 - (l.y - (l.top ?? 0))})`), E(t, N), t.intersect = function(M) {
|
|
2084
|
+
return R.polygon(t, b, M);
|
|
2085
|
+
}, r;
|
|
2086
|
+
}
|
|
2087
|
+
$(Fa, "multiWaveEdgedRectangle");
|
|
2088
|
+
async function za(d, t, { config: { themeVariables: g } }) {
|
|
2089
|
+
const { labelStyles: h, nodeStyles: r } = W(t);
|
|
2090
|
+
t.labelStyle = h, t.useHtmlLabels || it(Pt()) || (t.centerLabel = !0);
|
|
2091
|
+
const { shapeSvg: l, bbox: f, label: i } = await _(d, t, Y(t)), n = Math.max(f.width + (t.padding ?? 0) * 2, t?.width ?? 0), e = Math.max(f.height + (t.padding ?? 0) * 2, t?.height ?? 0), a = -n / 2, s = -e / 2, { cssStyles: o } = t, c = I.svg(l), y = H(t, {
|
|
2092
|
+
fill: g.noteBkgColor,
|
|
2093
|
+
stroke: g.noteBorderColor
|
|
2094
|
+
});
|
|
2095
|
+
t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
|
|
2096
|
+
const p = c.rectangle(a, s, n, e, y), w = l.insert(() => p, ":first-child");
|
|
2097
|
+
return w.attr("class", "basic label-container outer-path"), i.attr("class", "label noteLabel"), o && t.look !== "handDrawn" && w.selectAll("path").attr("style", o), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), i.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${-(f.height / 2) - (f.y - (f.top ?? 0))})`), E(t, w), t.intersect = function(u) {
|
|
2098
|
+
return R.rect(t, u);
|
|
2099
|
+
}, l;
|
|
2100
|
+
}
|
|
2101
|
+
$(za, "note");
|
|
2102
|
+
var Ys = /* @__PURE__ */ $((d, t, g) => [
|
|
2103
|
+
`M${d + g / 2},${t}`,
|
|
2104
|
+
`L${d + g},${t - g / 2}`,
|
|
2105
|
+
`L${d + g / 2},${t - g}`,
|
|
2106
|
+
`L${d},${t - g / 2}`,
|
|
2107
|
+
"Z"
|
|
2108
|
+
].join(" "), "createDecisionBoxPathD");
|
|
2109
|
+
async function Va(d, t) {
|
|
2110
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2111
|
+
t.labelStyle = g;
|
|
2112
|
+
const { shapeSvg: r, bbox: l } = await _(d, t, Y(t)), f = l.width + (t.padding ?? 0) + (l.height + (t.padding ?? 0)), i = 0.5, n = [
|
|
2113
|
+
{
|
|
2114
|
+
x: f / 2,
|
|
2115
|
+
y: 0
|
|
2116
|
+
},
|
|
2117
|
+
{
|
|
2118
|
+
x: f,
|
|
2119
|
+
y: -f / 2
|
|
2120
|
+
},
|
|
2121
|
+
{
|
|
2122
|
+
x: f / 2,
|
|
2123
|
+
y: -f
|
|
2124
|
+
},
|
|
2125
|
+
{
|
|
2126
|
+
x: 0,
|
|
2127
|
+
y: -f / 2
|
|
2128
|
+
}
|
|
2129
|
+
];
|
|
2130
|
+
let e;
|
|
2131
|
+
const { cssStyles: a } = t;
|
|
2132
|
+
if (t.look === "handDrawn") {
|
|
2133
|
+
const s = I.svg(r), o = H(t, {}), c = Ys(0, 0, f), y = s.path(c, o);
|
|
2134
|
+
e = r.insert(() => y, ":first-child").attr("transform", `translate(${-f / 2 + i}, ${f / 2})`), a && e.attr("style", a);
|
|
2135
|
+
} else
|
|
2136
|
+
e = ft(r, f, f, n), e.attr("transform", `translate(${-f / 2 + i}, ${f / 2})`);
|
|
2137
|
+
return h && e.attr("style", h), E(t, e), t.calcIntersect = function(s, o) {
|
|
2138
|
+
const c = s.width, y = [
|
|
2139
|
+
{
|
|
2140
|
+
x: c / 2,
|
|
2141
|
+
y: 0
|
|
2142
|
+
},
|
|
2143
|
+
{
|
|
2144
|
+
x: c,
|
|
2145
|
+
y: -c / 2
|
|
2146
|
+
},
|
|
2147
|
+
{
|
|
2148
|
+
x: c / 2,
|
|
2149
|
+
y: -c
|
|
2150
|
+
},
|
|
2151
|
+
{
|
|
2152
|
+
x: 0,
|
|
2153
|
+
y: -c / 2
|
|
2154
|
+
}
|
|
2155
|
+
], p = R.polygon(s, y, o);
|
|
2156
|
+
return {
|
|
2157
|
+
x: p.x - 0.5,
|
|
2158
|
+
y: p.y - 0.5
|
|
2159
|
+
};
|
|
2160
|
+
}, t.intersect = function(s) {
|
|
2161
|
+
return this.calcIntersect(t, s);
|
|
2162
|
+
}, r;
|
|
2163
|
+
}
|
|
2164
|
+
$(Va, "question");
|
|
2165
|
+
async function Za(d, t) {
|
|
2166
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2167
|
+
t.labelStyle = g;
|
|
2168
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 21 : r ?? 0, f = t.look === "neo" ? 12 : r ?? 0, { shapeSvg: i, bbox: n, label: e } = await _(d, t, Y(t)), a = (t?.width ?? n.width) + (t.look === "neo" ? l * 2 : l), s = (t?.height ?? n.height) + (t.look === "neo" ? f * 2 : f), o = -a / 2, c = -s / 2, y = c / 2, p = [
|
|
2169
|
+
{
|
|
2170
|
+
x: o + y,
|
|
2171
|
+
y: c
|
|
2172
|
+
},
|
|
2173
|
+
{
|
|
2174
|
+
x: o,
|
|
2175
|
+
y: 0
|
|
2176
|
+
},
|
|
2177
|
+
{
|
|
2178
|
+
x: o + y,
|
|
2179
|
+
y: -c
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
x: -o,
|
|
2183
|
+
y: -c
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
x: -o,
|
|
2187
|
+
y: c
|
|
2188
|
+
}
|
|
2189
|
+
], { cssStyles: w } = t, u = I.svg(i), m = H(t, {});
|
|
2190
|
+
t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
2191
|
+
const x = j(p), S = u.path(x, m), b = i.insert(() => S, ":first-child");
|
|
2192
|
+
return b.attr("class", "basic label-container outer-path"), w && t.look !== "handDrawn" && b.selectAll("path").attr("style", w), h && t.look !== "handDrawn" && b.selectAll("path").attr("style", h), b.attr("transform", `translate(${-y / 2},0)`), e.attr("transform", `translate(${-y / 2 - n.width / 2 - (n.x - (n.left ?? 0))}, ${-(n.height / 2) - (n.y - (n.top ?? 0))})`), E(t, b), t.intersect = function(D) {
|
|
2193
|
+
return R.polygon(t, p, D);
|
|
2194
|
+
}, i;
|
|
2195
|
+
}
|
|
2196
|
+
$(Za, "rect_left_inv_arrow");
|
|
2197
|
+
async function Ja(d, t) {
|
|
2198
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2199
|
+
t.labelStyle = g;
|
|
2200
|
+
let r;
|
|
2201
|
+
t.cssClasses ? r = "node " + t.cssClasses : r = "node default";
|
|
2202
|
+
const l = d.insert("g").attr("class", r).attr("id", t.domId || t.id), f = l.insert("g"), i = l.insert("g").attr("class", "label").attr("style", h), n = t.description, e = t.label, a = await Mt(i, e, t.labelStyle, !0, !0);
|
|
2203
|
+
let s = {
|
|
2204
|
+
width: 0,
|
|
2205
|
+
height: 0
|
|
2206
|
+
};
|
|
2207
|
+
if (it(J())) {
|
|
2208
|
+
const v = a.children[0], B = U(a);
|
|
2209
|
+
s = v.getBoundingClientRect(), B.attr("width", s.width), B.attr("height", s.height);
|
|
2210
|
+
}
|
|
2211
|
+
F.info("Text 2", n);
|
|
2212
|
+
const o = n || [], c = a.getBBox(), y = await Mt(i, Array.isArray(o) ? o.join("<br/>") : o, t.labelStyle, !0, !0), p = y.children[0], w = U(y);
|
|
2213
|
+
s = p.getBoundingClientRect(), w.attr("width", s.width), w.attr("height", s.height);
|
|
2214
|
+
const u = (t.padding || 0) / 2;
|
|
2215
|
+
U(y).attr("transform", "translate( " + (s.width > c.width ? 0 : (c.width - s.width) / 2) + ", " + (c.height + u + 5) + ")"), U(a).attr("transform", "translate( " + (s.width < c.width ? 0 : -(c.width - s.width) / 2) + ", 0)"), s = i.node().getBBox(), i.attr("transform", "translate(" + -s.width / 2 + ", " + (-s.height / 2 - u + 3) + ")");
|
|
2216
|
+
const m = s.width + (t.padding || 0), x = s.height + (t.padding || 0), S = -s.width / 2 - u, b = -s.height / 2 - u;
|
|
2217
|
+
let D, k;
|
|
2218
|
+
if (t.look === "handDrawn") {
|
|
2219
|
+
const v = I.svg(l), B = H(t, {}), A = v.path(dt(S, b, m, x, t.rx || 0), B), L = v.line(-s.width / 2 - u, -s.height / 2 - u + c.height + u, s.width / 2 + u, -s.height / 2 - u + c.height + u, B);
|
|
2220
|
+
k = l.insert(() => (F.debug("Rough node insert CXC", A), L), ":first-child"), D = l.insert(() => (F.debug("Rough node insert CXC", A), A), ":first-child");
|
|
2221
|
+
} else
|
|
2222
|
+
D = f.insert("rect", ":first-child"), k = f.insert("line"), D.attr("class", "outer title-state").attr("style", h).attr("x", -s.width / 2 - u).attr("y", -s.height / 2 - u).attr("width", s.width + (t.padding || 0)).attr("height", s.height + (t.padding || 0)), k.attr("class", "divider").attr("x1", -s.width / 2 - u).attr("x2", s.width / 2 + u).attr("y1", -s.height / 2 - u + c.height + u).attr("y2", -s.height / 2 - u + c.height + u);
|
|
2223
|
+
return E(t, D), t.intersect = function(v) {
|
|
2224
|
+
return R.rect(t, v);
|
|
2225
|
+
}, l;
|
|
2226
|
+
}
|
|
2227
|
+
$(Ja, "rectWithTitle");
|
|
2228
|
+
async function Qa(d, t, { config: { themeVariables: g } }) {
|
|
2229
|
+
const h = g?.radius ?? 5;
|
|
2230
|
+
return $t(d, t, {
|
|
2231
|
+
rx: h,
|
|
2232
|
+
ry: h,
|
|
2233
|
+
classes: "",
|
|
2234
|
+
labelPaddingX: (t?.padding ?? 0) * 1,
|
|
2235
|
+
labelPaddingY: (t?.padding ?? 0) * 1
|
|
2236
|
+
});
|
|
2237
|
+
}
|
|
2238
|
+
$(Qa, "roundedRect");
|
|
2239
|
+
var ut = 8;
|
|
2240
|
+
async function Ua(d, t) {
|
|
2241
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2242
|
+
t.labelStyle = g;
|
|
2243
|
+
const r = t.look === "neo" ? 16 : t.padding ?? 0, l = t.look === "neo" ? 12 : t.padding ?? 0, { shapeSvg: f, bbox: i, label: n } = await _(d, t, Y(t)), e = (t?.width ?? i.width) + r * 2 + (t.look === "neo" ? ut : ut * 2), a = (t?.height ?? i.height) + l * 2, s = e - ut, o = a, c = ut - e / 2, y = -a / 2, { cssStyles: p } = t, w = I.svg(f), u = H(t, {});
|
|
2244
|
+
t.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
|
|
2245
|
+
const m = [
|
|
2246
|
+
{
|
|
2247
|
+
x: c,
|
|
2248
|
+
y
|
|
2249
|
+
},
|
|
2250
|
+
{
|
|
2251
|
+
x: c + s,
|
|
2252
|
+
y
|
|
2253
|
+
},
|
|
2254
|
+
{
|
|
2255
|
+
x: c + s,
|
|
2256
|
+
y: y + o
|
|
2257
|
+
},
|
|
2258
|
+
{
|
|
2259
|
+
x: c - ut,
|
|
2260
|
+
y: y + o
|
|
2261
|
+
},
|
|
2262
|
+
{
|
|
2263
|
+
x: c - ut,
|
|
2264
|
+
y
|
|
2265
|
+
},
|
|
2266
|
+
{
|
|
2267
|
+
x: c,
|
|
2268
|
+
y
|
|
2269
|
+
},
|
|
2270
|
+
{
|
|
2271
|
+
x: c,
|
|
2272
|
+
y: y + o
|
|
2273
|
+
}
|
|
2274
|
+
], x = w.polygon(m.map((b) => [b.x, b.y]), u), S = f.insert(() => x, ":first-child");
|
|
2275
|
+
return S.attr("class", "basic label-container outer-path").attr("style", K(p)), h && t.look !== "handDrawn" && S.selectAll("path").attr("style", h), p && t.look !== "handDrawn" && S.selectAll("path").attr("style", h), n.attr("transform", `translate(${ut / 2 - i.width / 2 - (i.x - (i.left ?? 0))}, ${-(i.height / 2) - (i.y - (i.top ?? 0))})`), E(t, S), t.intersect = function(b) {
|
|
2276
|
+
return R.rect(t, b);
|
|
2277
|
+
}, f;
|
|
2278
|
+
}
|
|
2279
|
+
$(Ua, "shadedProcess");
|
|
2280
|
+
async function Ka(d, t) {
|
|
2281
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2282
|
+
t.labelStyle = g;
|
|
2283
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 12 : r;
|
|
2284
|
+
(t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - l * 2, 10), t.height = Math.max((t?.height ?? 0) / 1.5 - f * 2, 10));
|
|
2285
|
+
const { shapeSvg: i, bbox: n, label: e } = await _(d, t, Y(t)), a = (t?.width ? t?.width : n.width) + l * 2, s = ((t?.height ? t?.height : n.height) + f * 2) * 1.5, o = a, c = s / 1.5, y = -o / 2, p = -c / 2, { cssStyles: w } = t, u = I.svg(i), m = H(t, {});
|
|
2286
|
+
t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
2287
|
+
const x = [
|
|
2288
|
+
{
|
|
2289
|
+
x: y,
|
|
2290
|
+
y: p
|
|
2291
|
+
},
|
|
2292
|
+
{
|
|
2293
|
+
x: y,
|
|
2294
|
+
y: p + c
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
x: y + o,
|
|
2298
|
+
y: p + c
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
x: y + o,
|
|
2302
|
+
y: p - c / 2
|
|
2303
|
+
}
|
|
2304
|
+
], S = j(x), b = u.path(S, m), D = i.insert(() => b, ":first-child");
|
|
2305
|
+
return D.attr("class", "basic label-container outer-path"), w && t.look !== "handDrawn" && D.selectChildren("path").attr("style", w), h && t.look !== "handDrawn" && D.selectChildren("path").attr("style", h), D.attr("transform", `translate(0, ${c / 4})`), e.attr("transform", `translate(${-o / 2 + (t.padding ?? 0) - (n.x - (n.left ?? 0))}, ${-c / 4 + (t.padding ?? 0) - (n.y - (n.top ?? 0))})`), E(t, D), t.intersect = function(k) {
|
|
2306
|
+
return R.polygon(t, x, k);
|
|
2307
|
+
}, i;
|
|
2308
|
+
}
|
|
2309
|
+
$(Ka, "slopedRect");
|
|
2310
|
+
async function ts(d, t) {
|
|
2311
|
+
const g = t.padding ?? 0, h = t.look === "neo" ? 16 : g * 2, r = t.look === "neo" ? 12 : g;
|
|
2312
|
+
return $t(d, t, {
|
|
2313
|
+
rx: 0,
|
|
2314
|
+
ry: 0,
|
|
2315
|
+
classes: "",
|
|
2316
|
+
labelPaddingX: t.labelPaddingX ?? h,
|
|
2317
|
+
labelPaddingY: r
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
$(ts, "squareRect");
|
|
2321
|
+
async function as(d, t) {
|
|
2322
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2323
|
+
t.labelStyle = g;
|
|
2324
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 20 : r, f = t.look === "neo" ? 12 : r, { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = n.height + (t.look === "neo" ? f * 2 : f), a = n.width + e / 4 + (t.look === "neo" ? l * 2 : l), s = e / 2, { cssStyles: o } = t, c = I.svg(i), y = H(t, {});
|
|
2325
|
+
t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
|
|
2326
|
+
const p = [
|
|
2327
|
+
{
|
|
2328
|
+
x: -a / 2 + s,
|
|
2329
|
+
y: -e / 2
|
|
2330
|
+
},
|
|
2331
|
+
{
|
|
2332
|
+
x: a / 2 - s,
|
|
2333
|
+
y: -e / 2
|
|
2334
|
+
},
|
|
2335
|
+
...Dt(-a / 2 + s, 0, s, 50, 90, 270),
|
|
2336
|
+
{
|
|
2337
|
+
x: a / 2 - s,
|
|
2338
|
+
y: e / 2
|
|
2339
|
+
},
|
|
2340
|
+
...Dt(a / 2 - s, 0, s, 50, 270, 450)
|
|
2341
|
+
], w = j(p), u = c.path(w, y), m = i.insert(() => u, ":first-child");
|
|
2342
|
+
return m.attr("class", "basic label-container outer-path"), o && t.look !== "handDrawn" && m.selectChildren("path").attr("style", o), h && t.look !== "handDrawn" && m.selectChildren("path").attr("style", h), E(t, m), t.intersect = function(x) {
|
|
2343
|
+
return R.polygon(t, p, x);
|
|
2344
|
+
}, i;
|
|
2345
|
+
}
|
|
2346
|
+
$(as, "stadium");
|
|
2347
|
+
async function ss(d, t) {
|
|
2348
|
+
return $t(d, t, {
|
|
2349
|
+
rx: t.look === "neo" ? 3 : 5,
|
|
2350
|
+
ry: t.look === "neo" ? 3 : 5,
|
|
2351
|
+
classes: "flowchart-node"
|
|
2352
|
+
});
|
|
2353
|
+
}
|
|
2354
|
+
$(ss, "state");
|
|
2355
|
+
function es(d, t, { config: { themeVariables: g } }) {
|
|
2356
|
+
const { labelStyles: h, nodeStyles: r } = W(t);
|
|
2357
|
+
t.labelStyle = h;
|
|
2358
|
+
const { cssStyles: l } = t, { lineColor: f, stateBorder: i, nodeBorder: n, nodeShadow: e } = g;
|
|
2359
|
+
(t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width || (t.width = 14), t.height || (t.height = 14);
|
|
2360
|
+
const a = d.insert("g").attr("class", "node default").attr("id", t.domId ?? t.id), s = I.svg(a), o = H(t, {});
|
|
2361
|
+
t.look !== "handDrawn" && (o.roughness = 0, o.fillStyle = "solid");
|
|
2362
|
+
const c = s.circle(0, 0, t.width, {
|
|
2363
|
+
...o,
|
|
2364
|
+
stroke: f,
|
|
2365
|
+
strokeWidth: 2
|
|
2366
|
+
}), y = i ?? n, p = (t.width ?? 0) * 5 / 14, w = s.circle(0, 0, p, {
|
|
2367
|
+
...o,
|
|
2368
|
+
fill: y,
|
|
2369
|
+
stroke: y,
|
|
2370
|
+
strokeWidth: 2,
|
|
2371
|
+
fillStyle: "solid"
|
|
2372
|
+
}), u = a.insert(() => c, ":first-child");
|
|
2373
|
+
if (u.insert(() => w), t.look !== "handDrawn" && u.attr("class", "outer-path"), l && u.selectAll("path").attr("style", l), r && u.selectAll("path").attr("style", r), t.width < 25 && e && t.look !== "handDrawn") {
|
|
2374
|
+
const m = d.node()?.ownerSVGElement?.id ?? "", x = m ? `${m}-drop-shadow-small` : "drop-shadow-small";
|
|
2375
|
+
u.attr("style", `filter:url(#${x})`);
|
|
2376
|
+
}
|
|
2377
|
+
return E(t, u), t.intersect = function(m) {
|
|
2378
|
+
return R.circle(t, (t.width ?? 0) / 2, m);
|
|
2379
|
+
}, a;
|
|
2380
|
+
}
|
|
2381
|
+
$(es, "stateEnd");
|
|
2382
|
+
function is(d, t, { config: { themeVariables: g } }) {
|
|
2383
|
+
const { lineColor: h, nodeShadow: r } = g;
|
|
2384
|
+
(t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width || (t.width = 14), t.height || (t.height = 14);
|
|
2385
|
+
const l = d.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
|
|
2386
|
+
let f;
|
|
2387
|
+
if (t.look === "handDrawn") {
|
|
2388
|
+
const i = I.svg(l).circle(0, 0, t.width, Bs(h));
|
|
2389
|
+
f = l.insert(() => i), f.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
|
|
2390
|
+
} else
|
|
2391
|
+
f = l.insert("circle", ":first-child"), f.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
|
|
2392
|
+
if (t.width < 25 && r && t.look !== "handDrawn") {
|
|
2393
|
+
const i = d.node()?.ownerSVGElement?.id ?? "", n = i ? `${i}-drop-shadow-small` : "drop-shadow-small";
|
|
2394
|
+
f.attr("style", `filter:url(#${n})`);
|
|
2395
|
+
}
|
|
2396
|
+
return E(t, f), t.intersect = function(i) {
|
|
2397
|
+
return R.circle(t, (t.width ?? 7) / 2, i);
|
|
2398
|
+
}, l;
|
|
2399
|
+
}
|
|
2400
|
+
$(is, "stateStart");
|
|
2401
|
+
var xt = 8;
|
|
2402
|
+
async function ls(d, t) {
|
|
2403
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2404
|
+
t.labelStyle = g;
|
|
2405
|
+
const r = t?.padding ?? 8, l = t.look === "neo" ? 28 : r, f = t.look === "neo" ? 12 : r, { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = (t?.width ?? n.width) + 2 * xt + l, a = (t?.height ?? n.height) + f, s = e - 2 * xt, o = a, c = -e / 2, y = -a / 2, p = [
|
|
2406
|
+
{
|
|
2407
|
+
x: 0,
|
|
2408
|
+
y: 0
|
|
2409
|
+
},
|
|
2410
|
+
{
|
|
2411
|
+
x: s,
|
|
2412
|
+
y: 0
|
|
2413
|
+
},
|
|
2414
|
+
{
|
|
2415
|
+
x: s,
|
|
2416
|
+
y: -o
|
|
2417
|
+
},
|
|
2418
|
+
{
|
|
2419
|
+
x: 0,
|
|
2420
|
+
y: -o
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
x: 0,
|
|
2424
|
+
y: 0
|
|
2425
|
+
},
|
|
2426
|
+
{
|
|
2427
|
+
x: -8,
|
|
2428
|
+
y: 0
|
|
2429
|
+
},
|
|
2430
|
+
{
|
|
2431
|
+
x: s + 8,
|
|
2432
|
+
y: 0
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
x: s + 8,
|
|
2436
|
+
y: -o
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
x: -8,
|
|
2440
|
+
y: -o
|
|
2441
|
+
},
|
|
2442
|
+
{
|
|
2443
|
+
x: -8,
|
|
2444
|
+
y: 0
|
|
2445
|
+
}
|
|
2446
|
+
];
|
|
2447
|
+
if (t.look === "handDrawn") {
|
|
2448
|
+
const w = I.svg(i), u = H(t, {}), m = w.rectangle(c, y, s + 16, o, u), x = w.line(c + xt, y, c + xt, y + o, u), S = w.line(c + xt + s, y, c + xt + s, y + o, u);
|
|
2449
|
+
i.insert(() => x, ":first-child"), i.insert(() => S, ":first-child");
|
|
2450
|
+
const b = i.insert(() => m, ":first-child"), { cssStyles: D } = t;
|
|
2451
|
+
b.attr("class", "basic label-container").attr("style", K(D)), E(t, b);
|
|
2452
|
+
} else {
|
|
2453
|
+
const w = ft(i, s, o, p);
|
|
2454
|
+
h && w.attr("style", h), E(t, w);
|
|
2455
|
+
}
|
|
2456
|
+
return t.intersect = function(w) {
|
|
2457
|
+
return R.polygon(t, p, w);
|
|
2458
|
+
}, i;
|
|
2459
|
+
}
|
|
2460
|
+
$(ls, "subroutine");
|
|
2461
|
+
var Tt = 0.2;
|
|
2462
|
+
async function rs(d, t) {
|
|
2463
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2464
|
+
t.labelStyle = g;
|
|
2465
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 12 : r;
|
|
2466
|
+
(t.width || t.height) && (t.height = Math.max((t?.height ?? 0) - f * 2, 10), t.width = Math.max((t?.width ?? 0) - l * 2 - Tt * (t.height + f * 2), 10));
|
|
2467
|
+
const { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = (t?.height ? t?.height : n.height) + f * 2, a = Tt * e, s = Tt * e, o = (t?.width ? t?.width : n.width) + l * 2 + a - a, c = e, y = -o / 2, p = -c / 2, { cssStyles: w } = t, u = I.svg(i), m = H(t, {}), x = [
|
|
2468
|
+
{
|
|
2469
|
+
x: y - a / 2,
|
|
2470
|
+
y: p
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
x: y + o + a / 2,
|
|
2474
|
+
y: p
|
|
2475
|
+
},
|
|
2476
|
+
{
|
|
2477
|
+
x: y + o + a / 2,
|
|
2478
|
+
y: p + c
|
|
2479
|
+
},
|
|
2480
|
+
{
|
|
2481
|
+
x: y - a / 2,
|
|
2482
|
+
y: p + c
|
|
2483
|
+
}
|
|
2484
|
+
], S = [
|
|
2485
|
+
{
|
|
2486
|
+
x: y + o - a / 2,
|
|
2487
|
+
y: p + c
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
x: y + o + a / 2,
|
|
2491
|
+
y: p + c
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
x: y + o + a / 2,
|
|
2495
|
+
y: p + c - s
|
|
2496
|
+
}
|
|
2497
|
+
];
|
|
2498
|
+
t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
2499
|
+
const b = j(x), D = u.path(b, m), k = j(S), v = u.path(k, {
|
|
2500
|
+
...m,
|
|
2501
|
+
fillStyle: "solid"
|
|
2502
|
+
}), B = i.insert(() => v, ":first-child");
|
|
2503
|
+
return B.insert(() => D, ":first-child"), B.attr("class", "basic label-container outer-path"), w && t.look !== "handDrawn" && B.selectAll("path").attr("style", w), h && t.look !== "handDrawn" && B.selectAll("path").attr("style", h), E(t, B), t.intersect = function(A) {
|
|
2504
|
+
return R.polygon(t, x, A);
|
|
2505
|
+
}, i;
|
|
2506
|
+
}
|
|
2507
|
+
$(rs, "taggedRect");
|
|
2508
|
+
async function ns(d, t) {
|
|
2509
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2510
|
+
t.labelStyle = g;
|
|
2511
|
+
const { shapeSvg: r, bbox: l, label: f } = await _(d, t, Y(t)), i = Math.max(l.width + (t.padding ?? 0) * 2, t?.width ?? 0), n = Math.max(l.height + (t.padding ?? 0) * 2, t?.height ?? 0), e = n / 8, a = 0.2 * i, s = 0.2 * n, o = n + e, { cssStyles: c } = t, y = I.svg(r), p = H(t, {});
|
|
2512
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
2513
|
+
const w = [
|
|
2514
|
+
{
|
|
2515
|
+
x: -i / 2 - i / 2 * 0.1,
|
|
2516
|
+
y: o / 2
|
|
2517
|
+
},
|
|
2518
|
+
...pt(-i / 2 - i / 2 * 0.1, o / 2, i / 2 + i / 2 * 0.1, o / 2, e, 0.8),
|
|
2519
|
+
{
|
|
2520
|
+
x: i / 2 + i / 2 * 0.1,
|
|
2521
|
+
y: -o / 2
|
|
2522
|
+
},
|
|
2523
|
+
{
|
|
2524
|
+
x: -i / 2 - i / 2 * 0.1,
|
|
2525
|
+
y: -o / 2
|
|
2526
|
+
}
|
|
2527
|
+
], u = -i / 2 + i / 2 * 0.1, m = -o / 2 - s * 0.4, x = [
|
|
2528
|
+
{
|
|
2529
|
+
x: u + i - a,
|
|
2530
|
+
y: (m + n) * 1.3
|
|
2531
|
+
},
|
|
2532
|
+
{
|
|
2533
|
+
x: u + i,
|
|
2534
|
+
y: m + n - s
|
|
2535
|
+
},
|
|
2536
|
+
{
|
|
2537
|
+
x: u + i,
|
|
2538
|
+
y: (m + n) * 0.9
|
|
2539
|
+
},
|
|
2540
|
+
...pt(u + i, (m + n) * 1.25, u + i - a, (m + n) * 1.3, -n * 0.02, 0.5)
|
|
2541
|
+
], S = j(w), b = y.path(S, p), D = j(x), k = y.path(D, {
|
|
2542
|
+
...p,
|
|
2543
|
+
fillStyle: "solid"
|
|
2544
|
+
}), v = r.insert(() => k, ":first-child");
|
|
2545
|
+
return v.insert(() => b, ":first-child"), v.attr("class", "basic label-container outer-path"), c && t.look !== "handDrawn" && v.selectAll("path").attr("style", c), h && t.look !== "handDrawn" && v.selectAll("path").attr("style", h), v.attr("transform", `translate(0,${-e / 2})`), f.attr("transform", `translate(${-i / 2 + (t.padding ?? 0) - (l.x - (l.left ?? 0))},${-n / 2 + (t.padding ?? 0) - e / 2 - (l.y - (l.top ?? 0))})`), E(t, v), t.intersect = function(B) {
|
|
2546
|
+
return R.polygon(t, w, B);
|
|
2547
|
+
}, r;
|
|
2548
|
+
}
|
|
2549
|
+
$(ns, "taggedWaveEdgedRectangle");
|
|
2550
|
+
async function cs(d, t) {
|
|
2551
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2552
|
+
t.labelStyle = g;
|
|
2553
|
+
const { shapeSvg: r, bbox: l } = await _(d, t, Y(t)), f = Math.max(l.width + (t.padding ?? 0), t?.width || 0), i = Math.max(l.height + (t.padding ?? 0), t?.height || 0), n = -f / 2, e = -i / 2, a = r.insert("rect", ":first-child");
|
|
2554
|
+
return a.attr("class", "text").attr("style", h).attr("rx", 0).attr("ry", 0).attr("x", n).attr("y", e).attr("width", f).attr("height", i), E(t, a), t.intersect = function(s) {
|
|
2555
|
+
return R.rect(t, s);
|
|
2556
|
+
}, r;
|
|
2557
|
+
}
|
|
2558
|
+
$(cs, "text");
|
|
2559
|
+
var _s = /* @__PURE__ */ $((d, t, g, h, r, l) => `M${d},${t}
|
|
2560
|
+
a${r},${l} 0,0,1 0,${-h}
|
|
2561
|
+
l${g},0
|
|
2562
|
+
a${r},${l} 0,0,1 0,${h}
|
|
2563
|
+
M${g},${-h}
|
|
2564
|
+
a${r},${l} 0,0,0 0,${h}
|
|
2565
|
+
l${-g},0`, "createCylinderPathD"), Os = /* @__PURE__ */ $((d, t, g, h, r, l) => [
|
|
2566
|
+
`M${d},${t}`,
|
|
2567
|
+
`M${d + g},${t}`,
|
|
2568
|
+
`a${r},${l} 0,0,0 0,${-h}`,
|
|
2569
|
+
`l${-g},0`,
|
|
2570
|
+
`a${r},${l} 0,0,0 0,${h}`,
|
|
2571
|
+
`l${g},0`
|
|
2572
|
+
].join(" "), "createOuterCylinderPathD"), js = /* @__PURE__ */ $((d, t, g, h, r, l) => [`M${d + g / 2},${-h / 2}`, `a${r},${l} 0,0,0 0,${h}`].join(" "), "createInnerCylinderPathD"), Qt = 5, Ut = 10;
|
|
2573
|
+
async function os(d, t) {
|
|
2574
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2575
|
+
t.labelStyle = g;
|
|
2576
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 12 : r / 2;
|
|
2577
|
+
if (t.width || t.height) {
|
|
2578
|
+
const p = t.height ?? 0;
|
|
2579
|
+
t.height = (t.height ?? 0) - l, t.height < Qt && (t.height = Qt);
|
|
2580
|
+
const w = p / 2 / (2.5 + p / 50);
|
|
2581
|
+
t.width = (t.width ?? 0) - l - w * 3, t.width < Ut && (t.width = Ut);
|
|
2582
|
+
}
|
|
2583
|
+
const { shapeSvg: f, bbox: i, label: n } = await _(d, t, Y(t)), e = (t.height ? t.height : i.height) + l, a = e / 2, s = a / (2.5 + e / 50), o = (t.width ? t.width : i.width) + s + l, { cssStyles: c } = t;
|
|
2584
|
+
let y;
|
|
2585
|
+
if (t.look === "handDrawn") {
|
|
2586
|
+
const p = I.svg(f), w = Os(0, 0, o, e, s, a), u = js(0, 0, o, e, s, a), m = p.path(w, H(t, {})), x = p.path(u, H(t, { fill: "none" }));
|
|
2587
|
+
y = f.insert(() => x, ":first-child"), y = f.insert(() => m, ":first-child"), y.attr("class", "basic label-container"), c && y.attr("style", c);
|
|
2588
|
+
} else {
|
|
2589
|
+
const p = _s(0, 0, o, e, s, a);
|
|
2590
|
+
y = f.insert("path", ":first-child").attr("d", p).attr("class", "basic label-container").attr("style", K(c)).attr("style", h), y.attr("class", "basic label-container outer-path"), c && y.selectAll("path").attr("style", c), h && y.selectAll("path").attr("style", h);
|
|
2591
|
+
}
|
|
2592
|
+
return y.attr("label-offset-x", s), y.attr("transform", `translate(${-o / 2}, ${e / 2} )`), n.attr("transform", `translate(${-(i.width / 2) - s - (i.x - (i.left ?? 0))}, ${-(i.height / 2) - (i.y - (i.top ?? 0))})`), E(t, y), t.intersect = function(p) {
|
|
2593
|
+
const w = R.rect(t, p), u = w.y - (t.y ?? 0);
|
|
2594
|
+
if (a != 0 && (Math.abs(u) < (t.height ?? 0) / 2 || Math.abs(u) == (t.height ?? 0) / 2 && Math.abs(w.x - (t.x ?? 0)) > (t.width ?? 0) / 2 - s)) {
|
|
2595
|
+
let m = s * s * (1 - u * u / (a * a));
|
|
2596
|
+
m != 0 && (m = Math.sqrt(Math.abs(m))), m = s - m, p.x - (t.x ?? 0) > 0 && (m = -m), w.x += m;
|
|
2597
|
+
}
|
|
2598
|
+
return w;
|
|
2599
|
+
}, f;
|
|
2600
|
+
}
|
|
2601
|
+
$(os, "tiltedCylinder");
|
|
2602
|
+
async function hs(d, t) {
|
|
2603
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2604
|
+
t.labelStyle = g;
|
|
2605
|
+
const r = t.padding ?? 0, l = (t.look === "neo", r), f = t.look === "neo" ? r * 2 : r, { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = (t?.height ?? n.height) + l, a = (t?.width ?? n.width) + f, s = [
|
|
2606
|
+
{
|
|
2607
|
+
x: -3 * e / 6,
|
|
2608
|
+
y: 0
|
|
2609
|
+
},
|
|
2610
|
+
{
|
|
2611
|
+
x: a + 3 * e / 6,
|
|
2612
|
+
y: 0
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
x: a,
|
|
2616
|
+
y: -e
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
x: 0,
|
|
2620
|
+
y: -e
|
|
2621
|
+
}
|
|
2622
|
+
];
|
|
2623
|
+
let o;
|
|
2624
|
+
const { cssStyles: c } = t;
|
|
2625
|
+
if (t.look === "handDrawn") {
|
|
2626
|
+
const y = I.svg(i), p = H(t, {}), w = j(s), u = y.path(w, p);
|
|
2627
|
+
o = i.insert(() => u, ":first-child").attr("transform", `translate(${-a / 2}, ${e / 2})`), c && o.attr("style", c);
|
|
2628
|
+
} else o = ft(i, a, e, s);
|
|
2629
|
+
return h && o.attr("style", h), t.width = a, t.height = e, E(t, o), t.intersect = function(y) {
|
|
2630
|
+
return R.polygon(t, s, y);
|
|
2631
|
+
}, i;
|
|
2632
|
+
}
|
|
2633
|
+
$(hs, "trapezoid");
|
|
2634
|
+
async function gs(d, t) {
|
|
2635
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2636
|
+
t.labelStyle = g;
|
|
2637
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 12 : r, i = 15, n = 5;
|
|
2638
|
+
(t.width || t.height) && (t.height = (t.height ?? 0) - f * 2, t.height < n && (t.height = n), t.width = (t.width ?? 0) - l * 2, t.width < i && (t.width = i));
|
|
2639
|
+
const { shapeSvg: e, bbox: a } = await _(d, t, Y(t)), s = (t?.width ? t?.width : a.width) + l * 2, o = (t?.height ? t?.height : a.height) + f * 2, { cssStyles: c } = t, y = I.svg(e), p = H(t, {});
|
|
2640
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
2641
|
+
const w = [
|
|
2642
|
+
{
|
|
2643
|
+
x: -s / 2 * 0.8,
|
|
2644
|
+
y: -o / 2
|
|
2645
|
+
},
|
|
2646
|
+
{
|
|
2647
|
+
x: s / 2 * 0.8,
|
|
2648
|
+
y: -o / 2
|
|
2649
|
+
},
|
|
2650
|
+
{
|
|
2651
|
+
x: s / 2,
|
|
2652
|
+
y: -o / 2 * 0.6
|
|
2653
|
+
},
|
|
2654
|
+
{
|
|
2655
|
+
x: s / 2,
|
|
2656
|
+
y: o / 2
|
|
2657
|
+
},
|
|
2658
|
+
{
|
|
2659
|
+
x: -s / 2,
|
|
2660
|
+
y: o / 2
|
|
2661
|
+
},
|
|
2662
|
+
{
|
|
2663
|
+
x: -s / 2,
|
|
2664
|
+
y: -o / 2 * 0.6
|
|
2665
|
+
}
|
|
2666
|
+
], u = j(w), m = y.path(u, p), x = e.insert(() => m, ":first-child");
|
|
2667
|
+
return x.attr("class", "basic label-container outer-path"), c && t.look !== "handDrawn" && x.selectChildren("path").attr("style", c), h && t.look !== "handDrawn" && x.selectChildren("path").attr("style", h), E(t, x), t.intersect = function(S) {
|
|
2668
|
+
return R.polygon(t, w, S);
|
|
2669
|
+
}, e;
|
|
2670
|
+
}
|
|
2671
|
+
$(gs, "trapezoidalPentagon");
|
|
2672
|
+
var Kt = 10, ta = 10;
|
|
2673
|
+
async function fs(d, t) {
|
|
2674
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2675
|
+
t.labelStyle = g;
|
|
2676
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? r * 2 : r;
|
|
2677
|
+
(t.width || t.height) && (t.width = ((t?.width ?? 0) - l) / 2, t.width < ta && (t.width = ta), t.height = t?.height ?? 0, t.height < Kt && (t.height = Kt));
|
|
2678
|
+
const { shapeSvg: f, bbox: i, label: n } = await _(d, t, Y(t)), e = mt(J().flowchart?.htmlLabels), a = (t?.width ? t?.width : i.width) + l, s = t?.height ? t?.height : a + i.height, o = s, c = [
|
|
2679
|
+
{
|
|
2680
|
+
x: 0,
|
|
2681
|
+
y: 0
|
|
2682
|
+
},
|
|
2683
|
+
{
|
|
2684
|
+
x: o,
|
|
2685
|
+
y: 0
|
|
2686
|
+
},
|
|
2687
|
+
{
|
|
2688
|
+
x: o / 2,
|
|
2689
|
+
y: -s
|
|
2690
|
+
}
|
|
2691
|
+
], { cssStyles: y } = t, p = I.svg(f), w = H(t, {});
|
|
2692
|
+
t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
2693
|
+
const u = j(c), m = p.path(u, w), x = f.insert(() => m, ":first-child").attr("transform", `translate(${-s / 2}, ${s / 2})`).attr("class", "outer-path");
|
|
2694
|
+
return y && t.look !== "handDrawn" && x.selectChildren("path").attr("style", y), h && t.look !== "handDrawn" && x.selectChildren("path").attr("style", h), t.width = a, t.height = s, E(t, x), n.attr("transform", `translate(${-i.width / 2 - (i.x - (i.left ?? 0))}, ${s / 2 - (i.height + (t.padding ?? 0) / (e ? 2 : 1) - (i.y - (i.top ?? 0)))})`), t.intersect = function(S) {
|
|
2695
|
+
return F.info("Triangle intersect", t, c, S), R.polygon(t, c, S);
|
|
2696
|
+
}, f;
|
|
2697
|
+
}
|
|
2698
|
+
$(fs, "triangle");
|
|
2699
|
+
async function ys(d, t) {
|
|
2700
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2701
|
+
t.labelStyle = g;
|
|
2702
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 12 : r;
|
|
2703
|
+
let i = !0;
|
|
2704
|
+
(t.width || t.height) && (i = !1, t.width = (t?.width ?? 0) - l * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - f * 2, t.height < 10 && (t.height = 10));
|
|
2705
|
+
const { shapeSvg: n, bbox: e, label: a } = await _(d, t, Y(t)), s = (t?.width ? t?.width : e.width) + (l ?? 0) * 2, o = (t?.height ? t?.height : e.height) + (f ?? 0) * 2, c = t.look === "neo" ? o / 4 : o / 8, y = o + (i ? c : -c), { cssStyles: p } = t, w = 14 - s, u = w > 0 ? w / 2 : 0, m = I.svg(n), x = H(t, {});
|
|
2706
|
+
t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
|
|
2707
|
+
const S = [
|
|
2708
|
+
{
|
|
2709
|
+
x: -s / 2 - u,
|
|
2710
|
+
y: y / 2
|
|
2711
|
+
},
|
|
2712
|
+
...pt(-s / 2 - u, y / 2, s / 2 + u, y / 2, c, 0.8),
|
|
2713
|
+
{
|
|
2714
|
+
x: s / 2 + u,
|
|
2715
|
+
y: -y / 2
|
|
2716
|
+
},
|
|
2717
|
+
{
|
|
2718
|
+
x: -s / 2 - u,
|
|
2719
|
+
y: -y / 2
|
|
2720
|
+
}
|
|
2721
|
+
], b = j(S), D = m.path(b, x), k = n.insert(() => D, ":first-child");
|
|
2722
|
+
return k.attr("class", "basic label-container outer-path"), p && t.look !== "handDrawn" && k.selectAll("path").attr("style", p), h && t.look !== "handDrawn" && k.selectAll("path").attr("style", h), k.attr("transform", `translate(0,${-c / 2})`), a.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (e.x - (e.left ?? 0))},${-o / 2 + (t.padding ?? 0) - c - (e.y - (e.top ?? 0))})`), E(t, k), t.intersect = function(v) {
|
|
2723
|
+
return R.polygon(t, S, v);
|
|
2724
|
+
}, n;
|
|
2725
|
+
}
|
|
2726
|
+
$(ys, "waveEdgedRectangle");
|
|
2727
|
+
async function ps(d, t) {
|
|
2728
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2729
|
+
t.labelStyle = g;
|
|
2730
|
+
const r = t.padding ?? 0, l = t.look === "neo" ? 16 : r, f = t.look === "neo" ? 20 : r;
|
|
2731
|
+
if (t.width || t.height) {
|
|
2732
|
+
t.width = t?.width ?? 0, t.width < 20 && (t.width = 20), t.height = t?.height ?? 0, t.height < 10 && (t.height = 10);
|
|
2733
|
+
const S = Math.min(t.height * 0.2, t.height / 4);
|
|
2734
|
+
t.height = Math.ceil(t.height - f - S * (20 / 9)), t.width = t.width - l * 2;
|
|
2735
|
+
}
|
|
2736
|
+
const { shapeSvg: i, bbox: n } = await _(d, t, Y(t)), e = (t?.width ? t?.width : n.width) + l * 2, a = (t?.height ? t?.height : n.height) + f, s = a / 8, o = a + s * 2, { cssStyles: c } = t, y = I.svg(i), p = H(t, {});
|
|
2737
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
2738
|
+
const w = [
|
|
2739
|
+
{
|
|
2740
|
+
x: -e / 2,
|
|
2741
|
+
y: o / 2
|
|
2742
|
+
},
|
|
2743
|
+
...pt(-e / 2, o / 2, e / 2, o / 2, s, 1),
|
|
2744
|
+
{
|
|
2745
|
+
x: e / 2,
|
|
2746
|
+
y: -o / 2
|
|
2747
|
+
},
|
|
2748
|
+
...pt(e / 2, -o / 2, -e / 2, -o / 2, s, -1)
|
|
2749
|
+
], u = j(w), m = y.path(u, p), x = i.insert(() => m, ":first-child");
|
|
2750
|
+
return x.attr("class", "basic label-container"), c && t.look !== "handDrawn" && x.selectAll("path").attr("style", c), h && t.look !== "handDrawn" && x.selectAll("path").attr("style", h), E(t, x), t.intersect = function(S) {
|
|
2751
|
+
return R.polygon(t, w, S);
|
|
2752
|
+
}, i;
|
|
2753
|
+
}
|
|
2754
|
+
$(ps, "waveRectangle");
|
|
2755
|
+
var Z = 10;
|
|
2756
|
+
async function ds(d, t) {
|
|
2757
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
2758
|
+
t.labelStyle = g;
|
|
2759
|
+
const r = t.look === "neo" ? 16 : t.padding ?? 0, l = t.look === "neo" ? 12 : t.padding ?? 0;
|
|
2760
|
+
(t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - r * 2 - Z, 10), t.height = Math.max((t?.height ?? 0) - l * 2 - Z, 10));
|
|
2761
|
+
const { shapeSvg: f, bbox: i, label: n } = await _(d, t, Y(t)), e = (t?.width ? t?.width : i.width) + r * 2 + Z, a = (t?.height ? t?.height : i.height) + l * 2 + Z, s = e - Z, o = a - Z, c = -s / 2, y = -o / 2, { cssStyles: p } = t, w = I.svg(f), u = H(t, {}), m = [
|
|
2762
|
+
{
|
|
2763
|
+
x: c - Z,
|
|
2764
|
+
y: y - Z
|
|
2765
|
+
},
|
|
2766
|
+
{
|
|
2767
|
+
x: c - Z,
|
|
2768
|
+
y: y + o
|
|
2769
|
+
},
|
|
2770
|
+
{
|
|
2771
|
+
x: c + s,
|
|
2772
|
+
y: y + o
|
|
2773
|
+
},
|
|
2774
|
+
{
|
|
2775
|
+
x: c + s,
|
|
2776
|
+
y: y - Z
|
|
2777
|
+
}
|
|
2778
|
+
], x = `M${c - Z},${y - Z} L${c + s},${y - Z} L${c + s},${y + o} L${c - Z},${y + o} L${c - Z},${y - Z}
|
|
2779
|
+
M${c - Z},${y} L${c + s},${y}
|
|
2780
|
+
M${c},${y - Z} L${c},${y + o}`;
|
|
2781
|
+
t.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
|
|
2782
|
+
const S = w.path(x, u), b = f.insert(() => S, ":first-child");
|
|
2783
|
+
return b.attr("transform", `translate(${Z / 2}, ${Z / 2})`), b.attr("class", "basic label-container outer-path"), p && t.look !== "handDrawn" && b.selectAll("path").attr("style", p), h && t.look !== "handDrawn" && b.selectAll("path").attr("style", h), n.attr("transform", `translate(${-(i.width / 2) + Z / 2 - (i.x - (i.left ?? 0))}, ${-(i.height / 2) + Z / 2 - (i.y - (i.top ?? 0))})`), E(t, b), t.intersect = function(D) {
|
|
2784
|
+
return R.polygon(t, m, D);
|
|
2785
|
+
}, f;
|
|
2786
|
+
}
|
|
2787
|
+
$(ds, "windowPane");
|
|
2788
|
+
var aa = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Gs = /* @__PURE__ */ new Set([
|
|
2789
|
+
"redux",
|
|
2790
|
+
"redux-dark",
|
|
2791
|
+
"redux-color",
|
|
2792
|
+
"redux-dark-color"
|
|
2793
|
+
]);
|
|
2794
|
+
async function _t(d, t) {
|
|
2795
|
+
const g = t;
|
|
2796
|
+
g.alias && (t.label = g.alias);
|
|
2797
|
+
const { theme: h, themeVariables: r } = Pt(), { rowEven: l, rowOdd: f, nodeBorder: i, borderColorArray: n } = r;
|
|
2798
|
+
if (t.look === "handDrawn") {
|
|
2799
|
+
const { themeVariables: O } = Pt(), { background: q } = O;
|
|
2800
|
+
await _t(d, {
|
|
2801
|
+
...t,
|
|
2802
|
+
id: t.id + "-background",
|
|
2803
|
+
domId: (t.domId || t.id) + "-background",
|
|
2804
|
+
look: "default",
|
|
2805
|
+
cssStyles: ["stroke: none", `fill: ${q}`]
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
const e = Pt();
|
|
2809
|
+
t.useHtmlLabels = e.htmlLabels;
|
|
2810
|
+
let a = e.er?.diagramPadding ?? 10, s = e.er?.entityPadding ?? 6;
|
|
2811
|
+
const { cssStyles: o } = t, { labelStyles: c, nodeStyles: y } = W(t);
|
|
2812
|
+
if (g.attributes.length === 0 && t.label) {
|
|
2813
|
+
const O = {
|
|
2814
|
+
rx: 0,
|
|
2815
|
+
ry: 0,
|
|
2816
|
+
labelPaddingX: a,
|
|
2817
|
+
labelPaddingY: a * 1.5,
|
|
2818
|
+
classes: ""
|
|
2819
|
+
};
|
|
2820
|
+
Ct(t.label, e) + O.labelPaddingX * 2 < e.er.minEntityWidth && (t.width = e.er.minEntityWidth);
|
|
2821
|
+
const q = await $t(d, t, O);
|
|
2822
|
+
if (h != null && aa.has(h)) {
|
|
2823
|
+
const tt = g.colorIndex ?? 0;
|
|
2824
|
+
q.attr("data-color-id", `color-${tt % n.length}`);
|
|
2825
|
+
}
|
|
2826
|
+
if (!mt(e.htmlLabels)) {
|
|
2827
|
+
const tt = q.select("text"), et = tt.node()?.getBBox();
|
|
2828
|
+
tt.attr("transform", `translate(${-et.width / 2}, 0)`);
|
|
2829
|
+
}
|
|
2830
|
+
return q;
|
|
2831
|
+
}
|
|
2832
|
+
e.htmlLabels || (a *= 1.25, s *= 1.25);
|
|
2833
|
+
let p = Y(t);
|
|
2834
|
+
p || (p = "node default");
|
|
2835
|
+
const w = d.insert("g").attr("class", p).attr("id", t.domId || t.id), u = await bt(w, t.label ?? "", e, 0, 0, ["name"], c);
|
|
2836
|
+
u.height += s;
|
|
2837
|
+
let m = 0;
|
|
2838
|
+
const x = [], S = [];
|
|
2839
|
+
let b = 0, D = 0, k = 0, v = 0, B = !0, A = !0;
|
|
2840
|
+
for (const O of g.attributes) {
|
|
2841
|
+
const q = await bt(w, O.type, e, 0, m, ["attribute-type"], c);
|
|
2842
|
+
b = Math.max(b, q.width + a);
|
|
2843
|
+
const tt = await bt(w, O.name, e, 0, m, ["attribute-name"], c);
|
|
2844
|
+
D = Math.max(D, tt.width + a);
|
|
2845
|
+
const et = await bt(w, O.keys.join(), e, 0, m, ["attribute-keys"], c);
|
|
2846
|
+
k = Math.max(k, et.width + a);
|
|
2847
|
+
const kt = await bt(w, O.comment, e, 0, m, ["attribute-comment"], c);
|
|
2848
|
+
v = Math.max(v, kt.width + a);
|
|
2849
|
+
const yt = Math.max(q.height, tt.height, et.height, kt.height) + s;
|
|
2850
|
+
S.push({
|
|
2851
|
+
yOffset: m,
|
|
2852
|
+
rowHeight: yt
|
|
2853
|
+
}), m += yt;
|
|
2854
|
+
}
|
|
2855
|
+
let L = 4;
|
|
2856
|
+
k <= a && (B = !1, k = 0, L--), v <= a && (A = !1, v = 0, L--);
|
|
2857
|
+
const X = w.node().getBBox();
|
|
2858
|
+
if (u.width + a * 2 - (b + D + k + v) > 0) {
|
|
2859
|
+
const O = u.width + a * 2 - (b + D + k + v);
|
|
2860
|
+
b += O / L, D += O / L, k > 0 && (k += O / L), v > 0 && (v += O / L);
|
|
2861
|
+
}
|
|
2862
|
+
const N = b + D + k + v, M = I.svg(w), P = H(t, {});
|
|
2863
|
+
t.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid");
|
|
2864
|
+
let T = 0;
|
|
2865
|
+
S.length > 0 && (T = S.reduce((O, q) => O + (q?.rowHeight ?? 0), 0));
|
|
2866
|
+
const C = Math.max(X.width + a * 2, t?.width || 0, N), G = Math.max((T ?? 0) + u.height, t?.height || 0), z = -C / 2, V = -G / 2;
|
|
2867
|
+
if (w.selectAll("g:not(:first-child)").each((O, q, tt) => {
|
|
2868
|
+
const et = U(tt[q]), kt = et.attr("transform");
|
|
2869
|
+
let yt = 0, Ot = 0;
|
|
2870
|
+
if (kt) {
|
|
2871
|
+
const It = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(kt);
|
|
2872
|
+
It && (yt = parseFloat(It[1]), Ot = parseFloat(It[2]), et.attr("class").includes("attribute-name") ? yt += b : et.attr("class").includes("attribute-keys") ? yt += b + D : et.attr("class").includes("attribute-comment") && (yt += b + D + k));
|
|
2873
|
+
}
|
|
2874
|
+
et.attr("transform", `translate(${z + a / 2 + yt}, ${Ot + V + u.height + s / 2})`);
|
|
2875
|
+
}), w.select(".name").attr("transform", "translate(" + -u.width / 2 + ", " + (V + s / 2) + ")"), h != null && aa.has(h)) {
|
|
2876
|
+
const O = g.colorIndex ?? 0;
|
|
2877
|
+
w.attr("data-color-id", `color-${O % n.length}`);
|
|
2878
|
+
}
|
|
2879
|
+
const rt = M.rectangle(z, V, C, G, P), st = w.insert(() => rt, ":first-child").attr("class", "outer-path").attr("style", o.join(""));
|
|
2880
|
+
x.push(0);
|
|
2881
|
+
for (const [O, q] of S.entries()) {
|
|
2882
|
+
const tt = (O + 1) % 2 === 0 && q.yOffset !== 0, et = M.rectangle(z, u.height + V + q?.yOffset, C, q?.rowHeight, {
|
|
2883
|
+
...P,
|
|
2884
|
+
fill: tt ? l : f,
|
|
2885
|
+
stroke: i
|
|
2886
|
+
});
|
|
2887
|
+
w.insert(() => et, "g.label").attr("style", o.join("")).attr("class", `row-rect-${tt ? "even" : "odd"}`);
|
|
2888
|
+
}
|
|
2889
|
+
const nt = 1e-4;
|
|
2890
|
+
let at = St(z, u.height + V, C + z, u.height + V, nt), ct = M.polygon(at.map((O) => [O.x, O.y]), P);
|
|
2891
|
+
if (w.insert(() => ct).attr("class", "divider"), at = St(b + z, u.height + V, b + z, G + V, nt), ct = M.polygon(at.map((O) => [O.x, O.y]), P), w.insert(() => ct).attr("class", "divider"), B) {
|
|
2892
|
+
const O = b + D + z;
|
|
2893
|
+
at = St(O, u.height + V, O, G + V, nt), ct = M.polygon(at.map((q) => [q.x, q.y]), P), w.insert(() => ct).attr("class", "divider");
|
|
2894
|
+
}
|
|
2895
|
+
if (A) {
|
|
2896
|
+
const O = b + D + k + z;
|
|
2897
|
+
at = St(O, u.height + V, O, G + V, nt), ct = M.polygon(at.map((q) => [q.x, q.y]), P), w.insert(() => ct).attr("class", "divider");
|
|
2898
|
+
}
|
|
2899
|
+
for (const O of x) {
|
|
2900
|
+
const q = u.height + V + O;
|
|
2901
|
+
at = St(z, q, C + z, q, nt), ct = M.polygon(at.map((tt) => [tt.x, tt.y]), P), w.insert(() => ct).attr("class", "divider");
|
|
2902
|
+
}
|
|
2903
|
+
if (E(t, st), y && t.look !== "handDrawn") if (h != null && Gs.has(h)) w.selectAll("path").attr("style", y);
|
|
2904
|
+
else {
|
|
2905
|
+
const O = y.split(";")?.filter((q) => q.includes("stroke"))?.map((q) => `${q}`).join("; ");
|
|
2906
|
+
w.selectAll("path").attr("style", O ?? ""), w.selectAll(".row-rect-even path").attr("style", y);
|
|
2907
|
+
}
|
|
2908
|
+
return t.intersect = function(O) {
|
|
2909
|
+
return R.rect(t, O);
|
|
2910
|
+
}, w;
|
|
2911
|
+
}
|
|
2912
|
+
$(_t, "erBox");
|
|
2913
|
+
async function bt(d, t, g, h = 0, r = 0, l = [], f = "") {
|
|
2914
|
+
const i = d.insert("g").attr("class", `label ${l.join(" ")}`).attr("transform", `translate(${h}, ${r})`).attr("style", f);
|
|
2915
|
+
t !== jt(t) && (t = jt(t), t = t.replaceAll("<", "<").replaceAll(">", ">"));
|
|
2916
|
+
const n = i.node().appendChild(await gt(i, t, {
|
|
2917
|
+
width: Ct(t, g) + 100,
|
|
2918
|
+
style: f,
|
|
2919
|
+
useHtmlLabels: g.htmlLabels
|
|
2920
|
+
}, g));
|
|
2921
|
+
if (t.includes("<") || t.includes(">")) {
|
|
2922
|
+
let a = n.children[0];
|
|
2923
|
+
for (a.textContent = a.textContent.replaceAll("<", "<").replaceAll(">", ">"); a.childNodes[0]; )
|
|
2924
|
+
a = a.childNodes[0], a.textContent = a.textContent.replaceAll("<", "<").replaceAll(">", ">");
|
|
2925
|
+
}
|
|
2926
|
+
let e = n.getBBox();
|
|
2927
|
+
if (mt(g.htmlLabels)) {
|
|
2928
|
+
const a = n.children[0];
|
|
2929
|
+
a.style.textAlign = "start";
|
|
2930
|
+
const s = U(n);
|
|
2931
|
+
e = a.getBoundingClientRect(), s.attr("width", e.width), s.attr("height", e.height);
|
|
2932
|
+
}
|
|
2933
|
+
return e;
|
|
2934
|
+
}
|
|
2935
|
+
$(bt, "addText");
|
|
2936
|
+
function St(d, t, g, h, r) {
|
|
2937
|
+
return d === g ? [
|
|
2938
|
+
{
|
|
2939
|
+
x: d - r / 2,
|
|
2940
|
+
y: t
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
x: d + r / 2,
|
|
2944
|
+
y: t
|
|
2945
|
+
},
|
|
2946
|
+
{
|
|
2947
|
+
x: g + r / 2,
|
|
2948
|
+
y: h
|
|
2949
|
+
},
|
|
2950
|
+
{
|
|
2951
|
+
x: g - r / 2,
|
|
2952
|
+
y: h
|
|
2953
|
+
}
|
|
2954
|
+
] : [
|
|
2955
|
+
{
|
|
2956
|
+
x: d,
|
|
2957
|
+
y: t - r / 2
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
x: d,
|
|
2961
|
+
y: t + r / 2
|
|
2962
|
+
},
|
|
2963
|
+
{
|
|
2964
|
+
x: g,
|
|
2965
|
+
y: h + r / 2
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
x: g,
|
|
2969
|
+
y: h - r / 2
|
|
2970
|
+
}
|
|
2971
|
+
];
|
|
2972
|
+
}
|
|
2973
|
+
$(St, "lineToPolygon");
|
|
2974
|
+
async function us(d, t, g, h, r = g.class.padding ?? 12) {
|
|
2975
|
+
const l = h ? 0 : 3, f = d.insert("g").attr("class", Y(t)).attr("id", t.domId || t.id);
|
|
2976
|
+
let i = null, n = null, e = null, a = null, s = 0, o = 0, c = 0;
|
|
2977
|
+
if (i = f.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
|
|
2978
|
+
const m = t.annotations[0];
|
|
2979
|
+
await vt(i, { text: `«${m}»` }, 0), s = i.node().getBBox().height;
|
|
2980
|
+
}
|
|
2981
|
+
n = f.insert("g").attr("class", "label-group text"), await vt(n, t, 0, ["font-weight: bolder"]);
|
|
2982
|
+
const y = n.node().getBBox();
|
|
2983
|
+
o = y.height, e = f.insert("g").attr("class", "members-group text");
|
|
2984
|
+
let p = 0;
|
|
2985
|
+
for (const m of t.members) {
|
|
2986
|
+
const x = await vt(e, m, p, [m.parseClassifier()]);
|
|
2987
|
+
p += x + l;
|
|
2988
|
+
}
|
|
2989
|
+
c = e.node().getBBox().height, c <= 0 && (c = r / 2), a = f.insert("g").attr("class", "methods-group text");
|
|
2990
|
+
let w = 0;
|
|
2991
|
+
for (const m of t.methods) {
|
|
2992
|
+
const x = await vt(a, m, w, [m.parseClassifier()]);
|
|
2993
|
+
w += x + l;
|
|
2994
|
+
}
|
|
2995
|
+
let u = f.node().getBBox();
|
|
2996
|
+
if (i !== null) {
|
|
2997
|
+
const m = i.node().getBBox();
|
|
2998
|
+
i.attr("transform", `translate(${-m.width / 2})`);
|
|
2999
|
+
}
|
|
3000
|
+
return n.attr("transform", `translate(${-y.width / 2}, ${s})`), u = f.node().getBBox(), e.attr("transform", `translate(0, ${s + o + r * 2})`), u = f.node().getBBox(), a.attr("transform", `translate(0, ${s + o + (c ? c + r * 4 : r * 2)})`), u = f.node().getBBox(), {
|
|
3001
|
+
shapeSvg: f,
|
|
3002
|
+
bbox: u
|
|
3003
|
+
};
|
|
3004
|
+
}
|
|
3005
|
+
$(us, "textHelper");
|
|
3006
|
+
async function vt(d, t, g, h = []) {
|
|
3007
|
+
const r = d.insert("g").attr("class", "label").attr("style", h.join("; ")), l = Pt();
|
|
3008
|
+
let f = "useHtmlLabels" in t ? t.useHtmlLabels : mt(l.htmlLabels) ?? !0, i = "";
|
|
3009
|
+
"text" in t ? i = t.text : i = t.label, !f && i.startsWith("\\") && (i = i.substring(1)), Ps(i) && (f = !0);
|
|
3010
|
+
const n = await gt(r, sa(Nt(i)), {
|
|
3011
|
+
width: Ct(i, l) + 50,
|
|
3012
|
+
classes: "markdown-node-label",
|
|
3013
|
+
useHtmlLabels: f
|
|
3014
|
+
}, l);
|
|
3015
|
+
let e, a = 1;
|
|
3016
|
+
if (f) {
|
|
3017
|
+
const s = n.children[0], o = U(n);
|
|
3018
|
+
a = s.innerHTML.split("<br>").length, s.innerHTML.includes("</math>") && (a += s.innerHTML.split("<mrow>").length - 1);
|
|
3019
|
+
const c = s.getElementsByTagName("img");
|
|
3020
|
+
if (c) {
|
|
3021
|
+
const y = i.replace(/<img[^>]*>/g, "").trim() === "";
|
|
3022
|
+
await Promise.all([...c].map((p) => new Promise((w) => {
|
|
3023
|
+
function u() {
|
|
3024
|
+
if (p.style.display = "flex", p.style.flexDirection = "column", y) {
|
|
3025
|
+
const m = l.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize, x = parseInt(m, 10) * 5 + "px";
|
|
3026
|
+
p.style.minWidth = x, p.style.maxWidth = x;
|
|
3027
|
+
} else p.style.width = "100%";
|
|
3028
|
+
w(p);
|
|
3029
|
+
}
|
|
3030
|
+
$(u, "setupImage"), setTimeout(() => {
|
|
3031
|
+
p.complete && u();
|
|
3032
|
+
}), p.addEventListener("error", u), p.addEventListener("load", u);
|
|
3033
|
+
})));
|
|
3034
|
+
}
|
|
3035
|
+
e = s.getBoundingClientRect(), o.attr("width", e.width), o.attr("height", e.height);
|
|
3036
|
+
} else {
|
|
3037
|
+
h.includes("font-weight: bolder") && U(n).selectAll("tspan").attr("font-weight", ""), a = n.children.length;
|
|
3038
|
+
const s = n.children[0];
|
|
3039
|
+
(n.textContent === "" || n.textContent.includes(">")) && (s.textContent = i[0] + i.substring(1).replaceAll(">", ">").replaceAll("<", "<").trim(), i[1] === " " && (s.textContent = s.textContent[0] + " " + s.textContent.substring(1))), s.textContent === "undefined" && (s.textContent = ""), e = n.getBBox();
|
|
3040
|
+
}
|
|
3041
|
+
return r.attr("transform", "translate(0," + (-e.height / (2 * a) + g) + ")"), e.height;
|
|
3042
|
+
}
|
|
3043
|
+
$(vt, "addText");
|
|
3044
|
+
async function ws(d, t) {
|
|
3045
|
+
const g = J(), { themeVariables: h } = g, { useGradient: r } = h, l = g.class.padding ?? 12, f = l, i = t.useHtmlLabels ?? mt(g.htmlLabels) ?? !0, n = t;
|
|
3046
|
+
n.annotations = n.annotations ?? [], n.members = n.members ?? [], n.methods = n.methods ?? [];
|
|
3047
|
+
const { shapeSvg: e, bbox: a } = await us(d, t, g, i, f), { labelStyles: s, nodeStyles: o } = W(t);
|
|
3048
|
+
t.labelStyle = s, t.cssStyles = n.styles || "";
|
|
3049
|
+
const c = n.styles?.join(";") || o || "";
|
|
3050
|
+
t.cssStyles || (t.cssStyles = c.replaceAll("!important", "").split(";"));
|
|
3051
|
+
const y = n.members.length === 0 && n.methods.length === 0 && !g.class?.hideEmptyMembersBox, p = I.svg(e), w = H(t, {});
|
|
3052
|
+
t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
|
|
3053
|
+
const u = Math.max(t.width ?? 0, a.width);
|
|
3054
|
+
let m = Math.max(t.height ?? 0, a.height);
|
|
3055
|
+
const x = (t.height ?? 0) > a.height;
|
|
3056
|
+
n.members.length === 0 && n.methods.length === 0 ? m += f : n.members.length > 0 && n.methods.length === 0 && (m += f * 2);
|
|
3057
|
+
const S = -u / 2, b = -m / 2;
|
|
3058
|
+
let D = y ? l * 2 : n.members.length === 0 && n.methods.length === 0 ? -l : 0;
|
|
3059
|
+
x && (D = l * 2);
|
|
3060
|
+
const k = p.rectangle(S - l, b - l - (y ? l : n.members.length === 0 && n.methods.length === 0 ? -l / 2 : 0), u + 2 * l, m + 2 * l + D, w), v = e.insert(() => k, ":first-child");
|
|
3061
|
+
v.attr("class", "basic label-container outer-path");
|
|
3062
|
+
const B = v.node().getBBox(), A = e.select(".annotation-group").node().getBBox().height - (y ? l / 2 : 0) || 0, L = e.select(".label-group").node().getBBox().height - (y ? l / 2 : 0) || 0, X = e.select(".members-group").node().getBBox().height - (y ? l / 2 : 0) || 0, N = (A + L + b + l - (b - l - (y ? l : n.members.length === 0 && n.methods.length === 0 ? -l / 2 : 0))) / 2;
|
|
3063
|
+
if (e.selectAll(".text").each((M, P, T) => {
|
|
3064
|
+
const C = U(T[P]), G = C.attr("transform");
|
|
3065
|
+
let z = 0;
|
|
3066
|
+
if (G) {
|
|
3067
|
+
const st = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(G);
|
|
3068
|
+
st && (z = parseFloat(st[2]));
|
|
3069
|
+
}
|
|
3070
|
+
let V = z + b + l - (y ? l : n.members.length === 0 && n.methods.length === 0 ? -l / 2 : 0);
|
|
3071
|
+
if (C.attr("class").includes("methods-group")) {
|
|
3072
|
+
const st = Math.max(X, f / 2);
|
|
3073
|
+
x ? V = Math.max(N, A + L + st + b + f * 2 + l) + f * 2 : V = A + L + st + b + f * 4 + l;
|
|
3074
|
+
}
|
|
3075
|
+
n.members.length === 0 && n.methods.length === 0 && g.class?.hideEmptyMembersBox && (n.annotations.length > 0 ? V = z - f : V = z), i || (V -= 4);
|
|
3076
|
+
let rt = S;
|
|
3077
|
+
(C.attr("class").includes("label-group") || C.attr("class").includes("annotation-group")) && (rt = -C.node()?.getBBox().width / 2 || 0, e.selectAll("text").each(function(st, nt, at) {
|
|
3078
|
+
window.getComputedStyle(at[nt]).textAnchor === "middle" && (rt = 0);
|
|
3079
|
+
})), C.attr("transform", `translate(${rt}, ${V})`);
|
|
3080
|
+
}), n.members.length > 0 || n.methods.length > 0 || y) {
|
|
3081
|
+
const M = A + L + b + l, P = p.line(B.x, M, B.x + B.width, M + 1e-3, w);
|
|
3082
|
+
e.insert(() => P).attr("class", `divider${t.look === "neo" && !r ? " neo-line" : ""}`).attr("style", c);
|
|
3083
|
+
}
|
|
3084
|
+
if (y || n.members.length > 0 || n.methods.length > 0) {
|
|
3085
|
+
const M = A + L + X + b + f * 2 + l, P = p.line(B.x, x ? Math.max(N, M) : M, B.x + B.width, (x ? Math.max(N, M) : M) + 1e-3, w);
|
|
3086
|
+
e.insert(() => P).attr("class", `divider${t.look === "neo" && !r ? " neo-line" : ""}`).attr("style", c);
|
|
3087
|
+
}
|
|
3088
|
+
if (n.look !== "handDrawn" && e.selectAll("path").attr("style", c), v.select(":nth-child(2)").attr("style", c), e.selectAll(".divider").select("path").attr("style", c), t.labelStyle ? e.selectAll("span").attr("style", t.labelStyle) : e.selectAll("span").attr("style", c), !i) {
|
|
3089
|
+
const M = RegExp(/color\s*:\s*([^;]*)/), P = M.exec(c);
|
|
3090
|
+
if (P) {
|
|
3091
|
+
const T = P[0].replace("color", "fill");
|
|
3092
|
+
e.selectAll("tspan").attr("style", T);
|
|
3093
|
+
} else if (s) {
|
|
3094
|
+
const T = M.exec(s);
|
|
3095
|
+
if (T) {
|
|
3096
|
+
const C = T[0].replace("color", "fill");
|
|
3097
|
+
e.selectAll("tspan").attr("style", C);
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
return E(t, v), t.intersect = function(M) {
|
|
3102
|
+
return R.rect(t, M);
|
|
3103
|
+
}, e;
|
|
3104
|
+
}
|
|
3105
|
+
$(ws, "classBox");
|
|
3106
|
+
async function ms(d, t) {
|
|
3107
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
3108
|
+
t.labelStyle = g;
|
|
3109
|
+
const r = t, l = t, f = 20, i = 20, n = "verifyMethod" in t, e = Y(t), { themeVariables: a } = J(), { borderColorArray: s, requirementEdgeLabelBackground: o } = a, c = d.insert("g").attr("class", e).attr("id", t.domId ?? t.id);
|
|
3110
|
+
let y;
|
|
3111
|
+
n ? y = await lt(c, `<<${r.type}>>`, 0, t.labelStyle) : y = await lt(c, "<<Element>>", 0, t.labelStyle);
|
|
3112
|
+
let p = y;
|
|
3113
|
+
const w = await lt(c, r.name, p, t.labelStyle + "; font-weight: bold;");
|
|
3114
|
+
if (p += w + i, n) {
|
|
3115
|
+
const B = await lt(c, `${r.requirementId ? `ID: ${r.requirementId}` : ""}`, p, t.labelStyle);
|
|
3116
|
+
p += B;
|
|
3117
|
+
const A = await lt(c, `${r.text ? `Text: ${r.text}` : ""}`, p, t.labelStyle);
|
|
3118
|
+
p += A;
|
|
3119
|
+
const L = await lt(c, `${r.risk ? `Risk: ${r.risk}` : ""}`, p, t.labelStyle);
|
|
3120
|
+
p += L, await lt(c, `${r.verifyMethod ? `Verification: ${r.verifyMethod}` : ""}`, p, t.labelStyle);
|
|
3121
|
+
} else {
|
|
3122
|
+
const B = await lt(c, `${l.type ? `Type: ${l.type}` : ""}`, p, t.labelStyle);
|
|
3123
|
+
p += B, await lt(c, `${l.docRef ? `Doc Ref: ${l.docRef}` : ""}`, p, t.labelStyle);
|
|
3124
|
+
}
|
|
3125
|
+
const u = (c.node()?.getBBox().width ?? 200) + f, m = (c.node()?.getBBox().height ?? 200) + f, x = -u / 2, S = -m / 2, b = I.svg(c), D = H(t, {});
|
|
3126
|
+
t.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
|
|
3127
|
+
const k = b.rectangle(x, S, u, m, D), v = c.insert(() => k, ":first-child");
|
|
3128
|
+
if (v.attr("class", "basic label-container outer-path").attr("style", h), s?.length) {
|
|
3129
|
+
const B = t.colorIndex ?? 0;
|
|
3130
|
+
c.attr("data-color-id", `color-${B % s.length}`);
|
|
3131
|
+
}
|
|
3132
|
+
if (c.selectAll(".label").each((B, A, L) => {
|
|
3133
|
+
const X = U(L[A]), N = X.attr("transform");
|
|
3134
|
+
let M = 0, P = 0;
|
|
3135
|
+
if (N) {
|
|
3136
|
+
const G = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(N);
|
|
3137
|
+
G && (M = parseFloat(G[1]), P = parseFloat(G[2]));
|
|
3138
|
+
}
|
|
3139
|
+
const T = P - m / 2;
|
|
3140
|
+
let C = x + f / 2;
|
|
3141
|
+
(A === 0 || A === 1) && (C = M), X.attr("transform", `translate(${C}, ${T + f})`);
|
|
3142
|
+
}), p > y + w + i) {
|
|
3143
|
+
const B = S + y + w + i;
|
|
3144
|
+
let A;
|
|
3145
|
+
if (t.look === "neo") {
|
|
3146
|
+
const X = [
|
|
3147
|
+
[x, B],
|
|
3148
|
+
[x + u, B],
|
|
3149
|
+
[x + u, B + 1e-3],
|
|
3150
|
+
[x, B + 1e-3]
|
|
3151
|
+
];
|
|
3152
|
+
A = b.polygon(X, D);
|
|
3153
|
+
} else A = b.line(x, B, x + u, B, D);
|
|
3154
|
+
c.insert(() => A).attr("class", "divider");
|
|
3155
|
+
}
|
|
3156
|
+
return E(t, v), t.intersect = function(B) {
|
|
3157
|
+
return R.rect(t, B);
|
|
3158
|
+
}, h && t.look !== "handDrawn" && (o || s?.length) && c.selectAll("path").attr("style", h), c;
|
|
3159
|
+
}
|
|
3160
|
+
$(ms, "requirementBox");
|
|
3161
|
+
async function lt(d, t, g, h = "") {
|
|
3162
|
+
if (t === "") return 0;
|
|
3163
|
+
const r = d.insert("g").attr("class", "label").attr("style", h), l = J(), f = l.htmlLabels ?? !0, i = await gt(r, sa(Nt(t)), {
|
|
3164
|
+
width: Ct(t, l) + 50,
|
|
3165
|
+
classes: "markdown-node-label",
|
|
3166
|
+
useHtmlLabels: f,
|
|
3167
|
+
style: h
|
|
3168
|
+
}, l);
|
|
3169
|
+
let n;
|
|
3170
|
+
if (f) {
|
|
3171
|
+
const e = i.children[0], a = U(i);
|
|
3172
|
+
n = e.getBoundingClientRect(), a.attr("width", n.width), a.attr("height", n.height);
|
|
3173
|
+
} else {
|
|
3174
|
+
const e = i.children[0];
|
|
3175
|
+
for (const a of e.children) h && a.setAttribute("style", h);
|
|
3176
|
+
n = i.getBBox(), n.height += 6;
|
|
3177
|
+
}
|
|
3178
|
+
return r.attr("transform", `translate(${-n.width / 2},${-n.height / 2 + g})`), n.height;
|
|
3179
|
+
}
|
|
3180
|
+
$(lt, "addText");
|
|
3181
|
+
var qs = /* @__PURE__ */ $((d) => {
|
|
3182
|
+
switch (d) {
|
|
3183
|
+
case "Very High":
|
|
3184
|
+
return "red";
|
|
3185
|
+
case "High":
|
|
3186
|
+
return "orange";
|
|
3187
|
+
case "Medium":
|
|
3188
|
+
return null;
|
|
3189
|
+
case "Low":
|
|
3190
|
+
return "blue";
|
|
3191
|
+
case "Very Low":
|
|
3192
|
+
return "lightblue";
|
|
3193
|
+
}
|
|
3194
|
+
}, "colorFromPriority");
|
|
3195
|
+
async function xs(d, t, { config: g }) {
|
|
3196
|
+
const { labelStyles: h, nodeStyles: r } = W(t);
|
|
3197
|
+
t.labelStyle = h || "";
|
|
3198
|
+
const l = 10, f = t.width;
|
|
3199
|
+
t.width = (t.width ?? 200) - 10;
|
|
3200
|
+
const { shapeSvg: i, bbox: n, label: e } = await _(d, t, Y(t)), a = t.padding || 10;
|
|
3201
|
+
let s = "", o;
|
|
3202
|
+
"ticket" in t && t.ticket && g?.kanban?.ticketBaseUrl && (s = g?.kanban?.ticketBaseUrl.replace("#TICKET#", t.ticket), o = i.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", s).attr("target", "_blank"));
|
|
3203
|
+
const c = {
|
|
3204
|
+
useHtmlLabels: t.useHtmlLabels,
|
|
3205
|
+
labelStyle: t.labelStyle || "",
|
|
3206
|
+
width: t.width,
|
|
3207
|
+
img: t.img,
|
|
3208
|
+
padding: t.padding || 8,
|
|
3209
|
+
centerLabel: !1
|
|
3210
|
+
};
|
|
3211
|
+
let y, p;
|
|
3212
|
+
o ? { label: y, bbox: p } = await Lt(o, "ticket" in t && t.ticket || "", c) : { label: y, bbox: p } = await Lt(i, "ticket" in t && t.ticket || "", c);
|
|
3213
|
+
const { label: w, bbox: u } = await Lt(i, "assigned" in t && t.assigned || "", c);
|
|
3214
|
+
t.width = f;
|
|
3215
|
+
const m = 10, x = t?.width || 0, S = Math.max(p.height, u.height) / 2, b = Math.max(n.height + m * 2, t?.height || 0) + S, D = -x / 2, k = -b / 2;
|
|
3216
|
+
e.attr("transform", "translate(" + (a - x / 2) + ", " + (-S - n.height / 2) + ")"), y.attr("transform", "translate(" + (a - x / 2) + ", " + (-S + n.height / 2) + ")"), w.attr("transform", "translate(" + (a + x / 2 - u.width - 2 * l) + ", " + (-S + n.height / 2) + ")");
|
|
3217
|
+
let v;
|
|
3218
|
+
const { rx: B, ry: A } = t, { cssStyles: L } = t;
|
|
3219
|
+
if (t.look === "handDrawn") {
|
|
3220
|
+
const X = I.svg(i), N = H(t, {}), M = B || A ? X.path(dt(D, k, x, b, B || 0), N) : X.rectangle(D, k, x, b, N);
|
|
3221
|
+
v = i.insert(() => M, ":first-child"), v.attr("class", "basic label-container").attr("style", L || null);
|
|
3222
|
+
} else {
|
|
3223
|
+
v = i.insert("rect", ":first-child"), v.attr("class", "basic label-container __APA__").attr("style", r).attr("rx", B ?? 5).attr("ry", A ?? 5).attr("x", D).attr("y", k).attr("width", x).attr("height", b);
|
|
3224
|
+
const X = "priority" in t && t.priority;
|
|
3225
|
+
if (X) {
|
|
3226
|
+
const N = i.append("line"), M = D + 2, P = k + Math.floor((B ?? 0) / 2), T = k + b - Math.floor((B ?? 0) / 2);
|
|
3227
|
+
N.attr("x1", M).attr("y1", P).attr("x2", M).attr("y2", T).attr("stroke-width", "4").attr("stroke", qs(X));
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
return E(t, v), t.height = b, t.intersect = function(X) {
|
|
3231
|
+
return R.rect(t, X);
|
|
3232
|
+
}, i;
|
|
3233
|
+
}
|
|
3234
|
+
$(xs, "kanbanItem");
|
|
3235
|
+
async function bs(d, t) {
|
|
3236
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
3237
|
+
t.labelStyle = g;
|
|
3238
|
+
const { shapeSvg: r, bbox: l, halfPadding: f, label: i } = await _(d, t, Y(t)), n = l.width + 10 * f, e = l.height + 8 * f, a = 0.15 * n, { cssStyles: s } = t, o = l.width + 20, c = l.height + 20, y = Math.max(n, o), p = Math.max(e, c);
|
|
3239
|
+
i.attr("transform", `translate(${-l.width / 2}, ${-l.height / 2})`);
|
|
3240
|
+
let w;
|
|
3241
|
+
const u = `M0 0
|
|
3242
|
+
a${a},${a} 1 0,0 ${y * 0.25},${-1 * p * 0.1}
|
|
3243
|
+
a${a},${a} 1 0,0 ${y * 0.25},0
|
|
3244
|
+
a${a},${a} 1 0,0 ${y * 0.25},0
|
|
3245
|
+
a${a},${a} 1 0,0 ${y * 0.25},${p * 0.1}
|
|
3246
|
+
|
|
3247
|
+
a${a},${a} 1 0,0 ${y * 0.15},${p * 0.33}
|
|
3248
|
+
a${a * 0.8},${a * 0.8} 1 0,0 0,${p * 0.34}
|
|
3249
|
+
a${a},${a} 1 0,0 ${-1 * y * 0.15},${p * 0.33}
|
|
3250
|
+
|
|
3251
|
+
a${a},${a} 1 0,0 ${-1 * y * 0.25},${p * 0.15}
|
|
3252
|
+
a${a},${a} 1 0,0 ${-1 * y * 0.25},0
|
|
3253
|
+
a${a},${a} 1 0,0 ${-1 * y * 0.25},0
|
|
3254
|
+
a${a},${a} 1 0,0 ${-1 * y * 0.25},${-1 * p * 0.15}
|
|
3255
|
+
|
|
3256
|
+
a${a},${a} 1 0,0 ${-1 * y * 0.1},${-1 * p * 0.33}
|
|
3257
|
+
a${a * 0.8},${a * 0.8} 1 0,0 0,${-1 * p * 0.34}
|
|
3258
|
+
a${a},${a} 1 0,0 ${y * 0.1},${-1 * p * 0.33}
|
|
3259
|
+
H0 V0 Z`;
|
|
3260
|
+
if (t.look === "handDrawn") {
|
|
3261
|
+
const m = I.svg(r), x = H(t, {}), S = m.path(u, x);
|
|
3262
|
+
w = r.insert(() => S, ":first-child"), w.attr("class", "basic label-container").attr("style", K(s));
|
|
3263
|
+
} else w = r.insert("path", ":first-child").attr("class", "basic label-container").attr("style", h).attr("d", u);
|
|
3264
|
+
return w.attr("transform", `translate(${-y / 2}, ${-p / 2})`), E(t, w), t.calcIntersect = function(m, x) {
|
|
3265
|
+
return R.rect(m, x);
|
|
3266
|
+
}, t.intersect = function(m) {
|
|
3267
|
+
return F.info("Bang intersect", t, m), R.rect(t, m);
|
|
3268
|
+
}, r;
|
|
3269
|
+
}
|
|
3270
|
+
$(bs, "bang");
|
|
3271
|
+
async function Ss(d, t) {
|
|
3272
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
3273
|
+
t.labelStyle = g;
|
|
3274
|
+
const { shapeSvg: r, bbox: l, halfPadding: f, label: i } = await _(d, t, Y(t)), n = l.width + 2 * f, e = l.height + 2 * f, a = 0.15 * n, s = 0.25 * n, o = 0.35 * n, c = 0.2 * n, { cssStyles: y } = t;
|
|
3275
|
+
let p;
|
|
3276
|
+
const w = `M0 0
|
|
3277
|
+
a${a},${a} 0 0,1 ${n * 0.25},${-1 * n * 0.1}
|
|
3278
|
+
a${o},${o} 1 0,1 ${n * 0.4},${-1 * n * 0.1}
|
|
3279
|
+
a${s},${s} 1 0,1 ${n * 0.35},${n * 0.2}
|
|
3280
|
+
|
|
3281
|
+
a${a},${a} 1 0,1 ${n * 0.15},${e * 0.35}
|
|
3282
|
+
a${c},${c} 1 0,1 ${-1 * n * 0.15},${e * 0.65}
|
|
3283
|
+
|
|
3284
|
+
a${s},${a} 1 0,1 ${-1 * n * 0.25},${n * 0.15}
|
|
3285
|
+
a${o},${o} 1 0,1 ${-1 * n * 0.5},0
|
|
3286
|
+
a${a},${a} 1 0,1 ${-1 * n * 0.25},${-1 * n * 0.15}
|
|
3287
|
+
|
|
3288
|
+
a${a},${a} 1 0,1 ${-1 * n * 0.1},${-1 * e * 0.35}
|
|
3289
|
+
a${c},${c} 1 0,1 ${n * 0.1},${-1 * e * 0.65}
|
|
3290
|
+
H0 V0 Z`;
|
|
3291
|
+
if (t.look === "handDrawn") {
|
|
3292
|
+
const u = I.svg(r), m = H(t, {}), x = u.path(w, m);
|
|
3293
|
+
p = r.insert(() => x, ":first-child"), p.attr("class", "basic label-container").attr("style", K(y));
|
|
3294
|
+
} else p = r.insert("path", ":first-child").attr("class", "basic label-container").attr("style", h).attr("d", w);
|
|
3295
|
+
return i.attr("transform", `translate(${-l.width / 2}, ${-l.height / 2})`), p.attr("transform", `translate(${-n / 2}, ${-e / 2})`), E(t, p), t.calcIntersect = function(u, m) {
|
|
3296
|
+
return R.rect(u, m);
|
|
3297
|
+
}, t.intersect = function(u) {
|
|
3298
|
+
return F.info("Cloud intersect", t, u), R.rect(t, u);
|
|
3299
|
+
}, r;
|
|
3300
|
+
}
|
|
3301
|
+
$(Ss, "cloud");
|
|
3302
|
+
async function $s(d, t) {
|
|
3303
|
+
const { labelStyles: g, nodeStyles: h } = W(t);
|
|
3304
|
+
t.labelStyle = g;
|
|
3305
|
+
const { shapeSvg: r, bbox: l, halfPadding: f, label: i } = await _(d, t, Y(t)), n = l.width + 8 * f, e = l.height + 2 * f, a = 5, s = t.look === "neo" ? `
|
|
3306
|
+
M${-n / 2} ${e / 2 - a}
|
|
3307
|
+
v${-e + 2 * a}
|
|
3308
|
+
q0,-${a} ${a},-${a}
|
|
3309
|
+
h${n - 2 * a}
|
|
3310
|
+
q${a},0 ${a},${a}
|
|
3311
|
+
v${e - a}
|
|
3312
|
+
H${-n / 2}
|
|
3313
|
+
Z
|
|
3314
|
+
` : `
|
|
3315
|
+
M${-n / 2} ${e / 2 - a}
|
|
3316
|
+
v${-e + 2 * a}
|
|
3317
|
+
q0,-${a} ${a},-${a}
|
|
3318
|
+
h${n - 2 * a}
|
|
3319
|
+
q${a},0 ${a},${a}
|
|
3320
|
+
v${e - 2 * a}
|
|
3321
|
+
q0,${a} -5,${a}
|
|
3322
|
+
h${-(n - 2 * a)}
|
|
3323
|
+
q-5,0 -5,-5
|
|
3324
|
+
Z
|
|
3325
|
+
`;
|
|
3326
|
+
if (!t.domId) throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);
|
|
3327
|
+
const o = r.append("path").attr("id", t.domId).attr("class", "node-bkg node-" + t.type).attr("style", h).attr("d", s);
|
|
3328
|
+
return r.append("line").attr("class", "node-line-").attr("x1", -n / 2).attr("y1", e / 2).attr("x2", n / 2).attr("y2", e / 2), i.attr("transform", `translate(${-l.width / 2}, ${-l.height / 2})`), r.append(() => i.node()), E(t, o), t.calcIntersect = function(c, y) {
|
|
3329
|
+
return R.rect(c, y);
|
|
3330
|
+
}, t.intersect = function(c) {
|
|
3331
|
+
return R.rect(t, c);
|
|
3332
|
+
}, r;
|
|
3333
|
+
}
|
|
3334
|
+
$($s, "defaultMindmapNode");
|
|
3335
|
+
async function ks(d, t) {
|
|
3336
|
+
return Yt(d, t, { padding: t.padding ?? 0 });
|
|
3337
|
+
}
|
|
3338
|
+
$(ks, "mindmapCircle");
|
|
3339
|
+
var Fs = [
|
|
3340
|
+
{
|
|
3341
|
+
semanticName: "Process",
|
|
3342
|
+
name: "Rectangle",
|
|
3343
|
+
shortName: "rect",
|
|
3344
|
+
description: "Standard process shape",
|
|
3345
|
+
aliases: [
|
|
3346
|
+
"proc",
|
|
3347
|
+
"process",
|
|
3348
|
+
"rectangle"
|
|
3349
|
+
],
|
|
3350
|
+
internalAliases: ["squareRect"],
|
|
3351
|
+
handler: ts
|
|
3352
|
+
},
|
|
3353
|
+
{
|
|
3354
|
+
semanticName: "Event",
|
|
3355
|
+
name: "Rounded Rectangle",
|
|
3356
|
+
shortName: "rounded",
|
|
3357
|
+
description: "Represents an event",
|
|
3358
|
+
aliases: ["event"],
|
|
3359
|
+
internalAliases: ["roundedRect"],
|
|
3360
|
+
handler: Qa
|
|
3361
|
+
},
|
|
3362
|
+
{
|
|
3363
|
+
semanticName: "Terminal Point",
|
|
3364
|
+
name: "Stadium",
|
|
3365
|
+
shortName: "stadium",
|
|
3366
|
+
description: "Terminal point",
|
|
3367
|
+
aliases: ["terminal", "pill"],
|
|
3368
|
+
handler: as
|
|
3369
|
+
},
|
|
3370
|
+
{
|
|
3371
|
+
semanticName: "Subprocess",
|
|
3372
|
+
name: "Framed Rectangle",
|
|
3373
|
+
shortName: "fr-rect",
|
|
3374
|
+
description: "Subprocess",
|
|
3375
|
+
aliases: [
|
|
3376
|
+
"subprocess",
|
|
3377
|
+
"subproc",
|
|
3378
|
+
"framed-rectangle",
|
|
3379
|
+
"subroutine"
|
|
3380
|
+
],
|
|
3381
|
+
handler: ls
|
|
3382
|
+
},
|
|
3383
|
+
{
|
|
3384
|
+
semanticName: "Database",
|
|
3385
|
+
name: "Cylinder",
|
|
3386
|
+
shortName: "cyl",
|
|
3387
|
+
description: "Database storage",
|
|
3388
|
+
aliases: [
|
|
3389
|
+
"db",
|
|
3390
|
+
"database",
|
|
3391
|
+
"cylinder"
|
|
3392
|
+
],
|
|
3393
|
+
handler: ka
|
|
3394
|
+
},
|
|
3395
|
+
{
|
|
3396
|
+
semanticName: "Data Store",
|
|
3397
|
+
name: "Data Store",
|
|
3398
|
+
shortName: "datastore",
|
|
3399
|
+
description: "Data flow diagram data store",
|
|
3400
|
+
aliases: ["data-store"],
|
|
3401
|
+
handler: va
|
|
3402
|
+
},
|
|
3403
|
+
{
|
|
3404
|
+
semanticName: "Start",
|
|
3405
|
+
name: "Circle",
|
|
3406
|
+
shortName: "circle",
|
|
3407
|
+
description: "Starting point",
|
|
3408
|
+
aliases: ["circ"],
|
|
3409
|
+
handler: Yt
|
|
3410
|
+
},
|
|
3411
|
+
{
|
|
3412
|
+
semanticName: "Bang",
|
|
3413
|
+
name: "Bang",
|
|
3414
|
+
shortName: "bang",
|
|
3415
|
+
description: "Bang",
|
|
3416
|
+
aliases: ["bang"],
|
|
3417
|
+
handler: bs
|
|
3418
|
+
},
|
|
3419
|
+
{
|
|
3420
|
+
semanticName: "Cloud",
|
|
3421
|
+
name: "Cloud",
|
|
3422
|
+
shortName: "cloud",
|
|
3423
|
+
description: "cloud",
|
|
3424
|
+
aliases: ["cloud"],
|
|
3425
|
+
handler: Ss
|
|
3426
|
+
},
|
|
3427
|
+
{
|
|
3428
|
+
semanticName: "Decision",
|
|
3429
|
+
name: "Diamond",
|
|
3430
|
+
shortName: "diam",
|
|
3431
|
+
description: "Decision-making step",
|
|
3432
|
+
aliases: [
|
|
3433
|
+
"decision",
|
|
3434
|
+
"diamond",
|
|
3435
|
+
"question"
|
|
3436
|
+
],
|
|
3437
|
+
handler: Va
|
|
3438
|
+
},
|
|
3439
|
+
{
|
|
3440
|
+
semanticName: "Prepare Conditional",
|
|
3441
|
+
name: "Hexagon",
|
|
3442
|
+
shortName: "hex",
|
|
3443
|
+
description: "Preparation or condition step",
|
|
3444
|
+
aliases: ["hexagon", "prepare"],
|
|
3445
|
+
handler: Ra
|
|
3446
|
+
},
|
|
3447
|
+
{
|
|
3448
|
+
semanticName: "Data Input/Output",
|
|
3449
|
+
name: "Lean Right",
|
|
3450
|
+
shortName: "lean-r",
|
|
3451
|
+
description: "Represents input or output",
|
|
3452
|
+
aliases: ["lean-right", "in-out"],
|
|
3453
|
+
internalAliases: ["lean_right"],
|
|
3454
|
+
handler: _a
|
|
3455
|
+
},
|
|
3456
|
+
{
|
|
3457
|
+
semanticName: "Data Input/Output",
|
|
3458
|
+
name: "Lean Left",
|
|
3459
|
+
shortName: "lean-l",
|
|
3460
|
+
description: "Represents output or input",
|
|
3461
|
+
aliases: ["lean-left", "out-in"],
|
|
3462
|
+
internalAliases: ["lean_left"],
|
|
3463
|
+
handler: Ya
|
|
3464
|
+
},
|
|
3465
|
+
{
|
|
3466
|
+
semanticName: "Priority Action",
|
|
3467
|
+
name: "Trapezoid Base Bottom",
|
|
3468
|
+
shortName: "trap-b",
|
|
3469
|
+
description: "Priority action",
|
|
3470
|
+
aliases: [
|
|
3471
|
+
"priority",
|
|
3472
|
+
"trapezoid-bottom",
|
|
3473
|
+
"trapezoid"
|
|
3474
|
+
],
|
|
3475
|
+
handler: hs
|
|
3476
|
+
},
|
|
3477
|
+
{
|
|
3478
|
+
semanticName: "Manual Operation",
|
|
3479
|
+
name: "Trapezoid Base Top",
|
|
3480
|
+
shortName: "trap-t",
|
|
3481
|
+
description: "Represents a manual task",
|
|
3482
|
+
aliases: [
|
|
3483
|
+
"manual",
|
|
3484
|
+
"trapezoid-top",
|
|
3485
|
+
"inv-trapezoid"
|
|
3486
|
+
],
|
|
3487
|
+
internalAliases: ["inv_trapezoid"],
|
|
3488
|
+
handler: Ea
|
|
3489
|
+
},
|
|
3490
|
+
{
|
|
3491
|
+
semanticName: "Stop",
|
|
3492
|
+
name: "Double Circle",
|
|
3493
|
+
shortName: "dbl-circ",
|
|
3494
|
+
description: "Represents a stop point",
|
|
3495
|
+
aliases: ["double-circle"],
|
|
3496
|
+
internalAliases: ["doublecircle"],
|
|
3497
|
+
handler: Da
|
|
3498
|
+
},
|
|
3499
|
+
{
|
|
3500
|
+
semanticName: "Text Block",
|
|
3501
|
+
name: "Text Block",
|
|
3502
|
+
shortName: "text",
|
|
3503
|
+
description: "Text block",
|
|
3504
|
+
handler: cs
|
|
3505
|
+
},
|
|
3506
|
+
{
|
|
3507
|
+
semanticName: "Card",
|
|
3508
|
+
name: "Notched Rectangle",
|
|
3509
|
+
shortName: "notch-rect",
|
|
3510
|
+
description: "Represents a card",
|
|
3511
|
+
aliases: ["card", "notched-rectangle"],
|
|
3512
|
+
handler: da
|
|
3513
|
+
},
|
|
3514
|
+
{
|
|
3515
|
+
semanticName: "Lined/Shaded Process",
|
|
3516
|
+
name: "Lined Rectangle",
|
|
3517
|
+
shortName: "lin-rect",
|
|
3518
|
+
description: "Lined process shape",
|
|
3519
|
+
aliases: [
|
|
3520
|
+
"lined-rectangle",
|
|
3521
|
+
"lined-process",
|
|
3522
|
+
"lin-proc",
|
|
3523
|
+
"shaded-process"
|
|
3524
|
+
],
|
|
3525
|
+
handler: Ua
|
|
3526
|
+
},
|
|
3527
|
+
{
|
|
3528
|
+
semanticName: "Start",
|
|
3529
|
+
name: "Small Circle",
|
|
3530
|
+
shortName: "sm-circ",
|
|
3531
|
+
description: "Small starting point",
|
|
3532
|
+
aliases: ["start", "small-circle"],
|
|
3533
|
+
internalAliases: ["stateStart"],
|
|
3534
|
+
handler: is
|
|
3535
|
+
},
|
|
3536
|
+
{
|
|
3537
|
+
semanticName: "Stop",
|
|
3538
|
+
name: "Framed Circle",
|
|
3539
|
+
shortName: "fr-circ",
|
|
3540
|
+
description: "Stop point",
|
|
3541
|
+
aliases: ["stop", "framed-circle"],
|
|
3542
|
+
internalAliases: ["stateEnd"],
|
|
3543
|
+
handler: es
|
|
3544
|
+
},
|
|
3545
|
+
{
|
|
3546
|
+
semanticName: "Fork/Join",
|
|
3547
|
+
name: "Filled Rectangle",
|
|
3548
|
+
shortName: "fork",
|
|
3549
|
+
description: "Fork or join in process flow",
|
|
3550
|
+
aliases: ["join"],
|
|
3551
|
+
internalAliases: ["forkJoin"],
|
|
3552
|
+
handler: Na
|
|
3553
|
+
},
|
|
3554
|
+
{
|
|
3555
|
+
semanticName: "Collate",
|
|
3556
|
+
name: "Hourglass",
|
|
3557
|
+
shortName: "hourglass",
|
|
3558
|
+
description: "Represents a collate operation",
|
|
3559
|
+
aliases: ["hourglass", "collate"],
|
|
3560
|
+
handler: Aa
|
|
3561
|
+
},
|
|
3562
|
+
{
|
|
3563
|
+
semanticName: "Comment",
|
|
3564
|
+
name: "Curly Brace",
|
|
3565
|
+
shortName: "brace",
|
|
3566
|
+
description: "Adds a comment",
|
|
3567
|
+
aliases: ["comment", "brace-l"],
|
|
3568
|
+
handler: xa
|
|
3569
|
+
},
|
|
3570
|
+
{
|
|
3571
|
+
semanticName: "Comment Right",
|
|
3572
|
+
name: "Curly Brace",
|
|
3573
|
+
shortName: "brace-r",
|
|
3574
|
+
description: "Adds a comment",
|
|
3575
|
+
handler: ba
|
|
3576
|
+
},
|
|
3577
|
+
{
|
|
3578
|
+
semanticName: "Comment with braces on both sides",
|
|
3579
|
+
name: "Curly Braces",
|
|
3580
|
+
shortName: "braces",
|
|
3581
|
+
description: "Adds a comment",
|
|
3582
|
+
handler: Sa
|
|
3583
|
+
},
|
|
3584
|
+
{
|
|
3585
|
+
semanticName: "Com Link",
|
|
3586
|
+
name: "Lightning Bolt",
|
|
3587
|
+
shortName: "bolt",
|
|
3588
|
+
description: "Communication link",
|
|
3589
|
+
aliases: ["com-link", "lightning-bolt"],
|
|
3590
|
+
handler: Oa
|
|
3591
|
+
},
|
|
3592
|
+
{
|
|
3593
|
+
semanticName: "Document",
|
|
3594
|
+
name: "Document",
|
|
3595
|
+
shortName: "doc",
|
|
3596
|
+
description: "Represents a document",
|
|
3597
|
+
aliases: ["doc", "document"],
|
|
3598
|
+
handler: ys
|
|
3599
|
+
},
|
|
3600
|
+
{
|
|
3601
|
+
semanticName: "Delay",
|
|
3602
|
+
name: "Half-Rounded Rectangle",
|
|
3603
|
+
shortName: "delay",
|
|
3604
|
+
description: "Represents a delay",
|
|
3605
|
+
aliases: ["half-rounded-rectangle"],
|
|
3606
|
+
handler: Ca
|
|
3607
|
+
},
|
|
3608
|
+
{
|
|
3609
|
+
semanticName: "Direct Access Storage",
|
|
3610
|
+
name: "Horizontal Cylinder",
|
|
3611
|
+
shortName: "h-cyl",
|
|
3612
|
+
description: "Direct access storage",
|
|
3613
|
+
aliases: ["das", "horizontal-cylinder"],
|
|
3614
|
+
handler: os
|
|
3615
|
+
},
|
|
3616
|
+
{
|
|
3617
|
+
semanticName: "Disk Storage",
|
|
3618
|
+
name: "Lined Cylinder",
|
|
3619
|
+
shortName: "lin-cyl",
|
|
3620
|
+
description: "Disk storage",
|
|
3621
|
+
aliases: ["disk", "lined-cylinder"],
|
|
3622
|
+
handler: ja
|
|
3623
|
+
},
|
|
3624
|
+
{
|
|
3625
|
+
semanticName: "Display",
|
|
3626
|
+
name: "Curved Trapezoid",
|
|
3627
|
+
shortName: "curv-trap",
|
|
3628
|
+
description: "Represents a display",
|
|
3629
|
+
aliases: ["curved-trapezoid", "display"],
|
|
3630
|
+
handler: $a
|
|
3631
|
+
},
|
|
3632
|
+
{
|
|
3633
|
+
semanticName: "Divided Process",
|
|
3634
|
+
name: "Divided Rectangle",
|
|
3635
|
+
shortName: "div-rect",
|
|
3636
|
+
description: "Divided process shape",
|
|
3637
|
+
aliases: [
|
|
3638
|
+
"div-proc",
|
|
3639
|
+
"divided-rectangle",
|
|
3640
|
+
"divided-process"
|
|
3641
|
+
],
|
|
3642
|
+
handler: Pa
|
|
3643
|
+
},
|
|
3644
|
+
{
|
|
3645
|
+
semanticName: "Extract",
|
|
3646
|
+
name: "Triangle",
|
|
3647
|
+
shortName: "tri",
|
|
3648
|
+
description: "Extraction process",
|
|
3649
|
+
aliases: ["extract", "triangle"],
|
|
3650
|
+
handler: fs
|
|
3651
|
+
},
|
|
3652
|
+
{
|
|
3653
|
+
semanticName: "Internal Storage",
|
|
3654
|
+
name: "Window Pane",
|
|
3655
|
+
shortName: "win-pane",
|
|
3656
|
+
description: "Internal storage",
|
|
3657
|
+
aliases: ["internal-storage", "window-pane"],
|
|
3658
|
+
handler: ds
|
|
3659
|
+
},
|
|
3660
|
+
{
|
|
3661
|
+
semanticName: "Junction",
|
|
3662
|
+
name: "Filled Circle",
|
|
3663
|
+
shortName: "f-circ",
|
|
3664
|
+
description: "Junction point",
|
|
3665
|
+
aliases: ["junction", "filled-circle"],
|
|
3666
|
+
handler: Ba
|
|
3667
|
+
},
|
|
3668
|
+
{
|
|
3669
|
+
semanticName: "Loop Limit",
|
|
3670
|
+
name: "Trapezoidal Pentagon",
|
|
3671
|
+
shortName: "notch-pent",
|
|
3672
|
+
description: "Loop limit step",
|
|
3673
|
+
aliases: ["loop-limit", "notched-pentagon"],
|
|
3674
|
+
handler: gs
|
|
3675
|
+
},
|
|
3676
|
+
{
|
|
3677
|
+
semanticName: "Manual File",
|
|
3678
|
+
name: "Flipped Triangle",
|
|
3679
|
+
shortName: "flip-tri",
|
|
3680
|
+
description: "Manual file operation",
|
|
3681
|
+
aliases: ["manual-file", "flipped-triangle"],
|
|
3682
|
+
handler: Ma
|
|
3683
|
+
},
|
|
3684
|
+
{
|
|
3685
|
+
semanticName: "Manual Input",
|
|
3686
|
+
name: "Sloped Rectangle",
|
|
3687
|
+
shortName: "sl-rect",
|
|
3688
|
+
description: "Manual input step",
|
|
3689
|
+
aliases: ["manual-input", "sloped-rectangle"],
|
|
3690
|
+
handler: Ka
|
|
3691
|
+
},
|
|
3692
|
+
{
|
|
3693
|
+
semanticName: "Multi-Document",
|
|
3694
|
+
name: "Stacked Document",
|
|
3695
|
+
shortName: "docs",
|
|
3696
|
+
description: "Multiple documents",
|
|
3697
|
+
aliases: [
|
|
3698
|
+
"documents",
|
|
3699
|
+
"st-doc",
|
|
3700
|
+
"stacked-document"
|
|
3701
|
+
],
|
|
3702
|
+
handler: Fa
|
|
3703
|
+
},
|
|
3704
|
+
{
|
|
3705
|
+
semanticName: "Multi-Process",
|
|
3706
|
+
name: "Stacked Rectangle",
|
|
3707
|
+
shortName: "st-rect",
|
|
3708
|
+
description: "Multiple processes",
|
|
3709
|
+
aliases: [
|
|
3710
|
+
"procs",
|
|
3711
|
+
"processes",
|
|
3712
|
+
"stacked-rectangle"
|
|
3713
|
+
],
|
|
3714
|
+
handler: qa
|
|
3715
|
+
},
|
|
3716
|
+
{
|
|
3717
|
+
semanticName: "Stored Data",
|
|
3718
|
+
name: "Bow Tie Rectangle",
|
|
3719
|
+
shortName: "bow-rect",
|
|
3720
|
+
description: "Stored data",
|
|
3721
|
+
aliases: ["stored-data", "bow-tie-rectangle"],
|
|
3722
|
+
handler: pa
|
|
3723
|
+
},
|
|
3724
|
+
{
|
|
3725
|
+
semanticName: "Summary",
|
|
3726
|
+
name: "Crossed Circle",
|
|
3727
|
+
shortName: "cross-circ",
|
|
3728
|
+
description: "Summary",
|
|
3729
|
+
aliases: ["summary", "crossed-circle"],
|
|
3730
|
+
handler: ma
|
|
3731
|
+
},
|
|
3732
|
+
{
|
|
3733
|
+
semanticName: "Tagged Document",
|
|
3734
|
+
name: "Tagged Document",
|
|
3735
|
+
shortName: "tag-doc",
|
|
3736
|
+
description: "Tagged document",
|
|
3737
|
+
aliases: ["tag-doc", "tagged-document"],
|
|
3738
|
+
handler: ns
|
|
3739
|
+
},
|
|
3740
|
+
{
|
|
3741
|
+
semanticName: "Tagged Process",
|
|
3742
|
+
name: "Tagged Rectangle",
|
|
3743
|
+
shortName: "tag-rect",
|
|
3744
|
+
description: "Tagged process",
|
|
3745
|
+
aliases: [
|
|
3746
|
+
"tagged-rectangle",
|
|
3747
|
+
"tag-proc",
|
|
3748
|
+
"tagged-process"
|
|
3749
|
+
],
|
|
3750
|
+
handler: rs
|
|
3751
|
+
},
|
|
3752
|
+
{
|
|
3753
|
+
semanticName: "Paper Tape",
|
|
3754
|
+
name: "Flag",
|
|
3755
|
+
shortName: "flag",
|
|
3756
|
+
description: "Paper tape",
|
|
3757
|
+
aliases: ["paper-tape"],
|
|
3758
|
+
handler: ps
|
|
3759
|
+
},
|
|
3760
|
+
{
|
|
3761
|
+
semanticName: "Odd",
|
|
3762
|
+
name: "Odd",
|
|
3763
|
+
shortName: "odd",
|
|
3764
|
+
description: "Odd shape",
|
|
3765
|
+
internalAliases: ["rect_left_inv_arrow"],
|
|
3766
|
+
handler: Za
|
|
3767
|
+
},
|
|
3768
|
+
{
|
|
3769
|
+
semanticName: "Lined Document",
|
|
3770
|
+
name: "Lined Document",
|
|
3771
|
+
shortName: "lin-doc",
|
|
3772
|
+
description: "Lined document",
|
|
3773
|
+
aliases: ["lined-document"],
|
|
3774
|
+
handler: Ga
|
|
3775
|
+
}
|
|
3776
|
+
], vs = (/* @__PURE__ */ $(() => {
|
|
3777
|
+
const d = [...Object.entries({
|
|
3778
|
+
state: ss,
|
|
3779
|
+
choice: ua,
|
|
3780
|
+
note: za,
|
|
3781
|
+
rectWithTitle: Ja,
|
|
3782
|
+
labelRect: Xa,
|
|
3783
|
+
iconSquare: Ta,
|
|
3784
|
+
iconCircle: Ia,
|
|
3785
|
+
icon: Ha,
|
|
3786
|
+
iconRounded: La,
|
|
3787
|
+
imageSquare: Wa,
|
|
3788
|
+
anchor: fa,
|
|
3789
|
+
kanbanItem: xs,
|
|
3790
|
+
mindmapCircle: ks,
|
|
3791
|
+
defaultMindmapNode: $s,
|
|
3792
|
+
classBox: ws,
|
|
3793
|
+
erBox: _t,
|
|
3794
|
+
requirementBox: ms
|
|
3795
|
+
}), ...Fs.flatMap((t) => [
|
|
3796
|
+
t.shortName,
|
|
3797
|
+
..."aliases" in t ? t.aliases : [],
|
|
3798
|
+
..."internalAliases" in t ? t.internalAliases : []
|
|
3799
|
+
].map((g) => [g, t.handler]))];
|
|
3800
|
+
return Object.fromEntries(d);
|
|
3801
|
+
}, "generateShapeMap"))();
|
|
3802
|
+
function zs(d) {
|
|
3803
|
+
return d in vs;
|
|
3804
|
+
}
|
|
3805
|
+
$(zs, "isValidShape");
|
|
3806
|
+
var Ht = /* @__PURE__ */ new Map();
|
|
3807
|
+
async function Vs(d, t, g) {
|
|
3808
|
+
let h, r;
|
|
3809
|
+
t.shape === "rect" && (t.rx && t.ry ? t.shape = "roundedRect" : t.shape = "squareRect");
|
|
3810
|
+
const l = t.shape ? vs[t.shape] : void 0;
|
|
3811
|
+
if (!l) throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);
|
|
3812
|
+
if (t.link) {
|
|
3813
|
+
let f;
|
|
3814
|
+
g.config.securityLevel === "sandbox" ? f = "_top" : t.linkTarget && (f = t.linkTarget || "_blank"), h = d.insert("svg:a").attr("xlink:href", t.link).attr("target", f ?? null), r = await l(h, t, g);
|
|
3815
|
+
} else
|
|
3816
|
+
r = await l(d, t, g), h = r;
|
|
3817
|
+
return h.attr("data-look", K(t.look)), t.tooltip && r.attr("title", t.tooltip), Ht.set(t.id, h), t.haveCallback && h.attr("class", h.attr("class") + " clickable"), h;
|
|
3818
|
+
}
|
|
3819
|
+
$(Vs, "insertNode");
|
|
3820
|
+
var re = /* @__PURE__ */ $((d, t) => {
|
|
3821
|
+
Ht.set(t.id, d);
|
|
3822
|
+
}, "setNodeElem"), ne = /* @__PURE__ */ $(() => {
|
|
3823
|
+
Ht.clear();
|
|
3824
|
+
}, "clear"), ce = /* @__PURE__ */ $((d) => {
|
|
3825
|
+
const t = Ht.get(d.id);
|
|
3826
|
+
F.trace("Transforming node", d.diff, d, "translate(" + (d.x - d.width / 2 - 5) + ", " + d.width / 2 + ")");
|
|
3827
|
+
const g = 8, h = d.diff || 0;
|
|
3828
|
+
return d.clusterNode ? t.attr("transform", "translate(" + (d.x + h - d.width / 2) + ", " + (d.y - d.height / 2 - g) + ")") : t.attr("transform", "translate(" + d.x + ", " + d.y + ")"), h;
|
|
3829
|
+
}, "positionNode");
|
|
3830
|
+
export {
|
|
3831
|
+
Vs as a,
|
|
3832
|
+
ce as c,
|
|
3833
|
+
ie as i,
|
|
3834
|
+
re as l,
|
|
3835
|
+
ne as n,
|
|
3836
|
+
zs as o,
|
|
3837
|
+
Mt as r,
|
|
3838
|
+
_ as s,
|
|
3839
|
+
le as t,
|
|
3840
|
+
E as u
|
|
3841
|
+
};
|