boardplot 0.56.0 → 0.58.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 +408 -0
- package/README.md +49 -15
- package/dist/{DiagnosticDetails-JFBBXOT2.js → DiagnosticDetails-VGSL4NJK.js} +1 -1
- package/dist/{ReaderBox-GLCKYXBU.js → ReaderBox-MHMXIDAJ.js} +8 -7
- package/dist/{annotateEngine-QVNAE3EH.js → annotateEngine-753KQBNN.js} +2 -1
- package/dist/build-identity.json +3 -3
- package/dist/{chunk-HZUAEMN5.js → chunk-2CQBBN7M.js} +4 -4
- package/dist/{chunk-K3VZ5QJK.js → chunk-2ETK5TSA.js} +4 -4
- package/dist/{chunk-HHXIVFAU.js → chunk-2ETSI2EL.js} +11 -9
- package/dist/{chunk-ECBUFKCP.js → chunk-2GRXHWRH.js} +3 -3
- package/dist/{chunk-ZVM5TFGR.js → chunk-2HII2B6S.js} +6 -2
- package/dist/{chunk-WBETBGSC.js → chunk-2LC2H3ZM.js} +1003 -907
- package/dist/chunk-2NX7EO7H.js +23 -0
- package/dist/{chunk-52WNCUIN.js → chunk-2QI2PK2O.js} +1 -1
- package/dist/{chunk-QWCLWFKC.js → chunk-2VKQQLP7.js} +180 -58
- package/dist/chunk-3DOVXJ6K.js +602 -0
- package/dist/{chunk-CAJ54IEP.js → chunk-3E6NLODZ.js} +1 -1
- package/dist/{chunk-MOS6WFWM.js → chunk-3HA4IJTO.js} +9 -9
- package/dist/{chunk-JCIXYOND.js → chunk-3HPPTQEW.js} +4 -4
- package/dist/{chunk-7VVHTOE7.js → chunk-3KT2647F.js} +4 -2
- package/dist/{chunk-O6ZTIDWB.js → chunk-3MFVJMP6.js} +3 -2
- package/dist/{chunk-KQCKK3LD.js → chunk-3P3FKPFN.js} +170 -73
- package/dist/{chunk-WI5VOSQX.js → chunk-3XAJSMYD.js} +2 -2
- package/dist/{chunk-CPGASWNN.js → chunk-42QKUSHJ.js} +13 -3
- package/dist/{chunk-QB5HV4IY.js → chunk-44JU3VOT.js} +7 -8
- package/dist/{chunk-BYCJ6TKI.js → chunk-44K75CYE.js} +3 -3
- package/dist/{chunk-MS7O3KDJ.js → chunk-4FNM4D57.js} +6 -6
- package/dist/{chunk-BVYIKLQ5.js → chunk-4ROZ4TFL.js} +1 -1
- package/dist/{chunk-3V62N3Z7.js → chunk-4VV3KUFT.js} +7 -8
- package/dist/{chunk-MAFPVR4G.js → chunk-54YO56IK.js} +10 -5
- package/dist/{chunk-JMGB444D.js → chunk-5ACFYNA4.js} +8 -4
- package/dist/{chunk-6AMN7IKJ.js → chunk-5JEU6MWC.js} +49 -28
- package/dist/{chunk-NCLRZQR6.js → chunk-5JIB4VJA.js} +18 -10
- package/dist/{chunk-SXD3OYAR.js → chunk-5OP3E2ZD.js} +205 -96
- package/dist/{chunk-SS4YGK3E.js → chunk-5SLBD4BT.js} +72 -304
- package/dist/{chunk-XMP2DNLI.js → chunk-5SVGTQTW.js} +4 -4
- package/dist/chunk-5U567TYU.js +23 -0
- package/dist/chunk-5ZLF4S7X.js +40 -0
- package/dist/{chunk-T2YDWT54.js → chunk-5ZMTQATF.js} +261 -147
- package/dist/{chunk-WXJ5MHLH.js → chunk-62BDQTO6.js} +2 -2
- package/dist/chunk-64K3V4VN.js +25 -0
- package/dist/{chunk-BK6P6KMW.js → chunk-67YJJJIB.js} +1 -1
- package/dist/{chunk-32LLDRPI.js → chunk-6DJNFT2K.js} +42 -32
- package/dist/{chunk-JYAZPMSA.js → chunk-6IUK6PAH.js} +7 -6
- package/dist/{chunk-7STMIK2X.js → chunk-6JFQCVNN.js} +4 -4
- package/dist/chunk-6JXBLQJ2.js +32 -0
- package/dist/{chunk-5TWY3ZIC.js → chunk-6XPV6M3Q.js} +5 -5
- package/dist/{chunk-MPO5TVGF.js → chunk-6ZDSEITW.js} +3 -3
- package/dist/{chunk-75WIUG2W.js → chunk-72HVDLMT.js} +172 -78
- package/dist/chunk-75NU5RLX.js +24 -0
- package/dist/chunk-76GPN6AT.js +72 -0
- package/dist/chunk-7BQK2UDV.js +13 -0
- package/dist/{chunk-CF4NMRN7.js → chunk-7CAYRPJV.js} +45 -25
- package/dist/{chunk-U3A6FMSI.js → chunk-7GWWBHVQ.js} +7 -7
- package/dist/{chunk-CHAS5A5B.js → chunk-7NYUFMLJ.js} +149 -86
- package/dist/{chunk-D2B3KP35.js → chunk-7VWXXBTC.js} +4 -0
- package/dist/chunk-A65B23JK.js +113 -0
- package/dist/{chunk-4KMZAK6J.js → chunk-A7R6FUS6.js} +4 -4
- package/dist/{chunk-E2ZUBP4Q.js → chunk-AEVGUOPB.js} +7 -8
- package/dist/chunk-AHIK2N72.js +53 -0
- package/dist/{chunk-KLB2QC24.js → chunk-AICO24HJ.js} +5 -2
- package/dist/{chunk-7KSUMFBK.js → chunk-AJGSCVVW.js} +5 -1
- package/dist/{chunk-RSCRIWAH.js → chunk-AL62JJTB.js} +10 -3
- package/dist/{chunk-E7V3OHQQ.js → chunk-AN2V2LC4.js} +37 -22
- package/dist/{chunk-JIEVDGAF.js → chunk-AOFUA5XP.js} +1 -1
- package/dist/chunk-B5A7X2BA.js +44 -0
- package/dist/{chunk-2HTYGMMG.js → chunk-BCMEGJRX.js} +2 -2
- package/dist/{chunk-KD5GOR2K.js → chunk-BDIKWR45.js} +124 -69
- package/dist/{chunk-FNRPQIQE.js → chunk-BG6AIWAK.js} +4 -6
- package/dist/{chunk-ZMPH2OC4.js → chunk-BOT6W3VB.js} +7 -8
- package/dist/{chunk-DRHQG44U.js → chunk-BQBD6Q5J.js} +6 -2
- package/dist/{chunk-2DOEZ5QY.js → chunk-BZ67BJBH.js} +11 -10
- package/dist/{chunk-UBCVBBJJ.js → chunk-C47POAC5.js} +4 -3
- package/dist/{chunk-O7REHICC.js → chunk-C5OBPO4Z.js} +36 -28
- package/dist/{chunk-IGNBQT23.js → chunk-CCAAI56H.js} +121 -10
- package/dist/{chunk-RPIKNMZA.js → chunk-CDUR3KWV.js} +7 -2
- package/dist/{chunk-MZACASZY.js → chunk-CMPHT2LS.js} +14 -2
- package/dist/{chunk-FHA3KMFC.js → chunk-CQBPNE7Z.js} +5 -1
- package/dist/{chunk-IVRYF7QA.js → chunk-CR5FP5SF.js} +1 -1
- package/dist/{chunk-DD6RVD3S.js → chunk-D2TQX7UJ.js} +5 -1
- package/dist/{chunk-VVXKFU72.js → chunk-DEANHDXU.js} +62 -41
- package/dist/{chunk-GM3EGUYW.js → chunk-DHGE46UK.js} +1 -1
- package/dist/{chunk-UZTQUPTB.js → chunk-DIHX6NUB.js} +5 -5
- package/dist/{chunk-MD6DCQMA.js → chunk-DILQ34NW.js} +37 -37
- package/dist/{chunk-YMTXTQCN.js → chunk-DJKRYJP7.js} +6 -6
- package/dist/{chunk-JCAGVAB3.js → chunk-DKLC6QLF.js} +1200 -21
- package/dist/{chunk-SRAV6FPB.js → chunk-DNHTMCUP.js} +3 -3
- package/dist/{chunk-CKGSGRP7.js → chunk-DORE2RHL.js} +21 -5
- package/dist/{chunk-SMHZXHHD.js → chunk-DZYTXZNS.js} +15 -5
- package/dist/chunk-E262NRFP.js +39 -0
- package/dist/{chunk-V5JQQMFQ.js → chunk-E5YF236N.js} +4 -1
- package/dist/{chunk-IGJ2G5C6.js → chunk-EBUK7HJP.js} +6 -6
- package/dist/{chunk-ZL6IHMOW.js → chunk-ECBHC272.js} +198 -119
- package/dist/{chunk-SA46CNMS.js → chunk-ED7GLWTF.js} +4 -1
- package/dist/chunk-EFW43JQJ.js +24 -0
- package/dist/{chunk-5P2TTHBZ.js → chunk-EHRRHSPV.js} +2 -2
- package/dist/{chunk-JXBZIJCG.js → chunk-EILNJQMN.js} +32 -12
- package/dist/{chunk-GELSK76Y.js → chunk-ERDKMZ7O.js} +3 -3
- package/dist/{chunk-T2CYNDYU.js → chunk-ETRAPN5G.js} +366 -130
- package/dist/{chunk-JEUL777U.js → chunk-ETUKDEGL.js} +21 -12
- package/dist/chunk-F2ET5ZTT.js +49 -0
- package/dist/{chunk-2YO4WRJN.js → chunk-F3XOBFS4.js} +40 -29
- package/dist/{chunk-SPSGUFTI.js → chunk-FB6X7QHA.js} +1 -1
- package/dist/{chunk-5PPQIF4D.js → chunk-FGW54I23.js} +7 -8
- package/dist/{chunk-JTC5SEAQ.js → chunk-FP5B5XIL.js} +7 -3
- package/dist/{chunk-RJGCYGC3.js → chunk-FRHQGA5Q.js} +86 -250
- package/dist/{chunk-YZZLIYPA.js → chunk-FRR7BJ3B.js} +5 -1
- package/dist/{chunk-4DZFR52I.js → chunk-FVWHEM2N.js} +7 -5
- package/dist/{chunk-YPYD6OJ3.js → chunk-FWSMENKH.js} +2 -2
- package/dist/{chunk-YYJORENB.js → chunk-FWTUGNSF.js} +8 -8
- package/dist/{chunk-GIHH6VC2.js → chunk-FZKDZQ6U.js} +10 -6
- package/dist/{chunk-S7NRL66K.js → chunk-G4FF6G3I.js} +26 -17
- package/dist/{chunk-PQLAZEQV.js → chunk-GB6BZSTL.js} +248 -92
- package/dist/chunk-GCIHRRDJ.js +24 -0
- package/dist/{chunk-X3KCQEYZ.js → chunk-GHCU6OSE.js} +9 -1
- package/dist/chunk-GKDUIDU6.js +138 -0
- package/dist/chunk-GO66OCN7.js +24 -0
- package/dist/chunk-GOFS336W.js +24 -0
- package/dist/{chunk-AGDDH6XY.js → chunk-GQYT7G4F.js} +5 -1
- package/dist/{chunk-WN3HEU3P.js → chunk-GUTLXO7Q.js} +140 -89
- package/dist/chunk-H3VICNTN.js +47 -0
- package/dist/{chunk-GC4WOLV3.js → chunk-HAG3K6PQ.js} +14 -2
- package/dist/{chunk-CB4CERXZ.js → chunk-HBQHSZ6S.js} +11 -2
- package/dist/chunk-HTQGJQZN.js +124 -0
- package/dist/{chunk-F77TMAUY.js → chunk-HUQRO6VF.js} +39 -36
- package/dist/{chunk-4KQHKPB3.js → chunk-I5VDW2XZ.js} +543 -509
- package/dist/{chunk-43GGVT7W.js → chunk-I5VNHDPR.js} +11 -4
- package/dist/{chunk-4LTN7SND.js → chunk-IDXYHDQY.js} +1 -1
- package/dist/{chunk-Y54LU4CU.js → chunk-IIWZJ5ZM.js} +1 -1
- package/dist/{chunk-FMDNJ6PC.js → chunk-IPBOREIY.js} +2 -2
- package/dist/chunk-IU335UO7.js +27 -0
- package/dist/{chunk-JVZTKQFS.js → chunk-IVDTP6SV.js} +9 -5
- package/dist/{chunk-BDGLMWPO.js → chunk-IXOBDDMW.js} +11 -2
- package/dist/{chunk-EIL3KHAL.js → chunk-J4QRB6DQ.js} +5 -5
- package/dist/{chunk-3465633G.js → chunk-JCMGKQVS.js} +3 -3
- package/dist/{chunk-YK2KWNTU.js → chunk-JM7UTLF3.js} +28 -14
- package/dist/{chunk-CXETOLPX.js → chunk-JNDWRV34.js} +4 -4
- package/dist/{chunk-DLUNQHFO.js → chunk-JSRQTDZZ.js} +26 -24
- package/dist/{chunk-WTQAG2OT.js → chunk-JT3UTEWZ.js} +8 -3
- package/dist/{chunk-GQT2SY2S.js → chunk-JUYRDZSV.js} +291 -151
- package/dist/{chunk-LKMFMNQX.js → chunk-JVGL2SCN.js} +1 -1
- package/dist/{chunk-4JC3SE4G.js → chunk-JY4LTPOV.js} +1 -1
- package/dist/chunk-K7XPTQBJ.js +267 -0
- package/dist/{chunk-P4SMC4BY.js → chunk-KGBUXMFP.js} +120 -86
- package/dist/{chunk-XC5IRUEL.js → chunk-KIE5V3DA.js} +2 -2
- package/dist/{chunk-RT66UTLJ.js → chunk-KU4PCG4W.js} +2 -2
- package/dist/{chunk-VPL3JYC6.js → chunk-KVBLTAO7.js} +52 -10
- package/dist/{chunk-XCROSJ2Z.js → chunk-KW4JXWHO.js} +1 -1
- package/dist/{chunk-PJBEJR2U.js → chunk-KWIP5YRA.js} +24 -7
- package/dist/{chunk-JYBT2JNY.js → chunk-LE3LSEUL.js} +27 -2
- package/dist/{chunk-R2IKOLBK.js → chunk-LG6M2JTH.js} +3 -3
- package/dist/{chunk-DF3XEFQ7.js → chunk-LIE2WSB4.js} +21 -18
- package/dist/{chunk-Z55DXFWS.js → chunk-LJDATBPB.js} +26 -16
- package/dist/{chunk-KLIZXSBK.js → chunk-LMMS675D.js} +10 -9
- package/dist/{chunk-MRAP2UVV.js → chunk-LPKGZ664.js} +286 -35
- package/dist/{chunk-JFFREZGT.js → chunk-LPMSGO7L.js} +6 -2
- package/dist/chunk-LQWINE7K.js +211 -0
- package/dist/{chunk-6MJUW5R5.js → chunk-MKMMQDIY.js} +139 -71
- package/dist/{chunk-F5BYLT3M.js → chunk-MQ4IEDM5.js} +462 -138
- package/dist/{chunk-QGFKSDQO.js → chunk-MRM4KJ2O.js} +2 -2
- package/dist/{chunk-ETMHDCEH.js → chunk-MX2OZHIT.js} +102 -42
- package/dist/{chunk-6EYTD777.js → chunk-MXUPMGRY.js} +2 -2
- package/dist/{chunk-2FKEF2AC.js → chunk-NHU26HQ7.js} +58 -35
- package/dist/{chunk-KBJMLXNW.js → chunk-NQVJ4FPY.js} +161 -78
- package/dist/chunk-NZ7FX3AE.js +65 -0
- package/dist/chunk-OALBVELJ.js +23 -0
- package/dist/{chunk-5S3JQ5AT.js → chunk-OGZ4UPYK.js} +183 -137
- package/dist/{chunk-6WHWXCHJ.js → chunk-OMNB27GM.js} +7 -3
- package/dist/{chunk-EGGDPDYJ.js → chunk-OO63YP35.js} +1 -1
- package/dist/{chunk-ZYQYX66L.js → chunk-OPYDTW5Q.js} +6 -6
- package/dist/{chunk-A2GAWGVJ.js → chunk-OSJN7KDS.js} +68 -39
- package/dist/{chunk-RMC4OONA.js → chunk-OSJXIW6I.js} +1030 -1123
- package/dist/{chunk-X23SZHV5.js → chunk-OVVE42P4.js} +6 -6
- package/dist/{chunk-CCJP6QZO.js → chunk-OZA7HA6L.js} +1 -1
- package/dist/chunk-OZLKEBCD.js +54 -0
- package/dist/{chunk-TE4M52AA.js → chunk-P6DEFCMQ.js} +18 -2
- package/dist/{chunk-AMR4SUAN.js → chunk-PDTIQL3B.js} +6 -6
- package/dist/{chunk-BIVL764T.js → chunk-PJ5BYZPN.js} +2 -2
- package/dist/{chunk-BISJK67O.js → chunk-PK7Z7WRJ.js} +98 -46
- package/dist/{chunk-7VMEM3LN.js → chunk-PL6NWB5U.js} +178 -113
- package/dist/chunk-PMT75APP.js +94 -0
- package/dist/chunk-PP6A4X55.js +11 -0
- package/dist/{chunk-I7H5DU34.js → chunk-PPCH3PLO.js} +25 -13
- package/dist/{chunk-BIGQKCU7.js → chunk-PPE6S7WU.js} +42 -24
- package/dist/{chunk-2NSQIPAA.js → chunk-PT7KSIEO.js} +23 -36
- package/dist/{chunk-KZJ5VM6E.js → chunk-PZ3TQFSY.js} +15 -1
- package/dist/{chunk-ZJFJ2IKQ.js → chunk-QAUGRVRU.js} +122 -23
- package/dist/{chunk-BTDGWHGJ.js → chunk-QMFWZG2P.js} +39 -19
- package/dist/{chunk-L6YVK6VC.js → chunk-QZGGCE45.js} +2 -2
- package/dist/{chunk-67QSW5RW.js → chunk-R2RJQ3BM.js} +4 -4
- package/dist/{chunk-ZY72LSQK.js → chunk-R7HBIQ63.js} +102 -61
- package/dist/{chunk-4JHMCXOB.js → chunk-RBNDZLYS.js} +77 -36
- package/dist/chunk-RCSY4CT4.js +2170 -0
- package/dist/{chunk-NGA7ICG4.js → chunk-RDJ3ZU6O.js} +16 -13
- package/dist/{chunk-2NN676RI.js → chunk-RHQRPJHS.js} +7 -8
- package/dist/chunk-RI6XQKWJ.js +26 -0
- package/dist/{chunk-YOOHNQ3L.js → chunk-RJICOOB3.js} +18 -8
- package/dist/{chunk-5DTCOOLU.js → chunk-RLAVNCQJ.js} +2 -2
- package/dist/{chunk-CYKXROFG.js → chunk-ROPPWJQB.js} +23 -12
- package/dist/{chunk-54ROMBU7.js → chunk-SELOV32X.js} +105 -50
- package/dist/{chunk-TUW5IYGA.js → chunk-SQI4NWTQ.js} +9 -9
- package/dist/{chunk-ZEYBI47P.js → chunk-SRJ74CMG.js} +11 -3
- package/dist/{chunk-NHC2ADGI.js → chunk-STWOURLG.js} +253 -144
- package/dist/chunk-SWMFXSVW.js +23 -0
- package/dist/chunk-SXAZDIGM.js +84 -0
- package/dist/{chunk-EMFUZKYK.js → chunk-SZ5VGWDY.js} +3 -3
- package/dist/{chunk-R5MEBBAA.js → chunk-T26G23RS.js} +442 -119
- package/dist/{chunk-QHRE2M6V.js → chunk-T2L5H2WW.js} +4 -3
- package/dist/chunk-T7GPIJ4L.js +89 -0
- package/dist/{chunk-MJPXHCBW.js → chunk-TAEB3RU6.js} +5 -5
- package/dist/{chunk-V7F4F6JA.js → chunk-TBDIMTRD.js} +37 -16
- package/dist/{chunk-63Y3ROZ7.js → chunk-TFFPEWNP.js} +102 -64
- package/dist/{chunk-EZZ533MH.js → chunk-TMEUK2WS.js} +6 -2
- package/dist/{chunk-37PKNVLS.js → chunk-TVOMGNFQ.js} +1 -1
- package/dist/{chunk-HJRNBKIT.js → chunk-TX5FSNAU.js} +436 -30
- package/dist/{chunk-V634AXDM.js → chunk-U52PNFPX.js} +1 -1
- package/dist/{chunk-QLANK3VN.js → chunk-U74AWJ3X.js} +6 -6
- package/dist/chunk-UC7LBW7N.js +26 -0
- package/dist/{chunk-PZ46S2SY.js → chunk-UCKUAKYQ.js} +2 -2
- package/dist/{chunk-KF7HD3EH.js → chunk-UCYL3YA7.js} +77 -55
- package/dist/{chunk-HOU2MZHC.js → chunk-UD2GI3CS.js} +11 -4
- package/dist/{chunk-SNQ7D5R7.js → chunk-UIHGGWES.js} +51 -11
- package/dist/{chunk-LGNJCPFP.js → chunk-ULQIC76A.js} +10 -13
- package/dist/{chunk-KTHFHD6C.js → chunk-UY34DDUM.js} +11 -6
- package/dist/{chunk-6QDMRPXI.js → chunk-UYMFLWM6.js} +215 -258
- package/dist/{chunk-KDSYZLF6.js → chunk-V5IFI3FV.js} +8 -1
- package/dist/{chunk-JTFKRDDA.js → chunk-V7FV66KL.js} +1 -1
- package/dist/{chunk-27OIGDRK.js → chunk-V7NUJEJE.js} +1 -1
- package/dist/{chunk-CCDXK5NA.js → chunk-VESSIKBG.js} +8 -3
- package/dist/{chunk-QSMGZOT5.js → chunk-VRFJAF3R.js} +7 -8
- package/dist/chunk-VS2R3OGN.js +34 -0
- package/dist/{chunk-RLMC5CUP.js → chunk-VS5B4J2D.js} +7 -8
- package/dist/{chunk-7M2GK7XQ.js → chunk-W4R6SGU3.js} +252 -121
- package/dist/{chunk-JKOEHRGV.js → chunk-WDLWWEHZ.js} +1 -1
- package/dist/{chunk-7DAH2E4T.js → chunk-WFBN2HXR.js} +2 -2
- package/dist/{chunk-DLDDRXAI.js → chunk-WJS6SAWA.js} +296 -145
- package/dist/{chunk-WWGPTEQB.js → chunk-WQYNKF33.js} +73 -22
- package/dist/{chunk-64LJDGJH.js → chunk-WUP6C4ZD.js} +4 -2
- package/dist/{chunk-F2EVCJ4U.js → chunk-X24WAHHV.js} +87 -43
- package/dist/{chunk-OJ5CQV7H.js → chunk-X3UCQPVV.js} +209 -96
- package/dist/{chunk-7FKY6YWU.js → chunk-X46PSAJ7.js} +6 -6
- package/dist/{chunk-H3IBJQ5A.js → chunk-XD5XB22R.js} +2 -2
- package/dist/chunk-XDIAQEYK.js +28 -0
- package/dist/{chunk-7PPMT5EJ.js → chunk-XFPNYHX3.js} +372 -105
- package/dist/{chunk-FCECYJVA.js → chunk-XIBVAKCO.js} +1 -1
- package/dist/{chunk-OG2YUVBW.js → chunk-XMX4PCFL.js} +8 -3
- package/dist/{chunk-2NRHD2G7.js → chunk-XRRG4MBM.js} +12 -4
- package/dist/{chunk-FNMH5WEY.js → chunk-XTFO6D4L.js} +1 -1
- package/dist/chunk-XWRI3N5O.js +70 -0
- package/dist/{chunk-ZKJ5L35C.js → chunk-XXPLPSOE.js} +36 -25
- package/dist/{chunk-XQMYQ4TN.js → chunk-XZXZNI7A.js} +1 -1
- package/dist/{chunk-E555EDOQ.js → chunk-YEJZ2OYS.js} +490 -182
- package/dist/chunk-YGZEG3JV.js +123 -0
- package/dist/{chunk-F6OLHND5.js → chunk-Z3WQXVFV.js} +2 -2
- package/dist/{chunk-FFJGC2DX.js → chunk-Z6DUNKFU.js} +173 -40
- package/dist/{chunk-N5HN5QGH.js → chunk-Z6H5ED2I.js} +1 -1
- package/dist/{chunk-7Q37C6GZ.js → chunk-ZBOOMLHD.js} +1 -1
- package/dist/{chunk-MOK3ZS6P.js → chunk-ZDJ7C64T.js} +1 -1
- package/dist/{chunk-GLQ3KCTY.js → chunk-ZGZLEUKM.js} +7 -8
- package/dist/{chunk-YHD2FZFP.js → chunk-ZHRGX225.js} +6 -6
- package/dist/{chunk-76Q7E3TM.js → chunk-ZIVCPXXL.js} +510 -646
- package/dist/{chunk-BSATR6ZO.js → chunk-ZNRSYS76.js} +21 -3
- package/dist/{chunk-DMAMWUYY.js → chunk-ZSLTSCTI.js} +5 -5
- package/dist/{chunk-IGVAWAOK.js → chunk-ZSYFQSPF.js} +43 -9
- package/dist/cli/index.js +8 -3
- package/dist/{core-7Y5BZZON.js → core-43GLGBOY.js} +8 -1
- package/dist/{core-7S3XMW5O.js → core-5GI3ERXO.js} +4 -1
- package/dist/{core-K3JX5WPM.js → core-5L7TMK7I.js} +6 -1
- package/dist/{core-LB5M7XL4.js → core-7TO4OVY5.js} +6 -1
- package/dist/{core-ILPXXC2Z.js → core-BJVENHFQ.js} +7 -1
- package/dist/{core-JDFUZFRH.js → core-BX4MFWKC.js} +6 -1
- package/dist/{core-XW7UJFJZ.js → core-C3KXTOIZ.js} +7 -1
- package/dist/{core-WJNK7F2J.js → core-C5Y6BFLL.js} +7 -1
- package/dist/{core-WZ4CHVYL.js → core-CLUSJ2SK.js} +5 -1
- package/dist/{core-TCSW24N6.js → core-E3IN2VVH.js} +5 -1
- package/dist/{core-MU4ALRR7.js → core-FD67NQOV.js} +6 -1
- package/dist/{core-YMXYUGF5.js → core-FDKMLRAK.js} +5 -1
- package/dist/{core-VKZSQFRG.js → core-FL6Z3VVX.js} +5 -1
- package/dist/{core-5UF44NDI.js → core-JC7JUFPY.js} +8 -1
- package/dist/{core-RR2CAZC5.js → core-JF33TADA.js} +8 -1
- package/dist/{core-4RR6VSXM.js → core-JH32ZAKM.js} +4 -1
- package/dist/{core-G3LXHW73.js → core-JYYZPPQV.js} +7 -1
- package/dist/{core-4HFVG4CP.js → core-KJTKCV4U.js} +4 -1
- package/dist/{core-GSILPKUR.js → core-LCQPE5Y6.js} +8 -1
- package/dist/{core-GLOZY6Z7.js → core-LHVGWE54.js} +6 -1
- package/dist/{core-J2JD5ODO.js → core-OVSNBOCE.js} +9 -1
- package/dist/{core-BLHEJ5OK.js → core-PPEC236B.js} +5 -1
- package/dist/{core-ZLSQHZ3I.js → core-QTJZDK5H.js} +5 -1
- package/dist/{core-TKZZZ6UW.js → core-R3YZCOUZ.js} +7 -1
- package/dist/{core-HTD5RHE7.js → core-RIBW5XU4.js} +7 -1
- package/dist/{core-AR2T32Y3.js → core-RJFILBWL.js} +8 -1
- package/dist/{core-A5AKUB7H.js → core-RWSXEKTE.js} +4 -1
- package/dist/{core-DD62MWEW.js → core-SOPPZLEH.js} +5 -1
- package/dist/{core-HDNWVLJW.js → core-TBUZCXLX.js} +5 -1
- package/dist/{core-BOG33BFD.js → core-TZ5QLTAX.js} +5 -1
- package/dist/{core-H5HO2CED.js → core-U7E5W4MY.js} +3 -1
- package/dist/{core-QPSAYRFT.js → core-UBNVSL44.js} +7 -1
- package/dist/{core-E2XOSHPR.js → core-UDRD4WIU.js} +6 -1
- package/dist/{core-DFZMOO7E.js → core-UVJZ4HY2.js} +7 -1
- package/dist/{core-LGJZUP6H.js → core-X7WWYQH4.js} +8 -1
- package/dist/{core-BBNY2BX4.js → core-XP56X47I.js} +5 -1
- package/dist/{core-3KLQSYWB.js → core-XQG54CYG.js} +6 -1
- package/dist/{dataTable-CNDRVGA5.js → dataTable-U7W4I6IF.js} +15 -2
- package/dist/{engine-FVEIM3WV.js → engine-O5V26MGR.js} +32 -19
- package/dist/fixtures.js +4 -1
- package/dist/flags-BVLSAXT3.js +10 -0
- package/dist/{fontTables-ZPZQ6IR3.js → fontTables-JUW7ZTQY.js} +3 -1
- package/dist/fonts.js +1 -1
- package/dist/geo/dach.js +1 -1
- package/dist/geo/de-states.js +1 -1
- package/dist/geo/eu27.js +1 -1
- package/dist/geo/europe.js +1 -1
- package/dist/geo/index.js +2 -2
- package/dist/geo/us-states.js +1 -1
- package/dist/geo/world.js +1 -1
- package/dist/index.js +41 -22
- package/dist/{main-THU6VIVU.js → main-35GS47XC.js} +68 -123
- package/dist/mcp/server.js +131 -118
- package/dist/react/bar.js +10 -1
- package/dist/react/bartable.js +10 -1
- package/dist/react/box.js +8 -1
- package/dist/react/bullet.js +10 -1
- package/dist/react/butterfly.js +10 -1
- package/dist/react/choropleth.js +10 -1
- package/dist/react/cohort.js +11 -1
- package/dist/react/column.js +10 -1
- package/dist/react/combo.js +10 -1
- package/dist/react/creative.js +11 -1
- package/dist/react/diagram.js +10 -1
- package/dist/react/dimswitch.js +11 -1
- package/dist/react/dot.js +9 -1
- package/dist/react/export.js +36 -18
- package/dist/react/funnel.js +9 -1
- package/dist/react/gantt.js +9 -1
- package/dist/react/grid.js +10 -1
- package/dist/react/heatmap.js +9 -1
- package/dist/react/histogram.js +11 -1
- package/dist/react/index.js +101 -85
- package/dist/react/kpi.js +10 -1
- package/dist/react/likert.js +11 -1
- package/dist/react/line.js +9 -1
- package/dist/react/mekko.js +10 -1
- package/dist/react/pareto.js +11 -1
- package/dist/react/pie.js +9 -1
- package/dist/react/prepare.js +49 -21
- package/dist/react/pvm.js +12 -1
- package/dist/react/pyramid.js +10 -1
- package/dist/react/sankey.js +10 -1
- package/dist/react/scatter.js +8 -1
- package/dist/react/slope.js +10 -1
- package/dist/react/sparkline.js +10 -1
- package/dist/react/spec.js +24 -14
- package/dist/react/status.js +9 -1
- package/dist/react/story.js +5 -2
- package/dist/react/table.js +9 -1
- package/dist/react/theme.js +10 -3
- package/dist/react/tilemap.js +9 -1
- package/dist/react/treemap.js +9 -1
- package/dist/react/variance.js +10 -1
- package/dist/react/waffle.js +9 -1
- package/dist/react/waterfall.js +11 -1
- package/dist/{resvg-VB7S5HRF.js → resvg-ZYEZTSUO.js} +3 -1
- package/dist/rows.js +3 -2
- package/dist/{rowsModule-LI6KOS46.js → rowsModule-H2S6WW4D.js} +2 -1
- package/dist/{schema-CGQID64D.js → schema-2R32F6AW.js} +1 -1
- package/dist/{schema-H2EC4GAQ.js → schema-2TPGJGVR.js} +1 -1
- package/dist/{schema-THXXFY6I.js → schema-47BG2TZA.js} +1 -3
- package/dist/{schema-AMT7P7KB.js → schema-56MOEOVR.js} +1 -1
- package/dist/{schema-GNTKL5DN.js → schema-5MSR4LNN.js} +1 -1
- package/dist/{schema-5ZTGVQAJ.js → schema-5RIYEWE6.js} +1 -1
- package/dist/{schema-LOQ3AFC7.js → schema-A26ZNGTZ.js} +1 -3
- package/dist/{schema-MMVPMJEF.js → schema-ALBF6V7Y.js} +1 -3
- package/dist/{schema-BKUFZLLI.js → schema-BA6WP5YZ.js} +1 -1
- package/dist/{schema-PQZWO3BP.js → schema-CBL2SMVR.js} +1 -3
- package/dist/{schema-BBTXTWYI.js → schema-CWKGLDSR.js} +1 -3
- package/dist/{schema-5KDEQBBT.js → schema-DBIQFL56.js} +1 -1
- package/dist/{schema-KPEPBGAX.js → schema-DL7V6NN2.js} +1 -1
- package/dist/{schema-PL3EU6EQ.js → schema-DUVJMFKQ.js} +4 -2
- package/dist/{schema-L5U4OROI.js → schema-ECJERHKF.js} +2 -1
- package/dist/{schema-YLE4XXQQ.js → schema-EDSEKZDJ.js} +1 -1
- package/dist/{schema-HH5HOORE.js → schema-ESR6ZIK4.js} +1 -3
- package/dist/{schema-5DUTAVO7.js → schema-F7TWGLRZ.js} +1 -3
- package/dist/{schema-B2GCEYXD.js → schema-FGB6IGZM.js} +1 -3
- package/dist/{schema-7NSV542V.js → schema-FKGGTM4Z.js} +2 -1
- package/dist/{schema-72EEMYS3.js → schema-FU2AFIEE.js} +1 -1
- package/dist/{schema-QORUB6EK.js → schema-JNJFCYBM.js} +18 -1
- package/dist/{schema-JH57NFXJ.js → schema-JYZ4RF6S.js} +2 -1
- package/dist/{schema-25INXAMY.js → schema-K7F6TEDK.js} +1 -2
- package/dist/{schema-OU35XA3Z.js → schema-KAK6DZX4.js} +1 -1
- package/dist/{schema-R5Y6NVBH.js → schema-MOKWIGF7.js} +1 -1
- package/dist/{schema-ZQSIR5UC.js → schema-MQT6BMNK.js} +1 -3
- package/dist/{schema-FDFQKIO5.js → schema-MR3BPPQR.js} +1 -1
- package/dist/{schema-VYECMPON.js → schema-OPXZYIW7.js} +1 -3
- package/dist/{schema-ZEVJMFLV.js → schema-PV7JGX5H.js} +1 -1
- package/dist/{schema-QPOBZUAR.js → schema-PWPQF5RC.js} +1 -1
- package/dist/{schema-GN6GAIU5.js → schema-PYQEUC5P.js} +1 -3
- package/dist/{schema-M5JBHQIV.js → schema-QPIC5MAG.js} +9 -2
- package/dist/{schema-QCIE6M2P.js → schema-R42VXFIS.js} +1 -1
- package/dist/{schema-J7TNCZIP.js → schema-TVUJNEX7.js} +1 -1
- package/dist/{schema-AXRDF6ND.js → schema-Y4TI2T3T.js} +1 -1
- package/dist/{schema-ZG6ZKFRZ.js → schema-ZU2EU2VP.js} +1 -1
- package/dist/{specValidation-VHLGDEME.js → specValidation-2NHJT7TQ.js} +4 -1
- package/dist/theme.js +7 -2
- package/dist/{themeShapeRules-PW4BQHKL.js → themeShapeRules-G7UZX6GJ.js} +1 -1
- package/dist/types/core/annotate.d.ts +27 -2
- package/dist/types/core/annotateArms.d.ts +3 -1
- package/dist/types/core/annotateTargets.d.ts +4 -0
- package/dist/types/core/annotationOrigin.d.ts +13 -0
- package/dist/types/core/axis.d.ts +2 -2
- package/dist/types/core/charts/band/stacks.d.ts +7 -1
- package/dist/types/core/charts/bartable/types.d.ts +14 -1
- package/dist/types/core/charts/box/types.d.ts +3 -1
- package/dist/types/core/charts/choropleth/layout.d.ts +1 -5
- package/dist/types/core/charts/choropleth/types.d.ts +19 -0
- package/dist/types/core/charts/cohort/types.d.ts +16 -3
- package/dist/types/core/charts/column/model.d.ts +13 -0
- package/dist/types/core/charts/combo/layout.d.ts +7 -0
- package/dist/types/core/charts/creative/types.d.ts +21 -0
- package/dist/types/core/charts/dimswitch/compile.d.ts +15 -2
- package/dist/types/core/charts/dimswitch/types.d.ts +24 -1
- package/dist/types/core/charts/gantt/calendar.d.ts +24 -0
- package/dist/types/core/charts/gantt/columns.d.ts +56 -0
- package/dist/types/core/charts/gantt/layout.d.ts +8 -2
- package/dist/types/core/charts/gantt/model.d.ts +296 -0
- package/dist/types/core/charts/grid/metricStack.d.ts +9 -0
- package/dist/types/core/charts/grid/metricStackSchema.d.ts +13 -0
- package/dist/types/core/charts/grid/normalize.d.ts +5 -0
- package/dist/types/core/charts/grid/schema.d.ts +2 -2
- package/dist/types/core/charts/histogram/types.d.ts +8 -0
- package/dist/types/core/charts/likert/layout.d.ts +10 -8
- package/dist/types/core/charts/pareto/layout.d.ts +2 -0
- package/dist/types/core/charts/pvm/types.d.ts +10 -1
- package/dist/types/core/charts/pyramid/types.d.ts +3 -1
- package/dist/types/core/charts/sankey/types.d.ts +5 -1
- package/dist/types/core/charts/scatter/clamp.d.ts +2 -1
- package/dist/types/core/charts/scatter/model.d.ts +5 -0
- package/dist/types/core/charts/scatter/valueLines.d.ts +3 -1
- package/dist/types/core/charts/status/layout.d.ts +3 -0
- package/dist/types/core/charts/table/resolve.d.ts +22 -3
- package/dist/types/core/charts/table/view.d.ts +24 -1
- package/dist/types/core/claims/browser.d.ts +2 -0
- package/dist/types/core/claims/ids.d.ts +38 -0
- package/dist/types/core/deferred.d.ts +1 -0
- package/dist/types/core/doc/diagnostics.d.ts +3 -2
- package/dist/types/core/footer.d.ts +2 -0
- package/dist/types/core/formatSpec.d.ts +43 -14
- package/dist/types/core/frame.d.ts +26 -59
- package/dist/types/core/frameText.d.ts +203 -0
- package/dist/types/core/geo/types.d.ts +2 -0
- package/dist/types/core/geometry.d.ts +3 -1
- package/dist/types/core/label/categoryRow.d.ts +19 -2
- package/dist/types/core/label/solver.d.ts +23 -2
- package/dist/types/core/normalize/shared.d.ts +14 -2
- package/dist/types/core/notes.d.ts +15 -2
- package/dist/types/core/reading.d.ts +12 -1
- package/dist/types/core/registry.d.ts +4 -5
- package/dist/types/core/request.d.ts +7 -1
- package/dist/types/core/schema/capability.d.ts +32 -7
- package/dist/types/core/schema/generatedColumns.d.ts +168 -0
- package/dist/types/core/seriesIdentity.d.ts +4 -1
- package/dist/types/core/sizing.d.ts +32 -1
- package/dist/types/core/structureCounts.d.ts +3 -1
- package/dist/types/core/text.d.ts +16 -0
- package/dist/types/core/theme.d.ts +33 -4
- package/dist/types/core/themeGeometry.d.ts +9 -0
- package/dist/types/core/themeRules.d.ts +2 -0
- package/dist/types/core/timeAxis.d.ts +6 -1
- package/dist/types/core/types/annotations.d.ts +74 -4
- package/dist/types/core/types/diagram.d.ts +7 -0
- package/dist/types/core/types/options.d.ts +118 -15
- package/dist/types/core/types/scene.d.ts +30 -2
- package/dist/types/core/types/table.d.ts +27 -3
- package/dist/types/core/types/theme.d.ts +23 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/react/TableChart.d.ts +5 -0
- package/dist/types/react/barrelCharts.d.ts +16 -5
- package/dist/types/react/charts/butterfly.d.ts +2 -2
- package/dist/types/react/charts/dot.d.ts +7 -1
- package/dist/types/react/charts/pareto.d.ts +4 -1
- package/dist/types/react/charts/variance.d.ts +3 -1
- package/dist/types/react/hover/labelCard.d.ts +11 -2
- package/dist/types/react/prepare.d.ts +7 -1
- package/dist/types/theme.d.ts +2 -0
- package/dist/validate.js +23 -6
- package/docs/TELEMETRY.md +2 -2
- package/docs/manual.md +283 -65
- package/docs/reference/bar.md +15 -4
- package/docs/reference/bartable.md +17 -2
- package/docs/reference/box.md +15 -4
- package/docs/reference/bullet.md +21 -6
- package/docs/reference/butterfly.md +17 -6
- package/docs/reference/choropleth.md +16 -5
- package/docs/reference/cohort.md +25 -5
- package/docs/reference/column.md +19 -4
- package/docs/reference/combo.md +11 -5
- package/docs/reference/creative.md +17 -8
- package/docs/reference/diagram.md +6 -1
- package/docs/reference/dimswitch.md +71 -118
- package/docs/reference/dot.md +16 -7
- package/docs/reference/fixtures.md +94 -1
- package/docs/reference/funnel.md +14 -5
- package/docs/reference/gantt.md +17 -16
- package/docs/reference/grid.md +13 -3
- package/docs/reference/heatmap.md +16 -6
- package/docs/reference/histogram.md +2 -2
- package/docs/reference/kpi.md +5 -1
- package/docs/reference/likert.md +17 -4
- package/docs/reference/line.md +18 -5
- package/docs/reference/mekko.md +10 -5
- package/docs/reference/options.md +20 -15
- package/docs/reference/pareto.md +9 -5
- package/docs/reference/pie.md +9 -5
- package/docs/reference/pvm.md +16 -6
- package/docs/reference/pyramid.md +14 -4
- package/docs/reference/react.md +6 -7
- package/docs/reference/sankey.md +7 -3
- package/docs/reference/scatter.md +8 -4
- package/docs/reference/slope.md +15 -5
- package/docs/reference/sparkline.md +1 -1
- package/docs/reference/status.md +7 -1
- package/docs/reference/table.md +41 -110
- package/docs/reference/theme.md +12 -4
- package/docs/reference/tilemap.md +2 -4
- package/docs/reference/treemap.md +1 -1
- package/docs/reference/variance.md +12 -6
- package/docs/reference/waffle.md +1 -1
- package/docs/reference/warnings.md +1077 -0
- package/docs/reference/waterfall.md +20 -5
- package/docs/use-cases.md +25 -13
- package/llms.txt +19 -6
- package/package.json +18 -3
- package/dist/chunk-6364WO5D.js +0 -47
- package/dist/chunk-DQ7YMQVX.js +0 -26
- package/dist/chunk-EBB4PYBN.js +0 -24
- package/dist/chunk-FG5L2LUK.js +0 -89
- package/dist/chunk-IFQN4GKK.js +0 -1852
- package/dist/chunk-IRXVV65V.js +0 -24
- package/dist/chunk-JGFHNAHS.js +0 -22
- package/dist/chunk-JHWYG7V5.js +0 -24
- package/dist/chunk-M4SPKUZE.js +0 -7
- package/dist/chunk-O36WX56O.js +0 -13
- package/dist/chunk-QJWLNP64.js +0 -24
- package/dist/chunk-QZIHKQRH.js +0 -26
- package/dist/chunk-SE7MJ2LQ.js +0 -24
- package/dist/chunk-TXBO2LWM.js +0 -25
- package/dist/chunk-UPTXFTKH.js +0 -25
- package/dist/chunk-UREXN6WG.js +0 -25
- package/dist/chunk-UZLR25BW.js +0 -24
- package/dist/chunk-WIVFIVFZ.js +0 -27
- package/dist/chunk-WZL4EEBS.js +0 -11
- package/dist/chunk-XHRUXZD7.js +0 -28
- package/dist/chunk-ZWNRLIFT.js +0 -24
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMPACT_OMITTED_NOTES,
|
|
3
3
|
LIVE_NOTE_SHOW,
|
|
4
|
+
NOTES_ASKED,
|
|
4
5
|
allQuiet,
|
|
5
6
|
chartNotes,
|
|
6
7
|
copyNote,
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
isQuiet,
|
|
17
18
|
keepNoteMeta,
|
|
18
19
|
liveFooterExtra,
|
|
20
|
+
notesPanelLabel,
|
|
19
21
|
notesPointer,
|
|
20
22
|
recordFreedChrome,
|
|
21
23
|
shownNoteKinds,
|
|
@@ -23,19 +25,22 @@ import {
|
|
|
23
25
|
staticFrame,
|
|
24
26
|
valueNote,
|
|
25
27
|
wrapFootnote
|
|
26
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-DZYTXZNS.js";
|
|
27
29
|
import {
|
|
28
30
|
ENGINE_REV
|
|
29
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MRM4KJ2O.js";
|
|
30
32
|
import {
|
|
31
33
|
dateNames
|
|
32
34
|
} from "./chunk-QBR6IKIX.js";
|
|
35
|
+
import {
|
|
36
|
+
defaultAnnotationId
|
|
37
|
+
} from "./chunk-F2ET5ZTT.js";
|
|
33
38
|
import {
|
|
34
39
|
parseFormatExample,
|
|
35
40
|
parseISODate,
|
|
36
41
|
unitOfSpec,
|
|
37
42
|
utcDate
|
|
38
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-Z6DUNKFU.js";
|
|
39
44
|
import {
|
|
40
45
|
chartString,
|
|
41
46
|
chartStrings,
|
|
@@ -54,7 +59,10 @@ import {
|
|
|
54
59
|
WIDE_CANVAS_MIN_WIDTH,
|
|
55
60
|
arrowHeadPath,
|
|
56
61
|
arrowShaftEnd,
|
|
62
|
+
boxGap,
|
|
57
63
|
bulletBandPaints,
|
|
64
|
+
classStepWidth,
|
|
65
|
+
createOccupiedIndex,
|
|
58
66
|
decideFillEdges,
|
|
59
67
|
effectiveFill,
|
|
60
68
|
emphasisWeight,
|
|
@@ -68,6 +76,7 @@ import {
|
|
|
68
76
|
hatchPatternId,
|
|
69
77
|
hatchStrokeWidthFor,
|
|
70
78
|
hatchTile,
|
|
79
|
+
inflate,
|
|
71
80
|
isHatchPattern,
|
|
72
81
|
labelPlate,
|
|
73
82
|
leaderPath,
|
|
@@ -77,6 +86,8 @@ import {
|
|
|
77
86
|
paintTokenColor,
|
|
78
87
|
panelTypeClass,
|
|
79
88
|
pieRamp,
|
|
89
|
+
rectContains,
|
|
90
|
+
rectsOverlap,
|
|
80
91
|
referenceCasings,
|
|
81
92
|
repaintSeparation,
|
|
82
93
|
resolvePalette,
|
|
@@ -84,6 +95,7 @@ import {
|
|
|
84
95
|
resolveTheme,
|
|
85
96
|
secondaryFont,
|
|
86
97
|
secondaryType,
|
|
98
|
+
segmentHitsRect,
|
|
87
99
|
seriesTextAlone,
|
|
88
100
|
smallestTitleSize,
|
|
89
101
|
solidMutedPlan,
|
|
@@ -91,8 +103,9 @@ import {
|
|
|
91
103
|
strokeToken,
|
|
92
104
|
textScaleOf,
|
|
93
105
|
textSizeOf,
|
|
106
|
+
unionRect,
|
|
94
107
|
visibleTintAmount
|
|
95
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-TX5FSNAU.js";
|
|
96
109
|
import {
|
|
97
110
|
COLOR_FIX,
|
|
98
111
|
FILL_SEPARATION_FLOOR,
|
|
@@ -106,7 +119,10 @@ import {
|
|
|
106
119
|
parseColor,
|
|
107
120
|
pickInk,
|
|
108
121
|
readsAsLoss
|
|
109
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-BQBD6Q5J.js";
|
|
123
|
+
import {
|
|
124
|
+
fmtPathNumber
|
|
125
|
+
} from "./chunk-6IUK6PAH.js";
|
|
110
126
|
import {
|
|
111
127
|
DEFAULT_TARGET,
|
|
112
128
|
NormalizeError,
|
|
@@ -116,17 +132,16 @@ import {
|
|
|
116
132
|
scaleTextAtFloor,
|
|
117
133
|
targetFloorsPx,
|
|
118
134
|
targetTypeSizesPx
|
|
119
|
-
} from "./chunk-
|
|
120
|
-
import {
|
|
121
|
-
maxOf,
|
|
122
|
-
minOf,
|
|
123
|
-
pushAll
|
|
124
|
-
} from "./chunk-WYJEOMNY.js";
|
|
135
|
+
} from "./chunk-RJICOOB3.js";
|
|
125
136
|
import {
|
|
126
137
|
ellipsize,
|
|
127
138
|
hasAuthoredTypeSize,
|
|
128
139
|
wrapText
|
|
129
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-UIHGGWES.js";
|
|
141
|
+
import {
|
|
142
|
+
maxOf,
|
|
143
|
+
pushAll
|
|
144
|
+
} from "./chunk-WYJEOMNY.js";
|
|
130
145
|
import {
|
|
131
146
|
boldMeasurer,
|
|
132
147
|
boldRuns,
|
|
@@ -136,184 +151,22 @@ import {
|
|
|
136
151
|
splitBoldLines
|
|
137
152
|
} from "./chunk-SRUV7AT6.js";
|
|
138
153
|
|
|
139
|
-
// src/core/
|
|
140
|
-
function
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
function rectContains(outer, inner, pad = 0) {
|
|
144
|
-
return inner.x >= outer.x + pad && inner.y >= outer.y + pad && inner.x + inner.w <= outer.x + outer.w - pad && inner.y + inner.h <= outer.y + outer.h - pad;
|
|
145
|
-
}
|
|
146
|
-
function polylineYAt(line, x) {
|
|
147
|
-
if (x <= line[0].x) return line[0].y;
|
|
148
|
-
for (let i = 1; i < line.length; i++) {
|
|
149
|
-
let a = line[i - 1], b = line[i];
|
|
150
|
-
if (x <= b.x) return b.x === a.x ? b.y : a.y + (b.y - a.y) * (x - a.x) / (b.x - a.x);
|
|
151
|
-
}
|
|
152
|
-
return line[line.length - 1].y;
|
|
153
|
-
}
|
|
154
|
-
function pointRectDistance(p, rect) {
|
|
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));
|
|
156
|
-
}
|
|
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));
|
|
159
|
-
return Math.hypot(x - a.x - t * dx, y - a.y - t * dy);
|
|
160
|
-
}
|
|
161
|
-
function rectLineDistance(rect, line) {
|
|
162
|
-
if (line.length === 1) return pointRectDistance(line[0], rect);
|
|
163
|
-
let right = rect.x + rect.w, bottom = rect.y + rect.h, best = 1 / 0, previousDistance = 1 / 0;
|
|
164
|
-
for (let i = 1; i < line.length; i++) {
|
|
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;
|
|
177
|
-
i === 1 && (previousDistance = pointRectDistance(a, rect));
|
|
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);
|
|
181
|
-
best = Math.min(
|
|
182
|
-
best,
|
|
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)
|
|
187
|
-
), previousDistance = nextDistance;
|
|
188
|
-
}
|
|
189
|
-
return best;
|
|
190
|
-
}
|
|
191
|
-
function sideAwayFrom(point, others) {
|
|
192
|
-
let above = 1 / 0, below = 1 / 0, any = !1;
|
|
193
|
-
for (let line of others) {
|
|
194
|
-
if (line.length === 0 || point.x < line[0].x || point.x > line[line.length - 1].x) continue;
|
|
195
|
-
any = !0;
|
|
196
|
-
let y = polylineYAt(line, point.x);
|
|
197
|
-
y < point.y ? above = Math.min(above, point.y - y) : y > point.y && (below = Math.min(below, y - point.y));
|
|
198
|
-
}
|
|
199
|
-
return any ? below > above ? "below" : "above" : void 0;
|
|
200
|
-
}
|
|
201
|
-
function segmentHitsRect(a, b, rect, pad = 0) {
|
|
202
|
-
let x0 = rect.x - pad, y0 = rect.y - pad, x1 = rect.x + rect.w + pad, y1 = rect.y + rect.h + pad, dx = b.x - a.x, dy = b.y - a.y, t0 = 0, t1 = 1;
|
|
203
|
-
for (let side = 0; side < 4; side++) {
|
|
204
|
-
let p = side === 0 ? -dx : side === 1 ? dx : side === 2 ? -dy : dy, q = side === 0 ? a.x - x0 : side === 1 ? x1 - a.x : side === 2 ? a.y - y0 : y1 - a.y;
|
|
205
|
-
if (p === 0) {
|
|
206
|
-
if (q < 0) return !1;
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
let t = q / p;
|
|
210
|
-
if (p < 0 ? t0 = Math.max(t0, t) : t1 = Math.min(t1, t), t0 > t1) return !1;
|
|
211
|
-
}
|
|
212
|
-
return !0;
|
|
213
|
-
}
|
|
214
|
-
function rectHitsConvexPolygon(rect, polygon, pad = 0) {
|
|
215
|
-
let x0 = rect.x - pad, y0 = rect.y - pad, x1 = rect.x + rect.w + pad, y1 = rect.y + rect.h + pad, corners = [{ x: x0, y: y0 }, { x: x1, y: y0 }, { x: x1, y: y1 }, { x: x0, y: y1 }], axes = [{ x: 1, y: 0 }, { x: 0, y: 1 }];
|
|
216
|
-
return polygon.forEach((p, i) => {
|
|
217
|
-
let q = polygon[(i + 1) % polygon.length];
|
|
218
|
-
(p.x !== q.x || p.y !== q.y) && axes.push({ x: q.y - p.y, y: p.x - q.x });
|
|
219
|
-
}), axes.every((axis) => {
|
|
220
|
-
let a = corners.map((p) => p.x * axis.x + p.y * axis.y), b = polygon.map((p) => p.x * axis.x + p.y * axis.y);
|
|
221
|
-
return Math.max(...a) > minOf(b) && maxOf(b) > Math.min(...a);
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
function prepareConvexPolygon(polygon) {
|
|
225
|
-
let axes = [[1, 0], [0, 1], ...polygon.map((p, i) => {
|
|
226
|
-
let q = polygon[(i + 1) % polygon.length];
|
|
227
|
-
return [q.y - p.y, p.x - q.x];
|
|
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
|
-
}
|
|
238
|
-
return (rect, pad) => {
|
|
239
|
-
let x0 = rect.x - pad, y0 = rect.y - pad, x1 = rect.x + rect.w + pad, y1 = rect.y + rect.h + pad;
|
|
240
|
-
return projected.every(([x, y, min, max]) => {
|
|
241
|
-
let a = x0 * x + y0 * y, b = x1 * x + y0 * y, c = x1 * x + y1 * y, d = x0 * x + y1 * y;
|
|
242
|
-
return Math.max(a, b, c, d) > min && max > Math.min(a, b, c, d);
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
var deltaGap = (labelHeight) => Math.round(labelHeight);
|
|
247
|
-
function boxGap(a, b) {
|
|
248
|
-
return Math.hypot(Math.max(0, b.x - (a.x + a.w), a.x - (b.x + b.w)), Math.max(0, b.y - (a.y + a.h), a.y - (b.y + b.h)));
|
|
249
|
-
}
|
|
250
|
-
function rectCenter(r) {
|
|
251
|
-
return { x: r.x + r.w / 2, y: r.y + r.h / 2 };
|
|
252
|
-
}
|
|
253
|
-
function inflate(r, by) {
|
|
254
|
-
return { x: r.x - by, y: r.y - by, w: r.w + 2 * by, h: r.h + 2 * by };
|
|
255
|
-
}
|
|
256
|
-
function boundsOf(rects) {
|
|
257
|
-
if (rects.length === 0) return { x: 0, y: 0, w: 0, h: 0 };
|
|
258
|
-
let x0 = 1 / 0, y0 = 1 / 0, x1 = -1 / 0, y1 = -1 / 0;
|
|
259
|
-
for (let r of rects)
|
|
260
|
-
x0 = Math.min(x0, r.x), y0 = Math.min(y0, r.y), x1 = Math.max(x1, r.x + r.w), y1 = Math.max(y1, r.y + r.h);
|
|
261
|
-
return { x: x0, y: y0, w: x1 - x0, h: y1 - y0 };
|
|
262
|
-
}
|
|
263
|
-
function unionRect(a, b) {
|
|
264
|
-
let x = Math.min(a.x, b.x), y = Math.min(a.y, b.y);
|
|
265
|
-
return {
|
|
266
|
-
x,
|
|
267
|
-
y,
|
|
268
|
-
w: Math.max(a.x + a.w, b.x + b.w) - x,
|
|
269
|
-
h: Math.max(a.y + a.h, b.y + b.h) - y
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
function clamp(v, lo, hi) {
|
|
273
|
-
return v < lo ? lo : v > hi ? hi : v;
|
|
274
|
-
}
|
|
275
|
-
function round2(v) {
|
|
276
|
-
return Math.round(v * 100) / 100;
|
|
154
|
+
// src/core/claims/ids.ts
|
|
155
|
+
function claimId(prefix, ...parts) {
|
|
156
|
+
return [prefix, ...parts.map((part) => String(part).replace(/[\\:]/g, "\\$&"))].join(":");
|
|
277
157
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return Math.abs(cleaned - v) > 4 * Number.EPSILON * Math.abs(scale) ? v : cleaned;
|
|
158
|
+
var HOST_CLAIMS = /* @__PURE__ */ Symbol("boardplot.hostClaims");
|
|
159
|
+
function requestClaims(request, options) {
|
|
160
|
+
let host = options[HOST_CLAIMS];
|
|
161
|
+
return host ? host(request) : request.claimIds;
|
|
283
162
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return cleanFloat(terms.reduce((a, b) => a + b, 0), scale);
|
|
163
|
+
var UNPRINTED_CLAIMS = /* @__PURE__ */ Symbol("boardplot.unprintedClaims");
|
|
164
|
+
function unprintedClaims(geometry) {
|
|
165
|
+
return geometry[UNPRINTED_CLAIMS] ?? [];
|
|
288
166
|
}
|
|
289
|
-
function
|
|
290
|
-
return
|
|
167
|
+
function withUnprintedClaims(geometry, ids) {
|
|
168
|
+
return ids.length === 0 ? geometry : { ...geometry, [UNPRINTED_CLAIMS]: [...unprintedClaims(geometry), ...ids] };
|
|
291
169
|
}
|
|
292
|
-
function strokeBoxPad(width, dx, dy) {
|
|
293
|
-
let r = width / 2, length = Math.hypot(dx, dy);
|
|
294
|
-
return length === 0 ? { x: r, y: r } : { x: r * Math.abs(dy) / length, y: r * Math.abs(dx) / length };
|
|
295
|
-
}
|
|
296
|
-
function rowLabelX(laneX, laneW, labelW, align) {
|
|
297
|
-
return align === "right" ? laneX + laneW - labelW : laneX;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// src/core/types/annotations.ts
|
|
301
|
-
function defaultAnnotationId(annotation, index) {
|
|
302
|
-
return annotation.id ?? `${annotation.kind}-${index + 1}`;
|
|
303
|
-
}
|
|
304
|
-
var ANNOTATION_KIND_PURPOSES = {
|
|
305
|
-
diff: "Draws a level-difference arrow between two anchors and computes either percent change or their signed value difference.",
|
|
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.",
|
|
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.",
|
|
309
|
-
abs: "Reads the anchored data value and places its formatted absolute value in a collision-managed label.",
|
|
310
|
-
note: "Places authored text at an anchored data element through collision avoidance, with an optional icon or status chip.",
|
|
311
|
-
callout: "Places authored free text at an anchored data element, routing a leader when displaced and honoring the preferred side.",
|
|
312
|
-
valueLine: "Draws a reference line at an authored value or an engine-computed mean, with optional tolerance shading and attainment fill between the line and resolved actuals.",
|
|
313
|
-
indicator100: "Maps 100 through the chart's value scale and draws a side tick with a 100% label.",
|
|
314
|
-
band: "Draws an inclusive category span as a shaded band or bracket, or a value-axis plan corridor, tolerance band or attainment fill, with a collision-managed label.",
|
|
315
|
-
event: "Places a dated event in the lane above the plot as a block with a pole to the data, or, when it does not fit, as a numbered marker with an entry in the event key below the plot; periods draw a thin bar."
|
|
316
|
-
};
|
|
317
170
|
|
|
318
171
|
// src/core/adjacentSeries.ts
|
|
319
172
|
var ORDERED_STEP_FLOOR = 3, orderedRung = (sample, theme) => {
|
|
@@ -576,13 +429,12 @@ var NAMED_PARTS = [
|
|
|
576
429
|
function textRole(node) {
|
|
577
430
|
return node.role !== void 0 && ROLES.has(node.role) ? node.role : node.part === "title" || node.part === "subtitle" || node.part === "source" ? node.part : node.part === "credit" ? "source" : PART_ROLES.get(node.part) ?? "value";
|
|
578
431
|
}
|
|
579
|
-
var CURRENCY_SIGN = "$\u20AC\xA3\xA5\u20B9\u20BD\xA2\u20A9", CURRENCY_CODE = "EUR|USD|GBP|CHF|JPY|CNY|SEK|NOK|DKK|PLN|CZK|HUF|CAD|AUD|NZD|INR|BRL|MXN|ZAR|SGD|HKD|KRW", MAGNITUDE = "(?:k|K|m|M|bn|Bn|BN|b|B|t|T|Mio|Mrd)", CURRENCY = `(?:[${CURRENCY_SIGN}]|(?:${CURRENCY_CODE})\\b)`, DIGITS = "\\p{Nd}[\\p{Nd}.,'\u2019\xA0\u202F\u066B\u066C\u060C ]*", SIGN = "[+\\-\u2013\u2212\u061C\u200E\u200F]*", PERCENT = "(?:%|\u066A|\u2030|pp|x|\xD7)", ONE_NUMBER = `${SIGN}\\s?${CURRENCY}?\\s?${SIGN}${DIGITS}${MAGNITUDE}?\\s?${PERCENT}?[\u061C\u200E\u200F]?\\s?${CURRENCY}?\\s?${MAGNITUDE}?`, NUMBER_ALONE = new RegExp(
|
|
580
|
-
`^(?:${ONE_NUMBER}(?:\\s?\\(${ONE_NUMBER}\\))?|\\(${ONE_NUMBER}\\))$`,
|
|
581
|
-
"u"
|
|
582
|
-
), NUMBER_PLACEHOLDER = /^(?:n\/a|n\.m\.|[-–—])$/;
|
|
432
|
+
var CURRENCY_SIGN = "$\u20AC\xA3\xA5\u20B9\u20BD\xA2\u20A9", CURRENCY_CODE = "EUR|USD|GBP|CHF|JPY|CNY|SEK|NOK|DKK|PLN|CZK|HUF|CAD|AUD|NZD|INR|BRL|MXN|ZAR|SGD|HKD|KRW", MAGNITUDE = "(?:k|K|m|M|bn|Bn|BN|b|B|t|T|Mio|Mrd)", CURRENCY = `(?:[${CURRENCY_SIGN}]|(?:${CURRENCY_CODE})\\b)`, DIGITS = "\\p{Nd}[\\p{Nd}.,'\u2019\xA0\u202F\u066B\u066C\u060C ]*", SIGN = "[+\\-\u2013\u2212\u061C\u200E\u200F]*", PERCENT = "(?:%|\u066A|\u2030|pp|x|\xD7)", ONE_NUMBER = `${SIGN}\\s?${CURRENCY}?\\s?${SIGN}${DIGITS}${MAGNITUDE}?\\s?${PERCENT}?[\u061C\u200E\u200F]?\\s?${CURRENCY}?\\s?${MAGNITUDE}?`, NUMBER_ALONE = new RegExp(`^${ONE_NUMBER}$`, "u"), NUMBER_PLACEHOLDER = /^(?:n\/a|n\.m\.|[-–—])$/;
|
|
583
433
|
function isNumberAlone(text) {
|
|
584
434
|
let trimmed = text.replace(/\s+/g, " ").trim();
|
|
585
|
-
|
|
435
|
+
if (trimmed === "" || NUMBER_PLACEHOLDER.test(trimmed)) return !0;
|
|
436
|
+
let open = trimmed.indexOf("(");
|
|
437
|
+
return open < 0 ? NUMBER_ALONE.test(trimmed) : trimmed.endsWith(")") ? NUMBER_ALONE.test(trimmed.slice(open + 1, -1)) && (open === 0 || NUMBER_ALONE.test(trimmed.slice(0, open).trimEnd())) : !1;
|
|
586
438
|
}
|
|
587
439
|
function composedTextRole(text, prose = "caption") {
|
|
588
440
|
return isNumberAlone(text) ? "value" : prose;
|
|
@@ -598,85 +450,6 @@ function numericVariant(role, theme) {
|
|
|
598
450
|
return theme.type.numeric === "proportional" ? "proportional-nums" : "tabular-nums";
|
|
599
451
|
}
|
|
600
452
|
|
|
601
|
-
// src/core/label/occupied.ts
|
|
602
|
-
var CELL = 16;
|
|
603
|
-
function cellRange(rect, pad, range) {
|
|
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);
|
|
605
|
-
if (x0 <= x1 && y0 <= y1 && (x1 - x0 + 1) * (y1 - y0 + 1) <= 256 && Math.max(-x0, x1, -y0, y1) < 32768)
|
|
606
|
-
return range[0] = x0, range[1] = x1, range[2] = y0, range[3] = y1, range;
|
|
607
|
-
}
|
|
608
|
-
function createOccupiedIndex(_plot) {
|
|
609
|
-
let rects = [], scratchRange = [0, 0, 0, 0], released = /* @__PURE__ */ new Set(), cells = /* @__PURE__ */ new Map(), wide = [], polygonTests = [], hit = (index, rect, pad) => {
|
|
610
|
-
let claim = rects[index];
|
|
611
|
-
return rectsOverlap(claim.rect, rect, pad) && (claim.polygon === void 0 || (polygonTests[index] ??= prepareConvexPolygon(claim.polygon))(rect, pad));
|
|
612
|
-
}, seen = [], stamp = 0, visiting = !1, visitNear = (rect, pad, visit) => {
|
|
613
|
-
if (visiting) throw new Error("occupied index: a query ran inside another query's callback");
|
|
614
|
-
visiting = !0;
|
|
615
|
-
try {
|
|
616
|
-
return visitClaims(rect, pad, visit);
|
|
617
|
-
} finally {
|
|
618
|
-
visiting = !1;
|
|
619
|
-
}
|
|
620
|
-
}, visitClaims = (rect, pad, visit) => {
|
|
621
|
-
let range = cellRange(rect, pad, scratchRange);
|
|
622
|
-
if (range === void 0) {
|
|
623
|
-
for (let i = 0; i < rects.length; i++) if (visit(i)) return !0;
|
|
624
|
-
return !1;
|
|
625
|
-
}
|
|
626
|
-
let [x0, x1, y0, y1] = range;
|
|
627
|
-
stamp++;
|
|
628
|
-
for (let w = 0; w < wide.length; w++) if (visit(wide[w])) return !0;
|
|
629
|
-
for (let x = x0; x <= x1; x++)
|
|
630
|
-
for (let y = y0; y <= y1; y++) {
|
|
631
|
-
let cell = cells.get(x * 65536 + y);
|
|
632
|
-
if (cell !== void 0)
|
|
633
|
-
for (let c = 0; c < cell.length; c++) {
|
|
634
|
-
let i = cell[c];
|
|
635
|
-
if (seen[i] !== stamp && (seen[i] = stamp, visit(i)))
|
|
636
|
-
return !0;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
return !1;
|
|
640
|
-
};
|
|
641
|
-
return {
|
|
642
|
-
claim(rect, kind, owner, part, polygon) {
|
|
643
|
-
let claimed = part === void 0 ? { rect: { ...rect }, kind, owner } : { rect: { ...rect }, kind, owner, part };
|
|
644
|
-
polygon !== void 0 && (claimed.polygon = polygon.map((point) => ({ ...point })));
|
|
645
|
-
let index = rects.push(claimed) - 1, range = cellRange(rect, 0, scratchRange);
|
|
646
|
-
if (range === void 0) wide.push(index);
|
|
647
|
-
else {
|
|
648
|
-
let [x0, x1, y0, y1] = range;
|
|
649
|
-
for (let x = x0; x <= x1; x++) for (let y = y0; y <= y1; y++) {
|
|
650
|
-
let key = x * 65536 + y, cell = cells.get(key);
|
|
651
|
-
cell === void 0 ? cells.set(key, [index]) : cell.push(index);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
},
|
|
655
|
-
hits(rect, pad = 0, skip) {
|
|
656
|
-
return visitNear(rect, pad, (i) => !skip?.(rects[i]) && hit(i, rect, pad));
|
|
657
|
-
},
|
|
658
|
-
some(rect, pad, test) {
|
|
659
|
-
return visitNear(rect, pad, (i) => hit(i, rect, pad) && test(rects[i]));
|
|
660
|
-
},
|
|
661
|
-
hitsWhich(rect, pad = 0, skip) {
|
|
662
|
-
let found = [];
|
|
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]);
|
|
664
|
-
},
|
|
665
|
-
snapshot() {
|
|
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);
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
|
|
680
453
|
// src/core/label/ownership.ts
|
|
681
454
|
function circleGap(rect, m) {
|
|
682
455
|
let dx = Math.max(rect.x - m.cx, 0, m.cx - rect.x - rect.w), dy = Math.max(rect.y - m.cy, 0, m.cy - rect.y - rect.h);
|
|
@@ -794,9 +567,12 @@ function labelCtx(theme, size, options, rest) {
|
|
|
794
567
|
focus: options.focus,
|
|
795
568
|
density: options.labelDensity ?? "smart",
|
|
796
569
|
pins: options.labelPlacements ?? {},
|
|
570
|
+
labelOffsets: options.labelOffsets,
|
|
797
571
|
canvas: { x: 0, y: 0, w: size.width, h: size.height },
|
|
798
572
|
darkInk: theme.color.ink,
|
|
799
573
|
lightInk: theme.color.inkInverse,
|
|
574
|
+
// A host chart names the claims of this delegate's labels (claims/ids.ts).
|
|
575
|
+
...HOST_CLAIMS in options ? { [HOST_CLAIMS]: options[HOST_CLAIMS] } : {},
|
|
800
576
|
...rest
|
|
801
577
|
};
|
|
802
578
|
}
|
|
@@ -806,8 +582,24 @@ function dropsFromRow(row, index) {
|
|
|
806
582
|
return row.mode === "none" ? !(row.keepEnds && (index === 0 || index === last)) : (last - index) % 2 !== 0;
|
|
807
583
|
}
|
|
808
584
|
function solveLabels(requests, occupied, ctx) {
|
|
585
|
+
if (ctx.labelOffsets && !ctx.naturalSeats && Object.keys(ctx.labelOffsets).length > 0) {
|
|
586
|
+
let probe = createOccupiedIndex(ctx.plot);
|
|
587
|
+
probe.tickColumns = occupied.tickColumns;
|
|
588
|
+
for (let claim of occupied.snapshot()) probe.claim(claim.rect, claim.kind, claim.owner, claim.part, claim.polygon);
|
|
589
|
+
let natural = solveLabels(requests, probe, { ...ctx, labelOffsets: void 0 });
|
|
590
|
+
ctx = { ...ctx, naturalSeats: new Map(natural.placed.flatMap((label) => label.hidden ? [] : [[label.id, label.rect]])) };
|
|
591
|
+
}
|
|
809
592
|
if (!ctx.valueRows?.length) return solveLabelPass(requests, occupied, ctx);
|
|
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();
|
|
593
|
+
let initial = occupied.snapshot(), pinned = new Set(requests.filter((req) => req.pinnedSlot ?? ctx.pins[req.id]).map((req) => req.id)), held = new Set(requests.filter((req) => pinned.has(req.id) || ctx.density === "minimal" && req.keepWhenDense).map((req) => req.id)), rows = ctx.valueRows.map((row) => ({ ...row, eligible: [], mode: row.from ?? "all", reason: "" })), dropped = /* @__PURE__ */ new Set();
|
|
594
|
+
for (let row of rows) if (row.mode !== "all") {
|
|
595
|
+
let byId = new Map(requests.map((req) => [req.id, req]));
|
|
596
|
+
row.eligible = row.ids.filter((id) => {
|
|
597
|
+
let req = byId.get(id);
|
|
598
|
+
return req && !(req.redundant && req.suppressedAs !== "density");
|
|
599
|
+
}), row.reason = `computed row ${row.mode === "alternate" ? "uses alternate values from the end" : "omitted"}; the full row needs a wider plot`, row.eligible.forEach((id, index) => {
|
|
600
|
+
!held.has(id) && dropsFromRow(row, index) && dropped.add(id);
|
|
601
|
+
});
|
|
602
|
+
}
|
|
811
603
|
if (rows.length === 1 && pinned.size === 0 && ctx.density !== "minimal" && !ctx.seriesUniform && !requests.some((req) => req.printedIn)) {
|
|
812
604
|
let row = rows[0], byId = new Map(requests.map((req) => [req.id, req]));
|
|
813
605
|
if (byId.size === requests.length && new Set(row.ids).size === row.ids.length)
|
|
@@ -836,7 +628,7 @@ function solveLabels(requests, occupied, ctx) {
|
|
|
836
628
|
}));
|
|
837
629
|
let failed = row.eligible.filter((id) => !dropped.has(id) && byId.get(id)?.hidden);
|
|
838
630
|
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) => {
|
|
839
|
-
|
|
631
|
+
held.has(id) || (dropsFromRow(row, index) ? dropped.add(id) : dropped.delete(id));
|
|
840
632
|
}), retry = !0);
|
|
841
633
|
}
|
|
842
634
|
if (retry) continue;
|
|
@@ -855,8 +647,8 @@ function anyHit(occupied, rect, pad, test) {
|
|
|
855
647
|
return occupied.some ? occupied.some(rect, pad, test) : occupied.hitsWhich(rect, pad).some(test);
|
|
856
648
|
}
|
|
857
649
|
function solveLabelPass(requests, occupied, ctx) {
|
|
858
|
-
let placed = [], decisions = [], warnings = [], hiddenWarningByLabel = /* @__PURE__ */ new Map(), printedIn = new Map(requests.flatMap((req) => req.printedIn ? [[req.id, req.printedIn]] : [])), pad = ctx.labelPad ?? 2, darkInk = ctx.darkInk ?? "#111827", lightInk = ctx.lightInk ?? "#ffffff", pinOf = (r) => r.pinnedSlot ?? ctx.pins[r.id], ownership = ctx.pointOwnership ? pointOwnership(ctx.pointOwnership) : void 0, owned = ownership ? withOwnedSeats(requests, ownership, pinOf) : requests, ownedPoint = (req) => req.kind === "point" && ownership?.pointOf(req.owner.seriesId, req.owner.categoryId) !== void 0, ownershipLimited = new Set(owned.flatMap((req, i) => req !== requests[i] ? [req.id] : [])), order = [...owned].sort(labelOrder(pinOf, ctx.focus)), leaderRuns = [], keepOffLeader = (label, req) => {
|
|
859
|
-
req.leaderAvoidsLabels && label.leader && leaderRuns.push(...leaderPieces(label.leader.d, 64));
|
|
650
|
+
let placed = [], decisions = [], warnings = [], hiddenWarningByLabel = /* @__PURE__ */ new Map(), printedIn = new Map(requests.flatMap((req) => req.printedIn ? [[req.id, req.printedIn]] : [])), pad = ctx.labelPad ?? 2, darkInk = ctx.darkInk ?? "#111827", lightInk = ctx.lightInk ?? "#ffffff", pinOf = (r) => r.pinnedSlot ?? ctx.pins[r.id], ownership = ctx.pointOwnership ? pointOwnership(ctx.pointOwnership) : void 0, owned = ownership ? withOwnedSeats(requests, ownership, pinOf) : requests, ownedPoint = (req) => req.kind === "point" && ownership?.pointOf(req.owner.seriesId, req.owner.categoryId) !== void 0, ownershipLimited = new Set(owned.flatMap((req, i) => req !== requests[i] ? [req.id] : [])), order = [...owned].sort(labelOrder(pinOf, ctx.focus)), leaderRuns = [], moved = [], ownRooms = /* @__PURE__ */ new Map(), keepOffLeader = (label, req) => {
|
|
651
|
+
req.leaderAvoidsLabels && label.leader && !moved.includes(label.id) && leaderRuns.push(...leaderPieces(label.leader.d, 64));
|
|
860
652
|
}, onLeader = (rect, padding) => leaderRuns.some(([a, b]) => segmentHitsRect(a, b, rect, padding));
|
|
861
653
|
for (let queued of order) {
|
|
862
654
|
let runClear = (from, to) => occupied.hitsWhich({ x: from.x - 0.5, y: Math.min(from.y, to) + 0.5, w: 1, h: Math.max(0, Math.abs(to - from.y) - 1) }, 0).every((o) => o.kind !== "mark" || isOwnMark(o.owner, queued.owner, queued.kind, o.part)), req = withLiftLeaders(queued, ownedPoint(queued), runClear), slots = req.candidates.map((c) => c.slot), first = req.candidates[0], markValue = isMarkValue(req), naturals = naturalSeats(req), withinMarkBand = (cand) => {
|
|
@@ -870,20 +662,46 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
870
662
|
}, selfAnn = req.owner.annotationId, blocks = /* @__PURE__ */ new Map(), crowdsSeriesValue = (cand) => cand.insideFill === void 0 ? crowdsSeries(cand.rect) : req.kind === "segment" && crowdsSeries(cand.rect, !0), marksTouch = (a, b) => {
|
|
871
663
|
let [left, right] = a.x <= b.x ? [a, b] : [b, a], x = (left.x + left.w + right.x) / 2, y = (Math.max(a.y, b.y) + Math.min(a.y + a.h, b.y + b.h)) / 2;
|
|
872
664
|
return anyHit(occupied, { x: x - 0.5, y: y - 0.5, w: 1, h: 1 }, 0, (o) => o.kind === "mark");
|
|
873
|
-
}, outsideSegment = (touching) => req.kind === "segment" && !touching, crowdsTotal = (rect) => TOTAL_KINDS.has(req.kind) && anyHit(occupied, rect, SERIES_VALUE_GAP, (o) => o.kind === "label" && o.part === TOTAL_PART && o.owner.seriesId === req.owner.seriesId && o.owner.categoryId !== void 0 && o.owner.categoryId !== req.owner.categoryId && Math.min(o.rect.y + o.rect.h, rect.y + rect.h) - Math.max(o.rect.y, rect.y) >= rect.h / Math.max(1, req.lines.length) / 2 - 0.1), crowdsSeries = (rect, touching = !1) => crowdsTotal(rect) || (req.kind === "point" || req.kind === "segment") && (req.owner.seriesId !== void 0 || req.valueRow === !0 || outsideSegment(touching)) && occupied.hitsWhich(rect, SERIES_VALUE_GAP).some((o) => o.kind === "label" && (outsideSegment(touching) || o.owner.seriesId === req.owner.seriesId) && o.owner.categoryId !== void 0 && o.owner.categoryId !== req.owner.categoryId && Math.min(o.rect.y + o.rect.h, rect.y + rect.h) > Math.max(o.rect.y, rect.y) && (!touching || marksTouch(rect, o.rect))), inTickColumn = (rect, air = 0) => ["point", "segment", "total", "grandTotal"].includes(req.kind) && (occupied.tickColumns?.some((column) => rectsOverlap(column, rect, air)) ?? !1),
|
|
874
|
-
let
|
|
875
|
-
if (
|
|
876
|
-
let { rect, overColumns, overRules, overLegend } = req.candidates[index], value = "free";
|
|
877
|
-
if (!withinMarkBand(req.candidates[index]) || ctx.canvas && !rectContains(ctx.canvas, rect, 0))
|
|
665
|
+
}, outsideSegment = (touching) => req.kind === "segment" && !touching, crowdsTotal = (rect) => TOTAL_KINDS.has(req.kind) && anyHit(occupied, rect, SERIES_VALUE_GAP, (o) => o.kind === "label" && o.part === TOTAL_PART && o.owner.seriesId === req.owner.seriesId && o.owner.categoryId !== void 0 && o.owner.categoryId !== req.owner.categoryId && Math.min(o.rect.y + o.rect.h, rect.y + rect.h) - Math.max(o.rect.y, rect.y) >= rect.h / Math.max(1, req.lines.length) / 2 - 0.1), crowdsSeries = (rect, touching = !1) => crowdsTotal(rect) || (req.kind === "point" || req.kind === "segment") && (req.owner.seriesId !== void 0 || req.valueRow === !0 || outsideSegment(touching)) && occupied.hitsWhich(rect, SERIES_VALUE_GAP).some((o) => o.kind === "label" && (outsideSegment(touching) || o.owner.seriesId === req.owner.seriesId) && o.owner.categoryId !== void 0 && o.owner.categoryId !== req.owner.categoryId && Math.min(o.rect.y + o.rect.h, rect.y + rect.h) > Math.max(o.rect.y, rect.y) && (!touching || marksTouch(rect, o.rect))), inTickColumn = (rect, air = 0) => ["point", "segment", "total", "grandTotal"].includes(req.kind) && (occupied.tickColumns?.some((column) => rectsOverlap(column, rect, air)) ?? !1), blockOf = (cand, padding, isMoved = !1) => {
|
|
666
|
+
let { rect, overColumns, overRules, overLegend } = cand, value = "free";
|
|
667
|
+
if (!isMoved && !withinMarkBand(cand) || ctx.canvas && !rectContains(ctx.canvas, rect, 0))
|
|
878
668
|
value = "hard";
|
|
879
669
|
else {
|
|
880
670
|
let sawLabel = !1;
|
|
881
|
-
anyHit(occupied, rect, padding, (o) => o.kind === "annotation" && selfAnn && o.owner.annotationId === selfAnn || overRules && (o.part === "referenceLine" || o.part === CROSSABLE_RULE_PART) ||
|
|
882
|
-
let tickAir =
|
|
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" &&
|
|
671
|
+
anyHit(occupied, rect, padding, (o) => o.kind === "annotation" && selfAnn && o.owner.annotationId === selfAnn && (!isMoved || o.part === "bracketLabel" || !rectsOverlap(o.rect, rect, 0)) || overRules && (o.part === "referenceLine" || o.part === CROSSABLE_RULE_PART) || cand.overValueLines && isValueLine(o) || overLegend && o.kind === "legend" || o.kind === "mark" && (isOwnMark(o.owner, req.owner, req.kind, o.part) && (!cand.keepOffLines || o.part === void 0 || isColumnPart(o.part)) || overColumns && isColumnPart(o.part) && rectContains(o.rect, rect, 0)) || o.kind === "mark" && o.part === AREA_FILL_PART && cand.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 && cand.slot.startsWith("inside") && (cand.slot.startsWith("insideBand") || !rectsOverlap(o.rect, rect, 0)) || o.kind === "mark" && o.part === AREA_FILL_PART && (cand.slot.startsWith("insideBand") || cand.insideFill !== void 0) ? !1 : o.kind === "label" ? (sawLabel = !0, !1) : !0) ? value = "hard" : sawLabel && (value = "label"), value !== "hard" && inTickColumn(rect, cand.tickAir) && (value = "hard");
|
|
672
|
+
let tickAir = cand.tickAir;
|
|
673
|
+
if (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" && isMoved && ctx.naturalSeats)
|
|
674
|
+
for (let [id, seat] of ctx.naturalSeats) id !== req.id && rectsOverlap(seat, rect, padding) && (value = "label");
|
|
675
|
+
value === "free" && pinOf(req) !== cand.slot && crowdsSeriesValue(cand) && (value = "label");
|
|
884
676
|
}
|
|
677
|
+
return value;
|
|
678
|
+
}, blockAt = (index, padding) => {
|
|
679
|
+
let key = `${index}:${padding}`, cached = blocks.get(key);
|
|
680
|
+
if (cached) return cached;
|
|
681
|
+
let value = blockOf(req.candidates[index], padding);
|
|
885
682
|
return blocks.set(key, value), value;
|
|
886
|
-
},
|
|
683
|
+
}, offset = ctx.labelOffsets?.[req.id], ownBar = (cand) => {
|
|
684
|
+
if (!MOVED_VALUE_KINDS.has(req.kind)) return;
|
|
685
|
+
let best;
|
|
686
|
+
for (let o of occupied.hitsWhich(cand.rect, OWN_BAR_REACH))
|
|
687
|
+
o.kind !== "mark" || !isColumnPart(o.part) || !isOwnMark(o.owner, req.owner, req.kind, o.part) || (!best || boxGap(o.rect, cand.rect) < boxGap(best.rect, cand.rect)) && (best = o);
|
|
688
|
+
return best?.rect;
|
|
689
|
+
}, movedSeat = (cand, move) => {
|
|
690
|
+
let rect = { ...cand.rect, x: cand.rect.x + (move.x ?? 0), y: cand.rect.y + (move.y ?? 0) }, bar = ownBar(cand);
|
|
691
|
+
bar && (cand.insideFill !== void 0 || cand.onFill) && rectContains(bar, rect, 0) && !rectContains(bar, rect, INSIDE_PAD) && rect.w <= bar.w - 2 * INSIDE_PAD && rect.h <= bar.h - 2 * INSIDE_PAD && (rect = { ...rect, x: Math.min(Math.max(rect.x, bar.x + INSIDE_PAD), bar.x + bar.w - INSIDE_PAD - rect.w), y: Math.min(Math.max(rect.y, bar.y + INSIDE_PAD), bar.y + bar.h - INSIDE_PAD - rect.h) });
|
|
692
|
+
let ownMarks = occupied.hitsWhich(rect, 0).filter((o) => o.kind === "mark" && isOwnMark(o.owner, req.owner, req.kind, o.part)), seat = { ...cand, rect };
|
|
693
|
+
if (cand.insideFill !== void 0 || cand.onFill ? ownMarks.some((o) => rectContains(o.rect, rect, 0)) || (delete seat.insideFill, delete seat.insidePaint, delete seat.insideMatrix, delete seat.insidePattern, delete seat.onFill, seat.needsBacking = !0) : ownMarks.length > 0 && (seat.needsBacking = !0), !seat.leaderFrom && !req.noLeader && Math.hypot(move.x ?? 0, move.y ?? 0) >= MOVED_LEADER_MIN && !ownMarks.some((o) => rectContains(o.rect, rect, 0)))
|
|
694
|
+
if (bar) {
|
|
695
|
+
let run = movedValueRun(bar, rect);
|
|
696
|
+
run === "beside" ? seat.besideBar = !0 : run !== "over" && (seat.leaderFrom = run.from, seat.leaderTo = run.to);
|
|
697
|
+
} else
|
|
698
|
+
seat.leaderFrom = req.anchor ? nearestPointOf(anchorBox(req.anchor), rect) : req.movedLeaderFrom ?? movedLeaderStart(cand.rect, move), seat.leaderVertical = !0;
|
|
699
|
+
return seat;
|
|
700
|
+
}, moveIsFree = (seat, padding) => !seat.besideBar && blockOf(seat, padding, !0) === "free", settled = (cand, padding) => {
|
|
701
|
+
if (!offset) return cand;
|
|
702
|
+
let seat = movedSeat(cand, offset);
|
|
703
|
+
return moveIsFree(seat, padding) ? (moved.push(req.id), seat) : (warnings.push(offsetBlockedWarning(req, seat, occupied, padding, selfAnn, ctx)), cand);
|
|
704
|
+
}, pinnableSlots = () => req.candidates.flatMap((c, i) => blockAt(i, 0) === "hard" ? [] : [c.slot]), claimIds = requestClaims(req, ctx), base = {
|
|
887
705
|
id: req.id,
|
|
888
706
|
kind: req.kind,
|
|
889
707
|
typeRole: labelTypeRole(req),
|
|
@@ -893,7 +711,7 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
893
711
|
slots,
|
|
894
712
|
pinned: !1,
|
|
895
713
|
priority: req.priority,
|
|
896
|
-
...
|
|
714
|
+
...claimIds?.length ? { claimIds, claimText: req.claimText } : {},
|
|
897
715
|
...req.noteText ? { noteText: req.noteText } : {},
|
|
898
716
|
...req.printsFor ? { printsFor: req.printsFor } : {},
|
|
899
717
|
...req.owed ? { owed: !0 } : {},
|
|
@@ -928,6 +746,7 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
928
746
|
severity: req.priority >= REQUIRED_VALUE_PRIORITY ? "warn" : "info",
|
|
929
747
|
message: `label '${req.id}' with text '${req.text}' (priority ${req.priority}, owner ${formatOwner(req.owner)}) was hidden: ${decisionReason}`,
|
|
930
748
|
owner: req.owner,
|
|
749
|
+
detail: { labelId: req.id },
|
|
931
750
|
suggest: slots.length === 0 ? "increase chart size or provide a placement candidate" : pinnable.length > 0 ? `increase chart size, or pin '${req.id}' to a slot a pin can actually take (${pinnable.join(", ")})` + (pinnable.length < slots.length ? " \u2014 the other candidates are blocked by marks, annotations or the canvas edge, which pinning cannot move" : "") : `increase chart size or lower label density \u2014 every candidate slot (${slots.join(", ")}) is blocked by marks, annotations or the canvas edge, which pinning cannot move`
|
|
932
751
|
}), hiddenWarningByLabel.set(req.id, warnings[warnings.length - 1]);
|
|
933
752
|
}
|
|
@@ -958,8 +777,8 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
958
777
|
suggest: slots.join(", ")
|
|
959
778
|
});
|
|
960
779
|
else if (blockAt(index, 0) === "free" && (req.leaderClear !== "includingPins" || !leaderFor(req.candidates[index]) || !leaderPieces(leaderFor(req.candidates[index]).d).some(([a, b]) => occupied.hitsWhich(pieceBox(a, b), 0).some((o) => o.kind === "label" && segmentHitsRect(a, b, o.rect))))) {
|
|
961
|
-
let cand = req.candidates[index], label = finalize(base, req, cand, !0, darkInk, lightInk);
|
|
962
|
-
if (placed.push(label), occupied.claim(cand.rect, "label", req.owner, TOTAL_KINDS.has(req.kind) ? TOTAL_PART : void 0), req.leaderClear === "includingPins" && label.leader) for (let [a, b] of leaderPieces(label.leader.d)) occupied.claim(pieceBox(a, b), "label", req.owner);
|
|
780
|
+
let cand = settled(req.candidates[index], 0), label = finalize(base, req, cand, !0, darkInk, lightInk);
|
|
781
|
+
if (placed.push(label), occupied.claim(cand.rect, "label", req.owner, TOTAL_KINDS.has(req.kind) ? TOTAL_PART : void 0), req.leaderClear === "includingPins" && label.leader && !moved.includes(req.id)) for (let [a, b] of leaderPieces(label.leader.d)) occupied.claim(pieceBox(a, b), "label", req.owner);
|
|
963
782
|
keepOffLeader(label, req), decisions.push({
|
|
964
783
|
labelId: req.id,
|
|
965
784
|
strategy: "candidatesOccupied",
|
|
@@ -985,7 +804,7 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
985
804
|
continue;
|
|
986
805
|
}
|
|
987
806
|
let note = (reason) => refusedPin === void 0 ? reason : `pin '${refusedPin}' blocked; ${reason}`, tried = [], done = !1, crossesLabel = (leader) => !!(req.leaderClear || req.leaderAvoidsLabels) && leader !== void 0 && leaderPieces(leader.d, req.leaderAvoidsLabels ? 64 : 8).some(([a, b]) => occupied.hitsWhich(pieceBox(a, b), 0).some((o) => (o.kind === "label" || req.leaderClearsAxis && o.kind === "axis") && segmentHitsRect(a, b, o.rect))), claimLeader = (label) => {
|
|
988
|
-
if (req.leaderClear && label.leader) for (let [a, b] of leaderPieces(label.leader.d)) occupied.claim(pieceBox(a, b), "label", req.owner);
|
|
807
|
+
if (req.leaderClear && label.leader && !moved.includes(req.id)) for (let [a, b] of leaderPieces(label.leader.d)) occupied.claim(pieceBox(a, b), "label", req.owner);
|
|
989
808
|
keepOffLeader(label, req);
|
|
990
809
|
}, 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) => {
|
|
991
810
|
let label = finalize(base, req, cand, !1, darkInk, lightInk);
|
|
@@ -1002,13 +821,13 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
1002
821
|
cand.onFill || ambiguous.push(cand);
|
|
1003
822
|
continue;
|
|
1004
823
|
}
|
|
1005
|
-
place(cand, tried.length === 1 ? "first candidate free" : `candidate ${tried.length} free`), done = !0;
|
|
824
|
+
place(settled(cand, cand.pad ?? req.pad ?? pad), tried.length === 1 ? "first candidate free" : `candidate ${tried.length} free`), done = !0;
|
|
1006
825
|
break;
|
|
1007
826
|
}
|
|
1008
827
|
}
|
|
1009
828
|
if (!done) {
|
|
1010
829
|
if (crossing && req.leaderAvoidsLabels) {
|
|
1011
|
-
place(crossing, "every free seat draws its leader across a label"), warnings.push({
|
|
830
|
+
place(settled(crossing, crossing.pad ?? req.pad ?? pad), "every free seat draws its leader across a label"), warnings.push({
|
|
1012
831
|
code: "label-leader-crossing",
|
|
1013
832
|
severity: "warn",
|
|
1014
833
|
message: `label '${req.id}': every free seat draws its leader across a label`,
|
|
@@ -1020,24 +839,45 @@ function solveLabelPass(requests, occupied, ctx) {
|
|
|
1020
839
|
if (req.anchor && !req.noLeader && ambiguous.length > 0) {
|
|
1021
840
|
let box = anchorBox(req.anchor), anchorFor = (rect) => ({ x: Math.max(box.x, Math.min(rect.x + rect.w / 2, box.x + box.w)), y: Math.max(box.y, Math.min(rect.y + rect.h / 2, box.y + box.h)) }), led = ambiguous.find((cand) => anchorLeader(cand.rect, anchorFor(cand.rect)) && !leaderExceedsLimit(req, { ...cand, leaderFrom: anchorFor(cand.rect) }) && !crossesLabel(anchorLeader(cand.rect, anchorFor(cand.rect))));
|
|
1022
841
|
if (led) {
|
|
1023
|
-
let leader = anchorLeader(led.rect, anchorFor(led.rect));
|
|
1024
|
-
place(
|
|
1025
|
-
let [x, y] = leader.d.trim().split(/[\s,A-Za-z]+/).filter(Boolean).slice(-2).map(Number), reach = LEADER_GUTTER_RATIO * led.rect.h;
|
|
1026
|
-
occupied.claim(
|
|
1027
|
-
} else place(ambiguous[0], "nearer another mark; too close to its anchor for a leader");
|
|
842
|
+
let seat = settled(led, led.pad ?? req.pad ?? pad), leader = anchorLeader(seat.rect, anchorFor(seat.rect)) ?? anchorLeader(led.rect, anchorFor(led.rect));
|
|
843
|
+
place(seat, "nearer another mark: leader from its anchor", leader);
|
|
844
|
+
let [x, y] = leader.d.trim().split(/[\s,A-Za-z]+/).filter(Boolean).slice(-2).map(Number), reach = LEADER_GUTTER_RATIO * led.rect.h, room = { x: x - reach, y: y - reach, w: 2 * reach, h: 2 * reach };
|
|
845
|
+
occupied.claim(room, "label", req.owner), moved.includes(req.id) && ownRooms.set(req.id, room);
|
|
846
|
+
} else place(settled(ambiguous[0], ambiguous[0].pad ?? req.pad ?? pad), "nearer another mark; too close to its anchor for a leader");
|
|
1028
847
|
continue;
|
|
1029
848
|
}
|
|
1030
849
|
{
|
|
1031
|
-
let across = req.candidates.findIndex((cand) => (!req.noLeader || !cand.leaderFrom && (!req.anchor || !nearerOtherMark(req, cand, occupied, ctx.pointOwnership !== void 0))) && withinMarkBand(cand) && !cand.insideFill && !leaderExceedsLimit(req, cand) && !crossesLabel(leaderFor(cand)) && (!ctx.canvas || rectContains(ctx.canvas, cand.rect, 0)) && !onLeader(cand.rect, req.pad ?? pad) && !crowdsSeriesValue(cand) && !inTickColumn(cand.rect) && !anyHit(occupied, cand.rect, req.pad ?? pad, (o) => !(o.part === "trendLine" || o.part === "zeroLine" || req.protect === !0 && o.part === "referenceLine" || o.kind === "mark" && isOwnMark(o.owner, req.owner, req.kind, o.part))));
|
|
850
|
+
let across = req.candidates.findIndex((cand) => !cand.keepOffLines && (!req.noLeader || !cand.leaderFrom && (!req.anchor || !nearerOtherMark(req, cand, occupied, ctx.pointOwnership !== void 0))) && withinMarkBand(cand) && !cand.insideFill && !leaderExceedsLimit(req, cand) && !crossesLabel(leaderFor(cand)) && (!ctx.canvas || rectContains(ctx.canvas, cand.rect, 0)) && !onLeader(cand.rect, req.pad ?? pad) && !crowdsSeriesValue(cand) && !inTickColumn(cand.rect) && !anyHit(occupied, cand.rect, req.pad ?? pad, (o) => !(o.part === "trendLine" || o.part === "zeroLine" || req.protect === !0 && o.part === "referenceLine" || o.kind === "mark" && isOwnMark(o.owner, req.owner, req.kind, o.part))));
|
|
1032
851
|
if (across >= 0) {
|
|
1033
|
-
let cand = req.candidates[across], label = finalize(base, req, cand, !1, darkInk, lightInk);
|
|
852
|
+
let cand = settled(req.candidates[across], req.pad ?? pad), label = finalize(base, req, cand, !1, darkInk, lightInk);
|
|
1034
853
|
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(req.protect ? "highlighted value crosses a reference line" : "label crosses a trend or zero line") });
|
|
1035
854
|
continue;
|
|
1036
855
|
}
|
|
1037
856
|
}
|
|
857
|
+
if (offset && first && !(req.noLeader && first.leaderFrom)) {
|
|
858
|
+
let seat = movedSeat(first, offset);
|
|
859
|
+
if (moveIsFree(seat, first.pad ?? req.pad ?? pad)) {
|
|
860
|
+
moved.push(req.id), place(seat, "every seat is taken; the moved first seat is free");
|
|
861
|
+
continue;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
1038
864
|
hide("collision", note(ownershipLimited.has(req.id) && req.candidates.length === 0 ? "no seat reads as its own point's value" : `all ${req.candidates.length} candidates collide${req.maxLeaderLength === void 0 ? "" : " or exceed the leader limit"}`));
|
|
1039
865
|
}
|
|
1040
866
|
}
|
|
867
|
+
for (let id of moved) {
|
|
868
|
+
let label = placed.find((entry) => entry.id === id);
|
|
869
|
+
if (!label?.leader) continue;
|
|
870
|
+
let pieces = leaderPieces(label.leader.d);
|
|
871
|
+
if (pieces.some(([a, b]) => occupied.hitsWhich(pieceBox(a, b), 0).some((o) => o.kind === "label" && !sameRect(o.rect, label.rect) && !(ownRooms.has(id) && sameRect(o.rect, ownRooms.get(id))) && segmentHitsRect(a, b, o.rect))))
|
|
872
|
+
delete label.leader, warnings.push({
|
|
873
|
+
code: "label-offset-blocked",
|
|
874
|
+
severity: "warn",
|
|
875
|
+
message: `labelOffsets moves label '${id}' so that its leader would cross text, so the label draws no leader`,
|
|
876
|
+
owner: label.owner,
|
|
877
|
+
suggest: "Use a smaller or another offset."
|
|
878
|
+
});
|
|
879
|
+
else for (let [a, b] of pieces) occupied.claim(pieceBox(a, b), "label", label.owner);
|
|
880
|
+
}
|
|
1041
881
|
if (ctx.seriesUniform) {
|
|
1042
882
|
let kinds = new Set(ctx.seriesUniform.kinds), maxShare = ctx.seriesUniform.maxHiddenShare ?? 0.25, groups = /* @__PURE__ */ new Map();
|
|
1043
883
|
for (let label of placed) {
|
|
@@ -1163,15 +1003,56 @@ function withOwnedSeats(requests, model, pinOf) {
|
|
|
1163
1003
|
return changed ? { ...req, candidates: [...kept.filter((cand) => !last(cand)), ...led, ...kept.filter(last)], ...led.length > 0 && !req.leaderClear ? { leaderClear: !0 } : {} } : req;
|
|
1164
1004
|
});
|
|
1165
1005
|
}
|
|
1006
|
+
function nearestPointOf(rect, other) {
|
|
1007
|
+
let nearest = (low, size, otherLow, otherSize) => {
|
|
1008
|
+
let from = Math.max(low, otherLow), to = Math.min(low + size, otherLow + otherSize);
|
|
1009
|
+
return from <= to ? (from + to) / 2 : otherLow > low ? low + size : low;
|
|
1010
|
+
};
|
|
1011
|
+
return { x: nearest(rect.x, rect.w, other.x, other.w), y: nearest(rect.y, rect.h, other.y, other.h) };
|
|
1012
|
+
}
|
|
1013
|
+
function sameRect(a, b) {
|
|
1014
|
+
return a.x === b.x && a.y === b.y && a.w === b.w && a.h === b.h;
|
|
1015
|
+
}
|
|
1016
|
+
var MOVED_LEADER_MIN = 12, MOVED_VALUE_KINDS = /* @__PURE__ */ new Set(["point", "segment", "total", "grandTotal"]), OWN_BAR_REACH = 8, INSIDE_PAD = 4, MOVED_LEADER_MIN_SLOPE = 0.5;
|
|
1017
|
+
function movedValueRun(bar, rect) {
|
|
1018
|
+
let gutter = LEADER_GUTTER_RATIO * rect.h, above = rect.y + rect.h / 2 < bar.y + bar.h / 2, to = { x: rect.x + rect.w / 2, y: above ? rect.y + rect.h + gutter : rect.y - gutter }, from = { x: Math.min(Math.max(to.x, bar.x), bar.x + bar.w), y: Math.min(Math.max(to.y, bar.y), bar.y + bar.h) }, dx = Math.abs(to.x - from.x), dy = Math.abs(to.y - from.y);
|
|
1019
|
+
return dy >= MOVED_LEADER_MIN_SLOPE * dx && Math.hypot(dx, dy) >= LEADER_MIN_DRAWN_RATIO * rect.h ? { from, to } : dx === 0 && dy < rect.h ? "over" : "beside";
|
|
1020
|
+
}
|
|
1021
|
+
function offsetBlockedWarning(req, seat, occupied, padding, selfAnn, ctx) {
|
|
1022
|
+
let leave = "so the label stays where the chart placed it", what, suggest = "Use a smaller or another offset, or give the chart more room.";
|
|
1023
|
+
if (ctx.canvas && !rectContains(ctx.canvas, seat.rect, 0) || ctx.plot && !rectsOverlap(ctx.plot, seat.rect, 0))
|
|
1024
|
+
what = `would move label '${req.id}' off the chart`, suggest = "Use a smaller offset.";
|
|
1025
|
+
else if (seat.besideBar)
|
|
1026
|
+
what = `would set value '${req.id}' beside its bar, where it reads as a neighbour's value`, suggest = "Move it further up or down, so its leader can reach its bar.";
|
|
1027
|
+
else {
|
|
1028
|
+
let hits = occupied.hitsWhich(seat.rect, padding).filter((o) => !(o.kind === "annotation" && selfAnn && o.owner.annotationId === selfAnn && (o.part === "bracketLabel" || !rectsOverlap(o.rect, seat.rect, 0))) && !(o.kind === "mark" && isOwnMark(o.owner, req.owner, req.kind, o.part))), other = [...ctx.naturalSeats ?? []].find(([id, rect]) => id !== req.id && rectsOverlap(rect, seat.rect, padding))?.[0];
|
|
1029
|
+
what = `would move label '${req.id}' onto ${plainBlockers(hits, other)}`;
|
|
1030
|
+
}
|
|
1031
|
+
return { code: "label-offset-blocked", severity: "warn", message: `labelOffsets ${what}, ${leave}`, owner: req.owner, suggest };
|
|
1032
|
+
}
|
|
1033
|
+
function plainBlockers(hits, otherLabel) {
|
|
1034
|
+
let parts = [], add = (text) => {
|
|
1035
|
+
parts.includes(text) || parts.push(text);
|
|
1036
|
+
};
|
|
1037
|
+
for (let o of hits) {
|
|
1038
|
+
let of = Object.keys(o.owner).length > 0 ? ` of ${formatOwner(o.owner)}` : "";
|
|
1039
|
+
o.kind === "label" ? add(`the label${of}`) : o.kind === "mark" ? add(`the mark${of}`) : o.kind === "annotation" ? add(`the annotation${o.owner.annotationId ? ` '${o.owner.annotationId}'` : ""}`) : o.kind === "axis" ? add("the axis labels") : o.kind === "legend" ? add("the legend") : o.kind === "frame" ? add("the title or the notes") : add(`the ${o.kind}${of}`);
|
|
1040
|
+
}
|
|
1041
|
+
return otherLabel !== void 0 && add(`the place of label '${otherLabel}'`), parts.length > 0 ? parts.join("; ") : "the space around another label";
|
|
1042
|
+
}
|
|
1043
|
+
function movedLeaderStart(seat, move) {
|
|
1044
|
+
let edge = (low, size, by = 0) => by > 0 ? low : by < 0 ? low + size : low + size / 2;
|
|
1045
|
+
return { x: edge(seat.x, seat.w, move.x), y: edge(seat.y, seat.h, move.y) };
|
|
1046
|
+
}
|
|
1166
1047
|
var LED_FROM_R = 3;
|
|
1167
|
-
function describeBlockers(hits, req, selfAnn) {
|
|
1048
|
+
function describeBlockers(hits, req, selfAnn, none = "the canvas edge") {
|
|
1168
1049
|
let parts = [];
|
|
1169
1050
|
for (let o of hits) {
|
|
1170
1051
|
if (o.kind === "annotation" && selfAnn && o.owner.annotationId === selfAnn || o.kind === "mark" && isOwnMark(o.owner, req.owner, req.kind, o.part)) continue;
|
|
1171
1052
|
let label = `${o.kind}${o.part ? ` '${o.part}'` : ""} of ${formatOwner(o.owner)}`;
|
|
1172
1053
|
parts.includes(label) || parts.push(label);
|
|
1173
1054
|
}
|
|
1174
|
-
return parts.length > 0 ? parts.join("; ") :
|
|
1055
|
+
return parts.length > 0 ? parts.join("; ") : none;
|
|
1175
1056
|
}
|
|
1176
1057
|
function sameOwner(a, b) {
|
|
1177
1058
|
return ["seriesId", "categoryId", "segmentId", "pointId", "annotationId"].every((key) => a[key] === b[key]);
|
|
@@ -1220,6 +1101,7 @@ function leaderHeightOf(cand) {
|
|
|
1220
1101
|
function leaderAt(cand, lineHeight) {
|
|
1221
1102
|
let from = cand.leaderFrom;
|
|
1222
1103
|
if (!from) return;
|
|
1104
|
+
if (cand.leaderTo) return { d: leaderPath(from, cand.leaderTo, 1 / 0), curved: !1 };
|
|
1223
1105
|
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;
|
|
1224
1106
|
if (approachesFromLeft ? dx <= 0 : dx >= 0) return cand.leaderVertical ? verticalLeader(cand.rect, from) : void 0;
|
|
1225
1107
|
if (Math.hypot(dx, dy) < minimum) return;
|
|
@@ -1269,20 +1151,69 @@ function finalize(base, _req, cand, pinned, darkInk, lightInk) {
|
|
|
1269
1151
|
return label;
|
|
1270
1152
|
}
|
|
1271
1153
|
|
|
1154
|
+
// src/core/annotationArrow.ts
|
|
1155
|
+
var ARROW_STANDARD = { head: 8, headWidth: 7, tipGap: 6, tailGap: 4, minShaft: 24 };
|
|
1156
|
+
function arrowLook(theme, compact) {
|
|
1157
|
+
let spec = theme.marks?.arrow;
|
|
1158
|
+
if (spec?.style === "compact") {
|
|
1159
|
+
let stroke2 = strokeToken(theme, "rule");
|
|
1160
|
+
return {
|
|
1161
|
+
standard: !1,
|
|
1162
|
+
stroke: stroke2,
|
|
1163
|
+
depth: compact.size * Math.abs(Math.cos(Math.PI * 0.85)),
|
|
1164
|
+
half: compact.size * Math.abs(Math.sin(Math.PI * 0.85)),
|
|
1165
|
+
shaftEnd: arrowShaftEnd(compact.size, stroke2),
|
|
1166
|
+
tipGap: compact.tipGap ?? 0,
|
|
1167
|
+
tailGap: compact.tailGap ?? 0,
|
|
1168
|
+
minShaft: 0,
|
|
1169
|
+
head: (tip, angle) => arrowHeadPath(tip, angle, compact.size)
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
let stroke = spec?.stroke ?? strokeToken(theme, "rule"), depth = spec?.head ?? ARROW_STANDARD.head, half = (spec?.headWidth ?? ARROW_STANDARD.headWidth) / 2;
|
|
1173
|
+
return {
|
|
1174
|
+
standard: !0,
|
|
1175
|
+
stroke,
|
|
1176
|
+
depth,
|
|
1177
|
+
half,
|
|
1178
|
+
// Depth at which the head is as wide as the shaft, plus half a pixel.
|
|
1179
|
+
shaftEnd: Math.min(depth, stroke / 2 * (depth / half) + 0.5),
|
|
1180
|
+
tipGap: spec?.tipGap ?? ARROW_STANDARD.tipGap,
|
|
1181
|
+
tailGap: spec?.tailGap ?? ARROW_STANDARD.tailGap,
|
|
1182
|
+
minShaft: spec?.minShaft ?? ARROW_STANDARD.minShaft,
|
|
1183
|
+
head: (tip, angle) => {
|
|
1184
|
+
let ux = Math.cos(angle), uy = Math.sin(angle), bx = tip.x - ux * depth, by = tip.y - uy * depth;
|
|
1185
|
+
return `M${fmtPathNumber(tip.x)} ${fmtPathNumber(tip.y)}L${fmtPathNumber(bx - uy * half)} ${fmtPathNumber(by + ux * half)}L${fmtPathNumber(bx + uy * half)} ${fmtPathNumber(by - ux * half)}Z`;
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1272
1190
|
// src/core/annotateCallout.ts
|
|
1273
|
-
var
|
|
1274
|
-
function
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1191
|
+
var COMPACT_REACH = 22, COMPACT = { size: 4, tipGap: 4, tailGap: 3 };
|
|
1192
|
+
function calloutArrowLook(theme) {
|
|
1193
|
+
return arrowLook(theme, COMPACT);
|
|
1194
|
+
}
|
|
1195
|
+
function calloutArrowReach(look, edge) {
|
|
1196
|
+
return look.standard ? edge + look.tipGap + look.depth + look.minShaft + look.tailGap : COMPACT_REACH;
|
|
1197
|
+
}
|
|
1198
|
+
function arrowSeats(anchor, w, h, lineH, prefer, reach, standard, valueBox) {
|
|
1199
|
+
let y = anchor.y - lineH / 2, vertical = prefer === "above" || prefer === "below", side = [
|
|
1200
|
+
{ slot: "arrowRight", rect: { x: anchor.x + reach, y, w, h }, penalty: vertical ? 0.5 : prefer === "left" ? -2.5 : -3 },
|
|
1201
|
+
{ slot: "arrowLeft", rect: { x: anchor.x - reach - w, y, w, h }, penalty: vertical ? 0.6 : prefer === "left" ? -3 : -2.5 }
|
|
1279
1202
|
];
|
|
1203
|
+
if (!standard) return side;
|
|
1204
|
+
let top = Math.min(anchor.y, valueBox?.y ?? anchor.y), bottom = Math.max(anchor.y, valueBox ? valueBox.y + valueBox.h : anchor.y);
|
|
1205
|
+
return [
|
|
1206
|
+
...side,
|
|
1207
|
+
{ slot: "arrowAbove", rect: { x: anchor.x - w / 2, y: top - reach - h, w, h }, penalty: prefer === "above" ? -3 : prefer === "below" ? 0.8 : 0.7 },
|
|
1208
|
+
{ slot: "arrowBelow", rect: { x: anchor.x - w / 2, y: bottom + reach, w, h }, penalty: prefer === "below" ? -3 : prefer === "above" ? 0.8 : 0.75 }
|
|
1209
|
+
].sort((a, b) => a.penalty - b.penalty);
|
|
1280
1210
|
}
|
|
1281
|
-
function tail(rect, anchor) {
|
|
1211
|
+
function tail(rect, anchor, gap) {
|
|
1282
1212
|
let y = Math.min(Math.max(anchor.y, rect.y), rect.y + rect.h);
|
|
1283
|
-
return anchor.x < rect.x ? { x: rect.x -
|
|
1213
|
+
return anchor.x < rect.x ? { x: rect.x - gap, y } : anchor.x > rect.x + rect.w ? { x: rect.x + rect.w + gap, y } : { x: anchor.x, y: anchor.y < rect.y ? rect.y - gap : rect.y + rect.h + gap };
|
|
1284
1214
|
}
|
|
1285
|
-
function finishCalloutHeads(theme, labels, plans, nodes, occupied) {
|
|
1215
|
+
function finishCalloutHeads(theme, labels, plans, nodes, occupied, warnings) {
|
|
1216
|
+
let look = calloutArrowLook(theme);
|
|
1286
1217
|
for (let label of labels) {
|
|
1287
1218
|
let plan = plans.get(label.id);
|
|
1288
1219
|
if (!plan) continue;
|
|
@@ -1291,15 +1222,23 @@ function finishCalloutHeads(theme, labels, plans, nodes, occupied) {
|
|
|
1291
1222
|
continue;
|
|
1292
1223
|
}
|
|
1293
1224
|
if (label.font = plan.font, plan.headline && (label.headLines = plan.headlineLines ?? 1, label.headWeight = plan.headlineWeight), !plan.arrow) continue;
|
|
1294
|
-
let { anchor,
|
|
1295
|
-
|
|
1296
|
-
|
|
1225
|
+
let { owner, valueBox } = plan.arrow, { anchor, edge } = plan.arrow, from = tail(label.rect, anchor, look.tailGap);
|
|
1226
|
+
look.standard && valueBox && segmentHitsRect(from, anchor, valueBox) && (anchor = { x: Math.min(Math.max(from.x, valueBox.x), valueBox.x + valueBox.w), y: Math.min(Math.max(from.y, valueBox.y), valueBox.y + valueBox.h) }, edge = 0);
|
|
1227
|
+
let length = Math.hypot(anchor.x - from.x, anchor.y - from.y), tipGap = look.standard ? edge + look.tipGap : look.tipGap;
|
|
1228
|
+
if (look.standard ? length - tipGap - look.depth < look.minShaft - 0.5 : length <= look.tipGap + COMPACT.size) {
|
|
1229
|
+
plan.arrow.nodeIds.splice(0), look.standard && warnings.push({
|
|
1230
|
+
code: "callout-arrow-no-room",
|
|
1231
|
+
severity: "warn",
|
|
1232
|
+
owner,
|
|
1233
|
+
message: `callout '${owner.annotationId}': its text found no seat far enough from its point for an arrow of ${look.minShaft} px, so it is drawn without the arrow`,
|
|
1234
|
+
suggest: "Give the callout a preferSide with free room, or leave arrow out."
|
|
1235
|
+
});
|
|
1297
1236
|
continue;
|
|
1298
1237
|
}
|
|
1299
|
-
let ux = (anchor.x - from.x) / length, uy = (anchor.y - from.y) / length, tip = { x: anchor.x - ux *
|
|
1238
|
+
let ux = (anchor.x - from.x) / length, uy = (anchor.y - from.y) / length, tip = { x: anchor.x - ux * tipGap, y: anchor.y - uy * tipGap }, shaft = look.shaftEnd, end = { x: tip.x - ux * shaft, y: tip.y - uy * shaft }, [shaftId, headId] = plan.arrow.nodeIds;
|
|
1300
1239
|
delete label.leader, nodes.push(
|
|
1301
|
-
{ t: "path", id: shaftId, d: `M${from.x} ${from.y}L${end.x} ${end.y}`, stroke: { token: "ink" }, width:
|
|
1302
|
-
{ t: "path", id: headId, d:
|
|
1240
|
+
{ t: "path", id: shaftId, d: `M${from.x} ${from.y}L${end.x} ${end.y}`, stroke: { token: "ink" }, width: look.stroke, owner, part: "calloutArrow" },
|
|
1241
|
+
{ t: "path", id: headId, d: look.head(tip, Math.atan2(uy, ux)), fill: { token: "ink" }, owner, part: "calloutArrow" }
|
|
1303
1242
|
), occupied.claim(
|
|
1304
1243
|
{ x: Math.min(from.x, tip.x) - 0.5, y: Math.min(from.y, tip.y) - 0.5, w: Math.abs(tip.x - from.x) + 1, h: Math.abs(tip.y - from.y) + 1 },
|
|
1305
1244
|
"annotation",
|
|
@@ -1484,6 +1423,7 @@ function labelsToNodes(theme, labels, fontOf, marks) {
|
|
|
1484
1423
|
}
|
|
1485
1424
|
|
|
1486
1425
|
// src/core/repaintGeometry.ts
|
|
1426
|
+
var withoutPointer = ({ field: _field, fix: _fix, ...warning }) => warning;
|
|
1487
1427
|
function repaintGeometry(geometry, theme, options) {
|
|
1488
1428
|
let scene = repaintScene(geometry.scene, theme, sceneThemeBindings(geometry)), warnings = geometry.paintWarningRules?.length ? refreshPaintWarnings(geometry.warnings, geometry.paintWarningRules.map((rule) => rule.kind === "mark-lost-on-band" ? { ...rule, pairs: marksOnBands(scene) } : rule), theme) : [...geometry.warnings];
|
|
1489
1429
|
if (options?.palette && warnings.some((warning) => warning.code === "unknown-palette")) {
|
|
@@ -1497,13 +1437,17 @@ function repaintGeometry(geometry, theme, options) {
|
|
|
1497
1437
|
for (let panel of [...panels].reverse()) {
|
|
1498
1438
|
let chart = panel.chart;
|
|
1499
1439
|
if (!chart || chart.warningOffset === void 0) continue;
|
|
1500
|
-
let child = repaintGeometry(chart.geometry, chart.theme ? resolveTheme(chart.theme) : theme, chart.options)
|
|
1440
|
+
let child = repaintGeometry(chart.geometry, chart.theme ? resolveTheme(chart.theme) : theme, chart.options), passedOn = new Map(chart.geometry.warnings.flatMap((warning, index) => {
|
|
1441
|
+
let forwarded = warnings[chart.warningOffset + index];
|
|
1442
|
+
return forwarded?.code === warning.code && forwarded.detail?.panelId === panel.id && forwarded.message === `[${panel.id}] ${warning.message}` ? [[warning, forwarded]] : [];
|
|
1443
|
+
}));
|
|
1501
1444
|
warnings.splice(
|
|
1502
1445
|
chart.warningOffset,
|
|
1503
1446
|
chart.geometry.warnings.length,
|
|
1504
|
-
...child.warnings.map((warning) => ({
|
|
1505
|
-
...warning,
|
|
1447
|
+
...child.warnings.map((warning) => passedOn.get(warning) ?? {
|
|
1448
|
+
...withoutPointer(warning),
|
|
1506
1449
|
message: `[${panel.id}] ${warning.message}`,
|
|
1450
|
+
detail: { ...warning.detail, panelId: panel.id },
|
|
1507
1451
|
...chart.warningOwnerPrefix === void 0 ? {} : {
|
|
1508
1452
|
owner: warning.owner ? {
|
|
1509
1453
|
...warning.owner,
|
|
@@ -1511,7 +1455,7 @@ function repaintGeometry(geometry, theme, options) {
|
|
|
1511
1455
|
...warning.owner.valueLineId === void 0 ? {} : { valueLineId: chart.warningOwnerPrefix + warning.owner.valueLineId }
|
|
1512
1456
|
} : void 0
|
|
1513
1457
|
}
|
|
1514
|
-
})
|
|
1458
|
+
})
|
|
1515
1459
|
);
|
|
1516
1460
|
}
|
|
1517
1461
|
}
|
|
@@ -1952,7 +1896,7 @@ function renderNodeInner(node, theme, formatter, tf, interaction, idScope, rootF
|
|
|
1952
1896
|
}
|
|
1953
1897
|
|
|
1954
1898
|
// src/core/aspect.ts
|
|
1955
|
-
var furnitureBudget = (width) => width < 720 ? 0.5 : 0.4, ASPECT_LADDER = [
|
|
1899
|
+
var furnitureBudget = (width) => classStepWidth(width) < 720 ? 0.5 : 0.4, ASPECT_LADDER = [
|
|
1956
1900
|
{ name: "strip", ratio: 4.5 },
|
|
1957
1901
|
{ name: "band", ratio: 3.6 },
|
|
1958
1902
|
{ name: "wide", ratio: 2.84 },
|
|
@@ -2143,7 +2087,7 @@ function collectSeriesIdentities(layout, data, options) {
|
|
|
2143
2087
|
}
|
|
2144
2088
|
function textNames(node, name) {
|
|
2145
2089
|
if (node.t !== "text" || !name.trim()) return !1;
|
|
2146
|
-
let escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2090
|
+
let escaped = name.trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+");
|
|
2147
2091
|
return new RegExp(`(?<![\\p{L}\\p{N}_])${escaped}(?![\\p{L}\\p{N}_])`, "iu").test(node.lines.join(" "));
|
|
2148
2092
|
}
|
|
2149
2093
|
function nameIsDrawn(geometry, name, id) {
|
|
@@ -2295,7 +2239,7 @@ function readableLabelDestination(geo) {
|
|
|
2295
2239
|
let hostId = prefix + label.printedIn, host = labels.get(hostId), node = nodes.get(host?.nodeId ?? `label:${hostId}`) ?? nodes.get(hostId), printed = node ? printedText.get(node.id) : "";
|
|
2296
2240
|
if (node && (containsText(printed, words(host?.text ?? text)) || containsText(printed, normalized))) return `label:${hostId}`;
|
|
2297
2241
|
}
|
|
2298
|
-
let named = kind === "series" || kind === "category" || kind === "restSeries" || kind === "source", numeric = ["point", "segment", "total", "grandTotal", "insidePie", "outsidePie", "growth"].includes(kind ?? "") && label?.role !== "category" && label?.printsFor?.length !== 0, own = ownerKey(owner), scoped = (node) => !prefix || node.id.startsWith(prefix) || node.origin?.panels.some((panel) => prefix.startsWith(`${panel}/`)), sameOwner2 = (node) => Object.keys(owner).length > 0 && nodeOwners.get(node.id) === own, sameQuantity = (node) => !numeric || textRole(node) === "value" && (painted.get(node.id)?.kind === kind || label?.
|
|
2242
|
+
let named = kind === "series" || kind === "category" || kind === "restSeries" || kind === "source", numeric = ["point", "segment", "total", "grandTotal", "insidePie", "outsidePie", "growth"].includes(kind ?? "") && label?.role !== "category" && label?.printsFor?.length !== 0, own = ownerKey(owner), scoped = (node) => !prefix || node.id.startsWith(prefix) || node.origin?.panels.some((panel) => prefix.startsWith(`${panel}/`)), sameOwner2 = (node) => Object.keys(owner).length > 0 && nodeOwners.get(node.id) === own, sameQuantity = (node) => !numeric || textRole(node) === "value" && (painted.get(node.id)?.kind === kind || label?.claimIds?.some((id2) => painted.get(node.id)?.claimIds?.includes(id2)) || owner.rowId !== void 0 && owner.colId !== void 0), match = (exact.get(normalized) ?? []).find((node) => scoped(node) && (sameOwner2(node) && sameQuantity(node) || named && !["value", "axis"].includes(textRole(node))));
|
|
2299
2243
|
if (match) return `scene:${match.id}`;
|
|
2300
2244
|
let shared = Object.keys(owner).length ? owners.get(own)?.find((node) => scoped(node) && containsText(printedText.get(node.id), normalized) && (sameOwner2(node) ? named : !0)) : void 0;
|
|
2301
2245
|
if (shared) return `scene:${shared.id}`;
|
|
@@ -2308,9 +2252,9 @@ function readableLabelDestination(geo) {
|
|
|
2308
2252
|
return note ? `scene:${note.id}` : void 0;
|
|
2309
2253
|
};
|
|
2310
2254
|
}
|
|
2311
|
-
function omissionScope(geo, options, id, data) {
|
|
2255
|
+
function omissionScope(geo, options, id, data, type) {
|
|
2312
2256
|
let panel = geo.marks.panels?.find((panel2) => id.startsWith(`${panel2.id}/`) && panel2.chart), sourcePanel = data?.panels?.find((source) => source.id === panel?.id);
|
|
2313
|
-
return panel?.chart ? omissionScope(panel.chart.geometry, panel.chart.options, id.slice(panel.id.length + 1), sourcePanel?.data) : { geometry: geo, options, id, data };
|
|
2257
|
+
return panel?.chart ? omissionScope(panel.chart.geometry, panel.chart.options, id.slice(panel.id.length + 1), sourcePanel?.data, sourcePanel?.type) : { geometry: geo, options, id, data, ...type ? { type } : {} };
|
|
2314
2258
|
}
|
|
2315
2259
|
function intentionalOmission(geo, options, data, omission, labelFor) {
|
|
2316
2260
|
let scope = omissionScope(geo, options, omission.labelId, data), settings = typeof scope.options?.labels == "object" && scope.options.labels !== null ? scope.options.labels : void 0;
|
|
@@ -2411,8 +2355,18 @@ function partialPattern(category, pattern, outlined = !1) {
|
|
|
2411
2355
|
return pattern ?? (category?.partial === !0 && !outlined ? "hatch45" : void 0);
|
|
2412
2356
|
}
|
|
2413
2357
|
function partialFootnotes(categories, strings, keyed = !1) {
|
|
2414
|
-
let
|
|
2415
|
-
return
|
|
2358
|
+
let names = partialNames(categories, strings);
|
|
2359
|
+
return names === void 0 || keyed ? [] : [disclosureNote(names)];
|
|
2360
|
+
}
|
|
2361
|
+
function partialNames(categories, strings) {
|
|
2362
|
+
let toDate = strings?.toDate ?? localeStrings().toDate, labels = categories.filter((c) => c.partial === !0).map((c) => (c.label ?? c.id).replace(/\s*\n\s*/g, " "));
|
|
2363
|
+
if (labels.length === 0) return;
|
|
2364
|
+
let parts = [], run = [], close = () => {
|
|
2365
|
+
run.length > 0 && parts.push(`${run.join(", ")} ${toDate}`.trim()), run = [];
|
|
2366
|
+
};
|
|
2367
|
+
for (let label of labels)
|
|
2368
|
+
saysToDate(label, toDate) ? (close(), parts.push(label)) : run.push(label);
|
|
2369
|
+
return close(), parts.join(", ");
|
|
2416
2370
|
}
|
|
2417
2371
|
function partialAxisWords(strings, options, keyed = !1) {
|
|
2418
2372
|
return keyed || disclosuresShown(options) ? void 0 : strings?.toDate ?? localeStrings().toDate;
|
|
@@ -2425,7 +2379,7 @@ function partialIds(categories) {
|
|
|
2425
2379
|
return new Set(categories.filter((category) => category.partial === !0).map((category) => category.id));
|
|
2426
2380
|
}
|
|
2427
2381
|
function partialLegendKeys(painted, strings, categories = []) {
|
|
2428
|
-
let
|
|
2382
|
+
let label = partialNames(categories, strings) ?? strings?.partial ?? localeStrings().partial;
|
|
2429
2383
|
return painted ? [{ id: "__partial", label, paint: { token: "markInk" }, pattern: "hatch45" }] : [];
|
|
2430
2384
|
}
|
|
2431
2385
|
var PARTIAL_KEY = /* @__PURE__ */ Symbol("boardplot.partialKey");
|
|
@@ -2496,9 +2450,6 @@ function categoryLabelsAndMarks(categories, refs, toDate) {
|
|
|
2496
2450
|
};
|
|
2497
2451
|
}
|
|
2498
2452
|
|
|
2499
|
-
// src/core/types/sizing.ts
|
|
2500
|
-
var HEIGHT_STRUCTURE = /* @__PURE__ */ Symbol("heightStructure"), VALUE_SELECTION = /* @__PURE__ */ Symbol("valueSelection");
|
|
2501
|
-
|
|
2502
2453
|
// src/core/strings/frame.ts
|
|
2503
2454
|
var EN = {
|
|
2504
2455
|
// reader-facing wording linked only by its consumers.
|
|
@@ -2516,12 +2467,181 @@ var EN = {
|
|
|
2516
2467
|
listedInNotes: "Vollst\xE4ndiger Text steht in der Anmerkungsliste"
|
|
2517
2468
|
}, { chartString: chartString2, localeStrings: localeStrings2 } = chartStrings(EN, DE);
|
|
2518
2469
|
|
|
2470
|
+
// src/core/frameText.ts
|
|
2471
|
+
var HIDDEN_LABEL_LEAD = "Not labelled on the chart";
|
|
2472
|
+
function frameText(input) {
|
|
2473
|
+
let { footFont, measure, footWidth: footW, policy } = input, footMeasure = input.source && hasBold(input.source) || input.footnotes.some((note) => hasBold(note.text)) ? boldMeasurer(measure, input.boldWeight) : measure, warnings = [], marked = [], countable = !1, fullStatic = policy.pinned, placement = fullStatic ? "frame" : input.notes?.placement ?? defaultNotePlacement(input.target), budget = fullStatic ? 1 / 0 : input.notes?.maxLines ?? defaultNoteLines(input.target, input.width), shown = new Set(input.notes?.show ?? ["note"]), pointerOn = !fullStatic && !input.footnotesOff && input.notes?.pointer !== !1, metas = /* @__PURE__ */ new Map();
|
|
2474
|
+
for (let note of input.footnotes) metas.set(note.text, note.meta);
|
|
2475
|
+
let mark = (text, meta) => (metas.set(text, meta), marked.push({ text, meta }), text), entries = [];
|
|
2476
|
+
{
|
|
2477
|
+
let notes = input.footnotes.map((note) => note.text), numbered = input.numberedFootnotes ?? notes, unreferencedNotes = new Set(input.unreferencedNotes ?? []), next = 0, referenced = !1, unmarked = [];
|
|
2478
|
+
for (let f of notes) {
|
|
2479
|
+
let numberedHere = next < numbered.length && numbered[next] === f && !f.startsWith(`${HIDDEN_LABEL_LEAD}:`), numberedDisclosure = numberedHere && (input.numberedDisclosures?.includes(next + 1) ?? !1), marker = numberedHere && !unreferencedNotes.has(next + 1) ? `${footnoteMark(next + 1)} ` : "";
|
|
2480
|
+
marker && (referenced = !0), numberedHere && marker === "" && unmarked.push(next + 1), numberedHere && (next += 1);
|
|
2481
|
+
let meta = numberedHere ? void 0 : metas.get(f);
|
|
2482
|
+
if (fullStatic && meta?.list && (countable = !0), meta?.list) {
|
|
2483
|
+
let fitted = fittedNote(meta.list, (text) => wrapFootnote(markBold(text), footFont, footW, footMeasure).length <= 2);
|
|
2484
|
+
f = meta.short ? mark(f, { kind: "disclosure", short: fitted, values: meta.values, list: meta.list }) : mark(fitted, { kind: "disclosure", values: meta.values, list: meta.list });
|
|
2485
|
+
}
|
|
2486
|
+
let kind = numberedDisclosure ? "disclosure" : numberedHere ? "note" : meta?.kind ?? "method", fittedShort = metas.get(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, ...metas.get(f), ...meta.ranks ? { ranks: !0 } : {} } : void 0;
|
|
2487
|
+
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));
|
|
2488
|
+
}
|
|
2489
|
+
!input.footnotesOff && unmarked.length > 0 && referenced && warnings.push({
|
|
2490
|
+
code: "footnote-unreferenced",
|
|
2491
|
+
severity: "info",
|
|
2492
|
+
message: `${unmarked.length === 1 ? "note" : "notes"} ${unmarked.join(", ")} ${unmarked.length === 1 ? "has" : "have"} no category or cell pointing at ${unmarked.length === 1 ? "it" : "them"} (footnote: n), so ${unmarked.length === 1 ? "it prints" : "they print"} without a number`,
|
|
2493
|
+
suggest: "set footnote: n on the category or cell the note explains, or keep it as a note about the whole exhibit"
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
let rank = { note: 0, disclosure: 1, method: 2, source: 3, credit: 4 };
|
|
2497
|
+
entries.sort((a, b) => rank[a.kind] - rank[b.kind]);
|
|
2498
|
+
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.compactSourceLines === 0;
|
|
2499
|
+
sourceOff && warnings.push({ code: "footnotes-off", severity: "info", message: `compact frame has no room for the source line: ${sourceText}` });
|
|
2500
|
+
let pointed = new Set(input.pointedNotes ?? []), kept = entries.filter((entry) => entry.kind === "disclosure" ? (input.notesShowAuthored === !0 || !policy.live || entry.ref !== void 0 || entry.ranks === !0) && (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 = policy.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), pointerAt = (k2) => {
|
|
2501
|
+
let hidden = listed(k2);
|
|
2502
|
+
return pointerOn && hidden > 0 ? notesPointer(hidden, input.strings) : void 0;
|
|
2503
|
+
}, sourcePara = (k2) => {
|
|
2504
|
+
let pointer = pointerAt(k2), source = sourceOff ? void 0 : sourceText;
|
|
2505
|
+
return source === void 0 ? pointer : pointer === void 0 ? source : `${source}${/[.!?]$/.test(source) ? "" : "."} ${pointer}`;
|
|
2506
|
+
}, sourceLines = (text) => {
|
|
2507
|
+
let fitted = !fullStatic && input.compactSourceLines === 1 ? fitText(markBold(text), footFont, footW, 1, footMeasure) : void 0;
|
|
2508
|
+
return fitted ? { lines: fitted.lines, ...fitted.title ? { title: fitted.title } : {} } : { lines: wrapFootnote(markBold(text), footFont, footW, footMeasure) };
|
|
2509
|
+
}, noteLines = candidates.map((entry) => wrapFootnote(markBold(entry.drawn), footFont, footW, footMeasure)), usedAt = (k2) => {
|
|
2510
|
+
let para = sourcePara(k2);
|
|
2511
|
+
return noteLines.slice(0, k2).reduce((sum, lines) => sum + lines.length, 0) + (para ? sourceLines(para).lines.length : 0);
|
|
2512
|
+
}, k = candidates.length;
|
|
2513
|
+
for (; k > 0 && !(usedAt(k) <= budget); k--) ;
|
|
2514
|
+
let visible = /* @__PURE__ */ new Set([...candidates.slice(0, k), ...kept]), sourceBlock = sourcePara(k);
|
|
2515
|
+
if (policy.live && !fullStatic && input.notes?.pointer === !1 && !input.footnotesOff && placement !== "list") {
|
|
2516
|
+
let left = candidates.filter((entry) => entry.kind === "note" && (infoPanel || !visible.has(entry))).length;
|
|
2517
|
+
left > 0 && warnings.push({
|
|
2518
|
+
code: "notes-left-out",
|
|
2519
|
+
severity: "warn",
|
|
2520
|
+
message: `${left} author ${left === 1 ? "note is" : "notes are"} not shown: ${infoPanel ? "under notes.placement 'info'" : `the line budget of ${budget} lines leaves ${left === 1 ? "it" : "them"} out of the footer, and`} notes.pointer: false hides the notes list`,
|
|
2521
|
+
suggest: infoPanel ? `Remove notes.pointer: false, so the notes button lists ${left === 1 ? "it" : "them"}.` : `Set notes.maxLines to ${usedAt(candidates.length)} to print ${left === 1 ? "it" : "them"}, or remove notes.pointer: false, so "+N notes" lists ${left === 1 ? "it" : "them"}.`,
|
|
2522
|
+
field: ["options", "notes", "pointer"],
|
|
2523
|
+
fix: [{ op: "remove", path: "/options/notes/pointer" }]
|
|
2524
|
+
});
|
|
2525
|
+
}
|
|
2526
|
+
if (input.footnotesOff) {
|
|
2527
|
+
let leftOff = entries.filter((entry) => !kept.includes(entry)).map((entry) => entry.text);
|
|
2528
|
+
leftOff.length && warnings.push({ code: "footnotes-off", severity: "info", message: `footnotes: false left these notes off: ${leftOff.join(" | ")}` });
|
|
2529
|
+
}
|
|
2530
|
+
let unprinted = entries.filter((entry) => !visible.has(entry)).map((entry) => entry.text), noteList = [
|
|
2531
|
+
...entries.map((entry) => keepNoteMeta({ kind: entry.kind, text: entry.text, ...entry.short ? { short: entry.short } : {}, inFrame: visible.has(entry), ...entry.ref ? { ref: entry.ref } : {} }, engineNoteMeta(entry))),
|
|
2532
|
+
...input.source ? [{ kind: "source", text: input.source, inFrame: !sourceOff }] : [],
|
|
2533
|
+
...credit ? [{ kind: "credit", text: credit.text, short: credit.short, ...credit.links.length ? { links: credit.links.map((link) => ({ ...link })) } : {}, inFrame: creditInFrame }] : []
|
|
2534
|
+
].map((entry, i) => keepNoteMeta({ n: i + 1, ...entry }, engineNoteMeta(entry))), printed = entries.filter((entry) => visible.has(entry)).map((entry) => {
|
|
2535
|
+
let at = candidates.indexOf(entry);
|
|
2536
|
+
return { entry, lines: at >= 0 ? noteLines[at] : wrapFootnote(markBold(entry.drawn), footFont, footW, footMeasure) };
|
|
2537
|
+
});
|
|
2538
|
+
return {
|
|
2539
|
+
...input.title ? { title: input.title } : {},
|
|
2540
|
+
...input.subtitle ? { subtitle: subtitleText(input.subtitle, input.unit) } : {},
|
|
2541
|
+
placement,
|
|
2542
|
+
footMeasure,
|
|
2543
|
+
entries,
|
|
2544
|
+
printed,
|
|
2545
|
+
sourceText,
|
|
2546
|
+
sourceOff,
|
|
2547
|
+
sourceBlock,
|
|
2548
|
+
pointer: pointerAt(k),
|
|
2549
|
+
sourceLines,
|
|
2550
|
+
creditInFrame,
|
|
2551
|
+
pointerOn,
|
|
2552
|
+
noteList,
|
|
2553
|
+
unprinted,
|
|
2554
|
+
warnings,
|
|
2555
|
+
countable,
|
|
2556
|
+
marked
|
|
2557
|
+
};
|
|
2558
|
+
}
|
|
2559
|
+
var listText = (lead, items) => `${lead}: ${items.join(", ").replace(/\.$/, "")}.`;
|
|
2560
|
+
function fittedNote(list, fits) {
|
|
2561
|
+
let at = (k) => listedNoteText(list, k), low = 0, high = Math.min(list.items.length, noteCap(list.options, list.items.length));
|
|
2562
|
+
if (fits(at(high))) return at(high);
|
|
2563
|
+
for (; high - low > 1; ) {
|
|
2564
|
+
let mid = low + high >> 1;
|
|
2565
|
+
fits(at(mid)) ? low = mid : high = mid;
|
|
2566
|
+
}
|
|
2567
|
+
return at(low);
|
|
2568
|
+
}
|
|
2569
|
+
function listedNoteText({ lead, items, total, options }, k) {
|
|
2570
|
+
let n = items.length;
|
|
2571
|
+
return k === 0 ? listText(lead, [total !== void 0 && total >= n ? countedValuesText(n, total, options) : moreListedText(n, options, !0)]) : listText(lead, k < n ? [...items.slice(0, k), moreListedText(n - k, options)] : items);
|
|
2572
|
+
}
|
|
2573
|
+
var DEFAULT_NOTE_LIMIT = 8;
|
|
2574
|
+
function noteCap(options, count = 0) {
|
|
2575
|
+
let max = options?.notes?.maxListed, cap = max === "all" ? 1 / 0 : typeof max == "number" && max >= 0 ? Math.floor(max) : DEFAULT_NOTE_LIMIT;
|
|
2576
|
+
return cap && count === cap + 1 ? count : cap;
|
|
2577
|
+
}
|
|
2578
|
+
function moreListedText(count, options, alone = !1) {
|
|
2579
|
+
return alone ? chartString2(options, "countedItems", { count }) : (options?.strings?.moreListed ?? "and {count} more").replace("{count}", String(count));
|
|
2580
|
+
}
|
|
2581
|
+
function countedValuesText(count, total, options) {
|
|
2582
|
+
return chartString2(options, "countedValues", { count, total });
|
|
2583
|
+
}
|
|
2584
|
+
function cappedItems(items, options, total) {
|
|
2585
|
+
let cap = noteCap(options, items.length);
|
|
2586
|
+
return items.length <= cap ? [...items] : cap === 0 && total !== void 0 && total >= items.length ? [countedValuesText(items.length, total, options)] : [...items.slice(0, cap), moreListedText(items.length - cap, options, cap === 0)];
|
|
2587
|
+
}
|
|
2588
|
+
var UNIT_SIGNS = [
|
|
2589
|
+
[/\b(?:EUR|euros?)\b/gi, "\u20AC"],
|
|
2590
|
+
[/\bUSD\b/gi, "$"],
|
|
2591
|
+
[/\bGBP\b/gi, "\xA3"],
|
|
2592
|
+
[/\bJPY\b/gi, "\xA5"],
|
|
2593
|
+
[/\b(?:percent(?:ages?)?|per\s+cent|pct)\b/gi, "%"]
|
|
2594
|
+
];
|
|
2595
|
+
function unitWordsAsSigns(text) {
|
|
2596
|
+
return UNIT_SIGNS.reduce((out, [code, sign]) => out.replace(code, sign), text);
|
|
2597
|
+
}
|
|
2598
|
+
function measureNamesUnit(unit, measure) {
|
|
2599
|
+
measure = unitWordsAsSigns(plainText(measure));
|
|
2600
|
+
let escaped = unitWordsAsSigns(unit.trim()).replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+");
|
|
2601
|
+
return escaped.length > 0 && new RegExp(`(?<![\\p{L}\\p{N}_])${escaped}(?![\\p{L}\\p{N}_])`, "iu").test(measure);
|
|
2602
|
+
}
|
|
2603
|
+
function subtitleUnitClause(unit, measure) {
|
|
2604
|
+
let normalized = unit.trim().toLowerCase();
|
|
2605
|
+
return normalized === "x" || normalized === "\xD7" || normalized === "ratio" ? /\bper\b/i.test(measure) ? "" : /\bratio\b/i.test(measure) ? " (\xD7)" : " ratio (\xD7)" : measureNamesUnit(unit, measure) ? "" : ` in ${unit}`;
|
|
2606
|
+
}
|
|
2607
|
+
function frameRendersUnit(input) {
|
|
2608
|
+
return !!(input.subtitle && input.unit && (measureNamesUnit(input.unit, input.subtitle.measure) || subtitleUnitClause(input.unit, input.subtitle.measure).length > 0));
|
|
2609
|
+
}
|
|
2610
|
+
function unitPrinted(input) {
|
|
2611
|
+
return !!(input.unitShown && input.unit) || frameRendersUnit(input);
|
|
2612
|
+
}
|
|
2613
|
+
function subtitleLine(sub) {
|
|
2614
|
+
return [sub.company, sub.measure, sub.period, sub.scenarios?.length ? formatScenarios(sub.scenarios) : void 0].filter(Boolean).join(" \xB7 ");
|
|
2615
|
+
}
|
|
2616
|
+
function measureUnitTail(measure, unit) {
|
|
2617
|
+
let at = measure.lastIndexOf(", ");
|
|
2618
|
+
if (at <= 0) return "";
|
|
2619
|
+
let tail2 = measure.slice(at + 2);
|
|
2620
|
+
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) : "";
|
|
2621
|
+
}
|
|
2622
|
+
function subtitleText(authored, unit) {
|
|
2623
|
+
let sub = hasBold(authored.measure) || hasBold(authored.company ?? "") || hasBold(authored.period ?? "") ? {
|
|
2624
|
+
...authored,
|
|
2625
|
+
measure: markBold(authored.measure),
|
|
2626
|
+
...authored.company ? { company: markBold(authored.company) } : {},
|
|
2627
|
+
...authored.period ? { period: markBold(authored.period) } : {}
|
|
2628
|
+
} : authored, trailing = "";
|
|
2629
|
+
frameRendersUnit({ subtitle: authored, unit }) && (trailing += subtitleUnitClause(unit, sub.measure)), sub.period && (trailing += ` \xB7 ${sub.period}`), sub.scenarios && sub.scenarios.length > 0 && (trailing += ` \xB7 ${formatScenarios(sub.scenarios)}`);
|
|
2630
|
+
let segments = [];
|
|
2631
|
+
sub.company && segments.push({ text: `${sub.company} \xB7 `, bold: !1 });
|
|
2632
|
+
let unitTail = measureUnitTail(sub.measure, unit), lone = !sub.company && !unitTail && !trailing;
|
|
2633
|
+
return segments.push({ text: sub.measure.slice(0, sub.measure.length - unitTail.length), bold: !lone }), (unitTail || trailing) && segments.push({ text: unitTail + trailing, bold: !1 }), { sub, segments };
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
// src/core/types/sizing.ts
|
|
2637
|
+
var HEIGHT_STRUCTURE = /* @__PURE__ */ Symbol("heightStructure"), VALUE_SELECTION = /* @__PURE__ */ Symbol("valueSelection");
|
|
2638
|
+
|
|
2519
2639
|
// src/core/frame.ts
|
|
2520
2640
|
function legendRequired(option, warnings, chartType, theme, reason = "the mapped range and no-data encoding must remain explicit") {
|
|
2521
2641
|
let position = theme?.legend?.required ?? "top";
|
|
2522
2642
|
return option === "none" ? (warnings.push({
|
|
2523
2643
|
code: `${chartType}-legend-required`,
|
|
2524
|
-
severity: "
|
|
2644
|
+
severity: "warn",
|
|
2525
2645
|
message: `${chartType} legend cannot be hidden because ${reason}`
|
|
2526
2646
|
}), { position }) : normalizeLegendOption(option, { position });
|
|
2527
2647
|
}
|
|
@@ -2577,6 +2697,7 @@ function frameTextOptions(options) {
|
|
|
2577
2697
|
...options[LIVE_NOTE_SHOW] ? { [LIVE_NOTE_SHOW]: options[LIVE_NOTE_SHOW] } : {},
|
|
2578
2698
|
strings: options.strings,
|
|
2579
2699
|
...options.notes !== void 0 || shownNoteKinds(options) !== void 0 ? { notes: { ...options.notes, show: shownNoteKinds(options) } } : {},
|
|
2700
|
+
...options.notes?.show !== void 0 && options[NOTES_ASKED] !== !0 ? { notesShowAuthored: !0 } : {},
|
|
2580
2701
|
footnotes: options.footnotes === !1 ? [] : options.footnotes,
|
|
2581
2702
|
...options.footnotesOff === !0 || options.footnotes === !1 ? { footnotesOff: !0 } : {},
|
|
2582
2703
|
numberedFootnotes: options.authoredFootnotes ?? authoredNotes(options),
|
|
@@ -2594,7 +2715,7 @@ function htmlFooterHeight(input, parts, sourceText, font, width, lineH, measure)
|
|
|
2594
2715
|
let height = (text) => wrapFootnote(markBold(text), font, width, measure).length * lineH, total = 0;
|
|
2595
2716
|
for (let note of parts.shown)
|
|
2596
2717
|
total += height(`${note.ref ? `${footnoteMark(note.ref)} ` : ""}${note.kind === "method" || note.kind === "disclosure" ? note.short ?? note.text : note.text}`);
|
|
2597
|
-
let credit = parts.credit && `${chartString2(input, "mapCredit")}: ${parts.credit.text}`, label = parts.panel.length === 0 ? void 0 : parts.info ?
|
|
2718
|
+
let credit = parts.credit && `${chartString2(input, "mapCredit")}: ${parts.credit.text}`, label = parts.panel.length === 0 ? void 0 : parts.info ? notesPanelLabel(parts.panel.length, chartString(input, "notesAndSources")) : notesPointer(parts.panel.length, input.strings), items = [
|
|
2598
2719
|
...parts.source && sourceText ? [{ w: measure(markBold(sourceText), font).width, text: sourceText }] : [],
|
|
2599
2720
|
...credit && parts.info ? [{ w: measure(credit, font).width, text: credit }] : [],
|
|
2600
2721
|
...label ? [{ w: Math.max(NOTE_HIT_PX, measure(label, font).width), h: Math.max(NOTE_HIT_PX, lineH) }] : []
|
|
@@ -2823,21 +2944,6 @@ function shiftLegendKeyY(node, dy) {
|
|
|
2823
2944
|
}
|
|
2824
2945
|
}
|
|
2825
2946
|
}
|
|
2826
|
-
function measureNamesUnit(unit, measure) {
|
|
2827
|
-
measure = plainText(measure);
|
|
2828
|
-
let escaped = unit.trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+");
|
|
2829
|
-
return escaped.length > 0 && new RegExp(`(?<![\\p{L}\\p{N}_])${escaped}(?![\\p{L}\\p{N}_])`, "iu").test(measure);
|
|
2830
|
-
}
|
|
2831
|
-
function subtitleUnitClause(unit, measure) {
|
|
2832
|
-
let normalized = unit.trim().toLowerCase();
|
|
2833
|
-
return normalized === "x" || normalized === "\xD7" || normalized === "ratio" ? /\bper\b/i.test(measure) ? "" : /\bratio\b/i.test(measure) ? " (\xD7)" : " ratio (\xD7)" : measureNamesUnit(unit, measure) ? "" : ` in ${unit}`;
|
|
2834
|
-
}
|
|
2835
|
-
function frameRendersUnit(input) {
|
|
2836
|
-
return !!(input.subtitle && input.unit && (measureNamesUnit(input.unit, input.subtitle.measure) || subtitleUnitClause(input.unit, input.subtitle.measure).length > 0));
|
|
2837
|
-
}
|
|
2838
|
-
function unitPrinted(input) {
|
|
2839
|
-
return !!(input.unitShown && input.unit) || frameRendersUnit(input);
|
|
2840
|
-
}
|
|
2841
2947
|
function unitNotShownLints(options, geo) {
|
|
2842
2948
|
if (!unitMissing(options, geo)) return [];
|
|
2843
2949
|
let unit = options.unit.trim();
|
|
@@ -2885,20 +2991,6 @@ function noteLine(lead, items, options, total) {
|
|
|
2885
2991
|
options?.notes?.maxListed === void 0 && options ? { lead, items, total, options } : void 0
|
|
2886
2992
|
)];
|
|
2887
2993
|
}
|
|
2888
|
-
var listText = (lead, items) => `${lead}: ${items.join(", ").replace(/\.$/, "")}.`;
|
|
2889
|
-
function fittedNote(list, fits) {
|
|
2890
|
-
let at = (k) => listedNoteText(list, k), low = 0, high = Math.min(list.items.length, noteCap(list.options, list.items.length));
|
|
2891
|
-
if (fits(at(high))) return at(high);
|
|
2892
|
-
for (; high - low > 1; ) {
|
|
2893
|
-
let mid = low + high >> 1;
|
|
2894
|
-
fits(at(mid)) ? low = mid : high = mid;
|
|
2895
|
-
}
|
|
2896
|
-
return at(low);
|
|
2897
|
-
}
|
|
2898
|
-
function listedNoteText({ lead, items, total, options }, k) {
|
|
2899
|
-
let n = items.length;
|
|
2900
|
-
return k === 0 ? listText(lead, [total !== void 0 && total >= n ? countedValuesText(n, total, options) : moreListedText(n, options, !0)]) : listText(lead, k < n ? [...items.slice(0, k), moreListedText(n - k, options)] : items);
|
|
2901
|
-
}
|
|
2902
2994
|
function namedInDrawnNote(list, drawn) {
|
|
2903
2995
|
let flat = (text) => text.replace(/\s+/g, ""), target = flat(drawn);
|
|
2904
2996
|
for (let k = Math.min(list.items.length, noteCap(list.options, list.items.length)); k >= 0; k--) if (flat(listedNoteText(list, k)) === target) return k;
|
|
@@ -2906,22 +2998,6 @@ function namedInDrawnNote(list, drawn) {
|
|
|
2906
2998
|
function valueNoteLine(lead, items, options, total) {
|
|
2907
2999
|
return noteLine(lead, items, options, total).map((line) => valueNote(line, items));
|
|
2908
3000
|
}
|
|
2909
|
-
var DEFAULT_NOTE_LIMIT = 8;
|
|
2910
|
-
function noteCap(options, count = 0) {
|
|
2911
|
-
let max = options?.notes?.maxListed, cap = max === "all" ? 1 / 0 : typeof max == "number" && max >= 0 ? Math.floor(max) : DEFAULT_NOTE_LIMIT;
|
|
2912
|
-
return cap && count === cap + 1 ? count : cap;
|
|
2913
|
-
}
|
|
2914
|
-
function moreListedText(count, options, alone = !1) {
|
|
2915
|
-
return alone ? chartString2(options, "countedItems", { count }) : (options?.strings?.moreListed ?? "and {count} more").replace("{count}", String(count));
|
|
2916
|
-
}
|
|
2917
|
-
function countedValuesText(count, total, options) {
|
|
2918
|
-
return chartString2(options, "countedValues", { count, total });
|
|
2919
|
-
}
|
|
2920
|
-
function cappedItems(items, options, total) {
|
|
2921
|
-
let cap = noteCap(options, items.length);
|
|
2922
|
-
return items.length <= cap ? [...items] : cap === 0 && total !== void 0 && total >= items.length ? [countedValuesText(items.length, total, options)] : [...items.slice(0, cap), moreListedText(items.length - cap, options, cap === 0)];
|
|
2923
|
-
}
|
|
2924
|
-
var HIDDEN_LABEL_LEAD = "Not labelled on the chart";
|
|
2925
3001
|
function withCutLabelNotes(data, options, layout) {
|
|
2926
3002
|
let first = layout(options);
|
|
2927
3003
|
if (first.refused) return first;
|
|
@@ -3152,7 +3228,13 @@ function hiddenNoteWith(options, extras) {
|
|
|
3152
3228
|
let own = options, items = new Map(own[NOTE_ITEMS]);
|
|
3153
3229
|
for (let { id, text } of extras) items.set(id, { text });
|
|
3154
3230
|
let plan = planNote(items, own[NOTE_CONTEXT] ?? { data: void 0 }, own);
|
|
3155
|
-
return {
|
|
3231
|
+
return {
|
|
3232
|
+
footnotes: authoredNotes(own).filter((note) => note !== own[NOTE_LINE]),
|
|
3233
|
+
line: plan.line ? [plan.line] : [],
|
|
3234
|
+
ids: new Set(items.keys()),
|
|
3235
|
+
counted: plan.counted,
|
|
3236
|
+
marks: { strings: own.strings, [NOTE_ITEMS]: items, [NOTE_LINE]: plan.line, [NOTE_COUNTED]: plan.counted }
|
|
3237
|
+
};
|
|
3156
3238
|
}
|
|
3157
3239
|
function markNotedLabels(geo, noted, from) {
|
|
3158
3240
|
let ids = new Set(geo.frame.footnoteNodeIds ?? []), notes = [
|
|
@@ -3175,12 +3257,24 @@ function markNotedLabels(geo, noted, from) {
|
|
|
3175
3257
|
gone.size > 0 && (geo.scene = geo.scene.filter((node) => !gone.has(node.id)));
|
|
3176
3258
|
}
|
|
3177
3259
|
function unitMissing(options, geo) {
|
|
3260
|
+
return unitUnprinted(options, {
|
|
3261
|
+
type: geo.type,
|
|
3262
|
+
derived: geo.derived,
|
|
3263
|
+
refused: geo.warnings.some((w) => w.severity === "error"),
|
|
3264
|
+
*texts() {
|
|
3265
|
+
yield geo.scene.flatMap((node) => node.t === "text" && node.id.startsWith("frame:subtitle") ? node.lines : []).join(" ");
|
|
3266
|
+
for (let node of geo.scene) node.t === "text" && (yield node.lines.join(" "));
|
|
3267
|
+
}
|
|
3268
|
+
});
|
|
3269
|
+
}
|
|
3270
|
+
function unitUnprinted(options, drawn) {
|
|
3178
3271
|
let unit = typeof options?.unit == "string" ? options.unit.trim() : "";
|
|
3179
|
-
if (!unit || options?.unitShown === !0 ||
|
|
3272
|
+
if (!unit || options?.unitShown === !0 || drawn.refused || drawn.type === "variance" && options?.variant === "relative" || drawn.type === "table" && drawn.derived?.table?.columnUnits || printsOnlyShares(drawn.type, options, drawn.derived)) return !1;
|
|
3180
3273
|
let subtitle = resolveSubtitle(options?.subtitle);
|
|
3181
3274
|
if (subtitle && subtitleUnitClause(unit, subtitle.measure) === "" || !squeezeUnit(unit)) return !1;
|
|
3182
|
-
let
|
|
3183
|
-
|
|
3275
|
+
let carriesUnit = drawn.type === "cohort" ? textCarriesCohortUnit : textCarriesUnit;
|
|
3276
|
+
for (let text of drawn.texts()) if (carriesUnit(text, unit)) return !1;
|
|
3277
|
+
return !0;
|
|
3184
3278
|
}
|
|
3185
3279
|
var PERCENT_UNIT = /^(?:%|percent|per\s*cent|pct|percentage)(?!\p{L})/iu, isPercentUnit = (unit) => PERCENT_UNIT.test(unit.trim());
|
|
3186
3280
|
function columnSegmentsPrintAbsolute(options) {
|
|
@@ -3214,8 +3308,8 @@ function shareUnitLints(options, geo) {
|
|
|
3214
3308
|
let unit = typeof options?.unit == "string" ? options.unit.trim() : "";
|
|
3215
3309
|
if (!unit || PERCENT_UNIT.test(unit) || !printsOnlyShares(geo.type, options, geo.derived)) return [];
|
|
3216
3310
|
if (geo.warnings.some((w) => w.severity === "error")) return [];
|
|
3217
|
-
let measure = resolveSubtitle(options?.subtitle)?.measure ?? "",
|
|
3218
|
-
if (!measure || !textCarriesUnit(
|
|
3311
|
+
let measure = resolveSubtitle(options?.subtitle)?.measure ?? "", subtitleText2 = geo.scene.flatMap((node) => node.t === "text" && node.id.startsWith("frame:subtitle") ? node.lines : []).join(" ");
|
|
3312
|
+
if (!measure || !textCarriesUnit(subtitleText2, unit)) return [];
|
|
3219
3313
|
let escaped = unit.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+"), clause = new RegExp(`(?:\\bin|,|\\()\\s*${escaped}\\s*\\)?\\s*$`, "iu");
|
|
3220
3314
|
if (!clause.test(measure)) return [];
|
|
3221
3315
|
let kept = measure.replace(clause, "").trim(), path = typeof options?.subtitle == "string" ? "/options/subtitle" : "/options/subtitle/measure";
|
|
@@ -3228,19 +3322,13 @@ function shareUnitLints(options, geo) {
|
|
|
3228
3322
|
...kept ? { fix: [{ op: "replace", path, value: kept }] } : {}
|
|
3229
3323
|
}];
|
|
3230
3324
|
}
|
|
3231
|
-
var
|
|
3232
|
-
[/\b(?:EUR|euros?)\b/gi, "\u20AC"],
|
|
3233
|
-
[/\bUSD\b/gi, "$"],
|
|
3234
|
-
[/\bGBP\b/gi, "\xA3"],
|
|
3235
|
-
[/\bJPY\b/gi, "\xA5"],
|
|
3236
|
-
[/\b(?:percent|pct)\b/gi, "%"]
|
|
3237
|
-
], signedUnit = (text) => squeezeUnit(UNIT_SIGNS.reduce((out, [code, sign]) => out.replace(code, sign), text));
|
|
3325
|
+
var signedUnit = (text) => squeezeUnit(unitWordsAsSigns(text));
|
|
3238
3326
|
function textCarriesUnit(text, unit) {
|
|
3239
3327
|
let needle = signedUnit(unit);
|
|
3240
3328
|
if (needle === "") return !1;
|
|
3241
3329
|
if (needle.replace(/[^\p{L}]/gu, "").length > 2) return signedUnit(text).includes(needle);
|
|
3242
3330
|
let between = String.raw`[\d\s.,'’+\-−]*`, pattern = [...needle].map((char) => char.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join(between);
|
|
3243
|
-
return new RegExp(String.raw`(?<!\p{L})${pattern}(?!\p{L})`, "iu").test(
|
|
3331
|
+
return new RegExp(String.raw`(?<!\p{L})${pattern}(?!\p{L})`, "iu").test(unitWordsAsSigns(text));
|
|
3244
3332
|
}
|
|
3245
3333
|
function textCarriesCohortUnit(text, unit) {
|
|
3246
3334
|
let words2 = /\b(?:percentages?|per\s+cent|prozent)\b/gi;
|
|
@@ -3252,28 +3340,8 @@ function stringsIn(value) {
|
|
|
3252
3340
|
function squeezeUnit(text) {
|
|
3253
3341
|
return text.replace(/[\d\s.,'’+\-−]/g, "").toLowerCase();
|
|
3254
3342
|
}
|
|
3255
|
-
function
|
|
3256
|
-
|
|
3257
|
-
}
|
|
3258
|
-
function measureUnitTail(measure, unit) {
|
|
3259
|
-
let at = measure.lastIndexOf(", ");
|
|
3260
|
-
if (at <= 0) return "";
|
|
3261
|
-
let tail2 = measure.slice(at + 2);
|
|
3262
|
-
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) : "";
|
|
3263
|
-
}
|
|
3264
|
-
function measureSubtitle(input, x, y, id, nextId, contentW) {
|
|
3265
|
-
let authored = input.subtitle, sub = hasBold(authored.measure) || hasBold(authored.company ?? "") || hasBold(authored.period ?? "") ? {
|
|
3266
|
-
...authored,
|
|
3267
|
-
measure: markBold(authored.measure),
|
|
3268
|
-
...authored.company ? { company: markBold(authored.company) } : {},
|
|
3269
|
-
...authored.period ? { period: markBold(authored.period) } : {}
|
|
3270
|
-
} : authored, font = { family: input.theme.type.family, ...input.theme.type.subtitle }, boldFont = { ...font, weight: emphasisWeight(input.theme) }, trailing = "";
|
|
3271
|
-
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)}`);
|
|
3272
|
-
let segments = [];
|
|
3273
|
-
sub.company && segments.push({ text: `${sub.company} \xB7 `, bold: !1 });
|
|
3274
|
-
let unitTail = measureUnitTail(sub.measure, input.unit), lone = !sub.company && !unitTail && !trailing;
|
|
3275
|
-
segments.push({ text: sub.measure.slice(0, sub.measure.length - unitTail.length), bold: !lone }), (unitTail || trailing) && segments.push({ text: unitTail + trailing, bold: !1 });
|
|
3276
|
-
let lineH = font.size * (font.lineHeight ?? 1.3), runs = subtitleRuns(segments.map((seg) => ({
|
|
3343
|
+
function measureSubtitle(input, composed, x, y, id, nextId, contentW) {
|
|
3344
|
+
let { sub, segments } = composed, font = { family: input.theme.type.family, ...input.theme.type.subtitle }, boldFont = { ...font, weight: emphasisWeight(input.theme) }, lineH = font.size * (font.lineHeight ?? 1.3), runs = subtitleRuns(segments.map((seg) => ({
|
|
3277
3345
|
text: seg.text.replace(/^ /, "\xA0").replace(/ $/, "\xA0"),
|
|
3278
3346
|
...seg.bold ? { weight: boldFont.weight } : {}
|
|
3279
3347
|
})), 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;
|
|
@@ -3442,7 +3510,30 @@ function solveFrame(input, occupied) {
|
|
|
3442
3510
|
gapFootnoteSource: 0,
|
|
3443
3511
|
gapLegend: 8
|
|
3444
3512
|
}
|
|
3445
|
-
) : spaceTokens(theme, size.width), nodes = [], frame = {}, warnings = [], contentX = margin.left, contentW = size.width - margin.left - margin.right, headerW = size.width - margin.left - Math.min(margin.right, Math.max(0, tokens.margin.right)), topY = margin.top, bottomY = size.height - margin.bottom, seq = 0, nid = (part) => `frame:${part}:${seq++}`, bottomBlocks = [], drawBottomLegend, withFamily = (f) => ({ family: theme.type.family, ...f }), bottomKey = input.legend?.options.position === "bottom" && ((input.legend.items.length ?? 0) > 0 || (input.eventKey?.legend?.length ?? 0) > 0), footGap = bottomKey ? tokens.gapKeyFootnote : tokens.gapAxisFootnote
|
|
3513
|
+
) : spaceTokens(theme, size.width), nodes = [], frame = {}, warnings = [], contentX = margin.left, contentW = size.width - margin.left - margin.right, headerW = size.width - margin.left - Math.min(margin.right, Math.max(0, tokens.margin.right)), topY = margin.top, bottomY = size.height - margin.bottom, seq = 0, nid = (part) => `frame:${part}:${seq++}`, bottomBlocks = [], drawBottomLegend, withFamily = (f) => ({ family: theme.type.family, ...f }), bottomKey = input.legend?.options.position === "bottom" && ((input.legend.items.length ?? 0) > 0 || (input.eventKey?.legend?.length ?? 0) > 0), footGap = bottomKey ? tokens.gapKeyFootnote : tokens.gapAxisFootnote, footFont = withFamily(footerType(theme.type.footnote, input.target, input.textScale)), footInset = Math.max(0, Math.min(input.footerInset ?? 0, (contentW - 1) / 2)), footW = contentW - 2 * footInset, text = frameText({
|
|
3514
|
+
target: input.target,
|
|
3515
|
+
title: input.title || void 0,
|
|
3516
|
+
subtitle: input.subtitle,
|
|
3517
|
+
unit: input.unit,
|
|
3518
|
+
source: input.source,
|
|
3519
|
+
credit: input.credit,
|
|
3520
|
+
notes: input.notes,
|
|
3521
|
+
notesShowAuthored: input.notesShowAuthored,
|
|
3522
|
+
strings: input.strings,
|
|
3523
|
+
footnotes: (input.footnotes ?? []).map((note) => ({ text: note, meta: engineNoteMeta(note) })),
|
|
3524
|
+
footnotesOff: input.footnotesOff,
|
|
3525
|
+
numberedFootnotes: input.numberedFootnotes,
|
|
3526
|
+
unreferencedNotes: input.unreferencedNotes,
|
|
3527
|
+
numberedDisclosures: input.numberedDisclosures,
|
|
3528
|
+
pointedNotes: input.pointedNotes,
|
|
3529
|
+
compactSourceLines: input[COMPACT_SOURCE_LINES],
|
|
3530
|
+
width: size.width,
|
|
3531
|
+
footWidth: footW,
|
|
3532
|
+
footFont,
|
|
3533
|
+
boldWeight: emphasisWeight(theme),
|
|
3534
|
+
measure,
|
|
3535
|
+
policy: { pinned: staticFrame.pinned, live: staticFrame.live }
|
|
3536
|
+
});
|
|
3446
3537
|
if (input.title) {
|
|
3447
3538
|
let titleFont = theme.type.title, compactSize = input.mode === "compact" ? input.compactTitleSize ?? titleFont.size : titleFont.size, baseFont = withFamily(titleFont), fitOptions = {
|
|
3448
3539
|
target: input.target,
|
|
@@ -3478,61 +3569,17 @@ function solveFrame(input, occupied) {
|
|
|
3478
3569
|
occupied.claim({ x: contentX, y: topY, w: headerW, h }, "frame", {}), frame.titleNodeId = id, frame.titleLines = lines.length, topY += h + tokens.gapTitleSubtitle;
|
|
3479
3570
|
}
|
|
3480
3571
|
if (input.subtitle) {
|
|
3481
|
-
let subtitle = measureSubtitle(input, contentX, topY, nid("subtitle"), () => nid("subtitle"), headerW);
|
|
3572
|
+
let subtitle = measureSubtitle(input, text.subtitle, contentX, topY, nid("subtitle"), () => nid("subtitle"), headerW);
|
|
3482
3573
|
nodes.push(...subtitle.nodes), occupied.claim(subtitle.rect, "frame", {}), frame.subtitleNodeId = subtitle.nodes[0].id, topY += subtitle.rect.h + tokens.gapSubtitlePlot;
|
|
3483
3574
|
} else input.title && (topY += input.cardGaps ? 8 : tokens.gapSubtitlePlot - tokens.gapTitleSubtitle);
|
|
3484
|
-
!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);
|
|
3485
|
-
let
|
|
3486
|
-
{
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
marker && (referenced = !0), numberedHere && marker === "" && unmarked.push(next + 1), numberedHere && (next += 1);
|
|
3491
|
-
let meta = numberedHere ? void 0 : engineNoteMeta(f);
|
|
3492
|
-
if (fullStatic && meta?.list && (staticFrame.countable = !0), meta?.list) {
|
|
3493
|
-
let fitted = fittedNote(meta.list, (text) => wrapFootnote(markBold(text), footFont, footW, footMeasure).length <= 2);
|
|
3494
|
-
f = meta.short ? engineNote(f, "disclosure", fitted, meta.values, meta.list) : engineNote(fitted, "disclosure", void 0, meta.values, meta.list);
|
|
3495
|
-
}
|
|
3496
|
-
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;
|
|
3497
|
-
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));
|
|
3498
|
-
}
|
|
3499
|
-
!input.footnotesOff && unmarked.length > 0 && referenced && warnings.push({
|
|
3500
|
-
code: "footnote-unreferenced",
|
|
3501
|
-
severity: "info",
|
|
3502
|
-
message: `${unmarked.length === 1 ? "note" : "notes"} ${unmarked.join(", ")} ${unmarked.length === 1 ? "has" : "have"} no category or cell pointing at ${unmarked.length === 1 ? "it" : "them"} (footnote: n), so ${unmarked.length === 1 ? "it prints" : "they print"} without a number`,
|
|
3503
|
-
suggest: "set footnote: n on the category or cell the note explains, or keep it as a note about the whole exhibit"
|
|
3504
|
-
});
|
|
3505
|
-
}
|
|
3506
|
-
let rank = { note: 0, disclosure: 1, method: 2, source: 3, credit: 4 };
|
|
3507
|
-
entries.sort((a, b) => rank[a.kind] - rank[b.kind]);
|
|
3508
|
-
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;
|
|
3509
|
-
sourceOff && (frame.source = input.source, warnings.push({ code: "footnotes-off", severity: "info", message: `compact frame has no room for the source line: ${sourceText}` }));
|
|
3510
|
-
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) => {
|
|
3511
|
-
let hidden = listed(k2), pointer = pointerOn && hidden > 0 ? notesPointer(hidden, input.strings) : void 0, source = sourceOff ? void 0 : sourceText;
|
|
3512
|
-
return source === void 0 ? pointer : pointer === void 0 ? source : `${source}${/[.!?]$/.test(source) ? "" : "."} ${pointer}`;
|
|
3513
|
-
}, 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;
|
|
3514
|
-
for (; k > 0; k--) {
|
|
3515
|
-
let para = sourcePara(k);
|
|
3516
|
-
if (noteLines.slice(0, k).reduce((sum, lines) => sum + lines.length, 0) + (para ? sourceLines(para).length : 0) <= budget) break;
|
|
3517
|
-
}
|
|
3518
|
-
let visible = /* @__PURE__ */ new Set([...candidates.slice(0, k), ...kept]), sourceBlock = sourcePara(k);
|
|
3519
|
-
if (input.footnotesOff) {
|
|
3520
|
-
let leftOff = entries.filter((entry) => !kept.includes(entry)).map((entry) => entry.text);
|
|
3521
|
-
leftOff.length && warnings.push({ code: "footnotes-off", severity: "info", message: `footnotes: false left these notes off: ${leftOff.join(" | ")}` });
|
|
3522
|
-
}
|
|
3523
|
-
let unprinted = entries.filter((entry) => !visible.has(entry)).map((entry) => entry.text);
|
|
3524
|
-
unprinted.length > 0 && (frame.notes = unprinted);
|
|
3525
|
-
let noteList = [
|
|
3526
|
-
...entries.map((entry) => keepNoteMeta({ kind: entry.kind, text: entry.text, ...entry.short ? { short: entry.short } : {}, inFrame: visible.has(entry), ...entry.ref ? { ref: entry.ref } : {} }, engineNoteMeta(entry))),
|
|
3527
|
-
...input.source ? [{ kind: "source", text: input.source, inFrame: !sourceOff }] : [],
|
|
3528
|
-
...credit ? [{ kind: "credit", text: credit.text, short: credit.short, ...credit.links.length ? { links: credit.links.map((link) => ({ ...link })) } : {}, inFrame: creditInFrame }] : []
|
|
3529
|
-
].map((entry, i) => keepNoteMeta({ n: i + 1, ...entry }, engineNoteMeta(entry)));
|
|
3530
|
-
noteList.length > 0 && (frame.noteList = noteList), frame.notePlacement = placement;
|
|
3575
|
+
!input.cardGaps && (input.subtitle || input.title) && theme.space.gap?.subtitlePlot === void 0 && classStepWidth(size.width) < WIDE_CANVAS_MIN_WIDTH && recordFreedChrome(frame, "header-gap", REFERENCE_SUBTITLE_PLOT_GAP - tokens.gapSubtitlePlot);
|
|
3576
|
+
let liveFooterH = 0, footLineH = footFont.size * (footFont.lineHeight ?? 1.3), footX = contentX + footInset, fullStatic = staticFrame.pinned;
|
|
3577
|
+
for (let { text: note, meta } of text.marked) engineNote(note, meta.kind, meta.short, meta.values, meta.list ?? null);
|
|
3578
|
+
text.countable && (staticFrame.countable = !0);
|
|
3579
|
+
let { placement, footMeasure, sourceText, sourceOff, sourceBlock, noteList } = text, hitRoom = (y) => placement === "info" ? Math.min(y, size.height - NOTE_HIT_PX) : y, credit = input.credit, creditInFrame = text.creditInFrame, pointerOn = text.pointerOn;
|
|
3580
|
+
pushAll(warnings, text.warnings), sourceOff && (frame.source = input.source), text.unprinted.length > 0 && (frame.notes = text.unprinted), noteList.length > 0 && (frame.noteList = noteList), frame.notePlacement = placement;
|
|
3531
3581
|
let footParts = [
|
|
3532
|
-
...
|
|
3533
|
-
let at = candidates.indexOf(entry);
|
|
3534
|
-
return { text: entry.drawn, kind: "footnote", lines: at >= 0 ? noteLines[at] : wrapFootnote(markBold(entry.drawn), footFont, footW, footMeasure) };
|
|
3535
|
-
}),
|
|
3582
|
+
...text.printed.map(({ entry, lines }) => ({ text: entry.drawn, kind: "footnote", lines })),
|
|
3536
3583
|
...sourceBlock ? [{ text: sourceBlock, kind: "source" }] : [],
|
|
3537
3584
|
...credit && creditInFrame ? [{ text: `${chartString2(input, "mapCredit")}: ${credit.text}`, kind: "credit" }] : []
|
|
3538
3585
|
], 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;
|
|
@@ -3543,7 +3590,7 @@ function solveFrame(input, occupied) {
|
|
|
3543
3590
|
if (footParts.length > 0 || liveFooterH > 0) {
|
|
3544
3591
|
frame.footnoteNodeIds = [];
|
|
3545
3592
|
for (let i = footParts.length - 1; i >= 0; i--) {
|
|
3546
|
-
let p = footParts[i], fitted = p.kind === "source" ?
|
|
3593
|
+
let p = footParts[i], fitted = p.kind === "source" ? text.sourceLines(p.text) : void 0, lines = p.lines ?? fitted?.lines ?? wrapFootnote(p.kind === "credit" ? p.text : markBold(p.text), footFont, footW, footMeasure);
|
|
3547
3594
|
bottomY -= footLineH * lines.length, footLines += lines.length;
|
|
3548
3595
|
let id = nid(p.kind);
|
|
3549
3596
|
nodes.push({
|
|
@@ -3565,7 +3612,7 @@ function solveFrame(input, occupied) {
|
|
|
3565
3612
|
gap: i > 0 && (p.kind === "source" || p.kind === "credit" && footParts[i - 1].kind === "footnote") ? tokens.gapFootnoteSource : 0
|
|
3566
3613
|
}), p.kind === "credit" ? (frame.creditNodeId = id, i > 0 && footParts[i - 1].kind === "footnote" && (bottomY -= tokens.gapFootnoteSource)) : p.kind === "source" ? (frame.sourceNodeId = id, i > 0 && (bottomY -= tokens.gapFootnoteSource)) : frame.footnoteNodeIds.unshift(id);
|
|
3567
3614
|
}
|
|
3568
|
-
liveFooterH > size.height - margin.bottom - bottomY + 0.01 && (liveFooterExtra.set(frame, liveFooterH - (size.height - margin.bottom - bottomY) + (footParts.length === 0 ? input.eventKey ? KEY_NOTE_GAP : footGap : 0)), bottomY = size.height - margin.bottom - liveFooterH), bottomY = hitRoom(bottomY), frame.footerRect = { x: contentX, y: bottomY, w: contentW, h: size.height - margin.bottom - bottomY }, bottomY -= input.eventKey ? KEY_NOTE_GAP : footGap, recordFreedChrome(frame, "footer-text", footLines * (withFamily(theme.type.footnote).size - footFont.size) * (footFont.lineHeight ?? 1.3)), !input.cardGaps && !input.eventKey && bottomKey && theme.space.gap?.axisFootnote === void 0 && size.width < WIDE_CANVAS_MIN_WIDTH && recordFreedChrome(frame, "key-footer-gap", REFERENCE_FOOTER_GAP - tokens.gapKeyFootnote);
|
|
3615
|
+
liveFooterH > size.height - margin.bottom - bottomY + 0.01 && (liveFooterExtra.set(frame, liveFooterH - (size.height - margin.bottom - bottomY) + (footParts.length === 0 ? input.eventKey ? KEY_NOTE_GAP : footGap : 0)), bottomY = size.height - margin.bottom - liveFooterH), bottomY = hitRoom(bottomY), frame.footerRect = { x: contentX, y: bottomY, w: contentW, h: size.height - margin.bottom - bottomY }, bottomY -= input.eventKey ? KEY_NOTE_GAP : footGap, recordFreedChrome(frame, "footer-text", footLines * (withFamily(theme.type.footnote).size - footFont.size) * (footFont.lineHeight ?? 1.3)), !input.cardGaps && !input.eventKey && bottomKey && theme.space.gap?.axisFootnote === void 0 && classStepWidth(size.width) < WIDE_CANVAS_MIN_WIDTH && recordFreedChrome(frame, "key-footer-gap", REFERENCE_FOOTER_GAP - tokens.gapKeyFootnote);
|
|
3569
3616
|
}
|
|
3570
3617
|
if (footerPlans.set(frame, fullStatic ? { ...input, fullStaticFooter: !0 } : input), credit?.required && frame.creditNodeId === void 0 && warnings.push({ code: "credit-hidden", severity: "warn", message: `the map credit the licence requires is not drawn: ${credit.text}`, suggest: "Keep the credit visible under the chart, linked on a web page." }), input.eventKey) {
|
|
3571
3618
|
let key = input.eventKey.layout(contentX, contentW);
|
|
@@ -3575,10 +3622,10 @@ function solveFrame(input, occupied) {
|
|
|
3575
3622
|
if (legendInput && legendInput.items.length > 0) {
|
|
3576
3623
|
let { options } = legendInput, { items } = dedupeLegendKeys(legendInput.items, (item) => identityAppearance(item, theme));
|
|
3577
3624
|
pushAll(warnings, identityCollisionWarnings(items, theme));
|
|
3578
|
-
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 = (
|
|
3625
|
+
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 = (budget) => new Map(items.map((it) => [it, wrapFootnote(
|
|
3579
3626
|
it.label,
|
|
3580
3627
|
font,
|
|
3581
|
-
Math.max(1,
|
|
3628
|
+
Math.max(1, budget - maxKeyW - SWATCH_GAP2 - (it.value ? SWATCH_GAP2 + measure(it.value, valueFont).width : 0)),
|
|
3582
3629
|
measure
|
|
3583
3630
|
)])), 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) => ({
|
|
3584
3631
|
t: "text",
|
|
@@ -3594,11 +3641,11 @@ function solveFrame(input, occupied) {
|
|
|
3594
3641
|
part: "legendValue"
|
|
3595
3642
|
}), 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));
|
|
3596
3643
|
if (sideWanted && !input.sideKeyFixed) {
|
|
3597
|
-
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),
|
|
3644
|
+
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), shareShort = plotW < SIDE_KEY_PLOT_SHARE * size.width, widthShort = shareShort || input.sideKeyGivesWay === !0;
|
|
3598
3645
|
(widthShort || columnH > bottomY - topY) && (warnings.push({
|
|
3599
3646
|
code: "legend-side-fallback",
|
|
3600
3647
|
severity: "warn",
|
|
3601
|
-
message:
|
|
3648
|
+
message: shareShort ? `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` : widthShort ? `the key stays in the row above the plot: with a column beside it the chart does not fit 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`,
|
|
3602
3649
|
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.",
|
|
3603
3650
|
field: ["options", "legend"]
|
|
3604
3651
|
}), options = { ...options, position: "top" }, wrappedKeys = wrapKeys(contentW));
|
|
@@ -3628,8 +3675,8 @@ function solveFrame(input, occupied) {
|
|
|
3628
3675
|
message: `the key stands beside the plot and takes ${Math.round(legendW + 16)} px of its width; 'top' keeps the plot full width`
|
|
3629
3676
|
});
|
|
3630
3677
|
} else {
|
|
3631
|
-
let keyH = lineH, titles = /* @__PURE__ */ new Map(), plainRowH = Math.max(tokens.legendRowH, lineH, maxOf(items.map(ringH))) + (input.cardGaps ? 4 : 0),
|
|
3632
|
-
if (Number.isFinite(available) && available >= plainRowH && items.every((it) =>
|
|
3678
|
+
let keyH = lineH, titles = /* @__PURE__ */ new Map(), plainRowH = Math.max(tokens.legendRowH, lineH, maxOf(items.map(ringH))) + (input.cardGaps ? 4 : 0), budget = input[LEGEND_HEIGHT], available = budget?.height === "auto" ? size.height * furnitureBudget(size.width) - (size.height - bottomY + topY) - tokens.gapLegend : budget?.height ?? 1 / 0, fullBlockH;
|
|
3679
|
+
if (Number.isFinite(available) && available >= plainRowH && items.every((it) => budget?.names.get(it.id) === it.label && it.key !== "heading" && ringH(it) <= keyH)) {
|
|
3633
3680
|
let widths = items.map((it) => keyWidth(it, keyH) + SWATCH_GAP2 + itemTextW(it));
|
|
3634
3681
|
if (fullBlockH = (1 + keyRowStarts(widths, items.map(() => !1), contentW).filter(Boolean).length) * (Math.max(tokens.legendRowH, maxOf(items.map(keyTextH))) + (input.cardGaps ? 4 : 0)) - (input.cardGaps ? 4 : 0), fullBlockH > available) {
|
|
3635
3682
|
let perRow = Math.ceil(items.length / Math.floor(available / plainRowH)), entryWidth = (contentW - ITEM_GAP * (perRow - 1)) / perRow, fitted = items.map((it) => fitText(
|
|
@@ -3640,10 +3687,10 @@ function solveFrame(input, occupied) {
|
|
|
3640
3687
|
measure,
|
|
3641
3688
|
{ target: input.target, typeRole }
|
|
3642
3689
|
)), texts = fitted.map((fit) => fit.lines.join("")), seen = /* @__PURE__ */ new Map();
|
|
3643
|
-
texts.every((
|
|
3644
|
-
if (!
|
|
3645
|
-
seen.set(
|
|
3646
|
-
let stem =
|
|
3690
|
+
texts.every((text2, i) => {
|
|
3691
|
+
if (!text2 || text2 === "\u2026" || seen.has(text2) && seen.get(text2) !== items[i].label) return !1;
|
|
3692
|
+
seen.set(text2, items[i].label);
|
|
3693
|
+
let stem = text2.endsWith("\u2026") ? text2.slice(0, -1) : void 0;
|
|
3647
3694
|
return stem === void 0 || !texts.some((other, j) => j !== i && items[j].label !== items[i].label && other.startsWith(stem));
|
|
3648
3695
|
}) && items.forEach((it, i) => {
|
|
3649
3696
|
wrappedKeys.set(it, fitted[i].lines), fitted[i].title && titles.set(it, it.label);
|
|
@@ -3993,26 +4040,6 @@ function datePatternFromExample(example, language) {
|
|
|
3993
4040
|
}
|
|
3994
4041
|
|
|
3995
4042
|
export {
|
|
3996
|
-
rectsOverlap,
|
|
3997
|
-
rectContains,
|
|
3998
|
-
polylineYAt,
|
|
3999
|
-
rectLineDistance,
|
|
4000
|
-
sideAwayFrom,
|
|
4001
|
-
segmentHitsRect,
|
|
4002
|
-
rectHitsConvexPolygon,
|
|
4003
|
-
deltaGap,
|
|
4004
|
-
boxGap,
|
|
4005
|
-
rectCenter,
|
|
4006
|
-
inflate,
|
|
4007
|
-
boundsOf,
|
|
4008
|
-
unionRect,
|
|
4009
|
-
clamp,
|
|
4010
|
-
round2,
|
|
4011
|
-
cleanFloat,
|
|
4012
|
-
cleanSum,
|
|
4013
|
-
cleanDiff,
|
|
4014
|
-
strokeBoxPad,
|
|
4015
|
-
rowLabelX,
|
|
4016
4043
|
chartString2 as chartString,
|
|
4017
4044
|
localeStrings2 as localeStrings,
|
|
4018
4045
|
furnitureBudget,
|
|
@@ -4062,7 +4089,11 @@ export {
|
|
|
4062
4089
|
cutLabels,
|
|
4063
4090
|
labelOmissions,
|
|
4064
4091
|
reportLabelOmissions,
|
|
4065
|
-
|
|
4092
|
+
claimId,
|
|
4093
|
+
HOST_CLAIMS,
|
|
4094
|
+
requestClaims,
|
|
4095
|
+
unprintedClaims,
|
|
4096
|
+
withUnprintedClaims,
|
|
4066
4097
|
nearestIsOwn,
|
|
4067
4098
|
leaderCrosses,
|
|
4068
4099
|
inkBox,
|
|
@@ -4096,10 +4127,22 @@ export {
|
|
|
4096
4127
|
markedLabel,
|
|
4097
4128
|
footnoteSuffix,
|
|
4098
4129
|
categoryLabelsAndMarks,
|
|
4099
|
-
|
|
4100
|
-
|
|
4130
|
+
HIDDEN_LABEL_LEAD,
|
|
4131
|
+
frameText,
|
|
4132
|
+
fittedNote,
|
|
4133
|
+
DEFAULT_NOTE_LIMIT,
|
|
4134
|
+
noteCap,
|
|
4135
|
+
moreListedText,
|
|
4136
|
+
cappedItems,
|
|
4137
|
+
subtitleUnitClause,
|
|
4138
|
+
frameRendersUnit,
|
|
4139
|
+
unitPrinted,
|
|
4140
|
+
subtitleLine,
|
|
4101
4141
|
HEIGHT_STRUCTURE,
|
|
4102
4142
|
assertEmbeddedImage,
|
|
4143
|
+
arrowLook,
|
|
4144
|
+
calloutArrowLook,
|
|
4145
|
+
calloutArrowReach,
|
|
4103
4146
|
arrowSeats,
|
|
4104
4147
|
finishCalloutHeads,
|
|
4105
4148
|
anchorValueBox,
|
|
@@ -4137,19 +4180,10 @@ export {
|
|
|
4137
4180
|
settledAutoHeight,
|
|
4138
4181
|
fixedPlotChrome,
|
|
4139
4182
|
plotHeightAfter,
|
|
4140
|
-
subtitleUnitClause,
|
|
4141
|
-
frameRendersUnit,
|
|
4142
|
-
unitPrinted,
|
|
4143
4183
|
unitNotShownLints,
|
|
4144
4184
|
unitInFormatLints,
|
|
4145
4185
|
noteLine,
|
|
4146
|
-
fittedNote,
|
|
4147
4186
|
valueNoteLine,
|
|
4148
|
-
DEFAULT_NOTE_LIMIT,
|
|
4149
|
-
noteCap,
|
|
4150
|
-
moreListedText,
|
|
4151
|
-
cappedItems,
|
|
4152
|
-
HIDDEN_LABEL_LEAD,
|
|
4153
4187
|
withCutLabelNotes,
|
|
4154
4188
|
finishCutLabelNotes,
|
|
4155
4189
|
DEFER_DENSITY_NOTES,
|
|
@@ -4169,6 +4203,7 @@ export {
|
|
|
4169
4203
|
hiddenNoteWith,
|
|
4170
4204
|
markNotedLabels,
|
|
4171
4205
|
unitMissing,
|
|
4206
|
+
unitUnprinted,
|
|
4172
4207
|
isPercentUnit,
|
|
4173
4208
|
columnSegmentsPrintAbsolute,
|
|
4174
4209
|
shareUnitOptions,
|
|
@@ -4176,7 +4211,6 @@ export {
|
|
|
4176
4211
|
textCarriesUnit,
|
|
4177
4212
|
textCarriesCohortUnit,
|
|
4178
4213
|
stringsIn,
|
|
4179
|
-
subtitleLine,
|
|
4180
4214
|
solveFrame,
|
|
4181
4215
|
readDateFormat,
|
|
4182
4216
|
formatDate,
|