mio-previewer 0.2.73 → 0.2.76
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 -0
- package/README.zh-CN.md +2 -1
- package/dist/_basePickBy-CXmXW7jd.js +166 -0
- package/dist/_basePickBy-CtuVwROD.cjs +1 -0
- package/dist/_baseUniq-CGoiOkSa.js +682 -0
- package/dist/_baseUniq-CYtOXxfV.cjs +1 -0
- package/dist/_createAssigner-DqH64jc7.cjs +1 -0
- package/dist/_createAssigner-IEX8lwxm.js +573 -0
- package/dist/arc-C78br9Yj.cjs +1 -0
- package/dist/arc-vLgDTVZZ.js +80 -0
- package/dist/architecture-O4VJ6CD3-B9qzjtV8.cjs +1 -0
- package/dist/architecture-O4VJ6CD3-wqAP4onK.js +2 -0
- package/dist/architectureDiagram-VXUJARFQ-CYbuyVAs.js +4039 -0
- package/dist/architectureDiagram-VXUJARFQ-DEGYSl1f.cjs +36 -0
- package/dist/array-CApNbSU9.js +6 -0
- package/dist/array-DZSRzHA_.cjs +1 -0
- package/dist/assets/parser.worker-Bzb1GItl.js +14 -0
- package/dist/blockDiagram-VD42YOAC-DaH3L5Ng.js +3009 -0
- package/dist/blockDiagram-VD42YOAC-DeX0dq72.cjs +122 -0
- package/dist/c4Diagram-YG6GDRKO-CIThIYo6.js +2959 -0
- package/dist/c4Diagram-YG6GDRKO-Dz6dif_9.cjs +10 -0
- package/dist/channel-BWHkpgVD.cjs +1 -0
- package/dist/channel-JT7eWw2w.js +5 -0
- package/dist/chunk-4BX2VUAB-BZTgbbzC.js +8 -0
- package/dist/chunk-4BX2VUAB-HXFjpyQg.cjs +1 -0
- package/dist/chunk-55IACEB6-DWUqxxdp.js +8 -0
- package/dist/chunk-55IACEB6-Hy_THNUs.cjs +1 -0
- package/dist/chunk-ABZYJK2D-CbIYYZa_.cjs +80 -0
- package/dist/chunk-ABZYJK2D-DDrmE3Q7.js +2518 -0
- package/dist/chunk-ATLVNIR6-DHlCNWnJ.js +67 -0
- package/dist/chunk-ATLVNIR6-shAOudT0.cjs +1 -0
- package/dist/chunk-B4BG7PRW-C67vroOS.cjs +165 -0
- package/dist/chunk-B4BG7PRW-DSYuK8dI.js +3116 -0
- package/dist/chunk-BNMv73og.cjs +1 -0
- package/dist/chunk-CVBHYZKI-CLVcv_xh.cjs +1 -0
- package/dist/chunk-CVBHYZKI-CiCGetln.js +12 -0
- package/dist/chunk-DI55MBZ5-BCvBgHrp.cjs +220 -0
- package/dist/chunk-DI55MBZ5-Clru0TyG.js +2000 -0
- package/dist/chunk-Dbv0sNQl.js +20 -0
- package/dist/chunk-FMBD7UC4-D4kohRVY.js +5 -0
- package/dist/{chunk-FMBD7UC4-DxkUZTpt.cjs → chunk-FMBD7UC4-DWMVCXKq.cjs} +2 -2
- package/dist/chunk-HN2XXSSU-BwmRMa2r.cjs +1 -0
- package/dist/chunk-HN2XXSSU-CJL8wAZ2.js +76 -0
- package/dist/chunk-JA3XYJ7Z-BaAdjYEy.cjs +70 -0
- package/dist/chunk-JA3XYJ7Z-CpKHrbOX.js +1849 -0
- package/dist/chunk-JZLCHNYA-CYo7ykJf.js +4863 -0
- package/dist/chunk-JZLCHNYA-CvPIQFXP.cjs +54 -0
- package/dist/chunk-QN33PNHL-BFbXAWI4.js +25 -0
- package/dist/chunk-QN33PNHL-Cu0FHarG.cjs +1 -0
- package/dist/chunk-QXUST7PY-CnnfdJrM.cjs +7 -0
- package/dist/chunk-QXUST7PY-CxCAwQqP.js +488 -0
- package/dist/chunk-QZHKN3VN-2e6nJr8c.cjs +1 -0
- package/dist/chunk-QZHKN3VN-Dal4kx9B.js +15 -0
- package/dist/chunk-S3R3BYOJ-B2ozcJNg.cjs +2 -0
- package/dist/chunk-S3R3BYOJ-CG6GoSCd.js +1119 -0
- package/dist/chunk-TZMSLE5B-CooeLs4Q.js +57 -0
- package/dist/chunk-TZMSLE5B-D92K1Ja5.cjs +1 -0
- package/dist/classDiagram-2ON5EDUG-Bv1XCvDZ.js +28 -0
- package/dist/classDiagram-2ON5EDUG-BzMV1CJW.cjs +1 -0
- package/dist/classDiagram-v2-WZHVMYZB-Bqxv5U7u.js +28 -0
- package/dist/classDiagram-v2-WZHVMYZB-BzMV1CJW.cjs +1 -0
- package/dist/clone-B0KDIkSS.js +8 -0
- package/dist/clone-wvtBTB6v.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-DMHTv1aW.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-bGPAcpg6.js +2250 -0
- package/dist/custom-Bl_fVJZ0.cjs +84 -0
- package/dist/custom-D-TzPpWT.js +5281 -0
- package/dist/cytoscape.esm-CElDUMAx.cjs +321 -0
- package/dist/cytoscape.esm-xf9dtmBj.js +18100 -0
- package/dist/dagre-6UL2VRFP-3bgUxzqG.js +294 -0
- package/dist/dagre-6UL2VRFP-B3NqmIxs.cjs +4 -0
- package/dist/dagre-BfAHSwtP.js +1472 -0
- package/dist/dagre-Buvkww-e.cjs +1 -0
- package/dist/defaultLocale-B5dSAwiC.js +201 -0
- package/dist/defaultLocale-G0HsdRIB.cjs +1 -0
- package/dist/diagram-PSM6KHXK-C4FjxUHt.cjs +24 -0
- package/dist/diagram-PSM6KHXK-CF8TkgzX.js +527 -0
- package/dist/diagram-QEK2KX5R-Dl3IHeA5.js +213 -0
- package/dist/diagram-QEK2KX5R-Z9DYjr44.cjs +43 -0
- package/dist/diagram-S2PKOQOG-Bib-zL2S.cjs +24 -0
- package/dist/diagram-S2PKOQOG-ZKvn7IEe.js +133 -0
- package/dist/dist-DC-lM4uX.cjs +1 -0
- package/dist/dist-zNcLEPGR.js +51 -0
- package/dist/erDiagram-Q2GNP2WA-DFMV9OUT.cjs +60 -0
- package/dist/erDiagram-Q2GNP2WA-DJYJEzEB.js +1600 -0
- package/dist/flowDiagram-NV44I4VS-7TxeawHS.cjs +162 -0
- package/dist/flowDiagram-NV44I4VS-CXa6ycqs.js +4128 -0
- package/dist/ganttDiagram-LVOFAZNH-DqT7pu4m.js +2869 -0
- package/dist/ganttDiagram-LVOFAZNH-iiExGpwF.cjs +267 -0
- package/dist/gitGraph-ZV4HHKMB-BjaEVcYh.cjs +1 -0
- package/dist/gitGraph-ZV4HHKMB-Cl2I6-l3.js +2 -0
- package/dist/gitGraphDiagram-NY62KEGX-Tphu_MeC.js +621 -0
- package/dist/gitGraphDiagram-NY62KEGX-k5xzXg7C.cjs +65 -0
- package/dist/graphlib-C3tPLMbC.js +225 -0
- package/dist/graphlib-Cdg0u3TT.cjs +1 -0
- package/dist/info-63CPKGFF-D2A5GDFo.js +2 -0
- package/dist/info-63CPKGFF-MRaucWlf.cjs +1 -0
- package/dist/infoDiagram-F6ZHWCRC-3Jwo4J0f.cjs +2 -0
- package/dist/infoDiagram-F6ZHWCRC-BUoruN76.js +19 -0
- package/dist/init-07zIhv_j.cjs +1 -0
- package/dist/init-Bwwdo3M6.js +15 -0
- package/dist/journeyDiagram-XKPGCS4Q-C_3oD9RV.cjs +139 -0
- package/dist/journeyDiagram-XKPGCS4Q-DB7INfrf.js +883 -0
- package/dist/kanban-definition-3W4ZIXB7-AVLIBuMF.js +968 -0
- package/dist/kanban-definition-3W4ZIXB7-txUXjKzB.cjs +89 -0
- package/dist/katex-6UpFeIdV.cjs +261 -0
- package/dist/katex-BHcJffnM.js +22112 -0
- package/dist/line-DYhVGH2B.js +34 -0
- package/dist/line-DdNAPGaw.cjs +1 -0
- package/dist/linear-n4_iirEu.js +289 -0
- package/dist/linear-rQLpRrSH.cjs +1 -0
- package/dist/loadCss-D6257oR0.js +8 -0
- package/dist/loadCss-DhrQh6-A.cjs +1 -0
- package/dist/markdown-it-Cz3KGZjR.cjs +2 -0
- package/dist/markdown-it-D-hH4G7k.js +173 -0
- package/dist/math-G8rF7UWn.cjs +1 -0
- package/dist/math-H49DsxYR.js +10 -0
- package/dist/mermaid-parser.core-B84fnaGG.js +11904 -0
- package/dist/mermaid-parser.core-C9EbhVVg.cjs +82 -0
- package/dist/mindmap-definition-VGOIOE7T-CXlyYsc6.cjs +68 -0
- package/dist/mindmap-definition-VGOIOE7T-VIt9sDN3.js +963 -0
- package/dist/mio-previewer.cjs.js +11 -21
- package/dist/mio-previewer.css +2 -9
- package/dist/mio-previewer.esm.js +4939 -0
- package/dist/ordinal-C55HfHHp.js +65 -0
- package/dist/ordinal-CUPR-p0T.cjs +1 -0
- package/dist/packet-HUATNLJX-CGNko_oS.cjs +1 -0
- package/dist/packet-HUATNLJX-CVx40lqO.js +2 -0
- package/dist/path-DNvJyUE8.js +85 -0
- package/dist/path-Kklx0M1v.cjs +1 -0
- package/dist/pie-WTHONI2E-BdPx0Cfg.cjs +1 -0
- package/dist/pie-WTHONI2E-DX5V8x0L.js +2 -0
- package/dist/pieDiagram-ADFJNKIX-BysReYfx.js +165 -0
- package/dist/pieDiagram-ADFJNKIX-CTT1YMsk.cjs +30 -0
- package/dist/plugins/custom.cjs.js +1 -1
- package/dist/plugins/custom.esm.js +2 -0
- package/dist/plugins/markdown-it.cjs.js +1 -3
- package/dist/plugins/markdown-it.esm.js +2 -0
- package/dist/quadrantDiagram-AYHSOK5B-8-V3cwsC.cjs +7 -0
- package/dist/quadrantDiagram-AYHSOK5B-DRutDK03.js +1974 -0
- package/dist/radar-NJJJXTRR-CTD6M8nl.js +2 -0
- package/dist/radar-NJJJXTRR-wJoTnQbj.cjs +1 -0
- package/dist/requirementDiagram-UZGBJVZJ-DFRpWnfW.cjs +64 -0
- package/dist/requirementDiagram-UZGBJVZJ-DNYoJyhG.js +2191 -0
- package/dist/sankeyDiagram-TZEHDZUN-B9fxDP0Q.cjs +10 -0
- package/dist/sankeyDiagram-TZEHDZUN-DD6bkI4Z.js +920 -0
- package/dist/sequenceDiagram-WL72ISMW-Bmptok1c.js +3562 -0
- package/dist/sequenceDiagram-WL72ISMW-D9sXtgAn.cjs +145 -0
- package/dist/src-BMjps4Ui.cjs +1 -0
- package/dist/src-BuisGndr.js +2149 -0
- package/dist/stateDiagram-FKZM4ZOC-Bmiw8fnW.js +217 -0
- package/dist/stateDiagram-FKZM4ZOC-DiD1WJPM.cjs +1 -0
- package/dist/stateDiagram-v2-4FDKWEC3-5ADhn1IF.js +27 -0
- package/dist/stateDiagram-v2-4FDKWEC3-BjhmCPL1.cjs +1 -0
- package/dist/timeline-definition-IT6M3QCI-C9VMls3W.js +830 -0
- package/dist/timeline-definition-IT6M3QCI-ZzbHXhNl.cjs +61 -0
- package/dist/treemap-75Q7IDZK-9TPMYr3R.cjs +1 -0
- package/dist/treemap-75Q7IDZK-u3p-cHDL.js +2 -0
- package/dist/types/plugins/custom/codeBlockPlugin.d.ts +8 -0
- package/dist/types/plugins/custom/mermaidPlugin.d.ts +4 -0
- package/dist/xychartDiagram-PRI3JC2R-BI6KuGZ2.cjs +7 -0
- package/dist/xychartDiagram-PRI3JC2R-BWabDL1u.js +2041 -0
- package/package.json +2 -2
- package/dist/_basePickBy-Be3yyf2d.js +0 -151
- package/dist/_basePickBy-Z0DtrAKQ.cjs +0 -1
- package/dist/_baseUniq-BXkA0Pgx.js +0 -614
- package/dist/_baseUniq-Dq2eV1vY.cjs +0 -1
- package/dist/arc-B-QGG8RZ.cjs +0 -1
- package/dist/arc-djW14lrn.js +0 -83
- package/dist/architecture-O4VJ6CD3-Cws_zM2K.cjs +0 -1
- package/dist/architecture-O4VJ6CD3-pdMXTCaT.js +0 -5
- package/dist/architectureDiagram-VXUJARFQ-BwchhvqL.js +0 -4661
- package/dist/architectureDiagram-VXUJARFQ-DxDLWGpO.cjs +0 -36
- package/dist/assets/parser.worker-67NQKZt5.js +0 -16
- package/dist/blockDiagram-VD42YOAC-B4Xc8gfX.cjs +0 -122
- package/dist/blockDiagram-VD42YOAC-DpPneP6J.js +0 -2261
- package/dist/c4Diagram-YG6GDRKO-695lQbrZ.cjs +0 -10
- package/dist/c4Diagram-YG6GDRKO-Cnlax2Xq.js +0 -1580
- package/dist/channel-D_ITz6Jy.cjs +0 -1
- package/dist/channel-sXy9EduO.js +0 -5
- package/dist/chunk-4BX2VUAB-Bdx3_f83.cjs +0 -1
- package/dist/chunk-4BX2VUAB-DRkGmgAZ.js +0 -8
- package/dist/chunk-55IACEB6-BB03hpRC.cjs +0 -1
- package/dist/chunk-55IACEB6-Ord5OQlh.js +0 -8
- package/dist/chunk-B4BG7PRW-Ca0fOgzA.cjs +0 -165
- package/dist/chunk-B4BG7PRW-D-cs8bDX.js +0 -1375
- package/dist/chunk-DI55MBZ5-BsRe2B2M.cjs +0 -220
- package/dist/chunk-DI55MBZ5-DSmlLD1s.js +0 -1370
- package/dist/chunk-FMBD7UC4-IYQmAMTo.js +0 -19
- package/dist/chunk-QN33PNHL-B7G6Qlf3.cjs +0 -1
- package/dist/chunk-QN33PNHL-EYMc4JVr.js +0 -19
- package/dist/chunk-QZHKN3VN-B8NJ6Ahx.cjs +0 -1
- package/dist/chunk-QZHKN3VN-C4WIG5z8.js +0 -15
- package/dist/chunk-TZMSLE5B-BoM53RHv.js +0 -64
- package/dist/chunk-TZMSLE5B-CgLDb48A.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-CxmdZvqc.js +0 -16
- package/dist/classDiagram-2ON5EDUG-DIRim8qa.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-CxmdZvqc.js +0 -16
- package/dist/classDiagram-v2-WZHVMYZB-DIRim8qa.cjs +0 -1
- package/dist/clone-DOYxaT_d.js +0 -8
- package/dist/clone-DSlm33NG.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-BD3p1OC_.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-yLoaqH3G.js +0 -2608
- package/dist/cytoscape.esm-DHF7mANN.cjs +0 -331
- package/dist/cytoscape.esm-DfdJODL8.js +0 -18735
- package/dist/dagre-6UL2VRFP-DG1oQ4B2.cjs +0 -4
- package/dist/dagre-6UL2VRFP-VjboDBbp.js +0 -444
- package/dist/defaultLocale-D7EN2tov.js +0 -171
- package/dist/defaultLocale-DIVzfLaQ.cjs +0 -1
- package/dist/diagram-PSM6KHXK-C1p0l5TY.js +0 -531
- package/dist/diagram-PSM6KHXK-a4rni6rJ.cjs +0 -24
- package/dist/diagram-QEK2KX5R-CErKOsX1.cjs +0 -43
- package/dist/diagram-QEK2KX5R-CKmmuumX.js +0 -217
- package/dist/diagram-S2PKOQOG-B1M7qCNl.cjs +0 -24
- package/dist/diagram-S2PKOQOG-BMLCJExF.js +0 -142
- package/dist/erDiagram-Q2GNP2WA-BfuCa_Za.cjs +0 -60
- package/dist/erDiagram-Q2GNP2WA-fOTsQA-d.js +0 -841
- package/dist/flowDiagram-NV44I4VS-BEqeUuqz.cjs +0 -162
- package/dist/flowDiagram-NV44I4VS-DDwRAjVG.js +0 -1620
- package/dist/ganttDiagram-LVOFAZNH-BbuRS8g3.js +0 -2505
- package/dist/ganttDiagram-LVOFAZNH-BlVeWKRf.cjs +0 -267
- package/dist/gitGraph-ZV4HHKMB-Bmu8r_Iq.cjs +0 -1
- package/dist/gitGraph-ZV4HHKMB-DcQ2E4dF.js +0 -5
- package/dist/gitGraphDiagram-NY62KEGX-DcMEeNh7.cjs +0 -65
- package/dist/gitGraphDiagram-NY62KEGX-_sWVSKbL.js +0 -699
- package/dist/graph-DEnt0OtZ.js +0 -247
- package/dist/graph-Dgcjs2XL.cjs +0 -1
- package/dist/info-63CPKGFF-DVDDcoHy.js +0 -5
- package/dist/info-63CPKGFF-Dc3cWL0G.cjs +0 -1
- package/dist/infoDiagram-F6ZHWCRC-DoUSS0kC.js +0 -24
- package/dist/infoDiagram-F6ZHWCRC-ZeTrjgaE.cjs +0 -2
- package/dist/init-CHZsXQcr.cjs +0 -1
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/journeyDiagram-XKPGCS4Q-DGe13iBu.js +0 -834
- package/dist/journeyDiagram-XKPGCS4Q-Ihl9g4mY.cjs +0 -139
- package/dist/kanban-definition-3W4ZIXB7-2qkrkVLK.cjs +0 -89
- package/dist/kanban-definition-3W4ZIXB7-BhWe5nMU.js +0 -719
- package/dist/katex-CmGeg_OO.js +0 -11692
- package/dist/katex-DEiiRhcn.cjs +0 -261
- package/dist/layout-BDNzBIaA.cjs +0 -1
- package/dist/layout-DTBfbHzy.js +0 -1324
- package/dist/linear-BRl2UYUr.cjs +0 -1
- package/dist/linear-CwbXkgvF.js +0 -259
- package/dist/loadCss-BbD6mdv-.cjs +0 -1
- package/dist/loadCss-DS0Fuaxe.js +0 -8
- package/dist/mermaid-parser.core-CJ1yJm0s.js +0 -12966
- package/dist/mermaid-parser.core-CxTcWSA2.cjs +0 -128
- package/dist/mindmap-definition-VGOIOE7T-BPUEmP7g.cjs +0 -68
- package/dist/mindmap-definition-VGOIOE7T-DSqZBgzR.js +0 -784
- package/dist/mio-previewer.es.js +0 -6171
- package/dist/ordinal-CagbB1m8.cjs +0 -1
- package/dist/ordinal-DfAQgscy.js +0 -61
- package/dist/packet-HUATNLJX-B-qfkr5X.cjs +0 -1
- package/dist/packet-HUATNLJX-Dxob_meO.js +0 -5
- package/dist/pie-WTHONI2E-BRtdTGWt.js +0 -5
- package/dist/pie-WTHONI2E-DK7f6qJw.cjs +0 -1
- package/dist/pieDiagram-ADFJNKIX-Dhq_bEzm.js +0 -161
- package/dist/pieDiagram-ADFJNKIX-V04ms3gr.cjs +0 -30
- package/dist/plugins/custom.es.js +0 -85
- package/dist/plugins/markdown-it.es.js +0 -173
- package/dist/quadrantDiagram-AYHSOK5B-C97bOmUE.js +0 -1022
- package/dist/quadrantDiagram-AYHSOK5B-DlqFPVhi.cjs +0 -7
- package/dist/radar-NJJJXTRR-B9jT3LP3.cjs +0 -1
- package/dist/radar-NJJJXTRR-D8plmle3.js +0 -5
- package/dist/requirementDiagram-UZGBJVZJ-BxVMLKfQ.js +0 -850
- package/dist/requirementDiagram-UZGBJVZJ-DENJ74Ew.cjs +0 -64
- package/dist/sankeyDiagram-TZEHDZUN-DwgW7Suq.js +0 -810
- package/dist/sankeyDiagram-TZEHDZUN-lTBLhaSq.cjs +0 -10
- package/dist/sequenceDiagram-WL72ISMW-BAOeX1dA.js +0 -2511
- package/dist/sequenceDiagram-WL72ISMW-BRVvH1X4.cjs +0 -145
- package/dist/stateDiagram-FKZM4ZOC-BrFQE7Gl.js +0 -263
- package/dist/stateDiagram-FKZM4ZOC-D8GjooGL.cjs +0 -1
- package/dist/stateDiagram-v2-4FDKWEC3-4VRIY-eH.cjs +0 -1
- package/dist/stateDiagram-v2-4FDKWEC3-DnrWD6a3.js +0 -16
- package/dist/timeline-definition-IT6M3QCI-BJMIlueb.js +0 -795
- package/dist/timeline-definition-IT6M3QCI-BQFGUuGP.cjs +0 -61
- package/dist/treemap-75Q7IDZK-BX1vBFWf.cjs +0 -1
- package/dist/treemap-75Q7IDZK-CMTkunTV.js +0 -5
- package/dist/viewer-CZUSHxhf.js +0 -19131
- package/dist/viewer-Canph5Zx.cjs +0 -305
- package/dist/xychartDiagram-PRI3JC2R-Sl8WX8wc.cjs +0 -7
- package/dist/xychartDiagram-PRI3JC2R-WnFI7Ezu.js +0 -1340
|
@@ -0,0 +1,4863 @@
|
|
|
1
|
+
import { g as e, h as t, p as n } from "./src-BuisGndr.js";
|
|
2
|
+
import { A as r, I as i, L as a, N as o, O as s, b as c, d as l, h as u, s as d, y as f } from "./chunk-ABZYJK2D-DDrmE3Q7.js";
|
|
3
|
+
import { f as p, i as m, l as h, n as g } from "./chunk-S3R3BYOJ-CG6GoSCd.js";
|
|
4
|
+
import { t as _ } from "./chunk-CVBHYZKI-CiCGetln.js";
|
|
5
|
+
import { a as v, i as y, r as b, t as x } from "./chunk-ATLVNIR6-DHlCNWnJ.js";
|
|
6
|
+
import { n as S, r as C } from "./chunk-JA3XYJ7Z-CpKHrbOX.js";
|
|
7
|
+
//#region node_modules/.pnpm/roughjs@4.6.6/node_modules/roughjs/bundled/rough.esm.js
|
|
8
|
+
function w(e, t, n) {
|
|
9
|
+
if (e && e.length) {
|
|
10
|
+
let [r, i] = t, a = Math.PI / 180 * n, o = Math.cos(a), s = Math.sin(a);
|
|
11
|
+
for (let t of e) {
|
|
12
|
+
let [e, n] = t;
|
|
13
|
+
t[0] = (e - r) * o - (n - i) * s + r, t[1] = (e - r) * s + (n - i) * o + i;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function T(e, t) {
|
|
18
|
+
return e[0] === t[0] && e[1] === t[1];
|
|
19
|
+
}
|
|
20
|
+
function E(e, t, n, r = 1) {
|
|
21
|
+
let i = n, a = Math.max(t, .1), o = e[0] && e[0][0] && typeof e[0][0] == "number" ? [e] : e, s = [0, 0];
|
|
22
|
+
if (i) for (let e of o) w(e, s, i);
|
|
23
|
+
let c = function(e, t, n) {
|
|
24
|
+
let r = [];
|
|
25
|
+
for (let t of e) {
|
|
26
|
+
let e = [...t];
|
|
27
|
+
T(e[0], e[e.length - 1]) || e.push([e[0][0], e[0][1]]), e.length > 2 && r.push(e);
|
|
28
|
+
}
|
|
29
|
+
let i = [];
|
|
30
|
+
t = Math.max(t, .1);
|
|
31
|
+
let a = [];
|
|
32
|
+
for (let e of r) for (let t = 0; t < e.length - 1; t++) {
|
|
33
|
+
let n = e[t], r = e[t + 1];
|
|
34
|
+
if (n[1] !== r[1]) {
|
|
35
|
+
let e = Math.min(n[1], r[1]);
|
|
36
|
+
a.push({
|
|
37
|
+
ymin: e,
|
|
38
|
+
ymax: Math.max(n[1], r[1]),
|
|
39
|
+
x: e === n[1] ? n[0] : r[0],
|
|
40
|
+
islope: (r[0] - n[0]) / (r[1] - n[1])
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (a.sort(((e, t) => e.ymin < t.ymin ? -1 : e.ymin > t.ymin ? 1 : e.x < t.x ? -1 : e.x > t.x ? 1 : e.ymax === t.ymax ? 0 : (e.ymax - t.ymax) / Math.abs(e.ymax - t.ymax))), !a.length) return i;
|
|
45
|
+
let o = [], s = a[0].ymin, c = 0;
|
|
46
|
+
for (; o.length || a.length;) {
|
|
47
|
+
if (a.length) {
|
|
48
|
+
let e = -1;
|
|
49
|
+
for (let t = 0; t < a.length && !(a[t].ymin > s); t++) e = t;
|
|
50
|
+
a.splice(0, e + 1).forEach(((e) => {
|
|
51
|
+
o.push({
|
|
52
|
+
s,
|
|
53
|
+
edge: e
|
|
54
|
+
});
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
if (o = o.filter(((e) => !(e.edge.ymax <= s))), o.sort(((e, t) => e.edge.x === t.edge.x ? 0 : (e.edge.x - t.edge.x) / Math.abs(e.edge.x - t.edge.x))), (n !== 1 || c % t == 0) && o.length > 1) for (let e = 0; e < o.length; e += 2) {
|
|
58
|
+
let t = e + 1;
|
|
59
|
+
if (t >= o.length) break;
|
|
60
|
+
let n = o[e].edge, r = o[t].edge;
|
|
61
|
+
i.push([[Math.round(n.x), s], [Math.round(r.x), s]]);
|
|
62
|
+
}
|
|
63
|
+
s += n, o.forEach(((e) => {
|
|
64
|
+
e.edge.x = e.edge.x + n * e.edge.islope;
|
|
65
|
+
})), c++;
|
|
66
|
+
}
|
|
67
|
+
return i;
|
|
68
|
+
}(o, a, r);
|
|
69
|
+
if (i) {
|
|
70
|
+
for (let e of o) w(e, s, -i);
|
|
71
|
+
(function(e, t, n) {
|
|
72
|
+
let r = [];
|
|
73
|
+
e.forEach(((e) => r.push(...e))), w(r, t, n);
|
|
74
|
+
})(c, s, -i);
|
|
75
|
+
}
|
|
76
|
+
return c;
|
|
77
|
+
}
|
|
78
|
+
function D(e, t) {
|
|
79
|
+
let n = t.hachureAngle + 90, r = t.hachureGap;
|
|
80
|
+
r < 0 && (r = 4 * t.strokeWidth), r = Math.round(Math.max(r, .1));
|
|
81
|
+
let i = 1;
|
|
82
|
+
return t.roughness >= 1 && (t.randomizer?.next() || Math.random()) > .7 && (i = r), E(e, r, n, i || 1);
|
|
83
|
+
}
|
|
84
|
+
var O = class {
|
|
85
|
+
constructor(e) {
|
|
86
|
+
this.helper = e;
|
|
87
|
+
}
|
|
88
|
+
fillPolygons(e, t) {
|
|
89
|
+
return this._fillPolygons(e, t);
|
|
90
|
+
}
|
|
91
|
+
_fillPolygons(e, t) {
|
|
92
|
+
let n = D(e, t);
|
|
93
|
+
return {
|
|
94
|
+
type: "fillSketch",
|
|
95
|
+
ops: this.renderLines(n, t)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
renderLines(e, t) {
|
|
99
|
+
let n = [];
|
|
100
|
+
for (let r of e) n.push(...this.helper.doubleLineOps(r[0][0], r[0][1], r[1][0], r[1][1], t));
|
|
101
|
+
return n;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
function k(e) {
|
|
105
|
+
let t = e[0], n = e[1];
|
|
106
|
+
return Math.sqrt((t[0] - n[0]) ** 2 + (t[1] - n[1]) ** 2);
|
|
107
|
+
}
|
|
108
|
+
var A = class extends O {
|
|
109
|
+
fillPolygons(e, t) {
|
|
110
|
+
let n = t.hachureGap;
|
|
111
|
+
n < 0 && (n = 4 * t.strokeWidth), n = Math.max(n, .1);
|
|
112
|
+
let r = D(e, Object.assign({}, t, { hachureGap: n })), i = Math.PI / 180 * t.hachureAngle, a = [], o = .5 * n * Math.cos(i), s = .5 * n * Math.sin(i);
|
|
113
|
+
for (let [e, t] of r) k([e, t]) && a.push([[e[0] - o, e[1] + s], [...t]], [[e[0] + o, e[1] - s], [...t]]);
|
|
114
|
+
return {
|
|
115
|
+
type: "fillSketch",
|
|
116
|
+
ops: this.renderLines(a, t)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}, j = class extends O {
|
|
120
|
+
fillPolygons(e, t) {
|
|
121
|
+
let n = this._fillPolygons(e, t), r = Object.assign({}, t, { hachureAngle: t.hachureAngle + 90 }), i = this._fillPolygons(e, r);
|
|
122
|
+
return n.ops = n.ops.concat(i.ops), n;
|
|
123
|
+
}
|
|
124
|
+
}, M = class {
|
|
125
|
+
constructor(e) {
|
|
126
|
+
this.helper = e;
|
|
127
|
+
}
|
|
128
|
+
fillPolygons(e, t) {
|
|
129
|
+
let n = D(e, t = Object.assign({}, t, { hachureAngle: 0 }));
|
|
130
|
+
return this.dotsOnLines(n, t);
|
|
131
|
+
}
|
|
132
|
+
dotsOnLines(e, t) {
|
|
133
|
+
let n = [], r = t.hachureGap;
|
|
134
|
+
r < 0 && (r = 4 * t.strokeWidth), r = Math.max(r, .1);
|
|
135
|
+
let i = t.fillWeight;
|
|
136
|
+
i < 0 && (i = t.strokeWidth / 2);
|
|
137
|
+
let a = r / 4;
|
|
138
|
+
for (let o of e) {
|
|
139
|
+
let e = k(o), s = e / r, c = Math.ceil(s) - 1, l = e - c * r, u = (o[0][0] + o[1][0]) / 2 - r / 4, d = Math.min(o[0][1], o[1][1]);
|
|
140
|
+
for (let e = 0; e < c; e++) {
|
|
141
|
+
let o = d + l + e * r, s = u - a + 2 * Math.random() * a, c = o - a + 2 * Math.random() * a, f = this.helper.ellipse(s, c, i, i, t);
|
|
142
|
+
n.push(...f.ops);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
type: "fillSketch",
|
|
147
|
+
ops: n
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}, N = class {
|
|
151
|
+
constructor(e) {
|
|
152
|
+
this.helper = e;
|
|
153
|
+
}
|
|
154
|
+
fillPolygons(e, t) {
|
|
155
|
+
let n = D(e, t);
|
|
156
|
+
return {
|
|
157
|
+
type: "fillSketch",
|
|
158
|
+
ops: this.dashedLine(n, t)
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
dashedLine(e, t) {
|
|
162
|
+
let n = t.dashOffset < 0 ? t.hachureGap < 0 ? 4 * t.strokeWidth : t.hachureGap : t.dashOffset, r = t.dashGap < 0 ? t.hachureGap < 0 ? 4 * t.strokeWidth : t.hachureGap : t.dashGap, i = [];
|
|
163
|
+
return e.forEach(((e) => {
|
|
164
|
+
let a = k(e), o = Math.floor(a / (n + r)), s = (a + r - o * (n + r)) / 2, c = e[0], l = e[1];
|
|
165
|
+
c[0] > l[0] && (c = e[1], l = e[0]);
|
|
166
|
+
let u = Math.atan((l[1] - c[1]) / (l[0] - c[0]));
|
|
167
|
+
for (let e = 0; e < o; e++) {
|
|
168
|
+
let a = e * (n + r), o = a + n, l = [c[0] + a * Math.cos(u) + s * Math.cos(u), c[1] + a * Math.sin(u) + s * Math.sin(u)], d = [c[0] + o * Math.cos(u) + s * Math.cos(u), c[1] + o * Math.sin(u) + s * Math.sin(u)];
|
|
169
|
+
i.push(...this.helper.doubleLineOps(l[0], l[1], d[0], d[1], t));
|
|
170
|
+
}
|
|
171
|
+
})), i;
|
|
172
|
+
}
|
|
173
|
+
}, P = class {
|
|
174
|
+
constructor(e) {
|
|
175
|
+
this.helper = e;
|
|
176
|
+
}
|
|
177
|
+
fillPolygons(e, t) {
|
|
178
|
+
let n = t.hachureGap < 0 ? 4 * t.strokeWidth : t.hachureGap, r = t.zigzagOffset < 0 ? n : t.zigzagOffset, i = D(e, t = Object.assign({}, t, { hachureGap: n + r }));
|
|
179
|
+
return {
|
|
180
|
+
type: "fillSketch",
|
|
181
|
+
ops: this.zigzagLines(i, r, t)
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
zigzagLines(e, t, n) {
|
|
185
|
+
let r = [];
|
|
186
|
+
return e.forEach(((e) => {
|
|
187
|
+
let i = k(e), a = Math.round(i / (2 * t)), o = e[0], s = e[1];
|
|
188
|
+
o[0] > s[0] && (o = e[1], s = e[0]);
|
|
189
|
+
let c = Math.atan((s[1] - o[1]) / (s[0] - o[0]));
|
|
190
|
+
for (let e = 0; e < a; e++) {
|
|
191
|
+
let i = 2 * e * t, a = 2 * (e + 1) * t, s = Math.sqrt(2 * t ** 2), l = [o[0] + i * Math.cos(c), o[1] + i * Math.sin(c)], u = [o[0] + a * Math.cos(c), o[1] + a * Math.sin(c)], d = [l[0] + s * Math.cos(c + Math.PI / 4), l[1] + s * Math.sin(c + Math.PI / 4)];
|
|
192
|
+
r.push(...this.helper.doubleLineOps(l[0], l[1], d[0], d[1], n), ...this.helper.doubleLineOps(d[0], d[1], u[0], u[1], n));
|
|
193
|
+
}
|
|
194
|
+
})), r;
|
|
195
|
+
}
|
|
196
|
+
}, F = {}, I = class {
|
|
197
|
+
constructor(e) {
|
|
198
|
+
this.seed = e;
|
|
199
|
+
}
|
|
200
|
+
next() {
|
|
201
|
+
return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
|
|
202
|
+
}
|
|
203
|
+
}, ee = 0, te = 1, ne = 2, re = {
|
|
204
|
+
A: 7,
|
|
205
|
+
a: 7,
|
|
206
|
+
C: 6,
|
|
207
|
+
c: 6,
|
|
208
|
+
H: 1,
|
|
209
|
+
h: 1,
|
|
210
|
+
L: 2,
|
|
211
|
+
l: 2,
|
|
212
|
+
M: 2,
|
|
213
|
+
m: 2,
|
|
214
|
+
Q: 4,
|
|
215
|
+
q: 4,
|
|
216
|
+
S: 4,
|
|
217
|
+
s: 4,
|
|
218
|
+
T: 2,
|
|
219
|
+
t: 2,
|
|
220
|
+
V: 1,
|
|
221
|
+
v: 1,
|
|
222
|
+
Z: 0,
|
|
223
|
+
z: 0
|
|
224
|
+
};
|
|
225
|
+
function ie(e, t) {
|
|
226
|
+
return e.type === t;
|
|
227
|
+
}
|
|
228
|
+
function ae(e) {
|
|
229
|
+
let t = [], n = function(e) {
|
|
230
|
+
let t = [];
|
|
231
|
+
for (; e !== "";) if (e.match(/^([ \t\r\n,]+)/)) e = e.substr(RegExp.$1.length);
|
|
232
|
+
else if (e.match(/^([aAcChHlLmMqQsStTvVzZ])/)) t[t.length] = {
|
|
233
|
+
type: ee,
|
|
234
|
+
text: RegExp.$1
|
|
235
|
+
}, e = e.substr(RegExp.$1.length);
|
|
236
|
+
else {
|
|
237
|
+
if (!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return [];
|
|
238
|
+
t[t.length] = {
|
|
239
|
+
type: te,
|
|
240
|
+
text: `${parseFloat(RegExp.$1)}`
|
|
241
|
+
}, e = e.substr(RegExp.$1.length);
|
|
242
|
+
}
|
|
243
|
+
return t[t.length] = {
|
|
244
|
+
type: ne,
|
|
245
|
+
text: ""
|
|
246
|
+
}, t;
|
|
247
|
+
}(e), r = "BOD", i = 0, a = n[i];
|
|
248
|
+
for (; !ie(a, ne);) {
|
|
249
|
+
let o = 0, s = [];
|
|
250
|
+
if (r === "BOD") {
|
|
251
|
+
if (a.text !== "M" && a.text !== "m") return ae("M0,0" + e);
|
|
252
|
+
i++, o = re[a.text], r = a.text;
|
|
253
|
+
} else ie(a, te) ? o = re[r] : (i++, o = re[a.text], r = a.text);
|
|
254
|
+
if (!(i + o < n.length)) throw Error("Path data ended short");
|
|
255
|
+
for (let e = i; e < i + o; e++) {
|
|
256
|
+
let t = n[e];
|
|
257
|
+
if (!ie(t, te)) throw Error("Param not a number: " + r + "," + t.text);
|
|
258
|
+
s[s.length] = +t.text;
|
|
259
|
+
}
|
|
260
|
+
if (typeof re[r] != "number") throw Error("Bad segment: " + r);
|
|
261
|
+
{
|
|
262
|
+
let e = {
|
|
263
|
+
key: r,
|
|
264
|
+
data: s
|
|
265
|
+
};
|
|
266
|
+
t.push(e), i += o, a = n[i], r === "M" && (r = "L"), r === "m" && (r = "l");
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return t;
|
|
270
|
+
}
|
|
271
|
+
function L(e) {
|
|
272
|
+
let t = 0, n = 0, r = 0, i = 0, a = [];
|
|
273
|
+
for (let { key: o, data: s } of e) switch (o) {
|
|
274
|
+
case "M":
|
|
275
|
+
a.push({
|
|
276
|
+
key: "M",
|
|
277
|
+
data: [...s]
|
|
278
|
+
}), [t, n] = s, [r, i] = s;
|
|
279
|
+
break;
|
|
280
|
+
case "m":
|
|
281
|
+
t += s[0], n += s[1], a.push({
|
|
282
|
+
key: "M",
|
|
283
|
+
data: [t, n]
|
|
284
|
+
}), r = t, i = n;
|
|
285
|
+
break;
|
|
286
|
+
case "L":
|
|
287
|
+
a.push({
|
|
288
|
+
key: "L",
|
|
289
|
+
data: [...s]
|
|
290
|
+
}), [t, n] = s;
|
|
291
|
+
break;
|
|
292
|
+
case "l":
|
|
293
|
+
t += s[0], n += s[1], a.push({
|
|
294
|
+
key: "L",
|
|
295
|
+
data: [t, n]
|
|
296
|
+
});
|
|
297
|
+
break;
|
|
298
|
+
case "C":
|
|
299
|
+
a.push({
|
|
300
|
+
key: "C",
|
|
301
|
+
data: [...s]
|
|
302
|
+
}), t = s[4], n = s[5];
|
|
303
|
+
break;
|
|
304
|
+
case "c": {
|
|
305
|
+
let e = s.map(((e, r) => r % 2 ? e + n : e + t));
|
|
306
|
+
a.push({
|
|
307
|
+
key: "C",
|
|
308
|
+
data: e
|
|
309
|
+
}), t = e[4], n = e[5];
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
case "Q":
|
|
313
|
+
a.push({
|
|
314
|
+
key: "Q",
|
|
315
|
+
data: [...s]
|
|
316
|
+
}), t = s[2], n = s[3];
|
|
317
|
+
break;
|
|
318
|
+
case "q": {
|
|
319
|
+
let e = s.map(((e, r) => r % 2 ? e + n : e + t));
|
|
320
|
+
a.push({
|
|
321
|
+
key: "Q",
|
|
322
|
+
data: e
|
|
323
|
+
}), t = e[2], n = e[3];
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
case "A":
|
|
327
|
+
a.push({
|
|
328
|
+
key: "A",
|
|
329
|
+
data: [...s]
|
|
330
|
+
}), t = s[5], n = s[6];
|
|
331
|
+
break;
|
|
332
|
+
case "a":
|
|
333
|
+
t += s[5], n += s[6], a.push({
|
|
334
|
+
key: "A",
|
|
335
|
+
data: [
|
|
336
|
+
s[0],
|
|
337
|
+
s[1],
|
|
338
|
+
s[2],
|
|
339
|
+
s[3],
|
|
340
|
+
s[4],
|
|
341
|
+
t,
|
|
342
|
+
n
|
|
343
|
+
]
|
|
344
|
+
});
|
|
345
|
+
break;
|
|
346
|
+
case "H":
|
|
347
|
+
a.push({
|
|
348
|
+
key: "H",
|
|
349
|
+
data: [...s]
|
|
350
|
+
}), t = s[0];
|
|
351
|
+
break;
|
|
352
|
+
case "h":
|
|
353
|
+
t += s[0], a.push({
|
|
354
|
+
key: "H",
|
|
355
|
+
data: [t]
|
|
356
|
+
});
|
|
357
|
+
break;
|
|
358
|
+
case "V":
|
|
359
|
+
a.push({
|
|
360
|
+
key: "V",
|
|
361
|
+
data: [...s]
|
|
362
|
+
}), n = s[0];
|
|
363
|
+
break;
|
|
364
|
+
case "v":
|
|
365
|
+
n += s[0], a.push({
|
|
366
|
+
key: "V",
|
|
367
|
+
data: [n]
|
|
368
|
+
});
|
|
369
|
+
break;
|
|
370
|
+
case "S":
|
|
371
|
+
a.push({
|
|
372
|
+
key: "S",
|
|
373
|
+
data: [...s]
|
|
374
|
+
}), t = s[2], n = s[3];
|
|
375
|
+
break;
|
|
376
|
+
case "s": {
|
|
377
|
+
let e = s.map(((e, r) => r % 2 ? e + n : e + t));
|
|
378
|
+
a.push({
|
|
379
|
+
key: "S",
|
|
380
|
+
data: e
|
|
381
|
+
}), t = e[2], n = e[3];
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
case "T":
|
|
385
|
+
a.push({
|
|
386
|
+
key: "T",
|
|
387
|
+
data: [...s]
|
|
388
|
+
}), t = s[0], n = s[1];
|
|
389
|
+
break;
|
|
390
|
+
case "t":
|
|
391
|
+
t += s[0], n += s[1], a.push({
|
|
392
|
+
key: "T",
|
|
393
|
+
data: [t, n]
|
|
394
|
+
});
|
|
395
|
+
break;
|
|
396
|
+
case "Z":
|
|
397
|
+
case "z": a.push({
|
|
398
|
+
key: "Z",
|
|
399
|
+
data: []
|
|
400
|
+
}), t = r, n = i;
|
|
401
|
+
}
|
|
402
|
+
return a;
|
|
403
|
+
}
|
|
404
|
+
function oe(e) {
|
|
405
|
+
let t = [], n = "", r = 0, i = 0, a = 0, o = 0, s = 0, c = 0;
|
|
406
|
+
for (let { key: l, data: u } of e) {
|
|
407
|
+
switch (l) {
|
|
408
|
+
case "M":
|
|
409
|
+
t.push({
|
|
410
|
+
key: "M",
|
|
411
|
+
data: [...u]
|
|
412
|
+
}), [r, i] = u, [a, o] = u;
|
|
413
|
+
break;
|
|
414
|
+
case "C":
|
|
415
|
+
t.push({
|
|
416
|
+
key: "C",
|
|
417
|
+
data: [...u]
|
|
418
|
+
}), r = u[4], i = u[5], s = u[2], c = u[3];
|
|
419
|
+
break;
|
|
420
|
+
case "L":
|
|
421
|
+
t.push({
|
|
422
|
+
key: "L",
|
|
423
|
+
data: [...u]
|
|
424
|
+
}), [r, i] = u;
|
|
425
|
+
break;
|
|
426
|
+
case "H":
|
|
427
|
+
r = u[0], t.push({
|
|
428
|
+
key: "L",
|
|
429
|
+
data: [r, i]
|
|
430
|
+
});
|
|
431
|
+
break;
|
|
432
|
+
case "V":
|
|
433
|
+
i = u[0], t.push({
|
|
434
|
+
key: "L",
|
|
435
|
+
data: [r, i]
|
|
436
|
+
});
|
|
437
|
+
break;
|
|
438
|
+
case "S": {
|
|
439
|
+
let e = 0, a = 0;
|
|
440
|
+
n === "C" || n === "S" ? (e = r + (r - s), a = i + (i - c)) : (e = r, a = i), t.push({
|
|
441
|
+
key: "C",
|
|
442
|
+
data: [
|
|
443
|
+
e,
|
|
444
|
+
a,
|
|
445
|
+
...u
|
|
446
|
+
]
|
|
447
|
+
}), s = u[0], c = u[1], r = u[2], i = u[3];
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
case "T": {
|
|
451
|
+
let [e, a] = u, o = 0, l = 0;
|
|
452
|
+
n === "Q" || n === "T" ? (o = r + (r - s), l = i + (i - c)) : (o = r, l = i);
|
|
453
|
+
let d = r + 2 * (o - r) / 3, f = i + 2 * (l - i) / 3, p = e + 2 * (o - e) / 3, m = a + 2 * (l - a) / 3;
|
|
454
|
+
t.push({
|
|
455
|
+
key: "C",
|
|
456
|
+
data: [
|
|
457
|
+
d,
|
|
458
|
+
f,
|
|
459
|
+
p,
|
|
460
|
+
m,
|
|
461
|
+
e,
|
|
462
|
+
a
|
|
463
|
+
]
|
|
464
|
+
}), s = o, c = l, r = e, i = a;
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
case "Q": {
|
|
468
|
+
let [e, n, a, o] = u, l = r + 2 * (e - r) / 3, d = i + 2 * (n - i) / 3, f = a + 2 * (e - a) / 3, p = o + 2 * (n - o) / 3;
|
|
469
|
+
t.push({
|
|
470
|
+
key: "C",
|
|
471
|
+
data: [
|
|
472
|
+
l,
|
|
473
|
+
d,
|
|
474
|
+
f,
|
|
475
|
+
p,
|
|
476
|
+
a,
|
|
477
|
+
o
|
|
478
|
+
]
|
|
479
|
+
}), s = e, c = n, r = a, i = o;
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
case "A": {
|
|
483
|
+
let e = Math.abs(u[0]), n = Math.abs(u[1]), a = u[2], o = u[3], s = u[4], c = u[5], l = u[6];
|
|
484
|
+
e === 0 || n === 0 ? (t.push({
|
|
485
|
+
key: "C",
|
|
486
|
+
data: [
|
|
487
|
+
r,
|
|
488
|
+
i,
|
|
489
|
+
c,
|
|
490
|
+
l,
|
|
491
|
+
c,
|
|
492
|
+
l
|
|
493
|
+
]
|
|
494
|
+
}), r = c, i = l) : (r !== c || i !== l) && (ce(r, i, c, l, e, n, a, o, s).forEach((function(e) {
|
|
495
|
+
t.push({
|
|
496
|
+
key: "C",
|
|
497
|
+
data: e
|
|
498
|
+
});
|
|
499
|
+
})), r = c, i = l);
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
case "Z": t.push({
|
|
503
|
+
key: "Z",
|
|
504
|
+
data: []
|
|
505
|
+
}), r = a, i = o;
|
|
506
|
+
}
|
|
507
|
+
n = l;
|
|
508
|
+
}
|
|
509
|
+
return t;
|
|
510
|
+
}
|
|
511
|
+
function se(e, t, n) {
|
|
512
|
+
return [e * Math.cos(n) - t * Math.sin(n), e * Math.sin(n) + t * Math.cos(n)];
|
|
513
|
+
}
|
|
514
|
+
function ce(e, t, n, r, i, a, o, s, c, l) {
|
|
515
|
+
let u = (d = o, Math.PI * d / 180);
|
|
516
|
+
var d;
|
|
517
|
+
let f = [], p = 0, m = 0, h = 0, g = 0;
|
|
518
|
+
if (l) [p, m, h, g] = l;
|
|
519
|
+
else {
|
|
520
|
+
[e, t] = se(e, t, -u), [n, r] = se(n, r, -u);
|
|
521
|
+
let o = (e - n) / 2, l = (t - r) / 2, d = o * o / (i * i) + l * l / (a * a);
|
|
522
|
+
d > 1 && (d = Math.sqrt(d), i *= d, a *= d);
|
|
523
|
+
let f = i * i, _ = a * a, v = f * _ - f * l * l - _ * o * o, y = f * l * l + _ * o * o, b = (s === c ? -1 : 1) * Math.sqrt(Math.abs(v / y));
|
|
524
|
+
h = b * i * l / a + (e + n) / 2, g = b * -a * o / i + (t + r) / 2, p = Math.asin(parseFloat(((t - g) / a).toFixed(9))), m = Math.asin(parseFloat(((r - g) / a).toFixed(9))), e < h && (p = Math.PI - p), n < h && (m = Math.PI - m), p < 0 && (p = 2 * Math.PI + p), m < 0 && (m = 2 * Math.PI + m), c && p > m && (p -= 2 * Math.PI), !c && m > p && (m -= 2 * Math.PI);
|
|
525
|
+
}
|
|
526
|
+
let _ = m - p;
|
|
527
|
+
if (Math.abs(_) > 120 * Math.PI / 180) {
|
|
528
|
+
let e = m, t = n, s = r;
|
|
529
|
+
m = c && m > p ? p + 120 * Math.PI / 180 * 1 : p + 120 * Math.PI / 180 * -1, f = ce(n = h + i * Math.cos(m), r = g + a * Math.sin(m), t, s, i, a, o, 0, c, [
|
|
530
|
+
m,
|
|
531
|
+
e,
|
|
532
|
+
h,
|
|
533
|
+
g
|
|
534
|
+
]);
|
|
535
|
+
}
|
|
536
|
+
_ = m - p;
|
|
537
|
+
let v = Math.cos(p), y = Math.sin(p), b = Math.cos(m), x = Math.sin(m), S = Math.tan(_ / 4), C = 4 / 3 * i * S, w = 4 / 3 * a * S, T = [e, t], E = [e + C * y, t - w * v], D = [n + C * x, r - w * b], O = [n, r];
|
|
538
|
+
if (E[0] = 2 * T[0] - E[0], E[1] = 2 * T[1] - E[1], l) return [
|
|
539
|
+
E,
|
|
540
|
+
D,
|
|
541
|
+
O
|
|
542
|
+
].concat(f);
|
|
543
|
+
{
|
|
544
|
+
f = [
|
|
545
|
+
E,
|
|
546
|
+
D,
|
|
547
|
+
O
|
|
548
|
+
].concat(f);
|
|
549
|
+
let e = [];
|
|
550
|
+
for (let t = 0; t < f.length; t += 3) {
|
|
551
|
+
let n = se(f[t][0], f[t][1], u), r = se(f[t + 1][0], f[t + 1][1], u), i = se(f[t + 2][0], f[t + 2][1], u);
|
|
552
|
+
e.push([
|
|
553
|
+
n[0],
|
|
554
|
+
n[1],
|
|
555
|
+
r[0],
|
|
556
|
+
r[1],
|
|
557
|
+
i[0],
|
|
558
|
+
i[1]
|
|
559
|
+
]);
|
|
560
|
+
}
|
|
561
|
+
return e;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
var le = {
|
|
565
|
+
randOffset: function(e, t) {
|
|
566
|
+
return R(e, t);
|
|
567
|
+
},
|
|
568
|
+
randOffsetWithRange: function(e, t, n) {
|
|
569
|
+
return Se(e, t, n);
|
|
570
|
+
},
|
|
571
|
+
ellipse: function(e, t, n, r, i) {
|
|
572
|
+
return he(e, t, i, me(n, r, i)).opset;
|
|
573
|
+
},
|
|
574
|
+
doubleLineOps: function(e, t, n, r, i) {
|
|
575
|
+
return z(e, t, n, r, i, !0);
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
function ue(e, t, n, r, i) {
|
|
579
|
+
return {
|
|
580
|
+
type: "path",
|
|
581
|
+
ops: z(e, t, n, r, i)
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
function de(e, t, n) {
|
|
585
|
+
let r = (e || []).length;
|
|
586
|
+
if (r > 2) {
|
|
587
|
+
let i = [];
|
|
588
|
+
for (let t = 0; t < r - 1; t++) i.push(...z(e[t][0], e[t][1], e[t + 1][0], e[t + 1][1], n));
|
|
589
|
+
return t && i.push(...z(e[r - 1][0], e[r - 1][1], e[0][0], e[0][1], n)), {
|
|
590
|
+
type: "path",
|
|
591
|
+
ops: i
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
return r === 2 ? ue(e[0][0], e[0][1], e[1][0], e[1][1], n) : {
|
|
595
|
+
type: "path",
|
|
596
|
+
ops: []
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
function fe(e, t, n, r, i) {
|
|
600
|
+
return function(e, t) {
|
|
601
|
+
return de(e, !0, t);
|
|
602
|
+
}([
|
|
603
|
+
[e, t],
|
|
604
|
+
[e + n, t],
|
|
605
|
+
[e + n, t + r],
|
|
606
|
+
[e, t + r]
|
|
607
|
+
], i);
|
|
608
|
+
}
|
|
609
|
+
function pe(e, t) {
|
|
610
|
+
if (e.length) {
|
|
611
|
+
let n = typeof e[0][0] == "number" ? [e] : e, r = we(n[0], 1 * (1 + .2 * t.roughness), t), i = t.disableMultiStroke ? [] : we(n[0], 1.5 * (1 + .22 * t.roughness), be(t));
|
|
612
|
+
for (let e = 1; e < n.length; e++) {
|
|
613
|
+
let a = n[e];
|
|
614
|
+
if (a.length) {
|
|
615
|
+
let e = we(a, 1 * (1 + .2 * t.roughness), t), n = t.disableMultiStroke ? [] : we(a, 1.5 * (1 + .22 * t.roughness), be(t));
|
|
616
|
+
for (let t of e) t.op !== "move" && r.push(t);
|
|
617
|
+
for (let e of n) e.op !== "move" && i.push(e);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return {
|
|
621
|
+
type: "path",
|
|
622
|
+
ops: r.concat(i)
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
return {
|
|
626
|
+
type: "path",
|
|
627
|
+
ops: []
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
function me(e, t, n) {
|
|
631
|
+
let r = Math.sqrt(2 * Math.PI * Math.sqrt(((e / 2) ** 2 + (t / 2) ** 2) / 2)), i = Math.ceil(Math.max(n.curveStepCount, n.curveStepCount / Math.sqrt(200) * r)), a = 2 * Math.PI / i, o = Math.abs(e / 2), s = Math.abs(t / 2), c = 1 - n.curveFitting;
|
|
632
|
+
return o += R(o * c, n), s += R(s * c, n), {
|
|
633
|
+
increment: a,
|
|
634
|
+
rx: o,
|
|
635
|
+
ry: s
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
function he(e, t, n, r) {
|
|
639
|
+
let [i, a] = Ee(r.increment, e, t, r.rx, r.ry, 1, r.increment * Se(.1, Se(.4, 1, n), n), n), o = Te(i, null, n);
|
|
640
|
+
if (!n.disableMultiStroke && n.roughness !== 0) {
|
|
641
|
+
let [i] = Ee(r.increment, e, t, r.rx, r.ry, 1.5, 0, n), a = Te(i, null, n);
|
|
642
|
+
o = o.concat(a);
|
|
643
|
+
}
|
|
644
|
+
return {
|
|
645
|
+
estimatedPoints: a,
|
|
646
|
+
opset: {
|
|
647
|
+
type: "path",
|
|
648
|
+
ops: o
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
function ge(e, t, n, r, i, a, o, s, c) {
|
|
653
|
+
let l = e, u = t, d = Math.abs(n / 2), f = Math.abs(r / 2);
|
|
654
|
+
d += R(.01 * d, c), f += R(.01 * f, c);
|
|
655
|
+
let p = i, m = a;
|
|
656
|
+
for (; p < 0;) p += 2 * Math.PI, m += 2 * Math.PI;
|
|
657
|
+
m - p > 2 * Math.PI && (p = 0, m = 2 * Math.PI);
|
|
658
|
+
let h = 2 * Math.PI / c.curveStepCount, g = Math.min(h / 2, (m - p) / 2), _ = De(g, l, u, d, f, p, m, 1, c);
|
|
659
|
+
if (!c.disableMultiStroke) {
|
|
660
|
+
let e = De(g, l, u, d, f, p, m, 1.5, c);
|
|
661
|
+
_.push(...e);
|
|
662
|
+
}
|
|
663
|
+
return o && (s ? _.push(...z(l, u, l + d * Math.cos(p), u + f * Math.sin(p), c), ...z(l, u, l + d * Math.cos(m), u + f * Math.sin(m), c)) : _.push({
|
|
664
|
+
op: "lineTo",
|
|
665
|
+
data: [l, u]
|
|
666
|
+
}, {
|
|
667
|
+
op: "lineTo",
|
|
668
|
+
data: [l + d * Math.cos(p), u + f * Math.sin(p)]
|
|
669
|
+
})), {
|
|
670
|
+
type: "path",
|
|
671
|
+
ops: _
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
function _e(e, t) {
|
|
675
|
+
let n = oe(L(ae(e))), r = [], i = [0, 0], a = [0, 0];
|
|
676
|
+
for (let { key: e, data: o } of n) switch (e) {
|
|
677
|
+
case "M":
|
|
678
|
+
a = [o[0], o[1]], i = [o[0], o[1]];
|
|
679
|
+
break;
|
|
680
|
+
case "L":
|
|
681
|
+
r.push(...z(a[0], a[1], o[0], o[1], t)), a = [o[0], o[1]];
|
|
682
|
+
break;
|
|
683
|
+
case "C": {
|
|
684
|
+
let [e, n, i, s, c, l] = o;
|
|
685
|
+
r.push(...Oe(e, n, i, s, c, l, a, t)), a = [c, l];
|
|
686
|
+
break;
|
|
687
|
+
}
|
|
688
|
+
case "Z": r.push(...z(a[0], a[1], i[0], i[1], t)), a = [i[0], i[1]];
|
|
689
|
+
}
|
|
690
|
+
return {
|
|
691
|
+
type: "path",
|
|
692
|
+
ops: r
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
function ve(e, t) {
|
|
696
|
+
let n = [];
|
|
697
|
+
for (let r of e) if (r.length) {
|
|
698
|
+
let e = t.maxRandomnessOffset || 0, i = r.length;
|
|
699
|
+
if (i > 2) {
|
|
700
|
+
n.push({
|
|
701
|
+
op: "move",
|
|
702
|
+
data: [r[0][0] + R(e, t), r[0][1] + R(e, t)]
|
|
703
|
+
});
|
|
704
|
+
for (let a = 1; a < i; a++) n.push({
|
|
705
|
+
op: "lineTo",
|
|
706
|
+
data: [r[a][0] + R(e, t), r[a][1] + R(e, t)]
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
return {
|
|
711
|
+
type: "fillPath",
|
|
712
|
+
ops: n
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
function ye(e, t) {
|
|
716
|
+
return function(e, t) {
|
|
717
|
+
let n = e.fillStyle || "hachure";
|
|
718
|
+
if (!F[n]) switch (n) {
|
|
719
|
+
case "zigzag":
|
|
720
|
+
F[n] || (F[n] = new A(t));
|
|
721
|
+
break;
|
|
722
|
+
case "cross-hatch":
|
|
723
|
+
F[n] || (F[n] = new j(t));
|
|
724
|
+
break;
|
|
725
|
+
case "dots":
|
|
726
|
+
F[n] || (F[n] = new M(t));
|
|
727
|
+
break;
|
|
728
|
+
case "dashed":
|
|
729
|
+
F[n] || (F[n] = new N(t));
|
|
730
|
+
break;
|
|
731
|
+
case "zigzag-line":
|
|
732
|
+
F[n] || (F[n] = new P(t));
|
|
733
|
+
break;
|
|
734
|
+
default: n = "hachure", F[n] || (F[n] = new O(t));
|
|
735
|
+
}
|
|
736
|
+
return F[n];
|
|
737
|
+
}(t, le).fillPolygons(e, t);
|
|
738
|
+
}
|
|
739
|
+
function be(e) {
|
|
740
|
+
let t = Object.assign({}, e);
|
|
741
|
+
return t.randomizer = void 0, e.seed && (t.seed = e.seed + 1), t;
|
|
742
|
+
}
|
|
743
|
+
function xe(e) {
|
|
744
|
+
return e.randomizer ||= new I(e.seed || 0), e.randomizer.next();
|
|
745
|
+
}
|
|
746
|
+
function Se(e, t, n, r = 1) {
|
|
747
|
+
return n.roughness * r * (xe(n) * (t - e) + e);
|
|
748
|
+
}
|
|
749
|
+
function R(e, t, n = 1) {
|
|
750
|
+
return Se(-e, e, t, n);
|
|
751
|
+
}
|
|
752
|
+
function z(e, t, n, r, i, a = !1) {
|
|
753
|
+
let o = a ? i.disableMultiStrokeFill : i.disableMultiStroke, s = Ce(e, t, n, r, i, !0, !1);
|
|
754
|
+
if (o) return s;
|
|
755
|
+
let c = Ce(e, t, n, r, i, !0, !0);
|
|
756
|
+
return s.concat(c);
|
|
757
|
+
}
|
|
758
|
+
function Ce(e, t, n, r, i, a, o) {
|
|
759
|
+
let s = (e - n) ** 2 + (t - r) ** 2, c = Math.sqrt(s), l = 1;
|
|
760
|
+
l = c < 200 ? 1 : c > 500 ? .4 : -.0016668 * c + 1.233334;
|
|
761
|
+
let u = i.maxRandomnessOffset || 0;
|
|
762
|
+
u * u * 100 > s && (u = c / 10);
|
|
763
|
+
let d = u / 2, f = .2 + .2 * xe(i), p = i.bowing * i.maxRandomnessOffset * (r - t) / 200, m = i.bowing * i.maxRandomnessOffset * (e - n) / 200;
|
|
764
|
+
p = R(p, i, l), m = R(m, i, l);
|
|
765
|
+
let h = [], g = () => R(d, i, l), _ = () => R(u, i, l), v = i.preserveVertices;
|
|
766
|
+
return a && (o ? h.push({
|
|
767
|
+
op: "move",
|
|
768
|
+
data: [e + (v ? 0 : g()), t + (v ? 0 : g())]
|
|
769
|
+
}) : h.push({
|
|
770
|
+
op: "move",
|
|
771
|
+
data: [e + (v ? 0 : R(u, i, l)), t + (v ? 0 : R(u, i, l))]
|
|
772
|
+
})), o ? h.push({
|
|
773
|
+
op: "bcurveTo",
|
|
774
|
+
data: [
|
|
775
|
+
p + e + (n - e) * f + g(),
|
|
776
|
+
m + t + (r - t) * f + g(),
|
|
777
|
+
p + e + 2 * (n - e) * f + g(),
|
|
778
|
+
m + t + 2 * (r - t) * f + g(),
|
|
779
|
+
n + (v ? 0 : g()),
|
|
780
|
+
r + (v ? 0 : g())
|
|
781
|
+
]
|
|
782
|
+
}) : h.push({
|
|
783
|
+
op: "bcurveTo",
|
|
784
|
+
data: [
|
|
785
|
+
p + e + (n - e) * f + _(),
|
|
786
|
+
m + t + (r - t) * f + _(),
|
|
787
|
+
p + e + 2 * (n - e) * f + _(),
|
|
788
|
+
m + t + 2 * (r - t) * f + _(),
|
|
789
|
+
n + (v ? 0 : _()),
|
|
790
|
+
r + (v ? 0 : _())
|
|
791
|
+
]
|
|
792
|
+
}), h;
|
|
793
|
+
}
|
|
794
|
+
function we(e, t, n) {
|
|
795
|
+
if (!e.length) return [];
|
|
796
|
+
let r = [];
|
|
797
|
+
r.push([e[0][0] + R(t, n), e[0][1] + R(t, n)]), r.push([e[0][0] + R(t, n), e[0][1] + R(t, n)]);
|
|
798
|
+
for (let i = 1; i < e.length; i++) r.push([e[i][0] + R(t, n), e[i][1] + R(t, n)]), i === e.length - 1 && r.push([e[i][0] + R(t, n), e[i][1] + R(t, n)]);
|
|
799
|
+
return Te(r, null, n);
|
|
800
|
+
}
|
|
801
|
+
function Te(e, t, n) {
|
|
802
|
+
let r = e.length, i = [];
|
|
803
|
+
if (r > 3) {
|
|
804
|
+
let a = [], o = 1 - n.curveTightness;
|
|
805
|
+
i.push({
|
|
806
|
+
op: "move",
|
|
807
|
+
data: [e[1][0], e[1][1]]
|
|
808
|
+
});
|
|
809
|
+
for (let t = 1; t + 2 < r; t++) {
|
|
810
|
+
let n = e[t];
|
|
811
|
+
a[0] = [n[0], n[1]], a[1] = [n[0] + (o * e[t + 1][0] - o * e[t - 1][0]) / 6, n[1] + (o * e[t + 1][1] - o * e[t - 1][1]) / 6], a[2] = [e[t + 1][0] + (o * e[t][0] - o * e[t + 2][0]) / 6, e[t + 1][1] + (o * e[t][1] - o * e[t + 2][1]) / 6], a[3] = [e[t + 1][0], e[t + 1][1]], i.push({
|
|
812
|
+
op: "bcurveTo",
|
|
813
|
+
data: [
|
|
814
|
+
a[1][0],
|
|
815
|
+
a[1][1],
|
|
816
|
+
a[2][0],
|
|
817
|
+
a[2][1],
|
|
818
|
+
a[3][0],
|
|
819
|
+
a[3][1]
|
|
820
|
+
]
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
if (t && t.length === 2) {
|
|
824
|
+
let e = n.maxRandomnessOffset;
|
|
825
|
+
i.push({
|
|
826
|
+
op: "lineTo",
|
|
827
|
+
data: [t[0] + R(e, n), t[1] + R(e, n)]
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
} else r === 3 ? (i.push({
|
|
831
|
+
op: "move",
|
|
832
|
+
data: [e[1][0], e[1][1]]
|
|
833
|
+
}), i.push({
|
|
834
|
+
op: "bcurveTo",
|
|
835
|
+
data: [
|
|
836
|
+
e[1][0],
|
|
837
|
+
e[1][1],
|
|
838
|
+
e[2][0],
|
|
839
|
+
e[2][1],
|
|
840
|
+
e[2][0],
|
|
841
|
+
e[2][1]
|
|
842
|
+
]
|
|
843
|
+
})) : r === 2 && i.push(...Ce(e[0][0], e[0][1], e[1][0], e[1][1], n, !0, !0));
|
|
844
|
+
return i;
|
|
845
|
+
}
|
|
846
|
+
function Ee(e, t, n, r, i, a, o, s) {
|
|
847
|
+
let c = [], l = [];
|
|
848
|
+
if (s.roughness === 0) {
|
|
849
|
+
e /= 4, l.push([t + r * Math.cos(-e), n + i * Math.sin(-e)]);
|
|
850
|
+
for (let a = 0; a <= 2 * Math.PI; a += e) {
|
|
851
|
+
let e = [t + r * Math.cos(a), n + i * Math.sin(a)];
|
|
852
|
+
c.push(e), l.push(e);
|
|
853
|
+
}
|
|
854
|
+
l.push([t + r * Math.cos(0), n + i * Math.sin(0)]), l.push([t + r * Math.cos(e), n + i * Math.sin(e)]);
|
|
855
|
+
} else {
|
|
856
|
+
let u = R(.5, s) - Math.PI / 2;
|
|
857
|
+
l.push([R(a, s) + t + .9 * r * Math.cos(u - e), R(a, s) + n + .9 * i * Math.sin(u - e)]);
|
|
858
|
+
let d = 2 * Math.PI + u - .01;
|
|
859
|
+
for (let o = u; o < d; o += e) {
|
|
860
|
+
let e = [R(a, s) + t + r * Math.cos(o), R(a, s) + n + i * Math.sin(o)];
|
|
861
|
+
c.push(e), l.push(e);
|
|
862
|
+
}
|
|
863
|
+
l.push([R(a, s) + t + r * Math.cos(u + 2 * Math.PI + .5 * o), R(a, s) + n + i * Math.sin(u + 2 * Math.PI + .5 * o)]), l.push([R(a, s) + t + .98 * r * Math.cos(u + o), R(a, s) + n + .98 * i * Math.sin(u + o)]), l.push([R(a, s) + t + .9 * r * Math.cos(u + .5 * o), R(a, s) + n + .9 * i * Math.sin(u + .5 * o)]);
|
|
864
|
+
}
|
|
865
|
+
return [l, c];
|
|
866
|
+
}
|
|
867
|
+
function De(e, t, n, r, i, a, o, s, c) {
|
|
868
|
+
let l = a + R(.1, c), u = [];
|
|
869
|
+
u.push([R(s, c) + t + .9 * r * Math.cos(l - e), R(s, c) + n + .9 * i * Math.sin(l - e)]);
|
|
870
|
+
for (let a = l; a <= o; a += e) u.push([R(s, c) + t + r * Math.cos(a), R(s, c) + n + i * Math.sin(a)]);
|
|
871
|
+
return u.push([t + r * Math.cos(o), n + i * Math.sin(o)]), u.push([t + r * Math.cos(o), n + i * Math.sin(o)]), Te(u, null, c);
|
|
872
|
+
}
|
|
873
|
+
function Oe(e, t, n, r, i, a, o, s) {
|
|
874
|
+
let c = [], l = [s.maxRandomnessOffset || 1, (s.maxRandomnessOffset || 1) + .3], u = [0, 0], d = s.disableMultiStroke ? 1 : 2, f = s.preserveVertices;
|
|
875
|
+
for (let p = 0; p < d; p++) p === 0 ? c.push({
|
|
876
|
+
op: "move",
|
|
877
|
+
data: [o[0], o[1]]
|
|
878
|
+
}) : c.push({
|
|
879
|
+
op: "move",
|
|
880
|
+
data: [o[0] + (f ? 0 : R(l[0], s)), o[1] + (f ? 0 : R(l[0], s))]
|
|
881
|
+
}), u = f ? [i, a] : [i + R(l[p], s), a + R(l[p], s)], c.push({
|
|
882
|
+
op: "bcurveTo",
|
|
883
|
+
data: [
|
|
884
|
+
e + R(l[p], s),
|
|
885
|
+
t + R(l[p], s),
|
|
886
|
+
n + R(l[p], s),
|
|
887
|
+
r + R(l[p], s),
|
|
888
|
+
u[0],
|
|
889
|
+
u[1]
|
|
890
|
+
]
|
|
891
|
+
});
|
|
892
|
+
return c;
|
|
893
|
+
}
|
|
894
|
+
function ke(e) {
|
|
895
|
+
return [...e];
|
|
896
|
+
}
|
|
897
|
+
function Ae(e, t = 0) {
|
|
898
|
+
let n = e.length;
|
|
899
|
+
if (n < 3) throw Error("A curve must have at least three points.");
|
|
900
|
+
let r = [];
|
|
901
|
+
if (n === 3) r.push(ke(e[0]), ke(e[1]), ke(e[2]), ke(e[2]));
|
|
902
|
+
else {
|
|
903
|
+
let n = [];
|
|
904
|
+
n.push(e[0], e[0]);
|
|
905
|
+
for (let t = 1; t < e.length; t++) n.push(e[t]), t === e.length - 1 && n.push(e[t]);
|
|
906
|
+
let i = [], a = 1 - t;
|
|
907
|
+
r.push(ke(n[0]));
|
|
908
|
+
for (let e = 1; e + 2 < n.length; e++) {
|
|
909
|
+
let t = n[e];
|
|
910
|
+
i[0] = [t[0], t[1]], i[1] = [t[0] + (a * n[e + 1][0] - a * n[e - 1][0]) / 6, t[1] + (a * n[e + 1][1] - a * n[e - 1][1]) / 6], i[2] = [n[e + 1][0] + (a * n[e][0] - a * n[e + 2][0]) / 6, n[e + 1][1] + (a * n[e][1] - a * n[e + 2][1]) / 6], i[3] = [n[e + 1][0], n[e + 1][1]], r.push(i[1], i[2], i[3]);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
return r;
|
|
914
|
+
}
|
|
915
|
+
function je(e, t) {
|
|
916
|
+
return (e[0] - t[0]) ** 2 + (e[1] - t[1]) ** 2;
|
|
917
|
+
}
|
|
918
|
+
function Me(e, t, n) {
|
|
919
|
+
let r = je(t, n);
|
|
920
|
+
if (r === 0) return je(e, t);
|
|
921
|
+
let i = ((e[0] - t[0]) * (n[0] - t[0]) + (e[1] - t[1]) * (n[1] - t[1])) / r;
|
|
922
|
+
return i = Math.max(0, Math.min(1, i)), je(e, Ne(t, n, i));
|
|
923
|
+
}
|
|
924
|
+
function Ne(e, t, n) {
|
|
925
|
+
return [e[0] + (t[0] - e[0]) * n, e[1] + (t[1] - e[1]) * n];
|
|
926
|
+
}
|
|
927
|
+
function Pe(e, t, n, r) {
|
|
928
|
+
let i = r || [];
|
|
929
|
+
if (function(e, t) {
|
|
930
|
+
let n = e[t + 0], r = e[t + 1], i = e[t + 2], a = e[t + 3], o = 3 * r[0] - 2 * n[0] - a[0];
|
|
931
|
+
o *= o;
|
|
932
|
+
let s = 3 * r[1] - 2 * n[1] - a[1];
|
|
933
|
+
s *= s;
|
|
934
|
+
let c = 3 * i[0] - 2 * a[0] - n[0];
|
|
935
|
+
c *= c;
|
|
936
|
+
let l = 3 * i[1] - 2 * a[1] - n[1];
|
|
937
|
+
return l *= l, o < c && (o = c), s < l && (s = l), o + s;
|
|
938
|
+
}(e, t) < n) {
|
|
939
|
+
let n = e[t + 0];
|
|
940
|
+
i.length ? (a = i[i.length - 1], o = n, Math.sqrt(je(a, o))) > 1 && i.push(n) : i.push(n), i.push(e[t + 3]);
|
|
941
|
+
} else {
|
|
942
|
+
let r = .5, a = e[t + 0], o = e[t + 1], s = e[t + 2], c = e[t + 3], l = Ne(a, o, r), u = Ne(o, s, r), d = Ne(s, c, r), f = Ne(l, u, r), p = Ne(u, d, r), m = Ne(f, p, r);
|
|
943
|
+
Pe([
|
|
944
|
+
a,
|
|
945
|
+
l,
|
|
946
|
+
f,
|
|
947
|
+
m
|
|
948
|
+
], 0, n, i), Pe([
|
|
949
|
+
m,
|
|
950
|
+
p,
|
|
951
|
+
d,
|
|
952
|
+
c
|
|
953
|
+
], 0, n, i);
|
|
954
|
+
}
|
|
955
|
+
var a, o;
|
|
956
|
+
return i;
|
|
957
|
+
}
|
|
958
|
+
function Fe(e, t) {
|
|
959
|
+
return Ie(e, 0, e.length, t);
|
|
960
|
+
}
|
|
961
|
+
function Ie(e, t, n, r, i) {
|
|
962
|
+
let a = i || [], o = e[t], s = e[n - 1], c = 0, l = 1;
|
|
963
|
+
for (let r = t + 1; r < n - 1; ++r) {
|
|
964
|
+
let t = Me(e[r], o, s);
|
|
965
|
+
t > c && (c = t, l = r);
|
|
966
|
+
}
|
|
967
|
+
return Math.sqrt(c) > r ? (Ie(e, t, l + 1, r, a), Ie(e, l, n, r, a)) : (a.length || a.push(o), a.push(s)), a;
|
|
968
|
+
}
|
|
969
|
+
function Le(e, t = .15, n) {
|
|
970
|
+
let r = [], i = (e.length - 1) / 3;
|
|
971
|
+
for (let n = 0; n < i; n++) Pe(e, 3 * n, t, r);
|
|
972
|
+
return n && n > 0 ? Ie(r, 0, r.length, n) : r;
|
|
973
|
+
}
|
|
974
|
+
var B = "none", Re = class {
|
|
975
|
+
constructor(e) {
|
|
976
|
+
this.defaultOptions = {
|
|
977
|
+
maxRandomnessOffset: 2,
|
|
978
|
+
roughness: 1,
|
|
979
|
+
bowing: 1,
|
|
980
|
+
stroke: "#000",
|
|
981
|
+
strokeWidth: 1,
|
|
982
|
+
curveTightness: 0,
|
|
983
|
+
curveFitting: .95,
|
|
984
|
+
curveStepCount: 9,
|
|
985
|
+
fillStyle: "hachure",
|
|
986
|
+
fillWeight: -1,
|
|
987
|
+
hachureAngle: -41,
|
|
988
|
+
hachureGap: -1,
|
|
989
|
+
dashOffset: -1,
|
|
990
|
+
dashGap: -1,
|
|
991
|
+
zigzagOffset: -1,
|
|
992
|
+
seed: 0,
|
|
993
|
+
disableMultiStroke: !1,
|
|
994
|
+
disableMultiStrokeFill: !1,
|
|
995
|
+
preserveVertices: !1,
|
|
996
|
+
fillShapeRoughnessGain: .8
|
|
997
|
+
}, this.config = e || {}, this.config.options && (this.defaultOptions = this._o(this.config.options));
|
|
998
|
+
}
|
|
999
|
+
static newSeed() {
|
|
1000
|
+
return Math.floor(Math.random() * 2 ** 31);
|
|
1001
|
+
}
|
|
1002
|
+
_o(e) {
|
|
1003
|
+
return e ? Object.assign({}, this.defaultOptions, e) : this.defaultOptions;
|
|
1004
|
+
}
|
|
1005
|
+
_d(e, t, n) {
|
|
1006
|
+
return {
|
|
1007
|
+
shape: e,
|
|
1008
|
+
sets: t || [],
|
|
1009
|
+
options: n || this.defaultOptions
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
line(e, t, n, r, i) {
|
|
1013
|
+
let a = this._o(i);
|
|
1014
|
+
return this._d("line", [ue(e, t, n, r, a)], a);
|
|
1015
|
+
}
|
|
1016
|
+
rectangle(e, t, n, r, i) {
|
|
1017
|
+
let a = this._o(i), o = [], s = fe(e, t, n, r, a);
|
|
1018
|
+
if (a.fill) {
|
|
1019
|
+
let i = [
|
|
1020
|
+
[e, t],
|
|
1021
|
+
[e + n, t],
|
|
1022
|
+
[e + n, t + r],
|
|
1023
|
+
[e, t + r]
|
|
1024
|
+
];
|
|
1025
|
+
a.fillStyle === "solid" ? o.push(ve([i], a)) : o.push(ye([i], a));
|
|
1026
|
+
}
|
|
1027
|
+
return a.stroke !== B && o.push(s), this._d("rectangle", o, a);
|
|
1028
|
+
}
|
|
1029
|
+
ellipse(e, t, n, r, i) {
|
|
1030
|
+
let a = this._o(i), o = [], s = me(n, r, a), c = he(e, t, a, s);
|
|
1031
|
+
if (a.fill) if (a.fillStyle === "solid") {
|
|
1032
|
+
let n = he(e, t, a, s).opset;
|
|
1033
|
+
n.type = "fillPath", o.push(n);
|
|
1034
|
+
} else o.push(ye([c.estimatedPoints], a));
|
|
1035
|
+
return a.stroke !== B && o.push(c.opset), this._d("ellipse", o, a);
|
|
1036
|
+
}
|
|
1037
|
+
circle(e, t, n, r) {
|
|
1038
|
+
let i = this.ellipse(e, t, n, n, r);
|
|
1039
|
+
return i.shape = "circle", i;
|
|
1040
|
+
}
|
|
1041
|
+
linearPath(e, t) {
|
|
1042
|
+
let n = this._o(t);
|
|
1043
|
+
return this._d("linearPath", [de(e, !1, n)], n);
|
|
1044
|
+
}
|
|
1045
|
+
arc(e, t, n, r, i, a, o = !1, s) {
|
|
1046
|
+
let c = this._o(s), l = [], u = ge(e, t, n, r, i, a, o, !0, c);
|
|
1047
|
+
if (o && c.fill) if (c.fillStyle === "solid") {
|
|
1048
|
+
let o = Object.assign({}, c);
|
|
1049
|
+
o.disableMultiStroke = !0;
|
|
1050
|
+
let s = ge(e, t, n, r, i, a, !0, !1, o);
|
|
1051
|
+
s.type = "fillPath", l.push(s);
|
|
1052
|
+
} else l.push(function(e, t, n, r, i, a, o) {
|
|
1053
|
+
let s = e, c = t, l = Math.abs(n / 2), u = Math.abs(r / 2);
|
|
1054
|
+
l += R(.01 * l, o), u += R(.01 * u, o);
|
|
1055
|
+
let d = i, f = a;
|
|
1056
|
+
for (; d < 0;) d += 2 * Math.PI, f += 2 * Math.PI;
|
|
1057
|
+
f - d > 2 * Math.PI && (d = 0, f = 2 * Math.PI);
|
|
1058
|
+
let p = (f - d) / o.curveStepCount, m = [];
|
|
1059
|
+
for (let e = d; e <= f; e += p) m.push([s + l * Math.cos(e), c + u * Math.sin(e)]);
|
|
1060
|
+
return m.push([s + l * Math.cos(f), c + u * Math.sin(f)]), m.push([s, c]), ye([m], o);
|
|
1061
|
+
}(e, t, n, r, i, a, c));
|
|
1062
|
+
return c.stroke !== B && l.push(u), this._d("arc", l, c);
|
|
1063
|
+
}
|
|
1064
|
+
curve(e, t) {
|
|
1065
|
+
let n = this._o(t), r = [], i = pe(e, n);
|
|
1066
|
+
if (n.fill && n.fill !== B) if (n.fillStyle === "solid") {
|
|
1067
|
+
let t = pe(e, Object.assign(Object.assign({}, n), {
|
|
1068
|
+
disableMultiStroke: !0,
|
|
1069
|
+
roughness: n.roughness ? n.roughness + n.fillShapeRoughnessGain : 0
|
|
1070
|
+
}));
|
|
1071
|
+
r.push({
|
|
1072
|
+
type: "fillPath",
|
|
1073
|
+
ops: this._mergedShape(t.ops)
|
|
1074
|
+
});
|
|
1075
|
+
} else {
|
|
1076
|
+
let t = [], i = e;
|
|
1077
|
+
if (i.length) {
|
|
1078
|
+
let e = typeof i[0][0] == "number" ? [i] : i;
|
|
1079
|
+
for (let r of e) r.length < 3 ? t.push(...r) : r.length === 3 ? t.push(...Le(Ae([
|
|
1080
|
+
r[0],
|
|
1081
|
+
r[0],
|
|
1082
|
+
r[1],
|
|
1083
|
+
r[2]
|
|
1084
|
+
]), 10, (1 + n.roughness) / 2)) : t.push(...Le(Ae(r), 10, (1 + n.roughness) / 2));
|
|
1085
|
+
}
|
|
1086
|
+
t.length && r.push(ye([t], n));
|
|
1087
|
+
}
|
|
1088
|
+
return n.stroke !== B && r.push(i), this._d("curve", r, n);
|
|
1089
|
+
}
|
|
1090
|
+
polygon(e, t) {
|
|
1091
|
+
let n = this._o(t), r = [], i = de(e, !0, n);
|
|
1092
|
+
return n.fill && (n.fillStyle === "solid" ? r.push(ve([e], n)) : r.push(ye([e], n))), n.stroke !== B && r.push(i), this._d("polygon", r, n);
|
|
1093
|
+
}
|
|
1094
|
+
path(e, t) {
|
|
1095
|
+
let n = this._o(t), r = [];
|
|
1096
|
+
if (!e) return this._d("path", r, n);
|
|
1097
|
+
e = (e || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
|
|
1098
|
+
let i = n.fill && n.fill !== "transparent" && n.fill !== B, a = n.stroke !== B, o = !!(n.simplification && n.simplification < 1), s = function(e, t, n) {
|
|
1099
|
+
let r = oe(L(ae(e))), i = [], a = [], o = [0, 0], s = [], c = () => {
|
|
1100
|
+
s.length >= 4 && a.push(...Le(s, t)), s = [];
|
|
1101
|
+
}, l = () => {
|
|
1102
|
+
c(), a.length && (i.push(a), a = []);
|
|
1103
|
+
};
|
|
1104
|
+
for (let { key: e, data: t } of r) switch (e) {
|
|
1105
|
+
case "M":
|
|
1106
|
+
l(), o = [t[0], t[1]], a.push(o);
|
|
1107
|
+
break;
|
|
1108
|
+
case "L":
|
|
1109
|
+
c(), a.push([t[0], t[1]]);
|
|
1110
|
+
break;
|
|
1111
|
+
case "C":
|
|
1112
|
+
if (!s.length) {
|
|
1113
|
+
let e = a.length ? a[a.length - 1] : o;
|
|
1114
|
+
s.push([e[0], e[1]]);
|
|
1115
|
+
}
|
|
1116
|
+
s.push([t[0], t[1]]), s.push([t[2], t[3]]), s.push([t[4], t[5]]);
|
|
1117
|
+
break;
|
|
1118
|
+
case "Z": c(), a.push([o[0], o[1]]);
|
|
1119
|
+
}
|
|
1120
|
+
if (l(), !n) return i;
|
|
1121
|
+
let u = [];
|
|
1122
|
+
for (let e of i) {
|
|
1123
|
+
let t = Fe(e, n);
|
|
1124
|
+
t.length && u.push(t);
|
|
1125
|
+
}
|
|
1126
|
+
return u;
|
|
1127
|
+
}(e, 1, o ? 4 - 4 * (n.simplification || 1) : (1 + n.roughness) / 2), c = _e(e, n);
|
|
1128
|
+
if (i) if (n.fillStyle === "solid") if (s.length === 1) {
|
|
1129
|
+
let t = _e(e, Object.assign(Object.assign({}, n), {
|
|
1130
|
+
disableMultiStroke: !0,
|
|
1131
|
+
roughness: n.roughness ? n.roughness + n.fillShapeRoughnessGain : 0
|
|
1132
|
+
}));
|
|
1133
|
+
r.push({
|
|
1134
|
+
type: "fillPath",
|
|
1135
|
+
ops: this._mergedShape(t.ops)
|
|
1136
|
+
});
|
|
1137
|
+
} else r.push(ve(s, n));
|
|
1138
|
+
else r.push(ye(s, n));
|
|
1139
|
+
return a && (o ? s.forEach(((e) => {
|
|
1140
|
+
r.push(de(e, !1, n));
|
|
1141
|
+
})) : r.push(c)), this._d("path", r, n);
|
|
1142
|
+
}
|
|
1143
|
+
opsToPath(e, t) {
|
|
1144
|
+
let n = "";
|
|
1145
|
+
for (let r of e.ops) {
|
|
1146
|
+
let e = typeof t == "number" && t >= 0 ? r.data.map(((e) => +e.toFixed(t))) : r.data;
|
|
1147
|
+
switch (r.op) {
|
|
1148
|
+
case "move":
|
|
1149
|
+
n += `M${e[0]} ${e[1]} `;
|
|
1150
|
+
break;
|
|
1151
|
+
case "bcurveTo":
|
|
1152
|
+
n += `C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;
|
|
1153
|
+
break;
|
|
1154
|
+
case "lineTo": n += `L${e[0]} ${e[1]} `;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return n.trim();
|
|
1158
|
+
}
|
|
1159
|
+
toPaths(e) {
|
|
1160
|
+
let t = e.sets || [], n = e.options || this.defaultOptions, r = [];
|
|
1161
|
+
for (let e of t) {
|
|
1162
|
+
let t = null;
|
|
1163
|
+
switch (e.type) {
|
|
1164
|
+
case "path":
|
|
1165
|
+
t = {
|
|
1166
|
+
d: this.opsToPath(e),
|
|
1167
|
+
stroke: n.stroke,
|
|
1168
|
+
strokeWidth: n.strokeWidth,
|
|
1169
|
+
fill: B
|
|
1170
|
+
};
|
|
1171
|
+
break;
|
|
1172
|
+
case "fillPath":
|
|
1173
|
+
t = {
|
|
1174
|
+
d: this.opsToPath(e),
|
|
1175
|
+
stroke: B,
|
|
1176
|
+
strokeWidth: 0,
|
|
1177
|
+
fill: n.fill || B
|
|
1178
|
+
};
|
|
1179
|
+
break;
|
|
1180
|
+
case "fillSketch": t = this.fillSketch(e, n);
|
|
1181
|
+
}
|
|
1182
|
+
t && r.push(t);
|
|
1183
|
+
}
|
|
1184
|
+
return r;
|
|
1185
|
+
}
|
|
1186
|
+
fillSketch(e, t) {
|
|
1187
|
+
let n = t.fillWeight;
|
|
1188
|
+
return n < 0 && (n = t.strokeWidth / 2), {
|
|
1189
|
+
d: this.opsToPath(e),
|
|
1190
|
+
stroke: t.fill || B,
|
|
1191
|
+
strokeWidth: n,
|
|
1192
|
+
fill: B
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
_mergedShape(e) {
|
|
1196
|
+
return e.filter(((e, t) => t === 0 || e.op !== "move"));
|
|
1197
|
+
}
|
|
1198
|
+
}, ze = class {
|
|
1199
|
+
constructor(e, t) {
|
|
1200
|
+
this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.gen = new Re(t);
|
|
1201
|
+
}
|
|
1202
|
+
draw(e) {
|
|
1203
|
+
let t = e.sets || [], n = e.options || this.getDefaultOptions(), r = this.ctx, i = e.options.fixedDecimalPlaceDigits;
|
|
1204
|
+
for (let a of t) switch (a.type) {
|
|
1205
|
+
case "path":
|
|
1206
|
+
r.save(), r.strokeStyle = n.stroke === "none" ? "transparent" : n.stroke, r.lineWidth = n.strokeWidth, n.strokeLineDash && r.setLineDash(n.strokeLineDash), n.strokeLineDashOffset && (r.lineDashOffset = n.strokeLineDashOffset), this._drawToContext(r, a, i), r.restore();
|
|
1207
|
+
break;
|
|
1208
|
+
case "fillPath": {
|
|
1209
|
+
r.save(), r.fillStyle = n.fill || "";
|
|
1210
|
+
let t = e.shape === "curve" || e.shape === "polygon" || e.shape === "path" ? "evenodd" : "nonzero";
|
|
1211
|
+
this._drawToContext(r, a, i, t), r.restore();
|
|
1212
|
+
break;
|
|
1213
|
+
}
|
|
1214
|
+
case "fillSketch": this.fillSketch(r, a, n);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
fillSketch(e, t, n) {
|
|
1218
|
+
let r = n.fillWeight;
|
|
1219
|
+
r < 0 && (r = n.strokeWidth / 2), e.save(), n.fillLineDash && e.setLineDash(n.fillLineDash), n.fillLineDashOffset && (e.lineDashOffset = n.fillLineDashOffset), e.strokeStyle = n.fill || "", e.lineWidth = r, this._drawToContext(e, t, n.fixedDecimalPlaceDigits), e.restore();
|
|
1220
|
+
}
|
|
1221
|
+
_drawToContext(e, t, n, r = "nonzero") {
|
|
1222
|
+
e.beginPath();
|
|
1223
|
+
for (let r of t.ops) {
|
|
1224
|
+
let t = typeof n == "number" && n >= 0 ? r.data.map(((e) => +e.toFixed(n))) : r.data;
|
|
1225
|
+
switch (r.op) {
|
|
1226
|
+
case "move":
|
|
1227
|
+
e.moveTo(t[0], t[1]);
|
|
1228
|
+
break;
|
|
1229
|
+
case "bcurveTo":
|
|
1230
|
+
e.bezierCurveTo(t[0], t[1], t[2], t[3], t[4], t[5]);
|
|
1231
|
+
break;
|
|
1232
|
+
case "lineTo": e.lineTo(t[0], t[1]);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
t.type === "fillPath" ? e.fill(r) : e.stroke();
|
|
1236
|
+
}
|
|
1237
|
+
get generator() {
|
|
1238
|
+
return this.gen;
|
|
1239
|
+
}
|
|
1240
|
+
getDefaultOptions() {
|
|
1241
|
+
return this.gen.defaultOptions;
|
|
1242
|
+
}
|
|
1243
|
+
line(e, t, n, r, i) {
|
|
1244
|
+
let a = this.gen.line(e, t, n, r, i);
|
|
1245
|
+
return this.draw(a), a;
|
|
1246
|
+
}
|
|
1247
|
+
rectangle(e, t, n, r, i) {
|
|
1248
|
+
let a = this.gen.rectangle(e, t, n, r, i);
|
|
1249
|
+
return this.draw(a), a;
|
|
1250
|
+
}
|
|
1251
|
+
ellipse(e, t, n, r, i) {
|
|
1252
|
+
let a = this.gen.ellipse(e, t, n, r, i);
|
|
1253
|
+
return this.draw(a), a;
|
|
1254
|
+
}
|
|
1255
|
+
circle(e, t, n, r) {
|
|
1256
|
+
let i = this.gen.circle(e, t, n, r);
|
|
1257
|
+
return this.draw(i), i;
|
|
1258
|
+
}
|
|
1259
|
+
linearPath(e, t) {
|
|
1260
|
+
let n = this.gen.linearPath(e, t);
|
|
1261
|
+
return this.draw(n), n;
|
|
1262
|
+
}
|
|
1263
|
+
polygon(e, t) {
|
|
1264
|
+
let n = this.gen.polygon(e, t);
|
|
1265
|
+
return this.draw(n), n;
|
|
1266
|
+
}
|
|
1267
|
+
arc(e, t, n, r, i, a, o = !1, s) {
|
|
1268
|
+
let c = this.gen.arc(e, t, n, r, i, a, o, s);
|
|
1269
|
+
return this.draw(c), c;
|
|
1270
|
+
}
|
|
1271
|
+
curve(e, t) {
|
|
1272
|
+
let n = this.gen.curve(e, t);
|
|
1273
|
+
return this.draw(n), n;
|
|
1274
|
+
}
|
|
1275
|
+
path(e, t) {
|
|
1276
|
+
let n = this.gen.path(e, t);
|
|
1277
|
+
return this.draw(n), n;
|
|
1278
|
+
}
|
|
1279
|
+
}, Be = "http://www.w3.org/2000/svg", Ve = class {
|
|
1280
|
+
constructor(e, t) {
|
|
1281
|
+
this.svg = e, this.gen = new Re(t);
|
|
1282
|
+
}
|
|
1283
|
+
draw(e) {
|
|
1284
|
+
let t = e.sets || [], n = e.options || this.getDefaultOptions(), r = this.svg.ownerDocument || window.document, i = r.createElementNS(Be, "g"), a = e.options.fixedDecimalPlaceDigits;
|
|
1285
|
+
for (let o of t) {
|
|
1286
|
+
let t = null;
|
|
1287
|
+
switch (o.type) {
|
|
1288
|
+
case "path":
|
|
1289
|
+
t = r.createElementNS(Be, "path"), t.setAttribute("d", this.opsToPath(o, a)), t.setAttribute("stroke", n.stroke), t.setAttribute("stroke-width", n.strokeWidth + ""), t.setAttribute("fill", "none"), n.strokeLineDash && t.setAttribute("stroke-dasharray", n.strokeLineDash.join(" ").trim()), n.strokeLineDashOffset && t.setAttribute("stroke-dashoffset", `${n.strokeLineDashOffset}`);
|
|
1290
|
+
break;
|
|
1291
|
+
case "fillPath":
|
|
1292
|
+
t = r.createElementNS(Be, "path"), t.setAttribute("d", this.opsToPath(o, a)), t.setAttribute("stroke", "none"), t.setAttribute("stroke-width", "0"), t.setAttribute("fill", n.fill || ""), e.shape !== "curve" && e.shape !== "polygon" || t.setAttribute("fill-rule", "evenodd");
|
|
1293
|
+
break;
|
|
1294
|
+
case "fillSketch": t = this.fillSketch(r, o, n);
|
|
1295
|
+
}
|
|
1296
|
+
t && i.appendChild(t);
|
|
1297
|
+
}
|
|
1298
|
+
return i;
|
|
1299
|
+
}
|
|
1300
|
+
fillSketch(e, t, n) {
|
|
1301
|
+
let r = n.fillWeight;
|
|
1302
|
+
r < 0 && (r = n.strokeWidth / 2);
|
|
1303
|
+
let i = e.createElementNS(Be, "path");
|
|
1304
|
+
return i.setAttribute("d", this.opsToPath(t, n.fixedDecimalPlaceDigits)), i.setAttribute("stroke", n.fill || ""), i.setAttribute("stroke-width", r + ""), i.setAttribute("fill", "none"), n.fillLineDash && i.setAttribute("stroke-dasharray", n.fillLineDash.join(" ").trim()), n.fillLineDashOffset && i.setAttribute("stroke-dashoffset", `${n.fillLineDashOffset}`), i;
|
|
1305
|
+
}
|
|
1306
|
+
get generator() {
|
|
1307
|
+
return this.gen;
|
|
1308
|
+
}
|
|
1309
|
+
getDefaultOptions() {
|
|
1310
|
+
return this.gen.defaultOptions;
|
|
1311
|
+
}
|
|
1312
|
+
opsToPath(e, t) {
|
|
1313
|
+
return this.gen.opsToPath(e, t);
|
|
1314
|
+
}
|
|
1315
|
+
line(e, t, n, r, i) {
|
|
1316
|
+
let a = this.gen.line(e, t, n, r, i);
|
|
1317
|
+
return this.draw(a);
|
|
1318
|
+
}
|
|
1319
|
+
rectangle(e, t, n, r, i) {
|
|
1320
|
+
let a = this.gen.rectangle(e, t, n, r, i);
|
|
1321
|
+
return this.draw(a);
|
|
1322
|
+
}
|
|
1323
|
+
ellipse(e, t, n, r, i) {
|
|
1324
|
+
let a = this.gen.ellipse(e, t, n, r, i);
|
|
1325
|
+
return this.draw(a);
|
|
1326
|
+
}
|
|
1327
|
+
circle(e, t, n, r) {
|
|
1328
|
+
let i = this.gen.circle(e, t, n, r);
|
|
1329
|
+
return this.draw(i);
|
|
1330
|
+
}
|
|
1331
|
+
linearPath(e, t) {
|
|
1332
|
+
let n = this.gen.linearPath(e, t);
|
|
1333
|
+
return this.draw(n);
|
|
1334
|
+
}
|
|
1335
|
+
polygon(e, t) {
|
|
1336
|
+
let n = this.gen.polygon(e, t);
|
|
1337
|
+
return this.draw(n);
|
|
1338
|
+
}
|
|
1339
|
+
arc(e, t, n, r, i, a, o = !1, s) {
|
|
1340
|
+
let c = this.gen.arc(e, t, n, r, i, a, o, s);
|
|
1341
|
+
return this.draw(c);
|
|
1342
|
+
}
|
|
1343
|
+
curve(e, t) {
|
|
1344
|
+
let n = this.gen.curve(e, t);
|
|
1345
|
+
return this.draw(n);
|
|
1346
|
+
}
|
|
1347
|
+
path(e, t) {
|
|
1348
|
+
let n = this.gen.path(e, t);
|
|
1349
|
+
return this.draw(n);
|
|
1350
|
+
}
|
|
1351
|
+
}, V = {
|
|
1352
|
+
canvas: (e, t) => new ze(e, t),
|
|
1353
|
+
svg: (e, t) => new Ve(e, t),
|
|
1354
|
+
generator: (e) => new Re(e),
|
|
1355
|
+
newSeed: () => Re.newSeed()
|
|
1356
|
+
}, H = /* @__PURE__ */ t(async (e, r, a) => {
|
|
1357
|
+
let o, s = r.useHtmlLabels || u(c()?.htmlLabels);
|
|
1358
|
+
o = a || "node default";
|
|
1359
|
+
let d = e.insert("g").attr("class", o).attr("id", r.domId || r.id), f = d.insert("g").attr("class", "label").attr("style", h(r.labelStyle)), g;
|
|
1360
|
+
g = r.label === void 0 ? "" : typeof r.label == "string" ? r.label : r.label[0];
|
|
1361
|
+
let _ = await S(f, i(m(g), c()), {
|
|
1362
|
+
useHtmlLabels: s,
|
|
1363
|
+
width: r.width || c().flowchart?.wrappingWidth,
|
|
1364
|
+
cssClasses: "markdown-node-label",
|
|
1365
|
+
style: r.labelStyle,
|
|
1366
|
+
addSvgBackground: !!r.icon || !!r.img
|
|
1367
|
+
}), v = _.getBBox(), y = (r?.padding ?? 0) / 2;
|
|
1368
|
+
if (s) {
|
|
1369
|
+
let e = _.children[0], r = n(_), i = e.getElementsByTagName("img");
|
|
1370
|
+
if (i) {
|
|
1371
|
+
let e = g.replace(/<img[^>]*>/g, "").trim() === "";
|
|
1372
|
+
await Promise.all([...i].map((n) => new Promise((r) => {
|
|
1373
|
+
function i() {
|
|
1374
|
+
if (n.style.display = "flex", n.style.flexDirection = "column", e) {
|
|
1375
|
+
let [e = l.fontSize] = p(c().fontSize ? c().fontSize : window.getComputedStyle(document.body).fontSize), t = e * 5 + "px";
|
|
1376
|
+
n.style.minWidth = t, n.style.maxWidth = t;
|
|
1377
|
+
} else n.style.width = "100%";
|
|
1378
|
+
r(n);
|
|
1379
|
+
}
|
|
1380
|
+
t(i, "setupImage"), setTimeout(() => {
|
|
1381
|
+
n.complete && i();
|
|
1382
|
+
}), n.addEventListener("error", i), n.addEventListener("load", i);
|
|
1383
|
+
})));
|
|
1384
|
+
}
|
|
1385
|
+
v = e.getBoundingClientRect(), r.attr("width", v.width), r.attr("height", v.height);
|
|
1386
|
+
}
|
|
1387
|
+
return s ? f.attr("transform", "translate(" + -v.width / 2 + ", " + -v.height / 2 + ")") : f.attr("transform", "translate(0, " + -v.height / 2 + ")"), r.centerLabel && f.attr("transform", "translate(" + -v.width / 2 + ", " + -v.height / 2 + ")"), f.insert("rect", ":first-child"), {
|
|
1388
|
+
shapeSvg: d,
|
|
1389
|
+
bbox: v,
|
|
1390
|
+
halfPadding: y,
|
|
1391
|
+
label: f
|
|
1392
|
+
};
|
|
1393
|
+
}, "labelHelper"), He = /* @__PURE__ */ t(async (e, t, r) => {
|
|
1394
|
+
let a = r.useHtmlLabels || u(c()?.flowchart?.htmlLabels), o = e.insert("g").attr("class", "label").attr("style", r.labelStyle || ""), s = await S(o, i(m(t), c()), {
|
|
1395
|
+
useHtmlLabels: a,
|
|
1396
|
+
width: r.width || c()?.flowchart?.wrappingWidth,
|
|
1397
|
+
style: r.labelStyle,
|
|
1398
|
+
addSvgBackground: !!r.icon || !!r.img
|
|
1399
|
+
}), l = s.getBBox(), d = r.padding / 2;
|
|
1400
|
+
if (u(c()?.flowchart?.htmlLabels)) {
|
|
1401
|
+
let e = s.children[0], t = n(s);
|
|
1402
|
+
l = e.getBoundingClientRect(), t.attr("width", l.width), t.attr("height", l.height);
|
|
1403
|
+
}
|
|
1404
|
+
return a ? o.attr("transform", "translate(" + -l.width / 2 + ", " + -l.height / 2 + ")") : o.attr("transform", "translate(0, " + -l.height / 2 + ")"), r.centerLabel && o.attr("transform", "translate(" + -l.width / 2 + ", " + -l.height / 2 + ")"), o.insert("rect", ":first-child"), {
|
|
1405
|
+
shapeSvg: e,
|
|
1406
|
+
bbox: l,
|
|
1407
|
+
halfPadding: d,
|
|
1408
|
+
label: o
|
|
1409
|
+
};
|
|
1410
|
+
}, "insertLabel"), U = /* @__PURE__ */ t((e, t) => {
|
|
1411
|
+
let n = t.node().getBBox();
|
|
1412
|
+
e.width = n.width, e.height = n.height;
|
|
1413
|
+
}, "updateNodeBounds"), W = /* @__PURE__ */ t((e, t) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (t || ""), "getNodeClasses");
|
|
1414
|
+
function G(e) {
|
|
1415
|
+
let t = e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x},${e.y}`);
|
|
1416
|
+
return t.push("Z"), t.join(" ");
|
|
1417
|
+
}
|
|
1418
|
+
t(G, "createPathFromPoints");
|
|
1419
|
+
function K(e, t, n, r, i, a) {
|
|
1420
|
+
let o = [], s = n - e, c = r - t, l = s / a, u = 2 * Math.PI / l, d = t + c / 2;
|
|
1421
|
+
for (let t = 0; t <= 50; t++) {
|
|
1422
|
+
let n = e + t / 50 * s, r = d + i * Math.sin(u * (n - e));
|
|
1423
|
+
o.push({
|
|
1424
|
+
x: n,
|
|
1425
|
+
y: r
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
return o;
|
|
1429
|
+
}
|
|
1430
|
+
t(K, "generateFullSineWavePoints");
|
|
1431
|
+
function Ue(e, t, n, r, i, a) {
|
|
1432
|
+
let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
|
|
1433
|
+
for (let i = 0; i < r; i++) {
|
|
1434
|
+
let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
|
|
1435
|
+
o.push({
|
|
1436
|
+
x: -a,
|
|
1437
|
+
y: -l
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
return o;
|
|
1441
|
+
}
|
|
1442
|
+
t(Ue, "generateCirclePoints");
|
|
1443
|
+
var We = /* @__PURE__ */ t((e, t) => {
|
|
1444
|
+
var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
|
|
1445
|
+
return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
|
|
1446
|
+
x: n + c,
|
|
1447
|
+
y: r + l
|
|
1448
|
+
};
|
|
1449
|
+
}, "intersectRect");
|
|
1450
|
+
function Ge(e, t) {
|
|
1451
|
+
t && e.attr("style", t);
|
|
1452
|
+
}
|
|
1453
|
+
t(Ge, "applyStyle");
|
|
1454
|
+
async function Ke(e) {
|
|
1455
|
+
let t = n(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), r = t.append("xhtml:div"), a = c(), l = e.label;
|
|
1456
|
+
e.label && s(e.label) && (l = await o(e.label.replace(d.lineBreakRegex, "\n"), a));
|
|
1457
|
+
let u = "<span class=\"" + (e.isNode ? "nodeLabel" : "edgeLabel") + "\" " + (e.labelStyle ? "style=\"" + e.labelStyle + "\"" : "") + ">" + l + "</span>";
|
|
1458
|
+
return r.html(i(u, a)), Ge(r, e.labelStyle), r.style("display", "inline-block"), r.style("padding-right", "1px"), r.style("white-space", "nowrap"), r.attr("xmlns", "http://www.w3.org/1999/xhtml"), t.node();
|
|
1459
|
+
}
|
|
1460
|
+
t(Ke, "addHtmlLabel");
|
|
1461
|
+
var qe = /* @__PURE__ */ t(async (t, n, r, i) => {
|
|
1462
|
+
let a = t || "";
|
|
1463
|
+
if (typeof a == "object" && (a = a[0]), u(c().flowchart.htmlLabels)) return a = a.replace(/\\n|\n/g, "<br />"), e.info("vertexText" + a), await Ke({
|
|
1464
|
+
isNode: i,
|
|
1465
|
+
label: m(a).replace(/fa[blrs]?:fa-[\w-]+/g, (e) => `<i class='${e.replace(":", " ")}'></i>`),
|
|
1466
|
+
labelStyle: n && n.replace("fill:", "color:")
|
|
1467
|
+
});
|
|
1468
|
+
{
|
|
1469
|
+
let e = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1470
|
+
e.setAttribute("style", n.replace("color:", "fill:"));
|
|
1471
|
+
let t = [];
|
|
1472
|
+
t = typeof a == "string" ? a.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(a) ? a : [];
|
|
1473
|
+
for (let n of t) {
|
|
1474
|
+
let t = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
1475
|
+
t.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), t.setAttribute("dy", "1em"), t.setAttribute("x", "0"), r ? t.setAttribute("class", "title-row") : t.setAttribute("class", "row"), t.textContent = n.trim(), e.appendChild(t);
|
|
1476
|
+
}
|
|
1477
|
+
return e;
|
|
1478
|
+
}
|
|
1479
|
+
}, "createLabel"), q = /* @__PURE__ */ t((e, t, n, r, i) => [
|
|
1480
|
+
"M",
|
|
1481
|
+
e + i,
|
|
1482
|
+
t,
|
|
1483
|
+
"H",
|
|
1484
|
+
e + n - i,
|
|
1485
|
+
"A",
|
|
1486
|
+
i,
|
|
1487
|
+
i,
|
|
1488
|
+
0,
|
|
1489
|
+
0,
|
|
1490
|
+
1,
|
|
1491
|
+
e + n,
|
|
1492
|
+
t + i,
|
|
1493
|
+
"V",
|
|
1494
|
+
t + r - i,
|
|
1495
|
+
"A",
|
|
1496
|
+
i,
|
|
1497
|
+
i,
|
|
1498
|
+
0,
|
|
1499
|
+
0,
|
|
1500
|
+
1,
|
|
1501
|
+
e + n - i,
|
|
1502
|
+
t + r,
|
|
1503
|
+
"H",
|
|
1504
|
+
e + i,
|
|
1505
|
+
"A",
|
|
1506
|
+
i,
|
|
1507
|
+
i,
|
|
1508
|
+
0,
|
|
1509
|
+
0,
|
|
1510
|
+
1,
|
|
1511
|
+
e,
|
|
1512
|
+
t + r - i,
|
|
1513
|
+
"V",
|
|
1514
|
+
t + i,
|
|
1515
|
+
"A",
|
|
1516
|
+
i,
|
|
1517
|
+
i,
|
|
1518
|
+
0,
|
|
1519
|
+
0,
|
|
1520
|
+
1,
|
|
1521
|
+
e + i,
|
|
1522
|
+
t,
|
|
1523
|
+
"Z"
|
|
1524
|
+
].join(" "), "createRoundedRectPathD"), Je = /* @__PURE__ */ t(async (t, r) => {
|
|
1525
|
+
e.info("Creating subgraph rect for ", r.id, r);
|
|
1526
|
+
let i = c(), { themeVariables: a, handDrawnSeed: o } = i, { clusterBkg: s, clusterBorder: l } = a, { labelStyles: d, nodeStyles: f, borderStyles: p, backgroundStyles: m } = y(r), h = t.insert("g").attr("class", "cluster " + r.cssClasses).attr("id", r.id).attr("data-look", r.look), g = u(i.flowchart.htmlLabels), b = h.insert("g").attr("class", "cluster-label "), x = await S(b, r.label, {
|
|
1527
|
+
style: r.labelStyle,
|
|
1528
|
+
useHtmlLabels: g,
|
|
1529
|
+
isNode: !0
|
|
1530
|
+
}), C = x.getBBox();
|
|
1531
|
+
if (u(i.flowchart.htmlLabels)) {
|
|
1532
|
+
let e = x.children[0], t = n(x);
|
|
1533
|
+
C = e.getBoundingClientRect(), t.attr("width", C.width), t.attr("height", C.height);
|
|
1534
|
+
}
|
|
1535
|
+
let w = r.width <= C.width + r.padding ? C.width + r.padding : r.width;
|
|
1536
|
+
r.width <= C.width + r.padding ? r.diff = (w - r.width) / 2 - r.padding : r.diff = -r.padding;
|
|
1537
|
+
let T = r.height, E = r.x - w / 2, D = r.y - T / 2;
|
|
1538
|
+
e.trace("Data ", r, JSON.stringify(r));
|
|
1539
|
+
let O;
|
|
1540
|
+
if (r.look === "handDrawn") {
|
|
1541
|
+
let t = V.svg(h), n = v(r, {
|
|
1542
|
+
roughness: .7,
|
|
1543
|
+
fill: s,
|
|
1544
|
+
stroke: l,
|
|
1545
|
+
fillWeight: 3,
|
|
1546
|
+
seed: o
|
|
1547
|
+
}), i = t.path(q(E, D, w, T, 0), n);
|
|
1548
|
+
O = h.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child"), O.select("path:nth-child(2)").attr("style", p.join(";")), O.select("path").attr("style", m.join(";").replace("fill", "stroke"));
|
|
1549
|
+
} else O = h.insert("rect", ":first-child"), O.attr("style", f).attr("rx", r.rx).attr("ry", r.ry).attr("x", E).attr("y", D).attr("width", w).attr("height", T);
|
|
1550
|
+
let { subGraphTitleTopMargin: k } = _(i);
|
|
1551
|
+
if (b.attr("transform", `translate(${r.x - C.width / 2}, ${r.y - r.height / 2 + k})`), d) {
|
|
1552
|
+
let e = b.select("span");
|
|
1553
|
+
e && e.attr("style", d);
|
|
1554
|
+
}
|
|
1555
|
+
let A = O.node().getBBox();
|
|
1556
|
+
return r.offsetX = 0, r.width = A.width, r.height = A.height, r.offsetY = C.height - r.padding / 2, r.intersect = function(e) {
|
|
1557
|
+
return We(r, e);
|
|
1558
|
+
}, {
|
|
1559
|
+
cluster: h,
|
|
1560
|
+
labelBBox: C
|
|
1561
|
+
};
|
|
1562
|
+
}, "rect"), Ye = {
|
|
1563
|
+
rect: Je,
|
|
1564
|
+
squareRect: Je,
|
|
1565
|
+
roundedWithTitle: /* @__PURE__ */ t(async (e, t) => {
|
|
1566
|
+
let r = c(), { themeVariables: i, handDrawnSeed: a } = r, { altBackground: o, compositeBackground: s, compositeTitleBackground: l, nodeBorder: d } = i, f = e.insert("g").attr("class", t.cssClasses).attr("id", t.id).attr("data-id", t.id).attr("data-look", t.look), p = f.insert("g", ":first-child"), m = f.insert("g").attr("class", "cluster-label"), h = f.append("rect"), g = m.node().appendChild(await qe(t.label, t.labelStyle, void 0, !0)), _ = g.getBBox();
|
|
1567
|
+
if (u(r.flowchart.htmlLabels)) {
|
|
1568
|
+
let e = g.children[0], t = n(g);
|
|
1569
|
+
_ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
|
|
1570
|
+
}
|
|
1571
|
+
let v = 0 * t.padding, y = v / 2, b = (t.width <= _.width + t.padding ? _.width + t.padding : t.width) + v;
|
|
1572
|
+
t.width <= _.width + t.padding ? t.diff = (b - t.width) / 2 - t.padding : t.diff = -t.padding;
|
|
1573
|
+
let x = t.height + v, S = t.height + v - _.height - 6, C = t.x - b / 2, w = t.y - x / 2;
|
|
1574
|
+
t.width = b;
|
|
1575
|
+
let T = t.y - t.height / 2 - y + _.height + 2, E;
|
|
1576
|
+
if (t.look === "handDrawn") {
|
|
1577
|
+
let e = t.cssClasses.includes("statediagram-cluster-alt"), n = V.svg(f), r = t.rx || t.ry ? n.path(q(C, w, b, x, 10), {
|
|
1578
|
+
roughness: .7,
|
|
1579
|
+
fill: l,
|
|
1580
|
+
fillStyle: "solid",
|
|
1581
|
+
stroke: d,
|
|
1582
|
+
seed: a
|
|
1583
|
+
}) : n.rectangle(C, w, b, x, { seed: a });
|
|
1584
|
+
E = f.insert(() => r, ":first-child");
|
|
1585
|
+
let i = n.rectangle(C, T, b, S, {
|
|
1586
|
+
fill: e ? o : s,
|
|
1587
|
+
fillStyle: e ? "hachure" : "solid",
|
|
1588
|
+
stroke: d,
|
|
1589
|
+
seed: a
|
|
1590
|
+
});
|
|
1591
|
+
E = f.insert(() => r, ":first-child"), h = f.insert(() => i);
|
|
1592
|
+
} else E = p.insert("rect", ":first-child"), E.attr("class", "outer").attr("x", C).attr("y", w).attr("width", b).attr("height", x).attr("data-look", t.look), h.attr("class", "inner").attr("x", C).attr("y", T).attr("width", b).attr("height", S);
|
|
1593
|
+
return m.attr("transform", `translate(${t.x - _.width / 2}, ${w + 1 - (u(r.flowchart.htmlLabels) ? 0 : 3)})`), t.height = E.node().getBBox().height, t.offsetX = 0, t.offsetY = _.height - t.padding / 2, t.labelBBox = _, t.intersect = function(e) {
|
|
1594
|
+
return We(t, e);
|
|
1595
|
+
}, {
|
|
1596
|
+
cluster: f,
|
|
1597
|
+
labelBBox: _
|
|
1598
|
+
};
|
|
1599
|
+
}, "roundedWithTitle"),
|
|
1600
|
+
noteGroup: /* @__PURE__ */ t((e, t) => {
|
|
1601
|
+
let n = e.insert("g").attr("class", "note-cluster").attr("id", t.id), r = n.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
|
|
1602
|
+
r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
|
|
1603
|
+
let o = r.node().getBBox();
|
|
1604
|
+
return t.width = o.width, t.height = o.height, t.intersect = function(e) {
|
|
1605
|
+
return We(t, e);
|
|
1606
|
+
}, {
|
|
1607
|
+
cluster: n,
|
|
1608
|
+
labelBBox: {
|
|
1609
|
+
width: 0,
|
|
1610
|
+
height: 0
|
|
1611
|
+
}
|
|
1612
|
+
};
|
|
1613
|
+
}, "noteGroup"),
|
|
1614
|
+
divider: /* @__PURE__ */ t((e, t) => {
|
|
1615
|
+
let { themeVariables: n, handDrawnSeed: r } = c(), { nodeBorder: i } = n, a = e.insert("g").attr("class", t.cssClasses).attr("id", t.id).attr("data-look", t.look), o = a.insert("g", ":first-child"), s = 0 * t.padding, l = t.width + s;
|
|
1616
|
+
t.diff = -t.padding;
|
|
1617
|
+
let u = t.height + s, d = t.x - l / 2, f = t.y - u / 2;
|
|
1618
|
+
t.width = l;
|
|
1619
|
+
let p;
|
|
1620
|
+
if (t.look === "handDrawn") {
|
|
1621
|
+
let e = V.svg(a).rectangle(d, f, l, u, {
|
|
1622
|
+
fill: "lightgrey",
|
|
1623
|
+
roughness: .5,
|
|
1624
|
+
strokeLineDash: [5],
|
|
1625
|
+
stroke: i,
|
|
1626
|
+
seed: r
|
|
1627
|
+
});
|
|
1628
|
+
p = a.insert(() => e, ":first-child");
|
|
1629
|
+
} else p = o.insert("rect", ":first-child"), p.attr("class", "divider").attr("x", d).attr("y", f).attr("width", l).attr("height", u).attr("data-look", t.look);
|
|
1630
|
+
return t.height = p.node().getBBox().height, t.offsetX = 0, t.offsetY = 0, t.intersect = function(e) {
|
|
1631
|
+
return We(t, e);
|
|
1632
|
+
}, {
|
|
1633
|
+
cluster: a,
|
|
1634
|
+
labelBBox: {}
|
|
1635
|
+
};
|
|
1636
|
+
}, "divider"),
|
|
1637
|
+
kanbanSection: /* @__PURE__ */ t(async (t, r) => {
|
|
1638
|
+
e.info("Creating subgraph rect for ", r.id, r);
|
|
1639
|
+
let i = c(), { themeVariables: a, handDrawnSeed: o } = i, { clusterBkg: s, clusterBorder: l } = a, { labelStyles: d, nodeStyles: f, borderStyles: p, backgroundStyles: m } = y(r), h = t.insert("g").attr("class", "cluster " + r.cssClasses).attr("id", r.id).attr("data-look", r.look), g = u(i.flowchart.htmlLabels), b = h.insert("g").attr("class", "cluster-label "), x = await S(b, r.label, {
|
|
1640
|
+
style: r.labelStyle,
|
|
1641
|
+
useHtmlLabels: g,
|
|
1642
|
+
isNode: !0,
|
|
1643
|
+
width: r.width
|
|
1644
|
+
}), C = x.getBBox();
|
|
1645
|
+
if (u(i.flowchart.htmlLabels)) {
|
|
1646
|
+
let e = x.children[0], t = n(x);
|
|
1647
|
+
C = e.getBoundingClientRect(), t.attr("width", C.width), t.attr("height", C.height);
|
|
1648
|
+
}
|
|
1649
|
+
let w = r.width <= C.width + r.padding ? C.width + r.padding : r.width;
|
|
1650
|
+
r.width <= C.width + r.padding ? r.diff = (w - r.width) / 2 - r.padding : r.diff = -r.padding;
|
|
1651
|
+
let T = r.height, E = r.x - w / 2, D = r.y - T / 2;
|
|
1652
|
+
e.trace("Data ", r, JSON.stringify(r));
|
|
1653
|
+
let O;
|
|
1654
|
+
if (r.look === "handDrawn") {
|
|
1655
|
+
let t = V.svg(h), n = v(r, {
|
|
1656
|
+
roughness: .7,
|
|
1657
|
+
fill: s,
|
|
1658
|
+
stroke: l,
|
|
1659
|
+
fillWeight: 4,
|
|
1660
|
+
seed: o
|
|
1661
|
+
}), i = t.path(q(E, D, w, T, r.rx), n);
|
|
1662
|
+
O = h.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child"), O.select("path:nth-child(2)").attr("style", p.join(";")), O.select("path").attr("style", m.join(";").replace("fill", "stroke"));
|
|
1663
|
+
} else O = h.insert("rect", ":first-child"), O.attr("style", f).attr("rx", r.rx).attr("ry", r.ry).attr("x", E).attr("y", D).attr("width", w).attr("height", T);
|
|
1664
|
+
let { subGraphTitleTopMargin: k } = _(i);
|
|
1665
|
+
if (b.attr("transform", `translate(${r.x - C.width / 2}, ${r.y - r.height / 2 + k})`), d) {
|
|
1666
|
+
let e = b.select("span");
|
|
1667
|
+
e && e.attr("style", d);
|
|
1668
|
+
}
|
|
1669
|
+
let A = O.node().getBBox();
|
|
1670
|
+
return r.offsetX = 0, r.width = A.width, r.height = A.height, r.offsetY = C.height - r.padding / 2, r.intersect = function(e) {
|
|
1671
|
+
return We(r, e);
|
|
1672
|
+
}, {
|
|
1673
|
+
cluster: h,
|
|
1674
|
+
labelBBox: C
|
|
1675
|
+
};
|
|
1676
|
+
}, "kanbanSection")
|
|
1677
|
+
}, Xe = /* @__PURE__ */ new Map(), Ze = /* @__PURE__ */ t(async (e, t) => {
|
|
1678
|
+
let n = await Ye[t.shape || "rect"](e, t);
|
|
1679
|
+
return Xe.set(t.id, n), n;
|
|
1680
|
+
}, "insertCluster"), Qe = /* @__PURE__ */ t(() => {
|
|
1681
|
+
Xe = /* @__PURE__ */ new Map();
|
|
1682
|
+
}, "clear");
|
|
1683
|
+
function $e(e, t) {
|
|
1684
|
+
return e.intersect(t);
|
|
1685
|
+
}
|
|
1686
|
+
t($e, "intersectNode");
|
|
1687
|
+
var et = $e;
|
|
1688
|
+
function tt(e, t, n, r) {
|
|
1689
|
+
var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
|
|
1690
|
+
r.x < i && (l = -l);
|
|
1691
|
+
var u = Math.abs(t * n * s / c);
|
|
1692
|
+
return r.y < a && (u = -u), {
|
|
1693
|
+
x: i + l,
|
|
1694
|
+
y: a + u
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
t(tt, "intersectEllipse");
|
|
1698
|
+
var nt = tt;
|
|
1699
|
+
function rt(e, t, n) {
|
|
1700
|
+
return nt(e, t, t, n);
|
|
1701
|
+
}
|
|
1702
|
+
t(rt, "intersectCircle");
|
|
1703
|
+
var it = rt;
|
|
1704
|
+
function at(e, t, n, r) {
|
|
1705
|
+
{
|
|
1706
|
+
let i = t.y - e.y, a = e.x - t.x, o = t.x * e.y - e.x * t.y, s = i * n.x + a * n.y + o, c = i * r.x + a * r.y + o, l = 1e-6;
|
|
1707
|
+
if (s !== 0 && c !== 0 && ot(s, c)) return;
|
|
1708
|
+
let u = r.y - n.y, d = n.x - r.x, f = r.x * n.y - n.x * r.y, p = u * e.x + d * e.y + f, m = u * t.x + d * t.y + f;
|
|
1709
|
+
if (Math.abs(p) < l && Math.abs(m) < l && ot(p, m)) return;
|
|
1710
|
+
let h = i * d - u * a;
|
|
1711
|
+
if (h === 0) return;
|
|
1712
|
+
let g = Math.abs(h / 2), _ = a * f - d * o, v = _ < 0 ? (_ - g) / h : (_ + g) / h;
|
|
1713
|
+
return _ = u * o - i * f, {
|
|
1714
|
+
x: v,
|
|
1715
|
+
y: _ < 0 ? (_ - g) / h : (_ + g) / h
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
t(at, "intersectLine");
|
|
1720
|
+
function ot(e, t) {
|
|
1721
|
+
return e * t > 0;
|
|
1722
|
+
}
|
|
1723
|
+
t(ot, "sameSign");
|
|
1724
|
+
var st = at;
|
|
1725
|
+
function ct(e, t, n) {
|
|
1726
|
+
let r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
|
|
1727
|
+
typeof t.forEach == "function" ? t.forEach(function(e) {
|
|
1728
|
+
o = Math.min(o, e.x), s = Math.min(s, e.y);
|
|
1729
|
+
}) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
|
|
1730
|
+
let c = r - e.width / 2 - o, l = i - e.height / 2 - s;
|
|
1731
|
+
for (let r = 0; r < t.length; r++) {
|
|
1732
|
+
let i = t[r], o = t[r < t.length - 1 ? r + 1 : 0], s = st(e, n, {
|
|
1733
|
+
x: c + i.x,
|
|
1734
|
+
y: l + i.y
|
|
1735
|
+
}, {
|
|
1736
|
+
x: c + o.x,
|
|
1737
|
+
y: l + o.y
|
|
1738
|
+
});
|
|
1739
|
+
s && a.push(s);
|
|
1740
|
+
}
|
|
1741
|
+
return a.length ? (a.length > 1 && a.sort(function(e, t) {
|
|
1742
|
+
let r = e.x - n.x, i = e.y - n.y, a = Math.sqrt(r * r + i * i), o = t.x - n.x, s = t.y - n.y, c = Math.sqrt(o * o + s * s);
|
|
1743
|
+
return a < c ? -1 : a === c ? 0 : 1;
|
|
1744
|
+
}), a[0]) : e;
|
|
1745
|
+
}
|
|
1746
|
+
t(ct, "intersectPolygon");
|
|
1747
|
+
var J = {
|
|
1748
|
+
node: et,
|
|
1749
|
+
circle: it,
|
|
1750
|
+
ellipse: nt,
|
|
1751
|
+
polygon: ct,
|
|
1752
|
+
rect: We
|
|
1753
|
+
};
|
|
1754
|
+
function lt(t, n) {
|
|
1755
|
+
let { labelStyles: r } = y(n);
|
|
1756
|
+
n.labelStyle = r;
|
|
1757
|
+
let i = W(n), a = i;
|
|
1758
|
+
i || (a = "anchor");
|
|
1759
|
+
let o = t.insert("g").attr("class", a).attr("id", n.domId || n.id), { cssStyles: s } = n, c = V.svg(o), l = v(n, {
|
|
1760
|
+
fill: "black",
|
|
1761
|
+
stroke: "none",
|
|
1762
|
+
fillStyle: "solid"
|
|
1763
|
+
});
|
|
1764
|
+
n.look !== "handDrawn" && (l.roughness = 0);
|
|
1765
|
+
let u = c.circle(0, 0, 2, l), d = o.insert(() => u, ":first-child");
|
|
1766
|
+
return d.attr("class", "anchor").attr("style", h(s)), U(n, d), n.intersect = function(t) {
|
|
1767
|
+
return e.info("Circle intersect", n, 1, t), J.circle(n, 1, t);
|
|
1768
|
+
}, o;
|
|
1769
|
+
}
|
|
1770
|
+
t(lt, "anchor");
|
|
1771
|
+
function ut(e, t, n, r, i, a, o) {
|
|
1772
|
+
let s = (e + n) / 2, c = (t + r) / 2, l = Math.atan2(r - t, n - e), u = (n - e) / 2, d = (r - t) / 2, f = u / i, p = d / a, m = Math.sqrt(f ** 2 + p ** 2);
|
|
1773
|
+
if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
|
|
1774
|
+
let h = Math.sqrt(1 - m ** 2), g = s + h * a * Math.sin(l) * (o ? -1 : 1), _ = c - h * i * Math.cos(l) * (o ? -1 : 1), v = Math.atan2((t - _) / a, (e - g) / i), y = Math.atan2((r - _) / a, (n - g) / i) - v;
|
|
1775
|
+
o && y < 0 && (y += 2 * Math.PI), !o && y > 0 && (y -= 2 * Math.PI);
|
|
1776
|
+
let b = [];
|
|
1777
|
+
for (let e = 0; e < 20; e++) {
|
|
1778
|
+
let t = v + e / 19 * y, n = g + i * Math.cos(t), r = _ + a * Math.sin(t);
|
|
1779
|
+
b.push({
|
|
1780
|
+
x: n,
|
|
1781
|
+
y: r
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
return b;
|
|
1785
|
+
}
|
|
1786
|
+
t(ut, "generateArcPoints");
|
|
1787
|
+
async function dt(e, t) {
|
|
1788
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1789
|
+
t.labelStyle = n;
|
|
1790
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = a.width + t.padding + 20, s = a.height + t.padding, c = s / 2, l = c / (2.5 + s / 50), { cssStyles: u } = t, d = [
|
|
1791
|
+
{
|
|
1792
|
+
x: o / 2,
|
|
1793
|
+
y: -s / 2
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
x: -o / 2,
|
|
1797
|
+
y: -s / 2
|
|
1798
|
+
},
|
|
1799
|
+
...ut(-o / 2, -s / 2, -o / 2, s / 2, l, c, !1),
|
|
1800
|
+
{
|
|
1801
|
+
x: o / 2,
|
|
1802
|
+
y: s / 2
|
|
1803
|
+
},
|
|
1804
|
+
...ut(o / 2, s / 2, o / 2, -s / 2, l, c, !0)
|
|
1805
|
+
], f = V.svg(i), p = v(t, {});
|
|
1806
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
1807
|
+
let m = G(d), h = f.path(m, p), g = i.insert(() => h, ":first-child");
|
|
1808
|
+
return g.attr("class", "basic label-container"), u && t.look !== "handDrawn" && g.selectAll("path").attr("style", u), r && t.look !== "handDrawn" && g.selectAll("path").attr("style", r), g.attr("transform", `translate(${l / 2}, 0)`), U(t, g), t.intersect = function(e) {
|
|
1809
|
+
return J.polygon(t, d, e);
|
|
1810
|
+
}, i;
|
|
1811
|
+
}
|
|
1812
|
+
t(dt, "bowTieRect");
|
|
1813
|
+
function Y(e, t, n, r) {
|
|
1814
|
+
return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
|
|
1815
|
+
return e.x + "," + e.y;
|
|
1816
|
+
}).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
|
|
1817
|
+
}
|
|
1818
|
+
t(Y, "insertPolygonShape");
|
|
1819
|
+
async function ft(e, t) {
|
|
1820
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1821
|
+
t.labelStyle = n;
|
|
1822
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = a.height + t.padding, s = a.width + t.padding + 12, c = s, l = -o, u = [
|
|
1823
|
+
{
|
|
1824
|
+
x: 12,
|
|
1825
|
+
y: l
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
x: c,
|
|
1829
|
+
y: l
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
x: c,
|
|
1833
|
+
y: 0
|
|
1834
|
+
},
|
|
1835
|
+
{
|
|
1836
|
+
x: 0,
|
|
1837
|
+
y: 0
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
x: 0,
|
|
1841
|
+
y: l + 12
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
x: 12,
|
|
1845
|
+
y: l
|
|
1846
|
+
}
|
|
1847
|
+
], d, { cssStyles: f } = t;
|
|
1848
|
+
if (t.look === "handDrawn") {
|
|
1849
|
+
let e = V.svg(i), n = v(t, {}), r = G(u), a = e.path(r, n);
|
|
1850
|
+
d = i.insert(() => a, ":first-child").attr("transform", `translate(${-s / 2}, ${o / 2})`), f && d.attr("style", f);
|
|
1851
|
+
} else d = Y(i, s, o, u);
|
|
1852
|
+
return r && d.attr("style", r), U(t, d), t.intersect = function(e) {
|
|
1853
|
+
return J.polygon(t, u, e);
|
|
1854
|
+
}, i;
|
|
1855
|
+
}
|
|
1856
|
+
t(ft, "card");
|
|
1857
|
+
function pt(e, t) {
|
|
1858
|
+
let { nodeStyles: n } = y(t);
|
|
1859
|
+
t.label = "";
|
|
1860
|
+
let r = e.insert("g").attr("class", W(t)).attr("id", t.domId ?? t.id), { cssStyles: i } = t, a = Math.max(28, t.width ?? 0), o = [
|
|
1861
|
+
{
|
|
1862
|
+
x: 0,
|
|
1863
|
+
y: a / 2
|
|
1864
|
+
},
|
|
1865
|
+
{
|
|
1866
|
+
x: a / 2,
|
|
1867
|
+
y: 0
|
|
1868
|
+
},
|
|
1869
|
+
{
|
|
1870
|
+
x: 0,
|
|
1871
|
+
y: -a / 2
|
|
1872
|
+
},
|
|
1873
|
+
{
|
|
1874
|
+
x: -a / 2,
|
|
1875
|
+
y: 0
|
|
1876
|
+
}
|
|
1877
|
+
], s = V.svg(r), c = v(t, {});
|
|
1878
|
+
t.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
|
|
1879
|
+
let l = G(o), u = s.path(l, c), d = r.insert(() => u, ":first-child");
|
|
1880
|
+
return i && t.look !== "handDrawn" && d.selectAll("path").attr("style", i), n && t.look !== "handDrawn" && d.selectAll("path").attr("style", n), t.width = 28, t.height = 28, t.intersect = function(e) {
|
|
1881
|
+
return J.polygon(t, o, e);
|
|
1882
|
+
}, r;
|
|
1883
|
+
}
|
|
1884
|
+
t(pt, "choice");
|
|
1885
|
+
async function mt(t, n, r) {
|
|
1886
|
+
let { labelStyles: i, nodeStyles: a } = y(n);
|
|
1887
|
+
n.labelStyle = i;
|
|
1888
|
+
let { shapeSvg: o, bbox: s, halfPadding: c } = await H(t, n, W(n)), l = r?.padding ?? c, u = s.width / 2 + l, d, { cssStyles: f } = n;
|
|
1889
|
+
if (n.look === "handDrawn") {
|
|
1890
|
+
let e = V.svg(o), t = v(n, {}), r = e.circle(0, 0, u * 2, t);
|
|
1891
|
+
d = o.insert(() => r, ":first-child"), d.attr("class", "basic label-container").attr("style", h(f));
|
|
1892
|
+
} else d = o.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", a).attr("r", u).attr("cx", 0).attr("cy", 0);
|
|
1893
|
+
return U(n, d), n.calcIntersect = function(e, t) {
|
|
1894
|
+
let n = e.width / 2;
|
|
1895
|
+
return J.circle(e, n, t);
|
|
1896
|
+
}, n.intersect = function(t) {
|
|
1897
|
+
return e.info("Circle intersect", n, u, t), J.circle(n, u, t);
|
|
1898
|
+
}, o;
|
|
1899
|
+
}
|
|
1900
|
+
t(mt, "circle");
|
|
1901
|
+
function ht(e) {
|
|
1902
|
+
let t = Math.cos(Math.PI / 4), n = Math.sin(Math.PI / 4), r = e * 2, i = {
|
|
1903
|
+
x: r / 2 * t,
|
|
1904
|
+
y: r / 2 * n
|
|
1905
|
+
}, a = {
|
|
1906
|
+
x: -(r / 2) * t,
|
|
1907
|
+
y: r / 2 * n
|
|
1908
|
+
}, o = {
|
|
1909
|
+
x: -(r / 2) * t,
|
|
1910
|
+
y: -(r / 2) * n
|
|
1911
|
+
}, s = {
|
|
1912
|
+
x: r / 2 * t,
|
|
1913
|
+
y: -(r / 2) * n
|
|
1914
|
+
};
|
|
1915
|
+
return `M ${a.x},${a.y} L ${s.x},${s.y}
|
|
1916
|
+
M ${i.x},${i.y} L ${o.x},${o.y}`;
|
|
1917
|
+
}
|
|
1918
|
+
t(ht, "createLine");
|
|
1919
|
+
function gt(t, n) {
|
|
1920
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
1921
|
+
n.labelStyle = r, n.label = "";
|
|
1922
|
+
let a = t.insert("g").attr("class", W(n)).attr("id", n.domId ?? n.id), o = Math.max(30, n?.width ?? 0), { cssStyles: s } = n, c = V.svg(a), l = v(n, {});
|
|
1923
|
+
n.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
|
|
1924
|
+
let u = c.circle(0, 0, o * 2, l), d = ht(o), f = c.path(d, l), p = a.insert(() => u, ":first-child");
|
|
1925
|
+
return p.insert(() => f), s && n.look !== "handDrawn" && p.selectAll("path").attr("style", s), i && n.look !== "handDrawn" && p.selectAll("path").attr("style", i), U(n, p), n.intersect = function(t) {
|
|
1926
|
+
return e.info("crossedCircle intersect", n, {
|
|
1927
|
+
radius: o,
|
|
1928
|
+
point: t
|
|
1929
|
+
}), J.circle(n, o, t);
|
|
1930
|
+
}, a;
|
|
1931
|
+
}
|
|
1932
|
+
t(gt, "crossedCircle");
|
|
1933
|
+
function X(e, t, n, r = 100, i = 0, a = 180) {
|
|
1934
|
+
let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
|
|
1935
|
+
for (let i = 0; i < r; i++) {
|
|
1936
|
+
let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
|
|
1937
|
+
o.push({
|
|
1938
|
+
x: -a,
|
|
1939
|
+
y: -l
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1942
|
+
return o;
|
|
1943
|
+
}
|
|
1944
|
+
t(X, "generateCirclePoints");
|
|
1945
|
+
async function _t(e, t) {
|
|
1946
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
1947
|
+
t.labelStyle = n;
|
|
1948
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = a.width + (t.padding ?? 0), c = a.height + (t.padding ?? 0), l = Math.max(5, c * .1), { cssStyles: u } = t, d = [
|
|
1949
|
+
...X(s / 2, -c / 2, l, 30, -90, 0),
|
|
1950
|
+
{
|
|
1951
|
+
x: -s / 2 - l,
|
|
1952
|
+
y: l
|
|
1953
|
+
},
|
|
1954
|
+
...X(s / 2 + l * 2, -l, l, 20, -180, -270),
|
|
1955
|
+
...X(s / 2 + l * 2, l, l, 20, -90, -180),
|
|
1956
|
+
{
|
|
1957
|
+
x: -s / 2 - l,
|
|
1958
|
+
y: -c / 2
|
|
1959
|
+
},
|
|
1960
|
+
...X(s / 2, c / 2, l, 20, 0, 90)
|
|
1961
|
+
], f = [
|
|
1962
|
+
{
|
|
1963
|
+
x: s / 2,
|
|
1964
|
+
y: -c / 2 - l
|
|
1965
|
+
},
|
|
1966
|
+
{
|
|
1967
|
+
x: -s / 2,
|
|
1968
|
+
y: -c / 2 - l
|
|
1969
|
+
},
|
|
1970
|
+
...X(s / 2, -c / 2, l, 20, -90, 0),
|
|
1971
|
+
{
|
|
1972
|
+
x: -s / 2 - l,
|
|
1973
|
+
y: -l
|
|
1974
|
+
},
|
|
1975
|
+
...X(s / 2 + s * .1, -l, l, 20, -180, -270),
|
|
1976
|
+
...X(s / 2 + s * .1, l, l, 20, -90, -180),
|
|
1977
|
+
{
|
|
1978
|
+
x: -s / 2 - l,
|
|
1979
|
+
y: c / 2
|
|
1980
|
+
},
|
|
1981
|
+
...X(s / 2, c / 2, l, 20, 0, 90),
|
|
1982
|
+
{
|
|
1983
|
+
x: -s / 2,
|
|
1984
|
+
y: c / 2 + l
|
|
1985
|
+
},
|
|
1986
|
+
{
|
|
1987
|
+
x: s / 2,
|
|
1988
|
+
y: c / 2 + l
|
|
1989
|
+
}
|
|
1990
|
+
], p = V.svg(i), m = v(t, { fill: "none" });
|
|
1991
|
+
t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
1992
|
+
let h = G(d).replace("Z", ""), g = p.path(h, m), _ = G(f), b = p.path(_, { ...m }), x = i.insert("g", ":first-child");
|
|
1993
|
+
return x.insert(() => b, ":first-child").attr("stroke-opacity", 0), x.insert(() => g, ":first-child"), x.attr("class", "text"), u && t.look !== "handDrawn" && x.selectAll("path").attr("style", u), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.attr("transform", `translate(${l}, 0)`), o.attr("transform", `translate(${-s / 2 + l - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), U(t, x), t.intersect = function(e) {
|
|
1994
|
+
return J.polygon(t, f, e);
|
|
1995
|
+
}, i;
|
|
1996
|
+
}
|
|
1997
|
+
t(_t, "curlyBraceLeft");
|
|
1998
|
+
function Z(e, t, n, r = 100, i = 0, a = 180) {
|
|
1999
|
+
let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
|
|
2000
|
+
for (let i = 0; i < r; i++) {
|
|
2001
|
+
let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
|
|
2002
|
+
o.push({
|
|
2003
|
+
x: a,
|
|
2004
|
+
y: l
|
|
2005
|
+
});
|
|
2006
|
+
}
|
|
2007
|
+
return o;
|
|
2008
|
+
}
|
|
2009
|
+
t(Z, "generateCirclePoints");
|
|
2010
|
+
async function vt(e, t) {
|
|
2011
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2012
|
+
t.labelStyle = n;
|
|
2013
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = a.width + (t.padding ?? 0), c = a.height + (t.padding ?? 0), l = Math.max(5, c * .1), { cssStyles: u } = t, d = [
|
|
2014
|
+
...Z(s / 2, -c / 2, l, 20, -90, 0),
|
|
2015
|
+
{
|
|
2016
|
+
x: s / 2 + l,
|
|
2017
|
+
y: -l
|
|
2018
|
+
},
|
|
2019
|
+
...Z(s / 2 + l * 2, -l, l, 20, -180, -270),
|
|
2020
|
+
...Z(s / 2 + l * 2, l, l, 20, -90, -180),
|
|
2021
|
+
{
|
|
2022
|
+
x: s / 2 + l,
|
|
2023
|
+
y: c / 2
|
|
2024
|
+
},
|
|
2025
|
+
...Z(s / 2, c / 2, l, 20, 0, 90)
|
|
2026
|
+
], f = [
|
|
2027
|
+
{
|
|
2028
|
+
x: -s / 2,
|
|
2029
|
+
y: -c / 2 - l
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
x: s / 2,
|
|
2033
|
+
y: -c / 2 - l
|
|
2034
|
+
},
|
|
2035
|
+
...Z(s / 2, -c / 2, l, 20, -90, 0),
|
|
2036
|
+
{
|
|
2037
|
+
x: s / 2 + l,
|
|
2038
|
+
y: -l
|
|
2039
|
+
},
|
|
2040
|
+
...Z(s / 2 + l * 2, -l, l, 20, -180, -270),
|
|
2041
|
+
...Z(s / 2 + l * 2, l, l, 20, -90, -180),
|
|
2042
|
+
{
|
|
2043
|
+
x: s / 2 + l,
|
|
2044
|
+
y: c / 2
|
|
2045
|
+
},
|
|
2046
|
+
...Z(s / 2, c / 2, l, 20, 0, 90),
|
|
2047
|
+
{
|
|
2048
|
+
x: s / 2,
|
|
2049
|
+
y: c / 2 + l
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
x: -s / 2,
|
|
2053
|
+
y: c / 2 + l
|
|
2054
|
+
}
|
|
2055
|
+
], p = V.svg(i), m = v(t, { fill: "none" });
|
|
2056
|
+
t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
2057
|
+
let h = G(d).replace("Z", ""), g = p.path(h, m), _ = G(f), b = p.path(_, { ...m }), x = i.insert("g", ":first-child");
|
|
2058
|
+
return x.insert(() => b, ":first-child").attr("stroke-opacity", 0), x.insert(() => g, ":first-child"), x.attr("class", "text"), u && t.look !== "handDrawn" && x.selectAll("path").attr("style", u), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.attr("transform", `translate(${-l}, 0)`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), U(t, x), t.intersect = function(e) {
|
|
2059
|
+
return J.polygon(t, f, e);
|
|
2060
|
+
}, i;
|
|
2061
|
+
}
|
|
2062
|
+
t(vt, "curlyBraceRight");
|
|
2063
|
+
function Q(e, t, n, r = 100, i = 0, a = 180) {
|
|
2064
|
+
let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
|
|
2065
|
+
for (let i = 0; i < r; i++) {
|
|
2066
|
+
let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
|
|
2067
|
+
o.push({
|
|
2068
|
+
x: -a,
|
|
2069
|
+
y: -l
|
|
2070
|
+
});
|
|
2071
|
+
}
|
|
2072
|
+
return o;
|
|
2073
|
+
}
|
|
2074
|
+
t(Q, "generateCirclePoints");
|
|
2075
|
+
async function yt(e, t) {
|
|
2076
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2077
|
+
t.labelStyle = n;
|
|
2078
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = a.width + (t.padding ?? 0), c = a.height + (t.padding ?? 0), l = Math.max(5, c * .1), { cssStyles: u } = t, d = [
|
|
2079
|
+
...Q(s / 2, -c / 2, l, 30, -90, 0),
|
|
2080
|
+
{
|
|
2081
|
+
x: -s / 2 - l,
|
|
2082
|
+
y: l
|
|
2083
|
+
},
|
|
2084
|
+
...Q(s / 2 + l * 2, -l, l, 20, -180, -270),
|
|
2085
|
+
...Q(s / 2 + l * 2, l, l, 20, -90, -180),
|
|
2086
|
+
{
|
|
2087
|
+
x: -s / 2 - l,
|
|
2088
|
+
y: -c / 2
|
|
2089
|
+
},
|
|
2090
|
+
...Q(s / 2, c / 2, l, 20, 0, 90)
|
|
2091
|
+
], f = [
|
|
2092
|
+
...Q(-s / 2 + l + l / 2, -c / 2, l, 20, -90, -180),
|
|
2093
|
+
{
|
|
2094
|
+
x: s / 2 - l / 2,
|
|
2095
|
+
y: l
|
|
2096
|
+
},
|
|
2097
|
+
...Q(-s / 2 - l / 2, -l, l, 20, 0, 90),
|
|
2098
|
+
...Q(-s / 2 - l / 2, l, l, 20, -90, 0),
|
|
2099
|
+
{
|
|
2100
|
+
x: s / 2 - l / 2,
|
|
2101
|
+
y: -l
|
|
2102
|
+
},
|
|
2103
|
+
...Q(-s / 2 + l + l / 2, c / 2, l, 30, -180, -270)
|
|
2104
|
+
], p = [
|
|
2105
|
+
{
|
|
2106
|
+
x: s / 2,
|
|
2107
|
+
y: -c / 2 - l
|
|
2108
|
+
},
|
|
2109
|
+
{
|
|
2110
|
+
x: -s / 2,
|
|
2111
|
+
y: -c / 2 - l
|
|
2112
|
+
},
|
|
2113
|
+
...Q(s / 2, -c / 2, l, 20, -90, 0),
|
|
2114
|
+
{
|
|
2115
|
+
x: -s / 2 - l,
|
|
2116
|
+
y: -l
|
|
2117
|
+
},
|
|
2118
|
+
...Q(s / 2 + l * 2, -l, l, 20, -180, -270),
|
|
2119
|
+
...Q(s / 2 + l * 2, l, l, 20, -90, -180),
|
|
2120
|
+
{
|
|
2121
|
+
x: -s / 2 - l,
|
|
2122
|
+
y: c / 2
|
|
2123
|
+
},
|
|
2124
|
+
...Q(s / 2, c / 2, l, 20, 0, 90),
|
|
2125
|
+
{
|
|
2126
|
+
x: -s / 2,
|
|
2127
|
+
y: c / 2 + l
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
x: s / 2 - l - l / 2,
|
|
2131
|
+
y: c / 2 + l
|
|
2132
|
+
},
|
|
2133
|
+
...Q(-s / 2 + l + l / 2, -c / 2, l, 20, -90, -180),
|
|
2134
|
+
{
|
|
2135
|
+
x: s / 2 - l / 2,
|
|
2136
|
+
y: l
|
|
2137
|
+
},
|
|
2138
|
+
...Q(-s / 2 - l / 2, -l, l, 20, 0, 90),
|
|
2139
|
+
...Q(-s / 2 - l / 2, l, l, 20, -90, 0),
|
|
2140
|
+
{
|
|
2141
|
+
x: s / 2 - l / 2,
|
|
2142
|
+
y: -l
|
|
2143
|
+
},
|
|
2144
|
+
...Q(-s / 2 + l + l / 2, c / 2, l, 30, -180, -270)
|
|
2145
|
+
], m = V.svg(i), h = v(t, { fill: "none" });
|
|
2146
|
+
t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
2147
|
+
let g = G(d).replace("Z", ""), _ = m.path(g, h), b = G(f).replace("Z", ""), x = m.path(b, h), S = G(p), C = m.path(S, { ...h }), w = i.insert("g", ":first-child");
|
|
2148
|
+
return w.insert(() => C, ":first-child").attr("stroke-opacity", 0), w.insert(() => _, ":first-child"), w.insert(() => x, ":first-child"), w.attr("class", "text"), u && t.look !== "handDrawn" && w.selectAll("path").attr("style", u), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), w.attr("transform", `translate(${l - l / 4}, 0)`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), U(t, w), t.intersect = function(e) {
|
|
2149
|
+
return J.polygon(t, p, e);
|
|
2150
|
+
}, i;
|
|
2151
|
+
}
|
|
2152
|
+
t(yt, "curlyBraces");
|
|
2153
|
+
async function bt(e, t) {
|
|
2154
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2155
|
+
t.labelStyle = n;
|
|
2156
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = Math.max(80, (a.width + (t.padding ?? 0) * 2) * 1.25, t?.width ?? 0), s = Math.max(20, a.height + (t.padding ?? 0) * 2, t?.height ?? 0), c = s / 2, { cssStyles: l } = t, u = V.svg(i), d = v(t, {});
|
|
2157
|
+
t.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
|
|
2158
|
+
let f = o, p = s, m = f - c, h = p / 4, g = [
|
|
2159
|
+
{
|
|
2160
|
+
x: m,
|
|
2161
|
+
y: 0
|
|
2162
|
+
},
|
|
2163
|
+
{
|
|
2164
|
+
x: h,
|
|
2165
|
+
y: 0
|
|
2166
|
+
},
|
|
2167
|
+
{
|
|
2168
|
+
x: 0,
|
|
2169
|
+
y: p / 2
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
x: h,
|
|
2173
|
+
y: p
|
|
2174
|
+
},
|
|
2175
|
+
{
|
|
2176
|
+
x: m,
|
|
2177
|
+
y: p
|
|
2178
|
+
},
|
|
2179
|
+
...Ue(-m, -p / 2, c, 50, 270, 90)
|
|
2180
|
+
], _ = G(g), b = u.path(_, d), x = i.insert(() => b, ":first-child");
|
|
2181
|
+
return x.attr("class", "basic label-container"), l && t.look !== "handDrawn" && x.selectChildren("path").attr("style", l), r && t.look !== "handDrawn" && x.selectChildren("path").attr("style", r), x.attr("transform", `translate(${-o / 2}, ${-s / 2})`), U(t, x), t.intersect = function(e) {
|
|
2182
|
+
return J.polygon(t, g, e);
|
|
2183
|
+
}, i;
|
|
2184
|
+
}
|
|
2185
|
+
t(bt, "curvedTrapezoid");
|
|
2186
|
+
var xt = /* @__PURE__ */ t((e, t, n, r, i, a) => [
|
|
2187
|
+
`M${e},${t + a}`,
|
|
2188
|
+
`a${i},${a} 0,0,0 ${n},0`,
|
|
2189
|
+
`a${i},${a} 0,0,0 ${-n},0`,
|
|
2190
|
+
`l0,${r}`,
|
|
2191
|
+
`a${i},${a} 0,0,0 ${n},0`,
|
|
2192
|
+
`l0,${-r}`
|
|
2193
|
+
].join(" "), "createCylinderPathD"), St = /* @__PURE__ */ t((e, t, n, r, i, a) => [
|
|
2194
|
+
`M${e},${t + a}`,
|
|
2195
|
+
`M${e + n},${t + a}`,
|
|
2196
|
+
`a${i},${a} 0,0,0 ${-n},0`,
|
|
2197
|
+
`l0,${r}`,
|
|
2198
|
+
`a${i},${a} 0,0,0 ${n},0`,
|
|
2199
|
+
`l0,${-r}`
|
|
2200
|
+
].join(" "), "createOuterCylinderPathD"), Ct = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD");
|
|
2201
|
+
async function wt(e, t) {
|
|
2202
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2203
|
+
t.labelStyle = n;
|
|
2204
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + t.padding, t.width ?? 0), c = s / 2, l = c / (2.5 + s / 50), u = Math.max(a.height + l + t.padding, t.height ?? 0), d, { cssStyles: f } = t;
|
|
2205
|
+
if (t.look === "handDrawn") {
|
|
2206
|
+
let e = V.svg(i), n = St(0, 0, s, u, c, l), r = Ct(0, l, s, u, c, l), a = e.path(n, v(t, {})), o = e.path(r, v(t, { fill: "none" }));
|
|
2207
|
+
d = i.insert(() => o, ":first-child"), d = i.insert(() => a, ":first-child"), d.attr("class", "basic label-container"), f && d.attr("style", f);
|
|
2208
|
+
} else {
|
|
2209
|
+
let e = xt(0, 0, s, u, c, l);
|
|
2210
|
+
d = i.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", h(f)).attr("style", r);
|
|
2211
|
+
}
|
|
2212
|
+
return d.attr("label-offset-y", l), d.attr("transform", `translate(${-s / 2}, ${-(u / 2 + l)})`), U(t, d), o.attr("transform", `translate(${-(a.width / 2) - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + (t.padding ?? 0) / 1.5 - (a.y - (a.top ?? 0))})`), t.intersect = function(e) {
|
|
2213
|
+
let n = J.rect(t, e), r = n.x - (t.x ?? 0);
|
|
2214
|
+
if (c != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - l)) {
|
|
2215
|
+
let i = l * l * (1 - r * r / (c * c));
|
|
2216
|
+
i > 0 && (i = Math.sqrt(i)), i = l - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
|
|
2217
|
+
}
|
|
2218
|
+
return n;
|
|
2219
|
+
}, i;
|
|
2220
|
+
}
|
|
2221
|
+
t(wt, "cylinder");
|
|
2222
|
+
async function Tt(e, t) {
|
|
2223
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2224
|
+
t.labelStyle = n;
|
|
2225
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = a.width + t.padding, c = a.height + t.padding, l = c * .2, u = -s / 2, d = -c / 2 - l / 2, { cssStyles: f } = t, p = V.svg(i), m = v(t, {});
|
|
2226
|
+
t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
2227
|
+
let h = [
|
|
2228
|
+
{
|
|
2229
|
+
x: u,
|
|
2230
|
+
y: d + l
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
x: -u,
|
|
2234
|
+
y: d + l
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
x: -u,
|
|
2238
|
+
y: -d
|
|
2239
|
+
},
|
|
2240
|
+
{
|
|
2241
|
+
x: u,
|
|
2242
|
+
y: -d
|
|
2243
|
+
},
|
|
2244
|
+
{
|
|
2245
|
+
x: u,
|
|
2246
|
+
y: d
|
|
2247
|
+
},
|
|
2248
|
+
{
|
|
2249
|
+
x: -u,
|
|
2250
|
+
y: d
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
x: -u,
|
|
2254
|
+
y: d + l
|
|
2255
|
+
}
|
|
2256
|
+
], g = p.polygon(h.map((e) => [e.x, e.y]), m), _ = i.insert(() => g, ":first-child");
|
|
2257
|
+
return _.attr("class", "basic label-container"), f && t.look !== "handDrawn" && _.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && _.selectAll("path").attr("style", r), o.attr("transform", `translate(${u + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))}, ${d + l + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), U(t, _), t.intersect = function(e) {
|
|
2258
|
+
return J.rect(t, e);
|
|
2259
|
+
}, i;
|
|
2260
|
+
}
|
|
2261
|
+
t(Tt, "dividedRectangle");
|
|
2262
|
+
async function Et(t, n) {
|
|
2263
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
2264
|
+
n.labelStyle = r;
|
|
2265
|
+
let { shapeSvg: a, bbox: o, halfPadding: s } = await H(t, n, W(n)), c = o.width / 2 + s + 5, l = o.width / 2 + s, u, { cssStyles: d } = n;
|
|
2266
|
+
if (n.look === "handDrawn") {
|
|
2267
|
+
let e = V.svg(a), t = v(n, {
|
|
2268
|
+
roughness: .2,
|
|
2269
|
+
strokeWidth: 2.5
|
|
2270
|
+
}), r = v(n, {
|
|
2271
|
+
roughness: .2,
|
|
2272
|
+
strokeWidth: 1.5
|
|
2273
|
+
}), i = e.circle(0, 0, c * 2, t), o = e.circle(0, 0, l * 2, r);
|
|
2274
|
+
u = a.insert("g", ":first-child"), u.attr("class", h(n.cssClasses)).attr("style", h(d)), u.node()?.appendChild(i), u.node()?.appendChild(o);
|
|
2275
|
+
} else {
|
|
2276
|
+
u = a.insert("g", ":first-child");
|
|
2277
|
+
let e = u.insert("circle", ":first-child"), t = u.insert("circle");
|
|
2278
|
+
u.attr("class", "basic label-container").attr("style", i), e.attr("class", "outer-circle").attr("style", i).attr("r", c).attr("cx", 0).attr("cy", 0), t.attr("class", "inner-circle").attr("style", i).attr("r", l).attr("cx", 0).attr("cy", 0);
|
|
2279
|
+
}
|
|
2280
|
+
return U(n, u), n.intersect = function(t) {
|
|
2281
|
+
return e.info("DoubleCircle intersect", n, c, t), J.circle(n, c, t);
|
|
2282
|
+
}, a;
|
|
2283
|
+
}
|
|
2284
|
+
t(Et, "doublecircle");
|
|
2285
|
+
function Dt(t, n, { config: { themeVariables: r } }) {
|
|
2286
|
+
let { labelStyles: i, nodeStyles: a } = y(n);
|
|
2287
|
+
n.label = "", n.labelStyle = i;
|
|
2288
|
+
let o = t.insert("g").attr("class", W(n)).attr("id", n.domId ?? n.id), { cssStyles: s } = n, c = V.svg(o), { nodeBorder: l } = r, u = v(n, { fillStyle: "solid" });
|
|
2289
|
+
n.look !== "handDrawn" && (u.roughness = 0);
|
|
2290
|
+
let d = c.circle(0, 0, 14, u), f = o.insert(() => d, ":first-child");
|
|
2291
|
+
return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 && n.look !== "handDrawn" && f.selectAll("path").attr("style", s), a && n.look !== "handDrawn" && f.selectAll("path").attr("style", a), U(n, f), n.intersect = function(t) {
|
|
2292
|
+
return e.info("filledCircle intersect", n, {
|
|
2293
|
+
radius: 7,
|
|
2294
|
+
point: t
|
|
2295
|
+
}), J.circle(n, 7, t);
|
|
2296
|
+
}, o;
|
|
2297
|
+
}
|
|
2298
|
+
t(Dt, "filledCircle");
|
|
2299
|
+
async function Ot(t, n) {
|
|
2300
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
2301
|
+
n.labelStyle = r;
|
|
2302
|
+
let { shapeSvg: a, bbox: o, label: s } = await H(t, n, W(n)), c = o.width + (n.padding ?? 0), l = c + o.height, u = c + o.height, d = [
|
|
2303
|
+
{
|
|
2304
|
+
x: 0,
|
|
2305
|
+
y: -l
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
x: u,
|
|
2309
|
+
y: -l
|
|
2310
|
+
},
|
|
2311
|
+
{
|
|
2312
|
+
x: u / 2,
|
|
2313
|
+
y: 0
|
|
2314
|
+
}
|
|
2315
|
+
], { cssStyles: f } = n, p = V.svg(a), m = v(n, {});
|
|
2316
|
+
n.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
2317
|
+
let h = G(d), g = p.path(h, m), _ = a.insert(() => g, ":first-child").attr("transform", `translate(${-l / 2}, ${l / 2})`);
|
|
2318
|
+
return f && n.look !== "handDrawn" && _.selectChildren("path").attr("style", f), i && n.look !== "handDrawn" && _.selectChildren("path").attr("style", i), n.width = c, n.height = l, U(n, _), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${-l / 2 + (n.padding ?? 0) / 2 + (o.y - (o.top ?? 0))})`), n.intersect = function(t) {
|
|
2319
|
+
return e.info("Triangle intersect", n, d, t), J.polygon(n, d, t);
|
|
2320
|
+
}, a;
|
|
2321
|
+
}
|
|
2322
|
+
t(Ot, "flippedTriangle");
|
|
2323
|
+
function kt(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
|
|
2324
|
+
let { nodeStyles: a } = y(t);
|
|
2325
|
+
t.label = "";
|
|
2326
|
+
let o = e.insert("g").attr("class", W(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = Math.max(70, t?.width ?? 0), l = Math.max(10, t?.height ?? 0);
|
|
2327
|
+
n === "LR" && (c = Math.max(10, t?.width ?? 0), l = Math.max(70, t?.height ?? 0));
|
|
2328
|
+
let u = -1 * c / 2, d = -1 * l / 2, f = V.svg(o), p = v(t, {
|
|
2329
|
+
stroke: i.lineColor,
|
|
2330
|
+
fill: i.lineColor
|
|
2331
|
+
});
|
|
2332
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
2333
|
+
let m = f.rectangle(u, d, c, l, p), h = o.insert(() => m, ":first-child");
|
|
2334
|
+
s && t.look !== "handDrawn" && h.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && h.selectAll("path").attr("style", a), U(t, h);
|
|
2335
|
+
let g = r?.padding ?? 0;
|
|
2336
|
+
return t.width && t.height && (t.width += g / 2 || 0, t.height += g / 2 || 0), t.intersect = function(e) {
|
|
2337
|
+
return J.rect(t, e);
|
|
2338
|
+
}, o;
|
|
2339
|
+
}
|
|
2340
|
+
t(kt, "forkJoin");
|
|
2341
|
+
async function At(t, n) {
|
|
2342
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
2343
|
+
n.labelStyle = r;
|
|
2344
|
+
let { shapeSvg: a, bbox: o } = await H(t, n, W(n)), s = Math.max(80, o.width + (n.padding ?? 0) * 2, n?.width ?? 0), c = Math.max(50, o.height + (n.padding ?? 0) * 2, n?.height ?? 0), l = c / 2, { cssStyles: u } = n, d = V.svg(a), f = v(n, {});
|
|
2345
|
+
n.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
|
|
2346
|
+
let p = [
|
|
2347
|
+
{
|
|
2348
|
+
x: -s / 2,
|
|
2349
|
+
y: -c / 2
|
|
2350
|
+
},
|
|
2351
|
+
{
|
|
2352
|
+
x: s / 2 - l,
|
|
2353
|
+
y: -c / 2
|
|
2354
|
+
},
|
|
2355
|
+
...Ue(-s / 2 + l, 0, l, 50, 90, 270),
|
|
2356
|
+
{
|
|
2357
|
+
x: s / 2 - l,
|
|
2358
|
+
y: c / 2
|
|
2359
|
+
},
|
|
2360
|
+
{
|
|
2361
|
+
x: -s / 2,
|
|
2362
|
+
y: c / 2
|
|
2363
|
+
}
|
|
2364
|
+
], m = G(p), h = d.path(m, f), g = a.insert(() => h, ":first-child");
|
|
2365
|
+
return g.attr("class", "basic label-container"), u && n.look !== "handDrawn" && g.selectChildren("path").attr("style", u), i && n.look !== "handDrawn" && g.selectChildren("path").attr("style", i), U(n, g), n.intersect = function(t) {
|
|
2366
|
+
return e.info("Pill intersect", n, {
|
|
2367
|
+
radius: l,
|
|
2368
|
+
point: t
|
|
2369
|
+
}), J.polygon(n, p, t);
|
|
2370
|
+
}, a;
|
|
2371
|
+
}
|
|
2372
|
+
t(At, "halfRoundedRectangle");
|
|
2373
|
+
async function jt(e, t) {
|
|
2374
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2375
|
+
t.labelStyle = n;
|
|
2376
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = a.height + (t.padding ?? 0), s = a.width + (t.padding ?? 0) * 2.5, { cssStyles: c } = t, l = V.svg(i), u = v(t, {});
|
|
2377
|
+
t.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
|
|
2378
|
+
let d = s / 2, f = d / 6;
|
|
2379
|
+
d += f;
|
|
2380
|
+
let p = o / 2, m = p / 2, h = d - m, g = [
|
|
2381
|
+
{
|
|
2382
|
+
x: -h,
|
|
2383
|
+
y: -p
|
|
2384
|
+
},
|
|
2385
|
+
{
|
|
2386
|
+
x: 0,
|
|
2387
|
+
y: -p
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
x: h,
|
|
2391
|
+
y: -p
|
|
2392
|
+
},
|
|
2393
|
+
{
|
|
2394
|
+
x: d,
|
|
2395
|
+
y: 0
|
|
2396
|
+
},
|
|
2397
|
+
{
|
|
2398
|
+
x: h,
|
|
2399
|
+
y: p
|
|
2400
|
+
},
|
|
2401
|
+
{
|
|
2402
|
+
x: 0,
|
|
2403
|
+
y: p
|
|
2404
|
+
},
|
|
2405
|
+
{
|
|
2406
|
+
x: -h,
|
|
2407
|
+
y: p
|
|
2408
|
+
},
|
|
2409
|
+
{
|
|
2410
|
+
x: -d,
|
|
2411
|
+
y: 0
|
|
2412
|
+
}
|
|
2413
|
+
], _ = G(g), b = l.path(_, u), x = i.insert(() => b, ":first-child");
|
|
2414
|
+
return x.attr("class", "basic label-container"), c && t.look !== "handDrawn" && x.selectChildren("path").attr("style", c), r && t.look !== "handDrawn" && x.selectChildren("path").attr("style", r), t.width = s, t.height = o, U(t, x), t.intersect = function(e) {
|
|
2415
|
+
return J.polygon(t, g, e);
|
|
2416
|
+
}, i;
|
|
2417
|
+
}
|
|
2418
|
+
t(jt, "hexagon");
|
|
2419
|
+
async function Mt(t, n) {
|
|
2420
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
2421
|
+
n.label = "", n.labelStyle = r;
|
|
2422
|
+
let { shapeSvg: a } = await H(t, n, W(n)), o = Math.max(30, n?.width ?? 0), s = Math.max(30, n?.height ?? 0), { cssStyles: c } = n, l = V.svg(a), u = v(n, {});
|
|
2423
|
+
n.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
|
|
2424
|
+
let d = [
|
|
2425
|
+
{
|
|
2426
|
+
x: 0,
|
|
2427
|
+
y: 0
|
|
2428
|
+
},
|
|
2429
|
+
{
|
|
2430
|
+
x: o,
|
|
2431
|
+
y: 0
|
|
2432
|
+
},
|
|
2433
|
+
{
|
|
2434
|
+
x: 0,
|
|
2435
|
+
y: s
|
|
2436
|
+
},
|
|
2437
|
+
{
|
|
2438
|
+
x: o,
|
|
2439
|
+
y: s
|
|
2440
|
+
}
|
|
2441
|
+
], f = G(d), p = l.path(f, u), m = a.insert(() => p, ":first-child");
|
|
2442
|
+
return m.attr("class", "basic label-container"), c && n.look !== "handDrawn" && m.selectChildren("path").attr("style", c), i && n.look !== "handDrawn" && m.selectChildren("path").attr("style", i), m.attr("transform", `translate(${-o / 2}, ${-s / 2})`), U(n, m), n.intersect = function(t) {
|
|
2443
|
+
return e.info("Pill intersect", n, { points: d }), J.polygon(n, d, t);
|
|
2444
|
+
}, a;
|
|
2445
|
+
}
|
|
2446
|
+
t(Mt, "hourglass");
|
|
2447
|
+
async function Nt(t, n, { config: { themeVariables: r, flowchart: i } }) {
|
|
2448
|
+
let { labelStyles: a } = y(n);
|
|
2449
|
+
n.labelStyle = a;
|
|
2450
|
+
let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
|
|
2451
|
+
n.width = Math.max(c, l ?? 0);
|
|
2452
|
+
let { shapeSvg: u, bbox: d, label: f } = await H(t, n, "icon-shape default"), p = n.pos === "t", m = c, h = c, { nodeBorder: g } = r, { stylesMap: _ } = x(n), b = -h / 2, S = -m / 2, w = n.label ? 8 : 0, T = V.svg(u), E = v(n, {
|
|
2453
|
+
stroke: "none",
|
|
2454
|
+
fill: "none"
|
|
2455
|
+
});
|
|
2456
|
+
n.look !== "handDrawn" && (E.roughness = 0, E.fillStyle = "solid");
|
|
2457
|
+
let D = T.rectangle(b, S, h, m, E), O = Math.max(h, d.width), k = m + d.height + w, A = T.rectangle(-O / 2, -k / 2, O, k, {
|
|
2458
|
+
...E,
|
|
2459
|
+
fill: "transparent",
|
|
2460
|
+
stroke: "none"
|
|
2461
|
+
}), j = u.insert(() => D, ":first-child"), M = u.insert(() => A);
|
|
2462
|
+
if (n.icon) {
|
|
2463
|
+
let e = u.append("g");
|
|
2464
|
+
e.html(`<g>${await C(n.icon, {
|
|
2465
|
+
height: c,
|
|
2466
|
+
width: c,
|
|
2467
|
+
fallbackPrefix: ""
|
|
2468
|
+
})}</g>`);
|
|
2469
|
+
let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
|
|
2470
|
+
e.attr("transform", `translate(${-r / 2 - a},${p ? d.height / 2 + w / 2 - i / 2 - o : -d.height / 2 - w / 2 - i / 2 - o})`), e.attr("style", `color: ${_.get("stroke") ?? g};`);
|
|
2471
|
+
}
|
|
2472
|
+
return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -k / 2 : k / 2 - d.height})`), j.attr("transform", `translate(0,${p ? d.height / 2 + w / 2 : -d.height / 2 - w / 2})`), U(n, M), n.intersect = function(t) {
|
|
2473
|
+
if (e.info("iconSquare intersect", n, t), !n.label) return J.rect(n, t);
|
|
2474
|
+
let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
|
|
2475
|
+
return o = p ? [
|
|
2476
|
+
{
|
|
2477
|
+
x: r - d.width / 2,
|
|
2478
|
+
y: i - a / 2
|
|
2479
|
+
},
|
|
2480
|
+
{
|
|
2481
|
+
x: r + d.width / 2,
|
|
2482
|
+
y: i - a / 2
|
|
2483
|
+
},
|
|
2484
|
+
{
|
|
2485
|
+
x: r + d.width / 2,
|
|
2486
|
+
y: i - a / 2 + d.height + w
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
x: r + h / 2,
|
|
2490
|
+
y: i - a / 2 + d.height + w
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
x: r + h / 2,
|
|
2494
|
+
y: i + a / 2
|
|
2495
|
+
},
|
|
2496
|
+
{
|
|
2497
|
+
x: r - h / 2,
|
|
2498
|
+
y: i + a / 2
|
|
2499
|
+
},
|
|
2500
|
+
{
|
|
2501
|
+
x: r - h / 2,
|
|
2502
|
+
y: i - a / 2 + d.height + w
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
x: r - d.width / 2,
|
|
2506
|
+
y: i - a / 2 + d.height + w
|
|
2507
|
+
}
|
|
2508
|
+
] : [
|
|
2509
|
+
{
|
|
2510
|
+
x: r - h / 2,
|
|
2511
|
+
y: i - a / 2
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
x: r + h / 2,
|
|
2515
|
+
y: i - a / 2
|
|
2516
|
+
},
|
|
2517
|
+
{
|
|
2518
|
+
x: r + h / 2,
|
|
2519
|
+
y: i - a / 2 + m
|
|
2520
|
+
},
|
|
2521
|
+
{
|
|
2522
|
+
x: r + d.width / 2,
|
|
2523
|
+
y: i - a / 2 + m
|
|
2524
|
+
},
|
|
2525
|
+
{
|
|
2526
|
+
x: r + d.width / 2 / 2,
|
|
2527
|
+
y: i + a / 2
|
|
2528
|
+
},
|
|
2529
|
+
{
|
|
2530
|
+
x: r - d.width / 2,
|
|
2531
|
+
y: i + a / 2
|
|
2532
|
+
},
|
|
2533
|
+
{
|
|
2534
|
+
x: r - d.width / 2,
|
|
2535
|
+
y: i - a / 2 + m
|
|
2536
|
+
},
|
|
2537
|
+
{
|
|
2538
|
+
x: r - h / 2,
|
|
2539
|
+
y: i - a / 2 + m
|
|
2540
|
+
}
|
|
2541
|
+
], J.polygon(n, o, t);
|
|
2542
|
+
}, u;
|
|
2543
|
+
}
|
|
2544
|
+
t(Nt, "icon");
|
|
2545
|
+
async function Pt(t, n, { config: { themeVariables: r, flowchart: i } }) {
|
|
2546
|
+
let { labelStyles: a } = y(n);
|
|
2547
|
+
n.labelStyle = a;
|
|
2548
|
+
let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
|
|
2549
|
+
n.width = Math.max(c, l ?? 0);
|
|
2550
|
+
let { shapeSvg: u, bbox: d, label: f } = await H(t, n, "icon-shape default"), p = n.label ? 8 : 0, m = n.pos === "t", { nodeBorder: h, mainBkg: g } = r, { stylesMap: _ } = x(n), b = V.svg(u), S = v(n, {});
|
|
2551
|
+
n.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid"), S.stroke = _.get("fill") ?? g;
|
|
2552
|
+
let w = u.append("g");
|
|
2553
|
+
n.icon && w.html(`<g>${await C(n.icon, {
|
|
2554
|
+
height: c,
|
|
2555
|
+
width: c,
|
|
2556
|
+
fallbackPrefix: ""
|
|
2557
|
+
})}</g>`);
|
|
2558
|
+
let T = w.node().getBBox(), E = T.width, D = T.height, O = T.x, k = T.y, A = Math.max(E, D) * Math.SQRT2 + 40, j = b.circle(0, 0, A, S), M = Math.max(A, d.width), N = A + d.height + p, P = b.rectangle(-M / 2, -N / 2, M, N, {
|
|
2559
|
+
...S,
|
|
2560
|
+
fill: "transparent",
|
|
2561
|
+
stroke: "none"
|
|
2562
|
+
}), F = u.insert(() => j, ":first-child"), I = u.insert(() => P);
|
|
2563
|
+
return w.attr("transform", `translate(${-E / 2 - O},${m ? d.height / 2 + p / 2 - D / 2 - k : -d.height / 2 - p / 2 - D / 2 - k})`), w.attr("style", `color: ${_.get("stroke") ?? h};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -N / 2 : N / 2 - d.height})`), F.attr("transform", `translate(0,${m ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), U(n, I), n.intersect = function(t) {
|
|
2564
|
+
return e.info("iconSquare intersect", n, t), J.rect(n, t);
|
|
2565
|
+
}, u;
|
|
2566
|
+
}
|
|
2567
|
+
t(Pt, "iconCircle");
|
|
2568
|
+
async function Ft(t, n, { config: { themeVariables: r, flowchart: i } }) {
|
|
2569
|
+
let { labelStyles: a } = y(n);
|
|
2570
|
+
n.labelStyle = a;
|
|
2571
|
+
let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
|
|
2572
|
+
n.width = Math.max(c, l ?? 0);
|
|
2573
|
+
let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await H(t, n, "icon-shape default"), m = n.pos === "t", h = c + f * 2, g = c + f * 2, { nodeBorder: _, mainBkg: b } = r, { stylesMap: S } = x(n), w = -g / 2, T = -h / 2, E = n.label ? 8 : 0, D = V.svg(u), O = v(n, {});
|
|
2574
|
+
n.look !== "handDrawn" && (O.roughness = 0, O.fillStyle = "solid"), O.stroke = S.get("fill") ?? b;
|
|
2575
|
+
let k = D.path(q(w, T, g, h, 5), O), A = Math.max(g, d.width), j = h + d.height + E, M = D.rectangle(-A / 2, -j / 2, A, j, {
|
|
2576
|
+
...O,
|
|
2577
|
+
fill: "transparent",
|
|
2578
|
+
stroke: "none"
|
|
2579
|
+
}), N = u.insert(() => k, ":first-child").attr("class", "icon-shape2"), P = u.insert(() => M);
|
|
2580
|
+
if (n.icon) {
|
|
2581
|
+
let e = u.append("g");
|
|
2582
|
+
e.html(`<g>${await C(n.icon, {
|
|
2583
|
+
height: c,
|
|
2584
|
+
width: c,
|
|
2585
|
+
fallbackPrefix: ""
|
|
2586
|
+
})}</g>`);
|
|
2587
|
+
let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
|
|
2588
|
+
e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + E / 2 - i / 2 - o : -d.height / 2 - E / 2 - i / 2 - o})`), e.attr("style", `color: ${S.get("stroke") ?? _};`);
|
|
2589
|
+
}
|
|
2590
|
+
return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -j / 2 : j / 2 - d.height})`), N.attr("transform", `translate(0,${m ? d.height / 2 + E / 2 : -d.height / 2 - E / 2})`), U(n, P), n.intersect = function(t) {
|
|
2591
|
+
if (e.info("iconSquare intersect", n, t), !n.label) return J.rect(n, t);
|
|
2592
|
+
let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
|
|
2593
|
+
return o = m ? [
|
|
2594
|
+
{
|
|
2595
|
+
x: r - d.width / 2,
|
|
2596
|
+
y: i - a / 2
|
|
2597
|
+
},
|
|
2598
|
+
{
|
|
2599
|
+
x: r + d.width / 2,
|
|
2600
|
+
y: i - a / 2
|
|
2601
|
+
},
|
|
2602
|
+
{
|
|
2603
|
+
x: r + d.width / 2,
|
|
2604
|
+
y: i - a / 2 + d.height + E
|
|
2605
|
+
},
|
|
2606
|
+
{
|
|
2607
|
+
x: r + g / 2,
|
|
2608
|
+
y: i - a / 2 + d.height + E
|
|
2609
|
+
},
|
|
2610
|
+
{
|
|
2611
|
+
x: r + g / 2,
|
|
2612
|
+
y: i + a / 2
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
x: r - g / 2,
|
|
2616
|
+
y: i + a / 2
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
x: r - g / 2,
|
|
2620
|
+
y: i - a / 2 + d.height + E
|
|
2621
|
+
},
|
|
2622
|
+
{
|
|
2623
|
+
x: r - d.width / 2,
|
|
2624
|
+
y: i - a / 2 + d.height + E
|
|
2625
|
+
}
|
|
2626
|
+
] : [
|
|
2627
|
+
{
|
|
2628
|
+
x: r - g / 2,
|
|
2629
|
+
y: i - a / 2
|
|
2630
|
+
},
|
|
2631
|
+
{
|
|
2632
|
+
x: r + g / 2,
|
|
2633
|
+
y: i - a / 2
|
|
2634
|
+
},
|
|
2635
|
+
{
|
|
2636
|
+
x: r + g / 2,
|
|
2637
|
+
y: i - a / 2 + h
|
|
2638
|
+
},
|
|
2639
|
+
{
|
|
2640
|
+
x: r + d.width / 2,
|
|
2641
|
+
y: i - a / 2 + h
|
|
2642
|
+
},
|
|
2643
|
+
{
|
|
2644
|
+
x: r + d.width / 2 / 2,
|
|
2645
|
+
y: i + a / 2
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
x: r - d.width / 2,
|
|
2649
|
+
y: i + a / 2
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
x: r - d.width / 2,
|
|
2653
|
+
y: i - a / 2 + h
|
|
2654
|
+
},
|
|
2655
|
+
{
|
|
2656
|
+
x: r - g / 2,
|
|
2657
|
+
y: i - a / 2 + h
|
|
2658
|
+
}
|
|
2659
|
+
], J.polygon(n, o, t);
|
|
2660
|
+
}, u;
|
|
2661
|
+
}
|
|
2662
|
+
t(Ft, "iconRounded");
|
|
2663
|
+
async function It(t, n, { config: { themeVariables: r, flowchart: i } }) {
|
|
2664
|
+
let { labelStyles: a } = y(n);
|
|
2665
|
+
n.labelStyle = a;
|
|
2666
|
+
let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
|
|
2667
|
+
n.width = Math.max(c, l ?? 0);
|
|
2668
|
+
let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await H(t, n, "icon-shape default"), m = n.pos === "t", h = c + f * 2, g = c + f * 2, { nodeBorder: _, mainBkg: b } = r, { stylesMap: S } = x(n), w = -g / 2, T = -h / 2, E = n.label ? 8 : 0, D = V.svg(u), O = v(n, {});
|
|
2669
|
+
n.look !== "handDrawn" && (O.roughness = 0, O.fillStyle = "solid"), O.stroke = S.get("fill") ?? b;
|
|
2670
|
+
let k = D.path(q(w, T, g, h, .1), O), A = Math.max(g, d.width), j = h + d.height + E, M = D.rectangle(-A / 2, -j / 2, A, j, {
|
|
2671
|
+
...O,
|
|
2672
|
+
fill: "transparent",
|
|
2673
|
+
stroke: "none"
|
|
2674
|
+
}), N = u.insert(() => k, ":first-child"), P = u.insert(() => M);
|
|
2675
|
+
if (n.icon) {
|
|
2676
|
+
let e = u.append("g");
|
|
2677
|
+
e.html(`<g>${await C(n.icon, {
|
|
2678
|
+
height: c,
|
|
2679
|
+
width: c,
|
|
2680
|
+
fallbackPrefix: ""
|
|
2681
|
+
})}</g>`);
|
|
2682
|
+
let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
|
|
2683
|
+
e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + E / 2 - i / 2 - o : -d.height / 2 - E / 2 - i / 2 - o})`), e.attr("style", `color: ${S.get("stroke") ?? _};`);
|
|
2684
|
+
}
|
|
2685
|
+
return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -j / 2 : j / 2 - d.height})`), N.attr("transform", `translate(0,${m ? d.height / 2 + E / 2 : -d.height / 2 - E / 2})`), U(n, P), n.intersect = function(t) {
|
|
2686
|
+
if (e.info("iconSquare intersect", n, t), !n.label) return J.rect(n, t);
|
|
2687
|
+
let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
|
|
2688
|
+
return o = m ? [
|
|
2689
|
+
{
|
|
2690
|
+
x: r - d.width / 2,
|
|
2691
|
+
y: i - a / 2
|
|
2692
|
+
},
|
|
2693
|
+
{
|
|
2694
|
+
x: r + d.width / 2,
|
|
2695
|
+
y: i - a / 2
|
|
2696
|
+
},
|
|
2697
|
+
{
|
|
2698
|
+
x: r + d.width / 2,
|
|
2699
|
+
y: i - a / 2 + d.height + E
|
|
2700
|
+
},
|
|
2701
|
+
{
|
|
2702
|
+
x: r + g / 2,
|
|
2703
|
+
y: i - a / 2 + d.height + E
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
x: r + g / 2,
|
|
2707
|
+
y: i + a / 2
|
|
2708
|
+
},
|
|
2709
|
+
{
|
|
2710
|
+
x: r - g / 2,
|
|
2711
|
+
y: i + a / 2
|
|
2712
|
+
},
|
|
2713
|
+
{
|
|
2714
|
+
x: r - g / 2,
|
|
2715
|
+
y: i - a / 2 + d.height + E
|
|
2716
|
+
},
|
|
2717
|
+
{
|
|
2718
|
+
x: r - d.width / 2,
|
|
2719
|
+
y: i - a / 2 + d.height + E
|
|
2720
|
+
}
|
|
2721
|
+
] : [
|
|
2722
|
+
{
|
|
2723
|
+
x: r - g / 2,
|
|
2724
|
+
y: i - a / 2
|
|
2725
|
+
},
|
|
2726
|
+
{
|
|
2727
|
+
x: r + g / 2,
|
|
2728
|
+
y: i - a / 2
|
|
2729
|
+
},
|
|
2730
|
+
{
|
|
2731
|
+
x: r + g / 2,
|
|
2732
|
+
y: i - a / 2 + h
|
|
2733
|
+
},
|
|
2734
|
+
{
|
|
2735
|
+
x: r + d.width / 2,
|
|
2736
|
+
y: i - a / 2 + h
|
|
2737
|
+
},
|
|
2738
|
+
{
|
|
2739
|
+
x: r + d.width / 2 / 2,
|
|
2740
|
+
y: i + a / 2
|
|
2741
|
+
},
|
|
2742
|
+
{
|
|
2743
|
+
x: r - d.width / 2,
|
|
2744
|
+
y: i + a / 2
|
|
2745
|
+
},
|
|
2746
|
+
{
|
|
2747
|
+
x: r - d.width / 2,
|
|
2748
|
+
y: i - a / 2 + h
|
|
2749
|
+
},
|
|
2750
|
+
{
|
|
2751
|
+
x: r - g / 2,
|
|
2752
|
+
y: i - a / 2 + h
|
|
2753
|
+
}
|
|
2754
|
+
], J.polygon(n, o, t);
|
|
2755
|
+
}, u;
|
|
2756
|
+
}
|
|
2757
|
+
t(It, "iconSquare");
|
|
2758
|
+
async function Lt(t, n, { config: { flowchart: r } }) {
|
|
2759
|
+
let i = new Image();
|
|
2760
|
+
i.src = n?.img ?? "", await i.decode();
|
|
2761
|
+
let a = Number(i.naturalWidth.toString().replace("px", "")), o = Number(i.naturalHeight.toString().replace("px", ""));
|
|
2762
|
+
n.imageAspectRatio = a / o;
|
|
2763
|
+
let { labelStyles: s } = y(n);
|
|
2764
|
+
n.labelStyle = s;
|
|
2765
|
+
let c = r?.wrappingWidth;
|
|
2766
|
+
n.defaultWidth = r?.wrappingWidth;
|
|
2767
|
+
let l = Math.max(n.label ? c ?? 0 : 0, n?.assetWidth ?? a), u = n.constraint === "on" && n?.assetHeight ? n.assetHeight * n.imageAspectRatio : l, d = n.constraint === "on" ? u / n.imageAspectRatio : n?.assetHeight ?? o;
|
|
2768
|
+
n.width = Math.max(u, c ?? 0);
|
|
2769
|
+
let { shapeSvg: f, bbox: p, label: m } = await H(t, n, "image-shape default"), h = n.pos === "t", g = -u / 2, _ = -d / 2, b = n.label ? 8 : 0, x = V.svg(f), S = v(n, {});
|
|
2770
|
+
n.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
|
|
2771
|
+
let C = x.rectangle(g, _, u, d, S), w = Math.max(u, p.width), T = d + p.height + b, E = x.rectangle(-w / 2, -T / 2, w, T, {
|
|
2772
|
+
...S,
|
|
2773
|
+
fill: "none",
|
|
2774
|
+
stroke: "none"
|
|
2775
|
+
}), D = f.insert(() => C, ":first-child"), O = f.insert(() => E);
|
|
2776
|
+
if (n.img) {
|
|
2777
|
+
let e = f.append("image");
|
|
2778
|
+
e.attr("href", n.img), e.attr("width", u), e.attr("height", d), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-u / 2},${h ? T / 2 - d : -T / 2})`);
|
|
2779
|
+
}
|
|
2780
|
+
return m.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${h ? -d / 2 - p.height / 2 - b / 2 : d / 2 - p.height / 2 + b / 2})`), D.attr("transform", `translate(0,${h ? p.height / 2 + b / 2 : -p.height / 2 - b / 2})`), U(n, O), n.intersect = function(t) {
|
|
2781
|
+
if (e.info("iconSquare intersect", n, t), !n.label) return J.rect(n, t);
|
|
2782
|
+
let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
|
|
2783
|
+
return o = h ? [
|
|
2784
|
+
{
|
|
2785
|
+
x: r - p.width / 2,
|
|
2786
|
+
y: i - a / 2
|
|
2787
|
+
},
|
|
2788
|
+
{
|
|
2789
|
+
x: r + p.width / 2,
|
|
2790
|
+
y: i - a / 2
|
|
2791
|
+
},
|
|
2792
|
+
{
|
|
2793
|
+
x: r + p.width / 2,
|
|
2794
|
+
y: i - a / 2 + p.height + b
|
|
2795
|
+
},
|
|
2796
|
+
{
|
|
2797
|
+
x: r + u / 2,
|
|
2798
|
+
y: i - a / 2 + p.height + b
|
|
2799
|
+
},
|
|
2800
|
+
{
|
|
2801
|
+
x: r + u / 2,
|
|
2802
|
+
y: i + a / 2
|
|
2803
|
+
},
|
|
2804
|
+
{
|
|
2805
|
+
x: r - u / 2,
|
|
2806
|
+
y: i + a / 2
|
|
2807
|
+
},
|
|
2808
|
+
{
|
|
2809
|
+
x: r - u / 2,
|
|
2810
|
+
y: i - a / 2 + p.height + b
|
|
2811
|
+
},
|
|
2812
|
+
{
|
|
2813
|
+
x: r - p.width / 2,
|
|
2814
|
+
y: i - a / 2 + p.height + b
|
|
2815
|
+
}
|
|
2816
|
+
] : [
|
|
2817
|
+
{
|
|
2818
|
+
x: r - u / 2,
|
|
2819
|
+
y: i - a / 2
|
|
2820
|
+
},
|
|
2821
|
+
{
|
|
2822
|
+
x: r + u / 2,
|
|
2823
|
+
y: i - a / 2
|
|
2824
|
+
},
|
|
2825
|
+
{
|
|
2826
|
+
x: r + u / 2,
|
|
2827
|
+
y: i - a / 2 + d
|
|
2828
|
+
},
|
|
2829
|
+
{
|
|
2830
|
+
x: r + p.width / 2,
|
|
2831
|
+
y: i - a / 2 + d
|
|
2832
|
+
},
|
|
2833
|
+
{
|
|
2834
|
+
x: r + p.width / 2 / 2,
|
|
2835
|
+
y: i + a / 2
|
|
2836
|
+
},
|
|
2837
|
+
{
|
|
2838
|
+
x: r - p.width / 2,
|
|
2839
|
+
y: i + a / 2
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
x: r - p.width / 2,
|
|
2843
|
+
y: i - a / 2 + d
|
|
2844
|
+
},
|
|
2845
|
+
{
|
|
2846
|
+
x: r - u / 2,
|
|
2847
|
+
y: i - a / 2 + d
|
|
2848
|
+
}
|
|
2849
|
+
], J.polygon(n, o, t);
|
|
2850
|
+
}, f;
|
|
2851
|
+
}
|
|
2852
|
+
t(Lt, "imageSquare");
|
|
2853
|
+
async function Rt(e, t) {
|
|
2854
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2855
|
+
t.labelStyle = n;
|
|
2856
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), c = [
|
|
2857
|
+
{
|
|
2858
|
+
x: 0,
|
|
2859
|
+
y: 0
|
|
2860
|
+
},
|
|
2861
|
+
{
|
|
2862
|
+
x: o,
|
|
2863
|
+
y: 0
|
|
2864
|
+
},
|
|
2865
|
+
{
|
|
2866
|
+
x: o + 3 * s / 6,
|
|
2867
|
+
y: -s
|
|
2868
|
+
},
|
|
2869
|
+
{
|
|
2870
|
+
x: -3 * s / 6,
|
|
2871
|
+
y: -s
|
|
2872
|
+
}
|
|
2873
|
+
], l, { cssStyles: u } = t;
|
|
2874
|
+
if (t.look === "handDrawn") {
|
|
2875
|
+
let e = V.svg(i), n = v(t, {}), r = G(c), a = e.path(r, n);
|
|
2876
|
+
l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2}, ${s / 2})`), u && l.attr("style", u);
|
|
2877
|
+
} else l = Y(i, o, s, c);
|
|
2878
|
+
return r && l.attr("style", r), t.width = o, t.height = s, U(t, l), t.intersect = function(e) {
|
|
2879
|
+
return J.polygon(t, c, e);
|
|
2880
|
+
}, i;
|
|
2881
|
+
}
|
|
2882
|
+
t(Rt, "inv_trapezoid");
|
|
2883
|
+
async function zt(e, t, n) {
|
|
2884
|
+
let { labelStyles: r, nodeStyles: i } = y(t);
|
|
2885
|
+
t.labelStyle = r;
|
|
2886
|
+
let { shapeSvg: a, bbox: o } = await H(e, t, W(t)), s = Math.max(o.width + n.labelPaddingX * 2, t?.width || 0), c = Math.max(o.height + n.labelPaddingY * 2, t?.height || 0), l = -s / 2, u = -c / 2, d, { rx: f, ry: p } = t, { cssStyles: m } = t;
|
|
2887
|
+
if (n?.rx && n.ry && (f = n.rx, p = n.ry), t.look === "handDrawn") {
|
|
2888
|
+
let e = V.svg(a), n = v(t, {}), r = f || p ? e.path(q(l, u, s, c, f || 0), n) : e.rectangle(l, u, s, c, n);
|
|
2889
|
+
d = a.insert(() => r, ":first-child"), d.attr("class", "basic label-container").attr("style", h(m));
|
|
2890
|
+
} else d = a.insert("rect", ":first-child"), d.attr("class", "basic label-container").attr("style", i).attr("rx", h(f)).attr("ry", h(p)).attr("x", l).attr("y", u).attr("width", s).attr("height", c);
|
|
2891
|
+
return U(t, d), t.calcIntersect = function(e, t) {
|
|
2892
|
+
return J.rect(e, t);
|
|
2893
|
+
}, t.intersect = function(e) {
|
|
2894
|
+
return J.rect(t, e);
|
|
2895
|
+
}, a;
|
|
2896
|
+
}
|
|
2897
|
+
t(zt, "drawRect");
|
|
2898
|
+
async function Bt(e, t) {
|
|
2899
|
+
let { shapeSvg: n, bbox: r, label: i } = await H(e, t, "label"), a = n.insert("rect", ":first-child");
|
|
2900
|
+
return a.attr("width", .1).attr("height", .1), n.attr("class", "label edgeLabel"), i.attr("transform", `translate(${-(r.width / 2) - (r.x - (r.left ?? 0))}, ${-(r.height / 2) - (r.y - (r.top ?? 0))})`), U(t, a), t.intersect = function(e) {
|
|
2901
|
+
return J.rect(t, e);
|
|
2902
|
+
}, n;
|
|
2903
|
+
}
|
|
2904
|
+
t(Bt, "labelRect");
|
|
2905
|
+
async function Vt(e, t) {
|
|
2906
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2907
|
+
t.labelStyle = n;
|
|
2908
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = Math.max(a.width + (t.padding ?? 0), t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0), t?.height ?? 0), c = [
|
|
2909
|
+
{
|
|
2910
|
+
x: 0,
|
|
2911
|
+
y: 0
|
|
2912
|
+
},
|
|
2913
|
+
{
|
|
2914
|
+
x: o + 3 * s / 6,
|
|
2915
|
+
y: 0
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
x: o,
|
|
2919
|
+
y: -s
|
|
2920
|
+
},
|
|
2921
|
+
{
|
|
2922
|
+
x: -(3 * s) / 6,
|
|
2923
|
+
y: -s
|
|
2924
|
+
}
|
|
2925
|
+
], l, { cssStyles: u } = t;
|
|
2926
|
+
if (t.look === "handDrawn") {
|
|
2927
|
+
let e = V.svg(i), n = v(t, {}), r = G(c), a = e.path(r, n);
|
|
2928
|
+
l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2}, ${s / 2})`), u && l.attr("style", u);
|
|
2929
|
+
} else l = Y(i, o, s, c);
|
|
2930
|
+
return r && l.attr("style", r), t.width = o, t.height = s, U(t, l), t.intersect = function(e) {
|
|
2931
|
+
return J.polygon(t, c, e);
|
|
2932
|
+
}, i;
|
|
2933
|
+
}
|
|
2934
|
+
t(Vt, "lean_left");
|
|
2935
|
+
async function Ht(e, t) {
|
|
2936
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
2937
|
+
t.labelStyle = n;
|
|
2938
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = Math.max(a.width + (t.padding ?? 0), t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0), t?.height ?? 0), c = [
|
|
2939
|
+
{
|
|
2940
|
+
x: -3 * s / 6,
|
|
2941
|
+
y: 0
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
x: o,
|
|
2945
|
+
y: 0
|
|
2946
|
+
},
|
|
2947
|
+
{
|
|
2948
|
+
x: o + 3 * s / 6,
|
|
2949
|
+
y: -s
|
|
2950
|
+
},
|
|
2951
|
+
{
|
|
2952
|
+
x: 0,
|
|
2953
|
+
y: -s
|
|
2954
|
+
}
|
|
2955
|
+
], l, { cssStyles: u } = t;
|
|
2956
|
+
if (t.look === "handDrawn") {
|
|
2957
|
+
let e = V.svg(i), n = v(t, {}), r = G(c), a = e.path(r, n);
|
|
2958
|
+
l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2}, ${s / 2})`), u && l.attr("style", u);
|
|
2959
|
+
} else l = Y(i, o, s, c);
|
|
2960
|
+
return r && l.attr("style", r), t.width = o, t.height = s, U(t, l), t.intersect = function(e) {
|
|
2961
|
+
return J.polygon(t, c, e);
|
|
2962
|
+
}, i;
|
|
2963
|
+
}
|
|
2964
|
+
t(Ht, "lean_right");
|
|
2965
|
+
function Ut(t, n) {
|
|
2966
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
2967
|
+
n.label = "", n.labelStyle = r;
|
|
2968
|
+
let a = t.insert("g").attr("class", W(n)).attr("id", n.domId ?? n.id), { cssStyles: o } = n, s = Math.max(35, n?.width ?? 0), c = Math.max(35, n?.height ?? 0), l = [
|
|
2969
|
+
{
|
|
2970
|
+
x: s,
|
|
2971
|
+
y: 0
|
|
2972
|
+
},
|
|
2973
|
+
{
|
|
2974
|
+
x: 0,
|
|
2975
|
+
y: c + 7 / 2
|
|
2976
|
+
},
|
|
2977
|
+
{
|
|
2978
|
+
x: s - 14,
|
|
2979
|
+
y: c + 7 / 2
|
|
2980
|
+
},
|
|
2981
|
+
{
|
|
2982
|
+
x: 0,
|
|
2983
|
+
y: 2 * c
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
x: s,
|
|
2987
|
+
y: c - 7 / 2
|
|
2988
|
+
},
|
|
2989
|
+
{
|
|
2990
|
+
x: 14,
|
|
2991
|
+
y: c - 7 / 2
|
|
2992
|
+
}
|
|
2993
|
+
], u = V.svg(a), d = v(n, {});
|
|
2994
|
+
n.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
|
|
2995
|
+
let f = G(l), p = u.path(f, d), m = a.insert(() => p, ":first-child");
|
|
2996
|
+
return o && n.look !== "handDrawn" && m.selectAll("path").attr("style", o), i && n.look !== "handDrawn" && m.selectAll("path").attr("style", i), m.attr("transform", `translate(-${s / 2},${-c})`), U(n, m), n.intersect = function(t) {
|
|
2997
|
+
return e.info("lightningBolt intersect", n, t), J.polygon(n, l, t);
|
|
2998
|
+
}, a;
|
|
2999
|
+
}
|
|
3000
|
+
t(Ut, "lightningBolt");
|
|
3001
|
+
var Wt = /* @__PURE__ */ t((e, t, n, r, i, a, o) => [
|
|
3002
|
+
`M${e},${t + a}`,
|
|
3003
|
+
`a${i},${a} 0,0,0 ${n},0`,
|
|
3004
|
+
`a${i},${a} 0,0,0 ${-n},0`,
|
|
3005
|
+
`l0,${r}`,
|
|
3006
|
+
`a${i},${a} 0,0,0 ${n},0`,
|
|
3007
|
+
`l0,${-r}`,
|
|
3008
|
+
`M${e},${t + a + o}`,
|
|
3009
|
+
`a${i},${a} 0,0,0 ${n},0`
|
|
3010
|
+
].join(" "), "createCylinderPathD"), Gt = /* @__PURE__ */ t((e, t, n, r, i, a, o) => [
|
|
3011
|
+
`M${e},${t + a}`,
|
|
3012
|
+
`M${e + n},${t + a}`,
|
|
3013
|
+
`a${i},${a} 0,0,0 ${-n},0`,
|
|
3014
|
+
`l0,${r}`,
|
|
3015
|
+
`a${i},${a} 0,0,0 ${n},0`,
|
|
3016
|
+
`l0,${-r}`,
|
|
3017
|
+
`M${e},${t + a + o}`,
|
|
3018
|
+
`a${i},${a} 0,0,0 ${n},0`
|
|
3019
|
+
].join(" "), "createOuterCylinderPathD"), Kt = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD");
|
|
3020
|
+
async function qt(e, t) {
|
|
3021
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3022
|
+
t.labelStyle = n;
|
|
3023
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0), t.width ?? 0), c = s / 2, l = c / (2.5 + s / 50), u = Math.max(a.height + l + (t.padding ?? 0), t.height ?? 0), d = u * .1, f, { cssStyles: p } = t;
|
|
3024
|
+
if (t.look === "handDrawn") {
|
|
3025
|
+
let e = V.svg(i), n = Gt(0, 0, s, u, c, l, d), r = Kt(0, l, s, u, c, l), a = v(t, {}), o = e.path(n, a), m = e.path(r, a);
|
|
3026
|
+
i.insert(() => m, ":first-child").attr("class", "line"), f = i.insert(() => o, ":first-child"), f.attr("class", "basic label-container"), p && f.attr("style", p);
|
|
3027
|
+
} else {
|
|
3028
|
+
let e = Wt(0, 0, s, u, c, l, d);
|
|
3029
|
+
f = i.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", h(p)).attr("style", r);
|
|
3030
|
+
}
|
|
3031
|
+
return f.attr("label-offset-y", l), f.attr("transform", `translate(${-s / 2}, ${-(u / 2 + l)})`), U(t, f), o.attr("transform", `translate(${-(a.width / 2) - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + l - (a.y - (a.top ?? 0))})`), t.intersect = function(e) {
|
|
3032
|
+
let n = J.rect(t, e), r = n.x - (t.x ?? 0);
|
|
3033
|
+
if (c != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - l)) {
|
|
3034
|
+
let i = l * l * (1 - r * r / (c * c));
|
|
3035
|
+
i > 0 && (i = Math.sqrt(i)), i = l - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
|
|
3036
|
+
}
|
|
3037
|
+
return n;
|
|
3038
|
+
}, i;
|
|
3039
|
+
}
|
|
3040
|
+
t(qt, "linedCylinder");
|
|
3041
|
+
async function Jt(e, t) {
|
|
3042
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3043
|
+
t.labelStyle = n;
|
|
3044
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 4, u = c + l, { cssStyles: d } = t, f = V.svg(i), p = v(t, {});
|
|
3045
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
3046
|
+
let m = [
|
|
3047
|
+
{
|
|
3048
|
+
x: -s / 2 - s / 2 * .1,
|
|
3049
|
+
y: -u / 2
|
|
3050
|
+
},
|
|
3051
|
+
{
|
|
3052
|
+
x: -s / 2 - s / 2 * .1,
|
|
3053
|
+
y: u / 2
|
|
3054
|
+
},
|
|
3055
|
+
...K(-s / 2 - s / 2 * .1, u / 2, s / 2 + s / 2 * .1, u / 2, l, .8),
|
|
3056
|
+
{
|
|
3057
|
+
x: s / 2 + s / 2 * .1,
|
|
3058
|
+
y: -u / 2
|
|
3059
|
+
},
|
|
3060
|
+
{
|
|
3061
|
+
x: -s / 2 - s / 2 * .1,
|
|
3062
|
+
y: -u / 2
|
|
3063
|
+
},
|
|
3064
|
+
{
|
|
3065
|
+
x: -s / 2,
|
|
3066
|
+
y: -u / 2
|
|
3067
|
+
},
|
|
3068
|
+
{
|
|
3069
|
+
x: -s / 2,
|
|
3070
|
+
y: u / 2 * 1.1
|
|
3071
|
+
},
|
|
3072
|
+
{
|
|
3073
|
+
x: -s / 2,
|
|
3074
|
+
y: -u / 2
|
|
3075
|
+
}
|
|
3076
|
+
], h = f.polygon(m.map((e) => [e.x, e.y]), p), g = i.insert(() => h, ":first-child");
|
|
3077
|
+
return g.attr("class", "basic label-container"), d && t.look !== "handDrawn" && g.selectAll("path").attr("style", d), r && t.look !== "handDrawn" && g.selectAll("path").attr("style", r), g.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) + s / 2 * .1 / 2 - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) - l / 2 - (a.y - (a.top ?? 0))})`), U(t, g), t.intersect = function(e) {
|
|
3078
|
+
return J.polygon(t, m, e);
|
|
3079
|
+
}, i;
|
|
3080
|
+
}
|
|
3081
|
+
t(Jt, "linedWaveEdgedRect");
|
|
3082
|
+
async function Yt(e, t) {
|
|
3083
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3084
|
+
t.labelStyle = n;
|
|
3085
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = -s / 2, u = -c / 2, { cssStyles: d } = t, f = V.svg(i), p = v(t, {}), m = [
|
|
3086
|
+
{
|
|
3087
|
+
x: l - 5,
|
|
3088
|
+
y: u + 5
|
|
3089
|
+
},
|
|
3090
|
+
{
|
|
3091
|
+
x: l - 5,
|
|
3092
|
+
y: u + c + 5
|
|
3093
|
+
},
|
|
3094
|
+
{
|
|
3095
|
+
x: l + s - 5,
|
|
3096
|
+
y: u + c + 5
|
|
3097
|
+
},
|
|
3098
|
+
{
|
|
3099
|
+
x: l + s - 5,
|
|
3100
|
+
y: u + c
|
|
3101
|
+
},
|
|
3102
|
+
{
|
|
3103
|
+
x: l + s,
|
|
3104
|
+
y: u + c
|
|
3105
|
+
},
|
|
3106
|
+
{
|
|
3107
|
+
x: l + s,
|
|
3108
|
+
y: u + c - 5
|
|
3109
|
+
},
|
|
3110
|
+
{
|
|
3111
|
+
x: l + s + 5,
|
|
3112
|
+
y: u + c - 5
|
|
3113
|
+
},
|
|
3114
|
+
{
|
|
3115
|
+
x: l + s + 5,
|
|
3116
|
+
y: u - 5
|
|
3117
|
+
},
|
|
3118
|
+
{
|
|
3119
|
+
x: l + 5,
|
|
3120
|
+
y: u - 5
|
|
3121
|
+
},
|
|
3122
|
+
{
|
|
3123
|
+
x: l + 5,
|
|
3124
|
+
y: u
|
|
3125
|
+
},
|
|
3126
|
+
{
|
|
3127
|
+
x: l,
|
|
3128
|
+
y: u
|
|
3129
|
+
},
|
|
3130
|
+
{
|
|
3131
|
+
x: l,
|
|
3132
|
+
y: u + 5
|
|
3133
|
+
}
|
|
3134
|
+
], h = [
|
|
3135
|
+
{
|
|
3136
|
+
x: l,
|
|
3137
|
+
y: u + 5
|
|
3138
|
+
},
|
|
3139
|
+
{
|
|
3140
|
+
x: l + s - 5,
|
|
3141
|
+
y: u + 5
|
|
3142
|
+
},
|
|
3143
|
+
{
|
|
3144
|
+
x: l + s - 5,
|
|
3145
|
+
y: u + c
|
|
3146
|
+
},
|
|
3147
|
+
{
|
|
3148
|
+
x: l + s,
|
|
3149
|
+
y: u + c
|
|
3150
|
+
},
|
|
3151
|
+
{
|
|
3152
|
+
x: l + s,
|
|
3153
|
+
y: u
|
|
3154
|
+
},
|
|
3155
|
+
{
|
|
3156
|
+
x: l,
|
|
3157
|
+
y: u
|
|
3158
|
+
}
|
|
3159
|
+
];
|
|
3160
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
3161
|
+
let g = G(m), _ = f.path(g, p), b = G(h), x = f.path(b, {
|
|
3162
|
+
...p,
|
|
3163
|
+
fill: "none"
|
|
3164
|
+
}), S = i.insert(() => x, ":first-child");
|
|
3165
|
+
return S.insert(() => _, ":first-child"), S.attr("class", "basic label-container"), d && t.look !== "handDrawn" && S.selectAll("path").attr("style", d), r && t.look !== "handDrawn" && S.selectAll("path").attr("style", r), o.attr("transform", `translate(${-(a.width / 2) - 5 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 5 - (a.y - (a.top ?? 0))})`), U(t, S), t.intersect = function(e) {
|
|
3166
|
+
return J.polygon(t, m, e);
|
|
3167
|
+
}, i;
|
|
3168
|
+
}
|
|
3169
|
+
t(Yt, "multiRect");
|
|
3170
|
+
async function Xt(e, t) {
|
|
3171
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3172
|
+
t.labelStyle = n;
|
|
3173
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 4, u = c + l, d = -s / 2, f = -u / 2, { cssStyles: p } = t, m = K(d - 5, f + u + 5, d + s - 5, f + u + 5, l, .8), h = m?.[m.length - 1], g = [
|
|
3174
|
+
{
|
|
3175
|
+
x: d - 5,
|
|
3176
|
+
y: f + 5
|
|
3177
|
+
},
|
|
3178
|
+
{
|
|
3179
|
+
x: d - 5,
|
|
3180
|
+
y: f + u + 5
|
|
3181
|
+
},
|
|
3182
|
+
...m,
|
|
3183
|
+
{
|
|
3184
|
+
x: d + s - 5,
|
|
3185
|
+
y: h.y - 5
|
|
3186
|
+
},
|
|
3187
|
+
{
|
|
3188
|
+
x: d + s,
|
|
3189
|
+
y: h.y - 5
|
|
3190
|
+
},
|
|
3191
|
+
{
|
|
3192
|
+
x: d + s,
|
|
3193
|
+
y: h.y - 10
|
|
3194
|
+
},
|
|
3195
|
+
{
|
|
3196
|
+
x: d + s + 5,
|
|
3197
|
+
y: h.y - 10
|
|
3198
|
+
},
|
|
3199
|
+
{
|
|
3200
|
+
x: d + s + 5,
|
|
3201
|
+
y: f - 5
|
|
3202
|
+
},
|
|
3203
|
+
{
|
|
3204
|
+
x: d + 5,
|
|
3205
|
+
y: f - 5
|
|
3206
|
+
},
|
|
3207
|
+
{
|
|
3208
|
+
x: d + 5,
|
|
3209
|
+
y: f
|
|
3210
|
+
},
|
|
3211
|
+
{
|
|
3212
|
+
x: d,
|
|
3213
|
+
y: f
|
|
3214
|
+
},
|
|
3215
|
+
{
|
|
3216
|
+
x: d,
|
|
3217
|
+
y: f + 5
|
|
3218
|
+
}
|
|
3219
|
+
], _ = [
|
|
3220
|
+
{
|
|
3221
|
+
x: d,
|
|
3222
|
+
y: f + 5
|
|
3223
|
+
},
|
|
3224
|
+
{
|
|
3225
|
+
x: d + s - 5,
|
|
3226
|
+
y: f + 5
|
|
3227
|
+
},
|
|
3228
|
+
{
|
|
3229
|
+
x: d + s - 5,
|
|
3230
|
+
y: h.y - 5
|
|
3231
|
+
},
|
|
3232
|
+
{
|
|
3233
|
+
x: d + s,
|
|
3234
|
+
y: h.y - 5
|
|
3235
|
+
},
|
|
3236
|
+
{
|
|
3237
|
+
x: d + s,
|
|
3238
|
+
y: f
|
|
3239
|
+
},
|
|
3240
|
+
{
|
|
3241
|
+
x: d,
|
|
3242
|
+
y: f
|
|
3243
|
+
}
|
|
3244
|
+
], b = V.svg(i), x = v(t, {});
|
|
3245
|
+
t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
|
|
3246
|
+
let S = G(g), C = b.path(S, x), w = G(_), T = b.path(w, x), E = i.insert(() => C, ":first-child");
|
|
3247
|
+
return E.insert(() => T), E.attr("class", "basic label-container"), p && t.look !== "handDrawn" && E.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && E.selectAll("path").attr("style", r), E.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-(a.width / 2) - 5 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 5 - l / 2 - (a.y - (a.top ?? 0))})`), U(t, E), t.intersect = function(e) {
|
|
3248
|
+
return J.polygon(t, g, e);
|
|
3249
|
+
}, i;
|
|
3250
|
+
}
|
|
3251
|
+
t(Xt, "multiWaveEdgedRectangle");
|
|
3252
|
+
async function Zt(e, t, { config: { themeVariables: n } }) {
|
|
3253
|
+
let { labelStyles: r, nodeStyles: i } = y(t);
|
|
3254
|
+
t.labelStyle = r, t.useHtmlLabels || f().flowchart?.htmlLabels !== !1 || (t.centerLabel = !0);
|
|
3255
|
+
let { shapeSvg: a, bbox: o, label: s } = await H(e, t, W(t)), c = Math.max(o.width + (t.padding ?? 0) * 2, t?.width ?? 0), l = Math.max(o.height + (t.padding ?? 0) * 2, t?.height ?? 0), u = -c / 2, d = -l / 2, { cssStyles: p } = t, m = V.svg(a), h = v(t, {
|
|
3256
|
+
fill: n.noteBkgColor,
|
|
3257
|
+
stroke: n.noteBorderColor
|
|
3258
|
+
});
|
|
3259
|
+
t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
3260
|
+
let g = m.rectangle(u, d, c, l, h), _ = a.insert(() => g, ":first-child");
|
|
3261
|
+
return _.attr("class", "basic label-container"), p && t.look !== "handDrawn" && _.selectAll("path").attr("style", p), i && t.look !== "handDrawn" && _.selectAll("path").attr("style", i), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${-(o.height / 2) - (o.y - (o.top ?? 0))})`), U(t, _), t.intersect = function(e) {
|
|
3262
|
+
return J.rect(t, e);
|
|
3263
|
+
}, a;
|
|
3264
|
+
}
|
|
3265
|
+
t(Zt, "note");
|
|
3266
|
+
var Qt = /* @__PURE__ */ t((e, t, n) => [
|
|
3267
|
+
`M${e + n / 2},${t}`,
|
|
3268
|
+
`L${e + n},${t - n / 2}`,
|
|
3269
|
+
`L${e + n / 2},${t - n}`,
|
|
3270
|
+
`L${e},${t - n / 2}`,
|
|
3271
|
+
"Z"
|
|
3272
|
+
].join(" "), "createDecisionBoxPathD");
|
|
3273
|
+
async function $t(e, t) {
|
|
3274
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3275
|
+
t.labelStyle = n;
|
|
3276
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = a.width + t.padding + (a.height + t.padding), s = .5, c = [
|
|
3277
|
+
{
|
|
3278
|
+
x: o / 2,
|
|
3279
|
+
y: 0
|
|
3280
|
+
},
|
|
3281
|
+
{
|
|
3282
|
+
x: o,
|
|
3283
|
+
y: -o / 2
|
|
3284
|
+
},
|
|
3285
|
+
{
|
|
3286
|
+
x: o / 2,
|
|
3287
|
+
y: -o
|
|
3288
|
+
},
|
|
3289
|
+
{
|
|
3290
|
+
x: 0,
|
|
3291
|
+
y: -o / 2
|
|
3292
|
+
}
|
|
3293
|
+
], l, { cssStyles: u } = t;
|
|
3294
|
+
if (t.look === "handDrawn") {
|
|
3295
|
+
let e = V.svg(i), n = v(t, {}), r = Qt(0, 0, o), a = e.path(r, n);
|
|
3296
|
+
l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2 + s}, ${o / 2})`), u && l.attr("style", u);
|
|
3297
|
+
} else l = Y(i, o, o, c), l.attr("transform", `translate(${-o / 2 + s}, ${o / 2})`);
|
|
3298
|
+
return r && l.attr("style", r), U(t, l), t.calcIntersect = function(e, t) {
|
|
3299
|
+
let n = e.width, r = [
|
|
3300
|
+
{
|
|
3301
|
+
x: n / 2,
|
|
3302
|
+
y: 0
|
|
3303
|
+
},
|
|
3304
|
+
{
|
|
3305
|
+
x: n,
|
|
3306
|
+
y: -n / 2
|
|
3307
|
+
},
|
|
3308
|
+
{
|
|
3309
|
+
x: n / 2,
|
|
3310
|
+
y: -n
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
x: 0,
|
|
3314
|
+
y: -n / 2
|
|
3315
|
+
}
|
|
3316
|
+
], i = J.polygon(e, r, t);
|
|
3317
|
+
return {
|
|
3318
|
+
x: i.x - .5,
|
|
3319
|
+
y: i.y - .5
|
|
3320
|
+
};
|
|
3321
|
+
}, t.intersect = function(e) {
|
|
3322
|
+
return this.calcIntersect(t, e);
|
|
3323
|
+
}, i;
|
|
3324
|
+
}
|
|
3325
|
+
t($t, "question");
|
|
3326
|
+
async function en(e, t) {
|
|
3327
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3328
|
+
t.labelStyle = n;
|
|
3329
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0), t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0), t?.height ?? 0), l = -s / 2, u = -c / 2, d = u / 2, f = [
|
|
3330
|
+
{
|
|
3331
|
+
x: l + d,
|
|
3332
|
+
y: u
|
|
3333
|
+
},
|
|
3334
|
+
{
|
|
3335
|
+
x: l,
|
|
3336
|
+
y: 0
|
|
3337
|
+
},
|
|
3338
|
+
{
|
|
3339
|
+
x: l + d,
|
|
3340
|
+
y: -u
|
|
3341
|
+
},
|
|
3342
|
+
{
|
|
3343
|
+
x: -l,
|
|
3344
|
+
y: -u
|
|
3345
|
+
},
|
|
3346
|
+
{
|
|
3347
|
+
x: -l,
|
|
3348
|
+
y: u
|
|
3349
|
+
}
|
|
3350
|
+
], { cssStyles: p } = t, m = V.svg(i), h = v(t, {});
|
|
3351
|
+
t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
3352
|
+
let g = G(f), _ = m.path(g, h), b = i.insert(() => _, ":first-child");
|
|
3353
|
+
return b.attr("class", "basic label-container"), p && t.look !== "handDrawn" && b.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && b.selectAll("path").attr("style", r), b.attr("transform", `translate(${-d / 2},0)`), o.attr("transform", `translate(${-d / 2 - a.width / 2 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) - (a.y - (a.top ?? 0))})`), U(t, b), t.intersect = function(e) {
|
|
3354
|
+
return J.polygon(t, f, e);
|
|
3355
|
+
}, i;
|
|
3356
|
+
}
|
|
3357
|
+
t(en, "rect_left_inv_arrow");
|
|
3358
|
+
async function tn(t, r) {
|
|
3359
|
+
let { labelStyles: i, nodeStyles: a } = y(r);
|
|
3360
|
+
r.labelStyle = i;
|
|
3361
|
+
let o;
|
|
3362
|
+
o = r.cssClasses ? "node " + r.cssClasses : "node default";
|
|
3363
|
+
let s = t.insert("g").attr("class", o).attr("id", r.domId || r.id), l = s.insert("g"), d = s.insert("g").attr("class", "label").attr("style", a), f = r.description, p = r.label, m = d.node().appendChild(await qe(p, r.labelStyle, !0, !0)), h = {
|
|
3364
|
+
width: 0,
|
|
3365
|
+
height: 0
|
|
3366
|
+
};
|
|
3367
|
+
if (u(c()?.flowchart?.htmlLabels)) {
|
|
3368
|
+
let e = m.children[0], t = n(m);
|
|
3369
|
+
h = e.getBoundingClientRect(), t.attr("width", h.width), t.attr("height", h.height);
|
|
3370
|
+
}
|
|
3371
|
+
e.info("Text 2", f);
|
|
3372
|
+
let g = f || [], _ = m.getBBox(), b = d.node().appendChild(await qe(g.join ? g.join("<br/>") : g, r.labelStyle, !0, !0)), x = b.children[0], S = n(b);
|
|
3373
|
+
h = x.getBoundingClientRect(), S.attr("width", h.width), S.attr("height", h.height);
|
|
3374
|
+
let C = (r.padding || 0) / 2;
|
|
3375
|
+
n(b).attr("transform", "translate( " + (h.width > _.width ? 0 : (_.width - h.width) / 2) + ", " + (_.height + C + 5) + ")"), n(m).attr("transform", "translate( " + (h.width < _.width ? 0 : -(_.width - h.width) / 2) + ", 0)"), h = d.node().getBBox(), d.attr("transform", "translate(" + -h.width / 2 + ", " + (-h.height / 2 - C + 3) + ")");
|
|
3376
|
+
let w = h.width + (r.padding || 0), T = h.height + (r.padding || 0), E = -h.width / 2 - C, D = -h.height / 2 - C, O, k;
|
|
3377
|
+
if (r.look === "handDrawn") {
|
|
3378
|
+
let t = V.svg(s), n = v(r, {}), i = t.path(q(E, D, w, T, r.rx || 0), n), a = t.line(-h.width / 2 - C, -h.height / 2 - C + _.height + C, h.width / 2 + C, -h.height / 2 - C + _.height + C, n);
|
|
3379
|
+
k = s.insert(() => (e.debug("Rough node insert CXC", i), a), ":first-child"), O = s.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child");
|
|
3380
|
+
} else O = l.insert("rect", ":first-child"), k = l.insert("line"), O.attr("class", "outer title-state").attr("style", a).attr("x", -h.width / 2 - C).attr("y", -h.height / 2 - C).attr("width", h.width + (r.padding || 0)).attr("height", h.height + (r.padding || 0)), k.attr("class", "divider").attr("x1", -h.width / 2 - C).attr("x2", h.width / 2 + C).attr("y1", -h.height / 2 - C + _.height + C).attr("y2", -h.height / 2 - C + _.height + C);
|
|
3381
|
+
return U(r, O), r.intersect = function(e) {
|
|
3382
|
+
return J.rect(r, e);
|
|
3383
|
+
}, s;
|
|
3384
|
+
}
|
|
3385
|
+
t(tn, "rectWithTitle");
|
|
3386
|
+
function nn(e, t, n, r, i, a, o) {
|
|
3387
|
+
let s = (e + n) / 2, c = (t + r) / 2, l = Math.atan2(r - t, n - e), u = (n - e) / 2, d = (r - t) / 2, f = u / i, p = d / a, m = Math.sqrt(f ** 2 + p ** 2);
|
|
3388
|
+
if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
|
|
3389
|
+
let h = Math.sqrt(1 - m ** 2), g = s + h * a * Math.sin(l) * (o ? -1 : 1), _ = c - h * i * Math.cos(l) * (o ? -1 : 1), v = Math.atan2((t - _) / a, (e - g) / i), y = Math.atan2((r - _) / a, (n - g) / i) - v;
|
|
3390
|
+
o && y < 0 && (y += 2 * Math.PI), !o && y > 0 && (y -= 2 * Math.PI);
|
|
3391
|
+
let b = [];
|
|
3392
|
+
for (let e = 0; e < 20; e++) {
|
|
3393
|
+
let t = v + e / 19 * y, n = g + i * Math.cos(t), r = _ + a * Math.sin(t);
|
|
3394
|
+
b.push({
|
|
3395
|
+
x: n,
|
|
3396
|
+
y: r
|
|
3397
|
+
});
|
|
3398
|
+
}
|
|
3399
|
+
return b;
|
|
3400
|
+
}
|
|
3401
|
+
t(nn, "generateArcPoints");
|
|
3402
|
+
async function rn(e, t) {
|
|
3403
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3404
|
+
t.labelStyle = n;
|
|
3405
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = t?.padding ?? 0, s = t?.padding ?? 0, c = (t?.width ? t?.width : a.width) + o * 2, l = (t?.height ? t?.height : a.height) + s * 2, u = t.radius || 5, d = t.taper || 5, { cssStyles: f } = t, p = V.svg(i), m = v(t, {});
|
|
3406
|
+
t.stroke && (m.stroke = t.stroke), t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
3407
|
+
let h = [
|
|
3408
|
+
{
|
|
3409
|
+
x: -c / 2 + d,
|
|
3410
|
+
y: -l / 2
|
|
3411
|
+
},
|
|
3412
|
+
{
|
|
3413
|
+
x: c / 2 - d,
|
|
3414
|
+
y: -l / 2
|
|
3415
|
+
},
|
|
3416
|
+
...nn(c / 2 - d, -l / 2, c / 2, -l / 2 + d, u, u, !0),
|
|
3417
|
+
{
|
|
3418
|
+
x: c / 2,
|
|
3419
|
+
y: -l / 2 + d
|
|
3420
|
+
},
|
|
3421
|
+
{
|
|
3422
|
+
x: c / 2,
|
|
3423
|
+
y: l / 2 - d
|
|
3424
|
+
},
|
|
3425
|
+
...nn(c / 2, l / 2 - d, c / 2 - d, l / 2, u, u, !0),
|
|
3426
|
+
{
|
|
3427
|
+
x: c / 2 - d,
|
|
3428
|
+
y: l / 2
|
|
3429
|
+
},
|
|
3430
|
+
{
|
|
3431
|
+
x: -c / 2 + d,
|
|
3432
|
+
y: l / 2
|
|
3433
|
+
},
|
|
3434
|
+
...nn(-c / 2 + d, l / 2, -c / 2, l / 2 - d, u, u, !0),
|
|
3435
|
+
{
|
|
3436
|
+
x: -c / 2,
|
|
3437
|
+
y: l / 2 - d
|
|
3438
|
+
},
|
|
3439
|
+
{
|
|
3440
|
+
x: -c / 2,
|
|
3441
|
+
y: -l / 2 + d
|
|
3442
|
+
},
|
|
3443
|
+
...nn(-c / 2, -l / 2 + d, -c / 2 + d, -l / 2, u, u, !0)
|
|
3444
|
+
], g = G(h), _ = p.path(g, m), b = i.insert(() => _, ":first-child");
|
|
3445
|
+
return b.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && b.selectChildren("path").attr("style", f), r && t.look !== "handDrawn" && b.selectChildren("path").attr("style", r), U(t, b), t.intersect = function(e) {
|
|
3446
|
+
return J.polygon(t, h, e);
|
|
3447
|
+
}, i;
|
|
3448
|
+
}
|
|
3449
|
+
t(rn, "roundedRect");
|
|
3450
|
+
async function an(e, t) {
|
|
3451
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3452
|
+
t.labelStyle = n;
|
|
3453
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = t?.padding ?? 0, c = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), l = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), u = -a.width / 2 - s, d = -a.height / 2 - s, { cssStyles: f } = t, p = V.svg(i), m = v(t, {});
|
|
3454
|
+
t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
3455
|
+
let g = [
|
|
3456
|
+
{
|
|
3457
|
+
x: u,
|
|
3458
|
+
y: d
|
|
3459
|
+
},
|
|
3460
|
+
{
|
|
3461
|
+
x: u + c + 8,
|
|
3462
|
+
y: d
|
|
3463
|
+
},
|
|
3464
|
+
{
|
|
3465
|
+
x: u + c + 8,
|
|
3466
|
+
y: d + l
|
|
3467
|
+
},
|
|
3468
|
+
{
|
|
3469
|
+
x: u - 8,
|
|
3470
|
+
y: d + l
|
|
3471
|
+
},
|
|
3472
|
+
{
|
|
3473
|
+
x: u - 8,
|
|
3474
|
+
y: d
|
|
3475
|
+
},
|
|
3476
|
+
{
|
|
3477
|
+
x: u,
|
|
3478
|
+
y: d
|
|
3479
|
+
},
|
|
3480
|
+
{
|
|
3481
|
+
x: u,
|
|
3482
|
+
y: d + l
|
|
3483
|
+
}
|
|
3484
|
+
], _ = p.polygon(g.map((e) => [e.x, e.y]), m), b = i.insert(() => _, ":first-child");
|
|
3485
|
+
return b.attr("class", "basic label-container").attr("style", h(f)), r && t.look !== "handDrawn" && b.selectAll("path").attr("style", r), f && t.look !== "handDrawn" && b.selectAll("path").attr("style", r), o.attr("transform", `translate(${-c / 2 + 4 + (t.padding ?? 0) - (a.x - (a.left ?? 0))},${-l / 2 + (t.padding ?? 0) - (a.y - (a.top ?? 0))})`), U(t, b), t.intersect = function(e) {
|
|
3486
|
+
return J.rect(t, e);
|
|
3487
|
+
}, i;
|
|
3488
|
+
}
|
|
3489
|
+
t(an, "shadedProcess");
|
|
3490
|
+
async function on(e, t) {
|
|
3491
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3492
|
+
t.labelStyle = n;
|
|
3493
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = -s / 2, u = -c / 2, { cssStyles: d } = t, f = V.svg(i), p = v(t, {});
|
|
3494
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
3495
|
+
let m = [
|
|
3496
|
+
{
|
|
3497
|
+
x: l,
|
|
3498
|
+
y: u
|
|
3499
|
+
},
|
|
3500
|
+
{
|
|
3501
|
+
x: l,
|
|
3502
|
+
y: u + c
|
|
3503
|
+
},
|
|
3504
|
+
{
|
|
3505
|
+
x: l + s,
|
|
3506
|
+
y: u + c
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
x: l + s,
|
|
3510
|
+
y: u - c / 2
|
|
3511
|
+
}
|
|
3512
|
+
], h = G(m), g = f.path(h, p), _ = i.insert(() => g, ":first-child");
|
|
3513
|
+
return _.attr("class", "basic label-container"), d && t.look !== "handDrawn" && _.selectChildren("path").attr("style", d), r && t.look !== "handDrawn" && _.selectChildren("path").attr("style", r), _.attr("transform", `translate(0, ${c / 4})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (a.x - (a.left ?? 0))}, ${-c / 4 + (t.padding ?? 0) - (a.y - (a.top ?? 0))})`), U(t, _), t.intersect = function(e) {
|
|
3514
|
+
return J.polygon(t, m, e);
|
|
3515
|
+
}, i;
|
|
3516
|
+
}
|
|
3517
|
+
t(on, "slopedRect");
|
|
3518
|
+
async function sn(e, t) {
|
|
3519
|
+
return zt(e, t, {
|
|
3520
|
+
rx: 0,
|
|
3521
|
+
ry: 0,
|
|
3522
|
+
classes: "",
|
|
3523
|
+
labelPaddingX: t.labelPaddingX ?? (t?.padding || 0) * 2,
|
|
3524
|
+
labelPaddingY: (t?.padding || 0) * 1
|
|
3525
|
+
});
|
|
3526
|
+
}
|
|
3527
|
+
t(sn, "squareRect");
|
|
3528
|
+
async function cn(e, t) {
|
|
3529
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3530
|
+
t.labelStyle = n;
|
|
3531
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = a.height + t.padding, s = a.width + o / 4 + t.padding, c = o / 2, { cssStyles: l } = t, u = V.svg(i), d = v(t, {});
|
|
3532
|
+
t.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
|
|
3533
|
+
let f = [
|
|
3534
|
+
{
|
|
3535
|
+
x: -s / 2 + c,
|
|
3536
|
+
y: -o / 2
|
|
3537
|
+
},
|
|
3538
|
+
{
|
|
3539
|
+
x: s / 2 - c,
|
|
3540
|
+
y: -o / 2
|
|
3541
|
+
},
|
|
3542
|
+
...Ue(-s / 2 + c, 0, c, 50, 90, 270),
|
|
3543
|
+
{
|
|
3544
|
+
x: s / 2 - c,
|
|
3545
|
+
y: o / 2
|
|
3546
|
+
},
|
|
3547
|
+
...Ue(s / 2 - c, 0, c, 50, 270, 450)
|
|
3548
|
+
], p = G(f), m = u.path(p, d), h = i.insert(() => m, ":first-child");
|
|
3549
|
+
return h.attr("class", "basic label-container outer-path"), l && t.look !== "handDrawn" && h.selectChildren("path").attr("style", l), r && t.look !== "handDrawn" && h.selectChildren("path").attr("style", r), U(t, h), t.intersect = function(e) {
|
|
3550
|
+
return J.polygon(t, f, e);
|
|
3551
|
+
}, i;
|
|
3552
|
+
}
|
|
3553
|
+
t(cn, "stadium");
|
|
3554
|
+
async function ln(e, t) {
|
|
3555
|
+
return zt(e, t, {
|
|
3556
|
+
rx: 5,
|
|
3557
|
+
ry: 5,
|
|
3558
|
+
classes: "flowchart-node"
|
|
3559
|
+
});
|
|
3560
|
+
}
|
|
3561
|
+
t(ln, "state");
|
|
3562
|
+
function un(e, t, { config: { themeVariables: n } }) {
|
|
3563
|
+
let { labelStyles: r, nodeStyles: i } = y(t);
|
|
3564
|
+
t.labelStyle = r;
|
|
3565
|
+
let { cssStyles: a } = t, { lineColor: o, stateBorder: s, nodeBorder: c } = n, l = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), u = V.svg(l), d = v(t, {});
|
|
3566
|
+
t.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
|
|
3567
|
+
let f = u.circle(0, 0, 14, {
|
|
3568
|
+
...d,
|
|
3569
|
+
stroke: o,
|
|
3570
|
+
strokeWidth: 2
|
|
3571
|
+
}), p = s ?? c, m = u.circle(0, 0, 5, {
|
|
3572
|
+
...d,
|
|
3573
|
+
fill: p,
|
|
3574
|
+
stroke: p,
|
|
3575
|
+
strokeWidth: 2,
|
|
3576
|
+
fillStyle: "solid"
|
|
3577
|
+
}), h = l.insert(() => f, ":first-child");
|
|
3578
|
+
return h.insert(() => m), a && h.selectAll("path").attr("style", a), i && h.selectAll("path").attr("style", i), U(t, h), t.intersect = function(e) {
|
|
3579
|
+
return J.circle(t, 7, e);
|
|
3580
|
+
}, l;
|
|
3581
|
+
}
|
|
3582
|
+
t(un, "stateEnd");
|
|
3583
|
+
function dn(e, t, { config: { themeVariables: n } }) {
|
|
3584
|
+
let { lineColor: r } = n, i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), a;
|
|
3585
|
+
if (t.look === "handDrawn") {
|
|
3586
|
+
let e = V.svg(i).circle(0, 0, 14, b(r));
|
|
3587
|
+
a = i.insert(() => e), a.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
|
|
3588
|
+
} else a = i.insert("circle", ":first-child"), a.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
|
|
3589
|
+
return U(t, a), t.intersect = function(e) {
|
|
3590
|
+
return J.circle(t, 7, e);
|
|
3591
|
+
}, i;
|
|
3592
|
+
}
|
|
3593
|
+
t(dn, "stateStart");
|
|
3594
|
+
async function fn(e, t) {
|
|
3595
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3596
|
+
t.labelStyle = n;
|
|
3597
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = (t?.padding || 0) / 2, s = a.width + t.padding, c = a.height + t.padding, l = -a.width / 2 - o, u = -a.height / 2 - o, d = [
|
|
3598
|
+
{
|
|
3599
|
+
x: 0,
|
|
3600
|
+
y: 0
|
|
3601
|
+
},
|
|
3602
|
+
{
|
|
3603
|
+
x: s,
|
|
3604
|
+
y: 0
|
|
3605
|
+
},
|
|
3606
|
+
{
|
|
3607
|
+
x: s,
|
|
3608
|
+
y: -c
|
|
3609
|
+
},
|
|
3610
|
+
{
|
|
3611
|
+
x: 0,
|
|
3612
|
+
y: -c
|
|
3613
|
+
},
|
|
3614
|
+
{
|
|
3615
|
+
x: 0,
|
|
3616
|
+
y: 0
|
|
3617
|
+
},
|
|
3618
|
+
{
|
|
3619
|
+
x: -8,
|
|
3620
|
+
y: 0
|
|
3621
|
+
},
|
|
3622
|
+
{
|
|
3623
|
+
x: s + 8,
|
|
3624
|
+
y: 0
|
|
3625
|
+
},
|
|
3626
|
+
{
|
|
3627
|
+
x: s + 8,
|
|
3628
|
+
y: -c
|
|
3629
|
+
},
|
|
3630
|
+
{
|
|
3631
|
+
x: -8,
|
|
3632
|
+
y: -c
|
|
3633
|
+
},
|
|
3634
|
+
{
|
|
3635
|
+
x: -8,
|
|
3636
|
+
y: 0
|
|
3637
|
+
}
|
|
3638
|
+
];
|
|
3639
|
+
if (t.look === "handDrawn") {
|
|
3640
|
+
let e = V.svg(i), n = v(t, {}), r = e.rectangle(l - 8, u, s + 16, c, n), a = e.line(l, u, l, u + c, n), o = e.line(l + s, u, l + s, u + c, n);
|
|
3641
|
+
i.insert(() => a, ":first-child"), i.insert(() => o, ":first-child");
|
|
3642
|
+
let d = i.insert(() => r, ":first-child"), { cssStyles: f } = t;
|
|
3643
|
+
d.attr("class", "basic label-container").attr("style", h(f)), U(t, d);
|
|
3644
|
+
} else {
|
|
3645
|
+
let e = Y(i, s, c, d);
|
|
3646
|
+
r && e.attr("style", r), U(t, e);
|
|
3647
|
+
}
|
|
3648
|
+
return t.intersect = function(e) {
|
|
3649
|
+
return J.polygon(t, d, e);
|
|
3650
|
+
}, i;
|
|
3651
|
+
}
|
|
3652
|
+
t(fn, "subroutine");
|
|
3653
|
+
async function pn(e, t) {
|
|
3654
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3655
|
+
t.labelStyle = n;
|
|
3656
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), c = -o / 2, l = -s / 2, u = .2 * s, d = .2 * s, { cssStyles: f } = t, p = V.svg(i), m = v(t, {}), h = [
|
|
3657
|
+
{
|
|
3658
|
+
x: c - u / 2,
|
|
3659
|
+
y: l
|
|
3660
|
+
},
|
|
3661
|
+
{
|
|
3662
|
+
x: c + o + u / 2,
|
|
3663
|
+
y: l
|
|
3664
|
+
},
|
|
3665
|
+
{
|
|
3666
|
+
x: c + o + u / 2,
|
|
3667
|
+
y: l + s
|
|
3668
|
+
},
|
|
3669
|
+
{
|
|
3670
|
+
x: c - u / 2,
|
|
3671
|
+
y: l + s
|
|
3672
|
+
}
|
|
3673
|
+
], g = [
|
|
3674
|
+
{
|
|
3675
|
+
x: c + o - u / 2,
|
|
3676
|
+
y: l + s
|
|
3677
|
+
},
|
|
3678
|
+
{
|
|
3679
|
+
x: c + o + u / 2,
|
|
3680
|
+
y: l + s
|
|
3681
|
+
},
|
|
3682
|
+
{
|
|
3683
|
+
x: c + o + u / 2,
|
|
3684
|
+
y: l + s - d
|
|
3685
|
+
}
|
|
3686
|
+
];
|
|
3687
|
+
t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
3688
|
+
let _ = G(h), b = p.path(_, m), x = G(g), S = p.path(x, {
|
|
3689
|
+
...m,
|
|
3690
|
+
fillStyle: "solid"
|
|
3691
|
+
}), C = i.insert(() => S, ":first-child");
|
|
3692
|
+
return C.insert(() => b, ":first-child"), C.attr("class", "basic label-container"), f && t.look !== "handDrawn" && C.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), U(t, C), t.intersect = function(e) {
|
|
3693
|
+
return J.polygon(t, h, e);
|
|
3694
|
+
}, i;
|
|
3695
|
+
}
|
|
3696
|
+
t(pn, "taggedRect");
|
|
3697
|
+
async function mn(e, t) {
|
|
3698
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3699
|
+
t.labelStyle = n;
|
|
3700
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 4, u = .2 * s, d = .2 * c, f = c + l, { cssStyles: p } = t, m = V.svg(i), h = v(t, {});
|
|
3701
|
+
t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
3702
|
+
let g = [
|
|
3703
|
+
{
|
|
3704
|
+
x: -s / 2 - s / 2 * .1,
|
|
3705
|
+
y: f / 2
|
|
3706
|
+
},
|
|
3707
|
+
...K(-s / 2 - s / 2 * .1, f / 2, s / 2 + s / 2 * .1, f / 2, l, .8),
|
|
3708
|
+
{
|
|
3709
|
+
x: s / 2 + s / 2 * .1,
|
|
3710
|
+
y: -f / 2
|
|
3711
|
+
},
|
|
3712
|
+
{
|
|
3713
|
+
x: -s / 2 - s / 2 * .1,
|
|
3714
|
+
y: -f / 2
|
|
3715
|
+
}
|
|
3716
|
+
], _ = -s / 2 + s / 2 * .1, b = -f / 2 - d * .4, x = [
|
|
3717
|
+
{
|
|
3718
|
+
x: _ + s - u,
|
|
3719
|
+
y: (b + c) * 1.4
|
|
3720
|
+
},
|
|
3721
|
+
{
|
|
3722
|
+
x: _ + s,
|
|
3723
|
+
y: b + c - d
|
|
3724
|
+
},
|
|
3725
|
+
{
|
|
3726
|
+
x: _ + s,
|
|
3727
|
+
y: (b + c) * .9
|
|
3728
|
+
},
|
|
3729
|
+
...K(_ + s, (b + c) * 1.3, _ + s - u, (b + c) * 1.5, -c * .03, .5)
|
|
3730
|
+
], S = G(g), C = m.path(S, h), w = G(x), T = m.path(w, {
|
|
3731
|
+
...h,
|
|
3732
|
+
fillStyle: "solid"
|
|
3733
|
+
}), E = i.insert(() => T, ":first-child");
|
|
3734
|
+
return E.insert(() => C, ":first-child"), E.attr("class", "basic label-container"), p && t.look !== "handDrawn" && E.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && E.selectAll("path").attr("style", r), E.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) - l / 2 - (a.y - (a.top ?? 0))})`), U(t, E), t.intersect = function(e) {
|
|
3735
|
+
return J.polygon(t, g, e);
|
|
3736
|
+
}, i;
|
|
3737
|
+
}
|
|
3738
|
+
t(mn, "taggedWaveEdgedRectangle");
|
|
3739
|
+
async function hn(e, t) {
|
|
3740
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3741
|
+
t.labelStyle = n;
|
|
3742
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = Math.max(a.width + t.padding, t?.width || 0), s = Math.max(a.height + t.padding, t?.height || 0), c = -o / 2, l = -s / 2, u = i.insert("rect", ":first-child");
|
|
3743
|
+
return u.attr("class", "text").attr("style", r).attr("rx", 0).attr("ry", 0).attr("x", c).attr("y", l).attr("width", o).attr("height", s), U(t, u), t.intersect = function(e) {
|
|
3744
|
+
return J.rect(t, e);
|
|
3745
|
+
}, i;
|
|
3746
|
+
}
|
|
3747
|
+
t(hn, "text");
|
|
3748
|
+
var gn = /* @__PURE__ */ t((e, t, n, r, i, a) => `M${e},${t}
|
|
3749
|
+
a${i},${a} 0,0,1 0,${-r}
|
|
3750
|
+
l${n},0
|
|
3751
|
+
a${i},${a} 0,0,1 0,${r}
|
|
3752
|
+
M${n},${-r}
|
|
3753
|
+
a${i},${a} 0,0,0 0,${r}
|
|
3754
|
+
l${-n},0`, "createCylinderPathD"), _n = /* @__PURE__ */ t((e, t, n, r, i, a) => [
|
|
3755
|
+
`M${e},${t}`,
|
|
3756
|
+
`M${e + n},${t}`,
|
|
3757
|
+
`a${i},${a} 0,0,0 0,${-r}`,
|
|
3758
|
+
`l${-n},0`,
|
|
3759
|
+
`a${i},${a} 0,0,0 0,${r}`,
|
|
3760
|
+
`l${n},0`
|
|
3761
|
+
].join(" "), "createOuterCylinderPathD"), vn = /* @__PURE__ */ t((e, t, n, r, i, a) => [`M${e + n / 2},${-r / 2}`, `a${i},${a} 0,0,0 0,${r}`].join(" "), "createInnerCylinderPathD");
|
|
3762
|
+
async function yn(e, t) {
|
|
3763
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3764
|
+
t.labelStyle = n;
|
|
3765
|
+
let { shapeSvg: i, bbox: a, label: o, halfPadding: s } = await H(e, t, W(t)), c = t.look === "neo" ? s * 2 : s, l = a.height + c, u = l / 2, d = u / (2.5 + l / 50), f = a.width + d + c, { cssStyles: p } = t, m;
|
|
3766
|
+
if (t.look === "handDrawn") {
|
|
3767
|
+
let e = V.svg(i), n = _n(0, 0, f, l, d, u), r = vn(0, 0, f, l, d, u), a = e.path(n, v(t, {})), o = e.path(r, v(t, { fill: "none" }));
|
|
3768
|
+
m = i.insert(() => o, ":first-child"), m = i.insert(() => a, ":first-child"), m.attr("class", "basic label-container"), p && m.attr("style", p);
|
|
3769
|
+
} else {
|
|
3770
|
+
let e = gn(0, 0, f, l, d, u);
|
|
3771
|
+
m = i.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", h(p)).attr("style", r), m.attr("class", "basic label-container"), p && m.selectAll("path").attr("style", p), r && m.selectAll("path").attr("style", r);
|
|
3772
|
+
}
|
|
3773
|
+
return m.attr("label-offset-x", d), m.attr("transform", `translate(${-f / 2}, ${l / 2} )`), o.attr("transform", `translate(${-(a.width / 2) - d - (a.x - (a.left ?? 0))}, ${-(a.height / 2) - (a.y - (a.top ?? 0))})`), U(t, m), t.intersect = function(e) {
|
|
3774
|
+
let n = J.rect(t, e), r = n.y - (t.y ?? 0);
|
|
3775
|
+
if (u != 0 && (Math.abs(r) < (t.height ?? 0) / 2 || Math.abs(r) == (t.height ?? 0) / 2 && Math.abs(n.x - (t.x ?? 0)) > (t.width ?? 0) / 2 - d)) {
|
|
3776
|
+
let i = d * d * (1 - r * r / (u * u));
|
|
3777
|
+
i != 0 && (i = Math.sqrt(Math.abs(i))), i = d - i, e.x - (t.x ?? 0) > 0 && (i = -i), n.x += i;
|
|
3778
|
+
}
|
|
3779
|
+
return n;
|
|
3780
|
+
}, i;
|
|
3781
|
+
}
|
|
3782
|
+
t(yn, "tiltedCylinder");
|
|
3783
|
+
async function bn(e, t) {
|
|
3784
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3785
|
+
t.labelStyle = n;
|
|
3786
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = a.width + t.padding, s = a.height + t.padding, c = [
|
|
3787
|
+
{
|
|
3788
|
+
x: -3 * s / 6,
|
|
3789
|
+
y: 0
|
|
3790
|
+
},
|
|
3791
|
+
{
|
|
3792
|
+
x: o + 3 * s / 6,
|
|
3793
|
+
y: 0
|
|
3794
|
+
},
|
|
3795
|
+
{
|
|
3796
|
+
x: o,
|
|
3797
|
+
y: -s
|
|
3798
|
+
},
|
|
3799
|
+
{
|
|
3800
|
+
x: 0,
|
|
3801
|
+
y: -s
|
|
3802
|
+
}
|
|
3803
|
+
], l, { cssStyles: u } = t;
|
|
3804
|
+
if (t.look === "handDrawn") {
|
|
3805
|
+
let e = V.svg(i), n = v(t, {}), r = G(c), a = e.path(r, n);
|
|
3806
|
+
l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2}, ${s / 2})`), u && l.attr("style", u);
|
|
3807
|
+
} else l = Y(i, o, s, c);
|
|
3808
|
+
return r && l.attr("style", r), t.width = o, t.height = s, U(t, l), t.intersect = function(e) {
|
|
3809
|
+
return J.polygon(t, c, e);
|
|
3810
|
+
}, i;
|
|
3811
|
+
}
|
|
3812
|
+
t(bn, "trapezoid");
|
|
3813
|
+
async function xn(e, t) {
|
|
3814
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3815
|
+
t.labelStyle = n;
|
|
3816
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = Math.max(60, a.width + (t.padding ?? 0) * 2, t?.width ?? 0), s = Math.max(20, a.height + (t.padding ?? 0) * 2, t?.height ?? 0), { cssStyles: c } = t, l = V.svg(i), u = v(t, {});
|
|
3817
|
+
t.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
|
|
3818
|
+
let d = [
|
|
3819
|
+
{
|
|
3820
|
+
x: -o / 2 * .8,
|
|
3821
|
+
y: -s / 2
|
|
3822
|
+
},
|
|
3823
|
+
{
|
|
3824
|
+
x: o / 2 * .8,
|
|
3825
|
+
y: -s / 2
|
|
3826
|
+
},
|
|
3827
|
+
{
|
|
3828
|
+
x: o / 2,
|
|
3829
|
+
y: -s / 2 * .6
|
|
3830
|
+
},
|
|
3831
|
+
{
|
|
3832
|
+
x: o / 2,
|
|
3833
|
+
y: s / 2
|
|
3834
|
+
},
|
|
3835
|
+
{
|
|
3836
|
+
x: -o / 2,
|
|
3837
|
+
y: s / 2
|
|
3838
|
+
},
|
|
3839
|
+
{
|
|
3840
|
+
x: -o / 2,
|
|
3841
|
+
y: -s / 2 * .6
|
|
3842
|
+
}
|
|
3843
|
+
], f = G(d), p = l.path(f, u), m = i.insert(() => p, ":first-child");
|
|
3844
|
+
return m.attr("class", "basic label-container"), c && t.look !== "handDrawn" && m.selectChildren("path").attr("style", c), r && t.look !== "handDrawn" && m.selectChildren("path").attr("style", r), U(t, m), t.intersect = function(e) {
|
|
3845
|
+
return J.polygon(t, d, e);
|
|
3846
|
+
}, i;
|
|
3847
|
+
}
|
|
3848
|
+
t(xn, "trapezoidalPentagon");
|
|
3849
|
+
async function Sn(t, n) {
|
|
3850
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
3851
|
+
n.labelStyle = r;
|
|
3852
|
+
let { shapeSvg: a, bbox: o, label: s } = await H(t, n, W(n)), l = u(c().flowchart?.htmlLabels), d = o.width + (n.padding ?? 0), f = d + o.height, p = d + o.height, m = [
|
|
3853
|
+
{
|
|
3854
|
+
x: 0,
|
|
3855
|
+
y: 0
|
|
3856
|
+
},
|
|
3857
|
+
{
|
|
3858
|
+
x: p,
|
|
3859
|
+
y: 0
|
|
3860
|
+
},
|
|
3861
|
+
{
|
|
3862
|
+
x: p / 2,
|
|
3863
|
+
y: -f
|
|
3864
|
+
}
|
|
3865
|
+
], { cssStyles: h } = n, g = V.svg(a), _ = v(n, {});
|
|
3866
|
+
n.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
|
|
3867
|
+
let b = G(m), x = g.path(b, _), S = a.insert(() => x, ":first-child").attr("transform", `translate(${-f / 2}, ${f / 2})`);
|
|
3868
|
+
return h && n.look !== "handDrawn" && S.selectChildren("path").attr("style", h), i && n.look !== "handDrawn" && S.selectChildren("path").attr("style", i), n.width = d, n.height = f, U(n, S), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${f / 2 - (o.height + (n.padding ?? 0) / (l ? 2 : 1) - (o.y - (o.top ?? 0)))})`), n.intersect = function(t) {
|
|
3869
|
+
return e.info("Triangle intersect", n, m, t), J.polygon(n, m, t);
|
|
3870
|
+
}, a;
|
|
3871
|
+
}
|
|
3872
|
+
t(Sn, "triangle");
|
|
3873
|
+
async function Cn(e, t) {
|
|
3874
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3875
|
+
t.labelStyle = n;
|
|
3876
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 8, u = c + l, { cssStyles: d } = t, f = 70 - s, p = f > 0 ? f / 2 : 0, m = V.svg(i), h = v(t, {});
|
|
3877
|
+
t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
3878
|
+
let g = [
|
|
3879
|
+
{
|
|
3880
|
+
x: -s / 2 - p,
|
|
3881
|
+
y: u / 2
|
|
3882
|
+
},
|
|
3883
|
+
...K(-s / 2 - p, u / 2, s / 2 + p, u / 2, l, .8),
|
|
3884
|
+
{
|
|
3885
|
+
x: s / 2 + p,
|
|
3886
|
+
y: -u / 2
|
|
3887
|
+
},
|
|
3888
|
+
{
|
|
3889
|
+
x: -s / 2 - p,
|
|
3890
|
+
y: -u / 2
|
|
3891
|
+
}
|
|
3892
|
+
], _ = G(g), b = m.path(_, h), x = i.insert(() => b, ":first-child");
|
|
3893
|
+
return x.attr("class", "basic label-container"), d && t.look !== "handDrawn" && x.selectAll("path").attr("style", d), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) - l - (a.y - (a.top ?? 0))})`), U(t, x), t.intersect = function(e) {
|
|
3894
|
+
return J.polygon(t, g, e);
|
|
3895
|
+
}, i;
|
|
3896
|
+
}
|
|
3897
|
+
t(Cn, "waveEdgedRectangle");
|
|
3898
|
+
async function wn(e, t) {
|
|
3899
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3900
|
+
t.labelStyle = n;
|
|
3901
|
+
let { shapeSvg: i, bbox: a } = await H(e, t, W(t)), o = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), c = o / s, l = o, u = s;
|
|
3902
|
+
l > u * c ? u = l / c : l = u * c, l = Math.max(l, 100), u = Math.max(u, 50);
|
|
3903
|
+
let d = Math.min(u * .2, u / 4), f = u + d * 2, { cssStyles: p } = t, m = V.svg(i), h = v(t, {});
|
|
3904
|
+
t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
3905
|
+
let g = [
|
|
3906
|
+
{
|
|
3907
|
+
x: -l / 2,
|
|
3908
|
+
y: f / 2
|
|
3909
|
+
},
|
|
3910
|
+
...K(-l / 2, f / 2, l / 2, f / 2, d, 1),
|
|
3911
|
+
{
|
|
3912
|
+
x: l / 2,
|
|
3913
|
+
y: -f / 2
|
|
3914
|
+
},
|
|
3915
|
+
...K(l / 2, -f / 2, -l / 2, -f / 2, d, -1)
|
|
3916
|
+
], _ = G(g), b = m.path(_, h), x = i.insert(() => b, ":first-child");
|
|
3917
|
+
return x.attr("class", "basic label-container"), p && t.look !== "handDrawn" && x.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), U(t, x), t.intersect = function(e) {
|
|
3918
|
+
return J.polygon(t, g, e);
|
|
3919
|
+
}, i;
|
|
3920
|
+
}
|
|
3921
|
+
t(wn, "waveRectangle");
|
|
3922
|
+
async function Tn(e, t) {
|
|
3923
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
3924
|
+
t.labelStyle = n;
|
|
3925
|
+
let { shapeSvg: i, bbox: a, label: o } = await H(e, t, W(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = -s / 2, u = -c / 2, { cssStyles: d } = t, f = V.svg(i), p = v(t, {}), m = [
|
|
3926
|
+
{
|
|
3927
|
+
x: l - 5,
|
|
3928
|
+
y: u - 5
|
|
3929
|
+
},
|
|
3930
|
+
{
|
|
3931
|
+
x: l - 5,
|
|
3932
|
+
y: u + c
|
|
3933
|
+
},
|
|
3934
|
+
{
|
|
3935
|
+
x: l + s,
|
|
3936
|
+
y: u + c
|
|
3937
|
+
},
|
|
3938
|
+
{
|
|
3939
|
+
x: l + s,
|
|
3940
|
+
y: u - 5
|
|
3941
|
+
}
|
|
3942
|
+
], h = `M${l - 5},${u - 5} L${l + s},${u - 5} L${l + s},${u + c} L${l - 5},${u + c} L${l - 5},${u - 5}
|
|
3943
|
+
M${l - 5},${u} L${l + s},${u}
|
|
3944
|
+
M${l},${u - 5} L${l},${u + c}`;
|
|
3945
|
+
t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
3946
|
+
let g = f.path(h, p), _ = i.insert(() => g, ":first-child");
|
|
3947
|
+
return _.attr("transform", `translate(${5 / 2}, ${5 / 2})`), _.attr("class", "basic label-container"), d && t.look !== "handDrawn" && _.selectAll("path").attr("style", d), r && t.look !== "handDrawn" && _.selectAll("path").attr("style", r), o.attr("transform", `translate(${-(a.width / 2) + 5 / 2 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 5 / 2 - (a.y - (a.top ?? 0))})`), U(t, _), t.intersect = function(e) {
|
|
3948
|
+
return J.polygon(t, m, e);
|
|
3949
|
+
}, i;
|
|
3950
|
+
}
|
|
3951
|
+
t(Tn, "windowPane");
|
|
3952
|
+
async function En(e, t) {
|
|
3953
|
+
let r = t;
|
|
3954
|
+
if (r.alias && (t.label = r.alias), t.look === "handDrawn") {
|
|
3955
|
+
let { themeVariables: n } = f(), { background: r } = n;
|
|
3956
|
+
await En(e, {
|
|
3957
|
+
...t,
|
|
3958
|
+
id: t.id + "-background",
|
|
3959
|
+
look: "default",
|
|
3960
|
+
cssStyles: ["stroke: none", `fill: ${r}`]
|
|
3961
|
+
});
|
|
3962
|
+
}
|
|
3963
|
+
let i = f();
|
|
3964
|
+
t.useHtmlLabels = i.htmlLabels;
|
|
3965
|
+
let a = i.er?.diagramPadding ?? 10, o = i.er?.entityPadding ?? 6, { cssStyles: s } = t, { labelStyles: c, nodeStyles: l } = y(t);
|
|
3966
|
+
if (r.attributes.length === 0 && t.label) {
|
|
3967
|
+
let n = {
|
|
3968
|
+
rx: 0,
|
|
3969
|
+
ry: 0,
|
|
3970
|
+
labelPaddingX: a,
|
|
3971
|
+
labelPaddingY: a * 1.5,
|
|
3972
|
+
classes: ""
|
|
3973
|
+
};
|
|
3974
|
+
g(t.label, i) + n.labelPaddingX * 2 < i.er.minEntityWidth && (t.width = i.er.minEntityWidth);
|
|
3975
|
+
let r = await zt(e, t, n);
|
|
3976
|
+
if (!u(i.htmlLabels)) {
|
|
3977
|
+
let e = r.select("text"), t = e.node()?.getBBox();
|
|
3978
|
+
e.attr("transform", `translate(${-t.width / 2}, 0)`);
|
|
3979
|
+
}
|
|
3980
|
+
return r;
|
|
3981
|
+
}
|
|
3982
|
+
i.htmlLabels || (a *= 1.25, o *= 1.25);
|
|
3983
|
+
let d = W(t);
|
|
3984
|
+
d ||= "node default";
|
|
3985
|
+
let p = e.insert("g").attr("class", d).attr("id", t.domId || t.id), m = await Dn(p, t.label ?? "", i, 0, 0, ["name"], c);
|
|
3986
|
+
m.height += o;
|
|
3987
|
+
let h = 0, _ = [], b = [], x = 0, S = 0, C = 0, w = 0, T = !0, E = !0;
|
|
3988
|
+
for (let e of r.attributes) {
|
|
3989
|
+
let t = await Dn(p, e.type, i, 0, h, ["attribute-type"], c);
|
|
3990
|
+
x = Math.max(x, t.width + a);
|
|
3991
|
+
let n = await Dn(p, e.name, i, 0, h, ["attribute-name"], c);
|
|
3992
|
+
S = Math.max(S, n.width + a);
|
|
3993
|
+
let r = await Dn(p, e.keys.join(), i, 0, h, ["attribute-keys"], c);
|
|
3994
|
+
C = Math.max(C, r.width + a);
|
|
3995
|
+
let s = await Dn(p, e.comment, i, 0, h, ["attribute-comment"], c);
|
|
3996
|
+
w = Math.max(w, s.width + a);
|
|
3997
|
+
let l = Math.max(t.height, n.height, r.height, s.height) + o;
|
|
3998
|
+
b.push({
|
|
3999
|
+
yOffset: h,
|
|
4000
|
+
rowHeight: l
|
|
4001
|
+
}), h += l;
|
|
4002
|
+
}
|
|
4003
|
+
let D = 4;
|
|
4004
|
+
C <= a && (T = !1, C = 0, D--), w <= a && (E = !1, w = 0, D--);
|
|
4005
|
+
let O = p.node().getBBox();
|
|
4006
|
+
if (m.width + a * 2 - (x + S + C + w) > 0) {
|
|
4007
|
+
let e = m.width + a * 2 - (x + S + C + w);
|
|
4008
|
+
x += e / D, S += e / D, C > 0 && (C += e / D), w > 0 && (w += e / D);
|
|
4009
|
+
}
|
|
4010
|
+
let k = x + S + C + w, A = V.svg(p), j = v(t, {});
|
|
4011
|
+
t.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid");
|
|
4012
|
+
let M = 0;
|
|
4013
|
+
b.length > 0 && (M = b.reduce((e, t) => e + (t?.rowHeight ?? 0), 0));
|
|
4014
|
+
let N = Math.max(O.width + a * 2, t?.width || 0, k), P = Math.max((M ?? 0) + m.height, t?.height || 0), F = -N / 2, I = -P / 2;
|
|
4015
|
+
p.selectAll("g:not(:first-child)").each((e, t, r) => {
|
|
4016
|
+
let i = n(r[t]), s = i.attr("transform"), c = 0, l = 0;
|
|
4017
|
+
if (s) {
|
|
4018
|
+
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(s);
|
|
4019
|
+
e && (c = parseFloat(e[1]), l = parseFloat(e[2]), i.attr("class").includes("attribute-name") ? c += x : i.attr("class").includes("attribute-keys") ? c += x + S : i.attr("class").includes("attribute-comment") && (c += x + S + C));
|
|
4020
|
+
}
|
|
4021
|
+
i.attr("transform", `translate(${F + a / 2 + c}, ${l + I + m.height + o / 2})`);
|
|
4022
|
+
}), p.select(".name").attr("transform", "translate(" + -m.width / 2 + ", " + (I + o / 2) + ")");
|
|
4023
|
+
let ee = A.rectangle(F, I, N, P, j), te = p.insert(() => ee, ":first-child").attr("style", s.join("")), { themeVariables: ne } = f(), { rowEven: re, rowOdd: ie, nodeBorder: ae } = ne;
|
|
4024
|
+
_.push(0);
|
|
4025
|
+
for (let [e, t] of b.entries()) {
|
|
4026
|
+
let n = (e + 1) % 2 == 0 && t.yOffset !== 0, r = A.rectangle(F, m.height + I + t?.yOffset, N, t?.rowHeight, {
|
|
4027
|
+
...j,
|
|
4028
|
+
fill: n ? re : ie,
|
|
4029
|
+
stroke: ae
|
|
4030
|
+
});
|
|
4031
|
+
p.insert(() => r, "g.label").attr("style", s.join("")).attr("class", `row-rect-${n ? "even" : "odd"}`);
|
|
4032
|
+
}
|
|
4033
|
+
let L = A.line(F, m.height + I, N + F, m.height + I, j);
|
|
4034
|
+
p.insert(() => L).attr("class", "divider"), L = A.line(x + F, m.height + I, x + F, P + I, j), p.insert(() => L).attr("class", "divider"), T && (L = A.line(x + S + F, m.height + I, x + S + F, P + I, j), p.insert(() => L).attr("class", "divider")), E && (L = A.line(x + S + C + F, m.height + I, x + S + C + F, P + I, j), p.insert(() => L).attr("class", "divider"));
|
|
4035
|
+
for (let e of _) L = A.line(F, m.height + I + e, N + F, m.height + I + e, j), p.insert(() => L).attr("class", "divider");
|
|
4036
|
+
if (U(t, te), l && t.look !== "handDrawn") {
|
|
4037
|
+
let e = l.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
|
|
4038
|
+
p.selectAll("path").attr("style", e ?? ""), p.selectAll(".row-rect-even path").attr("style", l);
|
|
4039
|
+
}
|
|
4040
|
+
return t.intersect = function(e) {
|
|
4041
|
+
return J.rect(t, e);
|
|
4042
|
+
}, p;
|
|
4043
|
+
}
|
|
4044
|
+
t(En, "erBox");
|
|
4045
|
+
async function Dn(e, t, i, a = 0, o = 0, s = [], c = "") {
|
|
4046
|
+
let l = e.insert("g").attr("class", `label ${s.join(" ")}`).attr("transform", `translate(${a}, ${o})`).attr("style", c);
|
|
4047
|
+
t !== r(t) && (t = r(t), t = t.replaceAll("<", "<").replaceAll(">", ">"));
|
|
4048
|
+
let d = l.node().appendChild(await S(l, t, {
|
|
4049
|
+
width: g(t, i) + 100,
|
|
4050
|
+
style: c,
|
|
4051
|
+
useHtmlLabels: i.htmlLabels
|
|
4052
|
+
}, i));
|
|
4053
|
+
if (t.includes("<") || t.includes(">")) {
|
|
4054
|
+
let e = d.children[0];
|
|
4055
|
+
for (e.textContent = e.textContent.replaceAll("<", "<").replaceAll(">", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("<", "<").replaceAll(">", ">");
|
|
4056
|
+
}
|
|
4057
|
+
let f = d.getBBox();
|
|
4058
|
+
if (u(i.htmlLabels)) {
|
|
4059
|
+
let e = d.children[0];
|
|
4060
|
+
e.style.textAlign = "start";
|
|
4061
|
+
let t = n(d);
|
|
4062
|
+
f = e.getBoundingClientRect(), t.attr("width", f.width), t.attr("height", f.height);
|
|
4063
|
+
}
|
|
4064
|
+
return f;
|
|
4065
|
+
}
|
|
4066
|
+
t(Dn, "addText");
|
|
4067
|
+
async function On(e, t, n, r, i = n.class.padding ?? 12) {
|
|
4068
|
+
let a = r ? 0 : 3, o = e.insert("g").attr("class", W(t)).attr("id", t.domId || t.id), s = null, c = null, l = null, u = null, d = 0, f = 0, p = 0;
|
|
4069
|
+
if (s = o.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
|
|
4070
|
+
let e = t.annotations[0];
|
|
4071
|
+
await kn(s, { text: `\xAB${e}\xBB` }, 0), d = s.node().getBBox().height;
|
|
4072
|
+
}
|
|
4073
|
+
c = o.insert("g").attr("class", "label-group text"), await kn(c, t, 0, ["font-weight: bolder"]);
|
|
4074
|
+
let m = c.node().getBBox();
|
|
4075
|
+
f = m.height, l = o.insert("g").attr("class", "members-group text");
|
|
4076
|
+
let h = 0;
|
|
4077
|
+
for (let e of t.members) {
|
|
4078
|
+
let t = await kn(l, e, h, [e.parseClassifier()]);
|
|
4079
|
+
h += t + a;
|
|
4080
|
+
}
|
|
4081
|
+
p = l.node().getBBox().height, p <= 0 && (p = i / 2), u = o.insert("g").attr("class", "methods-group text");
|
|
4082
|
+
let g = 0;
|
|
4083
|
+
for (let e of t.methods) {
|
|
4084
|
+
let t = await kn(u, e, g, [e.parseClassifier()]);
|
|
4085
|
+
g += t + a;
|
|
4086
|
+
}
|
|
4087
|
+
let _ = o.node().getBBox();
|
|
4088
|
+
if (s !== null) {
|
|
4089
|
+
let e = s.node().getBBox();
|
|
4090
|
+
s.attr("transform", `translate(${-e.width / 2})`);
|
|
4091
|
+
}
|
|
4092
|
+
return c.attr("transform", `translate(${-m.width / 2}, ${d})`), _ = o.node().getBBox(), l.attr("transform", `translate(0, ${d + f + i * 2})`), _ = o.node().getBBox(), u.attr("transform", `translate(0, ${d + f + (p ? p + i * 4 : i * 2)})`), _ = o.node().getBBox(), {
|
|
4093
|
+
shapeSvg: o,
|
|
4094
|
+
bbox: _
|
|
4095
|
+
};
|
|
4096
|
+
}
|
|
4097
|
+
t(On, "textHelper");
|
|
4098
|
+
async function kn(e, r, i, o = []) {
|
|
4099
|
+
let c = e.insert("g").attr("class", "label").attr("style", o.join("; ")), l = f(), d = "useHtmlLabels" in r ? r.useHtmlLabels : u(l.htmlLabels) ?? !0, p = "";
|
|
4100
|
+
p = "text" in r ? r.text : r.label, !d && p.startsWith("\\") && (p = p.substring(1)), s(p) && (d = !0);
|
|
4101
|
+
let h = await S(c, a(m(p)), {
|
|
4102
|
+
width: g(p, l) + 50,
|
|
4103
|
+
classes: "markdown-node-label",
|
|
4104
|
+
useHtmlLabels: d
|
|
4105
|
+
}, l), _, v = 1;
|
|
4106
|
+
if (d) {
|
|
4107
|
+
let e = h.children[0], r = n(h);
|
|
4108
|
+
v = e.innerHTML.split("<br>").length, e.innerHTML.includes("</math>") && (v += e.innerHTML.split("<mrow>").length - 1);
|
|
4109
|
+
let i = e.getElementsByTagName("img");
|
|
4110
|
+
if (i) {
|
|
4111
|
+
let e = p.replace(/<img[^>]*>/g, "").trim() === "";
|
|
4112
|
+
await Promise.all([...i].map((n) => new Promise((r) => {
|
|
4113
|
+
function i() {
|
|
4114
|
+
if (n.style.display = "flex", n.style.flexDirection = "column", e) {
|
|
4115
|
+
let e = l.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize, t = parseInt(e, 10) * 5 + "px";
|
|
4116
|
+
n.style.minWidth = t, n.style.maxWidth = t;
|
|
4117
|
+
} else n.style.width = "100%";
|
|
4118
|
+
r(n);
|
|
4119
|
+
}
|
|
4120
|
+
t(i, "setupImage"), setTimeout(() => {
|
|
4121
|
+
n.complete && i();
|
|
4122
|
+
}), n.addEventListener("error", i), n.addEventListener("load", i);
|
|
4123
|
+
})));
|
|
4124
|
+
}
|
|
4125
|
+
_ = e.getBoundingClientRect(), r.attr("width", _.width), r.attr("height", _.height);
|
|
4126
|
+
} else {
|
|
4127
|
+
o.includes("font-weight: bolder") && n(h).selectAll("tspan").attr("font-weight", ""), v = h.children.length;
|
|
4128
|
+
let e = h.children[0];
|
|
4129
|
+
(h.textContent === "" || h.textContent.includes(">")) && (e.textContent = p[0] + p.substring(1).replaceAll(">", ">").replaceAll("<", "<").trim(), p[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), _ = h.getBBox();
|
|
4130
|
+
}
|
|
4131
|
+
return c.attr("transform", "translate(0," + (-_.height / (2 * v) + i) + ")"), _.height;
|
|
4132
|
+
}
|
|
4133
|
+
t(kn, "addText");
|
|
4134
|
+
async function An(e, t) {
|
|
4135
|
+
let r = c(), i = r.class.padding ?? 12, a = i, o = t.useHtmlLabels ?? u(r.htmlLabels) ?? !0, s = t;
|
|
4136
|
+
s.annotations = s.annotations ?? [], s.members = s.members ?? [], s.methods = s.methods ?? [];
|
|
4137
|
+
let { shapeSvg: l, bbox: d } = await On(e, t, r, o, a), { labelStyles: f, nodeStyles: p } = y(t);
|
|
4138
|
+
t.labelStyle = f, t.cssStyles = s.styles || "";
|
|
4139
|
+
let m = s.styles?.join(";") || p || "";
|
|
4140
|
+
t.cssStyles ||= m.replaceAll("!important", "").split(";");
|
|
4141
|
+
let h = s.members.length === 0 && s.methods.length === 0 && !r.class?.hideEmptyMembersBox, g = V.svg(l), _ = v(t, {});
|
|
4142
|
+
t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
|
|
4143
|
+
let b = d.width, x = d.height;
|
|
4144
|
+
s.members.length === 0 && s.methods.length === 0 ? x += a : s.members.length > 0 && s.methods.length === 0 && (x += a * 2);
|
|
4145
|
+
let S = -b / 2, C = -x / 2, w = g.rectangle(S - i, C - i - (h ? i : s.members.length === 0 && s.methods.length === 0 ? -i / 2 : 0), b + 2 * i, x + 2 * i + (h ? i * 2 : s.members.length === 0 && s.methods.length === 0 ? -i : 0), _), T = l.insert(() => w, ":first-child");
|
|
4146
|
+
T.attr("class", "basic label-container");
|
|
4147
|
+
let E = T.node().getBBox();
|
|
4148
|
+
l.selectAll(".text").each((e, t, r) => {
|
|
4149
|
+
let a = n(r[t]), c = a.attr("transform"), u = 0;
|
|
4150
|
+
if (c) {
|
|
4151
|
+
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(c);
|
|
4152
|
+
e && (u = parseFloat(e[2]));
|
|
4153
|
+
}
|
|
4154
|
+
let d = u + C + i - (h ? i : s.members.length === 0 && s.methods.length === 0 ? -i / 2 : 0);
|
|
4155
|
+
o || (d -= 4);
|
|
4156
|
+
let f = S;
|
|
4157
|
+
(a.attr("class").includes("label-group") || a.attr("class").includes("annotation-group")) && (f = -a.node()?.getBBox().width / 2 || 0, l.selectAll("text").each(function(e, t, n) {
|
|
4158
|
+
window.getComputedStyle(n[t]).textAnchor === "middle" && (f = 0);
|
|
4159
|
+
})), a.attr("transform", `translate(${f}, ${d})`);
|
|
4160
|
+
});
|
|
4161
|
+
let D = l.select(".annotation-group").node().getBBox().height - (h ? i / 2 : 0) || 0, O = l.select(".label-group").node().getBBox().height - (h ? i / 2 : 0) || 0, k = l.select(".members-group").node().getBBox().height - (h ? i / 2 : 0) || 0;
|
|
4162
|
+
if (s.members.length > 0 || s.methods.length > 0 || h) {
|
|
4163
|
+
let e = g.line(E.x, D + O + C + i, E.x + E.width, D + O + C + i, _);
|
|
4164
|
+
l.insert(() => e).attr("class", "divider").attr("style", m);
|
|
4165
|
+
}
|
|
4166
|
+
if (h || s.members.length > 0 || s.methods.length > 0) {
|
|
4167
|
+
let e = g.line(E.x, D + O + k + C + a * 2 + i, E.x + E.width, D + O + k + C + i + a * 2, _);
|
|
4168
|
+
l.insert(() => e).attr("class", "divider").attr("style", m);
|
|
4169
|
+
}
|
|
4170
|
+
if (s.look !== "handDrawn" && l.selectAll("path").attr("style", m), T.select(":nth-child(2)").attr("style", m), l.selectAll(".divider").select("path").attr("style", m), t.labelStyle ? l.selectAll("span").attr("style", t.labelStyle) : l.selectAll("span").attr("style", m), !o) {
|
|
4171
|
+
let e = RegExp(/color\s*:\s*([^;]*)/), t = e.exec(m);
|
|
4172
|
+
if (t) {
|
|
4173
|
+
let e = t[0].replace("color", "fill");
|
|
4174
|
+
l.selectAll("tspan").attr("style", e);
|
|
4175
|
+
} else if (f) {
|
|
4176
|
+
let t = e.exec(f);
|
|
4177
|
+
if (t) {
|
|
4178
|
+
let e = t[0].replace("color", "fill");
|
|
4179
|
+
l.selectAll("tspan").attr("style", e);
|
|
4180
|
+
}
|
|
4181
|
+
}
|
|
4182
|
+
}
|
|
4183
|
+
return U(t, T), t.intersect = function(e) {
|
|
4184
|
+
return J.rect(t, e);
|
|
4185
|
+
}, l;
|
|
4186
|
+
}
|
|
4187
|
+
t(An, "classBox");
|
|
4188
|
+
async function jn(e, t) {
|
|
4189
|
+
let { labelStyles: r, nodeStyles: i } = y(t);
|
|
4190
|
+
t.labelStyle = r;
|
|
4191
|
+
let a = t, o = t, s = "verifyMethod" in t, c = W(t), l = e.insert("g").attr("class", c).attr("id", t.domId ?? t.id), u;
|
|
4192
|
+
u = s ? await $(l, `<<${a.type}>>`, 0, t.labelStyle) : await $(l, "<<Element>>", 0, t.labelStyle);
|
|
4193
|
+
let d = u, f = await $(l, a.name, d, t.labelStyle + "; font-weight: bold;");
|
|
4194
|
+
if (d += f + 20, s) {
|
|
4195
|
+
let e = await $(l, `${a.requirementId ? `ID: ${a.requirementId}` : ""}`, d, t.labelStyle);
|
|
4196
|
+
d += e;
|
|
4197
|
+
let n = await $(l, `${a.text ? `Text: ${a.text}` : ""}`, d, t.labelStyle);
|
|
4198
|
+
d += n;
|
|
4199
|
+
let r = await $(l, `${a.risk ? `Risk: ${a.risk}` : ""}`, d, t.labelStyle);
|
|
4200
|
+
d += r, await $(l, `${a.verifyMethod ? `Verification: ${a.verifyMethod}` : ""}`, d, t.labelStyle);
|
|
4201
|
+
} else {
|
|
4202
|
+
let e = await $(l, `${o.type ? `Type: ${o.type}` : ""}`, d, t.labelStyle);
|
|
4203
|
+
d += e, await $(l, `${o.docRef ? `Doc Ref: ${o.docRef}` : ""}`, d, t.labelStyle);
|
|
4204
|
+
}
|
|
4205
|
+
let p = (l.node()?.getBBox().width ?? 200) + 20, m = (l.node()?.getBBox().height ?? 200) + 20, h = -p / 2, g = -m / 2, _ = V.svg(l), b = v(t, {});
|
|
4206
|
+
t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
|
|
4207
|
+
let x = _.rectangle(h, g, p, m, b), S = l.insert(() => x, ":first-child");
|
|
4208
|
+
if (S.attr("class", "basic label-container").attr("style", i), l.selectAll(".label").each((e, t, r) => {
|
|
4209
|
+
let i = n(r[t]), a = i.attr("transform"), o = 0, s = 0;
|
|
4210
|
+
if (a) {
|
|
4211
|
+
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
|
|
4212
|
+
e && (o = parseFloat(e[1]), s = parseFloat(e[2]));
|
|
4213
|
+
}
|
|
4214
|
+
let c = s - m / 2, l = h + 20 / 2;
|
|
4215
|
+
(t === 0 || t === 1) && (l = o), i.attr("transform", `translate(${l}, ${c + 20})`);
|
|
4216
|
+
}), d > u + f + 20) {
|
|
4217
|
+
let e = _.line(h, g + u + f + 20, h + p, g + u + f + 20, b);
|
|
4218
|
+
l.insert(() => e).attr("style", i);
|
|
4219
|
+
}
|
|
4220
|
+
return U(t, S), t.intersect = function(e) {
|
|
4221
|
+
return J.rect(t, e);
|
|
4222
|
+
}, l;
|
|
4223
|
+
}
|
|
4224
|
+
t(jn, "requirementBox");
|
|
4225
|
+
async function $(e, t, r, i = "") {
|
|
4226
|
+
if (t === "") return 0;
|
|
4227
|
+
let o = e.insert("g").attr("class", "label").attr("style", i), s = c(), l = s.htmlLabels ?? !0, u = await S(o, a(m(t)), {
|
|
4228
|
+
width: g(t, s) + 50,
|
|
4229
|
+
classes: "markdown-node-label",
|
|
4230
|
+
useHtmlLabels: l,
|
|
4231
|
+
style: i
|
|
4232
|
+
}, s), d;
|
|
4233
|
+
if (l) {
|
|
4234
|
+
let e = u.children[0], t = n(u);
|
|
4235
|
+
d = e.getBoundingClientRect(), t.attr("width", d.width), t.attr("height", d.height);
|
|
4236
|
+
} else {
|
|
4237
|
+
let e = u.children[0];
|
|
4238
|
+
for (let t of e.children) t.textContent = t.textContent.replaceAll(">", ">").replaceAll("<", "<"), i && t.setAttribute("style", i);
|
|
4239
|
+
d = u.getBBox(), d.height += 6;
|
|
4240
|
+
}
|
|
4241
|
+
return o.attr("transform", `translate(${-d.width / 2},${-d.height / 2 + r})`), d.height;
|
|
4242
|
+
}
|
|
4243
|
+
t($, "addText");
|
|
4244
|
+
var Mn = /* @__PURE__ */ t((e) => {
|
|
4245
|
+
switch (e) {
|
|
4246
|
+
case "Very High": return "red";
|
|
4247
|
+
case "High": return "orange";
|
|
4248
|
+
case "Medium": return null;
|
|
4249
|
+
case "Low": return "blue";
|
|
4250
|
+
case "Very Low": return "lightblue";
|
|
4251
|
+
}
|
|
4252
|
+
}, "colorFromPriority");
|
|
4253
|
+
async function Nn(e, t, { config: n }) {
|
|
4254
|
+
let { labelStyles: r, nodeStyles: i } = y(t);
|
|
4255
|
+
t.labelStyle = r || "";
|
|
4256
|
+
let a = t.width;
|
|
4257
|
+
t.width = (t.width ?? 200) - 10;
|
|
4258
|
+
let { shapeSvg: o, bbox: s, label: c } = await H(e, t, W(t)), l = t.padding || 10, u = "", d;
|
|
4259
|
+
"ticket" in t && t.ticket && n?.kanban?.ticketBaseUrl && (u = n?.kanban?.ticketBaseUrl.replace("#TICKET#", t.ticket), d = o.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", u).attr("target", "_blank"));
|
|
4260
|
+
let f = {
|
|
4261
|
+
useHtmlLabels: t.useHtmlLabels,
|
|
4262
|
+
labelStyle: t.labelStyle || "",
|
|
4263
|
+
width: t.width,
|
|
4264
|
+
img: t.img,
|
|
4265
|
+
padding: t.padding || 8,
|
|
4266
|
+
centerLabel: !1
|
|
4267
|
+
}, p, m;
|
|
4268
|
+
d ? {label: p, bbox: m} = await He(d, "ticket" in t && t.ticket || "", f) : {label: p, bbox: m} = await He(o, "ticket" in t && t.ticket || "", f);
|
|
4269
|
+
let { label: h, bbox: g } = await He(o, "assigned" in t && t.assigned || "", f);
|
|
4270
|
+
t.width = a;
|
|
4271
|
+
let _ = t?.width || 0, b = Math.max(m.height, g.height) / 2, x = Math.max(s.height + 20, t?.height || 0) + b, S = -_ / 2, C = -x / 2;
|
|
4272
|
+
c.attr("transform", "translate(" + (l - _ / 2) + ", " + (-b - s.height / 2) + ")"), p.attr("transform", "translate(" + (l - _ / 2) + ", " + (-b + s.height / 2) + ")"), h.attr("transform", "translate(" + (l + _ / 2 - g.width - 20) + ", " + (-b + s.height / 2) + ")");
|
|
4273
|
+
let w, { rx: T, ry: E } = t, { cssStyles: D } = t;
|
|
4274
|
+
if (t.look === "handDrawn") {
|
|
4275
|
+
let e = V.svg(o), n = v(t, {}), r = T || E ? e.path(q(S, C, _, x, T || 0), n) : e.rectangle(S, C, _, x, n);
|
|
4276
|
+
w = o.insert(() => r, ":first-child"), w.attr("class", "basic label-container").attr("style", D || null);
|
|
4277
|
+
} else {
|
|
4278
|
+
w = o.insert("rect", ":first-child"), w.attr("class", "basic label-container __APA__").attr("style", i).attr("rx", T ?? 5).attr("ry", E ?? 5).attr("x", S).attr("y", C).attr("width", _).attr("height", x);
|
|
4279
|
+
let e = "priority" in t && t.priority;
|
|
4280
|
+
if (e) {
|
|
4281
|
+
let t = o.append("line"), n = S + 2, r = C + Math.floor((T ?? 0) / 2), i = C + x - Math.floor((T ?? 0) / 2);
|
|
4282
|
+
t.attr("x1", n).attr("y1", r).attr("x2", n).attr("y2", i).attr("stroke-width", "4").attr("stroke", Mn(e));
|
|
4283
|
+
}
|
|
4284
|
+
}
|
|
4285
|
+
return U(t, w), t.height = x, t.intersect = function(e) {
|
|
4286
|
+
return J.rect(t, e);
|
|
4287
|
+
}, o;
|
|
4288
|
+
}
|
|
4289
|
+
t(Nn, "kanbanItem");
|
|
4290
|
+
async function Pn(t, n) {
|
|
4291
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
4292
|
+
n.labelStyle = r;
|
|
4293
|
+
let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await H(t, n, W(n)), l = o.width + 10 * s, u = o.height + 8 * s, d = .15 * l, { cssStyles: f } = n, p = o.width + 20, m = o.height + 20, g = Math.max(l, p), _ = Math.max(u, m);
|
|
4294
|
+
c.attr("transform", `translate(${-o.width / 2}, ${-o.height / 2})`);
|
|
4295
|
+
let b, x = `M0 0
|
|
4296
|
+
a${d},${d} 1 0,0 ${g * .25},${-1 * _ * .1}
|
|
4297
|
+
a${d},${d} 1 0,0 ${g * .25},0
|
|
4298
|
+
a${d},${d} 1 0,0 ${g * .25},0
|
|
4299
|
+
a${d},${d} 1 0,0 ${g * .25},${_ * .1}
|
|
4300
|
+
|
|
4301
|
+
a${d},${d} 1 0,0 ${g * .15},${_ * .33}
|
|
4302
|
+
a${d * .8},${d * .8} 1 0,0 0,${_ * .34}
|
|
4303
|
+
a${d},${d} 1 0,0 ${-1 * g * .15},${_ * .33}
|
|
4304
|
+
|
|
4305
|
+
a${d},${d} 1 0,0 ${-1 * g * .25},${_ * .15}
|
|
4306
|
+
a${d},${d} 1 0,0 ${-1 * g * .25},0
|
|
4307
|
+
a${d},${d} 1 0,0 ${-1 * g * .25},0
|
|
4308
|
+
a${d},${d} 1 0,0 ${-1 * g * .25},${-1 * _ * .15}
|
|
4309
|
+
|
|
4310
|
+
a${d},${d} 1 0,0 ${-1 * g * .1},${-1 * _ * .33}
|
|
4311
|
+
a${d * .8},${d * .8} 1 0,0 0,${-1 * _ * .34}
|
|
4312
|
+
a${d},${d} 1 0,0 ${g * .1},${-1 * _ * .33}
|
|
4313
|
+
H0 V0 Z`;
|
|
4314
|
+
if (n.look === "handDrawn") {
|
|
4315
|
+
let e = V.svg(a), t = v(n, {}), r = e.path(x, t);
|
|
4316
|
+
b = a.insert(() => r, ":first-child"), b.attr("class", "basic label-container").attr("style", h(f));
|
|
4317
|
+
} else b = a.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", x);
|
|
4318
|
+
return b.attr("transform", `translate(${-g / 2}, ${-_ / 2})`), U(n, b), n.calcIntersect = function(e, t) {
|
|
4319
|
+
return J.rect(e, t);
|
|
4320
|
+
}, n.intersect = function(t) {
|
|
4321
|
+
return e.info("Bang intersect", n, t), J.rect(n, t);
|
|
4322
|
+
}, a;
|
|
4323
|
+
}
|
|
4324
|
+
t(Pn, "bang");
|
|
4325
|
+
async function Fn(t, n) {
|
|
4326
|
+
let { labelStyles: r, nodeStyles: i } = y(n);
|
|
4327
|
+
n.labelStyle = r;
|
|
4328
|
+
let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await H(t, n, W(n)), l = o.width + 2 * s, u = o.height + 2 * s, d = .15 * l, f = .25 * l, p = .35 * l, m = .2 * l, { cssStyles: g } = n, _, b = `M0 0
|
|
4329
|
+
a${d},${d} 0 0,1 ${l * .25},${-1 * l * .1}
|
|
4330
|
+
a${p},${p} 1 0,1 ${l * .4},${-1 * l * .1}
|
|
4331
|
+
a${f},${f} 1 0,1 ${l * .35},${l * .2}
|
|
4332
|
+
|
|
4333
|
+
a${d},${d} 1 0,1 ${l * .15},${u * .35}
|
|
4334
|
+
a${m},${m} 1 0,1 ${-1 * l * .15},${u * .65}
|
|
4335
|
+
|
|
4336
|
+
a${f},${d} 1 0,1 ${-1 * l * .25},${l * .15}
|
|
4337
|
+
a${p},${p} 1 0,1 ${-1 * l * .5},0
|
|
4338
|
+
a${d},${d} 1 0,1 ${-1 * l * .25},${-1 * l * .15}
|
|
4339
|
+
|
|
4340
|
+
a${d},${d} 1 0,1 ${-1 * l * .1},${-1 * u * .35}
|
|
4341
|
+
a${m},${m} 1 0,1 ${l * .1},${-1 * u * .65}
|
|
4342
|
+
H0 V0 Z`;
|
|
4343
|
+
if (n.look === "handDrawn") {
|
|
4344
|
+
let e = V.svg(a), t = v(n, {}), r = e.path(b, t);
|
|
4345
|
+
_ = a.insert(() => r, ":first-child"), _.attr("class", "basic label-container").attr("style", h(g));
|
|
4346
|
+
} else _ = a.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", b);
|
|
4347
|
+
return c.attr("transform", `translate(${-o.width / 2}, ${-o.height / 2})`), _.attr("transform", `translate(${-l / 2}, ${-u / 2})`), U(n, _), n.calcIntersect = function(e, t) {
|
|
4348
|
+
return J.rect(e, t);
|
|
4349
|
+
}, n.intersect = function(t) {
|
|
4350
|
+
return e.info("Cloud intersect", n, t), J.rect(n, t);
|
|
4351
|
+
}, a;
|
|
4352
|
+
}
|
|
4353
|
+
t(Fn, "cloud");
|
|
4354
|
+
async function In(e, t) {
|
|
4355
|
+
let { labelStyles: n, nodeStyles: r } = y(t);
|
|
4356
|
+
t.labelStyle = n;
|
|
4357
|
+
let { shapeSvg: i, bbox: a, halfPadding: o, label: s } = await H(e, t, W(t)), c = a.width + 8 * o, l = a.height + 2 * o, u = `
|
|
4358
|
+
M${-c / 2} ${l / 2 - 5}
|
|
4359
|
+
v${-l + 10}
|
|
4360
|
+
q0,-5 5,-5
|
|
4361
|
+
h${c - 10}
|
|
4362
|
+
q5,0 5,5
|
|
4363
|
+
v${l - 10}
|
|
4364
|
+
q0,5 -5,5
|
|
4365
|
+
h${-c + 10}
|
|
4366
|
+
q-5,0 -5,-5
|
|
4367
|
+
Z
|
|
4368
|
+
`, d = i.append("path").attr("id", "node-" + t.id).attr("class", "node-bkg node-" + t.type).attr("style", r).attr("d", u);
|
|
4369
|
+
return i.append("line").attr("class", "node-line-").attr("x1", -c / 2).attr("y1", l / 2).attr("x2", c / 2).attr("y2", l / 2), s.attr("transform", `translate(${-a.width / 2}, ${-a.height / 2})`), i.append(() => s.node()), U(t, d), t.calcIntersect = function(e, t) {
|
|
4370
|
+
return J.rect(e, t);
|
|
4371
|
+
}, t.intersect = function(e) {
|
|
4372
|
+
return J.rect(t, e);
|
|
4373
|
+
}, i;
|
|
4374
|
+
}
|
|
4375
|
+
t(In, "defaultMindmapNode");
|
|
4376
|
+
async function Ln(e, t) {
|
|
4377
|
+
return mt(e, t, { padding: t.padding ?? 0 });
|
|
4378
|
+
}
|
|
4379
|
+
t(Ln, "mindmapCircle");
|
|
4380
|
+
var Rn = [
|
|
4381
|
+
{
|
|
4382
|
+
semanticName: "Process",
|
|
4383
|
+
name: "Rectangle",
|
|
4384
|
+
shortName: "rect",
|
|
4385
|
+
description: "Standard process shape",
|
|
4386
|
+
aliases: [
|
|
4387
|
+
"proc",
|
|
4388
|
+
"process",
|
|
4389
|
+
"rectangle"
|
|
4390
|
+
],
|
|
4391
|
+
internalAliases: ["squareRect"],
|
|
4392
|
+
handler: sn
|
|
4393
|
+
},
|
|
4394
|
+
{
|
|
4395
|
+
semanticName: "Event",
|
|
4396
|
+
name: "Rounded Rectangle",
|
|
4397
|
+
shortName: "rounded",
|
|
4398
|
+
description: "Represents an event",
|
|
4399
|
+
aliases: ["event"],
|
|
4400
|
+
internalAliases: ["roundedRect"],
|
|
4401
|
+
handler: rn
|
|
4402
|
+
},
|
|
4403
|
+
{
|
|
4404
|
+
semanticName: "Terminal Point",
|
|
4405
|
+
name: "Stadium",
|
|
4406
|
+
shortName: "stadium",
|
|
4407
|
+
description: "Terminal point",
|
|
4408
|
+
aliases: ["terminal", "pill"],
|
|
4409
|
+
handler: cn
|
|
4410
|
+
},
|
|
4411
|
+
{
|
|
4412
|
+
semanticName: "Subprocess",
|
|
4413
|
+
name: "Framed Rectangle",
|
|
4414
|
+
shortName: "fr-rect",
|
|
4415
|
+
description: "Subprocess",
|
|
4416
|
+
aliases: [
|
|
4417
|
+
"subprocess",
|
|
4418
|
+
"subproc",
|
|
4419
|
+
"framed-rectangle",
|
|
4420
|
+
"subroutine"
|
|
4421
|
+
],
|
|
4422
|
+
handler: fn
|
|
4423
|
+
},
|
|
4424
|
+
{
|
|
4425
|
+
semanticName: "Database",
|
|
4426
|
+
name: "Cylinder",
|
|
4427
|
+
shortName: "cyl",
|
|
4428
|
+
description: "Database storage",
|
|
4429
|
+
aliases: [
|
|
4430
|
+
"db",
|
|
4431
|
+
"database",
|
|
4432
|
+
"cylinder"
|
|
4433
|
+
],
|
|
4434
|
+
handler: wt
|
|
4435
|
+
},
|
|
4436
|
+
{
|
|
4437
|
+
semanticName: "Start",
|
|
4438
|
+
name: "Circle",
|
|
4439
|
+
shortName: "circle",
|
|
4440
|
+
description: "Starting point",
|
|
4441
|
+
aliases: ["circ"],
|
|
4442
|
+
handler: mt
|
|
4443
|
+
},
|
|
4444
|
+
{
|
|
4445
|
+
semanticName: "Bang",
|
|
4446
|
+
name: "Bang",
|
|
4447
|
+
shortName: "bang",
|
|
4448
|
+
description: "Bang",
|
|
4449
|
+
aliases: ["bang"],
|
|
4450
|
+
handler: Pn
|
|
4451
|
+
},
|
|
4452
|
+
{
|
|
4453
|
+
semanticName: "Cloud",
|
|
4454
|
+
name: "Cloud",
|
|
4455
|
+
shortName: "cloud",
|
|
4456
|
+
description: "cloud",
|
|
4457
|
+
aliases: ["cloud"],
|
|
4458
|
+
handler: Fn
|
|
4459
|
+
},
|
|
4460
|
+
{
|
|
4461
|
+
semanticName: "Decision",
|
|
4462
|
+
name: "Diamond",
|
|
4463
|
+
shortName: "diam",
|
|
4464
|
+
description: "Decision-making step",
|
|
4465
|
+
aliases: [
|
|
4466
|
+
"decision",
|
|
4467
|
+
"diamond",
|
|
4468
|
+
"question"
|
|
4469
|
+
],
|
|
4470
|
+
handler: $t
|
|
4471
|
+
},
|
|
4472
|
+
{
|
|
4473
|
+
semanticName: "Prepare Conditional",
|
|
4474
|
+
name: "Hexagon",
|
|
4475
|
+
shortName: "hex",
|
|
4476
|
+
description: "Preparation or condition step",
|
|
4477
|
+
aliases: ["hexagon", "prepare"],
|
|
4478
|
+
handler: jt
|
|
4479
|
+
},
|
|
4480
|
+
{
|
|
4481
|
+
semanticName: "Data Input/Output",
|
|
4482
|
+
name: "Lean Right",
|
|
4483
|
+
shortName: "lean-r",
|
|
4484
|
+
description: "Represents input or output",
|
|
4485
|
+
aliases: ["lean-right", "in-out"],
|
|
4486
|
+
internalAliases: ["lean_right"],
|
|
4487
|
+
handler: Ht
|
|
4488
|
+
},
|
|
4489
|
+
{
|
|
4490
|
+
semanticName: "Data Input/Output",
|
|
4491
|
+
name: "Lean Left",
|
|
4492
|
+
shortName: "lean-l",
|
|
4493
|
+
description: "Represents output or input",
|
|
4494
|
+
aliases: ["lean-left", "out-in"],
|
|
4495
|
+
internalAliases: ["lean_left"],
|
|
4496
|
+
handler: Vt
|
|
4497
|
+
},
|
|
4498
|
+
{
|
|
4499
|
+
semanticName: "Priority Action",
|
|
4500
|
+
name: "Trapezoid Base Bottom",
|
|
4501
|
+
shortName: "trap-b",
|
|
4502
|
+
description: "Priority action",
|
|
4503
|
+
aliases: [
|
|
4504
|
+
"priority",
|
|
4505
|
+
"trapezoid-bottom",
|
|
4506
|
+
"trapezoid"
|
|
4507
|
+
],
|
|
4508
|
+
handler: bn
|
|
4509
|
+
},
|
|
4510
|
+
{
|
|
4511
|
+
semanticName: "Manual Operation",
|
|
4512
|
+
name: "Trapezoid Base Top",
|
|
4513
|
+
shortName: "trap-t",
|
|
4514
|
+
description: "Represents a manual task",
|
|
4515
|
+
aliases: [
|
|
4516
|
+
"manual",
|
|
4517
|
+
"trapezoid-top",
|
|
4518
|
+
"inv-trapezoid"
|
|
4519
|
+
],
|
|
4520
|
+
internalAliases: ["inv_trapezoid"],
|
|
4521
|
+
handler: Rt
|
|
4522
|
+
},
|
|
4523
|
+
{
|
|
4524
|
+
semanticName: "Stop",
|
|
4525
|
+
name: "Double Circle",
|
|
4526
|
+
shortName: "dbl-circ",
|
|
4527
|
+
description: "Represents a stop point",
|
|
4528
|
+
aliases: ["double-circle"],
|
|
4529
|
+
internalAliases: ["doublecircle"],
|
|
4530
|
+
handler: Et
|
|
4531
|
+
},
|
|
4532
|
+
{
|
|
4533
|
+
semanticName: "Text Block",
|
|
4534
|
+
name: "Text Block",
|
|
4535
|
+
shortName: "text",
|
|
4536
|
+
description: "Text block",
|
|
4537
|
+
handler: hn
|
|
4538
|
+
},
|
|
4539
|
+
{
|
|
4540
|
+
semanticName: "Card",
|
|
4541
|
+
name: "Notched Rectangle",
|
|
4542
|
+
shortName: "notch-rect",
|
|
4543
|
+
description: "Represents a card",
|
|
4544
|
+
aliases: ["card", "notched-rectangle"],
|
|
4545
|
+
handler: ft
|
|
4546
|
+
},
|
|
4547
|
+
{
|
|
4548
|
+
semanticName: "Lined/Shaded Process",
|
|
4549
|
+
name: "Lined Rectangle",
|
|
4550
|
+
shortName: "lin-rect",
|
|
4551
|
+
description: "Lined process shape",
|
|
4552
|
+
aliases: [
|
|
4553
|
+
"lined-rectangle",
|
|
4554
|
+
"lined-process",
|
|
4555
|
+
"lin-proc",
|
|
4556
|
+
"shaded-process"
|
|
4557
|
+
],
|
|
4558
|
+
handler: an
|
|
4559
|
+
},
|
|
4560
|
+
{
|
|
4561
|
+
semanticName: "Start",
|
|
4562
|
+
name: "Small Circle",
|
|
4563
|
+
shortName: "sm-circ",
|
|
4564
|
+
description: "Small starting point",
|
|
4565
|
+
aliases: ["start", "small-circle"],
|
|
4566
|
+
internalAliases: ["stateStart"],
|
|
4567
|
+
handler: dn
|
|
4568
|
+
},
|
|
4569
|
+
{
|
|
4570
|
+
semanticName: "Stop",
|
|
4571
|
+
name: "Framed Circle",
|
|
4572
|
+
shortName: "fr-circ",
|
|
4573
|
+
description: "Stop point",
|
|
4574
|
+
aliases: ["stop", "framed-circle"],
|
|
4575
|
+
internalAliases: ["stateEnd"],
|
|
4576
|
+
handler: un
|
|
4577
|
+
},
|
|
4578
|
+
{
|
|
4579
|
+
semanticName: "Fork/Join",
|
|
4580
|
+
name: "Filled Rectangle",
|
|
4581
|
+
shortName: "fork",
|
|
4582
|
+
description: "Fork or join in process flow",
|
|
4583
|
+
aliases: ["join"],
|
|
4584
|
+
internalAliases: ["forkJoin"],
|
|
4585
|
+
handler: kt
|
|
4586
|
+
},
|
|
4587
|
+
{
|
|
4588
|
+
semanticName: "Collate",
|
|
4589
|
+
name: "Hourglass",
|
|
4590
|
+
shortName: "hourglass",
|
|
4591
|
+
description: "Represents a collate operation",
|
|
4592
|
+
aliases: ["hourglass", "collate"],
|
|
4593
|
+
handler: Mt
|
|
4594
|
+
},
|
|
4595
|
+
{
|
|
4596
|
+
semanticName: "Comment",
|
|
4597
|
+
name: "Curly Brace",
|
|
4598
|
+
shortName: "brace",
|
|
4599
|
+
description: "Adds a comment",
|
|
4600
|
+
aliases: ["comment", "brace-l"],
|
|
4601
|
+
handler: _t
|
|
4602
|
+
},
|
|
4603
|
+
{
|
|
4604
|
+
semanticName: "Comment Right",
|
|
4605
|
+
name: "Curly Brace",
|
|
4606
|
+
shortName: "brace-r",
|
|
4607
|
+
description: "Adds a comment",
|
|
4608
|
+
handler: vt
|
|
4609
|
+
},
|
|
4610
|
+
{
|
|
4611
|
+
semanticName: "Comment with braces on both sides",
|
|
4612
|
+
name: "Curly Braces",
|
|
4613
|
+
shortName: "braces",
|
|
4614
|
+
description: "Adds a comment",
|
|
4615
|
+
handler: yt
|
|
4616
|
+
},
|
|
4617
|
+
{
|
|
4618
|
+
semanticName: "Com Link",
|
|
4619
|
+
name: "Lightning Bolt",
|
|
4620
|
+
shortName: "bolt",
|
|
4621
|
+
description: "Communication link",
|
|
4622
|
+
aliases: ["com-link", "lightning-bolt"],
|
|
4623
|
+
handler: Ut
|
|
4624
|
+
},
|
|
4625
|
+
{
|
|
4626
|
+
semanticName: "Document",
|
|
4627
|
+
name: "Document",
|
|
4628
|
+
shortName: "doc",
|
|
4629
|
+
description: "Represents a document",
|
|
4630
|
+
aliases: ["doc", "document"],
|
|
4631
|
+
handler: Cn
|
|
4632
|
+
},
|
|
4633
|
+
{
|
|
4634
|
+
semanticName: "Delay",
|
|
4635
|
+
name: "Half-Rounded Rectangle",
|
|
4636
|
+
shortName: "delay",
|
|
4637
|
+
description: "Represents a delay",
|
|
4638
|
+
aliases: ["half-rounded-rectangle"],
|
|
4639
|
+
handler: At
|
|
4640
|
+
},
|
|
4641
|
+
{
|
|
4642
|
+
semanticName: "Direct Access Storage",
|
|
4643
|
+
name: "Horizontal Cylinder",
|
|
4644
|
+
shortName: "h-cyl",
|
|
4645
|
+
description: "Direct access storage",
|
|
4646
|
+
aliases: ["das", "horizontal-cylinder"],
|
|
4647
|
+
handler: yn
|
|
4648
|
+
},
|
|
4649
|
+
{
|
|
4650
|
+
semanticName: "Disk Storage",
|
|
4651
|
+
name: "Lined Cylinder",
|
|
4652
|
+
shortName: "lin-cyl",
|
|
4653
|
+
description: "Disk storage",
|
|
4654
|
+
aliases: ["disk", "lined-cylinder"],
|
|
4655
|
+
handler: qt
|
|
4656
|
+
},
|
|
4657
|
+
{
|
|
4658
|
+
semanticName: "Display",
|
|
4659
|
+
name: "Curved Trapezoid",
|
|
4660
|
+
shortName: "curv-trap",
|
|
4661
|
+
description: "Represents a display",
|
|
4662
|
+
aliases: ["curved-trapezoid", "display"],
|
|
4663
|
+
handler: bt
|
|
4664
|
+
},
|
|
4665
|
+
{
|
|
4666
|
+
semanticName: "Divided Process",
|
|
4667
|
+
name: "Divided Rectangle",
|
|
4668
|
+
shortName: "div-rect",
|
|
4669
|
+
description: "Divided process shape",
|
|
4670
|
+
aliases: [
|
|
4671
|
+
"div-proc",
|
|
4672
|
+
"divided-rectangle",
|
|
4673
|
+
"divided-process"
|
|
4674
|
+
],
|
|
4675
|
+
handler: Tt
|
|
4676
|
+
},
|
|
4677
|
+
{
|
|
4678
|
+
semanticName: "Extract",
|
|
4679
|
+
name: "Triangle",
|
|
4680
|
+
shortName: "tri",
|
|
4681
|
+
description: "Extraction process",
|
|
4682
|
+
aliases: ["extract", "triangle"],
|
|
4683
|
+
handler: Sn
|
|
4684
|
+
},
|
|
4685
|
+
{
|
|
4686
|
+
semanticName: "Internal Storage",
|
|
4687
|
+
name: "Window Pane",
|
|
4688
|
+
shortName: "win-pane",
|
|
4689
|
+
description: "Internal storage",
|
|
4690
|
+
aliases: ["internal-storage", "window-pane"],
|
|
4691
|
+
handler: Tn
|
|
4692
|
+
},
|
|
4693
|
+
{
|
|
4694
|
+
semanticName: "Junction",
|
|
4695
|
+
name: "Filled Circle",
|
|
4696
|
+
shortName: "f-circ",
|
|
4697
|
+
description: "Junction point",
|
|
4698
|
+
aliases: ["junction", "filled-circle"],
|
|
4699
|
+
handler: Dt
|
|
4700
|
+
},
|
|
4701
|
+
{
|
|
4702
|
+
semanticName: "Loop Limit",
|
|
4703
|
+
name: "Trapezoidal Pentagon",
|
|
4704
|
+
shortName: "notch-pent",
|
|
4705
|
+
description: "Loop limit step",
|
|
4706
|
+
aliases: ["loop-limit", "notched-pentagon"],
|
|
4707
|
+
handler: xn
|
|
4708
|
+
},
|
|
4709
|
+
{
|
|
4710
|
+
semanticName: "Manual File",
|
|
4711
|
+
name: "Flipped Triangle",
|
|
4712
|
+
shortName: "flip-tri",
|
|
4713
|
+
description: "Manual file operation",
|
|
4714
|
+
aliases: ["manual-file", "flipped-triangle"],
|
|
4715
|
+
handler: Ot
|
|
4716
|
+
},
|
|
4717
|
+
{
|
|
4718
|
+
semanticName: "Manual Input",
|
|
4719
|
+
name: "Sloped Rectangle",
|
|
4720
|
+
shortName: "sl-rect",
|
|
4721
|
+
description: "Manual input step",
|
|
4722
|
+
aliases: ["manual-input", "sloped-rectangle"],
|
|
4723
|
+
handler: on
|
|
4724
|
+
},
|
|
4725
|
+
{
|
|
4726
|
+
semanticName: "Multi-Document",
|
|
4727
|
+
name: "Stacked Document",
|
|
4728
|
+
shortName: "docs",
|
|
4729
|
+
description: "Multiple documents",
|
|
4730
|
+
aliases: [
|
|
4731
|
+
"documents",
|
|
4732
|
+
"st-doc",
|
|
4733
|
+
"stacked-document"
|
|
4734
|
+
],
|
|
4735
|
+
handler: Xt
|
|
4736
|
+
},
|
|
4737
|
+
{
|
|
4738
|
+
semanticName: "Multi-Process",
|
|
4739
|
+
name: "Stacked Rectangle",
|
|
4740
|
+
shortName: "st-rect",
|
|
4741
|
+
description: "Multiple processes",
|
|
4742
|
+
aliases: [
|
|
4743
|
+
"procs",
|
|
4744
|
+
"processes",
|
|
4745
|
+
"stacked-rectangle"
|
|
4746
|
+
],
|
|
4747
|
+
handler: Yt
|
|
4748
|
+
},
|
|
4749
|
+
{
|
|
4750
|
+
semanticName: "Stored Data",
|
|
4751
|
+
name: "Bow Tie Rectangle",
|
|
4752
|
+
shortName: "bow-rect",
|
|
4753
|
+
description: "Stored data",
|
|
4754
|
+
aliases: ["stored-data", "bow-tie-rectangle"],
|
|
4755
|
+
handler: dt
|
|
4756
|
+
},
|
|
4757
|
+
{
|
|
4758
|
+
semanticName: "Summary",
|
|
4759
|
+
name: "Crossed Circle",
|
|
4760
|
+
shortName: "cross-circ",
|
|
4761
|
+
description: "Summary",
|
|
4762
|
+
aliases: ["summary", "crossed-circle"],
|
|
4763
|
+
handler: gt
|
|
4764
|
+
},
|
|
4765
|
+
{
|
|
4766
|
+
semanticName: "Tagged Document",
|
|
4767
|
+
name: "Tagged Document",
|
|
4768
|
+
shortName: "tag-doc",
|
|
4769
|
+
description: "Tagged document",
|
|
4770
|
+
aliases: ["tag-doc", "tagged-document"],
|
|
4771
|
+
handler: mn
|
|
4772
|
+
},
|
|
4773
|
+
{
|
|
4774
|
+
semanticName: "Tagged Process",
|
|
4775
|
+
name: "Tagged Rectangle",
|
|
4776
|
+
shortName: "tag-rect",
|
|
4777
|
+
description: "Tagged process",
|
|
4778
|
+
aliases: [
|
|
4779
|
+
"tagged-rectangle",
|
|
4780
|
+
"tag-proc",
|
|
4781
|
+
"tagged-process"
|
|
4782
|
+
],
|
|
4783
|
+
handler: pn
|
|
4784
|
+
},
|
|
4785
|
+
{
|
|
4786
|
+
semanticName: "Paper Tape",
|
|
4787
|
+
name: "Flag",
|
|
4788
|
+
shortName: "flag",
|
|
4789
|
+
description: "Paper tape",
|
|
4790
|
+
aliases: ["paper-tape"],
|
|
4791
|
+
handler: wn
|
|
4792
|
+
},
|
|
4793
|
+
{
|
|
4794
|
+
semanticName: "Odd",
|
|
4795
|
+
name: "Odd",
|
|
4796
|
+
shortName: "odd",
|
|
4797
|
+
description: "Odd shape",
|
|
4798
|
+
internalAliases: ["rect_left_inv_arrow"],
|
|
4799
|
+
handler: en
|
|
4800
|
+
},
|
|
4801
|
+
{
|
|
4802
|
+
semanticName: "Lined Document",
|
|
4803
|
+
name: "Lined Document",
|
|
4804
|
+
shortName: "lin-doc",
|
|
4805
|
+
description: "Lined document",
|
|
4806
|
+
aliases: ["lined-document"],
|
|
4807
|
+
handler: Jt
|
|
4808
|
+
}
|
|
4809
|
+
], zn = (/* @__PURE__ */ t(() => {
|
|
4810
|
+
let e = [...Object.entries({
|
|
4811
|
+
state: ln,
|
|
4812
|
+
choice: pt,
|
|
4813
|
+
note: Zt,
|
|
4814
|
+
rectWithTitle: tn,
|
|
4815
|
+
labelRect: Bt,
|
|
4816
|
+
iconSquare: It,
|
|
4817
|
+
iconCircle: Pt,
|
|
4818
|
+
icon: Nt,
|
|
4819
|
+
iconRounded: Ft,
|
|
4820
|
+
imageSquare: Lt,
|
|
4821
|
+
anchor: lt,
|
|
4822
|
+
kanbanItem: Nn,
|
|
4823
|
+
mindmapCircle: Ln,
|
|
4824
|
+
defaultMindmapNode: In,
|
|
4825
|
+
classBox: An,
|
|
4826
|
+
erBox: En,
|
|
4827
|
+
requirementBox: jn
|
|
4828
|
+
}), ...Rn.flatMap((e) => [
|
|
4829
|
+
e.shortName,
|
|
4830
|
+
..."aliases" in e ? e.aliases : [],
|
|
4831
|
+
..."internalAliases" in e ? e.internalAliases : []
|
|
4832
|
+
].map((t) => [t, e.handler]))];
|
|
4833
|
+
return Object.fromEntries(e);
|
|
4834
|
+
}, "generateShapeMap"))();
|
|
4835
|
+
function Bn(e) {
|
|
4836
|
+
return e in zn;
|
|
4837
|
+
}
|
|
4838
|
+
t(Bn, "isValidShape");
|
|
4839
|
+
var Vn = /* @__PURE__ */ new Map();
|
|
4840
|
+
async function Hn(e, t, n) {
|
|
4841
|
+
let r, i;
|
|
4842
|
+
t.shape === "rect" && (t.rx && t.ry ? t.shape = "roundedRect" : t.shape = "squareRect");
|
|
4843
|
+
let a = t.shape ? zn[t.shape] : void 0;
|
|
4844
|
+
if (!a) throw Error(`No such shape: ${t.shape}. Please check your syntax.`);
|
|
4845
|
+
if (t.link) {
|
|
4846
|
+
let o;
|
|
4847
|
+
n.config.securityLevel === "sandbox" ? o = "_top" : t.linkTarget && (o = t.linkTarget || "_blank"), r = e.insert("svg:a").attr("xlink:href", t.link).attr("target", o ?? null), i = await a(r, t, n);
|
|
4848
|
+
} else i = await a(e, t, n), r = i;
|
|
4849
|
+
return t.tooltip && i.attr("title", t.tooltip), Vn.set(t.id, r), t.haveCallback && r.attr("class", r.attr("class") + " clickable"), r;
|
|
4850
|
+
}
|
|
4851
|
+
t(Hn, "insertNode");
|
|
4852
|
+
var Un = /* @__PURE__ */ t((e, t) => {
|
|
4853
|
+
Vn.set(t.id, e);
|
|
4854
|
+
}, "setNodeElem"), Wn = /* @__PURE__ */ t(() => {
|
|
4855
|
+
Vn.clear();
|
|
4856
|
+
}, "clear"), Gn = /* @__PURE__ */ t((t) => {
|
|
4857
|
+
let n = Vn.get(t.id);
|
|
4858
|
+
e.trace("Transforming node", t.diff, t, "translate(" + (t.x - t.width / 2 - 5) + ", " + t.width / 2 + ")");
|
|
4859
|
+
let r = t.diff || 0;
|
|
4860
|
+
return t.clusterNode ? n.attr("transform", "translate(" + (t.x + r - t.width / 2) + ", " + (t.y - t.height / 2 - 8) + ")") : n.attr("transform", "translate(" + t.x + ", " + t.y + ")"), r;
|
|
4861
|
+
}, "positionNode");
|
|
4862
|
+
//#endregion
|
|
4863
|
+
export { Hn as a, Gn as c, V as d, Ze as i, Un as l, Wn as n, Bn as o, qe as r, H as s, Qe as t, U as u };
|