@diagrammo/dgmo 0.95.0 → 0.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/advanced.d.ts +190 -568
- package/dist/advanced.js +259 -470
- package/dist/block.d.ts +8 -0
- package/dist/block.js +144 -73
- package/dist/{calculator-BNH3GSJE.js → calculator-CIGGTURF.js} +2 -2
- package/dist/{chart-meta-BbjsRY7o.d.ts → chart-meta-B7niEd52.d.ts} +3 -1
- package/dist/chart-meta.d.ts +2 -2
- package/dist/chart-meta.js +19 -19
- package/dist/{chart-types-Cppnp31G.d.ts → chart-types-Dxtv4XSz.d.ts} +4 -5
- package/dist/{charts-d3-SZV2SFTM.js → charts-d3-INWEGMSD.js} +14 -14
- package/dist/{chunk-P5XA627W.js → chunk-2FMOLWX4.js} +73 -65
- package/dist/{chunk-MLY5ALOV.js → chunk-2SZILMQT.js} +57 -15
- package/dist/chunk-35A3J4Z5.js +14 -0
- package/dist/{chunk-UXNA2H2V.js → chunk-3C4OXVZJ.js} +2 -2
- package/dist/{chunk-IZHGT5HD.js → chunk-3HL6NSSQ.js} +63 -18
- package/dist/{chunk-2WQ3YZMN.js → chunk-3IUMSK72.js} +2 -2
- package/dist/{chunk-LAXMUSGW.js → chunk-44RLIAYC.js} +17 -10
- package/dist/{chunk-H7AXCRO7.js → chunk-453IWXZ3.js} +0 -11
- package/dist/{chunk-2I4UQG7W.js → chunk-47INRTZ6.js} +2 -2
- package/dist/{chunk-IN7XI6NO.js → chunk-4NMRS6HW.js} +1 -1
- package/dist/{chunk-KLBTJEIK.js → chunk-4TK26YHH.js} +2 -2
- package/dist/{chunk-CN4RDJDV.js → chunk-5TGZBHEJ.js} +1 -1
- package/dist/{chunk-IXHWS2HI.js → chunk-5WZYJC2P.js} +2 -2
- package/dist/{chunk-KBDMEOLI.js → chunk-65JFUANT.js} +1 -1
- package/dist/{chunk-D3K4U3ZM.js → chunk-6K2W3FH7.js} +8 -5
- package/dist/{chunk-NXU4N5WT.js → chunk-6OUMYNAJ.js} +1 -1
- package/dist/{chunk-KRPLP5LP.js → chunk-6PUBFB6D.js} +24 -3
- package/dist/{chunk-EXHXTMVR.js → chunk-6S2H6EKN.js} +3 -3
- package/dist/{chunk-KSZB7TIY.js → chunk-6SDEXSJY.js} +42 -22
- package/dist/{chunk-IQN2NGEU.js → chunk-6YBZFOTA.js} +13 -13
- package/dist/{chunk-IHN6WDEY.js → chunk-74XR7Z3I.js} +13 -13
- package/dist/{chunk-2J2CWWWK.js → chunk-7ASVGFW3.js} +1 -1
- package/dist/{chunk-BH2SF4TT.js → chunk-7QKWU7FX.js} +3 -3
- package/dist/{chunk-A6YINTY6.js → chunk-7RACGVUY.js} +1 -1
- package/dist/{chunk-VB4VMB2I.js → chunk-7TEAFIEJ.js} +9 -5
- package/dist/{chunk-UNCCZ3NU.js → chunk-A3V72YIL.js} +14 -1
- package/dist/{chunk-BCV2VJTM.js → chunk-A5LFM62B.js} +3 -3
- package/dist/{chunk-U6VS3T2M.js → chunk-AULFF7L2.js} +4 -4
- package/dist/{chunk-LKZCUFOW.js → chunk-B7ZH5EQ2.js} +2 -2
- package/dist/{chunk-VGAMBOOC.js → chunk-C6ME2L4T.js} +2 -2
- package/dist/{chunk-3PP746YM.js → chunk-CGP7RGLJ.js} +1 -1
- package/dist/{chunk-67N26CER.js → chunk-CLW45YKE.js} +2 -1
- package/dist/{chunk-VTESGA5F.js → chunk-CUOMNKYW.js} +4 -4
- package/dist/{chunk-CDM6XMOT.js → chunk-CUTEHGXO.js} +2 -2
- package/dist/{chunk-NERQSSYD.js → chunk-D67YE4LR.js} +1 -1
- package/dist/{chunk-XOMIYMQ3.js → chunk-D7KZE2XJ.js} +39 -17
- package/dist/{chunk-NMS5XSLX.js → chunk-DFEVFLEG.js} +3 -3
- package/dist/{chunk-EBVVMUAA.js → chunk-DKMZ4VMV.js} +1 -1
- package/dist/{chunk-V5D6GDNK.js → chunk-DRY4W4W6.js} +36 -15
- package/dist/{chunk-XJQ6Z3FO.js → chunk-E6GHXMH2.js} +8 -8
- package/dist/{chunk-KBEWVCK3.js → chunk-EBJLT7PH.js} +1 -1
- package/dist/{chunk-TASRGDYP.js → chunk-EEIGHOJR.js} +92 -23
- package/dist/{chunk-AQQUJEDN.js → chunk-EUPUVYWO.js} +1 -1
- package/dist/{chunk-7IALGIOI.js → chunk-F2OAZHOX.js} +10 -5
- package/dist/{chunk-JXGSTBW6.js → chunk-FK6HZYGK.js} +4 -14
- package/dist/{chunk-OSSTOSXU.js → chunk-FTW2E2YH.js} +7 -10
- package/dist/{chunk-5P2L5QXE.js → chunk-FZVCS2XY.js} +4 -2
- package/dist/chunk-G24NSISJ.js +69 -0
- package/dist/{chunk-EBIDNRSR.js → chunk-GFQFLLP3.js} +2 -2
- package/dist/{chunk-RQTDUZUH.js → chunk-GLLYHYGT.js} +27 -17
- package/dist/{chunk-VLC6WNRD.js → chunk-GULGSH2Z.js} +4 -0
- package/dist/{chunk-H5NVCOEJ.js → chunk-GXBH7WNN.js} +2 -2
- package/dist/{chunk-C6G36F5S.js → chunk-H242TVAE.js} +9 -9
- package/dist/{chunk-5XBYLYYI.js → chunk-H7DZYHQF.js} +3 -3
- package/dist/{chunk-GLCMUTO5.js → chunk-HQNZJMNS.js} +1 -1
- package/dist/{chunk-IY62DXT2.js → chunk-IAM3IDL4.js} +2 -2
- package/dist/{chunk-IGJEKO2P.js → chunk-II6D6NWX.js} +8 -8
- package/dist/{chunk-AULZD45V.js → chunk-IUFTAFGN.js} +2 -2
- package/dist/{chunk-FWVE373X.js → chunk-IZEKHIV6.js} +3 -3
- package/dist/{chunk-BQMHJ6OW.js → chunk-J3YM6RA5.js} +22 -14
- package/dist/{chunk-R6EGUTIV.js → chunk-J467QBZF.js} +23 -3
- package/dist/{chunk-JJ7RGTAU.js → chunk-J7JF4QKA.js} +40 -30
- package/dist/{chunk-E7F76M3U.js → chunk-JULBDTNU.js} +61 -9
- package/dist/{chunk-EPDBWATV.js → chunk-K7RRXZHS.js} +4 -2
- package/dist/{chunk-ZECJ7Q6C.js → chunk-KMB754DO.js} +33 -6
- package/dist/chunk-KNKZGRRB.js +439 -0
- package/dist/{chunk-XIUGSUE4.js → chunk-KTGJQJB3.js} +6 -2
- package/dist/{chunk-4SACN2C5.js → chunk-KW3CC7SB.js} +1 -1
- package/dist/{chunk-3GUEYQGL.js → chunk-L3K5O3Z5.js} +3 -3
- package/dist/chunk-LRTSTDJ6.js +126 -0
- package/dist/{chunk-NBAAIRFP.js → chunk-LZATSXAA.js} +5 -2
- package/dist/{chunk-USE6HIOZ.js → chunk-MJ725XHD.js} +1156 -330
- package/dist/{chunk-3KVUFHUJ.js → chunk-NBISN6FH.js} +2 -2
- package/dist/{chunk-RITTLIDJ.js → chunk-NN5RUHXV.js} +84 -16
- package/dist/{chunk-62GLKE6Q.js → chunk-NOZMRPXI.js} +112 -157
- package/dist/{chunk-4XYZJTFO.js → chunk-NQFZ7LXC.js} +14 -6
- package/dist/chunk-NTDWVTEY.js +12 -0
- package/dist/{chunk-BQO24BDM.js → chunk-O3HRF25Z.js} +1 -1
- package/dist/{chunk-ZD3QCNB7.js → chunk-OSSA5UWA.js} +3 -3
- package/dist/{chunk-UOCWYLYT.js → chunk-OZXKW5NA.js} +1 -1
- package/dist/{chunk-NPDVWFAQ.js → chunk-PLQZJZ2K.js} +1 -1
- package/dist/chunk-PRG7NIUU.js +272 -0
- package/dist/{chunk-S4SJ4LLY.js → chunk-PSNRB75I.js} +3 -3
- package/dist/{chunk-QPQWY5RU.js → chunk-PT5VFY3B.js} +38 -14
- package/dist/{chunk-KAO7JL4I.js → chunk-PU5X3P3T.js} +6 -5
- package/dist/{chunk-J7Q4AB23.js → chunk-PZ5LAAO3.js} +2 -2
- package/dist/{chunk-TOHTKLKE.js → chunk-Q5Q5JLRT.js} +1 -1
- package/dist/{chunk-Y3SIQN4J.js → chunk-Q6V342WS.js} +17 -5
- package/dist/{chunk-RBVFNUAL.js → chunk-QDPTOIG7.js} +5 -5
- package/dist/{chunk-ERT7XDQW.js → chunk-QIITSGI5.js} +1 -1
- package/dist/{chunk-NM5V5EKY.js → chunk-QLIZ7SB7.js} +1 -1
- package/dist/chunk-QLNLRZ37.js +181 -0
- package/dist/{chunk-HHVIE45A.js → chunk-QOLRTPGH.js} +6 -6
- package/dist/{chunk-2ZW4NBYX.js → chunk-R4SXMBGF.js} +1 -1
- package/dist/chunk-R4U7IIRX.js +178 -0
- package/dist/{chunk-BRGRIZQB.js → chunk-RC6PISCK.js} +4 -2
- package/dist/{chunk-UIEKW4SG.js → chunk-REKLKGR6.js} +3 -4
- package/dist/{chunk-TIIZIAGS.js → chunk-RFGQDIOI.js} +843 -233
- package/dist/{chunk-FVTYJUXR.js → chunk-ROFSIFSY.js} +4 -4
- package/dist/{chunk-VSAKEMDD.js → chunk-ROH4LYBL.js} +71 -21
- package/dist/{chunk-4UVCTLRH.js → chunk-SNDCXT5R.js} +9 -7
- package/dist/{chunk-R46N5KR4.js → chunk-SQBCNEJB.js} +2 -1
- package/dist/{chunk-66JTY4AN.js → chunk-TDUBTDXS.js} +1 -1
- package/dist/{chunk-PGSGJLUR.js → chunk-TMB4YY3J.js} +34 -4
- package/dist/{chunk-UZ7EZW3B.js → chunk-TO53KK2P.js} +6 -1
- package/dist/{chunk-5KKZXA44.js → chunk-V3ICBS2O.js} +7 -5
- package/dist/{chunk-GWQRTA5W.js → chunk-V65EDV6S.js} +3 -3
- package/dist/{chunk-VF7IKIRS.js → chunk-VKT3BVRO.js} +35 -11
- package/dist/{chunk-L5S32VZJ.js → chunk-VOO65FKC.js} +12 -12
- package/dist/{chunk-PVWIBKV2.js → chunk-VQWLASDC.js} +2 -2
- package/dist/{chunk-JILEYZ2V.js → chunk-VVL2KKG4.js} +1 -1
- package/dist/{chunk-GI5R5B3S.js → chunk-VVZDBUHA.js} +2 -2
- package/dist/{chunk-PGBTUGDB.js → chunk-W46OMHOK.js} +23 -27
- package/dist/{chunk-XCKNFFKM.js → chunk-WH6E6SHC.js} +2 -4
- package/dist/{chunk-H6BT45SN.js → chunk-WPYJAHRP.js} +1 -1
- package/dist/{chunk-LJGE43SG.js → chunk-WXGFB2O2.js} +3 -3
- package/dist/{chunk-YQMIKX54.js → chunk-XCYGOCMS.js} +102 -52
- package/dist/{chunk-BTP2BMWN.js → chunk-XEMCNQQW.js} +15 -15
- package/dist/{chunk-NVZ7R4EK.js → chunk-XMUFXJI2.js} +6 -6
- package/dist/{chunk-AM42TLSZ.js → chunk-XZGXVN4T.js} +5 -5
- package/dist/{chunk-5OTA2PUH.js → chunk-YCIBBVI2.js} +2 -2
- package/dist/{chunk-V2NQV7VL.js → chunk-YFIDR7JH.js} +2 -2
- package/dist/{chunk-USZLHYEQ.js → chunk-YFWIFKRQ.js} +3 -3
- package/dist/{chunk-6XLMTAEX.js → chunk-YIHRLY55.js} +33 -6
- package/dist/{chunk-CYRB2JTN.js → chunk-YLKPRT6U.js} +1 -1
- package/dist/{chunk-KMU65FYM.js → chunk-YSDSFXQD.js} +1 -1
- package/dist/{chunk-ZI6WC24V.js → chunk-ZBJV4KNU.js} +1 -1
- package/dist/{chunk-4EX4OKGZ.js → chunk-ZCKVTZHD.js} +41 -19
- package/dist/{chunk-7PJBJ2DU.js → chunk-ZMVMGZAJ.js} +1 -1
- package/dist/{chunk-6EFCOES2.js → chunk-ZRW4B4KF.js} +48 -14
- package/dist/{chunk-A2A2I4Z4.js → chunk-ZTKO2RD4.js} +5 -5
- package/dist/collapse-6IGH2B24.js +31 -0
- package/dist/{collapse-BSPH3BFM.js → collapse-6X5S2S3G.js} +2 -1
- package/dist/collapse-GOWNCVHZ.js +7 -0
- package/dist/collapse-HNTPLB2Q.js +11 -0
- package/dist/collapse-NUM7DPJA.js +10 -0
- package/dist/completion-registry.js +28 -39
- package/dist/countdown.js +1 -1
- package/dist/dgmo-router-RSYWR5IS.js +101 -0
- package/dist/dimensions-KXAI7U2B.js +21 -0
- package/dist/editor.js +884 -222
- package/dist/{flowchart-parser-J3VWIFWB.js → flowchart-parser-UI5VZNGJ.js} +5 -5
- package/dist/{flowchart-renderer-FECH5KK5.js → flowchart-renderer-IYWPKPCF.js} +18 -18
- package/dist/fold-at-line-DmSAa1eU.d.ts +11 -0
- package/dist/highlight.js +886 -224
- package/dist/index.d.ts +89 -6
- package/dist/index.js +91 -70
- package/dist/{layout-TIBRMWHL.js → layout-6VY3DHYD.js} +6 -6
- package/dist/{layout-5SZ5A64I.js → layout-7C2QZCEZ.js} +10 -10
- package/dist/{layout-2WESJYRE.js → layout-7E7BNOGO.js} +3 -2
- package/dist/layout-BSK374N6.js +11 -0
- package/dist/{layout-RH3N46HP.js → layout-FJDBY3WG.js} +6 -5
- package/dist/{layout-YBMT74MG.js → layout-G3RVKEC4.js} +10 -10
- package/dist/{layout-KV27UW25.js → layout-GC5XX2RH.js} +2 -2
- package/dist/{layout-JTIRCKAW.js → layout-R6ULGQJK.js} +6 -6
- package/dist/{layout-HFBK5UEG.js → layout-ROI5KVSO.js} +3 -3
- package/dist/{layout-3TSVAGWH.js → layout-SPPS225I.js} +3 -3
- package/dist/{layout-HF3PMI4H.js → layout-VTGOYGRC.js} +2 -2
- package/dist/{layout-EWXHEXNS.js → layout-WBH5IHYK.js} +10 -10
- package/dist/layout-WTHBGTH2.js +15 -0
- package/dist/layout-ZCCABSV7.js +15 -0
- package/dist/{layout-search-AWPJWBKT.js → layout-search-DSIDKKQO.js} +8 -8
- package/dist/{legend-constants-55MFBXYF.js → legend-constants-KF3MKWL2.js} +2 -2
- package/dist/{parser-NUU3DVW4.js → parser-3PMYAVFL.js} +2 -2
- package/dist/{parser-KJPPUN4D.js → parser-5KVFS4RN.js} +2 -2
- package/dist/{parser-6TDWUKM5.js → parser-BA43YPIQ.js} +3 -3
- package/dist/{parser-EFF22GYO.js → parser-CFAYEWLF.js} +3 -3
- package/dist/{parser-A3AN76RQ.js → parser-DRFEX6OX.js} +3 -3
- package/dist/{parser-H5OODY5N.js → parser-DWVBRBB2.js} +3 -3
- package/dist/{parser-BJ7RJNUM.js → parser-E4B7HJT2.js} +3 -3
- package/dist/{parser-5UZV32ZI.js → parser-FWQY3HJX.js} +2 -2
- package/dist/{parser-RTWPFKXG.js → parser-GMCXCJSP.js} +3 -3
- package/dist/{parser-NL73FSFI.js → parser-IHFHPFL7.js} +3 -3
- package/dist/{parser-BTSTKY5G.js → parser-IU6425JW.js} +6 -6
- package/dist/{parser-ZRIZFDZY.js → parser-IZYIXDJX.js} +6 -6
- package/dist/{parser-4TBSWULQ.js → parser-JQGUTDSX.js} +3 -3
- package/dist/{parser-TUAEX6ML.js → parser-JRKPOO2Z.js} +3 -3
- package/dist/{parser-KMKVFET2.js → parser-KI2XYB2R.js} +2 -2
- package/dist/parser-LDVVBP7S.js +12 -0
- package/dist/{parser-YG625J5H.js → parser-MAGFK6OK.js} +4 -4
- package/dist/{parser-AR2GON37.js → parser-MH5BDN7X.js} +4 -4
- package/dist/{parser-EAQPZX2B.js → parser-MUHFEM4G.js} +3 -3
- package/dist/{parser-RCIEKN7Y.js → parser-P375HO7Q.js} +2 -2
- package/dist/{parser-GMQJISZ6.js → parser-PYY5BRLQ.js} +2 -2
- package/dist/parser-QEMFMVF5.js +12 -0
- package/dist/{parser-GDLKUBTO.js → parser-QIPDBT5M.js} +2 -2
- package/dist/{parser-BT4NI6JY.js → parser-RNBDDEGL.js} +3 -3
- package/dist/{parser-MA7L3XND.js → parser-RSWZGQA7.js} +6 -6
- package/dist/{parser-K2DI26SC.js → parser-SGX2PVR5.js} +2 -2
- package/dist/{parser-KKF6Y5MM.js → parser-SJUEFKNM.js} +4 -3
- package/dist/{parser-3QIFY5IN.js → parser-UMNBPXG2.js} +2 -2
- package/dist/{parser-F7NDRPMA.js → parser-WE4VSBBY.js} +3 -3
- package/dist/{parser-4Y6PODW6.js → parser-WKEYS7N3.js} +3 -3
- package/dist/{parser-KLCSFQ3J.js → parser-WPXUUNA2.js} +3 -3
- package/dist/{parser-LTRQASGB.js → parser-XP3RCOTN.js} +3 -3
- package/dist/{parser-2IKPQVKX.js → parser-YV4RBHG7.js} +3 -3
- package/dist/{parser-3LT3ZUUC.js → parser-YZ3J542U.js} +2 -2
- package/dist/{redraw-AHW7EUUF.js → redraw-BZ4GI6IC.js} +6 -4
- package/dist/{redraw-STZ4WJAI.js → redraw-LEOXS7C6.js} +3 -3
- package/dist/{renderer-IGSHD3OT.js → renderer-2V5NVI3V.js} +16 -16
- package/dist/renderer-4PKYVOYL.js +39 -0
- package/dist/{renderer-IVHD7ENY.js → renderer-66SCERH7.js} +14 -12
- package/dist/renderer-6IAXRZLK.js +85 -0
- package/dist/{renderer-XCLARXCK.js → renderer-6O5SV5YE.js} +10 -10
- package/dist/{renderer-IXBOT6DU.js → renderer-7OXMSF4R.js} +4 -4
- package/dist/{renderer-AM7P4LN7.js → renderer-A36NL2SS.js} +8 -8
- package/dist/{renderer-ACQQ2JXA.js → renderer-ASPBBACI.js} +13 -11
- package/dist/{renderer-W4MUMXJE.js → renderer-BXVTYE27.js} +7 -6
- package/dist/renderer-CC6O6GQK.js +18 -0
- package/dist/{renderer-Y47EM337.js → renderer-CNDB4JTZ.js} +17 -17
- package/dist/renderer-COV2DXTM.js +41 -0
- package/dist/renderer-DXCATVLO.js +30 -0
- package/dist/{renderer-JYHA6R2D.js → renderer-E5E3OJ42.js} +12 -11
- package/dist/{renderer-DAZWHNLI.js → renderer-E7LC7HCU.js} +5 -5
- package/dist/{renderer-RUSQJFFC.js → renderer-F3JYZERE.js} +4 -4
- package/dist/{renderer-7OGGV327.js → renderer-FAFSRFGR.js} +9 -9
- package/dist/renderer-HIB6LZWZ.js +26 -0
- package/dist/renderer-HLDRRFZB.js +28 -0
- package/dist/renderer-INQMQPNN.js +22 -0
- package/dist/renderer-ITJ67HXO.js +27 -0
- package/dist/{renderer-UTEEJDGB.js → renderer-JLOKFKOZ.js} +14 -13
- package/dist/{renderer-2LYX6NHN.js → renderer-KOPJ76GS.js} +10 -10
- package/dist/{renderer-MWZC7TMD.js → renderer-M2467III.js} +14 -13
- package/dist/{renderer-HX6ICPDX.js → renderer-MYKL6VG6.js} +6 -6
- package/dist/{renderer-BXD5KVSR.js → renderer-S6L3JR6C.js} +11 -11
- package/dist/{renderer-NOYLNVTI.js → renderer-SYWVZ4CY.js} +3 -3
- package/dist/renderer-TCTZZ5Y6.js +32 -0
- package/dist/{renderer-QTPWRRJ7.js → renderer-UIHCYXBY.js} +12 -12
- package/dist/{renderer-36446HSH.js → renderer-WIBVOPRC.js} +6 -4
- package/dist/{renderer-2QPHDBZY.js → renderer-XMJ6XZGL.js} +12 -11
- package/dist/{renderer-TINHO2IO.js → renderer-ZTHXOBXW.js} +8 -8
- package/dist/{renderer-radial-WFUX3Z3C.js → renderer-radial-FC25BDCZ.js} +8 -8
- package/dist/{state-parser-PMNHLHLE.js → state-parser-2PQRH5JE.js} +6 -6
- package/dist/state-renderer-YP6HWLJR.js +43 -0
- package/dist/{themes-DzIH3Hjv.d.ts → themes-DoLdhUXV.d.ts} +1 -1
- package/docs/ai-integration.md +4 -4
- package/docs/language-reference.md +154 -104
- package/gallery/fixtures/swot-relabel.dgmo +19 -0
- package/gallery/fixtures/swot-tags.dgmo +16 -0
- package/gallery/fixtures/swot.dgmo +13 -0
- package/gallery/fixtures/whiteboard.dgmo +1 -0
- package/package.json +1 -1
- package/dist/chunk-6BQSDF77.js +0 -734
- package/dist/chunk-NWSPPGIE.js +0 -60
- package/dist/chunk-R2K5L4UA.js +0 -49
- package/dist/chunk-VBMRZCMQ.js +0 -1465
- package/dist/chunk-WZBZXZ6T.js +0 -636
- package/dist/collapse-TCVK3RPO.js +0 -8
- package/dist/dgmo-router-6YLKM6WU.js +0 -101
- package/dist/dimensions-DS6FWLRY.js +0 -21
- package/dist/layout-D4L44NRG.js +0 -11
- package/dist/layout-MXHR3P35.js +0 -15
- package/dist/layout-ND26WVX2.js +0 -15
- package/dist/layout-VDCJOZSH.js +0 -11
- package/dist/parser-PEZ7RN43.js +0 -14
- package/dist/parser-YHDGKPZI.js +0 -14
- package/dist/renderer-4VGO27EE.js +0 -41
- package/dist/renderer-6BDK47V6.js +0 -30
- package/dist/renderer-ISQJ2ELA.js +0 -25
- package/dist/renderer-KJ3V5BYP.js +0 -26
- package/dist/renderer-O6RP52CQ.js +0 -22
- package/dist/renderer-P3WR7TKD.js +0 -39
- package/dist/renderer-UGW4N2W5.js +0 -28
- package/dist/renderer-WPN2SXGT.js +0 -29
- package/dist/renderer-XDX6S7OV.js +0 -30
- package/dist/renderer-ZV6KCLCL.js +0 -85
- package/dist/state-renderer-JQ5DS66J.js +0 -42
- package/gallery/fixtures/sketch.dgmo +0 -22
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderDataChartD3
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XCYGOCMS.js";
|
|
4
|
+
import {
|
|
5
|
+
readViewBox
|
|
6
|
+
} from "./chunk-6K2W3FH7.js";
|
|
7
|
+
import {
|
|
8
|
+
computeQuadrantPointLabels
|
|
9
|
+
} from "./chunk-YSDSFXQD.js";
|
|
4
10
|
import {
|
|
5
11
|
REGISTRY_BY_ID,
|
|
6
12
|
getRenderCategory,
|
|
@@ -12,7 +18,7 @@ import {
|
|
|
12
18
|
parseVenn,
|
|
13
19
|
parseVisualization,
|
|
14
20
|
parseWordcloud
|
|
15
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-2FMOLWX4.js";
|
|
16
22
|
import {
|
|
17
23
|
parseChart,
|
|
18
24
|
parseFunctionChart,
|
|
@@ -20,61 +26,64 @@ import {
|
|
|
20
26
|
parseHeatmap,
|
|
21
27
|
parseSankey,
|
|
22
28
|
parseScatter
|
|
23
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-WPYJAHRP.js";
|
|
30
|
+
import {
|
|
31
|
+
MAP_DX
|
|
32
|
+
} from "./chunk-EOYPX6SF.js";
|
|
33
|
+
import {
|
|
34
|
+
parseTechRadar
|
|
35
|
+
} from "./chunk-DKMZ4VMV.js";
|
|
24
36
|
import {
|
|
25
37
|
parsePyramid
|
|
26
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CGP7RGLJ.js";
|
|
27
39
|
import {
|
|
28
40
|
parseRing
|
|
29
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-QLIZ7SB7.js";
|
|
30
42
|
import {
|
|
31
43
|
parseTreemap
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import {
|
|
34
|
-
MAP_DX
|
|
35
|
-
} from "./chunk-EOYPX6SF.js";
|
|
44
|
+
} from "./chunk-NBISN6FH.js";
|
|
36
45
|
import {
|
|
37
|
-
|
|
38
|
-
} from "./chunk-
|
|
46
|
+
parseSwot
|
|
47
|
+
} from "./chunk-KNKZGRRB.js";
|
|
39
48
|
import {
|
|
40
49
|
parseVersionControl
|
|
41
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-R4SXMBGF.js";
|
|
42
51
|
import {
|
|
43
52
|
parseMap
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
parseSketch
|
|
47
|
-
} from "./chunk-WZBZXZ6T.js";
|
|
53
|
+
} from "./chunk-IUFTAFGN.js";
|
|
48
54
|
import {
|
|
49
55
|
parseWhiteboard
|
|
50
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-AULFF7L2.js";
|
|
51
57
|
import {
|
|
52
58
|
parseSwimlane
|
|
53
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-PZ5LAAO3.js";
|
|
54
60
|
import {
|
|
55
61
|
parseMindmap
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import {
|
|
58
|
-
parseTechRadar
|
|
59
|
-
} from "./chunk-EBVVMUAA.js";
|
|
62
|
+
} from "./chunk-KTGJQJB3.js";
|
|
60
63
|
import {
|
|
61
64
|
parseKanban
|
|
62
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-B7ZH5EQ2.js";
|
|
63
66
|
import {
|
|
64
67
|
parseInfra
|
|
65
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-3C4OXVZJ.js";
|
|
66
69
|
import {
|
|
67
70
|
parseJourneyMap
|
|
68
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-TMB4YY3J.js";
|
|
72
|
+
import {
|
|
73
|
+
parseGantt
|
|
74
|
+
} from "./chunk-VQWLASDC.js";
|
|
69
75
|
import {
|
|
70
76
|
parseGoal
|
|
71
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-ZMVMGZAJ.js";
|
|
78
|
+
import {
|
|
79
|
+
MIN_CANVAS_WIDTH
|
|
80
|
+
} from "./chunk-K7RRXZHS.js";
|
|
72
81
|
import {
|
|
73
82
|
parseEventLine
|
|
74
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-L3K5O3Z5.js";
|
|
75
84
|
import {
|
|
76
85
|
renderTimeline
|
|
77
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-EEIGHOJR.js";
|
|
78
87
|
import {
|
|
79
88
|
EXPORT_HEIGHT,
|
|
80
89
|
EXPORT_WIDTH,
|
|
@@ -86,93 +95,94 @@ import {
|
|
|
86
95
|
renderChartTitle,
|
|
87
96
|
resolveExportPalette,
|
|
88
97
|
showTooltip
|
|
89
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-YIHRLY55.js";
|
|
90
99
|
import {
|
|
91
100
|
parseTimelineDate
|
|
92
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-O3HRF25Z.js";
|
|
93
102
|
import {
|
|
94
103
|
parseFamily
|
|
95
|
-
} from "./chunk-
|
|
96
|
-
import {
|
|
97
|
-
parseGantt
|
|
98
|
-
} from "./chunk-PVWIBKV2.js";
|
|
104
|
+
} from "./chunk-J467QBZF.js";
|
|
99
105
|
import {
|
|
100
106
|
parseClock
|
|
101
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-6OUMYNAJ.js";
|
|
102
108
|
import {
|
|
103
109
|
parseCountdown
|
|
104
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-EBJLT7PH.js";
|
|
105
111
|
import {
|
|
106
112
|
parseCycle
|
|
107
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-PLQZJZ2K.js";
|
|
108
114
|
import {
|
|
109
115
|
parseBracket
|
|
110
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-3IUMSK72.js";
|
|
111
117
|
import {
|
|
112
118
|
layoutBracket
|
|
113
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-ZBJV4KNU.js";
|
|
114
120
|
import {
|
|
115
121
|
parseC4
|
|
116
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-5WZYJC2P.js";
|
|
117
123
|
import {
|
|
118
124
|
parseBlock
|
|
119
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-RC6PISCK.js";
|
|
120
126
|
import {
|
|
121
127
|
isBlockNode
|
|
122
128
|
} from "./chunk-XSVWUOUZ.js";
|
|
123
129
|
import {
|
|
124
130
|
parseBody
|
|
125
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-FK6HZYGK.js";
|
|
126
132
|
import {
|
|
127
133
|
parseBoxesAndLines
|
|
128
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-SNDCXT5R.js";
|
|
129
135
|
import {
|
|
130
136
|
ScaleContext
|
|
131
137
|
} from "./chunk-24YPR5EH.js";
|
|
138
|
+
import {
|
|
139
|
+
injectToggleCue,
|
|
140
|
+
stripFoldAffordance
|
|
141
|
+
} from "./chunk-LRTSTDJ6.js";
|
|
132
142
|
import {
|
|
133
143
|
legendInlineSupported
|
|
134
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-REKLKGR6.js";
|
|
135
145
|
import {
|
|
136
146
|
GRID_DASH,
|
|
137
147
|
scaleDash
|
|
138
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-WH6E6SHC.js";
|
|
139
149
|
import {
|
|
140
150
|
compactNumber
|
|
141
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-VVL2KKG4.js";
|
|
142
152
|
import {
|
|
143
153
|
parseRaci
|
|
144
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-6PUBFB6D.js";
|
|
155
|
+
import {
|
|
156
|
+
parseSitemap
|
|
157
|
+
} from "./chunk-KMB754DO.js";
|
|
158
|
+
import {
|
|
159
|
+
parsePert
|
|
160
|
+
} from "./chunk-CUTEHGXO.js";
|
|
145
161
|
import {
|
|
146
162
|
parseLiveLink
|
|
147
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-65JFUANT.js";
|
|
148
164
|
import {
|
|
149
165
|
parseSequenceDgmo
|
|
150
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-ROH4LYBL.js";
|
|
151
167
|
import {
|
|
152
168
|
parseOrg
|
|
153
|
-
} from "./chunk-
|
|
154
|
-
import {
|
|
155
|
-
parseSitemap
|
|
156
|
-
} from "./chunk-ZECJ7Q6C.js";
|
|
169
|
+
} from "./chunk-YCIBBVI2.js";
|
|
157
170
|
import {
|
|
158
|
-
|
|
159
|
-
} from "./chunk-
|
|
171
|
+
parseState
|
|
172
|
+
} from "./chunk-WXGFB2O2.js";
|
|
160
173
|
import {
|
|
161
174
|
parseFlowchart
|
|
162
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-IAM3IDL4.js";
|
|
163
176
|
import {
|
|
164
|
-
|
|
165
|
-
} from "./chunk-
|
|
177
|
+
parseERDiagram
|
|
178
|
+
} from "./chunk-PSNRB75I.js";
|
|
166
179
|
import {
|
|
167
180
|
choosePalette,
|
|
168
181
|
extractPaletteDirective
|
|
169
182
|
} from "./chunk-CYTFO2LF.js";
|
|
170
|
-
import {
|
|
171
|
-
parseERDiagram
|
|
172
|
-
} from "./chunk-S4SJ4LLY.js";
|
|
173
183
|
import {
|
|
174
184
|
parseClassDiagram
|
|
175
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-H7DZYHQF.js";
|
|
176
186
|
import {
|
|
177
187
|
getPalette
|
|
178
188
|
} from "./chunk-FMAVHTYB.js";
|
|
@@ -181,15 +191,15 @@ import {
|
|
|
181
191
|
} from "./chunk-ICLB27PZ.js";
|
|
182
192
|
import {
|
|
183
193
|
parseWireframe
|
|
184
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-VVZDBUHA.js";
|
|
185
195
|
import {
|
|
186
196
|
resolveActiveTagGroup,
|
|
187
197
|
tagAttrKey
|
|
188
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-KW3CC7SB.js";
|
|
189
199
|
import {
|
|
190
200
|
measureText,
|
|
191
201
|
wrapTextToWidth
|
|
192
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-PU5X3P3T.js";
|
|
193
203
|
import {
|
|
194
204
|
getSeriesColors,
|
|
195
205
|
mix,
|
|
@@ -200,6 +210,686 @@ import {
|
|
|
200
210
|
makeDgmoError
|
|
201
211
|
} from "./chunk-BYU54C3S.js";
|
|
202
212
|
|
|
213
|
+
// src/utils/export-fit.ts
|
|
214
|
+
var EXPORT_FIT_PAD = 24;
|
|
215
|
+
var EXPORT_FIT_MIN_TRIM = EXPORT_FIT_PAD * 2;
|
|
216
|
+
var TEXT_WIDTH_SAFETY = 1.15;
|
|
217
|
+
var MARKER_ALLOWANCE = 12;
|
|
218
|
+
var DEFAULT_FONT_SIZE = 16;
|
|
219
|
+
var NON_RENDERING = /* @__PURE__ */ new Set([
|
|
220
|
+
"defs",
|
|
221
|
+
"clippath",
|
|
222
|
+
"mask",
|
|
223
|
+
"marker",
|
|
224
|
+
"pattern",
|
|
225
|
+
"symbol",
|
|
226
|
+
"lineargradient",
|
|
227
|
+
"radialgradient",
|
|
228
|
+
"filter",
|
|
229
|
+
"style",
|
|
230
|
+
"title",
|
|
231
|
+
"desc",
|
|
232
|
+
"metadata",
|
|
233
|
+
"script"
|
|
234
|
+
]);
|
|
235
|
+
var IDENTITY = [1, 0, 0, 1, 0, 0];
|
|
236
|
+
function multiply(p, q) {
|
|
237
|
+
return [
|
|
238
|
+
p[0] * q[0] + p[2] * q[1],
|
|
239
|
+
p[1] * q[0] + p[3] * q[1],
|
|
240
|
+
p[0] * q[2] + p[2] * q[3],
|
|
241
|
+
p[1] * q[2] + p[3] * q[3],
|
|
242
|
+
p[0] * q[4] + p[2] * q[5] + p[4],
|
|
243
|
+
p[1] * q[4] + p[3] * q[5] + p[5]
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
var NUM_RE = /[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g;
|
|
247
|
+
function nums(s) {
|
|
248
|
+
return (s.match(NUM_RE) ?? []).map(Number);
|
|
249
|
+
}
|
|
250
|
+
function parseTransform(value) {
|
|
251
|
+
let m = IDENTITY;
|
|
252
|
+
const re = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)\s*,?/gy;
|
|
253
|
+
let consumed = 0;
|
|
254
|
+
for (const t of value.matchAll(re)) {
|
|
255
|
+
consumed = (t.index ?? 0) + t[0].length;
|
|
256
|
+
const a = nums(t[2]);
|
|
257
|
+
let local;
|
|
258
|
+
switch (t[1]) {
|
|
259
|
+
case "matrix":
|
|
260
|
+
if (a.length !== 6) return null;
|
|
261
|
+
local = a;
|
|
262
|
+
break;
|
|
263
|
+
case "translate":
|
|
264
|
+
if (a.length < 1 || a.length > 2) return null;
|
|
265
|
+
local = [1, 0, 0, 1, a[0], a[1] ?? 0];
|
|
266
|
+
break;
|
|
267
|
+
case "scale":
|
|
268
|
+
if (a.length < 1 || a.length > 2) return null;
|
|
269
|
+
local = [a[0], 0, 0, a[1] ?? a[0], 0, 0];
|
|
270
|
+
break;
|
|
271
|
+
case "rotate": {
|
|
272
|
+
if (a.length !== 1 && a.length !== 3) return null;
|
|
273
|
+
const r = a[0] * Math.PI / 180;
|
|
274
|
+
const c = Math.cos(r);
|
|
275
|
+
const s = Math.sin(r);
|
|
276
|
+
const rot = [c, s, -s, c, 0, 0];
|
|
277
|
+
if (a.length === 3) {
|
|
278
|
+
const [, cx, cy] = a;
|
|
279
|
+
local = multiply(multiply([1, 0, 0, 1, cx, cy], rot), [
|
|
280
|
+
1,
|
|
281
|
+
0,
|
|
282
|
+
0,
|
|
283
|
+
1,
|
|
284
|
+
-cx,
|
|
285
|
+
-cy
|
|
286
|
+
]);
|
|
287
|
+
} else local = rot;
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
case "skewX":
|
|
291
|
+
if (a.length !== 1) return null;
|
|
292
|
+
local = [1, 0, Math.tan(a[0] * Math.PI / 180), 1, 0, 0];
|
|
293
|
+
break;
|
|
294
|
+
default:
|
|
295
|
+
if (a.length !== 1) return null;
|
|
296
|
+
local = [1, Math.tan(a[0] * Math.PI / 180), 0, 1, 0, 0];
|
|
297
|
+
}
|
|
298
|
+
m = multiply(m, local);
|
|
299
|
+
}
|
|
300
|
+
return value.slice(consumed).trim() === "" ? m : null;
|
|
301
|
+
}
|
|
302
|
+
function pathBox(d) {
|
|
303
|
+
let i = 0;
|
|
304
|
+
const n = d.length;
|
|
305
|
+
const box = {
|
|
306
|
+
x0: Infinity,
|
|
307
|
+
y0: Infinity,
|
|
308
|
+
x1: -Infinity,
|
|
309
|
+
y1: -Infinity
|
|
310
|
+
};
|
|
311
|
+
const add = (x, y) => {
|
|
312
|
+
if (x < box.x0) box.x0 = x;
|
|
313
|
+
if (x > box.x1) box.x1 = x;
|
|
314
|
+
if (y < box.y0) box.y0 = y;
|
|
315
|
+
if (y > box.y1) box.y1 = y;
|
|
316
|
+
};
|
|
317
|
+
const skipSep = () => {
|
|
318
|
+
while (i < n && /[\s,]/.test(d[i])) i++;
|
|
319
|
+
};
|
|
320
|
+
const numAt = () => {
|
|
321
|
+
skipSep();
|
|
322
|
+
const m = /[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/y;
|
|
323
|
+
m.lastIndex = i;
|
|
324
|
+
const r = m.exec(d);
|
|
325
|
+
if (!r) return null;
|
|
326
|
+
i += r[0].length;
|
|
327
|
+
return Number(r[0]);
|
|
328
|
+
};
|
|
329
|
+
const flagAt = () => {
|
|
330
|
+
skipSep();
|
|
331
|
+
const c = d[i];
|
|
332
|
+
if (c !== "0" && c !== "1") return null;
|
|
333
|
+
i++;
|
|
334
|
+
return c === "1" ? 1 : 0;
|
|
335
|
+
};
|
|
336
|
+
const moreNumbers = () => {
|
|
337
|
+
skipSep();
|
|
338
|
+
return i < n && /[-+.\d]/.test(d[i]);
|
|
339
|
+
};
|
|
340
|
+
let cx = 0;
|
|
341
|
+
let cy = 0;
|
|
342
|
+
let sx = 0;
|
|
343
|
+
let sy = 0;
|
|
344
|
+
let cmd = "";
|
|
345
|
+
while (true) {
|
|
346
|
+
skipSep();
|
|
347
|
+
if (i >= n) break;
|
|
348
|
+
const c = d[i];
|
|
349
|
+
if (/[MmLlHhVvCcSsQqTtAaZz]/.test(c)) {
|
|
350
|
+
cmd = c;
|
|
351
|
+
i++;
|
|
352
|
+
} else if (!cmd || cmd === "Z" || cmd === "z" || !/[-+.\d]/.test(c)) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
const rel = cmd === cmd.toLowerCase();
|
|
356
|
+
const up = cmd.toUpperCase();
|
|
357
|
+
if (up === "Z") {
|
|
358
|
+
cx = sx;
|
|
359
|
+
cy = sy;
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
const arity = {
|
|
363
|
+
M: 2,
|
|
364
|
+
L: 2,
|
|
365
|
+
T: 2,
|
|
366
|
+
H: 1,
|
|
367
|
+
V: 1,
|
|
368
|
+
C: 6,
|
|
369
|
+
S: 4,
|
|
370
|
+
Q: 4,
|
|
371
|
+
A: 7
|
|
372
|
+
};
|
|
373
|
+
do {
|
|
374
|
+
const k = arity[up];
|
|
375
|
+
const a = [];
|
|
376
|
+
for (let j = 0; j < k; j++) {
|
|
377
|
+
const v = up === "A" && (j === 3 || j === 4) ? flagAt() : numAt();
|
|
378
|
+
if (v === null) return null;
|
|
379
|
+
a.push(v);
|
|
380
|
+
}
|
|
381
|
+
const ox = rel ? cx : 0;
|
|
382
|
+
const oy = rel ? cy : 0;
|
|
383
|
+
if (up === "H") {
|
|
384
|
+
cx = a[0] + ox;
|
|
385
|
+
} else if (up === "V") {
|
|
386
|
+
cy = a[0] + oy;
|
|
387
|
+
} else if (up === "A") {
|
|
388
|
+
const x2 = a[5] + ox;
|
|
389
|
+
const y2 = a[6] + oy;
|
|
390
|
+
arcExtent(cx, cy, a[0], a[1], a[2], a[3], a[4], x2, y2, add);
|
|
391
|
+
cx = x2;
|
|
392
|
+
cy = y2;
|
|
393
|
+
} else {
|
|
394
|
+
for (let j = 0; j + 1 < k; j += 2) add(a[j] + ox, a[j + 1] + oy);
|
|
395
|
+
cx = a[k - 2] + ox;
|
|
396
|
+
cy = a[k - 1] + oy;
|
|
397
|
+
}
|
|
398
|
+
add(cx, cy);
|
|
399
|
+
if (up === "M") {
|
|
400
|
+
sx = cx;
|
|
401
|
+
sy = cy;
|
|
402
|
+
}
|
|
403
|
+
} while (moreNumbers());
|
|
404
|
+
if (cmd === "M") cmd = "L";
|
|
405
|
+
else if (cmd === "m") cmd = "l";
|
|
406
|
+
}
|
|
407
|
+
return box.x0 <= box.x1 ? box : null;
|
|
408
|
+
}
|
|
409
|
+
function arcExtent(x1, y1, rxIn, ryIn, rotDeg, large, sweep, x2, y2, add) {
|
|
410
|
+
let rx = Math.abs(rxIn);
|
|
411
|
+
let ry = Math.abs(ryIn);
|
|
412
|
+
if (rx === 0 || ry === 0 || x1 === x2 && y1 === y2) return;
|
|
413
|
+
const phi = rotDeg * Math.PI / 180;
|
|
414
|
+
const cos = Math.cos(phi);
|
|
415
|
+
const sin = Math.sin(phi);
|
|
416
|
+
const dx = (x1 - x2) / 2;
|
|
417
|
+
const dy = (y1 - y2) / 2;
|
|
418
|
+
const xp = cos * dx + sin * dy;
|
|
419
|
+
const yp = -sin * dx + cos * dy;
|
|
420
|
+
const lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);
|
|
421
|
+
if (lambda > 1) {
|
|
422
|
+
rx *= Math.sqrt(lambda);
|
|
423
|
+
ry *= Math.sqrt(lambda);
|
|
424
|
+
}
|
|
425
|
+
const num = rx * rx * ry * ry - rx * rx * yp * yp - ry * ry * xp * xp;
|
|
426
|
+
const den = rx * rx * yp * yp + ry * ry * xp * xp;
|
|
427
|
+
const factor = (large === sweep ? -1 : 1) * Math.sqrt(Math.max(0, num / den || 0));
|
|
428
|
+
const cxp = factor * rx * yp / ry;
|
|
429
|
+
const cyp = -factor * ry * xp / rx;
|
|
430
|
+
const ccx = cos * cxp - sin * cyp + (x1 + x2) / 2;
|
|
431
|
+
const ccy = sin * cxp + cos * cyp + (y1 + y2) / 2;
|
|
432
|
+
const r = Math.max(rx, ry);
|
|
433
|
+
add(ccx - r, ccy - r);
|
|
434
|
+
add(ccx + r, ccy + r);
|
|
435
|
+
}
|
|
436
|
+
function attrOf(attrs, name) {
|
|
437
|
+
const m = new RegExp(`(?:^|\\s)${name}\\s*=\\s*("([^"]*)"|'([^']*)')`).exec(
|
|
438
|
+
attrs
|
|
439
|
+
);
|
|
440
|
+
return m ? m[2] ?? m[3] ?? "" : null;
|
|
441
|
+
}
|
|
442
|
+
function styleOf(attrs, prop2) {
|
|
443
|
+
const style = attrOf(attrs, "style");
|
|
444
|
+
if (!style) return null;
|
|
445
|
+
const m = new RegExp(`(?:^|;)\\s*${prop2}\\s*:\\s*([^;]+)`, "i").exec(style);
|
|
446
|
+
return m ? m[1].trim() : null;
|
|
447
|
+
}
|
|
448
|
+
function prop(attrs, name) {
|
|
449
|
+
return styleOf(attrs, name) ?? attrOf(attrs, name);
|
|
450
|
+
}
|
|
451
|
+
function lengthOf(v, basis, fontSize) {
|
|
452
|
+
if (v === null) return null;
|
|
453
|
+
const m = /^\s*([-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?)\s*(px|em|%|pt)?/.exec(v);
|
|
454
|
+
if (!m) return null;
|
|
455
|
+
const n = Number(m[1]);
|
|
456
|
+
switch (m[2]) {
|
|
457
|
+
case "em":
|
|
458
|
+
return n * fontSize;
|
|
459
|
+
case "%":
|
|
460
|
+
return n / 100 * basis;
|
|
461
|
+
case "pt":
|
|
462
|
+
return n * 4 / 3;
|
|
463
|
+
default:
|
|
464
|
+
return n;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function firstLength(v, basis, fontSize) {
|
|
468
|
+
if (v === null) return null;
|
|
469
|
+
return lengthOf(v.trim().split(/[\s,]+/)[0] ?? "", basis, fontSize);
|
|
470
|
+
}
|
|
471
|
+
function verticalEm(baseline) {
|
|
472
|
+
switch (baseline) {
|
|
473
|
+
case "middle":
|
|
474
|
+
case "central":
|
|
475
|
+
case "mathematical":
|
|
476
|
+
return [0.65, 0.65];
|
|
477
|
+
case "hanging":
|
|
478
|
+
case "text-before-edge":
|
|
479
|
+
case "before-edge":
|
|
480
|
+
return [0.1, 1.25];
|
|
481
|
+
case "text-after-edge":
|
|
482
|
+
case "after-edge":
|
|
483
|
+
case "ideographic":
|
|
484
|
+
return [1.3, 0.1];
|
|
485
|
+
case "auto":
|
|
486
|
+
case "alphabetic":
|
|
487
|
+
case "baseline":
|
|
488
|
+
case "":
|
|
489
|
+
return [1, 0.3];
|
|
490
|
+
default:
|
|
491
|
+
return [1.3, 1.25];
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
var SHAPES = /* @__PURE__ */ new Set([
|
|
495
|
+
"rect",
|
|
496
|
+
"circle",
|
|
497
|
+
"ellipse",
|
|
498
|
+
"line",
|
|
499
|
+
"polygon",
|
|
500
|
+
"polyline",
|
|
501
|
+
"path"
|
|
502
|
+
]);
|
|
503
|
+
var NO_PAINT = /^(?:none|transparent)$/i;
|
|
504
|
+
function zero(v) {
|
|
505
|
+
return v !== null && Number(v) === 0;
|
|
506
|
+
}
|
|
507
|
+
function paintsNothing(attrs, frame) {
|
|
508
|
+
if (zero(prop(attrs, "opacity"))) return true;
|
|
509
|
+
const fill = prop(attrs, "fill");
|
|
510
|
+
const noFill = frame.tag === "line" || fill !== null && NO_PAINT.test(fill.trim()) || zero(prop(attrs, "fill-opacity"));
|
|
511
|
+
const noStroke = frame.stroke === null || NO_PAINT.test(frame.stroke.trim()) || zero(prop(attrs, "stroke-opacity")) || frame.strokeW === 0;
|
|
512
|
+
return noFill && noStroke;
|
|
513
|
+
}
|
|
514
|
+
function cssCanSetPaint(svg) {
|
|
515
|
+
for (const m of svg.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/g)) {
|
|
516
|
+
let css = m[1];
|
|
517
|
+
for (; ; ) {
|
|
518
|
+
const at = css.search(/@media\s*\(\s*hover\s*:\s*hover\s*\)\s*\{/);
|
|
519
|
+
if (at < 0) break;
|
|
520
|
+
let i = css.indexOf("{", at) + 1;
|
|
521
|
+
for (let depth = 1; i < css.length && depth > 0; i++) {
|
|
522
|
+
if (css[i] === "{") depth++;
|
|
523
|
+
else if (css[i] === "}") depth--;
|
|
524
|
+
}
|
|
525
|
+
css = css.slice(0, at) + css.slice(i);
|
|
526
|
+
}
|
|
527
|
+
for (const r of css.matchAll(/([^{}]*)\{([^{}]*)\}/g)) {
|
|
528
|
+
if (r[1].includes(":hover")) continue;
|
|
529
|
+
if (/(?:^|[;\s])(?:fill|stroke|opacity|fill-opacity|stroke-opacity)\s*:/.test(
|
|
530
|
+
r[2]
|
|
531
|
+
))
|
|
532
|
+
return true;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
return false;
|
|
536
|
+
}
|
|
537
|
+
function decodeText(raw) {
|
|
538
|
+
return raw.replace(/&(?:#\d+|#x[0-9a-f]+|[a-z]+);/gi, "M").replace(/\s+/g, " ");
|
|
539
|
+
}
|
|
540
|
+
function measureSvgContent(svg) {
|
|
541
|
+
const canvas = readViewBox(svg);
|
|
542
|
+
const cw = canvas?.width ?? 0;
|
|
543
|
+
const ch = canvas?.height ?? 0;
|
|
544
|
+
const out = { x0: Infinity, y0: Infinity, x1: -Infinity, y1: -Infinity };
|
|
545
|
+
let complete = true;
|
|
546
|
+
const addBox = (m, b, inflate) => {
|
|
547
|
+
const xs = [b.x0 - inflate, b.x1 + inflate];
|
|
548
|
+
const ys = [b.y0 - inflate, b.y1 + inflate];
|
|
549
|
+
for (const x of xs)
|
|
550
|
+
for (const y of ys) {
|
|
551
|
+
const tx = m[0] * x + m[2] * y + m[4];
|
|
552
|
+
const ty = m[1] * x + m[3] * y + m[5];
|
|
553
|
+
if (!Number.isFinite(tx) || !Number.isFinite(ty)) {
|
|
554
|
+
complete = false;
|
|
555
|
+
continue;
|
|
556
|
+
}
|
|
557
|
+
if (tx < out.x0) out.x0 = tx;
|
|
558
|
+
if (tx > out.x1) out.x1 = tx;
|
|
559
|
+
if (ty < out.y0) out.y0 = ty;
|
|
560
|
+
if (ty > out.y1) out.y1 = ty;
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
const pathsById = /* @__PURE__ */ new Map();
|
|
564
|
+
for (const m of svg.matchAll(/<path\b([^>]*)>/g)) {
|
|
565
|
+
const id = attrOf(m[1], "id");
|
|
566
|
+
const d = attrOf(m[1], "d");
|
|
567
|
+
if (id && d) pathsById.set(id, d);
|
|
568
|
+
}
|
|
569
|
+
const trustNoPaint = !cssCanSetPaint(svg);
|
|
570
|
+
const stack = [];
|
|
571
|
+
let text = null;
|
|
572
|
+
const flushChunk = () => {
|
|
573
|
+
if (!text || text.pieces.length === 0) return;
|
|
574
|
+
const right = Math.max(...text.pieces.map((p) => p.x1));
|
|
575
|
+
const w = right - text.chunkX;
|
|
576
|
+
const shift = text.chunkAnchor === "middle" ? -w / 2 : text.chunkAnchor === "end" ? -w : 0;
|
|
577
|
+
for (const p of text.pieces) {
|
|
578
|
+
const [up, down] = verticalEm(p.baseline);
|
|
579
|
+
addBox(
|
|
580
|
+
text.m,
|
|
581
|
+
{
|
|
582
|
+
x0: p.x0 + shift,
|
|
583
|
+
x1: p.x1 + shift,
|
|
584
|
+
y0: p.y - up * p.fontSize,
|
|
585
|
+
y1: p.y + down * p.fontSize
|
|
586
|
+
},
|
|
587
|
+
0
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
text.pieces = [];
|
|
591
|
+
};
|
|
592
|
+
const tagRe = /<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<[?!][^>]*>|<(\/?)([A-Za-z][\w:.-]*)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>|([^<]+)/g;
|
|
593
|
+
for (const t of svg.matchAll(tagRe)) {
|
|
594
|
+
const [, close, rawName, attrs = "", selfClose, chars] = t;
|
|
595
|
+
const parent = stack[stack.length - 1];
|
|
596
|
+
if (chars !== void 0) {
|
|
597
|
+
if (!text || !parent || parent.skip) continue;
|
|
598
|
+
const s = decodeText(chars);
|
|
599
|
+
if (s.trim() === "") continue;
|
|
600
|
+
const fs = parent.fontSize;
|
|
601
|
+
let w = measureText(s, fs, { bold: parent.bold }) * TEXT_WIDTH_SAFETY;
|
|
602
|
+
if (parent.mono) w = Math.max(w, s.length * fs * 0.62);
|
|
603
|
+
text.pieces.push({
|
|
604
|
+
x0: text.curX,
|
|
605
|
+
x1: text.curX + w,
|
|
606
|
+
y: text.curY,
|
|
607
|
+
fontSize: fs,
|
|
608
|
+
baseline: parent.baseline
|
|
609
|
+
});
|
|
610
|
+
text.curX += w;
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
if (rawName === void 0) continue;
|
|
614
|
+
const name = rawName.toLowerCase();
|
|
615
|
+
if (close) {
|
|
616
|
+
for (let k = stack.length - 1; k >= 0; k--) {
|
|
617
|
+
if (stack[k].tag === name) {
|
|
618
|
+
stack.length = k;
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (name === "text" && text) {
|
|
623
|
+
flushChunk();
|
|
624
|
+
text = null;
|
|
625
|
+
}
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
const isRoot = stack.length === 0;
|
|
629
|
+
const base = parent ?? {
|
|
630
|
+
tag: "",
|
|
631
|
+
m: IDENTITY,
|
|
632
|
+
fontSize: DEFAULT_FONT_SIZE,
|
|
633
|
+
anchor: "start",
|
|
634
|
+
baseline: "",
|
|
635
|
+
bold: false,
|
|
636
|
+
mono: false,
|
|
637
|
+
strokeW: 1,
|
|
638
|
+
stroke: null,
|
|
639
|
+
skip: false
|
|
640
|
+
};
|
|
641
|
+
const skip = base.skip || NON_RENDERING.has(name);
|
|
642
|
+
let m = base.m;
|
|
643
|
+
if (!skip) {
|
|
644
|
+
if (/(?:^|[;\s"])transform\s*:/i.test(attrOf(attrs, "style") ?? "")) {
|
|
645
|
+
complete = false;
|
|
646
|
+
}
|
|
647
|
+
const tr = attrOf(attrs, "transform");
|
|
648
|
+
if (tr !== null && !isRoot) {
|
|
649
|
+
const local = parseTransform(tr);
|
|
650
|
+
if (local === null) complete = false;
|
|
651
|
+
else m = multiply(m, local);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
const fsRaw = prop(attrs, "font-size");
|
|
655
|
+
let fontSize = base.fontSize;
|
|
656
|
+
if (fsRaw !== null) {
|
|
657
|
+
const v = lengthOf(fsRaw, base.fontSize, base.fontSize);
|
|
658
|
+
fontSize = v !== null && v > 0 ? v : base.fontSize * 2;
|
|
659
|
+
}
|
|
660
|
+
const weight = prop(attrs, "font-weight");
|
|
661
|
+
const family = prop(attrs, "font-family");
|
|
662
|
+
const sw = lengthOf(prop(attrs, "stroke-width"), 1, fontSize);
|
|
663
|
+
const frame = {
|
|
664
|
+
tag: name,
|
|
665
|
+
m,
|
|
666
|
+
fontSize,
|
|
667
|
+
anchor: prop(attrs, "text-anchor") ?? base.anchor,
|
|
668
|
+
baseline: prop(attrs, "dominant-baseline") ?? prop(attrs, "alignment-baseline") ?? base.baseline,
|
|
669
|
+
bold: weight !== null ? /bold|bolder|[6-9]00/.test(weight) : base.bold,
|
|
670
|
+
mono: family !== null ? /mono|courier/i.test(family) : base.mono,
|
|
671
|
+
strokeW: sw !== null && sw >= 0 ? sw : base.strokeW,
|
|
672
|
+
stroke: prop(attrs, "stroke") ?? base.stroke,
|
|
673
|
+
skip
|
|
674
|
+
};
|
|
675
|
+
if (trustNoPaint && !skip && !isRoot && SHAPES.has(name) && paintsNothing(attrs, frame)) {
|
|
676
|
+
} else if (!skip && !isRoot) {
|
|
677
|
+
const num = (k, basis) => lengthOf(attrOf(attrs, k), basis, fontSize);
|
|
678
|
+
const inflate = frame.strokeW / 2 + (/marker-(?:start|mid|end)/.test(attrs) ? MARKER_ALLOWANCE : 0);
|
|
679
|
+
switch (name) {
|
|
680
|
+
case "rect":
|
|
681
|
+
case "image":
|
|
682
|
+
case "foreignobject":
|
|
683
|
+
case "svg": {
|
|
684
|
+
const cls = attrOf(attrs, "class") ?? "";
|
|
685
|
+
if (name === "rect" && /\bdgmo-canvas-bg\b/.test(cls)) break;
|
|
686
|
+
const x = num("x", cw) ?? 0;
|
|
687
|
+
const y = num("y", ch) ?? 0;
|
|
688
|
+
const w = num("width", cw);
|
|
689
|
+
const h = num("height", ch);
|
|
690
|
+
if (w === null || h === null) {
|
|
691
|
+
if (name !== "rect") complete = false;
|
|
692
|
+
break;
|
|
693
|
+
}
|
|
694
|
+
addBox(m, { x0: x, y0: y, x1: x + w, y1: y + h }, inflate);
|
|
695
|
+
if (name === "svg") frame.skip = true;
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
case "circle":
|
|
699
|
+
case "ellipse": {
|
|
700
|
+
const cx = num("cx", cw) ?? 0;
|
|
701
|
+
const cy = num("cy", ch) ?? 0;
|
|
702
|
+
const rx = name === "circle" ? num("r", cw) : num("rx", cw);
|
|
703
|
+
const ry = name === "circle" ? rx : num("ry", ch);
|
|
704
|
+
if (rx === null || ry === null) break;
|
|
705
|
+
addBox(
|
|
706
|
+
m,
|
|
707
|
+
{ x0: cx - rx, y0: cy - ry, x1: cx + rx, y1: cy + ry },
|
|
708
|
+
inflate
|
|
709
|
+
);
|
|
710
|
+
break;
|
|
711
|
+
}
|
|
712
|
+
case "line": {
|
|
713
|
+
const x1 = num("x1", cw) ?? 0;
|
|
714
|
+
const y1 = num("y1", ch) ?? 0;
|
|
715
|
+
const x2 = num("x2", cw) ?? 0;
|
|
716
|
+
const y2 = num("y2", ch) ?? 0;
|
|
717
|
+
addBox(
|
|
718
|
+
m,
|
|
719
|
+
{
|
|
720
|
+
x0: Math.min(x1, x2),
|
|
721
|
+
y0: Math.min(y1, y2),
|
|
722
|
+
x1: Math.max(x1, x2),
|
|
723
|
+
y1: Math.max(y1, y2)
|
|
724
|
+
},
|
|
725
|
+
inflate
|
|
726
|
+
);
|
|
727
|
+
break;
|
|
728
|
+
}
|
|
729
|
+
case "polygon":
|
|
730
|
+
case "polyline": {
|
|
731
|
+
const p = nums(attrOf(attrs, "points") ?? "");
|
|
732
|
+
if (p.length < 2) break;
|
|
733
|
+
const b = {
|
|
734
|
+
x0: Infinity,
|
|
735
|
+
y0: Infinity,
|
|
736
|
+
x1: -Infinity,
|
|
737
|
+
y1: -Infinity
|
|
738
|
+
};
|
|
739
|
+
for (let k = 0; k + 1 < p.length; k += 2) {
|
|
740
|
+
b.x0 = Math.min(b.x0, p[k]);
|
|
741
|
+
b.x1 = Math.max(b.x1, p[k]);
|
|
742
|
+
b.y0 = Math.min(b.y0, p[k + 1]);
|
|
743
|
+
b.y1 = Math.max(b.y1, p[k + 1]);
|
|
744
|
+
}
|
|
745
|
+
addBox(m, b, inflate);
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
748
|
+
case "path": {
|
|
749
|
+
const d = attrOf(attrs, "d");
|
|
750
|
+
if (!d || d.trim() === "" || d.trim().toLowerCase() === "none") break;
|
|
751
|
+
const b = pathBox(d);
|
|
752
|
+
if (b === null) complete = false;
|
|
753
|
+
else addBox(m, b, inflate);
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
case "use":
|
|
757
|
+
complete = false;
|
|
758
|
+
break;
|
|
759
|
+
case "text": {
|
|
760
|
+
flushChunk();
|
|
761
|
+
const x = firstLength(attrOf(attrs, "x"), cw, fontSize) ?? 0;
|
|
762
|
+
const y = firstLength(attrOf(attrs, "y"), ch, fontSize) ?? 0;
|
|
763
|
+
const dx = firstLength(attrOf(attrs, "dx"), cw, fontSize) ?? 0;
|
|
764
|
+
const dy = firstLength(attrOf(attrs, "dy"), ch, fontSize) ?? 0;
|
|
765
|
+
text = {
|
|
766
|
+
m,
|
|
767
|
+
curX: x + dx,
|
|
768
|
+
curY: y + dy,
|
|
769
|
+
chunkX: x + dx,
|
|
770
|
+
chunkAnchor: frame.anchor,
|
|
771
|
+
pieces: []
|
|
772
|
+
};
|
|
773
|
+
break;
|
|
774
|
+
}
|
|
775
|
+
case "tspan": {
|
|
776
|
+
if (!text) break;
|
|
777
|
+
const x = firstLength(attrOf(attrs, "x"), cw, fontSize);
|
|
778
|
+
const y = firstLength(attrOf(attrs, "y"), ch, fontSize);
|
|
779
|
+
const dx = firstLength(attrOf(attrs, "dx"), cw, fontSize) ?? 0;
|
|
780
|
+
const dy = firstLength(attrOf(attrs, "dy"), ch, fontSize) ?? 0;
|
|
781
|
+
if (x !== null || y !== null) {
|
|
782
|
+
flushChunk();
|
|
783
|
+
if (x !== null) text.curX = x;
|
|
784
|
+
if (y !== null) text.curY = y;
|
|
785
|
+
text.curX += dx;
|
|
786
|
+
text.curY += dy;
|
|
787
|
+
text.chunkX = text.curX;
|
|
788
|
+
text.chunkAnchor = frame.anchor;
|
|
789
|
+
} else {
|
|
790
|
+
text.curX += dx;
|
|
791
|
+
text.curY += dy;
|
|
792
|
+
}
|
|
793
|
+
break;
|
|
794
|
+
}
|
|
795
|
+
case "textpath": {
|
|
796
|
+
if (!text) break;
|
|
797
|
+
const href = (attrOf(attrs, "href") ?? attrOf(attrs, "xlink:href") ?? "").replace(/^#/, "");
|
|
798
|
+
const d = pathsById.get(href);
|
|
799
|
+
const b = d ? pathBox(d) : null;
|
|
800
|
+
if (b === null) complete = false;
|
|
801
|
+
else addBox(text.m, b, fontSize * 1.3);
|
|
802
|
+
frame.skip = true;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
default:
|
|
806
|
+
break;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
if (!selfClose) stack.push(frame);
|
|
810
|
+
else if (name === "text") {
|
|
811
|
+
flushChunk();
|
|
812
|
+
text = null;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
const box = out.x0 <= out.x1 && out.y0 <= out.y1 ? out : null;
|
|
816
|
+
return { box, complete };
|
|
817
|
+
}
|
|
818
|
+
function fmt(n) {
|
|
819
|
+
return String(Math.round(n * 1e3) / 1e3);
|
|
820
|
+
}
|
|
821
|
+
function setRootAttr(root, name, value) {
|
|
822
|
+
const re = new RegExp(`(\\s${name}=)"[^"]*"`);
|
|
823
|
+
return re.test(root) ? root.replace(re, `$1"${value}"`) : root.replace(/^<svg\b/, `<svg ${name}="${value}"`);
|
|
824
|
+
}
|
|
825
|
+
function fitSvgToContent(svg, opts = {}) {
|
|
826
|
+
const rootMatch = /<svg\b(?:[^>"']|"[^"]*"|'[^']*')*>/.exec(svg);
|
|
827
|
+
if (!rootMatch) return svg;
|
|
828
|
+
const root = rootMatch[0];
|
|
829
|
+
if (/\sdata-export-(?:width|height)=/.test(root)) return svg;
|
|
830
|
+
const canvas = readViewBox(svg);
|
|
831
|
+
if (!canvas) return svg;
|
|
832
|
+
const { box, complete } = measureSvgContent(svg);
|
|
833
|
+
if (!complete || !box) return svg;
|
|
834
|
+
const cx0 = canvas.x;
|
|
835
|
+
const cy0 = canvas.y;
|
|
836
|
+
const cx1 = canvas.x + canvas.width;
|
|
837
|
+
const cy1 = canvas.y + canvas.height;
|
|
838
|
+
let x0 = Math.max(cx0, Math.floor(box.x0 - EXPORT_FIT_PAD));
|
|
839
|
+
let x1 = Math.min(cx1, Math.ceil(box.x1 + EXPORT_FIT_PAD));
|
|
840
|
+
let y0 = Math.max(cy0, Math.floor(box.y0 - EXPORT_FIT_PAD));
|
|
841
|
+
let y1 = Math.min(cy1, Math.ceil(box.y1 + EXPORT_FIT_PAD));
|
|
842
|
+
if (x1 <= x0 || y1 <= y0) return svg;
|
|
843
|
+
const minW = Math.min(canvas.width, MIN_CANVAS_WIDTH);
|
|
844
|
+
if (x1 - x0 < minW) {
|
|
845
|
+
const grow = minW - (x1 - x0);
|
|
846
|
+
x0 = Math.max(cx0, x0 - Math.floor(grow / 2));
|
|
847
|
+
x1 = x0 + minW;
|
|
848
|
+
if (x1 > cx1) {
|
|
849
|
+
x1 = cx1;
|
|
850
|
+
x0 = cx1 - minW;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
const trimX = canvas.width - (x1 - x0) >= EXPORT_FIT_MIN_TRIM;
|
|
854
|
+
const trimY = canvas.height - (y1 - y0) >= EXPORT_FIT_MIN_TRIM;
|
|
855
|
+
if (!trimX && !trimY) return svg;
|
|
856
|
+
if (!trimX) {
|
|
857
|
+
x0 = cx0;
|
|
858
|
+
x1 = cx1;
|
|
859
|
+
}
|
|
860
|
+
if (!trimY) {
|
|
861
|
+
y0 = cy0;
|
|
862
|
+
y1 = cy1;
|
|
863
|
+
}
|
|
864
|
+
const w = x1 - x0;
|
|
865
|
+
const h = y1 - y0;
|
|
866
|
+
const rootW = Number(attrOf(root.slice(4), "width"));
|
|
867
|
+
const rootH = Number(attrOf(root.slice(4), "height"));
|
|
868
|
+
const sx = rootW > 0 ? rootW / canvas.width : 1;
|
|
869
|
+
const sy = rootH > 0 ? rootH / canvas.height : 1;
|
|
870
|
+
let outW = w * sx;
|
|
871
|
+
let outH = h * sy;
|
|
872
|
+
const scales = [];
|
|
873
|
+
if (opts.width && opts.width > 0 && Math.abs(rootW - opts.width) <= 1)
|
|
874
|
+
scales.push(opts.width / w);
|
|
875
|
+
if (opts.height && opts.height > 0 && Math.abs(rootH - opts.height) <= 1)
|
|
876
|
+
scales.push(opts.height / h);
|
|
877
|
+
if (scales.length > 0) {
|
|
878
|
+
const s = Math.min(...scales);
|
|
879
|
+
outW = w * s;
|
|
880
|
+
outH = h * s;
|
|
881
|
+
}
|
|
882
|
+
let newRoot = setRootAttr(root, "viewBox", `${x0} ${y0} ${w} ${h}`);
|
|
883
|
+
if (rootW > 0) newRoot = setRootAttr(newRoot, "width", fmt(outW));
|
|
884
|
+
if (rootH > 0) newRoot = setRootAttr(newRoot, "height", fmt(outH));
|
|
885
|
+
if (trimY) newRoot = newRoot.replace(/\sdata-content-height="[^"]*"/, "");
|
|
886
|
+
const body = svg.slice(rootMatch.index + root.length).replace(
|
|
887
|
+
/<rect\b[^>]*\bclass="[^"]*\bdgmo-canvas-bg\b[^"]*"[^>]*>/g,
|
|
888
|
+
(r) => r.replace(/(\sx=)"[^"]*"/, `$1"${x0}"`).replace(/(\sy=)"[^"]*"/, `$1"${y0}"`).replace(/(\swidth=)"[^"]*"/, `$1"${w}"`).replace(/(\sheight=)"[^"]*"/, `$1"${h}"`)
|
|
889
|
+
);
|
|
890
|
+
return svg.slice(0, rootMatch.index) + newRoot + body;
|
|
891
|
+
}
|
|
892
|
+
|
|
203
893
|
// src/arc/renderer.ts
|
|
204
894
|
import * as d3Scale from "d3-scale";
|
|
205
895
|
import * as d3Selection from "d3-selection";
|
|
@@ -345,8 +1035,18 @@ function renderArcDiagram(container, parsed, palette, isDark, onClickItem, expor
|
|
|
345
1035
|
if (ctx.isBelowFloor) {
|
|
346
1036
|
svg.attr("width", "100%");
|
|
347
1037
|
}
|
|
1038
|
+
const g = svg.append("g");
|
|
1039
|
+
const titleExtra = renderChartTitle(
|
|
1040
|
+
svg,
|
|
1041
|
+
title,
|
|
1042
|
+
parsed.titleLineNumber,
|
|
1043
|
+
width,
|
|
1044
|
+
textColor,
|
|
1045
|
+
onClickItem,
|
|
1046
|
+
2
|
|
1047
|
+
);
|
|
348
1048
|
const margin = {
|
|
349
|
-
top: sMarginTop,
|
|
1049
|
+
top: sMarginTop + titleExtra,
|
|
350
1050
|
right: sMarginRight,
|
|
351
1051
|
bottom: sMarginBottom,
|
|
352
1052
|
left: sMarginLeft
|
|
@@ -370,15 +1070,7 @@ function renderArcDiagram(container, parsed, palette, isDark, onClickItem, expor
|
|
|
370
1070
|
const values = links.map((l) => l.value);
|
|
371
1071
|
const [minVal, maxVal] = d3Array.extent(values);
|
|
372
1072
|
const strokeScale = d3Scale.scaleLinear().domain([minVal, maxVal]).range([sStrokeMin, sStrokeMax]);
|
|
373
|
-
|
|
374
|
-
renderChartTitle(
|
|
375
|
-
svg,
|
|
376
|
-
title,
|
|
377
|
-
parsed.titleLineNumber,
|
|
378
|
-
width,
|
|
379
|
-
textColor,
|
|
380
|
-
onClickItem
|
|
381
|
-
);
|
|
1073
|
+
g.attr("transform", `translate(${margin.left},${margin.top})`);
|
|
382
1074
|
const neighbors = /* @__PURE__ */ new Map();
|
|
383
1075
|
for (const node of nodes) neighbors.set(node, /* @__PURE__ */ new Set());
|
|
384
1076
|
for (const link of links) {
|
|
@@ -639,6 +1331,64 @@ function renderArcDiagram(container, parsed, palette, isDark, onClickItem, expor
|
|
|
639
1331
|
}
|
|
640
1332
|
}
|
|
641
1333
|
|
|
1334
|
+
// src/pert/export.ts
|
|
1335
|
+
function collapsedPertGroupIdsFromSource(parsed) {
|
|
1336
|
+
return new Set(parsed.groups.filter((g) => g.collapsed).map((g) => g.id));
|
|
1337
|
+
}
|
|
1338
|
+
function unionCollapsedPertGroups(parsed, runtime) {
|
|
1339
|
+
const set = collapsedPertGroupIdsFromSource(parsed);
|
|
1340
|
+
for (const id of runtime ?? []) set.add(id);
|
|
1341
|
+
return set;
|
|
1342
|
+
}
|
|
1343
|
+
async function exportPert(ctx) {
|
|
1344
|
+
const { content, theme, palette, viewState } = ctx;
|
|
1345
|
+
const { parsePert: parsePert2 } = await import("./parser-YV4RBHG7.js");
|
|
1346
|
+
const { analyzePert } = await import("./analyzer-G7PGOT3V.js");
|
|
1347
|
+
const { relayoutPert } = await import("./layout-GC5XX2RH.js");
|
|
1348
|
+
const { renderPert, measurePertAnalysisBlock } = await import("./renderer-M2467III.js");
|
|
1349
|
+
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
1350
|
+
const pertParsed = parsePert2(content, { palette: effectivePalette });
|
|
1351
|
+
if (pertParsed.error || pertParsed.activities.length === 0) return "";
|
|
1352
|
+
const pertResolved = analyzePert(pertParsed);
|
|
1353
|
+
const collapsedIds = unionCollapsedPertGroups(pertParsed, viewState?.cg);
|
|
1354
|
+
const pertLayout = relayoutPert(pertResolved, {}, collapsedIds);
|
|
1355
|
+
const hasTitle = !!pertParsed.title && !pertParsed.options.noTitle;
|
|
1356
|
+
const hasSubtitle = pertResolved.projectSubtitle !== null;
|
|
1357
|
+
const titleHeight = hasTitle ? 80 : hasSubtitle ? 50 : 0;
|
|
1358
|
+
const PERT_PADDING = 20;
|
|
1359
|
+
const analysisOn = viewState?.an ?? !pertParsed.options.noAnalysis;
|
|
1360
|
+
const fieldLabelsOn = viewState?.fl === true;
|
|
1361
|
+
const exportW = pertLayout.width + PERT_PADDING * 2;
|
|
1362
|
+
const analysisMeasured = measurePertAnalysisBlock(
|
|
1363
|
+
pertResolved,
|
|
1364
|
+
exportW - 2 * PERT_PADDING,
|
|
1365
|
+
{
|
|
1366
|
+
showTornado: analysisOn,
|
|
1367
|
+
showScurve: analysisOn,
|
|
1368
|
+
showFieldLegend: fieldLabelsOn
|
|
1369
|
+
}
|
|
1370
|
+
);
|
|
1371
|
+
const exportH = pertLayout.height + PERT_PADDING * 2 + titleHeight + analysisMeasured.height;
|
|
1372
|
+
const container = createExportContainer(exportW, exportH);
|
|
1373
|
+
renderPert(
|
|
1374
|
+
container,
|
|
1375
|
+
pertResolved,
|
|
1376
|
+
pertLayout,
|
|
1377
|
+
effectivePalette,
|
|
1378
|
+
ctx.isDark,
|
|
1379
|
+
{
|
|
1380
|
+
title: hasTitle ? pertParsed.title : null,
|
|
1381
|
+
subtitle: pertResolved.projectSubtitle,
|
|
1382
|
+
exportDims: { width: exportW, height: exportH },
|
|
1383
|
+
showTornado: analysisOn,
|
|
1384
|
+
showScurve: analysisOn,
|
|
1385
|
+
showFieldLegend: fieldLabelsOn,
|
|
1386
|
+
collapsedGroupIds: [...collapsedIds]
|
|
1387
|
+
}
|
|
1388
|
+
);
|
|
1389
|
+
return finalizeSvgExport(container, theme, effectivePalette);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
642
1392
|
// src/quadrant/renderer.ts
|
|
643
1393
|
import * as d3Scale2 from "d3-scale";
|
|
644
1394
|
import * as d3Selection2 from "d3-selection";
|
|
@@ -670,10 +1420,19 @@ function renderQuadrant(container, parsed, palette, isDark, onClickItem, exportD
|
|
|
670
1420
|
palette.colors.yellow,
|
|
671
1421
|
palette.colors.purple
|
|
672
1422
|
];
|
|
1423
|
+
const titleExtra = renderChartTitle(
|
|
1424
|
+
svg,
|
|
1425
|
+
title,
|
|
1426
|
+
quadrantTitleLineNumber,
|
|
1427
|
+
width,
|
|
1428
|
+
textColor,
|
|
1429
|
+
onClickItem,
|
|
1430
|
+
2
|
|
1431
|
+
);
|
|
673
1432
|
const hasXAxis = !!quadrantXAxis;
|
|
674
1433
|
const hasYAxis = !!quadrantYAxis;
|
|
675
1434
|
const margin = {
|
|
676
|
-
top: title ? ctx.aesthetic(60) : ctx.aesthetic(30),
|
|
1435
|
+
top: (title ? ctx.aesthetic(60) : ctx.aesthetic(30)) + titleExtra,
|
|
677
1436
|
right: ctx.aesthetic(30),
|
|
678
1437
|
bottom: hasXAxis ? ctx.aesthetic(70) : ctx.aesthetic(40),
|
|
679
1438
|
left: hasYAxis ? ctx.aesthetic(80) : ctx.aesthetic(40)
|
|
@@ -682,14 +1441,6 @@ function renderQuadrant(container, parsed, palette, isDark, onClickItem, exportD
|
|
|
682
1441
|
const chartHeight = height - margin.top - margin.bottom;
|
|
683
1442
|
const xScale = d3Scale2.scaleLinear().domain([0, 1]).range([0, chartWidth]);
|
|
684
1443
|
const yScale = d3Scale2.scaleLinear().domain([0, 1]).range([chartHeight, 0]);
|
|
685
|
-
renderChartTitle(
|
|
686
|
-
svg,
|
|
687
|
-
title,
|
|
688
|
-
quadrantTitleLineNumber,
|
|
689
|
-
width,
|
|
690
|
-
textColor,
|
|
691
|
-
onClickItem
|
|
692
|
-
);
|
|
693
1444
|
const chartG = svg.append("g").attr("transform", `translate(${margin.left}, ${margin.top})`);
|
|
694
1445
|
const bg = themeBaseBg(palette, isDark);
|
|
695
1446
|
const getQuadrantColor = (label, defaultIdx) => {
|
|
@@ -1036,6 +1787,17 @@ function renderSlopeChart(container, parsed, palette, isDark, onClickItem, expor
|
|
|
1036
1787
|
if (ctx.isBelowFloor) {
|
|
1037
1788
|
svg.attr("width", "100%");
|
|
1038
1789
|
}
|
|
1790
|
+
const g = svg.append("g");
|
|
1791
|
+
const titleExtra = renderChartTitle(
|
|
1792
|
+
svg,
|
|
1793
|
+
title,
|
|
1794
|
+
parsed.titleLineNumber,
|
|
1795
|
+
width,
|
|
1796
|
+
textColor,
|
|
1797
|
+
onClickItem,
|
|
1798
|
+
2
|
|
1799
|
+
);
|
|
1800
|
+
const sPlotTop = sMarginTop + titleExtra;
|
|
1039
1801
|
const maxLabelText = data.reduce((longest, item) => {
|
|
1040
1802
|
const text = `${item.values[item.values.length - 1]} \u2014 ${item.label}`;
|
|
1041
1803
|
return text.length > longest.length ? text : longest;
|
|
@@ -1047,22 +1809,14 @@ function renderSlopeChart(container, parsed, palette, isDark, onClickItem, expor
|
|
|
1047
1809
|
maxRightMargin
|
|
1048
1810
|
);
|
|
1049
1811
|
const innerWidth = width - sMarginLeft - rightMargin;
|
|
1050
|
-
const innerHeight = height -
|
|
1812
|
+
const innerHeight = height - sPlotTop - sMarginBottom;
|
|
1051
1813
|
const allValues2 = data.flatMap((d) => d.values);
|
|
1052
1814
|
const [minVal, maxVal] = d3Array2.extent(allValues2);
|
|
1053
1815
|
const valuePadding = (maxVal - minVal) * 0.1 || 1;
|
|
1054
1816
|
const yScale = d3Scale3.scaleLinear().domain([minVal - valuePadding, maxVal + valuePadding]).range([innerHeight, 0]);
|
|
1055
1817
|
const xScale = d3Scale3.scalePoint().domain(periods).range([0, innerWidth]).padding(0);
|
|
1056
|
-
|
|
1818
|
+
g.attr("transform", `translate(${sMarginLeft},${sPlotTop})`);
|
|
1057
1819
|
const tooltip = createTooltip(container, palette, isDark);
|
|
1058
|
-
renderChartTitle(
|
|
1059
|
-
svg,
|
|
1060
|
-
title,
|
|
1061
|
-
parsed.titleLineNumber,
|
|
1062
|
-
width,
|
|
1063
|
-
textColor,
|
|
1064
|
-
onClickItem
|
|
1065
|
-
);
|
|
1066
1820
|
for (const period of periods) {
|
|
1067
1821
|
const x = xScale(period);
|
|
1068
1822
|
g.append("text").attr("x", x).attr("y", -sPeriodHeaderY).attr("text-anchor", "middle").attr("fill", textColor).attr("font-size", sPeriodFont).attr("font-weight", "bold").text(period);
|
|
@@ -1262,11 +2016,23 @@ function renderVenn(container, parsed, palette, _isDark, onClickItem, exportDims
|
|
|
1262
2016
|
const n = vennSets.length;
|
|
1263
2017
|
const idealWidth = n === 2 ? 500 : 600;
|
|
1264
2018
|
const ctx = exportDims ? ScaleContext.identity() : ScaleContext.from(width, idealWidth);
|
|
1265
|
-
const sTitleHeight = title ? ctx.aesthetic(40) : 0;
|
|
1266
2019
|
svg.attr("preserveAspectRatio", "xMidYMid meet");
|
|
1267
2020
|
if (ctx.isBelowFloor) {
|
|
1268
2021
|
svg.attr("width", "100%");
|
|
1269
2022
|
}
|
|
2023
|
+
svg.append("style").text(
|
|
2024
|
+
"circle:focus, circle:focus-visible { outline-solid: none !important; }"
|
|
2025
|
+
);
|
|
2026
|
+
const titleExtra = renderChartTitle(
|
|
2027
|
+
svg,
|
|
2028
|
+
title,
|
|
2029
|
+
parsed.titleLineNumber,
|
|
2030
|
+
width,
|
|
2031
|
+
textColor,
|
|
2032
|
+
onClickItem,
|
|
2033
|
+
2
|
|
2034
|
+
);
|
|
2035
|
+
const sTitleHeight = title ? ctx.aesthetic(40) + titleExtra : 0;
|
|
1270
2036
|
const BASE_R = 100;
|
|
1271
2037
|
const OVERLAP_DISTANCE = BASE_R * 1.4;
|
|
1272
2038
|
let rawCircles;
|
|
@@ -1394,17 +2160,6 @@ function renderVenn(container, parsed, palette, _isDark, onClickItem, exportDims
|
|
|
1394
2160
|
marginBottom
|
|
1395
2161
|
).map((c) => ({ ...c, y: c.y + sTitleHeight }));
|
|
1396
2162
|
const scaledR = circles[0].r;
|
|
1397
|
-
svg.append("style").text(
|
|
1398
|
-
"circle:focus, circle:focus-visible { outline-solid: none !important; }"
|
|
1399
|
-
);
|
|
1400
|
-
renderChartTitle(
|
|
1401
|
-
svg,
|
|
1402
|
-
title,
|
|
1403
|
-
parsed.titleLineNumber,
|
|
1404
|
-
width,
|
|
1405
|
-
textColor,
|
|
1406
|
-
onClickItem
|
|
1407
|
-
);
|
|
1408
2163
|
const circleEls = [];
|
|
1409
2164
|
const circleGroup = svg.append("g");
|
|
1410
2165
|
circles.forEach((c, i) => {
|
|
@@ -1512,6 +2267,19 @@ function renderVenn(container, parsed, palette, _isDark, onClickItem, exportDims
|
|
|
1512
2267
|
const INTERNAL_PAD = ctx.aesthetic(12);
|
|
1513
2268
|
const labelGroup = svg.append("g");
|
|
1514
2269
|
const setLabelBBoxes = circles.map(() => null);
|
|
2270
|
+
const tripleLeader = n === 3 && vennOverlaps.some((ov) => ov.label && new Set(ov.sets).size === 3) ? regionCentroid(circles, [true, true, true]) : null;
|
|
2271
|
+
const LEADER_CLEARANCE = ctx.structural(6);
|
|
2272
|
+
const TRIPLE_DODGE = Math.PI / 6;
|
|
2273
|
+
const gapToTripleLeader = (x1, y1, x2, y2) => {
|
|
2274
|
+
if (!tripleLeader || Math.min(y1, y2) >= tripleLeader.y) return Infinity;
|
|
2275
|
+
const lo = Math.min(x1, x2);
|
|
2276
|
+
const hi = Math.max(x1, x2);
|
|
2277
|
+
if (tripleLeader.x >= lo && tripleLeader.x <= hi) return 0;
|
|
2278
|
+
return Math.min(
|
|
2279
|
+
Math.abs(lo - tripleLeader.x),
|
|
2280
|
+
Math.abs(hi - tripleLeader.x)
|
|
2281
|
+
);
|
|
2282
|
+
};
|
|
1515
2283
|
circles.forEach((c, i) => {
|
|
1516
2284
|
const text = vennSets[i].name;
|
|
1517
2285
|
const inside = circles.map((_, j) => j === i);
|
|
@@ -1546,6 +2314,37 @@ function renderVenn(container, parsed, palette, _isDark, onClickItem, exportDims
|
|
|
1546
2314
|
dx /= mag;
|
|
1547
2315
|
dy /= mag;
|
|
1548
2316
|
}
|
|
2317
|
+
const stubAt = (ux, uy) => {
|
|
2318
|
+
const near = c.r + edgePad;
|
|
2319
|
+
const far = near + stubLen;
|
|
2320
|
+
return gapToTripleLeader(
|
|
2321
|
+
c.x + ux * near,
|
|
2322
|
+
c.y + uy * near,
|
|
2323
|
+
c.x + ux * far,
|
|
2324
|
+
c.y + uy * far
|
|
2325
|
+
);
|
|
2326
|
+
};
|
|
2327
|
+
if (stubAt(dx, dy) < LEADER_CLEARANCE) {
|
|
2328
|
+
let best = null;
|
|
2329
|
+
for (const turn of [TRIPLE_DODGE, -TRIPLE_DODGE]) {
|
|
2330
|
+
const cos = Math.cos(turn);
|
|
2331
|
+
const sin = Math.sin(turn);
|
|
2332
|
+
const ux = dx * cos - dy * sin;
|
|
2333
|
+
const uy = dx * sin + dy * cos;
|
|
2334
|
+
const exit = { x: c.x + ux * c.r, y: c.y + uy * c.r };
|
|
2335
|
+
const blocked = circles.some(
|
|
2336
|
+
(o, j) => j !== i && pointInCircle(exit, o)
|
|
2337
|
+
);
|
|
2338
|
+
if (blocked) continue;
|
|
2339
|
+
const gap = stubAt(ux, uy);
|
|
2340
|
+
if (!best || gap > best.gap || gap === best.gap && ux > best.x)
|
|
2341
|
+
best = { x: ux, y: uy, gap };
|
|
2342
|
+
}
|
|
2343
|
+
if (best && best.gap >= LEADER_CLEARANCE) {
|
|
2344
|
+
dx = best.x;
|
|
2345
|
+
dy = best.y;
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
1549
2348
|
const exitX = c.x + dx * c.r;
|
|
1550
2349
|
const exitY = c.y + dy * c.r;
|
|
1551
2350
|
const edgeX = exitX + dx * edgePad;
|
|
@@ -1943,8 +2742,6 @@ function renderWordCloud(container, parsed, palette, _isDark, onClickItem, expor
|
|
|
1943
2742
|
const { svg, width, height, textColor, colors } = init;
|
|
1944
2743
|
const idealWidth = Math.max(400, words.length * 30);
|
|
1945
2744
|
const ctx = exportDims ? ScaleContext.identity() : ScaleContext.from(width, idealWidth);
|
|
1946
|
-
const sTitleHeight = title ? ctx.aesthetic(40) : 0;
|
|
1947
|
-
const cloudHeight = height - sTitleHeight;
|
|
1948
2745
|
const sPadding = ctx.structural(2);
|
|
1949
2746
|
svg.attr("preserveAspectRatio", "xMidYMid meet");
|
|
1950
2747
|
if (ctx.isBelowFloor) {
|
|
@@ -1962,14 +2759,17 @@ function renderWordCloud(container, parsed, palette, _isDark, onClickItem, expor
|
|
|
1962
2759
|
return sMinSize + Math.sqrt(t) * (sMaxSize - sMinSize);
|
|
1963
2760
|
};
|
|
1964
2761
|
const rotateFn = getRotateFn(cloudOptions.rotate);
|
|
1965
|
-
renderChartTitle(
|
|
2762
|
+
const titleExtra = renderChartTitle(
|
|
1966
2763
|
svg,
|
|
1967
2764
|
title,
|
|
1968
2765
|
parsed.titleLineNumber,
|
|
1969
2766
|
width,
|
|
1970
2767
|
textColor,
|
|
1971
|
-
onClickItem
|
|
2768
|
+
onClickItem,
|
|
2769
|
+
2
|
|
1972
2770
|
);
|
|
2771
|
+
const sTitleHeight = title ? ctx.aesthetic(40) + titleExtra : 0;
|
|
2772
|
+
const cloudHeight = height - sTitleHeight;
|
|
1973
2773
|
const g = svg.append("g").attr(
|
|
1974
2774
|
"transform",
|
|
1975
2775
|
`translate(${width / 2},${sTitleHeight + cloudHeight / 2})`
|
|
@@ -2008,8 +2808,6 @@ function renderWordCloudAsync(container, parsed, palette, _isDark, exportDims) {
|
|
|
2008
2808
|
resolve();
|
|
2009
2809
|
return;
|
|
2010
2810
|
}
|
|
2011
|
-
const titleHeight = title ? 40 : 0;
|
|
2012
|
-
const cloudHeight = height - titleHeight;
|
|
2013
2811
|
const textColor = palette.text;
|
|
2014
2812
|
const bgColor = palette.bg;
|
|
2015
2813
|
const colors = getSeriesColors(palette);
|
|
@@ -2024,7 +2822,17 @@ function renderWordCloudAsync(container, parsed, palette, _isDark, exportDims) {
|
|
|
2024
2822
|
};
|
|
2025
2823
|
const rotateFn = getRotateFn(cloudOptions.rotate);
|
|
2026
2824
|
const svg = d3Selection3.select(container).append("svg").attr("width", width).attr("height", height).attr("viewBox", `0 0 ${width} ${height}`).attr("preserveAspectRatio", "xMidYMid meet").style("background", bgColor);
|
|
2027
|
-
|
|
2825
|
+
const titleExtra = renderChartTitle(
|
|
2826
|
+
svg,
|
|
2827
|
+
title,
|
|
2828
|
+
parsed.titleLineNumber,
|
|
2829
|
+
width,
|
|
2830
|
+
textColor,
|
|
2831
|
+
void 0,
|
|
2832
|
+
2
|
|
2833
|
+
);
|
|
2834
|
+
const titleHeight = title ? 40 + titleExtra : 0;
|
|
2835
|
+
const cloudHeight = height - titleHeight;
|
|
2028
2836
|
const g = svg.append("g").attr(
|
|
2029
2837
|
"transform",
|
|
2030
2838
|
`translate(${width / 2},${titleHeight + cloudHeight / 2})`
|
|
@@ -2084,8 +2892,8 @@ async function exportArc(ctx) {
|
|
|
2084
2892
|
// src/block/export.ts
|
|
2085
2893
|
async function exportBlock(ctx) {
|
|
2086
2894
|
const { content, theme, palette } = ctx;
|
|
2087
|
-
const { parseBlock: parseBlock2 } = await import("./parser-
|
|
2088
|
-
const { renderBlockForExport } = await import("./renderer-
|
|
2895
|
+
const { parseBlock: parseBlock2 } = await import("./parser-JRKPOO2Z.js");
|
|
2896
|
+
const { renderBlockForExport } = await import("./renderer-HIB6LZWZ.js");
|
|
2089
2897
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2090
2898
|
const blockParsed = parseBlock2(content, effectivePalette);
|
|
2091
2899
|
if (blockParsed.error || blockParsed.top.rows.length === 0) return "";
|
|
@@ -2100,8 +2908,8 @@ async function exportBlock(ctx) {
|
|
|
2100
2908
|
// src/body/export.ts
|
|
2101
2909
|
async function exportBody(ctx) {
|
|
2102
2910
|
const { content, theme, palette } = ctx;
|
|
2103
|
-
const { parseBody: parseBody2 } = await import("./parser-
|
|
2104
|
-
const { renderBodyForExport } = await import("./renderer-
|
|
2911
|
+
const { parseBody: parseBody2 } = await import("./parser-QEMFMVF5.js");
|
|
2912
|
+
const { renderBodyForExport } = await import("./renderer-A36NL2SS.js");
|
|
2105
2913
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2106
2914
|
const parsed = parseBody2(content, effectivePalette);
|
|
2107
2915
|
if (parsed.error) return "";
|
|
@@ -2120,7 +2928,7 @@ async function exportBody(ctx) {
|
|
|
2120
2928
|
// src/boxes-and-lines/export.ts
|
|
2121
2929
|
async function exportBoxesAndLines(ctx) {
|
|
2122
2930
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2123
|
-
const { parseBoxesAndLines: parseBoxesAndLines2 } = await import("./parser-
|
|
2931
|
+
const { parseBoxesAndLines: parseBoxesAndLines2 } = await import("./parser-IZYIXDJX.js");
|
|
2124
2932
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2125
2933
|
const blParsed = parseBoxesAndLines2(content, effectivePalette);
|
|
2126
2934
|
if (blParsed.error || blParsed.nodes.length === 0) return "";
|
|
@@ -2131,9 +2939,17 @@ async function exportBoxesAndLines(ctx) {
|
|
|
2131
2939
|
blHiddenTagValues.set(k, new Set(v));
|
|
2132
2940
|
}
|
|
2133
2941
|
}
|
|
2134
|
-
const { renderBoxesAndLinesForExport } = await import("./renderer-
|
|
2135
|
-
const { layoutBoxesAndLines } = await import("./layout-
|
|
2136
|
-
const
|
|
2942
|
+
const { renderBoxesAndLinesForExport } = await import("./renderer-XMJ6XZGL.js");
|
|
2943
|
+
const { layoutBoxesAndLines } = await import("./layout-6VY3DHYD.js");
|
|
2944
|
+
const { collapseBoxesAndLines, unionCollapsedBLGroups } = await import("./collapse-HNTPLB2Q.js");
|
|
2945
|
+
const cr = collapseBoxesAndLines(
|
|
2946
|
+
blParsed,
|
|
2947
|
+
unionCollapsedBLGroups(blParsed, viewState?.cg)
|
|
2948
|
+
);
|
|
2949
|
+
const blLayout = await layoutBoxesAndLines(cr.parsed, {
|
|
2950
|
+
collapsedChildCounts: cr.collapsedChildCounts,
|
|
2951
|
+
originalGroups: cr.originalGroups
|
|
2952
|
+
});
|
|
2137
2953
|
const PADDING = 20;
|
|
2138
2954
|
const titleOffset = blParsed.title ? 40 : 0;
|
|
2139
2955
|
const exportWidth = blLayout.width + PADDING * 2;
|
|
@@ -2142,7 +2958,7 @@ async function exportBoxesAndLines(ctx) {
|
|
|
2142
2958
|
const blActiveTagGroup = ctxTagOverride(ctx);
|
|
2143
2959
|
renderBoxesAndLinesForExport(
|
|
2144
2960
|
container,
|
|
2145
|
-
|
|
2961
|
+
cr.parsed,
|
|
2146
2962
|
blLayout,
|
|
2147
2963
|
effectivePalette,
|
|
2148
2964
|
ctx.isDark,
|
|
@@ -2163,8 +2979,8 @@ async function exportBoxesAndLines(ctx) {
|
|
|
2163
2979
|
// src/bracket/export.ts
|
|
2164
2980
|
async function exportBracket(ctx) {
|
|
2165
2981
|
const { content, theme, palette } = ctx;
|
|
2166
|
-
const { parseBracket: parseBracket2 } = await import("./parser-
|
|
2167
|
-
const { renderBracketForExport, bracketExportDimensions } = await import("./renderer-
|
|
2982
|
+
const { parseBracket: parseBracket2 } = await import("./parser-GMCXCJSP.js");
|
|
2983
|
+
const { renderBracketForExport, bracketExportDimensions } = await import("./renderer-KOPJ76GS.js");
|
|
2168
2984
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2169
2985
|
const parsed = parseBracket2(content, effectivePalette);
|
|
2170
2986
|
if (parsed.error) return "";
|
|
@@ -2180,14 +2996,14 @@ async function exportBracket(ctx) {
|
|
|
2180
2996
|
// src/c4/export.ts
|
|
2181
2997
|
async function exportC4(ctx) {
|
|
2182
2998
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2183
|
-
const { parseC4: parseC42 } = await import("./parser-
|
|
2999
|
+
const { parseC4: parseC42 } = await import("./parser-WKEYS7N3.js");
|
|
2184
3000
|
const {
|
|
2185
3001
|
layoutC4Context,
|
|
2186
3002
|
layoutC4Containers,
|
|
2187
3003
|
layoutC4Components,
|
|
2188
3004
|
layoutC4Deployment
|
|
2189
|
-
} = await import("./layout-
|
|
2190
|
-
const { renderC4Context, renderC4Containers } = await import("./renderer-
|
|
3005
|
+
} = await import("./layout-R6ULGQJK.js");
|
|
3006
|
+
const { renderC4Context, renderC4Containers } = await import("./renderer-UIHCYXBY.js");
|
|
2191
3007
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2192
3008
|
const c4Parsed = parseC42(content, effectivePalette);
|
|
2193
3009
|
if (c4Parsed.error || c4Parsed.elements.length === 0) return "";
|
|
@@ -2223,9 +3039,9 @@ async function exportC4(ctx) {
|
|
|
2223
3039
|
// src/class/export.ts
|
|
2224
3040
|
async function exportClass(ctx) {
|
|
2225
3041
|
const { content, theme, palette, exportMode } = ctx;
|
|
2226
|
-
const { parseClassDiagram: parseClassDiagram2 } = await import("./parser-
|
|
2227
|
-
const { layoutClassDiagram } = await import("./layout-
|
|
2228
|
-
const { renderClassDiagram } = await import("./renderer-
|
|
3042
|
+
const { parseClassDiagram: parseClassDiagram2 } = await import("./parser-RSWZGQA7.js");
|
|
3043
|
+
const { layoutClassDiagram } = await import("./layout-7C2QZCEZ.js");
|
|
3044
|
+
const { renderClassDiagram } = await import("./renderer-4PKYVOYL.js");
|
|
2229
3045
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2230
3046
|
const classParsed = parseClassDiagram2(content, effectivePalette);
|
|
2231
3047
|
if (classParsed.error || classParsed.classes.length === 0) return "";
|
|
@@ -2252,7 +3068,7 @@ async function exportClass(ctx) {
|
|
|
2252
3068
|
// src/clock/export.ts
|
|
2253
3069
|
async function exportClock(ctx) {
|
|
2254
3070
|
const { content, theme, palette } = ctx;
|
|
2255
|
-
const { parseClock: parseClock2 } = await import("./parser-
|
|
3071
|
+
const { parseClock: parseClock2 } = await import("./parser-SGX2PVR5.js");
|
|
2256
3072
|
const { renderClockForExport } = await import("./renderer-DDWDCM2K.js");
|
|
2257
3073
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2258
3074
|
const parsed = parseClock2(content, effectivePalette);
|
|
@@ -2268,7 +3084,7 @@ async function exportClock(ctx) {
|
|
|
2268
3084
|
// src/countdown/export.ts
|
|
2269
3085
|
async function exportCountdown(ctx) {
|
|
2270
3086
|
const { content, theme, palette } = ctx;
|
|
2271
|
-
const { parseCountdown: parseCountdown2 } = await import("./parser-
|
|
3087
|
+
const { parseCountdown: parseCountdown2 } = await import("./parser-5KVFS4RN.js");
|
|
2272
3088
|
const { renderCountdownForExport } = await import("./renderer-3NLDX7DQ.js");
|
|
2273
3089
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2274
3090
|
const parsed = parseCountdown2(content, effectivePalette);
|
|
@@ -2284,8 +3100,8 @@ async function exportCountdown(ctx) {
|
|
|
2284
3100
|
// src/cycle/export.ts
|
|
2285
3101
|
async function exportCycle(ctx) {
|
|
2286
3102
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2287
|
-
const { parseCycle: parseCycle2 } = await import("./parser-
|
|
2288
|
-
const { renderCycleForExport } = await import("./renderer-
|
|
3103
|
+
const { parseCycle: parseCycle2 } = await import("./parser-P375HO7Q.js");
|
|
3104
|
+
const { renderCycleForExport } = await import("./renderer-FAFSRFGR.js");
|
|
2289
3105
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2290
3106
|
const cycleParsed = parseCycle2(content);
|
|
2291
3107
|
if (cycleParsed.error || cycleParsed.nodes.length === 0) return "";
|
|
@@ -2305,9 +3121,9 @@ async function exportCycle(ctx) {
|
|
|
2305
3121
|
// src/er/export.ts
|
|
2306
3122
|
async function exportEr(ctx) {
|
|
2307
3123
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2308
|
-
const { parseERDiagram: parseERDiagram2 } = await import("./parser-
|
|
2309
|
-
const { layoutERDiagram } = await import("./layout-
|
|
2310
|
-
const { renderERDiagram } = await import("./renderer-
|
|
3124
|
+
const { parseERDiagram: parseERDiagram2 } = await import("./parser-IU6425JW.js");
|
|
3125
|
+
const { layoutERDiagram } = await import("./layout-G3RVKEC4.js");
|
|
3126
|
+
const { renderERDiagram } = await import("./renderer-COV2DXTM.js");
|
|
2311
3127
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2312
3128
|
const erParsed = parseERDiagram2(content, effectivePalette);
|
|
2313
3129
|
if (erParsed.error || erParsed.tables.length === 0) return "";
|
|
@@ -2341,8 +3157,8 @@ async function exportEr(ctx) {
|
|
|
2341
3157
|
// src/event-line/export.ts
|
|
2342
3158
|
async function exportEventLine(ctx) {
|
|
2343
3159
|
const { content, theme, palette } = ctx;
|
|
2344
|
-
const { parseEventLine: parseEventLine2 } = await import("./parser-
|
|
2345
|
-
const { renderEventLineForExport } = await import("./renderer-
|
|
3160
|
+
const { parseEventLine: parseEventLine2 } = await import("./parser-MAGFK6OK.js");
|
|
3161
|
+
const { renderEventLineForExport } = await import("./renderer-CNDB4JTZ.js");
|
|
2346
3162
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2347
3163
|
const parsed = parseEventLine2(content, effectivePalette);
|
|
2348
3164
|
if (parsed.error || parsed.events.length === 0) return "";
|
|
@@ -2362,9 +3178,9 @@ async function exportEventLine(ctx) {
|
|
|
2362
3178
|
// src/family/export.ts
|
|
2363
3179
|
async function exportFamily(ctx) {
|
|
2364
3180
|
const { content, theme, palette } = ctx;
|
|
2365
|
-
const { parseFamily: parseFamily2 } = await import("./parser-
|
|
2366
|
-
const { layoutFamily } = await import("./layout-
|
|
2367
|
-
const { renderFamilyForExport } = await import("./renderer-
|
|
3181
|
+
const { parseFamily: parseFamily2 } = await import("./parser-MUHFEM4G.js");
|
|
3182
|
+
const { layoutFamily } = await import("./layout-SPPS225I.js");
|
|
3183
|
+
const { renderFamilyForExport } = await import("./renderer-6O5SV5YE.js");
|
|
2368
3184
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2369
3185
|
const parsed = parseFamily2(content, effectivePalette);
|
|
2370
3186
|
if (parsed.error || parsed.persons.size === 0) return "";
|
|
@@ -2396,9 +3212,9 @@ async function exportFamily(ctx) {
|
|
|
2396
3212
|
// src/gantt/export.ts
|
|
2397
3213
|
async function exportGantt(ctx) {
|
|
2398
3214
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2399
|
-
const { parseGantt: parseGantt2 } = await import("./parser-
|
|
2400
|
-
const { calculateSchedule } = await import("./calculator-
|
|
2401
|
-
const { renderGantt } = await import("./renderer-
|
|
3215
|
+
const { parseGantt: parseGantt2 } = await import("./parser-DRFEX6OX.js");
|
|
3216
|
+
const { calculateSchedule } = await import("./calculator-CIGGTURF.js");
|
|
3217
|
+
const { renderGantt } = await import("./renderer-E5E3OJ42.js");
|
|
2402
3218
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2403
3219
|
const ganttParsed = parseGantt2(content, effectivePalette);
|
|
2404
3220
|
const resolved = calculateSchedule(ganttParsed);
|
|
@@ -2441,8 +3257,8 @@ async function exportGantt(ctx) {
|
|
|
2441
3257
|
// src/goal/export.ts
|
|
2442
3258
|
async function exportGoal(ctx) {
|
|
2443
3259
|
const { content, theme, palette } = ctx;
|
|
2444
|
-
const { parseGoal: parseGoal2 } = await import("./parser-
|
|
2445
|
-
const { renderGoalForExport } = await import("./renderer-
|
|
3260
|
+
const { parseGoal: parseGoal2 } = await import("./parser-UMNBPXG2.js");
|
|
3261
|
+
const { renderGoalForExport } = await import("./renderer-MYKL6VG6.js");
|
|
2446
3262
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2447
3263
|
const parsed = parseGoal2(content, effectivePalette);
|
|
2448
3264
|
if (parsed.error) return "";
|
|
@@ -2457,9 +3273,9 @@ async function exportGoal(ctx) {
|
|
|
2457
3273
|
// src/graph/export.ts
|
|
2458
3274
|
async function exportFlowchart(ctx) {
|
|
2459
3275
|
const { content, theme, palette } = ctx;
|
|
2460
|
-
const { parseFlowchart: parseFlowchart2 } = await import("./flowchart-parser-
|
|
2461
|
-
const { layoutGraph } = await import("./layout-
|
|
2462
|
-
const { renderFlowchart } = await import("./flowchart-renderer-
|
|
3276
|
+
const { parseFlowchart: parseFlowchart2 } = await import("./flowchart-parser-UI5VZNGJ.js");
|
|
3277
|
+
const { layoutGraph } = await import("./layout-WBH5IHYK.js");
|
|
3278
|
+
const { renderFlowchart } = await import("./flowchart-renderer-IYWPKPCF.js");
|
|
2463
3279
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2464
3280
|
const fcParsed = parseFlowchart2(content, effectivePalette);
|
|
2465
3281
|
if (fcParsed.error || fcParsed.nodes.length === 0) return "";
|
|
@@ -2478,9 +3294,9 @@ async function exportFlowchart(ctx) {
|
|
|
2478
3294
|
}
|
|
2479
3295
|
async function exportState(ctx) {
|
|
2480
3296
|
const { content, theme, palette, viewState } = ctx;
|
|
2481
|
-
const { parseState: parseState2 } = await import("./state-parser-
|
|
2482
|
-
const { layoutGraph } = await import("./layout-
|
|
2483
|
-
const { renderState } = await import("./state-renderer-
|
|
3297
|
+
const { parseState: parseState2 } = await import("./state-parser-2PQRH5JE.js");
|
|
3298
|
+
const { layoutGraph } = await import("./layout-WBH5IHYK.js");
|
|
3299
|
+
const { renderState } = await import("./state-renderer-YP6HWLJR.js");
|
|
2484
3300
|
const { collapseStateGroups } = await import("./state-collapse-SE2G4K4I.js");
|
|
2485
3301
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2486
3302
|
const stateParsed = parseState2(content, effectivePalette);
|
|
@@ -2519,10 +3335,10 @@ async function exportState(ctx) {
|
|
|
2519
3335
|
// src/infra/export.ts
|
|
2520
3336
|
async function exportInfra(ctx) {
|
|
2521
3337
|
const { content, theme, palette, viewState } = ctx;
|
|
2522
|
-
const { parseInfra: parseInfra2 } = await import("./parser-
|
|
3338
|
+
const { parseInfra: parseInfra2 } = await import("./parser-WE4VSBBY.js");
|
|
2523
3339
|
const { computeInfra } = await import("./compute-II4G44IK.js");
|
|
2524
|
-
const { layoutInfra } = await import("./layout-
|
|
2525
|
-
const { renderInfra, computeInfraLegendGroups } = await import("./renderer-
|
|
3340
|
+
const { layoutInfra } = await import("./layout-7E7BNOGO.js");
|
|
3341
|
+
const { renderInfra, computeInfraLegendGroups } = await import("./renderer-JLOKFKOZ.js");
|
|
2526
3342
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2527
3343
|
const infraParsed = parseInfra2(content);
|
|
2528
3344
|
if (infraParsed.error || infraParsed.nodes.length === 0) return "";
|
|
@@ -2570,16 +3386,22 @@ async function exportInfra(ctx) {
|
|
|
2570
3386
|
|
|
2571
3387
|
// src/journey-map/export.ts
|
|
2572
3388
|
async function exportJourneyMap(ctx) {
|
|
2573
|
-
const { content, theme, palette, exportMode } = ctx;
|
|
2574
|
-
const { parseJourneyMap: parseJourneyMap2 } = await import("./parser-
|
|
2575
|
-
const { renderJourneyMap } = await import("./renderer-
|
|
2576
|
-
const { layoutJourneyMap } = await import("./layout-
|
|
3389
|
+
const { content, theme, palette, exportMode, viewState } = ctx;
|
|
3390
|
+
const { parseJourneyMap: parseJourneyMap2 } = await import("./parser-IHFHPFL7.js");
|
|
3391
|
+
const { renderJourneyMap } = await import("./renderer-66SCERH7.js");
|
|
3392
|
+
const { layoutJourneyMap } = await import("./layout-ROI5KVSO.js");
|
|
3393
|
+
const { collapsedJourneyPhasesFromSource } = await import("./collapse-GOWNCVHZ.js");
|
|
2577
3394
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2578
3395
|
const jmParsed = parseJourneyMap2(content, effectivePalette);
|
|
2579
3396
|
if (jmParsed.error || jmParsed.phases.length === 0 && jmParsed.steps.length === 0)
|
|
2580
3397
|
return "";
|
|
3398
|
+
const collapsedPhases = collapsedJourneyPhasesFromSource(
|
|
3399
|
+
jmParsed,
|
|
3400
|
+
viewState?.cg
|
|
3401
|
+
);
|
|
2581
3402
|
const jmLayout = layoutJourneyMap(jmParsed, effectivePalette, {
|
|
2582
|
-
isDark: ctx.isDark
|
|
3403
|
+
isDark: ctx.isDark,
|
|
3404
|
+
collapsedPhases
|
|
2583
3405
|
});
|
|
2584
3406
|
const container = createExportContainer(
|
|
2585
3407
|
jmLayout.totalWidth,
|
|
@@ -2587,7 +3409,8 @@ async function exportJourneyMap(ctx) {
|
|
|
2587
3409
|
);
|
|
2588
3410
|
renderJourneyMap(container, jmParsed, effectivePalette, ctx.isDark, {
|
|
2589
3411
|
exportDims: { width: jmLayout.totalWidth, height: jmLayout.totalHeight },
|
|
2590
|
-
exportMode
|
|
3412
|
+
exportMode,
|
|
3413
|
+
collapsedPhases
|
|
2591
3414
|
});
|
|
2592
3415
|
return finalizeSvgExport(container, theme, effectivePalette);
|
|
2593
3416
|
}
|
|
@@ -2595,8 +3418,8 @@ async function exportJourneyMap(ctx) {
|
|
|
2595
3418
|
// src/kanban/export.ts
|
|
2596
3419
|
async function exportKanban(ctx) {
|
|
2597
3420
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2598
|
-
const { parseKanban: parseKanban2 } = await import("./parser-
|
|
2599
|
-
const { renderKanban } = await import("./renderer-
|
|
3421
|
+
const { parseKanban: parseKanban2 } = await import("./parser-WPXUUNA2.js");
|
|
3422
|
+
const { renderKanban } = await import("./renderer-ITJ67HXO.js");
|
|
2600
3423
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2601
3424
|
const kanbanParsed = parseKanban2(content, effectivePalette);
|
|
2602
3425
|
if (kanbanParsed.error || kanbanParsed.columns.length === 0) return "";
|
|
@@ -2629,8 +3452,8 @@ async function exportKanban(ctx) {
|
|
|
2629
3452
|
// src/live-link/export.ts
|
|
2630
3453
|
async function exportLiveLink(ctx) {
|
|
2631
3454
|
const { content, theme, palette } = ctx;
|
|
2632
|
-
const { parseLiveLink: parseLiveLink2 } = await import("./parser-
|
|
2633
|
-
const { renderLiveLinkCard } = await import("./renderer-
|
|
3455
|
+
const { parseLiveLink: parseLiveLink2 } = await import("./parser-PYY5BRLQ.js");
|
|
3456
|
+
const { renderLiveLinkCard } = await import("./renderer-6IAXRZLK.js");
|
|
2634
3457
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2635
3458
|
return renderLiveLinkCard(parseLiveLink2(content), effectivePalette, theme);
|
|
2636
3459
|
}
|
|
@@ -2647,10 +3470,10 @@ async function resolveMapDataSource(source) {
|
|
|
2647
3470
|
}
|
|
2648
3471
|
async function exportMap(ctx) {
|
|
2649
3472
|
const { content, theme, palette, options } = ctx;
|
|
2650
|
-
const { parseMap: parseMap2 } = await import("./parser-
|
|
3473
|
+
const { parseMap: parseMap2 } = await import("./parser-CFAYEWLF.js");
|
|
2651
3474
|
const { resolveMap } = await import("./resolver-33K6MBCT.js");
|
|
2652
|
-
const { renderMapForExport } = await import("./renderer-
|
|
2653
|
-
const { mapExportDimensions } = await import("./dimensions-
|
|
3475
|
+
const { renderMapForExport } = await import("./renderer-S6L3JR6C.js");
|
|
3476
|
+
const { mapExportDimensions } = await import("./dimensions-KXAI7U2B.js");
|
|
2654
3477
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2655
3478
|
const mapParsed = parseMap2(content, effectivePalette);
|
|
2656
3479
|
const { data: mapData, reason } = await resolveMapDataSource(
|
|
@@ -2685,10 +3508,10 @@ async function exportMap(ctx) {
|
|
|
2685
3508
|
// src/mindmap/export.ts
|
|
2686
3509
|
async function exportMindmap(ctx) {
|
|
2687
3510
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2688
|
-
const { parseMindmap: parseMindmap2 } = await import("./parser-
|
|
2689
|
-
const { layoutMindmap } = await import("./layout-
|
|
2690
|
-
const { collapseMindmapTree } = await import("./collapse-
|
|
2691
|
-
const { renderMindmap } = await import("./renderer-
|
|
3511
|
+
const { parseMindmap: parseMindmap2 } = await import("./parser-SJUEFKNM.js");
|
|
3512
|
+
const { layoutMindmap } = await import("./layout-FJDBY3WG.js");
|
|
3513
|
+
const { collapseMindmapTree } = await import("./collapse-6X5S2S3G.js");
|
|
3514
|
+
const { renderMindmap } = await import("./renderer-TCTZZ5Y6.js");
|
|
2692
3515
|
const isDark = ctx.isDark;
|
|
2693
3516
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2694
3517
|
const mmParsed = parseMindmap2(content, effectivePalette);
|
|
@@ -2740,10 +3563,10 @@ async function exportMindmap(ctx) {
|
|
|
2740
3563
|
// src/org/export.ts
|
|
2741
3564
|
async function exportOrg(ctx) {
|
|
2742
3565
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2743
|
-
const { parseOrg: parseOrg2, findOrgNodeIdByName } = await import("./parser-
|
|
2744
|
-
const { layoutOrg } = await import("./layout-
|
|
3566
|
+
const { parseOrg: parseOrg2, findOrgNodeIdByName } = await import("./parser-E4B7HJT2.js");
|
|
3567
|
+
const { layoutOrg } = await import("./layout-WTHBGTH2.js");
|
|
2745
3568
|
const { collapseOrgTree, focusOrgTree, unionCollapsedOrgNodes } = await import("./collapse-VNYYXMUI.js");
|
|
2746
|
-
const { renderOrg, ancestorTrailReserve } = await import("./renderer-
|
|
3569
|
+
const { renderOrg, ancestorTrailReserve } = await import("./renderer-DXCATVLO.js");
|
|
2747
3570
|
const isDark = ctx.isDark;
|
|
2748
3571
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2749
3572
|
const orgParsed = parseOrg2(content, effectivePalette);
|
|
@@ -2803,59 +3626,11 @@ async function exportOrg(ctx) {
|
|
|
2803
3626
|
return finalizeSvgExport(container, theme, effectivePalette);
|
|
2804
3627
|
}
|
|
2805
3628
|
|
|
2806
|
-
// src/pert/export.ts
|
|
2807
|
-
async function exportPert(ctx) {
|
|
2808
|
-
const { content, theme, palette, viewState } = ctx;
|
|
2809
|
-
const { parsePert: parsePert2 } = await import("./parser-2IKPQVKX.js");
|
|
2810
|
-
const { analyzePert } = await import("./analyzer-G7PGOT3V.js");
|
|
2811
|
-
const { layoutPert } = await import("./layout-KV27UW25.js");
|
|
2812
|
-
const { renderPert, measurePertAnalysisBlock } = await import("./renderer-MWZC7TMD.js");
|
|
2813
|
-
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2814
|
-
const pertParsed = parsePert2(content, { palette: effectivePalette });
|
|
2815
|
-
if (pertParsed.error || pertParsed.activities.length === 0) return "";
|
|
2816
|
-
const pertResolved = analyzePert(pertParsed);
|
|
2817
|
-
const pertLayout = layoutPert(pertResolved);
|
|
2818
|
-
const hasTitle = !!pertParsed.title && !pertParsed.options.noTitle;
|
|
2819
|
-
const hasSubtitle = pertResolved.projectSubtitle !== null;
|
|
2820
|
-
const titleHeight = hasTitle ? 80 : hasSubtitle ? 50 : 0;
|
|
2821
|
-
const PERT_PADDING = 20;
|
|
2822
|
-
const analysisOn = viewState?.an ?? !pertParsed.options.noAnalysis;
|
|
2823
|
-
const fieldLabelsOn = viewState?.fl === true;
|
|
2824
|
-
const exportW = pertLayout.width + PERT_PADDING * 2;
|
|
2825
|
-
const analysisMeasured = measurePertAnalysisBlock(
|
|
2826
|
-
pertResolved,
|
|
2827
|
-
exportW - 2 * PERT_PADDING,
|
|
2828
|
-
{
|
|
2829
|
-
showTornado: analysisOn,
|
|
2830
|
-
showScurve: analysisOn,
|
|
2831
|
-
showFieldLegend: fieldLabelsOn
|
|
2832
|
-
}
|
|
2833
|
-
);
|
|
2834
|
-
const exportH = pertLayout.height + PERT_PADDING * 2 + titleHeight + analysisMeasured.height;
|
|
2835
|
-
const container = createExportContainer(exportW, exportH);
|
|
2836
|
-
renderPert(
|
|
2837
|
-
container,
|
|
2838
|
-
pertResolved,
|
|
2839
|
-
pertLayout,
|
|
2840
|
-
effectivePalette,
|
|
2841
|
-
ctx.isDark,
|
|
2842
|
-
{
|
|
2843
|
-
title: hasTitle ? pertParsed.title : null,
|
|
2844
|
-
subtitle: pertResolved.projectSubtitle,
|
|
2845
|
-
exportDims: { width: exportW, height: exportH },
|
|
2846
|
-
showTornado: analysisOn,
|
|
2847
|
-
showScurve: analysisOn,
|
|
2848
|
-
showFieldLegend: fieldLabelsOn
|
|
2849
|
-
}
|
|
2850
|
-
);
|
|
2851
|
-
return finalizeSvgExport(container, theme, effectivePalette);
|
|
2852
|
-
}
|
|
2853
|
-
|
|
2854
3629
|
// src/pyramid/export.ts
|
|
2855
3630
|
async function exportPyramid(ctx) {
|
|
2856
3631
|
const { content, theme, palette } = ctx;
|
|
2857
|
-
const { parsePyramid: parsePyramid2 } = await import("./parser-
|
|
2858
|
-
const { renderPyramidForExport } = await import("./renderer-
|
|
3632
|
+
const { parsePyramid: parsePyramid2 } = await import("./parser-3PMYAVFL.js");
|
|
3633
|
+
const { renderPyramidForExport } = await import("./renderer-7OXMSF4R.js");
|
|
2859
3634
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2860
3635
|
const pyramidParsed = parsePyramid2(content);
|
|
2861
3636
|
if (pyramidParsed.error || pyramidParsed.layers.length === 0) return "";
|
|
@@ -2890,16 +3665,43 @@ async function exportQuadrant(ctx) {
|
|
|
2890
3665
|
|
|
2891
3666
|
// src/raci/export.ts
|
|
2892
3667
|
async function exportRaci(ctx) {
|
|
2893
|
-
const { content, theme, palette } = ctx;
|
|
2894
|
-
const { parseRaci: parseRaci2 } = await import("./parser-
|
|
2895
|
-
const { renderRaciForExport } = await import("./renderer-
|
|
3668
|
+
const { content, theme, palette, viewState } = ctx;
|
|
3669
|
+
const { parseRaci: parseRaci2 } = await import("./parser-QIPDBT5M.js");
|
|
3670
|
+
const { renderRaciForExport } = await import("./renderer-BXVTYE27.js");
|
|
2896
3671
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2897
3672
|
const raciParsed = parseRaci2(content, effectivePalette);
|
|
2898
3673
|
if (raciParsed.error) return "";
|
|
2899
3674
|
const container = createExportContainer(ctx.width, ctx.height);
|
|
2900
|
-
renderRaciForExport(
|
|
2901
|
-
|
|
2902
|
-
|
|
3675
|
+
renderRaciForExport(
|
|
3676
|
+
container,
|
|
3677
|
+
raciParsed,
|
|
3678
|
+
effectivePalette,
|
|
3679
|
+
ctx.isDark,
|
|
3680
|
+
{ width: ctx.width, height: ctx.height },
|
|
3681
|
+
viewState?.cs
|
|
3682
|
+
);
|
|
3683
|
+
return finalizeSvgExport(container, theme, effectivePalette);
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
// src/swot/export.ts
|
|
3687
|
+
async function exportSwot(ctx) {
|
|
3688
|
+
const { content, theme, palette, exportMode } = ctx;
|
|
3689
|
+
const { parseSwot: parseSwot2 } = await import("./parser-LDVVBP7S.js");
|
|
3690
|
+
const { renderSwot } = await import("./renderer-CC6O6GQK.js");
|
|
3691
|
+
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3692
|
+
const parsed = parseSwot2(content, effectivePalette);
|
|
3693
|
+
if (parsed.error) return "";
|
|
3694
|
+
const container = document.createElement("div");
|
|
3695
|
+
container.style.position = "absolute";
|
|
3696
|
+
container.style.left = "-9999px";
|
|
3697
|
+
document.body.appendChild(container);
|
|
3698
|
+
renderSwot(container, parsed, effectivePalette, ctx.isDark, {
|
|
3699
|
+
activeTagGroup: resolveActiveTagGroup(
|
|
3700
|
+
parsed.tagGroups,
|
|
3701
|
+
parsed.options["active-tag"],
|
|
3702
|
+
ctxTagOverride(ctx)
|
|
3703
|
+
),
|
|
3704
|
+
exportMode
|
|
2903
3705
|
});
|
|
2904
3706
|
return finalizeSvgExport(container, theme, effectivePalette);
|
|
2905
3707
|
}
|
|
@@ -2907,8 +3709,8 @@ async function exportRaci(ctx) {
|
|
|
2907
3709
|
// src/ring/export.ts
|
|
2908
3710
|
async function exportRing(ctx) {
|
|
2909
3711
|
const { content, theme, palette } = ctx;
|
|
2910
|
-
const { parseRing: parseRing2 } = await import("./parser-
|
|
2911
|
-
const { renderRingForExport } = await import("./renderer-
|
|
3712
|
+
const { parseRing: parseRing2 } = await import("./parser-KI2XYB2R.js");
|
|
3713
|
+
const { renderRingForExport } = await import("./renderer-F3JYZERE.js");
|
|
2912
3714
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2913
3715
|
const ringParsed = parseRing2(content);
|
|
2914
3716
|
if (ringParsed.error || ringParsed.layers.length === 0) return "";
|
|
@@ -2935,12 +3737,21 @@ async function exportVisualization(ctx) {
|
|
|
2935
3737
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2936
3738
|
const isDark = ctx.isDark;
|
|
2937
3739
|
const container = createExportContainer(ctx.width, ctx.height);
|
|
2938
|
-
const { parseSequenceDgmo: parseSequenceDgmo2 } = await import("./parser-
|
|
2939
|
-
const { renderSequenceDiagram } = await import("./renderer-
|
|
3740
|
+
const { parseSequenceDgmo: parseSequenceDgmo2 } = await import("./parser-RNBDDEGL.js");
|
|
3741
|
+
const { renderSequenceDiagram } = await import("./renderer-ASPBBACI.js");
|
|
2940
3742
|
const seqParsed = parseSequenceDgmo2(content, effectivePalette);
|
|
2941
3743
|
if (seqParsed.error || seqParsed.participants.length === 0) return "";
|
|
2942
|
-
const
|
|
3744
|
+
const {
|
|
3745
|
+
unionCollapsedSequenceNotes,
|
|
3746
|
+
collapsedSequenceSectionLinesFromSource
|
|
3747
|
+
} = await import("./collapse-6IGH2B24.js");
|
|
3748
|
+
const collapsedSections = collapsedSequenceSectionLinesFromSource(seqParsed);
|
|
3749
|
+
for (const line2 of viewState?.cs ?? []) collapsedSections.add(line2);
|
|
2943
3750
|
const collapsedGroups = viewState?.cg ? new Set(viewState.cg.map(Number).filter((n) => Number.isFinite(n))) : void 0;
|
|
3751
|
+
const collapsedNotes = unionCollapsedSequenceNotes(
|
|
3752
|
+
seqParsed,
|
|
3753
|
+
viewState?.cg?.map(Number).filter((n) => Number.isFinite(n))
|
|
3754
|
+
);
|
|
2944
3755
|
const seqActiveTagGroup = ctxTagOverride(ctx);
|
|
2945
3756
|
renderSequenceDiagram(
|
|
2946
3757
|
container,
|
|
@@ -2953,8 +3764,9 @@ async function exportVisualization(ctx) {
|
|
|
2953
3764
|
...seqActiveTagGroup !== void 0 && {
|
|
2954
3765
|
activeTagGroup: seqActiveTagGroup
|
|
2955
3766
|
},
|
|
2956
|
-
...collapsedSections
|
|
2957
|
-
...collapsedGroups !== void 0 && { collapsedGroups }
|
|
3767
|
+
...collapsedSections.size > 0 && { collapsedSections },
|
|
3768
|
+
...collapsedGroups !== void 0 && { collapsedGroups },
|
|
3769
|
+
collapsedNotes
|
|
2958
3770
|
}
|
|
2959
3771
|
);
|
|
2960
3772
|
return finalizeSvgExport(container, theme, effectivePalette);
|
|
@@ -2963,15 +3775,18 @@ async function exportVisualization(ctx) {
|
|
|
2963
3775
|
// src/sitemap/export.ts
|
|
2964
3776
|
async function exportSitemap(ctx) {
|
|
2965
3777
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
2966
|
-
const { parseSitemap: parseSitemap2 } = await import("./parser-
|
|
2967
|
-
const { layoutSitemap } = await import("./layout-
|
|
2968
|
-
const { collapseSitemapTree } = await import("./collapse-
|
|
2969
|
-
const { renderSitemap } = await import("./renderer-
|
|
3778
|
+
const { parseSitemap: parseSitemap2 } = await import("./parser-BA43YPIQ.js");
|
|
3779
|
+
const { layoutSitemap } = await import("./layout-ZCCABSV7.js");
|
|
3780
|
+
const { collapseSitemapTree, unionCollapsedSitemapNodes } = await import("./collapse-NUM7DPJA.js");
|
|
3781
|
+
const { renderSitemap } = await import("./renderer-HLDRRFZB.js");
|
|
2970
3782
|
const isDark = ctx.isDark;
|
|
2971
3783
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2972
3784
|
const sitemapParsed = parseSitemap2(content, effectivePalette);
|
|
2973
3785
|
if (sitemapParsed.error || sitemapParsed.roots.length === 0) return "";
|
|
2974
|
-
const collapsedNodes =
|
|
3786
|
+
const collapsedNodes = unionCollapsedSitemapNodes(
|
|
3787
|
+
sitemapParsed,
|
|
3788
|
+
viewState?.cg
|
|
3789
|
+
);
|
|
2975
3790
|
const activeTagGroup = resolveActiveTagGroup(
|
|
2976
3791
|
sitemapParsed.tagGroups,
|
|
2977
3792
|
sitemapParsed.options["active-tag"],
|
|
@@ -2981,7 +3796,7 @@ async function exportSitemap(ctx) {
|
|
|
2981
3796
|
sitemapParsed.options["hide"],
|
|
2982
3797
|
viewState?.ha
|
|
2983
3798
|
);
|
|
2984
|
-
const { parsed: effectiveParsed, hiddenCounts } = collapsedNodes
|
|
3799
|
+
const { parsed: effectiveParsed, hiddenCounts } = collapsedNodes.size > 0 ? collapseSitemapTree(sitemapParsed, collapsedNodes) : { parsed: sitemapParsed, hiddenCounts: /* @__PURE__ */ new Map() };
|
|
2985
3800
|
const sitemapLayout = layoutSitemap(
|
|
2986
3801
|
effectiveParsed,
|
|
2987
3802
|
hiddenCounts.size > 0 ? hiddenCounts : void 0,
|
|
@@ -2994,7 +3809,7 @@ async function exportSitemap(ctx) {
|
|
|
2994
3809
|
const {
|
|
2995
3810
|
LEGEND_HEIGHT: SITEMAP_LEGEND_HEIGHT,
|
|
2996
3811
|
LEGEND_GROUP_GAP: SITEMAP_LEGEND_GROUP_GAP
|
|
2997
|
-
} = await import("./legend-constants-
|
|
3812
|
+
} = await import("./legend-constants-KF3MKWL2.js");
|
|
2998
3813
|
const suppressedLegendBand = sitemapLayout.legend.length > 0 && effectiveParsed.options["no-legend"] === "on" ? SITEMAP_LEGEND_HEIGHT + SITEMAP_LEGEND_GROUP_GAP : 0;
|
|
2999
3814
|
const exportWidth = sitemapLayout.width + PADDING * 2;
|
|
3000
3815
|
const exportHeight = sitemapLayout.height + PADDING * 2 + titleOffset - suppressedLegendBand;
|
|
@@ -3014,42 +3829,6 @@ async function exportSitemap(ctx) {
|
|
|
3014
3829
|
return finalizeSvgExport(container, theme, effectivePalette);
|
|
3015
3830
|
}
|
|
3016
3831
|
|
|
3017
|
-
// src/sketch/export.ts
|
|
3018
|
-
async function exportSketch(ctx) {
|
|
3019
|
-
const { content, theme, viewState, exportMode } = ctx;
|
|
3020
|
-
const { parseSketch: parseSketch2 } = await import("./parser-YHDGKPZI.js");
|
|
3021
|
-
const effectivePalette = await resolveExportPalette(theme, ctx.palette);
|
|
3022
|
-
const parsed = parseSketch2(content, effectivePalette);
|
|
3023
|
-
if (parsed.error || parsed.nodes.length === 0 && parsed.boxes.length === 0) {
|
|
3024
|
-
return "";
|
|
3025
|
-
}
|
|
3026
|
-
const { layoutSketch } = await import("./layout-D4L44NRG.js");
|
|
3027
|
-
const { renderSketchForExport } = await import("./renderer-WPN2SXGT.js");
|
|
3028
|
-
const collapsedBoxes = viewState?.cg ? new Set(viewState.cg) : void 0;
|
|
3029
|
-
const skLayout = layoutSketch(parsed, {
|
|
3030
|
-
...collapsedBoxes !== void 0 && { collapsedBoxes }
|
|
3031
|
-
});
|
|
3032
|
-
const PADDING = 20;
|
|
3033
|
-
const titleOffset = parsed.title ? 40 : 0;
|
|
3034
|
-
const exportWidth = skLayout.width + PADDING * 2;
|
|
3035
|
-
const exportHeight = skLayout.height + PADDING * 2 + titleOffset;
|
|
3036
|
-
const container = createExportContainer(exportWidth, exportHeight);
|
|
3037
|
-
const skTagOverride = ctxTagOverride(ctx);
|
|
3038
|
-
renderSketchForExport(
|
|
3039
|
-
container,
|
|
3040
|
-
parsed,
|
|
3041
|
-
skLayout,
|
|
3042
|
-
effectivePalette,
|
|
3043
|
-
ctx.isDark,
|
|
3044
|
-
{
|
|
3045
|
-
...skTagOverride !== void 0 && { activeTagGroup: skTagOverride },
|
|
3046
|
-
...exportMode !== void 0 && { exportMode },
|
|
3047
|
-
...viewState?.hd !== void 0 && { hideDescriptions: viewState.hd }
|
|
3048
|
-
}
|
|
3049
|
-
);
|
|
3050
|
-
return finalizeSvgExport(container, theme, effectivePalette);
|
|
3051
|
-
}
|
|
3052
|
-
|
|
3053
3832
|
// src/slope/export.ts
|
|
3054
3833
|
async function exportSlope(ctx) {
|
|
3055
3834
|
const { content, theme, palette } = ctx;
|
|
@@ -3071,9 +3850,9 @@ async function exportSlope(ctx) {
|
|
|
3071
3850
|
// src/swimlane/export.ts
|
|
3072
3851
|
async function exportSwimlane(ctx) {
|
|
3073
3852
|
const { content, theme, palette } = ctx;
|
|
3074
|
-
const { parseSwimlane: parseSwimlane2 } = await import("./parser-
|
|
3075
|
-
const { layoutSwimlane } = await import("./layout-
|
|
3076
|
-
const { renderSwimlaneForExport } = await import("./renderer-
|
|
3853
|
+
const { parseSwimlane: parseSwimlane2 } = await import("./parser-DWVBRBB2.js");
|
|
3854
|
+
const { layoutSwimlane } = await import("./layout-BSK374N6.js");
|
|
3855
|
+
const { renderSwimlaneForExport } = await import("./renderer-E7LC7HCU.js");
|
|
3077
3856
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3078
3857
|
const swimParsed = parseSwimlane2(content, effectivePalette);
|
|
3079
3858
|
if (swimParsed.error || swimParsed.nodes.length === 0) return "";
|
|
@@ -3105,8 +3884,8 @@ async function exportSwimlane(ctx) {
|
|
|
3105
3884
|
// src/tech-radar/export.ts
|
|
3106
3885
|
async function exportTechRadar(ctx) {
|
|
3107
3886
|
const { content, theme, palette, viewState, exportMode } = ctx;
|
|
3108
|
-
const { parseTechRadar: parseTechRadar2 } = await import("./parser-
|
|
3109
|
-
const { renderTechRadarForExport } = await import("./renderer-
|
|
3887
|
+
const { parseTechRadar: parseTechRadar2 } = await import("./parser-YZ3J542U.js");
|
|
3888
|
+
const { renderTechRadarForExport } = await import("./renderer-ZTHXOBXW.js");
|
|
3110
3889
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3111
3890
|
const radarParsed = parseTechRadar2(content);
|
|
3112
3891
|
if (radarParsed.error || radarParsed.quadrants.length === 0) return "";
|
|
@@ -3157,14 +3936,14 @@ async function exportTimeline(ctx) {
|
|
|
3157
3936
|
// src/treemap/export.ts
|
|
3158
3937
|
async function exportTreemap(ctx) {
|
|
3159
3938
|
const { content, theme, palette } = ctx;
|
|
3160
|
-
const { parseTreemap: parseTreemap2 } = await import("./parser-
|
|
3939
|
+
const { parseTreemap: parseTreemap2 } = await import("./parser-XP3RCOTN.js");
|
|
3161
3940
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3162
3941
|
const treemapParsed = parseTreemap2(content, effectivePalette);
|
|
3163
3942
|
if (treemapParsed.error || treemapParsed.roots.length === 0) return "";
|
|
3164
3943
|
const container = createExportContainer(ctx.width, ctx.height);
|
|
3165
3944
|
const dims = { width: ctx.width, height: ctx.height };
|
|
3166
3945
|
if (treemapParsed.options.radial) {
|
|
3167
|
-
const { renderTreemapRadialForExport } = await import("./renderer-radial-
|
|
3946
|
+
const { renderTreemapRadialForExport } = await import("./renderer-radial-FC25BDCZ.js");
|
|
3168
3947
|
renderTreemapRadialForExport(
|
|
3169
3948
|
container,
|
|
3170
3949
|
treemapParsed,
|
|
@@ -3173,7 +3952,7 @@ async function exportTreemap(ctx) {
|
|
|
3173
3952
|
dims
|
|
3174
3953
|
);
|
|
3175
3954
|
} else {
|
|
3176
|
-
const { renderTreemapForExport } = await import("./renderer-
|
|
3955
|
+
const { renderTreemapForExport } = await import("./renderer-INQMQPNN.js");
|
|
3177
3956
|
renderTreemapForExport(
|
|
3178
3957
|
container,
|
|
3179
3958
|
treemapParsed,
|
|
@@ -3199,8 +3978,8 @@ async function exportVenn(ctx) {
|
|
|
3199
3978
|
// src/version-control/export.ts
|
|
3200
3979
|
async function exportVersionControl(ctx) {
|
|
3201
3980
|
const { content, theme, palette } = ctx;
|
|
3202
|
-
const { parseVersionControl: parseVersionControl2 } = await import("./parser-
|
|
3203
|
-
const { renderVersionControlForExport } = await import("./renderer-
|
|
3981
|
+
const { parseVersionControl: parseVersionControl2 } = await import("./parser-FWQY3HJX.js");
|
|
3982
|
+
const { renderVersionControlForExport } = await import("./renderer-SYWVZ4CY.js");
|
|
3204
3983
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3205
3984
|
const parsed = parseVersionControl2(content, effectivePalette);
|
|
3206
3985
|
if (parsed.error || parsed.nodes.length === 0) return "";
|
|
@@ -3221,11 +4000,11 @@ async function exportVersionControl(ctx) {
|
|
|
3221
4000
|
// src/whiteboard/export.ts
|
|
3222
4001
|
async function exportWhiteboard(ctx) {
|
|
3223
4002
|
const { content, theme } = ctx;
|
|
3224
|
-
const { parseWhiteboard: parseWhiteboard2 } = await import("./parser-
|
|
4003
|
+
const { parseWhiteboard: parseWhiteboard2 } = await import("./parser-MH5BDN7X.js");
|
|
3225
4004
|
const effectivePalette = await resolveExportPalette(theme, ctx.palette);
|
|
3226
4005
|
const parsed = parseWhiteboard2(content, effectivePalette);
|
|
3227
4006
|
if (parsed.error || parsed.elements.length === 0) return "";
|
|
3228
|
-
const { renderWhiteboard } = await import("./renderer-
|
|
4007
|
+
const { renderWhiteboard } = await import("./renderer-2V5NVI3V.js");
|
|
3229
4008
|
const container = createExportContainer(1, 1);
|
|
3230
4009
|
const resolveImage = ctx.options?.resolveImage;
|
|
3231
4010
|
const showNotes = ctx.options?.showNotes;
|
|
@@ -3239,9 +4018,9 @@ async function exportWhiteboard(ctx) {
|
|
|
3239
4018
|
// src/wireframe/export.ts
|
|
3240
4019
|
async function exportWireframe(ctx) {
|
|
3241
4020
|
const { content, theme, palette } = ctx;
|
|
3242
|
-
const { parseWireframe: parseWireframe2 } = await import("./parser-
|
|
3243
|
-
const { layoutWireframe } = await import("./layout-
|
|
3244
|
-
const { renderWireframe } = await import("./renderer-
|
|
4021
|
+
const { parseWireframe: parseWireframe2 } = await import("./parser-JQGUTDSX.js");
|
|
4022
|
+
const { layoutWireframe } = await import("./layout-VTGOYGRC.js");
|
|
4023
|
+
const { renderWireframe } = await import("./renderer-WIBVOPRC.js");
|
|
3245
4024
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
3246
4025
|
const wireframeParsed = parseWireframe2(content);
|
|
3247
4026
|
if (wireframeParsed.error || wireframeParsed.roots.length === 0 && wireframeParsed.modals.length === 0)
|
|
@@ -3288,7 +4067,6 @@ var DIAGRAM_EXPORT_HANDLERS = {
|
|
|
3288
4067
|
class: exportClass,
|
|
3289
4068
|
er: exportEr,
|
|
3290
4069
|
"boxes-and-lines": exportBoxesAndLines,
|
|
3291
|
-
sketch: exportSketch,
|
|
3292
4070
|
whiteboard: exportWhiteboard,
|
|
3293
4071
|
swimlane: exportSwimlane,
|
|
3294
4072
|
family: exportFamily,
|
|
@@ -3314,6 +4092,7 @@ var DIAGRAM_EXPORT_HANDLERS = {
|
|
|
3314
4092
|
clock: exportClock,
|
|
3315
4093
|
bracket: exportBracket,
|
|
3316
4094
|
raci: exportRaci,
|
|
4095
|
+
swot: exportSwot,
|
|
3317
4096
|
body: exportBody,
|
|
3318
4097
|
"live-link": exportLiveLink,
|
|
3319
4098
|
// D3 visualizations — own handler per type (Story 109.2). Only `sequence`
|
|
@@ -3344,18 +4123,21 @@ function resolveArcChordOverride(content, detectedType, palette) {
|
|
|
3344
4123
|
}
|
|
3345
4124
|
async function renderForExport(content, theme, palette, viewState, options) {
|
|
3346
4125
|
const exportMode = options?.exportMode ?? false;
|
|
3347
|
-
const { parseDgmoChartType } = await import("./dgmo-router-
|
|
4126
|
+
const { parseDgmoChartType } = await import("./dgmo-router-RSYWR5IS.js");
|
|
3348
4127
|
const detectedTypeRaw = parseDgmoChartType(content);
|
|
3349
4128
|
const override = resolveArcChordOverride(content, detectedTypeRaw, palette);
|
|
3350
4129
|
const renderContent = override?.content ?? content;
|
|
3351
4130
|
const detectedType = override?.type ?? detectedTypeRaw;
|
|
3352
4131
|
if (detectedType !== null) {
|
|
3353
|
-
const { supportsD3DataChart, renderDataChartD3: renderDataChartD32 } = await import("./charts-d3-
|
|
4132
|
+
const { supportsD3DataChart, renderDataChartD3: renderDataChartD32 } = await import("./charts-d3-INWEGMSD.js");
|
|
3354
4133
|
if (supportsD3DataChart(detectedType)) {
|
|
3355
|
-
return
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
4134
|
+
return fitSvgToContent(
|
|
4135
|
+
await renderDataChartD32(renderContent, theme, palette, {
|
|
4136
|
+
...options?.width !== void 0 && { width: options.width },
|
|
4137
|
+
...options?.height !== void 0 && { height: options.height }
|
|
4138
|
+
}),
|
|
4139
|
+
exportFitRequest(options)
|
|
4140
|
+
);
|
|
3359
4141
|
}
|
|
3360
4142
|
}
|
|
3361
4143
|
const ctx = {
|
|
@@ -3376,7 +4158,16 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
3376
4158
|
height: options?.height && options.height > 0 ? Math.round(options.height) : EXPORT_HEIGHT
|
|
3377
4159
|
};
|
|
3378
4160
|
const handler = detectedType !== null ? DIAGRAM_EXPORT_HANDLERS[detectedType] : void 0;
|
|
3379
|
-
return (
|
|
4161
|
+
return fitSvgToContent(
|
|
4162
|
+
await (handler ?? exportVisualization)(ctx),
|
|
4163
|
+
exportFitRequest(options)
|
|
4164
|
+
);
|
|
4165
|
+
}
|
|
4166
|
+
function exportFitRequest(options) {
|
|
4167
|
+
return {
|
|
4168
|
+
...options?.width !== void 0 && { width: options.width },
|
|
4169
|
+
...options?.height !== void 0 && { height: options.height }
|
|
4170
|
+
};
|
|
3380
4171
|
}
|
|
3381
4172
|
|
|
3382
4173
|
// src/utils/hover-styles.ts
|
|
@@ -3517,6 +4308,7 @@ function buildHoverCss(spec, derived = {}, emphasisOverride) {
|
|
|
3517
4308
|
}
|
|
3518
4309
|
}
|
|
3519
4310
|
const parts = [...base];
|
|
4311
|
+
if (spec.extraCross) cross.push(...spec.extraCross(dimOpacity));
|
|
3520
4312
|
if (cross.length) parts.push(`@media (hover:hover){${cross.join("")}}`);
|
|
3521
4313
|
return parts.join("");
|
|
3522
4314
|
}
|
|
@@ -3720,17 +4512,6 @@ var HOVER_SPECS = {
|
|
|
3720
4512
|
emphasis: "dim",
|
|
3721
4513
|
legend: true
|
|
3722
4514
|
},
|
|
3723
|
-
sketch: {
|
|
3724
|
-
markSelector: ".sk-node",
|
|
3725
|
-
strategy: "connection",
|
|
3726
|
-
hoverSelector: ".sk-node",
|
|
3727
|
-
hoverAttr: "data-node-id",
|
|
3728
|
-
edgeSelector: ".sk-edge-group",
|
|
3729
|
-
fromAttr: "data-from",
|
|
3730
|
-
toAttr: "data-to",
|
|
3731
|
-
legend: true,
|
|
3732
|
-
emphasis: "dim"
|
|
3733
|
-
},
|
|
3734
4515
|
infra: {
|
|
3735
4516
|
markSelector: ".infra-node",
|
|
3736
4517
|
strategy: "connection",
|
|
@@ -3845,6 +4626,24 @@ var HOVER_SPECS = {
|
|
|
3845
4626
|
legend: true,
|
|
3846
4627
|
legendMarkSelector: ".kanban-card"
|
|
3847
4628
|
},
|
|
4629
|
+
// swot: as kanban — hovering anywhere in a panel dims the other three, and the
|
|
4630
|
+
// tag legend pairs on the items, which carry `data-tag-<slug>`.
|
|
4631
|
+
swot: {
|
|
4632
|
+
markSelector: ".swot-panel",
|
|
4633
|
+
strategy: "structural",
|
|
4634
|
+
groupSelector: ".swot-panel",
|
|
4635
|
+
emphasis: "dim",
|
|
4636
|
+
selfEmphasis: false,
|
|
4637
|
+
legend: true,
|
|
4638
|
+
legendMarkSelector: ".swot-item",
|
|
4639
|
+
// An axis header keeps the two panels it heads (#1742): HELPFUL → S and
|
|
4640
|
+
// O, INTERNAL → S and W. The other two panels and headers dim.
|
|
4641
|
+
extraCross: (dim) => ["col", "row"].flatMap(
|
|
4642
|
+
(axis) => [0, 1].map(
|
|
4643
|
+
(i) => `svg:has(.swot-axis[data-swot-axis="${axis}-${i}"]:hover) :is(.swot-panel:not([data-swot-${axis}="${i}"]),.swot-axis:not([data-swot-axis="${axis}-${i}"])){opacity:${dim}}`
|
|
4644
|
+
)
|
|
4645
|
+
)
|
|
4646
|
+
},
|
|
3848
4647
|
// line: each series is a `g.dgmo-series` wrapping its line + data dots + an
|
|
3849
4648
|
// invisible fat hit corridor (`.dgmo-series-hit`, renderer-baked) — without
|
|
3850
4649
|
// the corridor only the 2.5px stroke and 4px dots were hittable, so the
|
|
@@ -4008,13 +4807,17 @@ function deriveFromSvg(svg, spec) {
|
|
|
4008
4807
|
}
|
|
4009
4808
|
return { ...legendExtra() };
|
|
4010
4809
|
}
|
|
4011
|
-
function
|
|
4012
|
-
if (!
|
|
4810
|
+
function hoverCssFor(svg, chartType, emphasis) {
|
|
4811
|
+
if (!svg || !chartType) return "";
|
|
4013
4812
|
const spec = HOVER_SPECS[chartType];
|
|
4014
|
-
if (!spec) return
|
|
4813
|
+
if (!spec) return "";
|
|
4015
4814
|
const derived = deriveFromSvg(svg, spec);
|
|
4016
4815
|
const eff = derived.groupAttr ? { ...spec, groupAttr: derived.groupAttr } : spec;
|
|
4017
|
-
|
|
4816
|
+
return buildHoverCss(eff, derived, emphasis);
|
|
4817
|
+
}
|
|
4818
|
+
function injectHoverStyles(svg, chartType, opts) {
|
|
4819
|
+
if (!opts?.bakeHover) return svg;
|
|
4820
|
+
const css = hoverCssFor(svg, chartType, opts.emphasis);
|
|
4018
4821
|
if (!css) return svg;
|
|
4019
4822
|
const open = svg.match(/<svg\b[^>]*>/);
|
|
4020
4823
|
if (open?.index == null) return svg;
|
|
@@ -4277,12 +5080,6 @@ function summarizeBoxesAndLines(content) {
|
|
|
4277
5080
|
const names = parsed.nodes.map((n) => n.label);
|
|
4278
5081
|
return `Boxes and lines diagram of ${namedCount(names, "box", "boxes")}, with ${plural(parsed.edges.length, "line", "lines")}.`;
|
|
4279
5082
|
}
|
|
4280
|
-
function summarizeSketch(content) {
|
|
4281
|
-
const parsed = parseSketch(content);
|
|
4282
|
-
if (parsed.error) return null;
|
|
4283
|
-
const names = parsed.nodes.map((n) => n.label);
|
|
4284
|
-
return `Sketch of ${namedCount(names, "shape", "shapes")}, with ${plural(parsed.edges.length, "connection", "connections")}.`;
|
|
4285
|
-
}
|
|
4286
5083
|
function summarizeWhiteboard(content) {
|
|
4287
5084
|
const parsed = parseWhiteboard(content);
|
|
4288
5085
|
if (parsed.error) return null;
|
|
@@ -4361,6 +5158,13 @@ function summarizeJourneyMap(content) {
|
|
|
4361
5158
|
const who = parsed.persona ? ` for ${parsed.persona.name}` : "";
|
|
4362
5159
|
return `Journey map${who} of ${plural(steps, "step", "steps")}${phases.length > 0 ? ` across ${namedCount(phases, "phase", "phases")}` : ""}.`;
|
|
4363
5160
|
}
|
|
5161
|
+
function summarizeSwot(content) {
|
|
5162
|
+
const parsed = parseSwot(content);
|
|
5163
|
+
if (parsed.error) return null;
|
|
5164
|
+
const counts = parsed.sections.map((s) => `${s.label} ${s.items.length}`);
|
|
5165
|
+
const total = parsed.sections.reduce((n, s) => n + s.items.length, 0);
|
|
5166
|
+
return `SWOT analysis with ${plural(total, "item", "items")}: ${counts.join(", ")}.`;
|
|
5167
|
+
}
|
|
4364
5168
|
function summarizeRaci(content) {
|
|
4365
5169
|
const parsed = parseRaci(content);
|
|
4366
5170
|
if (parsed.error) return null;
|
|
@@ -4731,7 +5535,6 @@ var SUMMARIZERS = {
|
|
|
4731
5535
|
gantt: summarizeGantt,
|
|
4732
5536
|
pert: summarizePert,
|
|
4733
5537
|
"boxes-and-lines": summarizeBoxesAndLines,
|
|
4734
|
-
sketch: summarizeSketch,
|
|
4735
5538
|
whiteboard: summarizeWhiteboard,
|
|
4736
5539
|
swimlane: summarizeSwimlane,
|
|
4737
5540
|
family: summarizeFamily,
|
|
@@ -4740,6 +5543,7 @@ var SUMMARIZERS = {
|
|
|
4740
5543
|
wireframe: summarizeWireframe,
|
|
4741
5544
|
"journey-map": summarizeJourneyMap,
|
|
4742
5545
|
raci: summarizeRaci,
|
|
5546
|
+
swot: summarizeSwot,
|
|
4743
5547
|
body: summarizeBody,
|
|
4744
5548
|
bracket: summarizeBracket,
|
|
4745
5549
|
"live-link": summarizeLiveLink,
|
|
@@ -4916,10 +5720,19 @@ async function render(source, options) {
|
|
|
4916
5720
|
if (category === "data-chart") {
|
|
4917
5721
|
await acquireDom();
|
|
4918
5722
|
try {
|
|
4919
|
-
const
|
|
5723
|
+
const sizeRequest = {
|
|
4920
5724
|
...options?.width !== void 0 && { width: options.width },
|
|
4921
5725
|
...options?.height !== void 0 && { height: options.height }
|
|
4922
|
-
}
|
|
5726
|
+
};
|
|
5727
|
+
const raw = fitSvgToContent(
|
|
5728
|
+
await renderDataChartD3(
|
|
5729
|
+
renderContent,
|
|
5730
|
+
theme,
|
|
5731
|
+
paletteColors,
|
|
5732
|
+
sizeRequest
|
|
5733
|
+
),
|
|
5734
|
+
sizeRequest
|
|
5735
|
+
);
|
|
4923
5736
|
const svg2 = applyRootDesc(
|
|
4924
5737
|
applyRootA11y(
|
|
4925
5738
|
injectHoverStyles(raw, chartType, { bakeHover }),
|
|
@@ -4974,7 +5787,15 @@ async function render(source, options) {
|
|
|
4974
5787
|
);
|
|
4975
5788
|
svg = applyRootDesc(
|
|
4976
5789
|
applyRootA11y(
|
|
4977
|
-
|
|
5790
|
+
// The fold cue (#1741) rides the same gate: a host that opts out of
|
|
5791
|
+
// baked hover opts out of every baked hover rule.
|
|
5792
|
+
// `interactiveFolds: false` drops it, and the toggles' button markup.
|
|
5793
|
+
options?.interactiveFolds === false ? stripFoldAffordance(
|
|
5794
|
+
injectHoverStyles(svg, chartType, { bakeHover })
|
|
5795
|
+
) : bakeHover ? injectToggleCue(
|
|
5796
|
+
injectHoverStyles(svg, chartType, { bakeHover }),
|
|
5797
|
+
theme
|
|
5798
|
+
) : svg,
|
|
4978
5799
|
chartType,
|
|
4979
5800
|
diagramTitle(content, parsed.chartType)
|
|
4980
5801
|
),
|
|
@@ -4997,13 +5818,18 @@ async function render(source, options) {
|
|
|
4997
5818
|
}
|
|
4998
5819
|
|
|
4999
5820
|
export {
|
|
5821
|
+
EXPORT_FIT_PAD,
|
|
5822
|
+
measureSvgContent,
|
|
5823
|
+
fitSvgToContent,
|
|
5000
5824
|
orderArcNodes,
|
|
5001
5825
|
renderArcDiagram,
|
|
5826
|
+
collapsedPertGroupIdsFromSource,
|
|
5002
5827
|
renderQuadrant,
|
|
5003
5828
|
renderSlopeChart,
|
|
5004
5829
|
renderVenn,
|
|
5005
5830
|
renderWordCloud,
|
|
5006
5831
|
renderForExport,
|
|
5007
5832
|
DEFAULT_DIM_OPACITY,
|
|
5833
|
+
hoverCssFor,
|
|
5008
5834
|
render
|
|
5009
5835
|
};
|