@diagrammo/dgmo 0.89.0 → 0.91.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 +589 -15
- package/dist/advanced.js +813 -211
- package/dist/block.d.ts +11 -2
- package/dist/block.js +94 -64
- package/dist/{calculator-35YVW4QO.js → calculator-3LZUWOBK.js} +2 -2
- package/dist/{chart-meta-Bev5Ebjr.d.ts → chart-meta-B_WTMP0y.d.ts} +1 -1
- package/dist/chart-meta.d.ts +2 -2
- package/dist/chart-meta.js +18 -17
- package/dist/{chart-types-Bf8C5QQW.d.ts → chart-types-V2NcgN5O.d.ts} +4 -0
- package/dist/{charts-d3-KEQSUWKP.js → charts-d3-YXD6VGZQ.js} +8 -7
- package/dist/{chunk-PMNITNPR.js → chunk-273GB7WK.js} +6 -5
- package/dist/{chunk-HAMF4F3P.js → chunk-2A4OFZ2Z.js} +5 -5
- package/dist/{chunk-K5XT7NHD.js → chunk-2AM6VA3A.js} +10 -10
- package/dist/{chunk-XJ2TBXHA.js → chunk-2UV627GG.js} +9 -9
- package/dist/{chunk-7WGCQE2E.js → chunk-2ZVLI6GQ.js} +1 -1
- package/dist/{chunk-JVZ7KFAX.js → chunk-37QQXKFV.js} +9 -10
- package/dist/{chunk-M2BCY7H3.js → chunk-3LINSNJT.js} +199 -146
- package/dist/{chunk-WPL5PFXE.js → chunk-3SLRZKLB.js} +6 -6
- package/dist/chunk-3UR4F7FE.js +14 -0
- package/dist/{chunk-ZUCXFXLD.js → chunk-3YTAOMMN.js} +2 -2
- package/dist/{chunk-NIUO2TNR.js → chunk-4HG4PYHM.js} +197 -203
- package/dist/{chunk-BOO24UMJ.js → chunk-4YO7VJTP.js} +1 -1
- package/dist/{chunk-HUNDJTTH.js → chunk-53BJIOLF.js} +1 -1
- package/dist/{chunk-LR6RRDWN.js → chunk-57L2JPP2.js} +10 -6
- package/dist/{chunk-IIOLFAGJ.js → chunk-5DIBB2QG.js} +51 -32
- package/dist/{chunk-S2WE7TVK.js → chunk-5MDQMB6A.js} +1 -1
- package/dist/{chunk-7Z2VFRP5.js → chunk-5U6DXIMV.js} +47 -24
- package/dist/{chunk-QIOYTQDZ.js → chunk-5VPWIC6T.js} +9 -9
- package/dist/{chunk-JRUEIRJB.js → chunk-634LDSN6.js} +3 -3
- package/dist/{chunk-VEPIAUSK.js → chunk-6BQSDF77.js} +1 -5
- package/dist/{chunk-LPYYZCSI.js → chunk-6NO3MNBC.js} +3 -3
- package/dist/{chunk-ITSBBQTH.js → chunk-6QEXWMBP.js} +13 -17
- package/dist/{chunk-DDPGEGHB.js → chunk-7BBRSOKS.js} +3 -3
- package/dist/{chunk-WQ6G6FFM.js → chunk-AR4QVMWG.js} +5 -2
- package/dist/{chunk-BB6QKWHZ.js → chunk-B6EUFLRP.js} +10 -10
- package/dist/{chunk-C4FRGZGX.js → chunk-CDT33RHG.js} +1 -1
- package/dist/{chunk-WP22MHH6.js → chunk-CPGKRI7H.js} +10 -13
- package/dist/{chunk-ZNNVI5SR.js → chunk-CU2PZLZP.js} +53 -31
- package/dist/{chunk-CUYHST3B.js → chunk-CVZBLHHW.js} +1 -1
- package/dist/{chunk-Y7PSAHAY.js → chunk-CXIPV2FY.js} +3 -3
- package/dist/{chunk-NRPELUB6.js → chunk-D7DXNQW5.js} +2 -2
- package/dist/{chunk-YMFQLWZ2.js → chunk-D7PP35BA.js} +1 -1
- package/dist/{chunk-RGWYZR3S.js → chunk-DLX7MEN4.js} +2 -2
- package/dist/chunk-EDPDAUBL.js +825 -0
- package/dist/{chunk-GSYZZFI5.js → chunk-EP7BT3HU.js} +2 -2
- package/dist/{chunk-ICZ7M6IZ.js → chunk-EQJ3U5EW.js} +1 -1
- package/dist/{chunk-3C2FWS2J.js → chunk-EWERNTOX.js} +1 -1
- package/dist/{chunk-XUCQVKLQ.js → chunk-F2436VRR.js} +4 -4
- package/dist/{chunk-UG2XG57E.js → chunk-F26ZPBSF.js} +3 -3
- package/dist/{chunk-UWKRPQZO.js → chunk-FJCYK4K3.js} +25 -22
- package/dist/{chunk-FKLE6QA3.js → chunk-G22UV5AF.js} +12 -12
- package/dist/{chunk-GUTZCRBT.js → chunk-G3EUQMV4.js} +4 -4
- package/dist/{chunk-SOPM5PLO.js → chunk-GCDW3WAY.js} +14 -14
- package/dist/{chunk-7UDAIP6W.js → chunk-HFG7KQOY.js} +13 -15
- package/dist/{chunk-ID2K3IHI.js → chunk-HLE5QGZJ.js} +1 -1
- package/dist/{chunk-QFHWYWQL.js → chunk-HLVGZXM5.js} +2 -2
- package/dist/{chunk-7C2RAGPT.js → chunk-HSGWR2FL.js} +16 -16
- package/dist/{chunk-P3SKSKJI.js → chunk-HWXUQCDY.js} +3 -3
- package/dist/{chunk-HTWH2XQL.js → chunk-HYV6GSXM.js} +6 -3
- package/dist/{chunk-3RYBTEF5.js → chunk-I74AQRVD.js} +6 -12
- package/dist/chunk-IHK3Y2HG.js +781 -0
- package/dist/{chunk-7KPHRTND.js → chunk-II4XJETG.js} +1 -1
- package/dist/{chunk-RXIKESRI.js → chunk-IMHNZITR.js} +2 -2
- package/dist/{chunk-TAP2NZEU.js → chunk-IMKPFW67.js} +13 -13
- package/dist/{chunk-FKZ2Y3Q5.js → chunk-IS6WFBX7.js} +3 -3
- package/dist/{chunk-47E5UTXE.js → chunk-IUBCDNT2.js} +2 -2
- package/dist/{chunk-EXKCRXPO.js → chunk-IWTUXGHN.js} +12 -12
- package/dist/{chunk-C7QRRTAW.js → chunk-J2SQNZ6D.js} +2 -2
- package/dist/{chunk-DZPHN2WN.js → chunk-JA2S7PHR.js} +14 -14
- package/dist/{chunk-DPSMX4EY.js → chunk-JJQWCI35.js} +4 -4
- package/dist/chunk-JJUDOR4I.js +110 -0
- package/dist/{chunk-LYLNMN77.js → chunk-K3BYD3WU.js} +8 -3
- package/dist/{chunk-3AQJNY65.js → chunk-KFXY5IW2.js} +149 -43
- package/dist/{chunk-J64NZ6NF.js → chunk-KSZHIAI2.js} +1 -1
- package/dist/{chunk-LCJURK7L.js → chunk-LKR4FACF.js} +2 -4
- package/dist/{chunk-PIXJL77H.js → chunk-M6J25PAZ.js} +1 -1
- package/dist/{chunk-IJ27L3R4.js → chunk-MA42PIGJ.js} +1 -1
- package/dist/{chunk-IQ6P3HDE.js → chunk-MI6SJJQU.js} +2 -2
- package/dist/{chunk-N4BBSDWI.js → chunk-MJKQ5ZYY.js} +140 -151
- package/dist/{chunk-6K7RODXG.js → chunk-MKFQ5E7J.js} +1 -1
- package/dist/{chunk-AZ24RI5L.js → chunk-MNL547RV.js} +6 -6
- package/dist/{chunk-44GP7PD5.js → chunk-MPJQMMBZ.js} +12 -0
- package/dist/{chunk-ECMA6XE2.js → chunk-N254IJM2.js} +13 -13
- package/dist/{layout-search-YKUL4VBV.js → chunk-NWPMLX2V.js} +27 -30
- package/dist/{chunk-DV2VEJCC.js → chunk-NWSPPGIE.js} +6 -6
- package/dist/{chunk-GDJW64XE.js → chunk-OYKNMFUY.js} +1 -1
- package/dist/{chunk-B3S76BZO.js → chunk-PSGSFRRE.js} +4 -4
- package/dist/{chunk-4AJKOUBO.js → chunk-PUZ63XZM.js} +13 -11
- package/dist/{chunk-UQLHKLF4.js → chunk-PZVTFQI2.js} +8 -8
- package/dist/{chunk-W7QN5BC5.js → chunk-Q3N7PI3B.js} +180 -7
- package/dist/{chunk-L5AFONQU.js → chunk-QKJ6MQXW.js} +2 -4
- package/dist/{chunk-7SX4IY6T.js → chunk-QVKTAU7P.js} +1 -1
- package/dist/{chunk-SLQT3JP3.js → chunk-R7BSF7Z7.js} +1 -1
- package/dist/{chunk-4R6OMKXB.js → chunk-RHXIUUWB.js} +5 -5
- package/dist/{chunk-MHAYUS65.js → chunk-RMTOZALT.js} +8 -5
- package/dist/{chunk-HSRQDWV7.js → chunk-ROCBGUJN.js} +8 -17
- package/dist/{chunk-44FTCIRI.js → chunk-RVTYIGWZ.js} +9 -9
- package/dist/{chunk-RU725VCJ.js → chunk-SKF7XLCM.js} +10 -35
- package/dist/{chunk-RPKBWJBB.js → chunk-SMTWQ66K.js} +6 -6
- package/dist/{chunk-3AX6MCI6.js → chunk-SPQVER4T.js} +2 -2
- package/dist/{chunk-CX6OH5WP.js → chunk-SWBHH2UW.js} +4 -4
- package/dist/{chunk-WP2RLGDI.js → chunk-TCX5PMEY.js} +1 -1
- package/dist/{chunk-7TF3QOOD.js → chunk-TIVMAITN.js} +14 -0
- package/dist/{chunk-NSR2CGV6.js → chunk-TLPY4ZBI.js} +611 -437
- package/dist/{chunk-WRCAH3UO.js → chunk-TPEYEOXA.js} +15 -15
- package/dist/{chunk-FJNXXGTR.js → chunk-UWJP4JSZ.js} +3 -3
- package/dist/{chunk-MY6GUH26.js → chunk-V3KHZQPK.js} +3 -3
- package/dist/{chunk-66YFDTT6.js → chunk-VGSSAMLA.js} +4 -4
- package/dist/{chunk-Q6SQISHT.js → chunk-VMD2CYVP.js} +311 -74
- package/dist/{chunk-MFW6P7WH.js → chunk-WNTPJZU7.js} +3 -3
- package/dist/{chunk-7W4XLIVH.js → chunk-WTE27AJT.js} +14 -14
- package/dist/{chunk-UKJLPA7R.js → chunk-X6IZP2BD.js} +1 -1
- package/dist/{chunk-2GM7N5TV.js → chunk-XLAREWBK.js} +9 -9
- package/dist/{chunk-AYOVY75O.js → chunk-XLPJJ35N.js} +4 -4
- package/dist/{chunk-NGC3IZRY.js → chunk-XQTRGKQ3.js} +4 -4
- package/dist/{chunk-WEF6MXFG.js → chunk-YZG37S7L.js} +9 -9
- package/dist/{chunk-LFKSHDVI.js → chunk-ZB2Q67NO.js} +14 -13
- package/dist/{chunk-JQ57AWDL.js → chunk-ZJ4PYTCK.js} +1 -1
- package/dist/completion-registry.d.ts +6 -0
- package/dist/completion-registry.js +62 -6
- package/dist/{compute-JAP5E2E4.js → compute-2XWFVO7K.js} +1 -1
- package/dist/{d3-B6524aaP.d.ts → d3-2S3PrXik.d.ts} +11 -0
- package/dist/dgmo-router-YHBMKTXY.js +94 -0
- package/dist/{dimensions-7MF7VSGS.js → dimensions-QMGWJQTR.js} +5 -5
- package/dist/editor.js +12 -0
- package/dist/{flowchart-parser-GG7XBLQH.js → flowchart-parser-BLJ6RA53.js} +4 -4
- package/dist/{flowchart-renderer-DZQZRL2F.js → flowchart-renderer-FXRQKXAK.js} +12 -8
- package/dist/highlight.js +12 -0
- package/dist/index.d.ts +26 -5
- package/dist/index.js +84 -57
- package/dist/{layout-5VSMZPMG.js → layout-5HCEF7VO.js} +1 -1
- package/dist/{layout-6L3BIFEZ.js → layout-6PLSBB5X.js} +3 -3
- package/dist/{layout-UIV56NUA.js → layout-B7PQRAMB.js} +1 -1
- package/dist/{layout-IGAVGDME.js → layout-CCVCLZ6S.js} +1 -1
- package/dist/{layout-PP36LUTA.js → layout-CRUAP7JG.js} +3 -3
- package/dist/{layout-Q3RYSODA.js → layout-G42FDCF3.js} +3 -3
- package/dist/{layout-EFEZ533S.js → layout-IV4H2FLB.js} +3 -3
- package/dist/{layout-4RRC7XU7.js → layout-JTNRSGOS.js} +6 -3
- package/dist/{layout-H4K54IW3.js → layout-RBLD5EGX.js} +6 -3
- package/dist/{layout-SW3XWYKC.js → layout-ROAVGBUC.js} +1 -1
- package/dist/{layout-XUW444O5.js → layout-T2DQ4M77.js} +8 -4
- package/dist/{layout-MSSHF45T.js → layout-UPQGIT3N.js} +2 -2
- package/dist/{layout-DXVAYF6W.js → layout-VRJ5YFUE.js} +2 -2
- package/dist/{layout-ZP7XYVXF.js → layout-YKGQRFDM.js} +2 -4
- package/dist/layout-search-L75YOBME.js +42 -0
- package/dist/{palettes-WZAIQTEG.js → palettes-WQHELGVQ.js} +2 -1
- package/dist/{parser-ZLKYDFI5.js → parser-2XCDVLSN.js} +3 -3
- package/dist/{parser-GZ3LVF72.js → parser-3MGA2MTM.js} +2 -2
- package/dist/{parser-NOANDFJ4.js → parser-4AR25MAS.js} +2 -2
- package/dist/{parser-GCCWMBTU.js → parser-4QNRCGU5.js} +5 -4
- package/dist/{parser-LANGKWRG.js → parser-6LMB7BQQ.js} +2 -2
- package/dist/{parser-WEVTMBJ5.js → parser-6NSQLPTS.js} +3 -3
- package/dist/{parser-KYPP2DX6.js → parser-6X4GGH2R.js} +4 -4
- package/dist/parser-AL6YL7KM.js +12 -0
- package/dist/{parser-5655XSOR.js → parser-D6YRVV75.js} +3 -3
- package/dist/{parser-NGHQQGD2.js → parser-EY3VJWBE.js} +3 -3
- package/dist/{parser-TL3JA4RI.js → parser-EYF4ZSZO.js} +3 -3
- package/dist/{parser-256EIWB2.js → parser-FDXUQ5TI.js} +2 -2
- package/dist/{parser-JOOAVBJI.js → parser-H2DJEAPG.js} +3 -3
- package/dist/{parser-AKBVJHMK.js → parser-ILWAA3QJ.js} +3 -3
- package/dist/{parser-AN3MGHRL.js → parser-KMFMNZYI.js} +3 -3
- package/dist/{parser-IMM2JJX3.js → parser-MDSVVCJP.js} +4 -4
- package/dist/{parser-OVQTTTUJ.js → parser-OFTMA36M.js} +2 -2
- package/dist/{parser-LGS65QPN.js → parser-Q3UAOLEZ.js} +2 -2
- package/dist/{parser-DGF3ZEO6.js → parser-QL4DEPVA.js} +4 -4
- package/dist/{parser-XYY5NHP4.js → parser-R6OETHWM.js} +2 -2
- package/dist/{parser-GEKPWSSK.js → parser-UEDPLM46.js} +3 -3
- package/dist/{parser-KZMALSB2.js → parser-UL6WN6W5.js} +4 -4
- package/dist/{parser-J4DVNL4W.js → parser-ULSUK36C.js} +4 -4
- package/dist/{parser-KZMJNKDW.js → parser-UY3K4ROB.js} +2 -2
- package/dist/{parser-KFYRTGTC.js → parser-UYQNNQKT.js} +4 -4
- package/dist/{parser-DHSFIUPU.js → parser-VG747VR6.js} +3 -3
- package/dist/{parser-UTXFJG4X.js → parser-VK4PNDX4.js} +3 -3
- package/dist/{parser-SA3RAJFS.js → parser-WSONWDFN.js} +2 -2
- package/dist/{parser-NPXPJHWN.js → parser-X5FQ36KJ.js} +3 -3
- package/dist/{parser-OKB64MMN.js → parser-XO5IAXMT.js} +3 -3
- package/dist/{parser-HCGXNHHL.js → parser-YVHO2NRM.js} +3 -3
- package/dist/{parser-P4TOQYNN.js → parser-YWZGIU3C.js} +3 -3
- package/dist/{parser-337TACHB.js → parser-ZFLSULFC.js} +3 -3
- package/dist/{parser-7OEE7QT6.js → parser-ZR7JAKSW.js} +2 -2
- package/dist/{renderer-CHQZES6G.js → renderer-3N64GVNM.js} +2 -2
- package/dist/{renderer-JR2XNZAH.js → renderer-43IVPARP.js} +5 -5
- package/dist/{renderer-J4OS77PK.js → renderer-4MEZYGU6.js} +3 -3
- package/dist/{renderer-IR5GGAPB.js → renderer-54GXA3UO.js} +11 -7
- package/dist/{renderer-7VQOKAII.js → renderer-7EAWN7MC.js} +6 -6
- package/dist/{renderer-QQHQY3GT.js → renderer-7SEXPBGM.js} +5 -5
- package/dist/{renderer-P4XCRNCY.js → renderer-B7B7BQM3.js} +9 -9
- package/dist/{renderer-7HOSI6JJ.js → renderer-I2LYSQBV.js} +4 -4
- package/dist/{renderer-6OQM32X3.js → renderer-IPDCAACY.js} +3 -3
- package/dist/{renderer-JRVY7HAD.js → renderer-J2LOMTBC.js} +4 -4
- package/dist/renderer-JUH6M3XF.js +46 -0
- package/dist/renderer-KY6O5JTX.js +80 -0
- package/dist/{renderer-FCXRDYSJ.js → renderer-LHTDI5RV.js} +7 -7
- package/dist/{renderer-XHEMXBQM.js → renderer-LWL3IJOF.js} +5 -5
- package/dist/{renderer-BLHN3RCY.js → renderer-MRMFYYZT.js} +2 -2
- package/dist/{renderer-DBNDLKPE.js → renderer-NCIDGJ2R.js} +7 -7
- package/dist/{renderer-3AD4NDF5.js → renderer-OPA4JJKX.js} +6 -6
- package/dist/{renderer-XFEZ5UBE.js → renderer-QMNC7TGN.js} +6 -6
- package/dist/{renderer-5GZNGZU5.js → renderer-QQNPJGAP.js} +9 -7
- package/dist/{renderer-CEIX5JPA.js → renderer-R7OYCJEA.js} +2 -2
- package/dist/{renderer-WQ654YT5.js → renderer-R7RK7FKI.js} +1 -1
- package/dist/{renderer-4JE5ORRO.js → renderer-RFP55AW7.js} +13 -10
- package/dist/{renderer-NAA7D33G.js → renderer-S3NFBJCY.js} +15 -11
- package/dist/{renderer-43ESBXVY.js → renderer-SD4ZHHAR.js} +8 -6
- package/dist/{renderer-WB75JME5.js → renderer-SE7Z5AOL.js} +6 -6
- package/dist/{renderer-YTEZK3GC.js → renderer-T2WUA7MC.js} +7 -7
- package/dist/{renderer-VYWCMRWA.js → renderer-TWKEZ3DD.js} +5 -5
- package/dist/{renderer-DCJ4AQ3N.js → renderer-U5PD72G7.js} +5 -5
- package/dist/{renderer-EAORWLVK.js → renderer-VCTKBUTR.js} +7 -7
- package/dist/{renderer-7L7J4DHO.js → renderer-VNZTWATB.js} +7 -6
- package/dist/{renderer-2ZQ6DPVD.js → renderer-YDNWK6RI.js} +2 -2
- package/dist/{renderer-VGQMJC5K.js → renderer-YDOWBIUB.js} +11 -10
- package/dist/{renderer-7MCC6GKH.js → renderer-YQPZ7O2C.js} +2 -2
- package/dist/{renderer-ZXQXRNDR.js → renderer-ZQ77CM6Y.js} +6 -6
- package/dist/{renderer-radial-NA5DVBG4.js → renderer-radial-TNNEL3YN.js} +5 -5
- package/dist/{resolver-XSXE2TRX.js → resolver-6DJLZF6Y.js} +1 -1
- package/dist/{state-parser-FE3RF6XY.js → state-parser-NIIVOU2Y.js} +4 -4
- package/dist/{state-renderer-4S2C2CHB.js → state-renderer-TVLEG32M.js} +14 -10
- package/dist/{themes-CzuBdx1T.d.ts → themes-Cm2YBcT8.d.ts} +38 -2
- package/docs/ai-integration.md +4 -3
- package/docs/language-reference.md +162 -12
- package/gallery/fixtures/sketch.dgmo +2 -2
- package/gallery/fixtures/whiteboard.dgmo +18 -0
- package/package.json +2 -1
- package/dist/chunk-6EK55ART.js +0 -116
- package/dist/chunk-HTNLLT34.js +0 -72
- package/dist/dgmo-router-7WANZOBD.js +0 -92
- package/dist/renderer-TJJGFQGT.js +0 -78
- package/dist/{chunk-3FCSOYN4.js → chunk-5P2L5QXE.js} +0 -0
- package/dist/{chunk-HJRP6PXL.js → chunk-BQVTV4LB.js} +0 -0
- package/dist/{chunk-LYRDIVSY.js → chunk-GLCMUTO5.js} +0 -0
- package/dist/{chunk-5LE2CTLS.js → chunk-NTJ5HVV6.js} +3 -3
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
ScaleContext
|
|
11
11
|
} from "./chunk-24YPR5EH.js";
|
|
12
|
+
import {
|
|
13
|
+
renderIntegratedLegend
|
|
14
|
+
} from "./chunk-QVKTAU7P.js";
|
|
12
15
|
import {
|
|
13
16
|
ARROWHEAD_HEIGHT,
|
|
14
17
|
ARROWHEAD_WIDTH,
|
|
@@ -27,18 +30,15 @@ import {
|
|
|
27
30
|
import {
|
|
28
31
|
layoutInlineHeader
|
|
29
32
|
} from "./chunk-CNUN5GO6.js";
|
|
33
|
+
import {
|
|
34
|
+
getLegendExtent,
|
|
35
|
+
getMaxLegendReservedHeight
|
|
36
|
+
} from "./chunk-NS7L7YKH.js";
|
|
30
37
|
import {
|
|
31
38
|
TITLE_FONT_SIZE,
|
|
32
39
|
TITLE_FONT_WEIGHT,
|
|
33
40
|
TITLE_Y
|
|
34
41
|
} from "./chunk-VLC6WNRD.js";
|
|
35
|
-
import {
|
|
36
|
-
renderIntegratedLegend
|
|
37
|
-
} from "./chunk-7SX4IY6T.js";
|
|
38
|
-
import {
|
|
39
|
-
getLegendExtent,
|
|
40
|
-
getMaxLegendReservedHeight
|
|
41
|
-
} from "./chunk-NS7L7YKH.js";
|
|
42
42
|
import {
|
|
43
43
|
FONT_FAMILY
|
|
44
44
|
} from "./chunk-ICLB27PZ.js";
|
|
@@ -48,11 +48,10 @@ import {
|
|
|
48
48
|
resolveGroupTagColor,
|
|
49
49
|
resolveTagColor,
|
|
50
50
|
tagAttrKey
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-QKJ6MQXW.js";
|
|
52
52
|
import {
|
|
53
53
|
fitWrapped,
|
|
54
|
-
measureText
|
|
55
|
-
wrapTextToWidth
|
|
54
|
+
measureText
|
|
56
55
|
} from "./chunk-KAO7JL4I.js";
|
|
57
56
|
import {
|
|
58
57
|
contrastText,
|
|
@@ -424,41 +423,10 @@ var DASH = SKETCH_VISUALS.dash;
|
|
|
424
423
|
var BAND_LABEL_FONT_SIZE = SKETCH_VISUALS.bandLabelFontSize;
|
|
425
424
|
var BAND_LABEL_OPACITY = SKETCH_VISUALS.bandLabelOpacity;
|
|
426
425
|
var BAND_LABEL_WEIGHT = SKETCH_VISUALS.bandLabelFontWeight;
|
|
427
|
-
var NOTE_FONT_SIZE = 11;
|
|
428
426
|
var COLLAPSE_BAR_HEIGHT2 = COLLAPSE_BAR_HEIGHT;
|
|
429
427
|
var EDGE_LABEL_FONT_SIZE = SKETCH_VISUALS.edgeLabelFontSize;
|
|
430
428
|
var CURVE_HANDLE_MIN = 24;
|
|
431
429
|
var CURVE_HANDLE_MAX = 90;
|
|
432
|
-
function drawNoteBody(g, w, h, colors, strokeWidth) {
|
|
433
|
-
const f = 14;
|
|
434
|
-
g.append("path").attr(
|
|
435
|
-
"d",
|
|
436
|
-
`M0 2 a2 2 0 0 1 2 -2 h${w - f - 2} l${f} ${f} v${h - f - 2} a2 2 0 0 1 -2 2 h-${w - 4} a2 2 0 0 1 -2 -2 Z`
|
|
437
|
-
).attr("fill", colors.fill).attr("stroke", colors.stroke).attr("stroke-width", strokeWidth);
|
|
438
|
-
g.append("path").attr("d", `M${w - f} 0 v${f} h${f}`).attr("fill", "none").attr("stroke", colors.stroke).attr("stroke-width", 1.2);
|
|
439
|
-
}
|
|
440
|
-
function drawTypeBadge(g, kind, color, bx, by) {
|
|
441
|
-
const b = g.append("g").attr("transform", `translate(${bx},${by})`).attr("fill", "none").attr("stroke", color).attr("stroke-width", 1.3).attr("stroke-linejoin", "round").attr("stroke-linecap", "round");
|
|
442
|
-
switch (kind) {
|
|
443
|
-
case "database":
|
|
444
|
-
b.append("ellipse").attr("cx", 8).attr("cy", 3).attr("rx", 6).attr("ry", 2.4);
|
|
445
|
-
b.append("path").attr("d", "M2 3 v10 a6 2.4 0 0 0 12 0 v-10");
|
|
446
|
-
return;
|
|
447
|
-
case "queue":
|
|
448
|
-
b.append("path").attr("d", "M3 1 h8 a3 6.5 0 0 1 0 13 h-8 Z");
|
|
449
|
-
b.append("ellipse").attr("cx", 3).attr("cy", 7.5).attr("rx", 3).attr("ry", 6.5);
|
|
450
|
-
return;
|
|
451
|
-
case "document":
|
|
452
|
-
b.append("path").attr("d", "M2 1 h9 v11 q-4.5 2 -9 0 q0 0 0 0 Z");
|
|
453
|
-
return;
|
|
454
|
-
case "person":
|
|
455
|
-
b.append("circle").attr("cx", 8).attr("cy", 5).attr("r", 3);
|
|
456
|
-
b.append("path").attr("d", "M2 15 a6 5 0 0 1 12 0");
|
|
457
|
-
return;
|
|
458
|
-
default:
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
430
|
var CARD_HEADER_H = SKETCH_VISUALS.cardHeaderHeight;
|
|
463
431
|
var CARD_LABEL_MAX = SKETCH_VISUALS.nodeLabelFontSize;
|
|
464
432
|
var CARD_LABEL_MIN = SKETCH_VISUALS.nodeLabelFontSizeMin;
|
|
@@ -476,7 +444,6 @@ function renderSketch(container, parsed, layout, palette, isDark, options = {})
|
|
|
476
444
|
const sTitleFontSize = sctx.text(TITLE_FONT_SIZE2);
|
|
477
445
|
const sEdgeLabelFontSize = sctx.text(EDGE_LABEL_FONT_SIZE);
|
|
478
446
|
const sBandLabelFontSize = sctx.text(BAND_LABEL_FONT_SIZE);
|
|
479
|
-
const sNoteFontSize = sctx.text(NOTE_FONT_SIZE);
|
|
480
447
|
const sCardLabelMax = sctx.text(CARD_LABEL_MAX);
|
|
481
448
|
const sCardLabelMin = sctx.text(CARD_LABEL_MIN);
|
|
482
449
|
const sCardMetaFont = sctx.text(CARD_META_FONT);
|
|
@@ -497,8 +464,7 @@ function renderSketch(container, parsed, layout, palette, isDark, options = {})
|
|
|
497
464
|
cardLabelMin: sCardLabelMin,
|
|
498
465
|
cardMetaFont: sCardMetaFont,
|
|
499
466
|
cardTitleMax: sCardTitleMax,
|
|
500
|
-
bandLabelFontSize: sBandLabelFontSize
|
|
501
|
-
noteFontSize: sNoteFontSize
|
|
467
|
+
bandLabelFontSize: sBandLabelFontSize
|
|
502
468
|
};
|
|
503
469
|
const tagGroups = [...parsed.tagGroups];
|
|
504
470
|
const activeName = resolveActiveTagGroup(
|
|
@@ -817,75 +783,20 @@ function drawNode(layer, node, colors, palette, isDark, splitCard, s) {
|
|
|
817
783
|
void isDark;
|
|
818
784
|
const g = layer.append("g").attr("class", node.isCollapsedBox ? "sk-node sk-box-collapsed" : "sk-node").attr("transform", `translate(${node.x},${node.y})`).attr("data-node-id", node.id).attr("data-line-number", node.lineNumber);
|
|
819
785
|
for (const [k, v] of Object.entries(node.metadata)) {
|
|
820
|
-
g.attr(`data-tag-${k}`, v);
|
|
786
|
+
g.attr(`data-tag-${tagAttrKey(k)}`, v);
|
|
821
787
|
}
|
|
822
788
|
if (node.isCollapsedBox) {
|
|
823
789
|
g.attr("data-group-toggle", node.label);
|
|
824
790
|
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
const
|
|
829
|
-
lines.slice(0, 5).forEach((line, i) => {
|
|
830
|
-
g.append("text").attr("x", 10).attr("y", 20 + i * lineHeight).attr("font-size", s.noteFontSize).attr("fill", colors.text).text(line);
|
|
831
|
-
});
|
|
832
|
-
} else {
|
|
833
|
-
const badge = node.shape !== "rectangle";
|
|
834
|
-
const labelInset = badge ? 22 : 0;
|
|
835
|
-
const solidLike = colors.stroke === colors.fill;
|
|
836
|
-
const ruleColor = solidLike ? colors.text : colors.stroke;
|
|
837
|
-
if (!node.isCollapsedBox && (node.description || splitCard)) {
|
|
838
|
-
const fitH = fitWrapped(
|
|
839
|
-
node.label,
|
|
840
|
-
node.w - 24 - labelInset,
|
|
841
|
-
s.cardLabelMax,
|
|
842
|
-
s.cardLabelMin,
|
|
843
|
-
1
|
|
844
|
-
);
|
|
845
|
-
renderNodeCard(g, {
|
|
846
|
-
width: node.w,
|
|
847
|
-
height: node.h,
|
|
848
|
-
rx: s.cardRadius,
|
|
849
|
-
fill: colors.fill,
|
|
850
|
-
stroke: colors.stroke,
|
|
851
|
-
strokeWidth: s.nodeStrokeWidth,
|
|
852
|
-
label: fitH.lines[0] ?? node.label,
|
|
853
|
-
labelColor: colors.text,
|
|
854
|
-
labelFontSize: fitH.fontSize,
|
|
855
|
-
headerHeight: s.cardHeaderH
|
|
856
|
-
});
|
|
857
|
-
g.append("line").attr("x1", 0).attr("y1", s.cardHeaderH).attr("x2", node.w).attr("y2", s.cardHeaderH).attr("stroke", ruleColor).attr("stroke-opacity", 0.3).attr("stroke-width", 1);
|
|
858
|
-
if (node.description) {
|
|
859
|
-
const inset = 12;
|
|
860
|
-
const bodyGap = 8;
|
|
861
|
-
const lh = s.cardMetaFont + 4;
|
|
862
|
-
const avail = node.h - s.cardHeaderH - bodyGap - 8;
|
|
863
|
-
const body = g.append("g").attr("class", "sk-desc").attr("transform", `translate(${inset} ${s.cardHeaderH + bodyGap})`);
|
|
864
|
-
const block = drawMarkdownBlock(body, node.description, {
|
|
865
|
-
width: node.w - inset * 2,
|
|
866
|
-
fontSize: s.cardMetaFont,
|
|
867
|
-
lineHeight: lh,
|
|
868
|
-
color: colors.text,
|
|
869
|
-
// match the header label (contrast-aware in solid)
|
|
870
|
-
linkColor: colors.text,
|
|
871
|
-
maxLines: Math.max(1, Math.floor(avail / lh)),
|
|
872
|
-
noEllipsis: true
|
|
873
|
-
});
|
|
874
|
-
if (block.total > block.shown) {
|
|
875
|
-
g.append("text").attr("class", "sk-desc-more").attr("x", node.w - 8).attr("y", node.h - 5).attr("text-anchor", "end").attr("font-size", 9).attr("fill", palette.textMuted).attr("data-line-number", node.lineNumber).style("cursor", "pointer").text(`+${block.total - block.shown} more in source`);
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
if (badge) {
|
|
879
|
-
drawTypeBadge(g, node.shape, colors.text, 10, (s.cardHeaderH - 16) / 2);
|
|
880
|
-
}
|
|
881
|
-
return;
|
|
882
|
-
}
|
|
883
|
-
const fit = fitWrapped(
|
|
791
|
+
const solidLike = colors.stroke === colors.fill;
|
|
792
|
+
const ruleColor = solidLike ? colors.text : colors.stroke;
|
|
793
|
+
if (!node.isCollapsedBox && (node.description || splitCard)) {
|
|
794
|
+
const fitH = fitWrapped(
|
|
884
795
|
node.label,
|
|
885
|
-
node.w - 24
|
|
886
|
-
s.
|
|
796
|
+
node.w - 24,
|
|
797
|
+
s.cardLabelMax,
|
|
887
798
|
s.cardLabelMin,
|
|
888
|
-
|
|
799
|
+
1
|
|
889
800
|
);
|
|
890
801
|
renderNodeCard(g, {
|
|
891
802
|
width: node.w,
|
|
@@ -894,16 +805,54 @@ function drawNode(layer, node, colors, palette, isDark, splitCard, s) {
|
|
|
894
805
|
fill: colors.fill,
|
|
895
806
|
stroke: colors.stroke,
|
|
896
807
|
strokeWidth: s.nodeStrokeWidth,
|
|
897
|
-
label:
|
|
898
|
-
labelLines: fit.lines,
|
|
808
|
+
label: fitH.lines[0] ?? node.label,
|
|
899
809
|
labelColor: colors.text,
|
|
900
|
-
labelFontSize:
|
|
901
|
-
headerHeight:
|
|
810
|
+
labelFontSize: fitH.fontSize,
|
|
811
|
+
headerHeight: s.cardHeaderH
|
|
902
812
|
});
|
|
903
|
-
|
|
904
|
-
|
|
813
|
+
g.append("line").attr("x1", 0).attr("y1", s.cardHeaderH).attr("x2", node.w).attr("y2", s.cardHeaderH).attr("stroke", ruleColor).attr("stroke-opacity", 0.3).attr("stroke-width", 1);
|
|
814
|
+
if (node.description) {
|
|
815
|
+
const inset = 12;
|
|
816
|
+
const bodyGap = 8;
|
|
817
|
+
const lh = s.cardMetaFont + 4;
|
|
818
|
+
const avail = node.h - s.cardHeaderH - bodyGap - 8;
|
|
819
|
+
const body = g.append("g").attr("class", "sk-desc").attr("transform", `translate(${inset} ${s.cardHeaderH + bodyGap})`);
|
|
820
|
+
const block = drawMarkdownBlock(body, node.description, {
|
|
821
|
+
width: node.w - inset * 2,
|
|
822
|
+
fontSize: s.cardMetaFont,
|
|
823
|
+
lineHeight: lh,
|
|
824
|
+
color: colors.text,
|
|
825
|
+
// match the header label (contrast-aware in solid)
|
|
826
|
+
linkColor: colors.text,
|
|
827
|
+
maxLines: Math.max(1, Math.floor(avail / lh)),
|
|
828
|
+
noEllipsis: true
|
|
829
|
+
});
|
|
830
|
+
if (block.total > block.shown) {
|
|
831
|
+
g.append("text").attr("class", "sk-desc-more").attr("x", node.w - 8).attr("y", node.h - 5).attr("text-anchor", "end").attr("font-size", 9).attr("fill", palette.textMuted).attr("data-line-number", node.lineNumber).style("cursor", "pointer").text(`+${block.total - block.shown} more in source`);
|
|
832
|
+
}
|
|
905
833
|
}
|
|
834
|
+
return;
|
|
906
835
|
}
|
|
836
|
+
const fit = fitWrapped(
|
|
837
|
+
node.label,
|
|
838
|
+
node.w - 24,
|
|
839
|
+
s.cardTitleMax,
|
|
840
|
+
s.cardLabelMin,
|
|
841
|
+
3
|
|
842
|
+
);
|
|
843
|
+
renderNodeCard(g, {
|
|
844
|
+
width: node.w,
|
|
845
|
+
height: node.h,
|
|
846
|
+
rx: s.cardRadius,
|
|
847
|
+
fill: colors.fill,
|
|
848
|
+
stroke: colors.stroke,
|
|
849
|
+
strokeWidth: s.nodeStrokeWidth,
|
|
850
|
+
label: fit.lines.join(" "),
|
|
851
|
+
labelLines: fit.lines,
|
|
852
|
+
labelColor: colors.text,
|
|
853
|
+
labelFontSize: fit.fontSize,
|
|
854
|
+
headerHeight: node.h
|
|
855
|
+
});
|
|
907
856
|
if (node.isCollapsedBox) {
|
|
908
857
|
renderCollapseBar(g, {
|
|
909
858
|
width: node.w,
|
|
@@ -1048,57 +997,70 @@ function hoppedPath(g, hops) {
|
|
|
1048
997
|
const N = 49;
|
|
1049
998
|
const pts = [];
|
|
1050
999
|
for (let s = 0; s <= N; s++) pts.push(cubicAt(g, s / N));
|
|
1051
|
-
const
|
|
1000
|
+
const cum = [0];
|
|
1001
|
+
for (let k2 = 1; k2 <= N; k2++) {
|
|
1002
|
+
const a = pts[k2 - 1];
|
|
1003
|
+
const b = pts[k2];
|
|
1004
|
+
cum.push(cum[k2 - 1] + Math.hypot(b.x - a.x, b.y - a.y));
|
|
1005
|
+
}
|
|
1006
|
+
const total = cum[N];
|
|
1007
|
+
const at = (len) => {
|
|
1008
|
+
let k2 = 1;
|
|
1009
|
+
while (k2 < N && cum[k2] < len) k2++;
|
|
1010
|
+
const a = pts[k2 - 1];
|
|
1011
|
+
const b = pts[k2];
|
|
1012
|
+
const span = cum[k2] - cum[k2 - 1] || 1;
|
|
1013
|
+
const f = Math.max(0, Math.min(1, (len - cum[k2 - 1]) / span));
|
|
1014
|
+
return { x: a.x + f * (b.x - a.x), y: a.y + f * (b.y - a.y) };
|
|
1015
|
+
};
|
|
1016
|
+
const centres = [];
|
|
1052
1017
|
for (const hp of hops) {
|
|
1053
|
-
let bestSeg = -1;
|
|
1054
1018
|
let bestD = Infinity;
|
|
1055
|
-
let
|
|
1056
|
-
for (let
|
|
1057
|
-
const a = pts[
|
|
1058
|
-
const b = pts[
|
|
1019
|
+
let bestLen = 0;
|
|
1020
|
+
for (let k2 = 1; k2 <= N; k2++) {
|
|
1021
|
+
const a = pts[k2 - 1];
|
|
1022
|
+
const b = pts[k2];
|
|
1059
1023
|
const dx = b.x - a.x;
|
|
1060
1024
|
const dy = b.y - a.y;
|
|
1061
1025
|
const len2 = dx * dx + dy * dy || 1;
|
|
1062
1026
|
let f = ((hp.x - a.x) * dx + (hp.y - a.y) * dy) / len2;
|
|
1063
1027
|
f = Math.max(0, Math.min(1, f));
|
|
1064
|
-
const
|
|
1065
|
-
const py = a.y + f * dy;
|
|
1066
|
-
const d2 = Math.hypot(hp.x - px, hp.y - py);
|
|
1028
|
+
const d2 = Math.hypot(hp.x - (a.x + f * dx), hp.y - (a.y + f * dy));
|
|
1067
1029
|
if (d2 < bestD) {
|
|
1068
1030
|
bestD = d2;
|
|
1069
|
-
|
|
1070
|
-
bestPt = { x: px, y: py };
|
|
1031
|
+
bestLen = cum[k2 - 1] + f * (cum[k2] - cum[k2 - 1]);
|
|
1071
1032
|
}
|
|
1072
1033
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1034
|
+
centres.push(bestLen);
|
|
1035
|
+
}
|
|
1036
|
+
const clear = Math.max(2 * HOP_R, 3 * total / N);
|
|
1037
|
+
const kept = [];
|
|
1038
|
+
for (const c of centres.sort((x, y) => x - y)) {
|
|
1039
|
+
if (c < clear || c > total - clear) continue;
|
|
1040
|
+
if (kept.length > 0 && c - kept[kept.length - 1] < 2 * HOP_R) continue;
|
|
1041
|
+
kept.push(c);
|
|
1075
1042
|
}
|
|
1076
|
-
if (
|
|
1043
|
+
if (kept.length === 0) return null;
|
|
1077
1044
|
let d = `M ${pts[0].x} ${pts[0].y}`;
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
const
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
let perp = { x: dir.y, y: -dir.x };
|
|
1086
|
-
if (perp.y > 0) perp = { x: -perp.x, y: -perp.y };
|
|
1087
|
-
const A = { x: hp.x - dir.x * HOP_R, y: hp.y - dir.y * HOP_R };
|
|
1088
|
-
const B = { x: hp.x + dir.x * HOP_R, y: hp.y + dir.y * HOP_R };
|
|
1089
|
-
const k1 = {
|
|
1090
|
-
x: A.x + perp.x * HOP_R * 1.33,
|
|
1091
|
-
y: A.y + perp.y * HOP_R * 1.33
|
|
1092
|
-
};
|
|
1093
|
-
const k2 = {
|
|
1094
|
-
x: B.x + perp.x * HOP_R * 1.33,
|
|
1095
|
-
y: B.y + perp.y * HOP_R * 1.33
|
|
1096
|
-
};
|
|
1097
|
-
d += ` L ${A.x} ${A.y} C ${k1.x} ${k1.y}, ${k2.x} ${k2.y}, ${B.x} ${B.y} L ${b.x} ${b.y}`;
|
|
1098
|
-
} else {
|
|
1099
|
-
d += ` L ${b.x} ${b.y}`;
|
|
1045
|
+
let k = 1;
|
|
1046
|
+
for (const c of kept) {
|
|
1047
|
+
const s0 = c - HOP_R;
|
|
1048
|
+
const s1 = c + HOP_R;
|
|
1049
|
+
while (k <= N && cum[k] < s0) {
|
|
1050
|
+
d += ` L ${pts[k].x} ${pts[k].y}`;
|
|
1051
|
+
k++;
|
|
1100
1052
|
}
|
|
1053
|
+
const A = at(s0);
|
|
1054
|
+
const B = at(s1);
|
|
1055
|
+
const chord = Math.hypot(B.x - A.x, B.y - A.y) || 1;
|
|
1056
|
+
const dir = { x: (B.x - A.x) / chord, y: (B.y - A.y) / chord };
|
|
1057
|
+
let perp = { x: dir.y, y: -dir.x };
|
|
1058
|
+
if (perp.y > 0) perp = { x: -perp.x, y: -perp.y };
|
|
1059
|
+
const lift = chord / 2 * 1.33;
|
|
1060
|
+
d += ` L ${A.x} ${A.y} C ${A.x + perp.x * lift} ${A.y + perp.y * lift}, ${B.x + perp.x * lift} ${B.y + perp.y * lift}, ${B.x} ${B.y}`;
|
|
1061
|
+
while (k <= N && cum[k] <= s1) k++;
|
|
1101
1062
|
}
|
|
1063
|
+
for (; k <= N; k++) d += ` L ${pts[k].x} ${pts[k].y}`;
|
|
1102
1064
|
return d;
|
|
1103
1065
|
}
|
|
1104
1066
|
function pathCrossings(g, obstacles) {
|
|
@@ -1411,6 +1373,7 @@ function sketchEdgeGeometry(layout, offsets) {
|
|
|
1411
1373
|
return out;
|
|
1412
1374
|
};
|
|
1413
1375
|
const hopsFor = layout.edges.map(() => []);
|
|
1376
|
+
const hopsOn = layout.edges.map(() => []);
|
|
1414
1377
|
for (let i = 0; i < polys.length; i++) {
|
|
1415
1378
|
for (let j = i + 1; j < polys.length; j++) {
|
|
1416
1379
|
const a = polys[i];
|
|
@@ -1418,7 +1381,11 @@ function sketchEdgeGeometry(layout, offsets) {
|
|
|
1418
1381
|
if (!a || !b) continue;
|
|
1419
1382
|
if (!ctx[i]?.adjacent.has(j)) {
|
|
1420
1383
|
const pt2 = polyIntersections(a, b)[0];
|
|
1421
|
-
if (pt2)
|
|
1384
|
+
if (pt2) {
|
|
1385
|
+
hopsFor[j].push(pt2);
|
|
1386
|
+
hopsOn[i].push(pt2);
|
|
1387
|
+
hopsOn[j].push(pt2);
|
|
1388
|
+
}
|
|
1422
1389
|
continue;
|
|
1423
1390
|
}
|
|
1424
1391
|
const ei = layout.edges[i];
|
|
@@ -1435,7 +1402,11 @@ function sketchEdgeGeometry(layout, offsets) {
|
|
|
1435
1402
|
(q) => Math.hypot(p.x - q.x, p.y - q.y) > SHARED_END_CLEAR
|
|
1436
1403
|
)
|
|
1437
1404
|
);
|
|
1438
|
-
if (pt)
|
|
1405
|
+
if (pt) {
|
|
1406
|
+
hopsFor[j].push(pt);
|
|
1407
|
+
hopsOn[i].push(pt);
|
|
1408
|
+
hopsOn[j].push(pt);
|
|
1409
|
+
}
|
|
1439
1410
|
}
|
|
1440
1411
|
}
|
|
1441
1412
|
return layout.edges.map((edge, i) => {
|
|
@@ -1448,6 +1419,7 @@ function sketchEdgeGeometry(layout, offsets) {
|
|
|
1448
1419
|
d: g.d,
|
|
1449
1420
|
mid: g.mid,
|
|
1450
1421
|
...dRender && { dRender },
|
|
1422
|
+
...hopsOn[i].length > 0 && { hops: hopsOn[i] },
|
|
1451
1423
|
p0: g.p0,
|
|
1452
1424
|
h0: g.h0,
|
|
1453
1425
|
h1: g.h1,
|
|
@@ -1455,6 +1427,22 @@ function sketchEdgeGeometry(layout, offsets) {
|
|
|
1455
1427
|
};
|
|
1456
1428
|
});
|
|
1457
1429
|
}
|
|
1430
|
+
var HOP_LABEL_CLEAR = HOP_R + 2;
|
|
1431
|
+
function sketchLabelSpot(g, halfW, halfH) {
|
|
1432
|
+
const hops = g.hops ?? [];
|
|
1433
|
+
if (hops.length === 0) return g.mid;
|
|
1434
|
+
const clear = (p) => hops.every(
|
|
1435
|
+
(h) => Math.abs(p.x - h.x) >= halfW + HOP_LABEL_CLEAR || Math.abs(p.y - h.y) >= halfH + HOP_LABEL_CLEAR
|
|
1436
|
+
);
|
|
1437
|
+
if (clear(g.mid)) return g.mid;
|
|
1438
|
+
for (let step = 1; step <= 18; step++) {
|
|
1439
|
+
for (const t of [0.5 - step * 0.02, 0.5 + step * 0.02]) {
|
|
1440
|
+
const p = cubicAt(g, t);
|
|
1441
|
+
if (clear(p)) return p;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
return g.mid;
|
|
1445
|
+
}
|
|
1458
1446
|
function renderSketchForExport(container, parsed, layout, palette, isDark, options = {}) {
|
|
1459
1447
|
renderSketch(container, parsed, layout, palette, isDark, {
|
|
1460
1448
|
...options,
|
|
@@ -1472,5 +1460,6 @@ export {
|
|
|
1472
1460
|
SKETCH_VISUALS,
|
|
1473
1461
|
renderSketch,
|
|
1474
1462
|
sketchEdgeGeometry,
|
|
1463
|
+
sketchLabelSpot,
|
|
1475
1464
|
renderSketchForExport
|
|
1476
1465
|
};
|
|
@@ -3,7 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-26EVL454.js";
|
|
4
4
|
import {
|
|
5
5
|
layoutGraph
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CU2PZLZP.js";
|
|
7
|
+
import {
|
|
8
|
+
appendArrowheadMarkers
|
|
9
|
+
} from "./chunk-XBJJP2HN.js";
|
|
7
10
|
import {
|
|
8
11
|
NOTE_BADGE_RADIUS,
|
|
9
12
|
noteConnectorPoints,
|
|
@@ -11,9 +14,6 @@ import {
|
|
|
11
14
|
renderNoteBox,
|
|
12
15
|
renderNoteConnector
|
|
13
16
|
} from "./chunk-KATED53P.js";
|
|
14
|
-
import {
|
|
15
|
-
appendArrowheadMarkers
|
|
16
|
-
} from "./chunk-XBJJP2HN.js";
|
|
17
17
|
import {
|
|
18
18
|
fitDiagramToCanvas
|
|
19
19
|
} from "./chunk-EPDBWATV.js";
|
|
@@ -40,10 +40,10 @@ import {
|
|
|
40
40
|
} from "./chunk-ICLB27PZ.js";
|
|
41
41
|
import {
|
|
42
42
|
parseFlowchart
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-634LDSN6.js";
|
|
44
44
|
import {
|
|
45
45
|
fillModeFromOptions
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-MPJQMMBZ.js";
|
|
47
47
|
import {
|
|
48
48
|
measureText
|
|
49
49
|
} from "./chunk-KAO7JL4I.js";
|
|
@@ -135,6 +135,11 @@ var chartTypesData = [
|
|
|
135
135
|
description: "GUI-first constrained canvas: uniformly-sized shapes placed freely on a snap grid, arrows between them, meaning through tags \u2014 the markup is generated by the canvas editor",
|
|
136
136
|
beta: true
|
|
137
137
|
},
|
|
138
|
+
{
|
|
139
|
+
id: "whiteboard",
|
|
140
|
+
description: "Free-form whiteboard on an infinite canvas: rectangles, ellipses, databases, queues, free arrows, text, pasted images and freehand ink at pixel positions \u2014 drawn in the canvas; AI writes shapes, arrows and text, never ink",
|
|
141
|
+
beta: true
|
|
142
|
+
},
|
|
138
143
|
{
|
|
139
144
|
id: "goal",
|
|
140
145
|
description: "Single progress-toward-a-target value (now vs target) as a progress bar, thermometer, or gauge \u2014 KPIs, fundraising, quotas, completion"
|
|
@@ -569,6 +574,13 @@ var DIRECTIVES_REGISTRY = [
|
|
|
569
574
|
{ token: "alert", category: "control" },
|
|
570
575
|
{ token: "progress", category: "control" },
|
|
571
576
|
{ token: "mobile", category: "control" },
|
|
577
|
+
// Whiteboard element leaders (§39). `image` is shared with wireframe above
|
|
578
|
+
// and `text` stays an ER modifier; `database` / `queue` are left plain
|
|
579
|
+
// because sketch and sequence use them as values, not line leaders.
|
|
580
|
+
{ token: "rectangle", category: "control" },
|
|
581
|
+
{ token: "ellipse", category: "control" },
|
|
582
|
+
{ token: "arrow", category: "control" },
|
|
583
|
+
{ token: "ink", category: "control" },
|
|
572
584
|
// ── Kanban status keywords (STATUS) ──────────────────────
|
|
573
585
|
{ token: "na", category: "status" },
|
|
574
586
|
{ token: "todo", category: "status" },
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
appendArrowheadMarkers,
|
|
3
|
+
appendReverseArrowheadMarkers
|
|
4
|
+
} from "./chunk-XBJJP2HN.js";
|
|
1
5
|
import {
|
|
2
6
|
NOTE_BADGE_RADIUS,
|
|
3
7
|
noteConnectorPoints,
|
|
@@ -5,10 +9,6 @@ import {
|
|
|
5
9
|
renderNoteBox,
|
|
6
10
|
renderNoteConnector
|
|
7
11
|
} from "./chunk-KATED53P.js";
|
|
8
|
-
import {
|
|
9
|
-
appendArrowheadMarkers,
|
|
10
|
-
appendReverseArrowheadMarkers
|
|
11
|
-
} from "./chunk-XBJJP2HN.js";
|
|
12
12
|
import {
|
|
13
13
|
wrapDescriptionLines
|
|
14
14
|
} from "./chunk-NPWVOFB3.js";
|
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
ScaleContext
|
|
21
21
|
} from "./chunk-24YPR5EH.js";
|
|
22
|
+
import {
|
|
23
|
+
renderIntegratedLegend
|
|
24
|
+
} from "./chunk-QVKTAU7P.js";
|
|
22
25
|
import {
|
|
23
26
|
ARROWHEAD_HEIGHT,
|
|
24
27
|
ARROWHEAD_WIDTH,
|
|
@@ -32,30 +35,27 @@ import {
|
|
|
32
35
|
import {
|
|
33
36
|
layoutInlineHeader
|
|
34
37
|
} from "./chunk-CNUN5GO6.js";
|
|
38
|
+
import {
|
|
39
|
+
getLegendExtent,
|
|
40
|
+
getMaxLegendReservedHeight
|
|
41
|
+
} from "./chunk-NS7L7YKH.js";
|
|
35
42
|
import {
|
|
36
43
|
TITLE_FONT_SIZE,
|
|
37
44
|
TITLE_FONT_WEIGHT,
|
|
38
45
|
TITLE_Y
|
|
39
46
|
} from "./chunk-VLC6WNRD.js";
|
|
40
|
-
import {
|
|
41
|
-
renderIntegratedLegend
|
|
42
|
-
} from "./chunk-7SX4IY6T.js";
|
|
43
|
-
import {
|
|
44
|
-
getLegendExtent,
|
|
45
|
-
getMaxLegendReservedHeight
|
|
46
|
-
} from "./chunk-NS7L7YKH.js";
|
|
47
47
|
import {
|
|
48
48
|
FONT_FAMILY
|
|
49
49
|
} from "./chunk-ICLB27PZ.js";
|
|
50
50
|
import {
|
|
51
51
|
resolveGroupTagColor,
|
|
52
52
|
resolveTagColor
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-QKJ6MQXW.js";
|
|
54
54
|
import {
|
|
55
55
|
fillModeFromOptions,
|
|
56
56
|
legendInlineRequested,
|
|
57
57
|
legendSuppressed
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-MPJQMMBZ.js";
|
|
59
59
|
import {
|
|
60
60
|
CHAR_WIDTH_RATIO,
|
|
61
61
|
measureText,
|
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computeNodeSize
|
|
3
|
-
} from "./chunk-W7QN5BC5.js";
|
|
4
1
|
import {
|
|
5
2
|
clipEndpointsToNodes,
|
|
6
3
|
groupedTierCandidates
|
|
7
4
|
} from "./chunk-EJS3K44P.js";
|
|
5
|
+
import {
|
|
6
|
+
computeNodeSize
|
|
7
|
+
} from "./chunk-Q3N7PI3B.js";
|
|
8
8
|
import {
|
|
9
9
|
EDGE_LABEL_FONT_SIZE,
|
|
10
10
|
NODE_HEIGHT,
|
|
11
11
|
NODE_WIDTH,
|
|
12
12
|
measureEdgeLabel
|
|
13
13
|
} from "./chunk-QT3KDDXK.js";
|
|
14
|
-
import "./chunk-HTNLLT34.js";
|
|
15
|
-
import "./chunk-6EK55ART.js";
|
|
16
|
-
import "./chunk-RJNZHFNG.js";
|
|
17
|
-
import "./chunk-5DH3KYFH.js";
|
|
18
|
-
import "./chunk-NPWVOFB3.js";
|
|
19
|
-
import "./chunk-S7W75MIM.js";
|
|
20
|
-
import "./chunk-Z6DXWULM.js";
|
|
21
|
-
import "./chunk-ICLB27PZ.js";
|
|
22
|
-
import "./chunk-O753JUEZ.js";
|
|
23
|
-
import "./chunk-NOTA6TEI.js";
|
|
24
|
-
import "./chunk-KAO7JL4I.js";
|
|
25
|
-
import "./chunk-BYU54C3S.js";
|
|
26
|
-
import "./chunk-5WRI5ZAA.js";
|
|
27
14
|
|
|
28
15
|
// src/boxes-and-lines/layout-search.ts
|
|
29
16
|
import dagre from "@dagrejs/dagre";
|
|
@@ -816,6 +803,17 @@ var ESCALATE_SEEDS = 18;
|
|
|
816
803
|
var ESCALATE_REFINE = 10;
|
|
817
804
|
var SEARCH_WORK_CAP = 36e3;
|
|
818
805
|
var MIN_SEARCH_CANDIDATES = 6;
|
|
806
|
+
function searchBudget(nodes, edges) {
|
|
807
|
+
const seeds = nodes <= 12 ? 20 : nodes <= 22 ? 40 : nodes <= 35 ? 22 : 10;
|
|
808
|
+
const size = Math.max(1, nodes + edges);
|
|
809
|
+
return {
|
|
810
|
+
seeds,
|
|
811
|
+
maxCandidates: Math.max(
|
|
812
|
+
MIN_SEARCH_CANDIDATES,
|
|
813
|
+
Math.floor(SEARCH_WORK_CAP / Math.pow(size, 1.5))
|
|
814
|
+
)
|
|
815
|
+
};
|
|
816
|
+
}
|
|
819
817
|
function rng2(s) {
|
|
820
818
|
return () => {
|
|
821
819
|
s |= 0;
|
|
@@ -1751,15 +1749,12 @@ async function layoutBoxesAndLinesSearch(parsed, collapseInfo, opts) {
|
|
|
1751
1749
|
};
|
|
1752
1750
|
}
|
|
1753
1751
|
const n = parsed.nodes.length;
|
|
1754
|
-
const
|
|
1752
|
+
const budget = searchBudget(n, parsed.edges.length);
|
|
1753
|
+
const seedCount = opts?.seeds ?? budget.seeds;
|
|
1755
1754
|
const REFINE_K = opts?.refineK ?? 6;
|
|
1756
1755
|
const lambda = opts?.lambda ?? DEFAULT_LAMBDA;
|
|
1757
1756
|
const prev = opts?.previousPositions;
|
|
1758
|
-
const
|
|
1759
|
-
const maxCandidates = Math.max(
|
|
1760
|
-
MIN_SEARCH_CANDIDATES,
|
|
1761
|
-
Math.floor(SEARCH_WORK_CAP / Math.pow(searchSize, 1.5))
|
|
1762
|
-
);
|
|
1757
|
+
const maxCandidates = budget.maxCandidates;
|
|
1763
1758
|
let attempts = 0;
|
|
1764
1759
|
const configs = [];
|
|
1765
1760
|
if (opts?.configs) {
|
|
@@ -1994,16 +1989,18 @@ async function layoutBoxesAndLinesSearch(parsed, collapseInfo, opts) {
|
|
|
1994
1989
|
opts?.onTopConfigs?.(topConfigs);
|
|
1995
1990
|
return clipLayoutEdgesToNodes(best);
|
|
1996
1991
|
}
|
|
1992
|
+
|
|
1997
1993
|
export {
|
|
1998
|
-
|
|
1999
|
-
countEdgeNodePierces,
|
|
2000
|
-
countEdgeOverlaps,
|
|
2001
|
-
countGroupOverlaps,
|
|
1994
|
+
searchBudget,
|
|
2002
1995
|
countSplineCrossings,
|
|
2003
|
-
deroutePierces,
|
|
2004
|
-
detectEdgeNodePierces,
|
|
2005
1996
|
detectEdgeOverlaps,
|
|
1997
|
+
countEdgeOverlaps,
|
|
1998
|
+
detectEdgeNodePierces,
|
|
1999
|
+
countEdgeNodePierces,
|
|
2000
|
+
deroutePierces,
|
|
2001
|
+
countEdgeNearMiss,
|
|
2006
2002
|
detectGroupOverlaps,
|
|
2007
|
-
|
|
2008
|
-
separateGroupBands
|
|
2003
|
+
countGroupOverlaps,
|
|
2004
|
+
separateGroupBands,
|
|
2005
|
+
layoutBoxesAndLinesSearch
|
|
2009
2006
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var SKETCH_DIAGNOSTIC_CODES = {
|
|
3
3
|
BOX_DEPTH: "E_SKETCH_BOX_DEPTH",
|
|
4
4
|
AMBIGUOUS_TARGET: "E_SKETCH_AMBIGUOUS_TARGET",
|
|
5
|
-
|
|
5
|
+
SHAPE_UNSUPPORTED: "E_SKETCH_SHAPE_UNSUPPORTED",
|
|
6
6
|
OVERLAP_RESOLVED: "W_SKETCH_OVERLAP_RESOLVED",
|
|
7
7
|
AT_OUT_OF_RANGE: "W_SKETCH_AT_OUT_OF_RANGE"
|
|
8
8
|
};
|
|
@@ -26,12 +26,12 @@ var SKETCH_DIAGNOSTICS = [
|
|
|
26
26
|
example: "sketch\nCache as c1\nCache as c2\nApp\n -> c1"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
code: SKETCH_DIAGNOSTIC_CODES.
|
|
30
|
-
severity: "
|
|
29
|
+
code: SKETCH_DIAGNOSTIC_CODES.SHAPE_UNSUPPORTED,
|
|
30
|
+
severity: "error",
|
|
31
31
|
chartType: "sketch",
|
|
32
|
-
title: "
|
|
33
|
-
message: (p) => `
|
|
34
|
-
hint: "
|
|
32
|
+
title: "shape: is not supported in sketch",
|
|
33
|
+
message: (p) => `shape: ${String(p.shape ?? "?")} is not supported in sketch \u2014 every box is a plain rectangle; remove the shape: clause`,
|
|
34
|
+
hint: "Delete the shape: clause. Use a tag to say what kind of thing a box is.",
|
|
35
35
|
example: "sketch\nStore shape: database"
|
|
36
36
|
},
|
|
37
37
|
{
|