boardplot 0.54.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +448 -0
- package/README.md +4 -4
- package/dist/{ReaderBox-YXC5XK7D.js → ReaderBox-3FFPHWSI.js} +14 -10
- package/dist/{annotateEngine-5O3IRSQL.js → annotateEngine-ET4DM2OK.js} +3 -1
- package/dist/build-identity.json +3 -3
- package/dist/{chunk-GVKFFJ23.js → chunk-2ALFFOKB.js} +460 -148
- package/dist/chunk-2BP6X5GX.js +125 -0
- package/dist/chunk-2C4SYWZ3.js +25 -0
- package/dist/{chunk-23RWLBZF.js → chunk-2TAK2ELB.js} +3 -3
- package/dist/{chunk-J33RA3YO.js → chunk-2YNF6AHH.js} +5 -5
- package/dist/{chunk-DDI2W4TR.js → chunk-32IKJMUF.js} +3 -3
- package/dist/{chunk-7X3UZM7F.js → chunk-33FCWTGT.js} +1 -1
- package/dist/{chunk-KL2XJQAA.js → chunk-37A6CLR5.js} +1729 -196
- package/dist/{chunk-EHDWWFNV.js → chunk-3AJY353W.js} +3 -3
- package/dist/chunk-3B3CFJ2H.js +48 -0
- package/dist/{chunk-6TJDWMZV.js → chunk-3B3K7TD5.js} +83 -9
- package/dist/{chunk-WDONXBQE.js → chunk-3C24WWUQ.js} +1 -1
- package/dist/{chunk-BWTX7LUG.js → chunk-3L2VXXM4.js} +9 -4
- package/dist/{chunk-OD3IH6FG.js → chunk-3OZRODC4.js} +39 -21
- package/dist/{chunk-JB4YPOMT.js → chunk-3XOWXLLQ.js} +6 -7
- package/dist/{chunk-JAKRPSWP.js → chunk-3ZAH24P6.js} +164 -51
- package/dist/{chunk-2THWIKRB.js → chunk-4CJ6UCX4.js} +33 -16
- package/dist/{chunk-VDAZPGR2.js → chunk-4DZFR52I.js} +2 -2
- package/dist/{chunk-AZIRTSVP.js → chunk-4WT3T5SH.js} +122 -52
- package/dist/{chunk-FPPN5NAR.js → chunk-4X3HNETE.js} +3 -3
- package/dist/{chunk-WZBMTZBM.js → chunk-4Y7BA2NW.js} +4 -4
- package/dist/{chunk-TSPWXAAI.js → chunk-4YHZSPAJ.js} +6 -7
- package/dist/{chunk-GSMWHKOW.js → chunk-5DMHMQFP.js} +7 -7
- package/dist/{chunk-E64MTTBC.js → chunk-5SHI57XD.js} +45 -14
- package/dist/{chunk-A5TY7H5T.js → chunk-5SLJGRUO.js} +139 -47
- package/dist/{chunk-47BO6MYI.js → chunk-5UVJKB7L.js} +137 -70
- package/dist/{chunk-D3D7XHBI.js → chunk-63L35UCI.js} +6 -6
- package/dist/{chunk-S6CRZKPO.js → chunk-6C64IBOG.js} +5 -5
- package/dist/{chunk-ENOCOA3F.js → chunk-6D4EO3S7.js} +5 -5
- package/dist/chunk-6H3OSHEY.js +25 -0
- package/dist/chunk-6WZZADRL.js +25 -0
- package/dist/{chunk-HGGLJYPZ.js → chunk-75TWO5B2.js} +89 -57
- 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-RKITD2UJ.js → chunk-7GVYMGLK.js} +6 -3
- package/dist/{chunk-DSZUV3TM.js → chunk-7Q2WV6D2.js} +3 -3
- package/dist/{chunk-JFBEAUJ6.js → chunk-7Q37C6GZ.js} +1 -1
- package/dist/{chunk-GEBGBJBD.js → chunk-7UPZPFHQ.js} +41 -34
- package/dist/{chunk-T7ZCYYQZ.js → chunk-7Z73MM35.js} +14 -6
- package/dist/{chunk-VWYUUBBP.js → chunk-AB35GVPG.js} +80 -31
- package/dist/{chunk-HZG5NB7Q.js → chunk-AF7EB6N6.js} +151 -84
- package/dist/chunk-AIU4GZV5.js +24 -0
- package/dist/{chunk-TNHD4UTC.js → chunk-AM2CG7VX.js} +13 -3
- package/dist/{chunk-BXEM2CVW.js → chunk-APQPYM2Z.js} +3 -3
- package/dist/{chunk-AHQ4L3BE.js → chunk-AZM4YNRE.js} +2 -2
- package/dist/{chunk-U2HQELXL.js → chunk-B3AXM3MT.js} +2 -2
- package/dist/{chunk-6I7YZTY7.js → chunk-BDGLMWPO.js} +12 -4
- package/dist/{chunk-MKVV7GVJ.js → chunk-BFFPYT3Y.js} +13 -7
- package/dist/{chunk-EYLWVI26.js → chunk-BGJRCG7N.js} +135 -114
- package/dist/{chunk-RNOJSEES.js → chunk-BK6P6KMW.js} +1 -1
- package/dist/{chunk-XB4KZ6WO.js → chunk-BSATR6ZO.js} +40 -13
- package/dist/{chunk-PDG4IM3L.js → chunk-BVYIKLQ5.js} +1 -1
- package/dist/chunk-BWVNCLUS.js +19 -0
- package/dist/{chunk-MT4MP3UZ.js → chunk-CKNOLGRR.js} +1 -1
- package/dist/chunk-CLGUFVHM.js +24 -0
- package/dist/{chunk-VAEC53B3.js → chunk-COQEHO7B.js} +3 -3
- package/dist/{chunk-3EZRM4YM.js → chunk-CPGASWNN.js} +25 -1
- package/dist/{chunk-SFQ5ADIG.js → chunk-CVIW2MV4.js} +284 -150
- package/dist/chunk-CYKIX3IQ.js +24 -0
- package/dist/{chunk-4MREJWRM.js → chunk-CZ3WCG55.js} +5 -4
- package/dist/{chunk-DRTA6JG5.js → chunk-D2B3KP35.js} +26 -15
- package/dist/{chunk-E42JZ2DA.js → chunk-D2QMNHCC.js} +4 -5
- package/dist/{chunk-AA4U62G6.js → chunk-D7G27EYZ.js} +4 -4
- package/dist/{chunk-3RMTPAEJ.js → chunk-DB2JKPOX.js} +806 -69
- package/dist/{chunk-G6XCUX3I.js → chunk-DEYAI662.js} +60 -13
- package/dist/{chunk-4WK3CNW5.js → chunk-DRHQG44U.js} +11 -0
- package/dist/{chunk-WZGJSQKN.js → chunk-DZ3S4RPI.js} +15 -1
- package/dist/{chunk-JTJNQKPM.js → chunk-E44W4EEG.js} +2 -2
- package/dist/{chunk-QJ4WGAC6.js → chunk-E5OEWMNX.js} +66 -12
- package/dist/chunk-E6HDUEGK.js +26 -0
- package/dist/{chunk-A7IEVBYI.js → chunk-E76U5H52.js} +1 -5
- package/dist/{chunk-2IXDYW6O.js → chunk-EAR43REB.js} +195 -57
- package/dist/{chunk-MYCLO35J.js → chunk-EBC5TMI2.js} +29 -8
- package/dist/chunk-EBVJCVXL.js +25 -0
- package/dist/chunk-EC2PGJ64.js +24 -0
- package/dist/chunk-EGPXEY2K.js +24 -0
- package/dist/{chunk-LYVOL4TQ.js → chunk-EQRFSVDD.js} +2 -1
- package/dist/{chunk-WKWMOZNE.js → chunk-EW47LNWH.js} +226 -61
- package/dist/{chunk-7EVIIADO.js → chunk-EXDMYV5W.js} +3 -1
- package/dist/{chunk-WMZCOGD6.js → chunk-EZZ533MH.js} +1 -1
- package/dist/{chunk-K4RCWNLC.js → chunk-F5V7YFKS.js} +11 -8
- package/dist/{chunk-JEYJRJ7M.js → chunk-F6CVYNDY.js} +5 -4
- package/dist/{chunk-NRHTC2SQ.js → chunk-F6OLHND5.js} +2 -2
- package/dist/chunk-FI5EXISD.js +27 -0
- package/dist/{chunk-F35DA442.js → chunk-FQF7GSJK.js} +46 -27
- package/dist/{chunk-GYNZ72GO.js → chunk-FS6ZE5TG.js} +2 -2
- package/dist/{chunk-6BJQULXR.js → chunk-G63WXSQP.js} +75 -34
- package/dist/{chunk-DHWCFQNO.js → chunk-GCSCHK5Y.js} +4 -18
- package/dist/{chunk-WUKSZNHL.js → chunk-GD5TYS5R.js} +32 -21
- package/dist/{chunk-RGZGLKFB.js → chunk-GDVR3XHT.js} +418 -62
- package/dist/{chunk-UTQGZF37.js → chunk-GDZI5ZJ7.js} +1 -1
- package/dist/{chunk-FMFCGYCE.js → chunk-GFIT3FRE.js} +277 -291
- package/dist/chunk-GM2HIU6C.js +24 -0
- package/dist/{chunk-MZJBPDIL.js → chunk-GMJFCBR6.js} +1 -1
- package/dist/{chunk-PBYUJSEY.js → chunk-H3AEYPRP.js} +66 -43
- package/dist/{chunk-BUPLB3EX.js → chunk-H3IBJQ5A.js} +6 -2
- package/dist/chunk-H4VDQ7OE.js +24 -0
- package/dist/{chunk-FV32N6AF.js → chunk-H5L2P2GO.js} +6 -4
- package/dist/{chunk-F7X53SZM.js → chunk-HFRQLMKK.js} +12 -7
- package/dist/{chunk-KJEZFOO6.js → chunk-HGT3UKDW.js} +91 -48
- package/dist/{chunk-B3F4TS3V.js → chunk-HJRNBKIT.js} +768 -69
- package/dist/{chunk-G63ROSY5.js → chunk-HLOXWM2O.js} +118 -62
- package/dist/{chunk-NGRIT3CY.js → chunk-HR2BKLS3.js} +113 -128
- package/dist/{chunk-S4QSJAGY.js → chunk-HZUAEMN5.js} +1 -1
- package/dist/{chunk-OZUTYDV4.js → chunk-IF2ZABAM.js} +2 -2
- package/dist/chunk-IF76JRXT.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-KFWEO4UA.js → chunk-ILFQ75N4.js} +253 -141
- package/dist/chunk-INHDHZNP.js +8 -0
- package/dist/chunk-IOKWBUQP.js +25 -0
- package/dist/{chunk-JJJ2KAHR.js → chunk-IQDMZ33D.js} +20 -9
- package/dist/{chunk-IDDA5INB.js → chunk-IVRYF7QA.js} +7 -4
- package/dist/{chunk-L7RHB734.js → chunk-J5PL6JLL.js} +1 -1
- package/dist/chunk-JBMWRXDS.js +24 -0
- package/dist/{chunk-IDT7DJ7F.js → chunk-JKOEHRGV.js} +1 -1
- package/dist/chunk-JMGB444D.js +26 -0
- package/dist/chunk-JU7S52HI.js +26 -0
- package/dist/{chunk-BBL3R5YZ.js → chunk-JXBZIJCG.js} +1 -1
- package/dist/{chunk-WLZ54FWG.js → chunk-JYAZPMSA.js} +70 -1
- package/dist/chunk-K5S3K6QK.js +24 -0
- package/dist/{chunk-V7RAPZHX.js → chunk-KAYBRD4F.js} +3 -3
- package/dist/{chunk-OMNQXHFF.js → chunk-KC52E5G4.js} +31 -20
- package/dist/{chunk-LNKY5Z2X.js → chunk-KDSYZLF6.js} +2 -3
- package/dist/{chunk-C3O45JWU.js → chunk-KEDNHCGB.js} +4 -4
- package/dist/chunk-KFGZMHIB.js +28 -0
- package/dist/{chunk-QQNPU27R.js → chunk-KHRAJDBM.js} +1 -1
- package/dist/{chunk-ZTH6YSVA.js → chunk-KND4OM4B.js} +117 -102
- package/dist/{chunk-IM4WUIR7.js → chunk-KZH2QI6S.js} +2 -2
- package/dist/{chunk-IYEFEBRN.js → chunk-KZJ5VM6E.js} +14 -3
- package/dist/{chunk-CICWSCLC.js → chunk-LA5OYJ5P.js} +146 -69
- package/dist/{chunk-I2E3YDNZ.js → chunk-LAVVML3X.js} +33 -9
- package/dist/{chunk-TKQKXBGC.js → chunk-LD4LML5P.js} +10 -8
- package/dist/{chunk-OURX73UJ.js → chunk-LF6RTFNK.js} +13 -11
- package/dist/{chunk-HDZGZJKR.js → chunk-LFUJTEJO.js} +100 -36
- package/dist/{chunk-53OYF4ZT.js → chunk-LHKDZAWN.js} +16 -8
- package/dist/{chunk-5PCCSSII.js → chunk-LLDKKEUD.js} +1 -1
- package/dist/{chunk-VNLSTZES.js → chunk-LRCO4G7C.js} +314 -92
- package/dist/{chunk-HZZH3MQI.js → chunk-LSF76AS3.js} +7 -3
- package/dist/chunk-M427S3G7.js +25 -0
- package/dist/{chunk-WGIO6AHP.js → chunk-MEMPP7VZ.js} +3 -3
- package/dist/{chunk-K4K6KGEF.js → chunk-MJMOKPTF.js} +186 -167
- package/dist/chunk-MLGEBFEX.js +47 -0
- package/dist/chunk-MLW72KWN.js +24 -0
- package/dist/chunk-MQYIBGZE.js +19 -0
- package/dist/{chunk-6NLH6TEP.js → chunk-MTRV3BJL.js} +301 -130
- package/dist/{chunk-H4H4O62O.js → chunk-N5HN5QGH.js} +1 -1
- package/dist/chunk-N5TZL74Y.js +53 -0
- package/dist/chunk-N7N5NIAU.js +211 -0
- package/dist/{chunk-G57ZO7DB.js → chunk-NA6WLZ66.js} +66 -26
- package/dist/{chunk-XNA6DATU.js → chunk-NB7M4KX4.js} +99 -56
- package/dist/{chunk-WEPAE4KG.js → chunk-NCZWLV7T.js} +4 -4
- package/dist/{chunk-C54QLNE4.js → chunk-NGA7ICG4.js} +1 -1
- package/dist/{chunk-RZB4RPPD.js → chunk-NHYKSPL4.js} +154 -99
- package/dist/chunk-NMTWUYUF.js +30 -0
- package/dist/{chunk-XTGWCYAR.js → chunk-NOCIN2EM.js} +430 -256
- package/dist/{chunk-RK4S3VPS.js → chunk-NUCYUKVH.js} +3 -3
- package/dist/{chunk-S32YYDIB.js → chunk-NVGAEQ6M.js} +4 -3
- package/dist/{chunk-4FFCIQDG.js → chunk-O2KKQNGW.js} +4 -1
- package/dist/chunk-O36WX56O.js +13 -0
- package/dist/{chunk-P52JHUUM.js → chunk-O4WJWHCH.js} +187 -85
- package/dist/{chunk-MEG4NMSI.js → chunk-O6NJDRXE.js} +2 -2
- package/dist/{chunk-UYNAL3Y3.js → chunk-O7DVW3IE.js} +141 -68
- package/dist/{chunk-TNNK4IIY.js → chunk-O7W35PT3.js} +13 -12
- package/dist/{chunk-26P4WRQC.js → chunk-ODZJ4LW7.js} +6 -3
- package/dist/{chunk-7JQAUJOL.js → chunk-OHGEDG46.js} +1 -1
- package/dist/{chunk-ISWU5YB3.js → chunk-OJ2BPQGQ.js} +11 -5
- package/dist/chunk-ONKSGT2M.js +28 -0
- package/dist/{chunk-EP54VZI5.js → chunk-OOFSQ5AS.js} +1 -1
- package/dist/{chunk-SHH2AHIU.js → chunk-OY2UJ4XK.js} +64 -42
- package/dist/{chunk-OU5K2JPF.js → chunk-P6TA7M3G.js} +102 -32
- package/dist/{chunk-PJWLKCFX.js → chunk-PQYJZMCR.js} +98 -90
- package/dist/{chunk-ELPQZIGR.js → chunk-PYV6ZIR6.js} +37 -13
- package/dist/chunk-PZ46S2SY.js +69 -0
- package/dist/{chunk-5SJQOPL7.js → chunk-Q3E74U2W.js} +4 -4
- package/dist/{chunk-4TPHMIE5.js → chunk-QBJDHFJJ.js} +4 -2
- package/dist/chunk-QBRRJ5OR.js +24 -0
- package/dist/{chunk-3FNY7ZCG.js → chunk-QEP3X3OV.js} +141 -79
- package/dist/{chunk-OMVYFSOM.js → chunk-QKWBDH2L.js} +2 -2
- package/dist/{chunk-QY5ZKUWY.js → chunk-QOWE55RR.js} +9 -3
- package/dist/{chunk-LVXOY5WL.js → chunk-QRVIS2QB.js} +6 -5
- package/dist/chunk-R27IDIJI.js +24 -0
- package/dist/{chunk-FILDYFT4.js → chunk-RNIYG6PI.js} +2 -2
- package/dist/{chunk-AVMKRVNP.js → chunk-RO2PSSAI.js} +13 -23
- package/dist/{chunk-2DR5MMDY.js → chunk-ROLR7HRB.js} +12 -6
- package/dist/{chunk-YF2PYLC4.js → chunk-RSCRIWAH.js} +1 -1
- package/dist/{chunk-T3PNYRDM.js → chunk-RTXRIZYU.js} +370 -134
- package/dist/{chunk-GGO43PHB.js → chunk-RUWNG2JC.js} +6 -5
- package/dist/chunk-RYPJB3RO.js +132 -0
- package/dist/{chunk-DAVHGK27.js → chunk-S7NRL66K.js} +46 -23
- package/dist/{chunk-VABRPZVC.js → chunk-SA46CNMS.js} +5 -1
- package/dist/{chunk-ZXOD37BE.js → chunk-SBR2RLEQ.js} +72 -38
- package/dist/chunk-SC42DPNV.js +24 -0
- package/dist/{chunk-MBVXROCI.js → chunk-SFG7NG23.js} +20 -3
- package/dist/{chunk-AG2CJ4JY.js → chunk-SNQ7D5R7.js} +18 -1
- package/dist/{chunk-3V7AA3IZ.js → chunk-SPSGUFTI.js} +11 -3
- package/dist/chunk-SRUV7AT6.js +51 -0
- package/dist/{chunk-NRF223FR.js → chunk-SZXKV3BX.js} +1 -1
- package/dist/{chunk-5A6MO4AR.js → chunk-T5Y4HXYO.js} +7 -4
- package/dist/{chunk-QR35TD2B.js → chunk-U7W7GYXP.js} +37 -37
- package/dist/{chunk-LFX7W4B7.js → chunk-UDKYY27B.js} +1 -1
- package/dist/{chunk-24BHMKDD.js → chunk-UF3HSFAE.js} +25 -2
- package/dist/chunk-UIYXMPDW.js +24 -0
- package/dist/{chunk-CPKHL7FK.js → chunk-UNMIUILK.js} +1 -1
- package/dist/chunk-V3MSLNSD.js +24 -0
- package/dist/chunk-V634AXDM.js +31 -0
- package/dist/{chunk-57ZGVAU3.js → chunk-V7F4F6JA.js} +39 -6
- package/dist/{chunk-JEL6665C.js → chunk-VBVG6NEL.js} +6 -6
- package/dist/chunk-VL7WLE4H.js +24 -0
- package/dist/chunk-W45AR6EW.js +94 -0
- package/dist/{chunk-U7LLQ7XM.js → chunk-WALYNKBN.js} +446 -103
- package/dist/{chunk-J2ROMB7J.js → chunk-WAPCCJUB.js} +64 -26
- package/dist/{chunk-WQ55QPEB.js → chunk-WDIVAU5U.js} +241 -118
- package/dist/{chunk-EHVESNLV.js → chunk-WEMUCDPK.js} +1 -1
- package/dist/{chunk-HHS6333D.js → chunk-WFSOKGGA.js} +2 -2
- package/dist/{chunk-AJHYXD5U.js → chunk-WG5CJGLU.js} +2 -2
- package/dist/{chunk-WJKVNRCR.js → chunk-WQT6HIIY.js} +18 -17
- package/dist/{chunk-KAQH75T6.js → chunk-WSJDLZSZ.js} +78 -47
- package/dist/{chunk-3UBTO342.js → chunk-WWIY6BBY.js} +77 -38
- package/dist/{chunk-33PLBIMA.js → chunk-WXJ5MHLH.js} +3 -2
- package/dist/chunk-X3YP4DUV.js +76 -0
- package/dist/{chunk-ZNHF2XCP.js → chunk-X7XTIM6U.js} +50 -36
- package/dist/chunk-XJQXFVXY.js +24 -0
- package/dist/{chunk-NQSDIDRO.js → chunk-XMN3Z43K.js} +5 -5
- package/dist/{chunk-32X7JGH3.js → chunk-XPOMQWXY.js} +89 -69
- package/dist/chunk-XVUQMZWV.js +24 -0
- package/dist/chunk-XYYRHGQI.js +24 -0
- package/dist/{chunk-EYZ6SLF3.js → chunk-XZLU3G23.js} +7 -7
- package/dist/chunk-Y2CAIAUI.js +24 -0
- package/dist/{chunk-3P4PJJND.js → chunk-Y3L655X6.js} +6 -6
- package/dist/{chunk-QKL7IY42.js → chunk-Y54LU4CU.js} +1 -1
- package/dist/chunk-YGTNVZJE.js +89 -0
- package/dist/{chunk-4WQ2MBE7.js → chunk-YLC42C3M.js} +1 -1
- package/dist/{chunk-SGD3ZHID.js → chunk-YOOHNQ3L.js} +15 -4
- package/dist/{chunk-7NWFKHSG.js → chunk-YTCIGJUU.js} +116 -42
- package/dist/{chunk-ULTSSIOU.js → chunk-YV5KYGE5.js} +1 -1
- package/dist/{chunk-BRPOSOK5.js → chunk-YXM4W3TN.js} +144 -71
- package/dist/{chunk-7EOLHBI6.js → chunk-Z2X4JQNY.js} +81 -21
- package/dist/{chunk-SZCPKGYG.js → chunk-Z5V6ZM76.js} +3 -3
- package/dist/{chunk-KBFPMESI.js → chunk-Z7NHFNH3.js} +165 -79
- package/dist/{chunk-LTMF75MR.js → chunk-ZBSNF5F7.js} +208 -62
- package/dist/chunk-ZGHBDMYF.js +24 -0
- package/dist/{chunk-KORHKDJW.js → chunk-ZHFUMVW7.js} +2 -1
- package/dist/{chunk-YS56RSTZ.js → chunk-ZLYQWUNR.js} +84 -50
- package/dist/chunk-ZTMZOKVC.js +61 -0
- package/dist/cli/index.js +3 -3
- package/dist/{core-WJSKT5XM.js → core-2SICIP63.js} +5 -1
- package/dist/{core-CJ7FFPDU.js → core-2YTKFBNZ.js} +5 -1
- package/dist/{core-JLXFDYHX.js → core-3647Z25D.js} +4 -1
- package/dist/{core-ASBJZZTP.js → core-3IJPBNGC.js} +2 -1
- package/dist/{core-DJPGSTXB.js → core-6HMJHFRR.js} +8 -1
- package/dist/{core-ONNGSKWQ.js → core-7JKE7H32.js} +5 -1
- package/dist/{core-MNUVP5IJ.js → core-BMY7OL76.js} +5 -1
- package/dist/{core-GEUPUZUY.js → core-CAL7YNFC.js} +3 -1
- package/dist/{core-JLJTP7P6.js → core-CBEGB2NO.js} +3 -1
- package/dist/{core-XKV7GMPG.js → core-CLLIG7ZU.js} +2 -1
- package/dist/{core-L7Y7YXWR.js → core-CTZLHGXE.js} +1 -1
- package/dist/{core-KZK3WCUG.js → core-EYJ3WJK4.js} +3 -1
- package/dist/{core-KF6GJOGW.js → core-FX7HRKTF.js} +2 -1
- package/dist/{core-EAIFSTDE.js → core-GQC6VDW5.js} +3 -1
- package/dist/{core-R27R6J5M.js → core-GRWI22NS.js} +3 -1
- package/dist/{core-7YKLT7KY.js → core-H7KMWYP5.js} +4 -1
- package/dist/{core-CJZXX2V3.js → core-HJUGHAX7.js} +2 -1
- package/dist/{core-YPH723Z7.js → core-JMYMIH6Z.js} +8 -1
- package/dist/{core-7R3ARYNI.js → core-KEB5PBCO.js} +5 -1
- package/dist/{core-AEYGGH7X.js → core-MEC6A5DD.js} +4 -1
- package/dist/{core-L5KTPXHC.js → core-MV6KGAUV.js} +3 -1
- package/dist/{core-34KIMTK6.js → core-NTWHFDM4.js} +2 -1
- package/dist/{core-RGLOYY73.js → core-OIC5KJSD.js} +6 -1
- package/dist/{core-V7I4F6JW.js → core-OWCTIPHD.js} +5 -1
- package/dist/{core-RCFFJANI.js → core-PMYCLXT7.js} +5 -1
- package/dist/{core-MN45UFF4.js → core-PTRQPQTO.js} +3 -1
- package/dist/{core-DKJUX7Q4.js → core-QABTVASG.js} +2 -1
- package/dist/{core-PFXIBWLD.js → core-RPQBIOU4.js} +4 -1
- package/dist/{core-W7AZNHOX.js → core-SKRADU7T.js} +3 -1
- package/dist/{core-KII4CH3W.js → core-T2KHX5LG.js} +3 -1
- package/dist/{core-DAFZ7YJW.js → core-T4ZH3FAU.js} +2 -1
- package/dist/{core-WHI4ABF2.js → core-UAY2G7LN.js} +1 -1
- package/dist/{core-O2K4BDYH.js → core-ULZ7XUQP.js} +4 -1
- package/dist/{core-3CWPIFAL.js → core-VBR253SM.js} +3 -1
- package/dist/{core-YVNOHIQ4.js → core-VMIBBHXI.js} +3 -1
- package/dist/{core-KCORN7F7.js → core-XMTKUXLO.js} +3 -1
- package/dist/{core-QXIAQFHM.js → core-YEFGEW3Z.js} +3 -1
- package/dist/{dataTable-VKEHFLJM.js → dataTable-2ZXK54TP.js} +3 -2
- package/dist/{engine-PPXKJJFI.js → engine-HGXSWGOI.js} +26 -27
- 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 -27
- package/dist/{main-53MXACOU.js → main-PVT6FMGC.js} +54 -24
- package/dist/mcp/server.js +50 -23
- 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 -31
- package/dist/react/funnel.js +4 -1
- package/dist/react/gantt.js +3 -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 +94 -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 -28
- 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 +3 -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-JTDPTWXG.js} +2 -1
- package/dist/{schema-6ZV532RM.js → schema-2M3LXR35.js} +1 -1
- package/dist/{schema-WAKLKLBB.js → schema-2Q7IJ22V.js} +1 -1
- package/dist/{schema-IOKAZVL7.js → schema-3OLBUVMZ.js} +1 -1
- package/dist/{schema-ZSYX76MO.js → schema-3XLO43SX.js} +1 -1
- package/dist/{schema-KHCLVE2V.js → schema-5753NOAL.js} +1 -1
- package/dist/{schema-QNI6MNQ2.js → schema-5KHDHTIX.js} +1 -1
- package/dist/{schema-HWU55RJL.js → schema-76XRTBCJ.js} +1 -1
- package/dist/{schema-KFXLS67Q.js → schema-7CPGNCOL.js} +1 -1
- package/dist/{schema-26YUL3MG.js → schema-BKHQ3ZUH.js} +1 -1
- package/dist/{schema-CMXL5F5L.js → schema-BMD5JR3Y.js} +1 -1
- package/dist/{schema-HGUBNXUY.js → schema-BOGTPL7F.js} +1 -1
- package/dist/{schema-733PO52K.js → schema-BUTNGYTT.js} +1 -1
- package/dist/{schema-GSE3QXUK.js → schema-C7NVOQNV.js} +5 -3
- package/dist/{schema-LYBOPAGQ.js → schema-FNTAAXQ3.js} +1 -1
- package/dist/{schema-MNG24WU2.js → schema-FYULDJFB.js} +1 -1
- package/dist/{schema-4ZXJCRZR.js → schema-FZKNIAIH.js} +1 -1
- package/dist/{schema-IOWE3RQO.js → schema-G2PLJCYL.js} +1 -1
- package/dist/{schema-HRHNGOFC.js → schema-GGG2VOY7.js} +2 -2
- package/dist/{schema-WCDYWS4K.js → schema-GLN7IHSH.js} +1 -1
- package/dist/{schema-H7RKVTVO.js → schema-HIDW4BA4.js} +1 -1
- package/dist/{schema-KH62LDYK.js → schema-J53LCIY3.js} +1 -1
- package/dist/{schema-5E5J43CF.js → schema-KIJA53MB.js} +2 -1
- package/dist/{schema-3W7IFXVN.js → schema-LEQNLBNG.js} +1 -1
- package/dist/{schema-GK6MD4EG.js → schema-LHMEXFLY.js} +1 -1
- package/dist/{schema-FT37ZEYY.js → schema-MT6NA5AL.js} +1 -3
- package/dist/{schema-NOPOI5G2.js → schema-MUTAVQMI.js} +1 -1
- package/dist/{schema-PNUC54GC.js → schema-NVMEOHAW.js} +1 -1
- package/dist/{schema-QLH2DZFI.js → schema-TA3MSAPQ.js} +1 -1
- package/dist/{schema-B4GFRYIP.js → schema-U26KG42U.js} +1 -1
- package/dist/{schema-KORNUIC6.js → schema-UHHFTVGS.js} +1 -1
- package/dist/{schema-GVHM2HEF.js → schema-V3BPW4LA.js} +1 -1
- package/dist/{schema-SY3MKF5S.js → schema-WIZ2TZAT.js} +1 -1
- package/dist/{schema-ZCZCY34J.js → schema-WZLWHOMY.js} +1 -1
- package/dist/{schema-Q4IPIR6W.js → schema-XATDKZPW.js} +1 -1
- package/dist/{schema-SLQPM32G.js → schema-XHKSGMUH.js} +1 -1
- package/dist/{schema-33ZF6WKL.js → schema-XKY2EQFH.js} +1 -1
- package/dist/{schema-AQD3H5VV.js → schema-ZE7WUNFS.js} +1 -1
- package/dist/{specValidation-H5B4MQST.js → specValidation-X5XJBPTP.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/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 +4 -1
- package/dist/types/core/formatSpec.d.ts +84 -6
- package/dist/types/core/frame.d.ts +41 -8
- package/dist/types/core/geo/packs/registry.d.ts +3 -2
- package/dist/types/core/geometry.d.ts +19 -0
- package/dist/types/core/icons.d.ts +11 -0
- package/dist/types/core/inputError.d.ts +3 -0
- package/dist/types/core/isoDate.d.ts +2 -0
- package/dist/types/core/label/categoryRow.d.ts +8 -0
- package/dist/types/core/label/occupied.d.ts +5 -0
- package/dist/types/core/label/solver.d.ts +31 -2
- package/dist/types/core/notes.d.ts +13 -1
- package/dist/types/core/ols.d.ts +38 -0
- package/dist/types/core/periodYears.d.ts +5 -1
- package/dist/types/core/registry.d.ts +12 -0
- package/dist/types/core/request.d.ts +3 -2
- package/dist/types/core/scale.d.ts +7 -0
- package/dist/types/core/schema/capability.d.ts +17 -20
- package/dist/types/core/schema/namedColumns.d.ts +6 -0
- package/dist/types/core/schema/refusals.d.ts +1 -4
- package/dist/types/core/shareRounding.d.ts +8 -0
- package/dist/types/core/sizing.d.ts +17 -12
- package/dist/types/core/story.d.ts +3 -0
- package/dist/types/core/target.d.ts +6 -0
- package/dist/types/core/text.d.ts +8 -0
- package/dist/types/core/theme.d.ts +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 +9 -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 +14 -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 +12 -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 +9 -7
- package/docs/reference/cohort.md +3 -2
- package/docs/reference/column.md +14 -7
- package/docs/reference/combo.md +8 -6
- package/docs/reference/creative.md +1 -1
- package/docs/reference/diagram.md +94 -18
- package/docs/reference/dimswitch.md +16 -13
- package/docs/reference/dot.md +7 -4
- package/docs/reference/fixtures.md +49 -5
- package/docs/reference/funnel.md +4 -3
- package/docs/reference/gantt.md +1 -1
- package/docs/reference/grid.md +1 -1
- package/docs/reference/heatmap.md +6 -4
- package/docs/reference/histogram.md +7 -4
- package/docs/reference/kpi.md +11 -8
- package/docs/reference/likert.md +7 -3
- package/docs/reference/line.md +9 -8
- package/docs/reference/mekko.md +4 -4
- package/docs/reference/options.md +34 -32
- package/docs/reference/pareto.md +4 -4
- package/docs/reference/pie.md +8 -7
- package/docs/reference/pvm.md +4 -2
- package/docs/reference/pyramid.md +4 -4
- package/docs/reference/react.md +20 -11
- package/docs/reference/sankey.md +5 -3
- package/docs/reference/scatter.md +3 -3
- package/docs/reference/slope.md +7 -6
- package/docs/reference/sparkline.md +6 -5
- package/docs/reference/status.md +6 -4
- package/docs/reference/table.md +28 -26
- package/docs/reference/theme.md +93 -85
- package/docs/reference/tilemap.md +7 -6
- package/docs/reference/treemap.md +6 -5
- package/docs/reference/variance.md +8 -5
- package/docs/reference/waffle.md +2 -1
- package/docs/reference/waterfall.md +12 -9
- package/docs/use-cases.md +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,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPACT_OMITTED_NOTES,
|
|
3
3
|
LIVE_NOTE_SHOW,
|
|
4
|
+
allQuiet,
|
|
4
5
|
chartNotes,
|
|
5
6
|
copyNote,
|
|
6
7
|
defaultNoteLines,
|
|
@@ -12,6 +13,7 @@ import {
|
|
|
12
13
|
footerParts,
|
|
13
14
|
footerPlans,
|
|
14
15
|
footerType,
|
|
16
|
+
isQuiet,
|
|
15
17
|
keepNoteMeta,
|
|
16
18
|
liveFooterExtra,
|
|
17
19
|
notesPointer,
|
|
@@ -21,25 +23,26 @@ import {
|
|
|
21
23
|
staticFrame,
|
|
22
24
|
valueNote,
|
|
23
25
|
wrapFootnote
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5SHI57XD.js";
|
|
25
27
|
import {
|
|
26
28
|
ENGINE_REV
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-KZH2QI6S.js";
|
|
28
30
|
import {
|
|
29
31
|
dateNames
|
|
30
32
|
} from "./chunk-QBR6IKIX.js";
|
|
31
33
|
import {
|
|
32
34
|
parseFormatExample,
|
|
33
35
|
parseISODate,
|
|
34
|
-
unitOfSpec
|
|
35
|
-
|
|
36
|
+
unitOfSpec,
|
|
37
|
+
utcDate
|
|
38
|
+
} from "./chunk-GDVR3XHT.js";
|
|
36
39
|
import {
|
|
37
40
|
chartString,
|
|
38
41
|
chartStrings,
|
|
39
42
|
currencySign,
|
|
40
43
|
localeStrings,
|
|
41
44
|
withLocaleStrings
|
|
42
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-LHKDZAWN.js";
|
|
43
46
|
import {
|
|
44
47
|
cellValue
|
|
45
48
|
} from "./chunk-O3VN6BTL.js";
|
|
@@ -89,7 +92,7 @@ import {
|
|
|
89
92
|
textScaleOf,
|
|
90
93
|
textSizeOf,
|
|
91
94
|
visibleTintAmount
|
|
92
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-HJRNBKIT.js";
|
|
93
96
|
import {
|
|
94
97
|
COLOR_FIX,
|
|
95
98
|
FILL_SEPARATION_FLOOR,
|
|
@@ -103,7 +106,7 @@ import {
|
|
|
103
106
|
parseColor,
|
|
104
107
|
pickInk,
|
|
105
108
|
readsAsLoss
|
|
106
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-DRHQG44U.js";
|
|
107
110
|
import {
|
|
108
111
|
DEFAULT_TARGET,
|
|
109
112
|
NormalizeError,
|
|
@@ -113,7 +116,7 @@ import {
|
|
|
113
116
|
scaleTextAtFloor,
|
|
114
117
|
targetFloorsPx,
|
|
115
118
|
targetTypeSizesPx
|
|
116
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-YOOHNQ3L.js";
|
|
117
120
|
import {
|
|
118
121
|
maxOf,
|
|
119
122
|
minOf,
|
|
@@ -123,7 +126,15 @@ import {
|
|
|
123
126
|
ellipsize,
|
|
124
127
|
hasAuthoredTypeSize,
|
|
125
128
|
wrapText
|
|
126
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-SNQ7D5R7.js";
|
|
130
|
+
import {
|
|
131
|
+
boldMeasurer,
|
|
132
|
+
boldRuns,
|
|
133
|
+
hasBold,
|
|
134
|
+
markBold,
|
|
135
|
+
plainText,
|
|
136
|
+
splitBoldLines
|
|
137
|
+
} from "./chunk-SRUV7AT6.js";
|
|
127
138
|
|
|
128
139
|
// src/core/geometry.ts
|
|
129
140
|
function rectsOverlap(a, b, pad = 0) {
|
|
@@ -143,26 +154,36 @@ function polylineYAt(line, x) {
|
|
|
143
154
|
function pointRectDistance(p, rect) {
|
|
144
155
|
return Math.hypot(Math.max(rect.x - p.x, 0, p.x - rect.x - rect.w), Math.max(rect.y - p.y, 0, p.y - rect.y - rect.h));
|
|
145
156
|
}
|
|
146
|
-
function pointSegmentDistance(x, y, a,
|
|
147
|
-
let
|
|
157
|
+
function pointSegmentDistance(x, y, a, dx, dy, squared) {
|
|
158
|
+
let t = dx === 0 && dy === 0 ? 0 : Math.max(0, Math.min(1, ((x - a.x) * dx + (y - a.y) * dy) / squared));
|
|
148
159
|
return Math.hypot(x - a.x - t * dx, y - a.y - t * dy);
|
|
149
160
|
}
|
|
150
161
|
function rectLineDistance(rect, line) {
|
|
151
162
|
if (line.length === 1) return pointRectDistance(line[0], rect);
|
|
152
163
|
let right = rect.x + rect.w, bottom = rect.y + rect.h, best = 1 / 0, previousDistance = 1 / 0;
|
|
153
164
|
for (let i = 1; i < line.length; i++) {
|
|
154
|
-
let a = line[i - 1], b = line[i]
|
|
155
|
-
|
|
165
|
+
let a = line[i - 1], b = line[i], dx = b.x - a.x, dy = b.y - a.y, squared = dx * dx + dy * dy, minX = Math.min(a.x, b.x), maxX = Math.max(a.x, b.x), minY = Math.min(a.y, b.y), maxY = Math.max(a.y, b.y), scale = Math.max(
|
|
166
|
+
1,
|
|
167
|
+
Math.abs(rect.x),
|
|
168
|
+
Math.abs(rect.y),
|
|
169
|
+
Math.abs(right),
|
|
170
|
+
Math.abs(bottom),
|
|
171
|
+
Math.abs(a.x),
|
|
172
|
+
Math.abs(a.y),
|
|
173
|
+
Math.abs(b.x),
|
|
174
|
+
Math.abs(b.y)
|
|
175
|
+
), error = scale <= 2 ** 40 && (dx === 0 || Math.abs(dx) >= 2 ** -256) && (dy === 0 || Math.abs(dy) >= 2 ** -256) ? 64 * Number.EPSILON * scale : 1 / 0;
|
|
176
|
+
if (!(rect.w >= 0 && rect.h >= 0 && (maxX < rect.x - error || minX > right + error || maxY < rect.y - error || minY > bottom + error)) && segmentHitsRect(a, b, rect)) return 0;
|
|
156
177
|
i === 1 && (previousDistance = pointRectDistance(a, rect));
|
|
157
178
|
let nextDistance = pointRectDistance(b, rect);
|
|
179
|
+
best = Math.min(best, previousDistance, nextDistance);
|
|
180
|
+
let limit = best + error, leftGap = Math.max(0, minX - rect.x, rect.x - maxX), rightGap = Math.max(0, minX - right, right - maxX), topGap = Math.max(0, minY - rect.y, rect.y - maxY), bottomGap = Math.max(0, minY - bottom, bottom - maxY);
|
|
158
181
|
best = Math.min(
|
|
159
182
|
best,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
pointSegmentDistance(rect.x,
|
|
163
|
-
pointSegmentDistance(right,
|
|
164
|
-
pointSegmentDistance(rect.x, bottom, a, b),
|
|
165
|
-
pointSegmentDistance(right, bottom, a, b)
|
|
183
|
+
leftGap > limit || topGap > limit ? 1 / 0 : pointSegmentDistance(rect.x, rect.y, a, dx, dy, squared),
|
|
184
|
+
rightGap > limit || topGap > limit ? 1 / 0 : pointSegmentDistance(right, rect.y, a, dx, dy, squared),
|
|
185
|
+
leftGap > limit || bottomGap > limit ? 1 / 0 : pointSegmentDistance(rect.x, bottom, a, dx, dy, squared),
|
|
186
|
+
rightGap > limit || bottomGap > limit ? 1 / 0 : pointSegmentDistance(right, bottom, a, dx, dy, squared)
|
|
166
187
|
), previousDistance = nextDistance;
|
|
167
188
|
}
|
|
168
189
|
return best;
|
|
@@ -201,13 +222,19 @@ function rectHitsConvexPolygon(rect, polygon, pad = 0) {
|
|
|
201
222
|
});
|
|
202
223
|
}
|
|
203
224
|
function prepareConvexPolygon(polygon) {
|
|
204
|
-
let
|
|
225
|
+
let axes = [[1, 0], [0, 1], ...polygon.map((p, i) => {
|
|
205
226
|
let q = polygon[(i + 1) % polygon.length];
|
|
206
227
|
return [q.y - p.y, p.x - q.x];
|
|
207
|
-
})]
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
228
|
+
})], projected = [];
|
|
229
|
+
for (let [x, y] of axes) {
|
|
230
|
+
if (!x && !y) continue;
|
|
231
|
+
let min = 1 / 0, max = -1 / 0;
|
|
232
|
+
for (let point of polygon) {
|
|
233
|
+
let value = point.x * x + point.y * y;
|
|
234
|
+
min = Math.min(min, value), max = Math.max(max, value);
|
|
235
|
+
}
|
|
236
|
+
projected.push([x, y, min, max]);
|
|
237
|
+
}
|
|
211
238
|
return (rect, pad) => {
|
|
212
239
|
let x0 = rect.x - pad, y0 = rect.y - pad, x1 = rect.x + rect.w + pad, y1 = rect.y + rect.h + pad;
|
|
213
240
|
return projected.every(([x, y, min, max]) => {
|
|
@@ -248,6 +275,20 @@ function clamp(v, lo, hi) {
|
|
|
248
275
|
function round2(v) {
|
|
249
276
|
return Math.round(v * 100) / 100;
|
|
250
277
|
}
|
|
278
|
+
function cleanFloat(v, scale = v) {
|
|
279
|
+
let decimals = 14 - Math.floor(Math.log10(Math.abs(scale)));
|
|
280
|
+
if (decimals < 0 || decimals > 100) return v;
|
|
281
|
+
let cleaned = Number(v.toFixed(decimals)) + 0;
|
|
282
|
+
return Math.abs(cleaned - v) > 4 * Number.EPSILON * Math.abs(scale) ? v : cleaned;
|
|
283
|
+
}
|
|
284
|
+
function cleanSum(terms) {
|
|
285
|
+
let scale = 0;
|
|
286
|
+
for (let t of terms) scale += Math.abs(t);
|
|
287
|
+
return cleanFloat(terms.reduce((a, b) => a + b, 0), scale);
|
|
288
|
+
}
|
|
289
|
+
function cleanDiff(a, b) {
|
|
290
|
+
return cleanFloat(a - b, Math.max(Math.abs(a), Math.abs(b)));
|
|
291
|
+
}
|
|
251
292
|
function strokeBoxPad(width, dx, dy) {
|
|
252
293
|
let r = width / 2, length = Math.hypot(dx, dy);
|
|
253
294
|
return length === 0 ? { x: r, y: r } : { x: r * Math.abs(dy) / length, y: r * Math.abs(dx) / length };
|
|
@@ -263,6 +304,7 @@ function defaultAnnotationId(annotation, index) {
|
|
|
263
304
|
var ANNOTATION_KIND_PURPOSES = {
|
|
264
305
|
diff: "Draws a level-difference arrow between two anchors and computes either percent change or their signed value difference.",
|
|
265
306
|
cagr: "Draws a growth arrow between two anchored points and computes the compound annual growth rate from their values and ISO-date span.",
|
|
307
|
+
bracket: "Draws a bracket over an inclusive span of steps and prints the sum of their values, after an optional label.",
|
|
266
308
|
delta: "Computes the signed difference between an anchored value and another anchor or literal, then places a collision-managed label at the first anchor.",
|
|
267
309
|
abs: "Reads the anchored data value and places its formatted absolute value in a collision-managed label.",
|
|
268
310
|
note: "Places authored text at an anchored data element through collision avoidance, with an optional icon or status chip.",
|
|
@@ -276,7 +318,7 @@ var ANNOTATION_KIND_PURPOSES = {
|
|
|
276
318
|
// src/core/adjacentSeries.ts
|
|
277
319
|
var ORDERED_STEP_FLOOR = 3, orderedRung = (sample, theme) => {
|
|
278
320
|
let kind = sample.paint !== void 0 && "theme" in sample.paint ? sample.paint.theme?.kind : void 0;
|
|
279
|
-
return kind === "ordered-ramp" || kind === "stack-ramp" && (theme.color.stack?.length ?? 0) >= 2;
|
|
321
|
+
return kind === "ordered-ramp" || kind === "group-ramp" || kind === "neutral-ramp" || kind === "stack-ramp" && (theme.color.stack?.length ?? 0) >= 2;
|
|
280
322
|
}, sideOf = (paint) => paint && "theme" in paint && paint.theme?.kind === "visible-tint" && paint.theme.apart !== void 0 ? paint.theme.base : paint, sameSide = (first, second) => {
|
|
281
323
|
let a = sideOf(first.paint), b = sideOf(second.paint);
|
|
282
324
|
return a !== void 0 && (a !== first.paint || b !== second.paint) && JSON.stringify(a) === JSON.stringify(b);
|
|
@@ -558,13 +600,13 @@ function numericVariant(role, theme) {
|
|
|
558
600
|
|
|
559
601
|
// src/core/label/occupied.ts
|
|
560
602
|
var CELL = 16;
|
|
561
|
-
function cellRange(rect, pad) {
|
|
603
|
+
function cellRange(rect, pad, range) {
|
|
562
604
|
let x0 = Math.floor((rect.x - pad) / CELL), x1 = Math.floor((rect.x + rect.w + pad) / CELL), y0 = Math.floor((rect.y - pad) / CELL), y1 = Math.floor((rect.y + rect.h + pad) / CELL);
|
|
563
605
|
if (x0 <= x1 && y0 <= y1 && (x1 - x0 + 1) * (y1 - y0 + 1) <= 256 && Math.max(-x0, x1, -y0, y1) < 32768)
|
|
564
|
-
return [x0, x1, y0, y1
|
|
606
|
+
return range[0] = x0, range[1] = x1, range[2] = y0, range[3] = y1, range;
|
|
565
607
|
}
|
|
566
608
|
function createOccupiedIndex(_plot) {
|
|
567
|
-
let rects = [], cells = /* @__PURE__ */ new Map(), wide = [], polygonTests = [], hit = (index, rect, pad) => {
|
|
609
|
+
let rects = [], scratchRange = [0, 0, 0, 0], released = /* @__PURE__ */ new Set(), cells = /* @__PURE__ */ new Map(), wide = [], polygonTests = [], hit = (index, rect, pad) => {
|
|
568
610
|
let claim = rects[index];
|
|
569
611
|
return rectsOverlap(claim.rect, rect, pad) && (claim.polygon === void 0 || (polygonTests[index] ??= prepareConvexPolygon(claim.polygon))(rect, pad));
|
|
570
612
|
}, seen = [], stamp = 0, visiting = !1, visitNear = (rect, pad, visit) => {
|
|
@@ -576,14 +618,14 @@ function createOccupiedIndex(_plot) {
|
|
|
576
618
|
visiting = !1;
|
|
577
619
|
}
|
|
578
620
|
}, visitClaims = (rect, pad, visit) => {
|
|
579
|
-
let range = cellRange(rect, pad);
|
|
621
|
+
let range = cellRange(rect, pad, scratchRange);
|
|
580
622
|
if (range === void 0) {
|
|
581
623
|
for (let i = 0; i < rects.length; i++) if (visit(i)) return !0;
|
|
582
624
|
return !1;
|
|
583
625
|
}
|
|
626
|
+
let [x0, x1, y0, y1] = range;
|
|
584
627
|
stamp++;
|
|
585
628
|
for (let w = 0; w < wide.length; w++) if (visit(wide[w])) return !0;
|
|
586
|
-
let [x0, x1, y0, y1] = range;
|
|
587
629
|
for (let x = x0; x <= x1; x++)
|
|
588
630
|
for (let y = y0; y <= y1; y++) {
|
|
589
631
|
let cell = cells.get(x * 65536 + y);
|
|
@@ -600,7 +642,7 @@ function createOccupiedIndex(_plot) {
|
|
|
600
642
|
claim(rect, kind, owner, part, polygon) {
|
|
601
643
|
let claimed = part === void 0 ? { rect: { ...rect }, kind, owner } : { rect: { ...rect }, kind, owner, part };
|
|
602
644
|
polygon !== void 0 && (claimed.polygon = polygon.map((point) => ({ ...point })));
|
|
603
|
-
let index = rects.push(claimed) - 1, range = cellRange(rect, 0);
|
|
645
|
+
let index = rects.push(claimed) - 1, range = cellRange(rect, 0, scratchRange);
|
|
604
646
|
if (range === void 0) wide.push(index);
|
|
605
647
|
else {
|
|
606
648
|
let [x0, x1, y0, y1] = range;
|
|
@@ -621,7 +663,16 @@ function createOccupiedIndex(_plot) {
|
|
|
621
663
|
return visitNear(rect, pad, (i) => (!skip?.(rects[i]) && hit(i, rect, pad) && found.push(i), !1)), found.sort((a, b) => a - b).map((i) => rects[i]);
|
|
622
664
|
},
|
|
623
665
|
snapshot() {
|
|
624
|
-
|
|
666
|
+
let copy = (entry) => ({ ...entry, rect: { ...entry.rect } });
|
|
667
|
+
if (released.size === 0) return rects.map(copy);
|
|
668
|
+
let kept = [];
|
|
669
|
+
return rects.forEach((entry, index) => {
|
|
670
|
+
released.has(index) || kept.push(copy(entry));
|
|
671
|
+
}), kept;
|
|
672
|
+
},
|
|
673
|
+
release(claim) {
|
|
674
|
+
let index = rects.indexOf(claim);
|
|
675
|
+
index < 0 || (released.add(index), claim.rect = { x: -1e9, y: -1e9, w: 0, h: 0 }, claim.polygon = void 0);
|
|
625
676
|
}
|
|
626
677
|
};
|
|
627
678
|
}
|
|
@@ -750,6 +801,10 @@ function labelCtx(theme, size, options, rest) {
|
|
|
750
801
|
};
|
|
751
802
|
}
|
|
752
803
|
var DENSITY_MIN_PRIORITY = PRIORITY.endpoint, REQUIRED_VALUE_PRIORITY = PRIORITY.valueLine;
|
|
804
|
+
function dropsFromRow(row, index) {
|
|
805
|
+
let last = row.eligible.length - 1;
|
|
806
|
+
return row.mode === "none" ? !(row.keepEnds && (index === 0 || index === last)) : (last - index) % 2 !== 0;
|
|
807
|
+
}
|
|
753
808
|
function solveLabels(requests, occupied, ctx) {
|
|
754
809
|
if (!ctx.valueRows?.length) return solveLabelPass(requests, occupied, ctx);
|
|
755
810
|
let initial = occupied.snapshot(), pinned = new Set(requests.filter((req) => req.pinnedSlot ?? ctx.pins[req.id]).map((req) => req.id)), rows = ctx.valueRows.map((row) => ({ ...row, eligible: [], mode: "all", reason: "" })), dropped = /* @__PURE__ */ new Set();
|
|
@@ -764,7 +819,7 @@ function solveLabels(requests, occupied, ctx) {
|
|
|
764
819
|
if (unseated === void 0) break;
|
|
765
820
|
let skipped = row.mode;
|
|
766
821
|
row.mode = row.mode === "all" && row.alternate ? "alternate" : "none", row.reason = `computed row ${row.mode === "alternate" ? "uses alternate values from the end" : "omitted"}; skipped ${skipped}: no candidate for '${unseated}'`, row.eligible.forEach((id, index) => {
|
|
767
|
-
(row
|
|
822
|
+
dropsFromRow(row, index) ? dropped.add(id) : dropped.delete(id);
|
|
768
823
|
});
|
|
769
824
|
}
|
|
770
825
|
}
|
|
@@ -781,7 +836,7 @@ function solveLabels(requests, occupied, ctx) {
|
|
|
781
836
|
}));
|
|
782
837
|
let failed = row.eligible.filter((id) => !dropped.has(id) && byId.get(id)?.hidden);
|
|
783
838
|
row.eligible.length < 2 || failed.length === 0 || (row.mode = row.mode === "all" && row.alternate ? "alternate" : "none", row.reason = `computed row ${row.mode === "alternate" ? "uses alternate values from the end" : "omitted"}; unplaced: ${failed.join(", ")}`, row.eligible.forEach((id, index) => {
|
|
784
|
-
|
|
839
|
+
pinned.has(id) || (dropsFromRow(row, index) ? dropped.add(id) : dropped.delete(id));
|
|
785
840
|
}), retry = !0);
|
|
786
841
|
}
|
|
787
842
|
if (retry) continue;
|
|
@@ -823,7 +878,7 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
823
878
|
value = "hard";
|
|
824
879
|
else {
|
|
825
880
|
let sawLabel = !1;
|
|
826
|
-
anyHit(occupied, rect, padding, (o) => o.kind === "annotation" && selfAnn && o.owner.annotationId === selfAnn || overRules && (o.part === "referenceLine" || o.part === CROSSABLE_RULE_PART) || overLegend && o.kind === "legend" || o.kind === "mark" && (isOwnMark(o.owner, req.owner, req.kind, o.part) || overColumns && isColumnPart(o.part) && rectContains(o.rect, rect, 0)) || o.kind === "mark" && o.part === AREA_FILL_PART && req.candidates[index].onFill?.seriesId === o.owner.seriesId || req.ownStrokeClear && o.kind === "mark" && (o.part === void 0 || o.part === AREA_FILL_PART) && !o.polygon && o.owner.seriesId === req.owner.seriesId && !rectsOverlap(o.rect, rect) || o.kind === "mark" && req.owner.seriesId !== void 0 && o.owner.seriesId === req.owner.seriesId && req.candidates[index].slot.startsWith("inside") && (req.candidates[index].slot.startsWith("insideBand") || !rectsOverlap(o.rect, rect, 0)) || o.kind === "mark" && o.part === AREA_FILL_PART && (req.candidates[index].slot.startsWith("insideBand") || req.candidates[index].insideFill !== void 0) ? !1 : o.kind === "label" ? (sawLabel = !0, !1) : !0) ? value = "hard" : sawLabel && (value = "label"), value !== "hard" && inTickColumn(rect, req.candidates[index].tickAir) && (value = "hard");
|
|
881
|
+
anyHit(occupied, rect, padding, (o) => o.kind === "annotation" && selfAnn && o.owner.annotationId === selfAnn || overRules && (o.part === "referenceLine" || o.part === CROSSABLE_RULE_PART) || req.candidates[index].overValueLines && isValueLine(o) || overLegend && o.kind === "legend" || o.kind === "mark" && (isOwnMark(o.owner, req.owner, req.kind, o.part) || overColumns && isColumnPart(o.part) && rectContains(o.rect, rect, 0)) || o.kind === "mark" && o.part === AREA_FILL_PART && req.candidates[index].onFill?.seriesId === o.owner.seriesId || req.ownStrokeClear && o.kind === "mark" && (o.part === void 0 || o.part === AREA_FILL_PART) && !o.polygon && o.owner.seriesId === req.owner.seriesId && !rectsOverlap(o.rect, rect) || o.kind === "mark" && req.owner.seriesId !== void 0 && o.owner.seriesId === req.owner.seriesId && req.candidates[index].slot.startsWith("inside") && (req.candidates[index].slot.startsWith("insideBand") || !rectsOverlap(o.rect, rect, 0)) || o.kind === "mark" && o.part === AREA_FILL_PART && (req.candidates[index].slot.startsWith("insideBand") || req.candidates[index].insideFill !== void 0) ? !1 : o.kind === "label" ? (sawLabel = !0, !1) : !0) ? value = "hard" : sawLabel && (value = "label"), value !== "hard" && inTickColumn(rect, req.candidates[index].tickAir) && (value = "hard");
|
|
827
882
|
let tickAir = req.candidates[index].tickAir;
|
|
828
883
|
value !== "hard" && tickAir && anyHit(occupied, rect, tickAir, (o) => o.kind === "axis" && o.rect.w > 2 && o.rect.h > 2) && (value = "hard"), value === "free" && onLeader(rect, padding) && (value = "label"), value === "free" && pinOf(req) !== req.candidates[index].slot && crowdsSeriesValue(req.candidates[index]) && (value = "label");
|
|
829
884
|
}
|
|
@@ -934,7 +989,7 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
934
989
|
keepOffLeader(label, req);
|
|
935
990
|
}, crowds = (cand) => req.labelGap !== void 0 && anyHit(occupied, cand.rect, req.labelGap, (o) => o.kind === "label" && !sameOwner(o.owner, req.owner)), indices = req.candidates.map((_, i) => i), crowded = indices.map((i) => crowds(req.candidates[i])), order2 = req.labelGap === void 0 ? indices : [...indices].sort((a, b) => req.candidates[a].penalty - req.candidates[b].penalty || Number(crowded[a]) - Number(crowded[b]) || a - b), ambiguous = [], place = (cand, reason, leader) => {
|
|
936
991
|
let label = finalize(base, req, cand, !1, darkInk, lightInk);
|
|
937
|
-
leader && (label.leader = leader), cand.overRules && anyHit(occupied, cand.rect, req.pad ?? pad, (o) => o.part === "referenceLine") && (label.halo = !0), placed.push(label), occupied.claim(cand.rect, "label", req.owner, TOTAL_KINDS.has(req.kind) ? TOTAL_PART : void 0), claimLeader(label), decisions.push({ labelId: req.id, strategy: "candidatesOccupied", tried, chose: cand.slot, reason: note(reason) });
|
|
992
|
+
leader && (label.leader = leader), cand.overRules && anyHit(occupied, cand.rect, req.pad ?? pad, (o) => o.part === "referenceLine") && (label.halo = !0), cand.overValueLines && anyHit(occupied, cand.rect, req.pad ?? pad, isValueLine) && (label.halo = !0), placed.push(label), occupied.claim(cand.rect, "label", req.owner, TOTAL_KINDS.has(req.kind) ? TOTAL_PART : void 0), claimLeader(label), decisions.push({ labelId: req.id, strategy: "candidatesOccupied", tried, chose: cand.slot, reason: note(reason) });
|
|
938
993
|
}, crossing;
|
|
939
994
|
for (let i of order2) {
|
|
940
995
|
let cand = req.candidates[i];
|
|
@@ -1016,6 +1071,12 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
1016
1071
|
let rank = new Map([...owned].sort(labelOrder(pinOf, ctx.focus, !1)).map((req, i) => [req.id, i])), byRank = (a, b) => (rank.get(a) ?? 0) - (rank.get(b) ?? 0);
|
|
1017
1072
|
placed.sort((a, b) => byRank(a.id, b.id)), decisions.sort((a, b) => byRank(a.labelId, b.labelId));
|
|
1018
1073
|
}
|
|
1074
|
+
for (let label of placed) {
|
|
1075
|
+
let req = label.hidden || label.rotate !== -45 ? void 0 : requests.find((r) => r.id === label.id);
|
|
1076
|
+
if (!req) continue;
|
|
1077
|
+
let lineH = req.font.size * (req.font.lineHeight ?? 1.2), length = Math.max(...req.lines.map((line) => ctx.measure(line, req.font).width)), end = { x: label.rect.x + label.rect.w, y: label.rect.y + lineH * Math.SQRT1_2 / 2 }, reach = { x: -length * Math.SQRT1_2, y: length * Math.SQRT1_2 }, half = lineH * Math.SQRT1_2 / 2, polygon = [{ x: end.x - half, y: end.y - half }, { x: end.x + half, y: end.y + half }, { x: end.x + reach.x + half, y: end.y + reach.y + half }, { x: end.x + reach.x - half, y: end.y + reach.y - half }], xs = polygon.map((p) => p.x), ys = polygon.map((p) => p.y);
|
|
1078
|
+
occupied.claim({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) }, "label", label.owner, "rotatedName", polygon);
|
|
1079
|
+
}
|
|
1019
1080
|
return { placed, decisions, warnings, ...ownershipLimited.size > 0 ? { ownershipLimited } : {} };
|
|
1020
1081
|
}
|
|
1021
1082
|
function isOtherOwners(mark, label, kind, part) {
|
|
@@ -1075,7 +1136,7 @@ function withLiftLeaders(req, ownedPoint, runClear) {
|
|
|
1075
1136
|
});
|
|
1076
1137
|
return changed ? { ...req, candidates, ...req.leaderClear ? {} : { leaderClear: !0 } } : req;
|
|
1077
1138
|
}
|
|
1078
|
-
var LED_PENALTY = 100, CROSSABLE_RULE_PART = "crossableRule", LAST_RESORT_PENALTY = 200;
|
|
1139
|
+
var isValueLine = (claim) => claim.kind === "annotation" && claim.part === "referenceLine", LED_PENALTY = 100, CROSSABLE_RULE_PART = "crossableRule", LAST_RESORT_PENALTY = 200;
|
|
1079
1140
|
function withOwnedSeats(requests, model, pinOf) {
|
|
1080
1141
|
return requests.map((req) => {
|
|
1081
1142
|
if (req.kind !== "point" || req.owner.annotationId !== void 0 || req.rotate !== void 0) return req;
|
|
@@ -1134,8 +1195,8 @@ function isOwnMark(mark, label, kind, part) {
|
|
|
1134
1195
|
return shared > 0;
|
|
1135
1196
|
}
|
|
1136
1197
|
var LEADER_GUTTER_RATIO = 0.4, LEADER_MIN_DRAWN_RATIO = 0.6;
|
|
1137
|
-
function leaderTerminus(rect, from) {
|
|
1138
|
-
let gutter = LEADER_GUTTER_RATIO *
|
|
1198
|
+
function leaderTerminus(rect, from, lineHeight = rect.h) {
|
|
1199
|
+
let gutter = LEADER_GUTTER_RATIO * lineHeight, approachesFromLeft = from.x <= rect.x, edgeX = approachesFromLeft ? rect.x : rect.x + rect.w;
|
|
1139
1200
|
return {
|
|
1140
1201
|
x: approachesFromLeft ? edgeX - gutter : edgeX + gutter,
|
|
1141
1202
|
y: rect.y + rect.h / 2
|
|
@@ -1147,13 +1208,19 @@ function leaderExceedsLimit(req, cand) {
|
|
|
1147
1208
|
if (!cand.leaderFrom || !leaderFor(cand)) return !1;
|
|
1148
1209
|
let { rect, leaderFrom: from } = cand;
|
|
1149
1210
|
if (from.x > rect.x && from.x < rect.x + rect.w) return Math.max(rect.y - from.y, from.y - rect.y - rect.h) > req.maxLeaderLength;
|
|
1150
|
-
let end = leaderTerminus(cand.rect, cand.leaderFrom), dx = Math.abs(end.x - cand.leaderFrom.x), dy = Math.abs(end.y - cand.leaderFrom.y);
|
|
1211
|
+
let end = leaderTerminus(cand.rect, cand.leaderFrom, leaderHeightOf(cand)), dx = Math.abs(end.x - cand.leaderFrom.x), dy = Math.abs(end.y - cand.leaderFrom.y);
|
|
1151
1212
|
return (dx <= 8 || dy <= 8 ? Math.hypot(dx, dy) : dx + dy) > req.maxLeaderLength;
|
|
1152
1213
|
}
|
|
1153
1214
|
function leaderFor(cand) {
|
|
1215
|
+
return leaderAt(cand, cand.rect.h) ?? (cand.leaderLineHeight === void 0 ? void 0 : leaderAt(cand, cand.leaderLineHeight));
|
|
1216
|
+
}
|
|
1217
|
+
function leaderHeightOf(cand) {
|
|
1218
|
+
return cand.leaderLineHeight !== void 0 && !leaderAt(cand, cand.rect.h) ? cand.leaderLineHeight : cand.rect.h;
|
|
1219
|
+
}
|
|
1220
|
+
function leaderAt(cand, lineHeight) {
|
|
1154
1221
|
let from = cand.leaderFrom;
|
|
1155
1222
|
if (!from) return;
|
|
1156
|
-
let minimum = LEADER_MIN_DRAWN_RATIO *
|
|
1223
|
+
let minimum = LEADER_MIN_DRAWN_RATIO * lineHeight, approachesFromLeft = from.x <= cand.rect.x, toEdge = leaderTerminus(cand.rect, from, lineHeight), dx = toEdge.x - from.x, dy = toEdge.y - from.y;
|
|
1157
1224
|
if (approachesFromLeft ? dx <= 0 : dx >= 0) return cand.leaderVertical ? verticalLeader(cand.rect, from) : void 0;
|
|
1158
1225
|
if (Math.hypot(dx, dy) < minimum) return;
|
|
1159
1226
|
let d = leaderPath(from, toEdge);
|
|
@@ -1192,7 +1259,8 @@ function finalize(base, _req, cand, pinned, darkInk, lightInk) {
|
|
|
1192
1259
|
theme: {
|
|
1193
1260
|
kind: "contrast-ink",
|
|
1194
1261
|
fill: paint,
|
|
1195
|
-
...pattern ? { pattern } : {}
|
|
1262
|
+
...pattern ? { pattern } : {},
|
|
1263
|
+
...cand.insideMatrix ? { matrix: cand.insideMatrix } : {}
|
|
1196
1264
|
}
|
|
1197
1265
|
}), cand.needsBacking && (cand.contrast === "box" ? label.backing = inflate(cand.rect, 2) : label.halo = !0), cand.leaderFrom) {
|
|
1198
1266
|
let leader = leaderFor(cand);
|
|
@@ -1250,16 +1318,27 @@ function leaderBox(pieces) {
|
|
|
1250
1318
|
let xs = pieces.flatMap(([a, b]) => [a.x, b.x]), ys = pieces.flatMap(([a, b]) => [a.y, b.y]), x = Math.min(...xs), y = Math.min(...ys);
|
|
1251
1319
|
return { x, y, w: Math.max(...xs) - x, h: Math.max(...ys) - y };
|
|
1252
1320
|
}
|
|
1321
|
+
function anchorValueBox(occupied, near, anchor, reach) {
|
|
1322
|
+
let own = occupied.hitsWhich({ x: near.x - reach, y: near.y - reach, w: near.w + reach * 2, h: near.h + reach * 2 }, 0).filter((claim) => printsAnchor(claim, anchor));
|
|
1323
|
+
return own.length === 0 ? void 0 : own.slice(1).reduce((u, { rect }) => unionRect(u, rect), own[0].rect);
|
|
1324
|
+
}
|
|
1325
|
+
function valueEdgeToward(value, text) {
|
|
1326
|
+
let c = LEADER_LABEL_CLEARANCE;
|
|
1327
|
+
return {
|
|
1328
|
+
x: Math.min(Math.max(text.x + text.w / 2, value.x - c), value.x + value.w + c),
|
|
1329
|
+
y: Math.min(Math.max(text.y + text.h / 2, value.y - c), value.y + value.h + c)
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
function leaderCrossesLabel(d, occupied) {
|
|
1333
|
+
return leaderPieces(d, 32).some(([a, b]) => occupied.hitsWhich(leaderBox([[a, b]]), 0).some((claim) => claim.kind === "label" && segmentHitsRect(a, b, claim.rect)));
|
|
1334
|
+
}
|
|
1253
1335
|
function leadersOffAnchorValues(labels, anchors, occupied) {
|
|
1254
1336
|
for (let label of labels) {
|
|
1255
1337
|
let anchor = anchors.get(label.id);
|
|
1256
1338
|
if (label.hidden || !label.leader || !anchor) continue;
|
|
1257
1339
|
let pieces = leaderPieces(label.leader.d, 32), own = occupied.hitsWhich(leaderBox(pieces), 0).filter((claim) => printsAnchor(claim, anchor) && pieces.some(([a, b]) => segmentHitsRect(a, b, claim.rect)));
|
|
1258
1340
|
if (own.length === 0) continue;
|
|
1259
|
-
let box = own.slice(1).reduce((u, { rect }) => unionRect(u, rect), own[0].rect),
|
|
1260
|
-
x: Math.min(Math.max(label.rect.x + label.rect.w / 2, box.x - c), box.x + box.w + c),
|
|
1261
|
-
y: Math.min(Math.max(label.rect.y + label.rect.h / 2, box.y - c), box.y + box.h + c)
|
|
1262
|
-
}, leader = seatLeader(label.rect, from);
|
|
1341
|
+
let box = own.slice(1).reduce((u, { rect }) => unionRect(u, rect), own[0].rect), from = valueEdgeToward(box, label.rect), leader = seatLeader(label.rect, from);
|
|
1263
1342
|
if (!leader) continue;
|
|
1264
1343
|
let next = leaderPieces(leader.d, 32);
|
|
1265
1344
|
occupied.hitsWhich(leaderBox(next), 0).some((claim) => claim.kind === "label" && claim.owner.annotationId !== label.owner.annotationId && next.some(([a, b]) => segmentHitsRect(a, b, claim.rect))) || (label.leader = leader);
|
|
@@ -1581,6 +1660,12 @@ function colorAttr(value) {
|
|
|
1581
1660
|
let color = checkedColor(value);
|
|
1582
1661
|
return esc(color);
|
|
1583
1662
|
}
|
|
1663
|
+
function fillAttr(fill) {
|
|
1664
|
+
let m = /^#(?:([0-9a-f]{6})([0-9a-f]{2})|([0-9a-f]{3})([0-9a-f]))$/i.exec(fill);
|
|
1665
|
+
if (!m) return `fill="${fill}"`;
|
|
1666
|
+
let rgb = m[1] ?? m[3], alpha = parseInt(m[2] ?? m[4].repeat(2), 16);
|
|
1667
|
+
return alpha === 255 ? `fill="#${rgb}"` : `fill="#${rgb}" fill-opacity="${Number((alpha / 255).toFixed(3))}"`;
|
|
1668
|
+
}
|
|
1584
1669
|
function validateNumber(label, value, minimum) {
|
|
1585
1670
|
if (value !== void 0 && (!Number.isFinite(value) || minimum !== void 0 && value < minimum))
|
|
1586
1671
|
throw new Error(`invalid SVG numeric ${label} '${String(value)}'`);
|
|
@@ -1621,23 +1706,27 @@ function validateGeometryNumbers(geometry) {
|
|
|
1621
1706
|
validateNumber(`${node.id}.cx`, node.cx), validateNumber(`${node.id}.cy`, node.cy), validateNumber(`${node.id}.r`, node.r, 0);
|
|
1622
1707
|
else {
|
|
1623
1708
|
if (validateNumber(`${node.id}.x`, node.x), validateNumber(`${node.id}.y`, node.y), validateNumber(`${node.id}.font.size`, node.font.size, 0), validateNumber(`${node.id}.font.weight`, node.font.weight, 0), node.font.style !== void 0 && node.font.style !== "normal" && node.font.style !== "italic") throw new Error(`invalid SVG font style ${node.id}`);
|
|
1624
|
-
if (validateNumber(`${node.id}.font.lineHeight`, node.font.lineHeight, 0), validateNumber(`${node.id}.font.letterSpacing`, node.font.letterSpacing), node.runs !== void 0) {
|
|
1625
|
-
if (!Array.isArray(node.
|
|
1626
|
-
throw new Error(`invalid SVG text
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1709
|
+
if (validateNumber(`${node.id}.font.lineHeight`, node.font.lineHeight, 0), validateNumber(`${node.id}.font.letterSpacing`, node.font.letterSpacing), node.runs !== void 0 || node.lineRuns !== void 0) {
|
|
1710
|
+
if (node.lineRuns !== void 0 && (node.runs !== void 0 || !Array.isArray(node.lineRuns) || node.lineRuns.length !== node.lines.length))
|
|
1711
|
+
throw new Error(`invalid SVG text lineRuns ${node.id} \u2014 one run list per line, without runs`);
|
|
1712
|
+
let lists = node.lineRuns ?? [node.runs];
|
|
1713
|
+
for (let line = 0; line < lists.length; line++) {
|
|
1714
|
+
let runs = lists[line], field = node.lineRuns ? `lineRuns[${line}]` : "runs";
|
|
1715
|
+
if (!Array.isArray(runs) || runs.length === 0)
|
|
1716
|
+
throw new Error(`invalid SVG text ${field} ${node.id} \u2014 expected a non-empty array`);
|
|
1717
|
+
for (let index = 0; index < runs.length; index++) {
|
|
1718
|
+
let run = runs[index];
|
|
1719
|
+
if (typeof run != "object" || run === null)
|
|
1720
|
+
throw new Error(`invalid SVG text run ${node.id}.${field}[${index}] \u2014 expected an object`);
|
|
1721
|
+
let { text, weight } = run;
|
|
1722
|
+
if (typeof text != "string")
|
|
1723
|
+
throw new Error(`invalid SVG text run ${node.id}.${field}[${index}].text \u2014 expected a string`);
|
|
1724
|
+
if (validateNumber(`${node.id}.${field}[${index}].weight`, weight, 1), typeof weight == "number" && weight > 1e3)
|
|
1725
|
+
throw new Error(`invalid SVG numeric ${node.id}.${field}[${index}].weight '${weight}' \u2014 above 1000`);
|
|
1726
|
+
}
|
|
1727
|
+
if (!node.lineRuns && node.lines.length !== 1 || node.lines[line] !== runs.map((run) => run.text).join(""))
|
|
1728
|
+
throw new Error(`invalid SVG text ${field} ${node.id} \u2014 lines must equal the concatenated run texts`);
|
|
1636
1729
|
}
|
|
1637
|
-
if (node.lines.length !== 1 || node.lines[0] !== node.runs.map((run) => run.text).join(""))
|
|
1638
|
-
throw new Error(
|
|
1639
|
-
`invalid SVG text runs ${node.id} \u2014 runs are single-line and lines[0] must equal the concatenated run texts`
|
|
1640
|
-
);
|
|
1641
1730
|
}
|
|
1642
1731
|
node.backing && validateRectNumbers(`${node.id}.backing`, node.backing);
|
|
1643
1732
|
}
|
|
@@ -1748,8 +1837,8 @@ function renderSvgInternal(geometry, theme, opts) {
|
|
|
1748
1837
|
);
|
|
1749
1838
|
let { size } = geometry, natural = geometry.presentation?.naturalSize, dims = natural?.unit === "pt" ? `width="${n2(natural.width)}pt" height="${n2(natural.height)}pt"` : `width="${n2(size.width)}" height="${n2(size.height)}"`, out = [], titleId = scopedId("bp-title", idScope), descId = scopedId("bp-desc", idScope), xlink = geometry.scene.some((node) => node.t === "image") ? ` xmlns:xlink="${XLINK_NS}"` : "";
|
|
1750
1839
|
out.push(
|
|
1751
|
-
`<svg xmlns="http://www.w3.org/2000/svg"${xlink} data-bp-engine="${ENGINE_REV}" viewBox="0 0 ${n2(size.width)} ${n2(size.height)}" ${dims} direction="ltr" style="${ROOT_STYLE}" preserveAspectRatio="xMidYMid meet" role="${interactive ? "graphics-document document" : "img"}" aria-label="${esc(geometry.a11y.title, "a11y.title")}" aria-describedby="${descId}" ${geometry.sizing ? `data-bp-sizing="${esc(JSON.stringify(geometry.sizing), "sizing")}" ` : ""}${geometry.mode ? `data-bp-mode="${geometry.mode}" ` : ""}font-family="${esc(theme.type.family, "theme.type.family")}"${interactive ? ` data-bp-interactive="" data-bp-chart="${esc(geometry.type, "geometry.type")}"` : ""}>`
|
|
1752
|
-
), geometry.a11y.includeTitle === !0 && out.push(`<title id="${titleId}">${esc(geometry.a11y.title, "a11y.title")}</title>`), out.push(`<desc id="${descId}">${esc(geometry.a11y.desc, "a11y.desc")}</desc>`);
|
|
1840
|
+
`<svg xmlns="http://www.w3.org/2000/svg"${xlink} data-bp-engine="${ENGINE_REV}" viewBox="0 0 ${n2(size.width)} ${n2(size.height)}" ${dims} direction="ltr" style="${ROOT_STYLE}" preserveAspectRatio="xMidYMid meet" role="${interactive ? "graphics-document document" : "img"}" aria-label="${esc(plainText(geometry.a11y.title), "a11y.title")}" aria-describedby="${descId}" ${geometry.sizing ? `data-bp-sizing="${esc(JSON.stringify(geometry.sizing), "sizing")}" ` : ""}${geometry.mode ? `data-bp-mode="${geometry.mode}" ` : ""}font-family="${esc(theme.type.family, "theme.type.family")}"${interactive ? ` data-bp-interactive="" data-bp-chart="${esc(geometry.type, "geometry.type")}"` : ""}>`
|
|
1841
|
+
), geometry.a11y.includeTitle === !0 && out.push(`<title id="${titleId}">${esc(plainText(geometry.a11y.title), "a11y.title")}</title>`), out.push(`<desc id="${descId}">${esc(plainText(geometry.a11y.desc), "a11y.desc")}</desc>`);
|
|
1753
1842
|
let patternDefs = /* @__PURE__ */ new Map();
|
|
1754
1843
|
for (let node of geometry.scene)
|
|
1755
1844
|
if ((node.t === "rect" || node.t === "path") && isHatchPattern(node.pattern) && node.fill) {
|
|
@@ -1773,6 +1862,7 @@ function renderSvgInternal(geometry, theme, opts) {
|
|
|
1773
1862
|
`);
|
|
1774
1863
|
}
|
|
1775
1864
|
function renderSvg(geometry, theme, opts = {}) {
|
|
1865
|
+
if (!theme) throw new TypeError("renderSvg: theme is required; pass the theme the geometry was laid out with, such as request.theme");
|
|
1776
1866
|
return renderSvgInternal(geometry, theme, opts);
|
|
1777
1867
|
}
|
|
1778
1868
|
function scopedId(id, scope) {
|
|
@@ -1827,7 +1917,7 @@ function renderNodeInner(node, theme, formatter, tf, interaction, idScope, rootF
|
|
|
1827
1917
|
let stroke = formatter.attr(node.fill);
|
|
1828
1918
|
fill = `url(#${resolvedHatchPattern(node.fill, theme, formatter, idScope, node.hatchGround, node.hatch, node.pattern).id})`, extra = node.hatchEdge === !1 ? "" : ` stroke="${stroke}" stroke-width="${strokeToken(theme, "hair")}"`;
|
|
1829
1919
|
} else node.pattern === "outline" && solidMutedPlan(theme) ? fill = formatter.attr(PLAN_MUTED_PAINT) : node.pattern === "outline" || node.pattern === "hollow" ? (fill = formatter.background(), extra = ` stroke="${formatter.attr(node.fill)}" stroke-width="${theme.pattern.outlineStrokeWidth}"`) : (fill = formatter.attr(node.fill), node.stroke && (extra = ` stroke="${formatter.attr(node.stroke)}" stroke-width="${node.strokeWidth ?? strokeToken(theme, "mark")}"`));
|
|
1830
|
-
let radius = node.radius ? ` rx="${n2(node.radius)}"` : "", open = `<rect${tf} data-id="${esc(node.id, "node.id")}" data-part="${esc(node.part, "node.part")}"${rc} x="${n2(rect.x)}" y="${n2(rect.y)}" width="${n2(rect.w)}" height="${n2(rect.h)}"${radius}
|
|
1920
|
+
let radius = node.radius ? ` rx="${n2(node.radius)}"` : "", open = `<rect${tf} data-id="${esc(node.id, "node.id")}" data-part="${esc(node.part, "node.part")}"${rc} x="${n2(rect.x)}" y="${n2(rect.y)}" width="${n2(rect.w)}" height="${n2(rect.h)}"${radius} ${fillAttr(fill)}${extra}`;
|
|
1831
1921
|
return node.title === void 0 ? `${open}/>` : `${open} role="img" aria-label="${esc(node.title, "node.title")}"><title>${esc(node.title, "node.title")}</title></rect>`;
|
|
1832
1922
|
}
|
|
1833
1923
|
case "line": {
|
|
@@ -1836,18 +1926,25 @@ function renderNodeInner(node, theme, formatter, tf, interaction, idScope, rootF
|
|
|
1836
1926
|
}
|
|
1837
1927
|
case "path": {
|
|
1838
1928
|
let fill = renderedPathFill(node, theme, formatter, idScope), stroke = node.stroke ? ` stroke="${formatter.attr(node.stroke)}" stroke-width="${node.width ?? strokeToken(theme, "rule")}"` : "", dash = node.dash ? ` stroke-dasharray="${node.dash.join(" ")}"` : "", lineCap = node.lineCap ? ` stroke-linecap="${esc(node.lineCap, "path.lineCap")}"` : "";
|
|
1839
|
-
return `<path${tf} data-id="${esc(node.id)}" data-part="${esc(node.part)}"${rc} d="${esc(node.d)}"
|
|
1929
|
+
return `<path${tf} data-id="${esc(node.id)}" data-part="${esc(node.part)}"${rc} d="${esc(node.d)}" ${fillAttr(fill)}${stroke}${dash}${lineCap} stroke-linejoin="round"/>`;
|
|
1840
1930
|
}
|
|
1841
1931
|
case "circle": {
|
|
1842
1932
|
let stroke = node.stroke ? ` stroke="${formatter.attr(node.stroke)}" stroke-width="${node.strokeWidth ?? strokeToken(theme, "mark")}"` : "";
|
|
1843
|
-
return `<circle${tf} data-id="${esc(node.id, "node.id")}" data-part="${esc(node.part, "node.part")}"${rc} cx="${n2(node.cx)}" cy="${n2(node.cy)}" r="${n2(node.r)}"
|
|
1933
|
+
return `<circle${tf} data-id="${esc(node.id, "node.id")}" data-part="${esc(node.part, "node.part")}"${rc} cx="${n2(node.cx)}" cy="${n2(node.cy)}" r="${n2(node.r)}" ${fillAttr(formatter.attr(node.fill))}${stroke}${node.title === void 0 ? "/>" : `><title>${esc(node.title, "node.title")}</title></circle>`}`;
|
|
1844
1934
|
}
|
|
1845
1935
|
case "text": {
|
|
1846
1936
|
let anchor = node.align === "start" ? "start" : node.align === "end" ? "end" : "middle", font = node.font, lineH = font.size * (font.lineHeight ?? 1.2), ink = formatter.attr(node.ink), backing = node.backing ? `<rect x="${n2(node.backing.x)}" y="${n2(node.backing.y)}" width="${n2(node.backing.w)}" height="${n2(node.backing.h)}" fill="${formatter.background()}" opacity="0.92"/>` : "", ls = font.letterSpacing ?? 0, lsAttr = ls ? ` letter-spacing="${n2(ls)}"` : "", lsShift = ls ? node.align === "end" ? ls : node.align === "middle" ? ls / 2 : 0 : 0, tx0 = node.x + lsShift, spans = node.runs ? node.runs.map(
|
|
1847
1937
|
(run, i) => `<tspan${run.weight !== void 0 && run.weight !== font.weight ? ` font-weight="${n2(run.weight)}"` : ""}>${esc(run.text, `text run ${i}`)}</tspan>`
|
|
1848
|
-
).join("") : node.lines.map(
|
|
1849
|
-
|
|
1850
|
-
|
|
1938
|
+
).join("") : node.lines.map((line, i) => {
|
|
1939
|
+
let content = node.lineRuns ? node.lineRuns[i].map(
|
|
1940
|
+
(run, j) => `<tspan${run.weight !== void 0 && run.weight !== font.weight ? ` font-weight="${n2(run.weight)}"` : ""}>${esc(run.text, `text run ${i}.${j}`)}</tspan>`
|
|
1941
|
+
).join("") : esc(line, `text line ${i}`);
|
|
1942
|
+
return `${i === 0 || /\S-$/.test(node.lines[i - 1]) ? "" : `<tspan x="${n2(tx0)}" dy="0"> </tspan>`}<tspan x="${n2(tx0)}" dy="${i === 0 ? "0" : n2(lineH)}">${content}</tspan>`;
|
|
1943
|
+
}).join(""), family = font.family && font.family !== rootFontFamily ? ` font-family="${esc(font.family, "font.family")}"` : "", baselineY = node.y + font.size * TEXT_ASCENT2, rotateAttr = node.rotate ? ` transform="rotate(${n2(node.rotate)} ${n2(tx0)} ${n2(baselineY)})"` : "", role = textRole(node), figures = numericVariant(role, theme), numeric = figures ? ` style="font-variant-numeric: ${figures}"` : "", placed = ` x="${n2(tx0)}" y="${n2(baselineY)}" text-anchor="${anchor}"${rotateAttr}${family} font-size="${font.size}" font-weight="${font.weight}"${font.style === void 0 ? "" : ` font-style="${font.style}"`}${lsAttr}`, halo = node.halo ? formatter.halo(node.ink) : "", haloText = halo ? `<text aria-hidden="true"${node.opacity === void 0 ? "" : ` opacity="${node.opacity}"`}${placed} fill="${halo}" stroke="${halo}" stroke-width="2.5" stroke-linejoin="round"${numeric}>${spans}</text>` : "", text = `<text data-id="${esc(node.id, "node.id")}" data-part="${esc(node.part, "node.part")}" data-bp-role="${role}"${rc}${placed} fill="${ink}"${numeric}>${spans}</text>`;
|
|
1944
|
+
if (node.title) {
|
|
1945
|
+
let full = esc(node.title, "node.title");
|
|
1946
|
+
return `<g${tf} role="img" aria-label="${full}"><title>${full}</title>${backing}${haloText}${text}</g>`;
|
|
1947
|
+
}
|
|
1851
1948
|
return tf ? `<g${tf}>${backing}${haloText}${text}</g>` : backing + haloText + text;
|
|
1852
1949
|
}
|
|
1853
1950
|
}
|
|
@@ -2004,6 +2101,7 @@ function needsSeriesKey(type, data, options, geometry) {
|
|
|
2004
2101
|
if (type === "bar" && options?.variant === "tornado") return !1;
|
|
2005
2102
|
if (type === "scatter" || type === "bubble") return scatterGroupIdentities(data, geometry).length > 1;
|
|
2006
2103
|
if (["butterfly", "pyramid", "heatmap", "status"].includes(type) || !["column", "bar", "combo", "dot", "cleveland", "dumbbell"].includes(type) && options?.labels !== !1) return !1;
|
|
2104
|
+
if (type === "pie") return !0;
|
|
2007
2105
|
let series = data?.series;
|
|
2008
2106
|
return Array.isArray(series) && series.filter((s) => s.role !== "reference" && s.values?.some((entry) => {
|
|
2009
2107
|
let cell = entry !== null && typeof entry == "object" && "categoryId" in entry && "value" in entry ? entry.value : entry;
|
|
@@ -2113,20 +2211,25 @@ function shrinkFont(font, options) {
|
|
|
2113
2211
|
}
|
|
2114
2212
|
function fitText(text, font, maxWidth, maxLines, measure, options = {}) {
|
|
2115
2213
|
let widths = options.wider !== void 0 && options.wider > maxWidth ? [maxWidth, options.wider] : [maxWidth], joined = text.includes(`
|
|
2116
|
-
`) ? text.replace(/\s*\n\s*/g, " ") : text, texts = joined === text ? [text] : [text, joined]
|
|
2117
|
-
for (let width2 of widths)
|
|
2118
|
-
for (let candidate of texts) {
|
|
2119
|
-
let tried = attempt(candidate, font, width2, maxLines, measure, options.typeRole, options.breakAfter);
|
|
2120
|
-
if (!tried.cut) return tried.fitted;
|
|
2121
|
-
}
|
|
2122
|
-
let step = shrinkFont(font, options);
|
|
2123
|
-
if (step)
|
|
2214
|
+
`) ? text.replace(/\s*\n\s*/g, " ") : text, texts = joined === text ? [text] : [text, joined], fits = (candidateFont, lines) => {
|
|
2124
2215
|
for (let width2 of widths)
|
|
2125
2216
|
for (let candidate of texts) {
|
|
2126
|
-
let tried = attempt(candidate,
|
|
2127
|
-
if (!
|
|
2217
|
+
let tried = attempt(candidate, candidateFont, width2, lines, measure, options.typeRole, options.breakAfter), breakFlag = options.breakAfter, ok = tried;
|
|
2218
|
+
if (ok.cut && options.hyphenRetry && !options.breakAfter && (ok = attempt(candidate, candidateFont, width2, lines, measure, options.typeRole, !0), breakFlag = !0), ok.cut) continue;
|
|
2219
|
+
if (width2 === maxWidth) return ok.fitted;
|
|
2220
|
+
let narrow = Math.ceil(maxWidth), fitted = ok.fitted;
|
|
2221
|
+
for (let wide = width2; wide - narrow >= 2; ) {
|
|
2222
|
+
let mid = Math.floor((narrow + wide) / 2), fewer = attempt(candidate, candidateFont, mid, lines, measure, options.typeRole, breakFlag);
|
|
2223
|
+
fewer.cut ? narrow = mid : (wide = mid, fitted = fewer.fitted);
|
|
2224
|
+
}
|
|
2225
|
+
return fitted;
|
|
2128
2226
|
}
|
|
2129
|
-
|
|
2227
|
+
}, step = shrinkFont(font, options), limits = options.tightLines !== void 0 && options.tightLines > maxLines ? [maxLines, maxLines + 1] : [maxLines];
|
|
2228
|
+
for (let lines of limits) {
|
|
2229
|
+
let fitted = fits(font, lines) ?? (step && fits(step, lines));
|
|
2230
|
+
if (fitted) return fitted;
|
|
2231
|
+
}
|
|
2232
|
+
let width = widths[widths.length - 1], last = attempt(joined, step ?? font, width, limits[limits.length - 1], measure, options.typeRole, options.breakAfter).fitted, end = last.lines.length - 1;
|
|
2130
2233
|
if (end >= 0 && !last.lines.some((line) => line.endsWith("\u2026"))) {
|
|
2131
2234
|
let lines = [...last.lines];
|
|
2132
2235
|
return lines[end] = ellipsize(`${lines[end].trimEnd()}\u2026`, last.font, width, measure).text, { ...last, lines, w: Math.max(1, ...lines.map((line) => measure(line, last.font).width)), title: text };
|
|
@@ -2157,7 +2260,7 @@ function cutWithTitle(text, font, maxWidth, measure) {
|
|
|
2157
2260
|
}
|
|
2158
2261
|
|
|
2159
2262
|
// src/core/label/omissions.ts
|
|
2160
|
-
var words = (text) => text.replace(/\s+/g, " ").trim(), ownerKey = (owner) => JSON.stringify([owner.seriesId, owner.categoryId, owner.segmentId, owner.pointId, owner.valueLineId, owner.annotationId, owner.rowId, owner.colId]);
|
|
2263
|
+
var words = (text) => plainText(text).replace(/\s+/g, " ").trim(), ownerKey = (owner) => JSON.stringify([owner.seriesId, owner.categoryId, owner.segmentId, owner.pointId, owner.valueLineId, owner.annotationId, owner.rowId, owner.colId]);
|
|
2161
2264
|
function containsText(hay, needle) {
|
|
2162
2265
|
for (let at = needle ? hay.indexOf(needle) : -1; at >= 0; at = hay.indexOf(needle, at + 1))
|
|
2163
2266
|
if (!/[\p{L}\p{N}.,+\-−]$/u.test(hay.slice(0, at)) && !/^([\p{L}\p{N}]|[.,]\p{N})/u.test(hay.slice(at + needle.length))) return !0;
|
|
@@ -2428,7 +2531,7 @@ function normalizeLegendOption(option, defaultOptions) {
|
|
|
2428
2531
|
if (option !== "none")
|
|
2429
2532
|
return option === void 0 || option === "auto" ? defaultOptions : typeof option == "string" ? { position: option } : option;
|
|
2430
2533
|
}
|
|
2431
|
-
var COMPACT_SOURCE_LINES = /* @__PURE__ */ Symbol("compactSourceLines"), LEGEND_HEIGHT = /* @__PURE__ */ Symbol("legendHeight"), CUT_LABEL_NOTES = /* @__PURE__ */ Symbol("cutLabelNotes"), CUT_LABEL_LIST = /* @__PURE__ */ Symbol("cutLabelList");
|
|
2534
|
+
var SIDE_KEY_PLOT_SHARE = 0.68, COMPACT_SOURCE_LINES = /* @__PURE__ */ Symbol("compactSourceLines"), LEGEND_HEIGHT = /* @__PURE__ */ Symbol("legendHeight"), CUT_LABEL_NOTES = /* @__PURE__ */ Symbol("cutLabelNotes"), CUT_LABEL_LIST = /* @__PURE__ */ Symbol("cutLabelList");
|
|
2432
2535
|
function authoredNotes(options) {
|
|
2433
2536
|
return options.footnotes === !1 ? [] : options.footnotes ?? [];
|
|
2434
2537
|
}
|
|
@@ -2487,11 +2590,11 @@ function frameTextOptions(options) {
|
|
|
2487
2590
|
}
|
|
2488
2591
|
var NOTE_HIT_PX = 24;
|
|
2489
2592
|
function htmlFooterHeight(input, parts, sourceText, font, width, lineH, measure) {
|
|
2490
|
-
let height = (text) => wrapFootnote(text, font, width, measure).length * lineH, total = 0;
|
|
2593
|
+
let height = (text) => wrapFootnote(markBold(text), font, width, measure).length * lineH, total = 0;
|
|
2491
2594
|
for (let note of parts.shown)
|
|
2492
2595
|
total += height(`${note.ref ? `${footnoteMark(note.ref)} ` : ""}${note.kind === "method" || note.kind === "disclosure" ? note.short ?? note.text : note.text}`);
|
|
2493
2596
|
let credit = parts.credit && `${chartString2(input, "mapCredit")}: ${parts.credit.text}`, label = parts.panel.length === 0 ? void 0 : parts.info ? `${chartString(input, "notesAndSources")} (${parts.panel.length})` : notesPointer(parts.panel.length, input.strings), items = [
|
|
2494
|
-
...parts.source && sourceText ? [{ w: measure(sourceText, font).width, text: sourceText }] : [],
|
|
2597
|
+
...parts.source && sourceText ? [{ w: measure(markBold(sourceText), font).width, text: sourceText }] : [],
|
|
2495
2598
|
...credit && parts.info ? [{ w: measure(credit, font).width, text: credit }] : [],
|
|
2496
2599
|
...label ? [{ w: Math.max(NOTE_HIT_PX, measure(label, font).width), h: Math.max(NOTE_HIT_PX, lineH) }] : []
|
|
2497
2600
|
], used = -1, line = 0;
|
|
@@ -2503,7 +2606,7 @@ function htmlFooterHeight(input, parts, sourceText, font, width, lineH, measure)
|
|
|
2503
2606
|
}
|
|
2504
2607
|
used >= 0 && (total += line + 2), used = Math.min(item.w, width), line = h;
|
|
2505
2608
|
}
|
|
2506
|
-
return items.length > 0 && (total += line + (parts.shown.length > 0 ? 4 : 0)), credit && !parts.info && (total +=
|
|
2609
|
+
return items.length > 0 && (total += line + (parts.shown.length > 0 ? 4 : 0)), credit && !parts.info && (total += wrapFootnote(credit, font, width, measure).length * lineH), total;
|
|
2507
2610
|
}
|
|
2508
2611
|
var frameChrome = /* @__PURE__ */ new WeakMap(), plotChromeFloor = /* @__PURE__ */ new WeakMap(), settledAutoHeight = /* @__PURE__ */ new WeakSet(), REFERENCE_SUBTITLE_PLOT_GAP = 12, REFERENCE_FOOTER_GAP = 12;
|
|
2509
2612
|
function fixedPlotChrome(result, reserve = 0) {
|
|
@@ -2720,6 +2823,7 @@ function shiftLegendKeyY(node, dy) {
|
|
|
2720
2823
|
}
|
|
2721
2824
|
}
|
|
2722
2825
|
function measureNamesUnit(unit, measure) {
|
|
2826
|
+
measure = plainText(measure);
|
|
2723
2827
|
let escaped = unit.trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+");
|
|
2724
2828
|
return escaped.length > 0 && new RegExp(`(?<![\\p{L}\\p{N}_])${escaped}(?![\\p{L}\\p{N}_])`, "iu").test(measure);
|
|
2725
2829
|
}
|
|
@@ -2827,7 +2931,7 @@ function withCutLabelNotes(data, options, layout) {
|
|
|
2827
2931
|
severity: "warn",
|
|
2828
2932
|
message: `${cuts.length} shortened labels have their full text in the notes list and reading.omissions.`,
|
|
2829
2933
|
detail: { labels: cuts.map((cut) => cut.labelId) }
|
|
2830
|
-
}], geo), existing = chartNotes(first).map((note) => note.text.replace(/\s+/g, " ").trim()), unlisted = cuts.filter((cut) => isNumberAlone(cut.text) || !existing.some((note) => containsText(note, cut.text.replace(/\s+/g, " ").trim())));
|
|
2934
|
+
}], geo), existing = chartNotes(first).map((note) => note.text.replace(/\s+/g, " ").trim()), unlisted = cuts.filter((cut) => isNumberAlone(cut.text) || !existing.some((note) => containsText(plainText(note), cut.text.replace(/\s+/g, " ").trim())));
|
|
2831
2935
|
if (!unlisted.length) return warn(first);
|
|
2832
2936
|
let items = [...new Set(unlisted.map((cut) => {
|
|
2833
2937
|
let owner = first.scene.find((node2) => node2.t === "text" && (node2.id === cut.labelId || node2.id === `label:${cut.labelId}`))?.owner, source = data, row = source?.rows?.find((row2) => row2.id === owner?.rowId)?.label, column = source?.columns?.find((column2) => column2.id === owner?.colId)?.label, place = [row, row ? column : void 0].filter(Boolean).join(" \u2014 ");
|
|
@@ -3071,27 +3175,56 @@ function markNotedLabels(geo, noted, from) {
|
|
|
3071
3175
|
}
|
|
3072
3176
|
function unitMissing(options, geo) {
|
|
3073
3177
|
let unit = typeof options?.unit == "string" ? options.unit.trim() : "";
|
|
3074
|
-
if (!unit || options?.unitShown === !0 || geo.warnings.some((w) => w.severity === "error") || geo.type === "variance" && options?.variant === "relative") return !1;
|
|
3178
|
+
if (!unit || options?.unitShown === !0 || geo.warnings.some((w) => w.severity === "error") || geo.type === "variance" && options?.variant === "relative" || printsOnlyShares(geo.type, options, geo.derived)) return !1;
|
|
3075
3179
|
let subtitle = resolveSubtitle(options?.subtitle);
|
|
3076
3180
|
if (subtitle && subtitleUnitClause(unit, subtitle.measure) === "" || !squeezeUnit(unit)) return !1;
|
|
3077
3181
|
let subtitleText = geo.scene.flatMap((node) => node.t === "text" && node.id.startsWith("frame:subtitle") ? node.lines : []).join(" "), carriesUnit = geo.type === "cohort" ? textCarriesCohortUnit : textCarriesUnit;
|
|
3078
3182
|
return !carriesUnit(subtitleText, unit) && !geo.scene.some((node) => node.t === "text" && carriesUnit(node.lines.join(" "), unit));
|
|
3079
3183
|
}
|
|
3080
|
-
var PERCENT_UNIT = /^(?:%|percent|per\s*cent|pct|percentage)(?!\p{L})/iu;
|
|
3184
|
+
var PERCENT_UNIT = /^(?:%|percent|per\s*cent|pct|percentage)(?!\p{L})/iu, isPercentUnit = (unit) => PERCENT_UNIT.test(unit.trim());
|
|
3185
|
+
function columnSegmentsPrintAbsolute(options) {
|
|
3186
|
+
let o = options ?? {};
|
|
3187
|
+
if (o.labels === !1) return !1;
|
|
3188
|
+
let segment = o.labels?.segment;
|
|
3189
|
+
return Array.isArray(segment) ? segment.includes("absolute") : segment !== !1 && o.shareLabels !== void 0;
|
|
3190
|
+
}
|
|
3191
|
+
function printsOnlyShares(type, options, derived) {
|
|
3192
|
+
let o = options ?? {}, groupKey = (derived?.groups?.length ?? 0) > 1 && o.legend !== "none";
|
|
3193
|
+
switch (type) {
|
|
3194
|
+
case "column":
|
|
3195
|
+
return (o.variant === "stacked100" || o.valueAxis?.percent === !0) && o.grandTotalLabels !== !0 && !columnSegmentsPrintAbsolute(options);
|
|
3196
|
+
case "bar":
|
|
3197
|
+
return o.variant === "stacked100" && o.grandTotalLabels !== !0;
|
|
3198
|
+
case "line":
|
|
3199
|
+
return o.variant === "stacked100-area" || o.valueAxis?.percent === !0;
|
|
3200
|
+
case "treemap":
|
|
3201
|
+
return o.cellValue === "share" && !o.total && !groupKey;
|
|
3202
|
+
default:
|
|
3203
|
+
return !1;
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
function shareUnitOptions(type, options, derived) {
|
|
3207
|
+
let unit = options.unit?.trim();
|
|
3208
|
+
if (!unit || PERCENT_UNIT.test(unit) || !printsOnlyShares(type, options, derived)) return options;
|
|
3209
|
+
let measure = resolveSubtitle(options.subtitle)?.measure;
|
|
3210
|
+
return measure && measureNamesUnit(unit, measure) ? options : { ...options, unit: "%" };
|
|
3211
|
+
}
|
|
3081
3212
|
function shareUnitLints(options, geo) {
|
|
3082
3213
|
let unit = typeof options?.unit == "string" ? options.unit.trim() : "";
|
|
3083
|
-
if (!unit || PERCENT_UNIT.test(unit) || !
|
|
3214
|
+
if (!unit || PERCENT_UNIT.test(unit) || !printsOnlyShares(geo.type, options, geo.derived)) return [];
|
|
3084
3215
|
if (geo.warnings.some((w) => w.severity === "error")) return [];
|
|
3085
3216
|
let measure = resolveSubtitle(options?.subtitle)?.measure ?? "", subtitleText = geo.scene.flatMap((node) => node.t === "text" && node.id.startsWith("frame:subtitle") ? node.lines : []).join(" ");
|
|
3086
3217
|
if (!measure || !textCarriesUnit(subtitleText, unit)) return [];
|
|
3087
|
-
let
|
|
3088
|
-
|
|
3218
|
+
let escaped = unit.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+"), clause = new RegExp(`(?:\\bin|,|\\()\\s*${escaped}\\s*\\)?\\s*$`, "iu");
|
|
3219
|
+
if (!clause.test(measure)) return [];
|
|
3220
|
+
let kept = measure.replace(clause, "").trim(), path = typeof options?.subtitle == "string" ? "/options/subtitle" : "/options/subtitle/measure";
|
|
3221
|
+
return [{
|
|
3089
3222
|
code: "share-unit-conflict",
|
|
3090
3223
|
severity: "warn",
|
|
3091
|
-
message: `
|
|
3092
|
-
suggest:
|
|
3093
|
-
field:
|
|
3094
|
-
...
|
|
3224
|
+
message: `the chart prints shares in %, but the subtitle names the unit '${unit}' of the raw values`,
|
|
3225
|
+
suggest: `remove the unit clause from the subtitle measure '${measure}', or name the base instead ('Share of generation')`,
|
|
3226
|
+
field: ["options", "subtitle"],
|
|
3227
|
+
...kept ? { fix: [{ op: "replace", path, value: kept }] } : {}
|
|
3095
3228
|
}];
|
|
3096
3229
|
}
|
|
3097
3230
|
var UNIT_SIGNS = [
|
|
@@ -3125,20 +3258,25 @@ function measureUnitTail(measure, unit) {
|
|
|
3125
3258
|
let at = measure.lastIndexOf(", ");
|
|
3126
3259
|
if (at <= 0) return "";
|
|
3127
3260
|
let tail2 = measure.slice(at + 2);
|
|
3128
|
-
return /^(%|in\s|per\s|[$€£¥]|(?:EUR|USD|CHF|GBP|JPY|US\$)(?![\p{L}])|index\b|score\b|share of\b|# )/iu.test(tail2) || unit !== void 0 && unit.trim() !== "" && tail2.trim().toLowerCase() === unit.trim().toLowerCase() ? measure.slice(at + 1) : "";
|
|
3261
|
+
return /^(%|in\s|per\s|[$€£¥]|(?:EUR|USD|CHF|GBP|JPY|US\$)(?![\p{L}])|index\b|score\b|share of\b|# )/iu.test(plainText(tail2)) || unit !== void 0 && unit.trim() !== "" && plainText(tail2).trim().toLowerCase() === unit.trim().toLowerCase() ? measure.slice(at + 1) : "";
|
|
3129
3262
|
}
|
|
3130
3263
|
function measureSubtitle(input, x, y, id, nextId, contentW) {
|
|
3131
|
-
let
|
|
3264
|
+
let authored = input.subtitle, sub = hasBold(authored.measure) || hasBold(authored.company ?? "") || hasBold(authored.period ?? "") ? {
|
|
3265
|
+
...authored,
|
|
3266
|
+
measure: markBold(authored.measure),
|
|
3267
|
+
...authored.company ? { company: markBold(authored.company) } : {},
|
|
3268
|
+
...authored.period ? { period: markBold(authored.period) } : {}
|
|
3269
|
+
} : authored, font = { family: input.theme.type.family, ...input.theme.type.subtitle }, boldFont = { ...font, weight: emphasisWeight(input.theme) }, trailing = "";
|
|
3132
3270
|
frameRendersUnit(input) && (trailing += subtitleUnitClause(input.unit, sub.measure)), sub.period && (trailing += ` \xB7 ${sub.period}`), sub.scenarios && sub.scenarios.length > 0 && (trailing += ` \xB7 ${formatScenarios(sub.scenarios)}`);
|
|
3133
3271
|
let segments = [];
|
|
3134
3272
|
sub.company && segments.push({ text: `${sub.company} \xB7 `, bold: !1 });
|
|
3135
3273
|
let unitTail = measureUnitTail(sub.measure, input.unit), lone = !sub.company && !unitTail && !trailing;
|
|
3136
3274
|
segments.push({ text: sub.measure.slice(0, sub.measure.length - unitTail.length), bold: !lone }), (unitTail || trailing) && segments.push({ text: unitTail + trailing, bold: !1 });
|
|
3137
|
-
let lineH = font.size * (font.lineHeight ?? 1.3), runs = segments.map((seg) => ({
|
|
3275
|
+
let lineH = font.size * (font.lineHeight ?? 1.3), runs = subtitleRuns(segments.map((seg) => ({
|
|
3138
3276
|
text: seg.text.replace(/^ /, "\xA0").replace(/ $/, "\xA0"),
|
|
3139
3277
|
...seg.bold ? { weight: boldFont.weight } : {}
|
|
3140
|
-
})), width = runsWidth(runs, font, boldFont, input.measure), maxLines = 1 / 0, scenarios = sub.scenarios && sub.scenarios.length > 0 ? formatScenarios(sub.scenarios) : void 0;
|
|
3141
|
-
return width > contentW ? wrapSubtitle(segments, { x, y, id, nextId, contentW, lineH, font, boldFont, measure: input.measure, maxLines, scenarios, period: sub.period }) : { nodes: [{
|
|
3278
|
+
})), boldFont.weight, font.weight), width = runsWidth(runs, font, boldFont, input.measure), maxLines = 1 / 0, scenarios = sub.scenarios && sub.scenarios.length > 0 ? formatScenarios(sub.scenarios) : void 0;
|
|
3279
|
+
return width > contentW ? wrapSubtitle(segments, { x, y, id, nextId, contentW, lineH, font, boldFont, measure: input.measure, maxLines, scenarios, period: sub.period && plainText(sub.period) }) : { nodes: [{
|
|
3142
3280
|
t: "text",
|
|
3143
3281
|
id,
|
|
3144
3282
|
x,
|
|
@@ -3153,6 +3291,9 @@ function measureSubtitle(input, x, y, id, nextId, contentW) {
|
|
|
3153
3291
|
typeRole: "subtitle"
|
|
3154
3292
|
}], rect: { x, y, w: width, h: lineH } };
|
|
3155
3293
|
}
|
|
3294
|
+
function subtitleRuns(runs, boldWeight, baseWeight) {
|
|
3295
|
+
return runs.some((run) => run.text.includes("\uE000") || run.text.includes("\uE001")) ? runs.flatMap((run) => run.weight === boldWeight ? [{ ...run, text: plainText(run.text) }] : boldRuns(run.text, boldWeight, baseWeight)) : runs;
|
|
3296
|
+
}
|
|
3156
3297
|
function runsWidth(runs, font, boldFont, measure) {
|
|
3157
3298
|
return runs.reduce((w, run) => w + measure(run.text, run.weight ? boldFont : font).width, 0) + // measure() counts n−1 tracking gaps WITHIN each run; the renderer
|
|
3158
3299
|
// tracks the continuous line, which adds one more gap per run boundary.
|
|
@@ -3160,17 +3301,17 @@ function runsWidth(runs, font, boldFont, measure) {
|
|
|
3160
3301
|
// occupied claim honest the day a theme adds letterSpacing to it.
|
|
3161
3302
|
(font.letterSpacing ? font.letterSpacing * (runs.length - 1) : 0);
|
|
3162
3303
|
}
|
|
3163
|
-
function runsOf(words2, boldWeight) {
|
|
3304
|
+
function runsOf(words2, boldWeight, baseWeight) {
|
|
3164
3305
|
let runs = [];
|
|
3165
3306
|
return words2.forEach((word, i) => {
|
|
3166
3307
|
i > 0 && words2[i - 1].bold === word.bold ? runs[runs.length - 1].text += ` ${word.text}` : runs.push({ text: i > 0 ? `\xA0${word.text}` : word.text, ...word.bold ? { weight: boldWeight } : {} });
|
|
3167
|
-
}), runs;
|
|
3308
|
+
}), subtitleRuns(runs, boldWeight, baseWeight);
|
|
3168
3309
|
}
|
|
3169
3310
|
function balancedLines(text, font, maxWidth, lines, measure) {
|
|
3170
3311
|
let filled = filledLines(text, font, maxWidth, lines, measure);
|
|
3171
3312
|
if (text.includes(`
|
|
3172
3313
|
`) || lines.some((line) => line.endsWith("\u2026")) || lines.join(" ").split(/[^\S\u00a0\u202f]+/).filter(Boolean).join(" ") !== text.split(/[^\S\u00a0\u202f]+/).filter(Boolean).join(" ") || filled.length < 2 || filled.length > 3) return filled;
|
|
3173
|
-
let units = filled.join(" ").split(" ").reduce((out, word) => (out.length > 0 && /^p\.a\.[,;:]?$/i.test(word) ? out[out.length - 1] += ` ${word}` : out.push(word), out), []);
|
|
3314
|
+
let units = filled.join(" ").split(" ").reduce((out, word) => (out.length > 0 && /^p\.a\.[,;:]?$/i.test(plainText(word)) ? out[out.length - 1] += ` ${word}` : out.push(word), out), []);
|
|
3174
3315
|
if (units.length > 40) return filled;
|
|
3175
3316
|
let n = filled.length, best, consider = (cuts) => {
|
|
3176
3317
|
let bounds = [0, ...cuts, units.length], parts = bounds.slice(1).map((to, i) => units.slice(bounds[i], to).join(" ")), widths = parts.map((part) => measure(part, font).width);
|
|
@@ -3187,9 +3328,9 @@ function filledLines(text, font, maxWidth, lines, measure) {
|
|
|
3187
3328
|
`) || lines.some((line) => line.endsWith("\u2026")) || lines.length < 2) return [...lines];
|
|
3188
3329
|
let split = (line) => line.split(/[^\S\u00a0\u202f]+/).filter(Boolean), words2 = split(text);
|
|
3189
3330
|
if (lines.flatMap(split).join(" ") !== words2.join(" ")) return [...lines];
|
|
3190
|
-
let units = (line) => split(line).reduce((out2, word) => (out2.length > 0 && /^p\.a\.[,;:]?$/i.test(word) ? out2[out2.length - 1] += ` ${word}` : out2.push(word), out2), []), out = lines.map(units);
|
|
3331
|
+
let units = (line) => split(line).reduce((out2, word) => (out2.length > 0 && /^p\.a\.[,;:]?$/i.test(plainText(word)) ? out2[out2.length - 1] += ` ${word}` : out2.push(word), out2), []), out = lines.map(units);
|
|
3191
3332
|
for (let i = 1; i < out.length; i++)
|
|
3192
|
-
if (/^p\.a\.[,;:]?$/i.test(out[i][0] ?? "") && out[i - 1].length > 1) {
|
|
3333
|
+
if (/^p\.a\.[,;:]?$/i.test(plainText(out[i][0] ?? "")) && out[i - 1].length > 1) {
|
|
3193
3334
|
let rate = out[i - 1].pop();
|
|
3194
3335
|
out[i][0] = `${rate} ${out[i][0]}`;
|
|
3195
3336
|
}
|
|
@@ -3204,7 +3345,7 @@ function filledLines(text, font, maxWidth, lines, measure) {
|
|
|
3204
3345
|
function keepLastLineCompany(broken, words2, widthOf, maxWidth, scenarios, period) {
|
|
3205
3346
|
if (broken.length < 2 || words2.filter((word) => word.text !== "\xB7").length < 4) return;
|
|
3206
3347
|
let pairWord = scenarios !== void 0 && scenarios.split(" ").length <= 3 ? scenarios : void 0, periodWord = period !== void 0 && period.trim().split(/\s+/).length <= 3 ? period.trim().split(/\s+/).join(" ") : void 0, lone = (line) => {
|
|
3207
|
-
let text = line.filter((word) => word.text !== "\xB7").map((word) => word.text).join(" ");
|
|
3348
|
+
let text = line.filter((word) => word.text !== "\xB7").map((word) => plainText(word.text)).join(" ");
|
|
3208
3349
|
return line.filter((word) => word.text !== "\xB7").length < 2 || text === pairWord || text === periodWord;
|
|
3209
3350
|
};
|
|
3210
3351
|
if (!lone(broken[broken.length - 1])) return;
|
|
@@ -3216,7 +3357,7 @@ function keepLastLineCompany(broken, words2, widthOf, maxWidth, scenarios, perio
|
|
|
3216
3357
|
for (; from < to && line[from].text === "\xB7"; ) from++;
|
|
3217
3358
|
for (; to > from && line[to - 1].text === "\xB7"; ) to--;
|
|
3218
3359
|
return line.slice(from, to);
|
|
3219
|
-
}, boundary = (cut) => pair[cut].text === "\xB7" || pair[cut - 1].text === "\xB7" || pair[cut].bold !== pair[cut - 1].bold, binds = (cut) => /^(in|of|by|vs\.?|per|to|and|or|the|a|an|for|from|at|on|[$€£¥]|US\$|Q[1-4]|H[12])$/i.test(pair[cut - 1].text), tiers = [boundary, (cut) => !binds(cut), () => !0];
|
|
3360
|
+
}, boundary = (cut) => pair[cut].text === "\xB7" || pair[cut - 1].text === "\xB7" || pair[cut].bold !== pair[cut - 1].bold, binds = (cut) => /^(in|of|by|vs\.?|per|to|and|or|the|a|an|for|from|at|on|[$€£¥]|US\$|Q[1-4]|H[12])$/i.test(plainText(pair[cut - 1].text)), tiers = [boundary, (cut) => !binds(cut), () => !0];
|
|
3220
3361
|
for (let allowed of tiers)
|
|
3221
3362
|
for (let cut = broken[broken.length - 2].length - 1; cut >= 1; cut--) {
|
|
3222
3363
|
if (!allowed(cut)) continue;
|
|
@@ -3228,7 +3369,7 @@ function keepLastLineCompany(broken, words2, widthOf, maxWidth, scenarios, perio
|
|
|
3228
3369
|
}
|
|
3229
3370
|
}
|
|
3230
3371
|
function wrapSubtitle(segments, ctx) {
|
|
3231
|
-
let words2 = segments.flatMap((seg) => seg.text.split(" ").filter(Boolean).map((text) => ({ text, bold: seg.bold }))), widthOf = (list) => runsWidth(runsOf(list, ctx.boldFont.weight), ctx.font, ctx.boldFont, ctx.measure), broken = [], rest = words2;
|
|
3372
|
+
let words2 = segments.flatMap((seg) => seg.text.split(" ").filter(Boolean).map((text) => ({ text, bold: seg.bold }))), widthOf = (list) => runsWidth(runsOf(list, ctx.boldFont.weight, ctx.font.weight), ctx.font, ctx.boldFont, ctx.measure), broken = [], rest = words2;
|
|
3232
3373
|
for (; rest.length > 0 && broken.length < ctx.maxLines - 1 && widthOf(rest) > ctx.contentW; ) {
|
|
3233
3374
|
let split = 1;
|
|
3234
3375
|
for (; split < rest.length && widthOf(rest.slice(0, split + 1)) <= ctx.contentW; ) split++;
|
|
@@ -3242,9 +3383,9 @@ function wrapSubtitle(segments, ctx) {
|
|
|
3242
3383
|
line = kept ? [...line.slice(0, -1), { ...last, text: kept }] : line.slice(0, -1);
|
|
3243
3384
|
}
|
|
3244
3385
|
return withEllipsis(line);
|
|
3245
|
-
}, title = words2.map((word) => word.text).join(" "), lines = broken.map((line) => widthOf(line) > ctx.contentW ? { line: cutLine(line), cut: !0 } : { line, cut: !1 });
|
|
3386
|
+
}, title = words2.map((word) => plainText(word.text)).join(" "), lines = broken.map((line) => widthOf(line) > ctx.contentW ? { line: cutLine(line), cut: !0 } : { line, cut: !1 });
|
|
3246
3387
|
return { nodes: lines.map(({ line, cut }, index) => {
|
|
3247
|
-
let runs = runsOf(line, ctx.boldFont.weight);
|
|
3388
|
+
let runs = runsOf(line, ctx.boldFont.weight, ctx.font.weight);
|
|
3248
3389
|
return {
|
|
3249
3390
|
t: "text",
|
|
3250
3391
|
id: index === 0 ? ctx.id : ctx.nextId(),
|
|
@@ -3307,9 +3448,9 @@ function solveFrame(input, occupied) {
|
|
|
3307
3448
|
textScale: input.textScale,
|
|
3308
3449
|
typeRole: "title",
|
|
3309
3450
|
shrink: { ...baseFont, size: Math.max(targetFloorsPx(input.target ?? DEFAULT_TARGET, input.textScale).title, compactSize) }
|
|
3310
|
-
},
|
|
3311
|
-
wrapped.title !== void 0 && (wrapped = fitText(
|
|
3312
|
-
let font = wrapped.font, lines = wrapped.title === void 0 && wrapped.lines.length >= 2 ? balancedLines(
|
|
3451
|
+
}, title = markBold(input.title), titleMeasure = title === input.title ? measure : boldMeasurer(measure, emphasisWeight(theme)), wrapped = fitText(title, baseFont, headerW, TITLE_LINES, titleMeasure, fitOptions);
|
|
3452
|
+
wrapped.title !== void 0 && (wrapped = fitText(title, wrapped.font, headerW, Number.MAX_SAFE_INTEGER, titleMeasure, { ...fitOptions, shrink: void 0 }));
|
|
3453
|
+
let font = wrapped.font, lines = wrapped.title === void 0 && wrapped.lines.length >= 2 ? balancedLines(title, font, headerW, wrapped.lines, titleMeasure) : wrapped.lines;
|
|
3313
3454
|
wrapped.title !== void 0 && warnings.push({
|
|
3314
3455
|
code: "frame-title-truncated",
|
|
3315
3456
|
severity: "warn",
|
|
@@ -3322,9 +3463,9 @@ function solveFrame(input, occupied) {
|
|
|
3322
3463
|
id,
|
|
3323
3464
|
x: contentX,
|
|
3324
3465
|
y: topY,
|
|
3325
|
-
lines,
|
|
3466
|
+
...splitBoldLines(lines, emphasisWeight(theme), font.weight),
|
|
3326
3467
|
// A cut title keeps its full text for the reader.
|
|
3327
|
-
...wrapped.title !== void 0 ? { title: wrapped.title } : {},
|
|
3468
|
+
...wrapped.title !== void 0 ? { title: plainText(wrapped.title) } : {},
|
|
3328
3469
|
align: "start",
|
|
3329
3470
|
font,
|
|
3330
3471
|
ink: { token: "ink" },
|
|
@@ -3340,7 +3481,7 @@ function solveFrame(input, occupied) {
|
|
|
3340
3481
|
nodes.push(...subtitle.nodes), occupied.claim(subtitle.rect, "frame", {}), frame.subtitleNodeId = subtitle.nodes[0].id, topY += subtitle.rect.h + tokens.gapSubtitlePlot;
|
|
3341
3482
|
} else input.title && (topY += input.cardGaps ? 8 : tokens.gapSubtitlePlot - tokens.gapTitleSubtitle);
|
|
3342
3483
|
!input.cardGaps && (input.subtitle || input.title) && theme.space.gap?.subtitlePlot === void 0 && size.width < WIDE_CANVAS_MIN_WIDTH && recordFreedChrome(frame, "header-gap", REFERENCE_SUBTITLE_PLOT_GAP - tokens.gapSubtitlePlot);
|
|
3343
|
-
let footFont = withFamily(footerType(theme.type.footnote, input.target, input.textScale)), liveFooterH = 0, footLineH = footFont.size * (footFont.lineHeight ?? 1.3), footInset = Math.max(0, Math.min(input.footerInset ?? 0, (contentW - 1) / 2)), footX = contentX + footInset, footW = contentW - 2 * footInset, fullStatic = staticFrame.pinned, placement = fullStatic ? "frame" : input.notes?.placement ?? defaultNotePlacement(input.target), hitRoom = (y) => placement === "info" ? Math.min(y, size.height - NOTE_HIT_PX) : y, budget = fullStatic ? 1 / 0 : input.notes?.maxLines ?? defaultNoteLines(input.target, size.width), shown = new Set(input.notes?.show ?? ["note"]), pointerOn = !fullStatic && !input.footnotesOff && input.notes?.pointer !== !1, entries = [];
|
|
3484
|
+
let footFont = withFamily(footerType(theme.type.footnote, input.target, input.textScale)), footMeasure = input.source && hasBold(input.source) || input.footnotes?.some(hasBold) ? boldMeasurer(measure, emphasisWeight(theme)) : measure, liveFooterH = 0, footLineH = footFont.size * (footFont.lineHeight ?? 1.3), footInset = Math.max(0, Math.min(input.footerInset ?? 0, (contentW - 1) / 2)), footX = contentX + footInset, footW = contentW - 2 * footInset, fullStatic = staticFrame.pinned, placement = fullStatic ? "frame" : input.notes?.placement ?? defaultNotePlacement(input.target), hitRoom = (y) => placement === "info" ? Math.min(y, size.height - NOTE_HIT_PX) : y, budget = fullStatic ? 1 / 0 : input.notes?.maxLines ?? defaultNoteLines(input.target, size.width), shown = new Set(input.notes?.show ?? ["note"]), pointerOn = !fullStatic && !input.footnotesOff && input.notes?.pointer !== !1, entries = [];
|
|
3344
3485
|
{
|
|
3345
3486
|
let notes = input.footnotes ?? [], numbered = input.numberedFootnotes ?? notes, unreferencedNotes = new Set(input.unreferencedNotes ?? []), next = 0, referenced = !1, unmarked = [];
|
|
3346
3487
|
for (let f of notes) {
|
|
@@ -3348,10 +3489,10 @@ function solveFrame(input, occupied) {
|
|
|
3348
3489
|
marker && (referenced = !0), numberedHere && marker === "" && unmarked.push(next + 1), numberedHere && (next += 1);
|
|
3349
3490
|
let meta = numberedHere ? void 0 : engineNoteMeta(f);
|
|
3350
3491
|
if (fullStatic && meta?.list && (staticFrame.countable = !0), meta?.list) {
|
|
3351
|
-
let fitted = fittedNote(meta.list, (text) => wrapFootnote(text, footFont, footW,
|
|
3492
|
+
let fitted = fittedNote(meta.list, (text) => wrapFootnote(markBold(text), footFont, footW, footMeasure).length <= 2);
|
|
3352
3493
|
f = meta.short ? engineNote(f, "disclosure", fitted, meta.values, meta.list) : engineNote(fitted, "disclosure", void 0, meta.values, meta.list);
|
|
3353
3494
|
}
|
|
3354
|
-
let kind = numberedDisclosure ? "disclosure" : numberedHere ? "note" : meta?.kind ?? "method", fittedShort = engineNoteMeta(f)?.short ?? meta?.short, short = fittedShort && (kind !== "disclosure" || input.notes?.maxListed !== void 0 ||
|
|
3495
|
+
let kind = numberedDisclosure ? "disclosure" : numberedHere ? "note" : meta?.kind ?? "method", fittedShort = engineNoteMeta(f)?.short ?? meta?.short, short = fittedShort && (kind !== "disclosure" || input.notes?.maxListed !== void 0 || footMeasure(markBold(fittedShort), footFont).width < footMeasure(markBold(f), footFont).width) ? fittedShort : void 0, storedMeta = meta ? { ...meta, ...engineNoteMeta(f), ...meta.ranks ? { ranks: !0 } : {} } : void 0;
|
|
3355
3496
|
entries.push(keepNoteMeta({ kind, text: f, ...short ? { short } : {}, drawn: `${marker}${kind === "disclosure" || kind === "method" && !fullStatic ? short ?? f : f}`, ...marker ? { ref: next } : {}, ...meta?.ranks ? { ranks: !0 } : {} }, storedMeta));
|
|
3356
3497
|
}
|
|
3357
3498
|
!input.footnotesOff && unmarked.length > 0 && referenced && warnings.push({
|
|
@@ -3365,10 +3506,10 @@ function solveFrame(input, occupied) {
|
|
|
3365
3506
|
entries.sort((a, b) => rank[a.kind] - rank[b.kind]);
|
|
3366
3507
|
let credit = input.credit, creditInFrame = credit !== void 0 && (credit.required || fullStatic), sourceText = input.source ? sourceLine(input.source, input.strings?.source ?? localeStrings2().source) : void 0, sourceOff = sourceText !== void 0 && !fullStatic && input[COMPACT_SOURCE_LINES] === 0;
|
|
3367
3508
|
sourceOff && (frame.source = input.source, warnings.push({ code: "footnotes-off", severity: "info", message: `compact frame has no room for the source line: ${sourceText}` }));
|
|
3368
|
-
let pointed = new Set(input.pointedNotes ?? []), kept = entries.filter((entry) => entry.kind === "disclosure" ? shown.has("disclosure") || entry.ranks === !0 && shown.has("ranks") : !input.footnotesOff && pointed.has(entry.text)), candidates = input.footnotesOff || placement === "list" ? [] : entries.filter((entry) => !kept.includes(entry) && shown.has(entry.kind)), infoPanel = staticFrame.live && placement === "info", listed = (k2) => infoPanel ? entries.filter((entry) => !kept.includes(entry) && !candidates.slice(0, k2).includes(entry))
|
|
3509
|
+
let pointed = new Set(input.pointedNotes ?? []), kept = entries.filter((entry) => entry.kind === "disclosure" ? shown.has("disclosure") || entry.ranks === !0 && shown.has("ranks") : !input.footnotesOff && pointed.has(entry.text)), candidates = input.footnotesOff || placement === "list" ? [] : entries.filter((entry) => !kept.includes(entry) && shown.has(entry.kind) && !isQuiet(entry)), infoPanel = staticFrame.live && placement === "info", infoCount = (hidden) => allQuiet(hidden) && !(credit && !creditInFrame) ? 0 : hidden.length, listed = (k2) => infoPanel ? infoCount(entries.filter((entry) => !kept.includes(entry) && !candidates.slice(0, k2).includes(entry))) + (credit && !creditInFrame ? 1 : 0) : entries.filter((entry) => shown.has(entry.kind) && !kept.includes(entry) && !isQuiet(entry)).length - k2 + (credit && !creditInFrame ? 1 : 0), sourcePara = (k2) => {
|
|
3369
3510
|
let hidden = listed(k2), pointer = pointerOn && hidden > 0 ? notesPointer(hidden, input.strings) : void 0, source = sourceOff ? void 0 : sourceText;
|
|
3370
3511
|
return source === void 0 ? pointer : pointer === void 0 ? source : `${source}${/[.!?]$/.test(source) ? "" : "."} ${pointer}`;
|
|
3371
|
-
}, sourceFit = (text) => !fullStatic && input[COMPACT_SOURCE_LINES] === 1 ? fitText(text, footFont, footW, 1,
|
|
3512
|
+
}, sourceFit = (text) => !fullStatic && input[COMPACT_SOURCE_LINES] === 1 ? fitText(markBold(text), footFont, footW, 1, footMeasure) : void 0, sourceLines = (text) => sourceFit(text)?.lines ?? wrapFootnote(markBold(text), footFont, footW, footMeasure), noteLines = candidates.map((entry) => wrapFootnote(markBold(entry.drawn), footFont, footW, footMeasure)), k = candidates.length;
|
|
3372
3513
|
for (; k > 0; k--) {
|
|
3373
3514
|
let para = sourcePara(k);
|
|
3374
3515
|
if (noteLines.slice(0, k).reduce((sum, lines) => sum + lines.length, 0) + (para ? sourceLines(para).length : 0) <= budget) break;
|
|
@@ -3389,23 +3530,19 @@ function solveFrame(input, occupied) {
|
|
|
3389
3530
|
let footParts = [
|
|
3390
3531
|
...entries.filter((entry) => visible.has(entry)).map((entry) => {
|
|
3391
3532
|
let at = candidates.indexOf(entry);
|
|
3392
|
-
return { text: entry.drawn, kind: "footnote", lines: at >= 0 ? noteLines[at] : wrapFootnote(entry.drawn, footFont, footW,
|
|
3533
|
+
return { text: entry.drawn, kind: "footnote", lines: at >= 0 ? noteLines[at] : wrapFootnote(markBold(entry.drawn), footFont, footW, footMeasure) };
|
|
3393
3534
|
}),
|
|
3394
3535
|
...sourceBlock ? [{ text: sourceBlock, kind: "source" }] : [],
|
|
3395
3536
|
...credit && creditInFrame ? [{ text: `${chartString2(input, "mapCredit")}: ${credit.text}`, kind: "credit" }] : []
|
|
3396
|
-
], footLines = 0, omitted = Array.from({ length: input[COMPACT_OMITTED_NOTES] ?? 0 }, () => ({ n: 0, kind: "note", text: "", inFrame: !1 }));
|
|
3397
|
-
if (liveFooterH =
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
contentW,
|
|
3403
|
-
footLineH,
|
|
3404
|
-
measure
|
|
3405
|
-
) - (placement === "info" ? margin.bottom : 0)) : 0, footParts.length > 0 || liveFooterH > 0) {
|
|
3537
|
+
], footLines = 0, omitted = Array.from({ length: input[COMPACT_OMITTED_NOTES] ?? 0 }, () => ({ n: 0, kind: "note", text: "", inFrame: !1 })), liveParts = (pointer) => footerParts([...noteList, ...omitted], placement, input[LIVE_NOTE_SHOW] ?? input.notes?.show, pointer), liveHeight = (parts) => Math.max(0, htmlFooterHeight(input, parts, sourceText, footFont, contentW, footLineH, footMeasure) - (placement === "info" ? margin.bottom : 0)), withPointer = staticFrame.live && !fullStatic ? liveParts(pointerOn) : void 0;
|
|
3538
|
+
if (liveFooterH = withPointer ? liveHeight(withPointer) : 0, withPointer && liveFooterH > 0 && allQuiet(withPointer.panel)) {
|
|
3539
|
+
let without = liveHeight(liveParts(!1));
|
|
3540
|
+
without < liveFooterH && (liveFooterH = without, frame.notesButtonOff = !0);
|
|
3541
|
+
}
|
|
3542
|
+
if (footParts.length > 0 || liveFooterH > 0) {
|
|
3406
3543
|
frame.footnoteNodeIds = [];
|
|
3407
3544
|
for (let i = footParts.length - 1; i >= 0; i--) {
|
|
3408
|
-
let p = footParts[i], fitted = p.kind === "source" ? sourceFit(p.text) : void 0, lines = p.lines ?? (p.kind === "source" ? sourceLines(p.text) : wrapFootnote(p.text, footFont, footW,
|
|
3545
|
+
let p = footParts[i], fitted = p.kind === "source" ? sourceFit(p.text) : void 0, lines = p.lines ?? (p.kind === "source" ? sourceLines(p.text) : wrapFootnote(p.kind === "credit" ? p.text : markBold(p.text), footFont, footW, footMeasure));
|
|
3409
3546
|
bottomY -= footLineH * lines.length, footLines += lines.length;
|
|
3410
3547
|
let id = nid(p.kind);
|
|
3411
3548
|
nodes.push({
|
|
@@ -3413,8 +3550,8 @@ function solveFrame(input, occupied) {
|
|
|
3413
3550
|
id,
|
|
3414
3551
|
x: footX,
|
|
3415
3552
|
y: bottomY,
|
|
3416
|
-
lines,
|
|
3417
|
-
...fitted?.title ? { title: fitted.title } : {},
|
|
3553
|
+
...splitBoldLines(lines, emphasisWeight(theme), footFont.weight),
|
|
3554
|
+
...fitted?.title ? { title: plainText(fitted.title) } : {},
|
|
3418
3555
|
align: "start",
|
|
3419
3556
|
font: footFont,
|
|
3420
3557
|
ink: { token: p.kind === "footnote" ? input.footnoteInk ?? "inkMuted" : "inkMuted" },
|
|
@@ -3433,11 +3570,16 @@ function solveFrame(input, occupied) {
|
|
|
3433
3570
|
let key = input.eventKey.layout(contentX, contentW);
|
|
3434
3571
|
bottomY -= key.h, pushAll(nodes, key.draw(bottomY, nid)), frame.eventKeyRect = { x: contentX, y: bottomY, w: contentW, h: key.h }, occupied.claim(frame.eventKeyRect, "frame", {}), bottomY -= tokens.gapAxisFootnote;
|
|
3435
3572
|
}
|
|
3436
|
-
let legendGeom, legendBand = 0, rightLegendBottom = 0, plotRight = size.width - margin.right, bandKeys = input.eventKey?.legendYieldsToSeries && (input.legend?.items.length ?? 0) > 0 ? [] : input.eventKey?.legend ?? [], legendInput = bandKeys.length > 0 ? { options: input.legend?.options ?? { position: "top" }, items: [...input.legend?.items ?? [], ...bandKeys] } : input.legend;
|
|
3573
|
+
let legendGeom, legendBand = 0, rightLegendBottom = 0, plotRight = size.width - margin.right, plotLeft = margin.left, bandKeys = input.eventKey?.legendYieldsToSeries && (input.legend?.items.length ?? 0) > 0 ? [] : input.eventKey?.legend ?? [], legendInput = bandKeys.length > 0 ? { options: input.legend?.options ?? { position: "top" }, items: [...input.legend?.items ?? [], ...bandKeys] } : input.legend;
|
|
3437
3574
|
if (legendInput && legendInput.items.length > 0) {
|
|
3438
3575
|
let { options } = legendInput, { items } = dedupeLegendKeys(legendInput.items, (item) => identityAppearance(item, theme));
|
|
3439
3576
|
pushAll(warnings, identityCollisionWarnings(items, theme));
|
|
3440
|
-
let footKey = input.legendFont === "footnote" || input.legendFont === "compact" && theme.type.footnote.size <= secondaryType(theme).size, keyCap = footKey ? 1 / 0 : scaleTextAtFloor(targetTypeSizesPx(input.target ?? DEFAULT_TARGET, "S").axis, input.textScale ?? 1, targetFloorsPx(input.target ?? DEFAULT_TARGET).secondary), keyRole = footKey ? theme.type.footnote : secondaryType(theme), font = withFamily(!hasAuthoredTypeSize(keyRole) && keyRole.size > keyCap ? { ...keyRole, size: keyCap } : keyRole), lineH = Math.max(SWATCH, font.size * (font.lineHeight ?? 1.2)), typeRole = footKey ? "footnote" : "secondary",
|
|
3577
|
+
let footKey = input.legendFont === "footnote" || input.legendFont === "compact" && theme.type.footnote.size <= secondaryType(theme).size, keyCap = footKey ? 1 / 0 : scaleTextAtFloor(targetTypeSizesPx(input.target ?? DEFAULT_TARGET, "S").axis, input.textScale ?? 1, targetFloorsPx(input.target ?? DEFAULT_TARGET).secondary), keyRole = footKey ? theme.type.footnote : secondaryType(theme), font = withFamily(!hasAuthoredTypeSize(keyRole) && keyRole.size > keyCap ? { ...keyRole, size: keyCap } : keyRole), lineH = Math.max(SWATCH, font.size * (font.lineHeight ?? 1.2)), typeRole = footKey ? "footnote" : "secondary", sideWanted = options.position === "right" || options.position === "left", labelBudget = sideWanted ? contentW * 0.45 : contentW, ringH = (it) => it.key === "sizes" ? Math.max(it.ringRow ?? 0, Math.ceil(2 * Math.max(0.5, ...it.radii ?? []))) : 0, maxKeyW = maxOf(items.map((it) => keyWidth(it, Math.max(lineH, ringH(it))))), valueFont = { ...font, weight: emphasisWeight(theme) }, wrapKeys = (budget2) => new Map(items.map((it) => [it, wrapFootnote(
|
|
3578
|
+
it.label,
|
|
3579
|
+
font,
|
|
3580
|
+
Math.max(1, budget2 - maxKeyW - SWATCH_GAP2 - (it.value ? SWATCH_GAP2 + measure(it.value, valueFont).width : 0)),
|
|
3581
|
+
measure
|
|
3582
|
+
)])), wrappedKeys = wrapKeys(labelBudget), keyTextH = (it) => Math.max(1, wrappedKeys.get(it).length) * lineH, textWOf = (it) => Math.max(0, ...wrappedKeys.get(it).map((line) => measure(line, font).width)), itemTextW = (it) => textWOf(it) + (it.value ? SWATCH_GAP2 + measure(it.value, valueFont).width : 0), valueNode = (it, lbId, x, y) => ({
|
|
3441
3583
|
t: "text",
|
|
3442
3584
|
id: `${lbId}:value`,
|
|
3443
3585
|
x: x + textWOf(it) + SWATCH_GAP2,
|
|
@@ -3449,9 +3591,19 @@ function solveFrame(input, occupied) {
|
|
|
3449
3591
|
ink: { token: "ink" },
|
|
3450
3592
|
owner: { seriesId: it.id },
|
|
3451
3593
|
part: "legendValue"
|
|
3452
|
-
}), keyNodes = (it, id, x, y, height2) => legendKeyNodes(theme, it, id, x, y, height2, font).map((node) => node.t === "text" ? { ...node, typeRole } : node), capMidBelowTop = font.size * TEXT_ASCENT2 - (measure.capHeight?.(font) ?? font.size * 0.72) / 2, keyTopAt = (textTop, height2) => textTop + capMidBelowTop - height2 / 2, onLabelLine = (keys, textTop) => keys.map((node) => node.t === "text" && node.part === "swatch" ? { ...node, y: textTop } : node);
|
|
3453
|
-
if (
|
|
3454
|
-
let
|
|
3594
|
+
}), keyNodes = (it, id, x, y, height2) => legendKeyNodes(theme, it, id, x, y, height2, font).map((node) => node.t === "text" ? { ...node, typeRole } : node), capMidBelowTop = font.size * TEXT_ASCENT2 - (measure.capHeight?.(font) ?? font.size * 0.72) / 2, keyTopAt = (textTop, height2) => textTop + capMidBelowTop - height2 / 2, onLabelLine = (keys, textTop) => keys.map((node) => node.t === "text" && node.part === "swatch" ? { ...node, y: textTop } : node), sideKeyW = maxOf(items.map((it) => keyWidth(it, Math.max(lineH, ringH(it))))), sideLegendW = sideKeyW + SWATCH_GAP2 + maxOf(items.map(itemTextW));
|
|
3595
|
+
if (sideWanted && !input.sideKeyFixed) {
|
|
3596
|
+
let columnH = items.reduce((h, it) => h + Math.max(keyTextH(it), ringH(it)) + 4, -4), plotW = size.width - margin.right - margin.left - sideLegendW - 16 - Math.max(0, input.plotInset?.left ?? 0), widthShort = plotW < SIDE_KEY_PLOT_SHARE * size.width;
|
|
3597
|
+
(widthShort || columnH > bottomY - topY) && (warnings.push({
|
|
3598
|
+
code: "legend-side-fallback",
|
|
3599
|
+
severity: "warn",
|
|
3600
|
+
message: widthShort ? `the key stays in the row above the plot: a column beside it would leave the plot ${Math.round(Math.max(0, plotW))} px, under ${Math.round(SIDE_KEY_PLOT_SHARE * 100)}% of the ${Math.round(size.width)} px width` : `the key stays in the row above the plot: its ${Math.round(columnH)} px column is taller than the ${Math.round(Math.max(0, bottomY - topY))} px beside the plot`,
|
|
3601
|
+
suggest: widthShort ? "Give the chart more width, or shorten the series names, to keep the key beside the plot." : "Give the chart more height, or show fewer series, to keep the key beside the plot.",
|
|
3602
|
+
field: ["options", "legend"]
|
|
3603
|
+
}), options = { ...options, position: "top" }, wrappedKeys = wrapKeys(contentW));
|
|
3604
|
+
}
|
|
3605
|
+
if (options.position === "right" || options.position === "left") {
|
|
3606
|
+
let keyW = sideKeyW, legendW = sideLegendW, legendX = options.position === "left" ? contentX : size.width - margin.right - legendW, y = topY, legendItems = [];
|
|
3455
3607
|
for (let it of items) {
|
|
3456
3608
|
let swId = nid("swatch"), lbId = nid("legendLabel"), sideKeyH = Math.max(lineH, ringH(it));
|
|
3457
3609
|
nodes.push(...onLabelLine(keyNodes(it, swId, legendX, keyTopAt(y, sideKeyH), sideKeyH), y)), nodes.push({
|
|
@@ -3469,10 +3621,10 @@ function solveFrame(input, occupied) {
|
|
|
3469
3621
|
}), it.value && nodes.push(valueNode(it, lbId, legendX + keyW + SWATCH_GAP2, y)), it.key !== "heading" && legendItems.push({ id: it.id, swatchNodeId: swId, labelId: lbId }), y += Math.max(keyTextH(it), ringH(it)) + 4;
|
|
3470
3622
|
}
|
|
3471
3623
|
let rect = { x: legendX, y: topY, w: legendW, h: y - topY - 4 };
|
|
3472
|
-
rightLegendBottom = y - 4, occupied.claim(rect, "legend", {}), legendGeom = { rect, items: legendItems }, plotRight = legendX - 16, warnings.push({
|
|
3624
|
+
rightLegendBottom = y - 4, occupied.claim(rect, "legend", {}), legendGeom = { rect, items: legendItems }, options.position === "left" ? plotLeft = legendX + legendW + 16 : plotRight = legendX - 16, warnings.push({
|
|
3473
3625
|
code: "legend-beside-plot",
|
|
3474
3626
|
severity: "info",
|
|
3475
|
-
message: `the key stands beside the plot and takes ${Math.round(
|
|
3627
|
+
message: `the key stands beside the plot and takes ${Math.round(legendW + 16)} px of its width; 'top' keeps the plot full width`
|
|
3476
3628
|
});
|
|
3477
3629
|
} else {
|
|
3478
3630
|
let keyH = lineH, titles = /* @__PURE__ */ new Map(), plainRowH = Math.max(tokens.legendRowH, lineH, maxOf(items.map(ringH))) + (input.cardGaps ? 4 : 0), budget2 = input[LEGEND_HEIGHT], available = budget2?.height === "auto" ? size.height * furnitureBudget(size.width) - (size.height - bottomY + topY) - tokens.gapLegend : budget2?.height ?? 1 / 0, fullBlockH;
|
|
@@ -3551,9 +3703,9 @@ function solveFrame(input, occupied) {
|
|
|
3551
3703
|
}
|
|
3552
3704
|
}
|
|
3553
3705
|
let plotInsetLeft = Math.max(0, input.plotInset?.left ?? 0), plot = {
|
|
3554
|
-
x:
|
|
3706
|
+
x: plotLeft + plotInsetLeft,
|
|
3555
3707
|
y: topY,
|
|
3556
|
-
w: Math.max(10, plotRight -
|
|
3708
|
+
w: Math.max(10, plotRight - plotLeft - plotInsetLeft),
|
|
3557
3709
|
h: Math.max(MIN_PLOT_H, bottomY - topY)
|
|
3558
3710
|
}, height = bottomY - topY >= MIN_PLOT_H && rightLegendBottom === 0 && !input.eventKey ? input.autoHeight?.(plot) : void 0, dy = height === void 0 ? 0 : height - size.height, moved = /* @__PURE__ */ new Map(), legendY = legendGeom?.rect.y;
|
|
3559
3711
|
if (dy !== 0) {
|
|
@@ -3569,11 +3721,157 @@ function solveFrame(input, occupied) {
|
|
|
3569
3721
|
return frame.minHeight = size.height + deficit, warnings.length > 0 && (frame.warnings = warnings), { plot, nodes, frame, legend: legendGeom, ...deficit > 0 ? { deficit } : {}, ...legendBand > 0 ? { legendBand } : {} };
|
|
3570
3722
|
}
|
|
3571
3723
|
|
|
3724
|
+
// src/core/dateFormatRead.ts
|
|
3725
|
+
var readCache = /* @__PURE__ */ new Map(), TABLE_DEFAULT = "d MMM yyyy", DATE_TOKENS = /yyyy|YYYY|yy|YY|MMMMM|MMMM|mmmm|MMM|mmm|MM|mm|M|m|dddd|ddd|dd|DD|d|D|QQQ|QQ|Q|ww|w/g, TIME_TOKENS = /yyyy|YYYY|yy|YY|MMMM|mmmm|MMM|mmm|MM|mm|M|m|dddd|ddd|dd|DD|d|D|QQQ|QQ|Q|HH|H|hh|h|ss|SSS|a/g, SEPARATOR = /^[ ./,–-]+$/, ALIASES = { YYYY: "yyyy", YY: "yy", D: "d", DD: "dd", mmm: "MMM", mmmm: "MMMM" };
|
|
3726
|
+
function readPattern(text, context) {
|
|
3727
|
+
let parts = text.match(/'[^']*'|[A-Za-z]+|'|[^'A-Za-z]+/g) ?? [];
|
|
3728
|
+
if (!parts.length || parts.join("") !== text) return;
|
|
3729
|
+
let tokens = [];
|
|
3730
|
+
for (let part of parts) {
|
|
3731
|
+
if (part.startsWith("'")) {
|
|
3732
|
+
tokens.push(part);
|
|
3733
|
+
continue;
|
|
3734
|
+
}
|
|
3735
|
+
if (/\d/.test(part)) return;
|
|
3736
|
+
if (!/[A-Za-z]/.test(part)) {
|
|
3737
|
+
tokens.push(part);
|
|
3738
|
+
continue;
|
|
3739
|
+
}
|
|
3740
|
+
let run = part.match(context === "table" ? DATE_TOKENS : TIME_TOKENS) ?? [];
|
|
3741
|
+
if (run.join("") !== part) return;
|
|
3742
|
+
tokens.push(...run);
|
|
3743
|
+
}
|
|
3744
|
+
let clock = tokens.some((token) => /^(?:HH|H|hh|h|ss)$/.test(token)), date = tokens.some((token) => /^(?:y|Y|d|D|M|Q|w|mmm)/.test(token)), result = [];
|
|
3745
|
+
for (let token of tokens)
|
|
3746
|
+
if (token === "m" || token === "mm")
|
|
3747
|
+
if (!clock && date) result.push(token === "m" ? "M" : "MM");
|
|
3748
|
+
else if (context === "time" && token === "mm") result.push(token);
|
|
3749
|
+
else return;
|
|
3750
|
+
else
|
|
3751
|
+
result.push(ALIASES[token] ?? token);
|
|
3752
|
+
return result.join("");
|
|
3753
|
+
}
|
|
3754
|
+
var fiscalNote = () => ({
|
|
3755
|
+
kind: "fiscal",
|
|
3756
|
+
message: "The fiscal year is read as the calendar year. A fiscal year that starts in another month is not supported."
|
|
3757
|
+
}), exampleNamesCache = /* @__PURE__ */ new Map();
|
|
3758
|
+
function exampleNames(language) {
|
|
3759
|
+
let cached = exampleNamesCache.get(language);
|
|
3760
|
+
if (cached) return cached;
|
|
3761
|
+
let names = /* @__PURE__ */ new Map(), add = (word, name) => {
|
|
3762
|
+
names.get(word)?.month !== void 0 && name.month === void 0 || names.set(word, name);
|
|
3763
|
+
};
|
|
3764
|
+
for (let set of [dateNames("en"), dateNames(language)])
|
|
3765
|
+
for (let [full, short, longToken, shortToken] of [
|
|
3766
|
+
[set.months, set.monthsShort, "MMMM", "MMM"],
|
|
3767
|
+
[set.days, set.daysShort, "dddd", "ddd"]
|
|
3768
|
+
])
|
|
3769
|
+
full.forEach((name, index) => {
|
|
3770
|
+
let month = longToken === "MMMM" ? index + 1 : void 0, weekday = longToken === "dddd" ? index : void 0, abbreviation = name.slice(0, 3).toLowerCase();
|
|
3771
|
+
names.has(abbreviation) || add(abbreviation, { token: shortToken, month, weekday }), add(name.toLowerCase(), { token: longToken, month, weekday });
|
|
3772
|
+
}), short.forEach((name, index) => add(name.replace(/\.$/, "").toLowerCase(), {
|
|
3773
|
+
token: shortToken,
|
|
3774
|
+
month: longToken === "MMMM" ? index + 1 : void 0,
|
|
3775
|
+
weekday: longToken === "dddd" ? index : void 0
|
|
3776
|
+
}));
|
|
3777
|
+
return exampleNamesCache.size >= 200 && exampleNamesCache.clear(), exampleNamesCache.set(language, names), names;
|
|
3778
|
+
}
|
|
3779
|
+
function readExample(text, language) {
|
|
3780
|
+
let fiscal = /^FY([ -]?)(\d{4}|\d{2})$/i.exec(text);
|
|
3781
|
+
if (fiscal) return { pattern: `'FY'${fiscal[1]}${fiscal[2].length === 4 ? "yyyy" : "yy"}`, notes: [fiscalNote()] };
|
|
3782
|
+
let quarter = /^(Q|Quarter) *([1-4])(?:([ ./,–-]+)(\d{4}|\d{2}))?$/i.exec(text);
|
|
3783
|
+
if (quarter) return {
|
|
3784
|
+
pattern: `${quarter[1].toLowerCase() === "q" ? "QQ" : "QQQ"}${quarter[4] ? quarter[3] + (quarter[4].length === 4 ? "yyyy" : "yy") : ""}`,
|
|
3785
|
+
notes: []
|
|
3786
|
+
};
|
|
3787
|
+
let parts = text.match(/[\p{L}]+|\d+|[ ./,–-]+/gu) ?? [];
|
|
3788
|
+
if (!parts.length || parts.join("") !== text) return;
|
|
3789
|
+
let names = exampleNames(language), localized = dateNames(language), fields = [], pattern = [...parts];
|
|
3790
|
+
for (let [index, part] of parts.entries()) {
|
|
3791
|
+
if (SEPARATOR.test(part)) continue;
|
|
3792
|
+
let name = names.get(part.toLowerCase());
|
|
3793
|
+
if (!/^\d+$/.test(part) && !name) return;
|
|
3794
|
+
fields.push({ index, text: part, name }), name && (pattern[index] = name.token, (name.token === "MMM" ? localized.monthsShort[name.month - 1] : name.token === "ddd" ? localized.daysShort[name.weekday] : void 0)?.endsWith(".") && parts[index + 1]?.startsWith(".") && (pattern[index + 1] = parts[index + 1].slice(1)));
|
|
3795
|
+
}
|
|
3796
|
+
let months = fields.filter((field) => field.name?.month !== void 0), weekdays = fields.filter((field) => field.name && field.name.month === void 0), numbers = fields.filter((field) => !field.name);
|
|
3797
|
+
if (months.length > 1 || weekdays.length > 1) return;
|
|
3798
|
+
let notes = [];
|
|
3799
|
+
if (months.length) {
|
|
3800
|
+
let month = months[0], years = numbers.filter((field) => field.text.length === 4), short = numbers.filter((field) => field.text.length <= 2);
|
|
3801
|
+
if (years.length > 1 || short.length > 2 || years.length + short.length !== numbers.length) return;
|
|
3802
|
+
years[0] && (pattern[years[0].index] = "yyyy");
|
|
3803
|
+
let dayToken = (field) => field.text.startsWith("0") ? "dd" : "d", validDay = (field) => +field.text >= 1 && +field.text <= 31;
|
|
3804
|
+
if (years.length) {
|
|
3805
|
+
if (short.length > 1 || short[0] && !validDay(short[0])) return;
|
|
3806
|
+
short[0] && (pattern[short[0].index] = dayToken(short[0]));
|
|
3807
|
+
} else if (short.length === 2) {
|
|
3808
|
+
let [first, second] = short;
|
|
3809
|
+
if (first.index > month.index || second.index < month.index || !validDay(first)) return;
|
|
3810
|
+
pattern[first.index] = dayToken(first), pattern[second.index] = "yy";
|
|
3811
|
+
} else if (short[0]) {
|
|
3812
|
+
let field = short[0];
|
|
3813
|
+
if (field.index < month.index || weekdays.length) {
|
|
3814
|
+
if (!validDay(field)) return;
|
|
3815
|
+
pattern[field.index] = dayToken(field);
|
|
3816
|
+
} else {
|
|
3817
|
+
pattern[field.index] = "yy";
|
|
3818
|
+
let between = parts.slice(month.index + 1, field.index).join("");
|
|
3819
|
+
+field.text <= 31 && /[ ,]/.test(between) && notes.push({
|
|
3820
|
+
kind: "ambiguous",
|
|
3821
|
+
message: `Read '${text}' as month/year. '${field.text}' is the year.`,
|
|
3822
|
+
suggest: "Use 'MMM d' for month and day, or write a four-digit year."
|
|
3823
|
+
});
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3826
|
+
} else if (numbers.length === 1 && numbers[0].text.length === 4)
|
|
3827
|
+
pattern[numbers[0].index] = "yyyy";
|
|
3828
|
+
else if (numbers.length === 2) {
|
|
3829
|
+
let year = numbers.find((field) => field.text.length === 4), month = numbers.find((field) => field !== year);
|
|
3830
|
+
if (!year || !month || month.text.length > 2 || +month.text < 1 || +month.text > 12) return;
|
|
3831
|
+
pattern[year.index] = "yyyy", pattern[month.index] = month.text.length === 2 ? "MM" : "M";
|
|
3832
|
+
} else if (numbers.length === 3) {
|
|
3833
|
+
let year = numbers[0].text.length === 4 ? numbers[0] : numbers[2];
|
|
3834
|
+
if (year.text.length !== 4 && year.text.length !== 2) return;
|
|
3835
|
+
let pair = numbers.filter((field) => field !== year);
|
|
3836
|
+
if (pair.some((field) => field.text.length > 2 || +field.text < 1 || +field.text > 31)) return;
|
|
3837
|
+
let first = pair[0], second = pair[1], yearFirst = year === numbers[0], monthFirst = yearFirst || +second.text > 12, day = monthFirst ? second : first, month = monthFirst ? first : second;
|
|
3838
|
+
if (+month.text > 12) return;
|
|
3839
|
+
let padded = pair.some((field) => field.text.startsWith("0")) || pair.every((field) => field.text.length === 2);
|
|
3840
|
+
pattern[year.index] = year.text.length === 4 ? "yyyy" : "yy", pattern[day.index] = padded ? "dd" : "d", pattern[month.index] = padded ? "MM" : "M", !yearFirst && pair.every((field) => +field.text <= 12) && notes.push({
|
|
3841
|
+
kind: "ambiguous",
|
|
3842
|
+
message: `Read '${text}' as day/month/year, ${+day.text} ${dateNames("en").months[+month.text - 1]} ${year.text}.`,
|
|
3843
|
+
suggest: "Write a day above 12, or use the pattern 'MM/dd/yyyy' for month/day/year."
|
|
3844
|
+
});
|
|
3845
|
+
} else if (numbers.length || !fields.length) return;
|
|
3846
|
+
return { pattern: pattern.join(""), notes };
|
|
3847
|
+
}
|
|
3848
|
+
function parseDateFormat(text, context, language) {
|
|
3849
|
+
let fallback = context === "table" ? TABLE_DEFAULT : void 0;
|
|
3850
|
+
if (text === void 0) return { pattern: fallback, notes: [] };
|
|
3851
|
+
let pattern = readPattern(text, context);
|
|
3852
|
+
if (pattern !== void 0) return { pattern, notes: /'FY'\s*(?:yyyy|yy)/i.test(pattern) ? [fiscalNote()] : [] };
|
|
3853
|
+
let example = readExample(text, language);
|
|
3854
|
+
return example || {
|
|
3855
|
+
pattern: fallback,
|
|
3856
|
+
notes: [{
|
|
3857
|
+
kind: "unknown",
|
|
3858
|
+
message: `Date format '${text}' was not read. ${context === "table" ? "The default 'd MMM yyyy' is used." : "The default ticks are used."}`,
|
|
3859
|
+
suggest: "Write an example such as '30 Sep 2026' or a pattern such as 'dd.MM.yyyy'. Quote literal words with single quotes."
|
|
3860
|
+
}]
|
|
3861
|
+
};
|
|
3862
|
+
}
|
|
3863
|
+
function readDateFormat(text, context, language) {
|
|
3864
|
+
let key = `${context}|${language ?? ""}|${text}`, cached = readCache.get(key);
|
|
3865
|
+
if (cached) return cached;
|
|
3866
|
+
let result = parseDateFormat(text, context, language);
|
|
3867
|
+
return readCache.size >= 200 && readCache.clear(), readCache.set(key, result), result;
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3572
3870
|
// src/core/dateFormat.ts
|
|
3573
3871
|
function isoWeek(date) {
|
|
3574
|
-
let d =
|
|
3872
|
+
let d = utcDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()), dayNum = d.getUTCDay() || 7;
|
|
3575
3873
|
d.setUTCDate(d.getUTCDate() + 4 - dayNum);
|
|
3576
|
-
let yearStart =
|
|
3874
|
+
let yearStart = utcDate(d.getUTCFullYear(), 0, 1);
|
|
3577
3875
|
return Math.ceil(((d.getTime() - yearStart.getTime()) / 864e5 + 1) / 7);
|
|
3578
3876
|
}
|
|
3579
3877
|
function quarterOf(date) {
|
|
@@ -3689,8 +3987,8 @@ function dateTickKeepCalendar(dates, interval) {
|
|
|
3689
3987
|
for (let i = 1; i < parsed.length; i++) gap = Math.min(gap, (parsed[i].getTime() - parsed[i - 1].getTime()) / 864e5);
|
|
3690
3988
|
return (first.getTime() - start.getTime()) / 864e5 > gap && (keep[0] = !1), keep;
|
|
3691
3989
|
}
|
|
3692
|
-
function datePatternFromExample(example) {
|
|
3693
|
-
return
|
|
3990
|
+
function datePatternFromExample(example, language) {
|
|
3991
|
+
return readDateFormat(example, "table", language).pattern;
|
|
3694
3992
|
}
|
|
3695
3993
|
|
|
3696
3994
|
export {
|
|
@@ -3709,6 +4007,9 @@ export {
|
|
|
3709
4007
|
unionRect,
|
|
3710
4008
|
clamp,
|
|
3711
4009
|
round2,
|
|
4010
|
+
cleanFloat,
|
|
4011
|
+
cleanSum,
|
|
4012
|
+
cleanDiff,
|
|
3712
4013
|
strokeBoxPad,
|
|
3713
4014
|
rowLabelX,
|
|
3714
4015
|
chartString2 as chartString,
|
|
@@ -3730,6 +4031,7 @@ export {
|
|
|
3730
4031
|
needsSeriesKey,
|
|
3731
4032
|
scatterGroupIdentities,
|
|
3732
4033
|
scatterGroupNameIsDrawn,
|
|
4034
|
+
COLLECT_IDENTITIES,
|
|
3733
4035
|
collectSeriesIdentities,
|
|
3734
4036
|
textNames,
|
|
3735
4037
|
nameIsDrawn,
|
|
@@ -3773,6 +4075,8 @@ export {
|
|
|
3773
4075
|
LAST_RESORT_PENALTY,
|
|
3774
4076
|
isOwnMark,
|
|
3775
4077
|
leaderTerminus,
|
|
4078
|
+
leaderFor,
|
|
4079
|
+
leaderHeightOf,
|
|
3776
4080
|
seatLeader,
|
|
3777
4081
|
partialPattern,
|
|
3778
4082
|
partialFootnotes,
|
|
@@ -3797,6 +4101,9 @@ export {
|
|
|
3797
4101
|
assertEmbeddedImage,
|
|
3798
4102
|
arrowSeats,
|
|
3799
4103
|
finishCalloutHeads,
|
|
4104
|
+
anchorValueBox,
|
|
4105
|
+
valueEdgeToward,
|
|
4106
|
+
leaderCrossesLabel,
|
|
3800
4107
|
leadersOffAnchorValues,
|
|
3801
4108
|
SWATCH_RESERVE,
|
|
3802
4109
|
groundEdges,
|
|
@@ -3813,6 +4120,7 @@ export {
|
|
|
3813
4120
|
legendRequired,
|
|
3814
4121
|
legendOff,
|
|
3815
4122
|
normalizeLegendOption,
|
|
4123
|
+
SIDE_KEY_PLOT_SHARE,
|
|
3816
4124
|
COMPACT_SOURCE_LINES,
|
|
3817
4125
|
LEGEND_HEIGHT,
|
|
3818
4126
|
authoredNotes,
|
|
@@ -3860,12 +4168,16 @@ export {
|
|
|
3860
4168
|
hiddenNoteWith,
|
|
3861
4169
|
markNotedLabels,
|
|
3862
4170
|
unitMissing,
|
|
4171
|
+
isPercentUnit,
|
|
4172
|
+
columnSegmentsPrintAbsolute,
|
|
4173
|
+
shareUnitOptions,
|
|
3863
4174
|
shareUnitLints,
|
|
3864
4175
|
textCarriesUnit,
|
|
3865
4176
|
textCarriesCohortUnit,
|
|
3866
4177
|
stringsIn,
|
|
3867
4178
|
subtitleLine,
|
|
3868
4179
|
solveFrame,
|
|
4180
|
+
readDateFormat,
|
|
3869
4181
|
formatDate,
|
|
3870
4182
|
DATE_TICK_STRIDES,
|
|
3871
4183
|
dateTickOrdinals,
|