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,829 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sparkLabelsRefusal
|
|
3
|
+
} from "./chunk-HTYFQHRC.js";
|
|
4
|
+
import {
|
|
5
|
+
eyebrowFont,
|
|
6
|
+
figureRole
|
|
7
|
+
} from "./chunk-QXILAMAU.js";
|
|
8
|
+
import {
|
|
9
|
+
fittedLabel,
|
|
10
|
+
stepDownFont
|
|
11
|
+
} from "./chunk-EWVKBRLV.js";
|
|
12
|
+
import {
|
|
13
|
+
withUnit
|
|
14
|
+
} from "./chunk-JETXFF3M.js";
|
|
15
|
+
import {
|
|
16
|
+
cardSize,
|
|
17
|
+
emitKpiSpark,
|
|
18
|
+
kpiSparkPeriodRowHeight,
|
|
19
|
+
kpiSparkSeries,
|
|
20
|
+
lastObservedIndex,
|
|
21
|
+
lastObservedLabel,
|
|
22
|
+
lastObservedPriority
|
|
23
|
+
} from "./chunk-NYEY6W5R.js";
|
|
24
|
+
import {
|
|
25
|
+
rowDrivenHeight
|
|
26
|
+
} from "./chunk-COYPDRJK.js";
|
|
27
|
+
import {
|
|
28
|
+
structureCount
|
|
29
|
+
} from "./chunk-B2EBEXIS.js";
|
|
30
|
+
import {
|
|
31
|
+
chipPaints
|
|
32
|
+
} from "./chunk-A3ULWR5N.js";
|
|
33
|
+
import {
|
|
34
|
+
bandFor
|
|
35
|
+
} from "./chunk-263SZKIL.js";
|
|
36
|
+
import {
|
|
37
|
+
chartSizing,
|
|
38
|
+
resolveSizing
|
|
39
|
+
} from "./chunk-GQPESFAF.js";
|
|
40
|
+
import {
|
|
41
|
+
PRIORITY,
|
|
42
|
+
composedTextRole,
|
|
43
|
+
createOccupiedIndex,
|
|
44
|
+
fitText,
|
|
45
|
+
frameTextOptions,
|
|
46
|
+
labelCtx,
|
|
47
|
+
labelsToNodes,
|
|
48
|
+
lineBox,
|
|
49
|
+
solveFrame,
|
|
50
|
+
solveLabels,
|
|
51
|
+
textCarriesUnit,
|
|
52
|
+
unitPrinted
|
|
53
|
+
} from "./chunk-2JAWQ7VV.js";
|
|
54
|
+
import {
|
|
55
|
+
differenceExample,
|
|
56
|
+
formatNonzeroWithSpec,
|
|
57
|
+
localized,
|
|
58
|
+
parseFormatExample,
|
|
59
|
+
sameScale
|
|
60
|
+
} from "./chunk-ASAON7G4.js";
|
|
61
|
+
import {
|
|
62
|
+
MINUS,
|
|
63
|
+
chartStrings,
|
|
64
|
+
formatAutomaticPercent,
|
|
65
|
+
valueSetFormatter
|
|
66
|
+
} from "./chunk-YQ2B3YVF.js";
|
|
67
|
+
import {
|
|
68
|
+
cellMeta
|
|
69
|
+
} from "./chunk-OAPCJO6W.js";
|
|
70
|
+
import {
|
|
71
|
+
KPI_HOST_TEXT,
|
|
72
|
+
KPI_VALUE_SIZE,
|
|
73
|
+
arrowHeadPath,
|
|
74
|
+
emphasisWeight,
|
|
75
|
+
panelTypeClass,
|
|
76
|
+
readerFloorPx,
|
|
77
|
+
resolveSemanticPaletteTheme,
|
|
78
|
+
resolveSurface,
|
|
79
|
+
resolveTheme,
|
|
80
|
+
textScaleOf
|
|
81
|
+
} from "./chunk-II7652VA.js";
|
|
82
|
+
import {
|
|
83
|
+
DEFAULT_TARGET,
|
|
84
|
+
NormalizeError,
|
|
85
|
+
TARGET_SIZE,
|
|
86
|
+
accessibleTitle,
|
|
87
|
+
kpiHeroSizesPx,
|
|
88
|
+
normalizeScenario,
|
|
89
|
+
resolveSize,
|
|
90
|
+
resolveSubtitle,
|
|
91
|
+
scaleTextPx
|
|
92
|
+
} from "./chunk-SGD3ZHID.js";
|
|
93
|
+
import {
|
|
94
|
+
maxOf,
|
|
95
|
+
pushAll
|
|
96
|
+
} from "./chunk-WYJEOMNY.js";
|
|
97
|
+
import {
|
|
98
|
+
defaultMeasurer
|
|
99
|
+
} from "./chunk-TXINIAFL.js";
|
|
100
|
+
|
|
101
|
+
// src/core/strings/kpi.ts
|
|
102
|
+
var EN = {
|
|
103
|
+
// reader-facing wording linked only by its consumers.
|
|
104
|
+
endingAt: ", ending at {v1}",
|
|
105
|
+
unchanged: "unchanged",
|
|
106
|
+
kpiTitle: "KPI: {v1}",
|
|
107
|
+
up: "up",
|
|
108
|
+
down: "down",
|
|
109
|
+
kpiSparkDesc: ". Trend over {v1} periods{v2}",
|
|
110
|
+
attainmentNonpositive: ", {v1} attainment not meaningful because the reference is nonpositive",
|
|
111
|
+
lowerBetterHint: " \xB7 lower is better"
|
|
112
|
+
}, DE = {
|
|
113
|
+
// reader-facing wording linked only by its consumers.
|
|
114
|
+
endingAt: " mit Endwert {v1}",
|
|
115
|
+
unchanged: "unver\xE4ndert",
|
|
116
|
+
kpiTitle: "KPI: {v1}",
|
|
117
|
+
up: "gestiegen",
|
|
118
|
+
down: "gefallen",
|
|
119
|
+
kpiSparkDesc: ". Verlauf \xFCber {v1} {v1|Periode|Perioden}{v2}",
|
|
120
|
+
attainmentNonpositive: ", Zielerreichung {v1} nicht aussagekr\xE4ftig, da die Referenz nicht positiv ist",
|
|
121
|
+
lowerBetterHint: " \xB7 niedriger ist besser"
|
|
122
|
+
}, { chartString } = chartStrings(EN, DE);
|
|
123
|
+
|
|
124
|
+
// src/core/charts/kpi/steering.ts
|
|
125
|
+
var COLUMN_GAP = 22, CARET_GAP = 6, BAR_H = 10, TICK_REACH = 5, MIN_BAR_COLUMN = 200, BAND_HERO_STEPS = [2.6, 2.4, 2.2], BAND_LARGE_HERO_PLOT = 800, BAND_MIN_PLOT = 576, BAND_RIGHT_INSET = 16, COLUMNS_BOTTOM_AIR = 11;
|
|
126
|
+
function planSteering(input) {
|
|
127
|
+
let { plot, measure } = input, rowSize = Math.max(input.labelFloor, Math.round(input.titleSize * 0.75)), rowFont = { family: input.family, size: rowSize, weight: input.regularWeight, lineHeight: 1.2 }, boldFont = { ...rowFont, weight: input.boldWeight }, scaleFont = { ...input.footnote, family: input.footnote.family ?? input.family, size: Math.max(input.footnote.size, input.labelFloor) }, cap = (font) => measure.capHeight?.(font) ?? font.size * 0.72, rowCap = cap(rowFont), rowH = measure("0", rowFont).height, pitch = Math.round(lineBox(rowFont) + 8), caretSize = rowSize * 0.44, caretW = 2 * caretSize * Math.sin(0.15 * Math.PI), caretH = caretSize * Math.cos(0.15 * Math.PI), textInset = input.comparisons.some((c) => c.caretDir) ? caretW + CARET_GAP : 0, bodyWidth = (c) => {
|
|
128
|
+
let rest = c.body.slice(c.lead.length);
|
|
129
|
+
return measure(c.lead, boldFont).width + (rest ? measure(rest, rowFont).width : 0);
|
|
130
|
+
}, bodyW = Math.max(0, maxOf(input.comparisons.map(bodyWidth))), labelW = Math.max(0, maxOf(input.comparisons.map((c) => measure(c.label, rowFont).width))), colGap = Math.round(rowSize * 0.9), compareW = input.comparisons.length === 0 ? 0 : textInset + bodyW + colGap + labelW, compareH = input.comparisons.length === 0 ? 0 : (input.comparisons.length - 1) * pitch;
|
|
131
|
+
if (compareW > plot.w) return;
|
|
132
|
+
let heroFont = (size) => ({ family: input.figure.family, size, weight: input.figure.weight, lineHeight: 1.2 }), heroWidth = (size) => input.valueText === void 0 ? 0 : measure(input.valueText, heroFont(size)).width, cardHero = Math.max(input.heroBase, Math.round(input.titleSize * 2)), fitHero = (size, width) => {
|
|
133
|
+
let s = size;
|
|
134
|
+
for (; s > input.heroMinimum && heroWidth(s) > width; ) s -= 0.5;
|
|
135
|
+
return Math.max(input.heroMinimum, s);
|
|
136
|
+
}, attainment = input.attainment, hasBoth = attainment !== void 0 && input.comparisons.length > 0, form = "stacked", heroSize = fitHero(cardHero, plot.w);
|
|
137
|
+
if (plot.w >= BAND_MIN_PLOT && input.noteLines.length === 0)
|
|
138
|
+
for (let step of plot.w >= BAND_LARGE_HERO_PLOT ? BAND_HERO_STEPS : BAND_HERO_STEPS.slice(-1)) {
|
|
139
|
+
let size = Math.max(input.heroBase, Math.round(input.titleSize * step)), heroW = input.valueText === void 0 ? 0 : heroWidth(size) + 2 * COLUMN_GAP, rest = plot.w - BAND_RIGHT_INSET - heroW - (input.comparisons.length > 0 ? compareW + (attainment ? 2 * COLUMN_GAP : 0) : 0);
|
|
140
|
+
if (attainment ? rest >= Math.max(MIN_BAR_COLUMN, plot.w / 3) : rest >= 0) {
|
|
141
|
+
form = "band", heroSize = size;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
form === "stacked" && hasBoth && plot.w - compareW - 2 * COLUMN_GAP >= MIN_BAR_COLUMN && (form = "split");
|
|
146
|
+
let requests = [], marks = [], fonts = /* @__PURE__ */ new Map(), leads = /* @__PURE__ */ new Map(), muted = /* @__PURE__ */ new Set(), owner = { categoryId: "kpi" }, atBaseline = (x, baseline, text2, font) => {
|
|
147
|
+
let m = measure(text2, font);
|
|
148
|
+
return { x, y: baseline - m.height / 2 - cap(font) / 2, w: m.width, h: m.height };
|
|
149
|
+
}, text = (id, rect, value, font, request = {}) => {
|
|
150
|
+
fonts.set(id, font), requests.push({
|
|
151
|
+
id,
|
|
152
|
+
kind: "point",
|
|
153
|
+
owner,
|
|
154
|
+
text: value,
|
|
155
|
+
lines: [value],
|
|
156
|
+
font,
|
|
157
|
+
typeRole: "label",
|
|
158
|
+
pad: 0,
|
|
159
|
+
priority: PRIORITY.endpoint,
|
|
160
|
+
candidates: [{ slot: "comparisonRow", rect, penalty: 0 }],
|
|
161
|
+
...request
|
|
162
|
+
});
|
|
163
|
+
}, rule = (id, x, y1, y2) => {
|
|
164
|
+
marks.push({ t: "line", id, x1: x, y1, x2: x, y2, stroke: { token: "neutral", tint: 0.75 }, width: 1, owner, part: "kpiRule" });
|
|
165
|
+
}, valueFont = heroFont(heroSize), heroM = input.valueText === void 0 ? void 0 : measure(input.valueText, valueFont), heroCap = cap(valueFont), valueRect, noteRect, y = input.top, firstBaseline, left = plot.x, right = plot.x + plot.w;
|
|
166
|
+
if (form === "band") {
|
|
167
|
+
right -= BAND_RIGHT_INSET, firstBaseline = y + Math.round(rowH + rowCap);
|
|
168
|
+
let barBottom = firstBaseline + Math.round(rowSize * 0.8) + BAR_H, textBottom = input.comparisons.length > 0 ? firstBaseline + compareH : barBottom, blockTop = firstBaseline - rowH, blockBottom = Math.max(textBottom + 10, attainment ? barBottom + TICK_REACH : 0);
|
|
169
|
+
if (heroM) {
|
|
170
|
+
let baseline = (firstBaseline - rowCap + textBottom) / 2 + heroCap / 2;
|
|
171
|
+
valueRect = { x: plot.x, y: baseline - heroM.height / 2 - heroCap / 2, w: heroM.width, h: heroM.height }, left = plot.x + heroM.width + COLUMN_GAP, rule("mark:kpi:rule:0", Math.round(left) + 0.5, blockTop, blockBottom), left = Math.round(left) + 0.5 + COLUMN_GAP;
|
|
172
|
+
}
|
|
173
|
+
y = blockBottom;
|
|
174
|
+
} else {
|
|
175
|
+
if (heroM && (valueRect = { x: plot.x, y, w: heroM.width, h: heroM.height }, y += heroM.height), input.noteLines.length > 0) {
|
|
176
|
+
let noteH = measure(input.noteLines[0], input.noteFont).height + (input.noteLines.length - 1) * lineBox(input.noteFont);
|
|
177
|
+
noteRect = { x: plot.x, y: y + 2, w: plot.w, h: noteH }, y += 2 + noteH;
|
|
178
|
+
}
|
|
179
|
+
let heroBaseline = valueRect ? valueRect.y + valueRect.h / 2 + heroCap / 2 : void 0;
|
|
180
|
+
firstBaseline = heroBaseline !== void 0 && input.noteLines.length === 0 ? heroBaseline + 2 * rowSize : y + Math.round(rowH + rowCap) - 6;
|
|
181
|
+
}
|
|
182
|
+
let compareEnd = left;
|
|
183
|
+
input.comparisons.forEach((comparison, index) => {
|
|
184
|
+
let baseline = firstBaseline + index * pitch, x = left + textInset, body = atBaseline(x, baseline, comparison.body, rowFont);
|
|
185
|
+
body.w = bodyWidth(comparison), text(`point:compare:${index}`, body, comparison.body, rowFont, { owner: { categoryId: "kpi", seriesId: comparison.id, segmentId: comparison.id }, claimId: `kpi:delta:${index}` }), leads.set(`point:compare:${index}`, comparison.lead);
|
|
186
|
+
let labelId = `point:compareLabel:${index}`;
|
|
187
|
+
if (text(labelId, atBaseline(x + bodyW + colGap, baseline, comparison.label, rowFont), comparison.label, rowFont, { owner: { categoryId: "kpi", seriesId: comparison.id, segmentId: comparison.id }, role: "caption" }), muted.add(labelId), comparison.caretDir) {
|
|
188
|
+
let capCy = baseline - rowCap / 2, tip = { x: left + caretW / 2, y: comparison.caretDir === "up" ? capCy - caretH / 2 : capCy + caretH / 2 };
|
|
189
|
+
marks.push({
|
|
190
|
+
t: "path",
|
|
191
|
+
id: `mark:compare:${index}:caret`,
|
|
192
|
+
d: arrowHeadPath(tip, comparison.caretDir === "up" ? -Math.PI / 2 : Math.PI / 2, caretSize),
|
|
193
|
+
fill: comparison.tone === "neutral" ? { token: "inkMuted" } : { token: comparison.tone },
|
|
194
|
+
owner: { categoryId: "kpi", seriesId: comparison.id, segmentId: comparison.id },
|
|
195
|
+
part: "caret"
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
compareEnd = x + bodyW + colGap + labelW;
|
|
199
|
+
});
|
|
200
|
+
let lastCompareBaseline = firstBaseline + compareH, attainmentLeft = plot.x, attainmentBaseline = lastCompareBaseline + (input.comparisons.length > 0 ? pitch + 1 : 0);
|
|
201
|
+
if (attainment && input.comparisons.length > 0 && form !== "stacked") {
|
|
202
|
+
let x = Math.round(compareEnd + COLUMN_GAP) + 0.5;
|
|
203
|
+
rule(
|
|
204
|
+
`mark:kpi:rule:${form === "band" && valueRect ? 1 : 0}`,
|
|
205
|
+
x,
|
|
206
|
+
firstBaseline - rowH,
|
|
207
|
+
form === "band" ? y : lastCompareBaseline + 8
|
|
208
|
+
), attainmentLeft = x + COLUMN_GAP, attainmentBaseline = firstBaseline;
|
|
209
|
+
} else form === "band" && (attainmentLeft = left, attainmentBaseline = firstBaseline);
|
|
210
|
+
let bottom = form === "band" ? y : Math.max(y, lastCompareBaseline + (input.comparisons.length > 0 ? 8 : 0));
|
|
211
|
+
if (attainment) {
|
|
212
|
+
let color = attainment.tone === "neutral" ? { token: "ink" } : { token: attainment.tone }, pctRect = atBaseline(attainmentLeft, attainmentBaseline, attainment.figure, boldFont);
|
|
213
|
+
text("point:attainment", pctRect, attainment.figure, boldFont, { owner: { categoryId: "kpi", seriesId: "attainment", segmentId: "attainment" }, claimId: "kpi:attainment", candidates: [{ slot: "attainmentRow", rect: pctRect, penalty: 0 }] });
|
|
214
|
+
let space = measure(" ", rowFont).width, labelRect = atBaseline(pctRect.x + pctRect.w + space, attainmentBaseline, attainment.label, rowFont);
|
|
215
|
+
if (text("point:attainmentLabel", labelRect, attainment.label, rowFont, { owner: { categoryId: "kpi", seriesId: "attainment", segmentId: "attainment" }, role: "caption", candidates: [{ slot: "attainmentRow", rect: labelRect, penalty: 0 }] }), muted.add("point:attainmentLabel"), attainment.pct !== null) {
|
|
216
|
+
let barW = right - attainmentLeft, domain = Math.min(200, Math.max(100, attainment.pct)), share = Math.max(0, Math.min(attainment.pct, domain)) / domain, tickX = attainmentLeft + 100 / domain * barW, barTop = attainmentBaseline + Math.round(rowSize * 0.8), owner2 = { categoryId: "kpi", seriesId: "attainment", segmentId: "attainment" };
|
|
217
|
+
marks.push({ t: "rect", id: "mark:attainment:track", rect: { x: attainmentLeft, y: barTop, w: barW, h: BAR_H }, fill: { token: "neutral", tint: input.trackTint }, owner: owner2, part: "kpiAttainmentTrack" }), share > 0 && marks.push({ t: "rect", id: "mark:attainment:bar", rect: { x: attainmentLeft, y: barTop, w: share * barW, h: BAR_H }, fill: color, owner: owner2, part: "kpiAttainmentBar" }), marks.push({ t: "line", id: "mark:attainment:tick", x1: tickX, y1: barTop - TICK_REACH, x2: tickX, y2: barTop + BAR_H + TICK_REACH, stroke: { token: "ink" }, width: 2, owner: owner2, part: "kpiAttainmentTick" });
|
|
218
|
+
let scale = "100%", scaleM = measure(scale, scaleFont), scaleX = Math.min(right - scaleM.width, Math.max(labelRect.x + labelRect.w + 8, tickX - scaleM.width / 2));
|
|
219
|
+
if (scaleX + scaleM.width <= right + 0.5 && scaleX >= labelRect.x + labelRect.w + 4) {
|
|
220
|
+
let scaleRect = atBaseline(tickX >= right - 1 ? right - scaleM.width : scaleX, attainmentBaseline, scale, scaleFont);
|
|
221
|
+
text("point:attainmentScale", scaleRect, scale, scaleFont, { owner: owner2, candidates: [{ slot: "attainmentRow", rect: scaleRect, penalty: 0 }] }), muted.add("point:attainmentScale");
|
|
222
|
+
}
|
|
223
|
+
bottom = Math.max(bottom, barTop + BAR_H + TICK_REACH);
|
|
224
|
+
} else
|
|
225
|
+
bottom = Math.max(bottom, attainmentBaseline + (rowH - rowCap));
|
|
226
|
+
}
|
|
227
|
+
return form !== "stacked" && (bottom += COLUMNS_BOTTOM_AIR), {
|
|
228
|
+
form,
|
|
229
|
+
requests,
|
|
230
|
+
marks,
|
|
231
|
+
fonts,
|
|
232
|
+
leads,
|
|
233
|
+
muted,
|
|
234
|
+
valueFont,
|
|
235
|
+
valueRect,
|
|
236
|
+
noteRect,
|
|
237
|
+
contentHeight: bottom - input.top
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/core/charts/kpi/layout.ts
|
|
242
|
+
var SPARK_SHARE = { regular: 0.3, compact: 0.2 }, SPARK_MIN_TREND = 24, KPI_SIZE = { regular: { width: 360, height: 144 }, compact: { width: 280, height: 120 } }, NOTE_GAP = 2, KPI_LABEL_PAD = 2, CARET_GAP2 = 4, CHIP_PAD_X = 8, CHIP_H = 18, CHIP_GAP = 6, CHIP_ROW_GAP = 4, CHIP_PAD_Y = 3.5, CHIP_ANATOMY = { padX: CHIP_PAD_X, gap: CHIP_GAP, h: CHIP_H }, TEXT_ANATOMY = { padX: 0, gap: 2 * CHIP_PAD_X + CHIP_GAP }, VALUE_ROW_GAP = 4;
|
|
243
|
+
function layoutKpi(authored, options = {}) {
|
|
244
|
+
let data = authored?.compare?.length === 0 ? { ...authored, compare: void 0 } : authored, warnings = sparkLabelsRefusal(data.spark), theme = resolveSemanticPaletteTheme(resolveTheme(options.theme), options.palette, warnings), compact = options.density === "compact", carets = theme.marks?.kpiCaret !== !1, sparkShare = SPARK_SHARE[compact ? "compact" : "regular"], sparkFloor = SPARK_MIN_TREND + ((data.spark?.labels?.length ?? 0) > 0 ? kpiSparkPeriodRowHeight(theme) : 0), requestedSize = resolveSize(cardSize(options, KPI_SIZE[compact ? "compact" : "regular"])), target = options.target ?? DEFAULT_TARGET, size = panelTypeClass(options) === void 0 ? { ...requestedSize, width: Math.min(requestedSize.width, 420) } : requestedSize, measure = options.measure ?? defaultMeasurer;
|
|
245
|
+
if (!data || typeof data.label != "string" || data.label.length === 0)
|
|
246
|
+
throw new NormalizeError("missing-label", "label", "kpi requires a label");
|
|
247
|
+
if (typeof data.value != "number" || !Number.isFinite(data.value))
|
|
248
|
+
throw new NormalizeError("invalid-number", "value", "kpi requires a finite numeric value");
|
|
249
|
+
if (data.delta && data.compare)
|
|
250
|
+
throw new NormalizeError("conflicting-options", "compare", "kpi accepts either delta or compare, not both");
|
|
251
|
+
if (data.compare && (data.compare.length < 1 || data.compare.length > 2))
|
|
252
|
+
throw new NormalizeError("invalid-count", "compare", "kpi compare requires one or two entries");
|
|
253
|
+
let value = data.value, valueBand = data.bands?.length ? bandFor(value, data.bands) : void 0, deltaScenario = normalizeScenario(data.delta?.scenario, "delta.scenario", "compare[].label"), example = data.format ?? options.format, spec = example ? localized(parseFormatExample(example), options.locale?.language) : void 0, referencePrinted = data.delta !== void 0 && deltaScenario === void 0 && typeof data.delta.vs == "number", printed = [value, ...referencePrinted ? [data.delta.vs] : []], changes = data.delta ? [value - Number(data.delta.vs)] : (data.compare ?? []).map((comparison) => value - Number(comparison.vs)), fmt = spec ? (v) => formatNonzeroWithSpec(v, spec) : valueSetFormatter(printed, options.locale?.language, !1, options.unit, options.target), diffSpec = example ? localized(parseFormatExample(differenceExample(example)), options.locale?.language) : void 0, fmtDiff = diffSpec ? (v) => formatNonzeroWithSpec(v, diffSpec) : valueSetFormatter(changes, options.locale?.language, !1, options.unit, options.target), fmtSigned = diffSpec ? (v) => formatNonzeroWithSpec(v, { ...diffSpec, signed: !0 }) : valueSetFormatter(changes, options.locale?.language, !0, options.unit, options.target), fmtPct = (p, signed) => {
|
|
254
|
+
let r1 = Math.round(p * 10) / 10;
|
|
255
|
+
return formatAutomaticPercent(p, Number.isInteger(r1) ? 0 : 1, signed, options.locale?.language);
|
|
256
|
+
}, derived = {};
|
|
257
|
+
valueBand && (derived.band = { tone: valueBand.tone ?? "neutral", ...valueBand.label ? { label: valueBand.label } : {} });
|
|
258
|
+
let comparisonVisuals = [], deltaText, deltaBody, caretDir, a11yDelta = "";
|
|
259
|
+
if (data.delta) {
|
|
260
|
+
let vs = data.delta.vs;
|
|
261
|
+
if (typeof vs != "number" || !Number.isFinite(vs))
|
|
262
|
+
throw new NormalizeError("invalid-number", "delta.vs", "delta.vs must be a finite number");
|
|
263
|
+
let direction = data.delta.direction ?? "higherIsBetter", refused = vs <= 0 && (data.delta.mode ?? "relative") !== "absolute", mode = refused ? "absolute" : data.delta.mode ?? "relative", deltaAbs = value - vs;
|
|
264
|
+
derived.deltaAbs = deltaAbs, refused && warnings.push({
|
|
265
|
+
code: "ref-nonpositive",
|
|
266
|
+
severity: "warn",
|
|
267
|
+
message: `delta.vs is ${vs === 0 ? "0" : "negative"} \u2014 relative delta suppressed, absolute shown`,
|
|
268
|
+
suggest: "mode: 'absolute'"
|
|
269
|
+
}), vs > 0 && (derived.deltaPct = deltaAbs / vs * 100), derived.tone = deltaAbs === 0 || direction === "neutral" ? "neutral" : deltaAbs > 0 == (direction === "higherIsBetter") ? "good" : "bad", caretDir = !carets || deltaAbs === 0 ? void 0 : deltaAbs > 0 ? "up" : "down";
|
|
270
|
+
let pct = derived.deltaPct, body = mode === "relative" ? fmtPct(pct, !0) : mode === "both" ? `${fmtPct(pct, !0)} (${fmtSigned(deltaAbs)})` : fmtSigned(deltaAbs), suffix = ` vs ${deltaScenario ?? fmt(vs)}`;
|
|
271
|
+
deltaText = `${body}${suffix}`, deltaBody = body;
|
|
272
|
+
let word = chartString(options, deltaAbs > 0 ? "up" : deltaAbs < 0 ? "down" : "unchanged"), magnitude = mode === "relative" ? fmtPct(Math.abs(pct), !1) : mode === "both" ? `${fmtPct(Math.abs(pct), !1)} (${fmtDiff(Math.abs(deltaAbs))})` : fmtDiff(Math.abs(deltaAbs));
|
|
273
|
+
a11yDelta = deltaAbs === 0 ? `, ${word}${suffix}` : `, ${word} ${magnitude}${suffix}`, derived.comparisons = [{
|
|
274
|
+
source: "delta",
|
|
275
|
+
value,
|
|
276
|
+
vs,
|
|
277
|
+
label: suffix.trim(),
|
|
278
|
+
mode,
|
|
279
|
+
deltaAbs,
|
|
280
|
+
deltaPct: derived.deltaPct ?? null,
|
|
281
|
+
tone: derived.tone,
|
|
282
|
+
state: refused ? "ref-nonpositive" : "value",
|
|
283
|
+
displayed: deltaText
|
|
284
|
+
}], direction === "lowerIsBetter" && (deltaText += chartString(options, "lowerBetterHint"));
|
|
285
|
+
}
|
|
286
|
+
if (data.compare) {
|
|
287
|
+
derived.comparisons = data.compare.map((comparison, index) => {
|
|
288
|
+
if (typeof comparison.vs != "number" || !Number.isFinite(comparison.vs))
|
|
289
|
+
throw new NormalizeError("invalid-number", `compare[${index}].vs`, "comparison reference must be finite");
|
|
290
|
+
if (typeof comparison.label != "string" || comparison.label.trim().length === 0)
|
|
291
|
+
throw new NormalizeError("missing-label", `compare[${index}].label`, "comparison label must be nonblank");
|
|
292
|
+
let label = comparison.label.trim(), refused = comparison.vs <= 0 && (comparison.mode ?? "both") !== "absolute", mode = refused ? "absolute" : comparison.mode ?? "both", deltaAbs = value - comparison.vs, deltaPct = comparison.vs > 0 ? deltaAbs / comparison.vs * 100 : null, direction = comparison.direction ?? "higherIsBetter", tone = deltaAbs === 0 || direction === "neutral" ? "neutral" : deltaAbs > 0 == (direction === "higherIsBetter") ? "good" : "bad";
|
|
293
|
+
refused && warnings.push({
|
|
294
|
+
code: "ref-nonpositive",
|
|
295
|
+
severity: "warn",
|
|
296
|
+
message: `compare[${index}].vs is nonpositive \u2014 relative delta suppressed, absolute shown`,
|
|
297
|
+
owner: { seriesId: `compare-${index}` }
|
|
298
|
+
});
|
|
299
|
+
let body = mode === "relative" ? fmtPct(deltaPct, !0) : mode === "both" ? `${fmtPct(deltaPct, !0)} (${fmtSigned(deltaAbs)})` : fmtSigned(deltaAbs), firstLower = direction === "lowerIsBetter" && data.compare.findIndex((entry) => entry.direction === "lowerIsBetter") === index, displayed = `${body} ${label}`, record = {
|
|
300
|
+
source: "compare",
|
|
301
|
+
value,
|
|
302
|
+
vs: comparison.vs,
|
|
303
|
+
label,
|
|
304
|
+
mode,
|
|
305
|
+
deltaAbs,
|
|
306
|
+
deltaPct,
|
|
307
|
+
tone,
|
|
308
|
+
state: refused ? "ref-nonpositive" : "value",
|
|
309
|
+
displayed
|
|
310
|
+
};
|
|
311
|
+
return comparisonVisuals.push({
|
|
312
|
+
id: `compare-${index}`,
|
|
313
|
+
text: `${displayed}${firstLower ? chartString(options, "lowerBetterHint") : ""}`,
|
|
314
|
+
body,
|
|
315
|
+
label,
|
|
316
|
+
caretDir: !carets || deltaAbs === 0 ? void 0 : deltaAbs > 0 ? "up" : "down",
|
|
317
|
+
derived: record
|
|
318
|
+
}), record;
|
|
319
|
+
});
|
|
320
|
+
let first = derived.comparisons[0];
|
|
321
|
+
derived.deltaAbs = first.deltaAbs, first.deltaPct !== null && (derived.deltaPct = first.deltaPct), derived.tone = first.tone, a11yDelta = derived.comparisons.map((comparison) => `, ${comparison.displayed}`).join("");
|
|
322
|
+
}
|
|
323
|
+
if (data.attainment) {
|
|
324
|
+
let attainment = data.attainment;
|
|
325
|
+
if (typeof attainment.vs != "number" || !Number.isFinite(attainment.vs))
|
|
326
|
+
throw new NormalizeError("invalid-number", "attainment.vs", "attainment reference must be finite");
|
|
327
|
+
if (typeof attainment.label != "string" || attainment.label.trim().length === 0)
|
|
328
|
+
throw new NormalizeError("missing-label", "attainment.label", "attainment label must be nonblank");
|
|
329
|
+
let label = attainment.label.trim(), suppressed = attainment.vs <= 0, pct = suppressed ? null : value / attainment.vs * 100;
|
|
330
|
+
suppressed && warnings.push({
|
|
331
|
+
code: "ref-nonpositive",
|
|
332
|
+
severity: "warn",
|
|
333
|
+
message: "attainment.vs is nonpositive \u2014 attainment is not meaningful",
|
|
334
|
+
owner: { seriesId: "attainment" }
|
|
335
|
+
}), derived.attainment = {
|
|
336
|
+
value,
|
|
337
|
+
vs: attainment.vs,
|
|
338
|
+
label,
|
|
339
|
+
pct,
|
|
340
|
+
// Omitted, the tone is that of the comparison against the same reference:
|
|
341
|
+
// the attainment states the same shortfall or lead.
|
|
342
|
+
tone: attainment.tone ?? (suppressed ? void 0 : derived.comparisons?.find((comparison) => comparison.vs === attainment.vs)?.tone) ?? "neutral",
|
|
343
|
+
state: suppressed ? "ref-nonpositive" : "value",
|
|
344
|
+
displayed: `${suppressed ? "n.m." : pct > 999 ? ">999%" : pct < -999 ? `<${MINUS}999%` : fmtPct(pct, !1)} ${label}`
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
let occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { top: 12, right: 12, bottom: 12, left: 12, ...options.margin }, subtitle = options.title ? resolveSubtitle(options.subtitle) ?? { measure: data.label } : resolveSubtitle(options.subtitle), frameTheme = options.title && subtitle?.measure === data.label ? { ...theme, type: { ...theme.type, subtitle: { ...theme.type.subtitle, size: Math.max(scaleTextPx(13, textScaleOf(options)), theme.type.subtitle.size) } } } : theme, frameResult = solveFrame(
|
|
348
|
+
{
|
|
349
|
+
size,
|
|
350
|
+
margin,
|
|
351
|
+
// Cards keep compact gaps at every width; see FrameInput.cardGaps.
|
|
352
|
+
cardGaps: !0,
|
|
353
|
+
...frameTextOptions(options),
|
|
354
|
+
subtitle,
|
|
355
|
+
theme: frameTheme,
|
|
356
|
+
measure
|
|
357
|
+
},
|
|
358
|
+
occupied
|
|
359
|
+
), plot = frameResult.plot, nodes = [...frameResult.nodes], kindOn = (kind) => {
|
|
360
|
+
let l = options.labels;
|
|
361
|
+
if (l === !1) return kind === "total" || kind === "category";
|
|
362
|
+
let v = l?.[kind];
|
|
363
|
+
return v === void 0 ? !0 : v !== !1;
|
|
364
|
+
}, requests = [], sparkSeries = kpiSparkSeries(data.spark), sparkVals = sparkSeries.values;
|
|
365
|
+
warnings.push(...sparkScaleRefusal(value, sparkVals));
|
|
366
|
+
let sparkDrawable = data.spark !== void 0 && sparkVals.some((v) => v !== null), sparkRect, sparkNodeId;
|
|
367
|
+
if (sparkDrawable) {
|
|
368
|
+
let sparkH = sparkHeight(size.height, plot.h, sparkShare, sparkFloor);
|
|
369
|
+
sparkRect = { x: plot.x, y: plot.y + plot.h - sparkH, w: plot.w, h: sparkH };
|
|
370
|
+
let endpointLabel = kindOn("point") ? lastObservedLabel(sparkSeries.cells) : !1, endpointPriority = kindOn("point") ? lastObservedPriority(sparkSeries.cells) : void 0, endpointIndex = lastObservedIndex(sparkVals), endpointFormat = endpointIndex === void 0 ? void 0 : cellMeta(sparkSeries.cells[endpointIndex])?.format;
|
|
371
|
+
sparkNodeId = emitKpiSpark(
|
|
372
|
+
nodes,
|
|
373
|
+
sparkRect,
|
|
374
|
+
data.spark.kind,
|
|
375
|
+
sparkVals,
|
|
376
|
+
theme,
|
|
377
|
+
options.palette,
|
|
378
|
+
fmt,
|
|
379
|
+
measure,
|
|
380
|
+
requests,
|
|
381
|
+
endpointLabel,
|
|
382
|
+
endpointPriority,
|
|
383
|
+
endpointFormat,
|
|
384
|
+
{ heroText: fmt(value), locale: options.locale?.language, ...data.spark.labels ? { periods: data.spark.labels } : {} }
|
|
385
|
+
), occupied.claim(sparkRect, "mark", { seriesId: "spark" });
|
|
386
|
+
}
|
|
387
|
+
let contentBottom = sparkRect ? sparkRect.y - 4 : plot.y + plot.h, textScale = textScaleOf(options), labelFont = eyebrowFont(theme, textScale), deltaFont = { family: theme.type.family, ...theme.type.label }, chipSize = Math.max(theme.type.footnote.size, readerFloorPx(target, "label", textScale)), chipFont = { family: theme.type.family, size: chipSize, weight: theme.type.label.weight, lineHeight: 1.2 }, chipH = Math.max(CHIP_H, Math.ceil(measure("0", chipFont).height + 2 * CHIP_PAD_Y)), textComparisons = options.comparisons === "text", compareFont = textComparisons ? deltaFont : chipFont, compareAnatomy = textComparisons ? TEXT_ANATOMY : { ...CHIP_ANATOMY, h: chipH }, figure = figureRole(theme), surface = resolveSurface(theme), chipInk = (tone) => chipPaints(theme, tone).ink, valueY = plot.y;
|
|
388
|
+
if (!options.title && kindOn("category")) {
|
|
389
|
+
let eyebrow = data.label, fitted = fitText(eyebrow, labelFont, plot.w, 2, measure, { shrink: stepDownFont(theme, labelFont, "label", target, textScale), target, textScale, typeRole: "label" }), lsize = { width: fitted.w, height: measure(fitted.lines[0] ?? "", fitted.font).height + (fitted.lines.length - 1) * lineBox(fitted.font) };
|
|
390
|
+
requests.push({
|
|
391
|
+
id: "category:label",
|
|
392
|
+
kind: "category",
|
|
393
|
+
owner: { categoryId: "kpi" },
|
|
394
|
+
text: eyebrow,
|
|
395
|
+
...fittedLabel(fitted, labelFont),
|
|
396
|
+
font: labelFont,
|
|
397
|
+
priority: PRIORITY.total,
|
|
398
|
+
candidates: [
|
|
399
|
+
{ slot: "topLeft", rect: { x: plot.x, y: plot.y, w: lsize.width, h: lsize.height }, penalty: 0 }
|
|
400
|
+
]
|
|
401
|
+
}), valueY = plot.y + lsize.height + 2;
|
|
402
|
+
}
|
|
403
|
+
let showComparisonChips = comparisonVisuals.length > 0 && kindOn("point"), showAttainmentChip = derived.attainment !== void 0 && kindOn("point"), caretSize = deltaFont.size * 0.35, caretW = 2 * caretSize * Math.sin(0.15 * Math.PI), caretH = caretSize * Math.cos(0.15 * Math.PI), caretPad = caretDir !== void 0 ? caretW + CARET_GAP2 : 0, showDelta = deltaText !== void 0 && kindOn("point"), compareCaretSize = compareFont.size * 0.35, compareCaretW = 2 * compareCaretSize * Math.sin(0.15 * Math.PI), compareCaretH = compareCaretSize * Math.cos(0.15 * Math.PI), comparisonItems = showComparisonChips ? comparisonVisuals.map((visual) => ({
|
|
404
|
+
text: visual.text,
|
|
405
|
+
caretPad: visual.caretDir ? compareCaretW + CARET_GAP2 : 0
|
|
406
|
+
})) : [], packed = planChips([...comparisonItems, ...showAttainmentChip ? [{ text: derived.attainment.displayed, caretPad: 0 }] : []], compareFont, plot.w, measure, compareAnatomy), packAttainment = showComparisonChips && showAttainmentChip && packed.naturalWidth <= plot.w, comparisonBlock = packAttainment ? packed : planChips(comparisonItems, compareFont, plot.w, measure, compareAnatomy), attainmentBlock = packAttainment ? { slots: [packed.slots[comparisonItems.length]], height: 0, naturalWidth: 0 } : planChips(showAttainmentChip ? [{ text: derived.attainment.displayed, caretPad: 0 }] : [], compareFont, plot.w, measure, compareAnatomy), comparisonRowH = comparisonBlock.height, attainmentRowH = attainmentBlock.height, attainmentGap = !packAttainment && showAttainmentChip && (showDelta || showComparisonChips) ? CHIP_ROW_GAP : 0, valueGap = showDelta || showComparisonChips || showAttainmentChip ? VALUE_ROW_GAP : 0, unit = options.unit?.trim(), around = [
|
|
407
|
+
...frameResult.nodes.flatMap((node) => node.t === "text" ? node.lines : []),
|
|
408
|
+
...!options.title && kindOn("category") ? [data.label] : [],
|
|
409
|
+
data.note?.trim(),
|
|
410
|
+
fmt(value),
|
|
411
|
+
...options[KPI_HOST_TEXT] ?? []
|
|
412
|
+
], unitBeside = unit && !unitPrinted({ subtitle, unit, unitShown: options.unitShown }) && !around.some((text) => typeof text == "string" && textCarriesUnit(text, unit)) ? unit : void 0, valueText = withUnit(fmt(value), unitBeside), hero = kpiHeroSizesPx(target, theme.type.title.size, textScale), baseSize = options?.[KPI_VALUE_SIZE] ?? hero.preferred, minimumValue = measure(valueText, { family: figure.family, size: hero.minimum, weight: figure.weight, lineHeight: 1.2 }), minimumValueH = minimumValue.height, deltaFloor = readerFloorPx(target, "label", textScale), deltaWidth = Math.max(4, plot.w - caretPad), deltaSuffix = deltaBody === void 0 ? "" : deltaText.slice(deltaBody.length).trim(), deltaWrapped = !showDelta || measure(deltaText, deltaFont).width <= deltaWidth ? [] : measure(deltaBody, deltaFont).width <= deltaWidth && measure(deltaSuffix, deltaFont).width <= deltaWidth ? [deltaBody, deltaSuffix] : wrapWhole(deltaText, deltaFont, deltaWidth, measure), deltaOneLine = deltaText === void 0 ? [] : [deltaText], deltaLines = deltaWrapped.length === 2 ? deltaWrapped : deltaOneLine, deltaBlock = (font, lines = deltaLines) => ({
|
|
413
|
+
w: Math.max(...lines.map((line) => measure(line, font).width)),
|
|
414
|
+
h: measure(lines[0], font).height + (lines.length - 1) * lineBox(font)
|
|
415
|
+
}), minimumDeltaH = showDelta ? deltaBlock({ ...deltaFont, size: Math.min(deltaFloor, deltaFont.size) }, deltaOneLine).h : 0, comparisonH = valueGap + comparisonRowH + attainmentRowH + attainmentGap, noteFont = { family: theme.type.family, ...theme.type.footnote }, noteLines = data.note === void 0 ? [] : wrapWhole(data.note.trim(), noteFont, plot.w, measure), noteBlockH = noteLines.length === 0 ? 0 : NOTE_GAP + measure(noteLines[0], noteFont).height + (noteLines.length - 1) * lineBox(noteFont), hostPanel = options[KPI_HOST_TEXT] !== void 0, steer = options.comparisons === void 0 && !hostPanel && !compact && !sparkDrawable && data.delta === void 0 && kindOn("point") && (comparisonVisuals.length > 0 || derived.attainment !== void 0) ? planSteering({
|
|
416
|
+
plot,
|
|
417
|
+
top: valueY,
|
|
418
|
+
titleSize: theme.type.title.size,
|
|
419
|
+
family: theme.type.family,
|
|
420
|
+
regularWeight: theme.type.label.weight ?? 400,
|
|
421
|
+
boldWeight: figure.weight,
|
|
422
|
+
figure,
|
|
423
|
+
heroMinimum: hero.minimum,
|
|
424
|
+
heroBase: baseSize,
|
|
425
|
+
labelFloor: deltaFloor,
|
|
426
|
+
footnote: { family: theme.type.family, ...theme.type.footnote },
|
|
427
|
+
...kindOn("total") ? { valueText } : {},
|
|
428
|
+
noteLines,
|
|
429
|
+
noteFont,
|
|
430
|
+
comparisons: comparisonVisuals.map((visual) => {
|
|
431
|
+
let firstLower = visual.text.length > visual.derived.displayed.length ? visual.text.slice(visual.derived.displayed.length) : "";
|
|
432
|
+
return {
|
|
433
|
+
id: visual.id,
|
|
434
|
+
body: visual.body,
|
|
435
|
+
lead: visual.body.split(" (")[0],
|
|
436
|
+
label: `${visual.label}${firstLower}`,
|
|
437
|
+
...visual.caretDir ? { caretDir: visual.caretDir } : {},
|
|
438
|
+
tone: visual.derived.tone
|
|
439
|
+
};
|
|
440
|
+
}),
|
|
441
|
+
...derived.attainment ? { attainment: {
|
|
442
|
+
pct: derived.attainment.pct,
|
|
443
|
+
figure: derived.attainment.displayed.slice(0, -derived.attainment.label.length - 1),
|
|
444
|
+
label: derived.attainment.label,
|
|
445
|
+
tone: derived.attainment.tone
|
|
446
|
+
} } : {},
|
|
447
|
+
measure,
|
|
448
|
+
trackTint: surface.chipTint
|
|
449
|
+
}) : void 0, steerChrome = cardChromeHeight(size.height, plot.y, margin.bottom, frameResult.nodes), steerHeight = steer ? Math.ceil(steerChrome + (valueY - plot.y) + steer.contentHeight) : 0;
|
|
450
|
+
if (steer) {
|
|
451
|
+
let grow = rowDrivenHeight({ options, width: size.width, height: size.height, chromeH: 0, rowsH: steerHeight });
|
|
452
|
+
if (grow !== void 0) return layoutKpi(data, { ...options, size: { width: size.width, height: grow } });
|
|
453
|
+
size.height < steerHeight - 0.5 && options[TARGET_SIZE]?.fixed.height !== !1 && (steer = void 0);
|
|
454
|
+
}
|
|
455
|
+
let minHeight, naturalHeight, valueFont, fittedComparisons = [], fittedAttainment;
|
|
456
|
+
if (steer) {
|
|
457
|
+
minHeight = steerHeight, naturalHeight = steerHeight, valueFont = steer.valueFont, steer.valueRect && kindOn("total") && requests.push({
|
|
458
|
+
id: "total:value",
|
|
459
|
+
kind: "total",
|
|
460
|
+
owner: { categoryId: "kpi" },
|
|
461
|
+
text: valueText,
|
|
462
|
+
lines: [valueText],
|
|
463
|
+
font: valueFont,
|
|
464
|
+
typeRole: "kpiValue",
|
|
465
|
+
priority: PRIORITY.grandTotal,
|
|
466
|
+
candidates: [{ slot: "main", rect: steer.valueRect, penalty: 0 }]
|
|
467
|
+
}), steer.noteRect && requests.push({
|
|
468
|
+
id: "note:kpi",
|
|
469
|
+
kind: "category",
|
|
470
|
+
role: "note",
|
|
471
|
+
typeRole: "footnote",
|
|
472
|
+
pad: 0,
|
|
473
|
+
owner: { categoryId: "kpi" },
|
|
474
|
+
text: data.note.trim(),
|
|
475
|
+
lines: noteLines,
|
|
476
|
+
font: noteFont,
|
|
477
|
+
priority: PRIORITY.total,
|
|
478
|
+
candidates: [{ slot: "belowValue", rect: steer.noteRect, penalty: 0 }]
|
|
479
|
+
}), pushAll(requests, steer.requests), pushAll(nodes, steer.marks);
|
|
480
|
+
for (let mark of steer.marks)
|
|
481
|
+
mark.t === "rect" && occupied.claim(mark.rect, "mark", mark.owner, mark.part);
|
|
482
|
+
} else {
|
|
483
|
+
let minimumContentH = valueY - plot.y + minimumValueH + noteBlockH + minimumDeltaH + comparisonH + (sparkDrawable ? 4 : 0), chromeHeight = cardChromeHeight(size.height, plot.y, margin.bottom, frameResult.nodes);
|
|
484
|
+
minHeight = minimumCardHeight(chromeHeight, minimumContentH, sparkDrawable, sparkShare, sparkFloor);
|
|
485
|
+
let naturalValueH = fitValueText(valueText, baseSize, hero.minimum, figure, plot.w, 1 / 0, measure).vsize.height, naturalWith = (lines) => minimumCardHeight(
|
|
486
|
+
chromeHeight,
|
|
487
|
+
minimumContentH - minimumValueH - minimumDeltaH + naturalValueH + (showDelta ? deltaBlock(deltaFont, lines).h : 0),
|
|
488
|
+
sparkDrawable,
|
|
489
|
+
sparkShare,
|
|
490
|
+
sparkFloor
|
|
491
|
+
), wrappedNatural = naturalWith(deltaLines);
|
|
492
|
+
naturalHeight = options[TARGET_SIZE]?.fixed.height === !1 || size.height >= wrappedNatural - 0.5 ? wrappedNatural : naturalWith(deltaOneLine);
|
|
493
|
+
let grow = rowDrivenHeight({ options, width: size.width, height: size.height, chromeH: 0, rowsH: naturalHeight });
|
|
494
|
+
if (grow !== void 0) return layoutKpi(data, { ...options, size: { width: size.width, height: grow } });
|
|
495
|
+
let deltaBandH = contentBottom - valueY - minimumValueH - noteBlockH - comparisonH, stepDelta = (font) => {
|
|
496
|
+
for (; showDelta && font.size > deltaFloor && deltaBlock(font).h > deltaBandH; ) font = { ...font, size: font.size - 0.5 };
|
|
497
|
+
return font;
|
|
498
|
+
}, wrappedFont = stepDelta(deltaFont);
|
|
499
|
+
deltaLines.length === 2 && deltaBlock(wrappedFont).h > deltaBandH && (deltaLines = deltaOneLine), deltaFont = deltaLines.length === 2 ? wrappedFont : stepDelta(deltaFont);
|
|
500
|
+
let deltaRowH = showDelta ? deltaBlock(deltaFont).h : 0, valueBottom = contentBottom - deltaRowH - comparisonH - noteBlockH, fitted = fitValueText(valueText, baseSize, hero.minimum, figure, plot.w, valueBottom - valueY, measure);
|
|
501
|
+
valueFont = fitted.valueFont;
|
|
502
|
+
let vsize = fitted.vsize, valueRect = { x: plot.x, y: valueY, w: vsize.width, h: vsize.height }, noteRect = noteLines.length === 0 ? void 0 : {
|
|
503
|
+
x: plot.x,
|
|
504
|
+
y: valueRect.y + valueRect.h + NOTE_GAP,
|
|
505
|
+
w: plot.w,
|
|
506
|
+
h: noteBlockH - NOTE_GAP
|
|
507
|
+
}, rowTop = valueRect.y + valueRect.h + noteBlockH + valueGap, comparisonRowY = showComparisonChips ? rowTop : void 0, attainmentRowY = showAttainmentChip ? packAttainment ? rowTop : rowTop + deltaRowH + comparisonRowH + attainmentGap : void 0;
|
|
508
|
+
if (kindOn("total") && requests.push({
|
|
509
|
+
id: "total:value",
|
|
510
|
+
kind: "total",
|
|
511
|
+
owner: { categoryId: "kpi" },
|
|
512
|
+
text: valueText,
|
|
513
|
+
lines: [valueText],
|
|
514
|
+
font: valueFont,
|
|
515
|
+
typeRole: "kpiValue",
|
|
516
|
+
priority: PRIORITY.grandTotal,
|
|
517
|
+
candidates: [{ slot: "main", rect: valueRect, penalty: 0 }]
|
|
518
|
+
}), deltaText !== void 0 && kindOn("point")) {
|
|
519
|
+
let dsize = deltaBlock(deltaFont), pillW = dsize.w + caretPad, candidates = [{
|
|
520
|
+
slot: "belowValue",
|
|
521
|
+
rect: { x: plot.x, y: rowTop, w: pillW, h: dsize.h },
|
|
522
|
+
penalty: 0
|
|
523
|
+
}];
|
|
524
|
+
requests.push({
|
|
525
|
+
id: "point:delta",
|
|
526
|
+
claimId: "kpi:delta:0",
|
|
527
|
+
kind: "point",
|
|
528
|
+
role: composedTextRole(deltaText),
|
|
529
|
+
typeRole: "label",
|
|
530
|
+
pad: 0,
|
|
531
|
+
owner: { categoryId: "kpi", segmentId: "delta" },
|
|
532
|
+
text: deltaText,
|
|
533
|
+
lines: deltaLines,
|
|
534
|
+
font: deltaFont,
|
|
535
|
+
priority: PRIORITY.endpoint,
|
|
536
|
+
candidates
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
if (showComparisonChips && comparisonRowY !== void 0 && comparisonVisuals.forEach((visual, index) => {
|
|
540
|
+
let slot = comparisonBlock.slots[index], rect = { x: plot.x + slot.x, y: comparisonRowY + slot.y, w: slot.w, h: slot.h };
|
|
541
|
+
fittedComparisons.push({ visual, rect, caretPad: slot.caretPad }), requests.push({
|
|
542
|
+
id: `point:compare:${index}`,
|
|
543
|
+
claimId: `kpi:delta:${index}`,
|
|
544
|
+
kind: "point",
|
|
545
|
+
role: composedTextRole(visual.text),
|
|
546
|
+
typeRole: "label",
|
|
547
|
+
pad: 0,
|
|
548
|
+
owner: { categoryId: "kpi", seriesId: visual.id, segmentId: visual.id },
|
|
549
|
+
text: visual.text,
|
|
550
|
+
lines: slot.lines,
|
|
551
|
+
font: compareFont,
|
|
552
|
+
priority: PRIORITY.endpoint,
|
|
553
|
+
candidates: [{ slot: "comparisonRow", rect, penalty: 0 }]
|
|
554
|
+
});
|
|
555
|
+
}), showAttainmentChip && attainmentRowY !== void 0) {
|
|
556
|
+
let slot = attainmentBlock.slots[0], rect = { x: plot.x + slot.x, y: attainmentRowY + slot.y, w: slot.w, h: slot.h };
|
|
557
|
+
fittedAttainment = { lines: slot.lines, rect }, requests.push({
|
|
558
|
+
id: "point:attainment",
|
|
559
|
+
claimId: "kpi:attainment",
|
|
560
|
+
kind: "point",
|
|
561
|
+
role: composedTextRole(derived.attainment.displayed),
|
|
562
|
+
typeRole: "label",
|
|
563
|
+
pad: 0,
|
|
564
|
+
owner: { categoryId: "kpi", seriesId: "attainment", segmentId: "attainment" },
|
|
565
|
+
text: derived.attainment.displayed,
|
|
566
|
+
lines: slot.lines,
|
|
567
|
+
font: compareFont,
|
|
568
|
+
priority: PRIORITY.endpoint,
|
|
569
|
+
candidates: [{ slot: "attainmentRow", rect, penalty: 0 }]
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
noteRect !== void 0 && requests.push({
|
|
573
|
+
id: "note:kpi",
|
|
574
|
+
kind: "category",
|
|
575
|
+
role: "note",
|
|
576
|
+
typeRole: "footnote",
|
|
577
|
+
pad: 0,
|
|
578
|
+
owner: { categoryId: "kpi" },
|
|
579
|
+
text: data.note.trim(),
|
|
580
|
+
lines: noteLines,
|
|
581
|
+
font: noteFont,
|
|
582
|
+
priority: PRIORITY.total,
|
|
583
|
+
candidates: [{ slot: "belowValue", rect: noteRect, penalty: 0 }]
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
let solveCtx = labelCtx(theme, size, options, {
|
|
587
|
+
measure,
|
|
588
|
+
plot,
|
|
589
|
+
labelPad: KPI_LABEL_PAD
|
|
590
|
+
}), solved = solveLabels(requests, occupied, solveCtx);
|
|
591
|
+
for (let warning of solved.warnings)
|
|
592
|
+
warning.code !== "label-hidden" || warning.owner?.segmentId !== "delta" || (warning.severity = "warn", warning.suggest = "widen the card (fewer grid columns or a wider canvas), or set delta.mode 'relative' for a shorter delta");
|
|
593
|
+
pushAll(warnings, solved.warnings);
|
|
594
|
+
for (let l of solved.placed)
|
|
595
|
+
if (!l.hidden) {
|
|
596
|
+
if (l.id === "note:kpi" && (l.ink = { token: "inkMuted" }), l.id === "category:label" && (l.ink = { token: theme.type.eyebrow?.ink ?? "inkMuted" }), l.id === "total:value" && derived.band && derived.band.tone !== "neutral" && (l.ink = { token: derived.band.tone }), l.id === "point:delta" && derived.tone && (l.ink = derived.tone === "neutral" ? { token: data.delta?.direction === "neutral" ? "ink" : "inkMuted" } : { token: derived.tone }), l.id.startsWith("point:compare:")) {
|
|
597
|
+
let index = Number(l.id.slice(14)), tone = derived.comparisons?.[index]?.tone ?? "neutral";
|
|
598
|
+
l.ink = tone === "neutral" ? { token: data.compare?.[index]?.direction === "neutral" ? "ink" : "inkMuted" } : textComparisons || steer ? { token: tone } : chipInk(tone);
|
|
599
|
+
}
|
|
600
|
+
if (l.id === "point:attainment") {
|
|
601
|
+
let tone = derived.attainment?.tone ?? "neutral";
|
|
602
|
+
l.ink = tone === "neutral" ? { token: steer ? "ink" : "inkMuted" } : textComparisons || steer ? { token: tone } : chipInk(tone);
|
|
603
|
+
}
|
|
604
|
+
steer?.muted.has(l.id) && (l.ink = { token: "inkMuted" });
|
|
605
|
+
}
|
|
606
|
+
let deltaPlaced = solved.placed.find((l) => l.id === "point:delta");
|
|
607
|
+
if (deltaPlaced && !deltaPlaced.hidden && caretDir !== void 0 && deltaText !== void 0) {
|
|
608
|
+
let pill = deltaPlaced.rect, capCy = deltaPlaced.lines.length === 1 && deltaPlaced.capHeight !== void 0 ? pill.y + pill.h / 2 : pill.y + measure(deltaText, deltaFont).ascent * 0.5, tip = {
|
|
609
|
+
x: pill.x + caretW / 2,
|
|
610
|
+
y: caretDir === "up" ? capCy - caretH / 2 : capCy + caretH / 2
|
|
611
|
+
};
|
|
612
|
+
nodes.push({
|
|
613
|
+
t: "path",
|
|
614
|
+
id: "mark:delta:caret",
|
|
615
|
+
d: arrowHeadPath(tip, caretDir === "up" ? -Math.PI / 2 : Math.PI / 2, caretSize),
|
|
616
|
+
fill: deltaPlaced.ink,
|
|
617
|
+
owner: { categoryId: "kpi", segmentId: "delta" },
|
|
618
|
+
part: "caret"
|
|
619
|
+
}), deltaPlaced.rect = { x: pill.x + caretPad, y: pill.y, w: pill.w - caretPad, h: pill.h };
|
|
620
|
+
}
|
|
621
|
+
for (let index = 0; index < fittedComparisons.length; index++) {
|
|
622
|
+
let fitted = fittedComparisons[index], placed = solved.placed.find((label) => label.id === `point:compare:${index}`);
|
|
623
|
+
if (!placed || placed.hidden) continue;
|
|
624
|
+
let pill = placed.rect, owner = placed.owner;
|
|
625
|
+
if (textComparisons || (nodes.push({
|
|
626
|
+
t: "rect",
|
|
627
|
+
id: `mark:compare:${index}:chip`,
|
|
628
|
+
rect: pill,
|
|
629
|
+
fill: chipPaints(theme, fitted.visual.derived.tone, options.palette).fill,
|
|
630
|
+
radius: surface.chipRadius,
|
|
631
|
+
owner,
|
|
632
|
+
part: "kpiChip"
|
|
633
|
+
}), occupied.claim(pill, "mark", owner, "kpiChip")), fitted.visual.caretDir) {
|
|
634
|
+
let capCy = textComparisons ? placed.lines.length === 1 && placed.capHeight !== void 0 ? pill.y + pill.h / 2 : pill.y + measure(placed.lines[0] ?? "", compareFont).ascent * 0.5 : pill.y + chipH / 2, tip = {
|
|
635
|
+
x: pill.x + compareAnatomy.padX + compareCaretW / 2,
|
|
636
|
+
y: fitted.visual.caretDir === "up" ? capCy - compareCaretH / 2 : capCy + compareCaretH / 2
|
|
637
|
+
};
|
|
638
|
+
nodes.push({
|
|
639
|
+
t: "path",
|
|
640
|
+
id: `mark:compare:${index}:caret`,
|
|
641
|
+
d: arrowHeadPath(
|
|
642
|
+
tip,
|
|
643
|
+
fitted.visual.caretDir === "up" ? -Math.PI / 2 : Math.PI / 2,
|
|
644
|
+
compareCaretSize
|
|
645
|
+
),
|
|
646
|
+
fill: placed.ink,
|
|
647
|
+
owner,
|
|
648
|
+
part: "caret"
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
placed.rect = chipTextRect(pill, placed.lines, fitted.caretPad, compareFont, measure, compareAnatomy);
|
|
652
|
+
}
|
|
653
|
+
if (fittedAttainment) {
|
|
654
|
+
let placed = solved.placed.find((label) => label.id === "point:attainment");
|
|
655
|
+
if (placed && !placed.hidden) {
|
|
656
|
+
let pill = placed.rect, owner = placed.owner;
|
|
657
|
+
textComparisons || (nodes.push({
|
|
658
|
+
t: "rect",
|
|
659
|
+
id: "mark:attainment:chip",
|
|
660
|
+
rect: pill,
|
|
661
|
+
fill: chipPaints(theme, derived.attainment.tone, options.palette).fill,
|
|
662
|
+
radius: surface.chipRadius,
|
|
663
|
+
owner,
|
|
664
|
+
part: "kpiChip"
|
|
665
|
+
}), occupied.claim(pill, "mark", owner, "kpiChip")), placed.rect = chipTextRect(pill, fittedAttainment.lines, 0, compareFont, measure, compareAnatomy);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
let allLabels = solved.placed, emittedLabels = labelsToNodes(
|
|
669
|
+
theme,
|
|
670
|
+
allLabels,
|
|
671
|
+
(l) => steer?.fonts.get(l.id) ?? (l.id === "total:value" ? valueFont : l.id === "point:delta" ? deltaFont : l.id === "spark:last" || l.id.startsWith("spark:period:") ? { family: theme.type.family, ...theme.type.axis } : l.id.startsWith("point:compare:") || l.id === "point:attainment" ? compareFont : l.id === "note:kpi" ? noteFont : labelFont)
|
|
672
|
+
).map((node) => {
|
|
673
|
+
let lead = node.t === "text" && node.id.startsWith("label:") ? steer?.leads.get(node.id.slice(6)) : void 0;
|
|
674
|
+
if (lead !== void 0 && node.t === "text" && node.lines.length === 1 && node.lines[0].startsWith(lead)) {
|
|
675
|
+
let rest = node.lines[0].slice(lead.length), comparison = derived.comparisons?.[Number(node.id.slice(20))];
|
|
676
|
+
return {
|
|
677
|
+
...node,
|
|
678
|
+
runs: [{ text: lead, weight: emphasisWeight(theme) }, ...rest ? [{ text: rest }] : []],
|
|
679
|
+
...comparison ? { display: { value: comparison.displayed } } : {}
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
if (node.id === "label:note:kpi") return { ...node, part: "kpiNote" };
|
|
683
|
+
if (node.id === "label:total:value") return { ...node, display: { value: valueText } };
|
|
684
|
+
if (node.id === "label:spark:last" && node.t === "text") return { ...node, display: { value: node.lines.join(" ") } };
|
|
685
|
+
if (node.id.startsWith("label:spark:period:") && node.t === "text") return { ...node, ink: { token: "inkMuted" }, part: "kpiSparkPeriod" };
|
|
686
|
+
if (node.id === "label:point:delta" && deltaText !== void 0)
|
|
687
|
+
return { ...node, display: { value: deltaText } };
|
|
688
|
+
if (node.id.startsWith("label:point:compare:")) {
|
|
689
|
+
let index = Number(node.id.slice(20)), comparison = derived.comparisons?.[index];
|
|
690
|
+
return comparison === void 0 ? node : { ...node, display: { value: comparison.displayed } };
|
|
691
|
+
}
|
|
692
|
+
return node.id === "label:point:attainment" && derived.attainment ? {
|
|
693
|
+
...node,
|
|
694
|
+
display: derived.attainment.state === "ref-nonpositive" ? { state: derived.attainment.displayed } : { value: derived.attainment.displayed }
|
|
695
|
+
} : node;
|
|
696
|
+
});
|
|
697
|
+
pushAll(nodes, emittedLabels);
|
|
698
|
+
let valueLabel = allLabels.find((l) => l.id === "total:value"), deltaLabel = allLabels.find((l) => l.id === "point:delta"), comparisonLabels = comparisonVisuals.map(
|
|
699
|
+
(_, index) => allLabels.find((label) => label.id === `point:compare:${index}`)
|
|
700
|
+
), attainmentLabel = allLabels.find((label) => label.id === "point:attainment");
|
|
701
|
+
if (data.delta && derived.comparisons?.[0] && (derived.comparisons[0].nodeId = deltaLabel?.nodeId), data.compare)
|
|
702
|
+
for (let index = 0; index < data.compare.length; index++)
|
|
703
|
+
derived.comparisons?.[index] && (derived.comparisons[index].nodeId = comparisonLabels[index]?.nodeId);
|
|
704
|
+
derived.attainment && (derived.attainment.nodeId = attainmentLabel?.nodeId);
|
|
705
|
+
let marks = {
|
|
706
|
+
valueNodeId: valueLabel?.nodeId ?? "label:total:value",
|
|
707
|
+
deltaNodeId: deltaLabel?.nodeId ?? comparisonLabels[0]?.nodeId,
|
|
708
|
+
comparisonNodeIds: data.compare ? comparisonLabels.flatMap((label) => label?.nodeId ? [label.nodeId] : []) : void 0,
|
|
709
|
+
attainmentNodeId: attainmentLabel?.nodeId,
|
|
710
|
+
sparkNodeId
|
|
711
|
+
}, sparkEndpoint = allLabels.find((label) => label.id === "spark:last"), sparkPhrase = sparkDrawable ? chartString(options, "kpiSparkDesc", { v1: sparkVals.length, v2: sparkEndpoint && !sparkEndpoint.hidden ? chartString(options, "endingAt", { v1: sparkEndpoint.text }) : "" }) : "", attainmentPhrase = derived.attainment ? derived.attainment.state === "ref-nonpositive" ? chartString(options, "attainmentNonpositive", { v1: derived.attainment.label }) : `, ${derived.attainment.displayed}` : "";
|
|
712
|
+
return {
|
|
713
|
+
type: "kpi",
|
|
714
|
+
size,
|
|
715
|
+
sizing: resolveSizing({ ...chartSizing("kpi", options), minWidth: 0 }, size, {
|
|
716
|
+
minWidth: size.width - plot.w + minimumValue.width,
|
|
717
|
+
minHeight,
|
|
718
|
+
// A chip row wider than the default card asks for the width it needs.
|
|
719
|
+
naturalWidth: Math.min(420, Math.max(
|
|
720
|
+
KPI_SIZE[compact ? "compact" : "regular"].width,
|
|
721
|
+
Math.ceil(margin.left + margin.right + comparisonBlock.naturalWidth)
|
|
722
|
+
)),
|
|
723
|
+
naturalHeight
|
|
724
|
+
}),
|
|
725
|
+
plot,
|
|
726
|
+
scene: nodes,
|
|
727
|
+
labels: allLabels,
|
|
728
|
+
axes: [],
|
|
729
|
+
annotations: [],
|
|
730
|
+
legend: frameResult.legend,
|
|
731
|
+
frame: frameResult.frame,
|
|
732
|
+
marks,
|
|
733
|
+
derived,
|
|
734
|
+
a11y: {
|
|
735
|
+
title: accessibleTitle(options.title, chartString(options, "kpiTitle", { v1: data.label })),
|
|
736
|
+
counts: [...sparkDrawable ? [structureCount("periods", sparkVals.length, void 0, options)] : []],
|
|
737
|
+
desc: `${data.label} ${valueText}${derived.band?.label ? `, ${derived.band.label}` : ""}${a11yDelta}${attainmentPhrase}${sparkPhrase}${noteLines.length === 0 ? "" : `. ${data.note.trim()}`}.`
|
|
738
|
+
},
|
|
739
|
+
warnings,
|
|
740
|
+
debug: { occupied: occupied.snapshot(), decisions: solved.decisions }
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
function sparkScaleRefusal(value, spark) {
|
|
744
|
+
let index = lastObservedIndex(spark);
|
|
745
|
+
return index === void 0 || sameScale([value], [spark[index]]) ? [] : [{
|
|
746
|
+
code: "spark-scale-mismatch",
|
|
747
|
+
severity: "error",
|
|
748
|
+
message: `the spark ends at ${spark[index]} and the card's value is ${value}, 1000 times or more apart, so one of them is in another unit`,
|
|
749
|
+
suggest: "give the spark values in the card's unit",
|
|
750
|
+
field: ["data", "spark", "values"]
|
|
751
|
+
}];
|
|
752
|
+
}
|
|
753
|
+
function cardChromeHeight(height, plotTop, bottomMargin, nodes) {
|
|
754
|
+
let footerTops = nodes.flatMap((node) => node.t === "text" && (node.part === "source" || node.part === "footnote") ? [node.y] : []), footerTop = Math.min(height - bottomMargin, ...footerTops);
|
|
755
|
+
return plotTop + height - footerTop + (footerTops.length > 0 ? 8 : 0);
|
|
756
|
+
}
|
|
757
|
+
function sparkHeight(canvasHeight, plotHeight, share, floor) {
|
|
758
|
+
return Math.max(floor, Math.min(Math.round(canvasHeight * share), Math.floor(plotHeight * 0.5)));
|
|
759
|
+
}
|
|
760
|
+
function minimumCardHeight(chromeHeight, contentHeight, spark, share, floor) {
|
|
761
|
+
let height = Math.ceil(chromeHeight + contentHeight);
|
|
762
|
+
for (; spark && height - chromeHeight - sparkHeight(height, height - chromeHeight, share, floor) < contentHeight; ) height++;
|
|
763
|
+
return height;
|
|
764
|
+
}
|
|
765
|
+
function planChips(items, font, width, measure, anatomy) {
|
|
766
|
+
if (items.length === 0) return { slots: [], height: 0, naturalWidth: 0 };
|
|
767
|
+
let { padX, gap } = anatomy, rowH = (text) => anatomy.h ?? measure(text, font).height, natural = items.map((item) => measure(item.text, font).width + 2 * padX + item.caretPad), naturalWidth = natural.reduce((sum, w) => sum + w, 0) + gap * (items.length - 1);
|
|
768
|
+
if (naturalWidth <= width) {
|
|
769
|
+
let x = 0, slots2 = items.map((item, index) => {
|
|
770
|
+
let slot = { x, y: 0, w: natural[index], h: rowH(item.text), lines: [item.text], caretPad: item.caretPad };
|
|
771
|
+
return x += natural[index] + gap, slot;
|
|
772
|
+
});
|
|
773
|
+
return { slots: slots2, height: maxOf(slots2.map((slot) => slot.h)), naturalWidth };
|
|
774
|
+
}
|
|
775
|
+
let y = 0;
|
|
776
|
+
return { slots: items.map((item, index) => {
|
|
777
|
+
let fits = natural[index] <= width, lines = fits ? [item.text] : wrapWhole(item.text, font, Math.max(4, width - 2 * padX - item.caretPad), measure), h = rowH(lines[0]) + (lines.length - 1) * lineBox(font), slot = { x: 0, y, w: fits ? natural[index] : width, h, lines, caretPad: item.caretPad };
|
|
778
|
+
return y += h + CHIP_ROW_GAP, slot;
|
|
779
|
+
}), height: y - CHIP_ROW_GAP, naturalWidth };
|
|
780
|
+
}
|
|
781
|
+
function wrapWhole(text, font, width, measure) {
|
|
782
|
+
let lines = [], current = "", fits = (candidate) => measure(candidate, font).width <= width;
|
|
783
|
+
for (let word of text.split(/\s+/).filter(Boolean)) {
|
|
784
|
+
let joined = current ? `${current} ${word}` : word;
|
|
785
|
+
if (fits(joined)) {
|
|
786
|
+
current = joined;
|
|
787
|
+
continue;
|
|
788
|
+
}
|
|
789
|
+
current && lines.push(current), current = "";
|
|
790
|
+
for (let ch of Array.from(word))
|
|
791
|
+
current && !fits(current + ch) && (lines.push(current), current = ""), current += ch;
|
|
792
|
+
}
|
|
793
|
+
return current && lines.push(current), lines.length > 0 ? lines : [""];
|
|
794
|
+
}
|
|
795
|
+
function chipTextRect(pill, lines, caretPad, font, measure, anatomy) {
|
|
796
|
+
let first = measure(lines[0] ?? "", font);
|
|
797
|
+
return {
|
|
798
|
+
x: pill.x + anatomy.padX + caretPad,
|
|
799
|
+
y: pill.y + ((anatomy.h ?? first.height) - first.height) / 2,
|
|
800
|
+
w: Math.max(...lines.map((line) => measure(line, font).width)),
|
|
801
|
+
h: first.height + (lines.length - 1) * lineBox(font)
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
function fitValueText(valueText, baseSize, minimum, figure, width, height, measure) {
|
|
805
|
+
let valueFont = { family: figure.family, size: baseSize, weight: figure.weight, lineHeight: 1.2 }, vsize = measure(valueText, valueFont), availH = Math.max(10, height), scale = Math.min(1, width / vsize.width, availH / vsize.height);
|
|
806
|
+
if (scale < 1) {
|
|
807
|
+
let s = Math.max(minimum, Math.floor(baseSize * scale * 2) / 2);
|
|
808
|
+
for (valueFont = { ...valueFont, size: s }, vsize = measure(valueText, valueFont); s > minimum && (vsize.width > width || vsize.height > availH); )
|
|
809
|
+
s -= 0.5, valueFont = { ...valueFont, size: s }, vsize = measure(valueText, valueFont);
|
|
810
|
+
}
|
|
811
|
+
return { valueFont, vsize };
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// src/core/charts/kpi/core.ts
|
|
815
|
+
var kpiCore = {
|
|
816
|
+
type: "kpi",
|
|
817
|
+
sizing: chartSizing("kpi"),
|
|
818
|
+
title: "KPI card",
|
|
819
|
+
summary: "Single-metric card: label, big value, up to two comparison pills, optional attainment, shape-only line/area/column sparkline with last observed value labelled",
|
|
820
|
+
layout: layoutKpi,
|
|
821
|
+
// comparisons has no default: omitted, a standalone card draws the steering
|
|
822
|
+
// form (steering.ts) and a grid panel, a compact card or a card with a spark draws chips.
|
|
823
|
+
defaults: { density: "regular" },
|
|
824
|
+
annotationKinds: []
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
export {
|
|
828
|
+
kpiCore
|
|
829
|
+
};
|