boardplot 0.60.0 → 0.62.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 +49 -0
- package/README.md +2 -2
- package/dist/{ReaderBox-JJX4J7GC.js → ReaderBox-5QFALZHR.js} +5 -5
- package/dist/{annotateEngine-KNRKDLY3.js → annotateEngine-ONWZYNEM.js} +1 -1
- package/dist/build-identity.json +3 -3
- package/dist/{chunk-D4SXBDA4.js → chunk-23YYVMWH.js} +1 -1
- package/dist/{chunk-OMUW75ZR.js → chunk-2MK5437T.js} +7 -7
- package/dist/{chunk-CDFZV6LR.js → chunk-2P5KBQLT.js} +4 -4
- package/dist/{chunk-EH23CIC5.js → chunk-2VUEIEUO.js} +2 -2
- package/dist/{chunk-TASEX7VA.js → chunk-2YXO645A.js} +1 -1
- package/dist/{chunk-YHIBABKS.js → chunk-35JGEMCK.js} +35 -28
- package/dist/{chunk-XWGAANY4.js → chunk-3DXOZRRW.js} +3 -3
- package/dist/{chunk-PP23D6QV.js → chunk-3H72EFNC.js} +4 -4
- package/dist/{chunk-RDJ3ZU6O.js → chunk-3KYSWAEH.js} +13 -8
- package/dist/{chunk-XMRLQDOR.js → chunk-3QJVBKRX.js} +37 -37
- package/dist/{chunk-XVFUJRRC.js → chunk-3YSLEJPV.js} +1 -1
- package/dist/{chunk-DBKMJWPO.js → chunk-3Z4I6LNK.js} +1 -1
- package/dist/{chunk-J5QVU7GS.js → chunk-476R7YF4.js} +24 -20
- package/dist/{chunk-MA57XWZA.js → chunk-47IEMR6C.js} +85 -79
- package/dist/{chunk-ZNA4JHHG.js → chunk-4HZKH4HS.js} +2 -2
- package/dist/{chunk-CQ6WHTRL.js → chunk-4NGKSJBX.js} +109 -23
- package/dist/{chunk-DEJKDFS3.js → chunk-4SK4IGMK.js} +3 -3
- package/dist/{chunk-OL6HVC6K.js → chunk-4TTNLFTJ.js} +1 -1
- package/dist/{chunk-L2VWHKTJ.js → chunk-4XDWZJUX.js} +3 -1
- package/dist/{chunk-66FOKRUF.js → chunk-5FG24HFB.js} +4 -4
- package/dist/{chunk-HLQ74GAX.js → chunk-5J2PQ5EZ.js} +4 -4
- package/dist/{chunk-7BQK2UDV.js → chunk-5LUHGXXE.js} +1 -1
- package/dist/{chunk-FYFXOLWI.js → chunk-5OUURZ2T.js} +70 -58
- package/dist/{chunk-UNO3WZR2.js → chunk-64D7CHCE.js} +4 -4
- package/dist/{chunk-SBYKLBDV.js → chunk-6LYMOF2S.js} +4 -4
- package/dist/{chunk-52YYGKXG.js → chunk-6MXRNA4Z.js} +17 -17
- package/dist/{chunk-IDVHLD2L.js → chunk-6OM5IYNK.js} +68 -11
- package/dist/{chunk-B7UWG6XJ.js → chunk-6PR23T2O.js} +1 -1
- package/dist/{chunk-VGOZOBNB.js → chunk-6QQPQ2TX.js} +1 -1
- package/dist/{chunk-BQBD6Q5J.js → chunk-6RRK3VFP.js} +1 -1
- package/dist/{chunk-YM7MO7WI.js → chunk-6WEJGZVQ.js} +1 -1
- package/dist/{chunk-OYLZRQTX.js → chunk-6XDX3MIU.js} +5 -5
- package/dist/{chunk-5XAU6JH5.js → chunk-75OLP5KB.js} +35 -35
- package/dist/{chunk-UIHGGWES.js → chunk-77LQEREO.js} +1 -1
- package/dist/{chunk-PRVX4PAO.js → chunk-7JSGG67J.js} +1 -1
- package/dist/{chunk-RTN422GQ.js → chunk-7NUNEVOU.js} +14 -9
- package/dist/{chunk-2ZDFX75P.js → chunk-7OT6CVQT.js} +1 -1
- package/dist/{chunk-QCDJGYFU.js → chunk-7R43Y35G.js} +1 -1
- package/dist/{chunk-XLX3TUFO.js → chunk-7RAF2HJA.js} +2 -2
- package/dist/{chunk-CROGQZFW.js → chunk-7S57SH2K.js} +9 -9
- package/dist/{chunk-LWRLVDFU.js → chunk-7ZYGEPY2.js} +52 -28
- package/dist/{chunk-N5DPRWQ6.js → chunk-ABUJPENV.js} +53 -42
- package/dist/{chunk-C63YFMCB.js → chunk-ADVFTNDL.js} +4 -4
- package/dist/{chunk-MOPY5REE.js → chunk-AFONROHX.js} +3 -3
- package/dist/{chunk-EGCELTRX.js → chunk-AO73FLJT.js} +4 -4
- package/dist/{chunk-U75MMLNQ.js → chunk-AU2TQN6F.js} +4 -4
- package/dist/{chunk-34XJCEPN.js → chunk-BFHAYXUU.js} +2 -2
- package/dist/{chunk-UKEI7JDA.js → chunk-BFJKH4AX.js} +3 -2
- package/dist/{chunk-3JG764MI.js → chunk-BHO5H4AF.js} +43 -15
- package/dist/{chunk-T73SF424.js → chunk-BKZF27CE.js} +2 -2
- package/dist/{chunk-BXZNLMMH.js → chunk-BR2ADMLU.js} +2 -2
- package/dist/{chunk-BIRB4FIZ.js → chunk-BZUHBKMK.js} +4 -4
- package/dist/{chunk-N7BPP6ZZ.js → chunk-C2X6NYMY.js} +1 -1
- package/dist/{chunk-NOC5PYN3.js → chunk-C3ULVZI7.js} +2 -2
- package/dist/{chunk-JUVSZGY7.js → chunk-CFT6W2QY.js} +3 -3
- package/dist/{chunk-7KIULDTU.js → chunk-CPBJII5T.js} +5 -5
- package/dist/{chunk-LUYV7PHY.js → chunk-CTRPRU4Y.js} +16 -13
- package/dist/{chunk-3HKY4LAR.js → chunk-CWBM7MXM.js} +4 -4
- package/dist/{chunk-ZQ6AEWKM.js → chunk-CZZXZFYL.js} +2 -2
- package/dist/{chunk-TDVNIVU4.js → chunk-D2I2BUR6.js} +1 -1
- package/dist/{chunk-VRG7GG7T.js → chunk-DCFK2BUL.js} +2 -2
- package/dist/{chunk-5OV7VOGV.js → chunk-DVQR5SFL.js} +2 -2
- package/dist/{chunk-GZYMHC44.js → chunk-DWEVPNNE.js} +2 -2
- package/dist/{chunk-RQT52BP4.js → chunk-DYG4XMCC.js} +5 -5
- package/dist/{chunk-PCITI5ED.js → chunk-E46KFVP5.js} +11 -11
- package/dist/{chunk-DITI57ZB.js → chunk-EKKRDPVW.js} +1 -1
- package/dist/{chunk-UGAZT73S.js → chunk-ELFF5YO7.js} +8 -8
- package/dist/{chunk-2KICOGFN.js → chunk-EPRJX5BI.js} +2 -2
- package/dist/{chunk-JOX252XQ.js → chunk-EPS7N5ZS.js} +8 -3
- package/dist/{chunk-AGR4VJ2Y.js → chunk-ERIMFXE3.js} +1 -1
- package/dist/{chunk-TSGSZAAN.js → chunk-ESS7GAO5.js} +15 -15
- package/dist/{chunk-VTUSC24F.js → chunk-EW77WN7V.js} +2 -2
- package/dist/{chunk-CLZPPLDA.js → chunk-F2IGRFYM.js} +57 -33
- package/dist/{chunk-WQ2TZNGR.js → chunk-F7LDXGWD.js} +11 -11
- package/dist/{chunk-SDAVHADX.js → chunk-FC6H5ATA.js} +2 -2
- package/dist/{chunk-ISNHKFCU.js → chunk-FI5VGWUQ.js} +2 -2
- package/dist/{chunk-Q53IWBTJ.js → chunk-FPF73SCJ.js} +18 -15
- package/dist/{chunk-4S3DTNEQ.js → chunk-FSRAPSO7.js} +28 -28
- package/dist/{chunk-ID65JMYY.js → chunk-FXKGNJYB.js} +17 -17
- package/dist/{chunk-25JXYOSX.js → chunk-FXQH2QJN.js} +1 -1
- package/dist/{chunk-GDS7LEGY.js → chunk-GA7CIH6N.js} +23 -18
- package/dist/{chunk-GYEBEF4S.js → chunk-GCOFMXFJ.js} +5 -5
- package/dist/{chunk-Q4SQGAEI.js → chunk-GGWYJNHH.js} +4 -4
- package/dist/{chunk-64M7YDMJ.js → chunk-GNSAYVND.js} +2 -2
- package/dist/{chunk-X725AGYP.js → chunk-H7K3RXBQ.js} +2 -2
- package/dist/{chunk-I5LFCHNQ.js → chunk-HCAPGTEA.js} +1 -1
- package/dist/{chunk-RF6ZHX5F.js → chunk-HUU76QHF.js} +1 -1
- package/dist/{chunk-TZOHCW4R.js → chunk-HV6OKHM6.js} +1 -1
- package/dist/{chunk-7OLE7R46.js → chunk-HYBGISXA.js} +3 -3
- package/dist/{chunk-E7GO4KFZ.js → chunk-I37SEVQ4.js} +127 -79
- package/dist/{chunk-ZCOGCNT7.js → chunk-I3UJHKCS.js} +3 -3
- package/dist/{chunk-VSAX2PYB.js → chunk-I56NIVFF.js} +4 -4
- package/dist/{chunk-2KDELDD4.js → chunk-IDMGFWB7.js} +134 -116
- package/dist/{chunk-YDYZWCUQ.js → chunk-IHZNRJEV.js} +1 -1
- package/dist/{chunk-EFU2RCCR.js → chunk-IMKHDTEQ.js} +1 -1
- package/dist/{chunk-PYJZ7CCP.js → chunk-ISNWAYX2.js} +3 -3
- package/dist/{chunk-6IRPZUWJ.js → chunk-ITPXKZXT.js} +83 -79
- package/dist/{chunk-PS45RNDC.js → chunk-J233F6JA.js} +3 -3
- package/dist/{chunk-PSUSHJFV.js → chunk-J6WWK4VC.js} +1 -1
- package/dist/{chunk-DXKMCMIH.js → chunk-J77EYTIA.js} +2 -2
- package/dist/{chunk-D7FFMBHF.js → chunk-JCZ64D4G.js} +4 -4
- package/dist/{chunk-LUIHWUZB.js → chunk-JEC6YG2C.js} +34 -20
- package/dist/{chunk-BNBCHZ6D.js → chunk-JV3S3OCN.js} +19 -18
- package/dist/{chunk-7KZN3TXQ.js → chunk-K2ZDFPYP.js} +5 -5
- package/dist/{chunk-WPHEUEO3.js → chunk-K3METEEY.js} +133 -30
- package/dist/{chunk-WWFUZXCW.js → chunk-K464WFSQ.js} +4 -4
- package/dist/{chunk-T52ZPSGL.js → chunk-KDRI3KHH.js} +7 -2
- package/dist/{chunk-K7CONTAT.js → chunk-KK7UXU2E.js} +3 -3
- package/dist/{chunk-5SPL5QEB.js → chunk-KNTNUQNS.js} +8 -8
- package/dist/{chunk-QZAT46PP.js → chunk-KRSI6U6L.js} +1 -0
- package/dist/{chunk-SC2363Q7.js → chunk-KU5WGRQJ.js} +72 -44
- package/dist/{chunk-C7SY7RYQ.js → chunk-KWBG3P7W.js} +4 -4
- package/dist/{chunk-ZXT3OS6U.js → chunk-KWKJYMXJ.js} +3 -3
- package/dist/{chunk-XKKII2K5.js → chunk-KWTVCTWS.js} +246 -83
- package/dist/{chunk-ZOQRX5V7.js → chunk-KZ7ECRPL.js} +4 -4
- package/dist/{chunk-VCENIUYM.js → chunk-L46NAICE.js} +5 -5
- package/dist/{chunk-2OKDNNCY.js → chunk-L4VGGSB3.js} +4 -4
- package/dist/{chunk-76IZNTNL.js → chunk-L6T7FXEM.js} +6 -6
- package/dist/{chunk-2E2MK4XM.js → chunk-LE6QYQRU.js} +2 -2
- package/dist/{chunk-WDLWWEHZ.js → chunk-LIMLKOX7.js} +1 -1
- package/dist/{chunk-2FSJFKUH.js → chunk-LK5V7U6C.js} +5 -5
- package/dist/{chunk-6RQCZA7X.js → chunk-LNBYRD5Q.js} +4 -4
- package/dist/{chunk-CVLTU3T4.js → chunk-LTEGXWSU.js} +4 -4
- package/dist/{chunk-MXC5QMPC.js → chunk-LUIHCUMB.js} +4 -4
- package/dist/{chunk-GOVRBONO.js → chunk-MAA5IGGT.js} +2 -2
- package/dist/{chunk-RLRVSX4I.js → chunk-MDGVRYXX.js} +20 -20
- package/dist/{chunk-7TGG57QF.js → chunk-MEIDC7ZF.js} +4 -4
- package/dist/{chunk-RWVM4EVE.js → chunk-MTJZT6F2.js} +5 -5
- package/dist/{chunk-AXKZLSON.js → chunk-MUYU6KTM.js} +1 -1
- package/dist/{chunk-RPS7G77V.js → chunk-MVA2JWM4.js} +2 -2
- package/dist/{chunk-LCTLW4ZW.js → chunk-MYDVNJAA.js} +1 -1
- package/dist/{chunk-3PFNYRBD.js → chunk-NFEVGJJ6.js} +13 -13
- package/dist/{chunk-HXAWJC32.js → chunk-NFSG2WBI.js} +4 -4
- package/dist/{chunk-K7NCVUIB.js → chunk-NFYF7P6H.js} +36 -28
- package/dist/{chunk-ZT7QX7UQ.js → chunk-NL2K3CZM.js} +5 -5
- package/dist/{chunk-A2RKEC66.js → chunk-NTONEZH5.js} +20 -20
- package/dist/{chunk-GGXAAOKT.js → chunk-NTSJ2RXB.js} +4 -4
- package/dist/{chunk-OJWJMG6B.js → chunk-NVPORMKX.js} +15 -15
- package/dist/{chunk-NJNMKQHG.js → chunk-NXA2CNVU.js} +125 -31
- package/dist/{chunk-R2RLERPT.js → chunk-NYROTVGH.js} +1 -1
- package/dist/{chunk-W74Y5AUG.js → chunk-NZHIXLKM.js} +19 -17
- package/dist/{chunk-UIOZDIUB.js → chunk-OCANU74G.js} +3 -3
- package/dist/{chunk-IF4PERIE.js → chunk-OF4VHET3.js} +4 -4
- package/dist/{chunk-UXJXA4NP.js → chunk-OJLXBFI3.js} +1 -1
- package/dist/{chunk-5HOIOQK3.js → chunk-OLXZXEKQ.js} +1 -1
- package/dist/{chunk-UNBUFCQT.js → chunk-OQGSYQLE.js} +1 -1
- package/dist/{chunk-MZCJ22O4.js → chunk-OQQGM2TM.js} +1 -1
- package/dist/{chunk-FPWADEL6.js → chunk-OQRTTGYP.js} +22 -1
- package/dist/{chunk-XUEX5WTR.js → chunk-OQTD4GN4.js} +1 -1
- package/dist/{chunk-HOQJIUTX.js → chunk-OXWIBDJP.js} +2 -2
- package/dist/{chunk-F7QCIJAY.js → chunk-OYDZO5BR.js} +1 -1
- package/dist/{chunk-5PC6VOEW.js → chunk-PDUF6EII.js} +9 -9
- package/dist/{chunk-GEFUIQUO.js → chunk-PHRQAWK4.js} +2 -2
- package/dist/{chunk-NF74JTTK.js → chunk-PM5D5KYQ.js} +67 -30
- package/dist/{chunk-QF6NFIBD.js → chunk-Q5BD6PMX.js} +22 -22
- package/dist/{chunk-UHFSDVW2.js → chunk-QEEE2WH5.js} +4 -4
- package/dist/{chunk-BG2RBCJP.js → chunk-QMGCL5FR.js} +4 -4
- package/dist/{chunk-DXSYY6XR.js → chunk-QMZPQU65.js} +2 -2
- package/dist/{chunk-7VWXXBTC.js → chunk-QSNEZ4UR.js} +1 -1
- package/dist/{chunk-BHYY6VMQ.js → chunk-QSWLPQCW.js} +27 -23
- package/dist/{chunk-LVC2YJGV.js → chunk-R55LS2W2.js} +28 -28
- package/dist/{chunk-BLTQ2L6U.js → chunk-RDXJAEZ4.js} +4 -4
- package/dist/{chunk-OVYQJDRW.js → chunk-RDZNRSAB.js} +2 -2
- package/dist/{chunk-VHZ4MXJO.js → chunk-RFUSBITY.js} +1 -1
- package/dist/{chunk-4VKYFELK.js → chunk-RIGQU57Y.js} +7 -7
- package/dist/{chunk-DEUOC3IL.js → chunk-RNA5GO3B.js} +2 -2
- package/dist/{chunk-IFRDI7EF.js → chunk-RODV3OHP.js} +294 -180
- package/dist/{chunk-CPKPQQV6.js → chunk-RPK657TE.js} +16 -2
- package/dist/{chunk-HMWN6FTW.js → chunk-SAVO62PW.js} +1 -1
- package/dist/{chunk-3ADWX4BM.js → chunk-SB2DHY53.js} +18 -18
- package/dist/{chunk-BIQ5LJEC.js → chunk-SBHPRHKB.js} +4 -4
- package/dist/{chunk-TMY4PWDQ.js → chunk-SBPFCQNK.js} +4 -4
- package/dist/{chunk-PZZAVTLQ.js → chunk-SFPHP3CC.js} +2 -2
- package/dist/{chunk-PLVYTK2H.js → chunk-SIZW5V4G.js} +18 -14
- package/dist/{chunk-Y4BJ7D5F.js → chunk-SJ5KVLTG.js} +1 -1
- package/dist/{chunk-PGZGBVTS.js → chunk-SJZLWRRY.js} +8 -8
- package/dist/{chunk-A3AKNPLZ.js → chunk-SOAB4G33.js} +4 -4
- package/dist/{chunk-LPLRXEOT.js → chunk-ST2IQX7U.js} +57 -17
- package/dist/{chunk-E4XQSRH6.js → chunk-T33R2CM3.js} +7 -7
- package/dist/{chunk-FWPPZB4G.js → chunk-T4ZE7AIX.js} +2 -2
- package/dist/{chunk-HTXICOSJ.js → chunk-TCQ733WC.js} +15 -15
- package/dist/{chunk-J3GYX5BJ.js → chunk-TGTKAIDU.js} +20 -15
- package/dist/{chunk-AE6X6RRH.js → chunk-U4PDXI67.js} +4 -4
- package/dist/{chunk-JXMOPQXC.js → chunk-UGTYYTPP.js} +2 -2
- package/dist/{chunk-Y5ROVCMQ.js → chunk-UL3RNOYB.js} +3 -3
- package/dist/{chunk-MYBBZNYN.js → chunk-UOTZH4TG.js} +2 -2
- package/dist/{chunk-ZH4DRVFN.js → chunk-UQSH52UJ.js} +4 -4
- package/dist/{chunk-PL43U5GM.js → chunk-UWT66OAR.js} +1 -1
- package/dist/{chunk-QTT4AJY5.js → chunk-V4NJTLJP.js} +14 -14
- package/dist/{chunk-SY7JC3PH.js → chunk-V4YJRZHE.js} +1 -1
- package/dist/{chunk-FP4INYSU.js → chunk-V5Y3CXSU.js} +4 -4
- package/dist/{chunk-TTY4CA7M.js → chunk-VZFPQMYN.js} +9 -9
- package/dist/{chunk-C26Z5AEW.js → chunk-W35C2SL3.js} +3 -3
- package/dist/{chunk-X5I3LGHD.js → chunk-W6ZCXWOK.js} +1 -1
- package/dist/{chunk-TUYKMVYV.js → chunk-WDP7IDGF.js} +13 -13
- package/dist/{chunk-L3B46VGP.js → chunk-WDQJ2DRZ.js} +14 -14
- package/dist/{chunk-3HKL6KJ6.js → chunk-WKBW4JFU.js} +1 -1
- package/dist/chunk-WM65Q3AL.js +69 -0
- package/dist/{chunk-HPNQ3GKK.js → chunk-WO6ZJCAO.js} +4 -4
- package/dist/chunk-WSRGEK5T.js +89 -0
- package/dist/{chunk-NGKZRGQL.js → chunk-WXGBSBHQ.js} +13 -12
- package/dist/{chunk-XDGAJVCG.js → chunk-WXOSGKMS.js} +8 -8
- package/dist/{chunk-6BAUUBP2.js → chunk-XBASXPUJ.js} +2 -2
- package/dist/{chunk-O6E2LWGK.js → chunk-XDDFM3BH.js} +6 -6
- package/dist/{chunk-ENVV7LI4.js → chunk-XJOCPL6R.js} +2 -2
- package/dist/{chunk-ETSWVJB6.js → chunk-XJSI7ZO2.js} +1 -1
- package/dist/chunk-XKGZWQF7.js +63 -0
- package/dist/{chunk-ZLH7XSHV.js → chunk-XLHURGH3.js} +5 -5
- package/dist/{chunk-LGNAFFIL.js → chunk-XWQDNJ36.js} +4 -4
- package/dist/{chunk-ZS24JHBP.js → chunk-YBQ4F27M.js} +4 -4
- package/dist/{chunk-ZIC22PSH.js → chunk-YDT6QZZK.js} +9 -9
- package/dist/{chunk-BJS6TLLE.js → chunk-YE6B7P6Q.js} +1 -1
- package/dist/{chunk-UF7OWARN.js → chunk-YERTQ576.js} +4 -4
- package/dist/{chunk-GNK7RTO4.js → chunk-YF4DIQJR.js} +4 -4
- package/dist/{chunk-7XO74NDR.js → chunk-YHLKL4R5.js} +3 -3
- package/dist/{chunk-E6KUWZ5W.js → chunk-YHSY6CVM.js} +4 -4
- package/dist/{chunk-RYH3JFCL.js → chunk-YJGZ3AOW.js} +2 -2
- package/dist/{chunk-5DTMIKDX.js → chunk-YKK25QM4.js} +4 -4
- package/dist/{chunk-3WC2TA6C.js → chunk-YMBJHKTY.js} +3 -3
- package/dist/{chunk-TLKRYDH3.js → chunk-YTFU2B5K.js} +2 -2
- package/dist/{chunk-AH2L44TR.js → chunk-YUIITZCO.js} +3 -3
- package/dist/{chunk-XHEG2BG6.js → chunk-Z3VCVPYX.js} +1 -1
- package/dist/{chunk-MF6XGFHB.js → chunk-ZB4WVG7Q.js} +7 -3
- package/dist/{chunk-YCTBPRV4.js → chunk-ZCB5MLPW.js} +3 -3
- package/dist/{chunk-DP5CXMZW.js → chunk-ZDQ2EWWH.js} +32 -28
- package/dist/{chunk-FG2VET62.js → chunk-ZG46HLGN.js} +108 -81
- package/dist/chunk-ZGL2P56Z.js +11 -0
- package/dist/{chunk-6USMWXB3.js → chunk-ZIAPNZ6R.js} +4 -4
- package/dist/{chunk-Q7GDGSTK.js → chunk-ZLIVUVIV.js} +28 -16
- package/dist/{chunk-IRCLNPLJ.js → chunk-ZMCTTTR2.js} +4 -4
- package/dist/{chunk-STRN4XOX.js → chunk-ZYJZ624V.js} +5 -5
- package/dist/cli/index.js +2 -2
- package/dist/{core-32KM4AJG.js → core-2DRDBSL7.js} +2 -1
- package/dist/{core-OZLK2EJW.js → core-2VAPYQDA.js} +2 -1
- package/dist/{core-STATMGC7.js → core-3JGHUUZZ.js} +2 -1
- package/dist/{core-6N5ONDKG.js → core-3KMBTZ32.js} +3 -1
- package/dist/{core-J5DSGZZR.js → core-4HEB3CRT.js} +2 -1
- package/dist/{core-2JHH5LLH.js → core-4WT74WGL.js} +3 -1
- package/dist/{core-JFORSZQS.js → core-4ZUNKYYC.js} +2 -1
- package/dist/{core-RYEENVFZ.js → core-5VCTJDQM.js} +2 -1
- package/dist/{core-FRVHGKYW.js → core-AJANHLTB.js} +2 -1
- package/dist/{core-7II27MGX.js → core-AL3TDBHQ.js} +5 -1
- package/dist/{core-AAC2ESXF.js → core-ATBNPTR5.js} +2 -1
- package/dist/{core-REYW2XB3.js → core-BIEUVBZK.js} +3 -1
- package/dist/{core-COGECGZY.js → core-C2CCLPE5.js} +2 -1
- package/dist/{core-XHSGRJDP.js → core-C3VC6YEV.js} +3 -1
- package/dist/{core-V2RMMBMO.js → core-DCWAUTD4.js} +2 -1
- package/dist/{core-X4SPCV6G.js → core-GYDBZC7Q.js} +3 -1
- package/dist/{core-255NAAUA.js → core-H3RRJPQK.js} +2 -1
- package/dist/{core-BTKBKGCU.js → core-HAMHEP3M.js} +3 -1
- package/dist/{core-CELQJZJB.js → core-HRBOWCHO.js} +2 -1
- package/dist/{core-WU6DBIAM.js → core-IHG5XK6Q.js} +2 -1
- package/dist/{core-L4EGZ73S.js → core-JNA7L23P.js} +3 -1
- package/dist/{core-QYAXEGWD.js → core-JTHVZEC4.js} +2 -1
- package/dist/{core-YTTTVHUH.js → core-JXCXTDYK.js} +3 -1
- package/dist/{core-TBQAFBDU.js → core-LL2O5PBD.js} +3 -1
- package/dist/{core-HRHUGQNB.js → core-NNHCWP3B.js} +2 -1
- package/dist/{core-FLCLKSGA.js → core-OM3DGO6B.js} +2 -1
- package/dist/{core-GCYDQRFM.js → core-QH3H6ZPI.js} +2 -1
- package/dist/{core-YVWLKGAN.js → core-QKDNA6KJ.js} +2 -1
- package/dist/{core-W4NG6WON.js → core-R6OE3ORL.js} +2 -1
- package/dist/{core-NARJSEGI.js → core-RZI7LRK3.js} +5 -1
- package/dist/{core-6GE3EMCB.js → core-SXBMOZ3W.js} +2 -1
- package/dist/{core-GETUMW6I.js → core-TXADFQ3I.js} +3 -1
- package/dist/{core-SUFLQLWC.js → core-UOB4JKCT.js} +2 -1
- package/dist/{core-56KTQ7DK.js → core-WIV43MFA.js} +2 -1
- package/dist/{core-W3XIUTU7.js → core-XDPELH2B.js} +4 -1
- package/dist/{core-F7ASDBXB.js → core-YKHQUOAW.js} +2 -1
- package/dist/{core-QLJQOZGJ.js → core-ZXGKAECT.js} +4 -1
- package/dist/{dataTable-OI4CVMFJ.js → dataTable-JBVSQNJX.js} +3 -2
- package/dist/{engine-3SQQ2S5U.js → engine-QUEIPS7M.js} +44 -18
- package/dist/fixtures.js +2 -1
- package/dist/fonts.js +4 -4
- package/dist/index.js +21 -20
- package/dist/{main-TWTT3Q2R.js → main-V264O3WR.js} +8 -7
- package/dist/mcp/server.js +14 -13
- package/dist/react/bar.js +5 -1
- package/dist/react/bartable.js +3 -1
- package/dist/react/box.js +3 -1
- package/dist/react/bullet.js +4 -1
- package/dist/react/butterfly.js +3 -1
- package/dist/react/choropleth.js +3 -1
- package/dist/react/cohort.js +3 -1
- package/dist/react/column.js +4 -1
- package/dist/react/combo.js +4 -1
- package/dist/react/creative.js +3 -1
- package/dist/react/diagram.js +3 -1
- package/dist/react/dimswitch.js +2 -1
- package/dist/react/dot.js +6 -1
- package/dist/react/export.js +19 -18
- package/dist/react/funnel.js +3 -1
- package/dist/react/gantt.js +3 -1
- package/dist/react/grid.js +5 -1
- package/dist/react/heatmap.js +3 -1
- package/dist/react/histogram.js +4 -1
- package/dist/react/index.js +86 -84
- package/dist/react/kpi.js +3 -1
- package/dist/react/likert.js +5 -1
- package/dist/react/line.js +3 -1
- package/dist/react/mekko.js +4 -1
- package/dist/react/pareto.js +3 -1
- package/dist/react/pie.js +3 -1
- package/dist/react/prepare.js +24 -22
- package/dist/react/pvm.js +4 -1
- package/dist/react/pyramid.js +3 -1
- package/dist/react/sankey.js +3 -1
- package/dist/react/scatter.js +3 -1
- package/dist/react/slope.js +4 -1
- package/dist/react/sparkline.js +3 -1
- package/dist/react/spec.js +12 -10
- package/dist/react/status.js +3 -1
- package/dist/react/story.js +4 -3
- package/dist/react/table.js +2 -1
- package/dist/react/theme.js +4 -3
- package/dist/react/tilemap.js +3 -1
- package/dist/react/treemap.js +3 -1
- package/dist/react/variance.js +4 -1
- package/dist/react/waffle.js +3 -1
- package/dist/react/waterfall.js +4 -1
- package/dist/{resvg-ZYEZTSUO.js → resvg-M5HJ3ME3.js} +1 -1
- package/dist/{rowsModule-BULW5KS2.js → rowsModule-6UL4SSUC.js} +1 -1
- package/dist/{schema-D3ELHESU.js → schema-3FSG2YXY.js} +1 -1
- package/dist/{schema-PBMYZKBK.js → schema-5PQPGEZQ.js} +1 -1
- package/dist/{schema-SUDJBIHX.js → schema-6LUORZNN.js} +1 -1
- package/dist/{schema-LGYHJPXU.js → schema-6MDHX2E7.js} +1 -1
- package/dist/{schema-4HGZZNUL.js → schema-7HXHGBUN.js} +1 -1
- package/dist/{schema-5SVPR3EU.js → schema-ACOD4XKI.js} +1 -1
- package/dist/{schema-AM2KS6ZC.js → schema-B3I7XBP3.js} +1 -1
- package/dist/{schema-4YIYGGOJ.js → schema-CCOTGURZ.js} +1 -1
- package/dist/{schema-GYVYJEL3.js → schema-E5O7M5KM.js} +1 -1
- package/dist/{schema-PAKZIYQF.js → schema-EWATAK6Z.js} +1 -1
- package/dist/{schema-NNNG7CWG.js → schema-FEBMLOZG.js} +1 -1
- package/dist/{schema-GYTWCCNA.js → schema-FL57LIU2.js} +1 -1
- package/dist/{schema-NI5B642U.js → schema-FTRAVEX3.js} +2 -1
- package/dist/{schema-FBIEOKO2.js → schema-GSKCG2WP.js} +1 -1
- package/dist/{schema-FPDLOIA6.js → schema-HVDY6QXK.js} +1 -1
- package/dist/{schema-XKPUXAVB.js → schema-I267TVQ4.js} +1 -1
- package/dist/{schema-IYLRZNFB.js → schema-IG2WGTQO.js} +1 -1
- package/dist/{schema-YCKUQ3FF.js → schema-ITZQDKSE.js} +1 -1
- package/dist/{schema-C25ECGJL.js → schema-LCOGZNQF.js} +1 -1
- package/dist/{schema-A4U4RDKJ.js → schema-MC3CQNPR.js} +1 -1
- package/dist/{schema-FQWENOJY.js → schema-MP2QNFCN.js} +1 -1
- package/dist/{schema-CBLNGK2F.js → schema-NYCMLGOW.js} +1 -1
- package/dist/{schema-GTLGAPCU.js → schema-OML7XS7J.js} +1 -1
- package/dist/{schema-IYBZPCM4.js → schema-QAAVXXYR.js} +1 -1
- package/dist/{schema-3LRC5TOZ.js → schema-QPYFXSEQ.js} +1 -1
- package/dist/{schema-WDKBCN3V.js → schema-RJBIXN5U.js} +1 -1
- package/dist/{schema-P2JYSV32.js → schema-RW47HWVO.js} +1 -1
- package/dist/{schema-TRPPZCIR.js → schema-S7Q4YR7R.js} +1 -1
- package/dist/{schema-YVBUY7NH.js → schema-SWVWMZY3.js} +1 -1
- package/dist/{schema-LX4EXDTI.js → schema-T3RSFE2V.js} +1 -1
- package/dist/{schema-KPZVLE6A.js → schema-T4CGWZLB.js} +4 -2
- package/dist/{schema-VH4AW62Z.js → schema-TXYKZ5NT.js} +1 -1
- package/dist/{schema-5OLQ54J5.js → schema-U6CZI6XG.js} +1 -1
- package/dist/{schema-SQ2GYLMI.js → schema-XE4WY64H.js} +1 -1
- package/dist/{schema-HAMPGUH3.js → schema-YDWVXQPK.js} +1 -1
- package/dist/{schema-KBV2JB2A.js → schema-YPGXVI22.js} +1 -1
- package/dist/{schema-2ACHQTR3.js → schema-ZMOIP2BK.js} +1 -1
- package/dist/{specValidation-5J6DDCHF.js → specValidation-6LVTTHZI.js} +2 -1
- package/dist/theme.js +3 -3
- package/dist/{themeShapeRules-MOUDTDUB.js → themeShapeRules-NDEXKFC7.js} +1 -1
- package/dist/types/core/annotate.d.ts +9 -0
- package/dist/types/core/annotateFields.d.ts +36 -1
- package/dist/types/core/annotateTargets.d.ts +2 -0
- package/dist/types/core/charts/bar/layout.d.ts +1 -1
- package/dist/types/core/charts/column/model.d.ts +3 -1
- package/dist/types/core/charts/grid/metricStack.d.ts +35 -3
- package/dist/types/core/charts/grid/metricStackSchema.d.ts +8 -0
- package/dist/types/core/charts/grid/schema.d.ts +5 -0
- package/dist/types/core/charts/scatter/layout.d.ts +18 -1
- package/dist/types/core/charts/scatter/marks.d.ts +94 -0
- package/dist/types/core/charts/scatter/zones.d.ts +52 -0
- package/dist/types/core/fontMetrics/index.d.ts +3 -1
- package/dist/types/core/fontMetrics/injected.d.ts +1 -0
- package/dist/types/core/frame.d.ts +7 -2
- package/dist/types/core/label/occupied.d.ts +1 -1
- package/dist/types/core/registry.d.ts +2 -0
- package/dist/types/core/request.d.ts +7 -0
- package/dist/types/core/sizing.d.ts +9 -0
- package/dist/types/core/themeGeometry.d.ts +184 -0
- package/dist/types/core/types/data.d.ts +2 -0
- package/dist/types/core/types/options.d.ts +10 -0
- package/dist/types/core/types/scene.d.ts +11 -0
- package/dist/types/core/types/theme.d.ts +26 -2
- package/dist/types/react/hover/engine.d.ts +5 -1
- package/dist/types/react/hover/labelCard.d.ts +33 -2
- package/dist/types/react/hover/placement.d.ts +11 -0
- package/dist/types/react/prepare.d.ts +2 -1
- package/dist/types/react/useHover.d.ts +1 -0
- package/dist/types/theme.d.ts +1 -1
- package/dist/validate.js +8 -6
- package/docs/manual.md +4 -2
- package/docs/reference/bar.md +2 -2
- package/docs/reference/bullet.md +1 -1
- package/docs/reference/butterfly.md +1 -1
- package/docs/reference/column.md +2 -2
- package/docs/reference/combo.md +2 -2
- package/docs/reference/dot.md +2 -2
- package/docs/reference/fixtures.md +3 -0
- package/docs/reference/grid.md +25 -12
- package/docs/reference/heatmap.md +1 -1
- package/docs/reference/line.md +2 -2
- package/docs/reference/mekko.md +2 -2
- package/docs/reference/options.md +6 -1
- package/docs/reference/pvm.md +1 -1
- package/docs/reference/react.md +4 -2
- package/docs/reference/scatter.md +1 -1
- package/docs/reference/slope.md +2 -2
- package/docs/reference/sparkline.md +1 -0
- package/docs/reference/table.md +1 -1
- package/docs/reference/theme.md +5 -1
- package/docs/reference/variance.md +1 -1
- package/docs/reference/waterfall.md +1 -1
- package/package.json +1 -1
- package/dist/chunk-6AIHN5S6.js +0 -89
- package/dist/chunk-CDZHNLO6.js +0 -42
- package/dist/chunk-QPWRHDLZ.js +0 -17
|
@@ -4,8 +4,12 @@ import {
|
|
|
4
4
|
metricStackGrain,
|
|
5
5
|
normalizeMetricStack,
|
|
6
6
|
stackError,
|
|
7
|
-
stackRange
|
|
8
|
-
|
|
7
|
+
stackRange,
|
|
8
|
+
withCompareWindow
|
|
9
|
+
} from "./chunk-ST2IQX7U.js";
|
|
10
|
+
import {
|
|
11
|
+
displayFont
|
|
12
|
+
} from "./chunk-KDRI3KHH.js";
|
|
9
13
|
import {
|
|
10
14
|
rebaseRefusal,
|
|
11
15
|
rebaseWarning,
|
|
@@ -13,21 +17,24 @@ import {
|
|
|
13
17
|
} from "./chunk-ZQ5ILQ5A.js";
|
|
14
18
|
import {
|
|
15
19
|
scalePanelSemantics
|
|
16
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-C3ULVZI7.js";
|
|
17
21
|
import {
|
|
18
22
|
STACK_ROOM
|
|
19
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XBASXPUJ.js";
|
|
24
|
+
import {
|
|
25
|
+
STACK_FOCUS
|
|
26
|
+
} from "./chunk-ZGL2P56Z.js";
|
|
20
27
|
import {
|
|
21
28
|
normalizeGridData,
|
|
22
29
|
parseGridLegendPanelData,
|
|
23
30
|
parseGridTextPanelData
|
|
24
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-WKBW4JFU.js";
|
|
25
32
|
import {
|
|
26
33
|
categoryBandFromCenters
|
|
27
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-WM65Q3AL.js";
|
|
28
35
|
import {
|
|
29
36
|
structureCount
|
|
30
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-IHZNRJEV.js";
|
|
31
38
|
import {
|
|
32
39
|
lineBoxes
|
|
33
40
|
} from "./chunk-B5A7X2BA.js";
|
|
@@ -65,7 +72,7 @@ import {
|
|
|
65
72
|
stackedColumnPlotPx,
|
|
66
73
|
varianceTierWeights,
|
|
67
74
|
withCalendarLabels
|
|
68
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-PM5D5KYQ.js";
|
|
69
76
|
import {
|
|
70
77
|
LEFT_OUT_OF_NOTE,
|
|
71
78
|
PRIORITY,
|
|
@@ -86,12 +93,12 @@ import {
|
|
|
86
93
|
unprintedClaims,
|
|
87
94
|
valueNoteLine,
|
|
88
95
|
withUnprintedClaims
|
|
89
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-ZLIVUVIV.js";
|
|
90
97
|
import {
|
|
91
98
|
disclosureNote,
|
|
92
99
|
disclosuresShown,
|
|
93
100
|
slotDemandHeight
|
|
94
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-I3UJHKCS.js";
|
|
95
102
|
import {
|
|
96
103
|
withAnnotationOrigins,
|
|
97
104
|
withoutAnnotationOrigins
|
|
@@ -100,14 +107,16 @@ import {
|
|
|
100
107
|
emptyIdRecord
|
|
101
108
|
} from "./chunk-LINZPU5D.js";
|
|
102
109
|
import {
|
|
103
|
-
unitMagnitude
|
|
104
|
-
|
|
110
|
+
unitMagnitude,
|
|
111
|
+
unitOnNumber,
|
|
112
|
+
withUnit
|
|
113
|
+
} from "./chunk-BHO5H4AF.js";
|
|
105
114
|
import {
|
|
106
115
|
authoredStrings,
|
|
107
116
|
chartStrings,
|
|
108
117
|
localeStrings,
|
|
109
118
|
notApplicableGlyph
|
|
110
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-5OUURZ2T.js";
|
|
111
120
|
import {
|
|
112
121
|
cellMeta,
|
|
113
122
|
cellValue
|
|
@@ -132,10 +141,10 @@ import {
|
|
|
132
141
|
themeForWidth,
|
|
133
142
|
themeRegistrations,
|
|
134
143
|
typeWidthClass
|
|
135
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-4NGKSJBX.js";
|
|
136
145
|
import {
|
|
137
146
|
requireChartCores
|
|
138
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-6RRK3VFP.js";
|
|
139
148
|
import {
|
|
140
149
|
fmtPathNumber
|
|
141
150
|
} from "./chunk-6IUK6PAH.js";
|
|
@@ -153,8 +162,9 @@ import {
|
|
|
153
162
|
} from "./chunk-RJICOOB3.js";
|
|
154
163
|
import {
|
|
155
164
|
defaultMeasurer,
|
|
165
|
+
isCachedTextMeasurer,
|
|
156
166
|
wrapText
|
|
157
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-77LQEREO.js";
|
|
158
168
|
import {
|
|
159
169
|
maxOf,
|
|
160
170
|
minOf,
|
|
@@ -366,7 +376,10 @@ var EN = {
|
|
|
366
376
|
stackRightRemaining: "Right: remaining per 100",
|
|
367
377
|
stackAboveRemaining: "Above each panel: remaining per 100",
|
|
368
378
|
notYetMature: "Not yet mature",
|
|
369
|
-
labelsShowTotals: "Labels show totals"
|
|
379
|
+
labelsShowTotals: "Labels show totals",
|
|
380
|
+
stackFrom: "from {v1}",
|
|
381
|
+
stackAgainst: "against",
|
|
382
|
+
stackAverages: "Averages per {v1}; rates and amounts per unit use volume weighting"
|
|
370
383
|
}, DE = {
|
|
371
384
|
// reader-facing wording linked only by its consumers.
|
|
372
385
|
maturingCohortNote: "Noch nicht ausgereifte Kohorten hatten nicht die volle Zeit f\xFCr ein Ergebnis. Ihre Werte im angegebenen Bereich sind vorl\xE4ufig.",
|
|
@@ -397,25 +410,36 @@ var EN = {
|
|
|
397
410
|
stackRightRemaining: "Rechts: Rest je 100",
|
|
398
411
|
stackAboveRemaining: "\xDCber jedem Feld: Rest je 100",
|
|
399
412
|
notYetMature: "Noch nicht ausgereift",
|
|
400
|
-
labelsShowTotals: "Beschriftungen zeigen Summen"
|
|
413
|
+
labelsShowTotals: "Beschriftungen zeigen Summen",
|
|
414
|
+
stackFrom: "von {v1}",
|
|
415
|
+
stackAgainst: "gegen\xFCber",
|
|
416
|
+
stackAverages: "Mittelwerte je {v1}; Raten und Betr\xE4ge je Einheit sind nach Volumen gewichtet"
|
|
401
417
|
}, { chartString } = chartStrings(EN, DE);
|
|
402
418
|
|
|
403
419
|
// src/core/charts/grid/metricStackLayout.ts
|
|
404
|
-
var neutral = { token: "markInk" }, muted = { token: "inkMuted" }, accent = { token: "focus" }, wash = (base, weight, pageFloor) => ({ token: "markInk", theme: { kind: "mix", from: base, to: { token: "background" }, weight, ...pageFloor === void 0 ? {} : { pageFloor } } }), GUTTER_PROBE = /* @__PURE__ */ Symbol("boardplot.metricStackGutterProbe"), COMPACT_READOUT = /* @__PURE__ */ Symbol("boardplot.metricStackCompactReadout"), GUTTER_LIMIT = /* @__PURE__ */ Symbol("boardplot.metricStackGutterLimit");
|
|
405
|
-
function
|
|
420
|
+
var neutral = { token: "markInk" }, muted = { token: "inkMuted" }, baseStroke = { token: "leader" }, accent = { token: "focus" }, LOOK_CATEGORY_FLOOR = 14, PERIOD_TICK_TOP = 3, wash = (base, weight, pageFloor) => ({ token: "markInk", theme: { kind: "mix", from: base, to: { token: "background" }, weight, ...pageFloor === void 0 ? {} : { pageFloor } } }), GUTTER_PROBE = /* @__PURE__ */ Symbol("boardplot.metricStackGutterProbe"), COMPACT_READOUT = /* @__PURE__ */ Symbol("boardplot.metricStackCompactReadout"), GUTTER_LIMIT = /* @__PURE__ */ Symbol("boardplot.metricStackGutterLimit"), focusStacks = /* @__PURE__ */ new WeakMap();
|
|
421
|
+
function everyFocus(data, raw, locale, na) {
|
|
422
|
+
let byLocale = focusStacks.get(raw) ?? /* @__PURE__ */ new Map();
|
|
423
|
+
focusStacks.set(raw, byLocale);
|
|
424
|
+
let key = `${locale ?? ""}\0${na}`, stacks = byLocale.get(key);
|
|
425
|
+
return stacks || byLocale.set(key, stacks = [data.windows.compare, ...data.categories.map((c) => ({ from: c.id, to: c.id, label: c.label }))].map((window) => computeMetricStack(withCompareWindow(data, window), locale, na, !0))), stacks;
|
|
426
|
+
}
|
|
427
|
+
function printedReadout(readout, showHeadline, showSpan, look) {
|
|
406
428
|
if (showHeadline && showSpan) return readout;
|
|
407
429
|
let byId = new Map(readout.claims.map((claim) => [claim.id, claim])), kept = /* @__PURE__ */ new Set(), keep = (id) => {
|
|
408
430
|
let claim = byId.get(id);
|
|
409
431
|
!claim || kept.has(id) || (kept.add(id), claim.inputs.forEach((input) => keep(input.ref)));
|
|
410
432
|
}, panel = `stack:${readout.panelId}`;
|
|
411
|
-
return showHeadline && (keep(`${panel}:headline`), keep(`${panel}:rate`)), showSpan && (keep(`${panel}:before`), keep(`${panel}:after`)), {
|
|
433
|
+
return showHeadline && (keep(`${panel}:headline`), keep(`${panel}:rate`)), showSpan && (keep(`${panel}:before`), keep(`${panel}:after`)), look && (keep(`${panel}:after`), keep(`${panel}:base`), readout.claims.forEach((claim) => {
|
|
434
|
+
/:share:[^:]+$/.test(claim.id.slice(panel.length)) && keep(claim.id);
|
|
435
|
+
})), {
|
|
412
436
|
...readout,
|
|
413
437
|
claims: readout.claims.filter((claim) => kept.has(claim.id)),
|
|
414
438
|
...showHeadline ? {} : { headline: null, headlineText: "" },
|
|
415
|
-
...showSpan ? {} : { before: null, after: null, spanText: "" }
|
|
439
|
+
...showSpan ? {} : { before: null, ...look ? {} : { after: null }, spanText: "" }
|
|
416
440
|
};
|
|
417
441
|
}
|
|
418
|
-
function stackColumnWarnings(stack, narrow, floored, capped) {
|
|
442
|
+
function stackColumnWarnings(stack, narrow, floored, capped, lookIgnored) {
|
|
419
443
|
let inStack = (key, authored, drawn) => generatedIdWarnings("grid", key, authored, drawn).map((warning) => ({ ...warning, field: ["options", "stack", ...(warning.field ?? []).slice(1)] })), warnings = [
|
|
420
444
|
...inStack("columnVisibility", stack.columnVisibility, ["name", "unit", "headline", "span"]),
|
|
421
445
|
...inStack("columnOverrides", stack.columnOverrides, ["gutter"]),
|
|
@@ -439,27 +463,66 @@ function stackColumnWarnings(stack, narrow, floored, capped) {
|
|
|
439
463
|
field: ["options", "stack", "columnOverrides", "gutter", "width"],
|
|
440
464
|
message: "the gutter width leaves too little room for the values on this canvas, so it gave way",
|
|
441
465
|
suggest: "Lower the width, or widen the chart."
|
|
466
|
+
}), lookIgnored && warnings.push({
|
|
467
|
+
code: "option-ignored",
|
|
468
|
+
severity: "warn",
|
|
469
|
+
field: ["options", "stack", "variant"],
|
|
470
|
+
message: "the focus look compares the base and the compare window, and these panels read a weighted rate (readout { base }), so variant 'focus' does nothing here",
|
|
471
|
+
suggest: "Use readout 'change' with data.windows in every panel, or remove variant."
|
|
442
472
|
}), warnings;
|
|
443
473
|
}
|
|
474
|
+
function segmentShareWarnings(data, look) {
|
|
475
|
+
return data.panels.flatMap((panel, i) => {
|
|
476
|
+
if (!panel.segmentShares) return [];
|
|
477
|
+
let stacks = panel.type === "column" && "sum" in panel.measure && panel.measure.sum.length > 1;
|
|
478
|
+
return look && stacks ? [] : [{
|
|
479
|
+
code: "option-ignored",
|
|
480
|
+
severity: "warn",
|
|
481
|
+
field: ["data", "panels", i, "segmentShares"],
|
|
482
|
+
message: look ? "this panel stacks no measures, so segmentShares does nothing here" : "segment shares print only in the focus look (options.stack.variant 'focus'), so segmentShares does nothing here",
|
|
483
|
+
suggest: look ? "Remove segmentShares from this panel." : "Set options.stack.variant: 'focus', or remove segmentShares."
|
|
484
|
+
}];
|
|
485
|
+
});
|
|
486
|
+
}
|
|
444
487
|
function layoutMetricStack(raw, options) {
|
|
445
488
|
let data = normalizeMetricStack(raw);
|
|
446
489
|
options.stack || stackError("options.stack", "Shared measures require options.stack: {}"), (options.sharedAxis === "none" || options.sharedScale === !0 || options.columns !== void 0 || options.gutters !== void 0 || options.anchors !== void 0 || options.alignmentRules !== void 0 || options.panelOrder !== void 0) && stackError("options", "A metric stack owns top-down order, shared categories, spacing and independent scales; remove conflicting grid controls");
|
|
447
|
-
let stack = options.stack, showUnit = stack.columnVisibility?.unit !== !1, showHeadline = stack.columnVisibility?.headline !== !1, showSpan = stack.columnVisibility?.span !== !1, gutterAfter = (() => {
|
|
490
|
+
let stack = options.stack, look = stack.variant === "focus" && data.panels.every((p) => p.readout === "change"), pointed = look ? stack[STACK_FOCUS] : void 0, focusCategory = pointed === void 0 ? void 0 : data.categories.find((c) => c.id === pointed), focusWindow = focusCategory ? { from: focusCategory.id, to: focusCategory.id, label: focusCategory.label } : data.windows?.compare, showUnit = stack.columnVisibility?.unit !== !1, showHeadline = stack.columnVisibility?.headline !== !1, showSpan = stack.columnVisibility?.span !== !1, gutterAfter = (() => {
|
|
448
491
|
let order = stack.columnOrder ?? [], plotAt = order.indexOf("plot"), gutterAt2 = order.indexOf("gutter");
|
|
449
492
|
return plotAt >= 0 && (gutterAt2 < 0 || plotAt < gutterAt2);
|
|
450
493
|
})();
|
|
451
494
|
stack.heights && options.rows && stackError("options", "Use stack.heights or rows, not both"), (stack.heights && stack.heights.length !== data.panels.length || options.rows && options.rows.length !== data.panels.length) && stackError("options", "Supply one height or row weight per panel");
|
|
452
|
-
let
|
|
495
|
+
let fullTheme = resolveTheme(options.theme), theme = themeForWidth(fullTheme, resolveSize(options.size).width), measure = options.measure ?? defaultMeasurer, na = notApplicableGlyph(options.strings), computed = computeMetricStack(focusCategory ? withCompareWindow(data, focusWindow) : data, options.locale?.language, na, look), font = (role, weight) => ({ family: theme.type.family, ...theme.type[role], ...weight ? { weight } : {} }), valueFont = font("label", 700), nameFont = font("label", 700), unitFont = font("axis"), heroFont = font("title", 700), axisFont = font("axis"), noteFont = font("footnote"), keyFont = secondaryFont(theme), heightOf = (f) => f.size * (f.lineHeight ?? 1.2), displayValueFont = displayFont(fullTheme), changeFont = nameFont, fromFont = font("label"), textBox = (text, f, width) => {
|
|
453
496
|
let lines = wrapText(text, f, width, Number.MAX_SAFE_INTEGER, measure).lines;
|
|
454
497
|
return { lines, w: Math.max(...lines.map((line) => measure(line, f).width), 0), h: heightOf(f) * lines.length };
|
|
455
|
-
}, spacingError = (field, message, fix) => {
|
|
498
|
+
}, NO_BOX = { lines: [], w: 0, h: 0 }, spacingError = (field, message, fix) => {
|
|
456
499
|
throw new NormalizeError("metric-stack-spacing", field, message, "Increase the named dimension; the engine does not shrink or overlap required labels.", fix);
|
|
457
|
-
}, heightFix = (i, px) => stack.heights ? [{ op: "replace", path: `/options/stack/heights/${i}`, value: px }] : void 0, minGap = Math.ceil(heightOf(axisFont) + 8), compactReadout = options[COMPACT_READOUT] === !0, gap = compactReadout && !computed.maturing.length ? 10 : Math.max(26, minGap), arrowWidth = Math.max(unitFont.size, measure("\u2192", unitFont).width), spanSpace = measure(" ", unitFont).width, spanWidths = computed.panels.map((p) => measure(p.readout.spanText, unitFont).width + arrowWidth - measure("\u2192", unitFont).width),
|
|
500
|
+
}, heightFix = (i, px) => stack.heights ? [{ op: "replace", path: `/options/stack/heights/${i}`, value: px }] : void 0, minGap = Math.ceil(heightOf(axisFont) + 8), compactReadout = options[COMPACT_READOUT] === !0, gap = compactReadout && !computed.maturing.length ? 10 : Math.max(26, minGap), arrowWidth = Math.max(unitFont.size, measure("\u2192", unitFont).width), spanSpace = measure(" ", unitFont).width, spanWidths = computed.panels.map((p) => measure(p.readout.spanText, unitFont).width + arrowWidth - measure("\u2192", unitFont).width), sign = (p, text) => withUnit(text, unitOnNumber(p.panel.unit), !0), fromTemplate = chartString(options, "stackFrom", { v1: "\0" }), fromAt = fromTemplate.indexOf("\0"), fromWords = fromAt < 0 ? [`${fromTemplate} `, ""] : [fromTemplate.slice(0, fromAt), fromTemplate.slice(fromAt + 1)], focusText = (p) => {
|
|
501
|
+
let end = (key) => p.readout.claims.find((c) => c.id === `stack:${p.panel.id}:${key}`).output, after = end("after"), before = end("before"), line = after.raw !== null, base2 = before.raw === null ? na : sign(p, before.displayed);
|
|
502
|
+
return {
|
|
503
|
+
value: line ? sign(p, after.displayed) : na,
|
|
504
|
+
change: line && showHeadline ? p.readout.headlineText : "",
|
|
505
|
+
from: line && showSpan ? `${fromWords[0]}${base2}${fromWords[1]}` : "",
|
|
506
|
+
base: line && showSpan ? base2 : "",
|
|
507
|
+
shares: p.shares ?? []
|
|
508
|
+
};
|
|
509
|
+
}, texts = look ? computed.panels.map(focusText) : [], variants = look ? everyFocus(data, raw, options.locale?.language, na).map((c) => c.panels.map(focusText)) : [], lineWidth = (t) => (t.change ? measure(t.change, changeFont).width : 0) + (t.change && t.from ? measure(" ", fromFont).width : 0) + (t.from ? measure(t.from, fromFont).width : 0), hasLine = showHeadline || showSpan, lookWidths = computed.panels.map((_, i) => ({
|
|
510
|
+
value: maxOf(variants.map((v) => measure(v[i].value, displayValueFont).width)),
|
|
511
|
+
line: maxOf(variants.map((v) => lineWidth(v[i]))),
|
|
512
|
+
share: maxOf(variants.flatMap((v) => v[i].shares.map((share) => measure(share.text, keyFont).width)))
|
|
513
|
+
})), minGutter = Math.ceil(look ? Math.max(120, maxOf(computed.panels.map((p, i) => Math.max(
|
|
514
|
+
lookWidths[i].value,
|
|
515
|
+
lookWidths[i].line,
|
|
516
|
+
...(showUnit ? `${p.panel.title} ${p.panel.unit}` : p.panel.title).split(/\s+/).map((word) => measure(word, nameFont).width)
|
|
517
|
+
)))) + 4 : Math.max(120, maxOf(computed.panels.map((p, i) => Math.max(
|
|
458
518
|
showSpan ? spanWidths[i] : 0,
|
|
459
519
|
showHeadline ? measure(p.readout.headlineText, heroFont).width : 0,
|
|
460
520
|
...(showUnit ? `${p.panel.title} ${p.panel.unit}` : p.panel.title).split(/\s+/).map((word) => measure(word, nameFont).width)
|
|
461
521
|
)))) + 4), nameWidth = Math.ceil(maxOf(computed.panels.flatMap((p) => p.panel.title.split(`
|
|
462
|
-
`).map((line) => measure(line, nameFont).width)))) + 4, heroBlock = showHeadline ? showSpan ? Math.max(heroFont.size, heightOf(heroFont) / 2 + heightOf(unitFont) / 2 + 0.36 * (heroFont.size - unitFont.size)) : heroFont.size : showSpan ? heightOf(unitFont) : 0, oneLine = (p, i) => showHeadline ? showSpan ? measure(p.readout.headlineText, heroFont).width + 3 * spanSpace + spanWidths[i] : measure(p.readout.headlineText, heroFont).width : showSpan ? spanWidths[i] : 0, compactFloor = compactReadout ? Math.ceil(maxOf(computed.panels.map(oneLine)) + 4) : 0, defaultGutter = Math.max(170, minGutter, Math.min(320, nameWidth), compactFloor),
|
|
522
|
+
`).map((line) => measure(line, nameFont).width)))) + 4, heroBlock = showHeadline ? showSpan ? Math.max(heroFont.size, heightOf(heroFont) / 2 + heightOf(unitFont) / 2 + 0.36 * (heroFont.size - unitFont.size)) : heroFont.size : showSpan ? heightOf(unitFont) : 0, oneLine = (p, i) => showHeadline ? showSpan ? measure(p.readout.headlineText, heroFont).width + 3 * spanSpace + spanWidths[i] : measure(p.readout.headlineText, heroFont).width : showSpan ? spanWidths[i] : 0, lookLine = (i) => lookWidths[i].value + (hasLine ? 3 * spanSpace + lookWidths[i].line : 0), compactFloor = compactReadout ? Math.ceil(maxOf(computed.panels.map((p, i) => look ? lookLine(i) : oneLine(p, i))) + 4) : 0, nameUnitWidth = look ? Math.ceil(maxOf(computed.panels.map((p) => measure(p.panel.title, nameFont).width + (showUnit ? 2 * spanSpace + measure(p.panel.unit, keyFont).width : 0)))) + 4 : 0, defaultGutter = Math.max(170, minGutter, Math.min(320, Math.max(nameWidth, nameUnitWidth)), compactFloor), baseFont = font("label"), baseLevel = (p) => p.readout.claims.find((c) => c.id === `stack:${p.panel.id}:base${"denominator" in p.panel.measure ? ":raw" : ""}`)?.output.raw ?? null, baseTexts = computed.panels.map((p) => {
|
|
523
|
+
let v = look ? baseLevel(p) : null;
|
|
524
|
+
return v === null ? void 0 : p.format(v);
|
|
525
|
+
}), baseRoom = look ? Math.ceil(maxOf(baseTexts.map((t) => t === void 0 ? 0 : measure(t, baseFont).width)) + 8) : 0, gutterGap = Math.max(28, heightOf(axisFont), look ? baseRoom + 4 : 0), partial = partialIds(data.categories), notes = [...options.footnotes || []], listed = [], stateNotes = {}, engineNumbers = [], notesOff = frameTextOptions(options).footnotesOff, stateNote = (state, authored, engine) => {
|
|
463
526
|
if (authored === void 0 && (!disclosuresShown(options) || notesOff)) {
|
|
464
527
|
listed.push(disclosureNote(engine()));
|
|
465
528
|
return;
|
|
@@ -486,13 +549,16 @@ function layoutMetricStack(raw, options) {
|
|
|
486
549
|
// A later measure steps back into the page but keeps the 1.4:1 mark floor, as a faded series does.
|
|
487
550
|
mature: i === 0 ? base2 : wash(base2, Math.max(0.16, 0.45 - i * 0.12), 1.4)
|
|
488
551
|
}];
|
|
489
|
-
})), stacked = (p) => p.panel.type === "column" && "sum" in p.panel.measure && p.parts.length > 1, panelKeys = computed.panels.map(() => []), seen = /* @__PURE__ */ new Set();
|
|
552
|
+
})), focusIndexes = new Set(look ? stackRange(data, focusWindow) : []), baseIndexes = new Set(look ? stackRange(data, data.windows.base) : []), stateOf = (ci) => focusIndexes.has(ci) ? "focus" : baseIndexes.has(ci) ? "base" : "rest", stateToken = { focus: "focus", base: "neutralMark", rest: "rest" }, statePaint = (state, index, count) => count < 2 ? { token: stateToken[state] } : { token: stateToken[state], theme: { kind: "focus-ramp", state, index, count } }, stacked = (p) => p.panel.type === "column" && "sum" in p.panel.measure && p.parts.length > 1, panelKeys = computed.panels.map(() => []), seen = /* @__PURE__ */ new Set();
|
|
490
553
|
computed.panels.forEach((p, pi) => {
|
|
491
|
-
stacked(p) && "sum" in p.panel.measure
|
|
492
|
-
|
|
493
|
-
|
|
554
|
+
if (stacked(p) && "sum" in p.panel.measure) {
|
|
555
|
+
let count = p.panel.measure.sum.length;
|
|
556
|
+
p.panel.measure.sum.forEach((id, i) => {
|
|
557
|
+
p.parts[i].some((value, ci) => value !== null && value > 0 && visibleValue(p, ci)) && (seen.add(id), panelKeys[pi].push({ id, label: data.measures.find((m) => m.id === id).label, paint: look ? statePaint("focus", i, count) : measurePaints.get(id).mature }));
|
|
558
|
+
});
|
|
559
|
+
}
|
|
494
560
|
}), options.legend === "none" && panelKeys.forEach((items) => items.splice(0));
|
|
495
|
-
let totalsCue = chartString(options, "labelsShowTotals"), keySwatch = 10, keyRow = heightOf(keyFont) + (compactReadout ? 0 : 6), breakWords = (text, width) => text.split(/\r?\n/).flatMap((paragraph) => {
|
|
561
|
+
let totalsCue = chartString(options, "labelsShowTotals"), keySwatch = 10, keyRow = heightOf(keyFont) + (compactReadout ? 0 : look ? 4 : 6), breakWords = (text, width) => text.split(/\r?\n/).flatMap((paragraph) => {
|
|
496
562
|
let lines = [], line = "";
|
|
497
563
|
for (let word of paragraph.split(/[^\S ]+/).filter(Boolean)) {
|
|
498
564
|
let joined = line ? `${line} ${word}` : word;
|
|
@@ -506,17 +572,26 @@ function layoutMetricStack(raw, options) {
|
|
|
506
572
|
}
|
|
507
573
|
return (line || !lines.length) && lines.push(line), lines;
|
|
508
574
|
}), keyLayout = (pi, width, column) => {
|
|
509
|
-
let items = [...panelKeys[pi],
|
|
510
|
-
let
|
|
511
|
-
return { ...item, lines, textW, w:
|
|
512
|
-
}),
|
|
575
|
+
let shareW = look ? lookWidths[pi].share : 0, tail = shareW ? (column ? 12 : 6) + shareW : 0, items = [...panelKeys[pi], ...!look && panelKeys[pi].length ? [{ id: "stack:totals", label: totalsCue, paint: void 0 }] : []].map((item) => {
|
|
576
|
+
let inset2 = item.paint ? keySwatch + 5 : 0, room = Math.max(1, width - inset2 - tail), wrapped = wrapText(item.label, keyFont, room, Number.MAX_SAFE_INTEGER, measure), lines = wrapped.truncated ? breakWords(item.label, room) : wrapped.lines, textW = Math.max(...lines.map((line) => measure(line, keyFont).width));
|
|
577
|
+
return { ...item, lines, textW, w: inset2 + textW + tail, extra: (lines.length - 1) * heightOf(keyFont), shareRight: inset2 + textW + tail };
|
|
578
|
+
}), labelColumn = look && column ? maxOf(items.map((item) => item.textW)) : 0;
|
|
579
|
+
labelColumn && items.forEach((item) => {
|
|
580
|
+
item.w = item.shareRight = keySwatch + 5 + labelColumn + tail;
|
|
581
|
+
});
|
|
582
|
+
let x = 0, dy = 0, rowExtra = 0;
|
|
513
583
|
return { placed: items.map((item, i) => {
|
|
514
584
|
i > 0 && (column || rowExtra > 0 || item.extra > 0 || x + item.w > width) && (x = 0, dy += keyRow + rowExtra, rowExtra = 0);
|
|
515
585
|
let at = { ...item, dx: x, dy };
|
|
516
586
|
return x += item.w + 14, rowExtra = Math.max(rowExtra, item.extra), at;
|
|
517
587
|
}), h: items.length ? dy + keyRow + rowExtra : 0 };
|
|
588
|
+
}, captionBox = (pi, width) => data.panels[pi].keyTitle && panelKeys[pi].length ? textBox(data.panels[pi].keyTitle, keyFont, width) : NO_BOX, captionRoom = (pi, width) => {
|
|
589
|
+
let box = captionBox(pi, width);
|
|
590
|
+
return box.h ? box.h + 2 : 0;
|
|
518
591
|
}, legend = [];
|
|
519
|
-
if (
|
|
592
|
+
if (look)
|
|
593
|
+
hasProvisional && legend.push({ id: "stack:provisional", label: chartString(options, "provisional"), paint: muted, key: "line", dash: dashToken(theme, "reference") });
|
|
594
|
+
else if (!seen.size) {
|
|
520
595
|
hasProvisional && computed.panels.some((p) => !p.panel.emphasis && hasMatureLine(p)) && legend.push({ id: "stack:mature", label: chartString(options, "matureCohort"), paint: neutral, key: "line" });
|
|
521
596
|
let emphasis = computed.panels.find((p) => p.panel.emphasis && hasMatureLine(p));
|
|
522
597
|
emphasis && legend.push({ id: "stack:emphasis", label: emphasis.panel.title, paint: accent, key: "line", width: strokeToken(theme, "focus") }), hasProvisional && legend.push({ id: "stack:provisional", label: chartString(options, "provisional"), paint: muted, key: "line", dash: dashToken(theme, "reference") });
|
|
@@ -539,20 +614,25 @@ function layoutMetricStack(raw, options) {
|
|
|
539
614
|
return { occupied: occupied2, frame: frame2 };
|
|
540
615
|
};
|
|
541
616
|
automatic && (size = { ...size, height: Math.max(size.height, 1600) });
|
|
542
|
-
let { occupied, frame } = frameAt(), valueWidth = maxOf(computed.panels.flatMap((p) => p.values.map((v) => v === null ? measure(na, valueFont).width : measure(p.format(v), valueFont).width))) + 4, categoryWidth = maxOf(data.categories.flatMap((c) => c.label.split(/\s+/).map((word) => measure(word, keyFont).width))) + 3, valueRoom = Math.max(20, valueWidth, categoryWidth) * data.categories.length,
|
|
617
|
+
let { occupied, frame } = frameAt(), valueWidth = maxOf(computed.panels.flatMap((p) => p.values.map((v) => v === null ? measure(na, valueFont).width : measure(p.format(v), valueFont).width))) + 4, categoryWidth = maxOf(data.categories.flatMap((c) => c.label.split(/\s+/).map((word) => measure(word, keyFont).width))) + 3, periodAxis = look && data.periods !== void 0, valueRoom = (look ? Math.max(LOOK_CATEGORY_FLOOR, periodAxis ? 0 : categoryWidth) : Math.max(20, valueWidth, categoryWidth)) * data.categories.length, thinnedRoom = Math.max(valueRoom / 2, look ? LOOK_CATEGORY_FLOOR * data.categories.length : 0), unitBox = (p, width) => showUnit ? textBox(p.panel.unit, keyFont, width) : NO_BOX, gutterAt = (width) => {
|
|
543
618
|
let boxes = computed.panels.map((p) => {
|
|
544
|
-
let name = textBox(p.panel.title, nameFont, width), unit = unitBox(p, width), beside = showUnit && compactReadout && name.lines.length === 1 && unit.lines.length === 1 && name.w + 2 * spanSpace + unit.w <= width;
|
|
619
|
+
let name = textBox(p.panel.title, nameFont, width), unit = unitBox(p, width), beside = showUnit && (compactReadout || look) && name.lines.length === 1 && unit.lines.length === 1 && name.w + 2 * spanSpace + unit.w <= width;
|
|
545
620
|
return { name, unit, beside, top: beside ? Math.max(name.h, unit.h) : showUnit ? name.h + 2 + unit.h : name.h };
|
|
546
621
|
}), keys = computed.panels.map((_, i) => keyLayout(i, width, !compactReadout)), heights2 = boxes.map((box, i) => {
|
|
547
|
-
|
|
548
|
-
|
|
622
|
+
let captioned = keys[i].h ? captionRoom(i, width) : 0;
|
|
623
|
+
if (look) {
|
|
624
|
+
let lineH = hasLine ? heightOf(changeFont) : 0, keyed2 = keys[i].h ? 6 + captioned + keys[i].h : 0;
|
|
625
|
+
return compactReadout ? box.top + 4 + Math.max(heightOf(displayValueFont), lineH) + keyed2 : box.top + 4 + heightOf(displayValueFont) + (lineH ? 4 + lineH : 0) + keyed2;
|
|
626
|
+
}
|
|
627
|
+
if (compactReadout) return box.top + 4 + heroBlock + captioned + keys[i].h - (heroBlock ? 0 : 4);
|
|
628
|
+
let keyed = keys[i].h ? captioned + keys[i].h + 6 : 0;
|
|
549
629
|
return showUnit && showHeadline && showSpan ? box.name.h + box.unit.h + heightOf(heroFont) + heightOf(unitFont) + 18 + keyed : box.top + (showHeadline ? 10 + heightOf(heroFont) : 0) + (showSpan ? (showHeadline ? 6 : 10) + heightOf(unitFont) : 0) + keyed;
|
|
550
630
|
});
|
|
551
631
|
return { boxes, keys, heights: heights2 };
|
|
552
632
|
}, atDefault = gutterAt(defaultGutter), narrow = frame.plot.w - defaultGutter - gutterGap < valueRoom || atDefault.heights.some((h, i) => stack.heights !== void 0 && Math.ceil(h) > stack.heights[i]), authoredGutter = narrow ? void 0 : stack.columnOverrides?.gutter?.width, widest = frame.plot.w - gutterGap - valueRoom, heldHeight = !automatic || stack.heights !== void 0 || options.rows !== void 0, fitGutter = (width) => {
|
|
553
633
|
let at = gutterAt(width);
|
|
554
634
|
return !heldHeight || at.heights.every((h, i) => h <= atDefault.heights[i]) ? at : void 0;
|
|
555
|
-
}, wanted = authoredGutter === void 0 ? defaultGutter : Math.min(Math.max(authoredGutter, minGutter, compactFloor), widest, options[GUTTER_LIMIT] ?? 1 / 0), fitted = wanted === defaultGutter ? atDefault : fitGutter(wanted), gutter = fitted ? wanted : defaultGutter, { boxes: gutterBoxes, keys: gutterKeys, heights: gutterHeights } = fitted ?? atDefault, gutterFloored = authoredGutter !== void 0 && gutter > authoredGutter, gutterCapped = authoredGutter !== void 0 && gutter < authoredGutter, thin = narrow && frame.plot.w < valueRoom, lastIndex = data.categories.length - 1, named = (ci) => !thin || ci % 2 === lastIndex % 2,
|
|
635
|
+
}, wanted = authoredGutter === void 0 ? defaultGutter : Math.min(Math.max(authoredGutter, minGutter, compactFloor), widest, options[GUTTER_LIMIT] ?? 1 / 0), fitted = wanted === defaultGutter ? atDefault : fitGutter(wanted), gutter = fitted ? wanted : defaultGutter, { boxes: gutterBoxes, keys: gutterKeys, heights: gutterHeights } = fitted ?? atDefault, gutterFloored = authoredGutter !== void 0 && gutter > authoredGutter, gutterCapped = authoredGutter !== void 0 && gutter < authoredGutter, onRight = gutterAfter && !narrow, inset = narrow || onRight ? baseRoom : 0, thin = narrow && !periodAxis && frame.plot.w - inset < valueRoom, lastIndex = data.categories.length - 1, named = (ci) => !thin || ci % 2 === lastIndex % 2, plotX = narrow || onRight ? frame.plot.x + inset : frame.plot.x + gutter + gutterGap, plotW = narrow ? frame.plot.w - inset : frame.plot.w - gutter - gutterGap - inset, trackX = onRight ? frame.plot.x + plotW + gutterGap : frame.plot.x, trackW = narrow ? frame.plot.w : gutter, trackAlign = narrow ? void 0 : stack.columnOverrides?.gutter?.align, seat = (w) => trackAlign === "right" ? trackX + trackW - w : trackAlign === "center" ? trackX + (trackW - w) / 2 : trackX, step = plotW / data.categories.length, minimumWidth = Math.ceil(size.width - plotW + (thin ? thinnedRoom : valueRoom)), needsWidth = (width) => ({
|
|
556
636
|
type: "grid",
|
|
557
637
|
size,
|
|
558
638
|
plot: frame.plot,
|
|
@@ -570,8 +650,13 @@ function layoutMetricStack(raw, options) {
|
|
|
570
650
|
});
|
|
571
651
|
if (size.width < minimumWidth) return needsWidth(minimumWidth);
|
|
572
652
|
let heads = narrow ? computed.panels.map((p, i) => {
|
|
573
|
-
let name = textBox(p.panel.title, nameFont, frame.plot.w), unit = unitBox(p, frame.plot.w), unitBeside = showUnit && name.lines.length === 1 && unit.lines.length === 1 && name.w + 2 * spanSpace + unit.w <= frame.plot.w,
|
|
574
|
-
|
|
653
|
+
let name = textBox(p.panel.title, nameFont, frame.plot.w), unit = unitBox(p, frame.plot.w), unitBeside = showUnit && name.lines.length === 1 && unit.lines.length === 1 && name.w + 2 * spanSpace + unit.w <= frame.plot.w, captioned = captionRoom(i, frame.plot.w);
|
|
654
|
+
if (look) {
|
|
655
|
+
let spanBeside2 = hasLine && lookLine(i) <= frame.plot.w, top2 = unitBeside ? Math.max(name.h, unit.h) : showUnit ? name.h + 2 + unit.h : name.h, body2 = top2 + 8 + heightOf(displayValueFont) + (!hasLine || spanBeside2 ? 0 : 6 + heightOf(changeFont)) + 6, key2 = keyLayout(i, frame.plot.w, !1);
|
|
656
|
+
return { name, unit, unitBeside, spanBeside: spanBeside2, top: top2, key: key2, body: body2, h: body2 + (key2.h ? captioned + key2.h + 4 : 0) };
|
|
657
|
+
}
|
|
658
|
+
let hero = measure(p.readout.headlineText, heroFont).width, spanBeside = showHeadline && showSpan && hero + 3 * spanSpace + spanWidths[i] + 2 * spanSpace <= frame.plot.w, top = unitBeside ? Math.max(name.h, unit.h) : showUnit ? name.h + 2 + unit.h : name.h, block = showHeadline ? showSpan ? heightOf(heroFont) + (spanBeside ? 0 : 6 + heightOf(unitFont)) : heightOf(heroFont) : showSpan ? heightOf(unitFont) : 0, key = keyLayout(i, frame.plot.w, !1), body = block ? showHeadline && showSpan ? top + 8 + heightOf(heroFont) + (spanBeside ? 0 : 6 + heightOf(unitFont)) + 6 : top + 8 + block + 6 : top + 6;
|
|
659
|
+
return { name, unit, unitBeside, spanBeside, top, key, body, h: body + (key.h ? captioned + key.h + 4 : 0) };
|
|
575
660
|
}) : void 0, minimumHeights = gutterHeights.map((h) => Math.ceil(Math.max(narrow ? 0 : h, 3 * heightOf(valueFont) + 20))), heights = computed.panels.map((p, i) => stack.heights?.[i] ?? Math.max(minimumHeights[i], p.panel.type === "column" ? p.parts.length > 1 ? narrow ? 110 : 150 : narrow ? 120 : 200 : narrow ? 90 : 130));
|
|
576
661
|
if (options.rows) {
|
|
577
662
|
let factor = maxOf(minimumHeights.map((h, i) => h / options.rows[i]));
|
|
@@ -582,10 +667,13 @@ function layoutMetricStack(raw, options) {
|
|
|
582
667
|
let fix = stack.heights ? short.flatMap((i) => heightFix(i, minimumHeights[i])) : void 0;
|
|
583
668
|
spacingError(`options.stack.heights.${short[0]}`, `${short.map((i) => `Panel '${data.panels[i].id}' needs at least ${minimumHeights[i]} px`).join(", ")} for its readout and value labels`, fix);
|
|
584
669
|
}
|
|
585
|
-
let headRoom = heads?.reduce((sum2, head) => sum2 + head.h, 0) ?? 0, partialOnValues = computed.panels.some((p) => p.panel.type === "column" && computed.partial.some((i) => p.values[i] !== null)), partialMark = marker(stateNotes.partial), toDate = ` ${options.strings?.toDate ?? localeStrings(options.locale?.language).toDate}`, categoryName = (c) => c.label + (c.partial ? partialMark ? partialOnValues ? "" : partialMark : saysToDate(c.label, toDate.trim()) ? "" : toDate : ""), categoryBoxes = data.categories.map((c) => textBox(categoryName(c), keyFont, (thin ? 2 : 1) * step - 3)), categoryHeight = maxOf(categoryBoxes.map((b) => b.h)), periodBoxes = data.periods?.map((period) => {
|
|
586
|
-
let indexes = stackRange(data, period), bold = data.windows ? [data.windows.base, data.windows.compare].some((w) => w.from === period.from && w.to === period.to) : indexes.every((i) => computed.mature.includes(i)), f = { ...keyFont, weight: bold ? 700 : keyFont.weight };
|
|
587
|
-
return { ...textBox(period.label, f, indexes.length * step - 4), indexes, bold, font: f };
|
|
588
|
-
}), axisHeight = (compactReadout ? 8 : 12) + categoryHeight + (periodBoxes ? 10 + maxOf(periodBoxes.map((b) => b.h)) : 0) + (compactReadout ? 4 : 10), bandFirstIndex = data.states?.maturing ? data.panels.findIndex((p) => data.states.maturing.panels.includes(p.id)) : -1, firstOverhang = computed.maturing.length ? gap : 0, hasMethod = showHeadline || showSpan, readLogic = data.panels.some((p) => p.readout === "change") && data.windows ? chartString(options, showHeadline ? "stackChangeMethod" : "stackAverageMethod", { v1: metricStackGrain(data), v2: data.windows.base.label, v3: data.windows.compare.label }) : chartString(options, `stack${narrow ? "Above" : onRight ? "Right" : "Left"}${showSpan ? showHeadline ? "Method" : "Remaining" : "Rates"}`),
|
|
670
|
+
let headRoom = heads?.reduce((sum2, head) => sum2 + head.h, 0) ?? 0, partialOnValues = computed.panels.some((p) => p.panel.type === "column" && computed.partial.some((i) => p.values[i] !== null)), partialMark = marker(stateNotes.partial), toDate = ` ${options.strings?.toDate ?? localeStrings(options.locale?.language).toDate}`, categoryName = (c) => c.label + (c.partial ? partialMark ? partialOnValues ? "" : partialMark : saysToDate(c.label, toDate.trim()) ? "" : toDate : ""), categoryBoxes = data.categories.map((c) => periodAxis ? NO_BOX : textBox(categoryName(c), keyFont, (thin ? 2 : 1) * step - 3)), categoryHeight = maxOf(categoryBoxes.map((b) => b.h)), periodBoxes = data.periods?.map((period) => {
|
|
671
|
+
let indexes = stackRange(data, period), bold = !periodAxis && (data.windows ? [data.windows.base, data.windows.compare].some((w) => w.from === period.from && w.to === period.to) : indexes.every((i) => computed.mature.includes(i))), f = { ...keyFont, weight: bold ? 700 : keyFont.weight };
|
|
672
|
+
return { ...textBox(period.label, f, indexes.length * step - (periodAxis ? 7 : 4)), indexes, bold, font: f };
|
|
673
|
+
}), axisHeight = periodAxis ? PERIOD_TICK_TOP + maxOf(periodBoxes.map((b) => b.h)) + (compactReadout ? 4 : 10) : (compactReadout ? 8 : 12) + categoryHeight + (periodBoxes ? 10 + maxOf(periodBoxes.map((b) => b.h)) : 0) + (compactReadout ? 4 : 10), bandFirstIndex = data.states?.maturing ? data.panels.findIndex((p) => data.states.maturing.panels.includes(p.id)) : -1, firstOverhang = computed.maturing.length ? gap : 0, hasMethod = showHeadline || showSpan || look, readLogic = data.panels.some((p) => p.readout === "change") && data.windows ? chartString(options, showHeadline ? "stackChangeMethod" : "stackAverageMethod", { v1: metricStackGrain(data), v2: data.windows.base.label, v3: data.windows.compare.label }) : chartString(options, `stack${narrow ? "Above" : onRight ? "Right" : "Left"}${showSpan ? showHeadline ? "Method" : "Remaining" : "Rates"}`), focusLabelFont = { ...keyFont, weight: 700 }, header = look ? (() => {
|
|
674
|
+
let sp = measure(" ", keyFont).width, dashW = 18, against = chartString(options, "stackAgainst"), base2 = data.windows.base.label, widest2 = maxOf([data.windows.compare.label, ...data.categories.map((c) => c.label)].map((label) => measure(label, focusLabelFont).width)), tail = sp + measure(against, keyFont).width + sp + dashW + sp + measure(base2, keyFont).width, several = (range) => stackRange(data, range).length > 1, averages = several(data.windows.base) || several(data.windows.compare) ? chartString(options, "stackAverages", { v1: metricStackGrain(data) }) : "", shown = several(data.windows.base) || several(focusWindow), sentence = averages ? textBox(averages, keyFont, frame.plot.w) : NO_BOX, beside = sentence.lines.length === 1 && widest2 + tail + 2 * sp + sentence.w <= frame.plot.w;
|
|
675
|
+
return { sp, dashW, against, base: base2, averages: shown ? averages : "", sentence, beside, h: heightOf(keyFont) + (averages && !beside ? sentence.h : 0) };
|
|
676
|
+
})() : void 0, readLogicBox = header ? { lines: [], w: frame.plot.w, h: header.h } : hasMethod ? textBox(readLogic, keyFont, frame.plot.w) : NO_BOX, topRoom = (hasMethod ? readLogicBox.h + 12 + (compactReadout ? 4 : 30) : 0) + (bandFirstIndex === 0 ? firstOverhang : 0), neededPlotHeight = topRoom + headRoom + heights.reduce((a, b) => a + b, 0) + gap * (heights.length - 1) + axisHeight, overhead = size.height - frame.plot.h, naturalHeight = Math.ceil(overhead + neededPlotHeight), shrinks = !stack.heights && !options.rows, floorPlotHeight = neededPlotHeight - heights.reduce((a, b) => a + b, 0) + minimumHeights.reduce((a, b) => a + b, 0), floorHeight = shrinks ? Math.ceil(overhead + floorPlotHeight) : naturalHeight, minHeight = naturalHeight;
|
|
589
677
|
if (automatic)
|
|
590
678
|
size = { ...size, height: naturalHeight }, { occupied, frame } = frameAt();
|
|
591
679
|
else if (frame.plot.h < neededPlotHeight - 0.01)
|
|
@@ -630,21 +718,39 @@ function layoutMetricStack(raw, options) {
|
|
|
630
718
|
let box = measure(text, f);
|
|
631
719
|
put(id, text, f, { x: x - box.width / 2, y: y2, w: box.width, h: heightOf(f) }, owner, ink, role, kind, [text], claimId, below);
|
|
632
720
|
};
|
|
633
|
-
|
|
721
|
+
if (header) {
|
|
722
|
+
let at = (text, f) => ({ w: measure(text, f).width, h: heightOf(f) }), lineY = frame.plot.y, hx = frame.plot.x, focus = at(focusWindow.label, focusLabelFont);
|
|
723
|
+
put("stack:focus", focusWindow.label, focusLabelFont, { x: hx, y: lineY, ...focus }, {}, { token: "ink" }, "label", "annotation"), hx += focus.w + header.sp;
|
|
724
|
+
let against = at(header.against, keyFont);
|
|
725
|
+
put("stack:against", header.against, keyFont, { x: hx, y: lineY, ...against }, {}, muted, "secondary", "annotation"), hx += against.w + header.sp, scene.push({ t: "line", id: "stack:base-key", x1: hx, x2: hx + header.dashW, y1: lineY + heightOf(keyFont) / 2, y2: lineY + heightOf(keyFont) / 2, stroke: baseStroke, width: strokeToken(theme, "rule"), dash: dashToken(theme, "reference"), owner: {}, part: "baseKey" }), hx += header.dashW + header.sp;
|
|
726
|
+
let base2 = at(header.base, keyFont);
|
|
727
|
+
if (put("stack:base-window", header.base, keyFont, { x: hx, y: lineY, ...base2 }, {}, muted, "secondary", "annotation"), hx += base2.w, header.averages) {
|
|
728
|
+
let box = header.sentence;
|
|
729
|
+
put("stack:averages", header.averages, keyFont, header.beside ? { x: hx + 2 * header.sp, y: lineY, w: box.w, h: box.h } : { x: frame.plot.x, y: lineY + heightOf(keyFont), w: box.w, h: box.h }, {}, muted, "secondary", "annotation", box.lines);
|
|
730
|
+
}
|
|
731
|
+
} else put("stack:read-logic", readLogic, keyFont, { x: frame.plot.x, y: frame.plot.y, w: readLogicBox.w, h: readLogicBox.h }, {}, muted, "secondary", "annotation", readLogicBox.lines);
|
|
732
|
+
hasMethod && scene.push({ t: "line", id: "stack:header-rule", x1: frame.plot.x, x2: frame.plot.x + frame.plot.w, y1: frame.plot.y + readLogicBox.h + 10, y2: frame.plot.y + readLogicBox.h + 10, stroke: { token: "grid" }, width: strokeToken(theme, "hair"), owner: {}, part: "headerRule" });
|
|
634
733
|
let plots = [], tops = [], y = frame.plot.y + topRoom;
|
|
635
734
|
heights.forEach((h, i) => {
|
|
636
735
|
tops.push(y), y += heads?.[i].h ?? 0, plots.push({ x: plotX, y, w: plotW, h }), y += h + gap;
|
|
637
736
|
});
|
|
638
|
-
let derived = { gap, gutterWidth: narrow ? 0 : gutter, axisOwner: data.panels.at(-1).id, readouts: computed.panels.map((p) => printedReadout(p.readout, showHeadline, showSpan)), panels: [] }, bandLabelHeight = 0;
|
|
737
|
+
let derived = { gap, gutterWidth: narrow ? 0 : gutter, axisOwner: data.panels.at(-1).id, readouts: computed.panels.map((p) => printedReadout(p.readout, showHeadline, showSpan, look)), panels: [] }, bandLabelHeight = 0;
|
|
639
738
|
if (computed.maturing.length) {
|
|
640
739
|
let scope = data.states.maturing, indexes = scope.panels.map((id) => data.panels.findIndex((p) => p.id === id)).sort((a, b) => a - b), first = plots[indexes[0]], last = plots[indexes.at(-1)], firstTop = tops[indexes[0]], bandAt = categoryBandFromCenters(data.categories.map((c) => c.id), first, (i) => plotX + (i + 0.5) * step, "x"), left = bandAt(scope.from), right = bandAt(scope.to), rect = { x: left.x, y: firstTop - firstOverhang, w: right.x + right.w - left.x, h: last.y + last.h - firstTop + firstOverhang }, nodeId = "stack:maturing:band";
|
|
641
740
|
derived.band = { rect, panels: indexes.map((i) => data.panels[i].id), categoryIds: computed.maturing.map((i) => data.categories[i].id), nodeId }, scene.push({ t: "rect", id: nodeId, rect, fill: wash(neutral, 0.035), owner: { annotationId: "stack:maturing" }, part: "band" });
|
|
642
741
|
let text = (scope.label ?? chartString(options, "notYetMature")) + marker(stateNotes.maturing), box = textBox(text, noteFont, rect.w - 8);
|
|
643
742
|
bandLabelHeight = box.h, put("stack:maturing:label", text, noteFont, { x: rect.x + (rect.w - box.w) / 2, y: rect.y + 4, w: box.w, h: box.h }, { annotationId: "stack:maturing" }, muted, "footnote", "annotation", box.lines);
|
|
644
743
|
}
|
|
645
|
-
|
|
744
|
+
if (look) {
|
|
745
|
+
let lastBottom = plots.at(-1).y + plots.at(-1).h;
|
|
746
|
+
if (derived.focusBand = { x: plotX, y: plots[0].y, w: plotW, h: lastBottom - plots[0].y }, focusIndexes.size === 1) {
|
|
747
|
+
let fx = plotX + ([...focusIndexes][0] + 0.5) * step;
|
|
748
|
+
(narrow ? plots.map((p) => [p.y, p.y + p.h]) : [[plots[0].y, lastBottom]]).forEach(([y1, y2], i) => scene.push({ t: "line", id: narrow ? `stack:focus-rule:${i}` : "stack:focus-rule", x1: fx, x2: fx, y1, y2, stroke: { token: "grid" }, width: strokeToken(theme, "rule"), owner: {}, part: "focusRule" }));
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
let marks = { panels: [] }, yielding = /* @__PURE__ */ new Set(), plated = /* @__PURE__ */ new Set();
|
|
646
752
|
computed.panels.forEach((p, pi) => {
|
|
647
|
-
let formatValue = p.format, plot = plots[pi], baseline = plot.y + plot.h, owner = { seriesId: p.panel.id }, color = p.panel.emphasis ? accent : neutral, labelGap = p.panel.type === "line" ? 9 : 5, clearance = heightOf(valueFont) + labelGap + (p.panel.type === "line" ? 4.5 : 0) + 4, bandClear = pi === bandFirstIndex ? Math.max(0, bandLabelHeight + 8 - firstOverhang - (heads?.[pi].h ?? 0)) : 0, headroom = clearance + bandClear;
|
|
753
|
+
let formatValue = p.format, plot = plots[pi], baseline = plot.y + plot.h, owner = { seriesId: p.panel.id }, color = p.panel.emphasis ? accent : look ? { token: "neutralMark" } : neutral, labelGap = p.panel.type === "line" ? 9 : 5, clearance = heightOf(valueFont) + labelGap + (p.panel.type === "line" ? 4.5 : 0) + 4, bandClear = pi === bandFirstIndex ? Math.max(0, bandLabelHeight + 8 - firstOverhang - (heads?.[pi].h ?? 0)) : 0, headroom = clearance + bandClear;
|
|
648
754
|
plot.h <= headroom + 10 && spacingError(`options.stack.heights.${pi}`, `Panel '${p.panel.id}' needs at least ${Math.ceil(headroom + 11)} px height for its band and labels`, heightFix(pi, Math.ceil(headroom + 11)));
|
|
649
755
|
let visible = (i) => visibleValue(p, i), max = Math.max(maxOf(p.values.map((v, i) => visible(i) ? v ?? 0 : 0)), 0), domainMax = max === 0 ? 1 : max / (1 - headroom / plot.h), py = (v) => baseline - v / domainMax * plot.h, nodeIds = data.categories.map(() => []), displayed = data.categories.map(() => na), emit = (node, ci) => {
|
|
650
756
|
scene.push(node), ci !== void 0 && nodeIds[ci].push(node.id);
|
|
@@ -655,30 +761,69 @@ function layoutMetricStack(raw, options) {
|
|
|
655
761
|
let last = requests.at(-1);
|
|
656
762
|
lineAlign && last?.id === args[0] && (last.align = lineAlign);
|
|
657
763
|
}, unitBeside = head ? head.unitBeside : gutterBoxes[pi].beside, nameX = seat(unitBeside ? boxes.name.w + 2 * spanSpace + boxes.unit.w : boxes.name.w);
|
|
658
|
-
putLines(`${p.panel.id}:name`, p.panel.title, nameFont, { x: nameX, y: gy, w: boxes.name.w, h: boxes.name.h }, owner, { token: "ink" }, "label", "category", boxes.name.lines), unitBeside ? put(`${p.panel.id}:unit`, p.panel.unit, keyFont, { x: nameX + boxes.name.w + 2 * spanSpace, y: gy + boxes.name.h - boxes.unit.h, w: boxes.unit.w, h: boxes.unit.h }, owner, muted, "secondary", "category", boxes.unit.lines) : showUnit ? (gy += boxes.name.h + 2, putLines(`${p.panel.id}:unit`, p.panel.unit, keyFont, { x: seat(boxes.unit.w), y: gy, w: boxes.unit.w, h: boxes.unit.h }, owner, muted, "secondary", "category", boxes.unit.lines)) : gy += boxes.name.h, gy = head ? tops[pi] + head.top + 8 : unitBeside ? tops[pi] + gutterBoxes[pi].top + 4 : gy + boxes.unit.h + (compactReadout ? 4 : 10);
|
|
659
|
-
let hero = measure(p.readout.headlineText, heroFont),
|
|
660
|
-
|
|
764
|
+
putLines(`${p.panel.id}:name`, p.panel.title, nameFont, { x: nameX, y: gy, w: boxes.name.w, h: boxes.name.h }, owner, { token: "ink" }, "label", "category", boxes.name.lines), unitBeside ? put(`${p.panel.id}:unit`, p.panel.unit, keyFont, { x: nameX + boxes.name.w + 2 * spanSpace, y: gy + boxes.name.h - boxes.unit.h, w: boxes.unit.w, h: boxes.unit.h }, owner, muted, "secondary", "category", boxes.unit.lines) : showUnit ? (gy += boxes.name.h + 2, putLines(`${p.panel.id}:unit`, p.panel.unit, keyFont, { x: seat(boxes.unit.w), y: gy, w: boxes.unit.w, h: boxes.unit.h }, owner, muted, "secondary", "category", boxes.unit.lines)) : gy += boxes.name.h, gy = head ? tops[pi] + head.top + 8 : unitBeside ? tops[pi] + gutterBoxes[pi].top + 4 : gy + boxes.unit.h + (compactReadout || look ? 4 : 10);
|
|
765
|
+
let hero = measure(p.readout.headlineText, heroFont), lookKeyTop;
|
|
766
|
+
if (look) {
|
|
767
|
+
let t = texts[pi], vf = displayValueFont, vw = measure(t.value, vf).width, lw = lineWidth(t), claimOf = (key2) => p.readout.claims.find((c) => c.id === `stack:${p.panel.id}:${key2}`).id, beside = hasLine && (head ? head.spanBeside : compactReadout), vx = seat(beside ? vw + 3 * spanSpace + lw : vw);
|
|
768
|
+
put(`${p.panel.id}:after`, t.value, vf, { x: vx, y: gy, w: vw, h: heightOf(vf) }, owner, { token: "ink" }, "title", "point", [t.value], claimOf("after"));
|
|
769
|
+
let lx = beside ? vx + vw + 3 * spanSpace : seat(lw), ly = beside ? gy + heightOf(vf) / 2 - heightOf(changeFont) / 2 + 0.36 * (vf.size - changeFont.size) : gy + heightOf(vf) + (head ? 6 : 4);
|
|
770
|
+
if (t.change) {
|
|
771
|
+
let w = measure(t.change, changeFont).width;
|
|
772
|
+
put(`${p.panel.id}:headline`, t.change, changeFont, { x: lx, y: ly, w, h: heightOf(changeFont) }, owner, { token: "ink" }, "label", "point", [t.change], claimOf("headline")), lx += w + measure(" ", fromFont).width;
|
|
773
|
+
}
|
|
774
|
+
if (t.from) for (let [key2, text, claim] of [["from", fromWords[0].trimEnd(), void 0], ["before", t.base, claimOf("before")], ["from-end", fromWords[1].trim(), void 0]]) {
|
|
775
|
+
if (!text) continue;
|
|
776
|
+
key2 === "before" && fromWords[0].endsWith(" ") && (lx += measure(" ", fromFont).width), key2 === "from-end" && fromWords[1].startsWith(" ") && (lx += measure(" ", fromFont).width);
|
|
777
|
+
let w = measure(text, fromFont).width;
|
|
778
|
+
put(`${p.panel.id}:${key2}`, text, fromFont, { x: lx, y: ly, w, h: heightOf(fromFont) }, owner, muted, "label", "point", [text], claim), lx += w;
|
|
779
|
+
}
|
|
780
|
+
lookKeyTop = head ? void 0 : (beside ? gy + Math.max(heightOf(vf), hasLine ? heightOf(changeFont) : 0) : gy + heightOf(vf) + (hasLine ? 4 + heightOf(changeFont) : 0)) + 6;
|
|
781
|
+
}
|
|
782
|
+
let headlineClaim = p.readout.claims.find((c) => c.id === `stack:${p.panel.id}:headline` || c.id === `stack:${p.panel.id}:rate`), sideBySide = showHeadline && showSpan && (head?.spanBeside || !head && compactReadout), heroX = seat(sideBySide ? hero.width + 3 * spanSpace + spanWidths[pi] : hero.width);
|
|
783
|
+
showHeadline && !look && put(`${p.panel.id}:headline`, p.readout.headlineText, heroFont, { x: heroX, y: gy, w: hero.width, h: compactReadout ? heroFont.size : heightOf(heroFont) }, owner, color, "title", "point", [p.readout.headlineText], headlineClaim.id);
|
|
661
784
|
let before = p.readout.claims.find((c) => c.id === `stack:${p.panel.id}:before`), after = p.readout.claims.find((c) => c.id === `stack:${p.panel.id}:after`), gx = sideBySide ? heroX : seat(spanWidths[pi]), heroTop = gy;
|
|
662
|
-
if (sideBySide ? (gx += hero.width + 3 * spanSpace, gy += heightOf(heroFont) / 2 - heightOf(unitFont) / 2 + 0.36 * (heroFont.size - unitFont.size)) : showHeadline && (gy += heightOf(heroFont) + 6), showSpan) for (let [suffix, text, claim] of [["before", before.output.displayed, before.id], ["arrow", "\u2192", void 0], ["after", after.output.displayed, after.id]]) {
|
|
785
|
+
if (sideBySide ? (gx += hero.width + 3 * spanSpace, gy += heightOf(heroFont) / 2 - heightOf(unitFont) / 2 + 0.36 * (heroFont.size - unitFont.size)) : showHeadline && (gy += heightOf(heroFont) + 6), showSpan && !look) for (let [suffix, text, claim] of [["before", before.output.displayed, before.id], ["arrow", "\u2192", void 0], ["after", after.output.displayed, after.id]]) {
|
|
663
786
|
suffix === "arrow" && (gx += spanSpace);
|
|
664
787
|
let width = suffix === "arrow" ? arrowWidth : measure(text, unitFont).width;
|
|
665
788
|
put(`${p.panel.id}:${suffix}`, text, unitFont, { x: gx, y: gy, w: width, h: heightOf(unitFont) }, owner, muted, "axis", "point", [text], claim), gx += width + (suffix === "arrow" ? spanSpace : 0);
|
|
666
789
|
}
|
|
667
|
-
let barWidth = step * 0.64, segmentLabels = stacked(p) && !thin && data.categories.every((_, ci) => {
|
|
790
|
+
let barWidth = step * 0.64, segmentLabels = stacked(p) && !thin && !look && data.categories.every((_, ci) => {
|
|
668
791
|
let part = p.parts[0][ci];
|
|
669
792
|
return !visible(ci) || !part || part / domainMax * plot.h >= heightOf(valueFont) + 10 && measure(formatValue(part), valueFont).width < barWidth - 6;
|
|
670
|
-
}), key = head ? head.key : gutterKeys[pi], keyTop = head ? tops[pi] + head.body : compactReadout ? heroTop + heroBlock : gy + (showSpan ? heightOf(unitFont) + 6 : 0);
|
|
793
|
+
}), key = head ? head.key : gutterKeys[pi], keyTop = head ? tops[pi] + head.body : lookKeyTop ?? (compactReadout ? heroTop + heroBlock : gy + (showSpan ? heightOf(unitFont) + 6 : 0)), caption = key.placed.length ? captionBox(pi, head ? frame.plot.w : trackW) : NO_BOX;
|
|
794
|
+
caption.h && (putLines(`${p.panel.id}:key-title`, data.panels[pi].keyTitle, keyFont, { x: seat(caption.w), y: keyTop, w: caption.w, h: caption.h }, owner, muted, "secondary", "category", caption.lines), keyTop += caption.h + 2);
|
|
671
795
|
for (let item of key.placed) {
|
|
672
796
|
if (item.id === "stack:totals" && segmentLabels) continue;
|
|
673
797
|
let rowW = maxOf(key.placed.filter((other) => other.dy === item.dy && !(other.id === "stack:totals" && segmentLabels)).map((other) => other.dx + other.w)), kx = seat(rowW) + item.dx, ky = keyTop + item.dy;
|
|
674
798
|
item.paint && scene.push({ t: "rect", id: `${p.panel.id}:key:${item.id}`, rect: { x: kx, y: ky + (keyRow - keySwatch) / 2, w: keySwatch, h: keySwatch }, fill: item.paint, owner: { seriesId: item.id }, part: "swatch" });
|
|
675
799
|
let tx = item.paint ? kx + keySwatch + 5 : kx;
|
|
676
800
|
put(`${p.panel.id}:key:${item.id}:label`, item.label, keyFont, { x: tx, y: ky + (keyRow - heightOf(keyFont)) / 2, w: item.textW, h: heightOf(keyFont) * item.lines.length }, { seriesId: item.id }, muted, "secondary", "category", item.lines);
|
|
801
|
+
let share = look ? texts[pi].shares.find((s) => s.id === item.id) : void 0;
|
|
802
|
+
if (share) {
|
|
803
|
+
let sw = measure(share.text, keyFont).width;
|
|
804
|
+
put(`${p.panel.id}:key:${item.id}:share`, share.text, keyFont, { x: kx + item.shareRight - sw, y: ky + (keyRow - heightOf(keyFont)) / 2, w: sw, h: heightOf(keyFont) }, { seriesId: item.id }, { token: "ink" }, "secondary", "point", [share.text], share.claimId);
|
|
805
|
+
}
|
|
677
806
|
}
|
|
678
|
-
|
|
807
|
+
let level = look ? baseLevel(p) : null, baseText = baseTexts[pi], baseLine = () => {
|
|
808
|
+
if (level === null || baseText === void 0) return;
|
|
809
|
+
let by = py(level), bw = measure(baseText, baseFont).width;
|
|
810
|
+
emit({ t: "line", id: `${p.panel.id}:base-line`, x1: plotX, x2: plotX + plotW, y1: by, y2: by, stroke: baseStroke, width: strokeToken(theme, "rule"), dash: dashToken(theme, "reference"), owner, part: "baseLine" }), put(
|
|
811
|
+
`${p.panel.id}:base-value`,
|
|
812
|
+
baseText,
|
|
813
|
+
baseFont,
|
|
814
|
+
{ x: plotX - 8 - bw, y: by - heightOf(baseFont) / 2, w: bw, h: heightOf(baseFont) },
|
|
815
|
+
owner,
|
|
816
|
+
muted,
|
|
817
|
+
"label",
|
|
818
|
+
"point",
|
|
819
|
+
[baseText],
|
|
820
|
+
`stack:${p.panel.id}:base${"denominator" in p.panel.measure ? ":raw" : ""}`
|
|
821
|
+
);
|
|
822
|
+
};
|
|
823
|
+
if (p.panel.type === "line" && baseLine(), p.panel.type === "line") {
|
|
679
824
|
for (let i = 1; i < data.categories.length; i++) if (visible(i - 1) && visible(i) && p.states[i - 1] !== "partial" && p.states[i] !== "partial") {
|
|
680
825
|
let provisional = p.states[i - 1] === "maturing" || p.states[i] === "maturing", x1 = plotX + (i - 0.5) * step, y1 = py(p.values[i - 1]), x2 = plotX + (i + 0.5) * step, y2 = py(p.values[i]);
|
|
681
|
-
emit({ t: "line", id: `${p.panel.id}:line:${i}`, x1, y1, x2, y2, stroke: provisional ? muted : color, width: strokeToken(theme, p.panel.emphasis ? "focus" : "data"), ...provisional ? { dash: dashToken(theme, "reference") } : {}, owner, part: provisional ? "provisionalLine" : "line" });
|
|
826
|
+
if (emit({ t: "line", id: `${p.panel.id}:line:${i}`, x1, y1, x2, y2, stroke: provisional ? muted : color, width: strokeToken(theme, p.panel.emphasis ? "focus" : "data"), ...provisional ? { dash: dashToken(theme, "reference") } : {}, owner, part: provisional ? "provisionalLine" : "line" }), look) continue;
|
|
682
827
|
let length = Math.hypot(x2 - x1, y2 - y1), dx = -(y2 - y1) / length, dy = (x2 - x1) / length;
|
|
683
828
|
occupied.claim(
|
|
684
829
|
{ x: x1 - 1, y: Math.min(y1, y2) - 1, w: x2 - x1 + 2, h: Math.abs(y2 - y1) + 2 },
|
|
@@ -694,11 +839,15 @@ function layoutMetricStack(raw, options) {
|
|
|
694
839
|
);
|
|
695
840
|
}
|
|
696
841
|
}
|
|
697
|
-
let latest = data.categories.reduce((last, _, ci) => visible(ci) ? ci : last, -1), valued = (ci) => named(ci) || ci === latest
|
|
698
|
-
|
|
842
|
+
let latest = data.categories.reduce((last, _, ci) => visible(ci) ? ci : last, -1), valued = (ci) => look ? stateOf(ci) === "focus" : named(ci) || ci === latest, seatX = (x, text) => {
|
|
843
|
+
if (!look) return x;
|
|
844
|
+
let w = measure(text, valueFont).width;
|
|
845
|
+
return Math.min(Math.max(x - w / 2, plotX + 3), plotX + plotW - 3 - w) + w / 2;
|
|
846
|
+
};
|
|
847
|
+
!look && !named(latest) && yielding.add(`${p.panel.id}:value:${data.categories[latest - 1]?.id}`), data.categories.forEach((category, ci) => {
|
|
699
848
|
let x = plotX + (ci + 0.5) * step, cellOwner = { seriesId: p.panel.id, categoryId: category.id };
|
|
700
849
|
if (!visible(ci)) {
|
|
701
|
-
valued(ci) && centerText(`${p.panel.id}:value:${category.id}`, na, valueFont, x, baseline - heightOf(valueFont) - 5, cellOwner, muted);
|
|
850
|
+
valued(ci) && centerText(`${p.panel.id}:value:${category.id}`, na, valueFont, seatX(x, na), baseline - heightOf(valueFont) - 5, cellOwner, muted), look && valued(ci) && plated.add(`${p.panel.id}:value:${category.id}`);
|
|
702
851
|
return;
|
|
703
852
|
}
|
|
704
853
|
let v = p.values[ci], top = py(v), provisional = p.states[ci] !== "mature", val = formatValue(v);
|
|
@@ -709,35 +858,50 @@ function layoutMetricStack(raw, options) {
|
|
|
709
858
|
values.forEach((part, si) => {
|
|
710
859
|
let h = part / domainMax * plot.h;
|
|
711
860
|
sum2 += part;
|
|
712
|
-
let paints = values.length > 1 && "sum" in p.panel.measure ? measurePaints.get(p.panel.measure.sum[si]) : void 0, fill = paints ? paints.mature : p.panel.emphasis ? emphasizedFill : columnFill, rect = { x: x - width / 2, y: py(sum2), w: width, h }, partOwner = { ...cellOwner, segmentId: String(si) };
|
|
713
|
-
if (emit({ t: "rect", id: `${p.panel.id}:bar:${category.id}:${si}`, rect, fill, ...provisional ? { pattern: "hatch45", hatchEdge: !1, ...paints ? { hatch: { strength: options.hatchStrength ?? HATCH_STRENGTH_DEFAULT.sole, cue: "sole", stacked: !0 } } : {} } : {}, owner: partOwner, part: "segment" }, ci), occupied.claim(rect, "mark", partOwner, "segment"), segmentLabels && si === 0 && part) {
|
|
861
|
+
let paints = values.length > 1 && "sum" in p.panel.measure && !look ? measurePaints.get(p.panel.measure.sum[si]) : void 0, fill = (look ? statePaint(stateOf(ci), si, values.length) : void 0) ?? (paints ? paints.mature : p.panel.emphasis ? emphasizedFill : columnFill), rect = { x: x - width / 2, y: py(sum2), w: width, h }, partOwner = { ...cellOwner, segmentId: String(si) };
|
|
862
|
+
if (emit({ t: "rect", id: `${p.panel.id}:bar:${category.id}:${si}`, rect, fill, ...provisional ? { pattern: "hatch45", hatchEdge: !1, ...paints || look && values.length > 1 ? { hatch: { strength: options.hatchStrength ?? HATCH_STRENGTH_DEFAULT.sole, cue: "sole", stacked: !0 } } : {} } : {}, owner: partOwner, part: "segment" }, ci), (!look || valued(ci)) && occupied.claim(rect, "mark", partOwner, "segment"), segmentLabels && si === 0 && part) {
|
|
714
863
|
let text = formatValue(part), ink = provisional ? { token: "ink" } : paints && fill !== color ? { token: "ink", theme: { kind: "contrast-ink", fill } } : { token: "inkInverse" }, tw = measure(text, valueFont).width;
|
|
715
864
|
provisional && emit({ t: "rect", id: `${p.panel.id}:segment-tag:${category.id}`, rect: { x: x - tw / 2 - 2, y: rect.y + 4, w: tw + 4, h: heightOf(valueFont) }, fill: { token: "background" }, radius: 2, owner: partOwner, part: "labelTag" }, ci), centerText(`${p.panel.id}:segment:${category.id}`, text, valueFont, x, rect.y + 4, partOwner, ink);
|
|
716
865
|
}
|
|
866
|
+
let share = look ? p.segmentShares?.[ci]?.[si] : void 0;
|
|
867
|
+
if (share && rect.h >= heightOf(keyFont) + 4 && measure(share.text, keyFont).width + 6 <= width) {
|
|
868
|
+
let ink = provisional ? { token: "ink" } : { token: "ink", theme: { kind: "contrast-ink", fill } }, sy = rect.y + (rect.h - heightOf(keyFont)) / 2, sw = measure(share.text, keyFont).width;
|
|
869
|
+
provisional && emit({ t: "rect", id: `${p.panel.id}:share-tag:${category.id}:${si}`, rect: { x: x - sw / 2 - 2, y: sy, w: sw + 4, h: heightOf(keyFont) }, fill: { token: "background" }, radius: 2, owner: partOwner, part: "labelTag" }, ci), centerText(`${p.panel.id}:share:${category.id}:${si}`, share.text, keyFont, x, sy, partOwner, ink, "label", "point", share.claimId);
|
|
870
|
+
}
|
|
717
871
|
}), provisional && emit({ t: "path", id: `${p.panel.id}:outline:${category.id}`, d: `M${fmtPathNumber(x - width / 2)} ${fmtPathNumber(baseline)}V${fmtPathNumber(top)}H${fmtPathNumber(x + width / 2)}V${fmtPathNumber(baseline)}`, stroke: muted, width: strokeToken(theme, "mark"), dash: dashToken(theme, "reference"), owner: cellOwner, part: "provisionalOutline" }, ci);
|
|
872
|
+
} else if (look && !provisional) {
|
|
873
|
+
let state = stateOf(ci);
|
|
874
|
+
state === "base" && emit({ t: "circle", id: `${p.panel.id}:point:${category.id}`, cx: x, cy: top, r: 3.75, fill: { token: "background" }, stroke: { token: "neutralMark" }, strokeWidth: 1.5, owner: cellOwner, part: "basePoint" }, ci), state === "focus" && emit({ t: "circle", id: `${p.panel.id}:point:${category.id}`, cx: x, cy: top, r: 6, fill: accent, stroke: { token: "background" }, strokeWidth: 2, owner: cellOwner, part: "focusPoint" }, ci), state === "focus" && occupied.claim({ x: x - 6, y: top - 6, w: 12, h: 12 }, "mark", cellOwner, "point");
|
|
718
875
|
} else
|
|
719
876
|
emit({ t: "circle", id: `${p.panel.id}:point:${category.id}`, cx: x, cy: top, r: 4.5, fill: provisional ? { token: "background" } : color, ...provisional ? { stroke: muted, strokeWidth: strokeToken(theme, "mark") } : {}, owner: cellOwner, part: provisional ? "provisionalPoint" : "point" }, ci), occupied.claim({ x: x - 4.5, y: top - 4.5, w: 9, h: 9 }, "mark", cellOwner, "point");
|
|
720
|
-
valued(ci) && centerText(`${p.panel.id}:value:${category.id}`, labelText, valueFont, x, top - labelGap - heightOf(valueFont), cellOwner, provisional ? muted : { token: "ink" }, "label", "point", void 0, p.panel.type === "line" && top + labelGap + heightOf(valueFont) < baseline - 2 ? top + labelGap : void 0);
|
|
877
|
+
valued(ci) && centerText(`${p.panel.id}:value:${category.id}`, labelText, valueFont, seatX(x, labelText), top - labelGap - heightOf(valueFont), cellOwner, provisional ? muted : { token: "ink" }, "label", "point", void 0, !look && p.panel.type === "line" && top + labelGap + heightOf(valueFont) < baseline - 2 ? top + labelGap : void 0), look && valued(ci) && plated.add(`${p.panel.id}:value:${category.id}`);
|
|
721
878
|
let valueRequest = requests.at(-1);
|
|
722
879
|
p.panel.type === "line" && valueRequest?.id === `${p.panel.id}:value:${category.id}` && (valueRequest.priority = ci === latest ? PRIORITY.endpoint : PRIORITY.interior);
|
|
723
|
-
}),
|
|
880
|
+
}), p.panel.type === "column" && baseLine();
|
|
881
|
+
let ruleFrom = look && !narrow && !onRight ? frame.plot.x : plotX, ruleTo = look && onRight ? trackX + trackW : plotX + plotW;
|
|
882
|
+
emit({ t: "line", id: `${p.panel.id}:baseline`, x1: ruleFrom, x2: ruleTo, y1: baseline, y2: baseline, stroke: { token: "axis" }, width: strokeToken(theme, "rule"), owner, part: "baseline" }), occupied.claim({ x: plotX, y: baseline - 0.5, w: plotW, h: 1 }, "axis", owner, "baseline");
|
|
724
883
|
});
|
|
725
884
|
let axisY = plots.at(-1).y + plots.at(-1).h + 8;
|
|
726
|
-
data.categories.forEach((category, i) => {
|
|
885
|
+
periodAxis || data.categories.forEach((category, i) => {
|
|
727
886
|
let box = categoryBoxes[i], text = categoryName(category);
|
|
728
887
|
if (!named(i)) {
|
|
729
888
|
scene.push({ t: "line", id: `stack:category:tick:${category.id}`, x1: plotX + (i + 0.5) * step, x2: plotX + (i + 0.5) * step, y1: axisY + 2, y2: axisY + 7, stroke: muted, width: strokeToken(theme, "rule"), owner: { categoryId: category.id }, part: "categoryTick" });
|
|
730
889
|
return;
|
|
731
890
|
}
|
|
732
891
|
put(`stack:category:${category.id}`, text, keyFont, { x: plotX + (i + 0.5) * step - box.w / 2, y: axisY, w: box.w, h: box.h }, { categoryId: category.id }, { token: "ink" }, "secondary", "category", box.lines);
|
|
733
|
-
})
|
|
892
|
+
});
|
|
893
|
+
let lastBaseline = plots.at(-1).y + plots.at(-1).h;
|
|
894
|
+
periodAxis ? data.periods.forEach((period, i) => {
|
|
895
|
+
let box = periodBoxes[i], x = plotX + box.indexes[0] * step;
|
|
896
|
+
scene.push({ t: "line", id: `stack:period:tick:${i}`, x1: x + 0.5, x2: x + 0.5, y1: lastBaseline, y2: lastBaseline + PERIOD_TICK_TOP + heightOf(box.font), stroke: { token: "axis" }, width: strokeToken(theme, "rule"), owner: {}, part: "periodTick" }), put(`stack:period:${i}`, period.label, box.font, { x: x + 5, y: lastBaseline + PERIOD_TICK_TOP, w: box.w, h: box.h }, { categoryId: period.from }, muted, "secondary", "category", box.lines);
|
|
897
|
+
}) : data.periods?.forEach((period, i) => {
|
|
734
898
|
let box = periodBoxes[i], { indexes, bold, font: f } = box, x = plotX + indexes[0] * step, y2 = axisY + categoryHeight + 8;
|
|
735
899
|
put(`stack:period:${i}`, period.label, f, { x: x + 2, y: y2 + 4, w: box.w, h: box.h }, { categoryId: period.from }, bold ? { token: "ink" } : muted, "secondary", "category", box.lines), scene.push({ t: "line", id: `stack:period:rule:${i}`, x1: x + 1.5, x2: x + indexes.length * step - 1.5, y1: y2, y2, stroke: bold ? { token: "ink" } : { token: "grid" }, width: strokeToken(theme, bold ? "data" : "rule"), owner: {}, part: "periodRule" });
|
|
736
900
|
});
|
|
737
901
|
for (let request of requests) yielding.has(request.id) && (request.priority = PRIORITY.interior);
|
|
738
902
|
let solved = solveLabels(requests, occupied, { focus: options.focus, density: options.labelDensity ?? "full", pins: options.labelPlacements ?? {}, labelOffsets: options.labelOffsets, measure, plot: frame.plot, canvas: { x: 0, y: 0, w: size.width, h: size.height }, darkInk: theme.color.ink, lightInk: theme.color.inkInverse, labelPad: 0 }), fonts = new Map(requests.map((request) => [request.id, request.font]));
|
|
739
903
|
for (let label of solved.placed)
|
|
740
|
-
label.ink = inks.get(label.id) ?? label.ink, label.font = fonts.get(label.id);
|
|
904
|
+
label.ink = inks.get(label.id) ?? label.ink, label.font = fonts.get(label.id), plated.has(label.id) && (label.plate = !0);
|
|
741
905
|
let hidden = solved.placed.filter((l) => (l.hidden === "collision" || l.hidden === "tooSmall") && !yielding.has(l.id)), probe = options[GUTTER_PROBE] === !0;
|
|
742
906
|
if (hidden.length && probe && spacingError("options.size", `Metric stack cannot place ${hidden.map((l) => `'${l.text}'`).join(", ")} at ${size.width} \xD7 ${size.height} px`), hidden.length && gutter > defaultGutter) {
|
|
743
907
|
let places = (width) => {
|
|
@@ -755,22 +919,24 @@ function layoutMetricStack(raw, options) {
|
|
|
755
919
|
return layoutMetricStack(raw, { ...options, [GUTTER_LIMIT]: low });
|
|
756
920
|
}
|
|
757
921
|
pushAll(scene, labelsToNodes(theme, solved.placed, () => valueFont));
|
|
758
|
-
let counts = [structureCount("panels", data.panels.length, void 0, options), structureCount("categories", data.categories.length, void 0, options), structureCount("series", data.measures.length, chartString(options, "sourceMeasures", { v1: data.measures.length }))], requested = new Set(requests.flatMap((request) => request.claimIds ?? [])),
|
|
922
|
+
let counts = [structureCount("panels", data.panels.length, void 0, options), structureCount("categories", data.categories.length, void 0, options), structureCount("series", data.measures.length, chartString(options, "sourceMeasures", { v1: data.measures.length }))], requested = new Set(requests.flatMap((request) => request.claimIds ?? [])), segmentShares = new Set(computed.panels.flatMap((p) => (p.segmentShares ?? []).flatMap((column) => column?.map((share) => share.claimId) ?? [])));
|
|
923
|
+
segmentShares.size && (derived.readouts = derived.readouts.map((readout) => ({ ...readout, claims: readout.claims.map((claim) => segmentShares.has(claim.id) && !requested.has(claim.id) ? { ...claim, output: { ...claim.output, displayed: "" } } : claim) })));
|
|
924
|
+
let unprinted = derived.readouts.flatMap((readout) => readout.claims.filter((claim) => !requested.has(claim.id)).map((claim) => claim.id));
|
|
759
925
|
return withUnprintedClaims({
|
|
760
926
|
type: "grid",
|
|
761
927
|
size,
|
|
762
928
|
plot: frame.plot,
|
|
763
929
|
scene,
|
|
764
930
|
labels: solved.placed,
|
|
765
|
-
axes: [{ axis: "x", baselineNodeId: `${data.panels.at(-1).id}:baseline`, ticks: data.categories.map((c, i) => ({ at: c.id, pos: plotX + (i + 0.5) * step, labelId: `stack:category:${c.id}` })) }],
|
|
931
|
+
axes: [{ axis: "x", baselineNodeId: `${data.panels.at(-1).id}:baseline`, ticks: data.categories.map((c, i) => ({ at: c.id, pos: plotX + (i + 0.5) * step, ...periodAxis ? {} : { labelId: `stack:category:${c.id}` } })) }],
|
|
766
932
|
annotations: [],
|
|
767
933
|
frame: frame.frame,
|
|
768
934
|
legend: frame.legend,
|
|
769
935
|
marks,
|
|
770
936
|
derived: { metricStack: derived, sharedPlotX: plotX, sharedPlotW: plotW, tierGap: gap },
|
|
771
937
|
sizing: { aspect: "content", fit: "content", minWidth: size.width, minHeight, measuredMinWidth: size.width, measuredMinHeight: minHeight, naturalWidth: size.width, naturalHeight, comfortableWidth: size.width, comfortableHeight: naturalHeight },
|
|
772
|
-
a11y: { title: accessibleTitle(options.title, chartString(options, "metricStackTitle", { v1: data.panels.length })), counts, desc: chartString(options, "metricStackDesc", { v1: counts.map((c) => c.text).join(", "), v2: data.panels.map((p) => p.title).join("; "), v3: hasMethod ? computed.panels.map((p) => `${p.panel.title}: ${[...showHeadline ? [p.readout.headlineText] : [], ...showSpan ? [p.readout.spanText] : []].join("; ")}.`).join(" ") : "" }) },
|
|
773
|
-
warnings: [...solved.warnings, ...stackColumnWarnings(stack, narrow, gutterFloored, gutterCapped)],
|
|
938
|
+
a11y: { title: accessibleTitle(options.title, chartString(options, "metricStackTitle", { v1: data.panels.length })), counts, desc: chartString(options, "metricStackDesc", { v1: counts.map((c) => c.text).join(", "), v2: data.panels.map((p) => p.title).join("; "), v3: look ? computed.panels.map((p, i) => `${p.panel.title}: ${[texts[i].value, ...texts[i].change ? [texts[i].change] : [], ...texts[i].from ? [texts[i].from] : []].join(" ")}.`).join(" ") : hasMethod ? computed.panels.map((p) => `${p.panel.title}: ${[...showHeadline ? [p.readout.headlineText] : [], ...showSpan ? [p.readout.spanText] : []].join("; ")}.`).join(" ") : "" }) },
|
|
939
|
+
warnings: [...solved.warnings, ...stackColumnWarnings(stack, narrow, gutterFloored, gutterCapped, stack.variant === "focus" && !look), ...segmentShareWarnings(data, look)],
|
|
774
940
|
debug: { occupied: occupied.snapshot(), decisions: solved.decisions }
|
|
775
941
|
}, unprinted);
|
|
776
942
|
}
|
|
@@ -1110,23 +1276,20 @@ function layoutGridPass(data, options = {}) {
|
|
|
1110
1276
|
let groups = new Set(data.panels.map((panel) => panel.options?.scaleGroup?.y));
|
|
1111
1277
|
for (let group of groups) group !== void 0 && alignValuePanels(panels.filter((_, i) => data.panels[i].options?.scaleGroup?.y === group), theme);
|
|
1112
1278
|
return children;
|
|
1113
|
-
}, layoutChildren = () => {
|
|
1279
|
+
}, reusePanels = isCachedTextMeasurer(measure), layoutChildren = () => {
|
|
1114
1280
|
if (share === "category" && n > 1) {
|
|
1115
1281
|
let pass1 = data.panels.map((p, i) => layoutPanel(p, i, slots[i], baseMargins[i]));
|
|
1116
|
-
!uniformLineEndpointLegend && !keepEndNames && landsOnEndpointLegend(pass1) && (uniformLineEndpointLegend = !0, pass1 =
|
|
1282
|
+
!uniformLineEndpointLegend && !keepEndNames && landsOnEndpointLegend(pass1) && (uniformLineEndpointLegend = !0, pass1 = pass1.map((child, i) => reusePanels && child.def?.type !== "line" ? child : layoutPanel(data.panels[i], i, slots[i], baseMargins[i]))), sharedX = maxOf(pass1.map((c) => c.geo.plot.x));
|
|
1117
1283
|
let sharedR = minOf(pass1.map((c) => c.geo.plot.x + c.geo.plot.w));
|
|
1118
1284
|
sharedW = sharedR - sharedX;
|
|
1119
1285
|
let aligned = data.panels.map((p, i) => {
|
|
1120
|
-
let c1 = pass1[i], effRight = typeof c1.geo.derived.rightInset == "number" ? c1.geo.derived.rightInset : baseMargins[i].right,
|
|
1121
|
-
return layoutPanel(p, i, slots[i], {
|
|
1122
|
-
left: effLeft + (sharedX - c1.geo.plot.x),
|
|
1123
|
-
right: effRight + (c1.geo.plot.x + c1.geo.plot.w - sharedR)
|
|
1124
|
-
});
|
|
1286
|
+
let c1 = pass1[i], effRight = typeof c1.geo.derived.rightInset == "number" ? c1.geo.derived.rightInset : baseMargins[i].right, left = (typeof c1.geo.derived.leftInset == "number" ? c1.geo.derived.leftInset : baseMargins[i].left) + (sharedX - c1.geo.plot.x), right = effRight + (c1.geo.plot.x + c1.geo.plot.w - sharedR);
|
|
1287
|
+
return reusePanels && left === baseMargins[i].left && right === baseMargins[i].right ? c1 : layoutPanel(p, i, slots[i], { left, right });
|
|
1125
1288
|
});
|
|
1126
1289
|
return alignCategoryPanels(alignedPanels(aligned), theme), alignSharedValues(aligned);
|
|
1127
1290
|
}
|
|
1128
1291
|
let children = data.panels.map((p, i) => layoutPanel(p, i, slots[i]));
|
|
1129
|
-
return !uniformLineEndpointLegend && !keepEndNames && landsOnEndpointLegend(children) && (uniformLineEndpointLegend = !0, children =
|
|
1292
|
+
return !uniformLineEndpointLegend && !keepEndNames && landsOnEndpointLegend(children) && (uniformLineEndpointLegend = !0, children = children.map((child, i) => reusePanels && child.def?.type !== "line" ? child : layoutPanel(data.panels[i], i, slots[i]))), alignSharedValues(children);
|
|
1130
1293
|
}, measureTierContents = (laidOut) => {
|
|
1131
1294
|
let childContent = laidOut.map((child) => occupiedBounds(child.geo, measure)), tierLabels = laidOut.map((child, index) => {
|
|
1132
1295
|
if (!child.tierCaption && !child.tierDetail) return;
|