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,1156 @@
|
|
|
1
|
+
import {
|
|
2
|
+
seatsPastBlockers,
|
|
3
|
+
stackSegmentCandidates
|
|
4
|
+
} from "./chunk-XJP5DKIL.js";
|
|
5
|
+
import {
|
|
6
|
+
cellFields,
|
|
7
|
+
normalizeCategorySeries
|
|
8
|
+
} from "./chunk-S4QSJAGY.js";
|
|
9
|
+
import {
|
|
10
|
+
segmentTooShort
|
|
11
|
+
} from "./chunk-27QADBDV.js";
|
|
12
|
+
import {
|
|
13
|
+
roundWholes
|
|
14
|
+
} from "./chunk-24BHMKDD.js";
|
|
15
|
+
import {
|
|
16
|
+
compositionBasis,
|
|
17
|
+
mixedSignsWarning,
|
|
18
|
+
overfullShareSum,
|
|
19
|
+
overfullWarning,
|
|
20
|
+
sk,
|
|
21
|
+
stackParts
|
|
22
|
+
} from "./chunk-M4EUXOLU.js";
|
|
23
|
+
import {
|
|
24
|
+
valueLineExtent
|
|
25
|
+
} from "./chunk-QPWRHDLZ.js";
|
|
26
|
+
import {
|
|
27
|
+
isIncomplete,
|
|
28
|
+
warnIncompleteComposition,
|
|
29
|
+
warnShareRoundingDrift
|
|
30
|
+
} from "./chunk-5LGSRWFC.js";
|
|
31
|
+
import {
|
|
32
|
+
runAnnotatePass
|
|
33
|
+
} from "./chunk-KZS46KDY.js";
|
|
34
|
+
import {
|
|
35
|
+
breakUnsupported,
|
|
36
|
+
chartPalette,
|
|
37
|
+
chartTheme
|
|
38
|
+
} from "./chunk-3QWZAEW5.js";
|
|
39
|
+
import {
|
|
40
|
+
withUnit
|
|
41
|
+
} from "./chunk-IK4BHOPZ.js";
|
|
42
|
+
import {
|
|
43
|
+
mekkoAmount,
|
|
44
|
+
poolMekkoAmounts,
|
|
45
|
+
restLabel,
|
|
46
|
+
restSum,
|
|
47
|
+
topNCut
|
|
48
|
+
} from "./chunk-KDMKHR5A.js";
|
|
49
|
+
import {
|
|
50
|
+
structureCount
|
|
51
|
+
} from "./chunk-LFX7W4B7.js";
|
|
52
|
+
import {
|
|
53
|
+
emptyIdRecord
|
|
54
|
+
} from "./chunk-LINZPU5D.js";
|
|
55
|
+
import {
|
|
56
|
+
PLOT_FLOOR_PX,
|
|
57
|
+
PLOT_FLOOR_RECT,
|
|
58
|
+
applyAxisBounds,
|
|
59
|
+
applyValueAxisTitleInk,
|
|
60
|
+
axisTitleAllowed,
|
|
61
|
+
calendarCategories,
|
|
62
|
+
categoryLineAlign,
|
|
63
|
+
categoryRowTop,
|
|
64
|
+
chartSizing,
|
|
65
|
+
hangingLabelReserve,
|
|
66
|
+
isDateNumericTickSequence,
|
|
67
|
+
layoutValueAxis,
|
|
68
|
+
linearScale,
|
|
69
|
+
measureValueAxisWidth,
|
|
70
|
+
niceDomain,
|
|
71
|
+
planCategoryRow,
|
|
72
|
+
planValueAxisTitle,
|
|
73
|
+
plotFloorShare,
|
|
74
|
+
valueAxisTitleBand,
|
|
75
|
+
valueAxisTitleRequest
|
|
76
|
+
} from "./chunk-RL3NUWMY.js";
|
|
77
|
+
import {
|
|
78
|
+
prepareFractionData
|
|
79
|
+
} from "./chunk-3EZRM4YM.js";
|
|
80
|
+
import {
|
|
81
|
+
PRIORITY,
|
|
82
|
+
authoredFootnoteCount,
|
|
83
|
+
authoredNotes,
|
|
84
|
+
categoryLabelsAndMarks,
|
|
85
|
+
composedTextRole,
|
|
86
|
+
createOccupiedIndex,
|
|
87
|
+
fitText,
|
|
88
|
+
fixedPlotChrome,
|
|
89
|
+
frameTextOptions,
|
|
90
|
+
labelsToNodes,
|
|
91
|
+
normalizeLegendOption,
|
|
92
|
+
omittedKey,
|
|
93
|
+
plotChromeFloor,
|
|
94
|
+
plotHeightAfter,
|
|
95
|
+
rectSeriesAdjacentWarnings,
|
|
96
|
+
rectsOverlap,
|
|
97
|
+
round2,
|
|
98
|
+
scenarioLegendKeys,
|
|
99
|
+
solveFrame,
|
|
100
|
+
solveLabels,
|
|
101
|
+
unitPrinted,
|
|
102
|
+
withAuthoredFootnotes
|
|
103
|
+
} from "./chunk-SS42FJVN.js";
|
|
104
|
+
import {
|
|
105
|
+
disclosureNote,
|
|
106
|
+
disclosuresShown
|
|
107
|
+
} from "./chunk-BPKXEMRE.js";
|
|
108
|
+
import {
|
|
109
|
+
formatterFromExample,
|
|
110
|
+
parseFormatExample,
|
|
111
|
+
specUnitKind
|
|
112
|
+
} from "./chunk-RGZGLKFB.js";
|
|
113
|
+
import {
|
|
114
|
+
chartStrings,
|
|
115
|
+
formatAuthoredPercent,
|
|
116
|
+
formatAutomaticNumber,
|
|
117
|
+
formatAutomaticPercent,
|
|
118
|
+
formatShare,
|
|
119
|
+
notApplicableGlyph,
|
|
120
|
+
shareSetDecimals,
|
|
121
|
+
shareSetFormatter
|
|
122
|
+
} from "./chunk-53OYF4ZT.js";
|
|
123
|
+
import {
|
|
124
|
+
canvasMargin,
|
|
125
|
+
effectiveFill,
|
|
126
|
+
emphasisLabelTheme,
|
|
127
|
+
emphasisWeight,
|
|
128
|
+
labelsOffKeepsNames,
|
|
129
|
+
linePath,
|
|
130
|
+
markOutlineOff,
|
|
131
|
+
markRolePaint,
|
|
132
|
+
mutedMarkPaint,
|
|
133
|
+
namesOnly,
|
|
134
|
+
paintColor,
|
|
135
|
+
panelTypeClass,
|
|
136
|
+
rampSlots,
|
|
137
|
+
recedingSeriesId,
|
|
138
|
+
separationStroke,
|
|
139
|
+
seriesPaint,
|
|
140
|
+
signedFillPaint,
|
|
141
|
+
strokeToken,
|
|
142
|
+
textScaleOf,
|
|
143
|
+
typeWidthClass,
|
|
144
|
+
withSegmentSeams
|
|
145
|
+
} from "./chunk-CWDHCSL2.js";
|
|
146
|
+
import {
|
|
147
|
+
DEFAULT_TARGET,
|
|
148
|
+
NormalizeError,
|
|
149
|
+
accessibleTitle,
|
|
150
|
+
normalizeScenario,
|
|
151
|
+
resolveHighlight,
|
|
152
|
+
resolveSize,
|
|
153
|
+
resolveSubtitle,
|
|
154
|
+
targetFloorsPx
|
|
155
|
+
} from "./chunk-SGD3ZHID.js";
|
|
156
|
+
import {
|
|
157
|
+
maxOf,
|
|
158
|
+
minOf,
|
|
159
|
+
pushAll
|
|
160
|
+
} from "./chunk-WYJEOMNY.js";
|
|
161
|
+
import {
|
|
162
|
+
defaultMeasurer
|
|
163
|
+
} from "./chunk-AG2CJ4JY.js";
|
|
164
|
+
|
|
165
|
+
// src/core/strings/mekko.ts
|
|
166
|
+
var EN = {
|
|
167
|
+
// reader-facing wording linked only by its consumers.
|
|
168
|
+
mekkoTitle: "Mekko chart: {v1} by {v2} categories",
|
|
169
|
+
validColumns: "{v1} valid composition columns",
|
|
170
|
+
mekkoUnnamedNote: "Not named in place, left to right: {v1}.",
|
|
171
|
+
mekkoZeroNote: "Not drawn (total 0 or too thin): {v1}.",
|
|
172
|
+
totalsSentence: ". Totals: {v1}.",
|
|
173
|
+
mekkoPercentAxis: "percent-axis marimekko",
|
|
174
|
+
mekkoUnitAxis: "unit-axis mekko",
|
|
175
|
+
barMekko: "bar-mekko",
|
|
176
|
+
categoryTotals: "category totals",
|
|
177
|
+
mekkoValidDesc: "{v1}; {v2} valid composition columns \xD7 {v3} series; column widths proportional to ",
|
|
178
|
+
mekkoInvalidDesc: ". Valid totals: {v1}. Suppressed: {v2}.",
|
|
179
|
+
mekkoDesc: "{v1}, {v2} columns \xD7 {v3} series; column widths proportional to ",
|
|
180
|
+
widthTitle: "Column width: {v1}, {v2}",
|
|
181
|
+
netValue: "net {v1}"
|
|
182
|
+
}, DE = {
|
|
183
|
+
// reader-facing wording linked only by its consumers.
|
|
184
|
+
mekkoTitle: "Mekko-Diagramm: {v1} nach {v2} {v2|Kategorie|Kategorien}",
|
|
185
|
+
validColumns: "{v1} {v1|g\xFCltige Anteilss\xE4ule|g\xFCltige Anteilss\xE4ulen}",
|
|
186
|
+
mekkoUnnamedNote: "Ohne Beschriftung vor Ort, von links nach rechts: {v1}.",
|
|
187
|
+
mekkoZeroNote: "Nicht gezeichnet (Summe 0 oder zu schmal): {v1}.",
|
|
188
|
+
totalsSentence: ". Summen: {v1}.",
|
|
189
|
+
mekkoPercentAxis: "Marimekko mit Prozentachse",
|
|
190
|
+
mekkoUnitAxis: "Mekko mit Einheitenachse",
|
|
191
|
+
barMekko: "Balken-Mekko",
|
|
192
|
+
categoryTotals: "Kategoriesummen",
|
|
193
|
+
mekkoValidDesc: "{v1}; {v2} {v2|g\xFCltige Anteilss\xE4ule|g\xFCltige Anteilss\xE4ulen} \xD7 {v3} {v3|Reihe|Reihen}; S\xE4ulenbreiten proportional zu ",
|
|
194
|
+
mekkoInvalidDesc: ". G\xFCltige Summen: {v1}. Ausgeblendet: {v2}.",
|
|
195
|
+
mekkoDesc: "{v1}, {v2} {v2|S\xE4ule|S\xE4ulen} \xD7 {v3} {v3|Reihe|Reihen}; S\xE4ulenbreiten proportional zu ",
|
|
196
|
+
widthTitle: "Spaltenbreite: {v1}, {v2}",
|
|
197
|
+
netValue: "netto {v1}"
|
|
198
|
+
}, { chartString } = chartStrings(EN, DE);
|
|
199
|
+
|
|
200
|
+
// src/core/charts/mekko/domain.ts
|
|
201
|
+
function resolveMekkoEnv(options, warnings) {
|
|
202
|
+
breakUnsupported("mekko", options, warnings);
|
|
203
|
+
let theme = chartTheme(options), paletteRamp = chartPalette(theme, options.palette, warnings), autoDecimals = (v) => Number.isInteger(v) || Math.abs(v) >= 100 ? 0 : 1, lang = options.locale?.language, plainFmt = (v) => formatAutomaticNumber(v, { locale: lang, decimals: autoDecimals(v) }), percentExample = options.format && specUnitKind(parseFormatExample(options.format)) === "percent", sharesOnly = percentExample && ((options.variant ?? "stacked100") === "stacked100" || options.valueAxis?.percent);
|
|
204
|
+
return {
|
|
205
|
+
options,
|
|
206
|
+
theme,
|
|
207
|
+
palette: paletteRamp ? options.palette : void 0,
|
|
208
|
+
size: resolveSize(options.size),
|
|
209
|
+
measure: options.measure ?? defaultMeasurer,
|
|
210
|
+
fmt: options.format && !sharesOnly ? formatterFromExample(options.format, lang) : plainFmt,
|
|
211
|
+
widthFmt: plainFmt,
|
|
212
|
+
pctFmt: percentExample ? formatterFromExample(options.format, lang) : (p) => formatShare(p, lang),
|
|
213
|
+
authoredPctFmt: percentExample ? formatterFromExample(options.format, lang) : (p) => formatAuthoredPercent(p, lang),
|
|
214
|
+
highlights: new Set(resolveHighlight(options.highlight)),
|
|
215
|
+
density: options.labelDensity ?? "smart",
|
|
216
|
+
va: options.valueAxis ?? {}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function normalizeMekkoData(data) {
|
|
220
|
+
let { cats, series } = normalizeCategorySeries("mekko", data, (s, cells) => ({
|
|
221
|
+
id: s.id,
|
|
222
|
+
label: s.label ?? s.id,
|
|
223
|
+
role: s.role ?? "data",
|
|
224
|
+
scenario: normalizeScenario(s.scenario, `series[${s.id}].scenario`),
|
|
225
|
+
colorRole: s.colorRole,
|
|
226
|
+
fill: s.fill,
|
|
227
|
+
format: s.format,
|
|
228
|
+
...s.unit === void 0 ? {} : { unit: s.unit },
|
|
229
|
+
vals: cells.map((cell, ci) => cellFields(cell, `series[${s.id}].values[${ci}]`))
|
|
230
|
+
}));
|
|
231
|
+
return { cats, seriesNorm: series };
|
|
232
|
+
}
|
|
233
|
+
var VARIANT_MODE = { stacked100: "percent", stacked: "unit", bar: "bar" };
|
|
234
|
+
function mekkoSeriesRoles(options, seriesNorm, warnings) {
|
|
235
|
+
let mode = VARIANT_MODE[options.variant ?? "stacked100"];
|
|
236
|
+
options.valueAxis?.percent && mode === "unit" && (mode = "percent");
|
|
237
|
+
let widthSer = null;
|
|
238
|
+
options.widthSeriesId && (widthSer = seriesNorm.find((s) => s.id === options.widthSeriesId) ?? null, widthSer || warnings.push({
|
|
239
|
+
code: "unknown-width-series",
|
|
240
|
+
severity: "warn",
|
|
241
|
+
message: `widthSeriesId '${options.widthSeriesId}' not found \u2014 using category totals`
|
|
242
|
+
}));
|
|
243
|
+
let refSeries = seriesNorm.filter((s) => s.role === "reference" && s !== widthSer);
|
|
244
|
+
refSeries.length > 0 && warnings.push({
|
|
245
|
+
code: "reference-ignored",
|
|
246
|
+
severity: "info",
|
|
247
|
+
message: `mekko does not plot reference series (${refSeries.map((s) => s.id).join(", ")})`
|
|
248
|
+
});
|
|
249
|
+
let series = seriesNorm.filter((s) => s.role !== "reference" && s !== widthSer);
|
|
250
|
+
if (series.length === 0)
|
|
251
|
+
throw new NormalizeError("empty-data", "series", "mekko requires at least one data-role series");
|
|
252
|
+
return mode === "bar" && series.length > 1 && (warnings.push({
|
|
253
|
+
code: "bar-mekko-extra-series",
|
|
254
|
+
severity: "warn",
|
|
255
|
+
message: `bar-mekko plots a single data series \u2014 using '${series[0].id}', ignoring ${series.slice(1).map((s) => s.id).join(", ")}`
|
|
256
|
+
}), series = series.slice(0, 1)), mode === "bar" && !widthSer && warnings.push({
|
|
257
|
+
code: "bar-mekko-no-width-series",
|
|
258
|
+
severity: "info",
|
|
259
|
+
message: "bar-mekko without widthSeriesId \u2014 columns get equal widths"
|
|
260
|
+
}), { mode, widthSer, series };
|
|
261
|
+
}
|
|
262
|
+
function valueFns(st) {
|
|
263
|
+
let invalidAt = (ci) => st.mode === "percent" && (st.nm.has(st.cats[ci].id) || st.na.has(st.cats[ci].id)), basisAt = (ci) => {
|
|
264
|
+
let c = st.cats[ci];
|
|
265
|
+
return c.total100 !== void 0 ? c.total100 : st.series.reduce((a, s) => {
|
|
266
|
+
let val = s.vals[ci];
|
|
267
|
+
return a + (val.isPct || val.v === null ? 0 : val.v);
|
|
268
|
+
}, 0);
|
|
269
|
+
}, absAt = (s, ci) => {
|
|
270
|
+
let val = s.vals[ci];
|
|
271
|
+
return mekkoAmount(val, val.isPct && st.mode === "percent" ? basisAt(ci) : 0, st.mode === "percent");
|
|
272
|
+
};
|
|
273
|
+
return { invalidAt, basisAt, absAt, plottedAt: (s, ci) => {
|
|
274
|
+
let val = s.vals[ci];
|
|
275
|
+
if (val.v === null) return null;
|
|
276
|
+
if (st.mode !== "percent") return val.v;
|
|
277
|
+
if (invalidAt(ci)) return 0;
|
|
278
|
+
if (val.isPct) return val.v;
|
|
279
|
+
let b = basisAt(ci);
|
|
280
|
+
return b > 0 ? val.v / b * 100 : 0;
|
|
281
|
+
}, weightAt: (ci) => {
|
|
282
|
+
if (st.widthSer) {
|
|
283
|
+
let v = st.widthSer.vals[ci]?.v;
|
|
284
|
+
return v == null ? 0 : Math.max(0, v);
|
|
285
|
+
}
|
|
286
|
+
return st.mode === "bar" ? 1 : Math.max(0, st.series.reduce((a, s) => a + (absAt(s, ci) ?? 0), 0));
|
|
287
|
+
} };
|
|
288
|
+
}
|
|
289
|
+
function reorderCategories(st, seriesNorm, options, weightAt, basisAt) {
|
|
290
|
+
let applyOrder = (order) => {
|
|
291
|
+
st.cats = order.map((i) => st.cats[i]);
|
|
292
|
+
for (let s of seriesNorm) s.vals = order.map((i) => s.vals[i]);
|
|
293
|
+
}, catSort = options.sort?.categories;
|
|
294
|
+
if (catSort && catSort !== "sheet") {
|
|
295
|
+
let order = st.cats.map((_, i) => i);
|
|
296
|
+
if (catSort === "reverse") order.reverse();
|
|
297
|
+
else {
|
|
298
|
+
let dir = catSort === "asc" ? 1 : -1;
|
|
299
|
+
order.sort((a, b) => (weightAt(a) - weightAt(b)) * dir || a - b);
|
|
300
|
+
}
|
|
301
|
+
applyOrder(order);
|
|
302
|
+
}
|
|
303
|
+
let topN = options.topN;
|
|
304
|
+
if (!topN || topN.n <= 0 || st.cats.length <= topN.n) return null;
|
|
305
|
+
let { kept: keptIdx, dropped: dropIdx } = topNCut(st.cats.map((_, i) => weightAt(i)), topN.n);
|
|
306
|
+
if (topN.rest === !1 || dropIdx.length === 0)
|
|
307
|
+
return applyOrder(keptIdx), null;
|
|
308
|
+
let othersId = "others";
|
|
309
|
+
for (; st.cats.some((c) => c.id === othersId); ) othersId = `_${othersId}`;
|
|
310
|
+
let bases = dropIdx.map(basisAt), othersVals = seriesNorm.map((s) => s === st.widthSer ? restSum(dropIdx.map((i) => s.vals[i].v)) : poolMekkoAmounts(dropIdx.map((i, k) => ({ ...s.vals[i], basis: bases[k] })), st.mode === "percent")), total100 = st.mode === "percent" && dropIdx.some((i) => st.cats[i].total100 !== void 0) ? bases.reduce((sum, basis) => sum + basis, 0) : void 0;
|
|
311
|
+
return applyOrder(keptIdx), st.cats = [...st.cats, { id: othersId, label: restLabel(topN, options.strings, dropIdx.length), ...total100 === void 0 ? {} : { total100 } }], seriesNorm.forEach((s, k) => {
|
|
312
|
+
s.vals = [...s.vals, { v: othersVals[k], isPct: !1 }];
|
|
313
|
+
}), othersId;
|
|
314
|
+
}
|
|
315
|
+
function percentValidity(st, warnings) {
|
|
316
|
+
if (st.mode !== "percent") return;
|
|
317
|
+
st.cats.forEach((c, ci) => {
|
|
318
|
+
let values = st.series.map((series) => series.vals[ci]), { nm, na } = compositionBasis(values, c.total100);
|
|
319
|
+
if (nm) {
|
|
320
|
+
st.nm.add(c.id);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
na && (st.na.add(c.id), warnings.push({
|
|
324
|
+
code: "percent-basis-nonpositive",
|
|
325
|
+
severity: "warn",
|
|
326
|
+
message: `category '${c.id}': non-positive 100% basis \u2014 nothing to compose, category marked n/a`,
|
|
327
|
+
owner: { categoryId: c.id }
|
|
328
|
+
}));
|
|
329
|
+
}), st.nm.size > 0 && warnings.push(mixedSignsWarning([...st.nm], st.cats.length));
|
|
330
|
+
let overfull = st.cats.flatMap((c, ci) => {
|
|
331
|
+
if (st.nm.has(c.id) || st.na.has(c.id)) return [];
|
|
332
|
+
let values = st.series.map((series) => series.vals[ci]), sum = overfullShareSum(values, compositionBasis(values, c.total100).basis);
|
|
333
|
+
return sum === void 0 ? [] : [{ id: c.id, sum }];
|
|
334
|
+
});
|
|
335
|
+
for (let row of overfull) st.nm.add(row.id);
|
|
336
|
+
overfull.length > 0 && warnings.push(overfullWarning(overfull, st.nm.size + st.na.size === st.cats.length, "give every part as a share of the same whole, or use variant 'bar' for shares that overlap"));
|
|
337
|
+
}
|
|
338
|
+
function mekkoStacks(st, fns, warnings) {
|
|
339
|
+
let { plottedAt, absAt } = fns, columnTotals = emptyIdRecord(), posTop = [], negBot = [], anyByCat = [], weights = [];
|
|
340
|
+
st.cats.forEach((c, ci) => {
|
|
341
|
+
let pos = 0, neg = 0, any = !1;
|
|
342
|
+
for (let s of st.series) {
|
|
343
|
+
let v = plottedAt(s, ci);
|
|
344
|
+
v !== null && (any = !0, v >= 0 ? pos += v : neg += v);
|
|
345
|
+
}
|
|
346
|
+
posTop[ci] = pos, negBot[ci] = neg, anyByCat[ci] = any, columnTotals[c.id] = round2(st.series.reduce((a, s) => a + (absAt(s, ci) ?? 0), 0)), weights[ci] = fns.weightAt(ci);
|
|
347
|
+
});
|
|
348
|
+
let unknownTotals = new Set(st.cats.filter((_, ci) => st.series.some((s) => s.vals[ci].v !== null) && st.series.every((s) => absAt(s, ci) === null)).map((c) => c.id));
|
|
349
|
+
unknownTotals.size > 0 && !st.widthSer && (weights.fill(1), warnings.push({
|
|
350
|
+
code: "mekko-widths-need-amounts",
|
|
351
|
+
severity: "warn",
|
|
352
|
+
message: `a mekko's column widths need absolute column totals, and ${unknownTotals.size === st.cats.length ? "every column gives" : `${[...unknownTotals].join(", ")} give`} shares only: the columns draw at equal widths, and a column of shares prints no total`,
|
|
353
|
+
suggest: "give the values as amounts, or set widthSeriesId to the id of a series of column sizes"
|
|
354
|
+
}));
|
|
355
|
+
let totalWeight = weights.reduce((a, b) => a + b, 0);
|
|
356
|
+
totalWeight <= 0 && warnings.push({
|
|
357
|
+
code: "zero-weight-total",
|
|
358
|
+
severity: "warn",
|
|
359
|
+
message: "all column weights are zero \u2014 columns get equal widths"
|
|
360
|
+
});
|
|
361
|
+
let shares = emptyIdRecord();
|
|
362
|
+
return st.cats.forEach((c, ci) => {
|
|
363
|
+
let row = emptyIdRecord(), totalAbs = columnTotals[c.id];
|
|
364
|
+
for (let s of st.series)
|
|
365
|
+
if (st.mode === "percent") {
|
|
366
|
+
let p = plottedAt(s, ci);
|
|
367
|
+
p !== null && (row[s.id] = round2(p));
|
|
368
|
+
} else if (st.mode === "bar")
|
|
369
|
+
s.vals[ci].v !== null && (row[s.id] = 100);
|
|
370
|
+
else {
|
|
371
|
+
let a = absAt(s, ci);
|
|
372
|
+
a !== null && (row[s.id] = totalAbs !== 0 ? round2(a / totalAbs * 100) : 0);
|
|
373
|
+
}
|
|
374
|
+
shares[c.id] = row;
|
|
375
|
+
}), { columnTotals, unknownTotals, posTop, negBot, anyByCat, weights, totalWeight, shares };
|
|
376
|
+
}
|
|
377
|
+
function resolveMekkoDomain(data, env, warnings) {
|
|
378
|
+
let { options, va } = env, { cats, seriesNorm } = normalizeMekkoData(data), st = { ...mekkoSeriesRoles(options, seriesNorm, warnings), cats, nm: /* @__PURE__ */ new Set(), na: /* @__PURE__ */ new Set() }, fns = valueFns(st), allCats = st.cats, othersId = reorderCategories(st, seriesNorm, options, fns.weightAt, fns.basisAt), othersMembers = othersId === null ? [] : allCats.filter((c) => !st.cats.some((kept) => kept.id === c.id)).map((c) => c.label ?? c.id);
|
|
379
|
+
percentValidity(st, warnings);
|
|
380
|
+
let isOthersSeries = (s) => s.colorRole === "others" || s.id.toLowerCase() === "others", segSort = options.sort?.segments ?? "sheet", ridgeAt = st.mode === "percent" && options.sort?.segments === void 0 && options.ridge !== void 0 ? st.series.findIndex((s) => s.id === options.ridge) : -1, rest = st.series.map((_, si) => si).filter((si) => si !== ridgeAt), ridgeOrder = [ridgeAt, ...rest.filter((si) => !isOthersSeries(st.series[si])), ...rest.filter((si) => isOthersSeries(st.series[si]))].reverse(), order = st.cats.map((_, ci) => {
|
|
381
|
+
if (ridgeAt >= 0) return [...ridgeOrder];
|
|
382
|
+
let idx = st.series.map((_2, si) => si), ordered;
|
|
383
|
+
if (segSort === "sheet") ordered = idx;
|
|
384
|
+
else if (segSort === "reverse") ordered = [...idx].reverse();
|
|
385
|
+
else {
|
|
386
|
+
let dir = segSort === "asc" ? 1 : -1;
|
|
387
|
+
ordered = [...idx].sort((a, b) => {
|
|
388
|
+
let va2 = fns.plottedAt(st.series[a], ci) ?? 0;
|
|
389
|
+
return ((fns.plottedAt(st.series[b], ci) ?? 0) - va2) * dir || a - b;
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
return [
|
|
393
|
+
...ordered.filter((si) => !isOthersSeries(st.series[si])),
|
|
394
|
+
...ordered.filter((si) => isOthersSeries(st.series[si]))
|
|
395
|
+
];
|
|
396
|
+
}), stacks = mekkoStacks(st, fns, warnings), incomplete = new Set(st.mode === "bar" ? [] : st.cats.filter((_, ci) => isIncomplete(st.series.map((s) => s.vals[ci].v))).map((c) => c.id)), wholeUnknown = new Set(st.mode !== "percent" ? [] : st.cats.filter((c, ci) => {
|
|
397
|
+
let { basis, nm, direct } = compositionBasis(st.series.map((s) => s.vals[ci]), c.total100);
|
|
398
|
+
return direct && !nm && basis <= 0;
|
|
399
|
+
}).map((c) => c.id)), rounded = options.rounding === "sum-consistent" && st.mode !== "bar" ? roundWholes(st.cats.flatMap((c, ci) => {
|
|
400
|
+
if (fns.invalidAt(ci) || incomplete.has(c.id) || c.total100 !== void 0 || st.series.some((s) => s.vals[ci].isPct)) return [];
|
|
401
|
+
let total = st.series.reduce((sum, s) => sum + (fns.absAt(s, ci) ?? 0), 0), parts = st.series.flatMap((s) => {
|
|
402
|
+
let share = st.mode === "percent" ? fns.plottedAt(s, ci) : total !== 0 && fns.absAt(s, ci) !== null ? fns.absAt(s, ci) / total * 100 : null, example = s.vals[ci].format ?? s.format;
|
|
403
|
+
return share === null ? [] : [{ id: s.id, name: s.label, share, ...example ? { format: parseFormatExample(example) } : {} }];
|
|
404
|
+
});
|
|
405
|
+
return [{ id: c.id, name: c.label ?? c.id, parts }];
|
|
406
|
+
}), options.locale?.language, options.format && specUnitKind(parseFormatExample(options.format)) === "percent" ? parseFormatExample(options.format) : void 0) : void 0;
|
|
407
|
+
rounded && pushAll(warnings, rounded.warnings);
|
|
408
|
+
let dLo, dHi, lineExtent = valueLineExtent(options.annotations), loAll = Math.min(0, lineExtent?.lo ?? 0, minOf(stacks.negBot)), hiAll = Math.max(0, lineExtent?.hi ?? 0, maxOf(stacks.posTop));
|
|
409
|
+
if (st.mode === "percent")
|
|
410
|
+
dLo = Math.min(0, loAll), dHi = Math.max(100, hiAll);
|
|
411
|
+
else {
|
|
412
|
+
let lo2 = loAll < 0 ? loAll * 1.08 : 0, hi2 = hiAll > 0 ? hiAll * 1.08 : 0;
|
|
413
|
+
lo2 === 0 && hi2 === 0 && (hi2 = 1), [dLo, dHi] = niceDomain(lo2, hi2, 5, { dataExtent: [loAll, hiAll], maxWasteFraction: 0.15 }), st.mode === "bar" && va.show !== !0 && ([dLo, dHi] = loAll === 0 && hiAll === 0 ? [0, 1] : [loAll, hiAll]);
|
|
414
|
+
}
|
|
415
|
+
[dLo, dHi] = applyAxisBounds([dLo, dHi], [Math.min(loAll, 0), Math.max(hiAll, 0)], va, warnings);
|
|
416
|
+
let plottedTotal = (ci) => stacks.posTop[ci] + stacks.negBot[ci], valid = st.cats.map((_, ci) => !fns.invalidAt(ci)), meanWeight = st.cats.reduce((sum, _, ci) => sum + (valid[ci] ? stacks.weights[ci] : 0), 0), validCount = valid.filter(Boolean).length, meanValue = validCount > 0 ? meanWeight > 0 ? st.cats.reduce((a, _, ci) => a + (valid[ci] ? stacks.weights[ci] * plottedTotal(ci) : 0), 0) / meanWeight : st.cats.reduce((a, _, ci) => a + (valid[ci] ? plottedTotal(ci) : 0), 0) / validCount : void 0;
|
|
417
|
+
return {
|
|
418
|
+
mode: st.mode,
|
|
419
|
+
cats: st.cats,
|
|
420
|
+
series: st.series,
|
|
421
|
+
widthSer: st.widthSer,
|
|
422
|
+
othersId,
|
|
423
|
+
othersMembers,
|
|
424
|
+
nm: st.nm,
|
|
425
|
+
na: st.na,
|
|
426
|
+
incomplete,
|
|
427
|
+
wholeUnknown,
|
|
428
|
+
order,
|
|
429
|
+
...stacks,
|
|
430
|
+
dLo,
|
|
431
|
+
dHi,
|
|
432
|
+
meanValue,
|
|
433
|
+
validCount,
|
|
434
|
+
plottedAt: fns.plottedAt,
|
|
435
|
+
absAt: fns.absAt,
|
|
436
|
+
invalidAt: fns.invalidAt,
|
|
437
|
+
shareTexts: rounded?.texts ?? (options.format && specUnitKind(parseFormatExample(options.format)) === "percent" ? /* @__PURE__ */ new Map() : oneColumnPrecision(st, fns, incomplete, options.locale?.language)),
|
|
438
|
+
...rounded ? { roundingAdjustments: rounded.adjustments } : {}
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
function oneColumnPrecision(st, fns, incomplete, locale) {
|
|
442
|
+
let texts = /* @__PURE__ */ new Map();
|
|
443
|
+
return st.mode === "bar" || st.cats.forEach((c, ci) => {
|
|
444
|
+
if (fns.invalidAt(ci) || incomplete.has(c.id)) return;
|
|
445
|
+
let total = st.series.reduce((sum, s) => sum + (fns.absAt(s, ci) ?? 0), 0), shares = st.series.flatMap((s) => {
|
|
446
|
+
if (s.vals[ci].isPct) return [];
|
|
447
|
+
let share = st.mode === "percent" ? fns.plottedAt(s, ci) : total !== 0 && fns.absAt(s, ci) !== null ? fns.absAt(s, ci) / total * 100 : null;
|
|
448
|
+
return share === null ? [] : [{ id: s.id, share }];
|
|
449
|
+
}), set = shareSetFormatter(shares.map((entry) => entry.share), locale);
|
|
450
|
+
for (let { id, share } of shares) texts.set(`${c.id}\0${id}`, set.format(share));
|
|
451
|
+
}), texts;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// src/core/charts/mekko/model.ts
|
|
455
|
+
var colX = (area, ci) => area.xEdge[ci], colW = (area, ci) => area.xEdge[ci + 1] - area.xEdge[ci], colCx = (area, ci) => (area.xEdge[ci] + area.xEdge[ci + 1]) / 2;
|
|
456
|
+
|
|
457
|
+
// src/core/charts/mekko/plot.ts
|
|
458
|
+
function mekkoPaints(env, domain, warnings) {
|
|
459
|
+
let { theme, palette, highlights } = env, { series, mode } = domain, css = (p) => paintColor(theme, p), slots = rampSlots(theme, series.map(
|
|
460
|
+
(s) => s.fill ? { css: s.fill } : s.colorRole ? markRolePaint(s.colorRole, !0) : highlights.has(s.id) ? { token: "focus" } : void 0
|
|
461
|
+
), palette, series.length > 1 ? { labels: series.map((s) => s.label), warnings } : void 0), receding = recedingSeriesId(series, highlights), base = (s, dataIdx) => s.fill ? { css: s.fill } : s.colorRole ? markRolePaint(s.colorRole, !0) : s.id === receding ? mutedMarkPaint() : series.length === 1 ? seriesPaint(dataIdx, palette, s.scenario) : seriesPaint(slots[dataIdx] ?? dataIdx, palette), cell = (s, val, cat, dataIdx, v) => val.fill ? { css: val.fill } : highlights.has(cat.id) || highlights.has(s.id) ? { token: "focus" } : mode === "bar" && v < 0 && !s.fill && !s.colorRole ? signedFillPaint("bad") : val.scenario && series.length === 1 ? seriesPaint(dataIdx, palette, val.scenario) : base(s, dataIdx), pattern = (s, val) => {
|
|
462
|
+
let sc = val.scenario ?? s.scenario;
|
|
463
|
+
return sc === "FC" ? "hatch45" : sc === "PL" ? "outline" : void 0;
|
|
464
|
+
};
|
|
465
|
+
return { css, base, cell, pattern, inside: (s, val, cat, dataIdx, v) => effectiveFill(css(cell(s, val, cat, dataIdx, v)), pattern(s, val), theme) };
|
|
466
|
+
}
|
|
467
|
+
function mekkoLegend(env, domain, paints) {
|
|
468
|
+
let { options } = env, zero = disclosuresShown(options) ? [] : options[MEKKO_NOT_DRAWN] ?? [], omitted = zero.length > 0 ? [omittedKey("__omitted", chartString(options, "mekkoZeroNote", { v1: zero.join(", ") }))] : [];
|
|
469
|
+
if (env.namesInPlace) return omitted.length > 0 && options.legend !== "none" ? { options: normalizeLegendOption("top"), items: omitted } : void 0;
|
|
470
|
+
let position = options.legend ?? (domain.series.length > 1 && domain.mode !== "bar" || omitted.length > 0 ? "top" : void 0);
|
|
471
|
+
if (!position || position === "none" || position === "auto") return;
|
|
472
|
+
let painted = [];
|
|
473
|
+
domain.cats.forEach((_c, ci) => {
|
|
474
|
+
if (!domain.invalidAt(ci))
|
|
475
|
+
for (let s of domain.series) {
|
|
476
|
+
let v = domain.plottedAt(s, ci);
|
|
477
|
+
v === null || v === 0 || painted.push(paints.pattern(s, s.vals[ci]));
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
let legendOpts = normalizeLegendOption(position), seriesItems = domain.series.map((s, i) => ({
|
|
481
|
+
id: s.id,
|
|
482
|
+
label: s.label,
|
|
483
|
+
paint: paints.base(s, i),
|
|
484
|
+
pattern: s.scenario === "FC" ? "hatch45" : s.scenario === "PL" ? "outline" : void 0
|
|
485
|
+
})), items = [
|
|
486
|
+
...seriesItems,
|
|
487
|
+
...scenarioLegendKeys({ markPatterns: painted, keyPatterns: seriesItems.map((item) => item.pattern), paint: { token: "neutralMark" }, strings: options.strings }),
|
|
488
|
+
...omitted
|
|
489
|
+
];
|
|
490
|
+
if (legendOpts.order) {
|
|
491
|
+
let oi = (id) => {
|
|
492
|
+
let k = legendOpts.order.indexOf(id);
|
|
493
|
+
return k === -1 ? Number.MAX_SAFE_INTEGER : k;
|
|
494
|
+
};
|
|
495
|
+
items = [...items].sort((a, b) => oi(a.id) - oi(b.id));
|
|
496
|
+
}
|
|
497
|
+
return { options: legendOpts, items };
|
|
498
|
+
}
|
|
499
|
+
var MEKKO_NOT_DRAWN = /* @__PURE__ */ Symbol("mekkoNotDrawn");
|
|
500
|
+
function solveMekkoFrame(env, domain, paints) {
|
|
501
|
+
let { options, theme, size } = env, needsRightRoom = (options.annotations ?? []).some((a) => a.kind === "indicator100" && a.side === "right"), tokenMargin = canvasMargin(theme, size.width), margin = {
|
|
502
|
+
...tokenMargin,
|
|
503
|
+
right: needsRightRoom ? Math.max(56, tokenMargin.right) : tokenMargin.right,
|
|
504
|
+
...options.margin
|
|
505
|
+
}, legend = mekkoLegend(env, domain, paints), claims = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height });
|
|
506
|
+
return { frame: solveFrame({ size, margin, ...frameTextOptions(options), legend, theme, measure: env.measure }, claims), claims };
|
|
507
|
+
}
|
|
508
|
+
function kindSetting(env, kind) {
|
|
509
|
+
let l = env.options.labels;
|
|
510
|
+
if (l === !1) return kind === "category" && labelsOffKeepsNames(env.options);
|
|
511
|
+
let v = l?.[kind];
|
|
512
|
+
return v === void 0 ? !0 : v;
|
|
513
|
+
}
|
|
514
|
+
function mekkoPlotArea(env, domain, frame, warnings) {
|
|
515
|
+
let { theme, measure, va, options } = env, { mode, cats, weights, totalWeight, dLo, dHi } = domain, tickFont = { family: theme.type.family, ...theme.type.axis }, labelFont = { family: theme.type.family, ...theme.type.label }, strongFont = { family: theme.type.family, ...theme.type.label, weight: emphasisWeight(theme) }, totalH = measure("0", strongFont).height, hasCagr = (options.annotations ?? []).some((a) => a.kind === "cagr"), catsOnTop = mode === "percent", showCats = kindSetting(env, "category") !== !1, showTotals = kindSetting(env, "total") !== !1 && domain.cats.some((c) => !domain.wholeUnknown.has(c.id)), axisFmt = mode === "percent" ? (v) => formatAutomaticPercent(v, 0, !1, options.locale?.language) : env.fmt, segmentSetting = kindSetting(env, "segment"), valuesPrinted = (part) => segmentSetting === !0 || Array.isArray(segmentSetting) && segmentSetting.includes(part), smallCard = va.show === void 0 && (panelTypeClass(options) ?? typeWidthClass(env.size.width)) === "S", compactPercent = smallCard && mode === "percent" && valuesPrinted("percent"), compactUnit = smallCard && mode === "unit" && showTotals && (valuesPrinted("absolute") || domain.series.length === 1), showAxis = va.show ?? (mode !== "bar" && !compactPercent && !compactUnit), axisTitle = (showAxis || compactPercent) && axisTitleAllowed(options.labels) ? planValueAxisTitle(options.axisTitles?.primary, theme, measure, frame.plot.w) : void 0, axisTitleBand = valueAxisTitleBand(axisTitle, theme, measure, catsOnTop ? measure("0", tickFont).height : 0), axisReserve = showAxis ? measureValueAxisWidth([dLo, dHi], axisFmt, theme, measure) : 0, plotX0 = frame.plot.x + axisReserve, plotWFull = showAxis ? Math.max(10, frame.plot.w - axisReserve) : frame.plot.w, edgesFor = (plotW) => {
|
|
516
|
+
let edges = [plotX0], cumW = 0;
|
|
517
|
+
return cats.forEach((_, ci) => {
|
|
518
|
+
cumW += totalWeight > 0 ? weights[ci] : 1;
|
|
519
|
+
let denom = totalWeight > 0 ? totalWeight : cats.length;
|
|
520
|
+
edges.push(plotX0 + plotW * cumW / denom);
|
|
521
|
+
}), edges;
|
|
522
|
+
}, namedCol = env.namesInPlace ? widestColumn(domain, edgesFor(plotWFull)) : -1, gutter = sharesGutter(env, domain, edgesFor(plotWFull), labelFont, namedCol), plotW0 = Math.max(10, plotWFull - gutter), xEdge = mode === "bar" ? edgesFor(plotW0).map((x, i, all) => i === 0 || i === all.length - 1 ? x : Math.round(x)) : edgesFor(plotW0), last = cats.length - 1, borrow = catsOnTop && last > 0 ? Math.min(16, (xEdge[last] - xEdge[last - 1]) / 4) : 0, headW = (ci) => xEdge[ci + 1] - xEdge[ci] + (ci === last ? gutter + borrow : 0), catCenters = cats.map((_, ci) => ci === last ? xEdge[ci] - borrow + headW(ci) / 2 : (xEdge[ci] + xEdge[ci + 1]) / 2), visible = cats.map((_, ci) => xEdge[ci + 1] - xEdge[ci] >= 0.5), visibleCenters = catCenters.filter((_, ci) => visible[ci]), catStep = Math.max(
|
|
523
|
+
1,
|
|
524
|
+
visibleCenters.length > 1 ? minOf(visibleCenters.slice(1).map((center, i) => center - visibleCenters[i])) : plotW0
|
|
525
|
+
), row = categoryLabelsAndMarks(cats, { count: authoredFootnoteCount(options), warnings }), footnoteFont = { family: theme.type.family, ...theme.type.footnote }, rowPlan = (named, fonts = [tickFont, footnoteFont], widths, step = catStep) => planCategoryRow({
|
|
526
|
+
...row,
|
|
527
|
+
labels: row.labels.map((label, ci) => named[ci] ? label : ""),
|
|
528
|
+
keep: [...named],
|
|
529
|
+
centers: catCenters,
|
|
530
|
+
step,
|
|
531
|
+
// Columns are as wide as their totals: each name wraps in its own column.
|
|
532
|
+
widths: widths ? [...widths] : cats.map((_, ci) => headW(ci)),
|
|
533
|
+
fonts,
|
|
534
|
+
measure,
|
|
535
|
+
rotate: !1,
|
|
536
|
+
target: options.target,
|
|
537
|
+
textScale: textScaleOf(options)
|
|
538
|
+
}), catPlan = rowPlan(visible), footnoteStepAllowed = footnoteFont.size >= targetFloorsPx(options.target ?? DEFAULT_TARGET, textScaleOf(options)).axis;
|
|
539
|
+
if (catPlan.maxLines > 2 && catPlan.rotation === 0 && footnoteStepAllowed) {
|
|
540
|
+
let stepped = rowPlan(visible, [footnoteFont]);
|
|
541
|
+
stepped.maxLines <= 2 && stepped.step !== "stride" && !stepped.infos.some((info) => info.truncated) && (catPlan = stepped);
|
|
542
|
+
}
|
|
543
|
+
let dateNumericTicks = catPlan.dateNumeric || isDateNumericTickSequence(cats.map((c) => c.label ?? c.id)), unnamed = [], namePack;
|
|
544
|
+
if (showCats && catPlan.step === "stride" && !dateNumericTicks && !catsOnTop) {
|
|
545
|
+
namePack = packNames(env, domain, { labels: row.labels, font: tickFont, centers: catCenters, colLeft: xEdge.slice(0, -1), colRight: xEdge.slice(1), visible, lo: plotX0, hi: plotX0 + plotW0 });
|
|
546
|
+
let packed = rowPlan(namePack.row.map((r) => r >= 0), [tickFont], namePack.width.map((w, ci) => Math.max(w + 2, headW(ci))), plotW0 + Math.max(0, maxOf(namePack.width)));
|
|
547
|
+
catPlan = { ...packed, keep: namePack.row.map((r) => r >= 0), warnings: packed.warnings.filter((warning) => warning.code !== "category-stride") }, unnamed = cats.flatMap((_, ci) => visible[ci] && !catPlan.keep[ci] ? [ci] : []);
|
|
548
|
+
} else if (showCats && catPlan.step === "stride" && !dateNumericTicks) {
|
|
549
|
+
let fits = cats.map((_, ci) => visible[ci] && fitText(row.labels[ci], tickFont, Math.max(1, headW(ci) - 6), 2, measure, { target: options.target, textScale: textScaleOf(options), typeRole: "axis" }).title === void 0);
|
|
550
|
+
catPlan = rowPlan(fits), unnamed = cats.flatMap((_, ci) => visible[ci] && !catPlan.keep[ci] ? [ci] : []);
|
|
551
|
+
}
|
|
552
|
+
showCats && pushAll(warnings, catPlan.warnings);
|
|
553
|
+
let widthSer = domain.widthSer, widthValues = widthSer && showCats && catPlan.rotation === 0 ? cats.map((_, ci) => visible[ci] ? widthSer.vals[ci]?.v ?? null : null) : void 0, firstWidth = widthValues?.findIndex((v) => v !== null) ?? -1, widthTitled = widthValues !== void 0 && widthSer.unit !== void 0 && !catsOnTop, subtitleText = Object.values(resolveSubtitle(options.subtitle) ?? {}).flat().filter((part) => typeof part == "string").join(" ").toLowerCase(), captionShown = widthTitled && !(subtitleText.includes(widthSer.label.toLowerCase()) && subtitleText.includes(widthSer.unit.toLowerCase())), widthTexts = widthValues?.map((v, ci) => v === null ? "" : `${ci === firstWidth && !widthTitled ? `${widthSer.label} ` : ""}${env.widthFmt(v)}`), widthLineH = widthTexts ? catPlan.font.size * (catPlan.font.lineHeight ?? 1.2) : 0, widthTitleText = captionShown ? chartString(env.options, "widthTitle", { v1: widthSer.label, v2: widthSer.unit }) : void 0, widthTitlePlan = planValueAxisTitle(widthTitleText, theme, measure, frame.plot.w, 2), widthTitleH = widthTitlePlan ? widthTitlePlan.height + 4 : 0, tierH = namePack?.row.includes(1) ? catPlan.rowHeight + widthLineH + 2 : 0, categoryTickReserve = showCats ? catPlan.rowHeight + widthLineH + tierH + widthTitleH + (catsOnTop ? 4 : 8) : 0, topPad = 8 + axisTitleBand + (hasCagr ? 30 : 0) + (catsOnTop ? categoryTickReserve + (showTotals ? totalH + 4 : 0) : showTotals ? totalH + 6 : 0), catBandH = !catsOnTop && showCats ? categoryTickReserve : 4, hanging = !catsOnTop && showCats && showTotals ? cats.flatMap((c, ci) => (mode === "bar" ? domain.negBot[ci] : domain.columnTotals[c.id]) < 0 ? [domain.negBot[ci]] : []) : [], hangingEnd = hanging.length ? minOf(hanging) : void 0, plotH0 = frame.plot.h - catBandH - topPad, hangingReserve = hangingLabelReserve(plotH0, [dLo, dHi], hangingEnd, totalH + 4), headroom = plotFloorShare(env.size.width, options) >= 0.5 && mode === "unit" && !catsOnTop && showTotals ? totalH + 6 : 0;
|
|
554
|
+
fixedPlotChrome(frame, catBandH + topPad - headroom);
|
|
555
|
+
let chrome = plotChromeFloor.get(frame.frame);
|
|
556
|
+
if (chrome !== void 0 && hangingEnd !== void 0 && hangingEnd < 0) {
|
|
557
|
+
let share = dHi > dLo ? (hangingEnd - dLo) / (dHi - dLo) : 0, room = totalH + 4, floor = PLOT_FLOOR_PX[options.target ?? DEFAULT_TARGET], PLOT_FLOOR_SHARE = plotFloorShare(env.size.width, options), height = Math.max(
|
|
558
|
+
chrome + floor,
|
|
559
|
+
chrome + room + (1 - share) * floor,
|
|
560
|
+
chrome / (1 - PLOT_FLOOR_SHARE),
|
|
561
|
+
(chrome + room) / (1 - PLOT_FLOOR_SHARE + PLOT_FLOOR_SHARE * share)
|
|
562
|
+
);
|
|
563
|
+
share >= 0 && share < 1 && Number.isFinite(height) ? fixedPlotChrome(frame, catBandH + topPad - headroom + hangingLabelReserve(height - chrome, [dLo, dHi], hangingEnd, room)) : plotChromeFloor.delete(frame.frame);
|
|
564
|
+
}
|
|
565
|
+
let plotH = plotHeightAfter(frame, env.size.height, plotH0 - hangingReserve), need = Math.max(4, domain.series.length) * (totalH + 4);
|
|
566
|
+
frame.frame.plotMinHeight = Math.max(frame.frame.plotMinHeight ?? 0, env.size.height + (frame.deficit ?? 0) - (plotH0 - hangingReserve) + need);
|
|
567
|
+
let plot = {
|
|
568
|
+
x: showAxis ? frame.plot.x + axisReserve : frame.plot.x,
|
|
569
|
+
y: frame.plot.y + topPad,
|
|
570
|
+
w: plotW0,
|
|
571
|
+
h: plotH
|
|
572
|
+
}, y = linearScale([dLo, dHi], [plot.y + plot.h, plot.y]), catRowY = (dateNumericTicks ? plot.y + plot.h + hangingReserve : categoryRowTop(y, Math.min(0, minOf(domain.negBot)), hangingEnd, totalH + 4)) + 6;
|
|
573
|
+
return {
|
|
574
|
+
frame,
|
|
575
|
+
plot,
|
|
576
|
+
floorPlot: headroom > 0 ? { ...plot, y: plot.y - headroom, h: plot.h + headroom } : plot,
|
|
577
|
+
y,
|
|
578
|
+
y0: y(0),
|
|
579
|
+
tickFont,
|
|
580
|
+
labelFont,
|
|
581
|
+
strongFont,
|
|
582
|
+
totalH,
|
|
583
|
+
catsOnTop,
|
|
584
|
+
showCats,
|
|
585
|
+
showTotals,
|
|
586
|
+
showAxis,
|
|
587
|
+
axisFmt,
|
|
588
|
+
xEdge,
|
|
589
|
+
dateNumericTicks,
|
|
590
|
+
catPlan,
|
|
591
|
+
categoryTickReserve,
|
|
592
|
+
// A date row pins to the plot's bottom band; prose reads under the
|
|
593
|
+
// lowest column and its hanging total.
|
|
594
|
+
catRowY,
|
|
595
|
+
topPad,
|
|
596
|
+
axisTitle,
|
|
597
|
+
axisTitleBand,
|
|
598
|
+
widthTexts,
|
|
599
|
+
widthLineH,
|
|
600
|
+
...widthTitleText ? { widthTitle: { text: widthTitleText, y: catRowY + catPlan.rowHeight + widthLineH + tierH + 4 } } : {},
|
|
601
|
+
unnamed,
|
|
602
|
+
...namePack ? { namePack } : {},
|
|
603
|
+
namedCol,
|
|
604
|
+
gutter
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
var NAME_GAP = 6, PACK_SEARCH_MAX = 12;
|
|
608
|
+
function packNames(env, domain, row) {
|
|
609
|
+
let widthSer = domain.widthSer, width = domain.cats.map((_, ci) => {
|
|
610
|
+
let nameW = Math.max(0, ...row.labels[ci].split(`
|
|
611
|
+
`).map((line) => env.measure(line, row.font).width)), v = widthSer?.vals[ci]?.v, named = widthSer?.unit === void 0 && ci === widthSer?.vals.findIndex((cell) => cell?.v !== null && cell?.v !== void 0), valueW = v == null ? 0 : env.measure(`${named ? `${widthSer.label} ` : ""}${env.widthFmt(v)}`, row.font).width;
|
|
612
|
+
return Math.max(nameW, valueW);
|
|
613
|
+
}), drawn = domain.cats.map((_, ci) => row.visible[ci] && width[ci] > 0 && width[ci] <= row.hi - row.lo), centred = width.map((w, ci) => Math.max(row.lo, Math.min(row.centers[ci] - w / 2, row.hi - w))), minL = width.map((w, ci) => Math.max(row.lo, row.colLeft[ci] - w / 2)), maxL = width.map((w, ci) => Math.min(row.hi - w, row.colRight[ci] - w / 2)), order = domain.cats.map((_, ci) => ci).filter((ci) => drawn[ci]), place = (tierOf) => {
|
|
614
|
+
let lastRight2 = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], left = [...centred], tier = domain.cats.map(() => -1), moved = 0;
|
|
615
|
+
order.forEach((ci, k) => {
|
|
616
|
+
let t = tierOf(k), lo = minL[ci] <= maxL[ci] ? minL[ci] : centred[ci], hi = minL[ci] <= maxL[ci] ? maxL[ci] : centred[ci], at = Math.max(Math.min(Math.max(centred[ci], lo), hi), lastRight2[t] + NAME_GAP);
|
|
617
|
+
at > hi + 0.01 || (tier[ci] = t, left[ci] = at, lastRight2[t] = at + width[ci], moved += Math.abs(at - centred[ci]));
|
|
618
|
+
});
|
|
619
|
+
let unnamed = order.filter((ci) => tier[ci] < 0).length, firstLow = order.length > 0 && tier[order[0]] === 1 ? 1 : 0;
|
|
620
|
+
return { pack: { left, row: tier, width }, score: [unnamed, tier.filter((t) => t === 1).length, firstLow, moved] };
|
|
621
|
+
}, better = (a, b) => {
|
|
622
|
+
let k = a.findIndex((v, i) => Math.abs(v - b[i]) > 0.01);
|
|
623
|
+
return k >= 0 && a[k] < b[k];
|
|
624
|
+
}, lastRight = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], best = place((k) => {
|
|
625
|
+
let ci = order[k], hi = minL[ci] <= maxL[ci] ? maxL[ci] : centred[ci], t = lastRight.findIndex((right) => Math.max(centred[ci], right + NAME_GAP) <= hi + 0.01), at = t < 0 ? 0 : t;
|
|
626
|
+
return lastRight[at] = Math.max(centred[ci], lastRight[at] + NAME_GAP) + width[ci], at;
|
|
627
|
+
});
|
|
628
|
+
if (order.length <= PACK_SEARCH_MAX)
|
|
629
|
+
for (let mask = 0; mask < 1 << order.length; mask++) {
|
|
630
|
+
let tried = place((k) => mask >> k & 1);
|
|
631
|
+
better(tried.score, best.score) && (best = tried);
|
|
632
|
+
}
|
|
633
|
+
return best.pack;
|
|
634
|
+
}
|
|
635
|
+
function widestColumn(domain, edges) {
|
|
636
|
+
let best = -1;
|
|
637
|
+
return domain.cats.forEach((_, ci) => {
|
|
638
|
+
if (domain.invalidAt(ci) || domain.incomplete.has(domain.cats[ci].id)) return;
|
|
639
|
+
let w = edges[ci + 1] - edges[ci];
|
|
640
|
+
(best < 0 || w > edges[best + 1] - edges[best] + 0.5) && (best = ci);
|
|
641
|
+
}), best;
|
|
642
|
+
}
|
|
643
|
+
function sharesGutter(env, domain, edges, font, namedCol) {
|
|
644
|
+
let ci = domain.cats.length - 1;
|
|
645
|
+
if (domain.mode !== "percent" || ci < 1 || ci === namedCol || domain.invalidAt(ci) || domain.incomplete.has(domain.cats[ci].id) || kindSetting(env, "segment") !== !0) return 0;
|
|
646
|
+
let w = edges[ci + 1] - edges[ci];
|
|
647
|
+
if (w < 0.5) return 0;
|
|
648
|
+
let c = domain.cats[ci], widest = Math.max(0, maxOf(domain.series.map((s) => {
|
|
649
|
+
let v = domain.plottedAt(s, ci);
|
|
650
|
+
return v === null || v === 0 ? 0 : env.measure(domain.shareTexts.get(`${c.id}\0${s.id}`) ?? env.pctFmt(v), font).width;
|
|
651
|
+
})));
|
|
652
|
+
return widest + 4 <= w || widest === 0 ? 0 : Math.ceil(widest + GUTTER_GAP + 4);
|
|
653
|
+
}
|
|
654
|
+
var GUTTER_GAP = 5;
|
|
655
|
+
|
|
656
|
+
// src/core/charts/mekko/labels.ts
|
|
657
|
+
var SLIVER_MIN_W = 24;
|
|
658
|
+
function contentOf(env, kind, dflt) {
|
|
659
|
+
let s = kindSetting(env, kind);
|
|
660
|
+
return s === !1 ? null : Array.isArray(s) ? s : dflt;
|
|
661
|
+
}
|
|
662
|
+
function composeText(env, content, values, catLabel, serLabel, example) {
|
|
663
|
+
let parts = [];
|
|
664
|
+
for (let c of content)
|
|
665
|
+
c === "absolute" && values.abs !== null ? parts.push(example ? formatterFromExample(example, env.options.locale?.language)(values.abs) : env.fmt(values.abs)) : c === "percent" && values.pct !== null ? parts.push((env.options.rounding === "sum-consistent" ? values.pctText : void 0) ?? (example ? formatterFromExample(example, env.options.locale?.language)(values.pct) : values.authoredPct ? env.authoredPctFmt(values.pct) : values.pctText ?? env.pctFmt(values.pct))) : c === "category" && catLabel ? parts.push(catLabel) : c === "series" && serLabel && parts.push(serLabel);
|
|
666
|
+
return parts.join(" ");
|
|
667
|
+
}
|
|
668
|
+
function valueLineRules(env, domain, area) {
|
|
669
|
+
return (env.options.annotations ?? []).flatMap((annotation) => {
|
|
670
|
+
if (annotation.kind !== "valueLine") return [];
|
|
671
|
+
let value = typeof annotation.value == "number" ? annotation.value : domain.meanValue;
|
|
672
|
+
return value === void 0 || !Number.isFinite(value) ? [] : [{ x: area.plot.x, y: area.y(value) - 1, w: area.plot.w, h: 2 }];
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
function clearOfRules(candidates, segment, rules) {
|
|
676
|
+
return rules.length === 0 ? candidates : candidates.flatMap((candidate) => {
|
|
677
|
+
if (candidate.insideFill === void 0) return [candidate];
|
|
678
|
+
let seats = seatsPastBlockers(candidate.rect, "y", segment.y, segment.y + segment.h, rules, 3);
|
|
679
|
+
return seats.length === 0 ? [candidate] : seats.map((rect) => ({ ...candidate, rect }));
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
function segmentLabels(ctx, geometry) {
|
|
683
|
+
let { env, domain, area, paints } = ctx, { mode, cats } = domain;
|
|
684
|
+
if (mode === "bar") return;
|
|
685
|
+
let rules = valueLineRules(env, domain, area);
|
|
686
|
+
if (mode === "unit" && domain.series.length === 1 && area.showTotals) return;
|
|
687
|
+
let baseContent = contentOf(env, "segment", mode === "percent" ? ["percent"] : ["absolute"]);
|
|
688
|
+
if (!baseContent) return;
|
|
689
|
+
let last = cats.length - 1;
|
|
690
|
+
for (let { s, si, ci, v, rect } of geometry.segments) {
|
|
691
|
+
let c = cats[ci], val = s.vals[ci], content = ci === area.namedCol && !baseContent.includes("series") ? ["series", ...baseContent] : baseContent, pct = domain.incomplete.has(c.id) && (mode !== "percent" || c.total100 === void 0) ? null : mode === "percent" ? v : domain.shares[c.id][s.id] ?? null, text = composeText(env, content, {
|
|
692
|
+
abs: domain.absAt(s, ci),
|
|
693
|
+
pct,
|
|
694
|
+
authoredPct: mode === "percent" && val.isPct,
|
|
695
|
+
pctText: domain.shareTexts.get(`${c.id}\0${s.id}`)
|
|
696
|
+
}, c.label ?? c.id, s.label, val.format ?? s.format);
|
|
697
|
+
if (typeof val.labelOverride == "string" && (text = val.labelOverride.replace(/\$\{value\}/g, text)), !text && val.labelOverride !== !1) continue;
|
|
698
|
+
let tsize = env.measure(text || "0", area.labelFont), bw = colW(area, ci), fits = tsize.height + 4 <= rect.h && tsize.width + 4 <= bw, pin = env.options.labelPlacements?.[`segment:${s.id}:${c.id}`], inGutter = area.gutter > 0 && ci === last, topSegment = Math.abs(rect.y - area.y(Math.max(domain.posTop[ci], 0))) < 0.5, air = topSegment ? 2 : 4, tooShort = env.density === "smart" ? !pin && rect.h < tsize.height + air : segmentTooShort(env.density, rect.h, tsize.height, pin), topSeat = (candidates2) => {
|
|
699
|
+
let tight = topSegment && rect.h < tsize.height + 4 ? candidates2.find((candidate) => candidate.slot === "insideTight") : void 0, y = rect.y + rect.h - 2.01 - tsize.height;
|
|
700
|
+
return tight && y >= rect.y ? [{ ...tight, slot: "insideTightTop", rect: { ...tight.rect, y }, penalty: 0.9 }, ...candidates2] : candidates2;
|
|
701
|
+
}, sliver = !pin && !inGutter && env.density !== "full" && bw < SLIVER_MIN_W || !inGutter && tooShort, gutterSeat = inGutter && !fits ? [{ slot: "outsideRight", rect: { x: rect.x + rect.w + GUTTER_GAP, y: rect.y + rect.h / 2 - tsize.height / 2, w: tsize.width, h: tsize.height }, penalty: 0 }] : [], hl = env.highlights.has(c.id) || env.highlights.has(s.id), priority = val.priority ?? PRIORITY.interior + Math.min(99, Math.abs(v)) + (hl ? PRIORITY.highlightBonus : 0), candidates = [...typeof val.labelOverride == "string" ? gutterSeat : [], ...clearOfRules(topSeat(stackSegmentCandidates(rect, tsize, fits, paints.inside(s, val, c, si, v), { baselineY: area.y0 })), rect, rules).filter((candidate) => (typeof val.labelOverride == "string" || candidate.insideFill !== void 0) && (!area.showAxis || candidate.rect.x >= area.plot.x)).map((candidate) => ({ ...candidate, insidePaint: paints.cell(s, val, c, si, v), insidePattern: paints.pattern(s, val) }))], noInsideSeat = typeof val.labelOverride != "string" && !candidates.some((candidate) => candidate.insideFill !== void 0);
|
|
702
|
+
ctx.requests.push({
|
|
703
|
+
id: `segment:${s.id}:${c.id}`,
|
|
704
|
+
kind: "segment",
|
|
705
|
+
owner: { seriesId: s.id, categoryId: c.id },
|
|
706
|
+
// A withheld share or a share-only cell's missing amount does not print: only what prints counts.
|
|
707
|
+
...namesOnly(content.filter((part) => (part !== "percent" || pct !== null) && (part !== "absolute" || domain.absAt(s, ci) !== null)), val.labelOverride),
|
|
708
|
+
// A label that carries its series name ("Acme 44%") is composed: its role follows the string.
|
|
709
|
+
...content.includes("series") ? { role: composedTextRole(text) } : {},
|
|
710
|
+
text,
|
|
711
|
+
lines: [text],
|
|
712
|
+
font: area.labelFont,
|
|
713
|
+
priority,
|
|
714
|
+
redundant: val.labelOverride === !1 || sliver || noInsideSeat,
|
|
715
|
+
...typeof val.labelOverride != "string" ? { noLeader: !0 } : {},
|
|
716
|
+
...val.labelOverride !== !1 && noInsideSeat ? { suppressedAs: "density" } : {},
|
|
717
|
+
candidates
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function totalCandidates(negative, barMode, cx, edgeY, tsize, inside) {
|
|
722
|
+
let at = (slot, y, penalty, extra = {}) => ({ slot, rect: { x: cx - tsize.width / 2, y, w: tsize.width, h: tsize.height }, penalty, ...extra });
|
|
723
|
+
return negative ? [
|
|
724
|
+
at("outsideBottom", edgeY + 4, 0),
|
|
725
|
+
...barMode ? [at("insideEnd", edgeY - tsize.height - 2, 2, inside)] : []
|
|
726
|
+
] : [
|
|
727
|
+
at("columnTop", edgeY - tsize.height - 2, 0),
|
|
728
|
+
...barMode ? [at("insideEnd", edgeY + 2, 2, inside)] : []
|
|
729
|
+
];
|
|
730
|
+
}
|
|
731
|
+
function percentTotalsUnit(domain) {
|
|
732
|
+
if (domain.mode !== "percent") return;
|
|
733
|
+
let units = new Set(domain.series.map((s) => s.unit));
|
|
734
|
+
return units.size === 1 ? [...units][0] : void 0;
|
|
735
|
+
}
|
|
736
|
+
function columnTotalText(env, domain, ci, value = domain.columnTotals[domain.cats[ci].id]) {
|
|
737
|
+
let series = domain.series[0], example = domain.mode === "bar" ? series.vals[ci].format ?? series.format : void 0;
|
|
738
|
+
return example ? formatterFromExample(example, env.options.locale?.language)(value) : domain.mode === "bar" && series.vals[ci].isPct ? env.authoredPctFmt(value) : env.fmt(value);
|
|
739
|
+
}
|
|
740
|
+
var TOTAL_RULE_AIR = 2.05, gutterColumn = (area, ci) => area.gutter > 0 && ci === area.xEdge.length - 2;
|
|
741
|
+
function headLeft(area, ci, w) {
|
|
742
|
+
let left = gutterColumn(area, ci) ? area.xEdge[ci] + 3 : colCx(area, ci) - w / 2;
|
|
743
|
+
return area.catsOnTop && ci === area.xEdge.length - 2 ? Math.min(left, area.plot.x + area.plot.w + area.gutter - w) : left;
|
|
744
|
+
}
|
|
745
|
+
function totalLabel(ctx, ci, visibleCol, edges, unit) {
|
|
746
|
+
let { env, domain, area, paints } = ctx, { mode } = domain, c = domain.cats[ci], s0 = domain.series[0], val0 = s0.vals[ci], barV = mode === "bar" ? domain.plottedAt(s0, ci) : null, totalContent = contentOf(env, "total", ["absolute"]), text = "";
|
|
747
|
+
totalContent && (mode === "bar" ? barV !== null && (text = columnTotalText(env, domain, ci, barV)) : text = composeText(env, totalContent, { abs: domain.columnTotals[c.id], pct: null }, c.label ?? c.id, "")), text && unit && (text = withUnit(text, unit, !1, env.options.locale?.language));
|
|
748
|
+
let net = !!text && mode === "unit" && domain.posTop[ci] > 0 && domain.negBot[ci] < 0;
|
|
749
|
+
if (net && (text = chartString(env.options, "netValue", { v1: text })), !text || !visibleCol || domain.invalidAt(ci) || domain.incomplete.has(c.id) || domain.wholeUnknown.has(c.id) || mode !== "bar" && domain.unknownTotals.has(c.id)) return;
|
|
750
|
+
let tsize = env.measure(text, area.strongFont), negative = mode === "bar" ? barV !== null && barV < 0 : mode === "unit" && domain.columnTotals[c.id] < 0, owner = mode === "bar" ? { seriesId: s0.id, categoryId: c.id } : { categoryId: c.id }, candidates = totalCandidates(
|
|
751
|
+
negative,
|
|
752
|
+
mode === "bar",
|
|
753
|
+
headLeft(area, ci, tsize.width) + tsize.width / 2,
|
|
754
|
+
negative ? edges.bot : edges.top,
|
|
755
|
+
tsize,
|
|
756
|
+
negative || mode === "bar" ? {
|
|
757
|
+
insideFill: paints.inside(s0, val0, c, 0, barV ?? 0),
|
|
758
|
+
insidePaint: paints.cell(s0, val0, c, 0, barV ?? 0),
|
|
759
|
+
insidePattern: paints.pattern(s0, val0)
|
|
760
|
+
} : {}
|
|
761
|
+
);
|
|
762
|
+
if (!negative) {
|
|
763
|
+
let rules = valueLineRules(env, domain, area), past = seatsPastBlockers(candidates[0].rect, "y", area.frame.plot.y, edges.top - 2, rules, 3), first = candidates[0].rect, inkH = tsize.height - 2, under = rules.flatMap((rule) => {
|
|
764
|
+
let lo = rule.y + rule.h + TOTAL_RULE_AIR, hi = edges.top - TOTAL_RULE_AIR - inkH;
|
|
765
|
+
if (!rectsOverlap(rule, first, 2) || rule.y + rule.h > edges.top || hi < lo) return [];
|
|
766
|
+
let rect = { ...first, y: (lo + hi) / 2, h: inkH };
|
|
767
|
+
return rules.some((other) => rectsOverlap(other, rect, 2)) ? [] : [rect];
|
|
768
|
+
});
|
|
769
|
+
pushAll(candidates, under.map((rect) => ({ slot: "columnTopUnderRule", rect, penalty: 0.5 }))), pushAll(candidates, past.map((rect) => ({ slot: "columnTopPastRule", rect, penalty: 1.5 })));
|
|
770
|
+
}
|
|
771
|
+
ctx.requests.push({
|
|
772
|
+
id: `total:${c.id}`,
|
|
773
|
+
kind: "total",
|
|
774
|
+
owner,
|
|
775
|
+
...mode === "bar" ? {} : namesOnly(totalContent?.filter((part) => part !== "percent"), void 0),
|
|
776
|
+
...net ? { role: composedTextRole(text) } : {},
|
|
777
|
+
text,
|
|
778
|
+
lines: [text],
|
|
779
|
+
font: area.strongFont,
|
|
780
|
+
priority: PRIORITY.total + (env.highlights.has(c.id) ? PRIORITY.highlightBonus : 0),
|
|
781
|
+
candidates
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
function categoryLabel(ctx, ci, visibleCol, edges) {
|
|
785
|
+
let { area } = ctx, { catPlan, dateNumericTicks } = area, c = ctx.domain.cats[ci], named = catPlan.infos[ci], width = area.widthTexts?.[ci], info = width ? {
|
|
786
|
+
...named,
|
|
787
|
+
lines: [...named.lines, width],
|
|
788
|
+
w: Math.max(named.w, ctx.env.measure(width, catPlan.font).width),
|
|
789
|
+
h: named.h + area.widthLineH
|
|
790
|
+
} : named, tx = area.catsOnTop && ci === area.xEdge.length - 2 ? headLeft(area, ci, info.w) : width ? catPlan.anchor(ci, info.w) : catPlan.x(ci), at = (slot, y, penalty) => ({ slot, rect: { x: tx, y, w: info.w, h: info.h }, penalty }), aboveY = edges.top - (area.showTotals ? area.totalH + 4 : 2) - info.h - 2, pack = area.namePack, packed = (slot, y, penalty) => ({ slot, rect: { x: pack.left[ci], y, w: info.w, h: info.h }, penalty }), candidates = area.catsOnTop ? [at("aboveColumn", aboveY, 0), ...dateNumericTicks ? [] : [at("aboveColumnShifted", aboveY - catPlan.rowHeight, 1)]] : pack ? pack.row[ci] === 1 ? [{ ...packed("belowShifted", area.catRowY + info.h + 2, 0), ...tierLeader(ctx, ci, info.w, edges) }] : [packed("below", area.catRowY, 0), packed("belowShifted", area.catRowY + info.h + 2, 1)] : [
|
|
791
|
+
at("below", area.catRowY, 0),
|
|
792
|
+
...dateNumericTicks ? [] : [at("belowShifted", area.catRowY + catPlan.rowHeight, 1)]
|
|
793
|
+
];
|
|
794
|
+
ctx.requests.push({
|
|
795
|
+
id: `category:${c.id}`,
|
|
796
|
+
kind: "category",
|
|
797
|
+
owner: { categoryId: c.id },
|
|
798
|
+
text: c.label ?? c.id,
|
|
799
|
+
lines: info.lines,
|
|
800
|
+
...width || pack ? { align: "middle" } : categoryLineAlign(catPlan, ci),
|
|
801
|
+
...info.title !== void 0 ? { title: info.title } : {},
|
|
802
|
+
font: catPlan.font,
|
|
803
|
+
priority: PRIORITY.endpoint,
|
|
804
|
+
redundant: !catPlan.keep[ci] || !visibleCol,
|
|
805
|
+
candidates
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
function tierLeader(ctx, ci, w, edges) {
|
|
809
|
+
let { area, domain } = ctx, pack = area.namePack, left = pack.left[ci], lo = Math.max(area.xEdge[ci] + 1, left + 2), hi = Math.min(area.xEdge[ci + 1] - 1, left + w - 2);
|
|
810
|
+
if (lo > hi) return {};
|
|
811
|
+
let clear = (x2) => domain.cats.every((_, cj) => cj === ci || pack.row[cj] !== 0 || x2 < pack.left[cj] - 3 || x2 > pack.left[cj] + pack.width[cj] + 3), centre = Math.max(lo, Math.min(hi, (area.xEdge[ci] + area.xEdge[ci + 1]) / 2)), x = [centre, ...Array.from({ length: Math.floor(hi - lo) + 1 }, (_, k) => lo + k).sort((a, b) => Math.abs(a - centre) - Math.abs(b - centre))].find(clear);
|
|
812
|
+
if (x === void 0) return {};
|
|
813
|
+
let y = (edges.bot > area.y0 + 0.5 && area.showTotals ? edges.bot + area.totalH + 2 : Math.max(edges.bot, area.y0)) + 4;
|
|
814
|
+
return y < area.catRowY ? { leaderFrom: { x, y }, leaderVertical: !0 } : {};
|
|
815
|
+
}
|
|
816
|
+
function planMekkoLabels(env, domain, area, geometry, paints, warnings) {
|
|
817
|
+
let ctx = { env, domain, area, paints, requests: [] }, sharesOn = contentOf(env, "segment", domain.mode === "percent" ? ["percent"] : ["absolute"])?.includes("percent") === !0, withheld = [sharesOn ? "share labels" : "", area.showTotals ? "totals" : ""].filter(Boolean).join(" and ");
|
|
818
|
+
if (withheld && warnIncompleteComposition(
|
|
819
|
+
warnings,
|
|
820
|
+
domain.cats.filter((c) => domain.incomplete.has(c.id)).map((c) => c.label ?? c.id),
|
|
821
|
+
`their ${withheld} would describe the known parts only and are not printed`
|
|
822
|
+
), sharesOn && domain.mode === "percent" && env.options.rounding !== "sum-consistent" && warnShareRoundingDrift(warnings, domain.cats.flatMap((c, ci) => domain.invalidAt(ci) || domain.incomplete.has(c.id) || c.total100 !== void 0 || domain.series.some((s) => s.vals[ci].isPct) ? [] : [((shares) => ({ name: c.label ?? c.id, shares, decimals: shareSetDecimals(shares) }))(domain.series.flatMap((s) => domain.plottedAt(s, ci) ?? []))])), segmentLabels(ctx, geometry), area.widthTitle) {
|
|
823
|
+
let title = planValueAxisTitle(area.widthTitle.text, env.theme, env.measure, area.frame.plot.w, 2);
|
|
824
|
+
ctx.requests.push(valueAxisTitleRequest(title, { x: area.frame.plot.x, y: area.widthTitle.y }, "start", "axis:x:title"));
|
|
825
|
+
}
|
|
826
|
+
let { y, y0 } = area, totalsUnit = percentTotalsUnit(domain) ?? (domain.mode !== "percent" && env.options.unit && !unitPrinted({ subtitle: resolveSubtitle(env.options.subtitle), unit: env.options.unit, unitShown: env.options.unitShown }) ? env.options.unit : void 0), unitNamed = !1;
|
|
827
|
+
return domain.cats.forEach((c, ci) => {
|
|
828
|
+
let visibleCol = colW(area, ci) >= 0.5 && domain.anyByCat[ci], edges = { top: y(Math.max(domain.posTop[ci], 0)), bot: Math.max(y0, y(Math.min(0, domain.negBot[ci]))) }, printsTotal = visibleCol && !domain.invalidAt(ci) && !domain.incomplete.has(c.id) && !domain.wholeUnknown.has(c.id);
|
|
829
|
+
area.showTotals && totalLabel(ctx, ci, visibleCol, edges, printsTotal && !unitNamed ? totalsUnit : void 0), unitNamed ||= area.showTotals && printsTotal, area.showCats && categoryLabel(ctx, ci, visibleCol, edges);
|
|
830
|
+
}), ctx.requests;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// src/core/charts/mekko/marks.ts
|
|
834
|
+
function stackColumn(ci, input, out) {
|
|
835
|
+
let { env, domain, area, paints } = input, { mode } = domain, { y, y0 } = area, c = domain.cats[ci], bx = colX(area, ci), bw = colW(area, ci), visibleCol = bw >= 0.5, segs = [];
|
|
836
|
+
if (domain.invalidAt(ci)) {
|
|
837
|
+
out.marks.columns.push({ categoryId: c.id, x: bx, w: bw, rect: { x: bx, y: y0, w: bw, h: 0.5 }, segments: segs });
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
let posCursor = 0, negCursor = 0, posSum = domain.posTop[ci];
|
|
841
|
+
for (let si of domain.order[ci]) {
|
|
842
|
+
let s = domain.series[si], val = s.vals[ci], v = domain.plottedAt(s, ci);
|
|
843
|
+
if (v === null) continue;
|
|
844
|
+
let vTop, vBot;
|
|
845
|
+
if (v >= 0 ? (vTop = posSum - posCursor, vBot = vTop - v, posCursor += v) : (vTop = negCursor, vBot = negCursor + v, negCursor = vBot), out.segEdges.set(sk(s.id, c.id), { top: vTop, bot: vBot, v, abs: domain.absAt(s, ci) }), v === 0 || !visibleCol) continue;
|
|
846
|
+
let sy = y(vTop), rect = { x: bx, y: sy, w: bw, h: Math.max(y(vBot) - sy, 0.5) }, nodeId = `mark:${s.id}:${c.id}`, cellFill = paints.cell(s, val, c, si, v), cellPat = paints.pattern(s, val), cellSep = cellPat || markOutlineOff(cellFill, env.theme) ? void 0 : separationStroke(paints.css(cellFill), env.theme.color.background, env.theme);
|
|
847
|
+
out.nodes.push({
|
|
848
|
+
t: "rect",
|
|
849
|
+
id: nodeId,
|
|
850
|
+
rect,
|
|
851
|
+
fill: cellFill,
|
|
852
|
+
pattern: cellPat,
|
|
853
|
+
...cellSep ?? {},
|
|
854
|
+
separation: { fill: cellFill, backing: { token: "background" }, pattern: cellPat },
|
|
855
|
+
owner: { seriesId: s.id, categoryId: c.id },
|
|
856
|
+
part: mode === "bar" ? "bar" : "segment",
|
|
857
|
+
display: {
|
|
858
|
+
value: (mode === "percent" && env.options.rounding === "sum-consistent" ? domain.shareTexts.get(`${c.id}\0${s.id}`) : void 0) ?? (val.format ?? s.format ? formatterFromExample(val.format ?? s.format, env.options.locale?.language)(mode === "percent" || val.isPct ? v : domain.absAt(s, ci)) : val.isPct ? env.authoredPctFmt(v) : mode === "percent" ? domain.shareTexts.get(`${c.id}\0${s.id}`) ?? env.pctFmt(v) : env.fmt(domain.absAt(s, ci)))
|
|
859
|
+
}
|
|
860
|
+
}), out.claims.claim(rect, "mark", { seriesId: s.id, categoryId: c.id }), segs.push({ seriesId: s.id, rect, nodeId }), out.segments.push({ s, si, ci, v, rect });
|
|
861
|
+
}
|
|
862
|
+
let colTop = y(Math.max(posSum, 0)), colBot = y(Math.min(negCursor, 0));
|
|
863
|
+
if (out.marks.columns.push({
|
|
864
|
+
categoryId: c.id,
|
|
865
|
+
x: bx,
|
|
866
|
+
w: bw,
|
|
867
|
+
rect: { x: bx, y: colTop, w: bw, h: Math.max(colBot - colTop, 0.5) },
|
|
868
|
+
segments: segs
|
|
869
|
+
}), c.id === domain.othersId && segs.length > 0) {
|
|
870
|
+
let { x, y: top, w, h } = { x: bx + 0.75, y: colTop + 0.75, w: Math.max(bw - 1.5, 0.5), h: Math.max(colBot - colTop - 1.5, 0.5) }, corners = [[x, top], [x + w, top], [x + w, top + h], [x, top + h], [x, top]];
|
|
871
|
+
corners.slice(1).forEach(([x2, y2], k) => {
|
|
872
|
+
let [x1, y1] = corners[k];
|
|
873
|
+
out.nodes.push({ t: "line", id: `othersOutline:${c.id}:${k}`, x1, y1, x2, y2, stroke: { token: "ink" }, width: strokeToken(env.theme, "mark"), owner: { categoryId: c.id }, part: "othersOutline" });
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
function suppressedGlyphs(env, domain, area, nodes, claims) {
|
|
878
|
+
domain.mode === "percent" && domain.cats.forEach((c, ci) => {
|
|
879
|
+
let glyph = domain.nm.has(c.id) ? "n.m." : domain.na.has(c.id) ? notApplicableGlyph(env.options.strings) : null;
|
|
880
|
+
if (!glyph || colW(area, ci) < 0.5) return;
|
|
881
|
+
let glyphFont = { family: env.theme.type.family, ...env.theme.type.label }, glyphSize = env.measure(glyph, glyphFont), cx = colCx(area, ci), rect = { x: cx - glyphSize.width / 2, y: area.y0 - glyphSize.height - 6, w: glyphSize.width, h: glyphSize.height };
|
|
882
|
+
nodes.push({
|
|
883
|
+
t: "text",
|
|
884
|
+
id: `nm:${c.id}`,
|
|
885
|
+
x: cx,
|
|
886
|
+
y: rect.y,
|
|
887
|
+
lines: [glyph],
|
|
888
|
+
align: "middle",
|
|
889
|
+
font: glyphFont,
|
|
890
|
+
ink: { token: "inkMuted" },
|
|
891
|
+
owner: { categoryId: c.id },
|
|
892
|
+
part: "nmMarker",
|
|
893
|
+
typeRole: "label",
|
|
894
|
+
display: { state: glyph }
|
|
895
|
+
}), claims.claim(rect, "label", { categoryId: c.id });
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
function ridgeOutline(env, domain, area, geometry, warnings) {
|
|
899
|
+
let ridge = env.options.ridge;
|
|
900
|
+
if (!ridge) return;
|
|
901
|
+
let rs = domain.series.find((s) => s.id === ridge);
|
|
902
|
+
if (!rs) {
|
|
903
|
+
warnings.push({ code: "unknown-ridge", severity: "warn", message: `ridge series '${ridge}' is not a plotted data series` });
|
|
904
|
+
return;
|
|
905
|
+
}
|
|
906
|
+
let runs = [], run = [];
|
|
907
|
+
if (domain.cats.forEach((c, ci) => {
|
|
908
|
+
let e = geometry.segEdges.get(sk(rs.id, c.id));
|
|
909
|
+
if (!e || colW(area, ci) < 0.5) {
|
|
910
|
+
run.length > 1 && runs.push(run), run = [];
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
let ry = area.y(e.top);
|
|
914
|
+
run.push({ x: colX(area, ci), y: ry }, { x: colX(area, ci) + colW(area, ci), y: ry });
|
|
915
|
+
}), run.length > 1 && runs.push(run), runs.length === 0) return;
|
|
916
|
+
let ridgeId = `ridge:${rs.id}`;
|
|
917
|
+
geometry.nodes.push({ t: "path", id: ridgeId, d: runs.map((r) => linePath(r)).join(""), stroke: { token: "markInk" }, width: strokeToken(env.theme, "data"), owner: { seriesId: rs.id }, part: "ridge" }), geometry.marks.ridgeNodeId = ridgeId;
|
|
918
|
+
}
|
|
919
|
+
function layoutMekkoMarks(env, domain, area, paints, warnings) {
|
|
920
|
+
let { plot, y, y0 } = area, geometry = {
|
|
921
|
+
nodes: [],
|
|
922
|
+
claims: createOccupiedIndex({ x: 0, y: 0, w: env.size.width, h: env.size.height }),
|
|
923
|
+
axes: [],
|
|
924
|
+
marks: { columns: [] },
|
|
925
|
+
segEdges: /* @__PURE__ */ new Map(),
|
|
926
|
+
segments: [],
|
|
927
|
+
widths: emptyIdRecord()
|
|
928
|
+
}, { nodes, claims } = geometry;
|
|
929
|
+
if (area.showAxis) {
|
|
930
|
+
let axisResult = layoutValueAxis(
|
|
931
|
+
{ scale: y, plot, orient: "y", gridlines: env.va.gridlines ?? !1, format: area.axisFmt, theme: env.theme, measure: env.measure },
|
|
932
|
+
claims
|
|
933
|
+
);
|
|
934
|
+
nodes.push(...axisResult.nodes), geometry.axes.push(axisResult.axis);
|
|
935
|
+
}
|
|
936
|
+
return domain.cats.forEach((c, ci) => {
|
|
937
|
+
geometry.widths[c.id] = round2(colW(area, ci)), colW(area, ci) < 0.5 && domain.anyByCat[ci] && warnings.push({
|
|
938
|
+
code: "zero-weight-column",
|
|
939
|
+
severity: "warn",
|
|
940
|
+
message: `category '${c.id}': zero width \u2014 column and its labels are suppressed`,
|
|
941
|
+
owner: { categoryId: c.id }
|
|
942
|
+
});
|
|
943
|
+
}), nodes.push({ t: "line", id: "axis:baseline", x1: plot.x, y1: y0, x2: plot.x + plot.w, y2: y0, stroke: { token: "axis" }, width: strokeToken(env.theme, "rule"), owner: {}, part: "baseline" }), claims.claim({ x: plot.x, y: y0 - 0.5, w: plot.w, h: 1 }, "axis", {}), domain.cats.forEach((_c, ci) => stackColumn(ci, { env, domain, area, paints }, geometry)), nodes.push({ t: "line", id: "axis:baseline:over", x1: plot.x, y1: y0, x2: plot.x + plot.w, y2: y0, stroke: { token: "axis" }, width: strokeToken(env.theme, "rule"), owner: {}, part: "baseline" }), suppressedGlyphs(env, domain, area, nodes, claims), ridgeOutline(env, domain, area, geometry, warnings), (env.options.annotations ?? []).forEach((ann, n) => {
|
|
944
|
+
if (ann.kind !== "valueLine") return;
|
|
945
|
+
let annId = ann.id ?? `valueLine-${n + 1}`, v = ann.value === "mean" || ann.value === void 0 ? domain.meanValue : ann.value;
|
|
946
|
+
v !== void 0 && claims.claim({ x: plot.x, y: y(v) - 1, w: plot.w, h: 2 }, "annotation", { annotationId: annId });
|
|
947
|
+
}), geometry;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
// src/core/charts/mekko/layout.ts
|
|
951
|
+
function annotateMekko(env, domain, area, geometry, occupied, solveCtx) {
|
|
952
|
+
let { cats } = domain, { y, y0, plot, topPad } = area, catIndex = new Map(cats.map((c, i) => [c.id, i])), resolveAnchor = (ref) => {
|
|
953
|
+
let norm = typeof ref == "string" ? { categoryId: ref, edge: "total" } : ref;
|
|
954
|
+
if (!("categoryId" in norm)) return null;
|
|
955
|
+
let ci = catIndex.get(norm.categoryId);
|
|
956
|
+
if (ci === void 0) return null;
|
|
957
|
+
let c = cats[ci];
|
|
958
|
+
if (domain.invalidAt(ci)) return null;
|
|
959
|
+
if (norm.seriesId) {
|
|
960
|
+
let e = geometry.segEdges.get(sk(norm.seriesId, c.id));
|
|
961
|
+
if (!e) return null;
|
|
962
|
+
let edge = norm.edge ?? "end", named = domain.series.find((s) => s.id === norm.seriesId);
|
|
963
|
+
return {
|
|
964
|
+
x: colCx(area, ci),
|
|
965
|
+
y: y(edge === "start" ? e.bot : e.top),
|
|
966
|
+
value: e.abs ?? e.v,
|
|
967
|
+
format: named?.format,
|
|
968
|
+
date: c.date,
|
|
969
|
+
owner: { categoryId: c.id, seriesId: norm.seriesId },
|
|
970
|
+
...named && domain.series.length > 1 ? { series: { id: named.id, label: named.label } } : {}
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
let topPlotted = domain.posTop[ci] > 0 ? domain.posTop[ci] : domain.negBot[ci];
|
|
974
|
+
return {
|
|
975
|
+
x: colCx(area, ci),
|
|
976
|
+
y: norm.edge === "start" ? y0 : y(topPlotted),
|
|
977
|
+
value: domain.columnTotals[c.id],
|
|
978
|
+
format: domain.series.length === 1 ? domain.series[0].format : void 0,
|
|
979
|
+
date: c.date,
|
|
980
|
+
owner: { categoryId: c.id }
|
|
981
|
+
};
|
|
982
|
+
}, annPlot = { x: plot.x, y: plot.y - (topPad - 8 - area.axisTitleBand), w: plot.w, h: plot.h + (topPad - 8 - area.axisTitleBand) };
|
|
983
|
+
return runAnnotatePass({
|
|
984
|
+
annotations: env.options.annotations ?? [],
|
|
985
|
+
resolve: resolveAnchor,
|
|
986
|
+
defaultSpan: cats.length >= 2 ? { from: cats[0].id, to: cats[cats.length - 1].id } : void 0,
|
|
987
|
+
occupied,
|
|
988
|
+
plot: annPlot,
|
|
989
|
+
// The labels draw bold (see labelsToNodes below), so the pass measures them bold.
|
|
990
|
+
theme: emphasisLabelTheme(env.theme),
|
|
991
|
+
measure: env.measure,
|
|
992
|
+
format: env.options.format,
|
|
993
|
+
locale: env.options.locale?.language,
|
|
994
|
+
strings: env.options.strings,
|
|
995
|
+
valueLinePercentLevels: env.options.unit === "%" || domain.mode === "percent",
|
|
996
|
+
solveCtx,
|
|
997
|
+
yScale: y,
|
|
998
|
+
meanValue: domain.meanValue
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
function mekkoDescription(env, domain) {
|
|
1002
|
+
let { mode, cats, series, widthSer, nm, na } = domain, modeName = mode === "percent" ? chartString(env.options, "mekkoPercentAxis") : mode === "unit" ? chartString(env.options, "mekkoUnitAxis") : chartString(env.options, "barMekko"), widthText = widthSer ? `'${widthSer.label}'` : chartString(env.options, "categoryTotals");
|
|
1003
|
+
if (mode === "percent" && (nm.size > 0 || na.size > 0))
|
|
1004
|
+
return chartString(env.options, "mekkoValidDesc", { v1: modeName, v2: domain.validCount, v3: series.length }) + widthText + chartString(env.options, "mekkoInvalidDesc", { v1: cats.flatMap((c, ci) => domain.invalidAt(ci) || domain.wholeUnknown.has(c.id) ? [] : [`${c.label ?? c.id} ${columnTotalText(env, domain, ci)}`]).join(", ") || "none", v2: cats.filter((_, ci) => domain.invalidAt(ci)).map((c) => `${c.label ?? c.id} (${nm.has(c.id) ? "n.m." : "n/a"})`).join(", ") });
|
|
1005
|
+
let totals = cats.flatMap((c, ci) => domain.wholeUnknown.has(c.id) ? [] : [`${c.label ?? c.id} ${columnTotalText(env, domain, ci)}`]);
|
|
1006
|
+
return chartString(env.options, "mekkoDesc", { v1: modeName, v2: cats.length, v3: series.length }) + widthText + (totals.length > 0 ? chartString(env.options, "totalsSentence", { v1: totals.join(", ") }) : ".");
|
|
1007
|
+
}
|
|
1008
|
+
function assembleMekkoGeometry(input) {
|
|
1009
|
+
let { env, domain, area, geometry, solved, annotated, warnings } = input, { cats } = domain, { frame, catPlan, showCats } = area, catFont = catPlan.font, allLabels = [...solved.placed, ...annotated.labels], nodes = [...frame.nodes, ...geometry.nodes, ...annotated.nodes];
|
|
1010
|
+
pushAll(nodes, labelsToNodes(
|
|
1011
|
+
env.theme,
|
|
1012
|
+
allLabels,
|
|
1013
|
+
(l) => l.kind === "total" || l.kind === "grandTotal" ? area.strongFont : l.kind === "category" ? catFont : l.kind === "annotation" || l.kind === "valueLine" ? { ...area.labelFont, weight: emphasisWeight(env.theme) } : area.labelFont,
|
|
1014
|
+
nodes
|
|
1015
|
+
));
|
|
1016
|
+
let axes = [
|
|
1017
|
+
{
|
|
1018
|
+
axis: "x",
|
|
1019
|
+
baselineNodeId: "axis:baseline",
|
|
1020
|
+
ticks: cats.map((c, i) => ({ at: c.id, pos: colCx(area, i), labelId: showCats ? `category:${c.id}` : void 0 }))
|
|
1021
|
+
},
|
|
1022
|
+
...geometry.axes
|
|
1023
|
+
], a11yDesc = mekkoDescription(env, domain), paintWarningRules = [];
|
|
1024
|
+
pushAll(warnings, rectSeriesAdjacentWarnings(nodes, input.paints.css, "vertical", env.highlights, env.theme, { rules: paintWarningRules, before: warnings.filter((warning) => !["pie-ramp-crowded", "likert-ramp-invisible", "band-lightness-insufficient", "series-adjacent-similar", "highlight-reads-as-loss"].includes(warning.code)).length }));
|
|
1025
|
+
let catTickMaxLines = catPlan.maxLines, printedTotals = Object.fromEntries(domain.cats.flatMap((c, ci) => domain.series.some((s) => s.vals[ci].v !== null) && !domain.unknownTotals.has(c.id) && !domain.wholeUnknown.has(c.id) ? [[c.id, domain.columnTotals[c.id]]] : []));
|
|
1026
|
+
return {
|
|
1027
|
+
type: "mekko",
|
|
1028
|
+
size: env.size,
|
|
1029
|
+
plot: area.plot,
|
|
1030
|
+
...area.floorPlot !== area.plot ? { [PLOT_FLOOR_RECT]: area.floorPlot } : {},
|
|
1031
|
+
scene: withSegmentSeams(nodes, env.theme),
|
|
1032
|
+
labels: allLabels,
|
|
1033
|
+
axes,
|
|
1034
|
+
annotations: annotated.placed,
|
|
1035
|
+
legend: frame.legend,
|
|
1036
|
+
frame: frame.frame,
|
|
1037
|
+
marks: geometry.marks,
|
|
1038
|
+
derived: {
|
|
1039
|
+
columnTotals: printedTotals,
|
|
1040
|
+
stackParts: stackParts(printedTotals, domain.cats, domain.series, (si, ci) => domain.absAt(domain.series[si], ci)),
|
|
1041
|
+
shares: domain.shares,
|
|
1042
|
+
widths: geometry.widths,
|
|
1043
|
+
...domain.roundingAdjustments ? { roundingAdjustments: domain.roundingAdjustments } : {},
|
|
1044
|
+
...showCats ? {
|
|
1045
|
+
tickBand: {
|
|
1046
|
+
reserved: area.categoryTickReserve,
|
|
1047
|
+
measuredLines: catTickMaxLines,
|
|
1048
|
+
lineHeight: catFont.size * 1.2,
|
|
1049
|
+
extra: catPlan.rowHeight - catTickMaxLines * catFont.size * 1.2,
|
|
1050
|
+
dateNumeric: area.dateNumericTicks,
|
|
1051
|
+
position: area.catsOnTop ? "above" : "below"
|
|
1052
|
+
}
|
|
1053
|
+
} : {}
|
|
1054
|
+
},
|
|
1055
|
+
a11y: {
|
|
1056
|
+
titleCounts: [structureCount("categories", cats.length, void 0, env.options)],
|
|
1057
|
+
title: accessibleTitle(env.options.title, chartString(env.options, "mekkoTitle", { v1: domain.series.map((s) => s.label).join(", "), v2: cats.length })),
|
|
1058
|
+
counts: [domain.mode === "percent" && (domain.nm.size > 0 || domain.na.size > 0) ? structureCount("columns", domain.validCount, chartString(env.options, "validColumns", { v1: domain.validCount })) : structureCount("columns", cats.length, void 0, env.options), structureCount("series", domain.series.length, void 0, env.options)],
|
|
1059
|
+
desc: a11yDesc
|
|
1060
|
+
},
|
|
1061
|
+
warnings,
|
|
1062
|
+
paintWarningRules,
|
|
1063
|
+
debug: {
|
|
1064
|
+
occupied: input.occupied.snapshot(),
|
|
1065
|
+
decisions: [...solved.decisions, ...annotated.decisions]
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
}
|
|
1069
|
+
function commitClaims(occupied, phase) {
|
|
1070
|
+
for (let c of phase.snapshot()) occupied.claim(c.rect, c.kind, c.owner, c.part);
|
|
1071
|
+
phase.tickColumns && (occupied.tickColumns = phase.tickColumns);
|
|
1072
|
+
}
|
|
1073
|
+
function notDrawnColumns(domain, area) {
|
|
1074
|
+
return domain.cats.flatMap((c, ci) => area.xEdge[ci + 1] - area.xEdge[ci] < 0.5 && !domain.invalidAt(ci) ? [c.label ?? c.id] : []);
|
|
1075
|
+
}
|
|
1076
|
+
function mekkoNotes(env, domain, area) {
|
|
1077
|
+
let name = (ci) => domain.cats[ci].label ?? domain.cats[ci].id, notes = [];
|
|
1078
|
+
if (area.unnamed.length > 0) {
|
|
1079
|
+
let unnamed = area.unnamed.map(name);
|
|
1080
|
+
notes.push(disclosureNote(chartString(env.options, "mekkoUnnamedNote", { v1: unnamed.join(", ") })));
|
|
1081
|
+
}
|
|
1082
|
+
let dropped = notDrawnColumns(domain, area);
|
|
1083
|
+
dropped.length > 0 && notes.push(disclosureNote(chartString(env.options, "mekkoZeroNote", { v1: dropped.join(", ") })));
|
|
1084
|
+
let others = domain.othersId === null ? void 0 : domain.cats.find((c) => c.id === domain.othersId);
|
|
1085
|
+
return others && domain.othersMembers.length > 0 && notes.push(disclosureNote(`${others.label ?? others.id}: ${domain.othersMembers.join(", ")}.`)), notes;
|
|
1086
|
+
}
|
|
1087
|
+
function layoutMekko(data, options = {}) {
|
|
1088
|
+
if (options.legend === void 0 && (options.variant ?? "stacked100") === "stacked100" && options.labels !== !1) {
|
|
1089
|
+
let named = layoutMekkoPass(data, options, !0, !0);
|
|
1090
|
+
if (named.namedAll) return named.geometry;
|
|
1091
|
+
}
|
|
1092
|
+
return layoutMekkoPass(data, options).geometry;
|
|
1093
|
+
}
|
|
1094
|
+
function everySeriesNamed(domain, area, placed) {
|
|
1095
|
+
if (area.namedCol < 0 || domain.series.length < 2) return !1;
|
|
1096
|
+
let c = domain.cats[area.namedCol], ids = new Set(placed.flatMap((l) => l.hidden === void 0 ? [l.id] : []));
|
|
1097
|
+
return domain.series.every((s) => ids.has(`segment:${s.id}:${c.id}`));
|
|
1098
|
+
}
|
|
1099
|
+
function layoutMekkoPass(data, options, addNotes = !0, named = !1) {
|
|
1100
|
+
let warnings = [], env = resolveMekkoEnv(options, warnings), domain = resolveMekkoDomain(data, env, warnings);
|
|
1101
|
+
if (named) {
|
|
1102
|
+
if (domain.mode !== "percent" || domain.series.length < 2 || kindSetting(env, "segment") !== !0) return { geometry: void 0, namedAll: !1 };
|
|
1103
|
+
env.namesInPlace = !0;
|
|
1104
|
+
}
|
|
1105
|
+
let paints = mekkoPaints(env, domain, warnings), { size } = env, { frame, claims } = solveMekkoFrame(env, domain, paints), area = mekkoPlotArea(env, domain, frame, warnings), notDrawn = notDrawnColumns(domain, area);
|
|
1106
|
+
if (notDrawn.length > 0 && !disclosuresShown(options) && !options[MEKKO_NOT_DRAWN])
|
|
1107
|
+
return layoutMekkoPass(data, { ...options, [MEKKO_NOT_DRAWN]: notDrawn }, addNotes, named);
|
|
1108
|
+
let notes = addNotes ? mekkoNotes(env, domain, area) : [];
|
|
1109
|
+
if (notes.length > 0 && options.footnotes !== !1) {
|
|
1110
|
+
let authored = options.authoredFootnotes ?? options.footnotes;
|
|
1111
|
+
return layoutMekkoPass(data, withAuthoredFootnotes(options, [...authoredNotes(options), ...notes], authored), !1, named);
|
|
1112
|
+
}
|
|
1113
|
+
let occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height });
|
|
1114
|
+
commitClaims(occupied, claims);
|
|
1115
|
+
let geometry = layoutMekkoMarks(env, domain, area, paints, warnings);
|
|
1116
|
+
commitClaims(occupied, geometry.claims);
|
|
1117
|
+
let requests = planMekkoLabels(env, domain, area, geometry, paints, warnings);
|
|
1118
|
+
area.axisTitle && requests.unshift(valueAxisTitleRequest(area.axisTitle, { x: frame.plot.x, y: frame.plot.y + 4 }, "start", "axis:y:title"));
|
|
1119
|
+
let solveCtx = {
|
|
1120
|
+
focus: options.focus,
|
|
1121
|
+
density: env.density,
|
|
1122
|
+
pins: options.labelPlacements ?? {},
|
|
1123
|
+
measure: env.measure,
|
|
1124
|
+
plot: area.plot,
|
|
1125
|
+
canvas: { x: 0, y: 0, w: size.width, h: size.height },
|
|
1126
|
+
darkInk: env.theme.color.ink,
|
|
1127
|
+
lightInk: env.theme.color.inkInverse,
|
|
1128
|
+
labelPad: 2
|
|
1129
|
+
};
|
|
1130
|
+
solveCtx.valueRows = [{ ids: domain.cats.map((category) => `total:${category.id}`), alternate: !0 }];
|
|
1131
|
+
let solved = solveLabels(requests, occupied, solveCtx);
|
|
1132
|
+
applyValueAxisTitleInk(solved.placed), pushAll(warnings, solved.warnings);
|
|
1133
|
+
let namedAll = named && everySeriesNamed(domain, area, solved.placed);
|
|
1134
|
+
if (named && !namedAll) return { geometry: void 0, namedAll };
|
|
1135
|
+
let annotated = annotateMekko(env, domain, area, geometry, occupied, solveCtx);
|
|
1136
|
+
return pushAll(warnings, annotated.warnings), { geometry: assembleMekkoGeometry({ env, domain, area, paints, geometry, solved, annotated, occupied, warnings }), namedAll };
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
// src/core/charts/mekko/core.ts
|
|
1140
|
+
var mekkoCore = {
|
|
1141
|
+
type: "mekko",
|
|
1142
|
+
sizing: chartSizing("mekko"),
|
|
1143
|
+
title: "Mekko / Marimekko",
|
|
1144
|
+
summary: "Variable-width marimekko: stacked100 or stacked columns, plus bar-mekko profit pools (alias bar-mekko draws variant:'bar')",
|
|
1145
|
+
aliases: ["marimekko", "bar-mekko"],
|
|
1146
|
+
aliasDefaults: { "bar-mekko": { variant: "bar" } },
|
|
1147
|
+
layout: (data, options) => layoutMekko(prepareFractionData(data), options),
|
|
1148
|
+
categoryLabels: calendarCategories,
|
|
1149
|
+
prepare: prepareFractionData,
|
|
1150
|
+
defaults: { variant: "stacked100" },
|
|
1151
|
+
annotationKinds: ["cagr", "diff", "delta", "note", "callout", "valueLine", "indicator100", "abs"]
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
export {
|
|
1155
|
+
mekkoCore
|
|
1156
|
+
};
|