@diagrammo/dgmo 0.48.2 → 0.50.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/.cursorrules +12 -3
- package/.github/copilot-instructions.md +12 -3
- package/.windsurfrules +12 -3
- package/SKILL.md +12 -3
- package/dist/advanced.d.ts +851 -1
- package/dist/advanced.js +601 -177
- package/dist/auto.css +63 -0
- package/dist/auto.js +220 -110
- package/dist/auto.mjs +45920 -33167
- package/dist/block.css +63 -0
- package/dist/block.d.ts +13 -5
- package/dist/block.js +239 -62
- package/dist/{charts-d3-QOZHKTCT.js → charts-d3-DKUD7MQE.js} +9 -8
- package/dist/{chunk-3MQQNXPD.js → chunk-2C56LEML.js} +3 -3
- package/dist/{chunk-L66GEFB6.js → chunk-2JJ2KNPI.js} +4 -4
- package/dist/{chunk-6SM5NJQH.js → chunk-2QYTMIRR.js} +4 -4
- package/dist/{chunk-RJE5JTVK.js → chunk-3G6TMNVF.js} +7 -7
- package/dist/{chunk-MO5YHHMQ.js → chunk-3LKM6FMW.js} +2 -2
- package/dist/{chunk-76OWZ3BA.js → chunk-3P2DKJCG.js} +2 -2
- package/dist/chunk-3TDRHT4J.js +1043 -0
- package/dist/chunk-3XPUDB7B.js +420 -0
- package/dist/{chunk-2LACINWN.js → chunk-3ZPC476N.js} +7 -7
- package/dist/{chunk-G2H74XJZ.js → chunk-4BMJQFNK.js} +8 -8
- package/dist/{chunk-THXCFRTU.js → chunk-4S723I74.js} +9 -9
- package/dist/{chunk-6NYWYNBI.js → chunk-4XK3FLFB.js} +3 -3
- package/dist/chunk-5JSWBPZZ.js +607 -0
- package/dist/{chunk-WCT3NYCV.js → chunk-5LWQH6QV.js} +1 -1
- package/dist/{chunk-7DTWEFUE.js → chunk-5Z736BSU.js} +8 -8
- package/dist/{chunk-ERLBPDGU.js → chunk-6BFZKBGD.js} +2 -2
- package/dist/{chunk-6HO5ZTXK.js → chunk-6IAA2QQ2.js} +2 -2
- package/dist/{chunk-H6PI3KJT.js → chunk-6IUAK7RZ.js} +2 -2
- package/dist/{chunk-RTLBSQ3G.js → chunk-6M5PJFQG.js} +3 -3
- package/dist/{chunk-Z5CGSFJB.js → chunk-6X4AKWLF.js} +4 -4
- package/dist/{chunk-OJR3MQYV.js → chunk-6ZT4U37Q.js} +291 -52
- package/dist/{chunk-5QXL4NYS.js → chunk-7G2ER4CY.js} +10 -5
- package/dist/chunk-7PQYTZMA.js +681 -0
- package/dist/{chunk-OURHMODR.js → chunk-7RB5Q6MB.js} +11 -11
- package/dist/{chunk-YAA6IID3.js → chunk-7UEMZREK.js} +2 -2
- package/dist/{chunk-AN2MOO5T.js → chunk-A3WQVFBS.js} +3 -3
- package/dist/{chunk-VOKGH627.js → chunk-AHGF2YYA.js} +13 -3
- package/dist/{chunk-CI2G3OEB.js → chunk-ASS5YYIZ.js} +12 -12
- package/dist/{chunk-TYS6CSS5.js → chunk-BCYVE3N5.js} +2 -2
- package/dist/chunk-BDXC7MDK.js +2395 -0
- package/dist/chunk-BTUTZMPT.js +482 -0
- package/dist/{chunk-YGJTDXVR.js → chunk-C4GQDB5L.js} +2 -2
- package/dist/{chunk-Y2ZE3MSG.js → chunk-C63UWAKM.js} +2 -2
- package/dist/{chunk-725LDASD.js → chunk-CLD2OKV7.js} +2 -2
- package/dist/{chunk-WBRZJOEC.js → chunk-CMCR5WBW.js} +3 -3
- package/dist/{chunk-IZMRON6C.js → chunk-CVV36CWI.js} +2 -2
- package/dist/chunk-DMJJ3CEQ.js +254 -0
- package/dist/{chunk-MZSBFAPJ.js → chunk-EJTKV7CY.js} +9 -9
- package/dist/{chunk-FITOLXSX.js → chunk-EOFPYPAU.js} +26 -2
- package/dist/{chunk-X5LCYCL5.js → chunk-ER5SCQWQ.js} +5 -5
- package/dist/{chunk-4OHACBGX.js → chunk-F2L5GCQ4.js} +2 -2
- package/dist/{chunk-FCIIHT24.js → chunk-F5UDBSJY.js} +7 -7
- package/dist/{chunk-3JLKYGBQ.js → chunk-F7BFXWNQ.js} +2 -2
- package/dist/{chunk-FANX6UJR.js → chunk-FAL7NOK3.js} +11 -11
- package/dist/{chunk-BUPDIHML.js → chunk-FB2WHOEQ.js} +4 -4
- package/dist/chunk-FL4IOQ37.js +379 -0
- package/dist/{chunk-LIOHW36Z.js → chunk-GBE54KY6.js} +6 -5
- package/dist/{chunk-RUNNI6VE.js → chunk-GL5UZ6NY.js} +3 -3
- package/dist/{chunk-4GRI7MEB.js → chunk-GPWHQ5FJ.js} +6 -6
- package/dist/chunk-GROQGHCT.js +960 -0
- package/dist/{chunk-SGZYXELT.js → chunk-H73FP42Q.js} +9 -6
- package/dist/{chunk-PBAHEPLQ.js → chunk-HGN652MU.js} +7 -6
- package/dist/{chunk-3SMGIJDD.js → chunk-HHXOONLX.js} +13 -1
- package/dist/{chunk-QOOUC2J5.js → chunk-HQCHYB5F.js} +2 -2
- package/dist/{chunk-AELOBFW5.js → chunk-I4IFRCUB.js} +3 -3
- package/dist/{chunk-GMR5MFHJ.js → chunk-I7F2A35O.js} +2 -2
- package/dist/{chunk-T2OE3YQB.js → chunk-IA3FJYWR.js} +3 -3
- package/dist/chunk-IAEC4KLA.js +492 -0
- package/dist/chunk-IVKC4GID.js +32 -0
- package/dist/{chunk-HSH73DP6.js → chunk-JFYIP7XU.js} +139 -39
- package/dist/{chunk-CKNVO24D.js → chunk-JZNMXEIV.js} +2 -2
- package/dist/chunk-KJXIHOVL.js +940 -0
- package/dist/chunk-L2ZTFHAY.js +331 -0
- package/dist/{chunk-B7JUCQUA.js → chunk-M5RXSRO2.js} +4 -4
- package/dist/{chunk-ULOEATBZ.js → chunk-NFFIKVNO.js} +106 -29
- package/dist/{chunk-PZMETGLY.js → chunk-NISQC5KW.js} +358 -122
- package/dist/chunk-O4VUFXIH.js +574 -0
- package/dist/{chunk-RVMRZAPB.js → chunk-O76UD6VJ.js} +3 -3
- package/dist/{chunk-JM4LEPY3.js → chunk-O7NUCTFU.js} +2 -2
- package/dist/{chunk-JED6ZDEE.js → chunk-O7WP4ZD4.js} +2 -2
- package/dist/{chunk-EVCVDTXE.js → chunk-OHQEMBLI.js} +3 -3
- package/dist/{chunk-ZBWMSD5N.js → chunk-ONA5KPV3.js} +4 -4
- package/dist/{chunk-Y3J7VR52.js → chunk-OTAL43EH.js} +34 -2
- package/dist/{chunk-WCSOJFU3.js → chunk-OTP5KVLO.js} +3 -3
- package/dist/{chunk-RYEGFMUO.js → chunk-PGEGPSCZ.js} +2 -2
- package/dist/{chunk-ZO27FGJS.js → chunk-PH5X4GIP.js} +2 -2
- package/dist/{chunk-ZJEL4H2R.js → chunk-PJUGRJHJ.js} +9 -9
- package/dist/{chunk-ZGR7ULFJ.js → chunk-PLZI6KPM.js} +26 -14
- package/dist/{chunk-3R5POCTZ.js → chunk-PMN3Q7RJ.js} +6 -6
- package/dist/{chunk-YGJZWZTY.js → chunk-PZFVK3IH.js} +2 -2
- package/dist/chunk-Q4V4XQWV.js +158 -0
- package/dist/chunk-QDFNCATJ.js +325 -0
- package/dist/{chunk-QEBUY5NY.js → chunk-QFQ35BTO.js} +4 -4
- package/dist/chunk-QQJUTGQH.js +135 -0
- package/dist/{chunk-PWIHZ6NJ.js → chunk-QUJGFNFN.js} +4 -4
- package/dist/{chunk-J5FIXQRT.js → chunk-R56LASIN.js} +4 -4
- package/dist/{chunk-SRTU6HMQ.js → chunk-RV26LTUU.js} +8 -8
- package/dist/chunk-RV6A2B5S.js +354 -0
- package/dist/{chunk-EB6FPQUP.js → chunk-S5GRONXL.js} +3 -3
- package/dist/{chunk-5MLYVTYM.js → chunk-SCHXJTZL.js} +2 -2
- package/dist/{chunk-T3UBLACL.js → chunk-SCQ5VPUF.js} +19 -5
- package/dist/{chunk-PBHE5UG6.js → chunk-SGFZZAUO.js} +46 -12
- package/dist/{chunk-BUVJFRPY.js → chunk-SU2VBK4L.js} +4 -4
- package/dist/{chunk-SML67VPV.js → chunk-T4BRO3Z6.js} +3 -3
- package/dist/{chunk-NURGB5Z4.js → chunk-TSA237IM.js} +2 -2
- package/dist/chunk-TWCLK2GA.js +273 -0
- package/dist/{chunk-IJZFN3HM.js → chunk-TWQUYVP3.js} +4 -4
- package/dist/{chunk-DKEPS5LH.js → chunk-U2HGPLZS.js} +36 -2
- package/dist/{chunk-B65G5DNL.js → chunk-URSQLCTR.js} +3 -3
- package/dist/{chunk-ILKORZ3H.js → chunk-UUS2GIJZ.js} +7 -7
- package/dist/{chunk-XAKEUMEJ.js → chunk-UXOSVCLJ.js} +4 -4
- package/dist/{chunk-QLCCJEJI.js → chunk-WCUHAQKB.js} +2 -2
- package/dist/{chunk-WVAJFAIA.js → chunk-WWN566I7.js} +257 -101
- package/dist/{chunk-IPWPWM6R.js → chunk-X2NMFTG3.js} +111 -10
- package/dist/{chunk-UWN33VNX.js → chunk-XCLHOZAM.js} +10 -10
- package/dist/{chunk-P235SVAH.js → chunk-XDXNDSKO.js} +2 -2
- package/dist/chunk-XHVV4NVW.js +51 -0
- package/dist/{chunk-33LCUH4H.js → chunk-XMVQ5F4M.js} +4 -4
- package/dist/{chunk-MITI6NOL.js → chunk-YA7D2N2O.js} +11 -11
- package/dist/{chunk-7JEGTRLD.js → chunk-YB3FW24O.js} +3 -3
- package/dist/chunk-YNRDWYZP.js +295 -0
- package/dist/{chunk-44CM72SQ.js → chunk-YZLMKW4T.js} +3 -3
- package/dist/chunk-Z6XJQ6KO.js +452 -0
- package/dist/cli.cjs +179 -133
- package/dist/clock.d.ts +10 -0
- package/dist/clock.js +235 -0
- package/dist/countdown.d.ts +12 -0
- package/dist/countdown.js +450 -0
- package/dist/dgmo-router-QOMFCOOV.js +84 -0
- package/dist/dimensions-P5FSX2QN.js +22 -0
- package/dist/editor.js +43 -2
- package/dist/element.js +220 -110
- package/dist/element.mjs +45920 -33167
- package/dist/{flowchart-parser-ZNSKIBVR.js → flowchart-parser-OE4WHLTF.js} +4 -4
- package/dist/{flowchart-renderer-SNDSII4D.js → flowchart-renderer-GPCSMTOR.js} +8 -8
- package/dist/highlight.d.ts +17 -1
- package/dist/highlight.js +163 -6
- package/dist/index.d.ts +5 -1
- package/dist/index.js +199 -233
- package/dist/{layout-HRBZPFCN.js → layout-34CLNICW.js} +5 -5
- package/dist/layout-46366KBT.js +10 -0
- package/dist/{layout-HWDSRX5E.js → layout-5BG6DFCU.js} +6 -6
- package/dist/layout-6RDJHS6E.js +9 -0
- package/dist/{layout-7QXCNOVS.js → layout-7H4H46CS.js} +3 -3
- package/dist/{layout-46N4JJYK.js → layout-7SKMFYHL.js} +5 -5
- package/dist/{layout-EE6GE46Y.js → layout-DC4TVXER.js} +5 -5
- package/dist/layout-FGQWRYYW.js +14 -0
- package/dist/{layout-S2QBYSK2.js → layout-NXG63LWH.js} +3 -3
- package/dist/{layout-N76NR4ZO.js → layout-PUQCB6AN.js} +7 -7
- package/dist/{layout-HYZPWAK5.js → layout-QNUQLEHU.js} +3 -3
- package/dist/{layout-UM5F4DJB.js → layout-T3OZU5QW.js} +5 -5
- package/dist/layout-TJIWF7EM.js +14 -0
- package/dist/layout-VYELEAW7.js +14 -0
- package/dist/{layout-5RA6QWR6.js → layout-WZHNDT2O.js} +6 -6
- package/dist/{layout-search-OYV77HHS.js → layout-search-QS44PI5R.js} +6 -6
- package/dist/{parser-6BTRLKRZ.js → parser-45DENHFZ.js} +4 -4
- package/dist/{parser-TFZFBVWN.js → parser-4AI5ZN5F.js} +3 -3
- package/dist/{parser-XDVELHRK.js → parser-4P36TUVD.js} +4 -4
- package/dist/{parser-ZSDPZYQP.js → parser-5AURY4A6.js} +4 -4
- package/dist/{parser-N5O4IHUN.js → parser-A2BEFMGK.js} +4 -4
- package/dist/parser-B5FVS7O6.js +11 -0
- package/dist/{parser-NGU3ETO6.js → parser-C2HF2C2E.js} +4 -4
- package/dist/parser-CSFUN3CT.js +14 -0
- package/dist/{parser-TRTHDFPP.js → parser-D3QT6GWN.js} +5 -5
- package/dist/parser-D5637H5H.js +15 -0
- package/dist/{parser-VQP2UJ6W.js → parser-DFFEDKHH.js} +3 -3
- package/dist/parser-DOKMZXVZ.js +13 -0
- package/dist/parser-FMPCVFRK.js +15 -0
- package/dist/{parser-Y6WTBU76.js → parser-HYRTF3DO.js} +3 -3
- package/dist/{parser-I6KXEYFK.js → parser-I2UIJKVQ.js} +4 -4
- package/dist/{parser-O5J4VBII.js → parser-IBWNAPY4.js} +3 -3
- package/dist/{parser-PQ3POX45.js → parser-KUQWRPIT.js} +4 -4
- package/dist/{parser-2MFP2H2E.js → parser-LWKKBNSA.js} +3 -3
- package/dist/{parser-OV7NOBW6.js → parser-O4QFCUW7.js} +5 -5
- package/dist/{parser-IXSZZQHY.js → parser-PGMQDD4G.js} +4 -4
- package/dist/{parser-3STE62GB.js → parser-Q4QKCIWQ.js} +4 -4
- package/dist/parser-QTOB4KFL.js +14 -0
- package/dist/{parser-2EWECDSA.js → parser-QYYM4QVW.js} +4 -4
- package/dist/{parser-4OGOBJJ4.js → parser-RZMQP7MM.js} +4 -4
- package/dist/parser-RZPVAQVX.js +11 -0
- package/dist/parser-SOUJOEYI.js +13 -0
- package/dist/{parser-4FL2CMDG.js → parser-UQE5OWZI.js} +5 -5
- package/dist/{parser-NRAI6O25.js → parser-WAV5JRPT.js} +4 -4
- package/dist/{parser-KNSQSKQO.js → parser-YLKYBRIT.js} +5 -5
- package/dist/{parser-XKRP7QKP.js → parser-YS7TOS2K.js} +3 -3
- package/dist/{parser-AQETEVRW.js → parser-ZSOWUBML.js} +5 -5
- package/dist/{parser-CFZD5IBL.js → parser-ZTBATMLX.js} +4 -4
- package/dist/{renderer-VACVQYML.js → renderer-35HSIDMZ.js} +8 -8
- package/dist/{renderer-5MYBMBYO.js → renderer-4ITCHBT7.js} +5 -5
- package/dist/{renderer-CLJHQPBJ.js → renderer-67NPCBIS.js} +11 -11
- package/dist/{renderer-5NDVNDAZ.js → renderer-6GHYK7DX.js} +9 -9
- package/dist/{renderer-Z7I3W2PP.js → renderer-6RNGHC5Z.js} +8 -8
- package/dist/renderer-72LGR2YF.js +14 -0
- package/dist/{renderer-KQB7UGDS.js → renderer-7RH2SI3B.js} +3 -3
- package/dist/renderer-7SWMIFMM.js +21 -0
- package/dist/renderer-BBCEFILK.js +24 -0
- package/dist/{renderer-JGBKUCZD.js → renderer-BSW7SRIZ.js} +4 -4
- package/dist/{renderer-BYCNMBF7.js → renderer-BY533UWU.js} +11 -11
- package/dist/{renderer-6W5462RB.js → renderer-BZSBPTZJ.js} +9 -9
- package/dist/{renderer-7MVLWWQD.js → renderer-CXUC4KAD.js} +9 -9
- package/dist/{renderer-QIWVHWZO.js → renderer-DAXMXIKD.js} +3 -3
- package/dist/renderer-FZUKFUNZ.js +23 -0
- package/dist/renderer-G2NLGNKF.js +17 -0
- package/dist/renderer-GO3FE3RA.js +24 -0
- package/dist/{renderer-ZGNTUWC4.js → renderer-HPGR6USK.js} +8 -8
- package/dist/{renderer-UV6MI64M.js → renderer-HVCU2C3Z.js} +3 -3
- package/dist/renderer-ICJN2SA2.js +24 -0
- package/dist/{renderer-AWWAF6XD.js → renderer-INEXO7B6.js} +10 -10
- package/dist/{renderer-YY2OSF6E.js → renderer-KDYCFRBX.js} +8 -8
- package/dist/renderer-KY4KQBTF.js +19 -0
- package/dist/{renderer-B2OMQIQG.js → renderer-LBN65V45.js} +13 -13
- package/dist/{renderer-N43WR5GV.js → renderer-MGBWOCXG.js} +10 -10
- package/dist/{renderer-PGX2TKVS.js → renderer-O4JKUGKO.js} +8 -8
- package/dist/{renderer-4JHRUBE6.js → renderer-OOGFODWP.js} +10 -10
- package/dist/{renderer-6EEZHMH4.js → renderer-Q6ZKPLS6.js} +9 -9
- package/dist/{renderer-RPOA5YPZ.js → renderer-SZQ326M5.js} +12 -12
- package/dist/{renderer-ZRNG54CW.js → renderer-TKG6LS4U.js} +11 -11
- package/dist/{renderer-W4M6QLIJ.js → renderer-TQMZGDAX.js} +13 -13
- package/dist/renderer-radial-JELMHQ24.js +21 -0
- package/dist/{resolver-NOAA7ID7.js → resolver-FHBCO3PL.js} +3 -3
- package/dist/{state-parser-Z2V23ATR.js → state-parser-3REXRK3R.js} +4 -4
- package/dist/{state-renderer-B4DQBM6M.js → state-renderer-XYLNRWXR.js} +8 -8
- package/docs/ai-integration.md +12 -3
- package/docs/language-reference.md +429 -24
- package/gallery/fixtures/body.dgmo +17 -0
- package/gallery/fixtures/bracket.dgmo +30 -0
- package/gallery/fixtures/clock.dgmo +8 -0
- package/gallery/fixtures/countdown.dgmo +3 -0
- package/gallery/fixtures/family.dgmo +23 -0
- package/gallery/fixtures/goal.dgmo +4 -0
- package/gallery/fixtures/sketch.dgmo +22 -0
- package/package.json +12 -4
- package/dist/chunk-ODZVHU3R.js +0 -153
- package/dist/dgmo-router-X35VLZLM.js +0 -73
- package/dist/dimensions-J3FHIMJ6.js +0 -22
- package/dist/layout-5T6RH5M6.js +0 -14
- package/dist/layout-G23F7LDH.js +0 -9
- package/dist/layout-OB3RI63S.js +0 -14
- package/dist/parser-JAL2HD4I.js +0 -13
- package/dist/renderer-SMIBCRVB.js +0 -24
- package/dist/renderer-radial-C32GPJQ7.js +0 -21
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
tagAttrKey,
|
|
15
15
|
validateTagGroupNames,
|
|
16
16
|
validateTagValues
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WCUHAQKB.js";
|
|
18
18
|
import {
|
|
19
19
|
normalizeName
|
|
20
20
|
} from "./chunk-NOTA6TEI.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
splitNameAndMeta,
|
|
26
26
|
warnUnknownMetaKeys,
|
|
27
27
|
withTagAliases
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-OTAL43EH.js";
|
|
29
29
|
import {
|
|
30
30
|
emit,
|
|
31
31
|
makeDgmoError,
|
|
@@ -1152,4 +1152,4 @@ export {
|
|
|
1152
1152
|
extractPertSymbols,
|
|
1153
1153
|
looksLikePert
|
|
1154
1154
|
};
|
|
1155
|
-
//# sourceMappingURL=chunk-
|
|
1155
|
+
//# sourceMappingURL=chunk-6M5PJFQG.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
mapLegendConfig,
|
|
4
4
|
mapLegendGroups,
|
|
5
5
|
parsePathRings
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-X2NMFTG3.js";
|
|
7
7
|
import {
|
|
8
8
|
renderIntegratedLegend
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QUJGFNFN.js";
|
|
10
10
|
import {
|
|
11
11
|
TITLE_FONT_SIZE,
|
|
12
12
|
TITLE_FONT_WEIGHT,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-6KFWC4CO.js";
|
|
18
18
|
import {
|
|
19
19
|
measureText
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5LWQH6QV.js";
|
|
21
21
|
import {
|
|
22
22
|
mix
|
|
23
23
|
} from "./chunk-P6T66CCZ.js";
|
|
@@ -644,4 +644,4 @@ export {
|
|
|
644
644
|
renderMap,
|
|
645
645
|
renderMapForExport
|
|
646
646
|
};
|
|
647
|
-
//# sourceMappingURL=chunk-
|
|
647
|
+
//# sourceMappingURL=chunk-6X4AKWLF.js.map
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computeQuadrantPointLabels,
|
|
3
|
+
rectCircleOverlap,
|
|
4
|
+
rectsOverlap
|
|
5
|
+
} from "./chunk-HGN652MU.js";
|
|
1
6
|
import {
|
|
2
7
|
EXPORT_HEIGHT,
|
|
3
8
|
EXPORT_WIDTH,
|
|
@@ -9,7 +14,7 @@ import {
|
|
|
9
14
|
} from "./chunk-U6EQI3U6.js";
|
|
10
15
|
import {
|
|
11
16
|
computeLegendLayout
|
|
12
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7UEMZREK.js";
|
|
13
18
|
import {
|
|
14
19
|
FONT_FAMILY
|
|
15
20
|
} from "./chunk-6KFWC4CO.js";
|
|
@@ -18,17 +23,18 @@ import {
|
|
|
18
23
|
LEGEND_ENTRY_FONT_SIZE,
|
|
19
24
|
LEGEND_HEIGHT,
|
|
20
25
|
LEGEND_PILL_FONT_SIZE
|
|
21
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-HQCHYB5F.js";
|
|
22
27
|
import {
|
|
23
28
|
measureText
|
|
24
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5LWQH6QV.js";
|
|
25
30
|
import {
|
|
26
31
|
getExtendedChartLegendGroups,
|
|
27
32
|
getSimpleChartLegendGroups,
|
|
28
33
|
parseChart,
|
|
29
34
|
parseExtendedChart
|
|
30
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-XDXNDSKO.js";
|
|
31
36
|
import {
|
|
37
|
+
contrastText,
|
|
32
38
|
getSegmentColors,
|
|
33
39
|
getSeriesColors,
|
|
34
40
|
hexToHSL,
|
|
@@ -38,7 +44,7 @@ import {
|
|
|
38
44
|
} from "./chunk-P6T66CCZ.js";
|
|
39
45
|
import {
|
|
40
46
|
tagAttrKey
|
|
41
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-WCUHAQKB.js";
|
|
42
48
|
|
|
43
49
|
// src/utils/legend-svg.ts
|
|
44
50
|
function esc(s) {
|
|
@@ -396,6 +402,7 @@ function seriesValue(pt, s) {
|
|
|
396
402
|
function renderLine(svg, chart, width, height, colors, palette, isDark, textColor, mutedColor, bgColor, hasTitle) {
|
|
397
403
|
const data = chart.data;
|
|
398
404
|
const isArea = chart.fill === true;
|
|
405
|
+
const solid = chart.solidFill === true;
|
|
399
406
|
const seriesNames = chart.seriesNames?.length ? chart.seriesNames : [chart.series ?? ""];
|
|
400
407
|
const seriesCount = Math.max(
|
|
401
408
|
1,
|
|
@@ -490,10 +497,11 @@ function renderLine(svg, chart, width, height, colors, palette, isDark, textColo
|
|
|
490
497
|
if (seriesLine !== void 0) g.attr("data-line-number", seriesLine);
|
|
491
498
|
if (isArea) {
|
|
492
499
|
const areaGen = d3area().x((p) => x(p.label) ?? 0).y0(yy(Math.max(yy.domain()[0], 0))).y1((p) => yy(p.v));
|
|
493
|
-
g.append("path").attr("class", "dgmo-series-area").attr("d", areaGen(pts) ?? "").attr("fill", shapeFill(palette, color, isDark)).attr("stroke", "none");
|
|
500
|
+
g.append("path").attr("class", "dgmo-series-area").attr("d", areaGen(pts) ?? "").attr("fill", solid ? color : shapeFill(palette, color, isDark)).attr("stroke", "none");
|
|
494
501
|
}
|
|
495
502
|
const lineGen = d3line().x((p) => x(p.label) ?? 0).y((p) => yy(p.v));
|
|
496
503
|
g.append("path").attr("class", "dgmo-series-line").attr("d", lineGen(pts) ?? "").attr("fill", "none").attr("stroke", color).attr("stroke-width", 2.5).attr("stroke-linejoin", "round").attr("stroke-linecap", "round");
|
|
504
|
+
g.append("path").attr("class", "dgmo-series-hit").attr("d", lineGen(pts) ?? "").attr("fill", "none").attr("stroke", "transparent").attr("stroke-width", 16).attr("stroke-linejoin", "round").attr("stroke-linecap", "round");
|
|
497
505
|
const labelColor = mix(color, textColor, 60);
|
|
498
506
|
for (const p of pts) {
|
|
499
507
|
g.append("circle").attr("class", "dgmo-pt").attr("data-series-index", s).attr("data-series-name", name).attr("data-color", color).attr("data-x-index", p.xIndex).attr("data-x-label", p.label).attr("data-value", p.v).attr("data-line-number", p.lineNumber).attr("cx", x(p.label) ?? 0).attr("cy", yy(p.v)).attr("r", 3.5).attr("fill", bgColor).attr("stroke", color).attr("stroke-width", 2);
|
|
@@ -547,8 +555,30 @@ function renderPie(svg, chart, width, height, palette, isDark, textColor, topIns
|
|
|
547
555
|
const total = data.reduce((a, d) => a + d.value, 0);
|
|
548
556
|
const cx = width / 2;
|
|
549
557
|
const top = topInset + 12;
|
|
550
|
-
const
|
|
551
|
-
const
|
|
558
|
+
const availH = height - top;
|
|
559
|
+
const cy = top + availH / 2;
|
|
560
|
+
const labels = data.map((d) => {
|
|
561
|
+
const pct = Math.round(d.value / total * 100);
|
|
562
|
+
const nm = chart.noName ? "" : d.label;
|
|
563
|
+
const tail = [
|
|
564
|
+
chart.noValue ? "" : fmtNum(d.value),
|
|
565
|
+
chart.noPercent ? "" : `(${pct}%)`
|
|
566
|
+
].filter(Boolean).join(" ");
|
|
567
|
+
return [nm, tail].filter(Boolean).join(" \u2014 ");
|
|
568
|
+
});
|
|
569
|
+
const maxLabelLen = labels.reduce((m, s) => Math.max(m, s.length), 0);
|
|
570
|
+
const MARGIN2 = 6;
|
|
571
|
+
const halfW = width / 2 - MARGIN2;
|
|
572
|
+
const rH = availH / 2 - availH * 0.06;
|
|
573
|
+
const labelExtent = 1.268 + 0.0428 * maxLabelLen;
|
|
574
|
+
const rLabeled = Math.min(rH, halfW / labelExtent);
|
|
575
|
+
const showLabels = maxLabelLen > 0 && rLabeled >= 45;
|
|
576
|
+
const rPlain = Math.min(rH, halfW * 0.94);
|
|
577
|
+
const radius = Math.max(8, showLabels ? rLabeled : rPlain);
|
|
578
|
+
const labelScale = radius / 180;
|
|
579
|
+
const font = Math.max(7, LABEL_FONT * labelScale);
|
|
580
|
+
const elbowOut = radius * 0.09;
|
|
581
|
+
const elbowRun = radius * 0.155;
|
|
552
582
|
const segColors = getSegmentColors(palette, data.length);
|
|
553
583
|
const strokeFor = (i, override) => override ?? segColors[i % segColors.length];
|
|
554
584
|
const arcs = d3pie().sort(null).value((d) => d.value)(data.map((d) => ({ value: d.value })));
|
|
@@ -566,26 +596,35 @@ function renderPie(svg, chart, width, height, palette, isDark, textColor, topIns
|
|
|
566
596
|
value: `${fmtNum(data[i].value)} (${pct}%)`,
|
|
567
597
|
color: stroke
|
|
568
598
|
});
|
|
599
|
+
if (!showLabels) return;
|
|
569
600
|
const mid = (a.startAngle + a.endAngle) / 2 - Math.PI / 2;
|
|
570
601
|
const rightSide = Math.cos(mid) >= 0;
|
|
571
602
|
const x0 = Math.cos(mid) * radius;
|
|
572
603
|
const y0 = Math.sin(mid) * radius;
|
|
573
|
-
const x1 = Math.cos(mid) * (radius +
|
|
574
|
-
const y1 = Math.sin(mid) * (radius +
|
|
575
|
-
const x2 = x1 + (rightSide ?
|
|
576
|
-
const
|
|
577
|
-
const tail = [
|
|
578
|
-
chart.noValue ? "" : fmtNum(data[i].value),
|
|
579
|
-
chart.noPercent ? "" : `(${pct}%)`
|
|
580
|
-
].filter(Boolean).join(" ");
|
|
581
|
-
const label = [nm, tail].filter(Boolean).join(" \u2014 ");
|
|
604
|
+
const x1 = Math.cos(mid) * (radius + elbowOut);
|
|
605
|
+
const y1 = Math.sin(mid) * (radius + elbowOut);
|
|
606
|
+
const x2 = x1 + (rightSide ? elbowRun : -elbowRun);
|
|
607
|
+
const label = labels[i];
|
|
582
608
|
if (label) {
|
|
583
|
-
|
|
584
|
-
|
|
609
|
+
const tag = {
|
|
610
|
+
line: data[i].lineNumber,
|
|
611
|
+
key: data[i].label,
|
|
612
|
+
name: data[i].label,
|
|
613
|
+
value: `${fmtNum(data[i].value)} (${pct}%)`,
|
|
614
|
+
color: stroke
|
|
615
|
+
};
|
|
616
|
+
tagDatum(
|
|
617
|
+
g.append("polyline").attr("points", `${x0},${y0} ${x1},${y1} ${x2},${y1}`).attr("fill", "none").attr("stroke", stroke).attr("stroke-width", 1),
|
|
618
|
+
tag
|
|
619
|
+
);
|
|
620
|
+
tagDatum(
|
|
621
|
+
g.append("text").attr("x", x2 + (rightSide ? font * 0.3 : -font * 0.3)).attr("y", y1 + font * 0.3).attr("text-anchor", rightSide ? "start" : "end").attr("fill", stroke).attr("font-size", font).attr("font-family", FONT_FAMILY).text(label),
|
|
622
|
+
tag
|
|
623
|
+
);
|
|
585
624
|
}
|
|
586
625
|
});
|
|
587
626
|
if (hasHole && !chart.noCenterTotal) {
|
|
588
|
-
g.append("text").attr("text-anchor", "middle").attr("y", 8).attr("fill", textColor).attr("font-size", 26).attr("font-weight", 700).attr("font-family", FONT_FAMILY).text(fmtNum(total));
|
|
627
|
+
g.append("text").attr("text-anchor", "middle").attr("y", Math.max(4, 8 * labelScale)).attr("fill", textColor).attr("font-size", Math.max(11, 26 * labelScale)).attr("font-weight", 700).attr("font-family", FONT_FAMILY).text(fmtNum(total));
|
|
589
628
|
}
|
|
590
629
|
}
|
|
591
630
|
|
|
@@ -649,13 +688,19 @@ function renderRadar(svg, chart, width, height, colors, palette, isDark, textCol
|
|
|
649
688
|
const vtx = g.append("circle").attr("cx", x).attr("cy", y).attr("r", 4).attr("fill", color);
|
|
650
689
|
tagDatum(vtx, {
|
|
651
690
|
line: d.lineNumber,
|
|
652
|
-
key: multi ? `${name}
|
|
691
|
+
key: multi ? `${name} ${d.label}` : d.label,
|
|
653
692
|
name: multi ? `${name} \u2014 ${d.label}` : d.label,
|
|
654
693
|
value: fmtNum(v),
|
|
655
694
|
color
|
|
656
695
|
});
|
|
657
696
|
if (!chart.noValue) {
|
|
658
|
-
|
|
697
|
+
const [lx, ly] = pt(i, v / maxValue * radius + 14);
|
|
698
|
+
const c = Math.cos(angle(i));
|
|
699
|
+
const s2 = Math.sin(angle(i));
|
|
700
|
+
g.append("text").attr("x", lx).attr("y", ly + (s2 < -0.3 ? 0 : s2 > 0.3 ? 11 : 4)).attr(
|
|
701
|
+
"text-anchor",
|
|
702
|
+
Math.abs(c) < 0.3 ? "middle" : c > 0 ? "start" : "end"
|
|
703
|
+
).attr("fill", multi ? color : textColor).attr("font-size", 12).attr("font-family", FONT_FAMILY).text(fmtNum(v));
|
|
659
704
|
}
|
|
660
705
|
});
|
|
661
706
|
}
|
|
@@ -710,26 +755,72 @@ function renderPolarArea(svg, chart, width, height, palette, isDark, textColor,
|
|
|
710
755
|
}
|
|
711
756
|
|
|
712
757
|
// src/charts-d3/funnel.ts
|
|
713
|
-
|
|
758
|
+
var PAD = 12;
|
|
759
|
+
var MARGIN = 8;
|
|
760
|
+
function renderFunnel(svg, chart, width, height, colors, palette, isDark, topInset) {
|
|
714
761
|
const sorted = [...chart.data].sort((a, b) => b.value - a.value);
|
|
715
762
|
const n = sorted.length;
|
|
716
763
|
if (n === 0) return;
|
|
717
764
|
const solid = chart.solidFill === true;
|
|
718
|
-
const plotLeft = width * 0.2;
|
|
719
|
-
const plotW = width * 0.6;
|
|
720
|
-
const cx = width / 2;
|
|
721
765
|
const top = topInset + 8;
|
|
722
766
|
const bottom = height - 30;
|
|
723
767
|
const H = bottom - top;
|
|
724
768
|
const bandH = H / n;
|
|
725
769
|
const maxValue = sorted[0].value || 1;
|
|
726
|
-
const
|
|
727
|
-
const
|
|
770
|
+
const sideFont = Math.max(11, Math.min(21, width / 52));
|
|
771
|
+
const est = (s, f) => s.length * f * 0.6;
|
|
772
|
+
const pctLabelFor = (i) => {
|
|
773
|
+
const pct = sorted[i].value / sorted[i - 1].value * 100;
|
|
774
|
+
return pct < 1 ? "<1%" : `${Math.round(pct)}%`;
|
|
775
|
+
};
|
|
776
|
+
const rightTextFor = (i, valueInside) => {
|
|
777
|
+
const parts = [];
|
|
778
|
+
if (!chart.noValue && !valueInside) parts.push(fmtNum(sorted[i].value));
|
|
779
|
+
if (!chart.noPercent && i > 0) parts.push(pctLabelFor(i));
|
|
780
|
+
return parts.join(" \xB7 ");
|
|
781
|
+
};
|
|
782
|
+
const nameW = chart.noName ? 0 : Math.max(...sorted.map((d) => est(d.label, sideFont))) + PAD;
|
|
783
|
+
const bandWidthsAt = (plotW2, i) => {
|
|
784
|
+
const minW = plotW2 * 0.14;
|
|
785
|
+
const scale = (v) => Math.max(minW, v / maxValue * plotW2);
|
|
786
|
+
const topW = scale(sorted[i].value);
|
|
787
|
+
const botW = i < n - 1 ? scale(sorted[i + 1].value) : topW * 0.7;
|
|
788
|
+
return { topW, botW };
|
|
789
|
+
};
|
|
790
|
+
const valueSizeAt = (plotW2, i) => {
|
|
791
|
+
const { topW, botW } = bandWidthsAt(plotW2, i);
|
|
792
|
+
const wMid = (topW + botW) / 2;
|
|
793
|
+
const label = fmtNum(sorted[i].value);
|
|
794
|
+
const fitByWidth = (wMid - 16) / (label.length * 0.6);
|
|
795
|
+
return Math.min(bandH * 0.55, fitByWidth);
|
|
796
|
+
};
|
|
797
|
+
const valueInsideAt = (plotW2, i) => !chart.noValue && valueSizeAt(plotW2, i) >= 13;
|
|
798
|
+
const layout = (rightW2) => {
|
|
799
|
+
const spanL = MARGIN + nameW;
|
|
800
|
+
const spanR = width - MARGIN - rightW2;
|
|
801
|
+
const plotW2 = Math.max(width * 0.25, Math.min(width * 0.6, spanR - spanL));
|
|
802
|
+
const lo = spanL + plotW2 / 2;
|
|
803
|
+
const hi = spanR - plotW2 / 2;
|
|
804
|
+
const cx2 = lo > hi ? (spanL + spanR) / 2 : Math.min(Math.max(width / 2, lo), hi);
|
|
805
|
+
return { plotW: plotW2, cx: cx2 };
|
|
806
|
+
};
|
|
807
|
+
const maxRightEst = (plotW2) => Math.max(
|
|
808
|
+
0,
|
|
809
|
+
...sorted.map(
|
|
810
|
+
(_, i) => est(
|
|
811
|
+
rightTextFor(i, plotW2 === null ? true : valueInsideAt(plotW2, i)),
|
|
812
|
+
sideFont
|
|
813
|
+
)
|
|
814
|
+
)
|
|
815
|
+
);
|
|
816
|
+
let rightW = maxRightEst(null) + PAD;
|
|
817
|
+
let { plotW, cx } = layout(rightW);
|
|
818
|
+
rightW = maxRightEst(plotW) + PAD;
|
|
819
|
+
({ plotW, cx } = layout(rightW));
|
|
728
820
|
sorted.forEach((d, i) => {
|
|
729
821
|
const stroke = d.color ?? colors[chart.data.indexOf(d) % colors.length];
|
|
730
822
|
const fill = solid ? stroke : shapeFill(palette, stroke, isDark);
|
|
731
|
-
const topW =
|
|
732
|
-
const botW = i < n - 1 ? scaleW(sorted[i + 1].value) : minW;
|
|
823
|
+
const { topW, botW } = bandWidthsAt(plotW, i);
|
|
733
824
|
const y0 = top + i * bandH;
|
|
734
825
|
const y1 = y0 + bandH;
|
|
735
826
|
const seg = svg.append("polygon").attr(
|
|
@@ -744,13 +835,26 @@ function renderFunnel(svg, chart, width, height, colors, palette, isDark, textCo
|
|
|
744
835
|
color: stroke
|
|
745
836
|
});
|
|
746
837
|
const yMid = (y0 + y1) / 2;
|
|
838
|
+
const halfEdge = (topW + botW) / 4;
|
|
747
839
|
if (!chart.noName) {
|
|
748
|
-
svg.append("
|
|
749
|
-
|
|
840
|
+
svg.append("text").attr("x", cx - halfEdge - PAD).attr("y", yMid + sideFont * 0.35).attr("text-anchor", "end").attr("fill", stroke).attr("font-size", sideFont).attr("font-weight", 600).attr("font-family", FONT_FAMILY).text(d.label);
|
|
841
|
+
}
|
|
842
|
+
const showPct = !chart.noPercent && i > 0;
|
|
843
|
+
const valueInside = valueInsideAt(plotW, i);
|
|
844
|
+
if (valueInside) {
|
|
845
|
+
const valueSize = valueSizeAt(plotW, i);
|
|
846
|
+
const valueFill = solid ? contrastText(fill, palette.textOnFillLight, palette.textOnFillDark) : stroke;
|
|
847
|
+
svg.append("text").attr("x", cx).attr("y", yMid + valueSize * 0.35).attr("text-anchor", "middle").attr("fill", valueFill).attr("font-size", valueSize).attr("font-weight", 700).attr("font-family", FONT_FAMILY).text(fmtNum(d.value));
|
|
750
848
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
svg.append("text").attr("x",
|
|
849
|
+
const showValueRight = !chart.noValue && !valueInside;
|
|
850
|
+
if (showValueRight || showPct) {
|
|
851
|
+
const text = svg.append("text").attr("x", cx + halfEdge + PAD).attr("y", yMid + sideFont * 0.35).attr("text-anchor", "start").attr("font-size", sideFont).attr("font-weight", 600).attr("font-family", FONT_FAMILY);
|
|
852
|
+
if (showValueRight) {
|
|
853
|
+
text.append("tspan").attr("fill", stroke).text(fmtNum(d.value));
|
|
854
|
+
}
|
|
855
|
+
if (showPct) {
|
|
856
|
+
text.append("tspan").attr("fill", stroke).text(showValueRight ? ` \xB7 ${pctLabelFor(i)}` : pctLabelFor(i));
|
|
857
|
+
}
|
|
754
858
|
}
|
|
755
859
|
});
|
|
756
860
|
}
|
|
@@ -801,11 +905,19 @@ function renderHeatmap(svg, chart, width, height, palette, isDark, textColor, bg
|
|
|
801
905
|
const plotH = height - top - bottom;
|
|
802
906
|
const cw = plotW / ncols;
|
|
803
907
|
const ch = plotH / nrows;
|
|
804
|
-
const
|
|
908
|
+
const REF = 100;
|
|
909
|
+
const maxValueW = Math.max(
|
|
910
|
+
1,
|
|
911
|
+
...rows.flatMap((r) => r.values.map((v) => measureText(fmtNum(v), REF)))
|
|
912
|
+
);
|
|
913
|
+
const cellFont = Math.max(
|
|
914
|
+
11,
|
|
915
|
+
Math.min(ch * 0.55, cw * 0.7 * REF / maxValueW)
|
|
916
|
+
);
|
|
805
917
|
const rotate = cols.some((c) => measureText(c, 12) > cw * 0.85);
|
|
806
918
|
cols.forEach((c, ci) => {
|
|
807
919
|
const x = left + ci * cw + cw / 2;
|
|
808
|
-
const t = svg.append("text").attr("fill", textColor).attr("font-size", 12).attr("font-family", FONT_FAMILY).text(c);
|
|
920
|
+
const t = svg.append("text").attr("class", "dgmo-axis-label").attr("data-filter-attr", "data-col-key").attr("data-filter-value", c).attr("fill", textColor).attr("font-size", 12).attr("font-family", FONT_FAMILY).text(c);
|
|
809
921
|
if (rotate) {
|
|
810
922
|
t.attr("transform", `translate(${x},${top - 8}) rotate(-40)`).attr(
|
|
811
923
|
"text-anchor",
|
|
@@ -816,30 +928,97 @@ function renderHeatmap(svg, chart, width, height, palette, isDark, textColor, bg
|
|
|
816
928
|
}
|
|
817
929
|
});
|
|
818
930
|
rows.forEach((row, ri) => {
|
|
819
|
-
svg.append("text").attr("x", left - 10).attr("y", top + ri * ch + ch / 2 + 4).attr("text-anchor", "end").attr("fill", textColor).attr("font-size", 13).attr("font-family", FONT_FAMILY).text(row.label);
|
|
931
|
+
svg.append("text").attr("class", "dgmo-axis-label").attr("data-filter-attr", "data-row-key").attr("data-filter-value", row.label).attr("x", left - 10).attr("y", top + ri * ch + ch / 2 + 4).attr("text-anchor", "end").attr("fill", textColor).attr("font-size", 13).attr("font-family", FONT_FAMILY).text(row.label);
|
|
820
932
|
row.values.forEach((v, ci) => {
|
|
821
933
|
const t = maxValue === minValue ? 0.5 : (v - minValue) / (maxValue - minValue);
|
|
822
934
|
const cell = gradientAt(t);
|
|
823
935
|
const colLabel = cols[ci] ?? `Col ${ci + 1}`;
|
|
824
|
-
const
|
|
936
|
+
const cellKey = `${row.label} \xB7 ${colLabel}`;
|
|
937
|
+
const r = svg.append("rect").attr("x", left + ci * cw).attr("y", top + ri * ch).attr("width", cw).attr("height", ch).attr("fill", cell).attr("stroke", bgColor).attr("stroke-width", 2).attr("data-row-key", row.label).attr("data-col-key", colLabel);
|
|
825
938
|
tagDatum(r, {
|
|
826
939
|
line: row.lineNumber,
|
|
827
|
-
key:
|
|
828
|
-
name:
|
|
940
|
+
key: cellKey,
|
|
941
|
+
name: cellKey,
|
|
829
942
|
value: fmtNum(v),
|
|
830
943
|
color: cell
|
|
831
944
|
});
|
|
832
945
|
if (!chart.noValue) {
|
|
833
|
-
svg.append("text").attr("x", left + ci * cw + cw / 2).attr("y", top + ri * ch + ch / 2 + cellFont / 3).attr("text-anchor", "middle").attr("fill", labelTint(cell)).attr("font-size", cellFont).attr("font-weight", 600).attr("font-family", FONT_FAMILY).text(fmtNum(v));
|
|
946
|
+
const label = svg.append("text").attr("x", left + ci * cw + cw / 2).attr("y", top + ri * ch + ch / 2 + cellFont / 3).attr("text-anchor", "middle").attr("fill", labelTint(cell)).attr("font-size", cellFont).attr("font-weight", 600).attr("font-family", FONT_FAMILY).text(fmtNum(v));
|
|
947
|
+
tagDatum(label, {
|
|
948
|
+
line: row.lineNumber,
|
|
949
|
+
key: cellKey,
|
|
950
|
+
name: cellKey,
|
|
951
|
+
value: fmtNum(v),
|
|
952
|
+
color: cell
|
|
953
|
+
});
|
|
954
|
+
label.attr("data-row-key", row.label).attr("data-col-key", colLabel);
|
|
834
955
|
}
|
|
835
956
|
});
|
|
836
957
|
});
|
|
837
958
|
}
|
|
838
959
|
|
|
839
960
|
// src/charts-d3/scatter.ts
|
|
840
|
-
import { scaleLinear as scaleLinear3 } from "d3-scale";
|
|
961
|
+
import { scaleLinear as scaleLinear3, scaleSqrt } from "d3-scale";
|
|
841
962
|
var FILL_OPACITY = 0.65;
|
|
842
963
|
var DEFAULT_SIZE = 15;
|
|
964
|
+
var LABEL_FONT2 = 11;
|
|
965
|
+
var SIZEVAL_FONT = 20;
|
|
966
|
+
var SIZEVAL_LINE = SIZEVAL_FONT + 4;
|
|
967
|
+
var SIZEVAL_LABEL_FONT = 11;
|
|
968
|
+
var SIZEVAL_LABEL_LINE = SIZEVAL_LABEL_FONT + 4;
|
|
969
|
+
var SIZEVAL_BOLD_FACTOR = 1.08;
|
|
970
|
+
function placeScatterHoverValue(cx, cy, r, labelText, valueText, labelRects, circles, bounds) {
|
|
971
|
+
const w = Math.max(
|
|
972
|
+
measureText(valueText, SIZEVAL_FONT) * SIZEVAL_BOLD_FACTOR,
|
|
973
|
+
measureText(labelText, SIZEVAL_LABEL_FONT)
|
|
974
|
+
) + 6;
|
|
975
|
+
const h = SIZEVAL_LINE + SIZEVAL_LABEL_LINE;
|
|
976
|
+
const gap = 8;
|
|
977
|
+
const toResult = (rect2, anchor, numberFirst) => {
|
|
978
|
+
const numY = numberFirst ? rect2.y + SIZEVAL_LINE - 6 : rect2.y + h - 6;
|
|
979
|
+
const lblY = numberFirst ? rect2.y + h - 4 : rect2.y + SIZEVAL_LABEL_LINE - 4;
|
|
980
|
+
return {
|
|
981
|
+
x: anchor === "middle" ? cx : anchor === "start" ? rect2.x : rect2.x + rect2.w,
|
|
982
|
+
y: numY,
|
|
983
|
+
labelY: lblY,
|
|
984
|
+
anchor,
|
|
985
|
+
rect: rect2
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
const gens = [
|
|
989
|
+
(off) => ({
|
|
990
|
+
rect: { x: cx - w / 2, y: cy + r + off, w, h },
|
|
991
|
+
anchor: "middle",
|
|
992
|
+
numberFirst: true
|
|
993
|
+
}),
|
|
994
|
+
(off) => ({
|
|
995
|
+
rect: { x: cx - w / 2, y: cy - r - off - h, w, h },
|
|
996
|
+
anchor: "middle",
|
|
997
|
+
numberFirst: false
|
|
998
|
+
}),
|
|
999
|
+
(off) => ({
|
|
1000
|
+
rect: { x: cx + r + off, y: cy - h / 2, w, h },
|
|
1001
|
+
anchor: "start",
|
|
1002
|
+
numberFirst: true
|
|
1003
|
+
}),
|
|
1004
|
+
(off) => ({
|
|
1005
|
+
rect: { x: cx - r - off - w, y: cy - h / 2, w, h },
|
|
1006
|
+
anchor: "end",
|
|
1007
|
+
numberFirst: true
|
|
1008
|
+
})
|
|
1009
|
+
];
|
|
1010
|
+
for (let off = gap; off <= gap + 96; off += 12) {
|
|
1011
|
+
for (const gen of gens) {
|
|
1012
|
+
const { rect: rect2, anchor, numberFirst } = gen(off);
|
|
1013
|
+
if (rect2.x < bounds.left || rect2.x + rect2.w > bounds.right || rect2.y < bounds.top || rect2.y + rect2.h > bounds.bottom)
|
|
1014
|
+
continue;
|
|
1015
|
+
if (labelRects.some((lr) => rectsOverlap(rect2, lr))) continue;
|
|
1016
|
+
if (circles.some((c) => rectCircleOverlap(rect2, c))) continue;
|
|
1017
|
+
return toResult(rect2, anchor, numberFirst);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
return toResult({ x: cx - w / 2, y: cy + r + gap, w, h }, "middle", true);
|
|
1021
|
+
}
|
|
843
1022
|
function renderScatter(svg, chart, width, height, colors, palette, isDark, textColor, mutedColor, topInset) {
|
|
844
1023
|
const points = chart.scatterPoints ?? [];
|
|
845
1024
|
if (points.length === 0) return;
|
|
@@ -869,8 +1048,17 @@ function renderScatter(svg, chart, width, height, colors, palette, isDark, textC
|
|
|
869
1048
|
};
|
|
870
1049
|
const plotW = width - m.left - m.right;
|
|
871
1050
|
const plotH = height - m.top - m.bottom;
|
|
872
|
-
const
|
|
873
|
-
|
|
1051
|
+
const sizes = points.map(
|
|
1052
|
+
(p) => hasSize ? p.size ?? DEFAULT_SIZE : DEFAULT_SIZE
|
|
1053
|
+
);
|
|
1054
|
+
const rBudget = Math.max(12, Math.min(plotW, plotH) * 0.14);
|
|
1055
|
+
const rScale = scaleSqrt().domain([0, Math.max(...sizes) || 1]).range([0, rBudget]);
|
|
1056
|
+
const radii = points.map(
|
|
1057
|
+
(_, i) => hasSize ? Math.max(5, rScale(sizes[i])) : DEFAULT_SIZE / 2
|
|
1058
|
+
);
|
|
1059
|
+
const rInset = Math.max(...radii) + 4;
|
|
1060
|
+
const x = scaleLinear3().domain([Math.floor(xMin - xPad), Math.ceil(xMax + xPad)]).range([m.left + rInset, m.left + plotW - rInset]);
|
|
1061
|
+
const y = scaleLinear3().domain([Math.floor(yMin - yPad), Math.ceil(yMax + yPad)]).range([m.top + plotH - rInset, m.top + rInset]);
|
|
874
1062
|
svg.append("rect").attr("class", "dgmo-plot-rect").attr("x", m.left).attr("y", m.top).attr("width", plotW).attr("height", plotH).attr("fill", "transparent").attr("pointer-events", "none");
|
|
875
1063
|
for (const t of y.ticks(6)) {
|
|
876
1064
|
const yy = y(t);
|
|
@@ -882,21 +1070,73 @@ function renderScatter(svg, chart, width, height, colors, palette, isDark, textC
|
|
|
882
1070
|
svg.append("line").attr("x1", xx).attr("x2", xx).attr("y1", m.top).attr("y2", m.top + plotH).attr("stroke", mutedColor).attr("stroke-opacity", 0.25);
|
|
883
1071
|
svg.append("text").attr("class", "dgmo-tick").attr("x", xx).attr("y", m.top + plotH + 18).attr("text-anchor", "middle").attr("fill", textColor).attr("font-size", TICK_FONT).attr("font-family", FONT_FAMILY).text(fmtNum(t));
|
|
884
1072
|
}
|
|
1073
|
+
const placedLabels = chart.noName ? null : computeQuadrantPointLabels(
|
|
1074
|
+
points.map((p, i) => ({
|
|
1075
|
+
label: p.name,
|
|
1076
|
+
cx: x(p.x),
|
|
1077
|
+
cy: y(p.y),
|
|
1078
|
+
r: radii[i]
|
|
1079
|
+
})),
|
|
1080
|
+
{
|
|
1081
|
+
left: m.left,
|
|
1082
|
+
top: m.top,
|
|
1083
|
+
right: m.left + plotW,
|
|
1084
|
+
bottom: m.top + plotH
|
|
1085
|
+
},
|
|
1086
|
+
[],
|
|
1087
|
+
DEFAULT_SIZE / 2,
|
|
1088
|
+
LABEL_FONT2
|
|
1089
|
+
);
|
|
1090
|
+
const plotBounds = {
|
|
1091
|
+
left: m.left,
|
|
1092
|
+
top: m.top,
|
|
1093
|
+
right: m.left + plotW,
|
|
1094
|
+
bottom: m.top + plotH
|
|
1095
|
+
};
|
|
1096
|
+
const ownLabelRect = (i) => {
|
|
1097
|
+
const pl = placedLabels?.[i];
|
|
1098
|
+
if (!pl) return [];
|
|
1099
|
+
const w = measureText(points[i].name, LABEL_FONT2) + 8;
|
|
1100
|
+
const h = LABEL_FONT2 + 4;
|
|
1101
|
+
const lx = pl.anchor === "middle" ? pl.x - w / 2 : pl.anchor === "end" ? pl.x - w : pl.x;
|
|
1102
|
+
return [{ x: lx, y: pl.y - h / 2, w, h }];
|
|
1103
|
+
};
|
|
885
1104
|
points.forEach((p, i) => {
|
|
886
1105
|
const stroke = p.color ?? (p.category ? catColor(p.category, catIndex.get(p.category) ?? 0) : colors[i % colors.length]);
|
|
887
|
-
const r =
|
|
1106
|
+
const r = radii[i];
|
|
888
1107
|
const dot = svg.append("circle").attr("cx", x(p.x)).attr("cy", y(p.y)).attr("r", r).attr("fill", solid ? stroke : shapeFill(palette, stroke, isDark)).attr("fill-opacity", FILL_OPACITY).attr("stroke", stroke).attr("stroke-width", 2);
|
|
889
1108
|
tagDatum(dot, {
|
|
890
1109
|
line: p.lineNumber,
|
|
891
1110
|
key: p.name,
|
|
892
1111
|
name: p.category ? `${p.name} \xB7 ${p.category}` : p.name,
|
|
893
|
-
value: `(${fmtNum(p.x)}, ${fmtNum(p.y)})`,
|
|
1112
|
+
value: p.size !== void 0 ? `(${fmtNum(p.x)}, ${fmtNum(p.y)}) \xB7 ${chart.sizelabel ?? "size"}: ${fmtNum(p.size)}` : `(${fmtNum(p.x)}, ${fmtNum(p.y)})`,
|
|
894
1113
|
color: stroke
|
|
895
1114
|
});
|
|
896
1115
|
dot.attr("data-axval-x", fmtNum(p.x)).attr("data-axval-y", fmtNum(p.y));
|
|
897
|
-
if (p.
|
|
898
|
-
|
|
899
|
-
|
|
1116
|
+
if (p.size !== void 0) {
|
|
1117
|
+
const sizeLabel = chart.sizelabel ?? "size";
|
|
1118
|
+
const pos = placeScatterHoverValue(
|
|
1119
|
+
x(p.x),
|
|
1120
|
+
y(p.y),
|
|
1121
|
+
r,
|
|
1122
|
+
sizeLabel,
|
|
1123
|
+
fmtNum(p.size),
|
|
1124
|
+
ownLabelRect(i),
|
|
1125
|
+
[],
|
|
1126
|
+
plotBounds
|
|
1127
|
+
);
|
|
1128
|
+
dot.attr("data-size", fmtNum(p.size)).attr("data-size-label", sizeLabel).attr("data-sizeval-x", pos.x).attr("data-sizeval-y", pos.y).attr("data-sizeval-ly", pos.labelY).attr("data-sizeval-anchor", pos.anchor);
|
|
1129
|
+
}
|
|
1130
|
+
if (p.category) {
|
|
1131
|
+
dot.attr("data-category", p.category);
|
|
1132
|
+
dot.attr("data-series-name", p.category);
|
|
1133
|
+
}
|
|
1134
|
+
if (placedLabels) {
|
|
1135
|
+
const placed = placedLabels[i];
|
|
1136
|
+
if (placed.connectorLine) {
|
|
1137
|
+
svg.append("line").attr("class", "dgmo-ptlabel").attr("data-line-number", p.lineNumber).attr("x1", placed.connectorLine.x1).attr("y1", placed.connectorLine.y1).attr("x2", placed.connectorLine.x2).attr("y2", placed.connectorLine.y2).attr("stroke", stroke).attr("stroke-width", 1).attr("opacity", 0.5);
|
|
1138
|
+
}
|
|
1139
|
+
svg.append("text").attr("class", "dgmo-ptlabel").attr("data-line-number", p.lineNumber).attr("x", placed.x).attr("y", placed.y).attr("text-anchor", placed.anchor).attr("dominant-baseline", "central").attr("fill", stroke).attr("font-size", LABEL_FONT2).attr("font-family", FONT_FAMILY).text(p.name);
|
|
900
1140
|
}
|
|
901
1141
|
});
|
|
902
1142
|
drawXAxisTitle(
|
|
@@ -1355,7 +1595,6 @@ function renderInto(s, content, palette, isDark, width, height, textColor, muted
|
|
|
1355
1595
|
seriesColors,
|
|
1356
1596
|
palette,
|
|
1357
1597
|
isDark,
|
|
1358
|
-
textColor,
|
|
1359
1598
|
hasTitle ? 52 : 24
|
|
1360
1599
|
);
|
|
1361
1600
|
return true;
|
|
@@ -1455,4 +1694,4 @@ export {
|
|
|
1455
1694
|
supportsD3DataChart,
|
|
1456
1695
|
renderDataChartD3
|
|
1457
1696
|
};
|
|
1458
|
-
//# sourceMappingURL=chunk-
|
|
1697
|
+
//# sourceMappingURL=chunk-6ZT4U37Q.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
extractDatePrefix,
|
|
3
3
|
parseTimelineDate
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-I7F2A35O.js";
|
|
5
5
|
import {
|
|
6
6
|
AUTO_TAG_COLOR_SENTINEL,
|
|
7
7
|
finalizeAutoTagColors,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
tagAttrKey,
|
|
12
12
|
validateTagGroupNames,
|
|
13
13
|
validateTagValues
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-WCUHAQKB.js";
|
|
15
15
|
import {
|
|
16
16
|
EVENT_LINE_REGISTRY,
|
|
17
17
|
extractColor,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
tryParseSharedOption,
|
|
22
22
|
warnUnknownMetaKeys,
|
|
23
23
|
withTagAliases
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-OTAL43EH.js";
|
|
25
25
|
import {
|
|
26
26
|
emit,
|
|
27
27
|
formatDgmoError,
|
|
@@ -134,7 +134,8 @@ function parseEventLine(content, palette) {
|
|
|
134
134
|
side: "alternate",
|
|
135
135
|
noTitle: false,
|
|
136
136
|
noBox: false,
|
|
137
|
-
noLegend: false
|
|
137
|
+
noLegend: false,
|
|
138
|
+
solidFill: false
|
|
138
139
|
};
|
|
139
140
|
const result = {
|
|
140
141
|
type: "event-line",
|
|
@@ -293,6 +294,10 @@ function parseEventLine(content, palette) {
|
|
|
293
294
|
options.noLegend = true;
|
|
294
295
|
continue;
|
|
295
296
|
}
|
|
297
|
+
if (trimmed.toLowerCase() === "solid-fill") {
|
|
298
|
+
options.solidFill = true;
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
296
301
|
const dirMatch = trimmed.match(DIRECTION_RE);
|
|
297
302
|
if (dirMatch) {
|
|
298
303
|
const dir = dirMatch[1].toUpperCase();
|
|
@@ -550,4 +555,4 @@ export {
|
|
|
550
555
|
EVENT_LINE_DIAGNOSTICS,
|
|
551
556
|
parseEventLine
|
|
552
557
|
};
|
|
553
|
-
//# sourceMappingURL=chunk-
|
|
558
|
+
//# sourceMappingURL=chunk-7G2ER4CY.js.map
|