boardplot 0.0.0-stage → 0.52.5
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 +18 -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-VUNSFKZY.js +137 -0
- package/dist/annotateEngine-H7OW4H3W.js +30 -0
- package/dist/build-identity.json +6 -0
- package/dist/chunk-24WB3HMB.js +621 -0
- package/dist/chunk-263SZKIL.js +8 -0
- package/dist/chunk-27QQEWNV.js +18 -0
- package/dist/chunk-2AKWCMS4.js +24 -0
- package/dist/chunk-2DHJJ2EN.js +24 -0
- package/dist/chunk-2EQE4E3I.js +22 -0
- package/dist/chunk-2GELJH37.js +88 -0
- package/dist/chunk-2JAWQ7VV.js +3874 -0
- package/dist/chunk-2LMCD3ZR.js +6 -0
- package/dist/chunk-2MTWKMEG.js +841 -0
- package/dist/chunk-2SGIHKKU.js +33 -0
- package/dist/chunk-2UVTHU7A.js +1146 -0
- package/dist/chunk-33CBPK5Q.js +2800 -0
- package/dist/chunk-33PLBIMA.js +176 -0
- package/dist/chunk-35DZP2R2.js +22 -0
- package/dist/chunk-3D3D3D23.js +25 -0
- package/dist/chunk-3EZRM4YM.js +92 -0
- package/dist/chunk-3GZECHOK.js +802 -0
- package/dist/chunk-3HHNQPAH.js +68 -0
- package/dist/chunk-3I6RANBJ.js +1058 -0
- package/dist/chunk-3SIRPKMP.js +12 -0
- package/dist/chunk-3W23F7EY.js +185 -0
- package/dist/chunk-3XQ635KD.js +24 -0
- package/dist/chunk-3ZCKEANJ.js +24 -0
- package/dist/chunk-4DNOEV3Q.js +25857 -0
- package/dist/chunk-4GB7TBY7.js +373 -0
- package/dist/chunk-4SM2ONUC.js +18 -0
- package/dist/chunk-5C7TWNYZ.js +79 -0
- package/dist/chunk-5DJXJXDE.js +58 -0
- package/dist/chunk-5ENRZX6I.js +687 -0
- package/dist/chunk-5KWXRYAT.js +294 -0
- package/dist/chunk-5T5YW52S.js +47 -0
- package/dist/chunk-627P6T25.js +936 -0
- package/dist/chunk-62FR4FYJ.js +23 -0
- package/dist/chunk-6JUJ2DU3.js +67 -0
- package/dist/chunk-6KWIQ5KF.js +18 -0
- package/dist/chunk-6UBEGKIQ.js +25 -0
- package/dist/chunk-6XE3GVGU.js +116 -0
- package/dist/chunk-76ANFJOI.js +227 -0
- package/dist/chunk-7IFLQMJL.js +160 -0
- package/dist/chunk-7JVAQX6C.js +28 -0
- package/dist/chunk-7QDAHY5M.js +63 -0
- package/dist/chunk-7VXZDB45.js +149 -0
- package/dist/chunk-7X65ZQN4.js +38 -0
- package/dist/chunk-A2FHZH7E.js +1410 -0
- package/dist/chunk-A372DLQX.js +54 -0
- package/dist/chunk-A3ULWR5N.js +76 -0
- package/dist/chunk-A4QZXLXF.js +7 -0
- package/dist/chunk-A5JWFZVU.js +1467 -0
- package/dist/chunk-A5LZUYK4.js +59 -0
- package/dist/chunk-A6XCAQ52.js +89 -0
- package/dist/chunk-A7A4PDG5.js +24 -0
- package/dist/chunk-A7IEVBYI.js +35 -0
- package/dist/chunk-ACXX2JNL.js +6 -0
- package/dist/chunk-AFK47A6O.js +25 -0
- package/dist/chunk-ALKTNXMR.js +3650 -0
- package/dist/chunk-AOQ6VF5H.js +6 -0
- package/dist/chunk-ASAON7G4.js +648 -0
- package/dist/chunk-ATTE3FYC.js +24 -0
- package/dist/chunk-AZOUSKZD.js +728 -0
- package/dist/chunk-B2EBEXIS.js +113 -0
- package/dist/chunk-B67K5X4M.js +58 -0
- package/dist/chunk-BBL3R5YZ.js +186 -0
- package/dist/chunk-BIDIGDGH.js +6 -0
- package/dist/chunk-BKYMLFUG.js +69 -0
- package/dist/chunk-BLFWUMTD.js +12 -0
- package/dist/chunk-BM6SFFWF.js +6 -0
- package/dist/chunk-BUPLB3EX.js +129 -0
- package/dist/chunk-BVWU6GOB.js +47 -0
- package/dist/chunk-BW5VLBSZ.js +15 -0
- package/dist/chunk-C64FBRJO.js +290 -0
- package/dist/chunk-CAE2HK2G.js +295 -0
- package/dist/chunk-CCQNL33L.js +446 -0
- package/dist/chunk-CDZHNLO6.js +42 -0
- package/dist/chunk-COKHNEJP.js +24 -0
- package/dist/chunk-COYPDRJK.js +21 -0
- package/dist/chunk-CRZKGHZ6.js +1810 -0
- package/dist/chunk-CS4DHFNG.js +128 -0
- package/dist/chunk-CYDZP5W6.js +1589 -0
- package/dist/chunk-D4BIV6WG.js +1072 -0
- package/dist/chunk-D4SOADBD.js +19 -0
- package/dist/chunk-DCCJRLAJ.js +422 -0
- package/dist/chunk-DFKTS6XJ.js +75 -0
- package/dist/chunk-DGDOGOTQ.js +25 -0
- package/dist/chunk-DLC23CKC.js +53 -0
- package/dist/chunk-DRTA6JG5.js +160 -0
- package/dist/chunk-DVKBU23L.js +97 -0
- package/dist/chunk-E2HEVF23.js +692 -0
- package/dist/chunk-EC2NAYPQ.js +24 -0
- package/dist/chunk-EKQK5D6G.js +14 -0
- package/dist/chunk-EKQMYG2B.js +2353 -0
- package/dist/chunk-ELYU6TRQ.js +98 -0
- package/dist/chunk-EQT3EPTB.js +203 -0
- package/dist/chunk-ERAIVAK5.js +1359 -0
- package/dist/chunk-ETHWK2RZ.js +16 -0
- package/dist/chunk-EWVKBRLV.js +72 -0
- package/dist/chunk-F77BNDAT.js +43 -0
- package/dist/chunk-FGAGGPFF.js +566 -0
- package/dist/chunk-FIANWJXX.js +19 -0
- package/dist/chunk-FIWNDOMO.js +6 -0
- package/dist/chunk-FOKEGVPB.js +24 -0
- package/dist/chunk-FT3F72C3.js +30 -0
- package/dist/chunk-FT47HQ5U.js +47 -0
- package/dist/chunk-GDOW2KNP.js +19 -0
- package/dist/chunk-GDQ3NGDZ.js +17 -0
- package/dist/chunk-GH3ZMBFX.js +563 -0
- package/dist/chunk-GQPESFAF.js +3378 -0
- package/dist/chunk-GQS46LC3.js +50 -0
- package/dist/chunk-GULJ6KVT.js +587 -0
- package/dist/chunk-GWQIXU37.js +2774 -0
- package/dist/chunk-GZ2VNM4L.js +24 -0
- package/dist/chunk-GZ4RHGIW.js +836 -0
- package/dist/chunk-H4H4O62O.js +46 -0
- package/dist/chunk-H57TJD3B.js +72 -0
- package/dist/chunk-H7UZZ7KP.js +24 -0
- package/dist/chunk-HAAUJDGB.js +83 -0
- package/dist/chunk-HFG76JTS.js +296 -0
- package/dist/chunk-HJXXFPOL.js +211 -0
- package/dist/chunk-HTYFQHRC.js +24 -0
- package/dist/chunk-HUF6TQ2J.js +24 -0
- package/dist/chunk-HUFCSX2Y.js +89 -0
- package/dist/chunk-HX3MQ3H4.js +26 -0
- package/dist/chunk-HZQEQ34U.js +296 -0
- package/dist/chunk-I322G5UG.js +888 -0
- package/dist/chunk-IDDA5INB.js +60 -0
- package/dist/chunk-IDTLHPTK.js +60 -0
- package/dist/chunk-II7652VA.js +2918 -0
- package/dist/chunk-IN4QT33I.js +38 -0
- package/dist/chunk-IV2UXZXX.js +16 -0
- package/dist/chunk-IXSZ7OKR.js +133 -0
- package/dist/chunk-IYEFEBRN.js +41 -0
- package/dist/chunk-IZ35GMGB.js +2543 -0
- package/dist/chunk-IZCOG3FS.js +28 -0
- package/dist/chunk-JA755JHN.js +379 -0
- package/dist/chunk-JETXFF3M.js +33 -0
- package/dist/chunk-JFBEAUJ6.js +24 -0
- package/dist/chunk-JFG4DHKQ.js +48 -0
- package/dist/chunk-JL5BRMDT.js +179 -0
- package/dist/chunk-JLCAWQ3H.js +195 -0
- package/dist/chunk-JLZM7XMZ.js +525 -0
- package/dist/chunk-JMH5MD5A.js +19 -0
- package/dist/chunk-JRPI64AQ.js +3066 -0
- package/dist/chunk-JSX3C6LL.js +344 -0
- package/dist/chunk-JY4R3GML.js +83 -0
- package/dist/chunk-JYBT2JNY.js +61 -0
- package/dist/chunk-K2HNV4LE.js +2008 -0
- package/dist/chunk-KAXJFL7N.js +43 -0
- package/dist/chunk-KDMKHR5A.js +32 -0
- package/dist/chunk-KFFNCDX6.js +19 -0
- package/dist/chunk-KKWZWP67.js +24 -0
- package/dist/chunk-KOJ5QETJ.js +8 -0
- package/dist/chunk-KPMGGE4W.js +51 -0
- package/dist/chunk-KS7DXCXH.js +27 -0
- package/dist/chunk-KSYVTEKR.js +24 -0
- package/dist/chunk-KU4YS6HN.js +61 -0
- package/dist/chunk-KYELSLDJ.js +40 -0
- package/dist/chunk-LC3PSQJJ.js +383 -0
- package/dist/chunk-LC6DYCTG.js +85 -0
- package/dist/chunk-LNKY5Z2X.js +23 -0
- package/dist/chunk-LO2DANS6.js +302 -0
- package/dist/chunk-M4SPKUZE.js +7 -0
- package/dist/chunk-M4YLED7M.js +17 -0
- package/dist/chunk-M6KTNAND.js +746 -0
- package/dist/chunk-MCOIEWW6.js +54 -0
- package/dist/chunk-MDYLOIS2.js +48 -0
- package/dist/chunk-MEISCROL.js +24 -0
- package/dist/chunk-MFLH5ZDQ.js +69 -0
- package/dist/chunk-MIXKQJ64.js +935 -0
- package/dist/chunk-MJMJEURO.js +359 -0
- package/dist/chunk-MNJ2DHU6.js +526 -0
- package/dist/chunk-NEVSQGOI.js +63 -0
- package/dist/chunk-NG5IGZXC.js +1179 -0
- package/dist/chunk-NLOMCLKI.js +3303 -0
- package/dist/chunk-NMCOUVN5.js +24 -0
- package/dist/chunk-NT3HAZYT.js +51 -0
- package/dist/chunk-NXNQQ3DS.js +382 -0
- package/dist/chunk-NYEY6W5R.js +569 -0
- package/dist/chunk-OAPCJO6W.js +23 -0
- package/dist/chunk-OH7FA4TF.js +251 -0
- package/dist/chunk-OLNORNCT.js +331 -0
- package/dist/chunk-OQEBOVUO.js +30 -0
- package/dist/chunk-ORUJI3VB.js +83 -0
- package/dist/chunk-PEN2DK7T.js +49 -0
- package/dist/chunk-PGIQMQRU.js +1650 -0
- package/dist/chunk-PTVOXB5T.js +39 -0
- package/dist/chunk-PUVGWJQ5.js +24 -0
- package/dist/chunk-PWROWDZS.js +137 -0
- package/dist/chunk-Q6XJOJTY.js +29 -0
- package/dist/chunk-QBR6IKIX.js +50 -0
- package/dist/chunk-QETGGFH2.js +30 -0
- package/dist/chunk-QG6MOQLI.js +2934 -0
- package/dist/chunk-QGCEHR6S.js +13 -0
- package/dist/chunk-QHFQHQDC.js +43 -0
- package/dist/chunk-QHRE2M6V.js +26 -0
- package/dist/chunk-QKL7IY42.js +38 -0
- package/dist/chunk-QN6JHMGU.js +44 -0
- package/dist/chunk-QNHZXFRA.js +347 -0
- package/dist/chunk-QPWRHDLZ.js +17 -0
- package/dist/chunk-QVABTUDS.js +80 -0
- package/dist/chunk-QXILAMAU.js +28 -0
- package/dist/chunk-QZAT46PP.js +95 -0
- package/dist/chunk-R3WI7ZLE.js +545 -0
- package/dist/chunk-R5SWC3EW.js +30 -0
- package/dist/chunk-RJQ5YS3Q.js +40 -0
- package/dist/chunk-RNOD2UWF.js +613 -0
- package/dist/chunk-RNXITK5M.js +24 -0
- package/dist/chunk-ROXO4R3J.js +16 -0
- package/dist/chunk-RQ5DNYLG.js +10 -0
- package/dist/chunk-RSWVH7DB.js +24 -0
- package/dist/chunk-RTJXOIIQ.js +12 -0
- package/dist/chunk-RZNYW7UP.js +133 -0
- package/dist/chunk-S4F27M7N.js +37 -0
- package/dist/chunk-S4ONWRJE.js +28 -0
- package/dist/chunk-S53OGZL6.js +168 -0
- package/dist/chunk-S5ADHIZK.js +2508 -0
- package/dist/chunk-S62M63LU.js +19 -0
- package/dist/chunk-S7VDRUED.js +62 -0
- package/dist/chunk-SGD3ZHID.js +250 -0
- package/dist/chunk-SGSPYHFE.js +40 -0
- package/dist/chunk-SLTMRTXV.js +597 -0
- package/dist/chunk-SXGTRZFN.js +26 -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-TNEHPP3H.js +18 -0
- package/dist/chunk-TPYV2FTV.js +25 -0
- package/dist/chunk-TPZB2YWR.js +25 -0
- package/dist/chunk-TSR5YDPS.js +1266 -0
- package/dist/chunk-TTR7EWNH.js +170 -0
- package/dist/chunk-TVHLKVUO.js +24 -0
- package/dist/chunk-TXINIAFL.js +198 -0
- package/dist/chunk-TXZBBZOG.js +58 -0
- package/dist/chunk-UEU46Q3D.js +300 -0
- package/dist/chunk-UMDEWWXT.js +33 -0
- package/dist/chunk-UQSVWO7Z.js +334 -0
- package/dist/chunk-UZF3G2FN.js +942 -0
- package/dist/chunk-V422EKLW.js +24 -0
- package/dist/chunk-V4DYVLOO.js +433 -0
- package/dist/chunk-V4VC25UL.js +128 -0
- package/dist/chunk-V667FCIJ.js +12 -0
- package/dist/chunk-VABRPZVC.js +43 -0
- package/dist/chunk-VB2MJLET.js +19 -0
- package/dist/chunk-VDAKTZQP.js +18 -0
- package/dist/chunk-VDAZPGR2.js +79 -0
- package/dist/chunk-VXZFQKBJ.js +21 -0
- package/dist/chunk-VYMGZ27S.js +133 -0
- package/dist/chunk-W2RGSGRR.js +131 -0
- package/dist/chunk-W7UZXD5D.js +1109 -0
- package/dist/chunk-WDUNR2VI.js +2718 -0
- package/dist/chunk-WHSTEAVP.js +229 -0
- package/dist/chunk-WJMUMN3I.js +127 -0
- package/dist/chunk-WLZ54FWG.js +120 -0
- package/dist/chunk-WMJPFLF3.js +2980 -0
- package/dist/chunk-WRHFBCVY.js +24 -0
- package/dist/chunk-WVSNSWBJ.js +47 -0
- package/dist/chunk-WYJEOMNY.js +31 -0
- package/dist/chunk-WYJMV62X.js +24 -0
- package/dist/chunk-WZGJSQKN.js +29 -0
- package/dist/chunk-WZL4EEBS.js +11 -0
- package/dist/chunk-X7TXGKRX.js +272 -0
- package/dist/chunk-XB4KZ6WO.js +81 -0
- package/dist/chunk-XDLQRSSH.js +266 -0
- package/dist/chunk-XDS4UZGR.js +113 -0
- package/dist/chunk-XEGRWWNO.js +30 -0
- package/dist/chunk-XO5ONLVM.js +420 -0
- package/dist/chunk-XPWRD424.js +24 -0
- package/dist/chunk-XTNV2YMB.js +50 -0
- package/dist/chunk-XW5J5JAX.js +42 -0
- package/dist/chunk-XY5O74BH.js +33 -0
- package/dist/chunk-XYONCO5Q.js +984 -0
- package/dist/chunk-Y4PXIJMD.js +829 -0
- package/dist/chunk-YAYRRKC7.js +24 -0
- package/dist/chunk-YEDYBMCW.js +210 -0
- package/dist/chunk-YFG4E3N2.js +1161 -0
- package/dist/chunk-YHTO46W2.js +2670 -0
- package/dist/chunk-YI2ZVTCB.js +38 -0
- package/dist/chunk-YKO3VCTF.js +24 -0
- package/dist/chunk-YP3I6W7T.js +24 -0
- package/dist/chunk-YQ2B3YVF.js +687 -0
- package/dist/chunk-YS6KMYM4.js +91 -0
- package/dist/chunk-YTSSXSZR.js +197 -0
- package/dist/chunk-Z256ACGC.js +27 -0
- package/dist/chunk-Z2MGTKDR.js +20 -0
- package/dist/chunk-Z5VSLLNY.js +23 -0
- package/dist/chunk-Z7X3RGGA.js +22 -0
- package/dist/chunk-ZF43WRG3.js +29 -0
- package/dist/chunk-ZJKOLOVF.js +1754 -0
- package/dist/chunk-ZQ4VFQID.js +76 -0
- package/dist/chunk-ZSLGN6CO.js +89 -0
- package/dist/chunk-ZVTFZF4V.js +542 -0
- package/dist/cli/index.js +9 -0
- package/dist/core-5Z6UW5DS.js +31 -0
- package/dist/core-6ANZ2OWO.js +40 -0
- package/dist/core-6LLJNZ4O.js +37 -0
- package/dist/core-CPN2HF75.js +33 -0
- package/dist/core-CS7AKNME.js +37 -0
- package/dist/core-DBRILYNB.js +38 -0
- package/dist/core-DU77ZYPR.js +34 -0
- package/dist/core-E6YD7VU4.js +32 -0
- package/dist/core-EE55P6XK.js +56 -0
- package/dist/core-FFLPH5XK.js +41 -0
- package/dist/core-IV26EL5C.js +32 -0
- package/dist/core-IZVZ2B7Y.js +34 -0
- package/dist/core-JQV7STNF.js +34 -0
- package/dist/core-KBH3EJZV.js +32 -0
- package/dist/core-KFBW5PRT.js +36 -0
- package/dist/core-KWGXHBJE.js +37 -0
- package/dist/core-MZMR2DF4.js +32 -0
- package/dist/core-OK2ZY5OJ.js +29 -0
- package/dist/core-OV5MPTZP.js +43 -0
- package/dist/core-OW5V74Q4.js +40 -0
- package/dist/core-PL64QPOH.js +57 -0
- package/dist/core-PVINU5JJ.js +33 -0
- package/dist/core-QUYSNTC7.js +34 -0
- package/dist/core-RE3L6YCM.js +29 -0
- package/dist/core-RUA3EWW3.js +39 -0
- package/dist/core-RY6IFRKM.js +35 -0
- package/dist/core-SCWEVNUY.js +34 -0
- package/dist/core-SE67HHFG.js +55 -0
- package/dist/core-T5Q4DSH2.js +32 -0
- package/dist/core-TJX3I7KH.js +37 -0
- package/dist/core-ULUA5ZB2.js +55 -0
- package/dist/core-WLVU2HWX.js +46 -0
- package/dist/core-WQPHNVNY.js +51 -0
- package/dist/core-XXIOJY2X.js +52 -0
- package/dist/core-ZH7XTJTD.js +39 -0
- package/dist/core-ZHE7N4NS.js +50 -0
- package/dist/core-ZJYLJWZQ.js +38 -0
- package/dist/dataTable-IL7HVDHL.js +58 -0
- package/dist/engine-MYLZI5VH.js +961 -0
- package/dist/fixtures.d.ts +1 -0
- package/dist/fixtures.js +40 -0
- package/dist/fontTables-ZYBUCJ5N.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 +363 -0
- package/dist/main-ISJ53IS5.js +568 -0
- package/dist/mcp/server.js +1023 -0
- package/dist/module-SVEW5ZUE.js +137233 -0
- package/dist/react/bar.d.ts +1 -0
- package/dist/react/bar.js +80 -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 +64 -0
- package/dist/react/bullet.d.ts +1 -0
- package/dist/react/bullet.js +71 -0
- package/dist/react/butterfly.d.ts +1 -0
- package/dist/react/butterfly.js +65 -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 +69 -0
- package/dist/react/column.d.ts +1 -0
- package/dist/react/column.js +85 -0
- package/dist/react/combo.d.ts +1 -0
- package/dist/react/combo.js +85 -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 +71 -0
- package/dist/react/dot.d.ts +1 -0
- package/dist/react/dot.js +69 -0
- package/dist/react/export.d.ts +1 -0
- package/dist/react/export.js +657 -0
- package/dist/react/funnel.d.ts +1 -0
- package/dist/react/funnel.js +62 -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 +66 -0
- package/dist/react/heatmap.d.ts +1 -0
- package/dist/react/heatmap.js +67 -0
- package/dist/react/histogram.d.ts +1 -0
- package/dist/react/histogram.js +85 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +503 -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 +82 -0
- package/dist/react/line.d.ts +1 -0
- package/dist/react/line.js +80 -0
- package/dist/react/mekko.d.ts +1 -0
- package/dist/react/mekko.js +70 -0
- package/dist/react/pareto.d.ts +1 -0
- package/dist/react/pareto.js +89 -0
- package/dist/react/pie.d.ts +1 -0
- package/dist/react/pie.js +63 -0
- package/dist/react/prepare.d.ts +1 -0
- package/dist/react/prepare.js +277 -0
- package/dist/react/pvm.d.ts +1 -0
- package/dist/react/pvm.js +67 -0
- package/dist/react/pyramid.d.ts +1 -0
- package/dist/react/pyramid.js +66 -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 +62 -0
- package/dist/react/slope.d.ts +1 -0
- package/dist/react/slope.js +63 -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 +370 -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 +68 -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 +64 -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 +67 -0
- package/dist/resvg-ZOVDIZTV.js +23 -0
- package/dist/rows.d.ts +1 -0
- package/dist/rows.js +23 -0
- package/dist/rowsModule-3Y4I3M3E.js +27 -0
- package/dist/schema-2BMZOHXI.js +22 -0
- package/dist/schema-2GUBWOBC.js +26 -0
- package/dist/schema-34ZELWRQ.js +25 -0
- package/dist/schema-3BHL2B76.js +22 -0
- package/dist/schema-4735XAZX.js +29 -0
- package/dist/schema-5YTNQ6JY.js +22 -0
- package/dist/schema-7J3NAIN2.js +27 -0
- package/dist/schema-AOJJ7JZB.js +22 -0
- package/dist/schema-CVMV4LRA.js +22 -0
- package/dist/schema-D3RCMN3T.js +22 -0
- package/dist/schema-E2ISJ65D.js +23 -0
- package/dist/schema-E6YOSOWB.js +28 -0
- package/dist/schema-EQQB43AY.js +22 -0
- package/dist/schema-EVLLL5UF.js +22 -0
- package/dist/schema-EYQ5IBLF.js +23 -0
- package/dist/schema-EYZVD73N.js +22 -0
- package/dist/schema-G4KFMQBL.js +22 -0
- package/dist/schema-GH7IKSOU.js +23 -0
- package/dist/schema-IF5N3J56.js +42 -0
- package/dist/schema-IG7JIR4H.js +23 -0
- package/dist/schema-JJYJOQTT.js +23 -0
- package/dist/schema-KFC4WYH4.js +32 -0
- package/dist/schema-L7263JMT.js +25 -0
- package/dist/schema-MEAFRXVH.js +53 -0
- package/dist/schema-P63S63GE.js +23 -0
- package/dist/schema-P7LJFJAJ.js +22 -0
- package/dist/schema-PA2MXYY4.js +23 -0
- package/dist/schema-PDZ6256H.js +23 -0
- package/dist/schema-PNC3Z7AH.js +25 -0
- package/dist/schema-QEVSIMGO.js +22 -0
- package/dist/schema-QJJPRRE7.js +22 -0
- package/dist/schema-S3EQKVOT.js +23 -0
- package/dist/schema-STGL44TL.js +22 -0
- package/dist/schema-T4NE2EAO.js +22 -0
- package/dist/schema-TQYTESG3.js +22 -0
- package/dist/schema-W376PAJG.js +22 -0
- package/dist/schema-XYYDUUHS.js +26 -0
- package/dist/specValidation-NVBIZMEE.js +48 -0
- package/dist/theme.d.ts +1 -0
- package/dist/theme.js +24 -0
- package/dist/themeShapeRules-5C2463YH.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 +56 -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 +302 -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 +380 -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 +45 -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 +223 -0
- package/dist/types/core/types/cell.d.ts +82 -0
- package/dist/types/core/types/data.d.ts +309 -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 +65 -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 +58 -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 +222 -0
- package/docs/FONTS.md +68 -0
- package/docs/TELEMETRY.md +94 -0
- package/docs/manual.md +838 -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 +1088 -0
- package/docs/reference/funnel.md +121 -0
- package/docs/reference/gantt.md +132 -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 +703 -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,1266 @@
|
|
|
1
|
+
import {
|
|
2
|
+
floorValueLabel,
|
|
3
|
+
printedValueLabel,
|
|
4
|
+
valueLabelPlotFloor
|
|
5
|
+
} from "./chunk-DLC23CKC.js";
|
|
6
|
+
import {
|
|
7
|
+
stackSegmentCandidates
|
|
8
|
+
} from "./chunk-Q6XJOJTY.js";
|
|
9
|
+
import {
|
|
10
|
+
axisBreakHeightOrderWarning,
|
|
11
|
+
axisBreakInvalid,
|
|
12
|
+
breakReversesOrder,
|
|
13
|
+
breakStyleRefusal
|
|
14
|
+
} from "./chunk-ORUJI3VB.js";
|
|
15
|
+
import {
|
|
16
|
+
STACK_ROOM,
|
|
17
|
+
digitSeat,
|
|
18
|
+
digitSeatEdge,
|
|
19
|
+
segmentTooShort
|
|
20
|
+
} from "./chunk-HJXXFPOL.js";
|
|
21
|
+
import {
|
|
22
|
+
valueLineExtent
|
|
23
|
+
} from "./chunk-QPWRHDLZ.js";
|
|
24
|
+
import {
|
|
25
|
+
runAnnotatePass
|
|
26
|
+
} from "./chunk-GQS46LC3.js";
|
|
27
|
+
import {
|
|
28
|
+
GUTTER_MAX_SHARE,
|
|
29
|
+
fitColumn,
|
|
30
|
+
stepDownFont
|
|
31
|
+
} from "./chunk-EWVKBRLV.js";
|
|
32
|
+
import {
|
|
33
|
+
chartPalette,
|
|
34
|
+
chartTheme
|
|
35
|
+
} from "./chunk-SXGTRZFN.js";
|
|
36
|
+
import {
|
|
37
|
+
structureCount
|
|
38
|
+
} from "./chunk-B2EBEXIS.js";
|
|
39
|
+
import {
|
|
40
|
+
NATURAL_BAND_STEP,
|
|
41
|
+
applyValueAxisTitleInk,
|
|
42
|
+
axisTitleAllowed,
|
|
43
|
+
bandScale,
|
|
44
|
+
bandSizing,
|
|
45
|
+
barBreakCut,
|
|
46
|
+
brokenLinearScale,
|
|
47
|
+
categoryLineAlign,
|
|
48
|
+
categoryRowTop,
|
|
49
|
+
crossesLinearBreak,
|
|
50
|
+
hangingLabelReserve,
|
|
51
|
+
invalidLinearBreakReason,
|
|
52
|
+
isDateNumericTickSequence,
|
|
53
|
+
linearScale,
|
|
54
|
+
niceDomain,
|
|
55
|
+
planCategoryRow,
|
|
56
|
+
planValueAxisTitle,
|
|
57
|
+
rotatedClaimRect,
|
|
58
|
+
rotatedLeftOverhang,
|
|
59
|
+
straightBreakGlyph,
|
|
60
|
+
valueAxisTitleBand,
|
|
61
|
+
valueAxisTitleRequest
|
|
62
|
+
} from "./chunk-GQPESFAF.js";
|
|
63
|
+
import {
|
|
64
|
+
HEIGHT_STRUCTURE,
|
|
65
|
+
PRIORITY,
|
|
66
|
+
SERIES_VALUE_GAP,
|
|
67
|
+
authoredNotes,
|
|
68
|
+
boxGap,
|
|
69
|
+
composedTextRole,
|
|
70
|
+
createOccupiedIndex,
|
|
71
|
+
distinguishSeries,
|
|
72
|
+
fitText,
|
|
73
|
+
fixedPlotChrome,
|
|
74
|
+
frameTextOptions,
|
|
75
|
+
highlightPaintWarnings,
|
|
76
|
+
labelCtx,
|
|
77
|
+
labelsToNodes,
|
|
78
|
+
legendRequired,
|
|
79
|
+
lineBox,
|
|
80
|
+
normalizeLegendOption,
|
|
81
|
+
plotHeightAfter,
|
|
82
|
+
scenarioLegendKeys,
|
|
83
|
+
solveFrame,
|
|
84
|
+
solveLabels
|
|
85
|
+
} from "./chunk-2JAWQ7VV.js";
|
|
86
|
+
import {
|
|
87
|
+
disclosureNote
|
|
88
|
+
} from "./chunk-YTSSXSZR.js";
|
|
89
|
+
import {
|
|
90
|
+
formatterFromExample,
|
|
91
|
+
seriesRasterFormatter,
|
|
92
|
+
signedFormatterFromExample
|
|
93
|
+
} from "./chunk-ASAON7G4.js";
|
|
94
|
+
import {
|
|
95
|
+
authoredDecimals,
|
|
96
|
+
chartStrings,
|
|
97
|
+
formatAutomaticNumber
|
|
98
|
+
} from "./chunk-YQ2B3YVF.js";
|
|
99
|
+
import {
|
|
100
|
+
cellMeta,
|
|
101
|
+
cellValue,
|
|
102
|
+
isPctCell
|
|
103
|
+
} from "./chunk-OAPCJO6W.js";
|
|
104
|
+
import {
|
|
105
|
+
canvasMargin,
|
|
106
|
+
dashToken,
|
|
107
|
+
effectiveFill,
|
|
108
|
+
emphasisWeight,
|
|
109
|
+
haloOverpaintedInsideLabels,
|
|
110
|
+
markRolePaint,
|
|
111
|
+
paintColor,
|
|
112
|
+
panelTypeClass,
|
|
113
|
+
secondaryType,
|
|
114
|
+
seriesPaint,
|
|
115
|
+
signedFillPaint,
|
|
116
|
+
strokeToken,
|
|
117
|
+
textScaleOf,
|
|
118
|
+
withSegmentSeams
|
|
119
|
+
} from "./chunk-II7652VA.js";
|
|
120
|
+
import {
|
|
121
|
+
NormalizeError,
|
|
122
|
+
accessibleTitle,
|
|
123
|
+
normalizeCell,
|
|
124
|
+
normalizeScenario,
|
|
125
|
+
resolveHighlight,
|
|
126
|
+
resolveSize
|
|
127
|
+
} from "./chunk-SGD3ZHID.js";
|
|
128
|
+
import {
|
|
129
|
+
maxOf,
|
|
130
|
+
minOf,
|
|
131
|
+
pushAll
|
|
132
|
+
} from "./chunk-WYJEOMNY.js";
|
|
133
|
+
import {
|
|
134
|
+
defaultMeasurer
|
|
135
|
+
} from "./chunk-TXINIAFL.js";
|
|
136
|
+
|
|
137
|
+
// src/core/strings/waterfall.ts
|
|
138
|
+
var EN = {
|
|
139
|
+
// reader-facing wording linked only by its consumers.
|
|
140
|
+
waterfallChart: "Waterfall chart",
|
|
141
|
+
horizontalWaterfall: "Horizontal waterfall chart",
|
|
142
|
+
totalHighlightedStep: "Total, highlighted step",
|
|
143
|
+
change: "Change",
|
|
144
|
+
highlightedStep: "Highlighted step",
|
|
145
|
+
highlightedSteps: "Highlighted steps",
|
|
146
|
+
axisBreakNote: "Value axis broken between {v1} and {v2}",
|
|
147
|
+
checkTotalNote: "{v1} is drawn at {v2}, the sum of its steps; the data states {v3}",
|
|
148
|
+
checkSegmentsNote: "{v1} is drawn at {v2}, the sum of its segments; the data states {v3}",
|
|
149
|
+
waterfallCasesDesc: "{v1} cases side by side in each step. {v2}",
|
|
150
|
+
waterfallTitle: "Waterfall: {v1} to {v2}",
|
|
151
|
+
waterfallDesc: "Waterfall chart{v1}. {v2}.",
|
|
152
|
+
buildDownClause: " (build-down)",
|
|
153
|
+
increase: "Increase",
|
|
154
|
+
decrease: "Decrease"
|
|
155
|
+
}, DE = {
|
|
156
|
+
// reader-facing wording linked only by its consumers.
|
|
157
|
+
waterfallChart: "Wasserfalldiagramm",
|
|
158
|
+
horizontalWaterfall: "Horizontales Wasserfalldiagramm",
|
|
159
|
+
totalHighlightedStep: "Summe, hervorgehobener Schritt",
|
|
160
|
+
change: "\xC4nderung",
|
|
161
|
+
highlightedStep: "Hervorgehobener Schritt",
|
|
162
|
+
highlightedSteps: "Hervorgehobene Schritte",
|
|
163
|
+
axisBreakNote: "Wertachse zwischen {v1} und {v2} unterbrochen",
|
|
164
|
+
checkTotalNote: "{v1} ist als Summe der Schritte mit {v2} gezeichnet; die Daten nennen {v3}",
|
|
165
|
+
checkSegmentsNote: "{v1} ist als Summe der Segmente mit {v2} gezeichnet; die Daten nennen {v3}",
|
|
166
|
+
waterfallCasesDesc: "{v1} {v1|Fall|F\xE4lle} nebeneinander in jedem Schritt. {v2}",
|
|
167
|
+
waterfallTitle: "Wasserfall: {v1} bis {v2}",
|
|
168
|
+
waterfallDesc: "Wasserfalldiagramm{v1}. {v2}.",
|
|
169
|
+
buildDownClause: " (absteigend)",
|
|
170
|
+
increase: "Zunahme",
|
|
171
|
+
decrease: "Abnahme"
|
|
172
|
+
}, { chartString, localeStrings } = chartStrings(EN, DE);
|
|
173
|
+
|
|
174
|
+
// src/core/charts/waterfall/layout.ts
|
|
175
|
+
function cellText(meta) {
|
|
176
|
+
return {
|
|
177
|
+
...meta?.format !== void 0 ? { format: meta.format } : {},
|
|
178
|
+
...meta?.label !== void 0 ? { valueLabel: meta.label } : {},
|
|
179
|
+
...meta?.priority !== void 0 ? { priority: meta.priority } : {}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
var BRIDGE_END_GAP = 1;
|
|
183
|
+
function insetBridgeEnds(scene) {
|
|
184
|
+
return scene.map((node) => {
|
|
185
|
+
if (node.t !== "line" || node.part !== "connector") return node;
|
|
186
|
+
let dx = node.x2 - node.x1, dy = node.y2 - node.y1, length = Math.hypot(dx, dy);
|
|
187
|
+
if (length <= 2 * BRIDGE_END_GAP + 1e-9) return node;
|
|
188
|
+
let ux = dx / length * BRIDGE_END_GAP, uy = dy / length * BRIDGE_END_GAP;
|
|
189
|
+
return { ...node, x1: node.x1 + ux, y1: node.y1 + uy, x2: node.x2 - ux, y2: node.y2 - uy };
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function mixedSliverSeats(rect, tsize, k, n, sides = k === n - 1 ? ["right"] : k === 0 ? ["left"] : ["right", "left"], extraRows = !1) {
|
|
193
|
+
let levels = [
|
|
194
|
+
{ name: "Level", top: rect.y + rect.h / 2 - tsize.height / 2, gap: SLIVER_SEAT_GAP },
|
|
195
|
+
{ name: "Over", top: rect.y - tsize.height - SLIVER_SEAT_GAP, gap: SLIVER_LEADER_GAP },
|
|
196
|
+
{ name: "Under", top: rect.y + rect.h + SLIVER_SEAT_GAP, gap: SLIVER_LEADER_GAP },
|
|
197
|
+
...extraRows ? [2, 3].flatMap((row) => [
|
|
198
|
+
{ name: `Over${row}`, top: rect.y - row * (tsize.height + SLIVER_SEAT_GAP), gap: SLIVER_LEADER_GAP },
|
|
199
|
+
{ name: `Under${row}`, top: rect.y + rect.h + (row - 1) * (tsize.height + SLIVER_SEAT_GAP) + SLIVER_SEAT_GAP, gap: SLIVER_LEADER_GAP }
|
|
200
|
+
]) : []
|
|
201
|
+
];
|
|
202
|
+
return sides.flatMap((side, s) => levels.map((level, l) => {
|
|
203
|
+
let edge = side === "right" ? rect.x + rect.w : rect.x;
|
|
204
|
+
return {
|
|
205
|
+
slot: `sliver${side === "right" ? "Right" : "Left"}${level.name}`,
|
|
206
|
+
rect: { x: side === "right" ? edge + level.gap : edge - level.gap - tsize.width, y: level.top, w: tsize.width, h: tsize.height },
|
|
207
|
+
penalty: s * levels.length + l,
|
|
208
|
+
leaderFrom: { x: edge, y: rect.y + rect.h / 2 }
|
|
209
|
+
};
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
var SLIVER_SEAT_GAP = 4, SLIVER_LEADER_GAP = 10;
|
|
213
|
+
function layoutWaterfall(data, options = {}) {
|
|
214
|
+
if (options.variant === "horizontal") return layoutHorizontalWaterfall(data, options);
|
|
215
|
+
let withBridgeGap = (geometry) => ({
|
|
216
|
+
...geometry,
|
|
217
|
+
scene: insetBridgeEnds(geometry.scene)
|
|
218
|
+
}), pad = 0, pass = layoutWaterfallWithPad(data, options, pad, !0, void 0, !options.annotations?.length), cagr = (options.annotations ?? []).some((a) => a.kind === "cagr"), unseated = (geometry) => geometry.labels.some((label) => label.id.startsWith("annotation:") && label.hidden === "collision");
|
|
219
|
+
for (; cagr && pad < 48 && (unseated(pass.geometry) || pad < 18 && pass.annotationLegDeficit > 0); )
|
|
220
|
+
pad += 6, pass = layoutWaterfallWithPad(data, options, pad, !0, void 0, !1);
|
|
221
|
+
pad > 0 && (pad = unseated(pass.geometry) ? 18 : pad + 4, pass = layoutWaterfallWithPad(data, options, pad, !0, void 0, !1));
|
|
222
|
+
for (let i = 0; i < 3 && pass.annotationLegDeficit > 0.5; i++)
|
|
223
|
+
pad += Math.ceil(pass.annotationLegDeficit) + 2, pass = layoutWaterfallWithPad(data, options, pad, !0, void 0, !1);
|
|
224
|
+
if (pass.unsafeBreak && (pass = pass.repairBreak(), cagr && unseated(pass.geometry))) {
|
|
225
|
+
let repairPad = pad, repaired = pass;
|
|
226
|
+
for (; repairPad < 48 && unseated(repaired.geometry); )
|
|
227
|
+
repairPad += 6, repaired = layoutWaterfallWithPad(data, options, repairPad, !0, void 0, !0);
|
|
228
|
+
if (!unseated(repaired.geometry)) {
|
|
229
|
+
let settled = layoutWaterfallWithPad(data, options, repairPad + 4, !0, void 0, !0);
|
|
230
|
+
pass = unseated(settled.geometry) ? repaired : settled;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return withBridgeGap(pass.geometry);
|
|
234
|
+
}
|
|
235
|
+
function layoutHorizontalWaterfall(data, options) {
|
|
236
|
+
let authoredAnnotations = options.annotations ?? [], verticalOptions = {
|
|
237
|
+
...options,
|
|
238
|
+
variant: "vertical",
|
|
239
|
+
annotations: []
|
|
240
|
+
}, source = layoutWaterfallWithPad(data, verticalOptions, 0, !1).geometry, plot = source.plot, theme = chartTheme(options), measure = options.measure ?? defaultMeasurer, nameFont = { family: theme.type.family, ...theme.type.axis }, nameBudget = plot.w * 0.4 - 20, categoryLabels = source.labels.filter((label) => label.kind === "category"), barCenters = source.marks.bars.map((bar) => bar.rect.x + bar.rect.w / 2).sort((a, b) => a - b), nameLines = (barCenters.length > 1 ? (barCenters[1] - barCenters[0]) * plot.h / plot.w : plot.h) >= 2 * lineBox(nameFont) + 2 ? 2 : 1, nameColumn = fitColumn(categoryLabels.map((label) => ({
|
|
241
|
+
text: label.title ?? label.text,
|
|
242
|
+
font: nameFont,
|
|
243
|
+
maxWidth: nameBudget,
|
|
244
|
+
maxLines: nameLines,
|
|
245
|
+
wider: plot.w * GUTTER_MAX_SHARE - 20,
|
|
246
|
+
shrink: stepDownFont(theme, nameFont, "axis", options.target, textScaleOf(options)),
|
|
247
|
+
target: options.target,
|
|
248
|
+
textScale: textScaleOf(options),
|
|
249
|
+
typeRole: "axis"
|
|
250
|
+
})), measure), names = new Map(categoryLabels.map((label, index) => [label.id, nameColumn[index]])), categoryLabelWidth = Math.max(
|
|
251
|
+
0,
|
|
252
|
+
// Every name the column prints, including one the vertical row lost to its rotation.
|
|
253
|
+
maxOf(source.labels.filter((label) => label.kind === "category").map((label) => names.get(label.id).w))
|
|
254
|
+
), valueLabelWidth = Math.max(
|
|
255
|
+
0,
|
|
256
|
+
maxOf(source.labels.filter(
|
|
257
|
+
(label) => (label.kind === "segment" || label.kind === "total") && !label.hidden
|
|
258
|
+
).map((label) => label.rect.w))
|
|
259
|
+
), leftReserve = Math.min(plot.w * GUTTER_MAX_SHARE, Math.max(48, categoryLabelWidth + 20)), rightReserve = Math.min(plot.w * 0.18, Math.max(32, valueLabelWidth + 20)), horizontalPlot = {
|
|
260
|
+
x: plot.x + leftReserve,
|
|
261
|
+
y: plot.y,
|
|
262
|
+
w: Math.max(80, plot.w - leftReserve - rightReserve),
|
|
263
|
+
h: plot.h
|
|
264
|
+
}, transformPoint = (x, y) => ({
|
|
265
|
+
x: horizontalPlot.x + (plot.y + plot.h - y) / plot.h * horizontalPlot.w,
|
|
266
|
+
y: horizontalPlot.y + (x - plot.x) / plot.w * horizontalPlot.h
|
|
267
|
+
}), transformRect = (rect) => {
|
|
268
|
+
let a = transformPoint(rect.x, rect.y), b = transformPoint(rect.x + rect.w, rect.y + rect.h);
|
|
269
|
+
return {
|
|
270
|
+
x: Math.min(a.x, b.x),
|
|
271
|
+
y: Math.min(a.y, b.y),
|
|
272
|
+
w: Math.abs(b.x - a.x),
|
|
273
|
+
h: Math.abs(b.y - a.y)
|
|
274
|
+
};
|
|
275
|
+
}, transformRectKeepSize = (rect) => {
|
|
276
|
+
let center = transformPoint(rect.x + rect.w / 2, rect.y + rect.h / 2);
|
|
277
|
+
return { x: center.x - rect.w / 2, y: center.y - rect.h / 2, w: rect.w, h: rect.h };
|
|
278
|
+
}, slotMap = {
|
|
279
|
+
outsideTop: "outsideRight",
|
|
280
|
+
outsideTopShifted: "outsideRightShifted",
|
|
281
|
+
outsideBottom: "outsideLeft",
|
|
282
|
+
outsideBottomShifted: "outsideLeftShifted",
|
|
283
|
+
below: "left",
|
|
284
|
+
belowShifted: "leftShifted",
|
|
285
|
+
outsideRight: "below",
|
|
286
|
+
outsideLeft: "above"
|
|
287
|
+
}, mapSlot = (slot) => slotMap[slot] ?? slot, protectedNodeIds = /* @__PURE__ */ new Set();
|
|
288
|
+
Object.values(source.frame).forEach((value) => {
|
|
289
|
+
typeof value == "string" ? protectedNodeIds.add(value) : Array.isArray(value) && value.forEach((id) => protectedNodeIds.add(id));
|
|
290
|
+
}), source.legend?.items.forEach((item) => {
|
|
291
|
+
protectedNodeIds.add(item.swatchNodeId), protectedNodeIds.add(item.labelId);
|
|
292
|
+
});
|
|
293
|
+
let generatedLabelNodeIds = new Set(
|
|
294
|
+
source.labels.flatMap((label) => [
|
|
295
|
+
`label:${label.id}`,
|
|
296
|
+
`leader:${label.id}`,
|
|
297
|
+
`swatch:${label.id}`
|
|
298
|
+
])
|
|
299
|
+
), scene = source.scene.filter((node) => !generatedLabelNodeIds.has(node.id)).map((node) => {
|
|
300
|
+
if (protectedNodeIds.has(node.id) || node.id.startsWith("frame:")) return node;
|
|
301
|
+
if (node.t === "rect") return { ...node, rect: transformRect(node.rect) };
|
|
302
|
+
if (node.t === "line") {
|
|
303
|
+
let from = transformPoint(node.x1, node.y1), to = transformPoint(node.x2, node.y2);
|
|
304
|
+
return { ...node, x1: from.x, y1: from.y, x2: to.x, y2: to.y };
|
|
305
|
+
}
|
|
306
|
+
throw new Error(`horizontal waterfall cannot transpose unexpected '${node.t}' node '${node.id}'`);
|
|
307
|
+
}), marks = {
|
|
308
|
+
bars: source.marks.bars.map((bar) => ({
|
|
309
|
+
...bar,
|
|
310
|
+
rect: transformRect(bar.rect),
|
|
311
|
+
segments: bar.segments.map((segment) => ({
|
|
312
|
+
...segment,
|
|
313
|
+
rect: transformRect(segment.rect)
|
|
314
|
+
}))
|
|
315
|
+
})),
|
|
316
|
+
connectors: source.marks.connectors.map((connector) => ({ ...connector }))
|
|
317
|
+
}, axes = source.axes.map((axis) => ({
|
|
318
|
+
...axis,
|
|
319
|
+
axis: axis.axis === "x" ? "y" : "x",
|
|
320
|
+
ticks: axis.ticks.map((tick) => ({
|
|
321
|
+
...tick,
|
|
322
|
+
pos: axis.axis === "x" ? transformPoint(tick.pos, plot.y).y : transformPoint(plot.x, tick.pos).x
|
|
323
|
+
}))
|
|
324
|
+
})), nonLabelOccupied = source.debug.occupied.filter((entry) => entry.kind !== "label").map(
|
|
325
|
+
(entry) => entry.kind === "frame" || entry.kind === "legend" ? entry : { ...entry, rect: transformRect(entry.rect) }
|
|
326
|
+
), occupied = createOccupiedIndex(horizontalPlot);
|
|
327
|
+
nonLabelOccupied.forEach(
|
|
328
|
+
(entry) => occupied.claim(entry.rect, entry.kind, entry.owner, entry.part)
|
|
329
|
+
);
|
|
330
|
+
let barById = new Map(marks.bars.map((bar) => [bar.id, bar])), highlights = new Set(resolveHighlight(options.highlight)), fontForLabel = (label) => label.kind === "category" ? names.get(label.id)?.font ?? nameFont : {
|
|
331
|
+
family: theme.type.family,
|
|
332
|
+
...theme.type.label,
|
|
333
|
+
// A highlighted step's value is bold at the label size, as the totals are (the vertical bridge's strongFont).
|
|
334
|
+
...label.kind === "total" || label.id.startsWith("sum:") && highlights.has(label.owner.categoryId ?? "") ? { weight: emphasisWeight(theme) } : { size: Math.min(theme.type.label.size, secondaryType(theme).size) }
|
|
335
|
+
}, labelRequests = source.labels.map((label) => {
|
|
336
|
+
let name = label.kind === "category" ? names.get(label.id) : void 0, textSize = measure(label.text, fontForLabel(label)), transformed = { ...transformRectKeepSize(label.rect), w: name?.w ?? textSize.width, h: name?.h ?? textSize.height }, bar = label.owner.categoryId ? barById.get(label.owner.categoryId) : void 0, rowCenter = bar ? bar.rect.y + bar.rect.h / 2 : transformed.y + transformed.h / 2, categoryRect = {
|
|
337
|
+
x: horizontalPlot.x - transformed.w - 8,
|
|
338
|
+
y: rowCenter - transformed.h / 2,
|
|
339
|
+
w: transformed.w,
|
|
340
|
+
h: transformed.h
|
|
341
|
+
}, outsideRight = {
|
|
342
|
+
x: (bar ? bar.rect.x + bar.rect.w : transformed.x + transformed.w) + 8,
|
|
343
|
+
y: rowCenter - transformed.h / 2,
|
|
344
|
+
w: transformed.w,
|
|
345
|
+
h: transformed.h
|
|
346
|
+
}, insideCenter = {
|
|
347
|
+
x: bar ? bar.rect.x + bar.rect.w / 2 - transformed.w / 2 : transformed.x,
|
|
348
|
+
y: rowCenter - transformed.h / 2,
|
|
349
|
+
w: transformed.w,
|
|
350
|
+
h: transformed.h
|
|
351
|
+
}, outsideLeft = {
|
|
352
|
+
x: (bar ? bar.rect.x : transformed.x) - transformed.w - 8,
|
|
353
|
+
y: rowCenter - transformed.h / 2,
|
|
354
|
+
w: transformed.w,
|
|
355
|
+
h: transformed.h
|
|
356
|
+
}, candidates = label.kind === "category" ? [{ slot: "left", rect: categoryRect, penalty: 0 }] : [
|
|
357
|
+
{ slot: "outsideRight", rect: outsideRight, penalty: 0 },
|
|
358
|
+
// A value sits inside only with 4 px per side; wider, it would cross the bar's edge.
|
|
359
|
+
...!bar || transformed.w + 8 <= bar.rect.w ? [{ slot: "insideCenter", rect: insideCenter, penalty: 1, needsBacking: !0 }] : [],
|
|
360
|
+
{ slot: "outsideLeft", rect: outsideLeft, penalty: 2 }
|
|
361
|
+
], authoredPin = options.labelPlacements?.[label.id];
|
|
362
|
+
return {
|
|
363
|
+
id: label.id,
|
|
364
|
+
kind: label.kind,
|
|
365
|
+
owner: label.owner,
|
|
366
|
+
text: name ? label.title ?? label.text : label.text,
|
|
367
|
+
lines: name ? name.lines : label.lines,
|
|
368
|
+
...name?.title !== void 0 ? { title: name.title } : !name && label.title !== void 0 ? { title: label.title } : {},
|
|
369
|
+
font: fontForLabel(label),
|
|
370
|
+
priority: label.priority,
|
|
371
|
+
...authoredPin ? { pinnedSlot: mapSlot(authoredPin) } : {},
|
|
372
|
+
candidates,
|
|
373
|
+
...label.hidden === "redundant" && label.kind !== "category" ? { redundant: !0 } : {},
|
|
374
|
+
...label.swatch ? { swatch: label.swatch } : {}
|
|
375
|
+
};
|
|
376
|
+
}), horizontalPins = Object.fromEntries(
|
|
377
|
+
Object.entries(options.labelPlacements ?? {}).map(([id, slot]) => [id, mapSlot(slot)])
|
|
378
|
+
), solved = solveLabels(labelRequests, occupied, labelCtx(theme, source.size, options, {
|
|
379
|
+
focus: void 0,
|
|
380
|
+
pins: horizontalPins,
|
|
381
|
+
measure,
|
|
382
|
+
plot: horizontalPlot,
|
|
383
|
+
labelPad: 2
|
|
384
|
+
})), labels = solved.placed;
|
|
385
|
+
if (isSignBridge(theme, options))
|
|
386
|
+
for (let label of labels) {
|
|
387
|
+
let id = label.id.startsWith("sum:") ? label.id.slice(4) : void 0, level = id === void 0 ? void 0 : source.derived.levels[id], tone = level ? stepTone(level.end - level.start, data.items.find((it) => it.id === id)?.direction) : "neutral";
|
|
388
|
+
tone !== "neutral" && label.slot !== "insideCenter" && (label.ink = { token: tone });
|
|
389
|
+
}
|
|
390
|
+
pushAll(scene, labelsToNodes(theme, labels, fontForLabel, scene));
|
|
391
|
+
let annotationWarning = authoredAnnotations.length === 0 ? [] : [
|
|
392
|
+
{
|
|
393
|
+
code: "horizontal-annotations-unsupported",
|
|
394
|
+
severity: "warn",
|
|
395
|
+
message: `horizontal waterfall does not support ${[...new Set(authoredAnnotations.map((annotation) => `'${annotation.kind}'`))].join(", ")}; annotations suppressed`,
|
|
396
|
+
suggest: "remove the annotation or use variant:vertical"
|
|
397
|
+
}
|
|
398
|
+
], { tickBand: _verticalTickBand, ...horizontalDerived } = source.derived, uncutWidth = (label, lines) => {
|
|
399
|
+
let font = names.get(label.id).font, cut = (width) => fitText(label.title ?? label.text, font, width, lines, measure, { target: options.target, textScale: textScaleOf(options), typeRole: "axis" }).title !== void 0, [lo, hi] = [0, 600];
|
|
400
|
+
if (cut(hi)) return hi;
|
|
401
|
+
for (; hi - lo > 1; ) {
|
|
402
|
+
let mid = Math.floor((lo + hi) / 2);
|
|
403
|
+
cut(mid) ? lo = mid : hi = mid;
|
|
404
|
+
}
|
|
405
|
+
return hi;
|
|
406
|
+
}, twoLines = Math.max(0, maxOf(categoryLabels.map((label) => uncutWidth(label, 1)))) + 20 > plot.w * GUTTER_MAX_SHARE, nameNeed = Math.max(0, maxOf(categoryLabels.map((label) => uncutWidth(label, 2)))), minPlotW = Math.max(Math.max(48, nameNeed + 20) + 80 + Math.max(32, valueLabelWidth + 20), (nameNeed + 20) / GUTTER_MAX_SHARE), rowsNeed = ((twoLines ? 2 : 1) * lineBox(nameFont) + 2) * (barCenters.length > 1 ? plot.w / (barCenters[1] - barCenters[0]) : 1) + 1, measured = bandSizing("waterfall", source.size, plot.w, NATURAL_BAND_STEP, minPlotW);
|
|
407
|
+
return source.sizing?.[HEIGHT_STRUCTURE] && (measured[HEIGHT_STRUCTURE] = !0), {
|
|
408
|
+
...source,
|
|
409
|
+
sizing: { ...measured, minHeight: Math.max(measured.minHeight, Math.ceil(source.size.height - plot.h + rowsNeed)) },
|
|
410
|
+
derived: horizontalDerived,
|
|
411
|
+
plot: horizontalPlot,
|
|
412
|
+
// Applied here, after transformPoint has produced final device coordinates
|
|
413
|
+
// and after the label solve has pushed its nodes, so the gap is 1 device
|
|
414
|
+
// unit measured on screen in this orientation too.
|
|
415
|
+
scene: insetBridgeEnds(scene),
|
|
416
|
+
labels,
|
|
417
|
+
axes,
|
|
418
|
+
annotations: [],
|
|
419
|
+
marks,
|
|
420
|
+
a11y: {
|
|
421
|
+
...source.a11y,
|
|
422
|
+
desc: source.a11y.desc.replace(chartString(options, "waterfallChart"), chartString(options, "horizontalWaterfall"))
|
|
423
|
+
},
|
|
424
|
+
warnings: [
|
|
425
|
+
...source.warnings.filter((warning) => warning.code !== "label-hidden"),
|
|
426
|
+
...solved.warnings,
|
|
427
|
+
...annotationWarning
|
|
428
|
+
],
|
|
429
|
+
debug: {
|
|
430
|
+
occupied: occupied.snapshot(),
|
|
431
|
+
decisions: solved.decisions
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
var DIGIT_CAP = 0.72;
|
|
436
|
+
function floorTwoDigits(value) {
|
|
437
|
+
let unit = 10 ** (Math.floor(Math.log10(value)) - 1);
|
|
438
|
+
return Math.floor(value / unit + 1e-9) * unit;
|
|
439
|
+
}
|
|
440
|
+
var SLIVER_STEP = 0.15;
|
|
441
|
+
function automaticBreak(allItems, levels, totals, line) {
|
|
442
|
+
let deltas = allItems.filter((it) => it.type === "delta"), totalValues = allItems.filter((it) => it.type !== "delta").map((it) => totals[it.id]);
|
|
443
|
+
if (deltas.length === 0 || totalValues.length === 0) return;
|
|
444
|
+
let deltaLevels = deltas.flatMap((it) => {
|
|
445
|
+
let level = levels[it.id];
|
|
446
|
+
return [level.start, level.end, level.min ?? level.start, level.max ?? level.end];
|
|
447
|
+
}), running = [...deltaLevels, ...totalValues], runLo = minOf(running), runHi = maxOf(running), span = runHi - runLo, totalMin = minOf(totalValues), steps = deltas.map((it) => Math.abs(levels[it.id].end - levels[it.id].start)).sort((a, b) => a - b), medianStep = steps[Math.floor(steps.length / 2)];
|
|
448
|
+
if (!(runLo > 0) || !(span > 0) || !(totalMin >= 2 * span) || !(medianStep < SLIVER_STEP * runHi)) return;
|
|
449
|
+
let to = floorTwoDigits(runLo - span / 4), axisBreak = { from: floorTwoDigits(Math.min(totalMin * 0.05, (runHi - to) * 0.4)), to }, drawn = [...deltaLevels, ...line ? [line.lo, line.hi] : []];
|
|
450
|
+
return invalidLinearBreakReason([0, runHi], axisBreak, drawn) ? void 0 : axisBreak;
|
|
451
|
+
}
|
|
452
|
+
function layoutWaterfallWithPad(data, options, extraAnnPad, categoryRow = !0, automaticOverride, enforceBreakOrder = !0) {
|
|
453
|
+
let fmtPlain = (value, settings = {}) => formatAutomaticNumber(value, { locale: options.locale?.language, ...settings }), warnings = [], theme = chartTheme(options), paletteRamp = chartPalette(theme, options.palette, warnings), size = resolveSize(options.size), measure = options.measure ?? defaultMeasurer, highlights = new Set(resolveHighlight(options.highlight)), signBridge = isSignBridge(theme, options), signSteps = stepsBySign(theme, options), connectorStroke = { token: signBridge ? "inkMeta" : "leader" }, connectorDash = dashToken(theme, signBridge ? "dotted" : "reference"), stepTones = /* @__PURE__ */ new Map(), paintWarningRules = highlights.size > 0 ? [{ kind: "highlight-reads-as-loss", chart: "waterfall", before: warnings.length }] : [];
|
|
454
|
+
paintWarningRules.length && warnings.push(...highlightPaintWarnings(theme, "waterfall"));
|
|
455
|
+
let build = options.build ?? "up";
|
|
456
|
+
if (!data || !Array.isArray(data.items) || data.items.length === 0)
|
|
457
|
+
throw new NormalizeError("empty-data", "items", "waterfall requires at least one item");
|
|
458
|
+
let cases = data.cases ?? [];
|
|
459
|
+
if (cases.length > 0 && options.variant === "horizontal")
|
|
460
|
+
throw new NormalizeError("waterfall-cases-horizontal", "options.variant", "a bridge with cases draws vertically: its cases stand side by side in each step", "drop variant: 'horizontal', or draw one bridge per case");
|
|
461
|
+
let colonCase = cases.findIndex((c) => c.id.includes(":"));
|
|
462
|
+
if (colonCase >= 0)
|
|
463
|
+
throw new NormalizeError("waterfall-case-id-colon", `cases[${colonCase}].id`, `case id '${cases[colonCase].id}' holds ':', which joins an item id to its case id in the bars, levels and claims ('<item>:<case>'), so two bars could share one id`, "give the case an id without a colon", void 0, ["data", "cases", colonCase, "id"]);
|
|
464
|
+
let caseItems = cases.map((c, k) => data.items.map((raw, i) => caseItem(raw, i, c.id, k))), items = cases.length > 0 ? data.items.map((raw, i) => ({ ...caseItems[0][i], id: raw.id })) : data.items.map(normalizeItem), allItems = cases.length > 0 ? caseItems.flat() : items;
|
|
465
|
+
for (let id of highlights)
|
|
466
|
+
items.some((it) => it.id === id) || warnings.push({
|
|
467
|
+
code: "highlight-unknown-id",
|
|
468
|
+
severity: "warn",
|
|
469
|
+
message: `highlight '${id}' names no bar of this bridge and emphasises nothing`,
|
|
470
|
+
suggest: `highlight one of the bar ids: ${items.map((it) => it.id).join(", ")}`,
|
|
471
|
+
field: ["options", "highlight"]
|
|
472
|
+
});
|
|
473
|
+
let authoredValues = allItems.flatMap((it) => [it.checkValue, ...it.segments.map((seg) => seg.value)]), { fmt, fmtSigned } = seriesRasterFormatter(options.format, authoredValues, options.locale?.language, options.unit, options.target), checkValueNotes = [], checkAgainstSum = (supplied, computed, summed) => {
|
|
474
|
+
let gap = Math.abs(supplied - computed), partial = 0, noise = Number.isSafeInteger(supplied) && summed.every((value) => Number.isSafeInteger(value) && Number.isSafeInteger(partial += value)) ? 0 : sumRoundoff(summed);
|
|
475
|
+
if (gap <= noise) return;
|
|
476
|
+
let decimals = Math.max(0, maxOf(summed.map(authoredDecimals))), shown = Math.max(decimals, authoredDecimals(supplied));
|
|
477
|
+
return { printed: [fmtPlain(supplied, { decimals: shown, automatic: !1 }), fmtPlain(computed, { decimals: shown, automatic: !1 })], withinRounding: gap <= summed.length * 0.5 * 10 ** -decimals + noise };
|
|
478
|
+
}, discloseRoundedCheck = (it, k, printed, what) => {
|
|
479
|
+
let name = k === void 0 ? it.label : `${it.label} (${cases[k].label ?? cases[k].id})`;
|
|
480
|
+
warnings.push({
|
|
481
|
+
code: "check-value-rounded",
|
|
482
|
+
severity: "info",
|
|
483
|
+
message: `${it.type} '${it.id}': supplied ${printed[0]} differs from the computed ${printed[1]} by less than its inputs' rounding; the computed ${printed[1]} is drawn and a note names both`,
|
|
484
|
+
owner: { categoryId: it.id }
|
|
485
|
+
}), checkValueNotes.push(disclosureNote(chartString(options, what, { v1: name, v2: printed[1], v3: printed[0] })));
|
|
486
|
+
}, segmentCatalog = /* @__PURE__ */ new Map();
|
|
487
|
+
for (let it of items)
|
|
488
|
+
if (it.authoredSegments)
|
|
489
|
+
for (let seg of it.segments) {
|
|
490
|
+
let known = segmentCatalog.get(seg.id);
|
|
491
|
+
if (!known) {
|
|
492
|
+
segmentCatalog.set(seg.id, {
|
|
493
|
+
id: seg.id,
|
|
494
|
+
label: seg.label,
|
|
495
|
+
colorRole: seg.colorRole,
|
|
496
|
+
scenario: seg.scenario,
|
|
497
|
+
slot: segmentCatalog.size
|
|
498
|
+
});
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
let conflicts = [
|
|
502
|
+
known.label && seg.label && known.label !== seg.label ? `label '${seg.label}'` : null,
|
|
503
|
+
known.colorRole && seg.colorRole && known.colorRole !== seg.colorRole ? `colorRole '${seg.colorRole}'` : null
|
|
504
|
+
].filter((v) => v !== null);
|
|
505
|
+
conflicts.length > 0 && warnings.push({
|
|
506
|
+
code: "segment-identity-mismatch",
|
|
507
|
+
severity: "warn",
|
|
508
|
+
message: `segment '${seg.id}' reuses ${conflicts.join(" and ")}; first authored identity wins`,
|
|
509
|
+
owner: { categoryId: it.id, segmentId: seg.id }
|
|
510
|
+
}), !known.label && seg.label && (known.label = seg.label), !known.colorRole && seg.colorRole && (known.colorRole = seg.colorRole), !known.scenario && seg.scenario && (known.scenario = seg.scenario);
|
|
511
|
+
}
|
|
512
|
+
let fixedKeys = [];
|
|
513
|
+
items.some((it) => it.type !== "delta" && !it.authoredSegments) && fixedKeys.push({ id: "__keyTotal", label: chartString(options, "total"), paint: { token: "total" } });
|
|
514
|
+
let segmentPaints = new Map(distinguishSeries(
|
|
515
|
+
[
|
|
516
|
+
...fixedKeys,
|
|
517
|
+
...[...segmentCatalog.values()].map((identity) => ({
|
|
518
|
+
id: identity.id,
|
|
519
|
+
label: identity.label ?? identity.id,
|
|
520
|
+
paint: rawIdentityPaint(identity),
|
|
521
|
+
pattern: scenarioPattern(identity.scenario)
|
|
522
|
+
}))
|
|
523
|
+
],
|
|
524
|
+
/* @__PURE__ */ new Set([...fixedKeys.map((key) => key.id), ...[...segmentCatalog.values()].filter((identity) => identity.colorRole).map((identity) => identity.id)]),
|
|
525
|
+
Array.from({ length: theme.color.series.length }, (_, i) => seriesPaint(i, paletteRamp ? options.palette : void 0)),
|
|
526
|
+
theme
|
|
527
|
+
).map((identity) => [identity.id, identity.paint]));
|
|
528
|
+
if (categoryRow) {
|
|
529
|
+
let plainIds = [...segmentCatalog.values()].filter((identity) => !identity.colorRole && segmentPaints.has(identity.id)).map((identity) => identity.id), plain = plainIds.map((id) => segmentPaints.get(id)), others = [...segmentPaints].filter(([id]) => !plainIds.includes(id)).map(([, paint]) => paint);
|
|
530
|
+
plainIds.forEach((id, index) => {
|
|
531
|
+
let own = plain[index], paint = { token: "token" in own ? own.token : "neutral", theme: { kind: "segment-apart", plain, others, index } };
|
|
532
|
+
paintColor(theme, paint), segmentPaints.set(id, paint);
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
let connectors = data.connectors ?? [], hiddenAfter = new Set(connectors.filter((c) => c.hidden).map((c) => c.from)), connectorInto = new Map(connectors.filter((c) => !c.hidden).map((c) => [c.to, c])), bridges = cases.length > 0 ? caseItems.map(deriveBridge) : [deriveBridge(items)], levels = bridges.reduce((all, bridge) => Object.assign(all, bridge.levels), {}), totals = bridges.reduce((all, bridge) => Object.assign(all, bridge.totals), {}), totalBasis = bridges.reduce((all, bridge, k) => Object.assign(all, Object.fromEntries(Object.entries(bridge.totalBasis).map(([id, basis]) => [id, basis.authored && cases.length > 0 ? { authored: !0, ref: `${data.items[caseItems[k].findIndex((it) => it.id === id)].id}.values.${k}` } : basis]))), {}), derivedTotalSegments = new Map(bridges.flatMap((bridge) => [...bridge.derivedTotalSegments])), anchorLevel = bridges[0].anchorLevel;
|
|
536
|
+
function deriveBridge(items2, k) {
|
|
537
|
+
let levels2 = {}, totals2 = {}, totalBasis2 = {}, derivedTotalSegments2 = /* @__PURE__ */ new Map(), anchorLevel2 = (itemId, anchor) => {
|
|
538
|
+
let it = items2.find((x) => x.id === itemId), lvl = levels2[itemId];
|
|
539
|
+
if (!it || !lvl) return null;
|
|
540
|
+
if (!anchor || anchor === "sum") return it.type === "delta" ? lvl.end : totals2[itemId];
|
|
541
|
+
let cum = lvl.start;
|
|
542
|
+
for (let seg of it.segments)
|
|
543
|
+
if (cum += seg.value, seg.id === anchor) return cum;
|
|
544
|
+
return warnings.push({
|
|
545
|
+
code: "unknown-anchor",
|
|
546
|
+
severity: "warn",
|
|
547
|
+
message: `connector anchor '${anchor}' is not a segment of '${itemId}' \u2014 using sum`,
|
|
548
|
+
owner: { categoryId: itemId }
|
|
549
|
+
}), it.type === "delta" ? lvl.end : totals2[itemId];
|
|
550
|
+
}, valueRef = (index) => k === void 0 ? `${data.items[index].id}.value` : `${data.items[index].id}.values.${k}`, backwardOpenings = /* @__PURE__ */ new Map();
|
|
551
|
+
function backwardOpening(open) {
|
|
552
|
+
let deltas = [], inputs = [];
|
|
553
|
+
if (hiddenAfter.has(open.id)) return null;
|
|
554
|
+
for (let next of items2.slice(items2.indexOf(open) + 1)) {
|
|
555
|
+
if (connectorInto.has(next.id)) return null;
|
|
556
|
+
if (next.type !== "delta") {
|
|
557
|
+
if (next.checkValue === null) return null;
|
|
558
|
+
let value = compensatedSum([next.checkValue, ...deltas.map((delta) => -delta)]);
|
|
559
|
+
return backwardOpenings.set(open.id, { value, inputs: [{ ref: valueRef(items2.indexOf(next)), value: next.checkValue }, ...inputs] }), value;
|
|
560
|
+
}
|
|
561
|
+
if (next.toBaseline || hiddenAfter.has(next.id)) return null;
|
|
562
|
+
let sum = compensatedSum(next.segments.map((seg) => seg.value));
|
|
563
|
+
pushAll(deltas, next.segments.map((seg) => seg.value)), inputs.push({ ref: next.id, value: -sum });
|
|
564
|
+
}
|
|
565
|
+
return null;
|
|
566
|
+
}
|
|
567
|
+
let running = 0, operands = [], summed = [], summedAt = {}, started = !1, contributions = [], compositionEligible = !0, hasSegmentedDelta = !1, composition = /* @__PURE__ */ new Map();
|
|
568
|
+
for (let it of items2) {
|
|
569
|
+
let inbound = connectorInto.get(it.id);
|
|
570
|
+
if (inbound && levels2[inbound.from]) {
|
|
571
|
+
let lvl = anchorLevel2(inbound.from, inbound.anchor);
|
|
572
|
+
lvl !== null && (running = lvl, operands = [lvl], summed = summedAt[inbound.from] ?? summed, contributions = [
|
|
573
|
+
{ ref: `level:${inbound.from}${inbound.anchor ? `:${inbound.anchor}` : ""}`, value: lvl }
|
|
574
|
+
]), compositionEligible = !1, hasSegmentedDelta = !1, composition = /* @__PURE__ */ new Map();
|
|
575
|
+
}
|
|
576
|
+
if (it.type === "total" || it.type === "subtotal") {
|
|
577
|
+
let wasStarted = started, opening = wasStarted ? null : it.checkValue ?? backwardOpening(it);
|
|
578
|
+
if (!wasStarted && opening === null) {
|
|
579
|
+
let index = items2.indexOf(it);
|
|
580
|
+
warnings.push({
|
|
581
|
+
code: "waterfall-opening-missing",
|
|
582
|
+
severity: "error",
|
|
583
|
+
message: `${it.type} '${it.id}' opens the bridge without a value and cannot be derived backward: no later total with a value follows across plain deltas only`,
|
|
584
|
+
suggest: `Give '${it.id}' its value, or give the closing total its value so the opening is derived backward.`,
|
|
585
|
+
field: k === void 0 ? ["data", "items", index, "value"] : ["data", "items", index, "values", k],
|
|
586
|
+
owner: { categoryId: it.id }
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
let value = wasStarted ? running : opening ?? 0;
|
|
590
|
+
started || (running = value, summed = [it.checkValue ?? backwardOpenings.get(it.id)?.inputs[0].value ?? 0]), levels2[it.id] = { start: 0, end: value }, totals2[it.id] = value;
|
|
591
|
+
let derivedOpening = wasStarted ? void 0 : backwardOpenings.get(it.id);
|
|
592
|
+
totalBasis2[it.id] = wasStarted ? { authored: !1, inputs: contributions.map((c) => ({ ...c })) } : derivedOpening ? { authored: !1, inputs: derivedOpening.inputs } : { authored: !0, ref: `${it.id}.value` }, contributions = [{ ref: it.id, value }], operands = [value];
|
|
593
|
+
let totalCheck = started && it.checkValue !== null ? checkAgainstSum(it.checkValue, value, summed) : void 0;
|
|
594
|
+
totalCheck?.withinRounding && discloseRoundedCheck(it, k, totalCheck.printed, "checkTotalNote");
|
|
595
|
+
let totalMismatch = totalCheck && !totalCheck.withinRounding ? totalCheck.printed : void 0;
|
|
596
|
+
if (totalMismatch && warnings.push({
|
|
597
|
+
code: "derived-mismatch",
|
|
598
|
+
severity: "warn",
|
|
599
|
+
message: `${it.type} '${it.id}': supplied ${totalMismatch[0]} \u2260 computed ${totalMismatch[1]} \u2014 computed wins`,
|
|
600
|
+
owner: { categoryId: it.id }
|
|
601
|
+
}), !wasStarted && Math.abs(value) > 1e-9 && (compositionEligible = !1), it.type === "total" && wasStarted && compositionEligible && hasSegmentedDelta) {
|
|
602
|
+
let seriesTotals = [...segmentCatalog.values()].map((identity) => ({
|
|
603
|
+
id: identity.id,
|
|
604
|
+
label: identity.label,
|
|
605
|
+
value: compensatedSum(composition.get(identity.id) ?? []),
|
|
606
|
+
colorRole: identity.colorRole,
|
|
607
|
+
scenario: identity.scenario
|
|
608
|
+
})), segmentSum = compensatedSum(seriesTotals.map((seg) => seg.value));
|
|
609
|
+
if (Math.abs(segmentSum - value) <= sumRoundoff([...composition.values()].flat())) {
|
|
610
|
+
let totalSegments = seriesTotals.filter((seg) => Math.abs(seg.value) > 1e-9);
|
|
611
|
+
totalSegments.length > 0 && derivedTotalSegments2.set(it.id, totalSegments);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
} else {
|
|
615
|
+
let segmentValues = it.segments.map((seg) => seg.value), sum = compensatedSum(segmentValues), sumCheck = it.authoredSegments && it.checkValue !== null ? checkAgainstSum(it.checkValue, sum, segmentValues) : void 0;
|
|
616
|
+
sumCheck?.withinRounding && discloseRoundedCheck(it, k, sumCheck.printed, "checkSegmentsNote");
|
|
617
|
+
let sumMismatch = sumCheck && !sumCheck.withinRounding ? sumCheck.printed : void 0;
|
|
618
|
+
sumMismatch && warnings.push({
|
|
619
|
+
code: "derived-mismatch",
|
|
620
|
+
severity: "warn",
|
|
621
|
+
message: `delta '${it.id}': supplied ${sumMismatch[0]} != segment sum ${sumMismatch[1]}; computed wins`,
|
|
622
|
+
owner: { categoryId: it.id }
|
|
623
|
+
}), it.toBaseline && (compositionEligible = !0, hasSegmentedDelta = !1, composition = /* @__PURE__ */ new Map());
|
|
624
|
+
let start = it.toBaseline ? 0 : running;
|
|
625
|
+
operands = [...it.toBaseline ? [] : operands, ...segmentValues];
|
|
626
|
+
let end = compensatedSum(operands);
|
|
627
|
+
if (levels2[it.id] = { start, end }, running = end, summed = [...it.toBaseline ? [] : summed, ...segmentValues], it.toBaseline && (contributions = []), contributions.push({ ref: it.id, value: sum }), it.authoredSegments && compositionEligible) {
|
|
628
|
+
hasSegmentedDelta = !0;
|
|
629
|
+
for (let seg of it.segments)
|
|
630
|
+
composition.set(seg.id, [...composition.get(seg.id) ?? [], seg.value]);
|
|
631
|
+
} else
|
|
632
|
+
compositionEligible = !1;
|
|
633
|
+
}
|
|
634
|
+
started = !0, summedAt[it.id] = summed, hiddenAfter.has(it.id) && (running = 0, operands = [], summed = [], started = !1, contributions = [], compositionEligible = !0, hasSegmentedDelta = !1, composition = /* @__PURE__ */ new Map());
|
|
635
|
+
}
|
|
636
|
+
return { levels: levels2, totals: totals2, totalBasis: totalBasis2, derivedTotalSegments: derivedTotalSegments2, anchorLevel: anchorLevel2 };
|
|
637
|
+
}
|
|
638
|
+
let traversalExtrema = {}, markPatterns = /* @__PURE__ */ new Set(), segmentsFor = (it) => derivedTotalSegments.get(it.id) ?? (it.type === "delta" ? it.segments : [{ ...it.segments[0], value: totals[it.id] }]);
|
|
639
|
+
for (let it of allItems) {
|
|
640
|
+
let cursor = levels[it.id].start, min = cursor, max = cursor;
|
|
641
|
+
for (let segment of segmentsFor(it))
|
|
642
|
+
markPatterns.add(scenarioPattern(segment.scenario ?? it.scenario)), cursor += segment.value, min = Math.min(min, cursor), max = Math.max(max, cursor);
|
|
643
|
+
traversalExtrema[it.id] = { min, max };
|
|
644
|
+
let level = levels[it.id];
|
|
645
|
+
(min < Math.min(level.start, level.end) || max > Math.max(level.start, level.end)) && (level.min = min, level.max = max);
|
|
646
|
+
}
|
|
647
|
+
let preparedWarnings = warnings.slice(), recommendBreak = options.valueAxis?.break === void 0 || options.valueAxis.break === !1;
|
|
648
|
+
return drawBridge(options, automaticOverride, enforceBreakOrder);
|
|
649
|
+
function drawBridge(options2, automaticOverride2, enforceBreakOrder2 = !0) {
|
|
650
|
+
let warnings2 = preparedWarnings.slice(), occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { ...canvasMargin(theme, size.width), ...options2.margin }, legendItems = [...segmentCatalog.values()].map((identity) => ({
|
|
651
|
+
id: identity.id,
|
|
652
|
+
label: identity.label ?? identity.id,
|
|
653
|
+
paint: identityPaint(identity),
|
|
654
|
+
pattern: scenarioPattern(identity.scenario)
|
|
655
|
+
}));
|
|
656
|
+
pushAll(legendItems, cases.map((c, k) => ({ id: c.id, label: c.label ?? c.id, paint: casePaint(k) })));
|
|
657
|
+
let plain = (it) => !derivedTotalSegments.has(it.id) && !it.authoredSegments && !it.segments.some((seg) => seg.fill || segmentCatalog.has(seg.id)), keyed = legendItems.length > 0, inverted = cases.length === 0 && (signBridge || signSteps) && items.some((it) => plain(it) && it.type === "delta" && it.direction === "lowerIsBetter" && !!it.checkValue && !highlights.has(it.id));
|
|
658
|
+
if ((keyed || inverted) && cases.length === 0) {
|
|
659
|
+
let steps = items.filter((it) => plain(it) && it.type === "delta" && !highlights.has(it.id));
|
|
660
|
+
if (signBridge || signSteps) {
|
|
661
|
+
let words = localeStrings(options2.locale?.language), keys = /* @__PURE__ */ new Map();
|
|
662
|
+
for (let increase of [!0, !1]) {
|
|
663
|
+
let word = increase ? "Increase" : "Decrease";
|
|
664
|
+
for (let it of steps) {
|
|
665
|
+
let value = it.segments.reduce((sum, seg) => sum + seg.value, 0), tone = stepTone(value, it.direction);
|
|
666
|
+
if (tone === "neutral" || value > 0 !== increase) continue;
|
|
667
|
+
let meaning = tone === "good" ? options2.strings?.better ?? words.better : options2.strings?.worse ?? words.worse;
|
|
668
|
+
keys.set(`${word}:${tone}`, { id: `__key${word}:${tone}`, label: `${chartString(options2, increase ? "increase" : "decrease")} (${meaning})`, paint: tonePaint(tone) });
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
legendItems.push(...keys.values());
|
|
672
|
+
} else steps.length > 0 && legendItems.push({ id: "__keyStep", label: chartString(options2, "change"), paint: paletteRamp ? seriesPaint(0, options2.palette) : { token: "neutralMark" } });
|
|
673
|
+
}
|
|
674
|
+
let scenarioKeys = scenarioLegendKeys({
|
|
675
|
+
markPatterns,
|
|
676
|
+
keyPatterns: legendItems.map((item) => item.pattern),
|
|
677
|
+
paint: { token: "neutralMark" },
|
|
678
|
+
strings: options2.strings
|
|
679
|
+
});
|
|
680
|
+
legendItems.push(...scenarioKeys);
|
|
681
|
+
let required = keyed || scenarioKeys.length > 0;
|
|
682
|
+
inverted && !required && options2.legend === "none" && warnings2.push({ code: "legend-suppressed-encoding", severity: "warn", message: "legend: 'none' hides the key naming the inverted lower-is-better colours", suggest: "drop legend: 'none'" });
|
|
683
|
+
let legendOpts = required && panelTypeClass(options2) === void 0 ? legendRequired(options2.legend, warnings2, "waterfall", theme, cases.length > 0 ? "its case colours are named nowhere else" : "its segment colours and scenario hatches are named nowhere else") : normalizeLegendOption(options2.legend, inverted && panelTypeClass(options2) === void 0 ? { position: "top" } : void 0);
|
|
684
|
+
if (legendOpts?.order) {
|
|
685
|
+
let rank = new Map(legendOpts.order.map((id, i) => [id, i]));
|
|
686
|
+
legendItems.sort((a, b) => (rank.get(a.id) ?? 999) - (rank.get(b.id) ?? 999));
|
|
687
|
+
}
|
|
688
|
+
let breakOption = options2.valueAxis?.break, requestedBreak = typeof breakOption == "object" ? breakOption : void 0, autoBreak = breakOption === "auto" ? automaticOverride2 ?? automaticBreak(allItems, levels, totals, valueLineExtent(options2.annotations)) : void 0, axisBreak = requestedBreak ?? autoBreak, breakNote = axisBreak ? disclosureNote(chartString(options2, "axisBreakNote", { v1: fmtPlain(axisBreak.from), v2: fmtPlain(axisBreak.to) })) : void 0, frameResult = solveFrame(
|
|
689
|
+
{
|
|
690
|
+
size,
|
|
691
|
+
margin,
|
|
692
|
+
...frameTextOptions(options2),
|
|
693
|
+
footnotes: [...authoredNotes(options2), ...checkValueNotes, ...breakNote ? [breakNote] : []],
|
|
694
|
+
...legendOpts && legendItems.length > 0 ? { legend: { options: legendOpts, items: legendItems } } : {},
|
|
695
|
+
theme,
|
|
696
|
+
measure
|
|
697
|
+
},
|
|
698
|
+
occupied
|
|
699
|
+
), tickFont = { family: theme.type.family, ...theme.type.axis }, segmentValueWidth = categoryRow && options2.bandFraction === void 0 && options2.labels !== !1 && cases.length === 0 ? Math.max(0, maxOf(items.filter((it) => it.authoredSegments && !(it.segments.some((seg) => seg.value > 0) && it.segments.some((seg) => seg.value < 0))).flatMap((it) => it.segments.map((seg) => measure(it.type === "delta" ? fmtSigned(seg.value) : fmt(seg.value), { family: theme.type.family, ...theme.type.label }).width + 4)))) : 0, fractionFor = (w) => {
|
|
700
|
+
let base = options2.bandFraction ?? 0.62;
|
|
701
|
+
if (segmentValueWidth === 0) return base;
|
|
702
|
+
let step = w / (items.length + 0.1);
|
|
703
|
+
return Math.min(0.74, Math.max(base, segmentValueWidth / step));
|
|
704
|
+
}, bandFor = (x0, w) => bandScale(items.length, [x0, x0 + w], {
|
|
705
|
+
paddingInner: 1 - fractionFor(w),
|
|
706
|
+
paddingOuter: (1 - fractionFor(w)) / 2 + 0.05
|
|
707
|
+
}), plotLeft = frameResult.plot.x, plotWidth = frameResult.plot.w, band = bandFor(plotLeft, plotWidth), dateNumericTicks = isDateNumericTickSequence(items.map((it) => it.label)), planRowAt = (b, widths) => planCategoryRow({
|
|
708
|
+
labels: items.map((it) => it.label),
|
|
709
|
+
centers: items.map((_, i) => b.center(i)),
|
|
710
|
+
step: b.step,
|
|
711
|
+
...widths ? { widths } : {},
|
|
712
|
+
fonts: [tickFont, { family: theme.type.family, ...theme.type.footnote }],
|
|
713
|
+
measure,
|
|
714
|
+
plotHeight: frameResult.plot.h,
|
|
715
|
+
target: options2.target,
|
|
716
|
+
textScale: textScaleOf(options2),
|
|
717
|
+
range: b.range,
|
|
718
|
+
spreadBeforeRotate: categoryRow
|
|
719
|
+
}), planRow = (b) => planRowAt(b), catPlan = planRow(band), catOverhang = categoryRow ? rotatedLeftOverhang(catPlan, items.map((_, i) => band.center(i)), 4) : 0;
|
|
720
|
+
catOverhang > 0 && (plotLeft += catOverhang, plotWidth -= catOverhang, band = bandFor(plotLeft, plotWidth), catPlan = planRow(band));
|
|
721
|
+
let catInfos = catPlan.infos, catFont = catPlan.font, catRowH = catPlan.rowHeight, catTickMaxLines = catPlan.maxLines, CAT_TIER_GAP = 4, catStaggerExtra = catPlan.rowHeight - catTickMaxLines * catFont.size * (catFont.lineHeight ?? 1.2), catBandH = categoryRow ? catPlan.rowHeight + 8 : 0;
|
|
722
|
+
categoryRow && pushAll(warnings2, catPlan.warnings);
|
|
723
|
+
let annPad = (options2.annotations ?? []).some((a) => a.kind === "cagr") ? 12 + extraAnnPad : 0, axisTitle = categoryRow && axisTitleAllowed(options2.labels) ? planValueAxisTitle(options2.axisTitles?.primary, theme, measure, plotWidth) : void 0, axisTitleBand = valueAxisTitleBand(axisTitle, theme, measure, annPad), plot = {
|
|
724
|
+
x: plotLeft,
|
|
725
|
+
y: frameResult.plot.y + 8 + annPad + axisTitleBand,
|
|
726
|
+
w: plotWidth,
|
|
727
|
+
h: plotHeightAfter(frameResult, size.height, frameResult.plot.h - catBandH - 8 - annPad - axisTitleBand)
|
|
728
|
+
}, lineExtent = valueLineExtent(options2.annotations), lo = Math.min(0, lineExtent?.lo ?? 0), hi = Math.max(0, lineExtent?.hi ?? 0);
|
|
729
|
+
for (let it of allItems) {
|
|
730
|
+
let traversal = traversalExtrema[it.id];
|
|
731
|
+
lo = Math.min(lo, traversal.min), hi = Math.max(hi, traversal.max);
|
|
732
|
+
}
|
|
733
|
+
let negativeHeadroom = -lo * 0.08 || -lo, headroomHi = hi > 0 ? hi * (categoryRow ? 1.08 : 1) : lo < 0 ? Math.min(negativeHeadroom, Number.MAX_VALUE + lo) : 0, [dLo, dHi] = niceDomain(lo, headroomHi || 1, 5, {
|
|
734
|
+
dataExtent: [lo, hi],
|
|
735
|
+
maxWasteFraction: 0.15
|
|
736
|
+
}), activeBreak;
|
|
737
|
+
if (autoBreak)
|
|
738
|
+
activeBreak = autoBreak, dHi = hi + (hi - autoBreak.to) * 0.08;
|
|
739
|
+
else if (requestedBreak) {
|
|
740
|
+
let deltaItems = allItems.filter((it) => it.type === "delta"), deltaLevels = deltaItems.flatMap((it) => [traversalExtrema[it.id].min, traversalExtrema[it.id].max]), straddling = deltaItems.find(
|
|
741
|
+
(it) => crossesLinearBreak(traversalExtrema[it.id].min, traversalExtrema[it.id].max, requestedBreak)
|
|
742
|
+
), reason = breakStyleRefusal(requestedBreak) ?? (straddling ? `delta '${straddling.label}' spans the omitted range ${requestedBreak.from} to ${requestedBreak.to}` : invalidLinearBreakReason([dLo, dHi], requestedBreak, deltaLevels));
|
|
743
|
+
reason ? warnings2.push(axisBreakInvalid("waterfall", reason)) : (activeBreak = { from: requestedBreak.from, to: requestedBreak.to }, hi > 0 && headroomHi > requestedBreak.to && (dHi = hi > requestedBreak.to ? Math.min(headroomHi, hi + (hi - requestedBreak.to) * 0.08) : headroomHi));
|
|
744
|
+
} else if (recommendBreak) {
|
|
745
|
+
let deltaItems = allItems.filter((it) => it.type === "delta"), deltaMax = Math.max(0, maxOf(deltaItems.map((it) => traversalExtrema[it.id].max - traversalExtrema[it.id].min))), totalMin = minOf(allItems.filter((it) => it.type !== "delta").map((it) => totals[it.id])), deltaLevelMin = minOf(deltaItems.map((it) => traversalExtrema[it.id].min)), ratio = totalMin / deltaMax;
|
|
746
|
+
Number.isFinite(ratio) && totalMin > 0 && deltaMax > 0 && deltaLevelMin > 0 && ratio > 10 && warnings2.push({
|
|
747
|
+
code: "waterfall-base-dominates",
|
|
748
|
+
severity: "info",
|
|
749
|
+
message: `the smallest total is ${fmtPlain(ratio, { decimals: 2 })} times the largest step (above 10); consider a value-axis break to make the steps easier to compare`,
|
|
750
|
+
suggest: "set valueAxis: { break: 'auto' } to request a break where the running levels and total lengths allow it"
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
let labelFont = { family: theme.type.family, ...theme.type.label }, segmentFont = { ...labelFont, size: Math.min(labelFont.size, secondaryType(theme).size) }, strongFont = { family: theme.type.family, ...theme.type.label, weight: emphasisWeight(theme) }, hangingEnd = Math.min(0, minOf(allItems.map((it) => (it.type === "delta" ? levels[it.id].end - levels[it.id].start : totals[it.id]) < 0 ? traversalExtrema[it.id].min : 0))), hangingRoom = options2.labels === !1 || !categoryRow ? 0 : measure("0", strongFont).height + 4, hangingReserve = hangingLabelReserve(plot.h, [dLo, dHi], hangingEnd, hangingRoom);
|
|
754
|
+
categoryRow && !options2.annotations?.some((a) => a.kind === "cagr") && ["fit", "wrap", "font-down"].includes(catPlan.step) && fixedPlotChrome(frameResult, catBandH + 8 + axisTitleBand), plot.h = plotHeightAfter(frameResult, size.height, plot.h - hangingReserve);
|
|
755
|
+
let y = activeBreak ? brokenLinearScale([dLo, dHi], [plot.y + plot.h, plot.y], activeBreak) : linearScale([dLo, dHi], [plot.y + plot.h, plot.y]), unsafeBreak = !1;
|
|
756
|
+
if (activeBreak) {
|
|
757
|
+
let steps = allItems.filter((it) => it.type === "delta").flatMap((it) => {
|
|
758
|
+
let level = levels[it.id], traversal = traversalExtrema[it.id], start = level.start, segments = segmentsFor(it).map((segment) => {
|
|
759
|
+
let end = start + segment.value, span = { value: Math.abs(segment.value), start, end };
|
|
760
|
+
return start = end, span;
|
|
761
|
+
});
|
|
762
|
+
return [{ value: segments.some((s) => s.end > s.start) && segments.some((s) => s.end < s.start) ? traversal.max - traversal.min : Math.abs(level.end - level.start), start: traversal.min, end: traversal.max }, ...segments];
|
|
763
|
+
}), totalBars = allItems.filter((it) => it.type !== "delta").map((it) => {
|
|
764
|
+
let traversal = traversalExtrema[it.id];
|
|
765
|
+
return { value: Math.abs(totals[it.id]), start: traversal.min, end: traversal.max };
|
|
766
|
+
});
|
|
767
|
+
if (unsafeBreak = breakReversesOrder(y, totalBars, steps), enforceBreakOrder2 && unsafeBreak) {
|
|
768
|
+
if (autoBreak) {
|
|
769
|
+
let maxStepInk = maxOf(steps.map((step) => Math.abs(step.end - step.start))), totalMin = minOf(totalBars.map((total) => total.value)), pixelsPerUnit = Math.abs(y(dHi) - y(autoBreak.to)) / (dHi - autoBreak.to), margin2 = Math.max(1 / pixelsPerUnit, maxStepInk * 0.01), moved = { from: autoBreak.from, to: floorTwoDigits(totalMin + autoBreak.from - maxStepInk - margin2) }, drawn = [
|
|
770
|
+
...allItems.flatMap((it) => [traversalExtrema[it.id].min, traversalExtrema[it.id].max]),
|
|
771
|
+
...(() => {
|
|
772
|
+
let line = valueLineExtent(options2.annotations);
|
|
773
|
+
return line ? [line.lo, line.hi] : [];
|
|
774
|
+
})()
|
|
775
|
+
];
|
|
776
|
+
if (!invalidLinearBreakReason([dLo, dHi], moved, drawn))
|
|
777
|
+
return drawBridge(options2, moved);
|
|
778
|
+
}
|
|
779
|
+
let result = drawBridge({ ...options2, valueAxis: { ...options2.valueAxis, break: !1 } });
|
|
780
|
+
return requestedBreak && result.geometry.warnings.push(axisBreakHeightOrderWarning()), result;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
let y0 = y(0), catRowY = (dateNumericTicks ? plot.y + plot.h + hangingReserve : categoryRowTop(y, minOf(allItems.map((it) => traversalExtrema[it.id].min)), hangingEnd, hangingRoom)) + 6, nodes = [...frameResult.nodes], marks = { bars: [], connectors: [] }, labelRequests = axisTitle ? [valueAxisTitleRequest(axisTitle, { x: plot.x, y: frameResult.plot.y + 4 }, "start", "axis:y:title")] : [], baselineId = "axis:baseline";
|
|
784
|
+
nodes.push({
|
|
785
|
+
t: "line",
|
|
786
|
+
id: baselineId,
|
|
787
|
+
x1: plot.x,
|
|
788
|
+
y1: y0,
|
|
789
|
+
x2: plot.x + plot.w,
|
|
790
|
+
y2: y0,
|
|
791
|
+
stroke: { token: "axis" },
|
|
792
|
+
width: strokeToken(theme, "rule"),
|
|
793
|
+
owner: {},
|
|
794
|
+
part: "baseline"
|
|
795
|
+
}), occupied.claim({ x: plot.x, y: y0 - 1, w: plot.w, h: 2 }, "axis", {});
|
|
796
|
+
let segMaxAbs = Math.max(1e-9, maxOf(allItems.filter((it) => it.authoredSegments || derivedTotalSegments.has(it.id)).flatMap((it) => segmentsFor(it).map((seg) => Math.abs(seg.value))))), CASE_GAP = 2, CASE_LABEL_SHIFT = (SERIES_VALUE_GAP - CASE_GAP) / 2, boldValueIds = /* @__PURE__ */ new Set(), authoredValueIds = /* @__PURE__ */ new Set(), caseW = cases.length > 0 ? (band.bandwidth - CASE_GAP * (cases.length - 1)) / cases.length : 0;
|
|
797
|
+
cases.length === 0 ? items.forEach((it, i) => drawStep(it, i, band.position(i), band.bandwidth)) : items.forEach((_, i) => cases.forEach((__, k) => drawStep(caseItems[k][i], i, band.position(i) + k * (caseW + CASE_GAP), caseW, k)));
|
|
798
|
+
function drawStep(it, i, bx, bw, caseIndex) {
|
|
799
|
+
let lvl = levels[it.id], isTotal = it.type !== "delta", cat = items[i], caseId = caseIndex === void 0 ? void 0 : cases[caseIndex].id, stepOwner = caseId === void 0 ? { categoryId: it.id } : { categoryId: cat.id, seriesId: caseId }, paintOf = (seg) => caseIndex === void 0 ? segmentPaint(it, seg) : seg.fill ? { css: seg.fill } : casePaint(caseIndex), stackedTotal = derivedTotalSegments.get(it.id), drawSegments = segmentsFor(it), segmentedMark = it.authoredSegments || stackedTotal !== void 0, traversal = traversalExtrema[it.id], cumScan = lvl.start, segSpans = drawSegments.map((seg) => {
|
|
800
|
+
let sStart = cumScan, sEnd = cumScan + seg.value;
|
|
801
|
+
return cumScan = sEnd, { seg, sStart, sEnd };
|
|
802
|
+
}), yTop = y(traversal.max), yBot = y(traversal.min), barRect = { x: bx, y: yTop, w: bw, h: Math.max(yBot - yTop, 0.5) }, segRects = [], mixed = it.type === "delta" && segSpans.some((s) => s.seg.value > 0) && segSpans.some((s) => s.seg.value < 0), n = segSpans.length, gap = mixed && n > 1 ? Math.min(2, Math.max(0, (bw - n) / (n - 1))) : 0, subW = mixed ? (bw - gap * (n - 1)) / n : bw, drawOrder = segSpans.map((s, k) => ({ ...s, k, extent: Math.abs(y(s.sStart) - y(s.sEnd)) })).sort((a, b) => b.extent - a.extent || a.k - b.k);
|
|
803
|
+
drawOrder.forEach(({ seg, sStart, sEnd, k }) => {
|
|
804
|
+
let sy = y(Math.max(sStart, sEnd)), sh = Math.max(Math.abs(y(sStart) - y(sEnd)), 0.5), rect = { x: mixed ? bx + k * (subW + gap) : bx, y: sy, w: subW, h: sh }, nodeId = `mark:${cat.id}:${seg.id}`, paint = paintOf(seg), pattern = scenarioPattern(seg.scenario ?? it.scenario), segOwner = caseId === void 0 ? { categoryId: it.id, segmentId: segmentedMark ? seg.id : void 0 } : stepOwner, segFmt = seg.format ? { fmt: formatterFromExample(seg.format, options2.locale?.language), fmtSigned: signedFormatterFromExample(seg.format, options2.locale?.language) } : { fmt, fmtSigned }, segBase = isTotal || stackedTotal ? segFmt.fmt(seg.value) : segFmt.fmtSigned(seg.value), segText = typeof seg.valueLabel == "string" ? seg.valueLabel.replace(/\$\{value\}/g, segBase) : segBase, segDisplay = { value: segText }, breakMeta = activeBreak ? y.break : void 0;
|
|
805
|
+
if (activeBreak && breakMeta && crossesLinearBreak(sStart, sEnd, activeBreak)) {
|
|
806
|
+
let topPx = y(Math.max(sStart, sEnd)), bottomPx = y(Math.min(sStart, sEnd)), glyph;
|
|
807
|
+
if (pattern === "outline") {
|
|
808
|
+
let lower = { x: bx, y: breakMeta.position + 2, w: bw, h: Math.max(bottomPx - breakMeta.position - 2, 0.5) }, upper = { x: bx, y: topPx, w: bw, h: Math.max(breakMeta.position - 2 - topPx, 0.5) };
|
|
809
|
+
nodes.push(
|
|
810
|
+
{ t: "rect", id: nodeId, rect: lower, fill: paint, pattern, owner: segOwner, part: "segment", display: segDisplay },
|
|
811
|
+
{ t: "rect", id: `${nodeId}:beyondBreak`, rect: upper, fill: paint, pattern, owner: segOwner, part: "segmentBeyondBreak" }
|
|
812
|
+
), glyph = straightBreakGlyph(theme, { x: bx + bw / 2, y: breakMeta.position }, `${nodeId}:break`, segOwner, { token: "axis" }, "barBreak");
|
|
813
|
+
} else {
|
|
814
|
+
let whole = { x: bx, y: topPx, w: bw, h: bottomPx - topPx };
|
|
815
|
+
nodes.push({ t: "rect", id: nodeId, rect: whole, fill: paint, pattern, owner: segOwner, part: "segment", display: segDisplay }), glyph = barBreakCut(whole, "y", breakMeta.position, `${nodeId}:break`, segOwner);
|
|
816
|
+
}
|
|
817
|
+
nodes.push(...glyph.nodes), occupied.claim(glyph.rect, "axis", segOwner, "barBreak");
|
|
818
|
+
} else
|
|
819
|
+
nodes.push({
|
|
820
|
+
t: "rect",
|
|
821
|
+
id: nodeId,
|
|
822
|
+
rect,
|
|
823
|
+
fill: paint,
|
|
824
|
+
pattern,
|
|
825
|
+
owner: segOwner,
|
|
826
|
+
part: "segment",
|
|
827
|
+
display: segDisplay
|
|
828
|
+
});
|
|
829
|
+
if (segRects.push({ id: seg.id, rect, nodeId }), mixed && caseId === void 0 && occupied.claim(rect, "mark", { categoryId: it.id, segmentId: seg.id }), segmentedMark) {
|
|
830
|
+
let text2 = segText, tsize2 = measure(text2, segmentFont), fits = tsize2.height + 2 <= sh && tsize2.width + 8 <= subW, nextCase = caseIndex !== void 0 && caseIndex < cases.length - 1, nextItem = nextCase ? caseItems[caseIndex + 1][i] : i < items.length - 1 ? caseIndex !== void 0 ? caseItems[0][i + 1] : items[i + 1] : void 0, nextSpan = nextItem && traversalExtrema[nextItem.id], nextRect = nextSpan && { x: nextCase ? bx + bw + CASE_GAP : band.position(i + 1), y: y(nextSpan.max), w: bw, h: y(nextSpan.min) - y(nextSpan.max) }, stacked = stackSegmentCandidates(rect, tsize2, fits, effectiveFill(paintColor(theme, paint), pattern, theme), { tightLast: !0, insidePaint: paint, insidePattern: pattern }).filter((candidate) => !candidate.slot.startsWith("outside") || candidate.slot.startsWith("outsideRight") && (!nextRect || boxGap(candidate.rect, rect) < boxGap(candidate.rect, nextRect))), glyphFits = categoryRow && !mixed && !fits && !stacked.some((candidate) => candidate.slot.startsWith("inside")) && segmentFont.size * DIGIT_CAP + 2 <= sh && tsize2.width + 4 <= subW && digitSeat(
|
|
831
|
+
rect,
|
|
832
|
+
text2,
|
|
833
|
+
tsize2,
|
|
834
|
+
segmentFont.size * DIGIT_CAP,
|
|
835
|
+
segmentFont.size,
|
|
836
|
+
Math.max(2, digitSeatEdge(theme, pattern)) + (text2.includes(",") ? segmentFont.size * 0.2 : 0)
|
|
837
|
+
) !== void 0, glyphSeat = glyphFits ? [{
|
|
838
|
+
slot: "insideTight",
|
|
839
|
+
penalty: 1,
|
|
840
|
+
pad: 0,
|
|
841
|
+
rect: { x: rect.x + rect.w / 2 - tsize2.width / 2, y: rect.y + rect.h / 2 - tsize2.height / 2, w: tsize2.width, h: tsize2.height },
|
|
842
|
+
insideFill: effectiveFill(paintColor(theme, paint), pattern, theme),
|
|
843
|
+
insidePaint: paint,
|
|
844
|
+
insidePattern: pattern
|
|
845
|
+
}] : [], digits = categoryRow && !activeBreak && !mixed ? digitSeat(rect, text2, tsize2, measure.capHeight?.(segmentFont), segmentFont.size, digitSeatEdge(theme, pattern)) : void 0, inkFits = digits !== void 0, wholeAxisInkFits = inkFits && drawOrder.at(-1).extent < tsize2.height + 2, inkSeat = digits ? [{
|
|
846
|
+
slot: wholeAxisInkFits ? "insideTight" : "insideDigits",
|
|
847
|
+
penalty: wholeAxisInkFits ? 0 : 1.5,
|
|
848
|
+
pad: 0,
|
|
849
|
+
rect: digits,
|
|
850
|
+
insideFill: effectiveFill(paintColor(theme, paint), pattern, theme),
|
|
851
|
+
insidePaint: paint,
|
|
852
|
+
insidePattern: pattern
|
|
853
|
+
}] : [], sliver = !(fits || glyphFits || inkFits) && segmentTooShort(options2.labelDensity ?? "smart", sh, tsize2.height, options2.labelPlacements?.[`segment:${it.id}:${seg.id}`], STACK_ROOM), wholeAxisSliver = categoryRow && !activeBreak && !mixed && !fits;
|
|
854
|
+
labelRequests.push({
|
|
855
|
+
id: `segment:${it.id}:${seg.id}`,
|
|
856
|
+
kind: "segment",
|
|
857
|
+
...drawSegments.length === 1 && typeof seg.valueLabel != "string" ? { printedIn: `${isTotal ? "total" : "sum"}:${it.id}` } : {},
|
|
858
|
+
owner: { categoryId: it.id, segmentId: seg.id },
|
|
859
|
+
text: text2,
|
|
860
|
+
lines: [text2],
|
|
861
|
+
font: segmentFont,
|
|
862
|
+
typeRole: "secondary",
|
|
863
|
+
// The smallest |value| drops first, across the chart; the priority scales |value| to the
|
|
864
|
+
// chart's largest, so large values do not tie.
|
|
865
|
+
priority: seg.priority ?? PRIORITY.interior + 99 * Math.abs(seg.value) / segMaxAbs,
|
|
866
|
+
redundant: sliver || seg.valueLabel === !1,
|
|
867
|
+
...typeof seg.valueLabel != "string" ? { noLeader: !0 } : {},
|
|
868
|
+
// The value reads as its own sub-bar's; a seat nearer another mark takes a leader.
|
|
869
|
+
...mixed || wholeAxisSliver ? { anchor: { x: rect.x, y: rect.y, w: rect.w, h: rect.h } } : {},
|
|
870
|
+
...wholeAxisSliver ? { leaderClear: "includingPins" } : {},
|
|
871
|
+
candidates: typeof seg.valueLabel != "string" ? [...inkSeat, ...glyphSeat, ...stacked].filter((candidate) => candidate.insideFill !== void 0) : mixed && !fits ? [...mixedSliverSeats(rect, tsize2, k, n), ...stacked] : [...inkSeat, ...glyphSeat, ...stacked, ...wholeAxisSliver ? mixedSliverSeats(rect, tsize2, k, n, ["left", "right"], !0) : []]
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
let inputIndex = new Map(drawSegments.map((s, k) => [s.id, k]));
|
|
876
|
+
if (segRects.sort((a, b) => (inputIndex.get(a.id) ?? 0) - (inputIndex.get(b.id) ?? 0)), mixed && caseId === void 0 || occupied.claim(barRect, "mark", stepOwner), marks.bars.push({ id: it.id, rect: barRect, segments: segRects }), caseIndex === void 0 && i < items.length - 1 && !hiddenAfter.has(it.id) && !connectorInto.has(items[i + 1].id)) {
|
|
877
|
+
let next = items[i + 1], level = it.type === "delta" ? lvl.end : totals[it.id], cy = y(level), nodeId = `connector:${it.id}:${next.id}`;
|
|
878
|
+
nodes.push({
|
|
879
|
+
t: "line",
|
|
880
|
+
id: nodeId,
|
|
881
|
+
// TRUE corners. The air gap is applied by insetBridgeEnds() on final
|
|
882
|
+
// coordinates, once per orientation — see its doc comment.
|
|
883
|
+
x1: bx + bw,
|
|
884
|
+
y1: cy,
|
|
885
|
+
x2: band.position(i + 1),
|
|
886
|
+
y2: cy,
|
|
887
|
+
stroke: connectorStroke,
|
|
888
|
+
width: strokeToken(theme, "rule"),
|
|
889
|
+
dash: connectorDash,
|
|
890
|
+
lineCap: signBridge ? "round" : "butt",
|
|
891
|
+
owner: { categoryId: it.id },
|
|
892
|
+
part: "connector"
|
|
893
|
+
}), occupied.claim(connectorClaim(bx + bw, band.position(i + 1), cy), "mark", {}, "connector"), marks.connectors.push({ from: it.id, to: next.id, nodeId });
|
|
894
|
+
}
|
|
895
|
+
let itemValue = isTotal ? totals[it.id] : lvl.end - lvl.start, valueMeta = { ...drawSegments.length === 1 ? drawSegments[0] : {}, ...it.valueMeta }, own = valueMeta?.format ? { fmt: formatterFromExample(valueMeta.format, options2.locale?.language), fmtSigned: signedFormatterFromExample(valueMeta.format, options2.locale?.language) } : { fmt, fmtSigned }, itemBase = isTotal ? own.fmt(itemValue) : mixed ? `net ${own.fmtSigned(itemValue)}` : own.fmtSigned(itemValue), text = typeof valueMeta?.valueLabel == "string" ? valueMeta.valueLabel.replace(/\$\{value\}/g, itemBase) : itemBase;
|
|
896
|
+
isTotal || stepTones.set(it.id, stepTone(itemValue, it.direction));
|
|
897
|
+
let boldStep = !isTotal && categoryRow && highlights.has(cat.id);
|
|
898
|
+
boldStep && boldValueIds.add(`sum:${it.id}`), typeof valueMeta?.valueLabel == "string" && authoredValueIds.add(isTotal ? `total:${it.id}` : `sum:${it.id}`);
|
|
899
|
+
let font = isTotal || boldStep ? strongFont : labelFont, tsize = measure(text, font), negative = itemValue < 0, outsideY = negative ? yBot + 4 : yTop - tsize.height - 4, endpoint = i === 0 || i === items.length - 1, insidePaint = paintOf(stackedTotal ? drawSegments[drawSegments.length - 1] : it.segments[0]), insidePattern = scenarioPattern(stackedTotal ? drawSegments[drawSegments.length - 1].scenario ?? it.scenario : it.scenario ?? (it.segments.length === 1 ? it.segments[0].scenario : void 0));
|
|
900
|
+
if (labelRequests.push({
|
|
901
|
+
id: isTotal ? `total:${it.id}` : `sum:${it.id}`,
|
|
902
|
+
kind: isTotal ? "total" : "segment",
|
|
903
|
+
// A one-part value names its segment back, so a pinned segment placed first takes the value; an authored text keeps its seat.
|
|
904
|
+
...drawSegments.length === 1 && typeof drawSegments[0].valueLabel != "string" && typeof valueMeta?.valueLabel != "string" ? { printedIn: `segment:${it.id}:${drawSegments[0].id}` } : {},
|
|
905
|
+
owner: stepOwner,
|
|
906
|
+
...mixed ? { role: composedTextRole(text) } : {},
|
|
907
|
+
text,
|
|
908
|
+
lines: [text],
|
|
909
|
+
font,
|
|
910
|
+
priority: valueMeta?.priority ?? (isTotal ? PRIORITY.total : endpoint ? PRIORITY.endpoint : PRIORITY.extreme) + (highlights.has(cat.id) ? PRIORITY.highlightBonus : 0),
|
|
911
|
+
...valueMeta?.valueLabel === !1 ? { redundant: !0 } : {},
|
|
912
|
+
// An authored value passes the density gate, as on column and bar.
|
|
913
|
+
...typeof valueMeta?.valueLabel == "string" ? { keepWhenDense: !0 } : {},
|
|
914
|
+
candidates: [
|
|
915
|
+
{
|
|
916
|
+
slot: negative ? "outsideBottom" : "outsideTop",
|
|
917
|
+
rect: {
|
|
918
|
+
x: caseIndex === void 0 ? bx + bw / 2 - tsize.width / 2 : caseIndex === 0 ? bx + bw - tsize.width - (isTotal ? CASE_LABEL_SHIFT : 0) : caseIndex === cases.length - 1 ? bx + (isTotal ? CASE_LABEL_SHIFT : 0) : bx + bw / 2 - tsize.width / 2,
|
|
919
|
+
y: outsideY,
|
|
920
|
+
w: tsize.width,
|
|
921
|
+
h: tsize.height
|
|
922
|
+
},
|
|
923
|
+
penalty: 0
|
|
924
|
+
},
|
|
925
|
+
// Where the shifted seat is blocked, an outer case's total keeps the seat at its bar's inner edge.
|
|
926
|
+
...isTotal && caseIndex !== void 0 && (caseIndex === 0 || caseIndex === cases.length - 1) ? [{
|
|
927
|
+
slot: negative ? "outsideBottom" : "outsideTop",
|
|
928
|
+
rect: { x: caseIndex === 0 ? bx + bw - tsize.width : bx, y: outsideY, w: tsize.width, h: tsize.height },
|
|
929
|
+
penalty: 1
|
|
930
|
+
}] : [],
|
|
931
|
+
...tsize.height + 4 <= barRect.h && tsize.width + 4 <= bw ? [{
|
|
932
|
+
slot: "insideEnd",
|
|
933
|
+
rect: {
|
|
934
|
+
x: bx + bw / 2 - tsize.width / 2,
|
|
935
|
+
y: negative ? yBot - tsize.height - 2 : yTop + 2,
|
|
936
|
+
w: tsize.width,
|
|
937
|
+
h: tsize.height
|
|
938
|
+
},
|
|
939
|
+
penalty: 2,
|
|
940
|
+
insidePaint,
|
|
941
|
+
insidePattern,
|
|
942
|
+
insideFill: effectiveFill(paintColor(theme, insidePaint), insidePattern, theme)
|
|
943
|
+
}] : [],
|
|
944
|
+
// Full mode prints the start and end totals. When the centred seats collide with
|
|
945
|
+
// the neighbouring bar, the end total hangs outward from its bar's outer edge.
|
|
946
|
+
...isTotal && endpoint && caseIndex === void 0 && items.length > 1 ? [{
|
|
947
|
+
slot: negative ? "outsideBottom" : "outsideTop",
|
|
948
|
+
rect: { x: i === 0 ? bx + bw - tsize.width : bx, y: outsideY, w: tsize.width, h: tsize.height },
|
|
949
|
+
penalty: 3
|
|
950
|
+
}] : []
|
|
951
|
+
]
|
|
952
|
+
}), caseIndex !== void 0 && caseIndex > 0) return;
|
|
953
|
+
let catInfo = catInfos[i], catX = catPlan.x(i), catY = catRowY, rotated = catPlan.rotation !== 0;
|
|
954
|
+
labelRequests.push({
|
|
955
|
+
id: `category:${cat.id}`,
|
|
956
|
+
kind: "category",
|
|
957
|
+
owner: { categoryId: cat.id },
|
|
958
|
+
text: cat.label,
|
|
959
|
+
lines: catInfo.lines,
|
|
960
|
+
...categoryLineAlign(catPlan, i),
|
|
961
|
+
...catInfo.title !== void 0 ? { title: catInfo.title } : {},
|
|
962
|
+
font: catFont,
|
|
963
|
+
priority: PRIORITY.endpoint,
|
|
964
|
+
// A stride-hidden date label is the row's decision (one info lint), not a loss.
|
|
965
|
+
redundant: !catPlan.keep[i],
|
|
966
|
+
// A rotated claim is the small square at the anchor. At the 12 px type size of
|
|
967
|
+
// the W-L width class its top sits within the 2 px pad of the baseline claim, and every
|
|
968
|
+
// rotated name would be hidden; the square itself stays clear of it.
|
|
969
|
+
...rotated ? { rotate: -45, pad: 0 } : {},
|
|
970
|
+
candidates: rotated ? [
|
|
971
|
+
{
|
|
972
|
+
slot: "below",
|
|
973
|
+
rect: rotatedClaimRect(caseIndex === void 0 ? bx + bw / 2 : band.center(i), catY + 2, catInfo.h, catY - 6),
|
|
974
|
+
penalty: 0
|
|
975
|
+
}
|
|
976
|
+
] : [
|
|
977
|
+
{
|
|
978
|
+
slot: "below",
|
|
979
|
+
rect: { x: catX, y: catY, w: catInfo.w, h: catInfo.h },
|
|
980
|
+
penalty: 0
|
|
981
|
+
},
|
|
982
|
+
// Second tier: lets a name yield to a value label that still
|
|
983
|
+
// reaches the row. Prose only.
|
|
984
|
+
...dateNumericTicks ? [] : [
|
|
985
|
+
{
|
|
986
|
+
slot: "belowShifted",
|
|
987
|
+
rect: { x: catX, y: catY + catRowH + CAT_TIER_GAP, w: catInfo.w, h: catInfo.h },
|
|
988
|
+
penalty: 1
|
|
989
|
+
}
|
|
990
|
+
]
|
|
991
|
+
]
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
for (let c of connectors) {
|
|
995
|
+
if (c.hidden) continue;
|
|
996
|
+
let fromIdx = items.findIndex((x) => x.id === c.from), toIdx = items.findIndex((x) => x.id === c.to);
|
|
997
|
+
if (fromIdx < 0 || toIdx < 0) {
|
|
998
|
+
warnings2.push({
|
|
999
|
+
code: "unknown-connector-endpoint",
|
|
1000
|
+
severity: "warn",
|
|
1001
|
+
message: `connector ${c.from}\u2192${c.to}: unknown item id \u2014 skipped`
|
|
1002
|
+
});
|
|
1003
|
+
continue;
|
|
1004
|
+
}
|
|
1005
|
+
let level = anchorLevel(c.from, c.anchor);
|
|
1006
|
+
if (level === null) continue;
|
|
1007
|
+
let cy = y(level), nodeId = `connector:${c.from}:${c.to}`;
|
|
1008
|
+
if (nodes.some((n) => n.id === nodeId)) continue;
|
|
1009
|
+
let x1 = band.position(fromIdx) + band.bandwidth, x2 = band.position(toIdx);
|
|
1010
|
+
nodes.push({
|
|
1011
|
+
t: "line",
|
|
1012
|
+
id: nodeId,
|
|
1013
|
+
// True corners, same as the default connector; insetBridgeEnds() adds
|
|
1014
|
+
// the air gap after any transpose.
|
|
1015
|
+
x1: Math.min(x1, x2),
|
|
1016
|
+
y1: cy,
|
|
1017
|
+
x2: Math.max(x1, x2),
|
|
1018
|
+
y2: cy,
|
|
1019
|
+
stroke: connectorStroke,
|
|
1020
|
+
width: strokeToken(theme, "rule"),
|
|
1021
|
+
dash: connectorDash,
|
|
1022
|
+
lineCap: signBridge ? "round" : "butt",
|
|
1023
|
+
owner: { categoryId: c.from },
|
|
1024
|
+
part: "connector"
|
|
1025
|
+
}), occupied.claim(connectorClaim(x1, x2, cy), "mark", {}, "connector"), marks.connectors.push({ from: c.from, to: c.to, nodeId });
|
|
1026
|
+
}
|
|
1027
|
+
let solveCtx = labelCtx(theme, size, options2, {
|
|
1028
|
+
measure,
|
|
1029
|
+
plot,
|
|
1030
|
+
labelPad: 2
|
|
1031
|
+
}), rowValues = labelRequests.filter((request) => /^(sum|total):/.test(request.id) && !authoredValueIds.has(request.id));
|
|
1032
|
+
solveCtx.valueRows = [...new Set(rowValues.map((request) => `${request.kind}:${request.owner.seriesId ?? ""}`))].map((role) => ({
|
|
1033
|
+
ids: rowValues.filter((request) => `${request.kind}:${request.owner.seriesId ?? ""}` === role).map((request) => request.id),
|
|
1034
|
+
alternate: !0
|
|
1035
|
+
}));
|
|
1036
|
+
let solved = solveLabels(labelRequests, occupied, solveCtx);
|
|
1037
|
+
if (applyValueAxisTitleInk(solved.placed), pushAll(warnings2, solved.warnings), signBridge)
|
|
1038
|
+
for (let label of solved.placed) {
|
|
1039
|
+
let tone = label.id.startsWith("sum:") ? stepTones.get(label.id.slice(4)) : void 0;
|
|
1040
|
+
tone && tone !== "neutral" && label.slot !== "insideEnd" && (label.ink = { token: tone });
|
|
1041
|
+
}
|
|
1042
|
+
let totalsOrder = items.filter((it) => it.type !== "delta"), resolve = (ref) => {
|
|
1043
|
+
let norm = typeof ref == "string" ? { categoryId: ref, edge: "total" } : ref;
|
|
1044
|
+
if (!("categoryId" in norm)) return null;
|
|
1045
|
+
let k = cases.findIndex((c) => c.id === norm.seriesId);
|
|
1046
|
+
if (cases.length > 0 && k < 0) return null;
|
|
1047
|
+
let step = items.find((x) => x.id === norm.categoryId);
|
|
1048
|
+
if (!step) return null;
|
|
1049
|
+
let i = items.indexOf(step), it = k < 0 ? step : caseItems[k][i], lvl = levels[it.id], edge = norm.edge ?? "total", value = edge === "start" ? lvl.start : it.type === "delta" ? lvl.end : totals[it.id], anchorLevel2 = edge === "start" ? lvl.start : edge === "end" ? lvl.end : Math.max(lvl.start, lvl.end);
|
|
1050
|
+
return {
|
|
1051
|
+
x: k < 0 ? band.center(i) : band.position(i) + k * (caseW + CASE_GAP) + caseW / 2,
|
|
1052
|
+
y: y(anchorLevel2),
|
|
1053
|
+
value,
|
|
1054
|
+
date: it.date,
|
|
1055
|
+
label: it.label,
|
|
1056
|
+
owner: k < 0 ? { categoryId: it.id } : { categoryId: step.id, seriesId: cases[k].id }
|
|
1057
|
+
};
|
|
1058
|
+
}, annotations = options2.annotations ?? [], annPlot = {
|
|
1059
|
+
x: plot.x,
|
|
1060
|
+
y: plot.y - annPad,
|
|
1061
|
+
w: plot.w,
|
|
1062
|
+
h: plot.h + annPad
|
|
1063
|
+
}, sourceValues = annotations.some((annotation) => annotation.kind === "valueLine") ? data.items.flatMap((item) => item.values ?? (item.segments?.length ? item.segments.map((segment) => segment.value) : [item.value ?? null])).filter((value) => value !== null) : [], annResult = runAnnotatePass({
|
|
1064
|
+
annotations,
|
|
1065
|
+
resolve,
|
|
1066
|
+
defaultSpan: totalsOrder.length >= 2 ? { from: totalsOrder[0].id, to: totalsOrder[totalsOrder.length - 1].id } : items.length >= 2 ? { from: items[0].id, to: items[items.length - 1].id } : void 0,
|
|
1067
|
+
occupied,
|
|
1068
|
+
plot: annPlot,
|
|
1069
|
+
theme,
|
|
1070
|
+
measure,
|
|
1071
|
+
format: options2.format,
|
|
1072
|
+
locale: options2.locale?.language,
|
|
1073
|
+
strings: options2.strings,
|
|
1074
|
+
valueLinePercentLevels: options2.unit === "%" || sourceValues.length > 0 && sourceValues.every(isPctCell),
|
|
1075
|
+
solveCtx,
|
|
1076
|
+
yScale: y,
|
|
1077
|
+
annotationBandReserved: !0
|
|
1078
|
+
});
|
|
1079
|
+
pushAll(warnings2, annResult.warnings);
|
|
1080
|
+
let allLabels = [...solved.placed, ...annResult.labels];
|
|
1081
|
+
haloOverpaintedInsideLabels(nodes, allLabels, theme), pushAll(nodes, annResult.nodes), pushAll(
|
|
1082
|
+
nodes,
|
|
1083
|
+
labelsToNodes(
|
|
1084
|
+
theme,
|
|
1085
|
+
allLabels,
|
|
1086
|
+
(l) => (
|
|
1087
|
+
// A category label is drawn at the font its row was measured at.
|
|
1088
|
+
l.kind === "total" || boldValueIds.has(l.id) ? strongFont : l.kind === "segment" ? segmentFont : l.kind === "category" ? catFont : l.kind === "annotation" || l.kind === "valueLine" ? { ...labelFont, weight: emphasisWeight(theme) } : labelFont
|
|
1089
|
+
),
|
|
1090
|
+
nodes
|
|
1091
|
+
)
|
|
1092
|
+
);
|
|
1093
|
+
let first = items[0], last = items[items.length - 1], stepsDesc = (bridge) => bridge.map(
|
|
1094
|
+
(it) => it.type === "delta" ? `${it.label} ${labelRequests.find((label) => label.id === `sum:${it.id}`)?.text ?? fmtSigned(levels[it.id].end - levels[it.id].start)}` : `${it.label} ${labelRequests.find((label) => label.id === `total:${it.id}`)?.text ?? fmt(totals[it.id])}`
|
|
1095
|
+
).join(", "), a11yDesc = cases.length > 0 ? chartString(options2, "waterfallCasesDesc", { v1: cases.length, v2: cases.map((c, k) => `${c.label ?? c.id}: ${stepsDesc(caseItems[k])}`).join(". ") }) : stepsDesc(items), full = options2.mode !== "compact", valueLabels = new Map(solved.placed.map((label) => [label.id, label])), minPlotW = valueLabelPlotFloor(plot.w, marks.bars.map((bar, k) => ({
|
|
1096
|
+
bar: bar.rect,
|
|
1097
|
+
group: String(cases.length > 0 ? Math.floor(k / cases.length) : k),
|
|
1098
|
+
labels: [valueLabels.has(`sum:${bar.id}`) ? floorValueLabel(valueLabels.get(`sum:${bar.id}`), full) : printedValueLabel(valueLabels.get(`total:${bar.id}`))].flatMap((rect) => rect ?? [])
|
|
1099
|
+
})), !full);
|
|
1100
|
+
return {
|
|
1101
|
+
geometry: {
|
|
1102
|
+
type: "waterfall",
|
|
1103
|
+
size,
|
|
1104
|
+
sizing: {
|
|
1105
|
+
...bandSizing("waterfall", size, plot.w + catOverhang, band.step, minPlotW),
|
|
1106
|
+
...nodes.some((node) => node.part === "barBreak") ? { [HEIGHT_STRUCTURE]: !0 } : {}
|
|
1107
|
+
},
|
|
1108
|
+
plot,
|
|
1109
|
+
scene: withSegmentSeams(nodes, theme),
|
|
1110
|
+
labels: allLabels,
|
|
1111
|
+
axes: [
|
|
1112
|
+
{
|
|
1113
|
+
axis: "x",
|
|
1114
|
+
baselineNodeId: baselineId,
|
|
1115
|
+
ticks: items.map((it, i) => ({
|
|
1116
|
+
at: it.id,
|
|
1117
|
+
pos: band.center(i),
|
|
1118
|
+
labelId: `category:${it.id}`
|
|
1119
|
+
}))
|
|
1120
|
+
}
|
|
1121
|
+
],
|
|
1122
|
+
annotations: annResult.placed,
|
|
1123
|
+
legend: frameResult.legend,
|
|
1124
|
+
frame: frameResult.frame,
|
|
1125
|
+
marks,
|
|
1126
|
+
derived: {
|
|
1127
|
+
levels,
|
|
1128
|
+
totals,
|
|
1129
|
+
totalBasis,
|
|
1130
|
+
tickBand: {
|
|
1131
|
+
reserved: catBandH,
|
|
1132
|
+
measuredLines: catTickMaxLines,
|
|
1133
|
+
lineHeight: catFont.size * 1.2,
|
|
1134
|
+
extra: catStaggerExtra,
|
|
1135
|
+
dateNumeric: dateNumericTicks,
|
|
1136
|
+
position: "below"
|
|
1137
|
+
}
|
|
1138
|
+
},
|
|
1139
|
+
a11y: {
|
|
1140
|
+
title: accessibleTitle(options2.title, chartString(options2, "waterfallTitle", { v1: first.label, v2: last.label })),
|
|
1141
|
+
counts: [...cases.length ? [structureCount("cases", cases.length, void 0, options2)] : []],
|
|
1142
|
+
desc: chartString(options2, "waterfallDesc", { v1: build === "down" ? chartString(options2, "buildDownClause") : "", v2: a11yDesc })
|
|
1143
|
+
},
|
|
1144
|
+
...paintWarningRules.length ? { paintWarningRules } : {},
|
|
1145
|
+
warnings: warnings2,
|
|
1146
|
+
debug: { occupied: occupied.snapshot(), decisions: [...solved.decisions, ...annResult.decisions] }
|
|
1147
|
+
},
|
|
1148
|
+
annotationLegDeficit: annResult.legDeficit,
|
|
1149
|
+
unsafeBreak,
|
|
1150
|
+
...unsafeBreak && !enforceBreakOrder2 ? { repairBreak: () => drawBridge(options2) } : {}
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
function normalizeItem(raw, i) {
|
|
1154
|
+
if (!raw?.id) throw new NormalizeError("missing-id", `items[${i}]`, "item requires an id");
|
|
1155
|
+
let type = raw.type ?? "delta", path = `items[${raw.id}]`, checkCell = raw.value !== void 0 ? normalizeCell(raw.value, `${path}.value`) : null, checkValue = checkCell === null ? null : cellValue(checkCell), segments;
|
|
1156
|
+
if (type !== "delta")
|
|
1157
|
+
raw.segments?.some((segment) => cellMeta(segment.value)?.format) && warnings.push({
|
|
1158
|
+
code: "format-ignored",
|
|
1159
|
+
severity: "warn",
|
|
1160
|
+
owner: { categoryId: raw.id },
|
|
1161
|
+
message: `item '${raw.id}': a total derives its segments; an authored segment format cannot apply`,
|
|
1162
|
+
suggest: "set the total format on value.format, or format its contributing delta segments"
|
|
1163
|
+
}), segments = [{ id: "__total", value: 0 }];
|
|
1164
|
+
else if (raw.segments && raw.segments.length > 0)
|
|
1165
|
+
segments = raw.segments.map((s, k) => {
|
|
1166
|
+
let cell = normalizeCell(s.value, `${path}.segments[${k}].value`), v = cellValue(cell);
|
|
1167
|
+
if (v === null) throw new NormalizeError("missing-value", `${path}.segments[${k}]`, "segment needs a numeric value");
|
|
1168
|
+
let meta = cellMeta(cell);
|
|
1169
|
+
return {
|
|
1170
|
+
id: s.id ?? `s${k}`,
|
|
1171
|
+
label: s.label,
|
|
1172
|
+
value: v,
|
|
1173
|
+
colorRole: s.colorRole,
|
|
1174
|
+
scenario: normalizeScenario(s.scenario ?? meta?.scenario, `${path}.segments[${k}].scenario`),
|
|
1175
|
+
fill: meta?.fill,
|
|
1176
|
+
...cellText(meta)
|
|
1177
|
+
};
|
|
1178
|
+
});
|
|
1179
|
+
else {
|
|
1180
|
+
if (checkValue === null)
|
|
1181
|
+
throw new NormalizeError("missing-value", path, "delta item needs a value or segments");
|
|
1182
|
+
let meta = checkCell === null ? null : cellMeta(checkCell);
|
|
1183
|
+
segments = [
|
|
1184
|
+
{
|
|
1185
|
+
id: "__value",
|
|
1186
|
+
value: checkValue,
|
|
1187
|
+
scenario: normalizeScenario(raw.scenario ?? meta?.scenario, `${path}.scenario`),
|
|
1188
|
+
fill: meta?.fill,
|
|
1189
|
+
...cellText(meta)
|
|
1190
|
+
}
|
|
1191
|
+
];
|
|
1192
|
+
}
|
|
1193
|
+
return {
|
|
1194
|
+
id: raw.id,
|
|
1195
|
+
label: raw.label ?? raw.id,
|
|
1196
|
+
type,
|
|
1197
|
+
date: raw.date,
|
|
1198
|
+
toBaseline: raw.toBaseline ?? !1,
|
|
1199
|
+
checkValue,
|
|
1200
|
+
...checkCell === null ? {} : { valueMeta: cellText(cellMeta(checkCell)) },
|
|
1201
|
+
segments,
|
|
1202
|
+
authoredSegments: type === "delta" && !!raw.segments?.length,
|
|
1203
|
+
scenario: normalizeScenario(raw.scenario, `${path}.scenario`),
|
|
1204
|
+
direction: raw.direction
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
function caseItem(raw, i, caseId, k) {
|
|
1208
|
+
let norm = normalizeItem({ ...raw, id: `${raw.id}:${caseId}`, value: raw.values?.[k], values: void 0 }, i);
|
|
1209
|
+
return { ...norm, label: raw.label ?? raw.id, segments: norm.segments.map((seg) => ({ ...seg, id: caseId })) };
|
|
1210
|
+
}
|
|
1211
|
+
function casePaint(k) {
|
|
1212
|
+
return seriesPaint(k, paletteRamp ? options.palette : void 0);
|
|
1213
|
+
}
|
|
1214
|
+
function segmentPaint(it, seg) {
|
|
1215
|
+
if (seg.fill) return { css: seg.fill };
|
|
1216
|
+
let identity = segmentCatalog.get(seg.id);
|
|
1217
|
+
return identity ? identityPaint(identity) : signBridge && it.type === "delta" ? tonePaint(stepTone(seg.value, it.direction)) : highlights.has(it.id) ? { token: "focus" } : it.type !== "delta" ? { token: "total" } : signSteps ? tonePaint(stepTone(seg.value, it.direction)) : paletteRamp ? seriesPaint(0, options.palette) : { token: "neutralMark" };
|
|
1218
|
+
}
|
|
1219
|
+
function identityPaint(identity) {
|
|
1220
|
+
return segmentPaints.get(identity.id) ?? rawIdentityPaint(identity);
|
|
1221
|
+
}
|
|
1222
|
+
function rawIdentityPaint(identity) {
|
|
1223
|
+
return identity.colorRole ? markRolePaint(identity.colorRole, !0) : seriesPaint(identity.slot, paletteRamp ? options.palette : void 0);
|
|
1224
|
+
}
|
|
1225
|
+
function scenarioPattern(scenario) {
|
|
1226
|
+
return scenario === "FC" ? "hatch45" : scenario === "PL" ? "outline" : void 0;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
function isSignBridge(theme, options) {
|
|
1230
|
+
return (theme.marks?.bridge ?? options.bridgeDefault) === "sign" && options.signColor !== !1;
|
|
1231
|
+
}
|
|
1232
|
+
function stepsBySign(theme, options) {
|
|
1233
|
+
let bridge = theme.marks?.bridge ?? options.bridgeDefault;
|
|
1234
|
+
return options.signColor ?? (bridge === void 0 ? options.palette === void 0 : bridge === "sign");
|
|
1235
|
+
}
|
|
1236
|
+
function stepTone(value, direction) {
|
|
1237
|
+
return value === 0 ? "neutral" : value > 0 == (direction !== "lowerIsBetter") ? "good" : "bad";
|
|
1238
|
+
}
|
|
1239
|
+
function tonePaint(tone) {
|
|
1240
|
+
return tone === "neutral" ? { token: "neutralMark" } : signedFillPaint(tone);
|
|
1241
|
+
}
|
|
1242
|
+
function connectorClaim(xa, xb, cy) {
|
|
1243
|
+
let x1 = Math.min(xa, xb) + BRIDGE_END_GAP, x2 = Math.max(xa, xb) - BRIDGE_END_GAP;
|
|
1244
|
+
return {
|
|
1245
|
+
x: x1,
|
|
1246
|
+
y: cy - 1,
|
|
1247
|
+
w: Math.max(x2 - x1, 1),
|
|
1248
|
+
h: 2
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
function sumRoundoff(values) {
|
|
1252
|
+
let roundoff = values.length * Number.EPSILON;
|
|
1253
|
+
return roundoff / (1 - roundoff) * values.reduce((sum, value) => sum + Math.abs(value), 0);
|
|
1254
|
+
}
|
|
1255
|
+
function compensatedSum(values) {
|
|
1256
|
+
let sum = 0, carry = 0;
|
|
1257
|
+
for (let value of values) {
|
|
1258
|
+
let next = sum + value;
|
|
1259
|
+
carry += Math.abs(sum) >= Math.abs(value) ? sum - next + value : value - next + sum, sum = next;
|
|
1260
|
+
}
|
|
1261
|
+
return sum + carry;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
export {
|
|
1265
|
+
layoutWaterfall
|
|
1266
|
+
};
|