boardplot 0.54.0 → 0.56.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 +491 -0
- package/README.md +4 -4
- package/dist/{ReaderBox-YXC5XK7D.js → ReaderBox-GLCKYXBU.js} +14 -10
- package/dist/{annotateEngine-5O3IRSQL.js → annotateEngine-QVNAE3EH.js} +3 -1
- package/dist/build-identity.json +3 -3
- package/dist/{chunk-MT4MP3UZ.js → chunk-27OIGDRK.js} +1 -1
- package/dist/{chunk-OD3IH6FG.js → chunk-2DOEZ5QY.js} +39 -21
- package/dist/{chunk-WUKSZNHL.js → chunk-2FKEF2AC.js} +32 -21
- package/dist/{chunk-GYNZ72GO.js → chunk-2HTYGMMG.js} +2 -2
- package/dist/chunk-2NN676RI.js +25 -0
- package/dist/{chunk-4MREJWRM.js → chunk-2NRHD2G7.js} +5 -4
- package/dist/{chunk-3UBTO342.js → chunk-2NSQIPAA.js} +77 -38
- package/dist/{chunk-T7ZCYYQZ.js → chunk-2YO4WRJN.js} +25 -7
- package/dist/{chunk-SHH2AHIU.js → chunk-32LLDRPI.js} +64 -42
- package/dist/{chunk-WEPAE4KG.js → chunk-3465633G.js} +4 -4
- package/dist/{chunk-WGIO6AHP.js → chunk-37PKNVLS.js} +3 -3
- package/dist/chunk-3V62N3Z7.js +24 -0
- package/dist/{chunk-S6CRZKPO.js → chunk-43GGVT7W.js} +5 -5
- package/dist/{chunk-VDAZPGR2.js → chunk-4DZFR52I.js} +2 -2
- package/dist/{chunk-WDONXBQE.js → chunk-4JC3SE4G.js} +1 -1
- package/dist/{chunk-EHVESNLV.js → chunk-4JGBCBDZ.js} +1 -1
- package/dist/{chunk-G6XCUX3I.js → chunk-4JHMCXOB.js} +60 -13
- package/dist/{chunk-GGO43PHB.js → chunk-4KMZAK6J.js} +6 -5
- package/dist/{chunk-GVKFFJ23.js → chunk-4KQHKPB3.js} +462 -149
- package/dist/{chunk-AHQ4L3BE.js → chunk-4LTN7SND.js} +2 -2
- package/dist/{chunk-MZJBPDIL.js → chunk-52WNCUIN.js} +1 -1
- package/dist/{chunk-JAKRPSWP.js → chunk-54ROMBU7.js} +164 -51
- package/dist/{chunk-OZUTYDV4.js → chunk-5DTCOOLU.js} +2 -2
- package/dist/{chunk-DDI2W4TR.js → chunk-5P2TTHBZ.js} +3 -3
- package/dist/{chunk-U2HQELXL.js → chunk-5PPQIF4D.js} +2 -2
- package/dist/{chunk-K4K6KGEF.js → chunk-5S3JQ5AT.js} +241 -195
- package/dist/chunk-5TWY3ZIC.js +19 -0
- package/dist/{chunk-BXEM2CVW.js → chunk-6364WO5D.js} +3 -3
- package/dist/{chunk-ZNHF2XCP.js → chunk-63Y3ROZ7.js} +50 -36
- package/dist/{chunk-VAEC53B3.js → chunk-64LJDGJH.js} +3 -3
- package/dist/{chunk-WZBMTZBM.js → chunk-67QSW5RW.js} +4 -4
- package/dist/{chunk-HGGLJYPZ.js → chunk-6AMN7IKJ.js} +89 -57
- package/dist/{chunk-24BHMKDD.js → chunk-6EYTD777.js} +25 -2
- package/dist/{chunk-HZG5NB7Q.js → chunk-6MJUW5R5.js} +159 -86
- package/dist/{chunk-NGRIT3CY.js → chunk-6QDMRPXI.js} +113 -128
- package/dist/{chunk-HZZH3MQI.js → chunk-6WHWXCHJ.js} +7 -3
- package/dist/{chunk-T3PNYRDM.js → chunk-75WIUG2W.js} +394 -141
- package/dist/{chunk-ZTH6YSVA.js → chunk-76Q7E3TM.js} +117 -102
- package/dist/chunk-7ADUVRG5.js +14 -0
- package/dist/{chunk-U4P6TQRW.js → chunk-7DAH2E4T.js} +2 -2
- package/dist/{chunk-43OQ26TL.js → chunk-7FKY6YWU.js} +8 -8
- package/dist/{chunk-CPKHL7FK.js → chunk-7KSUMFBK.js} +1 -1
- package/dist/{chunk-KL2XJQAA.js → chunk-7M2GK7XQ.js} +1729 -196
- package/dist/{chunk-RZB4RPPD.js → chunk-7PPMT5EJ.js} +155 -151
- package/dist/{chunk-JFBEAUJ6.js → chunk-7Q37C6GZ.js} +1 -1
- package/dist/chunk-7STMIK2X.js +94 -0
- package/dist/{chunk-KFWEO4UA.js → chunk-7VMEM3LN.js} +254 -142
- package/dist/{chunk-GSMWHKOW.js → chunk-7VVHTOE7.js} +7 -7
- package/dist/{chunk-KBFPMESI.js → chunk-A2GAWGVJ.js} +246 -79
- package/dist/{chunk-23RWLBZF.js → chunk-AGDDH6XY.js} +3 -3
- package/dist/chunk-AMR4SUAN.js +25 -0
- package/dist/{chunk-6I7YZTY7.js → chunk-BDGLMWPO.js} +12 -4
- package/dist/{chunk-JJJ2KAHR.js → chunk-BIGQKCU7.js} +20 -9
- package/dist/{chunk-LTMF75MR.js → chunk-BISJK67O.js} +208 -62
- package/dist/{chunk-FILDYFT4.js → chunk-BIVL764T.js} +2 -2
- package/dist/{chunk-RNOJSEES.js → chunk-BK6P6KMW.js} +1 -1
- package/dist/{chunk-XB4KZ6WO.js → chunk-BSATR6ZO.js} +40 -13
- package/dist/{chunk-MYCLO35J.js → chunk-BTDGWHGJ.js} +50 -12
- package/dist/{chunk-PDG4IM3L.js → chunk-BVYIKLQ5.js} +1 -1
- package/dist/{chunk-TNHD4UTC.js → chunk-BYCJ6TKI.js} +13 -3
- package/dist/{chunk-NQSDIDRO.js → chunk-CAJ54IEP.js} +5 -5
- package/dist/{chunk-E42JZ2DA.js → chunk-CB4CERXZ.js} +4 -5
- package/dist/{chunk-ENOCOA3F.js → chunk-CCDXK5NA.js} +5 -5
- package/dist/{chunk-7X3UZM7F.js → chunk-CCJP6QZO.js} +1 -1
- package/dist/{chunk-ELPQZIGR.js → chunk-CF4NMRN7.js} +37 -13
- package/dist/{chunk-32X7JGH3.js → chunk-CHAS5A5B.js} +89 -69
- package/dist/{chunk-AVMKRVNP.js → chunk-CKGSGRP7.js} +14 -24
- package/dist/{chunk-3EZRM4YM.js → chunk-CPGASWNN.js} +25 -1
- package/dist/{chunk-BWTX7LUG.js → chunk-CXETOLPX.js} +9 -4
- package/dist/{chunk-D3D7XHBI.js → chunk-CYKXROFG.js} +6 -6
- package/dist/{chunk-DRTA6JG5.js → chunk-D2B3KP35.js} +26 -15
- package/dist/{chunk-TSPWXAAI.js → chunk-DD6RVD3S.js} +6 -7
- package/dist/{chunk-A5TY7H5T.js → chunk-DF3XEFQ7.js} +159 -53
- package/dist/{chunk-P52JHUUM.js → chunk-DLDDRXAI.js} +198 -88
- package/dist/{chunk-XNA6DATU.js → chunk-DLUNQHFO.js} +99 -56
- package/dist/{chunk-2THWIKRB.js → chunk-DMAMWUYY.js} +33 -16
- package/dist/chunk-DQ7YMQVX.js +26 -0
- package/dist/{chunk-4WK3CNW5.js → chunk-DRHQG44U.js} +11 -0
- package/dist/{chunk-WZGJSQKN.js → chunk-DZ3S4RPI.js} +15 -1
- package/dist/chunk-E2ZUBP4Q.js +24 -0
- package/dist/{chunk-G63ROSY5.js → chunk-E555EDOQ.js} +139 -72
- package/dist/{chunk-A7IEVBYI.js → chunk-E76U5H52.js} +1 -5
- package/dist/{chunk-J2ROMB7J.js → chunk-E7V3OHQQ.js} +64 -26
- package/dist/chunk-EBB4PYBN.js +24 -0
- package/dist/{chunk-FPPN5NAR.js → chunk-ECBUFKCP.js} +3 -3
- package/dist/{chunk-5PCCSSII.js → chunk-EGGDPDYJ.js} +1 -1
- package/dist/{chunk-F7X53SZM.js → chunk-EIL3KHAL.js} +12 -7
- package/dist/{chunk-MBVXROCI.js → chunk-EMFUZKYK.js} +20 -3
- package/dist/{chunk-TNNK4IIY.js → chunk-ETMHDCEH.js} +13 -12
- package/dist/{chunk-WMZCOGD6.js → chunk-EZZ533MH.js} +1 -1
- package/dist/{chunk-GEBGBJBD.js → chunk-F2EVCJ4U.js} +41 -34
- package/dist/{chunk-2IXDYW6O.js → chunk-F5BYLT3M.js} +195 -57
- package/dist/{chunk-NRHTC2SQ.js → chunk-F6OLHND5.js} +2 -2
- package/dist/{chunk-3FNY7ZCG.js → chunk-F77TMAUY.js} +141 -79
- package/dist/{chunk-QQNPU27R.js → chunk-FCECYJVA.js} +1 -1
- package/dist/{chunk-RGZGLKFB.js → chunk-FFJGC2DX.js} +418 -62
- package/dist/chunk-FG5L2LUK.js +89 -0
- package/dist/chunk-FMDNJ6PC.js +47 -0
- package/dist/{chunk-4WQ2MBE7.js → chunk-FNMH5WEY.js} +1 -1
- package/dist/{chunk-F35DA442.js → chunk-FNRPQIQE.js} +46 -27
- package/dist/{chunk-7EVIIADO.js → chunk-GC4WOLV3.js} +3 -1
- package/dist/{chunk-JB4YPOMT.js → chunk-GELSK76Y.js} +6 -7
- package/dist/{chunk-5SJQOPL7.js → chunk-GIHH6VC2.js} +4 -4
- package/dist/chunk-GLQ3KCTY.js +24 -0
- package/dist/{chunk-HHS6333D.js → chunk-GM3EGUYW.js} +2 -2
- package/dist/{chunk-PBYUJSEY.js → chunk-GQT2SY2S.js} +66 -43
- package/dist/{chunk-BUPLB3EX.js → chunk-H3IBJQ5A.js} +6 -2
- package/dist/{chunk-K4RCWNLC.js → chunk-HHXIVFAU.js} +11 -8
- package/dist/{chunk-B3F4TS3V.js → chunk-HJRNBKIT.js} +768 -69
- package/dist/chunk-HOU2MZHC.js +61 -0
- package/dist/{chunk-S4QSJAGY.js → chunk-HZUAEMN5.js} +1 -1
- package/dist/chunk-I7H5DU34.js +132 -0
- package/dist/{chunk-YS56RSTZ.js → chunk-IFQN4GKK.js} +161 -69
- package/dist/chunk-IGJ2G5C6.js +24 -0
- package/dist/{chunk-4ZGN4ZUN.js → chunk-IGNBQT23.js} +87 -3
- package/dist/{chunk-B6LHZLLK.js → chunk-IGVAWAOK.js} +31 -101
- package/dist/chunk-INHDHZNP.js +8 -0
- package/dist/chunk-IRXVV65V.js +24 -0
- package/dist/{chunk-IDDA5INB.js → chunk-IVRYF7QA.js} +7 -4
- package/dist/{chunk-3RMTPAEJ.js → chunk-JCAGVAB3.js} +810 -73
- package/dist/{chunk-OMVYFSOM.js → chunk-JCIXYOND.js} +2 -2
- package/dist/{chunk-6TJDWMZV.js → chunk-JEUL777U.js} +83 -9
- package/dist/{chunk-J33RA3YO.js → chunk-JFFREZGT.js} +5 -5
- package/dist/{chunk-AJHYXD5U.js → chunk-JGFHNAHS.js} +2 -2
- package/dist/chunk-JHWYG7V5.js +24 -0
- package/dist/{chunk-EP54VZI5.js → chunk-JIEVDGAF.js} +1 -1
- package/dist/{chunk-IDT7DJ7F.js → chunk-JKOEHRGV.js} +1 -1
- package/dist/chunk-JMGB444D.js +26 -0
- package/dist/{chunk-DSZUV3TM.js → chunk-JTC5SEAQ.js} +3 -3
- package/dist/chunk-JTFKRDDA.js +53 -0
- package/dist/{chunk-RKITD2UJ.js → chunk-JVZTKQFS.js} +6 -3
- package/dist/{chunk-BBL3R5YZ.js → chunk-JXBZIJCG.js} +1 -1
- package/dist/{chunk-WLZ54FWG.js → chunk-JYAZPMSA.js} +70 -1
- package/dist/chunk-K3VZ5QJK.js +19 -0
- package/dist/{chunk-EYLWVI26.js → chunk-KBJMLXNW.js} +165 -124
- package/dist/{chunk-KAQH75T6.js → chunk-KD5GOR2K.js} +82 -48
- package/dist/{chunk-LNKY5Z2X.js → chunk-KDSYZLF6.js} +2 -3
- package/dist/{chunk-7NWFKHSG.js → chunk-KF7HD3EH.js} +116 -42
- package/dist/{chunk-V7RAPZHX.js → chunk-KLB2QC24.js} +3 -3
- package/dist/chunk-KLIZXSBK.js +24 -0
- package/dist/{chunk-HDZGZJKR.js → chunk-KQCKK3LD.js} +100 -36
- package/dist/{chunk-4TPHMIE5.js → chunk-KTHFHD6C.js} +4 -2
- package/dist/{chunk-IYEFEBRN.js → chunk-KZJ5VM6E.js} +14 -3
- package/dist/{chunk-MEG4NMSI.js → chunk-L6YVK6VC.js} +2 -2
- package/dist/chunk-LGNJCPFP.js +28 -0
- package/dist/{chunk-7JQAUJOL.js → chunk-LKMFMNQX.js} +1 -1
- package/dist/{chunk-QY5ZKUWY.js → chunk-MAFPVR4G.js} +9 -3
- package/dist/{chunk-QR35TD2B.js → chunk-MD6DCQMA.js} +37 -37
- package/dist/{chunk-AA4U62G6.js → chunk-MJPXHCBW.js} +4 -4
- package/dist/{chunk-LYVOL4TQ.js → chunk-MOK3ZS6P.js} +2 -1
- package/dist/{chunk-MKVV7GVJ.js → chunk-MOS6WFWM.js} +13 -7
- package/dist/{chunk-2DR5MMDY.js → chunk-MPO5TVGF.js} +12 -6
- package/dist/{chunk-OU5K2JPF.js → chunk-MRAP2UVV.js} +102 -32
- package/dist/chunk-MS7O3KDJ.js +24 -0
- package/dist/{chunk-53OYF4ZT.js → chunk-MSYTF3DZ.js} +26 -11
- package/dist/{chunk-5A6MO4AR.js → chunk-MZACASZY.js} +7 -4
- package/dist/{chunk-H4H4O62O.js → chunk-N5HN5QGH.js} +1 -1
- package/dist/chunk-NCLRZQR6.js +211 -0
- package/dist/{chunk-C54QLNE4.js → chunk-NGA7ICG4.js} +1 -1
- package/dist/{chunk-SFQ5ADIG.js → chunk-NHC2ADGI.js} +315 -151
- package/dist/chunk-NMTWUYUF.js +30 -0
- package/dist/chunk-O36WX56O.js +13 -0
- package/dist/{chunk-FV32N6AF.js → chunk-O6ZTIDWB.js} +6 -4
- package/dist/{chunk-6BJQULXR.js → chunk-O7REHICC.js} +85 -39
- package/dist/{chunk-4FFCIQDG.js → chunk-OG2YUVBW.js} +4 -1
- package/dist/{chunk-CICWSCLC.js → chunk-OJ5CQV7H.js} +146 -69
- package/dist/{chunk-ULTSSIOU.js → chunk-OQQMDSCC.js} +1 -1
- package/dist/{chunk-PJWLKCFX.js → chunk-P4SMC4BY.js} +98 -90
- package/dist/{chunk-JEYJRJ7M.js → chunk-PJBEJR2U.js} +5 -4
- package/dist/{chunk-AZIRTSVP.js → chunk-PQLAZEQV.js} +122 -52
- package/dist/chunk-PZ46S2SY.js +69 -0
- package/dist/chunk-QB5HV4IY.js +24 -0
- package/dist/{chunk-IM4WUIR7.js → chunk-QGFKSDQO.js} +2 -2
- package/dist/chunk-QJWLNP64.js +24 -0
- package/dist/chunk-QLANK3VN.js +24 -0
- package/dist/chunk-QSMGZOT5.js +24 -0
- package/dist/{chunk-UYNAL3Y3.js → chunk-QWCLWFKC.js} +142 -68
- package/dist/chunk-QZIHKQRH.js +26 -0
- package/dist/{chunk-SZCPKGYG.js → chunk-R2IKOLBK.js} +3 -3
- package/dist/{chunk-BRPOSOK5.js → chunk-R5MEBBAA.js} +144 -71
- package/dist/{chunk-47BO6MYI.js → chunk-RJGCYGC3.js} +137 -70
- package/dist/chunk-RLMC5CUP.js +24 -0
- package/dist/{chunk-6NLH6TEP.js → chunk-RMC4OONA.js} +331 -143
- package/dist/{chunk-26P4WRQC.js → chunk-RPIKNMZA.js} +6 -3
- package/dist/{chunk-YF2PYLC4.js → chunk-RSCRIWAH.js} +1 -1
- package/dist/{chunk-DHWCFQNO.js → chunk-RT66UTLJ.js} +4 -18
- package/dist/{chunk-DAVHGK27.js → chunk-S7NRL66K.js} +46 -23
- package/dist/{chunk-VABRPZVC.js → chunk-SA46CNMS.js} +5 -1
- package/dist/chunk-SE7MJ2LQ.js +24 -0
- package/dist/{chunk-L7RHB734.js → chunk-SGDWLXUC.js} +1 -1
- package/dist/{chunk-E64MTTBC.js → chunk-SMHZXHHD.js} +45 -14
- package/dist/{chunk-AG2CJ4JY.js → chunk-SNQ7D5R7.js} +18 -1
- package/dist/{chunk-3V7AA3IZ.js → chunk-SPSGUFTI.js} +11 -3
- package/dist/{chunk-I2E3YDNZ.js → chunk-SRAV6FPB.js} +33 -9
- package/dist/chunk-SRUV7AT6.js +51 -0
- package/dist/{chunk-KJEZFOO6.js → chunk-SS4YGK3E.js} +91 -48
- package/dist/{chunk-WQ55QPEB.js → chunk-SXD3OYAR.js} +241 -118
- package/dist/{chunk-U7LLQ7XM.js → chunk-T2CYNDYU.js} +473 -109
- package/dist/{chunk-FMFCGYCE.js → chunk-T2YDWT54.js} +289 -300
- package/dist/{chunk-KORHKDJW.js → chunk-TE4M52AA.js} +2 -1
- package/dist/chunk-TUW5IYGA.js +24 -0
- package/dist/chunk-TXBO2LWM.js +25 -0
- package/dist/chunk-U3A6FMSI.js +28 -0
- package/dist/{chunk-EHDWWFNV.js → chunk-UBCVBBJJ.js} +3 -3
- package/dist/chunk-UPTXFTKH.js +25 -0
- package/dist/chunk-UREXN6WG.js +25 -0
- package/dist/chunk-UZLR25BW.js +24 -0
- package/dist/{chunk-JEL6665C.js → chunk-UZTQUPTB.js} +6 -6
- package/dist/{chunk-ISWU5YB3.js → chunk-V5JQQMFQ.js} +11 -5
- package/dist/chunk-V634AXDM.js +31 -0
- package/dist/{chunk-57ZGVAU3.js → chunk-V7F4F6JA.js} +39 -6
- package/dist/chunk-VJ7VBB6S.js +58 -0
- package/dist/{chunk-LVXOY5WL.js → chunk-VPL3JYC6.js} +6 -5
- package/dist/{chunk-VWYUUBBP.js → chunk-VVXKFU72.js} +83 -32
- package/dist/{chunk-XTGWCYAR.js → chunk-WBETBGSC.js} +430 -256
- package/dist/chunk-WI5VOSQX.js +125 -0
- package/dist/chunk-WIVFIVFZ.js +27 -0
- package/dist/{chunk-OURX73UJ.js → chunk-WN3HEU3P.js} +13 -11
- package/dist/{chunk-7EOLHBI6.js → chunk-WTQAG2OT.js} +81 -21
- package/dist/{chunk-G57ZO7DB.js → chunk-WWGPTEQB.js} +66 -26
- package/dist/{chunk-33PLBIMA.js → chunk-WXJ5MHLH.js} +3 -2
- package/dist/chunk-X23SZHV5.js +25 -0
- package/dist/{chunk-TKQKXBGC.js → chunk-X3KCQEYZ.js} +10 -8
- package/dist/chunk-X3YP4DUV.js +76 -0
- package/dist/chunk-XC5IRUEL.js +48 -0
- package/dist/{chunk-LFX7W4B7.js → chunk-XCROSJ2Z.js} +1 -1
- package/dist/{chunk-RK4S3VPS.js → chunk-XHRUXZD7.js} +3 -3
- package/dist/{chunk-S32YYDIB.js → chunk-XMP2DNLI.js} +4 -3
- package/dist/{chunk-C3O45JWU.js → chunk-XQMYQ4TN.js} +4 -4
- package/dist/{chunk-QKL7IY42.js → chunk-Y54LU4CU.js} +1 -1
- package/dist/chunk-YHD2FZFP.js +24 -0
- package/dist/{chunk-OMNQXHFF.js → chunk-YK2KWNTU.js} +31 -20
- package/dist/chunk-YMTXTQCN.js +24 -0
- package/dist/{chunk-SGD3ZHID.js → chunk-YOOHNQ3L.js} +15 -4
- package/dist/{chunk-JTJNQKPM.js → chunk-YPYD6OJ3.js} +2 -2
- package/dist/{chunk-3P4PJJND.js → chunk-YYJORENB.js} +6 -6
- package/dist/{chunk-NRF223FR.js → chunk-YZZLIYPA.js} +1 -1
- package/dist/{chunk-WJKVNRCR.js → chunk-Z55DXFWS.js} +18 -17
- package/dist/{chunk-UTQGZF37.js → chunk-ZEYBI47P.js} +1 -1
- package/dist/{chunk-WKWMOZNE.js → chunk-ZJFJ2IKQ.js} +226 -61
- package/dist/{chunk-QJ4WGAC6.js → chunk-ZKJ5L35C.js} +94 -21
- package/dist/{chunk-ZXOD37BE.js → chunk-ZL6IHMOW.js} +73 -39
- package/dist/chunk-ZMPH2OC4.js +24 -0
- package/dist/{chunk-EYZ6SLF3.js → chunk-ZVM5TFGR.js} +7 -7
- package/dist/chunk-ZWNRLIFT.js +24 -0
- package/dist/{chunk-VNLSTZES.js → chunk-ZY72LSQK.js} +314 -92
- package/dist/chunk-ZYQYX66L.js +24 -0
- package/dist/cli/index.js +3 -3
- package/dist/{core-MN45UFF4.js → core-3KLQSYWB.js} +3 -1
- package/dist/{core-DAFZ7YJW.js → core-4HFVG4CP.js} +2 -1
- package/dist/{core-34KIMTK6.js → core-4RR6VSXM.js} +2 -1
- package/dist/{core-7R3ARYNI.js → core-5UF44NDI.js} +5 -1
- package/dist/{core-3CWPIFAL.js → core-7S3XMW5O.js} +3 -1
- package/dist/{core-ONNGSKWQ.js → core-7Y5BZZON.js} +5 -1
- package/dist/{core-AEYGGH7X.js → core-A5AKUB7H.js} +4 -1
- package/dist/{core-YPH723Z7.js → core-AR2T32Y3.js} +8 -1
- package/dist/{core-CJZXX2V3.js → core-BBNY2BX4.js} +2 -1
- package/dist/{core-CJ7FFPDU.js → core-BLHEJ5OK.js} +5 -1
- package/dist/{core-KII4CH3W.js → core-BOG33BFD.js} +3 -1
- package/dist/{core-O2K4BDYH.js → core-DD62MWEW.js} +4 -1
- package/dist/{core-WJSKT5XM.js → core-DFZMOO7E.js} +5 -1
- package/dist/{core-QXIAQFHM.js → core-E2XOSHPR.js} +3 -1
- package/dist/{core-R27R6J5M.js → core-G3LXHW73.js} +3 -1
- package/dist/{core-V7I4F6JW.js → core-GLOZY6Z7.js} +5 -1
- package/dist/{core-KZK3WCUG.js → core-GSILPKUR.js} +3 -1
- package/dist/{core-GEUPUZUY.js → core-H5HO2CED.js} +3 -1
- package/dist/{core-W7AZNHOX.js → core-HDNWVLJW.js} +3 -1
- package/dist/{core-L7Y7YXWR.js → core-HTD5RHE7.js} +1 -1
- package/dist/{core-WHI4ABF2.js → core-ILPXXC2Z.js} +1 -1
- package/dist/{core-RGLOYY73.js → core-J2JD5ODO.js} +6 -1
- package/dist/{core-ASBJZZTP.js → core-JDFUZFRH.js} +2 -1
- package/dist/{core-XKV7GMPG.js → core-K3JX5WPM.js} +2 -1
- package/dist/{core-L5KTPXHC.js → core-LB5M7XL4.js} +3 -1
- package/dist/{core-KCORN7F7.js → core-LGJZUP6H.js} +3 -1
- package/dist/{core-DJPGSTXB.js → core-MU4ALRR7.js} +8 -1
- package/dist/{core-MNUVP5IJ.js → core-QPSAYRFT.js} +5 -1
- package/dist/{core-YVNOHIQ4.js → core-RR2CAZC5.js} +3 -1
- package/dist/{core-KF6GJOGW.js → core-TCSW24N6.js} +7 -1
- package/dist/{core-JLXFDYHX.js → core-TKZZZ6UW.js} +4 -1
- package/dist/{core-7YKLT7KY.js → core-VKZSQFRG.js} +4 -1
- package/dist/{core-EAIFSTDE.js → core-WJNK7F2J.js} +3 -1
- package/dist/{core-JLJTP7P6.js → core-WZ4CHVYL.js} +3 -1
- package/dist/{core-PFXIBWLD.js → core-XW7UJFJZ.js} +4 -1
- package/dist/{core-RCFFJANI.js → core-YMXYUGF5.js} +5 -1
- package/dist/{core-DKJUX7Q4.js → core-ZLSQHZ3I.js} +3 -1
- package/dist/{dataTable-VKEHFLJM.js → dataTable-CNDRVGA5.js} +4 -2
- package/dist/{engine-PPXKJJFI.js → engine-FVEIM3WV.js} +59 -32
- package/dist/fixtures.js +6 -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-53MXACOU.js → main-THU6VIVU.js} +55 -24
- package/dist/mcp/server.js +50 -22
- package/dist/{module-SVEW5ZUE.js → module-ZSR7KTAS.js} +1 -1
- package/dist/react/bar.js +6 -1
- package/dist/react/bartable.js +6 -1
- package/dist/react/box.js +6 -1
- package/dist/react/bullet.js +4 -1
- package/dist/react/butterfly.js +5 -1
- package/dist/react/choropleth.js +4 -1
- package/dist/react/cohort.js +4 -1
- package/dist/react/column.js +9 -1
- package/dist/react/combo.js +3 -1
- package/dist/react/creative.js +2 -1
- package/dist/react/diagram.js +3 -1
- package/dist/react/dimswitch.js +4 -1
- package/dist/react/dot.js +9 -1
- package/dist/react/export.js +33 -30
- package/dist/react/funnel.js +4 -1
- package/dist/react/gantt.js +4 -1
- package/dist/react/grid.js +4 -1
- package/dist/react/heatmap.js +4 -1
- package/dist/react/histogram.js +6 -1
- package/dist/react/index.js +95 -90
- package/dist/react/kpi.js +2 -1
- package/dist/react/likert.js +7 -1
- package/dist/react/line.js +4 -1
- package/dist/react/mekko.js +5 -1
- package/dist/react/pareto.js +3 -1
- package/dist/react/pie.js +5 -1
- package/dist/react/prepare.js +33 -27
- package/dist/react/pvm.js +4 -1
- package/dist/react/pyramid.js +5 -1
- package/dist/react/sankey.js +4 -1
- package/dist/react/scatter.js +4 -1
- package/dist/react/slope.js +6 -1
- package/dist/react/sparkline.js +4 -1
- package/dist/react/spec.js +25 -32
- package/dist/react/status.js +8 -1
- package/dist/react/story.js +6 -4
- package/dist/react/table.js +4 -1
- package/dist/react/theme.js +6 -3
- package/dist/react/tilemap.js +4 -1
- package/dist/react/treemap.js +3 -1
- package/dist/react/variance.js +5 -1
- package/dist/react/waffle.js +3 -1
- package/dist/react/waterfall.js +4 -1
- package/dist/{resvg-ZOVDIZTV.js → resvg-VB7S5HRF.js} +1 -1
- package/dist/rows.js +2 -3
- package/dist/{rowsModule-L3MBGPBH.js → rowsModule-LI6KOS46.js} +2 -1
- package/dist/{schema-GVHM2HEF.js → schema-25INXAMY.js} +1 -1
- package/dist/{schema-ZCZCY34J.js → schema-5DUTAVO7.js} +1 -1
- package/dist/{schema-26YUL3MG.js → schema-5KDEQBBT.js} +1 -1
- package/dist/{schema-FT37ZEYY.js → schema-5ZTGVQAJ.js} +1 -3
- package/dist/{schema-CMXL5F5L.js → schema-72EEMYS3.js} +1 -1
- package/dist/{schema-6ZV532RM.js → schema-7NSV542V.js} +1 -1
- package/dist/{schema-HWU55RJL.js → schema-AMT7P7KB.js} +1 -1
- package/dist/{schema-AQD3H5VV.js → schema-AXRDF6ND.js} +1 -1
- package/dist/{schema-SY3MKF5S.js → schema-B2GCEYXD.js} +1 -1
- package/dist/{schema-QLH2DZFI.js → schema-BBTXTWYI.js} +1 -1
- package/dist/{schema-SLQPM32G.js → schema-BKUFZLLI.js} +1 -1
- package/dist/{schema-LYBOPAGQ.js → schema-CGQID64D.js} +1 -1
- package/dist/{schema-QNI6MNQ2.js → schema-FDFQKIO5.js} +1 -1
- package/dist/{schema-KH62LDYK.js → schema-GN6GAIU5.js} +1 -1
- package/dist/{schema-733PO52K.js → schema-GNTKL5DN.js} +1 -1
- package/dist/{schema-ZSYX76MO.js → schema-H2EC4GAQ.js} +1 -1
- package/dist/{schema-H7RKVTVO.js → schema-HH5HOORE.js} +1 -1
- package/dist/{schema-NOPOI5G2.js → schema-J7TNCZIP.js} +1 -1
- package/dist/{schema-WAKLKLBB.js → schema-JH57NFXJ.js} +1 -1
- package/dist/{schema-KFXLS67Q.js → schema-KPEPBGAX.js} +1 -1
- package/dist/{schema-GK6MD4EG.js → schema-L5U4OROI.js} +1 -1
- package/dist/{schema-IOWE3RQO.js → schema-LOQ3AFC7.js} +1 -1
- package/dist/{schema-GSE3QXUK.js → schema-M5JBHQIV.js} +5 -3
- package/dist/{schema-IOKAZVL7.js → schema-MMVPMJEF.js} +1 -1
- package/dist/{schema-B4GFRYIP.js → schema-OU35XA3Z.js} +1 -1
- package/dist/{schema-HRHNGOFC.js → schema-PL3EU6EQ.js} +2 -2
- package/dist/{schema-MNG24WU2.js → schema-PQZWO3BP.js} +1 -1
- package/dist/{schema-5E5J43CF.js → schema-QCIE6M2P.js} +2 -1
- package/dist/{schema-Q4IPIR6W.js → schema-QORUB6EK.js} +1 -1
- package/dist/{schema-33ZF6WKL.js → schema-QPOBZUAR.js} +1 -1
- package/dist/{schema-3W7IFXVN.js → schema-R5Y6NVBH.js} +1 -1
- package/dist/{schema-KHCLVE2V.js → schema-THXXFY6I.js} +1 -1
- package/dist/{schema-HGUBNXUY.js → schema-VYECMPON.js} +1 -1
- package/dist/{schema-PNUC54GC.js → schema-YLE4XXQQ.js} +1 -1
- package/dist/{schema-KORNUIC6.js → schema-ZEVJMFLV.js} +1 -1
- package/dist/{schema-4ZXJCRZR.js → schema-ZG6ZKFRZ.js} +1 -1
- package/dist/{schema-WCDYWS4K.js → schema-ZQSIR5UC.js} +1 -1
- package/dist/{specValidation-H5B4MQST.js → specValidation-VHLGDEME.js} +3 -1
- package/dist/theme.js +4 -2
- package/dist/{themeShapeRules-54U5EIZR.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/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/box/types.d.ts +2 -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/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 +8 -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 +9 -1
- 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 +52 -1
- 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 +11 -0
- package/dist/types/core/types/theme.d.ts +48 -3
- 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 +20 -2
- package/dist/types/react/prepare.d.ts +2 -2
- package/dist/types/react/prepared.d.ts +5 -1
- 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 +139 -35
- 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 +10 -8
- 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 +93 -85
- package/docs/reference/tilemap.md +8 -7
- 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 +25 -2
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/dist/chunk-2HXKW6U6.js +0 -24
- package/dist/chunk-35ZTANEK.js +0 -24
- package/dist/chunk-3CLLHMFF.js +0 -24
- package/dist/chunk-46ZPFJAM.js +0 -24
- package/dist/chunk-6BWSF5PS.js +0 -24
- package/dist/chunk-6K2TMVPF.js +0 -42
- package/dist/chunk-6KWIQ5KF.js +0 -18
- package/dist/chunk-6ZXMA4TY.js +0 -24
- package/dist/chunk-7HFUG25L.js +0 -24
- package/dist/chunk-7R5EV5MS.js +0 -24
- package/dist/chunk-7X65ZQN4.js +0 -38
- package/dist/chunk-ATUZTGZI.js +0 -25
- package/dist/chunk-BW5VLBSZ.js +0 -15
- package/dist/chunk-BYD7VLAI.js +0 -24
- package/dist/chunk-CEY646NZ.js +0 -28
- package/dist/chunk-D7GZPMHW.js +0 -24
- package/dist/chunk-FIANWJXX.js +0 -19
- package/dist/chunk-H4SYN3QA.js +0 -24
- package/dist/chunk-HC4NDND6.js +0 -24
- package/dist/chunk-HNVW3YDS.js +0 -25
- package/dist/chunk-HW7BPJNQ.js +0 -24
- package/dist/chunk-I5L3QTKQ.js +0 -24
- package/dist/chunk-IK4BHOPZ.js +0 -33
- package/dist/chunk-IMJXJHFW.js +0 -88
- package/dist/chunk-JDEVGTSX.js +0 -24
- package/dist/chunk-K2KU4HHT.js +0 -25
- package/dist/chunk-KDMKHR5A.js +0 -32
- package/dist/chunk-KNZD53L4.js +0 -24
- package/dist/chunk-KOJ5QETJ.js +0 -8
- package/dist/chunk-KSQEG6DX.js +0 -24
- package/dist/chunk-KVSJ2O4Q.js +0 -24
- package/dist/chunk-L3JWM7FR.js +0 -50
- package/dist/chunk-L7FSCT4M.js +0 -28
- package/dist/chunk-LMPZKCDM.js +0 -24
- package/dist/chunk-MONVTUHR.js +0 -24
- package/dist/chunk-NWQTSZYC.js +0 -24
- package/dist/chunk-OM67S6S4.js +0 -19
- package/dist/chunk-OTW5SEFS.js +0 -21
- package/dist/chunk-PGV25HTX.js +0 -25
- package/dist/chunk-QGCEHR6S.js +0 -13
- package/dist/chunk-T3IGJARD.js +0 -22
- package/dist/chunk-U2ES66IN.js +0 -26
- package/dist/chunk-U6CJPTOB.js +0 -19
- package/dist/chunk-VDVXGAIP.js +0 -24
- package/dist/chunk-VGWWUCAB.js +0 -24
- package/dist/chunk-X4U6PT3Z.js +0 -33
- package/dist/chunk-XXNLNZ7E.js +0 -24
- package/dist/chunk-ZBJNEJSL.js +0 -24
- package/dist/chunk-ZWJTHFWB.js +0 -27
- /package/dist/{DiagnosticDetails-UNYNYCAH.js → DiagnosticDetails-JFBBXOT2.js} +0 -0
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BADGE_SECTION_ONLY,
|
|
3
3
|
BADGE_TEXT_EMPTY,
|
|
4
|
-
STATUS_VALUES
|
|
5
|
-
|
|
4
|
+
STATUS_VALUES,
|
|
5
|
+
STATUS_WORDS
|
|
6
|
+
} from "./chunk-7ADUVRG5.js";
|
|
6
7
|
import {
|
|
7
8
|
tableCellKey
|
|
8
9
|
} from "./chunk-M4SPKUZE.js";
|
|
9
10
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
calcFlipsWithInputs,
|
|
12
|
+
calcIsLinear,
|
|
13
|
+
calcPreservesScale,
|
|
14
|
+
calcYieldsPoints,
|
|
15
|
+
columnOwnsFormat
|
|
16
|
+
} from "./chunk-X3YP4DUV.js";
|
|
12
17
|
import {
|
|
13
18
|
DEFAULT_TRACK_GROWTH,
|
|
14
19
|
DENSE_COLUMNS,
|
|
@@ -26,6 +31,8 @@ import {
|
|
|
26
31
|
frameFillExtras,
|
|
27
32
|
groupHeadingFaces,
|
|
28
33
|
groupHeadingFloors,
|
|
34
|
+
groupHeadingNeed,
|
|
35
|
+
groupHeadingWrap,
|
|
29
36
|
headerContentWidth,
|
|
30
37
|
headsFit,
|
|
31
38
|
inlineFont,
|
|
@@ -34,12 +41,16 @@ import {
|
|
|
34
41
|
labelIndents,
|
|
35
42
|
rowFont,
|
|
36
43
|
sectionChipFloor,
|
|
44
|
+
strongColumnFont,
|
|
37
45
|
tableFonts,
|
|
38
46
|
wrapFloorWidth
|
|
39
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-2YO4WRJN.js";
|
|
40
48
|
import {
|
|
41
49
|
toneTextPaint
|
|
42
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-BVYIKLQ5.js";
|
|
51
|
+
import {
|
|
52
|
+
fieldHeadText
|
|
53
|
+
} from "./chunk-SPSGUFTI.js";
|
|
43
54
|
import {
|
|
44
55
|
operatorWidth,
|
|
45
56
|
qualifierFont
|
|
@@ -51,38 +62,47 @@ import {
|
|
|
51
62
|
emptyIdRecord
|
|
52
63
|
} from "./chunk-LINZPU5D.js";
|
|
53
64
|
import {
|
|
65
|
+
closestKey
|
|
66
|
+
} from "./chunk-BSATR6ZO.js";
|
|
67
|
+
import {
|
|
68
|
+
caseInsensitiveValue,
|
|
54
69
|
chartSizing,
|
|
55
70
|
fitsSize,
|
|
71
|
+
inputConversion,
|
|
56
72
|
resolveSizing
|
|
57
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-T2CYNDYU.js";
|
|
58
74
|
import {
|
|
59
75
|
clamp,
|
|
60
|
-
|
|
76
|
+
cleanDiff,
|
|
77
|
+
cleanSum,
|
|
61
78
|
formatDate,
|
|
62
79
|
isNumberAlone,
|
|
63
80
|
numericVariant,
|
|
81
|
+
readDateFormat,
|
|
64
82
|
unitPrinted
|
|
65
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-4KQHKPB3.js";
|
|
66
84
|
import {
|
|
67
85
|
disclosureNote,
|
|
68
86
|
disclosuresShown,
|
|
69
87
|
footerType
|
|
70
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-SMHZXHHD.js";
|
|
71
89
|
import {
|
|
72
90
|
AUTOMATIC_FORMAT,
|
|
73
91
|
MAGNITUDE_DIVISOR,
|
|
74
92
|
MAGNITUDE_GROUP,
|
|
93
|
+
MAGNITUDE_LABEL,
|
|
75
94
|
differenceExample,
|
|
76
95
|
effectiveScale,
|
|
77
96
|
formatWithSpec,
|
|
78
|
-
|
|
97
|
+
nonAdditiveSpec,
|
|
79
98
|
parseFormatExample,
|
|
80
99
|
parseISODate,
|
|
81
100
|
roundedNumber,
|
|
101
|
+
sameUnit,
|
|
82
102
|
specUnitKind,
|
|
83
103
|
unitOfSpec,
|
|
84
104
|
withChartMarks
|
|
85
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-FFJGC2DX.js";
|
|
86
106
|
import {
|
|
87
107
|
MINUS,
|
|
88
108
|
chartNumberMarks,
|
|
@@ -94,7 +114,7 @@ import {
|
|
|
94
114
|
typicalDecimals,
|
|
95
115
|
withSmallValues,
|
|
96
116
|
zeroLifts
|
|
97
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-MSYTF3DZ.js";
|
|
98
118
|
import {
|
|
99
119
|
canvasMargin,
|
|
100
120
|
contrastInkPaint,
|
|
@@ -110,7 +130,7 @@ import {
|
|
|
110
130
|
tableEmphasis,
|
|
111
131
|
tableHeadFloorPx,
|
|
112
132
|
textScaleOf
|
|
113
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-HJRNBKIT.js";
|
|
114
134
|
import {
|
|
115
135
|
DEFAULT_TARGET,
|
|
116
136
|
NormalizeError,
|
|
@@ -121,7 +141,7 @@ import {
|
|
|
121
141
|
resolveSubtitle,
|
|
122
142
|
scaleTextPx,
|
|
123
143
|
targetFloorsPx
|
|
124
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-YOOHNQ3L.js";
|
|
125
145
|
import {
|
|
126
146
|
maxOf,
|
|
127
147
|
minOf,
|
|
@@ -129,7 +149,7 @@ import {
|
|
|
129
149
|
} from "./chunk-WYJEOMNY.js";
|
|
130
150
|
import {
|
|
131
151
|
twoLineWidth
|
|
132
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-SNQ7D5R7.js";
|
|
133
153
|
|
|
134
154
|
// src/core/charts/table/ladder.ts
|
|
135
155
|
var COHORT_GRID = {
|
|
@@ -247,7 +267,7 @@ function assertTableRankOptions(options) {
|
|
|
247
267
|
);
|
|
248
268
|
}
|
|
249
269
|
function ranksAsData(row) {
|
|
250
|
-
return (row?.role ?? "data") === "data" && row?.kind !== "result" && row?.kind !== "driver";
|
|
270
|
+
return (row?.role ?? (row?.kind === "section" ? "section" : "data")) === "data" && row?.kind !== "result" && row?.kind !== "driver";
|
|
251
271
|
}
|
|
252
272
|
function additiveRankKey(row, columns) {
|
|
253
273
|
let sum = 0, counted = !1;
|
|
@@ -364,7 +384,7 @@ function foldTableTopN(data, ranked, options) {
|
|
|
364
384
|
}
|
|
365
385
|
|
|
366
386
|
// src/core/charts/table/encodings/arrow.ts
|
|
367
|
-
var ARROW_GAP = 4;
|
|
387
|
+
var ARROW_GAP = 4, printedNumber = (cell) => cell.negated ? -cell.raw : cell.raw;
|
|
368
388
|
function arrowGlyph(value, maxAbs, scale) {
|
|
369
389
|
let share = scale === "absolute" ? value / 100 : maxAbs > 0 ? value / maxAbs : 0;
|
|
370
390
|
return share > 0.1 ? "\u2191" : share > 0.02 ? "\u2197" : share >= -0.02 ? "\u2192" : share >= -0.1 ? "\u2198" : "\u2193";
|
|
@@ -382,16 +402,15 @@ function arrowKey(columns, rows) {
|
|
|
382
402
|
if (column.cellEncoding?.type !== "arrow" || column.kind !== "computed" || !column.polarity) continue;
|
|
383
403
|
let scale = column.cellEncoding.scale, values = rows.flatMap((row) => {
|
|
384
404
|
let cell = row.cells[column.id];
|
|
385
|
-
return cell?.state === "value" && typeof cell.raw == "number" ? [cell
|
|
405
|
+
return cell?.state === "value" && typeof cell.raw == "number" ? [printedNumber(cell)] : [];
|
|
386
406
|
}), maxAbs = Math.max(0, maxOf(values.map(Math.abs)));
|
|
387
407
|
for (let value of values) drawn[scale].add(arrowGlyph(value, maxAbs, scale));
|
|
388
408
|
}
|
|
389
409
|
return ["absolute", "relative"].flatMap((scale) => ARROW_KEY.filter(([glyph]) => drawn[scale].has(glyph)).map(([glyph, absolute, relative]) => ({ id: scale === "absolute" ? `arrowKey:${glyph}` : `arrowKey:relative:${glyph}`, label: scale === "absolute" ? absolute : relative, glyph })));
|
|
390
410
|
}
|
|
391
411
|
function emitArrow(context, metrics) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
let glyph = arrowGlyph(value, metrics.maxAbs, metrics.scale), font = metrics.font, glyphWidth = context.measure(glyph, font).width, valueWidth = context.measure(context.cell.displayed, metrics.font).width, valueLeft = metrics.valueX - valueWidth, available = valueLeft - context.box.x - ARROW_GAP;
|
|
412
|
+
if (context.cell.state !== "value" || typeof context.cell.raw != "number") return [];
|
|
413
|
+
let value = printedNumber(context.cell), glyph = arrowGlyph(value, metrics.maxAbs, metrics.scale), font = metrics.font, glyphWidth = context.measure(glyph, font).width, valueWidth = context.measure(context.cell.displayed, metrics.font).width, valueLeft = metrics.valueX - valueWidth, available = valueLeft - context.box.x - ARROW_GAP;
|
|
395
414
|
if (available <= 0) return [];
|
|
396
415
|
if (glyphWidth > available) {
|
|
397
416
|
let floor = Math.min(font.size, readerFloorPx(metrics.target ?? DEFAULT_TARGET, "label", metrics.textScale));
|
|
@@ -510,7 +529,9 @@ function laneHeatKey(columns, ranges, theme, strings, language) {
|
|
|
510
529
|
let encoding = column.cellEncoding;
|
|
511
530
|
if (encoding?.type === "heat" && encoding.scale === "status") return statusKey(columns, ranges, encoding, strings);
|
|
512
531
|
if (encoding?.type !== "heat" || encoding.scale !== "absolute" && encoding.scale !== "diverging") continue;
|
|
513
|
-
let diverging = encoding.scale === "diverging"
|
|
532
|
+
let diverging = encoding.scale === "diverging";
|
|
533
|
+
if (diverging && encoding.bins === void 0 && (encoding.steps ?? 0) < 2) continue;
|
|
534
|
+
let edges = encoding.bins ?? (diverging ? DIVERGING_BINS : []);
|
|
514
535
|
if (edges.length === 0) continue;
|
|
515
536
|
let steps = encoding.steps ?? edges.length + 1, spec = column.format === void 0 ? void 0 : withChartMarks(diverging ? { ...parseFormatExample(differenceExample(column.format)), signed: !1 } : parseFormatExample(column.format), language), text = spec === void 0 ? (value) => formatExactNumber(value, language) : (value) => formatWithSpec(value, spec), band = (index, last) => last ? `${text(edges[index - 1])} and more` : index === 0 ? `under ${text(edges[0])}` : intervalText(text(edges[index - 1]), text(edges[index])), swatch = (id, label, fill) => ({ id: `heatKey:${id}`, label, fill });
|
|
516
537
|
if (diverging) {
|
|
@@ -649,19 +670,12 @@ function holdAuthoredScale(spec, thousands) {
|
|
|
649
670
|
spec.magnitude === "none" || spec.lockMagnitude || (spec.rollMagnitude = !1, spec.thousandsSep === "" && (spec.thousandsSep = spec.decimals > 0 && thousands === spec.decimalSep ? spec.decimalSep === "," ? "." : "," : thousands));
|
|
650
671
|
}
|
|
651
672
|
function forceScale(spec, magnitude, thousands) {
|
|
652
|
-
spec.magnitude === "none" && magnitude === "m" && (spec.decimals = Math.max(spec.decimals, 1)), spec.magnitude = magnitude, spec.lockMagnitude = !0, spec.thousandsSep === "" && (spec.thousandsSep = thousands);
|
|
653
|
-
}
|
|
654
|
-
function sameUnit(a, b) {
|
|
655
|
-
return a.prefix === b.prefix && a.suffix === b.suffix && a.magnitude === b.magnitude && a.signed === b.signed && a.negative === b.negative && a.thousandsSep === b.thousandsSep && a.decimalSep === b.decimalSep;
|
|
673
|
+
spec.magnitudeInAffix || spec.exponent || spec.ordinal || (spec.magnitude === "none" && magnitude === "m" && (spec.decimals = Math.max(spec.decimals, 1)), spec.magnitude = magnitude, spec.lockMagnitude = !0, spec.thousandsSep === "" && (spec.thousandsSep = thousands));
|
|
656
674
|
}
|
|
657
|
-
function
|
|
658
|
-
|
|
659
|
-
return label ? text.endsWith(")") ? text.replace(`${label})`, ")") : text.endsWith(label) ? text.slice(0, -label.length) : text : text;
|
|
675
|
+
function sameUnit2(a, b) {
|
|
676
|
+
return a.prefix === b.prefix && a.suffix === b.suffix && a.magnitude === b.magnitude && a.signed === b.signed && a.negative === b.negative && a.thousandsSep === b.thousandsSep && a.decimalSep === b.decimalSep && a.trailingMinus === b.trailingMinus && a.ordinal === b.ordinal && a.magnitudeInAffix === b.magnitudeInAffix && JSON.stringify(a.glyphs) === JSON.stringify(b.glyphs) && JSON.stringify(a.exponent) === JSON.stringify(b.exponent) && JSON.stringify(a.magnitudeWord) === JSON.stringify(b.magnitudeWord);
|
|
660
677
|
}
|
|
661
678
|
var floatNoise = (a, b) => 1e-9 * Math.max(1, Math.abs(a), Math.abs(b));
|
|
662
|
-
function columnHeadLabel(label, theme) {
|
|
663
|
-
return theme.table?.head?.case === "asis" ? label : label.toUpperCase();
|
|
664
|
-
}
|
|
665
679
|
function columnHeaderAffix(column) {
|
|
666
680
|
let affix = [column.scenario, column.unitLabel].filter(Boolean).join(", ");
|
|
667
681
|
return `${affix ? ` (${affix})` : ""}${column.partial ? ` ${PARTIAL_MARKER}` : ""}`;
|
|
@@ -673,8 +687,20 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
673
687
|
let liftsBefore = zeroLifts.count, liftMode = options[ZERO_LIFT], automaticAs = (on) => on && liftMode !== "none" ? liftMode ?? !0 : !1, formats = /* @__PURE__ */ new Map(), markedLanguage = options.locale?.language, parseFormatExample2 = (example) => {
|
|
674
688
|
let spec = formats.get(example);
|
|
675
689
|
return spec === void 0 && (spec = parseFormatExample(example), spec.locale = markedLanguage, formats.set(example, spec)), { ...spec };
|
|
676
|
-
}, warnings = [];
|
|
690
|
+
}, warnings = [], datePatterns = /* @__PURE__ */ new Map();
|
|
677
691
|
data.columns.forEach((column, index) => {
|
|
692
|
+
if (column.kind === "date") {
|
|
693
|
+
let read = readDateFormat(column.format, "table", options.locale?.language);
|
|
694
|
+
datePatterns.set(column.id, read.pattern);
|
|
695
|
+
for (let note of read.notes) warnings.push({
|
|
696
|
+
code: note.kind === "fiscal" ? "date-format-fiscal-year" : `date-format-${note.kind}`,
|
|
697
|
+
severity: note.kind === "fiscal" ? "info" : "warn",
|
|
698
|
+
field: ["data", "columns", index, "format"],
|
|
699
|
+
owner: { colId: column.id },
|
|
700
|
+
message: note.message,
|
|
701
|
+
suggest: note.suggest
|
|
702
|
+
});
|
|
703
|
+
}
|
|
678
704
|
if (column.kind === "status")
|
|
679
705
|
for (let [key, label] of Object.entries(column.labels ?? {}))
|
|
680
706
|
typeof label != "string" || label.trim() !== "" || warnings.push({
|
|
@@ -687,6 +713,42 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
687
713
|
fix: [{ op: "remove", path: `/data/columns/${index}/labels/${key}` }]
|
|
688
714
|
});
|
|
689
715
|
});
|
|
716
|
+
let columnIds = data.columns.map((column) => column.id), columnIdSet = new Set(columnIds), nearColumn = /* @__PURE__ */ new Map(), unknownKeys = /* @__PURE__ */ new Map(), checkCellKeys = (rows, path) => {
|
|
717
|
+
rows.forEach((row, index) => {
|
|
718
|
+
let rowPath = [...path, index];
|
|
719
|
+
for (let key of Object.keys(row.cells ?? {})) {
|
|
720
|
+
if (columnIdSet.has(key)) continue;
|
|
721
|
+
if (!nearColumn.has(key)) {
|
|
722
|
+
let nearest = closestKey(key, columnIds);
|
|
723
|
+
nearColumn.set(key, nearest?.near ? nearest.key : void 0);
|
|
724
|
+
}
|
|
725
|
+
let near = nearColumn.get(key);
|
|
726
|
+
if (near === void 0 || Object.hasOwn(row.cells, near)) continue;
|
|
727
|
+
let seen = unknownKeys.get(key);
|
|
728
|
+
seen ? seen.rows += 1 : unknownKeys.set(key, { row, rowPath, near, rows: 1 });
|
|
729
|
+
}
|
|
730
|
+
row.children && checkCellKeys(row.children, [...rowPath, "children"]);
|
|
731
|
+
});
|
|
732
|
+
};
|
|
733
|
+
checkCellKeys(magnitudeSource.rows, []);
|
|
734
|
+
for (let [key, { row, rowPath, near, rows }] of unknownKeys) {
|
|
735
|
+
let cells = row.cells;
|
|
736
|
+
warnings.push({
|
|
737
|
+
code: "cell-column-unknown",
|
|
738
|
+
severity: "warn",
|
|
739
|
+
message: `cell '${key}' in row '${row.id}'${rows > 1 ? ` and ${rows - 1} more` : ""} names no column, so its value is not drawn; did you mean '${near}'?`,
|
|
740
|
+
owner: { rowId: row.id },
|
|
741
|
+
field: ["data", "rows", ...rowPath, "cells", key],
|
|
742
|
+
suggest: `Rename the cell key to '${near}'.`,
|
|
743
|
+
// A patch for the first row only would leave the others; a key in several rows gets the suggestion alone.
|
|
744
|
+
...rows > 1 ? {} : {
|
|
745
|
+
fix: [
|
|
746
|
+
{ op: "test", path: `/data/rows/${rowPath.join("/")}/cells`, value: cells },
|
|
747
|
+
{ op: "replace", path: `/data/rows/${rowPath.join("/")}/cells`, value: Object.fromEntries(Object.entries(cells).map(([name, value]) => [name === key ? near : name, value])) }
|
|
748
|
+
]
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
}
|
|
690
752
|
let records = [], autoFootnotes = /* @__PURE__ */ new Set(), lowerJudged = /* @__PURE__ */ new Set(), higherJudged = /* @__PURE__ */ new Set(), partialColumnIds = /* @__PURE__ */ new Set(), highlightedRows = new Set(resolveHighlight(options.highlight));
|
|
691
753
|
assertTableRankOptions(options);
|
|
692
754
|
let folded = applyTableTopN(data, options);
|
|
@@ -735,11 +797,11 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
735
797
|
dissolveSections(parentId);
|
|
736
798
|
let out = hoisted.some((k) => k.role !== "total") ? hoisted.filter((k) => k.role !== "total") : hoisted;
|
|
737
799
|
return summandCache.set(parentId, out), out;
|
|
738
|
-
}, nonAdditiveFormat = (format) => {
|
|
739
|
-
if (!format) return
|
|
800
|
+
}, nonAdditiveFormat = (format) => !!format && nonAdditiveSpec(parseFormatExample2(format)), formatAt = (row, colId) => cellFormat(row.cells[colId]) ?? row.format, unitOf = (format) => {
|
|
801
|
+
if (!format) return "";
|
|
740
802
|
let spec = parseFormatExample2(format);
|
|
741
|
-
return
|
|
742
|
-
},
|
|
803
|
+
return `${spec.prefix}\0${spec.suffix}\0${spec.magnitude}`;
|
|
804
|
+
}, nonAdditiveSum = (col, row, kids) => nonAdditiveFormat(col.format) || [row, ...kids].some((k) => nonAdditiveFormat(formatAt(k, col.id))) || new Set(kids.map((k) => unitOf(formatAt(k, col.id) ?? col.format ?? ""))).size > 1, aggregateFor = (col, row) => col.aggregate ?? (nonAdditiveSum(col, row, summandsOf(row.id)) ? "none" : "sum"), warnedNonAdditive = /* @__PURE__ */ new Set(), rawState = /* @__PURE__ */ new Map();
|
|
743
805
|
for (let r of flat) rawState.set(r.id, /* @__PURE__ */ new Map());
|
|
744
806
|
for (let [id, row] of folded.hidden) rawState.set(id, new Map(row.states));
|
|
745
807
|
let valueCols = columns.filter((c) => c.kind === "value"), postOrder = orderPostfix(childrenOf);
|
|
@@ -783,12 +845,12 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
783
845
|
return { raw: null, state: authored.state };
|
|
784
846
|
if (!isParent || aggregate === "none" || aggregate === "source")
|
|
785
847
|
return authored.raw === null ? { raw: null, state: "missing" } : { raw: authored.raw, state: "value" };
|
|
786
|
-
let inputs = [], blockers = [],
|
|
848
|
+
let inputs = [], blockers = [], partialKid = !1, skippedKids = [];
|
|
787
849
|
for (let kid of kids) {
|
|
788
850
|
let ks = rawState.get(kid.id).get(col.id);
|
|
789
851
|
if (ks.state === "value" && typeof ks.raw == "number") {
|
|
790
852
|
let contribution = signTo(kid, row.id) * ks.raw;
|
|
791
|
-
|
|
853
|
+
ks.partial && (partialKid = !0, pushAll(skippedKids, skippedRows(ks))), inputs.push({ rowId: kid.id, colId: col.id, value: contribution });
|
|
792
854
|
} else
|
|
793
855
|
blockers.push({ id: kid.id, state: ks.state });
|
|
794
856
|
}
|
|
@@ -840,7 +902,7 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
840
902
|
message: `'${row.id}'.'${col.id}' is '${glyphs[inherited]}' because ${blockers.map((b) => `child '${b.id}' is ${STATE_REASON[b.state]}`).join(", ")} (column nulls policy 'propagate')`
|
|
841
903
|
}), derived = { raw: null, state: inherited };
|
|
842
904
|
} else
|
|
843
|
-
blockers.length > 0 && (autoFootnotes.add(PARTIAL_FOOTNOTE), partialColumnIds.add(col.id)), derived = { raw:
|
|
905
|
+
blockers.length > 0 && (autoFootnotes.add(PARTIAL_FOOTNOTE), partialColumnIds.add(col.id)), derived = { raw: cleanSum(inputs.map((input) => input.value)), state: "value", ...blockers.length > 0 || partialKid ? { partial: !0, skipped: skippedKey([...blockers.map((b) => b.id), ...skippedKids]) } : {} };
|
|
844
906
|
let policy = row.totalPolicy ?? (authored.raw !== null ? "validate" : "derive");
|
|
845
907
|
return policy === "source" ? authored.raw === null ? derived : { raw: authored.raw, state: "value" } : policy === "validate" && authored.raw !== null ? (noSummands ? unauditedRecord() : records.push({
|
|
846
908
|
rowId: row.id,
|
|
@@ -875,20 +937,31 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
875
937
|
for (let r of summandsOf(parentId))
|
|
876
938
|
summandsOf(r.id).length === 0 ? leafRows.push(r) : collectLeafSummands(r.id);
|
|
877
939
|
};
|
|
878
|
-
collectLeafSummands(null);
|
|
879
|
-
let leafTotal = (colId) => {
|
|
880
|
-
let
|
|
881
|
-
for (let
|
|
882
|
-
|
|
940
|
+
collectLeafSummands(null), partitionLeafIds.set(rawState, leafRows.map((r) => r.id));
|
|
941
|
+
let hiddenLeaves = [...folded.hidden].filter(([, h]) => h.leaf), leafTotal = (colId) => {
|
|
942
|
+
let terms = [];
|
|
943
|
+
for (let [s, sign] of [
|
|
944
|
+
...leafRows.map((r) => [rawState.get(r.id).get(colId), signTo(r, null)]),
|
|
945
|
+
...hiddenLeaves.map(([, h]) => [h.states.get(colId), h.sign])
|
|
946
|
+
]) {
|
|
883
947
|
if (!s || s.state !== "value" || typeof s.raw != "number") return null;
|
|
884
|
-
|
|
948
|
+
terms.push(sign * s.raw);
|
|
885
949
|
}
|
|
886
|
-
return
|
|
950
|
+
return cleanSum(terms);
|
|
887
951
|
}, computedCols = columns.filter((c) => c.kind === "computed"), calcNotes = evaluateTableCalcs(flat, valueCols, computedCols, rawState, records, leafTotal, data.columnGroups ?? [], colById, noPrevious, (id) => {
|
|
888
952
|
let row = flatById.get(id);
|
|
889
953
|
return row ? signTo(row, null) : folded.hidden.get(id)?.sign ?? 1;
|
|
890
954
|
});
|
|
891
955
|
calcNotes.nearZero && autoFootnotes.add(options.strings?.nearZeroChange ?? localeStrings(options.locale?.language).nearZeroChange), calcNotes.mixedCoverage && autoFootnotes.add(options.strings?.mixedCoverage ?? localeStrings(options.locale?.language).mixedCoverage);
|
|
956
|
+
for (let { scope, rowId, colId, cells } of calcNotes.negativeBase) {
|
|
957
|
+
let more = cells > 1 ? ` and ${cells - 1} more` : "";
|
|
958
|
+
warnings.push({
|
|
959
|
+
code: "ratio-negative-base",
|
|
960
|
+
severity: "info",
|
|
961
|
+
message: `${scope === "column" ? `column '${colId}' in row '${rowId}'` : `row '${rowId}' in column '${colId}'`}${more} divides by a negative number, so the ratio prints as plain arithmetic; a percentDelta calc prints n.m. off a negative base`,
|
|
962
|
+
owner: { rowId, colId }
|
|
963
|
+
});
|
|
964
|
+
}
|
|
892
965
|
let locale = localeDefaults(options.locale), sourceRows = magnitudeSource === data ? flatById : new Map(flattenRows(magnitudeSource.rows).map((row) => [row.id, row])), sourceColumns = new Map(magnitudeSource.columns.map((col) => [col.id, col])), scales = (example) => scalesWithMagnitude(parseFormatExample2(example)), specs = /* @__PURE__ */ new Map(), formatExamples = /* @__PURE__ */ new Map(), localeDerivedColumns = /* @__PURE__ */ new Set();
|
|
893
966
|
for (let col of [...valueCols, ...computedCols]) {
|
|
894
967
|
let inherited = col.kind === "computed" && !calcPreservesScale(col.calc) ? void 0 : options.format, authoredExample = col.format ?? inherited, example = authoredExample ?? defaultExample(col);
|
|
@@ -899,18 +972,25 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
899
972
|
let rowSpecs = /* @__PURE__ */ new Map(), rowById = /* @__PURE__ */ new Map(), forcedMagnitude = options.magnitude === "million" ? "m" : options.magnitude === "thousand" ? "k" : void 0, authoredSpec = (example, sourceExample = example) => {
|
|
900
973
|
let spec = parseFormatExample2(example);
|
|
901
974
|
return forcedMagnitude !== void 0 && scales(sourceExample) && forceScale(spec, forcedMagnitude, locale.thousands), spec;
|
|
902
|
-
},
|
|
903
|
-
let
|
|
904
|
-
return
|
|
905
|
-
},
|
|
975
|
+
}, cellsOfRow = /* @__PURE__ */ new Map(), rowCells = (row) => {
|
|
976
|
+
let cells = cellsOfRow.get(row.id);
|
|
977
|
+
return cells === void 0 && cellsOfRow.set(row.id, cells = rowCellsUncached(row)), cells;
|
|
978
|
+
}, rowValues = (row) => rowCells(row).map(([, value]) => value), rowCellsUncached = (row) => valueCols.filter((col) => col.format === void 0 && cellFormat(row.cells[col.id]) === void 0 && !(data.columnToggles ?? []).some((toggle) => toggle.columns.includes(col.id) && (options.columnVisibility?.[toggle.id] ?? toggle.defaultVisible ?? !1) === !1)).flatMap((col) => {
|
|
979
|
+
let raw = rawState.get(row.id)?.get(col.id)?.raw;
|
|
980
|
+
return typeof raw == "number" ? [[col.id, raw]] : [];
|
|
981
|
+
}), largest = (values) => values.reduce((n, v) => Math.max(n, Math.abs(v)), 0), groupOf = (row) => sourceRows.get(row.id)?.[MAGNITUDE_GROUP], groupMax = /* @__PURE__ */ new Map(), groupColumns = /* @__PURE__ */ new Map();
|
|
906
982
|
for (let row of flat) {
|
|
907
983
|
let group = groupOf(row);
|
|
908
984
|
if (group === void 0) continue;
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
985
|
+
groupMax.set(group, Math.max(groupMax.get(group) ?? 0, largest(rowValues(row))));
|
|
986
|
+
let columns2 = groupColumns.get(group);
|
|
987
|
+
columns2 === void 0 && groupColumns.set(group, columns2 = /* @__PURE__ */ new Map());
|
|
988
|
+
for (let [colId, value] of rowCells(row)) {
|
|
989
|
+
let column = columns2.get(colId);
|
|
990
|
+
column === void 0 ? columns2.set(colId, [value]) : column.push(value);
|
|
991
|
+
}
|
|
913
992
|
}
|
|
993
|
+
let groupCellSpecs = /* @__PURE__ */ new Map();
|
|
914
994
|
for (let row of flat) {
|
|
915
995
|
rowById.set(row.id, row);
|
|
916
996
|
let example = row.format ?? (row.scale ? row.scale === "percent" ? "1.2%" : "1,234" : void 0) ?? (row.calc && calcYieldsPoints(row.calc) ? `1${locale.decimal}2%` : void 0);
|
|
@@ -920,7 +1000,7 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
920
1000
|
let group = groupOf(row), rowScale = row.scale === "money" || row.scale === "perUnit";
|
|
921
1001
|
if (rowScale || specUnitKind(spec) === "number") {
|
|
922
1002
|
let values = rowValues(row), max = group === void 0 ? largest(values) : groupMax.get(group), climb = (from) => max >= 1e9 ? "bn" : max >= 1e6 ? "m" : max >= from ? "k" : "none", authoredFormat = sourceRows.get(row.id)?.format !== void 0;
|
|
923
|
-
if (rowScale) {
|
|
1003
|
+
if (rowScale && !spec.magnitudeInAffix && !spec.exponent && !spec.ordinal) {
|
|
924
1004
|
let heldMoney = row.scale === "money" && forcedMagnitude !== void 0;
|
|
925
1005
|
if (spec.magnitude = heldMoney ? forcedMagnitude : row.scale === "money" ? climb(1e3) : "none", row.scale === "money")
|
|
926
1006
|
spec.decimals = max >= 1e3 && !(heldMoney && forcedMagnitude === "k" && max >= 1e5) ? 1 : 0;
|
|
@@ -929,25 +1009,42 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
929
1009
|
for (; value !== 0 && spec.decimals < 20 && Math.abs(roundedNumber(value, spec) - value) > Math.abs(value) * 0.01; ) spec.decimals++;
|
|
930
1010
|
spec.prefix = "", spec.suffix = "", spec.lockMagnitude = heldMoney, spec.rollMagnitude = !1, spec.thousandsSep === "" && (spec.thousandsSep = locale.thousands);
|
|
931
1011
|
} else row.scale === "count" && !authoredFormat && max >= 1e6 && spec.magnitude === "none" && !spec.signed && (spec.magnitude = climb(1 / 0), spec.decimals = 1, spec.lockMagnitude = !1, spec.rollMagnitude = !1);
|
|
932
|
-
let smallMoney = !rowScale && forcedMagnitude && scales(example) && values.every((v) => Math.abs(v) < 1e3), changeLine = row.inline === !0 || spec.signed;
|
|
1012
|
+
let smallMoney = !spec.magnitudeInAffix && !spec.exponent && !spec.ordinal && !rowScale && forcedMagnitude && scales(example) && values.every((v) => Math.abs(v) < 1e3), changeLine = row.inline === !0 || spec.signed;
|
|
933
1013
|
if (smallMoney || !changeLine && group === void 0 && values.some((v) => v !== 0 && roundedNumber(v, spec) === 0)) {
|
|
934
|
-
if (smallMoney || !rowScale && spec.lockMagnitude && spec.magnitude === "k" || row.scale === "money" && spec.magnitude === "k") {
|
|
1014
|
+
if (!spec.magnitudeInAffix && (smallMoney || !rowScale && spec.lockMagnitude && spec.magnitude === "k" || row.scale === "money" && spec.magnitude === "k")) {
|
|
935
1015
|
let authored = parseFormatExample2(example);
|
|
936
1016
|
spec.decimals = !rowScale && authored.magnitude === "none" ? authored.decimals : 0, spec.magnitude = "none";
|
|
937
1017
|
}
|
|
938
1018
|
spec.decimals = values.reduce((decimals, value) => nonzeroDecimals(value / MAGNITUDE_DIVISOR[spec.magnitude], decimals), spec.decimals);
|
|
939
1019
|
}
|
|
940
1020
|
if (!changeLine && (spec.magnitude !== "none" || group !== void 0 && row.scale === "money") && !(spec.lockMagnitude && spec.magnitude === "k") && (row.scale === "money" || row.scale === "count" && !authoredFormat))
|
|
941
|
-
|
|
942
|
-
for (
|
|
1021
|
+
if (group === void 0)
|
|
1022
|
+
for (let value of values)
|
|
1023
|
+
for (; value !== 0 && spec.decimals < 20 && Math.abs(roundedNumber(value, spec) - value) > Math.abs(value) * 0.01; ) spec.decimals++;
|
|
1024
|
+
else {
|
|
1025
|
+
let columns2 = groupColumns.get(group);
|
|
1026
|
+
for (let column of columns2.values())
|
|
1027
|
+
for (let value of column)
|
|
1028
|
+
for (; value !== 0 && spec.decimals < 20 && Math.abs(roundedNumber(value, spec) - value) > max * 0.01; ) spec.decimals++;
|
|
1029
|
+
let inRow = /* @__PURE__ */ new Map();
|
|
1030
|
+
for (let [colId, column] of columns2) {
|
|
1031
|
+
let cellSpec = { ...spec }, bound = largest(column) * 0.01;
|
|
1032
|
+
for (let value of column)
|
|
1033
|
+
for (; value !== 0 && cellSpec.decimals < 20 && Math.abs(roundedNumber(value, cellSpec) - value) > bound; ) cellSpec.decimals++;
|
|
1034
|
+
inRow.set(colId, cellSpec);
|
|
1035
|
+
}
|
|
1036
|
+
groupCellSpecs.set(row.id, inRow);
|
|
1037
|
+
}
|
|
943
1038
|
}
|
|
944
1039
|
let sourceRow = sourceRows.get(row.id);
|
|
945
|
-
spec.automatic = automaticAs(group !== void 0 || (sourceRow?.format === void 0 || sourceRow[AUTOMATIC_FORMAT] === !0) && options.format === void 0 && options.unit === void 0 && forcedMagnitude === void 0)
|
|
1040
|
+
spec.automatic = automaticAs(group !== void 0 || (sourceRow?.format === void 0 || sourceRow[AUTOMATIC_FORMAT] === !0) && options.format === void 0 && options.unit === void 0 && forcedMagnitude === void 0);
|
|
1041
|
+
for (let cellSpec of groupCellSpecs.get(row.id)?.values() ?? []) cellSpec.automatic = spec.automatic;
|
|
1042
|
+
rowSpecs.set(row.id, spec);
|
|
946
1043
|
}
|
|
947
1044
|
}
|
|
948
|
-
let cellSpecs = /* @__PURE__ */ new Map();
|
|
1045
|
+
let cellSpecs = /* @__PURE__ */ new Map(), cellFormatCols = [...valueCols, ...computedCols];
|
|
949
1046
|
for (let row of flat)
|
|
950
|
-
for (let col of
|
|
1047
|
+
for (let col of cellFormatCols) {
|
|
951
1048
|
let example = cellFormat(row.cells[col.id]);
|
|
952
1049
|
if (example !== void 0) {
|
|
953
1050
|
let sourceRow = sourceRows.get(row.id), sourceColumn = sourceColumns.get(col.id), sourceExample = cellFormat(sourceRow?.cells[col.id]) ?? sourceColumn?.format ?? sourceRow?.format ?? options.format ?? defaultExample(col), inRow = cellSpecs.get(row.id);
|
|
@@ -956,18 +1053,21 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
956
1053
|
cellFormat(sourceRow?.cells[col.id]) !== void 0 && sourceCell?.[AUTOMATIC_FORMAT] !== !0 && holdAuthoredScale(spec, locale.thousands), sourceCell?.[AUTOMATIC_FORMAT] === !0 && (spec.automatic = automaticAs(!0)), inRow.set(col.id, spec);
|
|
957
1054
|
}
|
|
958
1055
|
}
|
|
959
|
-
let
|
|
1056
|
+
let cellNamesOtherUnit = (rowId, colId, spec) => {
|
|
1057
|
+
let own = cellSpecs.get(rowId)?.get(colId);
|
|
1058
|
+
return own !== void 0 && typeof rawState.get(rowId)?.get(colId)?.raw == "number" && unitOfSpec(own) !== unitOfSpec(spec);
|
|
1059
|
+
}, hoistedRowUnits = /* @__PURE__ */ new Map();
|
|
960
1060
|
if (forcedMagnitude !== void 0)
|
|
961
1061
|
for (let [rowId, spec] of rowSpecs) {
|
|
962
|
-
if (rowById.get(rowId)?.scale === "money" || rowById.get(rowId)?.scale === "perUnit" || rowById.get(rowId)?.calc !== void 0 || !scales(sourceRows.get(rowId)?.format ?? "1,234")) continue;
|
|
963
|
-
let unit = unitOfSpec(spec);
|
|
1062
|
+
if (rowById.get(rowId)?.scale === "money" || rowById.get(rowId)?.scale === "perUnit" || rowById.get(rowId)?.calc !== void 0 || !scales(sourceRows.get(rowId)?.format ?? "1,234") || valueCols.some((col) => cellNamesOtherUnit(rowId, col.id, spec))) continue;
|
|
1063
|
+
let unit = spec.magnitude === "none" ? null : unitOfSpec(spec);
|
|
964
1064
|
unit !== null && hoistedRowUnits.set(rowId, unit);
|
|
965
1065
|
}
|
|
966
|
-
let
|
|
1066
|
+
let ownFormatColumns = new Set([...valueCols, ...computedCols].filter(columnOwnsFormat).map((col) => col.id)), rowFormattedColumns = /* @__PURE__ */ new Set();
|
|
967
1067
|
for (let row of flat)
|
|
968
1068
|
if (!(row.calc || !rowSpecs.has(row.id)))
|
|
969
1069
|
for (let col of valueCols)
|
|
970
|
-
!
|
|
1070
|
+
!ownFormatColumns.has(col.id) && typeof rawState.get(row.id)?.get(col.id)?.raw == "number" && rowFormattedColumns.add(col.id);
|
|
971
1071
|
let hoistedUnitSet = new Set(hoistedRowUnits.values()), figureRows = flat.filter((row) => !row.calc && valueCols.some((col) => typeof rawState.get(row.id)?.get(col.id)?.raw == "number")), headUnit = figureRows.length > 1 && hoistedUnitSet.size === 1 && figureRows.every((row) => hoistedRowUnits.has(row.id)) ? [...hoistedUnitSet][0] : void 0;
|
|
972
1072
|
function defaultExample(col) {
|
|
973
1073
|
if (col.kind === "computed" && calcYieldsPoints(col.calc)) return `1${locale.decimal}2%`;
|
|
@@ -985,13 +1085,13 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
985
1085
|
return decimals > 1 ? `0${locale.decimal}${"1234".slice(0, decimals)}` : `1${locale.decimal}2`;
|
|
986
1086
|
}
|
|
987
1087
|
let unitByCol = /* @__PURE__ */ new Map(), rollsOff = (colId, spec) => spec.magnitude !== "none" && flat.some((row) => {
|
|
988
|
-
if (rowSpecs.has(row.id) && (row.calc !== void 0 || row.inline === !0 || !
|
|
1088
|
+
if (rowSpecs.has(row.id) && (row.calc !== void 0 || row.inline === !0 || !ownFormatColumns.has(colId)) || cellSpecs.get(row.id)?.has(colId)) return !1;
|
|
989
1089
|
let raw = rawState.get(row.id)?.get(colId)?.raw;
|
|
990
1090
|
return typeof raw == "number" && raw !== 0 && effectiveScale(Math.abs(raw), spec).magnitude !== spec.magnitude;
|
|
991
1091
|
}), lettersInCells = /* @__PURE__ */ new Set();
|
|
992
1092
|
for (let col of [...valueCols, ...computedCols]) {
|
|
993
1093
|
let spec = specs.get(col.id);
|
|
994
|
-
!rowFormattedColumns.has(col.id) && rollsOff(col.id, spec) && lettersInCells.add(col.id), unitByCol.set(col.id, rowFormattedColumns.has(col.id) || lettersInCells.has(col.id) ? null : unitOfSpec(spec));
|
|
1094
|
+
!rowFormattedColumns.has(col.id) && (rollsOff(col.id, spec) || flat.some((row) => cellNamesOtherUnit(row.id, col.id, spec))) && lettersInCells.add(col.id), unitByCol.set(col.id, rowFormattedColumns.has(col.id) || lettersInCells.has(col.id) ? null : unitOfSpec(spec));
|
|
995
1095
|
}
|
|
996
1096
|
let headerUnitFor = (id) => unitByCol.get(id) ?? (rowFormattedColumns.has(id) ? headUnit ?? null : null), headerScaledFor = (id) => unitByCol.get(id) != null ? specs.get(id).magnitude !== "none" : rowFormattedColumns.has(id) && headUnit !== void 0 && figureRows.some((row) => (rowSpecs.get(row.id)?.magnitude ?? "none") !== "none"), distinctUnits = [...new Set([...unitByCol.keys()].map(headerUnitFor).filter((u) => u !== null))], candidateUnit = distinctUnits.length === 1 && [...valueCols, ...computedCols].every((col) => {
|
|
997
1097
|
let kind = specUnitKind(specs.get(col.id));
|
|
@@ -1000,8 +1100,8 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1000
1100
|
subtitle: resolveSubtitle(options.subtitle),
|
|
1001
1101
|
unit: candidateUnit,
|
|
1002
1102
|
unitShown: options.unitShown
|
|
1003
|
-
}),
|
|
1004
|
-
uniformUnit !== null && options.unit !== void 0 && options.unit !== uniformUnit && warnings.push({
|
|
1103
|
+
}), authoredUnit = typeof options.unit == "string" ? options.unit.trim() : void 0, scaleWords = (authoredUnit?.split(/[\s$€£¥()]+/) ?? []).filter((word) => Object.values(MAGNITUDE_LABEL).some((label) => label !== "" && sameUnit(word, label))), bareScale = candidateUnit !== void 0 && [...[...valueCols, ...computedCols].map((col) => specs.get(col.id)), ...rowSpecs.values()].every((spec) => specUnitKind(spec) !== "number" || spec.prefix.trim() === "" && spec.suffix.trim() === ""), carriesScale = scaleWords.some((word) => sameUnit(word, candidateUnit ?? "")), composes = bareScale && !!authoredUnit && (carriesScale || scaleWords.length === 0 && /^(?:[A-Z]{3}|\p{Sc})$/u.test(authoredUnit)), composedUnit = composes ? carriesScale ? authoredUnit : `${authoredUnit} ${candidateUnit}` : candidateUnit, uniformUnit = composedUnit && frameCarriesUnit ? composedUnit : null;
|
|
1104
|
+
uniformUnit !== null && options.unit !== void 0 && options.unit !== uniformUnit && !composes && warnings.push({
|
|
1005
1105
|
code: "table-unit-overridden",
|
|
1006
1106
|
severity: "warn",
|
|
1007
1107
|
field: ["options", "unit"],
|
|
@@ -1016,18 +1116,18 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1016
1116
|
let cellSpec = rowId ? cellSpecs.get(rowId)?.get(colId) : void 0;
|
|
1017
1117
|
if (cellSpec) return cellSpec;
|
|
1018
1118
|
let rowSpec = rowId ? rowSpecs.get(rowId) : void 0;
|
|
1019
|
-
return rowSpec && (rowOverridesColumn(rowId) || !
|
|
1119
|
+
return rowSpec && (rowOverridesColumn(rowId) || !ownFormatColumns.has(colId)) ? groupCellSpecs.get(rowId)?.get(colId) ?? rowSpec : specs.get(colId);
|
|
1020
1120
|
}, formatNumber = (raw, colId, rowId, lift = !0) => {
|
|
1021
|
-
let cellSpec = rowId ? cellSpecs.get(rowId)?.get(colId) : void 0, rowSpec = rowId ? rowSpecs.get(rowId) : void 0, rowPath = rowSpec !== void 0 && (rowOverridesColumn(rowId) || !
|
|
1022
|
-
if (cellSpec && !
|
|
1023
|
-
let decimals = cellSpec?.decimals ?? base.decimals;
|
|
1121
|
+
let cellSpec = rowId ? cellSpecs.get(rowId)?.get(colId) : void 0, rowSpec = rowId ? rowSpecs.get(rowId) : void 0, rowPath = rowSpec !== void 0 && (rowOverridesColumn(rowId) || !ownFormatColumns.has(colId)), base = rowPath ? rowSpec : specs.get(colId);
|
|
1122
|
+
if (cellSpec && !sameUnit2(cellSpec, base)) return formatWithSpec(raw, lift ? cellSpec : { ...cellSpec, automatic: !1 });
|
|
1123
|
+
let decimals = cellSpec?.decimals ?? (rowPath ? groupCellSpecs.get(rowId)?.get(colId)?.decimals : void 0) ?? base.decimals;
|
|
1024
1124
|
if (rowPath) {
|
|
1025
1125
|
if (raw === 0 && lift && !cellSpec && groupOf(rowById.get(rowId)) !== void 0) return "0";
|
|
1026
1126
|
let hoisted = rowId !== void 0 && hoistedRowUnits.has(rowId), automatic = lift && (cellSpec ? cellSpec.automatic : rowSpec.automatic);
|
|
1027
|
-
return hoisted ?
|
|
1127
|
+
return hoisted ? formatWithSpec(raw, { ...rowSpec, decimals, automatic, prefix: "", suffix: "", magnitudeInAffix: !0 }) : formatWithSpec(raw, { ...rowSpec, decimals, automatic });
|
|
1028
1128
|
}
|
|
1029
|
-
let spec = { ...specs.get(colId), decimals, ...cellSpec ? { currencyWhole: void 0, automatic: cellSpec.automatic } : {}, ...lift ? {} : { automatic: !1 } }, rendered = unitByCol.get(colId) == null ? formatWithSpec(raw, spec) : formatWithSpec(raw, { ...spec, prefix: "", suffix: ""
|
|
1030
|
-
return
|
|
1129
|
+
let spec = { ...specs.get(colId), decimals, ...cellSpec ? { currencyWhole: void 0, automatic: cellSpec.automatic } : {}, ...lift ? {} : { automatic: !1 } }, rendered = unitByCol.get(colId) == null ? formatWithSpec(raw, spec) : formatWithSpec(raw, { ...spec, prefix: "", suffix: "", magnitudeInAffix: !0 });
|
|
1130
|
+
return localeDerivedColumns.has(colId) && locale.minusGlyph === "-" && rendered.startsWith(MINUS) ? `-${rendered.slice(MINUS.length)}` : rendered;
|
|
1031
1131
|
}, madeNm = /* @__PURE__ */ new Set();
|
|
1032
1132
|
for (let record of records) {
|
|
1033
1133
|
if (record.kind !== "calc" || record.state !== "value") continue;
|
|
@@ -1041,16 +1141,23 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1041
1141
|
reconcileShares(col.id, spec);
|
|
1042
1142
|
}
|
|
1043
1143
|
function reconcileShares(colId, spec) {
|
|
1044
|
-
let entries =
|
|
1045
|
-
|
|
1046
|
-
|
|
1144
|
+
let entries = [
|
|
1145
|
+
...leafRows.map((r) => ({ r, s: rawState.get(r.id).get(colId), shown: !0 })),
|
|
1146
|
+
...hiddenLeaves.map(([id, h]) => ({ r: { id }, s: h.states.get(colId), shown: !1 }))
|
|
1147
|
+
].filter((e) => e.s?.state === "value" && typeof e.s.raw == "number"), LAST = Number.MAX_SAFE_INTEGER;
|
|
1148
|
+
if (entries.sort((a, b) => (folded.leafOrder.get(a.r.id) ?? LAST) - (folded.leafOrder.get(b.r.id) ?? LAST)), entries.length !== leafRows.length + hiddenLeaves.length || entries.length === 0) return;
|
|
1149
|
+
let decimals = spec.decimals ?? 1, unit = Math.pow(10, -decimals), floors = entries.map((e) => Math.floor(e.s.raw / unit) * unit), remainders = entries.map((e, i) => e.s.raw - floors[i]), deficit = Math.round((100 - floors.reduce((a, b) => a + b, 0)) / unit), ownPrecision = entries.map((e) => {
|
|
1150
|
+
let cellSpec = cellSpecs.get(e.r.id)?.get(colId);
|
|
1151
|
+
return cellSpec !== void 0 && (cellSpec.decimals ?? 1) !== decimals;
|
|
1152
|
+
}), order = entries.map((_, i) => i).filter((i) => !ownPrecision[i]).sort((a, b) => remainders[b] - remainders[a] || a - b), adjusted = /* @__PURE__ */ new Set();
|
|
1047
1153
|
for (let i of order) {
|
|
1048
1154
|
if (deficit <= 0) break;
|
|
1049
1155
|
adjusted.add(i), deficit--;
|
|
1050
1156
|
}
|
|
1051
1157
|
entries.forEach((e, i) => {
|
|
1052
|
-
|
|
1053
|
-
|
|
1158
|
+
if (ownPrecision[i] || !e.shown) return;
|
|
1159
|
+
let shown = floors[i] + (adjusted.has(i) ? unit : 0), cellSpec = cellSpecs.get(e.r.id)?.get(colId);
|
|
1160
|
+
displayOverride.set(tableCellKey(e.r.id, colId), shown === 0 && e.s.raw > 0 && spec.automatic && !cellSpec ? `<${formatNumber(unit, colId)}` : formatNumber(shown, colId, e.r.id)), overrideAmount.set(tableCellKey(e.r.id, colId), shown), adjusted.has(i) && Math.abs(shown - e.s.raw) > 1e-9 && records.push({
|
|
1054
1161
|
rowId: e.r.id,
|
|
1055
1162
|
colId,
|
|
1056
1163
|
op: "share-reconcile",
|
|
@@ -1063,7 +1170,7 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1063
1170
|
],
|
|
1064
1171
|
raw: shown,
|
|
1065
1172
|
state: "value",
|
|
1066
|
-
displayed: formatNumber(shown, colId),
|
|
1173
|
+
displayed: formatNumber(shown, colId, e.r.id),
|
|
1067
1174
|
kind: "rounding-adjustment"
|
|
1068
1175
|
});
|
|
1069
1176
|
});
|
|
@@ -1083,7 +1190,7 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1083
1190
|
for (let row of flat) {
|
|
1084
1191
|
let rowSpec = rowSpecs.get(row.id);
|
|
1085
1192
|
if (!rowSpec || row.calc || !(rowSpec.suffix ?? "").includes("%")) continue;
|
|
1086
|
-
let vals = valueCols.filter((col) => !
|
|
1193
|
+
let vals = valueCols.filter((col) => !ownFormatColumns.has(col.id) && col.percentScale !== "points").map((col) => rawState.get(row.id).get(col.id)).filter((s) => !!s && typeof s.raw == "number");
|
|
1087
1194
|
vals.length > 0 && vals.every((v) => Math.abs(v.raw) <= 1.5) && warnings.push({
|
|
1088
1195
|
code: "percent-scale-suspect",
|
|
1089
1196
|
severity: "warn",
|
|
@@ -1107,7 +1214,7 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1107
1214
|
{ rowId: k.id, colId: col.id, value: childRaw[i], role: "raw" },
|
|
1108
1215
|
{ rowId: k.id, colId: col.id, value: childShown[i], role: "displayed" }
|
|
1109
1216
|
])
|
|
1110
|
-
],
|
|
1217
|
+
], unitOf2 = (candidate) => Math.pow(10, -candidate.decimals) * MAGNITUDE_DIVISOR[candidate.magnitude], displayUnit = Math.min(unitOf2(spec), minOf(kids.map((k) => unitOf2(specFor(col.id, k.id)))));
|
|
1111
1218
|
Math.abs(roundingGap) > displayUnit * 0.5 && (autoFootnotes.add(ROUNDING_FOOTNOTE), records.push({
|
|
1112
1219
|
rowId: row.id,
|
|
1113
1220
|
colId: col.id,
|
|
@@ -1163,11 +1270,18 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1163
1270
|
function driverToneOf(row) {
|
|
1164
1271
|
return driverToneMode !== "grouped" ? driverToneMode === "always" : row.parentId !== null && flatById.get(row.parentId)?.role !== "section";
|
|
1165
1272
|
}
|
|
1273
|
+
function memoIndentStep(row) {
|
|
1274
|
+
if (row.relation !== "ofWhich" || row.kind !== void 0 || row.parentId === null) return;
|
|
1275
|
+
let siblings = treeChildrenOf.get(row.parentId) ?? [];
|
|
1276
|
+
if (!siblings.slice(0, siblings.findIndex((sibling) => sibling.id === row.id)).some((sibling) => sibling.relation !== "ofWhich")) return;
|
|
1277
|
+
let parentStep = ladderStep(flatById.get(row.parentId), flatById, levelOffset);
|
|
1278
|
+
return parentStep < ladderStep(row, flatById, levelOffset) ? parentStep : void 0;
|
|
1279
|
+
}
|
|
1166
1280
|
let resolvedRows = flat.map((row) => {
|
|
1167
1281
|
let cells = emptyIdRecord();
|
|
1168
1282
|
for (let col of columns)
|
|
1169
1283
|
cells[col.id] = resolveCell(row, col);
|
|
1170
|
-
let hasChildren = (treeChildrenOf.get(row.id) ?? []).length > 0;
|
|
1284
|
+
let hasChildren = (treeChildrenOf.get(row.id) ?? []).length > 0, indentStep = memoIndentStep(row);
|
|
1171
1285
|
return {
|
|
1172
1286
|
id: row.id,
|
|
1173
1287
|
label: row.label,
|
|
@@ -1176,6 +1290,7 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1176
1290
|
...hasChildren ? { defaultExpanded: expansion.get(row.id) } : {},
|
|
1177
1291
|
level: row.level,
|
|
1178
1292
|
step: ladderStep(row, flatById, levelOffset),
|
|
1293
|
+
...indentStep === void 0 ? {} : { indentStep },
|
|
1179
1294
|
...row.kind === void 0 ? {} : { kind: row.kind },
|
|
1180
1295
|
...row.kind === "driver" && driverToneOf(row) ? { driverTone: !0 } : {},
|
|
1181
1296
|
...row.sign === void 0 ? {} : { sign: row.sign },
|
|
@@ -1237,7 +1352,7 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1237
1352
|
...obj?.heat === !1 ? { heat: !1 } : {},
|
|
1238
1353
|
...obj?.strong === !0 && obj.tone !== void 0 && obj.tone !== "neutral" ? { strong: !0 } : {},
|
|
1239
1354
|
...typeof obj?.bar == "number" && Number.isFinite(obj.bar) ? { bar: Math.min(1, Math.max(0, obj.bar)) } : {},
|
|
1240
|
-
...col.kind === "value" && obj?.format !== void 0 ? { format: obj.format } : {},
|
|
1355
|
+
...(col.kind === "value" || col.kind === "computed") && obj?.format !== void 0 ? { format: obj.format } : {},
|
|
1241
1356
|
scenario: col.kind === "value" ? col.scenario : void 0,
|
|
1242
1357
|
role: row.role,
|
|
1243
1358
|
relation: row.relation,
|
|
@@ -1252,13 +1367,13 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1252
1367
|
return { ...base, raw: row.label, state: "value", displayed: row.label };
|
|
1253
1368
|
case "value":
|
|
1254
1369
|
case "computed": {
|
|
1255
|
-
let evaluated = rawState.get(row.id).get(col.id), s = evaluated ?? { raw: null, state: "missing" }, displayed;
|
|
1370
|
+
let evaluated = rawState.get(row.id).get(col.id), s = evaluated ?? { raw: null, state: "missing" }, displayed, negated = !1;
|
|
1256
1371
|
if (s.state !== "value" || typeof s.raw != "number") {
|
|
1257
1372
|
let state = s.state === "value" ? "missing" : s.state, noPreviousColumn = row.calc !== void 0 && JSON.stringify(row.calc).includes('"previous":true') && previousColumnInGroup(data.columnGroups ?? [], col.id) === null, noPreviousValue = state === "na" && previousPlaceholders && noPreviousColumn;
|
|
1258
1373
|
displayed = state === "missing" && gapWord && missing === void 0 && evaluated !== void 0 && !(noPreviousColumn && noPrevious === "missing") && !blankInputs(row, col) ? glyphs.na : state === "missing" || noPreviousValue ? missingGlyph : glyphs[state];
|
|
1259
1374
|
} else {
|
|
1260
|
-
let relativeChange = (row.inline === !0 || row.calc !== void 0 || col.kind === "computed") && (specUnitKind(specFor(col.id, row.id)) !== "number" || row.calc !== void 0 && calcYieldsPoints(row.calc) || col.kind === "computed" && calcYieldsPoints(col.calc)), negate = (options.signs ?? "signed") === "signed" && row.kind !== "driver" && row.kind !== "result" && !relativeChange && signTo(row, null) === -1;
|
|
1261
|
-
displayed = (negate ? void 0 : displayOverride.get(tableCellKey(row.id, col.id))) ?? formatNumber(negate && s.raw !== 0 ? -s.raw : s.raw, col.id, row.id), negate && locale.minusGlyph === "-" && (displayed = displayed.replace(MINUS, "-")), s.partial && !(disclosuresShown(options) && partialColumnIds.has(col.id)) && (displayed = `${displayed} ${options.strings?.incomplete ?? localeStrings(options.locale?.language).incomplete}`);
|
|
1375
|
+
let relativeChange = (row.inline === !0 || row.calc !== void 0 || col.kind === "computed") && (specUnitKind(specFor(col.id, row.id)) !== "number" || row.calc !== void 0 && calcYieldsPoints(row.calc) || col.kind === "computed" && calcYieldsPoints(col.calc)), negate = (options.signs ?? "signed") === "signed" && row.kind !== "driver" && row.kind !== "result" && !relativeChange && signTo(row, null) === -1 && (col.kind !== "computed" || row.calc !== void 0 || calcFlipsWithInputs(col.calc));
|
|
1376
|
+
negated = negate && s.raw !== 0, displayed = (negate ? void 0 : displayOverride.get(tableCellKey(row.id, col.id))) ?? formatNumber(negate && s.raw !== 0 ? -s.raw : s.raw, col.id, row.id), negate && locale.minusGlyph === "-" && (displayed = displayed.replace(MINUS, "-")), s.partial && !(disclosuresShown(options) && partialColumnIds.has(col.id)) && (displayed = `${displayed} ${options.strings?.incomplete ?? localeStrings(options.locale?.language).incomplete}`);
|
|
1262
1377
|
}
|
|
1263
1378
|
let band = obj?.bands !== void 0 && s.state === "value" && typeof s.raw == "number" ? bandFor(s.raw, obj.bands) : void 0, bandIndex = band === void 0 ? -1 : obj.bands.indexOf(band), tone = obj?.tone ?? band?.tone ?? "neutral", deEmphasized, judgmentRow = row.relation === "additive" || row.calc !== void 0 || row.inline === !0 && row.polarity !== void 0, polarity = col.polarity !== void 0 ? row.polarity ?? col.polarity : row.calc !== void 0 || row.inline === !0 || specFor(col.id, row.id).signed ? row.polarity : void 0;
|
|
1264
1379
|
if (s.state === "value" && typeof s.raw == "number" && judgmentRow) {
|
|
@@ -1282,11 +1397,12 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1282
1397
|
deEmphasized,
|
|
1283
1398
|
polarity,
|
|
1284
1399
|
...zero ? { zero: !0 } : {},
|
|
1400
|
+
...negated ? { negated: !0 } : {},
|
|
1285
1401
|
...band === void 0 ? {} : { band: { to: band.to, ...bandIndex > 0 ? { from: obj.bands[bandIndex - 1].to } : {}, ...band.label === void 0 ? {} : { label: band.label } } }
|
|
1286
1402
|
};
|
|
1287
1403
|
}
|
|
1288
1404
|
case "status": {
|
|
1289
|
-
let given = typeof authored == "number" ? authored : obj?.v,
|
|
1405
|
+
let given = typeof authored == "number" ? authored : obj?.v, written = typeof authored == "string" ? authored : typeof given == "string" ? given : null, v = written;
|
|
1290
1406
|
if (typeof given == "number")
|
|
1291
1407
|
return warnings.push({
|
|
1292
1408
|
code: "status-value-number",
|
|
@@ -1294,19 +1410,39 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1294
1410
|
message: `status cell rows[${row.id}].cells[${col.id}] holds the number ${given} and draws the missing dash; write one of: ${STATUS_VALUES.join(" \xB7 ")}, or use a text column with a cell tone. A later release refuses a number here.`,
|
|
1295
1411
|
owner: { rowId: row.id, colId: col.id }
|
|
1296
1412
|
}), { ...base, displayed: missingGlyph };
|
|
1413
|
+
if (v !== null && !STATUS_VALUES.includes(v)) {
|
|
1414
|
+
let converted = caseInsensitiveValue(v, STATUS_VALUES) ?? (Object.hasOwn(STATUS_WORDS, v.toLowerCase()) ? STATUS_WORDS[v.toLowerCase()] : void 0);
|
|
1415
|
+
if (converted !== void 0) {
|
|
1416
|
+
let rowPath = (rows, base2) => {
|
|
1417
|
+
for (let [index, candidate] of rows.entries()) {
|
|
1418
|
+
let path = [...base2, index];
|
|
1419
|
+
if (candidate.id === row.id) return path;
|
|
1420
|
+
let child = candidate.children && rowPath(candidate.children, [...path, "children"]);
|
|
1421
|
+
if (child) return child;
|
|
1422
|
+
}
|
|
1423
|
+
}, field = [...rowPath(data.rows, ["data", "rows"]), "cells", col.id, ...obj ? ["v"] : []];
|
|
1424
|
+
warnings.push(inputConversion(field, v, converted)), v = converted;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1297
1427
|
if (v !== null && !STATUS_VALUES.includes(v))
|
|
1298
1428
|
throw new NormalizeError(
|
|
1299
1429
|
"status-value-invalid",
|
|
1300
1430
|
`rows[${row.id}].cells[${col.id}]`,
|
|
1301
|
-
`status '${v}' is not one of: ${STATUS_VALUES.join(" \xB7 ")}; for free status text use a text column with a cell tone
|
|
1431
|
+
`status '${v}' is not one of: ${STATUS_VALUES.join(" \xB7 ")}; for free status text use a text column with a cell tone`,
|
|
1432
|
+
"Use on-track, at-risk, off-track, done or pending, or green, amber, yellow or red (any case). For free status text use a text column with a cell tone."
|
|
1302
1433
|
);
|
|
1303
1434
|
if (v === null) return { ...base, displayed: missingGlyph };
|
|
1304
|
-
let tone = v === "off-track" ? "bad" : v === "at-risk" ? "warn" : v === "done" || v === "on-track" ? "good" : "neutral", labels = col.kind === "status" ? col.labels : void 0;
|
|
1305
|
-
return { ...base, raw: v, state: "value", displayed
|
|
1435
|
+
let tone = v === "off-track" ? "bad" : v === "at-risk" ? "warn" : v === "done" || v === "on-track" ? "good" : "neutral", labels = col.kind === "status" ? col.labels : void 0, displayed = written === v ? labels?.[v] ?? v : labels?.[written] ?? labels?.[v] ?? v;
|
|
1436
|
+
return { ...base, raw: v, state: "value", displayed, tone: judgementTone(tone, obj?.strong) };
|
|
1306
1437
|
}
|
|
1307
1438
|
case "date": {
|
|
1308
|
-
let v = typeof authored == "string" ? authored : typeof
|
|
1309
|
-
if (
|
|
1439
|
+
let given = typeof authored == "number" ? authored : obj?.v, v = typeof authored == "string" ? authored : typeof given == "string" ? given : null;
|
|
1440
|
+
if (typeof given == "number" && warnings.push({
|
|
1441
|
+
code: "date-value-number",
|
|
1442
|
+
severity: "warn",
|
|
1443
|
+
message: `date cell rows[${row.id}].cells[${col.id}] holds the number ${given} and draws the missing dash; write an ISO date (YYYY-MM-DD), or use a value or text column.`,
|
|
1444
|
+
owner: { rowId: row.id, colId: col.id }
|
|
1445
|
+
}), v === null) return { ...base, displayed: missingGlyph };
|
|
1310
1446
|
let d = parseISODate(v);
|
|
1311
1447
|
if (!d)
|
|
1312
1448
|
throw new NormalizeError(
|
|
@@ -1314,7 +1450,7 @@ function resolveTableIn(data, options, magnitudeSource) {
|
|
|
1314
1450
|
`rows[${row.id}].cells[${col.id}]`,
|
|
1315
1451
|
`'${v}' is not an ISO date (YYYY-MM-DD)`
|
|
1316
1452
|
);
|
|
1317
|
-
let pattern =
|
|
1453
|
+
let pattern = datePatterns.get(col.id);
|
|
1318
1454
|
return { ...base, raw: v, state: "value", displayed: formatDate(d, pattern, options.locale?.language) };
|
|
1319
1455
|
}
|
|
1320
1456
|
case "text": {
|
|
@@ -1391,11 +1527,11 @@ function resolveCellEncoding(encoding, percent) {
|
|
|
1391
1527
|
...encoding.tolerance === void 0 ? {} : { tolerance: encoding.tolerance }
|
|
1392
1528
|
};
|
|
1393
1529
|
}
|
|
1394
|
-
var evaluatedStates = /* @__PURE__ */ new WeakMap();
|
|
1530
|
+
var evaluatedStates = /* @__PURE__ */ new WeakMap(), partitionLeafIds = /* @__PURE__ */ new WeakMap();
|
|
1395
1531
|
function applyTableTopN(data, options) {
|
|
1396
1532
|
let topN = options.topN;
|
|
1397
|
-
if (!topN || topN.n <= 0) return { data, generatedOthers: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Map() };
|
|
1398
|
-
let inner = resolveTable(data, { ...options, topN: void 0 }), folded = foldTableTopN(data, inner.table, options), kept = new Set(flattenRows(folded.data.rows).map((row) => row.id)), innerById = new Map(inner.table.rows.map((row) => [row.id, row])), hidden = /* @__PURE__ */ new Map();
|
|
1533
|
+
if (!topN || topN.n <= 0) return { data, generatedOthers: /* @__PURE__ */ new Set(), hidden: /* @__PURE__ */ new Map(), leafOrder: /* @__PURE__ */ new Map() };
|
|
1534
|
+
let inner = resolveTable(data, { ...options, topN: void 0 }), folded = foldTableTopN(data, inner.table, options), kept = new Set(flattenRows(folded.data.rows).map((row) => row.id)), innerById = new Map(inner.table.rows.map((row) => [row.id, row])), hidden = /* @__PURE__ */ new Map(), leafOrder = new Map((partitionLeafIds.get(evaluatedStates.get(inner)) ?? []).map((id, i) => [id, i]));
|
|
1399
1535
|
for (let row of inner.table.rows) {
|
|
1400
1536
|
if (kept.has(row.id)) continue;
|
|
1401
1537
|
let evaluated = evaluatedStates.get(inner)?.get(row.id), states = /* @__PURE__ */ new Map();
|
|
@@ -1403,16 +1539,16 @@ function applyTableTopN(data, options) {
|
|
|
1403
1539
|
let own = evaluated?.get(colId);
|
|
1404
1540
|
states.set(colId, { raw: cell.raw, state: cell.state, ...own?.partial ? { partial: !0, skipped: own.skipped } : {} });
|
|
1405
1541
|
}
|
|
1406
|
-
hidden.set(row.id, { sign: contributionSignOf(row, (id) => innerById.get(id), null), states });
|
|
1542
|
+
hidden.set(row.id, { sign: contributionSignOf(row, (id) => innerById.get(id), null), states, leaf: leafOrder.has(row.id) });
|
|
1407
1543
|
}
|
|
1408
|
-
return { ...folded, hidden };
|
|
1544
|
+
return { ...folded, hidden, leafOrder };
|
|
1409
1545
|
}
|
|
1410
1546
|
function stampRecordDisplay(records, resolvedRows, formatNumber) {
|
|
1411
1547
|
let cellIndex = /* @__PURE__ */ new Map();
|
|
1412
1548
|
for (let r of resolvedRows) for (let c of Object.values(r.cells)) cellIndex.set(tableCellKey(c.rowId, c.colId), c);
|
|
1413
1549
|
for (let rec of records) {
|
|
1414
1550
|
if (rec.kind === "reconciliation" || rec.kind === "rounding-adjustment") {
|
|
1415
|
-
rec.displayed = typeof rec.raw == "number" ? formatNumber(rec.raw, rec.colId) : "";
|
|
1551
|
+
rec.displayed = typeof rec.raw == "number" ? formatNumber(rec.raw, rec.colId, rec.kind === "rounding-adjustment" ? rec.rowId : void 0) : "";
|
|
1416
1552
|
continue;
|
|
1417
1553
|
}
|
|
1418
1554
|
rec.displayed = cellIndex.get(tableCellKey(rec.rowId, rec.colId))?.displayed ?? rec.displayed;
|
|
@@ -1716,9 +1852,6 @@ function validateCalcRefs(columns, colById) {
|
|
|
1716
1852
|
for (let c of columns)
|
|
1717
1853
|
c.kind === "computed" && check(c.calc, c.id);
|
|
1718
1854
|
}
|
|
1719
|
-
function calcYieldsPoints(calc) {
|
|
1720
|
-
return "op" in calc && (calc.op === "share" || calc.op === "percentDelta");
|
|
1721
|
-
}
|
|
1722
1855
|
var LEAF_TOTAL_ROW_ID = "__leafTotal", SHARE_UNIT_ROW_ID = "__displayUnit";
|
|
1723
1856
|
function pushCalcRecord(records, rowId, colId, res) {
|
|
1724
1857
|
records.push({
|
|
@@ -1806,7 +1939,10 @@ function walkRowCalc(calc, owner, rowIds, calcRows, colById, reads = []) {
|
|
|
1806
1939
|
return reads;
|
|
1807
1940
|
}
|
|
1808
1941
|
function evaluateTableCalcs(flat, valueCols, computedCols, rawState, records, leafTotal, columnGroups, colById, noPrevious = "na", contributionSign = () => 1) {
|
|
1809
|
-
let
|
|
1942
|
+
let negativeBase = /* @__PURE__ */ new Map(), noteNegativeBase = (scope, rowId, colId) => {
|
|
1943
|
+
let key = `${scope}:${scope === "column" ? colId : rowId}`, seen = negativeBase.get(key);
|
|
1944
|
+
seen ? seen.cells += 1 : negativeBase.set(key, { scope, rowId, colId, cells: 1 });
|
|
1945
|
+
}, nearZero = !1, mixedCoverage = !1, rowIds = new Set(rawState.keys()), calcRows = new Set(flat.filter((row) => row.calc).map((row) => row.id)), previousCol = (colId) => previousColumnInGroup(columnGroups, colId), numericCols = [...valueCols, ...computedCols], partialFrom = (res, rowId, states) => {
|
|
1810
1946
|
if (res.state !== "value") return {};
|
|
1811
1947
|
let partials = res.inputs.map((input) => (input.rowId === rowId ? states : rawState.get(input.rowId))?.get(input.colId)).filter((state) => state?.partial);
|
|
1812
1948
|
return partials.length > 0 ? { partial: !0, skipped: skippedKey(partials.flatMap((state) => skippedRows(state))) } : {};
|
|
@@ -1820,7 +1956,7 @@ function evaluateTableCalcs(flat, valueCols, computedCols, rawState, records, le
|
|
|
1820
1956
|
let states = rawState.get(row.id);
|
|
1821
1957
|
for (let col of computedCols) {
|
|
1822
1958
|
let res = evalCalc(col.calc, row, states, leafTotal, void 0, contributionSign);
|
|
1823
|
-
res.state === "value" && comparesMixedRows(col.calc, coverageOf(row.id, states, col.id)) && (res = { ...res, raw: null, state: "nm" }, mixedCoverage = !0), states.set(col.id, { raw: res.raw, state: res.state, ...partialFrom(res, row.id, states) }), res.nearZero && (nearZero = !0), pushCalcRecord(records, row.id, col.id, res);
|
|
1959
|
+
res.state === "value" && comparesMixedRows(col.calc, coverageOf(row.id, states, col.id)) && (res = { ...res, raw: null, state: "nm" }, mixedCoverage = !0), states.set(col.id, { raw: res.raw, state: res.state, ...partialFrom(res, row.id, states) }), res.nearZero && (nearZero = !0), res.negativeBase && res.state === "value" && noteNegativeBase("column", row.id, col.id), pushCalcRecord(records, row.id, col.id, res);
|
|
1824
1960
|
}
|
|
1825
1961
|
}
|
|
1826
1962
|
let calcFlat = flat.filter((row) => row.role !== "section" && row.calc), byId = new Map(calcFlat.map((row) => [row.id, row])), ordered = [], visit = /* @__PURE__ */ new Map(), place = (row) => {
|
|
@@ -1842,16 +1978,19 @@ function evaluateTableCalcs(flat, valueCols, computedCols, rawState, records, le
|
|
|
1842
1978
|
let states = rawState.get(row.id), sourceStates = new Map(states);
|
|
1843
1979
|
for (let col of numericCols) {
|
|
1844
1980
|
if (col.kind === "computed" && !calcPreservesScale(col.calc)) continue;
|
|
1845
|
-
let
|
|
1981
|
+
let ownCalc = col.kind === "computed" && isChangeCalc(col.calc) && !calcIsLinear(row.calc), calc = ownCalc ? col.calc : row.calc, read = ownCalc ? states : sourceStates, res = evalCalc(calc, row, read, leafTotal, ownCalc ? void 0 : {
|
|
1846
1982
|
currentCol: col.id,
|
|
1847
1983
|
rawState,
|
|
1848
1984
|
previousCol,
|
|
1849
1985
|
noPrevious
|
|
1850
1986
|
}, contributionSign);
|
|
1851
|
-
res.state === "value" && comparesMixedRows(
|
|
1987
|
+
res.state === "value" && comparesMixedRows(calc, coverageOf(row.id, read, col.id)) && (res = { ...res, raw: null, state: "nm" }, mixedCoverage = !0), states.set(col.id, { raw: res.raw, state: res.state, ...partialFrom(res, row.id, read) }), res.nearZero && (nearZero = !0), res.negativeBase && res.state === "value" && noteNegativeBase("row", row.id, col.id), pushCalcRecord(records, row.id, col.id, res);
|
|
1852
1988
|
}
|
|
1853
1989
|
}
|
|
1854
|
-
return { nearZero, mixedCoverage };
|
|
1990
|
+
return { nearZero, mixedCoverage, negativeBase: [...negativeBase.values()] };
|
|
1991
|
+
}
|
|
1992
|
+
function isChangeCalc(calc) {
|
|
1993
|
+
return "op" in calc && (calc.op === "delta" || calc.op === "sub" && "ref" in calc.a && "ref" in calc.b);
|
|
1855
1994
|
}
|
|
1856
1995
|
function comparesMixedRows(calc, skippedOf) {
|
|
1857
1996
|
let side = (node) => {
|
|
@@ -1888,7 +2027,7 @@ function skippedRows(state) {
|
|
|
1888
2027
|
return state.skipped ? state.skipped.split("") : [];
|
|
1889
2028
|
}
|
|
1890
2029
|
function evalCalc(calc, row, states, leafTotal, scope, contributionSign = () => 1) {
|
|
1891
|
-
let inputs = [], isState = (v) => typeof v != "number", expr = "", nearZero = !1, emit = (text) => {
|
|
2030
|
+
let inputs = [], isState = (v) => typeof v != "number", expr = "", nearZero = !1, negativeBase = !1, emit = (text) => {
|
|
1892
2031
|
expr = text;
|
|
1893
2032
|
}, read = (ref) => readCalcInput(ref, {
|
|
1894
2033
|
currentRow: row.id,
|
|
@@ -1913,7 +2052,7 @@ function evalCalc(calc, row, states, leafTotal, scope, contributionSign = () =>
|
|
|
1913
2052
|
case "mul":
|
|
1914
2053
|
case "div": {
|
|
1915
2054
|
let [a, aExpr] = child(node.a), [b, bExpr] = child(node.b);
|
|
1916
|
-
return emit(`${node.op}(${aExpr},${bExpr})`), isState(a) && isState(b) ? worse(a, b) : isState(a) ? a : isState(b) ? b : node.op === "add" ? a
|
|
2055
|
+
return emit(`${node.op}(${aExpr},${bExpr})`), isState(a) && isState(b) ? worse(a, b) : isState(a) ? a : isState(b) ? b : node.op === "add" ? cleanSum([a, b]) : node.op === "sub" ? cleanDiff(a, b) : node.op === "mul" ? a * b : b === 0 ? a === 0 ? "na" : "nm" : (b < 0 && !("lit" in node.b) && (negativeBase = !0), a / b);
|
|
1917
2056
|
}
|
|
1918
2057
|
case "delta": {
|
|
1919
2058
|
let a = read(node.a), aExpr = expr, b = read(node.b);
|
|
@@ -1939,7 +2078,7 @@ function evalCalc(calc, row, states, leafTotal, scope, contributionSign = () =>
|
|
|
1939
2078
|
}
|
|
1940
2079
|
}
|
|
1941
2080
|
}, result = evalNode(calc), op = "ref" in calc ? `ref(${expr})` : "lit" in calc ? `lit(${expr})` : expr;
|
|
1942
|
-
return isState(result) ? { raw: null, state: result, op, inputs, ...nearZero && result === "nm" ? { nearZero: !0 } : {} } : { raw: result, state: "value", op, inputs };
|
|
2081
|
+
return isState(result) ? { raw: null, state: result, op, inputs, ...nearZero && result === "nm" ? { nearZero: !0 } : {} } : { raw: result, state: "value", op, inputs, ...negativeBase ? { negativeBase: !0 } : {} };
|
|
1943
2082
|
}
|
|
1944
2083
|
|
|
1945
2084
|
// src/core/charts/table/view.ts
|
|
@@ -2079,7 +2218,7 @@ function sortableColumnIds(table, sortable) {
|
|
|
2079
2218
|
function sortKey(row, colId) {
|
|
2080
2219
|
let cell = row.cells[colId];
|
|
2081
2220
|
if (cell === void 0 || cell.state !== "value") return { missing: !0 };
|
|
2082
|
-
if (typeof cell.raw == "number") return { missing: !1, number: cell
|
|
2221
|
+
if (typeof cell.raw == "number") return { missing: !1, number: printedNumber(cell) };
|
|
2083
2222
|
let text = typeof cell.raw == "string" && cell.raw !== "" ? cell.raw : cell.displayed;
|
|
2084
2223
|
return text === "" ? { missing: !0 } : { missing: !1, text };
|
|
2085
2224
|
}
|
|
@@ -2097,7 +2236,7 @@ function sortRows(table, sort, locale) {
|
|
|
2097
2236
|
let list = childrenOf.get(row.parentId) ?? [];
|
|
2098
2237
|
list.push(row), childrenOf.set(row.parentId, list);
|
|
2099
2238
|
}
|
|
2100
|
-
let movable = (row) => row
|
|
2239
|
+
let movable = (row) => ranksAsData(row) && row.inline !== !0, compare = (a, b) => {
|
|
2101
2240
|
let ka = sortKey(a, sort.column), kb = sortKey(b, sort.column);
|
|
2102
2241
|
if (ka.missing || kb.missing)
|
|
2103
2242
|
return ka.missing === kb.missing ? a.order - b.order : ka.missing ? 1 : -1;
|
|
@@ -2164,9 +2303,14 @@ function inCellBarMaxima(rows, columns) {
|
|
|
2164
2303
|
// src/core/charts/table/widths.ts
|
|
2165
2304
|
var FLEX_MIN = 80, HEAT_ONLY_CELL_W = 22;
|
|
2166
2305
|
function tableWidths(table, theme, measure, options = {}, view = {}) {
|
|
2167
|
-
let
|
|
2306
|
+
let { defaultColumns, ...own } = view, shown = own.columns ?? visibleColumns(table);
|
|
2307
|
+
if (own.scroll && defaultColumns !== void 0 && (defaultColumns.length !== shown.length || defaultColumns.some((col, index) => col.id !== shown[index].id))) {
|
|
2308
|
+
let base = tableWidths(table, theme, measure, options, { ...own, columns: defaultColumns }), track = base.tracks.find((entry) => entry.id === defaultColumns.find((col) => col.kind === "rowLabel")?.id)?.width;
|
|
2309
|
+
track !== void 0 && base.labelNeed !== void 0 && (own.labelKeep = Math.min(track, Math.max(base.labelNeed, base.labelBeforeFill ?? 0)));
|
|
2310
|
+
}
|
|
2311
|
+
let regular = tableWidthsOnce(table, theme, measure, options, own), count = (view.columns ?? visibleColumns(table)).length, densePad = count >= 25 ? 3 : count >= DENSE_COLUMNS ? 5 : regular.cellPadX;
|
|
2168
2312
|
if (options.cellPadX !== void 0 || densePad >= regular.cellPadX || Math.max(regular.minimumW, regular.totalW) <= (view.available ?? 1 / 0)) return regular;
|
|
2169
|
-
let dense = tableWidthsOnce(table, theme, measure, { ...options, cellPadX: densePad },
|
|
2313
|
+
let dense = tableWidthsOnce(table, theme, measure, { ...options, cellPadX: densePad }, own), regularOverflow = regular.warnings.find((warning) => warning.code === "table-overflow");
|
|
2170
2314
|
return regularOverflow && (dense.warnings = dense.warnings.map((warning) => warning.code === "table-overflow" ? regularOverflow : warning)), dense;
|
|
2171
2315
|
}
|
|
2172
2316
|
function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
@@ -2183,15 +2327,20 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2183
2327
|
let first = cols.find((col) => col.groupId === groupId);
|
|
2184
2328
|
return first && view.groupStart.has(first.id) ? 1 : 0;
|
|
2185
2329
|
}
|
|
2186
|
-
}, headingFaces = (faces) => groupHeadingFaces(view.trailingTracking ? { ...faces.group, letterSpacing: Math.round((faces.group.letterSpacing ?? 0) * 1e3) / 1e3 } : faces.group), warnings = [], ladder = levelLadder(theme, options.density ?? "regular", options.target, textScaleOf(options)), regularFonts = tableFonts(theme, ladder), rowById = new Map([...widthRows, ...rows].map((row) => [row.id, row])), hasChanges = new Set(table.rows.filter((row) => visibleInlineRows(row, options.inlineVisibility).length > 0).map((row) => row.id)), cellStep = (cell) => rowById.get(cell.rowId)?.step ?? cell.level, childCount = treeChildCounts(table), isTree = fullRows.some((row) => row.hasChildren), indents = labelIndents(cellPadX2, options.labelIndent, view.withMarks ?? options.outlineMarks === !0), operatorSlot = operatorWidth(rows, theme), rowIndent = (level) => (isTree ? indents.base + level * indents.step : 0) + operatorSlot, inlineFont2 = (level, signed) => inlineFont(theme, ladder, level, signed);
|
|
2330
|
+
}, headingFaces = (faces) => groupHeadingFaces(view.trailingTracking ? { ...faces.group, letterSpacing: Math.round((faces.group.letterSpacing ?? 0) * 1e3) / 1e3 } : faces.group), warnings = [], ladder = levelLadder(theme, options.density ?? "regular", options.target, textScaleOf(options)), regularFonts = tableFonts(theme, ladder), rowById = new Map([...widthRows, ...rows].map((row) => [row.id, row])), hasChanges = new Set(table.rows.filter((row) => visibleInlineRows(row, options.inlineVisibility).length > 0).map((row) => row.id)), cellStep = (cell) => rowById.get(cell.rowId)?.step ?? cell.level, indentStep = (cell) => rowById.get(cell.rowId)?.indentStep ?? cellStep(cell), childCount = treeChildCounts(table), isTree = fullRows.some((row) => row.hasChildren), indents = labelIndents(cellPadX2, options.labelIndent, view.withMarks ?? options.outlineMarks === !0), operatorSlot = operatorWidth(rows, theme), rowIndent = (level) => (isTree ? indents.base + level * indents.step : 0) + operatorSlot, inlineFont2 = (level, signed) => inlineFont(theme, ladder, level, signed);
|
|
2187
2331
|
function cellFont(cell) {
|
|
2188
2332
|
let row = rowById.get(cell.rowId), kind = row?.kind, totalFace = kind === void 0 || kind !== "subtotal" && kind !== "result" && kind !== "driver" && (kind !== "member" && kind !== "measure" || theme.table?.weights?.figures?.[kind] === void 0);
|
|
2189
|
-
|
|
2333
|
+
if (cell.role === "total" && cell.kind !== "rowLabel" && totalFace) return regularFonts.totalValue;
|
|
2334
|
+
let font = kindFont(rowFont(theme, ladder, regularFonts, cell.role, cellStep(cell), row?.hasChildren === !0, hasChanges.has(cell.rowId)), kind, cell.kind === "rowLabel", theme);
|
|
2335
|
+
return cell.state === "value" ? strongColumnFont(font, cols.find((col) => col.id === cell.colId), cell, kind, theme) : font;
|
|
2190
2336
|
}
|
|
2191
2337
|
function affixRoom(row, font) {
|
|
2192
2338
|
return row.unitAffix === void 0 ? 0 : theme.table?.qualifier === void 0 ? measure(` ${row.unitAffix}`, inlineFont2(row.step, !1)).width : measure(row.unitAffix, qualifierFont(font, theme)).width + (theme.table.qualifier.gap ?? 4);
|
|
2193
2339
|
}
|
|
2194
|
-
let columnHeaderText = (col) =>
|
|
2340
|
+
let columnHeaderText = (col) => {
|
|
2341
|
+
let text = fieldHeadText(col.label, theme) + columnHeaderAffix(col);
|
|
2342
|
+
return view.headGlue === !1 ? text : text.replace(/ (\S{1,2})$/u, "\xA0$1");
|
|
2343
|
+
};
|
|
2195
2344
|
function trackWidths(faces) {
|
|
2196
2345
|
let widths2 = /* @__PURE__ */ new Map(), minimumWidths2 = /* @__PURE__ */ new Map(), wrappedOneLines = /* @__PURE__ */ new Map(), context = {
|
|
2197
2346
|
theme,
|
|
@@ -2249,7 +2398,7 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2249
2398
|
}
|
|
2250
2399
|
let labelFloor = options[LABEL_WRAP_FLOOR] === !0 && labelColumn !== void 0 ? labelWrapFloor(labelColumn, faces) + labelLead : 0;
|
|
2251
2400
|
if (labelFloor > 0) for (let target of [widths2, minimumWidths2]) target.set(labelColumn.id, Math.max(target.get(labelColumn.id), labelFloor));
|
|
2252
|
-
view.scroll && labelColumn?.width === void 0 && labelColumn !== void 0 && (labelFloor = Math.max(labelFloor, intrinsicColumnWidth(labelColumn, widthRows, {
|
|
2401
|
+
view.scroll && labelColumn?.width === void 0 && labelColumn !== void 0 && (labelFloor = Math.max(labelFloor, view.labelKeep ?? 0, intrinsicColumnWidth(labelColumn, widthRows, {
|
|
2253
2402
|
...context,
|
|
2254
2403
|
hint: void 0,
|
|
2255
2404
|
twoLineLabels: options.rowLabelLines !== 1
|
|
@@ -2266,7 +2415,7 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2266
2415
|
for (let row of rows) {
|
|
2267
2416
|
let cell = row.cells[col.id];
|
|
2268
2417
|
if (row.role === "section" || row.inline === !0 || !cell?.displayed) continue;
|
|
2269
|
-
let font = cellFont(cell), indent = rowIndent(
|
|
2418
|
+
let font = cellFont(cell), indent = rowIndent(indentStep(cell));
|
|
2270
2419
|
if (text = Math.max(text, indent + (options.rowLabelLines === 1 ? measure(cell.displayed, font).width : twoLineWidth(cell.displayed, font, measure, !0))), row.unitAffix !== void 0 && !(row.kind === "member" && open.has(row.id))) {
|
|
2271
2420
|
let unitFont = theme.table?.qualifier === void 0 ? { ...inlineFont2(row.step, !1), ...font.style ? { style: font.style } : {} } : qualifierFont(font, theme);
|
|
2272
2421
|
unit = Math.max(unit, indent + measure(row.unitAffix, unitFont).width);
|
|
@@ -2297,25 +2446,33 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2297
2446
|
}
|
|
2298
2447
|
let canShrink = (col) => !view.scroll || col.width === void 0 && col.kind === "rowLabel", flexIds = cols.filter((c) => canShrink(c) && (c.kind === "rowLabel" || c.kind === "text")).map((c) => c.id), totalW = sumOf(widths), floorFlexIds = cols.filter((col) => col.kind === "rowLabel" || col.kind === "text").map((col) => col.id), minimumW = Math.max(sumOf(sizingMinimums), sumOf(shrinkReach(cols, floorFlexIds, wideTable, sizingTracks, sizingMinimums, (dense ?? regular).labelFloor)));
|
|
2299
2448
|
if (totalW > available && flexIds.length > 0) {
|
|
2300
|
-
let deficit = totalW - available;
|
|
2449
|
+
let deficit = totalW - available, beforeShrink = new Map(widths), floorOf = (col) => view.scroll ? chosen.labelFloor : shrinkFloorWidth(col, wideTable, minimumWidths, chosen.labelFloor);
|
|
2301
2450
|
for (let col of cols.filter((c) => canShrink(c) && c.kind === "rowLabel")) {
|
|
2302
|
-
let take = Math.min(deficit, Math.max(0, widths.get(col.id) - minimumWidths.get(col.id)));
|
|
2451
|
+
let take = Math.min(deficit, Math.max(0, widths.get(col.id) - Math.max(minimumWidths.get(col.id), view.scroll ? view.labelKeep ?? 0 : 0)));
|
|
2303
2452
|
take > 0 && (widths.set(col.id, widths.get(col.id) - take), deficit -= take);
|
|
2304
2453
|
}
|
|
2305
2454
|
for (let kind of ["text", "rowLabel"]) {
|
|
2306
2455
|
if (deficit <= 0) break;
|
|
2307
2456
|
let shrinkable = cols.filter((c) => canShrink(c) && c.kind === kind).map((col) => ({
|
|
2308
2457
|
id: col.id,
|
|
2309
|
-
room: Math.max(0, widths.get(col.id) - (
|
|
2458
|
+
room: Math.max(0, widths.get(col.id) - floorOf(col))
|
|
2310
2459
|
})).filter((f) => f.room > 0), totalRoom = shrinkable.reduce((a, f) => a + f.room, 0);
|
|
2311
2460
|
if (totalRoom <= 0) continue;
|
|
2312
2461
|
let take = Math.min(deficit, totalRoom);
|
|
2313
2462
|
for (let f of shrinkable) {
|
|
2314
|
-
let
|
|
2315
|
-
widths.set(f.id, Math.round(widths.get(f.id) -
|
|
2463
|
+
let cut2 = take * f.room / totalRoom;
|
|
2464
|
+
widths.set(f.id, Math.round(widths.get(f.id) - cut2));
|
|
2316
2465
|
}
|
|
2317
2466
|
deficit -= take;
|
|
2318
2467
|
}
|
|
2468
|
+
if (deficit <= 0) {
|
|
2469
|
+
let flex = cols.filter((col) => canShrink(col) && (col.kind === "rowLabel" || col.kind === "text"));
|
|
2470
|
+
for (let over = Math.ceil(sumOf(widths) - available); over > 0; over--) {
|
|
2471
|
+
let roomOf2 = (col) => widths.get(col.id) - floorOf(col), widest = flex.reduce((best, col) => best === void 0 || roomOf2(col) > roomOf2(best) ? col : best, void 0);
|
|
2472
|
+
if (widest === void 0 || roomOf2(widest) < 1) break;
|
|
2473
|
+
widths.set(widest.id, widths.get(widest.id) - 1);
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2319
2476
|
let remaining = Math.ceil(sumOf(widths) - available);
|
|
2320
2477
|
if (remaining > 0 && wideTable) {
|
|
2321
2478
|
let compactable = cols.filter((col) => canShrink(col) && col.kind !== "rowLabel" && col.kind !== "text").map((col) => col.id);
|
|
@@ -2329,6 +2486,31 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2329
2486
|
if (!changed) break;
|
|
2330
2487
|
}
|
|
2331
2488
|
}
|
|
2489
|
+
let printsUncut = (col) => col.wrap ? minimumWidths.get(col.id) : intrinsicColumnWidth(col, widthRows, { ...chosen.context, hint: void 0, twoLineLabels: !0 }), flexText = cols.filter((col) => canShrink(col) && col.kind === "text" && col.width === void 0), gapOf = (col) => ({ id: col.id, gap: printsUncut(col) - widths.get(col.id) }), cutGaps = flexText.filter((col) => widths.get(col.id) < beforeShrink.get(col.id)).map(gapOf), wants = cutGaps.filter((entry) => entry.gap > 0), gaps = wants.length === 0 ? [] : flexText.map((col) => cutGaps.find((entry) => entry.id === col.id) ?? gapOf(col)), wanted = wants.reduce((sum, entry) => sum + entry.gap, 0), groupFaces = headingFaces(fonts), spare = new Map(table.columnGroups.filter((group) => group.heading !== !1).map((group) => [
|
|
2490
|
+
group.id,
|
|
2491
|
+
cols.filter((col) => group.columnIds.includes(col.id)).reduce((sum, col) => sum + widths.get(col.id), 0) - groupHeadingNeed(group, groupFaces, measure, groupCell)
|
|
2492
|
+
])), donors = gaps.filter((entry) => entry.gap < 0).map((entry) => ({
|
|
2493
|
+
id: entry.id,
|
|
2494
|
+
slack: Math.floor(-entry.gap),
|
|
2495
|
+
groups: table.columnGroups.filter((group) => spare.has(group.id) && group.columnIds.includes(entry.id))
|
|
2496
|
+
})), roomOf = (donor) => Math.max(0, Math.min(donor.slack, ...donor.groups.map((group) => spare.get(group.id)))), rooms = donors.map(roomOf), given = rooms.reduce((sum, room2) => sum + room2, 0), move = Math.floor(Math.min(wanted, given)), moved = 0, cut = (donor, amount) => {
|
|
2497
|
+
let take = Math.min(amount, roomOf(donor));
|
|
2498
|
+
widths.set(donor.id, widths.get(donor.id) - take), donor.slack -= take;
|
|
2499
|
+
for (let group of donor.groups) spare.set(group.id, spare.get(group.id) - take);
|
|
2500
|
+
moved += take;
|
|
2501
|
+
};
|
|
2502
|
+
if (move > 0) {
|
|
2503
|
+
donors.forEach((donor, index) => cut(donor, Math.floor(move * rooms[index] / given)));
|
|
2504
|
+
for (let progress = !0; progress && moved < move; ) {
|
|
2505
|
+
progress = !1;
|
|
2506
|
+
for (let donor of donors) moved < move && roomOf(donor) > 0 && (cut(donor, 1), progress = !0);
|
|
2507
|
+
}
|
|
2508
|
+
let toTake = moved;
|
|
2509
|
+
for (let [index, entry] of wants.entries()) {
|
|
2510
|
+
let add = index === wants.length - 1 ? toTake : Math.min(toTake, Math.floor(moved * entry.gap / wanted));
|
|
2511
|
+
widths.set(entry.id, widths.get(entry.id) + add), toTake -= add;
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2332
2514
|
labelColumn !== void 0 && chipSpan(widths) < chosen.chipFloor && widths.set(labelColumn.id, widths.get(labelColumn.id) + chosen.chipFloor - chipSpan(widths));
|
|
2333
2515
|
}
|
|
2334
2516
|
let narrowed = cols.some((col) => col.width !== void 0 && (figures || !heatColumn(col)) && widths.get(col.id) < col.width);
|
|
@@ -2362,15 +2544,19 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2362
2544
|
}
|
|
2363
2545
|
for (let [id, short] of groupHeadingFloors(table.columnGroups, cols.map((col) => col.id), (member) => widths.get(member) ?? 0, () => !1, headingFaces(fonts), measure, groupCell)) {
|
|
2364
2546
|
let add = options.frameFill === "none" ? 0 : Math.max(0, Math.min(room, Math.ceil(short)));
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2547
|
+
add >= 1 && (grow(id, add), room -= add);
|
|
2548
|
+
let group = table.columnGroups.find((candidate) => candidate.columnIds.includes(id)), wraps = () => !view.scroll && groupHeadingWrap(
|
|
2549
|
+
group,
|
|
2550
|
+
headingFaces(fonts),
|
|
2551
|
+
measure,
|
|
2552
|
+
cols.filter((col) => group.columnIds.includes(col.id)).reduce((sum, col) => sum + widths.get(col.id), 0) - 2 * cellPadX2 - (groupCell.startRule?.(group.id) ?? 0)
|
|
2553
|
+
) !== void 0;
|
|
2554
|
+
short - add > 0.5 && !wraps() && warnings.push({
|
|
2555
|
+
code: "table-group-heading-overflow",
|
|
2556
|
+
severity: "warn",
|
|
2557
|
+
message: `column group '${group.id}' heading needs ${Math.ceil(short - add)} px more than its columns' authored widths; it runs past the block`,
|
|
2558
|
+
suggest: "Shorten the heading or its note, widen a column of the group, or give the table a wider frame."
|
|
2559
|
+
});
|
|
2374
2560
|
}
|
|
2375
2561
|
for (let col of cols) if (figures || !heatColumn(col)) {
|
|
2376
2562
|
let grown = grownFrom.get(col.id), track = grown ?? widths.get(col.id), minimum = col.kind === "rowLabel" && col.width !== void 0 && minimumWidths.get(col.id) > track ? intrinsicColumnWidth(col, widthRows, { ...chosen.context, twoLineLabels: options.rowLabelLines !== 1 }) : minimumWidths.get(col.id), found = authoredWidthWarnings(col, table.columns.findIndex((authored) => authored.id === col.id), track, minimum, chosen.context);
|
|
@@ -2402,7 +2588,7 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2402
2588
|
let cell = row.cells[labelId];
|
|
2403
2589
|
if (row.role === "section" || !cell?.displayed) return 0;
|
|
2404
2590
|
let font = cellFont(cell);
|
|
2405
|
-
return measure(cell.displayed, font).width + affixRoom(row, font) + rowIndent(
|
|
2591
|
+
return measure(cell.displayed, font).width + affixRoom(row, font) + rowIndent(indentStep(cell)) + 2 * cellPadX2;
|
|
2406
2592
|
})))), cap = labelColumn.maxWidth !== void 0 && options[SOFT_LABEL_CAP] !== !0 ? labelColumn.maxWidth : 1 / 0;
|
|
2407
2593
|
labelNeed = Math.min(need, cap);
|
|
2408
2594
|
let short = labelNeed - widths.get(labelId);
|
|
@@ -2427,13 +2613,14 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2427
2613
|
}), labelsWrap = labelColumn !== void 0 && labelNeed !== void 0 && widths.get(labelColumn.id) < labelNeed, gridTracks = tracks.flatMap((track, index) => {
|
|
2428
2614
|
let spacer = spacerBefore.get(track.id), drawn = index === 0 && (view.frameStart ?? 0) > 0 ? { ...track, width: track.width + view.frameStart } : track;
|
|
2429
2615
|
return spacer === void 0 ? [drawn] : [{ id: `bp-spacer:${track.id}`, natural: spacer, width: spacer }, drawn];
|
|
2430
|
-
});
|
|
2616
|
+
}), labelBeforeFill = labelColumn === void 0 ? void 0 : beforeFill.get(labelColumn.id);
|
|
2431
2617
|
return {
|
|
2432
2618
|
tracks,
|
|
2433
2619
|
gridTracks,
|
|
2434
2620
|
spacerBefore,
|
|
2435
2621
|
spacerTotal,
|
|
2436
2622
|
labelNeed,
|
|
2623
|
+
labelBeforeFill,
|
|
2437
2624
|
labelsWrap,
|
|
2438
2625
|
widths,
|
|
2439
2626
|
minimumWidths,
|
|
@@ -2450,6 +2637,7 @@ function tableWidthsOnce(table, theme, measure, options = {}, view = {}) {
|
|
|
2450
2637
|
rowIndent,
|
|
2451
2638
|
cellFont,
|
|
2452
2639
|
cellStep,
|
|
2640
|
+
indentStep,
|
|
2453
2641
|
columnHeaderText,
|
|
2454
2642
|
indents,
|
|
2455
2643
|
operatorSlot,
|
|
@@ -2505,6 +2693,7 @@ export {
|
|
|
2505
2693
|
LINE_BOX_EPSILON,
|
|
2506
2694
|
levelLadder,
|
|
2507
2695
|
presetLanguage,
|
|
2696
|
+
printedNumber,
|
|
2508
2697
|
arrowGlyph,
|
|
2509
2698
|
arrowKey,
|
|
2510
2699
|
emitArrow,
|
|
@@ -2514,7 +2703,6 @@ export {
|
|
|
2514
2703
|
heatPaint,
|
|
2515
2704
|
emitHeat,
|
|
2516
2705
|
ZERO_LIFT,
|
|
2517
|
-
columnHeadLabel,
|
|
2518
2706
|
columnHeaderAffix,
|
|
2519
2707
|
resolveTable,
|
|
2520
2708
|
cellHoldsNumber,
|