boardplot 0.0.0-stage → 0.53.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/CHANGELOG.md +49 -0
- package/LICENSE +201 -0
- package/NOTICE.md +180 -0
- package/README.md +208 -2
- package/THIRD_PARTY_NOTICES.md +1110 -0
- package/dist/DiagnosticDetails-UNYNYCAH.js +69 -0
- package/dist/ReaderBox-VOJSJ66R.js +137 -0
- package/dist/annotateEngine-DLMFJZ67.js +30 -0
- package/dist/build-identity.json +6 -0
- package/dist/chunk-24BHMKDD.js +83 -0
- package/dist/chunk-263SZKIL.js +8 -0
- package/dist/chunk-27QADBDV.js +211 -0
- package/dist/chunk-2CVH5E57.js +128 -0
- package/dist/chunk-2DOR5SS6.js +446 -0
- package/dist/chunk-2EQE4E3I.js +22 -0
- package/dist/chunk-2FNNAPCI.js +24 -0
- package/dist/chunk-2L2Q53EP.js +251 -0
- package/dist/chunk-2LMCD3ZR.js +6 -0
- package/dist/chunk-2ND7ZITT.js +3069 -0
- package/dist/chunk-2QT5ZUHO.js +2937 -0
- package/dist/chunk-2RSG7JYI.js +24 -0
- package/dist/chunk-2V6CLH33.js +1392 -0
- package/dist/chunk-2VWJ5BGO.js +566 -0
- package/dist/chunk-2WNYRWHG.js +51 -0
- package/dist/chunk-323YZWYJ.js +548 -0
- package/dist/chunk-33PB4V6K.js +382 -0
- package/dist/chunk-33PLBIMA.js +176 -0
- package/dist/chunk-3A2IEBCN.js +195 -0
- package/dist/chunk-3D3D3D23.js +25 -0
- package/dist/chunk-3EZRM4YM.js +92 -0
- package/dist/chunk-3H2W76TB.js +2353 -0
- package/dist/chunk-3JEQGGVD.js +19 -0
- package/dist/chunk-3QWZAEW5.js +26 -0
- package/dist/chunk-3SIRPKMP.js +12 -0
- package/dist/chunk-3SQCCESO.js +1592 -0
- package/dist/chunk-3XHJHQWU.js +42 -0
- package/dist/chunk-4G2O2ZPJ.js +83 -0
- package/dist/chunk-4JLBVIGW.js +24 -0
- package/dist/chunk-4RRNJLCM.js +746 -0
- package/dist/chunk-4UVW5WU6.js +76 -0
- package/dist/chunk-4X66BTP5.js +344 -0
- package/dist/chunk-53OYF4ZT.js +687 -0
- package/dist/chunk-57ZGVAU3.js +179 -0
- package/dist/chunk-5HECRVXJ.js +62 -0
- package/dist/chunk-5LGSRWFC.js +63 -0
- package/dist/chunk-5LYXD6ME.js +1112 -0
- package/dist/chunk-66RFKRGO.js +28 -0
- package/dist/chunk-6KWIQ5KF.js +18 -0
- package/dist/chunk-6OCR6ITN.js +72 -0
- package/dist/chunk-6RBTTCQD.js +802 -0
- package/dist/chunk-6Y7EXYLR.js +563 -0
- package/dist/chunk-7CTKTIPF.js +613 -0
- package/dist/chunk-7EVIIADO.js +185 -0
- package/dist/chunk-7X2ZYVAX.js +89 -0
- package/dist/chunk-7X65ZQN4.js +38 -0
- package/dist/chunk-A4QZXLXF.js +7 -0
- package/dist/chunk-A6CQPJWR.js +49 -0
- package/dist/chunk-A7IEVBYI.js +35 -0
- package/dist/chunk-ACXX2JNL.js +6 -0
- package/dist/chunk-ADKCLH3Z.js +98 -0
- package/dist/chunk-ADWSGPH5.js +23 -0
- package/dist/chunk-AG2CJ4JY.js +203 -0
- package/dist/chunk-AHQ4L3BE.js +30 -0
- package/dist/chunk-AOQ6VF5H.js +6 -0
- package/dist/chunk-AQROQDLR.js +3303 -0
- package/dist/chunk-AWTG3RFF.js +85 -0
- package/dist/chunk-B54RN2FD.js +692 -0
- package/dist/chunk-B67K6OWJ.js +48 -0
- package/dist/chunk-B6GFKYBZ.js +40 -0
- package/dist/chunk-BBL3R5YZ.js +186 -0
- package/dist/chunk-BBRBCMNR.js +28 -0
- package/dist/chunk-BIDIGDGH.js +6 -0
- package/dist/chunk-BLFWUMTD.js +12 -0
- package/dist/chunk-BM6SFFWF.js +6 -0
- package/dist/chunk-BMRD6MAH.js +24 -0
- package/dist/chunk-BPKXEMRE.js +197 -0
- package/dist/chunk-BUPLB3EX.js +129 -0
- package/dist/chunk-BW5VLBSZ.js +15 -0
- package/dist/chunk-BWGRWGVA.js +295 -0
- package/dist/chunk-BWLOXQDV.js +131 -0
- package/dist/chunk-BWTX7LUG.js +203 -0
- package/dist/chunk-C54QLNE4.js +69 -0
- package/dist/chunk-CAQ5P4VN.js +296 -0
- package/dist/chunk-CCCEBIUZ.js +296 -0
- package/dist/chunk-CDZHNLO6.js +42 -0
- package/dist/chunk-CJGSJKPO.js +25 -0
- package/dist/chunk-CN7JRHST.js +25 -0
- package/dist/chunk-CNX7EGSU.js +266 -0
- package/dist/chunk-COYOTQC2.js +75 -0
- package/dist/chunk-CRNMNZJD.js +1161 -0
- package/dist/chunk-CUVUDK4O.js +68 -0
- package/dist/chunk-CWDHCSL2.js +2919 -0
- package/dist/chunk-CYOJZ3GQ.js +631 -0
- package/dist/chunk-D4SOADBD.js +19 -0
- package/dist/chunk-D7SHZDA3.js +1808 -0
- package/dist/chunk-DAVHGK27.js +657 -0
- package/dist/chunk-DCCJRLAJ.js +422 -0
- package/dist/chunk-DCTCUZ5L.js +51 -0
- package/dist/chunk-DDCB7ZA5.js +2511 -0
- package/dist/chunk-DDI2W4TR.js +149 -0
- package/dist/chunk-DIHUGBZO.js +61 -0
- package/dist/chunk-DJHIQWSG.js +25 -0
- package/dist/chunk-DO5OZJAO.js +302 -0
- package/dist/chunk-DOFYKPTC.js +18 -0
- package/dist/chunk-DRTA6JG5.js +160 -0
- package/dist/chunk-DRW6KGBK.js +1062 -0
- package/dist/chunk-DU4A5AOY.js +1156 -0
- package/dist/chunk-DYS7EIXY.js +294 -0
- package/dist/chunk-E4IQ6M4S.js +24 -0
- package/dist/chunk-EFUWFB64.js +24 -0
- package/dist/chunk-EHBB2Z4D.js +290 -0
- package/dist/chunk-EHVESNLV.js +30 -0
- package/dist/chunk-EJPVVGD7.js +67 -0
- package/dist/chunk-EKQK5D6G.js +14 -0
- package/dist/chunk-EUADDXAV.js +30 -0
- package/dist/chunk-F6CNPC4L.js +47 -0
- package/dist/chunk-FBAYZSFC.js +2806 -0
- package/dist/chunk-FBB4BWKN.js +30 -0
- package/dist/chunk-FF23FYQD.js +1269 -0
- package/dist/chunk-FG6EDGMI.js +53 -0
- package/dist/chunk-FHA3KMFC.js +43 -0
- package/dist/chunk-FIANWJXX.js +19 -0
- package/dist/chunk-FIWNDOMO.js +6 -0
- package/dist/chunk-FV3VF36K.js +2721 -0
- package/dist/chunk-G5FMTRG5.js +37 -0
- package/dist/chunk-GCBOHVDZ.js +229 -0
- package/dist/chunk-GDOW2KNP.js +19 -0
- package/dist/chunk-GTG3IGLF.js +2674 -0
- package/dist/chunk-GZTNTHSW.js +21 -0
- package/dist/chunk-H4H4O62O.js +46 -0
- package/dist/chunk-H5G7T35P.js +24 -0
- package/dist/chunk-H63XQ3OO.js +942 -0
- package/dist/chunk-H67RTX46.js +43 -0
- package/dist/chunk-HA4IPWMM.js +841 -0
- package/dist/chunk-HKYTOJLV.js +33 -0
- package/dist/chunk-HOAH5XBR.js +542 -0
- package/dist/chunk-HTYFQHRC.js +24 -0
- package/dist/chunk-HYY5V2KL.js +19 -0
- package/dist/chunk-HZI56ASJ.js +79 -0
- package/dist/chunk-I6VAWNNU.js +24 -0
- package/dist/chunk-IBXXZVG7.js +80 -0
- package/dist/chunk-IDDA5INB.js +60 -0
- package/dist/chunk-IK4BHOPZ.js +33 -0
- package/dist/chunk-IL5T7I2A.js +27 -0
- package/dist/chunk-ILSXT6KT.js +24 -0
- package/dist/chunk-IV2UXZXX.js +16 -0
- package/dist/chunk-IYEFEBRN.js +41 -0
- package/dist/chunk-IYMI7YI4.js +829 -0
- package/dist/chunk-J6I2YFJH.js +58 -0
- package/dist/chunk-JFBEAUJ6.js +24 -0
- package/dist/chunk-JR7Y5ONB.js +27 -0
- package/dist/chunk-JSEYUJUQ.js +836 -0
- package/dist/chunk-JYBT2JNY.js +61 -0
- package/dist/chunk-K3HSQPSM.js +24 -0
- package/dist/chunk-KAXJFL7N.js +43 -0
- package/dist/chunk-KDMKHR5A.js +32 -0
- package/dist/chunk-KKWZWP67.js +24 -0
- package/dist/chunk-KOJ5QETJ.js +8 -0
- package/dist/chunk-KPKXJYQH.js +19 -0
- package/dist/chunk-KSJVENRU.js +113 -0
- package/dist/chunk-KZJOV4QW.js +33 -0
- package/dist/chunk-KZS46KDY.js +58 -0
- package/dist/chunk-L3JWM7FR.js +50 -0
- package/dist/chunk-L4S6UFTL.js +26 -0
- package/dist/chunk-L6DJ4ZY5.js +2008 -0
- package/dist/chunk-L7RHB734.js +23 -0
- package/dist/chunk-LCWJS34U.js +38 -0
- package/dist/chunk-LFTAMH7I.js +24 -0
- package/dist/chunk-LFX7W4B7.js +113 -0
- package/dist/chunk-LINZPU5D.js +8 -0
- package/dist/chunk-LIWLBLCT.js +83 -0
- package/dist/chunk-LNKY5Z2X.js +23 -0
- package/dist/chunk-LS7HVBI7.js +24 -0
- package/dist/chunk-M4EUXOLU.js +170 -0
- package/dist/chunk-M4SPKUZE.js +7 -0
- package/dist/chunk-M4YLED7M.js +17 -0
- package/dist/chunk-MBKZYJRC.js +1424 -0
- package/dist/chunk-MCYM3RNF.js +227 -0
- package/dist/chunk-MF6IVSBJ.js +48 -0
- package/dist/chunk-MIAPBQCA.js +24 -0
- package/dist/chunk-MJZHFH5R.js +1075 -0
- package/dist/chunk-MQFCG4KS.js +1467 -0
- package/dist/chunk-MVV6RQMG.js +128 -0
- package/dist/chunk-MYMT5KJL.js +1182 -0
- package/dist/chunk-MZL6LGKO.js +587 -0
- package/dist/chunk-N23YFPPI.js +47 -0
- package/dist/chunk-N3G2FYDL.js +300 -0
- package/dist/chunk-N3TPMXS3.js +161 -0
- package/dist/chunk-N73IBH55.js +58 -0
- package/dist/chunk-N7J7CZS6.js +43 -0
- package/dist/chunk-NCB3YLHF.js +28 -0
- package/dist/chunk-NHQGRKEA.js +63 -0
- package/dist/chunk-NKIYLFXZ.js +2774 -0
- package/dist/chunk-NOSDEJ3K.js +25934 -0
- package/dist/chunk-NQDVMUHX.js +433 -0
- package/dist/chunk-NSSNYY6Y.js +58 -0
- package/dist/chunk-NY5NUFDZ.js +117 -0
- package/dist/chunk-O3S2KNIW.js +25 -0
- package/dist/chunk-O3VN6BTL.js +24 -0
- package/dist/chunk-ONZLC47B.js +88 -0
- package/dist/chunk-OQEBOVUO.js +30 -0
- package/dist/chunk-OUEGGWH7.js +24 -0
- package/dist/chunk-OURX73UJ.js +728 -0
- package/dist/chunk-P25VEGGX.js +24 -0
- package/dist/chunk-P26Z62UV.js +24 -0
- package/dist/chunk-P5RNWMZC.js +2984 -0
- package/dist/chunk-P6KZIZDV.js +987 -0
- package/dist/chunk-PEUSKIFV.js +168 -0
- package/dist/chunk-PFVTYFSL.js +24 -0
- package/dist/chunk-PWROWDZS.js +137 -0
- package/dist/chunk-Q3CV2JJ2.js +3650 -0
- package/dist/chunk-QBR6IKIX.js +50 -0
- package/dist/chunk-QGCEHR6S.js +13 -0
- package/dist/chunk-QHRE2M6V.js +26 -0
- package/dist/chunk-QKL7IY42.js +38 -0
- package/dist/chunk-QO6HEXIZ.js +272 -0
- package/dist/chunk-QOIVXZUF.js +24 -0
- package/dist/chunk-QPWRHDLZ.js +17 -0
- package/dist/chunk-QSXK6PJL.js +19 -0
- package/dist/chunk-QTZVVZ2A.js +54 -0
- package/dist/chunk-QWXWVPNE.js +18 -0
- package/dist/chunk-QY5ZKUWY.js +383 -0
- package/dist/chunk-QZAT46PP.js +95 -0
- package/dist/chunk-RA66JA3D.js +24 -0
- package/dist/chunk-REOPXBUR.js +600 -0
- package/dist/chunk-RGZGLKFB.js +648 -0
- package/dist/chunk-RL3NUWMY.js +3378 -0
- package/dist/chunk-RNOJSEES.js +16 -0
- package/dist/chunk-ROXO4R3J.js +16 -0
- package/dist/chunk-RPIW5T55.js +40 -0
- package/dist/chunk-RQ5DNYLG.js +10 -0
- package/dist/chunk-RZNYW7UP.js +133 -0
- package/dist/chunk-S32YYDIB.js +420 -0
- package/dist/chunk-S4QSJAGY.js +44 -0
- package/dist/chunk-S6UX7KB6.js +335 -0
- package/dist/chunk-SDSONLMZ.js +2546 -0
- package/dist/chunk-SGD3ZHID.js +250 -0
- package/dist/chunk-SKRSCTT5.js +28 -0
- package/dist/chunk-SMCDXUIO.js +24 -0
- package/dist/chunk-SPTPFY4S.js +528 -0
- package/dist/chunk-SREWFAAJ.js +90 -0
- package/dist/chunk-SS42FJVN.js +3875 -0
- package/dist/chunk-SVZDXFPX.js +891 -0
- package/dist/chunk-SZPTTNW7.js +16 -0
- package/dist/chunk-T3IGJARD.js +22 -0
- package/dist/chunk-TA3TFKYZ.js +86 -0
- package/dist/chunk-TBGUEF3M.js +939 -0
- package/dist/chunk-TGK6KUGN.js +331 -0
- package/dist/chunk-TJSND556.js +1783 -0
- package/dist/chunk-TKOJZQAJ.js +24 -0
- package/dist/chunk-TM4OC53S.js +97 -0
- package/dist/chunk-TNEHPP3H.js +18 -0
- package/dist/chunk-TWOREVKJ.js +1760 -0
- package/dist/chunk-TXS3U77A.js +60 -0
- package/dist/chunk-UB6ODJHO.js +134 -0
- package/dist/chunk-UBZXQIDR.js +24 -0
- package/dist/chunk-ULTSSIOU.js +38 -0
- package/dist/chunk-UMDEWWXT.js +33 -0
- package/dist/chunk-V6O6KVOA.js +347 -0
- package/dist/chunk-VABRPZVC.js +43 -0
- package/dist/chunk-VDAKTZQP.js +18 -0
- package/dist/chunk-VDAZPGR2.js +79 -0
- package/dist/chunk-VERLFNWR.js +25 -0
- package/dist/chunk-VH2UUU7K.js +24 -0
- package/dist/chunk-VJ3FCGQF.js +12 -0
- package/dist/chunk-VK5ZDV67.js +47 -0
- package/dist/chunk-VKQNDOAI.js +40 -0
- package/dist/chunk-VTEV3WVF.js +690 -0
- package/dist/chunk-VXZFQKBJ.js +21 -0
- package/dist/chunk-WI5ITCOH.js +22 -0
- package/dist/chunk-WLZ54FWG.js +120 -0
- package/dist/chunk-WYJEOMNY.js +31 -0
- package/dist/chunk-WZGJSQKN.js +29 -0
- package/dist/chunk-WZL4EEBS.js +11 -0
- package/dist/chunk-X4YNDLVA.js +54 -0
- package/dist/chunk-X6SUFTD7.js +17 -0
- package/dist/chunk-XB4KZ6WO.js +81 -0
- package/dist/chunk-XJI6SWFS.js +569 -0
- package/dist/chunk-XJP5DKIL.js +29 -0
- package/dist/chunk-XN4ARQ2W.js +47 -0
- package/dist/chunk-XN7MQO45.js +359 -0
- package/dist/chunk-XQCQZBGX.js +100 -0
- package/dist/chunk-XXOHXA3A.js +69 -0
- package/dist/chunk-XZOHR765.js +127 -0
- package/dist/chunk-YCNLQYTC.js +133 -0
- package/dist/chunk-YCRGWQBS.js +526 -0
- package/dist/chunk-YF2PYLC4.js +210 -0
- package/dist/chunk-YG5GUELW.js +935 -0
- package/dist/chunk-YS6KMYM4.js +91 -0
- package/dist/chunk-YWP7XFKD.js +12 -0
- package/dist/chunk-Z2MGTKDR.js +20 -0
- package/dist/chunk-Z6CL7AR6.js +24 -0
- package/dist/chunk-Z7X3RGGA.js +22 -0
- package/dist/chunk-ZF43WRG3.js +29 -0
- package/dist/chunk-ZMF7WEGG.js +60 -0
- package/dist/chunk-ZNHFLJSY.js +375 -0
- package/dist/chunk-ZQ4VFQID.js +76 -0
- package/dist/chunk-ZQF34VPS.js +72 -0
- package/dist/chunk-ZU425HNM.js +24 -0
- package/dist/chunk-ZZU5R5UU.js +24 -0
- package/dist/cli/index.js +9 -0
- package/dist/core-3VCCUFVX.js +32 -0
- package/dist/core-4BZQQSHS.js +33 -0
- package/dist/core-4VT4MHNB.js +38 -0
- package/dist/core-5535KXRD.js +40 -0
- package/dist/core-5HQBPCHL.js +35 -0
- package/dist/core-6RYHWUJO.js +35 -0
- package/dist/core-7BZJCIXN.js +35 -0
- package/dist/core-AJTVU6X7.js +37 -0
- package/dist/core-C6YUSTZI.js +57 -0
- package/dist/core-EEB7HTCL.js +33 -0
- package/dist/core-EFMVDWNH.js +38 -0
- package/dist/core-ETAGQBZO.js +34 -0
- package/dist/core-FVR3WZEC.js +36 -0
- package/dist/core-GCTFVYMH.js +29 -0
- package/dist/core-GES44OTS.js +33 -0
- package/dist/core-GGQREDSI.js +47 -0
- package/dist/core-HRYOV6QD.js +38 -0
- package/dist/core-IKD3EE3S.js +38 -0
- package/dist/core-JM4R426L.js +32 -0
- package/dist/core-KKQS3WI2.js +40 -0
- package/dist/core-LA6XDYG7.js +40 -0
- package/dist/core-MJ7JWQT5.js +37 -0
- package/dist/core-MLROKJ2M.js +53 -0
- package/dist/core-MR52YBRX.js +31 -0
- package/dist/core-NP4VHWXL.js +29 -0
- package/dist/core-NQLNZDX5.js +41 -0
- package/dist/core-NSIJEKLI.js +44 -0
- package/dist/core-OJUQLIQ5.js +35 -0
- package/dist/core-PB3VUQSS.js +32 -0
- package/dist/core-Q6VLFFYC.js +56 -0
- package/dist/core-QY7AVIKZ.js +51 -0
- package/dist/core-SBQMHWTA.js +52 -0
- package/dist/core-UHECQHJ2.js +38 -0
- package/dist/core-V5FV4NWL.js +56 -0
- package/dist/core-WGM4XUN3.js +58 -0
- package/dist/core-WUQVFARS.js +34 -0
- package/dist/core-Z2F3IGSR.js +42 -0
- package/dist/dataTable-3CPPIHB3.js +58 -0
- package/dist/engine-FXFBCWHB.js +961 -0
- package/dist/fixtures.d.ts +1 -0
- package/dist/fixtures.js +41 -0
- package/dist/fontTables-WYCZNRE7.js +18 -0
- package/dist/fonts.d.ts +1 -0
- package/dist/fonts.js +19 -0
- package/dist/geo/dach.d.ts +1 -0
- package/dist/geo/dach.js +14 -0
- package/dist/geo/de-states.d.ts +1 -0
- package/dist/geo/de-states.js +14 -0
- package/dist/geo/eu27.d.ts +1 -0
- package/dist/geo/eu27.js +14 -0
- package/dist/geo/europe.d.ts +1 -0
- package/dist/geo/europe.js +14 -0
- package/dist/geo/index.d.ts +1 -0
- package/dist/geo/index.js +41 -0
- package/dist/geo/us-states.d.ts +1 -0
- package/dist/geo/us-states.js +14 -0
- package/dist/geo/world.d.ts +1 -0
- package/dist/geo/world.js +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +364 -0
- package/dist/main-YLKBTHJP.js +569 -0
- package/dist/mcp/server.js +1025 -0
- package/dist/module-SVEW5ZUE.js +137233 -0
- package/dist/react/bar.d.ts +1 -0
- package/dist/react/bar.js +81 -0
- package/dist/react/bartable.d.ts +1 -0
- package/dist/react/bartable.js +70 -0
- package/dist/react/box.d.ts +1 -0
- package/dist/react/box.js +65 -0
- package/dist/react/bullet.d.ts +1 -0
- package/dist/react/bullet.js +72 -0
- package/dist/react/butterfly.d.ts +1 -0
- package/dist/react/butterfly.js +66 -0
- package/dist/react/choropleth.d.ts +1 -0
- package/dist/react/choropleth.js +67 -0
- package/dist/react/cohort.d.ts +1 -0
- package/dist/react/cohort.js +70 -0
- package/dist/react/column.d.ts +1 -0
- package/dist/react/column.js +86 -0
- package/dist/react/combo.d.ts +1 -0
- package/dist/react/combo.js +86 -0
- package/dist/react/creative.d.ts +1 -0
- package/dist/react/creative.js +61 -0
- package/dist/react/diagram.d.ts +1 -0
- package/dist/react/diagram.js +60 -0
- package/dist/react/dimswitch.d.ts +1 -0
- package/dist/react/dimswitch.js +72 -0
- package/dist/react/dot.d.ts +1 -0
- package/dist/react/dot.js +70 -0
- package/dist/react/export.d.ts +1 -0
- package/dist/react/export.js +658 -0
- package/dist/react/funnel.d.ts +1 -0
- package/dist/react/funnel.js +63 -0
- package/dist/react/gantt.d.ts +1 -0
- package/dist/react/gantt.js +62 -0
- package/dist/react/grid.d.ts +1 -0
- package/dist/react/grid.js +67 -0
- package/dist/react/heatmap.d.ts +1 -0
- package/dist/react/heatmap.js +68 -0
- package/dist/react/histogram.d.ts +1 -0
- package/dist/react/histogram.js +86 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +504 -0
- package/dist/react/kpi.d.ts +1 -0
- package/dist/react/kpi.js +67 -0
- package/dist/react/likert.d.ts +1 -0
- package/dist/react/likert.js +83 -0
- package/dist/react/line.d.ts +1 -0
- package/dist/react/line.js +81 -0
- package/dist/react/mekko.d.ts +1 -0
- package/dist/react/mekko.js +71 -0
- package/dist/react/pareto.d.ts +1 -0
- package/dist/react/pareto.js +90 -0
- package/dist/react/pie.d.ts +1 -0
- package/dist/react/pie.js +64 -0
- package/dist/react/prepare.d.ts +1 -0
- package/dist/react/prepare.js +278 -0
- package/dist/react/pvm.d.ts +1 -0
- package/dist/react/pvm.js +68 -0
- package/dist/react/pyramid.d.ts +1 -0
- package/dist/react/pyramid.js +67 -0
- package/dist/react/sankey.d.ts +1 -0
- package/dist/react/sankey.js +59 -0
- package/dist/react/scatter.d.ts +1 -0
- package/dist/react/scatter.js +63 -0
- package/dist/react/slope.d.ts +1 -0
- package/dist/react/slope.js +64 -0
- package/dist/react/sparkline.d.ts +1 -0
- package/dist/react/sparkline.js +59 -0
- package/dist/react/spec.d.ts +1 -0
- package/dist/react/spec.js +379 -0
- package/dist/react/status.d.ts +1 -0
- package/dist/react/status.js +64 -0
- package/dist/react/story.d.ts +1 -0
- package/dist/react/story.js +140 -0
- package/dist/react/table.d.ts +1 -0
- package/dist/react/table.js +69 -0
- package/dist/react/theme.d.ts +1 -0
- package/dist/react/theme.js +53 -0
- package/dist/react/tilemap.d.ts +1 -0
- package/dist/react/tilemap.js +66 -0
- package/dist/react/treemap.d.ts +1 -0
- package/dist/react/treemap.js +61 -0
- package/dist/react/variance.d.ts +1 -0
- package/dist/react/variance.js +65 -0
- package/dist/react/waffle.d.ts +1 -0
- package/dist/react/waffle.js +62 -0
- package/dist/react/waterfall.d.ts +1 -0
- package/dist/react/waterfall.js +68 -0
- package/dist/resvg-ZOVDIZTV.js +23 -0
- package/dist/rows.d.ts +1 -0
- package/dist/rows.js +23 -0
- package/dist/rowsModule-YVLAROIP.js +27 -0
- package/dist/schema-2K6C3U24.js +23 -0
- package/dist/schema-2KIHLTYI.js +23 -0
- package/dist/schema-4HY2MWZC.js +30 -0
- package/dist/schema-4S5CXHAO.js +24 -0
- package/dist/schema-5BKQV56C.js +27 -0
- package/dist/schema-5HA5DSYN.js +24 -0
- package/dist/schema-5NKJPSBD.js +23 -0
- package/dist/schema-65FOKNHK.js +43 -0
- package/dist/schema-6OHZWHUI.js +23 -0
- package/dist/schema-6RYJS2GM.js +24 -0
- package/dist/schema-6W4M3WJ4.js +23 -0
- package/dist/schema-7TLSFG6M.js +24 -0
- package/dist/schema-AMFRKUFS.js +27 -0
- package/dist/schema-B7CZPPB4.js +28 -0
- package/dist/schema-BNRNHGHQ.js +26 -0
- package/dist/schema-E4MRCGPZ.js +24 -0
- package/dist/schema-F3WYTR65.js +26 -0
- package/dist/schema-FA6XIHTW.js +23 -0
- package/dist/schema-GZNOW4LX.js +23 -0
- package/dist/schema-HEIDGCSL.js +23 -0
- package/dist/schema-JB2H6KPA.js +23 -0
- package/dist/schema-MPXZNWV3.js +23 -0
- package/dist/schema-NHNQK6XO.js +23 -0
- package/dist/schema-NN6UPDPW.js +23 -0
- package/dist/schema-O4YNAGIY.js +23 -0
- package/dist/schema-O7AKK232.js +29 -0
- package/dist/schema-OJCML6LV.js +24 -0
- package/dist/schema-ORTRMYI6.js +24 -0
- package/dist/schema-PJ6P52BC.js +23 -0
- package/dist/schema-RTWES6NR.js +24 -0
- package/dist/schema-S36SRYGO.js +24 -0
- package/dist/schema-S3TCLTYD.js +23 -0
- package/dist/schema-SWWMOLOR.js +54 -0
- package/dist/schema-WOSEZNKG.js +26 -0
- package/dist/schema-Y6KBWUUR.js +23 -0
- package/dist/schema-YQYTLKSW.js +23 -0
- package/dist/schema-ZUUUY3QS.js +33 -0
- package/dist/specValidation-VNWIKLHH.js +49 -0
- package/dist/theme.d.ts +1 -0
- package/dist/theme.js +24 -0
- package/dist/themeShapeRules-2D3KWSPQ.js +11 -0
- package/dist/types/core/a11y/accessibility.d.ts +43 -0
- package/dist/types/core/a11y/recordsShared.d.ts +44 -0
- package/dist/types/core/a11y/structuralRecords.d.ts +6 -0
- package/dist/types/core/a11y/types.d.ts +116 -0
- package/dist/types/core/annotate.d.ts +300 -0
- package/dist/types/core/annotateArms.d.ts +37 -0
- package/dist/types/core/annotateFields.d.ts +30 -0
- package/dist/types/core/annotateGapBracket.d.ts +66 -0
- package/dist/types/core/annotateLinks.d.ts +47 -0
- package/dist/types/core/annotateTargets.d.ts +90 -0
- package/dist/types/core/axis.d.ts +179 -0
- package/dist/types/core/bandSelect.d.ts +10 -0
- package/dist/types/core/bands.d.ts +14 -0
- package/dist/types/core/calendarLabels.d.ts +101 -0
- package/dist/types/core/charts/band/stacks.d.ts +155 -0
- package/dist/types/core/charts/bar/fixtures.d.ts +9 -0
- package/dist/types/core/charts/bar/layout.d.ts +95 -0
- package/dist/types/core/charts/bartable/fixtures.d.ts +4 -0
- package/dist/types/core/charts/bartable/types.d.ts +192 -0
- package/dist/types/core/charts/box/fixtures.d.ts +12 -0
- package/dist/types/core/charts/box/types.d.ts +110 -0
- package/dist/types/core/charts/bullet/fixtures.d.ts +11 -0
- package/dist/types/core/charts/butterfly/fixtures.d.ts +9 -0
- package/dist/types/core/charts/choropleth/fixtures.d.ts +3 -0
- package/dist/types/core/charts/choropleth/overlayTypes.d.ts +68 -0
- package/dist/types/core/charts/choropleth/types.d.ts +117 -0
- package/dist/types/core/charts/cohort/fixtures.d.ts +12 -0
- package/dist/types/core/charts/cohort/types.d.ts +165 -0
- package/dist/types/core/charts/column/anomaly.d.ts +204 -0
- package/dist/types/core/charts/column/fixtures.d.ts +12 -0
- package/dist/types/core/charts/column/layout.d.ts +116 -0
- package/dist/types/core/charts/column/model.d.ts +295 -0
- package/dist/types/core/charts/column/types.d.ts +56 -0
- package/dist/types/core/charts/combo/endpoints.d.ts +165 -0
- package/dist/types/core/charts/combo/fixtures.d.ts +12 -0
- package/dist/types/core/charts/combo/layout.d.ts +48 -0
- package/dist/types/core/charts/creative/fixtures.d.ts +4 -0
- package/dist/types/core/charts/creative/types.d.ts +73 -0
- package/dist/types/core/charts/diagram/fixtures.d.ts +3 -0
- package/dist/types/core/charts/dimswitch/compile.d.ts +20 -0
- package/dist/types/core/charts/dimswitch/fixtures.d.ts +3 -0
- package/dist/types/core/charts/dimswitch/types.d.ts +152 -0
- package/dist/types/core/charts/dot/fixtures.d.ts +11 -0
- package/dist/types/core/charts/funnel/fixtures.d.ts +11 -0
- package/dist/types/core/charts/gantt/fixtures.d.ts +9 -0
- package/dist/types/core/charts/gantt/layout.d.ts +63 -0
- package/dist/types/core/charts/grid/fixtures.d.ts +3 -0
- package/dist/types/core/charts/grid/metricStack.d.ts +108 -0
- package/dist/types/core/charts/grid/metricStackSchema.d.ts +74 -0
- package/dist/types/core/charts/grid/normalize.d.ts +99 -0
- package/dist/types/core/charts/grid/schema.d.ts +168 -0
- package/dist/types/core/charts/heatmap/fixtures.d.ts +11 -0
- package/dist/types/core/charts/histogram/fixtures.d.ts +15 -0
- package/dist/types/core/charts/histogram/types.d.ts +98 -0
- package/dist/types/core/charts/kpi/fixtures.d.ts +9 -0
- package/dist/types/core/charts/likert/fixtures.d.ts +11 -0
- package/dist/types/core/charts/likert/layout.d.ts +111 -0
- package/dist/types/core/charts/line/fixtures.d.ts +16 -0
- package/dist/types/core/charts/line/types.d.ts +6 -0
- package/dist/types/core/charts/mekko/fixtures.d.ts +13 -0
- package/dist/types/core/charts/pareto/fixtures.d.ts +5 -0
- package/dist/types/core/charts/pareto/layout.d.ts +68 -0
- package/dist/types/core/charts/pie/fixtures.d.ts +14 -0
- package/dist/types/core/charts/pvm/fixtures.d.ts +13 -0
- package/dist/types/core/charts/pvm/types.d.ts +118 -0
- package/dist/types/core/charts/pyramid/fixtures.d.ts +4 -0
- package/dist/types/core/charts/pyramid/types.d.ts +92 -0
- package/dist/types/core/charts/sankey/fixtures.d.ts +4 -0
- package/dist/types/core/charts/sankey/types.d.ts +116 -0
- package/dist/types/core/charts/scatter/fixtures.d.ts +12 -0
- package/dist/types/core/charts/scatter/types.d.ts +58 -0
- package/dist/types/core/charts/slope/fixtures.d.ts +13 -0
- package/dist/types/core/charts/sparkline/fixtures.d.ts +9 -0
- package/dist/types/core/charts/status/fixtures.d.ts +8 -0
- package/dist/types/core/charts/status/layout.d.ts +71 -0
- package/dist/types/core/charts/table/fitFormats.d.ts +67 -0
- package/dist/types/core/charts/table/fixtures.d.ts +7 -0
- package/dist/types/core/charts/table/resolve.d.ts +72 -0
- package/dist/types/core/charts/table/view.d.ts +156 -0
- package/dist/types/core/charts/tilemap/fixtures.d.ts +3 -0
- package/dist/types/core/charts/tilemap/types.d.ts +94 -0
- package/dist/types/core/charts/treemap/fixtures.d.ts +4 -0
- package/dist/types/core/charts/treemap/types.d.ts +78 -0
- package/dist/types/core/charts/variance/fixtures.d.ts +12 -0
- package/dist/types/core/charts/waffle/fixtures.d.ts +5 -0
- package/dist/types/core/charts/waffle/types.d.ts +117 -0
- package/dist/types/core/charts/waterfall/fixtures.d.ts +9 -0
- package/dist/types/core/claims/browser.d.ts +49 -0
- package/dist/types/core/claims/manifest.d.ts +22 -0
- package/dist/types/core/dateFormat.d.ts +39 -0
- package/dist/types/core/deferred.d.ts +121 -0
- package/dist/types/core/diagnostics/describe.d.ts +149 -0
- package/dist/types/core/diagnostics/jsonPatch.d.ts +36 -0
- package/dist/types/core/doc/bareChart.d.ts +2 -0
- package/dist/types/core/doc/diagnostics.d.ts +124 -0
- package/dist/types/core/doc/docExpand.d.ts +39 -0
- package/dist/types/core/doc/document.d.ts +43 -0
- package/dist/types/core/doc/ownedDocumentCopy.d.ts +5 -0
- package/dist/types/core/doc/specError.d.ts +6 -0
- package/dist/types/core/emptyData.d.ts +27 -0
- package/dist/types/core/eventLane.d.ts +208 -0
- package/dist/types/core/fontMetrics/index.d.ts +47 -0
- package/dist/types/core/fontMetrics/injected.d.ts +40 -0
- package/dist/types/core/fontMetrics/tableDocument.d.ts +73 -0
- package/dist/types/core/fontMetrics/tables.generated.d.ts +17 -0
- package/dist/types/core/footer.d.ts +59 -0
- package/dist/types/core/format.d.ts +149 -0
- package/dist/types/core/formatPrecision.d.ts +136 -0
- package/dist/types/core/formatSpec.d.ts +304 -0
- package/dist/types/core/frame.d.ts +583 -0
- package/dist/types/core/geo/packs/all.d.ts +7 -0
- package/dist/types/core/geo/packs/dach.d.ts +16 -0
- package/dist/types/core/geo/packs/de-states.d.ts +16 -0
- package/dist/types/core/geo/packs/eu27.d.ts +16 -0
- package/dist/types/core/geo/packs/europe.d.ts +16 -0
- package/dist/types/core/geo/packs/index.d.ts +22 -0
- package/dist/types/core/geo/packs/registry.d.ts +37 -0
- package/dist/types/core/geo/packs/us-states.d.ts +16 -0
- package/dist/types/core/geo/packs/world.d.ts +16 -0
- package/dist/types/core/geo/tiles/eu27.generated.d.ts +412 -0
- package/dist/types/core/geo/tiles/europe.generated.d.ts +842 -0
- package/dist/types/core/geo/tiles/index.d.ts +8 -0
- package/dist/types/core/geo/tiles/types.d.ts +36 -0
- package/dist/types/core/geo/tiles/us-states.generated.d.ts +952 -0
- package/dist/types/core/geo/tiles/world.generated.d.ts +968 -0
- package/dist/types/core/geo/types.d.ts +146 -0
- package/dist/types/core/geometry.d.ts +102 -0
- package/dist/types/core/grid/sharedScale.d.ts +82 -0
- package/dist/types/core/icons.d.ts +227 -0
- package/dist/types/core/inputError.d.ts +14 -0
- package/dist/types/core/isoDate.d.ts +2 -0
- package/dist/types/core/isoTime.d.ts +7 -0
- package/dist/types/core/label/categoryRow.d.ts +332 -0
- package/dist/types/core/label/occupied.d.ts +41 -0
- package/dist/types/core/label/ownership.d.ts +83 -0
- package/dist/types/core/label/solver.d.ts +384 -0
- package/dist/types/core/label/tickRow.d.ts +78 -0
- package/dist/types/core/live/types.d.ts +50 -0
- package/dist/types/core/normalize/shared.d.ts +56 -0
- package/dist/types/core/notes.d.ts +174 -0
- package/dist/types/core/othersShade.d.ts +9 -0
- package/dist/types/core/periodYears.d.ts +9 -0
- package/dist/types/core/polyline.d.ts +11 -0
- package/dist/types/core/rangeRules.d.ts +19 -0
- package/dist/types/core/ratioTier.d.ts +120 -0
- package/dist/types/core/readerStrings.d.ts +13 -0
- package/dist/types/core/reading.d.ts +120 -0
- package/dist/types/core/registry.d.ts +178 -0
- package/dist/types/core/repaintGeometry.d.ts +19 -0
- package/dist/types/core/request.d.ts +124 -0
- package/dist/types/core/rows.d.ts +47 -0
- package/dist/types/core/scale.d.ts +106 -0
- package/dist/types/core/schema/capability.d.ts +229 -0
- package/dist/types/core/schema/namedColumns.d.ts +45 -0
- package/dist/types/core/schema/reference.d.ts +31 -0
- package/dist/types/core/schema/refusals.d.ts +45 -0
- package/dist/types/core/schema/unknownKeys.d.ts +45 -0
- package/dist/types/core/seriesIdentity.d.ts +120 -0
- package/dist/types/core/shareRounding.d.ts +49 -0
- package/dist/types/core/sizing.d.ts +330 -0
- package/dist/types/core/staticFooter.d.ts +6 -0
- package/dist/types/core/story.d.ts +41 -0
- package/dist/types/core/structureCounts.d.ts +10 -0
- package/dist/types/core/svg/renderSvg.d.ts +51 -0
- package/dist/types/core/target.d.ts +89 -0
- package/dist/types/core/text.d.ts +113 -0
- package/dist/types/core/theme.d.ts +478 -0
- package/dist/types/core/themeFields.d.ts +11 -0
- package/dist/types/core/themeRules.d.ts +111 -0
- package/dist/types/core/themeShape.d.ts +87 -0
- package/dist/types/core/themeValidate.d.ts +15 -0
- package/dist/types/core/timeAxis.d.ts +106 -0
- package/dist/types/core/types/annotations.d.ts +227 -0
- package/dist/types/core/types/cell.d.ts +82 -0
- package/dist/types/core/types/data.d.ts +314 -0
- package/dist/types/core/types/diagram.d.ts +234 -0
- package/dist/types/core/types/index.d.ts +8 -0
- package/dist/types/core/types/options.d.ts +1583 -0
- package/dist/types/core/types/scene.d.ts +990 -0
- package/dist/types/core/types/sizing.d.ts +51 -0
- package/dist/types/core/types/table.d.ts +873 -0
- package/dist/types/core/types/theme.d.ts +806 -0
- package/dist/types/core/zoom.d.ts +106 -0
- package/dist/types/fixtures/index.d.ts +40 -0
- package/dist/types/fixtures/registry.d.ts +15 -0
- package/dist/types/fonts.d.ts +10 -0
- package/dist/types/index.d.ts +70 -0
- package/dist/types/react/BoardplotTheme.d.ts +9 -0
- package/dist/types/react/DimSwitchChart.d.ts +36 -0
- package/dist/types/react/ScaleGroup.d.ts +31 -0
- package/dist/types/react/SceneRenderer.d.ts +23 -0
- package/dist/types/react/SizePlaceholder.d.ts +51 -0
- package/dist/types/react/StoryFrame.d.ts +42 -0
- package/dist/types/react/TableChart.d.ts +220 -0
- package/dist/types/react/a11ySurface.d.ts +20 -0
- package/dist/types/react/barrelCharts.d.ts +1023 -0
- package/dist/types/react/charts/bar.d.ts +28 -0
- package/dist/types/react/charts/bartable.d.ts +27 -0
- package/dist/types/react/charts/box.d.ts +27 -0
- package/dist/types/react/charts/bullet.d.ts +28 -0
- package/dist/types/react/charts/butterfly.d.ts +28 -0
- package/dist/types/react/charts/choropleth.d.ts +27 -0
- package/dist/types/react/charts/cohort.d.ts +52 -0
- package/dist/types/react/charts/column.d.ts +27 -0
- package/dist/types/react/charts/combo.d.ts +7 -0
- package/dist/types/react/charts/creative.d.ts +27 -0
- package/dist/types/react/charts/diagram.d.ts +162 -0
- package/dist/types/react/charts/dimswitch.d.ts +6 -0
- package/dist/types/react/charts/dot.d.ts +28 -0
- package/dist/types/react/charts/funnel.d.ts +28 -0
- package/dist/types/react/charts/gantt.d.ts +28 -0
- package/dist/types/react/charts/grid.d.ts +29 -0
- package/dist/types/react/charts/heatmap.d.ts +28 -0
- package/dist/types/react/charts/histogram.d.ts +27 -0
- package/dist/types/react/charts/kpi.d.ts +28 -0
- package/dist/types/react/charts/likert.d.ts +27 -0
- package/dist/types/react/charts/line.d.ts +28 -0
- package/dist/types/react/charts/mekko.d.ts +28 -0
- package/dist/types/react/charts/pareto.d.ts +28 -0
- package/dist/types/react/charts/pie.d.ts +28 -0
- package/dist/types/react/charts/pvm.d.ts +27 -0
- package/dist/types/react/charts/pyramid.d.ts +27 -0
- package/dist/types/react/charts/sankey.d.ts +27 -0
- package/dist/types/react/charts/scatter.d.ts +28 -0
- package/dist/types/react/charts/slope.d.ts +28 -0
- package/dist/types/react/charts/sparkline.d.ts +28 -0
- package/dist/types/react/charts/status.d.ts +27 -0
- package/dist/types/react/charts/table.d.ts +6 -0
- package/dist/types/react/charts/tilemap.d.ts +27 -0
- package/dist/types/react/charts/treemap.d.ts +27 -0
- package/dist/types/react/charts/variance.d.ts +28 -0
- package/dist/types/react/charts/waffle.d.ts +28 -0
- package/dist/types/react/charts/waterfall.d.ts +28 -0
- package/dist/types/react/createChartComponent.d.ts +135 -0
- package/dist/types/react/export/clipboard.d.ts +8 -0
- package/dist/types/react/export/csv.d.ts +2 -0
- package/dist/types/react/export/frame.d.ts +35 -0
- package/dist/types/react/export/index.d.ts +7 -0
- package/dist/types/react/export/png.d.ts +14 -0
- package/dist/types/react/export/svg.d.ts +5 -0
- package/dist/types/react/export/types.d.ts +69 -0
- package/dist/types/react/export/useExport.d.ts +17 -0
- package/dist/types/react/exportLink.d.ts +49 -0
- package/dist/types/react/footerFrame.d.ts +25 -0
- package/dist/types/react/hover/dataTable.d.ts +13 -0
- package/dist/types/react/hover/engine.d.ts +210 -0
- package/dist/types/react/hover/keyboard.d.ts +44 -0
- package/dist/types/react/hover/labelCard.d.ts +170 -0
- package/dist/types/react/hover/placement.d.ts +49 -0
- package/dist/types/react/index.d.ts +16 -0
- package/dist/types/react/parseChartSpec.d.ts +16 -0
- package/dist/types/react/prepare.d.ts +32 -0
- package/dist/types/react/prepared.d.ts +53 -0
- package/dist/types/react/preparedTable.d.ts +15 -0
- package/dist/types/react/rowsInput.d.ts +55 -0
- package/dist/types/react/rowsModule.d.ts +18 -0
- package/dist/types/react/rowsStore.d.ts +50 -0
- package/dist/types/react/scale-group.d.ts +2 -0
- package/dist/types/react/scaleGroupContext.d.ts +22 -0
- package/dist/types/react/scenePaint.d.ts +10 -0
- package/dist/types/react/scrollState.d.ts +26 -0
- package/dist/types/react/spec.d.ts +82 -0
- package/dist/types/react/specValidation.d.ts +45 -0
- package/dist/types/react/story.d.ts +15 -0
- package/dist/types/react/theme.d.ts +9 -0
- package/dist/types/react/themeContext.d.ts +44 -0
- package/dist/types/react/useChartLayout.d.ts +22 -0
- package/dist/types/react/useContainerSize.d.ts +57 -0
- package/dist/types/react/useHover.d.ts +100 -0
- package/dist/types/react/useZoom.d.ts +50 -0
- package/dist/types/rows.d.ts +63 -0
- package/dist/types/tableLooks.d.ts +6 -0
- package/dist/types/theme.d.ts +3 -0
- package/dist/types/validate.d.ts +3 -0
- package/dist/validate.d.ts +1 -0
- package/dist/validate.js +223 -0
- package/docs/FONTS.md +68 -0
- package/docs/TELEMETRY.md +94 -0
- package/docs/manual.md +850 -0
- package/docs/reference/bar.md +222 -0
- package/docs/reference/bartable.md +143 -0
- package/docs/reference/box.md +93 -0
- package/docs/reference/bullet.md +118 -0
- package/docs/reference/butterfly.md +117 -0
- package/docs/reference/choropleth.md +148 -0
- package/docs/reference/cohort.md +149 -0
- package/docs/reference/column.md +275 -0
- package/docs/reference/combo.md +219 -0
- package/docs/reference/creative.md +147 -0
- package/docs/reference/diagram.md +191 -0
- package/docs/reference/dimswitch.md +1395 -0
- package/docs/reference/dot.md +117 -0
- package/docs/reference/fixtures.md +1089 -0
- package/docs/reference/funnel.md +121 -0
- package/docs/reference/gantt.md +138 -0
- package/docs/reference/grid.md +302 -0
- package/docs/reference/heatmap.md +127 -0
- package/docs/reference/histogram.md +77 -0
- package/docs/reference/kpi.md +115 -0
- package/docs/reference/likert.md +113 -0
- package/docs/reference/line.md +436 -0
- package/docs/reference/mekko.md +114 -0
- package/docs/reference/options.md +313 -0
- package/docs/reference/pareto.md +102 -0
- package/docs/reference/pie.md +114 -0
- package/docs/reference/pvm.md +114 -0
- package/docs/reference/pyramid.md +99 -0
- package/docs/reference/react.md +706 -0
- package/docs/reference/reading.md +28 -0
- package/docs/reference/sankey.md +110 -0
- package/docs/reference/scatter.md +211 -0
- package/docs/reference/slope.md +126 -0
- package/docs/reference/sparkline.md +74 -0
- package/docs/reference/status.md +107 -0
- package/docs/reference/table.md +673 -0
- package/docs/reference/theme.md +361 -0
- package/docs/reference/tilemap.md +121 -0
- package/docs/reference/treemap.md +86 -0
- package/docs/reference/variance.md +126 -0
- package/docs/reference/waffle.md +106 -0
- package/docs/reference/waterfall.md +164 -0
- package/llms.txt +57 -0
- package/package.json +437 -4
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_OTHERS_SHADE
|
|
3
|
+
} from "./chunk-RQ5DNYLG.js";
|
|
4
|
+
import {
|
|
5
|
+
roundWholes
|
|
6
|
+
} from "./chunk-24BHMKDD.js";
|
|
7
|
+
import {
|
|
8
|
+
warnIncompleteComposition,
|
|
9
|
+
warnShareRoundingDrift
|
|
10
|
+
} from "./chunk-5LGSRWFC.js";
|
|
11
|
+
import {
|
|
12
|
+
runAnnotatePass
|
|
13
|
+
} from "./chunk-KZS46KDY.js";
|
|
14
|
+
import {
|
|
15
|
+
chartPalette,
|
|
16
|
+
chartTheme
|
|
17
|
+
} from "./chunk-3QWZAEW5.js";
|
|
18
|
+
import {
|
|
19
|
+
restLabel,
|
|
20
|
+
restSum,
|
|
21
|
+
topNCut
|
|
22
|
+
} from "./chunk-KDMKHR5A.js";
|
|
23
|
+
import {
|
|
24
|
+
hiddenValueNoteHeight
|
|
25
|
+
} from "./chunk-DO5OZJAO.js";
|
|
26
|
+
import {
|
|
27
|
+
structureCount
|
|
28
|
+
} from "./chunk-LFX7W4B7.js";
|
|
29
|
+
import {
|
|
30
|
+
emptyIdRecord
|
|
31
|
+
} from "./chunk-LINZPU5D.js";
|
|
32
|
+
import {
|
|
33
|
+
calendarCategories,
|
|
34
|
+
chartSizing,
|
|
35
|
+
contentSizing,
|
|
36
|
+
spread1DResult,
|
|
37
|
+
warnSpreadOverflow
|
|
38
|
+
} from "./chunk-RL3NUWMY.js";
|
|
39
|
+
import {
|
|
40
|
+
prepareFractionData
|
|
41
|
+
} from "./chunk-3EZRM4YM.js";
|
|
42
|
+
import {
|
|
43
|
+
PRIORITY,
|
|
44
|
+
authoredNotes,
|
|
45
|
+
composedTextRole,
|
|
46
|
+
computedTextRole,
|
|
47
|
+
createOccupiedIndex,
|
|
48
|
+
frameTextOptions,
|
|
49
|
+
labelCtx,
|
|
50
|
+
labelsToNodes,
|
|
51
|
+
normalizeLegendOption,
|
|
52
|
+
rectsOverlap,
|
|
53
|
+
resolvePaintWarnings,
|
|
54
|
+
round2,
|
|
55
|
+
segmentHitsRect,
|
|
56
|
+
settledAutoHeight,
|
|
57
|
+
solveFrame,
|
|
58
|
+
solveLabels,
|
|
59
|
+
valueNoteLine
|
|
60
|
+
} from "./chunk-SS42FJVN.js";
|
|
61
|
+
import {
|
|
62
|
+
disclosuresShown
|
|
63
|
+
} from "./chunk-BPKXEMRE.js";
|
|
64
|
+
import {
|
|
65
|
+
formatterFromExample,
|
|
66
|
+
parseFormatExample,
|
|
67
|
+
sameUnit,
|
|
68
|
+
seriesRasterFormatter,
|
|
69
|
+
unitOfSpec
|
|
70
|
+
} from "./chunk-RGZGLKFB.js";
|
|
71
|
+
import {
|
|
72
|
+
autoDecimals,
|
|
73
|
+
chartStrings,
|
|
74
|
+
formatAutomaticNumber,
|
|
75
|
+
seriesValueFormatter,
|
|
76
|
+
shareSetFormatter
|
|
77
|
+
} from "./chunk-53OYF4ZT.js";
|
|
78
|
+
import {
|
|
79
|
+
cellMeta,
|
|
80
|
+
cellValue
|
|
81
|
+
} from "./chunk-O3VN6BTL.js";
|
|
82
|
+
import {
|
|
83
|
+
arrowHeadPath,
|
|
84
|
+
arrowShaftEnd,
|
|
85
|
+
canvasMargin,
|
|
86
|
+
emphasisLabelTheme,
|
|
87
|
+
emphasisWeight,
|
|
88
|
+
markOutlineOff,
|
|
89
|
+
markRolePaint,
|
|
90
|
+
namesOnly,
|
|
91
|
+
paintColor,
|
|
92
|
+
panelTypeClass,
|
|
93
|
+
separationStroke,
|
|
94
|
+
seriesPaint,
|
|
95
|
+
sliceOutlineOff,
|
|
96
|
+
strokeToken
|
|
97
|
+
} from "./chunk-CWDHCSL2.js";
|
|
98
|
+
import {
|
|
99
|
+
fmtPathNumber
|
|
100
|
+
} from "./chunk-WLZ54FWG.js";
|
|
101
|
+
import {
|
|
102
|
+
NormalizeError,
|
|
103
|
+
TARGET_SIZE,
|
|
104
|
+
accessibleTitle,
|
|
105
|
+
normalizeCategory,
|
|
106
|
+
normalizeSeriesValues,
|
|
107
|
+
resolveHighlight,
|
|
108
|
+
resolveSize
|
|
109
|
+
} from "./chunk-SGD3ZHID.js";
|
|
110
|
+
import {
|
|
111
|
+
maxOf,
|
|
112
|
+
pushAll
|
|
113
|
+
} from "./chunk-WYJEOMNY.js";
|
|
114
|
+
import {
|
|
115
|
+
defaultMeasurer,
|
|
116
|
+
wrapText
|
|
117
|
+
} from "./chunk-AG2CJ4JY.js";
|
|
118
|
+
|
|
119
|
+
// src/core/strings/pie.ts
|
|
120
|
+
var EN = {
|
|
121
|
+
// reader-facing wording linked only by its consumers.
|
|
122
|
+
pieHiddenSlices: "{v1} {v2} not labelled",
|
|
123
|
+
pieDesc: "{v1} chart, {v2} slices of {v3}, total {v4}. ",
|
|
124
|
+
sharesSentence: "Shares: {v1}.",
|
|
125
|
+
pieTitle: "{v1} chart: {v2} across {v3} slices",
|
|
126
|
+
pieName: "pie",
|
|
127
|
+
doughnutName: "doughnut"
|
|
128
|
+
}, DE = {
|
|
129
|
+
// reader-facing wording linked only by its consumers.
|
|
130
|
+
pieHiddenSlices: "{v1} {v1|Segment|Segmente} ohne Beschriftung",
|
|
131
|
+
pieDesc: "{v1} Diagramm mit {v2} {v2|Segment|Segmenten} f\xFCr {v3}, Summe {v4}. ",
|
|
132
|
+
sharesSentence: "Anteile: {v1}.",
|
|
133
|
+
pieTitle: "{v1} Diagramm: {v2} \xFCber {v3} {v3|Segment|Segmente}",
|
|
134
|
+
pieName: "Kreis",
|
|
135
|
+
doughnutName: "Ring"
|
|
136
|
+
}, { chartString } = chartStrings(EN, DE);
|
|
137
|
+
|
|
138
|
+
// src/core/charts/pie/comparisons.ts
|
|
139
|
+
var ARC_GAP = 8, END_INSET_DEG = 30, LABEL_GAP = 4, ARC_ARROW = 5;
|
|
140
|
+
function pieComparisonRoom(labelHeight) {
|
|
141
|
+
return ARC_GAP + LABEL_GAP + labelHeight + 2;
|
|
142
|
+
}
|
|
143
|
+
var norm = (deg) => (deg % 360 + 360) % 360, polar = (cx, cy, radius, deg) => {
|
|
144
|
+
let rad2 = deg * Math.PI / 180;
|
|
145
|
+
return { x: cx + radius * Math.sin(rad2), y: cy - radius * Math.cos(rad2) };
|
|
146
|
+
}, f = (n) => String(Math.round(n * 100) / 100);
|
|
147
|
+
function pieComparisonLayout(theme, ring, slices) {
|
|
148
|
+
let plans = [];
|
|
149
|
+
return {
|
|
150
|
+
draw: (pass, a, b, text, id, kind, computed, derivation) => {
|
|
151
|
+
let from = slices.find((s) => s.id === a.owner.categoryId), to = slices.find((s) => s.id === b.owner.categoryId);
|
|
152
|
+
if (!from || !to || from === to) {
|
|
153
|
+
pass.warn?.("bad-anchor", `${kind} '${id}': a pie comparison needs two different slices`);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
let cw = norm(to.mid - from.mid), between = (dir2) => slices.filter((s) => {
|
|
157
|
+
if (s === from || s === to) return !1;
|
|
158
|
+
let t = norm(dir2 * (s.mid - from.mid));
|
|
159
|
+
return t > 0 && t < (dir2 === 1 ? cw : 360 - cw);
|
|
160
|
+
}).length, dir = between(1) < between(-1) || between(1) === between(-1) && cw <= 180 ? 1 : -1, startDeg = from.mid + dir * Math.min(END_INSET_DEG, from.sweep / 3), endDeg = to.mid - dir * Math.min(END_INSET_DEG, to.sweep / 3), span = norm(dir * (endDeg - startDeg)), R = ring.outer + ARC_GAP, at = (t) => startDeg + dir * span * t, p0 = polar(ring.cx, ring.cy, R, startDeg), p1 = polar(ring.cx, ring.cy, R, endDeg), rim0 = polar(from.scx, from.scy, ring.r + 2, startDeg), tip = polar(to.scx, to.scy, ring.r + 2, endDeg), inward = Math.atan2(tip.y - p1.y, tip.x - p1.x), shaft = arrowShaftEnd(ARC_ARROW, strokeToken(theme, "rule")), shaftEnd = { x: tip.x - Math.cos(inward) * shaft, y: tip.y - Math.sin(inward) * shaft }, d = `M${f(rim0.x)} ${f(rim0.y)}L${f(p0.x)} ${f(p0.y)}A${f(R)} ${f(R)} 0 ${span > 180 ? 1 : 0} ${dir === 1 ? 1 : 0} ${f(p1.x)} ${f(p1.y)}L${f(shaftEnd.x)} ${f(shaftEnd.y)}`, { input } = pass, font = { family: input.theme.type.family, ...input.theme.type.label, weight: emphasisWeight(input.theme) }, size = input.measure(text, font), candidates = [0.5, 0.33, 0.67].map((t, index) => {
|
|
161
|
+
let deg = at(t), p = polar(ring.cx, ring.cy, R + LABEL_GAP, deg), rad2 = deg * Math.PI / 180, rect = {
|
|
162
|
+
x: p.x + (Math.sin(rad2) - 1) * (size.width / 2),
|
|
163
|
+
y: p.y - (Math.cos(rad2) + 1) * (size.height / 2),
|
|
164
|
+
w: size.width,
|
|
165
|
+
h: size.height
|
|
166
|
+
};
|
|
167
|
+
return { slot: `arc-${index}`, rect, penalty: index };
|
|
168
|
+
});
|
|
169
|
+
pass.labelRequests.push({
|
|
170
|
+
id: `annotation:${id}`,
|
|
171
|
+
kind: "annotation",
|
|
172
|
+
role: computedTextRole(text, computed),
|
|
173
|
+
owner: { annotationId: id },
|
|
174
|
+
text,
|
|
175
|
+
lines: [text],
|
|
176
|
+
font,
|
|
177
|
+
priority: pass.priority ?? PRIORITY.valueLine,
|
|
178
|
+
candidates
|
|
179
|
+
});
|
|
180
|
+
let annotation = { id, kind, computedText: computed, nodeIds: [], labelId: `annotation:${id}`, ...derivation ? { derivation } : {} };
|
|
181
|
+
pass.placed.push(annotation);
|
|
182
|
+
for (let t = 0; t <= 1; t += 0.125) {
|
|
183
|
+
let p = polar(ring.cx, ring.cy, R, at(t));
|
|
184
|
+
input.occupied.claim({ x: p.x - 3, y: p.y - 3, w: 6, h: 6 }, "annotation", { annotationId: id }, "arc");
|
|
185
|
+
}
|
|
186
|
+
plans.push({ annotation, d, head: arrowHeadPath(tip, inward, ARC_ARROW) });
|
|
187
|
+
},
|
|
188
|
+
emit(labels) {
|
|
189
|
+
let nodes = [];
|
|
190
|
+
for (let { annotation, d, head } of plans) {
|
|
191
|
+
let label = labels.find((l) => l.id === annotation.labelId);
|
|
192
|
+
if (!label || label.hidden) continue;
|
|
193
|
+
let owner = { annotationId: annotation.id }, pathId = `ann:${annotation.id}:bracket`, headId = `ann:${annotation.id}:comparisonHead`;
|
|
194
|
+
nodes.push(
|
|
195
|
+
{ t: "path", id: pathId, d, stroke: { token: "ink" }, width: strokeToken(theme, "rule"), owner, part: "bracket" },
|
|
196
|
+
{ t: "path", id: headId, d: head, fill: { token: "ink" }, owner, part: "arrowHead" }
|
|
197
|
+
), annotation.nodeIds.push(pathId, headId);
|
|
198
|
+
}
|
|
199
|
+
return nodes;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// src/core/charts/pie/labels.ts
|
|
205
|
+
var OUTSIDE_ALL_MAX = 8;
|
|
206
|
+
function pieLabelContent(options, displayedCount, legendDrawn) {
|
|
207
|
+
let settings = options.labels, kindSetting = (kind) => settings === !1 ? !1 : settings?.[kind] ?? !0, preferOutside = displayedCount <= (legendDrawn ? 4 : OUTSIDE_ALL_MAX) && settings !== !1 && settings?.insidePie === void 0 && settings?.outsidePie !== !1 && !Object.keys(options.labelPlacements ?? {}).some((id) => id.startsWith("insidePie:")), contentOf = (kind, fallback) => {
|
|
208
|
+
let setting = kindSetting(kind);
|
|
209
|
+
return setting === !1 ? null : Array.isArray(setting) ? setting : fallback;
|
|
210
|
+
}, named = settings !== !1 && settings?.category !== !1, outsideDefault = named ? ["category", "absolute", "percent"] : ["absolute", "percent"];
|
|
211
|
+
return {
|
|
212
|
+
kindSetting,
|
|
213
|
+
insideContent: preferOutside ? null : contentOf("insidePie", named && !legendDrawn ? ["category", "absolute", "percent"] : ["absolute", "percent"]),
|
|
214
|
+
outsideContent: contentOf("outsidePie", outsideDefault)
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function pieCenterLines(formatted, unit, format) {
|
|
218
|
+
if (!unit?.trim()) return [formatted];
|
|
219
|
+
let spec = format ? parseFormatExample(format) : void 0, formattedUnit = spec && (unitOfSpec(spec) ?? spec.suffix.trim());
|
|
220
|
+
return formattedUnit && sameUnit(formattedUnit, unit) ? [formatted] : [formatted, unit];
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// src/core/charts/pie/ring.ts
|
|
224
|
+
var RING_GAP = 12, LABEL_GAP2 = 3, LEADER_GUTTER = 2, CROWDED_DEG = 3, SHRINK_STEPS = [0.92, 0.84, 0.76, 0.7], rad = (deg) => deg * Math.PI / 180, polar2 = (c, radius, deg) => ({ x: c.x + radius * Math.sin(rad(deg)), y: c.y - radius * Math.cos(rad(deg)) });
|
|
225
|
+
function nearestOnRect(rect, p, pad = 0) {
|
|
226
|
+
return {
|
|
227
|
+
x: Math.min(Math.max(p.x, rect.x - pad), rect.x + rect.w + pad),
|
|
228
|
+
y: Math.min(Math.max(p.y, rect.y - pad), rect.y + rect.h + pad)
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function distToSegment(c, a, b) {
|
|
232
|
+
let dx = b.x - a.x, dy = b.y - a.y, t = Math.max(0, Math.min(1, ((c.x - a.x) * dx + (c.y - a.y) * dy) / (dx * dx + dy * dy || 1)));
|
|
233
|
+
return Math.hypot(a.x + t * dx - c.x, a.y + t * dy - c.y);
|
|
234
|
+
}
|
|
235
|
+
function segmentsCross(a, b, c, d) {
|
|
236
|
+
let side = (p, q, s) => (q.x - p.x) * (s.y - p.y) - (q.y - p.y) * (s.x - p.x);
|
|
237
|
+
return side(a, b, c) * side(a, b, d) < 0 && side(c, d, a) * side(c, d, b) < 0;
|
|
238
|
+
}
|
|
239
|
+
function arcSize(form, deg) {
|
|
240
|
+
let s = Math.abs(Math.sin(rad(deg))), c = Math.abs(Math.cos(rad(deg)));
|
|
241
|
+
return Math.min(form.h / Math.max(s, 1e-3), form.w / Math.max(c, 1e-3)) + LABEL_GAP2;
|
|
242
|
+
}
|
|
243
|
+
function seatRing(items, form, r, ring, plot) {
|
|
244
|
+
let n = items.length, order = items.map((_, i) => i).sort((a, b) => norm2(items[a].mid) - norm2(items[b].mid) || a - b), cut = 0, widest = -1;
|
|
245
|
+
order.forEach((i, k) => {
|
|
246
|
+
let next = order[(k + 1) % n], gap = k + 1 < n ? norm2(items[next].mid) - norm2(items[i].mid) : norm2(items[next].mid) + 360 - norm2(items[i].mid);
|
|
247
|
+
gap > widest && (widest = gap, cut = (k + 1) % n);
|
|
248
|
+
});
|
|
249
|
+
let ordered = [...order.slice(cut), ...order.slice(0, cut)], start = norm2(items[ordered[0]].mid), unrolled = ordered.map((i) => {
|
|
250
|
+
let m = norm2(items[i].mid);
|
|
251
|
+
return m < start ? m + 360 : m;
|
|
252
|
+
}), perDeg = rad(ring), lo = (start - widest / 2) * perDeg, seats = new Array(n), seatAt = (k, t) => {
|
|
253
|
+
let i = ordered[k], item = items[i], { w, h } = item.forms[form[i]], c = item.center(r), p = polar2(c, ring, t), rect = { x: p.x - w / 2 + w / 2 * Math.sin(rad(t)), y: p.y - h / 2 - h / 2 * Math.cos(rad(t)), w, h };
|
|
254
|
+
for (let step = 0; step < 3; step++) {
|
|
255
|
+
let near = nearestOnRect(rect, c), short = ring - Math.hypot(near.x - c.x, near.y - c.y);
|
|
256
|
+
if (short <= 0.5) break;
|
|
257
|
+
rect.x += short * Math.sin(rad(t)), rect.y -= short * Math.cos(rad(t));
|
|
258
|
+
}
|
|
259
|
+
seats[i] = { rect, from: polar2(c, r + 1, item.mid), to: nearestOnRect(rect, p, LEADER_GUTTER), angle: t };
|
|
260
|
+
}, extra = new Array(n).fill(0), theta = [...unrolled];
|
|
261
|
+
for (let pass = 0; pass < 10; pass++) {
|
|
262
|
+
if (theta = spread1DResult(ordered.map((i, k) => ({ desired: unrolled[k] * perDeg, size: arcSize(items[i].forms[form[i]], theta[k]) + extra[k] })), [lo, lo + 360 * perDeg], 0).positions.map((pos) => pos / perDeg), theta.forEach((t, k) => seatAt(k, t)), pass < 2) continue;
|
|
263
|
+
let crowded = !1;
|
|
264
|
+
for (let k = 0; k < n; k++) {
|
|
265
|
+
let next = (k + 1) % n;
|
|
266
|
+
next === k || !rectsOverlap(seats[ordered[k]].rect, seats[ordered[next]].rect, LABEL_GAP2 - 1) || (extra[k] += 4, extra[next] += 4, crowded = !0);
|
|
267
|
+
}
|
|
268
|
+
if (!crowded) break;
|
|
269
|
+
}
|
|
270
|
+
let bad = /* @__PURE__ */ new Set(), ends = seats.map((seat) => seat.to);
|
|
271
|
+
for (let i = 0; i < n; i++) {
|
|
272
|
+
let { rect, from } = seats[i];
|
|
273
|
+
(rect.x < plot.x || rect.y < plot.y || rect.x + rect.w > plot.x + plot.w || rect.y + rect.h > plot.y + plot.h) && bad.add(i), distToSegment(items[i].center(r), from, ends[i]) < r - 0.5 && bad.add(i);
|
|
274
|
+
for (let j = i + 1; j < n; j++)
|
|
275
|
+
rectsOverlap(rect, seats[j].rect, LABEL_GAP2 - 1) && (bad.add(i), bad.add(j)), segmentsCross(from, ends[i], seats[j].from, ends[j]) && (bad.add(i), bad.add(j));
|
|
276
|
+
for (let j = 0; j < n; j++) j !== i && segmentHitsRect(from, ends[i], seats[j].rect) && bad.add(i);
|
|
277
|
+
}
|
|
278
|
+
return { r, form: [...form], seats, bad };
|
|
279
|
+
}
|
|
280
|
+
var norm2 = (deg) => (deg % 360 + 360) % 360, WIDE_SLICE = 90, WIDE_INSET = 20;
|
|
281
|
+
function labelAngle(a0, a1) {
|
|
282
|
+
let mid = (a0 + a1) / 2;
|
|
283
|
+
if (a1 - a0 <= WIDE_SLICE) return mid;
|
|
284
|
+
let side = mid - norm2(mid) + (norm2(mid) < 180 ? 90 : 270);
|
|
285
|
+
return Math.min(a1 - WIDE_INSET, Math.max(a0 + WIDE_INSET, side));
|
|
286
|
+
}
|
|
287
|
+
function placeRing(items, r0, plot, minRadius) {
|
|
288
|
+
if (items.length === 0) return { r: r0, form: [], seats: [], bad: /* @__PURE__ */ new Set() };
|
|
289
|
+
let best, steps = [1, ...SHRINK_STEPS].flatMap((k) => k === 1 ? [[k, r0 + RING_GAP]] : [[k, r0 * k + RING_GAP], [k, r0 + RING_GAP]]);
|
|
290
|
+
for (let [k, ring] of steps) {
|
|
291
|
+
let r = r0 * k;
|
|
292
|
+
if (k < 1 && r < minRadius) break;
|
|
293
|
+
let form = items.map(() => 0);
|
|
294
|
+
for (let round = 0; round < 4; round++) {
|
|
295
|
+
let tried = seatRing(items, form, r, ring, plot);
|
|
296
|
+
if (tried.bad.size === 0) return tried;
|
|
297
|
+
(!best || tried.bad.size < best.bad.size) && (best = tried);
|
|
298
|
+
let changed = !1, shorter = items.map((item, i) => item.forms.reduce((j, f2, m) => arcSize(f2, item.mid) < arcSize(item.forms[j], item.mid) ? m : j, form[i])), pushed = items.map((item, i) => Math.abs((norm2(tried.seats[i].angle) - norm2(item.mid) + 540) % 360 - 180) > CROWDED_DEG || tried.bad.has(i)), order = items.map((_, i) => i).sort((a, b) => norm2(items[a].mid) - norm2(items[b].mid) || a - b), switching = items.map((_, i) => pushed[i] && shorter[i] !== form[i]);
|
|
299
|
+
if (order.forEach((i, k2) => {
|
|
300
|
+
let between = order.length > 2 && switching[order[(k2 + order.length - 1) % order.length]] && switching[order[(k2 + 1) % order.length]];
|
|
301
|
+
(pushed[i] || between) && shorter[i] !== form[i] && (form[i] = shorter[i], changed = !0);
|
|
302
|
+
}), !changed) break;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return best;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// src/core/charts/pie/layout.ts
|
|
309
|
+
var DEFAULT_TOP_N = { n: 7, rest: !0 }, DEFAULT_REST_MIN = 3, PIE_MIN_RADIUS = 36, PIE_STATIC_MIN_HEIGHT = 320, PIE_SLICE_LIMIT = 8, diameterCapFor = (width, ring) => Math.max(0.38 * width, Math.min((ring ? DOUGHNUT_CAP_SHARE : 0.44) * width, 210)), DOUGHNUT_CAP_SHARE = 0.5, OUTSIDE_MARGIN = 90, GREY_RAMP_FIRST = 0.2, GREY_RAMP_LAST = 0.74, GREY_RAMP_FLOOR = 1.4, INSIDE_MIN_DEG = 18, CENTER_TEXT_MIN = 0.35, COLUMN_GAP_RATIO = 0.036, COLUMN_GAP_MIN = 8, COLUMN_GAP_MAX = 36, MIN_COLUMN_HEIGHT = 320, VALUE_SHARE_SEP = " \xB7 ", CIRCLE_PAD = 8, OVERHANG_GAP = 12, CENTER_VALUE_MAX = 24, CENTER_VALUE_RATIO = 0.16;
|
|
310
|
+
function outsideLines(content, name, value, share, series) {
|
|
311
|
+
let lines = [], both = content.includes("absolute") && content.includes("percent");
|
|
312
|
+
for (let c of content)
|
|
313
|
+
c === "category" ? lines.push(...name.split(`
|
|
314
|
+
`)) : c === "absolute" ? lines.push(both ? `${value}${VALUE_SHARE_SEP}${share}` : value) : c === "percent" ? both || lines.push(share) : c === "series" && lines.push(series);
|
|
315
|
+
return lines;
|
|
316
|
+
}
|
|
317
|
+
function rectOnWedge(rect, g, ri, r) {
|
|
318
|
+
let corners = [
|
|
319
|
+
{ x: rect.x, y: rect.y },
|
|
320
|
+
{ x: rect.x + rect.w, y: rect.y },
|
|
321
|
+
{ x: rect.x + rect.w, y: rect.y + rect.h },
|
|
322
|
+
{ x: rect.x, y: rect.y + rect.h }
|
|
323
|
+
];
|
|
324
|
+
for (let edge = 0; edge < 4; edge++) {
|
|
325
|
+
let a = corners[edge], b = corners[(edge + 1) % 4];
|
|
326
|
+
for (let step = 0; step < 8; step++) {
|
|
327
|
+
let x = a.x + (b.x - a.x) * step / 8 - g.scx, y = a.y + (b.y - a.y) * step / 8 - g.scy, d = Math.hypot(x, y);
|
|
328
|
+
if (d > r || d < ri || ((Math.atan2(x, -y) * 180 / Math.PI - g.a0) % 360 + 360) % 360 > g.sweep) return !1;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return !0;
|
|
332
|
+
}
|
|
333
|
+
var UNLABELLED = /* @__PURE__ */ Symbol("pieUnlabelled"), FIXED_PASS = /* @__PURE__ */ Symbol("pieFixedPass"), BAD_FIRST = /* @__PURE__ */ Symbol("pieBadFirst");
|
|
334
|
+
function layoutPie(data, options = {}) {
|
|
335
|
+
let priority = drivePie(data, options);
|
|
336
|
+
if (!priority.swapped) return priority.geometry;
|
|
337
|
+
let plain = drivePie(data, { ...options, [BAD_FIRST]: !0 });
|
|
338
|
+
return plain.lost < priority.lost ? plain.geometry : priority.geometry;
|
|
339
|
+
}
|
|
340
|
+
function drivePie(data, options) {
|
|
341
|
+
let named = /* @__PURE__ */ new Map(), swapped = !1, run = (passOptions) => {
|
|
342
|
+
let result = layoutPiePass(data, passOptions);
|
|
343
|
+
return swapped ||= result.swapped, result;
|
|
344
|
+
}, pass = run(options);
|
|
345
|
+
if (pass.unlabelled.size > 0 && options[TARGET_SIZE]?.fixed.height === !1 && (options = { ...options, [FIXED_PASS]: !0 }, pass = run(options)), panelTypeClass(options) !== void 0) return { geometry: pass.geometry, lost: pass.unlabelled.size, swapped };
|
|
346
|
+
let owed = data.categories.length;
|
|
347
|
+
for (let round = 0; round <= owed && [...pass.unlabelled.keys()].some((id) => !named.has(id)); round++)
|
|
348
|
+
named = new Map([...named, ...pass.unlabelled]), pass = run({ ...options, [UNLABELLED]: named });
|
|
349
|
+
if (named.size > 0 && options[TARGET_SIZE]?.fixed.height === !1 && !disclosuresShown(options)) {
|
|
350
|
+
let room = hiddenValueNoteHeight(pass.geometry), { width, height } = pass.geometry.size, taller = room > 0 ? run({ ...options, size: { width, height: Math.ceil(height + room) } }) : void 0;
|
|
351
|
+
if (taller && taller.unlabelled.size === 0) return { geometry: taller.geometry, lost: 0, swapped };
|
|
352
|
+
}
|
|
353
|
+
return { geometry: pass.geometry, lost: (/* @__PURE__ */ new Set([...named.keys(), ...pass.unlabelled.keys()])).size, swapped };
|
|
354
|
+
}
|
|
355
|
+
function layoutPiePass(data, options) {
|
|
356
|
+
let named = options[UNLABELLED] ?? /* @__PURE__ */ new Map(), swapped = !1, warnings = [], theme = chartTheme(options), paletteRamp = chartPalette(theme, options.palette, warnings), size = resolveSize(options.size), measure = options.measure ?? defaultMeasurer, chartFmt = options.format ? formatterFromExample(options.format, options.locale?.language) : (v) => formatAutomaticNumber(v, { locale: options.locale?.language, decimals: autoDecimals(v) }), highlights = new Set(resolveHighlight(options.highlight)), density = options.labelDensity ?? "smart";
|
|
357
|
+
if (!data || !Array.isArray(data.categories) || data.categories.length === 0)
|
|
358
|
+
throw new NormalizeError("empty-data", "categories", "pie requires at least one category");
|
|
359
|
+
if (!Array.isArray(data.series) || data.series.length === 0)
|
|
360
|
+
throw new NormalizeError("empty-data", "series", "pie requires exactly one series");
|
|
361
|
+
let ser = data.series.filter((s) => s.role !== "reference")[0] ?? data.series[0];
|
|
362
|
+
if (!ser.id) throw new NormalizeError("missing-id", "series[0]", "series requires an id");
|
|
363
|
+
data.series.length > 1 && warnings.push({
|
|
364
|
+
code: "pie-single-series",
|
|
365
|
+
severity: "warn",
|
|
366
|
+
message: `pie plots exactly one series \u2014 using '${ser.id}', ignoring ` + data.series.filter((s) => s !== ser).map((s) => `'${s.id}'`).join(", "),
|
|
367
|
+
owner: { seriesId: ser.id },
|
|
368
|
+
suggest: "use one series per pie, or a column/bar chart for multi-series comparison"
|
|
369
|
+
});
|
|
370
|
+
let sid = ser.id, cats = data.categories.map((c, i) => normalizeCategory(c, i)), cells = normalizeSeriesValues(ser, cats, 0), formats = seriesRasterFormatter(options.format, cells.map(cellValue), options.locale?.language, options.unit, options.target), fmt = ser.format || ser.unit ? formats.forSeries(ser) : options.format ? chartFmt : seriesValueFormatter(cells.map(cellValue), options.locale?.language), sliceText = (slice) => slice.format ? formatterFromExample(slice.format, options.locale?.language)(slice.v) : fmt(slice.v);
|
|
371
|
+
warnIncompleteComposition(
|
|
372
|
+
warnings,
|
|
373
|
+
cats.filter((_, ci) => cellValue(cells[ci]) === null).map((cat) => cat.label ?? cat.id),
|
|
374
|
+
"the whole is not known, so the printed shares are of the known slices only"
|
|
375
|
+
);
|
|
376
|
+
let slices = cats.map((cat, ci) => {
|
|
377
|
+
let cell = cells[ci], meta = cellMeta(cell), v = cellValue(cell);
|
|
378
|
+
return v !== null && v < 0 && (warnings.push({
|
|
379
|
+
code: "pie-negative-value",
|
|
380
|
+
severity: "warn",
|
|
381
|
+
message: `category '${cat.id}': negative value ${v} cannot be a share \u2014 slice dropped`,
|
|
382
|
+
owner: { seriesId: sid, categoryId: cat.id },
|
|
383
|
+
suggest: "use a waterfall or bar chart for signed contributions"
|
|
384
|
+
}), v = null), {
|
|
385
|
+
cat,
|
|
386
|
+
v,
|
|
387
|
+
fill: meta?.fill,
|
|
388
|
+
format: meta?.format,
|
|
389
|
+
labelOverride: meta?.label,
|
|
390
|
+
priority: meta?.priority,
|
|
391
|
+
isOthers: !1
|
|
392
|
+
};
|
|
393
|
+
}), catSort = options.sort?.categories ?? "desc";
|
|
394
|
+
if (catSort !== "sheet")
|
|
395
|
+
if (catSort === "reverse") slices = [...slices].reverse();
|
|
396
|
+
else {
|
|
397
|
+
let dir = catSort === "asc" ? 1 : -1;
|
|
398
|
+
slices = [...slices].map((s, i) => ({ s, i })).sort((a, b) => ((a.s.v ?? 0) - (b.s.v ?? 0)) * dir || a.i - b.i).map((x) => x.s);
|
|
399
|
+
}
|
|
400
|
+
let topN = options.topN ?? DEFAULT_TOP_N;
|
|
401
|
+
if (topN && topN.n > 0 && slices.length > topN.n && (options.topN !== void 0 || slices.length - topN.n >= DEFAULT_REST_MIN)) {
|
|
402
|
+
let cut = topNCut(slices.map((s) => Math.abs(s.v ?? 0)), topN.n), kept = cut.kept.map((i) => slices[i]), dropped = cut.dropped.map((i) => slices[i]);
|
|
403
|
+
if (topN.rest === !1 || dropped.length === 0)
|
|
404
|
+
slices = kept;
|
|
405
|
+
else {
|
|
406
|
+
let othersId = "others";
|
|
407
|
+
for (; slices.some((s) => s.cat.id === othersId); ) othersId = `_${othersId}`;
|
|
408
|
+
slices = [...kept, { cat: { id: othersId, label: restLabel(topN, options.strings, dropped.length) }, v: restSum(dropped.map((s) => s.v)), isOthers: !0 }];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
slices.length > PIE_SLICE_LIMIT && warnings.push({
|
|
412
|
+
code: "pie-too-many-slices",
|
|
413
|
+
severity: "warn",
|
|
414
|
+
message: `${slices.length} slices exceed the ${PIE_SLICE_LIMIT}-slice readability limit`,
|
|
415
|
+
suggest: "aggregate with topN: { n: 7, rest: true } or switch to a bar chart"
|
|
416
|
+
});
|
|
417
|
+
let total = slices.reduce((a, s) => a + (s.v ?? 0), 0);
|
|
418
|
+
if (total <= 0)
|
|
419
|
+
throw new NormalizeError("empty-data", "series", "pie requires a positive total");
|
|
420
|
+
let shares = emptyIdRecord();
|
|
421
|
+
for (let s of slices) shares[s.cat.id] = round2((s.v ?? 0) / total * 100);
|
|
422
|
+
let paintCss = (p) => paintColor(theme, p), rampCount = Math.max(1, slices.filter((s) => !s.isOthers).length), apartShade = (options.othersShade ?? DEFAULT_OTHERS_SHADE) === "apart", hasOthers = slices.some((s) => s.isOthers), withOthers = hasOthers ? { withOthers: !0, ...apartShade ? { othersShade: "apart" } : {} } : {}, greyRest = slices.some((s) => highlights.has(s.cat.id)), greyCount = slices.filter((s) => !highlights.has(s.cat.id) && (s.v ?? 0) > 0).length, colorMode = options.colors ?? (slices.length <= 4 && options.palette === void 0 && options.topN === void 0 ? "categorical" : "sequential"), rampBase = seriesPaint(0, paletteRamp ? options.palette : void 0), paintWarningRules = colorMode === "sequential" && !greyRest ? [
|
|
423
|
+
{ kind: "pie-ramp-crowded", base: rampBase, count: rampCount, ...withOthers, before: warnings.length },
|
|
424
|
+
...hasOthers && !apartShade ? [{ kind: "others-shade-unavailable", base: rampBase, before: warnings.length }] : []
|
|
425
|
+
] : [];
|
|
426
|
+
warnings.push(...resolvePaintWarnings(theme, paintWarningRules));
|
|
427
|
+
let rampPaint = (index) => ({
|
|
428
|
+
token: "token" in rampBase ? rampBase.token : "series-1",
|
|
429
|
+
theme: { kind: "pie-ramp", base: rampBase, index, count: rampCount, ...withOthers }
|
|
430
|
+
}), rampIdx = 0, storyIdx = 0, greyIdx = 0, greyPaint = (index) => ({ token: "neutralMark", theme: {
|
|
431
|
+
kind: "visible-tint",
|
|
432
|
+
base: { token: "neutralMark" },
|
|
433
|
+
floor: GREY_RAMP_FLOOR,
|
|
434
|
+
amount: Number((greyCount <= 1 ? GREY_RAMP_FIRST : GREY_RAMP_FIRST + (GREY_RAMP_LAST - GREY_RAMP_FIRST) * index / (greyCount - 1)).toFixed(3))
|
|
435
|
+
} }), slicePaint = (s) => {
|
|
436
|
+
if (greyRest) {
|
|
437
|
+
if (!highlights.has(s.cat.id)) {
|
|
438
|
+
let g = (s.v ?? 0) > 0 ? greyIdx++ : 0;
|
|
439
|
+
return s.fill ? { css: s.fill } : greyPaint(g);
|
|
440
|
+
}
|
|
441
|
+
let k = storyIdx++;
|
|
442
|
+
return s.fill ? { css: s.fill } : seriesPaint(k, paletteRamp ? options.palette : void 0);
|
|
443
|
+
}
|
|
444
|
+
if (s.isOthers) return { token: "othersMark" };
|
|
445
|
+
let i = rampIdx++;
|
|
446
|
+
return s.fill ? { css: s.fill } : ser.colorRole && rampCount === 1 ? markRolePaint(ser.colorRole, !0) : colorMode === "categorical" ? seriesPaint(i, paletteRamp ? options.palette : void 0) : rampPaint(i);
|
|
447
|
+
}, paints = slices.map((s) => slicePaint(s)), occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { ...canvasMargin(theme, size.width), ...options.margin }, legendInput;
|
|
448
|
+
if (options.legend && options.legend !== "none" && options.legend !== "auto") {
|
|
449
|
+
let legendOpts = normalizeLegendOption(options.legend), items = slices.flatMap((s, i) => (s.v ?? 0) > 0 ? [{
|
|
450
|
+
id: s.cat.id,
|
|
451
|
+
label: s.cat.label ?? s.cat.id,
|
|
452
|
+
paint: paints[i]
|
|
453
|
+
}] : []);
|
|
454
|
+
if (legendOpts.order) {
|
|
455
|
+
let oi = (id) => {
|
|
456
|
+
let k = legendOpts.order.indexOf(id);
|
|
457
|
+
return k === -1 ? Number.MAX_SAFE_INTEGER : k;
|
|
458
|
+
};
|
|
459
|
+
items = [...items].sort((a, b) => oi(a.id) - oi(b.id));
|
|
460
|
+
}
|
|
461
|
+
legendInput = { options: legendOpts, items };
|
|
462
|
+
}
|
|
463
|
+
let sliceKey = legendInput !== void 0, displayedCount = slices.filter((slice) => (slice.v ?? 0) > 0).length, { insideContent, outsideContent, kindSetting } = pieLabelContent(options, displayedCount, sliceKey), labelFont = { family: theme.type.family, ...theme.type.label }, lineH = measure("0", labelFont).height, widestSliceWord = Math.max(
|
|
464
|
+
0,
|
|
465
|
+
maxOf(slices.flatMap((slice) => (slice.cat.label ?? slice.cat.id).split(/\s+/)).map((word) => measure(word, labelFont).width))
|
|
466
|
+
), columns = insideContent === null && outsideContent !== null, shownSlices = slices.filter((slice) => (slice.v ?? 0) > 0), preShares = shareSetFormatter(shownSlices.map((slice) => (slice.v ?? 0) / total * 100), options.locale?.language), preLines = (slice) => outsideLines(outsideContent ?? [], slice.cat.label ?? slice.cat.id, sliceText({ v: slice.v ?? 0, format: slice.format }), preShares.format((slice.v ?? 0) / total * 100), ser.label ?? sid), column = (() => {
|
|
467
|
+
let heights = [0, 0], counts = [0, 0], widths = [0, 0];
|
|
468
|
+
if (!columns) return { heights, counts, widths };
|
|
469
|
+
let at = 0;
|
|
470
|
+
for (let slice of shownSlices) {
|
|
471
|
+
let mid = (((options.rotate ?? 0) + (at + (slice.v ?? 0) / 2) / total * 360) % 360 + 360) % 360;
|
|
472
|
+
at += slice.v ?? 0;
|
|
473
|
+
let side = mid < 180 ? 0 : 1, lines = preLines(slice);
|
|
474
|
+
heights[side] += lines.length * lineH, counts[side]++, widths[side] = Math.max(widths[side], ...lines.map((line) => measure(line, labelFont).width));
|
|
475
|
+
}
|
|
476
|
+
return { heights, counts, widths };
|
|
477
|
+
})(), columnStack = maxOf(column.heights.map((h, i) => h + 3 * Math.max(0, column.counts[i] - 1) + 4)), columnOverhang = (radius) => {
|
|
478
|
+
let out = { top: 0, bottom: 0 };
|
|
479
|
+
if (!columns) return out;
|
|
480
|
+
let at = 0;
|
|
481
|
+
for (let slice of shownSlices) {
|
|
482
|
+
let a0 = (options.rotate ?? 0) + at / total * 360;
|
|
483
|
+
at += slice.v ?? 0;
|
|
484
|
+
let mid = labelAngle(a0, (options.rotate ?? 0) + at / total * 360) * Math.PI / 180, h = preLines(slice).length * lineH, reach = (radius + RING_GAP) * Math.abs(Math.cos(mid)) + h / 2 * (1 + Math.abs(Math.cos(mid))) - radius;
|
|
485
|
+
Math.cos(mid) > 0 ? out.top = Math.max(out.top, reach) : out.bottom = Math.max(out.bottom, reach);
|
|
486
|
+
}
|
|
487
|
+
return out;
|
|
488
|
+
}, calloutRoom = (above) => (options.annotations ?? []).some((a) => a.kind === "callout" && (above ? a.preferSide === "above" : a.preferSide === void 0 || a.preferSide === "below")) ? lineH + OVERHANG_GAP : 0, circlePads = (radius) => {
|
|
489
|
+
let over = columnOverhang(radius);
|
|
490
|
+
return { top: Math.max(CIRCLE_PAD, over.top + OVERHANG_GAP + calloutRoom(!0)), bottom: Math.max(CIRCLE_PAD, over.bottom + OVERHANG_GAP + calloutRoom(!1)) };
|
|
491
|
+
}, columnGap = (width) => Math.max(COLUMN_GAP_MIN, Math.min(COLUMN_GAP_MAX, width * COLUMN_GAP_RATIO)), sideReserve = (side, width) => column.counts[side] > 0 ? columnGap(width) + column.widths[side] + 2 : 0, outsideReserve = (width) => columns ? (sideReserve(0, width) + sideReserve(1, width)) / 2 : Math.max(OUTSIDE_MARGIN, Math.min(width * 0.3, 4 * lineH + 10 + widestSliceWord)), diameterCap = !(options[TARGET_SIZE]?.fixed.height === !0) && panelTypeClass(options) === void 0 ? diameterCapFor(size.width, (options.doughnut ?? 0) >= CENTER_TEXT_MIN) : Number.POSITIVE_INFINITY, diameterFor = (plotW) => Math.min(diameterCap, Math.max(40, plotW - 2 * outsideReserve(plotW))), arcRoom = (options.annotations ?? []).some((a) => a.kind === "cagr" || a.kind === "diff") ? pieComparisonRoom(measure("0", { family: theme.type.family, ...theme.type.label, weight: emphasisWeight(theme) }).height) : 0, automatic = !options[FIXED_PASS] && options[TARGET_SIZE]?.fixed.height === !1 && panelTypeClass(options) === void 0, maxLines = outsideContent?.reduce((sum, part) => sum + (part === "category" ? 2 : 1), 0) ?? 0, maxStack = displayedCount * Math.max(1, maxLines) * lineH + 3 * Math.max(0, displayedCount - 1) + 4, frameResult = solveFrame(
|
|
492
|
+
{
|
|
493
|
+
size,
|
|
494
|
+
...automatic && legendInput?.options.position !== "right" ? { autoHeight: (plot2) => {
|
|
495
|
+
if (columns) {
|
|
496
|
+
let diameter = diameterFor(plot2.w), pads = circlePads(diameter / 2), need = Math.max(diameter + 2 * arcRoom + pads.top + pads.bottom, columnStack + 8);
|
|
497
|
+
return Math.ceil(Math.max(MIN_COLUMN_HEIGHT, size.height - plot2.h + need));
|
|
498
|
+
}
|
|
499
|
+
let circleHeight = diameterFor(plot2.w) + 48;
|
|
500
|
+
return circleHeight >= maxStack ? Math.ceil(Math.max(320, size.height - plot2.h + circleHeight)) : void 0;
|
|
501
|
+
} } : {},
|
|
502
|
+
margin,
|
|
503
|
+
...frameTextOptions(options),
|
|
504
|
+
footnotes: [
|
|
505
|
+
...authoredNotes(options),
|
|
506
|
+
...valueNoteLine(chartString(options, "pieHiddenSlices", { v1: named.size, v2: named.size === 1 ? "slice" : "slices" }), [...named.values()], options)
|
|
507
|
+
],
|
|
508
|
+
legend: legendInput,
|
|
509
|
+
theme,
|
|
510
|
+
measure
|
|
511
|
+
},
|
|
512
|
+
occupied
|
|
513
|
+
), plot = frameResult.plot, cx = plot.x + plot.w / 2, cy = plot.y + plot.h / 2, insidePossible = insideContent !== null && slices.some((slice) => slice.labelOverride !== !1 && (slice.v ?? 0) / total * 360 >= INSIDE_MIN_DEG), hole = Math.max(0, Math.min(insidePossible ? 0.72 : 0.9, options.doughnut ?? 0)), rotate = options.rotate ?? 0, explode = Object.assign(emptyIdRecord(), options.explode), sliceIds = new Set(slices.map((s) => s.cat.id));
|
|
514
|
+
for (let id of Object.keys(options.explode ?? {}).sort())
|
|
515
|
+
sliceIds.has(id) || warnings.push({
|
|
516
|
+
code: "explode-unknown-id",
|
|
517
|
+
severity: "info",
|
|
518
|
+
message: `explode['${id}'] does not match any slice \u2014 ignored`
|
|
519
|
+
});
|
|
520
|
+
let outsideMargin = outsideReserve(plot.w), naturalPads = columns && automatic ? circlePads(diameterFor(plot.w) / 2) : void 0, verticalPad = naturalPads ? (naturalPads.top + naturalPads.bottom) / 2 : 24, baseFit = Math.max(
|
|
521
|
+
20,
|
|
522
|
+
Math.min((plot.w - 2 * outsideMargin) / 2, plot.h / 2 - verticalPad, diameterCap / 2) - arcRoom
|
|
523
|
+
);
|
|
524
|
+
if (columns) {
|
|
525
|
+
let left = sideReserve(1, plot.w);
|
|
526
|
+
cx = plot.x + (plot.w - left - 2 * baseFit - sideReserve(0, plot.w)) / 2 + left + baseFit;
|
|
527
|
+
}
|
|
528
|
+
let maxAuthoredExplode = slices.reduce(
|
|
529
|
+
(max, slice) => (slice.v ?? 0) > 0 ? Math.max(max, Math.max(0, explode[slice.cat.id] ?? 0)) : max,
|
|
530
|
+
0
|
|
531
|
+
), r = baseFit / (1 + maxAuthoredExplode), pieMinWidth = 0;
|
|
532
|
+
if (!automatic) {
|
|
533
|
+
frameResult.frame.plotMinHeight = Math.max(frameResult.frame.plotMinHeight ?? 0, Math.ceil(size.height + (frameResult.deficit ?? 0) + 2 * (PIE_MIN_RADIUS * (1 + maxAuthoredExplode) + arcRoom + verticalPad) - plot.h));
|
|
534
|
+
let radiusAt = (width) => (width - 2 * outsideReserve(width)) / 2 - arcRoom, need = PIE_MIN_RADIUS * (1 + maxAuthoredExplode);
|
|
535
|
+
if (size.height < PIE_STATIC_MIN_HEIGHT && radiusAt(plot.w) < need) {
|
|
536
|
+
let width = Math.ceil(plot.w);
|
|
537
|
+
for (; radiusAt(width) < need && width < 4 * size.width; ) width += 4;
|
|
538
|
+
pieMinWidth = Math.ceil(size.width - plot.w + width);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
let ri = r * hole;
|
|
542
|
+
if (columns) {
|
|
543
|
+
let pads = circlePads(baseFit), spare = plot.h - 2 * (baseFit + arcRoom) - pads.top - pads.bottom;
|
|
544
|
+
spare >= 0 && (cy = plot.y + pads.top + arcRoom + baseFit + spare / 2);
|
|
545
|
+
}
|
|
546
|
+
let polar3 = (pcx, pcy, radius, deg) => {
|
|
547
|
+
let rad2 = deg * Math.PI / 180;
|
|
548
|
+
return { x: pcx + radius * Math.sin(rad2), y: pcy - radius * Math.cos(rad2) };
|
|
549
|
+
}, buildGeoms = () => {
|
|
550
|
+
let geoms2 = [], cum = 0;
|
|
551
|
+
return slices.forEach((s, i) => {
|
|
552
|
+
let v = s.v ?? 0;
|
|
553
|
+
if (v <= 0) return;
|
|
554
|
+
let share = v / total, a0 = rotate + cum / total * 360;
|
|
555
|
+
cum += v;
|
|
556
|
+
let a1 = rotate + cum / total * 360, mid = (a0 + a1) / 2, e = Math.max(0, explode[s.cat.id] ?? 0), off = polar3(0, 0, e * r, mid), paint = paints[i];
|
|
557
|
+
geoms2.push({
|
|
558
|
+
cat: s.cat,
|
|
559
|
+
v,
|
|
560
|
+
share,
|
|
561
|
+
a0,
|
|
562
|
+
a1,
|
|
563
|
+
mid,
|
|
564
|
+
sweep: a1 - a0,
|
|
565
|
+
scx: cx + off.x,
|
|
566
|
+
scy: cy + off.y,
|
|
567
|
+
paint,
|
|
568
|
+
fillCss: paintCss(paint),
|
|
569
|
+
isOthers: s.isOthers,
|
|
570
|
+
labelOverride: s.labelOverride,
|
|
571
|
+
format: s.format,
|
|
572
|
+
priority: s.priority
|
|
573
|
+
});
|
|
574
|
+
}), geoms2;
|
|
575
|
+
}, geoms = buildGeoms(), strongFont = { family: theme.type.family, ...theme.type.label, weight: emphasisWeight(theme) }, roomBeside = (g) => {
|
|
576
|
+
let dy = polar3(g.scx, g.scy, r + 4, g.mid).y - g.scy, halfW = Math.sqrt(Math.max(0, r * r - dy * dy)), anchorX = polar3(g.scx, g.scy, r + RING_GAP, g.mid).x, centred = Math.abs(Math.cos(g.mid * Math.PI / 180)) >= 0.9 ? 2 * Math.min(anchorX - plot.x, plot.x + plot.w - anchorX) - 4 : 0, edge = (g.mid % 360 + 360) % 360 < 180 ? plot.x + plot.w - (g.scx + halfW) : g.scx - halfW - plot.x;
|
|
577
|
+
return Math.max(40, centred, edge - RING_GAP - 2, columns ? plot.w / 2 - baseFit - columnGap(plot.w) - 2 : 0);
|
|
578
|
+
}, rounded = options.rounding === "sum-consistent" ? roundWholes([{ id: sid, name: ser.label ?? sid, parts: geoms.map((g) => ({ id: g.cat.id, name: g.cat.label ?? g.cat.id, share: g.share * 100 })) }], options.locale?.language) : void 0;
|
|
579
|
+
rounded && pushAll(warnings, rounded.warnings);
|
|
580
|
+
let shareSet = shareSetFormatter(geoms.map((g) => g.share * 100), options.locale?.language), shareText = (g) => rounded?.texts.get(`${sid}\0${g.cat.id}`) ?? shareSet.format(g.share * 100), composeParts = (g, content, wrapW) => {
|
|
581
|
+
let abs = sliceText(g), both = content.includes("absolute") && content.includes("percent"), joined = both && wrapW !== void 0, parts = [], full = [], cut = !1;
|
|
582
|
+
for (let c of content) {
|
|
583
|
+
if (c === "absolute") parts.push(joined ? `${abs}${VALUE_SHARE_SEP}${shareText(g)}` : abs);
|
|
584
|
+
else if (c === "percent") {
|
|
585
|
+
if (joined) continue;
|
|
586
|
+
let p = shareText(g);
|
|
587
|
+
parts.push(both ? `(${p})` : p);
|
|
588
|
+
} else if (c === "category") {
|
|
589
|
+
let name = g.cat.label ?? g.cat.id, wrapped = wrapW === void 0 ? { lines: [name], truncated: !1 } : wrapText(name, labelFont, wrapW, 2, measure);
|
|
590
|
+
parts.push(...wrapped.lines), full.push(name), cut ||= wrapped.truncated;
|
|
591
|
+
continue;
|
|
592
|
+
} else c === "series" && parts.push(ser.label ?? sid);
|
|
593
|
+
full.push(parts[parts.length - 1]);
|
|
594
|
+
}
|
|
595
|
+
return { parts, ...cut ? { title: full.join(" ") } : {} };
|
|
596
|
+
}, applyOverride = (g, text) => typeof g.labelOverride == "string" ? g.labelOverride.replace(/\$\{value\}/g, sliceText(g)) : text, insideCandidate = (g, w, h) => {
|
|
597
|
+
let rl = ri > 0 ? (ri + r) / 2 : r * 0.68, p = polar3(g.scx, g.scy, rl, g.mid), rect = { x: p.x - w / 2, y: p.y - h / 2, w, h }, chord = 2 * rl * Math.sin(Math.min(g.sweep, 180) / 2 * (Math.PI / 180)), radial = ri > 0 ? r - ri : r * 0.6, fits = w + 6 <= chord && h + 4 <= radial;
|
|
598
|
+
return (fits || w <= chord && h <= radial) && rectOnWedge(rect, g, ri, r) ? { slot: fits ? "insideEdge" : "insideEdgeTight", rect, penalty: 0, insideFill: g.fillCss, insidePaint: g.paint } : void 0;
|
|
599
|
+
}, buildSliceLabels = () => {
|
|
600
|
+
let sliceLabels2 = [];
|
|
601
|
+
for (let g of geoms) {
|
|
602
|
+
if (named.has(g.cat.id)) continue;
|
|
603
|
+
let blockOf = (inside) => {
|
|
604
|
+
let content = inside ? insideContent : outsideContent;
|
|
605
|
+
if (!content) return;
|
|
606
|
+
let { parts, title: title2 } = composeParts(g, content, inside ? void 0 : roomBeside(g)), lines2 = typeof g.labelOverride == "string" ? [applyOverride(g, parts.join(" "))] : parts, w2 = Math.max(...lines2.map((l) => measure(l, labelFont).width), 1);
|
|
607
|
+
return { lines: lines2, title: title2, w: w2, h: lineH * Math.max(lines2.length, 1) };
|
|
608
|
+
}, insideEligible = insideContent !== null && g.sweep >= INSIDE_MIN_DEG, block = blockOf(insideEligible);
|
|
609
|
+
if (insideEligible && block && !insideCandidate(g, block.w, block.h) && (insideEligible = !1, block = blockOf(!1)), !block) continue;
|
|
610
|
+
let { lines, title, w, h } = block, text = lines.join(" ");
|
|
611
|
+
if (!text && g.labelOverride !== !1) continue;
|
|
612
|
+
let outsideBlock = insideEligible ? blockOf(!1) : void 0, outside = outsideBlock && outsideBlock.lines.join(" ") !== text ? { lines: outsideBlock.lines, text: outsideBlock.lines.join(" "), ...outsideBlock.title !== void 0 && typeof g.labelOverride != "string" ? { title: outsideBlock.title } : {}, w: outsideBlock.w, h: outsideBlock.h, ...namesOnly(outsideContent, g.labelOverride) } : void 0;
|
|
613
|
+
sliceLabels2.push({
|
|
614
|
+
g,
|
|
615
|
+
insideEligible,
|
|
616
|
+
kind: insideEligible ? "insidePie" : "outsidePie",
|
|
617
|
+
lines,
|
|
618
|
+
text,
|
|
619
|
+
...title !== void 0 && typeof g.labelOverride != "string" ? { title } : {},
|
|
620
|
+
w,
|
|
621
|
+
h,
|
|
622
|
+
...outside ? { outside } : {}
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
return sliceLabels2;
|
|
626
|
+
}, sliceLabels = buildSliceLabels();
|
|
627
|
+
!rounded && sliceLabels.some((sl) => (sl.insideEligible ? insideContent : outsideContent)?.includes("percent")) && warnShareRoundingDrift(warnings, [{ name: ser.label ?? sid, shares: geoms.map((g) => g.share * 100), decimals: shareSet.decimals }]);
|
|
628
|
+
let labelPriority = (g) => g.priority ?? PRIORITY.interior + Math.min(99, Math.round(g.share * 1e3) / 10) + (highlights.has(g.cat.id) ? PRIORITY.highlightBonus : 0);
|
|
629
|
+
function seatRingLabels() {
|
|
630
|
+
let oneLineOf = (form) => {
|
|
631
|
+
let lines = [form.lines.join(" ")];
|
|
632
|
+
return { lines, text: lines[0], w: Math.max(measure(lines[0], labelFont).width, 1), h: lineH };
|
|
633
|
+
}, itemOf = (sl) => {
|
|
634
|
+
let form = sl.outside ?? sl, r0 = r, off = { x: sl.g.scx - cx, y: sl.g.scy - cy };
|
|
635
|
+
return {
|
|
636
|
+
mid: labelAngle(sl.g.a0, sl.g.a1),
|
|
637
|
+
center: (radius) => ({ x: cx + off.x * radius / r0, y: cy + off.y * radius / r0 }),
|
|
638
|
+
forms: form.lines.length > 1 && (!sl.insideEligible || sl.outside) ? [form, oneLineOf(form)] : [form]
|
|
639
|
+
};
|
|
640
|
+
}, dropped = /* @__PURE__ */ new Set(), seatAll = (minRadius) => {
|
|
641
|
+
let spread = sliceLabels.filter((sl) => !sl.insideEligible && !dropped.has(sl.g.cat.id)), ring = placeRing(spread.map(itemOf), r, plot, minRadius), lowest = (pool) => pool.reduce((low, sl) => labelPriority(sl.g) <= labelPriority(low.g) ? sl : low);
|
|
642
|
+
for (; ring.bad.size > 0; ) {
|
|
643
|
+
let drop = lowest(spread.filter((_, k) => ring.bad.has(k))), last = lowest(spread), rest = spread.filter((sl) => sl !== last), freed = last !== drop && !options[BAD_FIRST] ? placeRing(rest.map(itemOf), r, plot, minRadius) : void 0;
|
|
644
|
+
freed && freed.bad.size < ring.bad.size && (drop = last, swapped = !0), dropped.add(drop.g.cat.id), spread = spread.filter((sl) => sl !== drop), ring = drop === last && freed ? freed : placeRing(spread.map(itemOf), r, plot, minRadius);
|
|
645
|
+
}
|
|
646
|
+
let seats = new Map(spread.map((sl, k) => [sl, { seat: ring.seats[k], form: ring.form[k], bad: ring.bad.has(k) }]));
|
|
647
|
+
for (let sl of sliceLabels) {
|
|
648
|
+
if (seats.has(sl) || dropped.has(sl.g.cat.id)) continue;
|
|
649
|
+
let alone = placeRing([itemOf(sl)], ring.r, plot, ring.r);
|
|
650
|
+
seats.set(sl, { seat: alone.seats[0], form: alone.form[0], bad: alone.bad.size > 0 });
|
|
651
|
+
}
|
|
652
|
+
return { ring, seats };
|
|
653
|
+
}, placed = seatAll(Math.max(PIE_MIN_RADIUS, 0.7 * r));
|
|
654
|
+
placed.ring.r < r && (r = placed.ring.r, ri = r * hole, geoms = buildGeoms(), sliceLabels = buildSliceLabels(), placed = seatAll(r)), warnSpreadOverflow(warnings, dropped.size === 0, "outside slice labels do not all fit round the pie \u2014 the labels that find no seat near their slices are named in the note; fewer slices or a larger canvas fixes it");
|
|
655
|
+
for (let [sl, { seat, form, bad }] of placed.seats) {
|
|
656
|
+
if (bad) continue;
|
|
657
|
+
let target = sl.outside ?? sl;
|
|
658
|
+
if (form === 1) {
|
|
659
|
+
let valueLine = target.lines.findIndex((line) => line.includes(VALUE_SHARE_SEP));
|
|
660
|
+
valueLine === target.lines.length - 1 && valueLine > 0 && oneLineValueAt.set(`${sl.insideEligible ? "insidePie" : "outsidePie"}:${sid}:${sl.g.cat.id}`, target.lines.slice(0, valueLine).join(" ").length + 1), Object.assign(target, oneLineOf(target));
|
|
661
|
+
}
|
|
662
|
+
outsideSlot.set(sl.g.cat.id, { rect: seat.rect, anchor: seat.from, end: seat.to });
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
let outsideSlot = /* @__PURE__ */ new Map(), oneLineValueAt = /* @__PURE__ */ new Map(), outsideStackH = 0;
|
|
666
|
+
for (let right of [!0, !1]) {
|
|
667
|
+
let outsideOnly = sliceLabels.filter((sl) => !sl.insideEligible && (sl.g.mid % 360 + 360) % 360 < 180 === right);
|
|
668
|
+
outsideOnly.length > 0 && (outsideStackH = Math.max(outsideStackH, outsideOnly.reduce((sum, sl) => sum + sl.h, 0) + 3 * (outsideOnly.length - 1) + 4));
|
|
669
|
+
}
|
|
670
|
+
seatRingLabels();
|
|
671
|
+
let nodes = [...frameResult.nodes], marks = { slices: [] }, exploded = (g) => g.scx !== cx || g.scy !== cy;
|
|
672
|
+
geoms.forEach((g, gi) => {
|
|
673
|
+
let nodeId = `mark:${sid}:${g.cat.id}`, neighbours = geoms.length >= 3 ? [geoms[(gi + geoms.length - 1) % geoms.length], geoms[(gi + 1) % geoms.length]] : [], arc = r * g.sweep * Math.PI / 180, joined = neighbours.length > 0 && ![g, ...neighbours].some(exploded) && arc > 2 * strokeToken(theme, "rule"), f1 = {
|
|
674
|
+
// The note item that names the slice with its value, if the frame draws it.
|
|
675
|
+
...named.has(g.cat.id) && !namesOnly(outsideContent ?? insideContent ?? [], void 0).printsFor ? { notedAs: named.get(g.cat.id) } : {},
|
|
676
|
+
...joined ? { bounds: neighbours.map((n) => n.paint) } : {}
|
|
677
|
+
};
|
|
678
|
+
nodes.push({
|
|
679
|
+
t: "path",
|
|
680
|
+
id: nodeId,
|
|
681
|
+
d: slicePath(g.scx, g.scy, r, ri, g.a0, g.a1),
|
|
682
|
+
fill: g.paint,
|
|
683
|
+
separation: { fill: g.paint, backing: { token: "background" }, fallback: { stroke: { token: "background" }, strokeWidth: strokeToken(theme, "rule") }, ...f1 },
|
|
684
|
+
// One closed stroke bounds the slice on its arc and both radial edges.
|
|
685
|
+
...((sep) => sep ? { stroke: sep.stroke, width: sep.strokeWidth } : { stroke: { token: "background" }, width: strokeToken(theme, "rule") })(
|
|
686
|
+
// A theme's `marks.sliceOutline: false` keeps the page separator alone.
|
|
687
|
+
sliceOutlineOff("slice", theme) || markOutlineOff(g.paint, theme) ? void 0 : separationStroke(paintCss(g.paint), theme.color.background, theme)
|
|
688
|
+
),
|
|
689
|
+
owner: { seriesId: sid, categoryId: g.cat.id },
|
|
690
|
+
part: "slice",
|
|
691
|
+
display: { value: sliceText(g) }
|
|
692
|
+
}), claimWedge(occupied, { seriesId: sid, categoryId: g.cat.id }, g, r, ri, polar3), marks.slices.push({
|
|
693
|
+
categoryId: g.cat.id,
|
|
694
|
+
nodeId,
|
|
695
|
+
midAngle: round2((g.mid % 360 + 360) % 360),
|
|
696
|
+
value: g.v,
|
|
697
|
+
share: round4(g.share)
|
|
698
|
+
});
|
|
699
|
+
});
|
|
700
|
+
let labelRequests = [], leaderAnchors = /* @__PURE__ */ new Map(), unseated = [];
|
|
701
|
+
for (let sl of sliceLabels) {
|
|
702
|
+
let { g, kind, lines, text, title, w, h } = sl, candidates = [], inside = sl.insideEligible ? insideCandidate(g, w, h) : void 0;
|
|
703
|
+
inside && candidates.push(inside);
|
|
704
|
+
let out = outsideSlot.get(g.cat.id);
|
|
705
|
+
if (out && (candidates.push({
|
|
706
|
+
slot: "outside",
|
|
707
|
+
rect: out.rect,
|
|
708
|
+
penalty: candidates.length
|
|
709
|
+
// Its straight leader is drawn after the solve (routeOutsideLeaders).
|
|
710
|
+
}), leaderAnchors.set(g.cat.id, { from: out.anchor, to: out.end })), candidates.length === 0) {
|
|
711
|
+
unseated.push(g);
|
|
712
|
+
continue;
|
|
713
|
+
}
|
|
714
|
+
let priority = labelPriority(g);
|
|
715
|
+
labelRequests.push({
|
|
716
|
+
id: `${kind}:${sid}:${g.cat.id}`,
|
|
717
|
+
kind,
|
|
718
|
+
role: composedTextRole(text),
|
|
719
|
+
owner: { seriesId: sid, categoryId: g.cat.id },
|
|
720
|
+
// An override's ${value} slot holds the slice value itself, whatever the content.
|
|
721
|
+
...namesOnly(typeof g.labelOverride == "string" ? void 0 : kind === "insidePie" ? insideContent : outsideContent, g.labelOverride),
|
|
722
|
+
text,
|
|
723
|
+
lines,
|
|
724
|
+
...title !== void 0 ? { title } : {},
|
|
725
|
+
font: labelFont,
|
|
726
|
+
// A left label column, or a ring label left of the circle, is set flush right, against it.
|
|
727
|
+
...out && out.rect.x + out.rect.w <= cx ? { align: "end" } : {},
|
|
728
|
+
priority,
|
|
729
|
+
redundant: g.labelOverride === !1,
|
|
730
|
+
candidates
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
let centerFont, centerValueFont = (lines) => {
|
|
734
|
+
let unitW = Math.max(0, ...lines.slice(1).map((line) => measure(line, labelFont).width)), fits = (font) => Math.hypot(Math.max(measure(lines[0], font).width, unitW) / 2, (measure("0", font).height + (lines.length - 1) * lineH) / 2) <= ri - 1, cap = Math.min(CENTER_VALUE_MAX, Math.max(labelFont.size, Math.round(2 * CENTER_VALUE_RATIO * r) / 2));
|
|
735
|
+
for (let px = cap; px > labelFont.size; px -= 0.5) {
|
|
736
|
+
let font = { ...strongFont, size: px };
|
|
737
|
+
if (fits(font)) return font;
|
|
738
|
+
}
|
|
739
|
+
return strongFont;
|
|
740
|
+
};
|
|
741
|
+
if (hole >= CENTER_TEXT_MIN && kindSetting("total") !== !1) {
|
|
742
|
+
let lines = pieCenterLines(fmt(total), options.unit ?? ser.unit, options.format), text = lines.join(" ");
|
|
743
|
+
centerFont = centerValueFont(lines);
|
|
744
|
+
let tsize = {
|
|
745
|
+
width: Math.max(measure(lines[0], centerFont).width, ...lines.slice(1).map((line) => measure(line, labelFont).width)),
|
|
746
|
+
height: measure("0", centerFont).height + (lines.length - 1) * lineH
|
|
747
|
+
}, inHole = Math.hypot(tsize.width / 2, tsize.height / 2) <= ri - 1;
|
|
748
|
+
labelRequests.push({
|
|
749
|
+
id: `total:${sid}`,
|
|
750
|
+
kind: "total",
|
|
751
|
+
owner: { seriesId: sid },
|
|
752
|
+
text,
|
|
753
|
+
lines,
|
|
754
|
+
font: strongFont,
|
|
755
|
+
priority: PRIORITY.total,
|
|
756
|
+
candidates: [
|
|
757
|
+
{
|
|
758
|
+
slot: "center",
|
|
759
|
+
rect: {
|
|
760
|
+
x: cx - tsize.width / 2,
|
|
761
|
+
y: cy - tsize.height / 2,
|
|
762
|
+
w: tsize.width,
|
|
763
|
+
h: tsize.height
|
|
764
|
+
},
|
|
765
|
+
penalty: 0,
|
|
766
|
+
...inHole ? { pad: 0 } : {},
|
|
767
|
+
insideFill: theme.color.background,
|
|
768
|
+
insidePaint: { token: "background" }
|
|
769
|
+
}
|
|
770
|
+
]
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
let solveCtx = labelCtx(theme, size, options, {
|
|
774
|
+
density,
|
|
775
|
+
measure,
|
|
776
|
+
plot,
|
|
777
|
+
labelPad: 2
|
|
778
|
+
}), solved = solveLabels(labelRequests, occupied, solveCtx);
|
|
779
|
+
pushAll(warnings, solved.warnings);
|
|
780
|
+
let outsideForms = new Map(sliceLabels.flatMap((sl) => sl.outside ? [[`insidePie:${sid}:${sl.g.cat.id}`, sl.outside]] : []));
|
|
781
|
+
for (let label of solved.placed) {
|
|
782
|
+
let form = label.slot === "outside" ? outsideForms.get(label.id) : void 0;
|
|
783
|
+
form && (label.lines = form.lines, label.text = form.text, label.role = composedTextRole(form.text), form.printsFor ? label.printsFor = form.printsFor : delete label.printsFor, form.title !== void 0 ? label.title = form.title : delete label.title);
|
|
784
|
+
}
|
|
785
|
+
routeOutsideLeaders(solved.placed, leaderAnchors);
|
|
786
|
+
let unlabelled = /* @__PURE__ */ new Map(), noteContent = (outsideContent ?? insideContent ?? []).filter((c) => c !== "category");
|
|
787
|
+
for (let label of solved.placed) {
|
|
788
|
+
let g = label.hidden && (label.kind === "insidePie" || label.kind === "outsidePie") ? geoms.find((candidate) => candidate.cat.id === label.owner.categoryId) : void 0;
|
|
789
|
+
g && unlabelled.set(g.cat.id, [g.cat.label ?? g.cat.id, ...composeParts(g, noteContent).parts].join(" "));
|
|
790
|
+
}
|
|
791
|
+
for (let g of unseated) unlabelled.set(g.cat.id, [g.cat.label ?? g.cat.id, ...composeParts(g, noteContent).parts].join(" "));
|
|
792
|
+
let geomByCat = new Map(geoms.map((g) => [g.cat.id, g])), resolveAnchor = (ref) => {
|
|
793
|
+
let norm3 = typeof ref == "string" ? { categoryId: ref } : ref;
|
|
794
|
+
if (!("categoryId" in norm3) || norm3.seriesId && norm3.seriesId !== sid) return null;
|
|
795
|
+
let g = geomByCat.get(norm3.categoryId);
|
|
796
|
+
if (!g) return null;
|
|
797
|
+
let p = polar3(g.scx, g.scy, r + 2, g.mid);
|
|
798
|
+
return {
|
|
799
|
+
x: p.x,
|
|
800
|
+
y: p.y,
|
|
801
|
+
// A callout or note leads to a point on its slice, inside the
|
|
802
|
+
// rim, so its leader shows which slice it speaks of.
|
|
803
|
+
calloutPoint: polar3(g.scx, g.scy, ri > 0 ? (ri + r) / 2 : r * 0.85, g.mid),
|
|
804
|
+
value: g.v,
|
|
805
|
+
format: ser.format,
|
|
806
|
+
date: g.cat.date,
|
|
807
|
+
label: g.cat.label ?? g.cat.id,
|
|
808
|
+
owner: { seriesId: sid, categoryId: g.cat.id }
|
|
809
|
+
};
|
|
810
|
+
}, annList = options.annotations ?? [], annResult = runAnnotatePass({
|
|
811
|
+
annotations: annList,
|
|
812
|
+
resolve: resolveAnchor,
|
|
813
|
+
defaultSpan: geoms.length > 1 ? { from: geoms[0].cat.id, to: geoms[geoms.length - 1].cat.id } : void 0,
|
|
814
|
+
comparisonLayout: pieComparisonLayout(theme, { cx, cy, r, outer: baseFit }, geoms.map((g) => ({ id: g.cat.id, a0: g.a0, sweep: g.sweep, mid: g.mid, scx: g.scx, scy: g.scy }))),
|
|
815
|
+
occupied,
|
|
816
|
+
plot,
|
|
817
|
+
// Annotation labels draw bold (see labelsToNodes below), so the pass measures them bold.
|
|
818
|
+
theme: emphasisLabelTheme(theme),
|
|
819
|
+
measure,
|
|
820
|
+
format: options.format,
|
|
821
|
+
locale: options.locale?.language,
|
|
822
|
+
strings: options.strings,
|
|
823
|
+
solveCtx
|
|
824
|
+
});
|
|
825
|
+
pushAll(warnings, annResult.warnings);
|
|
826
|
+
let allLabels = [...solved.placed, ...annResult.labels];
|
|
827
|
+
pushAll(nodes, annResult.nodes), pushAll(
|
|
828
|
+
nodes,
|
|
829
|
+
labelsToNodes(
|
|
830
|
+
theme,
|
|
831
|
+
allLabels,
|
|
832
|
+
(l) => l.kind === "total" ? strongFont : l.kind === "annotation" ? { ...labelFont, weight: emphasisWeight(theme) } : labelFont
|
|
833
|
+
)
|
|
834
|
+
);
|
|
835
|
+
let totalNode = nodes.find((node) => node.id === `label:total:${sid}`);
|
|
836
|
+
if (totalNode?.t === "text" && (totalNode.x = cx, totalNode.align = "middle", centerFont)) {
|
|
837
|
+
let [value, ...rest] = totalNode.lines, valueH = centerFont.size * (centerFont.lineHeight ?? 1.2);
|
|
838
|
+
totalNode.font = centerFont, totalNode.lines = [value], rest.length > 0 && nodes.splice(nodes.indexOf(totalNode) + 1, 0, {
|
|
839
|
+
...totalNode,
|
|
840
|
+
id: `${totalNode.id}:unit`,
|
|
841
|
+
y: totalNode.y + valueH,
|
|
842
|
+
lines: rest,
|
|
843
|
+
font: labelFont,
|
|
844
|
+
ink: { token: "inkMuted" }
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
boldColumnValues(nodes, solved.placed, emphasisWeight(theme), oneLineValueAt);
|
|
848
|
+
let axes = [], shapeName = chartString(options, hole > 0 ? "doughnutName" : "pieName"), a11yDesc = chartString(options, "pieDesc", { v1: shapeName, v2: geoms.length, v3: ser.label ?? sid, v4: fmt(total) }) + chartString(options, "sharesSentence", { v1: geoms.map((g) => `${g.cat.label ?? g.cat.id} ${shareText(g)}`).join(", ") }), geometry = {
|
|
849
|
+
type: "pie",
|
|
850
|
+
size,
|
|
851
|
+
sizing: naturalPieSizing(size, plot, columns ? Math.max(diameterFor(plot.w) + 2 * arcRoom + 48, columnStack + 8) : Math.max(diameterFor(plot.w) + 48, outsideStackH), contentSizing("pie", size, plot, [
|
|
852
|
+
{ x: cx - baseFit, y: cy - baseFit, w: 2 * baseFit, h: 2 * baseFit },
|
|
853
|
+
...allLabels.filter((label) => !label.hidden).map((label) => label.rect)
|
|
854
|
+
], !0), pieMinWidth),
|
|
855
|
+
plot,
|
|
856
|
+
scene: nodes,
|
|
857
|
+
labels: allLabels,
|
|
858
|
+
axes,
|
|
859
|
+
annotations: annResult.placed,
|
|
860
|
+
legend: frameResult.legend,
|
|
861
|
+
frame: frameResult.frame,
|
|
862
|
+
marks,
|
|
863
|
+
derived: { total: round2(total), shares, stackParts: { [sid]: Object.fromEntries(geoms.map((g) => [g.cat.id, g.v])) }, ...rounded ? { roundingAdjustments: rounded.adjustments } : {} },
|
|
864
|
+
a11y: {
|
|
865
|
+
title: accessibleTitle(options.title, chartString(options, "pieTitle", { v1: shapeName, v2: ser.label ?? sid, v3: geoms.length })),
|
|
866
|
+
counts: [structureCount("slices", geoms.length, void 0, options)],
|
|
867
|
+
desc: a11yDesc
|
|
868
|
+
},
|
|
869
|
+
warnings,
|
|
870
|
+
...paintWarningRules.length ? { paintWarningRules } : {},
|
|
871
|
+
debug: {
|
|
872
|
+
occupied: occupied.snapshot(),
|
|
873
|
+
decisions: [...solved.decisions, ...annResult.decisions]
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
return automatic && geometry.sizing?.naturalHeight === size.height && settledAutoHeight.add(geometry.frame), { geometry, unlabelled, swapped };
|
|
877
|
+
}
|
|
878
|
+
function slicePath(cx, cy, r, ri, a0, a1) {
|
|
879
|
+
let pt = (radius, deg) => {
|
|
880
|
+
let rad2 = deg * Math.PI / 180;
|
|
881
|
+
return { x: cx + radius * Math.sin(rad2), y: cy - radius * Math.cos(rad2) };
|
|
882
|
+
}, sweep = a1 - a0;
|
|
883
|
+
if (sweep >= 359.99) {
|
|
884
|
+
let p02 = pt(r, a0), ph = pt(r, a0 + 180), d = `M${fmtPathNumber(p02.x)} ${fmtPathNumber(p02.y)}A${fmtPathNumber(r)} ${fmtPathNumber(r)} 0 1 1 ${fmtPathNumber(ph.x)} ${fmtPathNumber(ph.y)}A${fmtPathNumber(r)} ${fmtPathNumber(r)} 0 1 1 ${fmtPathNumber(p02.x)} ${fmtPathNumber(p02.y)}Z`;
|
|
885
|
+
if (ri > 0) {
|
|
886
|
+
let q0 = pt(ri, a0), qh = pt(ri, a0 + 180);
|
|
887
|
+
d += `M${fmtPathNumber(q0.x)} ${fmtPathNumber(q0.y)}A${fmtPathNumber(ri)} ${fmtPathNumber(ri)} 0 1 0 ${fmtPathNumber(qh.x)} ${fmtPathNumber(qh.y)}A${fmtPathNumber(ri)} ${fmtPathNumber(ri)} 0 1 0 ${fmtPathNumber(q0.x)} ${fmtPathNumber(q0.y)}Z`;
|
|
888
|
+
}
|
|
889
|
+
return d;
|
|
890
|
+
}
|
|
891
|
+
let la = sweep > 180 ? 1 : 0, p0 = pt(r, a0), p1 = pt(r, a1);
|
|
892
|
+
if (ri > 0) {
|
|
893
|
+
let q1 = pt(ri, a1), q0 = pt(ri, a0);
|
|
894
|
+
return `M${fmtPathNumber(p0.x)} ${fmtPathNumber(p0.y)}A${fmtPathNumber(r)} ${fmtPathNumber(r)} 0 ${la} 1 ${fmtPathNumber(p1.x)} ${fmtPathNumber(p1.y)}L${fmtPathNumber(q1.x)} ${fmtPathNumber(q1.y)}A${fmtPathNumber(ri)} ${fmtPathNumber(ri)} 0 ${la} 0 ${fmtPathNumber(q0.x)} ${fmtPathNumber(q0.y)}Z`;
|
|
895
|
+
}
|
|
896
|
+
return `M${fmtPathNumber(cx)} ${fmtPathNumber(cy)}L${fmtPathNumber(p0.x)} ${fmtPathNumber(p0.y)}A${fmtPathNumber(r)} ${fmtPathNumber(r)} 0 ${la} 1 ${fmtPathNumber(p1.x)} ${fmtPathNumber(p1.y)}Z`;
|
|
897
|
+
}
|
|
898
|
+
function claimWedge(occupied, owner, g, r, ri, polar3) {
|
|
899
|
+
let hs = Math.max(5, Math.min(14, r * 0.12)), bands = ri > 0 ? [Math.max(ri + (r - ri) * 0.3, Math.min(ri + (r - ri) * 0.5, ri + hs * Math.SQRT2)), ri + (r - ri) * 0.72] : [r * 0.32, r * 0.6, r * 0.86], claimAt = (radius, deg) => {
|
|
900
|
+
let p = polar3(g.scx, g.scy, radius, deg);
|
|
901
|
+
occupied.claim({ x: p.x - hs, y: p.y - hs, w: 2 * hs, h: 2 * hs }, "mark", owner);
|
|
902
|
+
};
|
|
903
|
+
bands.forEach((rb, bi) => {
|
|
904
|
+
if (rb <= 0) return;
|
|
905
|
+
let insetDeg = Math.min(g.sweep / 4, hs * 0.7 / rb * (180 / Math.PI)), lo = g.a0 + insetDeg, hi = g.a1 - insetDeg;
|
|
906
|
+
if (hi <= lo) {
|
|
907
|
+
bi === bands.length - 1 && claimAt(rb, g.mid);
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
let stepDeg = Math.max(7, hs * 1.5 / rb * (180 / Math.PI));
|
|
911
|
+
for (let a = lo; a < hi; a += stepDeg) claimAt(rb, a);
|
|
912
|
+
claimAt(rb, hi);
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
function round4(v) {
|
|
916
|
+
return Math.round(v * 1e4) / 1e4;
|
|
917
|
+
}
|
|
918
|
+
function boldColumnValues(nodes, labels, weight, oneLineValueAt) {
|
|
919
|
+
let shown = labels.filter((label) => !label.hidden && label.slot === "outside" && label.nodeId), outside = new Set(shown.map((label) => label.nodeId)), oneLine = new Map(shown.flatMap((label) => oneLineValueAt.has(label.id) ? [[label.nodeId, oneLineValueAt.get(label.id)]] : []));
|
|
920
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
921
|
+
let node = nodes[i], from = node.t === "text" && node.lines.length === 1 ? oneLine.get(node.id) : void 0;
|
|
922
|
+
if (node.t === "text" && from !== void 0) {
|
|
923
|
+
let line = node.lines[0], at2 = line.indexOf(VALUE_SHARE_SEP, from);
|
|
924
|
+
at2 > from && (node.runs = [{ text: line.slice(0, from) }, { text: line.slice(from, at2), weight }, { text: line.slice(at2) }]);
|
|
925
|
+
continue;
|
|
926
|
+
}
|
|
927
|
+
if (node.t !== "text" || !outside.has(node.id) || node.lines.length < 2) continue;
|
|
928
|
+
let last = node.lines[node.lines.length - 1], at = last.indexOf(VALUE_SHARE_SEP);
|
|
929
|
+
if (at <= 0) continue;
|
|
930
|
+
let lineH = node.font.size * (node.font.lineHeight ?? 1.2), head = node.lines.slice(0, -1);
|
|
931
|
+
nodes.splice(i + 1, 0, {
|
|
932
|
+
...node,
|
|
933
|
+
id: `${node.id}:value`,
|
|
934
|
+
y: node.y + head.length * lineH,
|
|
935
|
+
lines: [last],
|
|
936
|
+
runs: [{ text: last.slice(0, at), weight }, { text: last.slice(at) }]
|
|
937
|
+
}), node.lines = head, i++;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function routeOutsideLeaders(labels, leaderAnchors) {
|
|
941
|
+
let p = (point) => `${round2(point.x)} ${round2(point.y)}`;
|
|
942
|
+
for (let label of labels) {
|
|
943
|
+
if (label.hidden || label.slot !== "outside") continue;
|
|
944
|
+
let leader = leaderAnchors.get(label.owner.categoryId);
|
|
945
|
+
leader && (label.leader = { d: `M${p(leader.from)}L${p(leader.to)}`, curved: !1 });
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
function naturalPieSizing(size, plot, plotNeed, measured, minWidth = 0) {
|
|
949
|
+
return {
|
|
950
|
+
...measured,
|
|
951
|
+
minHeight: measured.measuredMinHeight,
|
|
952
|
+
...minWidth > measured.minWidth ? { minWidth, measuredMinWidth: Math.max(measured.measuredMinWidth, minWidth) } : {},
|
|
953
|
+
naturalHeight: Math.ceil(Math.max(measured.minHeight, size.height - plot.h + plotNeed))
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// src/core/charts/pie/core.ts
|
|
958
|
+
var pieCore = {
|
|
959
|
+
type: "pie",
|
|
960
|
+
sizing: chartSizing("pie"),
|
|
961
|
+
title: "Pie / doughnut",
|
|
962
|
+
summary: "Share-of-total slices with inside/outside label cascade, doughnut center total, explode",
|
|
963
|
+
aliases: ["doughnut", "donut"],
|
|
964
|
+
layout: (data, options) => layoutPie(prepareFractionData(data), options),
|
|
965
|
+
categoryLabels: calendarCategories,
|
|
966
|
+
prepare: prepareFractionData,
|
|
967
|
+
defaults: {},
|
|
968
|
+
annotationKinds: ["cagr", "diff", "note", "callout", "delta", "abs"],
|
|
969
|
+
lint: (data, options) => {
|
|
970
|
+
let warnings = [], n = data.categories.length, topN = options.topN ?? DEFAULT_TOP_N, merges = options.topN !== void 0 || n - topN.n >= DEFAULT_REST_MIN, effective = topN.n > 0 && merges ? Math.min(n, topN.n + (topN.rest === !1 ? 0 : 1)) : n;
|
|
971
|
+
return effective > PIE_SLICE_LIMIT && warnings.push({
|
|
972
|
+
code: "pie-too-many-slices",
|
|
973
|
+
severity: "warn",
|
|
974
|
+
message: `${effective} slices exceed the ${PIE_SLICE_LIMIT}-slice readability limit`,
|
|
975
|
+
suggest: "aggregate with topN: { n: 7, rest: true } or switch to a bar chart"
|
|
976
|
+
}), data.series.length > 1 && warnings.push({
|
|
977
|
+
code: "pie-single-series",
|
|
978
|
+
severity: "warn",
|
|
979
|
+
message: `pie plots exactly one series \u2014 ${data.series.length} supplied, first wins`,
|
|
980
|
+
suggest: "use one series per pie, or a column/bar chart for multi-series comparison"
|
|
981
|
+
}), warnings;
|
|
982
|
+
}
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
export {
|
|
986
|
+
pieCore
|
|
987
|
+
};
|