boardplot 0.53.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +475 -0
- package/README.md +15 -14
- package/dist/{ReaderBox-VOJSJ66R.js → ReaderBox-3FFPHWSI.js} +15 -10
- package/dist/{annotateEngine-DLMFJZ67.js → annotateEngine-ET4DM2OK.js} +5 -1
- package/dist/build-identity.json +3 -3
- package/dist/{chunk-SS42FJVN.js → chunk-2ALFFOKB.js} +460 -148
- package/dist/chunk-2BP6X5GX.js +125 -0
- package/dist/chunk-2C4SYWZ3.js +25 -0
- package/dist/{chunk-7X2ZYVAX.js → chunk-2TAK2ELB.js} +3 -3
- package/dist/{chunk-XZOHR765.js → chunk-2YNF6AHH.js} +5 -5
- package/dist/{chunk-DDI2W4TR.js → chunk-32IKJMUF.js} +3 -3
- package/dist/{chunk-ADKCLH3Z.js → chunk-33FCWTGT.js} +1 -1
- package/dist/{chunk-AQROQDLR.js → chunk-37A6CLR5.js} +1729 -196
- package/dist/{chunk-DCTCUZ5L.js → chunk-3AJY353W.js} +3 -3
- package/dist/chunk-3B3CFJ2H.js +48 -0
- package/dist/{chunk-M4EUXOLU.js → chunk-3B3K7TD5.js} +83 -9
- package/dist/{chunk-QSXK6PJL.js → chunk-3C24WWUQ.js} +1 -1
- package/dist/{chunk-BWTX7LUG.js → chunk-3L2VXXM4.js} +9 -4
- package/dist/{chunk-DO5OZJAO.js → chunk-3OZRODC4.js} +39 -21
- package/dist/{chunk-A6CQPJWR.js → chunk-3XOWXLLQ.js} +6 -7
- package/dist/{chunk-TBGUEF3M.js → chunk-3ZAH24P6.js} +164 -51
- package/dist/{chunk-TGK6KUGN.js → chunk-4CJ6UCX4.js} +33 -16
- package/dist/{chunk-VDAZPGR2.js → chunk-4DZFR52I.js} +2 -2
- package/dist/{chunk-323YZWYJ.js → chunk-4WT3T5SH.js} +124 -54
- package/dist/{chunk-O3S2KNIW.js → chunk-4X3HNETE.js} +3 -3
- package/dist/{chunk-FBB4BWKN.js → chunk-4Y7BA2NW.js} +4 -4
- package/dist/{chunk-AWTG3RFF.js → chunk-4YHZSPAJ.js} +6 -7
- package/dist/{chunk-CNX7EGSU.js → chunk-5DMHMQFP.js} +7 -7
- package/dist/{chunk-BPKXEMRE.js → chunk-5SHI57XD.js} +45 -14
- package/dist/{chunk-H63XQ3OO.js → chunk-5SLJGRUO.js} +139 -47
- package/dist/{chunk-5LYXD6ME.js → chunk-5UVJKB7L.js} +137 -70
- package/dist/{chunk-ZNHFLJSY.js → chunk-63L35UCI.js} +6 -6
- package/dist/{chunk-YCNLQYTC.js → chunk-6C64IBOG.js} +5 -5
- package/dist/{chunk-N3TPMXS3.js → chunk-6D4EO3S7.js} +5 -5
- package/dist/chunk-6H3OSHEY.js +25 -0
- package/dist/chunk-6WZZADRL.js +25 -0
- package/dist/{chunk-6RBTTCQD.js → chunk-75TWO5B2.js} +89 -57
- package/dist/chunk-7ADUVRG5.js +14 -0
- package/dist/{chunk-3QWZAEW5.js → chunk-7DAH2E4T.js} +4 -3
- package/dist/{chunk-VKQNDOAI.js → chunk-7FKY6YWU.js} +11 -7
- package/dist/{chunk-NSSNYY6Y.js → chunk-7GVYMGLK.js} +6 -3
- package/dist/{chunk-KZS46KDY.js → chunk-7Q2WV6D2.js} +3 -3
- package/dist/{chunk-JFBEAUJ6.js → chunk-7Q37C6GZ.js} +1 -1
- package/dist/{chunk-SPTPFY4S.js → chunk-7UPZPFHQ.js} +41 -34
- package/dist/{chunk-V6O6KVOA.js → chunk-7Z73MM35.js} +14 -6
- package/dist/{chunk-MJZHFH5R.js → chunk-AB35GVPG.js} +80 -31
- package/dist/{chunk-MYMT5KJL.js → chunk-AF7EB6N6.js} +151 -84
- package/dist/chunk-AIU4GZV5.js +24 -0
- package/dist/{chunk-KSJVENRU.js → chunk-AM2CG7VX.js} +13 -3
- package/dist/{chunk-XN4ARQ2W.js → chunk-APQPYM2Z.js} +3 -3
- package/dist/{chunk-AHQ4L3BE.js → chunk-AZM4YNRE.js} +2 -2
- package/dist/{chunk-XXOHXA3A.js → chunk-B3AXM3MT.js} +2 -2
- package/dist/{chunk-BWGRWGVA.js → chunk-BDGLMWPO.js} +14 -14
- package/dist/{chunk-EHBB2Z4D.js → chunk-BFFPYT3Y.js} +13 -7
- package/dist/{chunk-2QT5ZUHO.js → chunk-BGJRCG7N.js} +135 -114
- package/dist/{chunk-RNOJSEES.js → chunk-BK6P6KMW.js} +1 -1
- package/dist/{chunk-XB4KZ6WO.js → chunk-BSATR6ZO.js} +40 -13
- package/dist/{chunk-4UVW5WU6.js → chunk-BVYIKLQ5.js} +1 -1
- package/dist/chunk-BWVNCLUS.js +19 -0
- package/dist/{chunk-LCWJS34U.js → chunk-CKNOLGRR.js} +1 -1
- package/dist/chunk-CLGUFVHM.js +24 -0
- package/dist/{chunk-NY5NUFDZ.js → chunk-COQEHO7B.js} +3 -3
- package/dist/{chunk-3EZRM4YM.js → chunk-CPGASWNN.js} +25 -1
- package/dist/{chunk-GTG3IGLF.js → chunk-CVIW2MV4.js} +284 -150
- package/dist/chunk-CYKIX3IQ.js +24 -0
- package/dist/{chunk-DIHUGBZO.js → chunk-CZ3WCG55.js} +5 -4
- package/dist/{chunk-DRTA6JG5.js → chunk-D2B3KP35.js} +26 -15
- package/dist/{chunk-6OCR6ITN.js → chunk-D2QMNHCC.js} +4 -5
- package/dist/{chunk-EUADDXAV.js → chunk-D7G27EYZ.js} +4 -4
- package/dist/{chunk-NOSDEJ3K.js → chunk-DB2JKPOX.js} +806 -69
- package/dist/{chunk-2CVH5E57.js → chunk-DEYAI662.js} +60 -13
- package/dist/{chunk-HA4IPWMM.js → chunk-DRHQG44U.js} +23 -5
- package/dist/{chunk-WZGJSQKN.js → chunk-DZ3S4RPI.js} +15 -1
- package/dist/{chunk-B6GFKYBZ.js → chunk-E44W4EEG.js} +8 -5
- package/dist/{chunk-YCRGWQBS.js → chunk-E5OEWMNX.js} +66 -12
- package/dist/chunk-E6HDUEGK.js +26 -0
- package/dist/{chunk-A7IEVBYI.js → chunk-E76U5H52.js} +1 -5
- package/dist/{chunk-NKIYLFXZ.js → chunk-EAR43REB.js} +213 -73
- package/dist/{chunk-NQDVMUHX.js → chunk-EBC5TMI2.js} +29 -8
- package/dist/chunk-EBVJCVXL.js +25 -0
- package/dist/chunk-EC2PGJ64.js +24 -0
- package/dist/chunk-EGPXEY2K.js +24 -0
- package/dist/{chunk-CUVUDK4O.js → chunk-EQRFSVDD.js} +2 -1
- package/dist/{chunk-CYOJZ3GQ.js → chunk-EW47LNWH.js} +228 -58
- package/dist/{chunk-7EVIIADO.js → chunk-EXDMYV5W.js} +3 -1
- package/dist/{chunk-VJ3FCGQF.js → chunk-EZZ533MH.js} +1 -1
- package/dist/{chunk-IBXXZVG7.js → chunk-F5V7YFKS.js} +11 -8
- package/dist/{chunk-COYOTQC2.js → chunk-F6CVYNDY.js} +5 -4
- package/dist/{chunk-66RFKRGO.js → chunk-F6OLHND5.js} +2 -2
- package/dist/chunk-FI5EXISD.js +27 -0
- package/dist/{chunk-CAQ5P4VN.js → chunk-FQF7GSJK.js} +46 -27
- package/dist/{chunk-XJP5DKIL.js → chunk-FS6ZE5TG.js} +2 -2
- package/dist/{chunk-7CTKTIPF.js → chunk-G63WXSQP.js} +75 -34
- package/dist/{chunk-3A2IEBCN.js → chunk-GCSCHK5Y.js} +4 -18
- package/dist/{chunk-REOPXBUR.js → chunk-GD5TYS5R.js} +32 -21
- package/dist/{chunk-RGZGLKFB.js → chunk-GDVR3XHT.js} +418 -62
- package/dist/{chunk-XQCQZBGX.js → chunk-GDZI5ZJ7.js} +1 -1
- package/dist/{chunk-P5RNWMZC.js → chunk-GFIT3FRE.js} +277 -291
- package/dist/chunk-GM2HIU6C.js +24 -0
- package/dist/{chunk-DOFYKPTC.js → chunk-GMJFCBR6.js} +1 -1
- package/dist/{chunk-CRNMNZJD.js → chunk-H3AEYPRP.js} +66 -43
- package/dist/{chunk-BUPLB3EX.js → chunk-H3IBJQ5A.js} +6 -2
- package/dist/chunk-H4VDQ7OE.js +24 -0
- package/dist/{chunk-J6I2YFJH.js → chunk-H5L2P2GO.js} +6 -4
- package/dist/{chunk-X4YNDLVA.js → chunk-HFRQLMKK.js} +12 -7
- package/dist/{chunk-YG5GUELW.js → chunk-HGT3UKDW.js} +91 -48
- package/dist/{chunk-CWDHCSL2.js → chunk-HJRNBKIT.js} +801 -76
- package/dist/{chunk-FV3VF36K.js → chunk-HLOXWM2O.js} +119 -63
- package/dist/{chunk-3SQCCESO.js → chunk-HR2BKLS3.js} +113 -128
- package/dist/{chunk-S4QSJAGY.js → chunk-HZUAEMN5.js} +1 -1
- package/dist/{chunk-QWXWVPNE.js → chunk-IF2ZABAM.js} +2 -2
- package/dist/chunk-IF76JRXT.js +24 -0
- package/dist/chunk-IGNBQT23.js +248 -0
- package/dist/{chunk-DCCJRLAJ.js → chunk-IGVAWAOK.js} +31 -96
- package/dist/{chunk-DDCB7ZA5.js → chunk-ILFQ75N4.js} +253 -141
- package/dist/chunk-INHDHZNP.js +8 -0
- package/dist/chunk-IOKWBUQP.js +25 -0
- package/dist/{chunk-33PB4V6K.js → chunk-IQDMZ33D.js} +20 -9
- package/dist/{chunk-IDDA5INB.js → chunk-IVRYF7QA.js} +7 -4
- package/dist/{chunk-L7RHB734.js → chunk-J5PL6JLL.js} +1 -1
- package/dist/chunk-JBMWRXDS.js +24 -0
- package/dist/{chunk-RPIW5T55.js → chunk-JKOEHRGV.js} +1 -1
- package/dist/chunk-JMGB444D.js +26 -0
- package/dist/chunk-JU7S52HI.js +26 -0
- package/dist/{chunk-BBL3R5YZ.js → chunk-JXBZIJCG.js} +1 -1
- package/dist/{chunk-WLZ54FWG.js → chunk-JYAZPMSA.js} +70 -1
- package/dist/chunk-K5S3K6QK.js +24 -0
- package/dist/{chunk-5LGSRWFC.js → chunk-KAYBRD4F.js} +3 -3
- package/dist/{chunk-N3G2FYDL.js → chunk-KC52E5G4.js} +31 -20
- package/dist/{chunk-LNKY5Z2X.js → chunk-KDSYZLF6.js} +2 -3
- package/dist/{chunk-B67K6OWJ.js → chunk-KEDNHCGB.js} +4 -4
- package/dist/chunk-KFGZMHIB.js +28 -0
- package/dist/{chunk-KPKXJYQH.js → chunk-KHRAJDBM.js} +1 -1
- package/dist/{chunk-2V6CLH33.js → chunk-KND4OM4B.js} +117 -102
- package/dist/{chunk-X6SUFTD7.js → chunk-KZH2QI6S.js} +2 -2
- package/dist/{chunk-IYEFEBRN.js → chunk-KZJ5VM6E.js} +14 -3
- package/dist/{chunk-JSEYUJUQ.js → chunk-LA5OYJ5P.js} +146 -69
- package/dist/{chunk-MVV6RQMG.js → chunk-LAVVML3X.js} +33 -9
- package/dist/{chunk-4G2O2ZPJ.js → chunk-LD4LML5P.js} +10 -8
- package/dist/{chunk-OURX73UJ.js → chunk-LF6RTFNK.js} +13 -11
- package/dist/{chunk-SVZDXFPX.js → chunk-LFUJTEJO.js} +100 -36
- package/dist/{chunk-53OYF4ZT.js → chunk-LHKDZAWN.js} +16 -8
- package/dist/{chunk-GCBOHVDZ.js → chunk-LLDKKEUD.js} +1 -1
- package/dist/{chunk-VTEV3WVF.js → chunk-LRCO4G7C.js} +314 -92
- package/dist/{chunk-5HECRVXJ.js → chunk-LSF76AS3.js} +7 -3
- package/dist/chunk-M427S3G7.js +25 -0
- package/dist/{chunk-ZMF7WEGG.js → chunk-MEMPP7VZ.js} +3 -3
- package/dist/{chunk-D7SHZDA3.js → chunk-MJMOKPTF.js} +186 -167
- package/dist/chunk-MLGEBFEX.js +47 -0
- package/dist/chunk-MLW72KWN.js +24 -0
- package/dist/chunk-MQYIBGZE.js +19 -0
- package/dist/{chunk-SDSONLMZ.js → chunk-MTRV3BJL.js} +301 -130
- package/dist/{chunk-H4H4O62O.js → chunk-N5HN5QGH.js} +1 -1
- package/dist/chunk-N5TZL74Y.js +53 -0
- package/dist/chunk-N7N5NIAU.js +211 -0
- package/dist/{chunk-XN7MQO45.js → chunk-NA6WLZ66.js} +66 -26
- package/dist/{chunk-B54RN2FD.js → chunk-NB7M4KX4.js} +99 -56
- package/dist/{chunk-ADWSGPH5.js → chunk-NCZWLV7T.js} +4 -4
- package/dist/{chunk-C54QLNE4.js → chunk-NGA7ICG4.js} +1 -1
- package/dist/{chunk-TJSND556.js → chunk-NHYKSPL4.js} +155 -100
- package/dist/chunk-NMTWUYUF.js +30 -0
- package/dist/{chunk-Q3CV2JJ2.js → chunk-NOCIN2EM.js} +425 -251
- package/dist/{chunk-SKRSCTT5.js → chunk-NUCYUKVH.js} +3 -3
- package/dist/{chunk-S32YYDIB.js → chunk-NVGAEQ6M.js} +4 -3
- package/dist/{chunk-N23YFPPI.js → chunk-O2KKQNGW.js} +4 -1
- package/dist/chunk-O36WX56O.js +13 -0
- package/dist/{chunk-FF23FYQD.js → chunk-O4WJWHCH.js} +187 -85
- package/dist/{chunk-H67RTX46.js → chunk-O6NJDRXE.js} +2 -2
- package/dist/{chunk-2DOR5SS6.js → chunk-O7DVW3IE.js} +141 -68
- package/dist/{chunk-2VWJ5BGO.js → chunk-O7W35PT3.js} +13 -12
- package/dist/{chunk-MF6IVSBJ.js → chunk-ODZJ4LW7.js} +6 -3
- package/dist/{chunk-FG6EDGMI.js → chunk-OHGEDG46.js} +1 -1
- package/dist/{chunk-HZI56ASJ.js → chunk-OJ2BPQGQ.js} +11 -5
- package/dist/chunk-ONKSGT2M.js +28 -0
- package/dist/{chunk-2WNYRWHG.js → chunk-OOFSQ5AS.js} +1 -1
- package/dist/{chunk-IYMI7YI4.js → chunk-OY2UJ4XK.js} +64 -42
- package/dist/{chunk-6Y7EXYLR.js → chunk-P6TA7M3G.js} +102 -32
- package/dist/{chunk-MQFCG4KS.js → chunk-PQYJZMCR.js} +99 -92
- package/dist/{chunk-BWLOXQDV.js → chunk-PYV6ZIR6.js} +41 -14
- package/dist/chunk-PZ46S2SY.js +69 -0
- package/dist/{chunk-IL5T7I2A.js → chunk-Q3E74U2W.js} +4 -4
- package/dist/{chunk-TXS3U77A.js → chunk-QBJDHFJJ.js} +4 -2
- package/dist/chunk-QBRRJ5OR.js +24 -0
- package/dist/{chunk-P6KZIZDV.js → chunk-QEP3X3OV.js} +141 -79
- package/dist/{chunk-CCCEBIUZ.js → chunk-QKWBDH2L.js} +2 -2
- package/dist/{chunk-QY5ZKUWY.js → chunk-QOWE55RR.js} +9 -3
- package/dist/{chunk-SREWFAAJ.js → chunk-QRVIS2QB.js} +6 -5
- package/dist/chunk-R27IDIJI.js +24 -0
- package/dist/{chunk-G5FMTRG5.js → chunk-RNIYG6PI.js} +2 -2
- package/dist/{chunk-PEUSKIFV.js → chunk-RO2PSSAI.js} +13 -23
- package/dist/{chunk-ZQF34VPS.js → chunk-ROLR7HRB.js} +12 -6
- package/dist/{chunk-YF2PYLC4.js → chunk-RSCRIWAH.js} +1 -1
- package/dist/{chunk-L6DJ4ZY5.js → chunk-RTXRIZYU.js} +370 -134
- package/dist/{chunk-VK5ZDV67.js → chunk-RUWNG2JC.js} +6 -5
- package/dist/chunk-RYPJB3RO.js +132 -0
- package/dist/{chunk-DAVHGK27.js → chunk-S7NRL66K.js} +46 -23
- package/dist/{chunk-VABRPZVC.js → chunk-SA46CNMS.js} +5 -1
- package/dist/{chunk-3H2W76TB.js → chunk-SBR2RLEQ.js} +72 -38
- package/dist/chunk-SC42DPNV.js +24 -0
- package/dist/{chunk-27QADBDV.js → chunk-SFG7NG23.js} +20 -3
- package/dist/{chunk-AG2CJ4JY.js → chunk-SNQ7D5R7.js} +18 -1
- package/dist/{chunk-QTZVVZ2A.js → chunk-SPSGUFTI.js} +11 -3
- package/dist/chunk-SRUV7AT6.js +51 -0
- package/dist/{chunk-F6CNPC4L.js → chunk-SZXKV3BX.js} +1 -1
- package/dist/{chunk-UB6ODJHO.js → chunk-T5Y4HXYO.js} +7 -4
- package/dist/{chunk-EJPVVGD7.js → chunk-U7W7GYXP.js} +37 -37
- package/dist/{chunk-LFX7W4B7.js → chunk-UDKYY27B.js} +1 -1
- package/dist/{chunk-24BHMKDD.js → chunk-UF3HSFAE.js} +25 -2
- package/dist/chunk-UIYXMPDW.js +24 -0
- package/dist/{chunk-N7J7CZS6.js → chunk-UNMIUILK.js} +1 -1
- package/dist/chunk-V3MSLNSD.js +24 -0
- package/dist/chunk-V634AXDM.js +31 -0
- package/dist/{chunk-57ZGVAU3.js → chunk-V7F4F6JA.js} +39 -6
- package/dist/{chunk-4X66BTP5.js → chunk-VBVG6NEL.js} +6 -6
- package/dist/chunk-VL7WLE4H.js +24 -0
- package/dist/chunk-W45AR6EW.js +94 -0
- package/dist/{chunk-RL3NUWMY.js → chunk-WALYNKBN.js} +444 -101
- package/dist/{chunk-DYS7EIXY.js → chunk-WAPCCJUB.js} +70 -26
- package/dist/{chunk-FBAYZSFC.js → chunk-WDIVAU5U.js} +241 -118
- package/dist/{chunk-EHVESNLV.js → chunk-WEMUCDPK.js} +1 -1
- package/dist/{chunk-N73IBH55.js → chunk-WFSOKGGA.js} +2 -2
- package/dist/{chunk-WI5ITCOH.js → chunk-WG5CJGLU.js} +2 -2
- package/dist/{chunk-S6UX7KB6.js → chunk-WQT6HIIY.js} +18 -17
- package/dist/{chunk-MZL6LGKO.js → chunk-WSJDLZSZ.js} +78 -47
- package/dist/{chunk-XJI6SWFS.js → chunk-WWIY6BBY.js} +77 -38
- package/dist/{chunk-33PLBIMA.js → chunk-WXJ5MHLH.js} +3 -2
- package/dist/chunk-X3YP4DUV.js +76 -0
- package/dist/{chunk-MBKZYJRC.js → chunk-X7XTIM6U.js} +50 -36
- package/dist/chunk-XJQXFVXY.js +24 -0
- package/dist/{chunk-KZJOV4QW.js → chunk-XMN3Z43K.js} +5 -5
- package/dist/{chunk-2ND7ZITT.js → chunk-XPOMQWXY.js} +90 -70
- package/dist/chunk-XVUQMZWV.js +24 -0
- package/dist/chunk-XYYRHGQI.js +24 -0
- package/dist/{chunk-NHQGRKEA.js → chunk-XZLU3G23.js} +7 -7
- package/dist/chunk-Y2CAIAUI.js +24 -0
- package/dist/{chunk-QO6HEXIZ.js → chunk-Y3L655X6.js} +6 -6
- package/dist/{chunk-QKL7IY42.js → chunk-Y54LU4CU.js} +1 -1
- package/dist/chunk-YGTNVZJE.js +89 -0
- package/dist/{chunk-LIWLBLCT.js → chunk-YLC42C3M.js} +1 -1
- package/dist/{chunk-SGD3ZHID.js → chunk-YOOHNQ3L.js} +15 -4
- package/dist/{chunk-DRW6KGBK.js → chunk-YTCIGJUU.js} +116 -42
- package/dist/{chunk-ULTSSIOU.js → chunk-YV5KYGE5.js} +1 -1
- package/dist/{chunk-4RRNJLCM.js → chunk-YXM4W3TN.js} +146 -67
- package/dist/{chunk-2L2Q53EP.js → chunk-Z2X4JQNY.js} +81 -21
- package/dist/{chunk-LS7HVBI7.js → chunk-Z5V6ZM76.js} +3 -3
- package/dist/{chunk-DU4A5AOY.js → chunk-Z7NHFNH3.js} +165 -79
- package/dist/{chunk-HOAH5XBR.js → chunk-ZBSNF5F7.js} +208 -62
- package/dist/chunk-ZGHBDMYF.js +24 -0
- package/dist/{chunk-TM4OC53S.js → chunk-ZHFUMVW7.js} +2 -1
- package/dist/{chunk-TWOREVKJ.js → chunk-ZLYQWUNR.js} +84 -50
- package/dist/chunk-ZTMZOKVC.js +61 -0
- package/dist/cli/index.js +3 -3
- package/dist/{core-LA6XDYG7.js → core-2SICIP63.js} +6 -1
- package/dist/{core-5HQBPCHL.js → core-2YTKFBNZ.js} +6 -1
- package/dist/{core-FVR3WZEC.js → core-3647Z25D.js} +5 -1
- package/dist/{core-GES44OTS.js → core-3IJPBNGC.js} +3 -1
- package/dist/{core-KKQS3WI2.js → core-6HMJHFRR.js} +9 -1
- package/dist/{core-QY7AVIKZ.js → core-7JKE7H32.js} +6 -1
- package/dist/{core-WUQVFARS.js → core-BMY7OL76.js} +6 -1
- package/dist/{core-4BZQQSHS.js → core-CAL7YNFC.js} +4 -1
- package/dist/{core-NP4VHWXL.js → core-CBEGB2NO.js} +4 -1
- package/dist/{core-C6YUSTZI.js → core-CLLIG7ZU.js} +3 -1
- package/dist/{core-MJ7JWQT5.js → core-CTZLHGXE.js} +2 -1
- package/dist/{core-UHECQHJ2.js → core-EYJ3WJK4.js} +4 -1
- package/dist/{core-ETAGQBZO.js → core-FX7HRKTF.js} +3 -1
- package/dist/{core-Z2F3IGSR.js → core-GQC6VDW5.js} +4 -1
- package/dist/{core-IKD3EE3S.js → core-GRWI22NS.js} +4 -1
- package/dist/{core-OJUQLIQ5.js → core-H7KMWYP5.js} +5 -1
- package/dist/{core-WGM4XUN3.js → core-HJUGHAX7.js} +3 -1
- package/dist/{core-V5FV4NWL.js → core-JMYMIH6Z.js} +9 -1
- package/dist/{core-GGQREDSI.js → core-KEB5PBCO.js} +6 -1
- package/dist/{core-6RYHWUJO.js → core-MEC6A5DD.js} +5 -1
- package/dist/{core-GCTFVYMH.js → core-MV6KGAUV.js} +4 -1
- package/dist/{core-MR52YBRX.js → core-NTWHFDM4.js} +3 -1
- package/dist/{core-SBQMHWTA.js → core-OIC5KJSD.js} +7 -1
- package/dist/{core-Q6VLFFYC.js → core-OWCTIPHD.js} +6 -1
- package/dist/{core-NSIJEKLI.js → core-PMYCLXT7.js} +6 -1
- package/dist/{core-EEB7HTCL.js → core-PTRQPQTO.js} +4 -1
- package/dist/{core-3VCCUFVX.js → core-QABTVASG.js} +3 -1
- package/dist/{core-AJTVU6X7.js → core-RPQBIOU4.js} +5 -1
- package/dist/{core-4VT4MHNB.js → core-SKRADU7T.js} +4 -1
- package/dist/{core-EFMVDWNH.js → core-T2KHX5LG.js} +4 -1
- package/dist/{core-PB3VUQSS.js → core-T4ZH3FAU.js} +3 -1
- package/dist/{core-JM4R426L.js → core-UAY2G7LN.js} +2 -1
- package/dist/{core-NQLNZDX5.js → core-ULZ7XUQP.js} +5 -1
- package/dist/{core-MLROKJ2M.js → core-VBR253SM.js} +4 -1
- package/dist/{core-7BZJCIXN.js → core-VMIBBHXI.js} +4 -1
- package/dist/{core-5535KXRD.js → core-XMTKUXLO.js} +4 -1
- package/dist/{core-HRYOV6QD.js → core-YEFGEW3Z.js} +4 -1
- package/dist/{dataTable-3CPPIHB3.js → dataTable-2ZXK54TP.js} +4 -2
- package/dist/{engine-FXFBCWHB.js → engine-HGXSWGOI.js} +27 -27
- package/dist/fixtures.js +7 -1
- package/dist/{fontTables-WYCZNRE7.js → fontTables-ZPZQ6IR3.js} +1 -1
- package/dist/fonts.js +2 -1
- package/dist/geo/dach.js +3 -1
- package/dist/geo/de-states.js +3 -1
- package/dist/geo/eu27.js +3 -1
- package/dist/geo/europe.js +3 -1
- package/dist/geo/index.js +4 -2
- package/dist/geo/us-states.js +3 -1
- package/dist/geo/world.js +3 -1
- package/dist/index.js +31 -26
- package/dist/{main-YLKBTHJP.js → main-PVT6FMGC.js} +55 -24
- package/dist/mcp/server.js +51 -23
- package/dist/{module-SVEW5ZUE.js → module-ZSR7KTAS.js} +1 -1
- package/dist/react/bar.js +7 -1
- package/dist/react/bartable.js +7 -1
- package/dist/react/box.js +7 -1
- package/dist/react/bullet.js +5 -1
- package/dist/react/butterfly.js +6 -1
- package/dist/react/choropleth.js +5 -1
- package/dist/react/cohort.js +5 -1
- package/dist/react/column.js +10 -1
- package/dist/react/combo.js +4 -1
- package/dist/react/creative.js +3 -1
- package/dist/react/diagram.js +4 -1
- package/dist/react/dimswitch.js +5 -1
- package/dist/react/dot.js +10 -1
- package/dist/react/export.js +34 -31
- package/dist/react/funnel.js +5 -1
- package/dist/react/gantt.js +4 -1
- package/dist/react/grid.js +5 -1
- package/dist/react/heatmap.js +5 -1
- package/dist/react/histogram.js +7 -1
- package/dist/react/index.js +95 -90
- package/dist/react/kpi.js +3 -1
- package/dist/react/likert.js +8 -1
- package/dist/react/line.js +5 -1
- package/dist/react/mekko.js +6 -1
- package/dist/react/pareto.js +4 -1
- package/dist/react/pie.js +6 -1
- package/dist/react/prepare.js +34 -28
- package/dist/react/pvm.js +5 -1
- package/dist/react/pyramid.js +6 -1
- package/dist/react/sankey.js +5 -1
- package/dist/react/scatter.js +5 -1
- package/dist/react/slope.js +7 -1
- package/dist/react/sparkline.js +5 -1
- package/dist/react/spec.js +25 -31
- package/dist/react/status.js +4 -1
- package/dist/react/story.js +7 -4
- package/dist/react/table.js +5 -1
- package/dist/react/theme.js +7 -3
- package/dist/react/tilemap.js +5 -1
- package/dist/react/treemap.js +4 -1
- package/dist/react/variance.js +6 -1
- package/dist/react/waffle.js +4 -1
- package/dist/react/waterfall.js +5 -1
- package/dist/{resvg-ZOVDIZTV.js → resvg-VB7S5HRF.js} +1 -1
- package/dist/rows.js +2 -3
- package/dist/{rowsModule-YVLAROIP.js → rowsModule-JTDPTWXG.js} +3 -1
- package/dist/{schema-BNRNHGHQ.js → schema-2M3LXR35.js} +3 -1
- package/dist/{schema-5HA5DSYN.js → schema-2Q7IJ22V.js} +3 -1
- package/dist/{schema-FA6XIHTW.js → schema-3OLBUVMZ.js} +3 -1
- package/dist/{schema-F3WYTR65.js → schema-3XLO43SX.js} +3 -1
- package/dist/{schema-RTWES6NR.js → schema-5753NOAL.js} +3 -1
- package/dist/{schema-S3TCLTYD.js → schema-5KHDHTIX.js} +3 -1
- package/dist/{schema-WOSEZNKG.js → schema-76XRTBCJ.js} +3 -1
- package/dist/{schema-MPXZNWV3.js → schema-7CPGNCOL.js} +3 -1
- package/dist/{schema-2KIHLTYI.js → schema-BKHQ3ZUH.js} +3 -1
- package/dist/{schema-JB2H6KPA.js → schema-BMD5JR3Y.js} +3 -1
- package/dist/{schema-5BKQV56C.js → schema-BOGTPL7F.js} +3 -1
- package/dist/{schema-ORTRMYI6.js → schema-BUTNGYTT.js} +3 -1
- package/dist/{schema-SWWMOLOR.js → schema-C7NVOQNV.js} +6 -3
- package/dist/{schema-O4YNAGIY.js → schema-FNTAAXQ3.js} +3 -1
- package/dist/{schema-7TLSFG6M.js → schema-FYULDJFB.js} +3 -1
- package/dist/{schema-NHNQK6XO.js → schema-FZKNIAIH.js} +3 -1
- package/dist/{schema-B7CZPPB4.js → schema-G2PLJCYL.js} +3 -1
- package/dist/{schema-ZUUUY3QS.js → schema-GGG2VOY7.js} +3 -2
- package/dist/{schema-6RYJS2GM.js → schema-GLN7IHSH.js} +3 -1
- package/dist/{schema-OJCML6LV.js → schema-HIDW4BA4.js} +3 -1
- package/dist/{schema-S36SRYGO.js → schema-J53LCIY3.js} +3 -1
- package/dist/{schema-2K6C3U24.js → schema-KIJA53MB.js} +4 -1
- package/dist/{schema-O7AKK232.js → schema-LEQNLBNG.js} +2 -1
- package/dist/{schema-AMFRKUFS.js → schema-LHMEXFLY.js} +3 -1
- package/dist/{schema-65FOKNHK.js → schema-MT6NA5AL.js} +3 -3
- package/dist/{schema-4S5CXHAO.js → schema-MUTAVQMI.js} +3 -1
- package/dist/{schema-Y6KBWUUR.js → schema-NVMEOHAW.js} +3 -1
- package/dist/{schema-6OHZWHUI.js → schema-TA3MSAPQ.js} +3 -1
- package/dist/{schema-YQYTLKSW.js → schema-U26KG42U.js} +3 -1
- package/dist/{schema-E4MRCGPZ.js → schema-UHHFTVGS.js} +3 -1
- package/dist/{schema-4HY2MWZC.js → schema-V3BPW4LA.js} +3 -1
- package/dist/{schema-PJ6P52BC.js → schema-WIZ2TZAT.js} +3 -1
- package/dist/{schema-NN6UPDPW.js → schema-WZLWHOMY.js} +3 -1
- package/dist/{schema-6W4M3WJ4.js → schema-XATDKZPW.js} +3 -1
- package/dist/{schema-5NKJPSBD.js → schema-XHKSGMUH.js} +3 -1
- package/dist/{schema-GZNOW4LX.js → schema-XKY2EQFH.js} +3 -1
- package/dist/{schema-HEIDGCSL.js → schema-ZE7WUNFS.js} +3 -1
- package/dist/{specValidation-VNWIKLHH.js → specValidation-X5XJBPTP.js} +4 -1
- package/dist/theme.js +5 -2
- package/dist/{themeShapeRules-2D3KWSPQ.js → themeShapeRules-PW4BQHKL.js} +1 -1
- package/dist/types/core/a11y/recordsShared.d.ts +4 -0
- package/dist/types/core/annotate.d.ts +39 -0
- package/dist/types/core/annotateArms.d.ts +1 -1
- package/dist/types/core/annotateEngine.d.ts +14 -0
- package/dist/types/core/axis.d.ts +2 -0
- package/dist/types/core/calendarLabels.d.ts +15 -0
- package/dist/types/core/charts/band/stacks.d.ts +71 -2
- package/dist/types/core/charts/bartable/types.d.ts +10 -0
- package/dist/types/core/charts/choropleth/index.d.ts +7 -0
- package/dist/types/core/charts/choropleth/layout.d.ts +7 -0
- package/dist/types/core/charts/choropleth/schema.d.ts +36 -0
- package/dist/types/core/charts/cohort/types.d.ts +8 -1
- package/dist/types/core/charts/column/layout.d.ts +1 -1
- package/dist/types/core/charts/column/model.d.ts +4 -0
- package/dist/types/core/charts/combo/endpoints.d.ts +1 -1
- package/dist/types/core/charts/creative/types.d.ts +1 -1
- package/dist/types/core/charts/dimswitch/compile.d.ts +2 -0
- package/dist/types/core/charts/dimswitch/types.d.ts +8 -0
- package/dist/types/core/charts/grid/normalize.d.ts +18 -1
- package/dist/types/core/charts/heatmap/fixtures.d.ts +2 -2
- package/dist/types/core/charts/histogram/types.d.ts +14 -2
- package/dist/types/core/charts/likert/layout.d.ts +14 -9
- package/dist/types/core/charts/logAxis.d.ts +55 -0
- package/dist/types/core/charts/pvm/types.d.ts +6 -0
- package/dist/types/core/charts/pyramid/types.d.ts +7 -4
- package/dist/types/core/charts/sankey/types.d.ts +3 -1
- package/dist/types/core/charts/scatter/clamp.d.ts +155 -0
- package/dist/types/core/charts/scatter/frontier.d.ts +21 -0
- package/dist/types/core/charts/scatter/index.d.ts +9 -0
- package/dist/types/core/charts/scatter/layout.d.ts +26 -0
- package/dist/types/core/charts/scatter/logAxis.d.ts +14 -0
- package/dist/types/core/charts/scatter/model.d.ts +258 -0
- package/dist/types/core/charts/scatter/schema.d.ts +57 -0
- package/dist/types/core/charts/scatter/trend.d.ts +54 -0
- package/dist/types/core/charts/scatter/valueLines.d.ts +47 -0
- package/dist/types/core/charts/sparkline/fixtures.d.ts +1 -1
- package/dist/types/core/charts/status/layout.d.ts +5 -3
- package/dist/types/core/charts/table/resolve.d.ts +0 -7
- package/dist/types/core/charts/tilemap/index.d.ts +6 -0
- package/dist/types/core/charts/tilemap/layout.d.ts +5 -0
- package/dist/types/core/charts/tilemap/schema.d.ts +4 -0
- package/dist/types/core/charts/treemap/types.d.ts +2 -2
- package/dist/types/core/charts/variance/fixtures.d.ts +2 -1
- package/dist/types/core/charts/waffle/types.d.ts +2 -0
- package/dist/types/core/dateFormat.d.ts +1 -1
- package/dist/types/core/deferred.d.ts +6 -1
- package/dist/types/core/doc/diagnostics.d.ts +8 -0
- package/dist/types/core/doc/document.d.ts +9 -1
- package/dist/types/core/doc/ownedDocumentCopy.d.ts +2 -1
- package/dist/types/core/fontMetrics/index.d.ts +1 -1
- package/dist/types/core/footer.d.ts +9 -1
- package/dist/types/core/format.d.ts +4 -1
- package/dist/types/core/formatSpec.d.ts +84 -6
- package/dist/types/core/frame.d.ts +41 -8
- package/dist/types/core/geo/packs/registry.d.ts +3 -2
- package/dist/types/core/geometry.d.ts +19 -0
- package/dist/types/core/icons.d.ts +11 -0
- package/dist/types/core/inputError.d.ts +3 -0
- package/dist/types/core/isoDate.d.ts +2 -0
- package/dist/types/core/label/categoryRow.d.ts +8 -0
- package/dist/types/core/label/occupied.d.ts +5 -0
- package/dist/types/core/label/solver.d.ts +31 -2
- package/dist/types/core/notes.d.ts +13 -1
- package/dist/types/core/ols.d.ts +38 -0
- package/dist/types/core/periodYears.d.ts +5 -1
- package/dist/types/core/registry.d.ts +12 -0
- package/dist/types/core/request.d.ts +3 -2
- package/dist/types/core/scale.d.ts +7 -0
- package/dist/types/core/schema/capability.d.ts +17 -20
- package/dist/types/core/schema/namedColumns.d.ts +6 -0
- package/dist/types/core/schema/refusals.d.ts +1 -4
- package/dist/types/core/shareRounding.d.ts +8 -0
- package/dist/types/core/sizing.d.ts +17 -12
- package/dist/types/core/story.d.ts +3 -0
- package/dist/types/core/target.d.ts +6 -0
- package/dist/types/core/text.d.ts +8 -0
- package/dist/types/core/theme.d.ts +55 -2
- package/dist/types/core/themeShape.d.ts +3 -3
- package/dist/types/core/themeValidate.d.ts +3 -3
- package/dist/types/core/types/annotations.d.ts +15 -3
- package/dist/types/core/types/data.d.ts +4 -1
- package/dist/types/core/types/diagram.d.ts +81 -2
- package/dist/types/core/types/optionInput.d.ts +13 -0
- package/dist/types/core/types/options.d.ts +65 -24
- package/dist/types/core/types/scene.d.ts +79 -2
- package/dist/types/core/types/table.d.ts +9 -0
- package/dist/types/core/types/theme.d.ts +50 -4
- package/dist/types/index.d.ts +28 -27
- package/dist/types/optionTypes.d.ts +44 -0
- package/dist/types/react/DimSwitchChart.d.ts +2 -1
- package/dist/types/react/RefusalBoundary.d.ts +25 -0
- package/dist/types/react/SceneRenderer.d.ts +3 -1
- package/dist/types/react/SizePlaceholder.d.ts +2 -1
- package/dist/types/react/TableChart.d.ts +8 -4
- package/dist/types/react/barrelCharts.d.ts +1521 -1012
- package/dist/types/react/charts/bar.d.ts +36 -25
- package/dist/types/react/charts/bartable.d.ts +36 -25
- package/dist/types/react/charts/box.d.ts +36 -25
- package/dist/types/react/charts/bullet.d.ts +36 -25
- package/dist/types/react/charts/butterfly.d.ts +36 -25
- package/dist/types/react/charts/choropleth.d.ts +36 -25
- package/dist/types/react/charts/cohort.d.ts +76 -50
- package/dist/types/react/charts/column.d.ts +36 -25
- package/dist/types/react/charts/combo.d.ts +2 -1
- package/dist/types/react/charts/creative.d.ts +31 -25
- package/dist/types/react/charts/diagram.d.ts +302 -160
- package/dist/types/react/charts/dot.d.ts +36 -25
- package/dist/types/react/charts/funnel.d.ts +36 -25
- package/dist/types/react/charts/gantt.d.ts +36 -25
- package/dist/types/react/charts/grid.d.ts +38 -27
- package/dist/types/react/charts/heatmap.d.ts +36 -25
- package/dist/types/react/charts/histogram.d.ts +36 -25
- package/dist/types/react/charts/kpi.d.ts +36 -25
- package/dist/types/react/charts/likert.d.ts +36 -25
- package/dist/types/react/charts/line.d.ts +36 -25
- package/dist/types/react/charts/mekko.d.ts +36 -25
- package/dist/types/react/charts/pareto.d.ts +33 -25
- package/dist/types/react/charts/pie.d.ts +36 -25
- package/dist/types/react/charts/pvm.d.ts +36 -25
- package/dist/types/react/charts/pyramid.d.ts +33 -25
- package/dist/types/react/charts/sankey.d.ts +36 -25
- package/dist/types/react/charts/scatter.d.ts +36 -25
- package/dist/types/react/charts/slope.d.ts +36 -25
- package/dist/types/react/charts/sparkline.d.ts +36 -25
- package/dist/types/react/charts/status.d.ts +36 -25
- package/dist/types/react/charts/tilemap.d.ts +36 -25
- package/dist/types/react/charts/treemap.d.ts +36 -25
- package/dist/types/react/charts/variance.d.ts +36 -25
- package/dist/types/react/charts/waffle.d.ts +36 -25
- package/dist/types/react/charts/waterfall.d.ts +36 -25
- package/dist/types/react/createChartComponent.d.ts +11 -9
- package/dist/types/react/footerFrame.d.ts +1 -1
- package/dist/types/react/hover/engine.d.ts +2 -1
- package/dist/types/react/hover/labelCard.d.ts +14 -2
- package/dist/types/react/prepare.d.ts +2 -2
- package/dist/types/react/prepared.d.ts +5 -1
- package/dist/types/react/rowsStore.d.ts +5 -0
- package/dist/types/react/useContainerSize.d.ts +2 -0
- package/dist/types/rows.d.ts +1 -1
- package/dist/validate.js +13 -8
- package/docs/manual.md +143 -37
- package/docs/reference/bar.md +10 -7
- package/docs/reference/bartable.md +7 -3
- package/docs/reference/box.md +5 -2
- package/docs/reference/bullet.md +7 -5
- package/docs/reference/butterfly.md +12 -5
- package/docs/reference/choropleth.md +9 -7
- package/docs/reference/cohort.md +3 -2
- package/docs/reference/column.md +14 -7
- package/docs/reference/combo.md +8 -6
- package/docs/reference/creative.md +1 -1
- package/docs/reference/diagram.md +94 -18
- package/docs/reference/dimswitch.md +16 -13
- package/docs/reference/dot.md +7 -4
- package/docs/reference/fixtures.md +49 -5
- package/docs/reference/funnel.md +4 -3
- package/docs/reference/gantt.md +1 -1
- package/docs/reference/grid.md +1 -1
- package/docs/reference/heatmap.md +6 -4
- package/docs/reference/histogram.md +7 -4
- package/docs/reference/kpi.md +11 -8
- package/docs/reference/likert.md +7 -3
- package/docs/reference/line.md +9 -8
- package/docs/reference/mekko.md +4 -4
- package/docs/reference/options.md +34 -32
- package/docs/reference/pareto.md +4 -4
- package/docs/reference/pie.md +8 -7
- package/docs/reference/pvm.md +4 -2
- package/docs/reference/pyramid.md +4 -4
- package/docs/reference/react.md +20 -11
- package/docs/reference/sankey.md +5 -3
- package/docs/reference/scatter.md +3 -3
- package/docs/reference/slope.md +7 -6
- package/docs/reference/sparkline.md +6 -5
- package/docs/reference/status.md +6 -4
- package/docs/reference/table.md +28 -26
- package/docs/reference/theme.md +94 -87
- package/docs/reference/tilemap.md +7 -6
- package/docs/reference/treemap.md +6 -5
- package/docs/reference/variance.md +8 -5
- package/docs/reference/waffle.md +2 -1
- package/docs/reference/waterfall.md +12 -9
- package/docs/use-cases.md +221 -0
- package/llms.txt +2 -1
- package/package.json +2 -1
- package/dist/chunk-2FNNAPCI.js +0 -24
- package/dist/chunk-2RSG7JYI.js +0 -24
- package/dist/chunk-3JEQGGVD.js +0 -19
- package/dist/chunk-3XHJHQWU.js +0 -42
- package/dist/chunk-4JLBVIGW.js +0 -24
- package/dist/chunk-6KWIQ5KF.js +0 -18
- package/dist/chunk-7X65ZQN4.js +0 -38
- package/dist/chunk-BBRBCMNR.js +0 -28
- package/dist/chunk-BMRD6MAH.js +0 -24
- package/dist/chunk-BW5VLBSZ.js +0 -15
- package/dist/chunk-CJGSJKPO.js +0 -25
- package/dist/chunk-CN7JRHST.js +0 -25
- package/dist/chunk-DJHIQWSG.js +0 -25
- package/dist/chunk-E4IQ6M4S.js +0 -24
- package/dist/chunk-EFUWFB64.js +0 -24
- package/dist/chunk-FIANWJXX.js +0 -19
- package/dist/chunk-GZTNTHSW.js +0 -21
- package/dist/chunk-H5G7T35P.js +0 -24
- package/dist/chunk-HKYTOJLV.js +0 -33
- package/dist/chunk-HYY5V2KL.js +0 -19
- package/dist/chunk-I6VAWNNU.js +0 -24
- package/dist/chunk-IK4BHOPZ.js +0 -33
- package/dist/chunk-ILSXT6KT.js +0 -24
- package/dist/chunk-JR7Y5ONB.js +0 -27
- package/dist/chunk-K3HSQPSM.js +0 -24
- package/dist/chunk-KDMKHR5A.js +0 -32
- package/dist/chunk-KOJ5QETJ.js +0 -8
- package/dist/chunk-L3JWM7FR.js +0 -50
- package/dist/chunk-L4S6UFTL.js +0 -26
- package/dist/chunk-LFTAMH7I.js +0 -24
- package/dist/chunk-MIAPBQCA.js +0 -24
- package/dist/chunk-NCB3YLHF.js +0 -28
- package/dist/chunk-ONZLC47B.js +0 -88
- package/dist/chunk-OUEGGWH7.js +0 -24
- package/dist/chunk-P25VEGGX.js +0 -24
- package/dist/chunk-P26Z62UV.js +0 -24
- package/dist/chunk-PFVTYFSL.js +0 -24
- package/dist/chunk-QGCEHR6S.js +0 -13
- package/dist/chunk-QOIVXZUF.js +0 -24
- package/dist/chunk-RA66JA3D.js +0 -24
- package/dist/chunk-SMCDXUIO.js +0 -24
- package/dist/chunk-T3IGJARD.js +0 -22
- package/dist/chunk-TKOJZQAJ.js +0 -24
- package/dist/chunk-UBZXQIDR.js +0 -24
- package/dist/chunk-VERLFNWR.js +0 -25
- package/dist/chunk-VH2UUU7K.js +0 -24
- package/dist/chunk-Z6CL7AR6.js +0 -24
- package/dist/chunk-ZU425HNM.js +0 -24
- package/dist/chunk-ZZU5R5UU.js +0 -24
- /package/dist/{DiagnosticDetails-UNYNYCAH.js → DiagnosticDetails-JFBBXOT2.js} +0 -0
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
formatPercent,
|
|
13
13
|
fractionFormat,
|
|
14
14
|
groupInteger,
|
|
15
|
+
isPercentagePointUnit,
|
|
15
16
|
magnitudeSuffix,
|
|
16
17
|
nonFiniteGlyph,
|
|
17
18
|
nonzeroDecimals,
|
|
@@ -29,14 +30,40 @@ import {
|
|
|
29
30
|
withoutLeadingZero,
|
|
30
31
|
wordLanguage,
|
|
31
32
|
zeroLifts
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-LHKDZAWN.js";
|
|
33
34
|
import {
|
|
34
35
|
NormalizeError
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-YOOHNQ3L.js";
|
|
36
37
|
import {
|
|
37
|
-
maxOf
|
|
38
|
+
maxOf,
|
|
39
|
+
minOf
|
|
38
40
|
} from "./chunk-WYJEOMNY.js";
|
|
39
41
|
|
|
42
|
+
// src/core/unitJoin.ts
|
|
43
|
+
var SYMBOL_UNIT = /^([$€£¥])?\s*(k|m|mm|mn|bn|%|x|×)?$/i, SIGN_WORD = /^([$€£¥])\s*(\p{L}.*)$/u, signAfter = /* @__PURE__ */ new Map();
|
|
44
|
+
function currencyAfter(locale) {
|
|
45
|
+
let after = signAfter.get(locale);
|
|
46
|
+
if (after === void 0) {
|
|
47
|
+
let parts = new Intl.NumberFormat(locale, { style: "currency", currency: "EUR" }).formatToParts(1);
|
|
48
|
+
after = parts.findIndex((part) => part.type === "currency") > parts.findIndex((part) => part.type === "integer"), signAfter.size >= 16 && signAfter.delete(signAfter.keys().next().value), signAfter.set(locale, after);
|
|
49
|
+
}
|
|
50
|
+
return after;
|
|
51
|
+
}
|
|
52
|
+
function withUnit(text, unit, deduplicatePercent = !1, locale) {
|
|
53
|
+
let trimmed = unit?.trim() ?? "";
|
|
54
|
+
if (!trimmed || deduplicatePercent && trimmed === "%" && text.includes("%")) return text;
|
|
55
|
+
if (deduplicatePercent && trimmed.startsWith("%") && text.includes("%")) return `${text} ${trimmed.slice(1).trim()}`;
|
|
56
|
+
if (isPercentagePointUnit(trimmed)) return `${text}pp`;
|
|
57
|
+
let signWord = SYMBOL_UNIT.test(trimmed) ? null : SIGN_WORD.exec(trimmed), match = signWord ? [trimmed, signWord[1], ""] : SYMBOL_UNIT.exec(trimmed);
|
|
58
|
+
if (!match) return `${text} ${trimmed}`;
|
|
59
|
+
let word = signWord ? ` ${signWord[2]}` : "";
|
|
60
|
+
if (match[1] && locale && currencyAfter(locale)) return `${text}${match[2] ?? ""}${word}\xA0${match[1]}`;
|
|
61
|
+
let prefix = match[1] ?? "", suffix = `${match[2] ?? ""}${word}`;
|
|
62
|
+
if (text.startsWith("(") && text.endsWith(")")) return `(${prefix}${text.slice(1, -1)}${suffix})`;
|
|
63
|
+
let sign = text.startsWith(MINUS) || text.startsWith("-") || text.startsWith("+") ? text[0] : "";
|
|
64
|
+
return `${sign}${prefix}${text.slice(sign.length)}${suffix}`;
|
|
65
|
+
}
|
|
66
|
+
|
|
40
67
|
// src/core/formatSpec.ts
|
|
41
68
|
var AUTOMATIC_FORMAT = /* @__PURE__ */ Symbol("automatic-format"), MAGNITUDE_GROUP = /* @__PURE__ */ Symbol("magnitude-group"), WORD_END = String.raw`(?![\p{L}\p{N}]|-\p{L})`, MAGNITUDE_SUFFIXES = [
|
|
42
69
|
{ re: new RegExp(String.raw`^(?:trillions?|billionen)${WORD_END}`, "iu"), key: "t" },
|
|
@@ -44,11 +71,15 @@ var AUTOMATIC_FORMAT = /* @__PURE__ */ Symbol("automatic-format"), MAGNITUDE_GRO
|
|
|
44
71
|
{ re: new RegExp(String.raw`^(?:thousands?|tausend)${WORD_END}`, "iu"), key: "k" },
|
|
45
72
|
{ re: new RegExp(String.raw`^(?:millions?|millionen)${WORD_END}`, "iu"), key: "m" },
|
|
46
73
|
{ re: new RegExp(String.raw`^(?:tn|bio\.?)${WORD_END}`, "iu"), key: "t" },
|
|
47
|
-
|
|
74
|
+
{ re: new RegExp(String.raw`^(?:bn|mrd\.?)${WORD_END}`, "iu"), key: "bn" },
|
|
75
|
+
{ re: new RegExp(String.raw`^(?:tsd\.?)${WORD_END}`, "iu"), key: "k" },
|
|
76
|
+
{ re: new RegExp(String.raw`^(?:mn|mio\.?)${WORD_END}`, "iu"), key: "m" },
|
|
77
|
+
// Without a currency these letters must be glued: "1.5 T" stays tesla, "12 m/s" metres per second and "50 B" bytes,
|
|
78
|
+
// while "$1.2T", "1.2m" and "50B" scale.
|
|
48
79
|
{ re: new RegExp(String.raw`^T${WORD_END}`, "u"), key: "t", glued: !0 },
|
|
49
|
-
{ re: new RegExp(String.raw`^
|
|
50
|
-
{ re: new RegExp(String.raw`^
|
|
51
|
-
{ re: new RegExp(String.raw`^(?:mm|
|
|
80
|
+
{ re: new RegExp(String.raw`^b${WORD_END}`, "iu"), key: "bn", glued: !0 },
|
|
81
|
+
{ re: new RegExp(String.raw`^k${WORD_END}`, "iu"), key: "k", glued: !0 },
|
|
82
|
+
{ re: new RegExp(String.raw`^(?:mm|m)${WORD_END}`, "iu"), key: "m", glued: !0 }
|
|
52
83
|
], MAGNITUDE_WORD_LETTER = {
|
|
53
84
|
bn: "b",
|
|
54
85
|
mn: "m",
|
|
@@ -73,9 +104,36 @@ var AUTOMATIC_FORMAT = /* @__PURE__ */ Symbol("automatic-format"), MAGNITUDE_GRO
|
|
|
73
104
|
trillion: "t",
|
|
74
105
|
trillions: "t",
|
|
75
106
|
billionen: "t"
|
|
76
|
-
};
|
|
107
|
+
}, MAX_FIGURES = 15;
|
|
108
|
+
function figureExample(s) {
|
|
109
|
+
if (!s.includes("@") || /[0-9]/.test(s)) return;
|
|
110
|
+
let runs = s.match(/@+/g);
|
|
111
|
+
if (runs.length > 1) {
|
|
112
|
+
let fixed = s.slice(0, s.indexOf("@")) + "@".repeat(runs.join("").length) + s.slice(s.lastIndexOf("@") + 1);
|
|
113
|
+
throw new NormalizeError("invalid-format", "format", `invalid-format-example: '${s}' splits its significant figures into more than one run of @; the engine places the decimal mark and the group marks`, `write one run of @, e.g. '${fixed}'`);
|
|
114
|
+
}
|
|
115
|
+
if (runs[0].length > MAX_FIGURES)
|
|
116
|
+
throw new NormalizeError("invalid-format", "format", `invalid-format-example: '${s}' asks for ${runs[0].length} significant figures; the most is ${MAX_FIGURES}`, `write at most ${MAX_FIGURES} @`);
|
|
117
|
+
return { standIn: s.replace("@".repeat(runs[0].length), "1,234"), figures: runs[0].length };
|
|
118
|
+
}
|
|
119
|
+
var parsedExamples = /* @__PURE__ */ new Map(), MAX_PARSED_EXAMPLES = 2048;
|
|
120
|
+
function copySpec(spec) {
|
|
121
|
+
let copy = { ...spec };
|
|
122
|
+
return spec.magnitudeWord && (copy.magnitudeWord = { ...spec.magnitudeWord }), spec.glyphs && (copy.glyphs = { ...spec.glyphs }), spec.exponent && (copy.exponent = { ...spec.exponent }), copy;
|
|
123
|
+
}
|
|
77
124
|
function parseFormatExample(example, keepWord = !1) {
|
|
78
|
-
let
|
|
125
|
+
let key = `${keepWord ? "w" : "n"}${String(example)}`, known = parsedExamples.get(key);
|
|
126
|
+
if (known) return copySpec(known);
|
|
127
|
+
let spec = parseExample(example, keepWord);
|
|
128
|
+
return parsedExamples.size >= MAX_PARSED_EXAMPLES && parsedExamples.clear(), parsedExamples.set(key, copySpec(spec)), spec;
|
|
129
|
+
}
|
|
130
|
+
function parseExample(example, keepWord) {
|
|
131
|
+
let s = formatExampleText(String(example)).trim(), figures = figureExample(s);
|
|
132
|
+
if (figures) {
|
|
133
|
+
let spec2 = parseFormatExample(figures.standIn, keepWord);
|
|
134
|
+
return spec2.magnitudeInAffix || delete spec2.rollMagnitude, spec2.significantDigits = figures.figures, spec2.decimals = Math.min(20, figures.figures - 1), spec2;
|
|
135
|
+
}
|
|
136
|
+
let spec = {
|
|
79
137
|
decimals: 0,
|
|
80
138
|
thousandsSep: "",
|
|
81
139
|
decimalSep: ".",
|
|
@@ -94,27 +152,171 @@ function parseFormatExample(example, keepWord = !1) {
|
|
|
94
152
|
throw new NormalizeError("invalid-format", "format", "invalid-format-example: parentheses must enclose one example number and its units, or sit beside it as balanced text", "write an example number as it should print, e.g. '($1,234)' for negatives in parentheses or '1,234 (kg)' for a unit");
|
|
95
153
|
accounting && !/[=:]/.test(before.slice(open)) && (spec.negative = "parens", before = before.slice(0, open) + before.slice(open + 1), after = after.slice(0, close) + after.slice(close + 1));
|
|
96
154
|
}
|
|
97
|
-
let lead
|
|
98
|
-
/[+]/.test(lead) && (spec.signed = !0, lead = lead.replace(/\+/g, "")), lead = lead.replace(new RegExp(`[-${MINUS}]`, "g"), ""), spec.prefix = lead.trimStart();
|
|
155
|
+
let lead;
|
|
156
|
+
[lead, after] = exampleSigns(spec, before, after, s), /[+]/.test(lead) && (spec.signed = !0, lead = lead.replace(/\+/g, "")), lead = lead.replace(new RegExp(`[-${MINUS}]`, "g"), ""), spec.prefix = lead.trimStart();
|
|
99
157
|
let tail = after.trimEnd(), tailTrimmed = tail.trimStart();
|
|
100
158
|
for (let m of MAGNITUDE_SUFFIXES) {
|
|
101
|
-
let word = m
|
|
159
|
+
let word = magnitudeAfterNumber(m, lead, tail, tailTrimmed);
|
|
102
160
|
if (word) {
|
|
103
161
|
spec.magnitude = m.key, keepWord && (spec.magnitudeWord = { magnitude: m.key, text: tail.slice(0, tail.length - tailTrimmed.length) + word[0] }), tail = tailTrimmed.replace(m.re, "");
|
|
104
162
|
break;
|
|
105
163
|
}
|
|
106
164
|
}
|
|
107
|
-
|
|
165
|
+
return spec.suffix = tail, affixMagnitude(spec), analyzeBody(body, spec), exampleNumberStyle(spec, body), checkedDecimals(spec.decimals), spec.magnitude !== "none" && spec.thousandsSep !== "" && (spec.rollMagnitude = !1), spec;
|
|
166
|
+
}
|
|
167
|
+
var SPREADSHEET_CODE = /[#?][#?,.]|[,.][#?]|;/, SPREADSHEET_BRACKET = /^\[(?:Black|Blue|Cyan|Green|Magenta|Red|White|Yellow|Color(?:[1-9]|[1-4][0-9]|5[0-6])|[<>=][^\]]*|\$[^\]]*)\]$/i, SPREADSHEET_SCALE_COMMAS = /[0#?](,+)(?=\s*(?:$|["\\_[;]))/;
|
|
168
|
+
function withoutSpreadsheetBrackets(text) {
|
|
169
|
+
let out = "", at = 0;
|
|
170
|
+
for (let open = text.indexOf("["); open >= 0; open = text.indexOf("[", at)) {
|
|
171
|
+
let close = text.indexOf("]", open + 1);
|
|
172
|
+
if (close < 0) break;
|
|
173
|
+
out += text.slice(at, open);
|
|
174
|
+
let bracket = text.slice(open, close + 1);
|
|
175
|
+
SPREADSHEET_BRACKET.test(bracket) || (out += bracket), at = close + 1;
|
|
176
|
+
}
|
|
177
|
+
return out + text.slice(at);
|
|
178
|
+
}
|
|
179
|
+
function isSpreadsheetCode(text) {
|
|
180
|
+
let withoutInstructions = withoutSpreadsheetBrackets(text);
|
|
181
|
+
return SPREADSHEET_CODE.test(text) || !/[1-9]/.test(withoutInstructions) && (withoutInstructions !== text || /"|\\|_[()]|\* |[Ee][+-]0+/.test(text) || SPREADSHEET_SCALE_COMMAS.test(text));
|
|
182
|
+
}
|
|
183
|
+
function spreadsheetSections(code) {
|
|
184
|
+
let sections = [[]];
|
|
185
|
+
for (let i = 0; i < code.length; i++) {
|
|
186
|
+
let char = code[i], section = sections[sections.length - 1];
|
|
187
|
+
if (char === ";") {
|
|
188
|
+
sections.push([]);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (char === '"') {
|
|
192
|
+
let end = code.indexOf('"', i + 1);
|
|
193
|
+
if (end < 0) return;
|
|
194
|
+
section.push({ text: code.slice(i + 1, end), literal: !0, at: i }), i = end;
|
|
195
|
+
} else if (char === "\\") {
|
|
196
|
+
if (++i === code.length) return;
|
|
197
|
+
section.push({ text: code[i], literal: !0, at: i });
|
|
198
|
+
} else if (char === "[") {
|
|
199
|
+
let end = code.indexOf("]", i + 1);
|
|
200
|
+
if (end < 0) return;
|
|
201
|
+
let currency = /^\$(.*?)(?:-[0-9a-f]+)?$/i.exec(code.slice(i + 1, end));
|
|
202
|
+
currency ? section.push({ text: currency[1], literal: !0, at: i }) : SPREADSHEET_BRACKET.test(code.slice(i, end + 1)) || section.push({ text: code.slice(i, end + 1), literal: !0, at: i }), i = end;
|
|
203
|
+
} else if (char === "_" || char === "*") {
|
|
204
|
+
if (++i === code.length) return;
|
|
205
|
+
} else section.push({ text: char, literal: !1, at: i });
|
|
206
|
+
}
|
|
207
|
+
return sections;
|
|
208
|
+
}
|
|
209
|
+
function spreadsheetExample(code) {
|
|
210
|
+
if (!isSpreadsheetCode(code)) return;
|
|
211
|
+
let sections = spreadsheetSections(code);
|
|
212
|
+
if (!sections || sections.length > 4) return;
|
|
213
|
+
let tokens = sections[0], digit = (token) => !token.literal && /^[0-9#?]$/.test(token.text), first = tokens.findIndex(digit);
|
|
214
|
+
if (first < 0) return;
|
|
215
|
+
let exponent = "", e = tokens.findIndex((token, index) => index > first && !token.literal && /^[Ee]$/.test(token.text) && /^[+-]$/.test(tokens[index + 1]?.text ?? "") && tokens[index + 2]?.text === "0");
|
|
216
|
+
if (e >= 0) {
|
|
217
|
+
let end2 = e + 2;
|
|
218
|
+
for (; tokens[end2]?.text === "0" && !tokens[end2].literal; ) end2++;
|
|
219
|
+
exponent = tokens.slice(e, end2).map((token) => token.text).join("").replace(/0+$/, (zeros) => "0".repeat(Math.max(zeros.length - 1, 0)) + "6"), tokens = [...tokens.slice(0, e), ...tokens.slice(end2)];
|
|
220
|
+
}
|
|
221
|
+
let last = tokens.length - 1;
|
|
222
|
+
for (; last >= first && !digit(tokens[last]); ) last--;
|
|
223
|
+
let body = tokens.slice(first, last + 1);
|
|
224
|
+
if (body.some((token) => token.literal) || !/^[0-9#?,]+(?:\.[0-9#?]+)?$/.test(body.map((token) => token.text).join(""))) return;
|
|
225
|
+
let numeric = body.map((token) => token.text).join(""), [integer, fraction = ""] = numeric.split("."), grouped = /[0-9#?],[0-9#?]{2,}/.test(integer), decimals = fraction.length, end = last + 1;
|
|
226
|
+
if (SPREADSHEET_SCALE_COMMAS.exec(code.slice(tokens[last].at))?.index === 0)
|
|
227
|
+
for (; tokens[end]?.text === "," && !tokens[end].literal; ) end++;
|
|
228
|
+
let commas = end - last - 1;
|
|
229
|
+
if (commas > 4 || exponent && commas > 0) return;
|
|
230
|
+
let magnitude = ["none", "k", "m", "bn", "t"][commas], suffix = tokens.slice(end), literalScale = (token) => token.literal && MAGNITUDE_SUFFIXES.some((entry) => entry.re.exec(token.text.trim())?.[0] === token.text.trim()), scaleLiterals = tokens.filter(literalScale);
|
|
231
|
+
if (scaleLiterals.some((token) => commas === 0 || unitMagnitude(token.text.trim()) !== magnitude) || tokens.slice(0, first).some(literalScale)) return;
|
|
232
|
+
let notes = [];
|
|
233
|
+
sections.length > 2 && notes.push("zero and text sections are dropped"), tokens.some((token) => token.text.includes("%")) && notes.push("percent values are percent points: 12.5 prints 12.5%");
|
|
234
|
+
let added = commas > 0 && scaleLiterals.length === 0 ? MAGNITUDE_LABEL[magnitude] : "";
|
|
235
|
+
added && notes.push(`the scale letter '${added}' is added for ${commas} trailing comma${commas === 1 ? "" : "s"}`);
|
|
236
|
+
let whole = grouped ? commas === 1 && decimals === 0 ? "1,235" : "1,234" : decimals === 3 ? "0" : "1", digits = grouped ? `5${"0".repeat(Math.max(0, decimals - 1))}` : decimals === 3 ? "555" : "23456789012345678901".slice(0, decimals), example = tokens.slice(0, first).map((token) => token.text).join("") + whole + (decimals ? `.${digits}` : "") + exponent + added + suffix.map((token) => token.text).join(""), negative = sections[1]?.map((token) => token.text).join("").trim();
|
|
237
|
+
if (negative?.startsWith("(") && negative.endsWith(")") && sections[1].some(digit) && (example = `(${example})`), !isSpreadsheetCode(example)) {
|
|
238
|
+
try {
|
|
239
|
+
let parsed = parseFormatExample(example, !0);
|
|
240
|
+
if (parsed.decimals !== decimals || parsed.thousandsSep !== "" !== (grouped && !exponent) || parsed.magnitude !== magnitude) return;
|
|
241
|
+
} catch {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
return { example, notes };
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function isCurrency(text) {
|
|
248
|
+
let trimmed = text.trim();
|
|
249
|
+
return /^\p{Sc}$/u.test(trimmed) || CURRENCY_CODES.has(trimmed.toUpperCase());
|
|
250
|
+
}
|
|
251
|
+
function currencyAffixMagnitude(text) {
|
|
252
|
+
if (!/[A-Za-z]/.test(text)) return;
|
|
253
|
+
let trimmed = text.trim();
|
|
254
|
+
if (!/^[\p{Sc}\p{L}. ]+$/u.test(trimmed)) return;
|
|
255
|
+
let magnitude = unitMagnitude(trimmed);
|
|
256
|
+
if (magnitude)
|
|
257
|
+
return /\p{Sc}/u.test(trimmed) || CURRENCY_CODES.has(trimmed.slice(0, 3).toUpperCase()) || CURRENCY_CODES.has(trimmed.slice(-3).toUpperCase()) ? magnitude : void 0;
|
|
258
|
+
}
|
|
259
|
+
function unitOnlyExample(text) {
|
|
260
|
+
if (/[0-9]/.test(text)) return;
|
|
261
|
+
let unit = text.trim();
|
|
262
|
+
if (/^(?:%|pp|x|×)$/.test(unit)) return `1.2${unit}`;
|
|
263
|
+
if (/^\p{Sc}$/u.test(unit)) return `${unit}1,234`;
|
|
264
|
+
if (CURRENCY_CODES.has(unit.toUpperCase())) return `1.2 ${unit}`;
|
|
265
|
+
if (!currencyAffixMagnitude(unit)) return;
|
|
266
|
+
let symbol = /^\p{Sc}/u.exec(unit)?.[0];
|
|
267
|
+
return symbol ? `${symbol}1.2${unit.slice(symbol.length)}` : /\p{Sc}$/u.test(unit) ? `1.2${unit}` : `1.2 ${unit}`;
|
|
268
|
+
}
|
|
269
|
+
function formatExampleText(example) {
|
|
270
|
+
if (isSpreadsheetCode(example)) {
|
|
271
|
+
let translated = spreadsheetExample(example);
|
|
272
|
+
if (translated) return translated.example;
|
|
108
273
|
throw new NormalizeError("invalid-format", "format", `invalid-format-example: '${example}' is a spreadsheet number code, not a format-by-example; write an example number as it should print`, "write an example number as it should print, e.g. '1,234' instead of '#,##0'");
|
|
109
|
-
|
|
274
|
+
}
|
|
275
|
+
return unitOnlyExample(example) ?? example;
|
|
276
|
+
}
|
|
277
|
+
var DIRECTION_GLYPHS = [["\u25B2", "\u25BC"], ["\u25B3", "\u25BD"], ["\u2191", "\u2193"], ["\u2B06", "\u2B07"], ["\u25B4", "\u25BE"]].map(([up, down]) => ({ up, down, start: new RegExp(`^[${up}${down}](\\s?)`), end: new RegExp(`(\\s?)[${up}${down}]$`) })), ANY_GLYPH = /^[▲▼△▽↑↓⬆⬇▴▾]|[▲▼△▽↑↓⬆⬇▴▾]$/;
|
|
278
|
+
function exampleSigns(spec, before, after, example) {
|
|
279
|
+
before.includes("\xB1") && (before = before.replace(/±/g, "+"));
|
|
280
|
+
let last = example.charCodeAt(example.length - 1), trailing = last === 45 || last === 8722 ? /([^\s])([-−])$/.exec(before + "0" + after) : null;
|
|
281
|
+
if (trailing && !/[-−]/.test((before + after).slice(0, -1)) && (after = after.slice(0, -1), spec.negative !== "parens" && (spec.negative = "trailing", spec.trailingMinus = trailing[2])), !ANY_GLYPH.test(example)) return [before, after];
|
|
282
|
+
for (let { up, down, start: startPattern, end: endPattern } of DIRECTION_GLYPHS) {
|
|
283
|
+
let start = startPattern.exec(example), end = endPattern.exec(example);
|
|
284
|
+
if (!(!start && !end)) {
|
|
285
|
+
spec.glyphs = { up, down, at: start ? "start" : "end", space: (start ?? end)[1] }, spec.signed = !0, start ? before = before.replace(start[0], "") : after = after.slice(0, -end[0].length);
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return [before, after];
|
|
290
|
+
}
|
|
291
|
+
function magnitudeAfterNumber(entry, lead, tail, trimmed) {
|
|
292
|
+
let word = entry.re.exec(trimmed);
|
|
293
|
+
return !word || !entry.glued || tail === trimmed || !trimmed.slice(word[0].length).startsWith("/") && (isCurrency(lead) || isCurrency(trimmed.slice(word[0].length))) ? word : null;
|
|
294
|
+
}
|
|
295
|
+
function affixMagnitude(spec) {
|
|
296
|
+
if (spec.magnitude !== "none" || spec.prefix === "" && spec.suffix === "") return;
|
|
297
|
+
let magnitude = currencyAffixMagnitude(spec.prefix) ?? currencyAffixMagnitude(spec.suffix);
|
|
298
|
+
magnitude && (spec.magnitude = magnitude, spec.magnitudeInAffix = !0, spec.rollMagnitude = !1);
|
|
299
|
+
}
|
|
300
|
+
function exampleNumberStyle(spec, body) {
|
|
301
|
+
let exponent = /^([Ee])([+-]?)([0-9]+)/.exec(spec.suffix);
|
|
302
|
+
if (exponent) {
|
|
303
|
+
spec.exponent = { letter: exponent[1], sign: exponent[2] === "+" ? "+" : "", digits: exponent[3].length }, spec.suffix = spec.suffix.slice(exponent[0].length), spec.thousandsSep = "";
|
|
304
|
+
let point = Math.max(body.lastIndexOf("."), body.lastIndexOf(","));
|
|
305
|
+
spec.decimals = point < 0 ? 0 : body.length - point - 1, spec.decimalSep = point >= 0 && body[point] === "," ? "," : ".", spec.rollMagnitude = !1;
|
|
306
|
+
}
|
|
307
|
+
let ordinal = /^(st|nd|rd|th)(?![\p{L}\p{N}])/iu.exec(spec.suffix);
|
|
308
|
+
ordinal && spec.decimals === 0 && spec.magnitude === "none" && (spec.ordinal = ordinal[0] === ordinal[0].toUpperCase() ? "upper" : "lower", spec.suffix = spec.suffix.slice(ordinal[0].length));
|
|
110
309
|
}
|
|
111
|
-
var SPREADSHEET_CODE = /[#?][#?,.]|[,.][#?]|;/;
|
|
112
310
|
function formatExampleProblem(example) {
|
|
113
311
|
if (example !== "")
|
|
114
312
|
try {
|
|
115
313
|
parseFormatExample(example);
|
|
116
314
|
return;
|
|
117
315
|
} catch (error) {
|
|
316
|
+
if (example.includes("@") && !/[0-9]/.test(example)) {
|
|
317
|
+
let figures = Math.min(MAX_FIGURES, example.replace(/[^@]/g, "").length);
|
|
318
|
+
return { message: error.message, replacement: example.slice(0, example.indexOf("@")) + "@".repeat(figures) + example.slice(example.lastIndexOf("@") + 1) };
|
|
319
|
+
}
|
|
118
320
|
let code = example.replace(/"/g, "").replace(/;.*$/, ""), replacement = "1,234";
|
|
119
321
|
try {
|
|
120
322
|
replacement = formatterFromExample(code.replace(/[#?]/g, "1"), void 0)(1234);
|
|
@@ -125,7 +327,95 @@ function formatExampleProblem(example) {
|
|
|
125
327
|
return { message: error.message, replacement };
|
|
126
328
|
}
|
|
127
329
|
}
|
|
128
|
-
var
|
|
330
|
+
var GROUP_OR_DECIMALS = /^[1-9][0-9]{0,2}\.[0-9]{3}$/;
|
|
331
|
+
function decimalExample(example) {
|
|
332
|
+
example = formatExampleText(example);
|
|
333
|
+
let body = numericBody(example), text = body?.text.trimEnd();
|
|
334
|
+
if (!(text === void 0 || !GROUP_OR_DECIMALS.test(text)) && !/^[Ee][+-]?[0-9]+/.test(example.slice(body.index + text.length)))
|
|
335
|
+
return example.slice(0, body.index) + text.replace(/^[0-9]+/, "0") + example.slice(body.index + text.length);
|
|
336
|
+
}
|
|
337
|
+
function exampleReading(example, numbers) {
|
|
338
|
+
let decimals = decimalExample(example);
|
|
339
|
+
if (decimals === void 0) return {};
|
|
340
|
+
let divisor = MAGNITUDE_DIVISOR[parseFormatExample(example).magnitude], lost = numbers.find((value) => Math.abs(value) / divisor < 1e3 && !Number.isInteger(value / divisor));
|
|
341
|
+
return lost === void 0 ? {} : maxOf(numbers.map((value) => Math.abs(value))) / divisor < 1e3 ? { decimals } : { lost };
|
|
342
|
+
}
|
|
343
|
+
function isPlainTree(node) {
|
|
344
|
+
if (typeof node != "object" || node === null) return !1;
|
|
345
|
+
let proto = Object.getPrototypeOf(node);
|
|
346
|
+
return proto === Object.prototype || proto === Array.prototype || proto === null;
|
|
347
|
+
}
|
|
348
|
+
function mapExamples(node, change, seen = /* @__PURE__ */ new Map(), keys = "format", path = []) {
|
|
349
|
+
if (!isPlainTree(node)) return node;
|
|
350
|
+
if (seen.has(node)) return seen.get(node);
|
|
351
|
+
seen.set(node, node);
|
|
352
|
+
let changed;
|
|
353
|
+
for (let key of Object.keys(node)) {
|
|
354
|
+
let child = node[key], example = keys === "all" || keys === "format" && key === "format", childPath = [...path, Array.isArray(node) ? Number(key) : key], next = typeof child == "string" ? example ? change(child, node, childPath) : child : mapExamples(child, change, seen, key === "axisFormat" ? "all" : key === "cells" ? "none" : "format", childPath);
|
|
355
|
+
next !== child && (changed ??= Array.isArray(node) ? [...node] : Object.assign(Object.create(Object.getPrototypeOf(node)), node), changed[key] = next);
|
|
356
|
+
}
|
|
357
|
+
return seen.set(node, changed ?? node), changed ?? node;
|
|
358
|
+
}
|
|
359
|
+
function treeNumbers(node, into = [], seen = /* @__PURE__ */ new Set()) {
|
|
360
|
+
if (typeof node == "number")
|
|
361
|
+
Number.isFinite(node) && into.push(node);
|
|
362
|
+
else if (isPlainTree(node) && !seen.has(node)) {
|
|
363
|
+
seen.add(node);
|
|
364
|
+
for (let key of Object.keys(node)) treeNumbers(node[key], into, seen);
|
|
365
|
+
}
|
|
366
|
+
return into;
|
|
367
|
+
}
|
|
368
|
+
function readFormatExamples(data, options) {
|
|
369
|
+
let warnings = [], warned = /* @__PURE__ */ new Set(), allNumbers, numbersOf = (owner) => {
|
|
370
|
+
let own = normalizedSeriesNumbers(owner);
|
|
371
|
+
if (own) return own;
|
|
372
|
+
let table = data;
|
|
373
|
+
if (Array.isArray(table?.columns) && table.columns.some((column) => column === owner) && typeof owner.id == "string") {
|
|
374
|
+
let cells = [], collect2 = (rows) => {
|
|
375
|
+
for (let row of rows ?? [])
|
|
376
|
+
cells.push(row.cells?.[owner.id]), Array.isArray(row.children) && collect2(row.children);
|
|
377
|
+
};
|
|
378
|
+
return collect2(table.rows), normalizedSeriesNumbers({ values: cells });
|
|
379
|
+
}
|
|
380
|
+
return allNumbers ??= treeNumbers(data);
|
|
381
|
+
}, rewrite = (example, owner, field) => {
|
|
382
|
+
let translated = spreadsheetExample(example);
|
|
383
|
+
if (translated)
|
|
384
|
+
return warned.has(example) || (warned.add(example), warnings.push({
|
|
385
|
+
code: "format-spreadsheet-code",
|
|
386
|
+
severity: "warn",
|
|
387
|
+
message: `format '${example}' is a spreadsheet number code, so the chart prints it as the example '${translated.example}'${translated.notes.length ? `; ${translated.notes.join("; ")}` : ""}`,
|
|
388
|
+
suggest: `write the example '${translated.example}' instead`,
|
|
389
|
+
field
|
|
390
|
+
})), translated.example;
|
|
391
|
+
let standIn = unitOnlyExample(example);
|
|
392
|
+
if (!standIn) return example;
|
|
393
|
+
let numbers2 = numbersOf(owner);
|
|
394
|
+
if (!numbers2?.length) return standIn;
|
|
395
|
+
let spec = parseFormatExample(standIn), smallest = 1 / 0;
|
|
396
|
+
for (let value of numbers2) {
|
|
397
|
+
let scaled = Math.abs(value / MAGNITUDE_DIVISOR[spec.magnitude]);
|
|
398
|
+
scaled > 0 && scaled < smallest && (smallest = scaled);
|
|
399
|
+
}
|
|
400
|
+
let figures = smallest < 1 ? Math.min(20, 1 - Math.floor(Math.log10(smallest))) : 0, decimals = Math.max(rasterDecimals(numbers2, spec), figures), body = numericBody(standIn), whole = spec.thousandsSep ? "1,234" : decimals === 3 ? "0" : "1";
|
|
401
|
+
return standIn.slice(0, body.index) + whole + (decimals ? `.${"5".repeat(decimals)}` : "") + standIn.slice(body.index + body.text.trimEnd().length);
|
|
402
|
+
};
|
|
403
|
+
data = mapExamples(data, rewrite, void 0, "format", ["data"]), options = mapExamples(options, rewrite, void 0, "format", ["options"]);
|
|
404
|
+
let examples = /* @__PURE__ */ new Set(), collect = (example) => (decimalExample(example) !== void 0 && examples.add(example), example);
|
|
405
|
+
if (mapExamples(data, collect), mapExamples(options, collect), examples.size === 0) return { data, options, warnings };
|
|
406
|
+
let numbers = treeNumbers(data), readings = new Map([...examples].map((example) => [example, exampleReading(example, numbers)])), change = (example) => readings.get(example)?.decimals ?? example;
|
|
407
|
+
return {
|
|
408
|
+
data: mapExamples(data, change),
|
|
409
|
+
options: mapExamples(options, change),
|
|
410
|
+
warnings: [...warnings, ...[...readings].flatMap(([example, { lost }]) => lost === void 0 ? [] : [{
|
|
411
|
+
code: "format-reads-as-group",
|
|
412
|
+
severity: "warn",
|
|
413
|
+
message: `format '${example}' reads as a thousands group on this chart, so ${lost} prints ${formatWithSpec(lost, parseFormatExample(example))}`,
|
|
414
|
+
suggest: `write ${JSON.stringify(decimalExample(example))} for three decimals, or remove the format to let the engine pick the precision`
|
|
415
|
+
}])]
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
var GROUP_SPACES = " \xA0\u202F\u2009", NUMBER_RUN = new RegExp(`(?:(?<!\\p{L})[.,](?=[0-9]))?[0-9][0-9.,'${GROUP_SPACES}]*`, "u");
|
|
129
419
|
function numericBody(s) {
|
|
130
420
|
let first = NUMBER_RUN.exec(s);
|
|
131
421
|
if (!first) return null;
|
|
@@ -134,14 +424,14 @@ function numericBody(s) {
|
|
|
134
424
|
let unitEnd = first.index + /^[^\s\u00a0\u202f]+/u.exec(first[0])[0].length, runs = new RegExp(NUMBER_RUN.source, "gu");
|
|
135
425
|
runs.lastIndex = unitEnd;
|
|
136
426
|
for (let run = runs.exec(s); run; run = runs.exec(s)) {
|
|
137
|
-
if (/[\p{L}\p{N}.,]$/u.test(s.slice(0, run.index))) continue;
|
|
427
|
+
if (/[Ee][+-]?$/.test(s.slice(0, run.index)) || /[\p{L}\p{N}.,]$/u.test(s.slice(0, run.index))) continue;
|
|
138
428
|
let open = s.lastIndexOf("(", run.index);
|
|
139
429
|
if (!(open > s.lastIndexOf(")", run.index) && /\p{L}/u.test(s.slice(open, s.indexOf(")", run.index) >>> 0)))) return { index: run.index, text: run[0] };
|
|
140
430
|
}
|
|
141
431
|
return body;
|
|
142
432
|
}
|
|
143
433
|
function analyzeBody(body, spec) {
|
|
144
|
-
let seps = body.match(
|
|
434
|
+
let seps = body.match(new RegExp(`[.,'${GROUP_SPACES}]`, "g")) ?? [];
|
|
145
435
|
if (seps.length === 0) {
|
|
146
436
|
spec.decimals = 0;
|
|
147
437
|
return;
|
|
@@ -157,10 +447,10 @@ function analyzeBody(body, spec) {
|
|
|
157
447
|
return;
|
|
158
448
|
}
|
|
159
449
|
let ch = uniqueSeps[0], fractionOnly = /^0?$/.test(body.slice(0, lastIdx));
|
|
160
|
-
ch
|
|
450
|
+
GROUP_SPACES.includes(ch) || ch === "'" || seps.length > 1 || digitsAfterLast === 3 && !fractionOnly ? asThousands(ch) : asDecimal(ch);
|
|
161
451
|
}
|
|
162
452
|
function normalizeSep(ch) {
|
|
163
|
-
return ch
|
|
453
|
+
return GROUP_SPACES.includes(ch) ? " " : ch;
|
|
164
454
|
}
|
|
165
455
|
var MAGNITUDE_DIVISOR = {
|
|
166
456
|
none: 1,
|
|
@@ -184,13 +474,19 @@ function sameScale(a, b) {
|
|
|
184
474
|
}
|
|
185
475
|
function unitOfSpec(spec) {
|
|
186
476
|
if (spec.suffix.includes("%") || specUnitKind(spec) === "pp") return null;
|
|
187
|
-
let unit =
|
|
477
|
+
let magnitude = magnitudeText(spec, spec.magnitude), unit = !spec.magnitudeWord && /^\s/.test(magnitude) ? [spec.prefix.trim(), magnitude.trim(), spec.suffix.trim()].filter(Boolean).join(" ") : `${spec.prefix.trim()}${magnitude.trim()}${spec.suffix.trim()}`;
|
|
188
478
|
return unit.length > 0 ? unit : null;
|
|
189
479
|
}
|
|
190
480
|
function specUnitKind(spec) {
|
|
191
481
|
let suffix = spec.suffix.trim().toLowerCase().replace(/\s+/g, "");
|
|
192
482
|
return suffix === "pp" || suffix === "p.p." ? "pp" : spec.suffix.includes("%") ? "percent" : "number";
|
|
193
483
|
}
|
|
484
|
+
function nonAdditiveSpec(spec) {
|
|
485
|
+
return specUnitKind(spec) !== "number" || /^[x×]$/i.test(spec.suffix.trim());
|
|
486
|
+
}
|
|
487
|
+
function nonAdditiveFormat(format) {
|
|
488
|
+
return !!format && nonAdditiveSpec(parseFormatExample(format));
|
|
489
|
+
}
|
|
194
490
|
var MAGNITUDE_PREVIOUS = { k: "none", m: "k", bn: "m", t: "bn" }, MAGNITUDE_NEXT = {
|
|
195
491
|
none: null,
|
|
196
492
|
k: "m",
|
|
@@ -217,8 +513,8 @@ function effectiveScale(value, spec) {
|
|
|
217
513
|
let scaled = Math.abs(value) / MAGNITUDE_DIVISOR[magnitude];
|
|
218
514
|
decimals = !currencyWhole && scaled < 10 && magnitude !== spec.magnitude ? Math.max(baseDecimals, 1) : baseDecimals;
|
|
219
515
|
let next = MAGNITUDE_NEXT[magnitude];
|
|
220
|
-
if (Number(scaled.toFixed(decimals)) < 1e3 || next === null)
|
|
221
|
-
return !spec.nonzero || spec.automatic || value === 0 || !roundsToZero(scaled, decimals) ? { magnitude, decimals } : rolledDown(value, magnitude, baseDecimals);
|
|
516
|
+
if ((spec.significantDigits === void 0 ? Number(scaled.toFixed(decimals)) : Number(roundSignificant(scaled, spec.significantDigits).text)) < 1e3 || next === null)
|
|
517
|
+
return !spec.nonzero || spec.automatic || spec.significantDigits !== void 0 || value === 0 || !roundsToZero(scaled, decimals) ? { magnitude, decimals } : rolledDown(value, magnitude, baseDecimals);
|
|
222
518
|
magnitude = next;
|
|
223
519
|
}
|
|
224
520
|
}
|
|
@@ -260,12 +556,12 @@ function magnitudeLabel(spec, magnitude) {
|
|
|
260
556
|
return magnitudeSuffix(magnitude, spec.locale);
|
|
261
557
|
}
|
|
262
558
|
function magnitudeText(spec, magnitude, printed = "", printedValue = 0) {
|
|
263
|
-
if (magnitude === "none") return "";
|
|
559
|
+
if (magnitude === "none" || spec.magnitudeInAffix) return "";
|
|
264
560
|
let authored = spec.magnitudeWord;
|
|
265
561
|
if (!authored) return magnitudeLabel(spec, magnitude);
|
|
266
562
|
let authoredFamily = wordFamily(authored.text, spec.locale), language = chartLanguage(spec.locale), family = localFamily(authoredFamily, language), space = /^\s*/.exec(authored.text)[0];
|
|
267
563
|
if (family === LETTERS)
|
|
268
|
-
return (language === "de" || language === "fr") && (magnitude === "bn" || magnitude === "t") ? magnitudeSuffix(magnitude, spec.locale) : authored.magnitude === magnitude ? authored.text : MAGNITUDE_LABEL[magnitude];
|
|
564
|
+
return (language === "de" || language === "fr") && (magnitude === "bn" || magnitude === "t") ? magnitudeSuffix(magnitude, spec.locale) : authored.magnitude === magnitude ? authored.text : space + MAGNITUDE_LABEL[magnitude];
|
|
269
565
|
if (authored.magnitude === magnitude && family === authoredFamily && family !== FAMILIES.wort && family !== FAMILIES.mot) return authored.text;
|
|
270
566
|
let one = family.one?.[magnitude], singular = family === FAMILIES.mot ? printedValue < 2 : /^[−+-]?1$/.test(printed), word = one !== void 0 && singular ? one : family.words[magnitude];
|
|
271
567
|
return family === FAMILIES.tsd ? family === authoredFamily ? space + (authored.text.endsWith(".") ? word : word.slice(0, -1)) : " " + word : family.language === "de" || family.language === "fr" ? space + word : space + authoredCase(word, authored.text);
|
|
@@ -323,10 +619,32 @@ function formatWithSpec(value, spec) {
|
|
|
323
619
|
let before = zeroLifts.count, text = formatWithSpecUncached(value, spec);
|
|
324
620
|
return texts.set(value, { text, lifts: zeroLifts.count - before }), specTexts++, text;
|
|
325
621
|
}
|
|
622
|
+
function signedText(core, negative, zero, spec) {
|
|
623
|
+
if (spec.glyphs) {
|
|
624
|
+
if (zero) return core;
|
|
625
|
+
let glyph = negative ? spec.glyphs.down : spec.glyphs.up;
|
|
626
|
+
return spec.glyphs.at === "start" ? glyph + spec.glyphs.space + core : core + spec.glyphs.space + glyph;
|
|
627
|
+
}
|
|
628
|
+
return negative ? spec.negative === "parens" ? `(${core})` : spec.negative === "trailing" ? core + spec.trailingMinus : MINUS + core : spec.signed && !zero ? `+${core}` : core;
|
|
629
|
+
}
|
|
630
|
+
function ordinalText(integer, style) {
|
|
631
|
+
let lastTwo = integer % 100, suffix = lastTwo >= 11 && lastTwo <= 13 ? "th" : { 1: "st", 2: "nd", 3: "rd" }[integer % 10] ?? "th";
|
|
632
|
+
return style === "upper" ? suffix.toUpperCase() : suffix;
|
|
633
|
+
}
|
|
634
|
+
function exampleScientific(value, spec) {
|
|
635
|
+
let [coefficient, power] = Math.abs(value).toExponential().split("e"), exponent = Number(power), mantissa = roundHalfUp(Number(coefficient), spec.decimals);
|
|
636
|
+
Number(mantissa) >= 10 && (exponent++, mantissa = roundHalfUp(Number(mantissa) / 10, spec.decimals));
|
|
637
|
+
let rounded = +`${mantissa}e${exponent}`;
|
|
638
|
+
return { mantissa, exponent, value: value < 0 ? -rounded : rounded };
|
|
639
|
+
}
|
|
326
640
|
function formatWithSpecUncached(value, spec) {
|
|
327
641
|
if (value == null) return "";
|
|
328
642
|
let glyph = nonFiniteGlyph(value);
|
|
329
643
|
if (glyph !== null) return glyph === "n/a" ? chartString({ locale: { language: spec.locale } }, "notApplicable") : glyph;
|
|
644
|
+
if (spec.exponent) {
|
|
645
|
+
let { mantissa, exponent } = exampleScientific(value, spec), digits = spec.locale ? fractionFormat(spec.locale, spec.decimals, !1).format(Number(mantissa)) : mantissa.replace(".", spec.decimalSep), power = `${exponent < 0 ? "-" : spec.exponent.sign}${String(Math.abs(exponent)).padStart(spec.exponent.digits, "0")}`;
|
|
646
|
+
return signedText(`${spec.prefix}${digits}${spec.exponent.letter}${power}${spec.suffix}`, value < 0, value === 0, spec);
|
|
647
|
+
}
|
|
330
648
|
let { magnitude, decimals } = effectiveScale(value, spec), scaled = value / MAGNITUDE_DIVISOR[magnitude], abs = Math.abs(scaled), { rounded, pValue, mode } = printedRounding(abs, scaled, spec, decimals), scientific;
|
|
331
649
|
if (mode !== void 0) {
|
|
332
650
|
if (mode === "bound") {
|
|
@@ -339,11 +657,12 @@ function formatWithSpecUncached(value, spec) {
|
|
|
339
657
|
let underflow = spec.automatic && scaled === 0 && value !== 0 ? underflowScientificText(value, MAGNITUDE_DIVISOR[magnitude]) : void 0;
|
|
340
658
|
underflow && zeroLifts.count++;
|
|
341
659
|
let isZero = !underflow && !scientific && Number(rounded.text) === 0, negative = value < 0 && !isZero, [intPart, fracPart] = rounded.text.split("."), num = groupInteger(intPart, spec.thousandsSep === " " ? "\xA0" : spec.thousandsSep);
|
|
342
|
-
rounded.decimals > 0 && (num += spec.decimalSep + (fracPart ?? "")), scientific ? num = scientific : spec.locale && (num = fractionFormat(spec.locale, rounded.decimals, spec.thousandsSep !== "").format(Number(rounded.text))), underflow && (num = underflow), pValue && (num = withoutLeadingZero(num)), num += magnitudeText(spec, magnitude, num, Number(rounded.text));
|
|
660
|
+
rounded.decimals > 0 && (num += spec.decimalSep + (fracPart ?? "")), scientific ? num = scientific : spec.locale && (num = fractionFormat(spec.locale, rounded.decimals, spec.thousandsSep !== "").format(Number(rounded.text))), underflow && (num = underflow), pValue && (num = withoutLeadingZero(num)), num += magnitudeText(spec, magnitude, num, Number(rounded.text)), spec.ordinal && (num += ordinalText(Number(rounded.text), spec.ordinal));
|
|
343
661
|
let core = `${spec.prefix}${num}${spec.suffix}`;
|
|
344
|
-
return
|
|
662
|
+
return signedText(core, negative, isZero, spec);
|
|
345
663
|
}
|
|
346
664
|
function roundedNumber(value, spec) {
|
|
665
|
+
if (spec.exponent && Number.isFinite(value)) return exampleScientific(value, spec).value;
|
|
347
666
|
let { magnitude, decimals } = effectiveScale(value, spec), divisor = MAGNITUDE_DIVISOR[magnitude], scaled = value / divisor;
|
|
348
667
|
if (spec.automatic && scaled === 0 && value !== 0) return Number(value.toPrecision(1));
|
|
349
668
|
let { rounded, mode } = printedRounding(Math.abs(scaled), scaled, spec, decimals), parts = mode === "scientific" ? scientificParts(Math.abs(scaled)) : void 0, abs = parts ? +`${parts.digits}e${parts.exponent}` : mode === "bound" ? 10 ** -rounded.decimals : Number(rounded.text);
|
|
@@ -355,14 +674,17 @@ function withChartMarks(spec, locale) {
|
|
|
355
674
|
function localized(spec, locale) {
|
|
356
675
|
return locale ? { ...spec, locale } : spec;
|
|
357
676
|
}
|
|
358
|
-
function exampleSpec(example, locale, unit) {
|
|
677
|
+
function exampleSpec(example, locale, unit, values) {
|
|
359
678
|
let spec = localized(parseFormatExample(example, !0), locale);
|
|
360
|
-
if (spec.nonzero = !0, spec.magnitude !== "none" && unitMagnitude(unit) === spec.magnitude && (spec.rollMagnitude = !1), spec.prefix.endsWith("#")) return spec;
|
|
361
|
-
let body = numericBody(String(example))?.text ?? "", integer = spec.decimals > 0 ? body.slice(0, body.lastIndexOf(spec.decimalSep)) : body;
|
|
679
|
+
if (spec.nonzero = !0, spec.magnitude !== "none" && unitMagnitude(unit) === spec.magnitude && (spec.rollMagnitude = !1), values && shareAuthoredScale(spec, [...values]), spec.prefix.endsWith("#") || spec.exponent) return spec;
|
|
680
|
+
let body = numericBody(formatExampleText(String(example)))?.text ?? "", integer = spec.decimals > 0 ? body.slice(0, body.lastIndexOf(spec.decimalSep)) : body;
|
|
362
681
|
return spec.thousandsSep === "" && integer.replace(/\D/g, "").length < 4 && (spec.thousandsSep = spec.decimalSep === "," ? "." : ","), spec;
|
|
363
682
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
683
|
+
function shareFormatExample(options) {
|
|
684
|
+
return options.shareLabels?.format ? formatExampleText(options.shareLabels.format) : options.format && parseFormatExample(options.format).suffix.includes("%") ? formatExampleText(options.format) : void 0;
|
|
685
|
+
}
|
|
686
|
+
function formatterFromExample(example, locale, unit, values) {
|
|
687
|
+
let spec = exampleSpec(example, locale, unit, values);
|
|
366
688
|
return (value) => formatWithSpec(value, spec);
|
|
367
689
|
}
|
|
368
690
|
function formatNonzeroWithSpec(value, spec) {
|
|
@@ -370,12 +692,20 @@ function formatNonzeroWithSpec(value, spec) {
|
|
|
370
692
|
let scaled = value / MAGNITUDE_DIVISOR[spec.autoMagnitude ? effectiveScale(value, spec).magnitude : spec.magnitude], lifted = nonzeroDecimals(scaled, spec.decimals);
|
|
371
693
|
return formatWithSpec(value, { ...spec, decimals: roundsToZero(scaled, lifted) ? spec.decimals : lifted });
|
|
372
694
|
}
|
|
373
|
-
function signedFormatterFromExample(example, locale, unit) {
|
|
374
|
-
let spec = { ...exampleSpec(example, locale, unit), signed: !0 };
|
|
695
|
+
function signedFormatterFromExample(example, locale, unit, values) {
|
|
696
|
+
let spec = { ...exampleSpec(example, locale, unit, values), signed: !0 };
|
|
375
697
|
return (value) => formatWithSpec(value, spec);
|
|
376
698
|
}
|
|
699
|
+
function levelFormatSpec(spec) {
|
|
700
|
+
let level = { ...spec, signed: !1 };
|
|
701
|
+
return delete level.glyphs, level;
|
|
702
|
+
}
|
|
703
|
+
function levelFormatterFromExample(example, locale, unit, values) {
|
|
704
|
+
let level = levelFormatSpec(exampleSpec(example, locale, unit, values));
|
|
705
|
+
return (value) => formatWithSpec(value, level);
|
|
706
|
+
}
|
|
377
707
|
function differenceExample(example) {
|
|
378
|
-
return specUnitKind(parseFormatExample(example)) === "percent" ? example.replace(/%/g, "pp") : example;
|
|
708
|
+
return example = formatExampleText(example), specUnitKind(parseFormatExample(example)) === "percent" ? example.replace(/%/g, "pp") : example;
|
|
379
709
|
}
|
|
380
710
|
function decimalCap(scaled, authored = 0) {
|
|
381
711
|
let max = 0;
|
|
@@ -408,12 +738,9 @@ function rasterDecimals(values, spec) {
|
|
|
408
738
|
}, 0);
|
|
409
739
|
}
|
|
410
740
|
function formatStatWithSpec(value, spec) {
|
|
411
|
-
return formatWithSpec(value,
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
wholeFrom: void 0,
|
|
415
|
-
decimals: Math.max(spec.decimals, neededDecimals(value, spec.decimals + 1))
|
|
416
|
-
});
|
|
741
|
+
if (spec.exponent) return formatWithSpec(value, spec);
|
|
742
|
+
let own = { ...spec, wholeFrom: void 0 }, scaled = value / MAGNITUDE_DIVISOR[effectiveScale(value, own).magnitude];
|
|
743
|
+
return formatWithSpec(value, { ...own, decimals: Math.max(spec.decimals, neededDecimals(scaled, spec.decimals + 1)) });
|
|
417
744
|
}
|
|
418
745
|
function trendRateFormatter(example, locale, unit, signed = !1) {
|
|
419
746
|
let spec = example ? exampleSpec(example, locale) : defaultFormatSpec(locale), face = {
|
|
@@ -422,8 +749,8 @@ function trendRateFormatter(example, locale, unit, signed = !1) {
|
|
|
422
749
|
signed,
|
|
423
750
|
negative: signed ? spec.negative : "minus",
|
|
424
751
|
suffix: spec.suffix.includes("%") ? spec.suffix.replace(/%/g, "pp") : unit?.includes("%") ? "pp" : spec.suffix
|
|
425
|
-
}, precision = (scaled) => scaled === 0 || scaled >= 100 ? 0 : scaled >= 1 ? 1 : 1 - Math.floor(Math.log10(scaled));
|
|
426
|
-
return (rate) => {
|
|
752
|
+
}, missingUnit = spec.prefix || face.suffix || spec.magnitude !== "none" ? void 0 : unit, precision = (scaled) => scaled === 0 || scaled >= 100 ? 0 : scaled >= 1 ? 1 : 1 - Math.floor(Math.log10(scaled));
|
|
753
|
+
return spec.magnitudeInAffix || spec.exponent ? (rate) => withUnit(formatWithSpec(rate, face), missingUnit, !1, locale) : (rate) => {
|
|
427
754
|
let abs = Math.abs(rate), magnitude = spec.magnitude === "none" ? "none" : abs >= 1e9 ? "bn" : abs >= 1e6 ? "m" : abs >= 1e3 ? "k" : "none", decimals = 0, authored = !1;
|
|
428
755
|
for (; ; ) {
|
|
429
756
|
let scaled = abs / MAGNITUDE_DIVISOR[magnitude], order = scaled === 0 ? 0 : Math.floor(Math.log10(scaled));
|
|
@@ -435,11 +762,20 @@ function trendRateFormatter(example, locale, unit, signed = !1) {
|
|
|
435
762
|
let scientific = !authored && decimals > AUTO_MAX_DECIMALS, rateSpec = { ...face, magnitude, decimals: Math.min(20, decimals), rollMagnitude: !1 };
|
|
436
763
|
if (scientific) {
|
|
437
764
|
let { digits } = scientificParts(Math.abs(rate));
|
|
438
|
-
return formatWithSpec(Math.sign(rate) * digits, { ...rateSpec, decimals: 1, suffix: `${scientificText(Math.abs(rate), () => "")}${face.suffix}` });
|
|
765
|
+
return withUnit(formatWithSpec(Math.sign(rate) * digits, { ...rateSpec, decimals: 1, suffix: `${scientificText(Math.abs(rate), () => "")}${face.suffix}` }), missingUnit, !1, locale);
|
|
439
766
|
}
|
|
440
|
-
return formatWithSpec(rate, rateSpec);
|
|
767
|
+
return withUnit(formatWithSpec(rate, rateSpec), missingUnit, !1, locale);
|
|
441
768
|
};
|
|
442
769
|
}
|
|
770
|
+
var SCALE_MAX_DECIMALS = 3;
|
|
771
|
+
function shareAuthoredScale(spec, values) {
|
|
772
|
+
let shown = values.flatMap((value) => value != null && Number.isFinite(value) && value !== 0 ? [Math.abs(value)] : []);
|
|
773
|
+
if (spec.magnitude === "none" || shown.length === 0) return;
|
|
774
|
+
let locked = spec.rollMagnitude === !1, largest = maxOf(shown), magnitude = spec.magnitude;
|
|
775
|
+
for (; !locked && magnitude !== "none" && largest < MAGNITUDE_DIVISOR[magnitude]; ) magnitude = MAGNITUDE_PREVIOUS[magnitude];
|
|
776
|
+
let divisor = MAGNITUDE_DIVISOR[magnitude], decimals = Math.max(spec.decimals, -Math.floor(Math.log10(minOf(shown) / divisor)));
|
|
777
|
+
spec.magnitude = magnitude, (locked || decimals <= SCALE_MAX_DECIMALS) && (spec.decimals = Math.min(20, decimals));
|
|
778
|
+
}
|
|
443
779
|
function defaultFormatSpec(locale) {
|
|
444
780
|
return {
|
|
445
781
|
decimals: 0,
|
|
@@ -461,7 +797,7 @@ function percentRasterFormatter(values, locale) {
|
|
|
461
797
|
return (value) => formatPercent(value, Math.max(decimals, smallRateDecimals(value)), !1, locale, !0);
|
|
462
798
|
}
|
|
463
799
|
function unscaledFormatLint(options, data, geo) {
|
|
464
|
-
let
|
|
800
|
+
let authored = typeof options?.format == "string" ? options.format : void 0, own = data, numbers = [
|
|
465
801
|
...Array.isArray(own?.series) ? own.series : [],
|
|
466
802
|
...Array.isArray(own?.values) ? [own] : [],
|
|
467
803
|
...Array.isArray(own?.items) ? [{ values: own.items.map((item) => item?.value) }] : []
|
|
@@ -477,28 +813,29 @@ function unscaledFormatLint(options, data, geo) {
|
|
|
477
813
|
suggest: `give the values in the unit's scale (${unit}), or set options.unit to the base unit and let the engine pick k, M or B`,
|
|
478
814
|
field: ["options", "unit"]
|
|
479
815
|
}];
|
|
480
|
-
if (!
|
|
481
|
-
let spec;
|
|
816
|
+
if (!authored) return [];
|
|
817
|
+
let format, spec;
|
|
482
818
|
try {
|
|
483
|
-
spec = parseFormatExample(format);
|
|
819
|
+
format = formatExampleText(authored), format = exampleReading(format, numbers.flat()).decimals ?? format, spec = parseFormatExample(format);
|
|
484
820
|
} catch {
|
|
485
821
|
return [];
|
|
486
822
|
}
|
|
487
|
-
|
|
488
|
-
|
|
823
|
+
if (spec.ordinal || spec.exponent) return [];
|
|
824
|
+
let found = numericBody(format), body = found && { index: found.index, text: found.text.trimEnd() }, figures = spec.significantDigits, checked = options?.variant !== "bump" && !spec.suffix.includes("%") && figures === void 0, zero = formatWithSpec(0, spec), zeroed = checked ? numbers.flat().filter((v) => v !== 0 && formatWithSpec(v, spec) === zero) : [], locale = options?.locale?.language, shared = spec.magnitude !== "none" && figures === void 0 ? seriesRasterFormatter(format, numbers.flat(), locale, unit) : void 0, raised = checked && shared !== void 0 && shared.spec.decimals > spec.decimals, smallest = numbers.flat().reduce((small, v) => v !== 0 && (small === 0 || Math.abs(v) < Math.abs(small)) ? v : small, 0), distinct = (row) => new Set(row.map((v) => Number(v.toPrecision(12)))).size, hidden = (row) => distinct(row) > 1 && new Set(row.map((v) => formatWithSpec(v, spec))).size === 1;
|
|
825
|
+
if ((checked && numbers.some(hidden) || raised || zeroed.length > 0) && body) {
|
|
489
826
|
let finerAt = (decimals2) => format.slice(0, body.index) + formatWithSpec(
|
|
490
827
|
(spec.thousandsSep ? 1234 : decimals2 === 3 ? 0 : 1) + 0.123456789,
|
|
491
828
|
{ ...spec, decimals: decimals2, signed: !1, prefix: "", suffix: "", magnitude: "none", magnitudeWord: void 0, locale: void 0 }
|
|
492
829
|
) + format.slice(body.index + body.text.length), shows = (example) => {
|
|
493
830
|
let finerSpec = parseFormatExample(example), print = (v) => formatWithSpec(v, finerSpec);
|
|
494
831
|
return zeroed.every((v) => print(v) !== print(0)) && numbers.every((row) => !hidden(row) || new Set(row.map(print)).size >= distinct(row));
|
|
495
|
-
}, decimals = spec.decimals + 1;
|
|
832
|
+
}, decimals = Math.max(spec.decimals + 1, raised ? shared.spec.decimals : 0);
|
|
496
833
|
for (; decimals < 20 && !shows(finerAt(decimals)); ) decimals++;
|
|
497
834
|
let finer = finerAt(decimals);
|
|
498
835
|
return [{
|
|
499
836
|
code: "format-hides-values",
|
|
500
837
|
severity: "warn",
|
|
501
|
-
message: zeroed.length > 0 ? `format '${format}' prints the nonzero value ${zeroed[0]} as ${zero}` : `format '${format}' prints the different values of a series as one string`,
|
|
838
|
+
message: raised ? `format '${format}' cannot show ${smallest} near its size, so the chart prints every value with ${shared.spec.decimals} decimals: ${smallest} as ${shared.fmt(smallest)}` : shared && zeroed.length > 0 ? `format '${format}' cannot show ${zeroed[0]} on its scale, so the chart prints it as ${shared.fmt(zeroed[0])}` : zeroed.length > 0 ? `format '${format}' prints the nonzero value ${zeroed[0]} as ${zero}` : `format '${format}' prints the different values of a series as one string`,
|
|
502
839
|
suggest: `set a finer format such as '${finer}', or remove options.format to let the engine pick the precision`,
|
|
503
840
|
field: ["options", "format"],
|
|
504
841
|
fix: [{ op: "replace", path: "/options/format", value: finer }]
|
|
@@ -507,7 +844,7 @@ function unscaledFormatLint(options, data, geo) {
|
|
|
507
844
|
if (spec.magnitude !== "none" || spec.suffix.includes("%") || unitMagnitude(unit)) return [];
|
|
508
845
|
let largest = Math.max(0, maxOf(numbers.flat().map(Math.abs)));
|
|
509
846
|
if (largest < 1e6) return [];
|
|
510
|
-
let compact = `${spec.prefix}1${spec.decimalSep}2${largest >= 1e9 ? "bn" : "m"}${spec.suffix}`;
|
|
847
|
+
let compact = `${spec.prefix}${figures === void 0 ? `1${spec.decimalSep}2` : "@".repeat(figures)}${largest >= 1e9 ? "bn" : "m"}${spec.suffix}`;
|
|
511
848
|
return [{
|
|
512
849
|
code: "format-unscaled",
|
|
513
850
|
severity: "warn",
|
|
@@ -524,15 +861,15 @@ function drawnNumberTexts(geo) {
|
|
|
524
861
|
...geo.scene.flatMap((node) => node.t === "text" && node.id.includes(":tick:") ? [node.lines.join(" ")] : [])
|
|
525
862
|
];
|
|
526
863
|
}
|
|
527
|
-
var MAGNITUDE_UNIT = /^\W*(?:([a-z]{3})(\W*))?(k|mm?|mn|bn?|tn|tsd|mio|mrd|bio|thousands?|tausend|millions?|millionen|billions?|billionen|trillions?|milliard(?:en?|s)?)\W
|
|
864
|
+
var MAGNITUDE_UNIT = /^\W*(?:([a-z]{3})(\W*))?(k|mm?|mn|bn?|tn|tsd|mio|mrd|bio|thousands?|tausend|millions?|millionen|billions?|billionen|trillions?|milliard(?:en?|s)?)\W*(?:([a-z]{3})\W*)?$/i, CURRENCY_CODES = new Set(Intl.supportedValuesOf("currency"));
|
|
528
865
|
function unitMagnitude(unit) {
|
|
529
866
|
let match = MAGNITUDE_UNIT.exec(unit ?? "");
|
|
530
|
-
if (!match || match[1] && !match[2] && !CURRENCY_CODES.has(match[1].toUpperCase())) return;
|
|
867
|
+
if (!match || match[1] && !match[2] && !CURRENCY_CODES.has(match[1].toUpperCase()) || match[4] && (match[1] || !CURRENCY_CODES.has(match[4].toUpperCase()))) return;
|
|
531
868
|
let letter = MAGNITUDE_WORD_LETTER[match[3].toLowerCase()] ?? match[3].toLowerCase();
|
|
532
869
|
return letter === "k" ? "k" : letter === "b" ? "bn" : letter === "t" ? "t" : "m";
|
|
533
870
|
}
|
|
534
871
|
function seriesRasterFormatter(example, values, locale, unit, target, defaultExample, shared = !1) {
|
|
535
|
-
let raster = [...values], unitScale = unitMagnitude(unit), spec = example ? exampleSpec(example, locale, unit) : defaultExample ? localized(parseFormatExample(defaultExample, !0), locale) : defaultFormatSpec(locale);
|
|
872
|
+
let raster = [...values], unitScale = unitMagnitude(unit), spec = example ? exampleSpec(example, locale, unit, raster) : defaultExample ? localized(parseFormatExample(defaultExample, !0), locale) : defaultFormatSpec(locale);
|
|
536
873
|
example || (spec.automatic = !0);
|
|
537
874
|
let unscaledSpec = { ...spec }, autoMagnitude = !1;
|
|
538
875
|
if (!example && target !== void 0 && spec.magnitude === "none" && !unitScale) {
|
|
@@ -565,14 +902,19 @@ function seriesRasterFormatter(example, values, locale, unit, target, defaultExa
|
|
|
565
902
|
made = decimals === base.decimals ? base : { ...base, decimals }, seriesSpecs.set(series, made);
|
|
566
903
|
}
|
|
567
904
|
return made;
|
|
568
|
-
},
|
|
569
|
-
|
|
905
|
+
}, plainSpec = (series) => {
|
|
906
|
+
let wholeFrom = !defaultExample && unitMagnitude(series.unit) ? 100 : void 0, currencyWhole = currencyWholeNumbers(series.unit, target), unscaled = autoMagnitude && unitMagnitude(series.unit) !== void 0, base = example || series.unit === void 0 || wholeFrom === spec.wholeFrom && currencyWhole === !!spec.currencyWhole && !unscaled ? spec : { ...unscaled ? { ...spec, magnitude: "none", autoMagnitude: void 0, rollMagnitude: void 0 } : spec, wholeFrom, currencyWhole };
|
|
907
|
+
return ownPrecision(series, base);
|
|
908
|
+
}, specForSeries = (series) => series.format ? exampleSpec(series.format, locale, series.unit ?? unit, normalizedSeriesNumbers(series)) : plainSpec(series), seriesFormatters = /* @__PURE__ */ new WeakMap(), forSeries = (series, cellFormat) => {
|
|
909
|
+
if (cellFormat) return byExample(cellFormat, series.unit ?? unit);
|
|
570
910
|
let formatter = seriesFormatters.get(series);
|
|
571
911
|
if (formatter) return formatter;
|
|
572
|
-
|
|
912
|
+
if (series.format)
|
|
913
|
+
return formatter = formatterFromExample(series.format, locale, series.unit ?? unit, normalizedSeriesNumbers(series)), seriesFormatters.set(series, formatter), formatter;
|
|
914
|
+
let own = plainSpec(series);
|
|
573
915
|
return formatter = own === spec ? fmt : (value) => face(value, own), seriesFormatters.set(series, formatter), formatter;
|
|
574
916
|
};
|
|
575
|
-
return { spec, fmt, fmtSigned, fmtPercent, percentSpec: example ? spec : percentSpec, forSeries, roundsToZeroAt: (value, series = {}, cellFormat) => {
|
|
917
|
+
return { spec, fmt, fmtSigned, fmtPercent, percentSpec: example ? spec : percentSpec, forSeries, specForSeries, roundsToZeroAt: (value, series = {}, cellFormat) => {
|
|
576
918
|
if (example || cellFormat || series.format) {
|
|
577
919
|
let formatter = forSeries(series, cellFormat);
|
|
578
920
|
return formatter(value) === formatter(0);
|
|
@@ -604,6 +946,10 @@ function memoFormatterFromExample(locale) {
|
|
|
604
946
|
}
|
|
605
947
|
|
|
606
948
|
// src/core/isoDate.ts
|
|
949
|
+
function utcDate(year, month, day = 1) {
|
|
950
|
+
let date = /* @__PURE__ */ new Date(0);
|
|
951
|
+
return date.setUTCFullYear(year, month, day), date;
|
|
952
|
+
}
|
|
607
953
|
function parseISODate(s) {
|
|
608
954
|
if (typeof s != "string") return null;
|
|
609
955
|
let m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s);
|
|
@@ -613,26 +959,33 @@ function parseISODate(s) {
|
|
|
613
959
|
}
|
|
614
960
|
|
|
615
961
|
export {
|
|
962
|
+
withUnit,
|
|
616
963
|
AUTOMATIC_FORMAT,
|
|
617
964
|
MAGNITUDE_GROUP,
|
|
618
965
|
parseFormatExample,
|
|
966
|
+
formatExampleText,
|
|
619
967
|
formatExampleProblem,
|
|
968
|
+
readFormatExamples,
|
|
620
969
|
MAGNITUDE_DIVISOR,
|
|
621
970
|
MAGNITUDE_LABEL,
|
|
622
971
|
sameUnit,
|
|
623
972
|
sameScale,
|
|
624
973
|
unitOfSpec,
|
|
625
974
|
specUnitKind,
|
|
975
|
+
nonAdditiveSpec,
|
|
976
|
+
nonAdditiveFormat,
|
|
626
977
|
effectiveScale,
|
|
627
|
-
magnitudeLabel,
|
|
628
978
|
formatWithSpec,
|
|
629
979
|
roundedNumber,
|
|
630
980
|
withChartMarks,
|
|
631
981
|
localized,
|
|
632
982
|
exampleSpec,
|
|
983
|
+
shareFormatExample,
|
|
633
984
|
formatterFromExample,
|
|
634
985
|
formatNonzeroWithSpec,
|
|
635
986
|
signedFormatterFromExample,
|
|
987
|
+
levelFormatSpec,
|
|
988
|
+
levelFormatterFromExample,
|
|
636
989
|
differenceExample,
|
|
637
990
|
decimalCap,
|
|
638
991
|
neededDecimals,
|
|
@@ -642,7 +995,10 @@ export {
|
|
|
642
995
|
defaultFormatSpec,
|
|
643
996
|
percentRasterFormatter,
|
|
644
997
|
unscaledFormatLint,
|
|
998
|
+
unitMagnitude,
|
|
645
999
|
seriesRasterFormatter,
|
|
1000
|
+
normalizedSeriesNumbers,
|
|
646
1001
|
memoFormatterFromExample,
|
|
1002
|
+
utcDate,
|
|
647
1003
|
parseISODate
|
|
648
1004
|
};
|