boardplot 0.56.0 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/CHANGELOG.md +408 -0
  2. package/README.md +49 -15
  3. package/dist/{DiagnosticDetails-JFBBXOT2.js → DiagnosticDetails-VGSL4NJK.js} +1 -1
  4. package/dist/{ReaderBox-GLCKYXBU.js → ReaderBox-MHMXIDAJ.js} +8 -7
  5. package/dist/{annotateEngine-QVNAE3EH.js → annotateEngine-753KQBNN.js} +2 -1
  6. package/dist/build-identity.json +3 -3
  7. package/dist/{chunk-HZUAEMN5.js → chunk-2CQBBN7M.js} +4 -4
  8. package/dist/{chunk-K3VZ5QJK.js → chunk-2ETK5TSA.js} +4 -4
  9. package/dist/{chunk-HHXIVFAU.js → chunk-2ETSI2EL.js} +11 -9
  10. package/dist/{chunk-ECBUFKCP.js → chunk-2GRXHWRH.js} +3 -3
  11. package/dist/{chunk-ZVM5TFGR.js → chunk-2HII2B6S.js} +6 -2
  12. package/dist/{chunk-WBETBGSC.js → chunk-2LC2H3ZM.js} +1003 -907
  13. package/dist/chunk-2NX7EO7H.js +23 -0
  14. package/dist/{chunk-52WNCUIN.js → chunk-2QI2PK2O.js} +1 -1
  15. package/dist/{chunk-QWCLWFKC.js → chunk-2VKQQLP7.js} +180 -58
  16. package/dist/chunk-3DOVXJ6K.js +602 -0
  17. package/dist/{chunk-CAJ54IEP.js → chunk-3E6NLODZ.js} +1 -1
  18. package/dist/{chunk-MOS6WFWM.js → chunk-3HA4IJTO.js} +9 -9
  19. package/dist/{chunk-JCIXYOND.js → chunk-3HPPTQEW.js} +4 -4
  20. package/dist/{chunk-7VVHTOE7.js → chunk-3KT2647F.js} +4 -2
  21. package/dist/{chunk-O6ZTIDWB.js → chunk-3MFVJMP6.js} +3 -2
  22. package/dist/{chunk-KQCKK3LD.js → chunk-3P3FKPFN.js} +170 -73
  23. package/dist/{chunk-WI5VOSQX.js → chunk-3XAJSMYD.js} +2 -2
  24. package/dist/{chunk-CPGASWNN.js → chunk-42QKUSHJ.js} +13 -3
  25. package/dist/{chunk-QB5HV4IY.js → chunk-44JU3VOT.js} +7 -8
  26. package/dist/{chunk-BYCJ6TKI.js → chunk-44K75CYE.js} +3 -3
  27. package/dist/{chunk-MS7O3KDJ.js → chunk-4FNM4D57.js} +6 -6
  28. package/dist/{chunk-BVYIKLQ5.js → chunk-4ROZ4TFL.js} +1 -1
  29. package/dist/{chunk-3V62N3Z7.js → chunk-4VV3KUFT.js} +7 -8
  30. package/dist/{chunk-MAFPVR4G.js → chunk-54YO56IK.js} +10 -5
  31. package/dist/{chunk-JMGB444D.js → chunk-5ACFYNA4.js} +8 -4
  32. package/dist/{chunk-6AMN7IKJ.js → chunk-5JEU6MWC.js} +49 -28
  33. package/dist/{chunk-NCLRZQR6.js → chunk-5JIB4VJA.js} +18 -10
  34. package/dist/{chunk-SXD3OYAR.js → chunk-5OP3E2ZD.js} +205 -96
  35. package/dist/{chunk-SS4YGK3E.js → chunk-5SLBD4BT.js} +72 -304
  36. package/dist/{chunk-XMP2DNLI.js → chunk-5SVGTQTW.js} +4 -4
  37. package/dist/chunk-5U567TYU.js +23 -0
  38. package/dist/chunk-5ZLF4S7X.js +40 -0
  39. package/dist/{chunk-T2YDWT54.js → chunk-5ZMTQATF.js} +261 -147
  40. package/dist/{chunk-WXJ5MHLH.js → chunk-62BDQTO6.js} +2 -2
  41. package/dist/chunk-64K3V4VN.js +25 -0
  42. package/dist/{chunk-BK6P6KMW.js → chunk-67YJJJIB.js} +1 -1
  43. package/dist/{chunk-32LLDRPI.js → chunk-6DJNFT2K.js} +42 -32
  44. package/dist/{chunk-JYAZPMSA.js → chunk-6IUK6PAH.js} +7 -6
  45. package/dist/{chunk-7STMIK2X.js → chunk-6JFQCVNN.js} +4 -4
  46. package/dist/chunk-6JXBLQJ2.js +32 -0
  47. package/dist/{chunk-5TWY3ZIC.js → chunk-6XPV6M3Q.js} +5 -5
  48. package/dist/{chunk-MPO5TVGF.js → chunk-6ZDSEITW.js} +3 -3
  49. package/dist/{chunk-75WIUG2W.js → chunk-72HVDLMT.js} +172 -78
  50. package/dist/chunk-75NU5RLX.js +24 -0
  51. package/dist/chunk-76GPN6AT.js +72 -0
  52. package/dist/chunk-7BQK2UDV.js +13 -0
  53. package/dist/{chunk-CF4NMRN7.js → chunk-7CAYRPJV.js} +45 -25
  54. package/dist/{chunk-U3A6FMSI.js → chunk-7GWWBHVQ.js} +7 -7
  55. package/dist/{chunk-CHAS5A5B.js → chunk-7NYUFMLJ.js} +149 -86
  56. package/dist/{chunk-D2B3KP35.js → chunk-7VWXXBTC.js} +4 -0
  57. package/dist/chunk-A65B23JK.js +113 -0
  58. package/dist/{chunk-4KMZAK6J.js → chunk-A7R6FUS6.js} +4 -4
  59. package/dist/{chunk-E2ZUBP4Q.js → chunk-AEVGUOPB.js} +7 -8
  60. package/dist/chunk-AHIK2N72.js +53 -0
  61. package/dist/{chunk-KLB2QC24.js → chunk-AICO24HJ.js} +5 -2
  62. package/dist/{chunk-7KSUMFBK.js → chunk-AJGSCVVW.js} +5 -1
  63. package/dist/{chunk-RSCRIWAH.js → chunk-AL62JJTB.js} +10 -3
  64. package/dist/{chunk-E7V3OHQQ.js → chunk-AN2V2LC4.js} +37 -22
  65. package/dist/{chunk-JIEVDGAF.js → chunk-AOFUA5XP.js} +1 -1
  66. package/dist/chunk-B5A7X2BA.js +44 -0
  67. package/dist/{chunk-2HTYGMMG.js → chunk-BCMEGJRX.js} +2 -2
  68. package/dist/{chunk-KD5GOR2K.js → chunk-BDIKWR45.js} +124 -69
  69. package/dist/{chunk-FNRPQIQE.js → chunk-BG6AIWAK.js} +4 -6
  70. package/dist/{chunk-ZMPH2OC4.js → chunk-BOT6W3VB.js} +7 -8
  71. package/dist/{chunk-DRHQG44U.js → chunk-BQBD6Q5J.js} +6 -2
  72. package/dist/{chunk-2DOEZ5QY.js → chunk-BZ67BJBH.js} +11 -10
  73. package/dist/{chunk-UBCVBBJJ.js → chunk-C47POAC5.js} +4 -3
  74. package/dist/{chunk-O7REHICC.js → chunk-C5OBPO4Z.js} +36 -28
  75. package/dist/{chunk-IGNBQT23.js → chunk-CCAAI56H.js} +121 -10
  76. package/dist/{chunk-RPIKNMZA.js → chunk-CDUR3KWV.js} +7 -2
  77. package/dist/{chunk-MZACASZY.js → chunk-CMPHT2LS.js} +14 -2
  78. package/dist/{chunk-FHA3KMFC.js → chunk-CQBPNE7Z.js} +5 -1
  79. package/dist/{chunk-IVRYF7QA.js → chunk-CR5FP5SF.js} +1 -1
  80. package/dist/{chunk-DD6RVD3S.js → chunk-D2TQX7UJ.js} +5 -1
  81. package/dist/{chunk-VVXKFU72.js → chunk-DEANHDXU.js} +62 -41
  82. package/dist/{chunk-GM3EGUYW.js → chunk-DHGE46UK.js} +1 -1
  83. package/dist/{chunk-UZTQUPTB.js → chunk-DIHX6NUB.js} +5 -5
  84. package/dist/{chunk-MD6DCQMA.js → chunk-DILQ34NW.js} +37 -37
  85. package/dist/{chunk-YMTXTQCN.js → chunk-DJKRYJP7.js} +6 -6
  86. package/dist/{chunk-JCAGVAB3.js → chunk-DKLC6QLF.js} +1200 -21
  87. package/dist/{chunk-SRAV6FPB.js → chunk-DNHTMCUP.js} +3 -3
  88. package/dist/{chunk-CKGSGRP7.js → chunk-DORE2RHL.js} +21 -5
  89. package/dist/{chunk-SMHZXHHD.js → chunk-DZYTXZNS.js} +15 -5
  90. package/dist/chunk-E262NRFP.js +39 -0
  91. package/dist/{chunk-V5JQQMFQ.js → chunk-E5YF236N.js} +4 -1
  92. package/dist/{chunk-IGJ2G5C6.js → chunk-EBUK7HJP.js} +6 -6
  93. package/dist/{chunk-ZL6IHMOW.js → chunk-ECBHC272.js} +198 -119
  94. package/dist/{chunk-SA46CNMS.js → chunk-ED7GLWTF.js} +4 -1
  95. package/dist/chunk-EFW43JQJ.js +24 -0
  96. package/dist/{chunk-5P2TTHBZ.js → chunk-EHRRHSPV.js} +2 -2
  97. package/dist/{chunk-JXBZIJCG.js → chunk-EILNJQMN.js} +32 -12
  98. package/dist/{chunk-GELSK76Y.js → chunk-ERDKMZ7O.js} +3 -3
  99. package/dist/{chunk-T2CYNDYU.js → chunk-ETRAPN5G.js} +366 -130
  100. package/dist/{chunk-JEUL777U.js → chunk-ETUKDEGL.js} +21 -12
  101. package/dist/chunk-F2ET5ZTT.js +49 -0
  102. package/dist/{chunk-2YO4WRJN.js → chunk-F3XOBFS4.js} +40 -29
  103. package/dist/{chunk-SPSGUFTI.js → chunk-FB6X7QHA.js} +1 -1
  104. package/dist/{chunk-5PPQIF4D.js → chunk-FGW54I23.js} +7 -8
  105. package/dist/{chunk-JTC5SEAQ.js → chunk-FP5B5XIL.js} +7 -3
  106. package/dist/{chunk-RJGCYGC3.js → chunk-FRHQGA5Q.js} +86 -250
  107. package/dist/{chunk-YZZLIYPA.js → chunk-FRR7BJ3B.js} +5 -1
  108. package/dist/{chunk-4DZFR52I.js → chunk-FVWHEM2N.js} +7 -5
  109. package/dist/{chunk-YPYD6OJ3.js → chunk-FWSMENKH.js} +2 -2
  110. package/dist/{chunk-YYJORENB.js → chunk-FWTUGNSF.js} +8 -8
  111. package/dist/{chunk-GIHH6VC2.js → chunk-FZKDZQ6U.js} +10 -6
  112. package/dist/{chunk-S7NRL66K.js → chunk-G4FF6G3I.js} +26 -17
  113. package/dist/{chunk-PQLAZEQV.js → chunk-GB6BZSTL.js} +248 -92
  114. package/dist/chunk-GCIHRRDJ.js +24 -0
  115. package/dist/{chunk-X3KCQEYZ.js → chunk-GHCU6OSE.js} +9 -1
  116. package/dist/chunk-GKDUIDU6.js +138 -0
  117. package/dist/chunk-GO66OCN7.js +24 -0
  118. package/dist/chunk-GOFS336W.js +24 -0
  119. package/dist/{chunk-AGDDH6XY.js → chunk-GQYT7G4F.js} +5 -1
  120. package/dist/{chunk-WN3HEU3P.js → chunk-GUTLXO7Q.js} +140 -89
  121. package/dist/chunk-H3VICNTN.js +47 -0
  122. package/dist/{chunk-GC4WOLV3.js → chunk-HAG3K6PQ.js} +14 -2
  123. package/dist/{chunk-CB4CERXZ.js → chunk-HBQHSZ6S.js} +11 -2
  124. package/dist/chunk-HTQGJQZN.js +124 -0
  125. package/dist/{chunk-F77TMAUY.js → chunk-HUQRO6VF.js} +39 -36
  126. package/dist/{chunk-4KQHKPB3.js → chunk-I5VDW2XZ.js} +543 -509
  127. package/dist/{chunk-43GGVT7W.js → chunk-I5VNHDPR.js} +11 -4
  128. package/dist/{chunk-4LTN7SND.js → chunk-IDXYHDQY.js} +1 -1
  129. package/dist/{chunk-Y54LU4CU.js → chunk-IIWZJ5ZM.js} +1 -1
  130. package/dist/{chunk-FMDNJ6PC.js → chunk-IPBOREIY.js} +2 -2
  131. package/dist/chunk-IU335UO7.js +27 -0
  132. package/dist/{chunk-JVZTKQFS.js → chunk-IVDTP6SV.js} +9 -5
  133. package/dist/{chunk-BDGLMWPO.js → chunk-IXOBDDMW.js} +11 -2
  134. package/dist/{chunk-EIL3KHAL.js → chunk-J4QRB6DQ.js} +5 -5
  135. package/dist/{chunk-3465633G.js → chunk-JCMGKQVS.js} +3 -3
  136. package/dist/{chunk-YK2KWNTU.js → chunk-JM7UTLF3.js} +28 -14
  137. package/dist/{chunk-CXETOLPX.js → chunk-JNDWRV34.js} +4 -4
  138. package/dist/{chunk-DLUNQHFO.js → chunk-JSRQTDZZ.js} +26 -24
  139. package/dist/{chunk-WTQAG2OT.js → chunk-JT3UTEWZ.js} +8 -3
  140. package/dist/{chunk-GQT2SY2S.js → chunk-JUYRDZSV.js} +291 -151
  141. package/dist/{chunk-LKMFMNQX.js → chunk-JVGL2SCN.js} +1 -1
  142. package/dist/{chunk-4JC3SE4G.js → chunk-JY4LTPOV.js} +1 -1
  143. package/dist/chunk-K7XPTQBJ.js +267 -0
  144. package/dist/{chunk-P4SMC4BY.js → chunk-KGBUXMFP.js} +120 -86
  145. package/dist/{chunk-XC5IRUEL.js → chunk-KIE5V3DA.js} +2 -2
  146. package/dist/{chunk-RT66UTLJ.js → chunk-KU4PCG4W.js} +2 -2
  147. package/dist/{chunk-VPL3JYC6.js → chunk-KVBLTAO7.js} +52 -10
  148. package/dist/{chunk-XCROSJ2Z.js → chunk-KW4JXWHO.js} +1 -1
  149. package/dist/{chunk-PJBEJR2U.js → chunk-KWIP5YRA.js} +24 -7
  150. package/dist/{chunk-JYBT2JNY.js → chunk-LE3LSEUL.js} +27 -2
  151. package/dist/{chunk-R2IKOLBK.js → chunk-LG6M2JTH.js} +3 -3
  152. package/dist/{chunk-DF3XEFQ7.js → chunk-LIE2WSB4.js} +21 -18
  153. package/dist/{chunk-Z55DXFWS.js → chunk-LJDATBPB.js} +26 -16
  154. package/dist/{chunk-KLIZXSBK.js → chunk-LMMS675D.js} +10 -9
  155. package/dist/{chunk-MRAP2UVV.js → chunk-LPKGZ664.js} +286 -35
  156. package/dist/{chunk-JFFREZGT.js → chunk-LPMSGO7L.js} +6 -2
  157. package/dist/chunk-LQWINE7K.js +211 -0
  158. package/dist/{chunk-6MJUW5R5.js → chunk-MKMMQDIY.js} +139 -71
  159. package/dist/{chunk-F5BYLT3M.js → chunk-MQ4IEDM5.js} +462 -138
  160. package/dist/{chunk-QGFKSDQO.js → chunk-MRM4KJ2O.js} +2 -2
  161. package/dist/{chunk-ETMHDCEH.js → chunk-MX2OZHIT.js} +102 -42
  162. package/dist/{chunk-6EYTD777.js → chunk-MXUPMGRY.js} +2 -2
  163. package/dist/{chunk-2FKEF2AC.js → chunk-NHU26HQ7.js} +58 -35
  164. package/dist/{chunk-KBJMLXNW.js → chunk-NQVJ4FPY.js} +161 -78
  165. package/dist/chunk-NZ7FX3AE.js +65 -0
  166. package/dist/chunk-OALBVELJ.js +23 -0
  167. package/dist/{chunk-5S3JQ5AT.js → chunk-OGZ4UPYK.js} +183 -137
  168. package/dist/{chunk-6WHWXCHJ.js → chunk-OMNB27GM.js} +7 -3
  169. package/dist/{chunk-EGGDPDYJ.js → chunk-OO63YP35.js} +1 -1
  170. package/dist/{chunk-ZYQYX66L.js → chunk-OPYDTW5Q.js} +6 -6
  171. package/dist/{chunk-A2GAWGVJ.js → chunk-OSJN7KDS.js} +68 -39
  172. package/dist/{chunk-RMC4OONA.js → chunk-OSJXIW6I.js} +1030 -1123
  173. package/dist/{chunk-X23SZHV5.js → chunk-OVVE42P4.js} +6 -6
  174. package/dist/{chunk-CCJP6QZO.js → chunk-OZA7HA6L.js} +1 -1
  175. package/dist/chunk-OZLKEBCD.js +54 -0
  176. package/dist/{chunk-TE4M52AA.js → chunk-P6DEFCMQ.js} +18 -2
  177. package/dist/{chunk-AMR4SUAN.js → chunk-PDTIQL3B.js} +6 -6
  178. package/dist/{chunk-BIVL764T.js → chunk-PJ5BYZPN.js} +2 -2
  179. package/dist/{chunk-BISJK67O.js → chunk-PK7Z7WRJ.js} +98 -46
  180. package/dist/{chunk-7VMEM3LN.js → chunk-PL6NWB5U.js} +178 -113
  181. package/dist/chunk-PMT75APP.js +94 -0
  182. package/dist/chunk-PP6A4X55.js +11 -0
  183. package/dist/{chunk-I7H5DU34.js → chunk-PPCH3PLO.js} +25 -13
  184. package/dist/{chunk-BIGQKCU7.js → chunk-PPE6S7WU.js} +42 -24
  185. package/dist/{chunk-2NSQIPAA.js → chunk-PT7KSIEO.js} +23 -36
  186. package/dist/{chunk-KZJ5VM6E.js → chunk-PZ3TQFSY.js} +15 -1
  187. package/dist/{chunk-ZJFJ2IKQ.js → chunk-QAUGRVRU.js} +122 -23
  188. package/dist/{chunk-BTDGWHGJ.js → chunk-QMFWZG2P.js} +39 -19
  189. package/dist/{chunk-L6YVK6VC.js → chunk-QZGGCE45.js} +2 -2
  190. package/dist/{chunk-67QSW5RW.js → chunk-R2RJQ3BM.js} +4 -4
  191. package/dist/{chunk-ZY72LSQK.js → chunk-R7HBIQ63.js} +102 -61
  192. package/dist/{chunk-4JHMCXOB.js → chunk-RBNDZLYS.js} +77 -36
  193. package/dist/chunk-RCSY4CT4.js +2170 -0
  194. package/dist/{chunk-NGA7ICG4.js → chunk-RDJ3ZU6O.js} +16 -13
  195. package/dist/{chunk-2NN676RI.js → chunk-RHQRPJHS.js} +7 -8
  196. package/dist/chunk-RI6XQKWJ.js +26 -0
  197. package/dist/{chunk-YOOHNQ3L.js → chunk-RJICOOB3.js} +18 -8
  198. package/dist/{chunk-5DTCOOLU.js → chunk-RLAVNCQJ.js} +2 -2
  199. package/dist/{chunk-CYKXROFG.js → chunk-ROPPWJQB.js} +23 -12
  200. package/dist/{chunk-54ROMBU7.js → chunk-SELOV32X.js} +105 -50
  201. package/dist/{chunk-TUW5IYGA.js → chunk-SQI4NWTQ.js} +9 -9
  202. package/dist/{chunk-ZEYBI47P.js → chunk-SRJ74CMG.js} +11 -3
  203. package/dist/{chunk-NHC2ADGI.js → chunk-STWOURLG.js} +253 -144
  204. package/dist/chunk-SWMFXSVW.js +23 -0
  205. package/dist/chunk-SXAZDIGM.js +84 -0
  206. package/dist/{chunk-EMFUZKYK.js → chunk-SZ5VGWDY.js} +3 -3
  207. package/dist/{chunk-R5MEBBAA.js → chunk-T26G23RS.js} +442 -119
  208. package/dist/{chunk-QHRE2M6V.js → chunk-T2L5H2WW.js} +4 -3
  209. package/dist/chunk-T7GPIJ4L.js +89 -0
  210. package/dist/{chunk-MJPXHCBW.js → chunk-TAEB3RU6.js} +5 -5
  211. package/dist/{chunk-V7F4F6JA.js → chunk-TBDIMTRD.js} +37 -16
  212. package/dist/{chunk-63Y3ROZ7.js → chunk-TFFPEWNP.js} +102 -64
  213. package/dist/{chunk-EZZ533MH.js → chunk-TMEUK2WS.js} +6 -2
  214. package/dist/{chunk-37PKNVLS.js → chunk-TVOMGNFQ.js} +1 -1
  215. package/dist/{chunk-HJRNBKIT.js → chunk-TX5FSNAU.js} +436 -30
  216. package/dist/{chunk-V634AXDM.js → chunk-U52PNFPX.js} +1 -1
  217. package/dist/{chunk-QLANK3VN.js → chunk-U74AWJ3X.js} +6 -6
  218. package/dist/chunk-UC7LBW7N.js +26 -0
  219. package/dist/{chunk-PZ46S2SY.js → chunk-UCKUAKYQ.js} +2 -2
  220. package/dist/{chunk-KF7HD3EH.js → chunk-UCYL3YA7.js} +77 -55
  221. package/dist/{chunk-HOU2MZHC.js → chunk-UD2GI3CS.js} +11 -4
  222. package/dist/{chunk-SNQ7D5R7.js → chunk-UIHGGWES.js} +51 -11
  223. package/dist/{chunk-LGNJCPFP.js → chunk-ULQIC76A.js} +10 -13
  224. package/dist/{chunk-KTHFHD6C.js → chunk-UY34DDUM.js} +11 -6
  225. package/dist/{chunk-6QDMRPXI.js → chunk-UYMFLWM6.js} +215 -258
  226. package/dist/{chunk-KDSYZLF6.js → chunk-V5IFI3FV.js} +8 -1
  227. package/dist/{chunk-JTFKRDDA.js → chunk-V7FV66KL.js} +1 -1
  228. package/dist/{chunk-27OIGDRK.js → chunk-V7NUJEJE.js} +1 -1
  229. package/dist/{chunk-CCDXK5NA.js → chunk-VESSIKBG.js} +8 -3
  230. package/dist/{chunk-QSMGZOT5.js → chunk-VRFJAF3R.js} +7 -8
  231. package/dist/chunk-VS2R3OGN.js +34 -0
  232. package/dist/{chunk-RLMC5CUP.js → chunk-VS5B4J2D.js} +7 -8
  233. package/dist/{chunk-7M2GK7XQ.js → chunk-W4R6SGU3.js} +252 -121
  234. package/dist/{chunk-JKOEHRGV.js → chunk-WDLWWEHZ.js} +1 -1
  235. package/dist/{chunk-7DAH2E4T.js → chunk-WFBN2HXR.js} +2 -2
  236. package/dist/{chunk-DLDDRXAI.js → chunk-WJS6SAWA.js} +296 -145
  237. package/dist/{chunk-WWGPTEQB.js → chunk-WQYNKF33.js} +73 -22
  238. package/dist/{chunk-64LJDGJH.js → chunk-WUP6C4ZD.js} +4 -2
  239. package/dist/{chunk-F2EVCJ4U.js → chunk-X24WAHHV.js} +87 -43
  240. package/dist/{chunk-OJ5CQV7H.js → chunk-X3UCQPVV.js} +209 -96
  241. package/dist/{chunk-7FKY6YWU.js → chunk-X46PSAJ7.js} +6 -6
  242. package/dist/{chunk-H3IBJQ5A.js → chunk-XD5XB22R.js} +2 -2
  243. package/dist/chunk-XDIAQEYK.js +28 -0
  244. package/dist/{chunk-7PPMT5EJ.js → chunk-XFPNYHX3.js} +372 -105
  245. package/dist/{chunk-FCECYJVA.js → chunk-XIBVAKCO.js} +1 -1
  246. package/dist/{chunk-OG2YUVBW.js → chunk-XMX4PCFL.js} +8 -3
  247. package/dist/{chunk-2NRHD2G7.js → chunk-XRRG4MBM.js} +12 -4
  248. package/dist/{chunk-FNMH5WEY.js → chunk-XTFO6D4L.js} +1 -1
  249. package/dist/chunk-XWRI3N5O.js +70 -0
  250. package/dist/{chunk-ZKJ5L35C.js → chunk-XXPLPSOE.js} +36 -25
  251. package/dist/{chunk-XQMYQ4TN.js → chunk-XZXZNI7A.js} +1 -1
  252. package/dist/{chunk-E555EDOQ.js → chunk-YEJZ2OYS.js} +490 -182
  253. package/dist/chunk-YGZEG3JV.js +123 -0
  254. package/dist/{chunk-F6OLHND5.js → chunk-Z3WQXVFV.js} +2 -2
  255. package/dist/{chunk-FFJGC2DX.js → chunk-Z6DUNKFU.js} +173 -40
  256. package/dist/{chunk-N5HN5QGH.js → chunk-Z6H5ED2I.js} +1 -1
  257. package/dist/{chunk-7Q37C6GZ.js → chunk-ZBOOMLHD.js} +1 -1
  258. package/dist/{chunk-MOK3ZS6P.js → chunk-ZDJ7C64T.js} +1 -1
  259. package/dist/{chunk-GLQ3KCTY.js → chunk-ZGZLEUKM.js} +7 -8
  260. package/dist/{chunk-YHD2FZFP.js → chunk-ZHRGX225.js} +6 -6
  261. package/dist/{chunk-76Q7E3TM.js → chunk-ZIVCPXXL.js} +510 -646
  262. package/dist/{chunk-BSATR6ZO.js → chunk-ZNRSYS76.js} +21 -3
  263. package/dist/{chunk-DMAMWUYY.js → chunk-ZSLTSCTI.js} +5 -5
  264. package/dist/{chunk-IGVAWAOK.js → chunk-ZSYFQSPF.js} +43 -9
  265. package/dist/cli/index.js +8 -3
  266. package/dist/{core-7Y5BZZON.js → core-43GLGBOY.js} +8 -1
  267. package/dist/{core-7S3XMW5O.js → core-5GI3ERXO.js} +4 -1
  268. package/dist/{core-K3JX5WPM.js → core-5L7TMK7I.js} +6 -1
  269. package/dist/{core-LB5M7XL4.js → core-7TO4OVY5.js} +6 -1
  270. package/dist/{core-ILPXXC2Z.js → core-BJVENHFQ.js} +7 -1
  271. package/dist/{core-JDFUZFRH.js → core-BX4MFWKC.js} +6 -1
  272. package/dist/{core-XW7UJFJZ.js → core-C3KXTOIZ.js} +7 -1
  273. package/dist/{core-WJNK7F2J.js → core-C5Y6BFLL.js} +7 -1
  274. package/dist/{core-WZ4CHVYL.js → core-CLUSJ2SK.js} +5 -1
  275. package/dist/{core-TCSW24N6.js → core-E3IN2VVH.js} +5 -1
  276. package/dist/{core-MU4ALRR7.js → core-FD67NQOV.js} +6 -1
  277. package/dist/{core-YMXYUGF5.js → core-FDKMLRAK.js} +5 -1
  278. package/dist/{core-VKZSQFRG.js → core-FL6Z3VVX.js} +5 -1
  279. package/dist/{core-5UF44NDI.js → core-JC7JUFPY.js} +8 -1
  280. package/dist/{core-RR2CAZC5.js → core-JF33TADA.js} +8 -1
  281. package/dist/{core-4RR6VSXM.js → core-JH32ZAKM.js} +4 -1
  282. package/dist/{core-G3LXHW73.js → core-JYYZPPQV.js} +7 -1
  283. package/dist/{core-4HFVG4CP.js → core-KJTKCV4U.js} +4 -1
  284. package/dist/{core-GSILPKUR.js → core-LCQPE5Y6.js} +8 -1
  285. package/dist/{core-GLOZY6Z7.js → core-LHVGWE54.js} +6 -1
  286. package/dist/{core-J2JD5ODO.js → core-OVSNBOCE.js} +9 -1
  287. package/dist/{core-BLHEJ5OK.js → core-PPEC236B.js} +5 -1
  288. package/dist/{core-ZLSQHZ3I.js → core-QTJZDK5H.js} +5 -1
  289. package/dist/{core-TKZZZ6UW.js → core-R3YZCOUZ.js} +7 -1
  290. package/dist/{core-HTD5RHE7.js → core-RIBW5XU4.js} +7 -1
  291. package/dist/{core-AR2T32Y3.js → core-RJFILBWL.js} +8 -1
  292. package/dist/{core-A5AKUB7H.js → core-RWSXEKTE.js} +4 -1
  293. package/dist/{core-DD62MWEW.js → core-SOPPZLEH.js} +5 -1
  294. package/dist/{core-HDNWVLJW.js → core-TBUZCXLX.js} +5 -1
  295. package/dist/{core-BOG33BFD.js → core-TZ5QLTAX.js} +5 -1
  296. package/dist/{core-H5HO2CED.js → core-U7E5W4MY.js} +3 -1
  297. package/dist/{core-QPSAYRFT.js → core-UBNVSL44.js} +7 -1
  298. package/dist/{core-E2XOSHPR.js → core-UDRD4WIU.js} +6 -1
  299. package/dist/{core-DFZMOO7E.js → core-UVJZ4HY2.js} +7 -1
  300. package/dist/{core-LGJZUP6H.js → core-X7WWYQH4.js} +8 -1
  301. package/dist/{core-BBNY2BX4.js → core-XP56X47I.js} +5 -1
  302. package/dist/{core-3KLQSYWB.js → core-XQG54CYG.js} +6 -1
  303. package/dist/{dataTable-CNDRVGA5.js → dataTable-U7W4I6IF.js} +15 -2
  304. package/dist/{engine-FVEIM3WV.js → engine-O5V26MGR.js} +32 -19
  305. package/dist/fixtures.js +4 -1
  306. package/dist/flags-BVLSAXT3.js +10 -0
  307. package/dist/{fontTables-ZPZQ6IR3.js → fontTables-JUW7ZTQY.js} +3 -1
  308. package/dist/fonts.js +1 -1
  309. package/dist/geo/dach.js +1 -1
  310. package/dist/geo/de-states.js +1 -1
  311. package/dist/geo/eu27.js +1 -1
  312. package/dist/geo/europe.js +1 -1
  313. package/dist/geo/index.js +2 -2
  314. package/dist/geo/us-states.js +1 -1
  315. package/dist/geo/world.js +1 -1
  316. package/dist/index.js +41 -22
  317. package/dist/{main-THU6VIVU.js → main-35GS47XC.js} +68 -123
  318. package/dist/mcp/server.js +131 -118
  319. package/dist/react/bar.js +10 -1
  320. package/dist/react/bartable.js +10 -1
  321. package/dist/react/box.js +8 -1
  322. package/dist/react/bullet.js +10 -1
  323. package/dist/react/butterfly.js +10 -1
  324. package/dist/react/choropleth.js +10 -1
  325. package/dist/react/cohort.js +11 -1
  326. package/dist/react/column.js +10 -1
  327. package/dist/react/combo.js +10 -1
  328. package/dist/react/creative.js +11 -1
  329. package/dist/react/diagram.js +10 -1
  330. package/dist/react/dimswitch.js +11 -1
  331. package/dist/react/dot.js +9 -1
  332. package/dist/react/export.js +36 -18
  333. package/dist/react/funnel.js +9 -1
  334. package/dist/react/gantt.js +9 -1
  335. package/dist/react/grid.js +10 -1
  336. package/dist/react/heatmap.js +9 -1
  337. package/dist/react/histogram.js +11 -1
  338. package/dist/react/index.js +101 -85
  339. package/dist/react/kpi.js +10 -1
  340. package/dist/react/likert.js +11 -1
  341. package/dist/react/line.js +9 -1
  342. package/dist/react/mekko.js +10 -1
  343. package/dist/react/pareto.js +11 -1
  344. package/dist/react/pie.js +9 -1
  345. package/dist/react/prepare.js +49 -21
  346. package/dist/react/pvm.js +12 -1
  347. package/dist/react/pyramid.js +10 -1
  348. package/dist/react/sankey.js +10 -1
  349. package/dist/react/scatter.js +8 -1
  350. package/dist/react/slope.js +10 -1
  351. package/dist/react/sparkline.js +10 -1
  352. package/dist/react/spec.js +24 -14
  353. package/dist/react/status.js +9 -1
  354. package/dist/react/story.js +5 -2
  355. package/dist/react/table.js +9 -1
  356. package/dist/react/theme.js +10 -3
  357. package/dist/react/tilemap.js +9 -1
  358. package/dist/react/treemap.js +9 -1
  359. package/dist/react/variance.js +10 -1
  360. package/dist/react/waffle.js +9 -1
  361. package/dist/react/waterfall.js +11 -1
  362. package/dist/{resvg-VB7S5HRF.js → resvg-ZYEZTSUO.js} +3 -1
  363. package/dist/rows.js +3 -2
  364. package/dist/{rowsModule-LI6KOS46.js → rowsModule-H2S6WW4D.js} +2 -1
  365. package/dist/{schema-CGQID64D.js → schema-2R32F6AW.js} +1 -1
  366. package/dist/{schema-H2EC4GAQ.js → schema-2TPGJGVR.js} +1 -1
  367. package/dist/{schema-THXXFY6I.js → schema-47BG2TZA.js} +1 -3
  368. package/dist/{schema-AMT7P7KB.js → schema-56MOEOVR.js} +1 -1
  369. package/dist/{schema-GNTKL5DN.js → schema-5MSR4LNN.js} +1 -1
  370. package/dist/{schema-5ZTGVQAJ.js → schema-5RIYEWE6.js} +1 -1
  371. package/dist/{schema-LOQ3AFC7.js → schema-A26ZNGTZ.js} +1 -3
  372. package/dist/{schema-MMVPMJEF.js → schema-ALBF6V7Y.js} +1 -3
  373. package/dist/{schema-BKUFZLLI.js → schema-BA6WP5YZ.js} +1 -1
  374. package/dist/{schema-PQZWO3BP.js → schema-CBL2SMVR.js} +1 -3
  375. package/dist/{schema-BBTXTWYI.js → schema-CWKGLDSR.js} +1 -3
  376. package/dist/{schema-5KDEQBBT.js → schema-DBIQFL56.js} +1 -1
  377. package/dist/{schema-KPEPBGAX.js → schema-DL7V6NN2.js} +1 -1
  378. package/dist/{schema-PL3EU6EQ.js → schema-DUVJMFKQ.js} +4 -2
  379. package/dist/{schema-L5U4OROI.js → schema-ECJERHKF.js} +2 -1
  380. package/dist/{schema-YLE4XXQQ.js → schema-EDSEKZDJ.js} +1 -1
  381. package/dist/{schema-HH5HOORE.js → schema-ESR6ZIK4.js} +1 -3
  382. package/dist/{schema-5DUTAVO7.js → schema-F7TWGLRZ.js} +1 -3
  383. package/dist/{schema-B2GCEYXD.js → schema-FGB6IGZM.js} +1 -3
  384. package/dist/{schema-7NSV542V.js → schema-FKGGTM4Z.js} +2 -1
  385. package/dist/{schema-72EEMYS3.js → schema-FU2AFIEE.js} +1 -1
  386. package/dist/{schema-QORUB6EK.js → schema-JNJFCYBM.js} +18 -1
  387. package/dist/{schema-JH57NFXJ.js → schema-JYZ4RF6S.js} +2 -1
  388. package/dist/{schema-25INXAMY.js → schema-K7F6TEDK.js} +1 -2
  389. package/dist/{schema-OU35XA3Z.js → schema-KAK6DZX4.js} +1 -1
  390. package/dist/{schema-R5Y6NVBH.js → schema-MOKWIGF7.js} +1 -1
  391. package/dist/{schema-ZQSIR5UC.js → schema-MQT6BMNK.js} +1 -3
  392. package/dist/{schema-FDFQKIO5.js → schema-MR3BPPQR.js} +1 -1
  393. package/dist/{schema-VYECMPON.js → schema-OPXZYIW7.js} +1 -3
  394. package/dist/{schema-ZEVJMFLV.js → schema-PV7JGX5H.js} +1 -1
  395. package/dist/{schema-QPOBZUAR.js → schema-PWPQF5RC.js} +1 -1
  396. package/dist/{schema-GN6GAIU5.js → schema-PYQEUC5P.js} +1 -3
  397. package/dist/{schema-M5JBHQIV.js → schema-QPIC5MAG.js} +9 -2
  398. package/dist/{schema-QCIE6M2P.js → schema-R42VXFIS.js} +1 -1
  399. package/dist/{schema-J7TNCZIP.js → schema-TVUJNEX7.js} +1 -1
  400. package/dist/{schema-AXRDF6ND.js → schema-Y4TI2T3T.js} +1 -1
  401. package/dist/{schema-ZG6ZKFRZ.js → schema-ZU2EU2VP.js} +1 -1
  402. package/dist/{specValidation-VHLGDEME.js → specValidation-2NHJT7TQ.js} +4 -1
  403. package/dist/theme.js +7 -2
  404. package/dist/{themeShapeRules-PW4BQHKL.js → themeShapeRules-G7UZX6GJ.js} +1 -1
  405. package/dist/types/core/annotate.d.ts +27 -2
  406. package/dist/types/core/annotateArms.d.ts +3 -1
  407. package/dist/types/core/annotateTargets.d.ts +4 -0
  408. package/dist/types/core/annotationOrigin.d.ts +13 -0
  409. package/dist/types/core/axis.d.ts +2 -2
  410. package/dist/types/core/charts/band/stacks.d.ts +7 -1
  411. package/dist/types/core/charts/bartable/types.d.ts +14 -1
  412. package/dist/types/core/charts/box/types.d.ts +3 -1
  413. package/dist/types/core/charts/choropleth/layout.d.ts +1 -5
  414. package/dist/types/core/charts/choropleth/types.d.ts +19 -0
  415. package/dist/types/core/charts/cohort/types.d.ts +16 -3
  416. package/dist/types/core/charts/column/model.d.ts +13 -0
  417. package/dist/types/core/charts/combo/layout.d.ts +7 -0
  418. package/dist/types/core/charts/creative/types.d.ts +21 -0
  419. package/dist/types/core/charts/dimswitch/compile.d.ts +15 -2
  420. package/dist/types/core/charts/dimswitch/types.d.ts +24 -1
  421. package/dist/types/core/charts/gantt/calendar.d.ts +24 -0
  422. package/dist/types/core/charts/gantt/columns.d.ts +56 -0
  423. package/dist/types/core/charts/gantt/layout.d.ts +8 -2
  424. package/dist/types/core/charts/gantt/model.d.ts +296 -0
  425. package/dist/types/core/charts/grid/metricStack.d.ts +9 -0
  426. package/dist/types/core/charts/grid/metricStackSchema.d.ts +13 -0
  427. package/dist/types/core/charts/grid/normalize.d.ts +5 -0
  428. package/dist/types/core/charts/grid/schema.d.ts +2 -2
  429. package/dist/types/core/charts/histogram/types.d.ts +8 -0
  430. package/dist/types/core/charts/likert/layout.d.ts +10 -8
  431. package/dist/types/core/charts/pareto/layout.d.ts +2 -0
  432. package/dist/types/core/charts/pvm/types.d.ts +10 -1
  433. package/dist/types/core/charts/pyramid/types.d.ts +3 -1
  434. package/dist/types/core/charts/sankey/types.d.ts +5 -1
  435. package/dist/types/core/charts/scatter/clamp.d.ts +2 -1
  436. package/dist/types/core/charts/scatter/model.d.ts +5 -0
  437. package/dist/types/core/charts/scatter/valueLines.d.ts +3 -1
  438. package/dist/types/core/charts/status/layout.d.ts +3 -0
  439. package/dist/types/core/charts/table/resolve.d.ts +22 -3
  440. package/dist/types/core/charts/table/view.d.ts +24 -1
  441. package/dist/types/core/claims/browser.d.ts +2 -0
  442. package/dist/types/core/claims/ids.d.ts +38 -0
  443. package/dist/types/core/deferred.d.ts +1 -0
  444. package/dist/types/core/doc/diagnostics.d.ts +3 -2
  445. package/dist/types/core/footer.d.ts +2 -0
  446. package/dist/types/core/formatSpec.d.ts +43 -14
  447. package/dist/types/core/frame.d.ts +26 -59
  448. package/dist/types/core/frameText.d.ts +203 -0
  449. package/dist/types/core/geo/types.d.ts +2 -0
  450. package/dist/types/core/geometry.d.ts +3 -1
  451. package/dist/types/core/label/categoryRow.d.ts +19 -2
  452. package/dist/types/core/label/solver.d.ts +23 -2
  453. package/dist/types/core/normalize/shared.d.ts +14 -2
  454. package/dist/types/core/notes.d.ts +15 -2
  455. package/dist/types/core/reading.d.ts +12 -1
  456. package/dist/types/core/registry.d.ts +4 -5
  457. package/dist/types/core/request.d.ts +7 -1
  458. package/dist/types/core/schema/capability.d.ts +32 -7
  459. package/dist/types/core/schema/generatedColumns.d.ts +168 -0
  460. package/dist/types/core/seriesIdentity.d.ts +4 -1
  461. package/dist/types/core/sizing.d.ts +32 -1
  462. package/dist/types/core/structureCounts.d.ts +3 -1
  463. package/dist/types/core/text.d.ts +16 -0
  464. package/dist/types/core/theme.d.ts +33 -4
  465. package/dist/types/core/themeGeometry.d.ts +9 -0
  466. package/dist/types/core/themeRules.d.ts +2 -0
  467. package/dist/types/core/timeAxis.d.ts +6 -1
  468. package/dist/types/core/types/annotations.d.ts +74 -4
  469. package/dist/types/core/types/diagram.d.ts +7 -0
  470. package/dist/types/core/types/options.d.ts +118 -15
  471. package/dist/types/core/types/scene.d.ts +30 -2
  472. package/dist/types/core/types/table.d.ts +27 -3
  473. package/dist/types/core/types/theme.d.ts +23 -0
  474. package/dist/types/index.d.ts +2 -0
  475. package/dist/types/react/TableChart.d.ts +5 -0
  476. package/dist/types/react/barrelCharts.d.ts +16 -5
  477. package/dist/types/react/charts/butterfly.d.ts +2 -2
  478. package/dist/types/react/charts/dot.d.ts +7 -1
  479. package/dist/types/react/charts/pareto.d.ts +4 -1
  480. package/dist/types/react/charts/variance.d.ts +3 -1
  481. package/dist/types/react/hover/labelCard.d.ts +11 -2
  482. package/dist/types/react/prepare.d.ts +7 -1
  483. package/dist/types/theme.d.ts +2 -0
  484. package/dist/validate.js +23 -6
  485. package/docs/TELEMETRY.md +2 -2
  486. package/docs/manual.md +283 -65
  487. package/docs/reference/bar.md +15 -4
  488. package/docs/reference/bartable.md +17 -2
  489. package/docs/reference/box.md +15 -4
  490. package/docs/reference/bullet.md +21 -6
  491. package/docs/reference/butterfly.md +17 -6
  492. package/docs/reference/choropleth.md +16 -5
  493. package/docs/reference/cohort.md +25 -5
  494. package/docs/reference/column.md +19 -4
  495. package/docs/reference/combo.md +11 -5
  496. package/docs/reference/creative.md +17 -8
  497. package/docs/reference/diagram.md +6 -1
  498. package/docs/reference/dimswitch.md +71 -118
  499. package/docs/reference/dot.md +16 -7
  500. package/docs/reference/fixtures.md +94 -1
  501. package/docs/reference/funnel.md +14 -5
  502. package/docs/reference/gantt.md +17 -16
  503. package/docs/reference/grid.md +13 -3
  504. package/docs/reference/heatmap.md +16 -6
  505. package/docs/reference/histogram.md +2 -2
  506. package/docs/reference/kpi.md +5 -1
  507. package/docs/reference/likert.md +17 -4
  508. package/docs/reference/line.md +18 -5
  509. package/docs/reference/mekko.md +10 -5
  510. package/docs/reference/options.md +20 -15
  511. package/docs/reference/pareto.md +9 -5
  512. package/docs/reference/pie.md +9 -5
  513. package/docs/reference/pvm.md +16 -6
  514. package/docs/reference/pyramid.md +14 -4
  515. package/docs/reference/react.md +6 -7
  516. package/docs/reference/sankey.md +7 -3
  517. package/docs/reference/scatter.md +8 -4
  518. package/docs/reference/slope.md +15 -5
  519. package/docs/reference/sparkline.md +1 -1
  520. package/docs/reference/status.md +7 -1
  521. package/docs/reference/table.md +41 -110
  522. package/docs/reference/theme.md +12 -4
  523. package/docs/reference/tilemap.md +2 -4
  524. package/docs/reference/treemap.md +1 -1
  525. package/docs/reference/variance.md +12 -6
  526. package/docs/reference/waffle.md +1 -1
  527. package/docs/reference/warnings.md +1077 -0
  528. package/docs/reference/waterfall.md +20 -5
  529. package/docs/use-cases.md +25 -13
  530. package/llms.txt +19 -6
  531. package/package.json +18 -3
  532. package/dist/chunk-6364WO5D.js +0 -47
  533. package/dist/chunk-DQ7YMQVX.js +0 -26
  534. package/dist/chunk-EBB4PYBN.js +0 -24
  535. package/dist/chunk-FG5L2LUK.js +0 -89
  536. package/dist/chunk-IFQN4GKK.js +0 -1852
  537. package/dist/chunk-IRXVV65V.js +0 -24
  538. package/dist/chunk-JGFHNAHS.js +0 -22
  539. package/dist/chunk-JHWYG7V5.js +0 -24
  540. package/dist/chunk-M4SPKUZE.js +0 -7
  541. package/dist/chunk-O36WX56O.js +0 -13
  542. package/dist/chunk-QJWLNP64.js +0 -24
  543. package/dist/chunk-QZIHKQRH.js +0 -26
  544. package/dist/chunk-SE7MJ2LQ.js +0 -24
  545. package/dist/chunk-TXBO2LWM.js +0 -25
  546. package/dist/chunk-UPTXFTKH.js +0 -25
  547. package/dist/chunk-UREXN6WG.js +0 -25
  548. package/dist/chunk-UZLR25BW.js +0 -24
  549. package/dist/chunk-WIVFIVFZ.js +0 -27
  550. package/dist/chunk-WZL4EEBS.js +0 -11
  551. package/dist/chunk-XHRUXZD7.js +0 -28
  552. package/dist/chunk-ZWNRLIFT.js +0 -24
@@ -1,39 +1,46 @@
1
1
  import {
2
- liftOrFallback
3
- } from "./chunk-6364WO5D.js";
2
+ nameTrackRefusals,
3
+ overrideIgnored,
4
+ widthCapped,
5
+ widthFloored,
6
+ yieldingWidths
7
+ } from "./chunk-YGZEG3JV.js";
4
8
  import {
5
9
  fixedBarRow
6
- } from "./chunk-SA46CNMS.js";
10
+ } from "./chunk-ED7GLWTF.js";
7
11
  import {
8
12
  roundingUnavailable,
9
13
  shareRoundingNotes,
10
14
  sumConsistentShares
11
- } from "./chunk-6EYTD777.js";
15
+ } from "./chunk-MXUPMGRY.js";
12
16
  import {
13
17
  accumulateStack
14
- } from "./chunk-JEUL777U.js";
18
+ } from "./chunk-ETUKDEGL.js";
15
19
  import {
16
20
  digitSeat,
17
21
  digitSeatEdge
18
- } from "./chunk-EMFUZKYK.js";
22
+ } from "./chunk-SZ5VGWDY.js";
19
23
  import {
20
24
  warnIncompleteComposition
21
- } from "./chunk-KLB2QC24.js";
25
+ } from "./chunk-AICO24HJ.js";
22
26
  import {
23
27
  rowLabelBand
24
- } from "./chunk-EIL3KHAL.js";
28
+ } from "./chunk-J4QRB6DQ.js";
25
29
  import {
26
30
  fittedLabel
27
- } from "./chunk-MPO5TVGF.js";
31
+ } from "./chunk-6ZDSEITW.js";
28
32
  import {
29
33
  chartPalette
30
- } from "./chunk-7DAH2E4T.js";
34
+ } from "./chunk-WFBN2HXR.js";
31
35
  import {
32
36
  yearSpanFromLabels
33
- } from "./chunk-JTFKRDDA.js";
37
+ } from "./chunk-V7FV66KL.js";
34
38
  import {
35
39
  structureCount
36
- } from "./chunk-XCROSJ2Z.js";
40
+ } from "./chunk-KW4JXWHO.js";
41
+ import {
42
+ liftOrFallback
43
+ } from "./chunk-XWRI3N5O.js";
37
44
  import {
38
45
  fieldHeadFont,
39
46
  fieldHeadText,
@@ -41,10 +48,13 @@ import {
41
48
  headRule,
42
49
  totalGround,
43
50
  totalRule
44
- } from "./chunk-SPSGUFTI.js";
51
+ } from "./chunk-FB6X7QHA.js";
45
52
  import {
46
53
  tableRuleInk
47
54
  } from "./chunk-Z2MGTKDR.js";
55
+ import {
56
+ generatedIdWarnings
57
+ } from "./chunk-SXAZDIGM.js";
48
58
  import {
49
59
  CARD_CLASS_WIDTH,
50
60
  calendarCategories,
@@ -53,11 +63,10 @@ import {
53
63
  heightOmitted,
54
64
  rowDrivenHeight,
55
65
  rowSizing
56
- } from "./chunk-T2CYNDYU.js";
66
+ } from "./chunk-ETRAPN5G.js";
57
67
  import {
58
68
  PRIORITY,
59
69
  authoredNotes,
60
- createOccupiedIndex,
61
70
  fitText,
62
71
  frameTextOptions,
63
72
  isNumberAlone,
@@ -69,17 +78,17 @@ import {
69
78
  normalizeLegendOption,
70
79
  solveFrame,
71
80
  solveLabels
72
- } from "./chunk-4KQHKPB3.js";
81
+ } from "./chunk-I5VDW2XZ.js";
73
82
  import {
74
83
  disclosureNote,
75
84
  footerType,
76
85
  quietMethodNote
77
- } from "./chunk-SMHZXHHD.js";
86
+ } from "./chunk-DZYTXZNS.js";
78
87
  import {
79
88
  nonAdditiveFormat,
80
89
  roundedNumber,
81
90
  seriesRasterFormatter
82
- } from "./chunk-FFJGC2DX.js";
91
+ } from "./chunk-Z6DUNKFU.js";
83
92
  import {
84
93
  cagr,
85
94
  chartStrings,
@@ -92,6 +101,9 @@ import {
92
101
  } from "./chunk-MSYTF3DZ.js";
93
102
  import {
94
103
  canvasMargin,
104
+ cleanSum,
105
+ colorRolePaints,
106
+ createOccupiedIndex,
95
107
  dashToken,
96
108
  markRolePaint,
97
109
  paintColor,
@@ -99,28 +111,29 @@ import {
99
111
  rampSlots,
100
112
  resolveTheme,
101
113
  seriesPaint,
114
+ stackApartPaint,
102
115
  strokeToken,
103
116
  tableEmphasis,
104
117
  textScaleOf,
105
118
  themeForWidth,
106
119
  withSegmentSeams
107
- } from "./chunk-HJRNBKIT.js";
120
+ } from "./chunk-TX5FSNAU.js";
108
121
  import {
109
122
  NormalizeError,
110
123
  TARGET_SIZE,
111
124
  accessibleTitle,
112
125
  resolveSize,
113
126
  resolveSubtitle
114
- } from "./chunk-YOOHNQ3L.js";
127
+ } from "./chunk-RJICOOB3.js";
128
+ import {
129
+ defaultMeasurer,
130
+ splitNameBreaks
131
+ } from "./chunk-UIHGGWES.js";
115
132
  import {
116
133
  maxOf,
117
134
  minOf,
118
135
  pushAll
119
136
  } from "./chunk-WYJEOMNY.js";
120
- import {
121
- defaultMeasurer,
122
- splitNameBreaks
123
- } from "./chunk-SNQ7D5R7.js";
124
137
 
125
138
  // src/core/strings/bartable.ts
126
139
  var EN = {
@@ -206,7 +219,9 @@ function deriveCascade(rows, panels, opts) {
206
219
  "bartable-cascade-zero-total",
207
220
  `data.panels[${panels.indexOf(panel)}]`,
208
221
  `cascade splits each panel's total, and panel '${panel.id}' sums to zero`,
209
- "give the panel nonzero values or drop it"
222
+ "give the panel nonzero values or drop it",
223
+ void 0,
224
+ ["data", "panels", panels.indexOf(panel)]
210
225
  );
211
226
  return { starts, total: at, shares: panel.values.map((value) => value / at * 100) };
212
227
  }), { decimals, format } = shareSetFormatter(base.flatMap((panel) => panel.shares), locale), rounded = base.map((panel) => opts.sumConsistent ? sumConsistentShares(panel.shares, locale, void 0, decimals) : null), adjustments = [], warnings = [];
@@ -347,7 +362,9 @@ function combinedShareNotes(options, rows, panels, locale, authored) {
347
362
  "bartable-combined-share-row",
348
363
  `options.combinedShare.rows[${i}]`,
349
364
  `combinedShare names row '${id}' twice, which counts it twice; name each row once`,
350
- "drop the repeated row id"
365
+ "drop the repeated row id",
366
+ void 0,
367
+ ["options", "combinedShare", "rows", i]
351
368
  );
352
369
  let r = rows.findIndex((row) => row.id === id);
353
370
  if (r < 0)
@@ -355,7 +372,9 @@ function combinedShareNotes(options, rows, panels, locale, authored) {
355
372
  "bartable-combined-share-row",
356
373
  `options.combinedShare.rows[${i}]`,
357
374
  `combinedShare names row '${id}', which the table does not have`,
358
- `use one of the row ids: ${rows.map((row) => row.id).join(", ")}`
375
+ `use one of the row ids: ${rows.map((row) => row.id).join(", ")}`,
376
+ void 0,
377
+ ["options", "combinedShare", "rows", i]
359
378
  );
360
379
  return r;
361
380
  }), label = chartString(options, "combinedShadedLead", { v1: combinedLabel(combined.label, picked.map((r) => rows[r].label), options) }), pct = (part, whole) => whole === 0 ? chartString(options, "combinedShareZero") : formatShare(part / whole * 100, locale);
@@ -370,6 +389,36 @@ function combinedShareNotes(options, rows, panels, locale, authored) {
370
389
  return [disclosureNote(chartString(options, "combinedShareRangeNote", { v1: label, v2: entry.fmt(lowPart), v3: entry.fmt(lowWhole), v4: unit, v5: name, v6: pct(lowPart, lowWhole), v7: entry.fmt(highPart), v8: entry.fmt(highWhole), v9: pct(highPart, highWhole) }))];
371
390
  });
372
391
  }
392
+ function alignedIn(left, right, w, align) {
393
+ return align === "right" ? right - w : Math.min(align === "left" ? left : left + (right - left - w) / 2, right - w);
394
+ }
395
+ function columnKeyWarnings(data, options, compact, sharedScale) {
396
+ let warnings = [], panelIds = data.panels.map((panel) => panel.id), columnIds = (data.columns ?? []).map((column) => column.id), overrides = options.columnOverrides ?? {};
397
+ pushAll(warnings, generatedIdWarnings("bartable", "columnOverrides", options.columnOverrides, ["label", ...columnIds, ...panelIds])), pushAll(warnings, generatedIdWarnings("bartable", "columnOrder", options.columnOrder, [...columnIds.length > 0 ? ["numbers"] : [], "panels"])), pushAll(warnings, nameTrackRefusals(overrides, [...columnIds, ...panelIds]));
398
+ for (let id of panelIds)
399
+ if (overrides[id]?.width !== void 0 && sharedScale ? warnings.push(overrideIgnored(id, "width", "under sharedScale or a cascade the one scale sets the panel width")) : overrides[id]?.width !== void 0 && compact && warnings.push(overrideIgnored(id, "width", "the compact form draws each panel across the whole width")), compact && panelIds.length > 1) for (let key of ["headAlign", "align"]) overrides[id]?.[key] !== void 0 && warnings.push(overrideIgnored(id, key, "the compact form names several panels in a key"));
400
+ if (compact) {
401
+ for (let key of ["width", "align"]) overrides.label?.[key] !== void 0 && warnings.push(overrideIgnored("label", key, "the compact form sets each row name above its bar"));
402
+ options.columnOrder !== void 0 && warnings.push({ code: "option-ignored", severity: "warn", field: ["options", "columnOrder"], message: "columnOrder has no effect: the compact form keeps the number columns at the right edge", suggest: "Remove columnOrder, or draw the chart wider.", fix: [{ op: "remove", path: "/options/columnOrder" }] });
403
+ }
404
+ if (options.total === !1 && options.totalPosition !== void 0 && warnings.push({ code: "option-ignored", severity: "warn", field: ["options", "totalPosition"], message: "totalPosition has no effect: total is false, so no Total row is drawn", suggest: "Remove totalPosition, or set total to true.", fix: [{ op: "remove", path: "/options/totalPosition" }] }), options.columnHeads === !1) {
405
+ let units = [...new Set(data.panels.flatMap((panel) => panel.unit ?? []))];
406
+ units.length > 0 && warnings.push({
407
+ code: "column-heads-unit-hidden",
408
+ severity: "warn",
409
+ field: ["options", "columnHeads"],
410
+ message: `columnHeads: false removes the only print of the unit ${units.join(", ")}`,
411
+ suggest: "Name the unit in the subtitle or a footnote."
412
+ }), panelIds.length + columnIds.length > 1 && warnings.push({
413
+ code: "column-heads-names-hidden",
414
+ severity: "warn",
415
+ field: ["options", "columnHeads"],
416
+ message: "columnHeads: false removes the only names of the number columns and panels",
417
+ suggest: "Name them in the subtitle or a footnote, or keep the heads."
418
+ });
419
+ }
420
+ return warnings;
421
+ }
373
422
  var CASCADE_LIFT = /* @__PURE__ */ Symbol("bartableCascadeLift");
374
423
  function layoutBarTable(authored, options = {}) {
375
424
  if (options.variant !== "cascade" || options[CASCADE_LIFT] !== void 0) return layoutBarTableOnce(authored, options);
@@ -387,7 +436,7 @@ function layoutBarTableOnce(authored, options) {
387
436
  throw new NormalizeError("bartable-cascade", "options.segmentValues", "segmentValues sets the part values of variant 'panels', and a cascade bar is one part that prints its own value", "set variant 'panels', or drop segmentValues");
388
437
  let cascadeOptions = options.variant === "cascade" ? options.cascade ?? {} : void 0;
389
438
  cascadeOptions && checkCascade(split.data, cascadeOptions.growth);
390
- let warnings = [], data = withAggregates(split.data, options, warnings);
439
+ let warnings = [], data = withAggregates(split.data, options, warnings), overrides = options.columnOverrides ?? {}, headsDrawn = options.columnHeads !== !1, valuesPrinted = options.labels?.point !== !1;
391
440
  if (options.rounding === "sum-consistent" && cascadeOptions?.share === !1 && !options.combinedShare && cascadeOptions.growth?.measure !== "share-change")
392
441
  throw new NormalizeError("bartable-rounding", "options.rounding", "rounding 'sum-consistent' sets how the share columns print, and this table prints none", "set cascade.share on, or drop options.rounding");
393
442
  if (options.rounding === "sum-consistent" && !cascadeOptions)
@@ -413,16 +462,16 @@ function layoutBarTableOnce(authored, options) {
413
462
  let found = series.filter((s) => panel.values[s.id]?.[r] === null).map((s) => states.get(panel.values[s.id])?.[r]);
414
463
  return found.every((state) => state === found[0]) ? found[0] : void 0;
415
464
  }, panels = data.panels.map((panel) => {
416
- let stacks = rows.map((_, r) => accumulateStack(series.map((s) => panel.values[s.id]?.[r] ?? null))), rowSums = stacks.map((stack, r) => stack.segments.some((segment) => segment === null) ? (single || incomplete.add(r), null) : stack.total), ends = panel.ends ?? [], ranges = rowSums.map((sum, r) => sum === null ? void 0 : ends[r] ?? void 0), stackTotal = rowSums.every((sum) => sum !== null) ? rowSums.reduce((sum, value) => sum + value, 0) : null, sumOf = (end) => rowSums.reduce((sum, value, r) => sum + (ranges[r]?.[end] ?? value), 0), total = panel.aggregate === "none" ? void 0 : stackTotal === null ? null : ranges.some(Boolean) ? { low: sumOf("low"), high: sumOf("high") } : stackTotal, raster = [
465
+ let stacks = rows.map((_, r) => accumulateStack(series.map((s) => panel.values[s.id]?.[r] ?? null))), rowSums = stacks.map((stack, r) => stack.segments.some((segment) => segment === null) ? (single || incomplete.add(r), null) : stack.total), ends = panel.ends ?? [], ranges = rowSums.map((sum, r) => sum === null ? void 0 : ends[r] ?? void 0), stackTotal = rowSums.every((sum) => sum !== null) ? cleanSum(rowSums) : null, sumOf = (end) => cleanSum(rowSums.map((value, r) => ranges[r]?.[end] ?? value)), total = panel.aggregate === "none" ? void 0 : stackTotal === null ? null : ranges.some(Boolean) ? { low: sumOf("low"), high: sumOf("high") } : stackTotal, raster = [
417
466
  ...rowSums.flatMap((sum, r) => {
418
467
  let end = ranges[r];
419
468
  return end ? [end.low, end.high] : [sum];
420
469
  }),
421
470
  ...total == null ? [] : typeof total == "number" ? [total] : [total.low, total.high]
422
- ], { fmt, spec } = seriesRasterFormatter(panel.format ?? options.format, raster, locale, panel.unit, options.target), endTexts = rowSums.map((sum, r) => {
471
+ ], { fmt, spec } = seriesRasterFormatter(panel.format ?? options.format, raster, locale, panel.unit ?? options.unit, options.target), endTexts = rowSums.map((sum, r) => {
423
472
  let end = ranges[r];
424
473
  return sum === null ? stateGlyph[blankState(panel, r) ?? "none"] : end ? range(fmt(end.low), fmt(end.high)) : fmt(sum);
425
- }), totalText = total === void 0 ? void 0 : total === null ? glyph : typeof total == "number" ? fmt(total) : range(fmt(total.low), fmt(total.high)), label2 = panel.label ?? panel.id, repeatsSubtitle = data.panels.length === 1 && panel.unit !== void 0 && label2.trim().toLowerCase() === (resolveSubtitle(options.subtitle)?.measure ?? "").trim().toLowerCase();
474
+ }), totalText = total === void 0 ? void 0 : total === null ? glyph : typeof total == "number" ? fmt(total) : range(fmt(total.low), fmt(total.high)), label2 = panel.label ?? panel.id, headOverride = overrides[panel.id]?.label, repeatsSubtitle = headOverride === void 0 && data.panels.length === 1 && panel.unit !== void 0 && label2.trim().toLowerCase() === (resolveSubtitle(options.subtitle)?.measure ?? "").trim().toLowerCase();
426
475
  return {
427
476
  panel,
428
477
  stacks,
@@ -434,17 +483,17 @@ function layoutBarTableOnce(authored, options) {
434
483
  spec,
435
484
  endTexts,
436
485
  totalText,
437
- head: repeatsSubtitle ? panel.unit : panel.unit ? `${label2}, ${panel.unit}` : label2,
486
+ head: headOverride ?? (repeatsSubtitle ? panel.unit : panel.unit ? `${label2}, ${panel.unit}` : label2),
438
487
  // A period panel (cascade, or a year alone) heads with a category value and keeps its case and face;
439
488
  // a unit alone keeps its case.
440
- fieldHead: !repeatsSubtitle && cascadeOptions === void 0 && !isNumberAlone(label2),
489
+ fieldHead: !repeatsSubtitle && cascadeOptions === void 0 && !isNumberAlone(headOverride ?? label2),
441
490
  unitHead: repeatsSubtitle,
442
491
  max: Math.max(0, maxOf(stacks.map((stack, r) => ranges[r]?.high ?? stack.positive)))
443
492
  };
444
493
  }), numberColumns = columns.map((column) => {
445
494
  let fmt = seriesRasterFormatter(column.format, column.values, locale, void 0, options.target).fmt, summed = column.aggregate !== "none", missing = column.values.some((value) => value === null);
446
495
  summed && missing && column.values.forEach((value, r) => value === null && incomplete.add(r));
447
- let total = summed && !missing ? column.values.reduce((sum, value) => sum + value, 0) : null;
496
+ let total = summed && !missing ? cleanSum(column.values) : null;
448
497
  return {
449
498
  column,
450
499
  texts: column.values.map((value, r) => value === null ? stateGlyph[states.get(column.values)?.[r] ?? "none"] : fmt(value)),
@@ -478,7 +527,7 @@ function layoutBarTableOnce(authored, options) {
478
527
  lift: options[CASCADE_LIFT] ?? "full"
479
528
  }) : void 0;
480
529
  cascade && pushAll(warnings, cascade.warnings);
481
- let showShare = cascadeOptions !== void 0 && cascadeOptions.share !== !1, margin = { ...canvasMargin(theme, size.width), ...options.margin }, noteFont = { family: theme.type.family, ...footerType(theme.type.footnote, options.target, textScaleOf(options)) }, noteW = Math.max(1, size.width - (margin.left ?? 0) - (margin.right ?? 0)), partsPrinted = panels.map((entry) => !cascade && series.length > 1 && options.segmentValues !== !1 && entry.spec.decimals <= PART_DECIMALS), partsMissTotal = panels.some((entry, p) => partsPrinted[p] && entry.rowSums.some((sum, r) => {
530
+ let showShare = cascadeOptions !== void 0 && cascadeOptions.share !== !1, margin = { ...canvasMargin(theme, size.width), ...options.margin }, noteFont = { family: theme.type.family, ...footerType(theme.type.footnote, options.target, textScaleOf(options)) }, noteW = Math.max(1, size.width - (margin.left ?? 0) - (margin.right ?? 0)), partsPrinted = panels.map((entry) => !cascade && series.length > 1 && options.segmentValues !== !1 && valuesPrinted && entry.spec.decimals <= PART_DECIMALS), partsMissTotal = panels.some((entry, p) => partsPrinted[p] && entry.rowSums.some((sum, r) => {
482
531
  if (sum === null || entry.ranges[r]) return !1;
483
532
  let rounded = series.reduce((acc, s) => acc + roundedNumber(Math.max(0, entry.panel.values[s.id]?.[r] ?? 0), entry.spec), 0);
484
533
  return Math.abs(rounded - roundedNumber(sum, entry.spec)) > 1e-9 * Math.max(1, Math.abs(sum));
@@ -489,12 +538,12 @@ function layoutBarTableOnce(authored, options) {
489
538
  ...blanks.length > 0 ? [disclosureNote(twoLineNote(chartString(options, single ? "bartableMissingHeading" : "bartableBlankHeading", { v1: glyph }), blanks, showTotal ? chartString(options, "bartableBlankTotal") : "", noteFont, noteW, measure, options))] : [],
490
539
  ...options[SLIVER_NOTE] ?? [],
491
540
  ...shareRoundingNotes(options, cascade?.adjustments ?? [])
492
- ], own = series.map((s) => s.fill ? { css: s.fill } : s.colorRole ? markRolePaint(s.colorRole, !0) : void 0), slots = rampSlots(
541
+ ], roles = colorRolePaints(series), own = series.map((s) => s.fill ? { css: s.fill } : s.colorRole ? roles.get(s.id) : void 0), slots = rampSlots(
493
542
  theme,
494
543
  own,
495
544
  options.palette,
496
545
  series.length > 1 ? { labels: series.map((s) => s.label ?? s.id), warnings } : void 0
497
- ), paints = series.map((_, i) => own[i] ?? seriesPaint(slots[i], options.palette)), groups = data.rowGroups?.groups ?? [], groupOwn = groups.map((g) => g.fill ? { css: g.fill } : g.colorRole ? markRolePaint(g.colorRole, !0) : void 0), groupSlots = groups.length > 0 ? rampSlots(theme, groupOwn, options.palette, groups.length > 1 ? { labels: groups.map((g) => g.label ?? g.id), warnings } : void 0) : [], groupPaints = groups.map((_, i) => groupOwn[i] ?? seriesPaint(groupSlots[i], options.palette)), rowPaint = (r, s) => {
546
+ ), paints = series.map((_, i) => own[i] ?? seriesPaint(slots[i], options.palette)), groups = data.rowGroups?.groups ?? [], groupRoles = colorRolePaints(groups), groupOwn = groups.map((g) => g.fill ? { css: g.fill } : g.colorRole ? groupRoles.get(g.id) : void 0), groupSlots = groups.length > 0 ? rampSlots(theme, groupOwn, options.palette, groups.length > 1 ? { labels: groups.map((g) => g.label ?? g.id), warnings } : void 0) : [], residualRows = data.categories.some((row) => row.residual), groupPaints = groups.map((_, i) => groupOwn[i] ?? (residualRows ? stackApartPaint([...groupOwn, RESIDUAL_FILL], i, groupSlots[i], options.palette) : seriesPaint(groupSlots[i], options.palette))), rowPaint = (r, s) => {
498
547
  let row = data.categories[r];
499
548
  if (row.residual) return RESIDUAL_FILL;
500
549
  let g = row.group === void 0 ? -1 : groups.findIndex((group) => group.id === row.group);
@@ -518,43 +567,72 @@ function layoutBarTableOnce(authored, options) {
518
567
  measure
519
568
  },
520
569
  occupied
521
- ), plot = frame.plot, cellFont = { family: theme.type.family, ...theme.type.label }, headFont = { ...cellFont, ...theme.type.axis }, fieldFont = fieldHeadFont(theme), fieldText = (text) => fieldHeadText(text, theme), totalFont = { ...cellFont, weight: tableEmphasis(theme) }, width = (text, font) => measure(text, font).width, compact = options.mode === "compact", interleaved = compact && panels.length > 1, fitRows = (maxW, lines) => {
570
+ ), plot = frame.plot, cellFont = { family: theme.type.family, ...theme.type.label }, headFont = { ...cellFont, ...theme.type.axis }, fieldFont = fieldHeadFont(theme), fieldText = (text) => fieldHeadText(text, theme), totalFont = { ...cellFont, weight: tableEmphasis(theme) }, width = (text, font) => measure(text, font).width, compact = options.mode === "compact";
571
+ pushAll(warnings, columnKeyWarnings(data, options, compact, sharedScale || cascadeOptions !== void 0));
572
+ let interleaved = compact && panels.length > 1, fitRows = (maxW, lines) => {
522
573
  let fit = (w, n) => rowLabelBand(rows, cellFont, w, n, lineBox(cellFont), measure, { target: options.target, typeRole: "label", breakAfter: !0 }), cut = (band2) => band2.labels.some((label2) => label2.title !== void 0), pieces = (label2) => label2.split(/\s+/).flatMap(splitNameBreaks), band = fit(maxW, lines), most = Math.max(lines, maxOf(rows.map((row) => pieces(row.label).length)));
523
574
  for (let n = lines + 1; cut(band) && n <= most; n++) band = fit(maxW, n);
524
575
  return cut(band) && (band = fit(Math.max(maxW, maxOf(rows.flatMap((row) => pieces(row.label).map((word) => width(word, cellFont))))), most)), band;
525
- }, { labels: rowText, width: rowBandW } = compact ? { labels: [], width: 0 } : fitRows(plot.w * 0.3, 3), labelTrack = compact ? 0 : Math.max(rowBandW, showTotal ? width(totalLabel, totalFont) : 0) + LABEL_GAP, x = plot.x + labelTrack, numberTracks = numberColumns.map((entry, i) => {
526
- let name = entry.column.label ?? entry.column.id, head2 = fieldText(name), overhang = i === 0 && !compact ? labelTrack : 0, inner = Math.max(
576
+ }, panelsFirst = !compact && (() => {
577
+ let order = options.columnOrder ?? [], at = (id) => {
578
+ let i = order.indexOf(id);
579
+ return i < 0 ? id === "numbers" ? order.length : order.length + 1 : i;
580
+ };
581
+ return at("panels") < at("numbers");
582
+ })(), weights = panels.map((entry) => entry.panel.weight ?? 1), weightSum = weights.reduce((sum, weight) => sum + weight, 0), endReserves = panels.map((entry) => {
583
+ let texts2 = valuesPrinted ? entry.endTexts : entry.endTexts.filter((_, r) => entry.rowSums[r] === null);
584
+ return texts2.length === 0 ? 0 : maxOf(texts2.map((text) => width(text, cellFont))) + END_GAP;
585
+ }), totalWidths = panels.map((entry) => showTotal && entry.totalText !== void 0 ? width(entry.totalText, totalFont) : 0), shareHead = fieldText(options.strings?.share ?? chartString(options, "shareHeading")), shareWs = panels.map((_, p) => showShare ? Math.max(headsDrawn ? width(shareHead, fieldFont) : 0, maxOf(cascade.panels[p].shareTexts.map((text) => width(text, cellFont)))) : 0), bracketWs = panels.map((_, p) => {
586
+ let combined = cascade?.panels[p].combined;
587
+ return combined ? BRACKET_GAP + BRACKET_ARM + BRACKET_TEXT_GAP + width(combined.text, totalFont) : 0;
588
+ }), growth = cascade?.growth, growthHead = growth ? fieldText(growth.head) : "", growthOverhang = !compact && !(panelsFirst && numberColumns.length > 0) ? bracketWs[panels.length - 1] : 0, growthInner = growth ? Math.max(maxOf(growth.texts.map((text, r) => width(text, r === rows.length ? totalFont : cellFont))), ...interleaved || growthOverhang > 0 || !headsDrawn ? [] : growthHead.split(/\s+/).map((word) => width(word, fieldFont))) : 0, growthFit = (w) => fitText(growthHead, fieldFont, w, 3, measure, { target: options.target, typeRole: "axis" });
589
+ for (; growth && headsDrawn && !interleaved && growthFit(growthInner + growthOverhang).title !== void 0 && growthInner < width(growthHead, fieldFont); ) growthInner += 4;
590
+ let growthW = growth ? PANEL_GAP + growthInner : 0, extras = panels.map((_, p) => PANEL_GAP + (cascade ? (showShare ? SHARE_GAP + shareWs[p] : 0) + bracketWs[p] : endReserves[p])), spans = panels.map((entry) => cascade ? cascade.panels[panels.indexOf(entry)].total : entry.max), extrasSum = extras.reduce((sum, w) => sum + w, 0), spanSum = spans.reduce((sum, v) => sum + v, 0), minTracks = panels.map((entry, p) => cascade ? Math.max(MIN_TRACK, ...(headsDrawn ? entry.head.split(/\s+/) : []).map((word) => width(word, headFont)), totalWidths[p] + 2 * END_GAP) : Math.max(MIN_RUN, totalWidths[p] - endReserves[p])), panelsW = sharedScale ? extrasSum + maxOf(minTracks.map((min, p) => spans[p] > 0 ? min / spans[p] : 0)) * spanSum : cascade ? Math.max(extrasSum + minTracks.reduce((sum, w) => sum + w, 0), maxOf(panels.map((_, p) => (extras[p] + minTracks[p]) * weightSum / weights[p]))) : panels.reduce((sum, _entry, p) => sum + PANEL_GAP + Math.max((panels.length > 1 ? PREFERRED_RUN : MIN_RUN) + endReserves[p], totalWidths[p]), 0), words = (label2) => label2.split(/\s+/).flatMap(splitNameBreaks), labelWidth = compact ? void 0 : overrides.label?.width, valueFloor = (entry) => CELL_AIR + Math.max(
591
+ maxOf(entry.texts.map((text) => width(text, cellFont))),
592
+ showTotal && entry.totalText !== void 0 ? width(entry.totalText, totalFont) : 0
593
+ ), labelRoom = plot.w - growthW - panelsW - numberColumns.reduce((sum, entry) => sum + valueFloor(entry), 0), { labels: rowText, width: rowBandW } = compact ? { labels: [], width: 0 } : fitRows(labelWidth === void 0 ? plot.w * 0.3 : Math.max(1, Math.min(labelWidth, labelRoom) - LABEL_GAP), 3), labelFloor = Math.max(rowBandW, showTotal ? width(totalLabel, totalFont) : 0) + LABEL_GAP;
594
+ labelWidth !== void 0 && labelWidth > Math.max(labelRoom, labelFloor) && warnings.push(widthCapped("bartable", "label")), labelWidth !== void 0 && labelWidth < labelFloor && warnings.push(widthFloored("bartable", "label"));
595
+ let labelTrack = compact ? 0 : labelWidth === void 0 ? labelFloor : Math.max(labelFloor, Math.min(labelWidth, labelRoom)), labelTrackFloor = labelWidth === void 0 ? labelTrack : Math.max(maxOf(rows.flatMap((row) => words(row.label).map((word) => width(word, cellFont)))), showTotal ? width(totalLabel, totalFont) : 0) + LABEL_GAP, x = plot.x + labelTrack, numberNaturals = numberColumns.map((entry, i) => {
596
+ let name = overrides[entry.column.id]?.label ?? entry.column.label ?? entry.column.id, head2 = fieldText(name), overhang = i === 0 && !compact && !panelsFirst && headsDrawn ? labelTrack : 0, inner = Math.max(
527
597
  maxOf(entry.texts.map((text) => width(text, cellFont))),
528
598
  showTotal && entry.totalText !== void 0 ? width(entry.totalText, totalFont) : 0,
529
- ...overhang > 0 ? [] : head2.split(/\s+/).map((word) => width(word, fieldFont))
599
+ ...overhang > 0 || !headsDrawn ? [] : head2.split(/\s+/).map((word) => width(word, fieldFont))
530
600
  ), headFitAt = (w) => fitText(head2, fieldFont, w, 3, measure, { target: options.target, typeRole: "axis" });
531
- for (; (overhang > 0 || interleaved && cascade?.growth) && headFitAt(inner + overhang).title !== void 0 && inner < width(head2, fieldFont); ) inner += 4;
532
- let track = { ...entry, name, head: head2, headFit: headFitAt(inner + overhang), right: x + CELL_AIR + inner };
601
+ for (; headsDrawn && (overhang > 0 || interleaved && cascade?.growth) && headFitAt(inner + overhang).title !== void 0 && inner < width(head2, fieldFont); ) inner += 4;
602
+ return { entry, name, head: head2, overhang, inner, headFitAt };
603
+ }), numberSurplus = numberNaturals.map((natural) => {
604
+ let asked = overrides[natural.entry.column.id]?.width;
605
+ return asked !== void 0 && asked < CELL_AIR + natural.inner && warnings.push(widthFloored("bartable", natural.entry.column.id)), asked === void 0 ? 0 : Math.max(0, asked - CELL_AIR - natural.inner);
606
+ }), numberSurplusSum = numberSurplus.reduce((sum, value) => sum + value, 0), numberRoom = Math.max(0, plot.w - growthW - (compact ? LABEL_GAP + MIN_COMPACT_LABEL : labelTrack + panelsW) - numberNaturals.reduce((sum, natural) => sum + CELL_AIR + natural.inner, 0)), numberScale = numberSurplusSum > numberRoom ? numberRoom / numberSurplusSum : 1, numberTracks = numberNaturals.map(({ entry, name, head: head2, overhang, inner: natural, headFitAt }, i) => {
607
+ numberScale < 1 && numberSurplus[i] > 0 && warnings.push(widthCapped("bartable", entry.column.id));
608
+ let inner = numberSurplus[i] > 0 ? natural + numberSurplus[i] * numberScale : natural, track = { ...entry, name, head: head2, inner, headFit: headFitAt(inner + overhang), right: x + CELL_AIR + inner };
533
609
  return x += CELL_AIR + inner, track;
534
- }), fixedW = x - plot.x, weights = panels.map((entry) => entry.panel.weight ?? 1), weightSum = weights.reduce((sum, weight) => sum + weight, 0), endReserves = panels.map((entry) => maxOf(entry.endTexts.map((text) => width(text, cellFont))) + END_GAP), totalWidths = panels.map((entry) => showTotal && entry.totalText !== void 0 ? width(entry.totalText, totalFont) : 0), shareHead = fieldText(options.strings?.share ?? chartString(options, "shareHeading")), shareWs = panels.map((_, p) => showShare ? Math.max(width(shareHead, fieldFont), maxOf(cascade.panels[p].shareTexts.map((text) => width(text, cellFont)))) : 0), bracketWs = panels.map((_, p) => {
535
- let combined = cascade?.panels[p].combined;
536
- return combined ? BRACKET_GAP + BRACKET_ARM + BRACKET_TEXT_GAP + width(combined.text, totalFont) : 0;
537
- }), growth = cascade?.growth, growthHead = growth ? fieldText(growth.head) : "", growthOverhang = compact ? 0 : bracketWs[panels.length - 1], growthInner = growth ? Math.max(maxOf(growth.texts.map((text, r) => width(text, r === rows.length ? totalFont : cellFont))), ...interleaved || growthOverhang > 0 ? [] : growthHead.split(/\s+/).map((word) => width(word, fieldFont))) : 0, growthFit = (w) => fitText(growthHead, fieldFont, w, 3, measure, { target: options.target, typeRole: "axis" });
538
- for (; growth && !interleaved && growthFit(growthInner + growthOverhang).title !== void 0 && growthInner < width(growthHead, fieldFont); ) growthInner += 4;
539
- let growthW = growth ? PANEL_GAP + growthInner : 0, sideW = compact ? fixedW + growthW : 0;
610
+ }), fixedW = x - plot.x, minFixedW = labelWidth === void 0 && numberSurplusSum === 0 ? fixedW : labelTrackFloor + numberNaturals.reduce((sum, natural) => sum + CELL_AIR + natural.inner, 0), sideW = compact ? fixedW + growthW : 0, minSideW = compact ? minFixedW + growthW : 0;
540
611
  compact && (numberTracks.forEach((track) => {
541
612
  track.right += plot.w - sideW;
542
613
  }), { labels: rowText } = fitRows(Math.max(MIN_COMPACT_LABEL, plot.w - sideW - LABEL_GAP), 2));
543
- let extras = panels.map((_, p) => PANEL_GAP + (cascade ? (showShare ? SHARE_GAP + shareWs[p] : 0) + bracketWs[p] : endReserves[p])), spans = panels.map((entry) => cascade ? cascade.panels[panels.indexOf(entry)].total : entry.max), compactW = plot.w - (cascade ? sideW : 0), restW = Math.max(0, plot.w - fixedW - growthW), extrasSum = extras.reduce((sum, w) => sum + w, 0), spanSum = spans.reduce((sum, v) => sum + v, 0), sharedK = spanSum > 0 ? Math.max(0, restW - extrasSum) / spanSum : 0, compactK = minOf(spans.map((span, p) => span > 0 ? Math.max(0, compactW - extras[p] + PANEL_GAP) / span : 1 / 0)), runFloors = panels.map((_, p) => Math.max(PREFERRED_RUN, totalWidths[p] - endReserves[p])), ownRuns = (() => {
544
- let total = Math.max(0, restW - panels.reduce((sum, _entry, p) => sum + PANEL_GAP + endReserves[p], 0)), held = /* @__PURE__ */ new Set(), runs = panels.map(() => 0);
614
+ let compactW = plot.w - (cascade ? sideW : 0), restW = Math.max(0, plot.w - fixedW - growthW), sharedK = spanSum > 0 ? Math.max(0, restW - extrasSum) / spanSum : 0, compactK = minOf(spans.map((span, p) => span > 0 ? Math.max(0, compactW - extras[p] + PANEL_GAP) / span : 1 / 0)), runFloors = panels.map((_, p) => Math.max(PREFERRED_RUN, totalWidths[p] - endReserves[p])), panelWidth = (p) => compact || sharedScale || cascade ? void 0 : overrides[panels[p].panel.id]?.width, runRoom = Math.max(0, restW - panels.reduce((sum, _entry, p) => sum + PANEL_GAP + endReserves[p], 0)), runSurplus = panels.map((entry, p) => {
615
+ let asked = panelWidth(p);
616
+ return asked !== void 0 && asked < PANEL_GAP + endReserves[p] + runFloors[p] && warnings.push(widthFloored("bartable", entry.panel.id)), asked === void 0 ? 0 : Math.max(0, asked - PANEL_GAP - endReserves[p] - runFloors[p]);
617
+ }), runSurplusSum = runSurplus.reduce((sum, value) => sum + value, 0), runSpare = Math.max(0, runRoom - runFloors.reduce((sum, floor) => sum + floor, 0)), runScale = runSurplusSum > runSpare ? runSpare / runSurplusSum : 1;
618
+ panels.forEach((entry, p) => {
619
+ runScale < 1 && runSurplus[p] > 0 && warnings.push(widthCapped("bartable", entry.panel.id));
620
+ });
621
+ let heldRun = (p) => runFloors[p] + runSurplus[p] * runScale, ownRuns = (() => {
622
+ let total = runRoom, held = new Set(panels.flatMap((_, p) => panelWidth(p) === void 0 ? [] : [p])), runs = panels.map(() => 0);
545
623
  for (let pass = 0; pass <= panels.length; pass++) {
546
- let free = total - [...held].reduce((sum, p) => sum + runFloors[p], 0), freeWeight = weights.reduce((sum, weight, p) => held.has(p) ? sum : sum + weight, 0);
547
- runs = panels.map((_entry, p) => held.has(p) ? runFloors[p] : freeWeight > 0 ? Math.max(0, free) * weights[p] / freeWeight : 0);
624
+ let free = total - [...held].reduce((sum, p) => sum + heldRun(p), 0), freeWeight = weights.reduce((sum, weight, p) => held.has(p) ? sum : sum + weight, 0);
625
+ runs = panels.map((_entry, p) => held.has(p) ? heldRun(p) : freeWeight > 0 ? Math.max(0, free) * weights[p] / freeWeight : 0);
548
626
  let low = panels.map((_entry, p) => p).filter((p) => !held.has(p) && runs[p] < runFloors[p] - 1e-9);
549
627
  if (low.length === 0 || held.size + low.length >= panels.length) break;
550
628
  low.forEach((p) => held.add(p));
551
629
  }
552
630
  return runs;
553
- })(), headingFloorRow = Math.max(BAR_H + 4, maxOf(rowText.map((text) => text.h + 2))), headingLines = !compact && !heightOmitted(options.size) && plot.h < 3 * lineBox(headFont) + HEAD_GAP + (showTotal ? TOTAL_GAP : 0) + (rows.length + (showTotal ? 1 : 0)) * headingFloorRow ? 2 : 3, shareColW = showShare ? SHARE_GAP + Math.max(0, maxOf(shareWs)) : 0, periodNameFull = interleaved && cascade ? maxOf(panels.map((entry) => width(entry.head, headFont))) : 0, periodNameW = interleaved && cascade ? Math.min(periodNameFull, plot.w / 3) + END_GAP : 0, interleavedRun = (p) => Math.max(0, cascade ? plot.w - growthW - shareColW - periodNameW : plot.w - endReserves[p]), interleavedK = minOf(spans.map((span, p) => span > 0 ? interleavedRun(p) / span : 1 / 0)), commonShareRight = plot.x + plot.w - growthW, keyTextW = Math.max(1, plot.w - KEY_W - KEY_GAP - CELL_AIR - (cascade ? plot.x + plot.w - commonShareRight + (showShare ? width(shareHead, fieldFont) : 0) : sideW)), panelTracks = panels.map((entry, p) => {
631
+ })(), headingFloorRow = Math.max(BAR_H + 4, maxOf(rowText.map((text) => text.h + 2))), headingLines = !compact && !heightOmitted(options.size) && plot.h < 3 * lineBox(headFont) + HEAD_GAP + (showTotal ? TOTAL_GAP : 0) + (rows.length + (showTotal ? 1 : 0)) * headingFloorRow ? 2 : 3, shareColW = showShare ? SHARE_GAP + Math.max(0, maxOf(shareWs)) : 0, periodNameFull = interleaved && cascade && headsDrawn ? maxOf(panels.map((entry) => width(entry.head, headFont))) : 0, periodNameW = interleaved && cascade && headsDrawn ? Math.min(periodNameFull, plot.w / 3) + END_GAP : 0, interleavedRun = (p) => Math.max(0, cascade ? plot.w - growthW - shareColW - periodNameW : plot.w - endReserves[p]), interleavedK = minOf(spans.map((span, p) => span > 0 ? interleavedRun(p) / span : 1 / 0)), commonShareRight = plot.x + plot.w - growthW, keyTextW = Math.max(1, plot.w - KEY_W - KEY_GAP - CELL_AIR - (cascade ? plot.x + plot.w - commonShareRight + (showShare ? width(shareHead, fieldFont) : 0) : sideW)), panelsStart = x = panelsFirst ? plot.x + labelTrack : x, panelTracks = panels.map((entry, p) => {
554
632
  let face = entry.fieldHead || entry.unitHead ? fieldFont : headFont, head2 = entry.fieldHead ? fieldText(entry.head) : entry.head;
555
633
  if (interleaved) {
556
634
  let scale2 = sharedScale ? Number.isFinite(interleavedK) ? interleavedK : 0 : spans[p] > 0 ? interleavedRun(p) / spans[p] : 0, headFit2 = cascade ? fitText(head2, face, Math.max(1, periodNameW - END_GAP), 1, measure, { target: options.target, typeRole: "axis" }) : fitText(head2, face, keyTextW, 2, measure, { target: options.target, typeRole: "axis" });
557
- return { ...entry, head: head2, face, origin: plot.x, scale: scale2, trackW: spans[p] * scale2, shareRight: commonShareRight, headFit: headFit2 };
635
+ return { ...entry, head: head2, face, origin: plot.x, scale: scale2, trackW: spans[p] * scale2, shareRight: commonShareRight, headFit: headFit2, headW: keyTextW };
558
636
  }
559
637
  let w = compact ? compactW + PANEL_GAP : sharedScale ? extras[p] + spans[p] * sharedK : cascade ? restW * weights[p] / weightSum : PANEL_GAP + endReserves[p] + ownRuns[p], origin = compact ? plot.x : x + PANEL_GAP, run = Math.max(0, cascade ? w - extras[p] : w - PANEL_GAP - endReserves[p]), scale = sharedScale ? compact ? Number.isFinite(compactK) ? compactK : 0 : sharedK : spans[p] > 0 ? run / spans[p] : 0, trackW = spans[p] * scale;
560
638
  compact || (x += w);
@@ -563,8 +641,12 @@ function layoutBarTableOnce(authored, options) {
563
641
  let before = headFit.lines[headFit.lines.length - 2].split(" "), last = `${before.pop()} ${entry.panel.unit}`;
564
642
  width(last, face) <= headW && (headFit.lines.splice(-2, 2, ...before.length ? [before.join(" ")] : [], last), headFit.w = Math.max(...headFit.lines.map((line2) => width(line2, face))), headFit.h = headFit.lines.length * lineBox(face));
565
643
  }
566
- return { ...entry, head: head2, face, origin, scale, trackW, shareRight: origin + trackW + SHARE_GAP + shareWs[p], headFit };
567
- }), growthTrack = growth ? { right: plot.x + plot.w, headFit: growthFit(interleaved ? Math.max(growthInner, plot.w * 0.4) : growthInner + growthOverhang) } : void 0, overlaps = (left, right, otherLeft, otherRight) => left < otherRight + 1 && right + 1 > otherLeft, shareBox = interleaved && growthTrack && showShare ? measure(shareHead, fieldFont) : void 0, shareRight = panelTracks[0]?.shareRight ?? 0, shareLift = shareBox ? Math.max(0, maxOf(numberTracks.filter((track) => overlaps(shareRight - shareBox.width, shareRight, track.right - track.headFit.w, track.right)).map((track) => track.headFit.h + 2))) : 0, growthLift = interleaved && growthTrack ? Math.max(
644
+ return { ...entry, head: head2, face, origin, scale, trackW, shareRight: origin + trackW + SHARE_GAP + shareWs[p], headFit, headW };
645
+ });
646
+ panelsFirst && numberTracks.forEach((track) => {
647
+ track.right += x - panelsStart;
648
+ });
649
+ let growthTrack = growth ? { right: plot.x + plot.w, headFit: growthFit(interleaved ? Math.max(growthInner, plot.w * 0.4) : growthInner + growthOverhang) } : void 0, overlaps = (left, right, otherLeft, otherRight) => left < otherRight + 1 && right + 1 > otherLeft, shareBox = interleaved && growthTrack && showShare ? measure(shareHead, fieldFont) : void 0, shareRight = panelTracks[0]?.shareRight ?? 0, shareLift = shareBox ? Math.max(0, maxOf(numberTracks.filter((track) => overlaps(shareRight - shareBox.width, shareRight, track.right - track.headFit.w, track.right)).map((track) => track.headFit.h + 2))) : 0, growthLift = interleaved && growthTrack ? Math.max(
568
650
  showShare && growthTrack.headFit.w > growthInner ? lineBox(headFont) + 2 : 0,
569
651
  maxOf(numberTracks.filter((track) => overlaps(growthTrack.right - growthTrack.headFit.w, growthTrack.right, track.right - track.headFit.w, track.right)).map((track) => track.headFit.h + 2)),
570
652
  shareBox && overlaps(growthTrack.right - growthTrack.headFit.w, growthTrack.right, shareRight - shareBox.width, shareRight) ? shareLift + shareBox.height + 2 : 0
@@ -592,20 +674,25 @@ function layoutBarTableOnce(authored, options) {
592
674
  if (mainNotes.length > 0) return layoutBarTable(authored, { ...options, [SLIVER_NOTE]: mainNotes });
593
675
  }
594
676
  }
595
- let heads = [...numberTracks, ...interleaved ? [] : panelTracks, ...growthTrack ? [growthTrack] : []].map((track) => track.headFit), keyH = interleaved && !cascade ? panelTracks.reduce((sum, track) => sum + track.headFit.h + 2, 0) - 2 : 0, headH = Math.max(lineBox(headFont), keyH, maxOf(heads.map((head2) => head2.h)), shareHeadH, (growthTrack?.headFit.h ?? 0) + growthLift), house = fixedBarRow(theme, rowText.map((text) => text.h + 4)), naturalRowH = house?.step ?? Math.max(ROW_PITCH, maxOf(rowText.map((text) => text.h + 4))), barH = house ? house.step * house.fraction : BAR_H, floorRowH = Math.max(barH + 4, maxOf(rowText.map((text) => text.h + 2))), rowCount = rows.length + (showTotal ? 1 : 0), blockH = headH + HEAD_GAP + (showTotal ? TOTAL_GAP : 0), minimumBlockH = Math.max(
677
+ let heads = [...numberTracks, ...interleaved ? [] : panelTracks, ...growthTrack ? [growthTrack] : []].map((track) => track.headFit), keyH = interleaved && !cascade ? panelTracks.reduce((sum, track) => sum + track.headFit.h + 2, 0) - 2 : 0, headH = headsDrawn ? Math.max(lineBox(headFont), keyH, maxOf(heads.map((head2) => head2.h)), shareHeadH, (growthTrack?.headFit.h ?? 0) + growthLift) : 0, headGap = headsDrawn ? HEAD_GAP : 0, house = fixedBarRow(theme, rowText.map((text) => text.h + 4)), naturalRowH = house?.step ?? Math.max(ROW_PITCH, maxOf(rowText.map((text) => text.h + 4))), barH = house ? house.step * house.fraction : BAR_H, floorRowH = Math.max(barH + 4, maxOf(rowText.map((text) => text.h + 2))), rowCount = rows.length + (showTotal ? 1 : 0), blockH = headH + headGap + (showTotal ? TOTAL_GAP : 0), minimumBlockH = (headsDrawn ? Math.max(
596
678
  lineBox(headFont),
597
679
  maxOf(numberTracks.map((track) => track.headFit.h)),
598
680
  maxOf(panelTracks.map((track) => Math.min(track.headFit.h, 2 * lineBox(headFont)))),
599
681
  shareHeadH,
600
682
  (growthTrack?.headFit.h ?? 0) + growthLift
601
- ) + HEAD_GAP + (showTotal ? TOTAL_GAP : 0), tight = interleaved && !cascade, tightFont = { ...cellFont, lineHeight: 1 }, valueFont = tight ? tightFont : cellFont, barLineH = Math.max(barH, measure("0", valueFont).height) + (interleaved ? 2 : 6), panelBarH = (p) => interleaved && !cascade && p > 0 ? THIN_BAR : barH, totalLineH = Math.max(lineBox(totalFont), measure(totalLabel, totalFont).height) + 2, nameBoxH = (r) => tight && rowText[r].lines.length === 1 ? measure(rowText[r].lines[0], tightFont).height : rowText[r].h, nameH = (r) => nameBoxH(r) + 2, unitTops = [0];
683
+ ) : 0) + headGap + (showTotal ? TOTAL_GAP : 0);
684
+ if (labelWidth !== void 0 && fixedHeightCanvas(options) && minimumBlockH + rowCount * floorRowH > plot.h) {
685
+ let { width: _width, ...nameSettings } = overrides.label, wider = layoutBarTable(authored, { ...options, columnOverrides: { ...overrides, label: nameSettings } });
686
+ return { ...wider, warnings: [...wider.warnings, overrideIgnored("label", "width", "the wrapped row names would not fit the pinned height")] };
687
+ }
688
+ let tight = interleaved && !cascade, tightFont = { ...cellFont, lineHeight: 1 }, valueFont = tight ? tightFont : cellFont, barLineH = Math.max(barH, measure("0", valueFont).height) + (interleaved ? 2 : 6), panelBarH = (p) => interleaved && !cascade && p > 0 ? THIN_BAR : barH, totalLineH = Math.max(lineBox(totalFont), measure(totalLabel, totalFont).height) + 2, nameBoxH = (r) => tight && rowText[r].lines.length === 1 ? measure(rowText[r].lines[0], tightFont).height : rowText[r].h, nameH = (r) => nameBoxH(r) + 2, unitTops = [0];
602
689
  for (let r = 0; r < rows.length; r++) unitTops.push(unitTops[r] + nameH(r) + (interleaved ? panels.length * barLineH + ROW_GAP : barLineH));
603
- let comboAfter = interleaved && cascade && bracketRows && bracketLabel !== void 0 && cascade.panels.some((c) => c.combined) ? bracketRows.at(-1) : -1, periodTexts = panels.map((entry) => entry.panel.label ?? entry.panel.id), periodW = Math.max(0, maxOf(periodTexts.map((text) => width(text, cellFont)))), comboShareW = Math.max(0, maxOf((cascade?.panels ?? []).map((c) => c.combined ? width(c.combined.text, totalFont) : 0))), comboFit = comboAfter >= 0 ? fitText(comboRowLabel, totalFont, Math.max(MIN_COMPACT_LABEL, commonShareRight - comboShareW - periodW - 2 * CELL_AIR - plot.x), 3, measure, { target: options.target, typeRole: "label" }) : void 0, comboPitch = lineBox(cellFont) + 2, combinedH = comboFit ? 2 * COMBINED_PAD + Math.max(comboFit.h, panels.length * comboPitch) + ROW_GAP : 0, rowTopIn = (r) => unitTops[r] + (comboAfter >= 0 && r > comboAfter ? combinedH : 0), rowsSpan = unitTops[rows.length] + combinedH, totalIn = (p) => showTotal && (compact && !interleaved ? panels[p].totalText !== void 0 || p === 0 && (numberColumns.some((column) => column.totalText !== void 0) || !!growth?.texts[rows.length]) : panels.some((panel) => panel.totalText !== void 0) || numberColumns.some((column) => column.totalText !== void 0) || !!growth?.texts[rows.length]), totalBars = panels.map((_entry, p) => p).filter((p) => cascade && panels[p].totalText !== void 0), compactTotalH = interleaved ? totalLineH + totalBars.length * barLineH : totalLineH + barLineH, compactBlockH = (p) => headH + HEAD_GAP + rowsSpan + (showTotal ? TOTAL_GAP : 0) + (totalIn(p) ? compactTotalH : 0), compactRowsH = interleaved ? compactBlockH(0) : panels.reduce((sum, _entry, p) => sum + compactBlockH(p), 0) + (panels.length - 1) * BLOCK_GAP, spareRowH = options.heightFill !== "none" && fixedHeightCanvas(options) && !compact && !house ? Math.floor(Math.min(naturalRowH * MAX_ROW_GROWTH, (plot.h - blockH) / rowCount)) : 0, rowH = compact ? barLineH : Math.max(floorRowH, Math.min(naturalRowH, (plot.h - blockH) / rowCount), spareRowH);
690
+ let comboAfter = interleaved && cascade && bracketRows && bracketLabel !== void 0 && cascade.panels.some((c) => c.combined) ? bracketRows.at(-1) : -1, periodTexts = panels.map((entry) => overrides[entry.panel.id]?.label ?? entry.panel.label ?? entry.panel.id), periodW = Math.max(0, maxOf(periodTexts.map((text) => width(text, cellFont)))), comboShareW = Math.max(0, maxOf((cascade?.panels ?? []).map((c) => c.combined ? width(c.combined.text, totalFont) : 0))), comboFit = comboAfter >= 0 ? fitText(comboRowLabel, totalFont, Math.max(MIN_COMPACT_LABEL, commonShareRight - comboShareW - periodW - 2 * CELL_AIR - plot.x), 3, measure, { target: options.target, typeRole: "label" }) : void 0, comboPitch = lineBox(cellFont) + 2, combinedH = comboFit ? 2 * COMBINED_PAD + Math.max(comboFit.h, panels.length * comboPitch) + ROW_GAP : 0, rowTopIn = (r) => unitTops[r] + (comboAfter >= 0 && r > comboAfter ? combinedH : 0), rowsSpan = unitTops[rows.length] + combinedH, totalIn = (p) => showTotal && (compact && !interleaved ? panels[p].totalText !== void 0 || p === 0 && (numberColumns.some((column) => column.totalText !== void 0) || !!growth?.texts[rows.length]) : panels.some((panel) => panel.totalText !== void 0) || numberColumns.some((column) => column.totalText !== void 0) || !!growth?.texts[rows.length]), totalBars = panels.map((_entry, p) => p).filter((p) => cascade && panels[p].totalText !== void 0), compactTotalH = interleaved ? totalLineH + totalBars.length * barLineH : totalLineH + barLineH, compactBlockH = (p) => headH + headGap + rowsSpan + (showTotal ? TOTAL_GAP : 0) + (totalIn(p) ? compactTotalH : 0), compactRowsH = interleaved ? compactBlockH(0) : panels.reduce((sum, _entry, p) => sum + compactBlockH(p), 0) + (panels.length - 1) * BLOCK_GAP, spareRowH = options.heightFill !== "none" && fixedHeightCanvas(options) && !compact && !house ? Math.floor(Math.min(naturalRowH * MAX_ROW_GROWTH, (plot.h - blockH) / rowCount)) : 0, rowH = compact ? barLineH : Math.max(floorRowH, Math.min(naturalRowH, (plot.h - blockH) / rowCount), spareRowH);
604
691
  rowH > naturalRowH && (barH += Math.round((rowH - naturalRowH) * BAR_GROWTH));
605
- let cellBarH = cascade ? interleaved ? barH : Math.max(barH, rowH - (compact ? 6 : 8)) : barH, totalBarH = cascade ? interleaved ? barH : Math.max(barH, rowH - 6) : barH, tableTop = plot.y, rowsTop = tableTop + headH + HEAD_GAP, rowsBottom = rowsTop + rows.length * rowH, totalTop = rowsBottom + TOTAL_GAP, tableH = compact ? compactRowsH : blockH + rowCount * rowH, chromeH = size.height - plot.h, grow = rowDrivenHeight({ options, width: size.width, height: size.height, chromeH, rowsH: compact ? compactRowsH : blockH + rowCount * naturalRowH });
692
+ let cellBarH = cascade ? interleaved ? barH : Math.max(barH, rowH - (compact ? 6 : 8)) : barH, totalBarH = cascade ? interleaved ? barH : Math.max(barH, rowH - 6) : barH, tableTop = plot.y, rowsTop = tableTop + headH + headGap, rowsBottom = rowsTop + rows.length * rowH, totalTop = rowsBottom + TOTAL_GAP, tableH = compact ? compactRowsH : blockH + rowCount * rowH, chromeH = size.height - plot.h, grow = rowDrivenHeight({ options, width: size.width, height: size.height, chromeH, rowsH: compact ? compactRowsH : blockH + rowCount * naturalRowH });
606
693
  if (grow !== void 0) return layoutBarTable(authored, { ...options, size: { width: size.width, height: grow } });
607
- let scene = [...frame.nodes], under = [], contrastInk = /* @__PURE__ */ new Set(), mutedInk = /* @__PURE__ */ new Set(), marks = { segments: [], cells: [] }, requests = [], rightAligned = /* @__PURE__ */ new Set(), fonts = /* @__PURE__ */ new Map(), tableRight = plot.x + plot.w, line = (id, x1, y1, x2, y2, lineWidth, stroke, part) => scene.push({ t: "line", id, x1, y1, x2, y2, stroke, width: lineWidth, owner: {}, part }), label = (id, kind, owner, text, font, rect, fitted) => {
608
- fonts.set(id, font), requests.push({
694
+ let scene = [...frame.nodes], under = [], contrastInk = /* @__PURE__ */ new Set(), mutedInk = /* @__PURE__ */ new Set(), marks = { segments: [], cells: [] }, requests = [], rightAligned = /* @__PURE__ */ new Set(), fonts = /* @__PURE__ */ new Map(), tableRight = plot.x + plot.w, line = (id, x1, y1, x2, y2, lineWidth, stroke, part) => scene.push({ t: "line", id, x1, y1, x2, y2, stroke, width: lineWidth, owner: {}, part }), label = (id, kind, owner, text, font, rect, fitted, align) => {
695
+ fonts.set(id, font), align === "right" && rightAligned.add(id), requests.push({
609
696
  id,
610
697
  kind,
611
698
  owner,
@@ -613,44 +700,46 @@ function layoutBarTableOnce(authored, options) {
613
700
  font,
614
701
  typeRole: kind === "axisTitle" ? "axis" : "label",
615
702
  ...fitted ? fittedLabel(fitted, font) : { lines: [text] },
703
+ ...align === "left" ? { align: "start" } : align === "center" ? { align: "middle" } : {},
616
704
  priority: PRIORITY.endpoint,
617
705
  candidates: [{ slot: `${id}:fixed`, rect, penalty: 0 }]
618
706
  });
619
707
  }, rowText1 = (text, font, top, at, bandH = rowH) => {
620
708
  let box = measure(text, font);
621
709
  return { x: "left" in at ? at.left : at.right - box.width, y: top + (bandH - box.height) / 2, w: box.width, h: box.height };
622
- }, blockTop = (p) => tableTop + (compact ? panels.slice(0, p).reduce((sum, _entry, q) => sum + compactBlockH(q) + BLOCK_GAP, 0) : 0), rowsTopOf = (p) => blockTop(p) + headH + HEAD_GAP, rowsBottomOf = (p) => compact ? rowsTopOf(p) + rowsSpan : rowsBottom, place = (p, r) => {
710
+ }, blockTop = (p) => tableTop + (compact ? panels.slice(0, p).reduce((sum, _entry, q) => sum + compactBlockH(q) + BLOCK_GAP, 0) : 0), rowsTopOf = (p) => blockTop(p) + headH + headGap, totalLead = (p) => options.totalPosition === "top" && totalIn(p) ? (compact ? compactTotalH : rowH) + TOTAL_GAP : 0, rowsBottomOf = (p) => compact ? rowsTopOf(p) + totalLead(p) + rowsSpan : rowsBottom + totalLead(p), place = (p, r) => {
623
711
  if (interleaved) {
624
712
  if (r < rows.length) {
625
- let top3 = rowsTopOf(0) + rowTopIn(r);
713
+ let top3 = rowsTopOf(0) + totalLead(0) + rowTopIn(r);
626
714
  return { labelTop: top3, labelH: tight ? nameBoxH(r) : lineBox(cellFont), barTop: top3 + nameH(r) + p * barLineH };
627
715
  }
628
- let top2 = rowsBottomOf(0) + TOTAL_GAP;
716
+ let top2 = totalLead(0) > 0 ? rowsTopOf(0) : rowsBottomOf(0) + TOTAL_GAP;
629
717
  return { labelTop: top2, labelH: totalLineH, barTop: top2 + totalLineH + Math.max(0, totalBars.indexOf(p)) * barLineH };
630
718
  }
631
719
  if (!compact) {
632
- let top2 = r < rows.length ? rowsTop + r * rowH : totalTop;
720
+ let top2 = r < rows.length ? rowsTop + totalLead(0) + r * rowH : totalLead(0) > 0 ? rowsTop : totalTop;
633
721
  return { labelTop: top2, labelH: rowH, barTop: top2 };
634
722
  }
635
723
  if (r < rows.length) {
636
- let top2 = rowsTopOf(p) + unitTops[r];
724
+ let top2 = rowsTopOf(p) + totalLead(p) + unitTops[r];
637
725
  return { labelTop: top2, labelH: lineBox(cellFont), barTop: top2 + nameH(r) };
638
726
  }
639
- let top = rowsBottomOf(p) + TOTAL_GAP;
727
+ let top = totalLead(p) > 0 ? rowsTopOf(p) : rowsBottomOf(p) + TOTAL_GAP;
640
728
  return { labelTop: top, labelH: totalLineH, barTop: top + totalLineH };
641
729
  }, nameId = (p, id) => p === 0 ? id : `${id}:${panels[p].panel.id}`, blocks = compact && !interleaved ? panels.map((_entry, p) => p) : [0], headBottom = tableTop + headH;
642
- numberTracks.forEach((track) => {
643
- let id = `head:${track.column.id}`;
644
- rightAligned.add(id), label(
730
+ headsDrawn && numberTracks.forEach((track) => {
731
+ let id = `head:${track.column.id}`, override = overrides[track.column.id], align = override?.headAlign ?? override?.align ?? "right";
732
+ label(
645
733
  id,
646
734
  "axisTitle",
647
735
  { colId: track.column.id },
648
736
  track.head,
649
737
  fieldFont,
650
- { x: track.right - track.headFit.w, y: headBottom - track.headFit.h, w: track.headFit.w, h: track.headFit.h },
651
- track.headFit
738
+ { x: alignedIn(track.right - track.inner, track.right, track.headFit.w, align), y: headBottom - track.headFit.h, w: track.headFit.w, h: track.headFit.h },
739
+ track.headFit,
740
+ align
652
741
  );
653
- }), panelTracks.forEach((track, p) => {
742
+ }), headsDrawn && panelTracks.forEach((track, p) => {
654
743
  if (interleaved) {
655
744
  let top = cascade ? place(p, 0).barTop : tableTop + headH - keyH + panelTracks.slice(0, p).reduce((sum, other) => sum + other.headFit.h + 2, 0);
656
745
  if (cascade)
@@ -680,19 +769,20 @@ function layoutBarTableOnce(authored, options) {
680
769
  rightAligned.add(id2), label(id2, "axisTitle", { colId: `share:${track.panel.id}` }, shareHead, fieldFont, { x: track.shareRight - box2.width, y: tableTop + headH - shareLift - box2.height, w: box2.width, h: box2.height });
681
770
  return;
682
771
  }
683
- let headBottom2 = blockTop(p) + headH;
772
+ let headBottom2 = blockTop(p) + headH, headAlign = overrides[track.panel.id]?.headAlign ?? overrides[track.panel.id]?.align;
684
773
  if (label(
685
774
  `head:${track.panel.id}`,
686
775
  "axisTitle",
687
776
  { colId: track.panel.id },
688
777
  track.head,
689
778
  track.face,
690
- { x: track.origin, y: headBottom2 - track.headFit.h, w: track.headFit.w, h: track.headFit.h },
691
- track.headFit
779
+ { x: headAlign === void 0 ? track.origin : alignedIn(track.origin, track.origin + track.headW, track.headFit.w, headAlign), y: headBottom2 - track.headFit.h, w: track.headFit.w, h: track.headFit.h },
780
+ track.headFit,
781
+ headAlign
692
782
  ), isNumberAlone(track.head) && (requests[requests.length - 1].role = "axis"), !showShare) return;
693
783
  let id = `head:share:${track.panel.id}`, box = measure(shareHead, fieldFont);
694
784
  rightAligned.add(id), label(id, "axisTitle", { colId: `share:${track.panel.id}` }, shareHead, fieldFont, { x: track.shareRight - box.width, y: headBottom2 - box.height, w: box.width, h: box.height });
695
- }), growthTrack && (rightAligned.add("head:growth"), label(
785
+ }), growthTrack && headsDrawn && (rightAligned.add("head:growth"), label(
696
786
  "head:growth",
697
787
  "axisTitle",
698
788
  { colId: "growth" },
@@ -705,13 +795,15 @@ function layoutBarTableOnce(authored, options) {
705
795
  let box = measure(text, font), y = top + (rowH - box.height) / 2, candidates = [], pad = total ? TOTAL_PAD : VALUE_PAD, fitsInside = box.width + 2 * pad <= rect.w, inside = (penalty) => candidates.push({ slot: `${id}:inside`, rect: { x: rect.x + pad, y, w: box.width, h: box.height }, penalty, insideFill: paintColor(theme, fill), insidePaint: fill }), left = rect.x - VALUE_PAD - box.width, right = rect.x + rect.w + VALUE_PAD, at = (slot, x2, penalty) => candidates.push({ slot: `${id}:${slot}`, rect: { x: x2, y, w: box.width, h: box.height }, penalty }), atStart = rect.x <= lo + 0.5;
706
796
  total || atStart ? fitsInside && inside(0) : (left >= lo && at("left", left, 0), fitsInside && inside(1)), right + box.width <= hi && at("right", right, 2), left < lo && left >= lo - PANEL_GAP + 4 && at("leftGap", left, 3), at("rightOut", right, 4), candidates.splice(0, candidates.length, ...candidates.filter((candidate) => candidate.rect.x >= plot.x && candidate.rect.x + candidate.rect.w <= tableRight)), fonts.set(id, font), contrastInk.add(id), requests.push({ id, kind: "segment", owner, text, font, typeRole: "label", lines: [text], priority: PRIORITY.endpoint, candidates });
707
797
  }, head = headRule(theme);
708
- blocks.forEach((p) => line(nameId(p, "bartable-head-rule"), plot.x, rowsTopOf(p) - HEAD_GAP / 2, tableRight, rowsTopOf(p) - HEAD_GAP / 2, head.width, head.stroke, "tableHeaderRule"));
798
+ headsDrawn && blocks.forEach((p) => line(nameId(p, "bartable-head-rule"), plot.x, rowsTopOf(p) - HEAD_GAP / 2, tableRight, rowsTopOf(p) - HEAD_GAP / 2, head.width, head.stroke, "tableHeaderRule"));
709
799
  let shaded = new Set(!cascade && options.combinedShare ? options.combinedShare.rows : []);
710
- if (rows.forEach((row, r) => {
800
+ rows.forEach((row, r) => {
711
801
  if (!shaded.has(row.id)) return;
712
802
  let at = place(0, r), air = interleaved ? ROW_GAP / 2 : 0, top = at.labelTop - air, bottom = compact ? (r + 1 < rows.length ? place(0, r + 1).labelTop : rowsBottomOf(0) + 2 * air) - air : at.labelTop + rowH;
713
803
  under.push({ t: "rect", id: `combined-band:${row.id}`, rect: { x: plot.x, y: top, w: tableRight - plot.x, h: bottom - top }, fill: { token: "others", tint: 0.5 }, owner: {}, part: "combinedBand" });
714
- }), rows.forEach((row, r) => {
804
+ });
805
+ let nameAlign = compact ? void 0 : overrides.label?.align, nameX = (w) => nameAlign === void 0 ? plot.x : alignedIn(plot.x, plot.x + labelTrack - LABEL_GAP, w, nameAlign);
806
+ if (rows.forEach((row, r) => {
715
807
  let text = rowText[r];
716
808
  blocks.forEach((p) => {
717
809
  let at = place(p, r), ruleY = at.labelTop - (interleaved ? ROW_GAP / 2 : 0);
@@ -721,14 +813,15 @@ function layoutBarTableOnce(authored, options) {
721
813
  { categoryId: row.id },
722
814
  row.label,
723
815
  cellFont,
724
- { x: plot.x, y: compact ? at.labelTop : at.labelTop + (rowH - text.h) / 2, w: text.w, h: compact ? nameBoxH(r) : text.h },
725
- text
816
+ { x: nameX(text.w), y: compact ? at.labelTop : at.labelTop + (rowH - text.h) / 2, w: text.w, h: compact ? nameBoxH(r) : text.h },
817
+ text,
818
+ nameAlign
726
819
  );
727
820
  });
728
821
  let side = place(0, r);
729
822
  if (numberTracks.forEach((track) => {
730
- let id = `cell:${track.column.id}:${row.id}`, rect = rowText1(track.texts[r], valueFont, side.labelTop, { right: track.right }, side.labelH);
731
- rightAligned.add(id), label(id, "point", { categoryId: row.id, colId: track.column.id }, track.texts[r], cellFont, rect), marks.cells.push({ rowId: row.id, colId: track.column.id, kind: "column", value: track.column.values[r] ?? null, text: track.texts[r], rect });
823
+ let id = `cell:${track.column.id}:${row.id}`, align = overrides[track.column.id]?.align ?? "right", box = rowText1(track.texts[r], valueFont, side.labelTop, { right: track.right }, side.labelH), rect = { ...box, x: alignedIn(track.right - track.inner, track.right, box.w, align) };
824
+ label(id, "point", { categoryId: row.id, colId: track.column.id }, track.texts[r], cellFont, rect, void 0, align), marks.cells.push({ rowId: row.id, colId: track.column.id, kind: "column", value: track.column.values[r] ?? null, text: track.texts[r], rect });
732
825
  }), panelTracks.forEach((track, p) => {
733
826
  let stack = track.stacks[r], top = place(p, r).barTop;
734
827
  if (cascade) {
@@ -737,7 +830,7 @@ function layoutBarTableOnce(authored, options) {
737
830
  let value = stack.total, rect2 = { x: track.origin + c.starts[r] * track.scale, y: barY2, w: value * track.scale, h: cellBarH }, text2 = track.fmt(value);
738
831
  marks.segments.push({ rowId: row.id, panelId: track.panel.id, seriesId, value, text: text2, rect: rect2 });
739
832
  let fill = rowPaint(r, 0);
740
- if (rect2.w > 0 && (scene.push({ t: "rect", id: `segment:${track.panel.id}:${row.id}:${seriesId}`, rect: rect2, fill, owner: owner2, part: "segment", display: { value: text2 } }), occupied.claim(rect2, "mark", owner2, "segment")), barValue(`end:${track.panel.id}:${row.id}`, owner2, text2, cellFont, rect2, fill, top, track.origin, track.origin + track.trackW), marks.cells.push({ rowId: row.id, colId: track.panel.id, kind: "end", value, text: text2, rect: rect2 }), !showShare) return;
833
+ if (rect2.w > 0 && (scene.push({ t: "rect", id: `segment:${track.panel.id}:${row.id}:${seriesId}`, rect: rect2, fill, owner: owner2, part: "segment", display: { value: text2 } }), occupied.claim(rect2, "mark", owner2, "segment")), valuesPrinted && barValue(`end:${track.panel.id}:${row.id}`, owner2, text2, cellFont, rect2, fill, top, track.origin, track.origin + track.trackW), marks.cells.push({ rowId: row.id, colId: track.panel.id, kind: "end", value, text: text2, rect: rect2 }), !showShare) return;
741
834
  let id = `cell:share:${track.panel.id}:${row.id}`, shareRect = rowText1(c.shareTexts[r], cellFont, top, { right: track.shareRight });
742
835
  rightAligned.add(id), label(id, "point", { categoryId: row.id, colId: `share:${track.panel.id}` }, c.shareTexts[r], cellFont, shareRect), marks.cells.push({ rowId: row.id, colId: `share:${track.panel.id}`, kind: "share", value: c.shares[r], text: c.shareTexts[r], rect: shareRect });
743
836
  return;
@@ -790,7 +883,7 @@ function layoutBarTableOnce(authored, options) {
790
883
  }), occupied.claim(rect2, "mark", owner, "rangeExtension");
791
884
  }
792
885
  let rect = rowText1(endText, valueFont, top, { left: track.origin + (range2?.high ?? stack.positive) * track.scale + END_GAP });
793
- label(`end:${track.panel.id}:${row.id}`, "total", owner, endText, cellFont, rect);
886
+ (valuesPrinted || track.rowSums[r] === null) && label(`end:${track.panel.id}:${row.id}`, "total", owner, endText, cellFont, rect);
794
887
  let sum = track.rowSums[r] ?? null;
795
888
  marks.cells.push({ rowId: row.id, colId: track.panel.id, kind: "end", value: range2?.low ?? sum, ...range2 ? { range: range2 } : {}, text: endText, rect });
796
889
  }), growthTrack) {
@@ -802,7 +895,7 @@ function layoutBarTableOnce(authored, options) {
802
895
  let c = cascade.panels[p];
803
896
  if (!c.combined || !bracketRows) return;
804
897
  if (interleaved) {
805
- let top = rowsTopOf(0) + unitTops[comboAfter + 1], ruleStroke = { token: "inkMuted" };
898
+ let top = rowsTopOf(0) + totalLead(0) + unitTops[comboAfter + 1], ruleStroke = { token: "inkMuted" };
806
899
  p === 0 && ([top + 1, top + combinedH - ROW_GAP - 1].forEach((y, i) => scene.push({ t: "line", id: `combined-rule:${i === 0 ? "top" : "bottom"}`, x1: plot.x, y1: y, x2: commonShareRight, y2: y, stroke: ruleStroke, width: strokeToken(theme, "hair"), dash: dashToken(theme, "dotted"), owner: {}, part: "combinedRule" })), label("combined:label", "category", {}, comboRowLabel, totalFont, { x: plot.x, y: top + COMBINED_PAD, w: comboFit.w, h: comboFit.h }, comboFit));
807
900
  let lineTop = top + COMBINED_PAD + p * comboPitch, box2 = measure(c.combined.text, totalFont), rect2 = { x: track.shareRight - box2.width, y: lineTop + (lineBox(cellFont) - box2.height) / 2, w: box2.width, h: box2.height };
808
901
  rightAligned.add(`combined:${track.panel.id}`), label(`combined:${track.panel.id}`, "total", { colId: `share:${track.panel.id}` }, c.combined.text, totalFont, rect2), marks.cells.push({ colId: `share:${track.panel.id}`, kind: "share", combined: !0, value: c.combined.value, text: c.combined.text, rect: rect2 });
@@ -819,16 +912,19 @@ function layoutBarTableOnce(authored, options) {
819
912
  blocks.forEach((p) => {
820
913
  let at = place(p, rows.length);
821
914
  if (totalIn(p)) {
822
- let bandH = compact ? compactTotalH : Math.min(rowH, Math.max(ROW_PITCH, totalLineH + 4, cascade ? totalBarH + 6 : 0)), bottom = at.labelTop + (compact ? compactTotalH : (rowH + bandH) / 2), top = !compact && bandH < rowH ? bottom - bandH : rowsBottomOf(p) + TOTAL_GAP / 2;
823
- under.push({ t: "rect", id: nameId(p, "bartable-total-ground"), rect: { x: plot.x, y: top, w: tableRight - plot.x, h: bottom - top }, fill: ground, owner: {}, part: "tableTotalGround" }), line(nameId(p, "bartable-total-rule"), plot.x, top, tableRight, top, rule.width, rule.stroke, "tableTotalRule"), line(nameId(p, "bartable-total-rule-below"), plot.x, bottom, tableRight, bottom, rule.width, rule.stroke, "tableTotalRule");
915
+ let bandH = compact ? compactTotalH : Math.min(rowH, Math.max(ROW_PITCH, totalLineH + 4, cascade ? totalBarH + 6 : 0)), bottom = at.labelTop + (compact ? compactTotalH : (rowH + bandH) / 2), first = totalLead(p) > 0, top = !compact && bandH < rowH ? bottom - bandH : first ? at.labelTop - headGap / 2 : rowsBottomOf(p) + TOTAL_GAP / 2;
916
+ under.push({ t: "rect", id: nameId(p, "bartable-total-ground"), rect: { x: plot.x, y: top, w: tableRight - plot.x, h: bottom - top }, fill: ground, owner: {}, part: "tableTotalGround" }), first && headsDrawn && top === at.labelTop - headGap / 2 || line(nameId(p, "bartable-total-rule"), plot.x, top, tableRight, top, rule.width, rule.stroke, "tableTotalRule"), line(nameId(p, "bartable-total-rule-below"), plot.x, bottom, tableRight, bottom, rule.width, rule.stroke, "tableTotalRule");
917
+ }
918
+ if (totalIn(p)) {
919
+ let box = rowText1(totalLabel, totalFont, at.labelTop, { left: plot.x }, at.labelH);
920
+ label(nameId(p, "total:label"), "category", {}, totalLabel, totalFont, { ...box, x: nameX(box.w) }, void 0, nameAlign);
824
921
  }
825
- totalIn(p) && label(nameId(p, "total:label"), "category", {}, totalLabel, totalFont, rowText1(totalLabel, totalFont, at.labelTop, { left: plot.x }, at.labelH));
826
922
  });
827
923
  let side = place(0, rows.length), totalX = plot.x + width(totalLabel, totalFont) + CELL_AIR;
828
924
  if (numberTracks.forEach((track) => {
829
925
  if (track.totalText === void 0) return;
830
- let id = `total:${track.column.id}`, rect = rowText1(track.totalText, totalFont, side.labelTop, { right: track.right }, side.labelH);
831
- rightAligned.add(id), label(id, "grandTotal", { colId: track.column.id }, track.totalText, totalFont, rect), marks.cells.push({ colId: track.column.id, kind: "total", value: track.total, text: track.totalText, rect });
926
+ let id = `total:${track.column.id}`, align = overrides[track.column.id]?.align ?? "right", box = rowText1(track.totalText, totalFont, side.labelTop, { right: track.right }, side.labelH), rect = { ...box, x: alignedIn(track.right - track.inner, track.right, box.w, align) };
927
+ label(id, "grandTotal", { colId: track.column.id }, track.totalText, totalFont, rect, void 0, align), marks.cells.push({ colId: track.column.id, kind: "total", value: track.total, text: track.totalText, rect });
832
928
  }), panelTracks.forEach((track, p) => {
833
929
  if (track.totalText === void 0) return;
834
930
  let totalTop2 = interleaved && !cascade ? place(p, rows.length).labelTop : place(p, rows.length).barTop;
@@ -860,7 +956,19 @@ function layoutBarTableOnce(authored, options) {
860
956
  node.t !== "text" || !placed || !rightAligned.has(placed.id) || (node.x = placed.rect.x + placed.rect.w, node.align = "end");
861
957
  }
862
958
  pushAll(scene, texts), pushAll(warnings, solved.warnings);
863
- let segmentNames = series.map((s) => s.label ?? s.id).join(", "), minTracks = panels.map((entry, p) => cascade ? Math.max(MIN_TRACK, ...entry.head.split(/\s+/).map((word) => width(word, headFont)), totalWidths[p] + 2 * END_GAP) : Math.max(MIN_RUN, totalWidths[p] - endReserves[p])), tightest = sharedScale ? minTracks.reduce((best, min, p) => spans[p] > 0 && min / spans[p] > minTracks[best] / spans[best] ? p : best, 0) : -1, widest = spans.indexOf(maxOf(spans)), wideHint = () => tightest >= 0 && tightest !== widest && spans[tightest] > 0 ? `The '${panels[tightest].panel.label ?? panels[tightest].panel.id}' panel's total is ${formatAutomaticPercent(spans[tightest] / spans[widest] * 100, spans[tightest] / spans[widest] < 0.1 ? 1 : 0, !1, locale)} of the '${panels[widest].panel.label ?? panels[widest].panel.id}' panel's, and the panels share one scale, so its track needs ${Math.round(minTracks[tightest])}px. Set options.sharedScale to false to give each panel its own width.` : void 0, panelsW = sharedScale ? extrasSum + maxOf(minTracks.map((min, p) => spans[p] > 0 ? min / spans[p] : 0)) * spanSum : cascade ? Math.max(extrasSum + minTracks.reduce((sum, w) => sum + w, 0), maxOf(panels.map((_, p) => (extras[p] + minTracks[p]) * weightSum / weights[p]))) : panels.reduce((sum, _entry, p) => sum + PANEL_GAP + Math.max((panels.length > 1 ? PREFERRED_RUN : MIN_RUN) + endReserves[p], totalWidths[p]), 0), kMin = Math.max(0, maxOf(minTracks.map((min, p) => spans[p] > 0 ? min / spans[p] : 0))), compactPanelsW = maxOf(panels.map((_, p) => extras[p] - PANEL_GAP + (sharedScale ? spans[p] * kMin : minTracks[p]))), cascadeRest = growthW + shareColW + END_GAP + (sharedScale ? kMin * maxOf(spans) : maxOf(minTracks)), interleavedPanelsW = cascade ? Math.min(cascadeRest + periodNameFull, 1.5 * cascadeRest) : maxOf(panels.map((_, p) => MIN_RUN + endReserves[p])), minWidth = size.width - plot.w + (interleaved ? Math.max(interleavedPanelsW, sideW + LABEL_GAP + MIN_COMPACT_LABEL) : compact ? Math.max(compactPanelsW + (cascade ? sideW : 0), sideW + LABEL_GAP + MIN_COMPACT_LABEL) : fixedW + growthW + panelsW), sizeHint = minWidth > size.width ? wideHint() : void 0;
959
+ let segmentNames = series.map((s) => s.label ?? s.id).join(", "), tightest = sharedScale ? minTracks.reduce((best, min, p) => spans[p] > 0 && min / spans[p] > minTracks[best] / spans[best] ? p : best, 0) : -1, widest = spans.indexOf(maxOf(spans)), wideHint = () => tightest >= 0 && tightest !== widest && spans[tightest] > 0 ? `The '${panels[tightest].panel.label ?? panels[tightest].panel.id}' panel's total is ${formatAutomaticPercent(spans[tightest] / spans[widest] * 100, spans[tightest] / spans[widest] < 0.1 ? 1 : 0, !1, locale)} of the '${panels[widest].panel.label ?? panels[widest].panel.id}' panel's, and the panels share one scale, so its track needs ${Math.round(minTracks[tightest])}px. Set options.sharedScale to false to give each panel its own width.` : void 0, kMin = Math.max(0, maxOf(minTracks.map((min, p) => spans[p] > 0 ? min / spans[p] : 0))), compactPanelsW = maxOf(panels.map((_, p) => extras[p] - PANEL_GAP + (sharedScale ? spans[p] * kMin : minTracks[p]))), cascadeRest = growthW + shareColW + END_GAP + (sharedScale ? kMin * maxOf(spans) : maxOf(minTracks)), interleavedPanelsW = cascade ? Math.min(cascadeRest + periodNameFull, 1.5 * cascadeRest) : maxOf(panels.map((_, p) => MIN_RUN + endReserves[p])), minWidth = size.width - plot.w + (interleaved ? Math.max(interleavedPanelsW, minSideW + LABEL_GAP + MIN_COMPACT_LABEL) : compact ? Math.max(compactPanelsW + (cascade ? minSideW : 0), minSideW + LABEL_GAP + MIN_COMPACT_LABEL) : minFixedW + growthW + panelsW);
960
+ if (panelsFirst && numberColumns.length > 0 && minWidth > size.width) {
961
+ let { columnOrder: _order, ...defaultOrder } = options, drawn = layoutBarTable(authored, defaultOrder);
962
+ return { ...drawn, warnings: [...drawn.warnings, {
963
+ code: "option-ignored",
964
+ severity: "warn",
965
+ field: ["options", "columnOrder"],
966
+ message: "columnOrder has no effect at this width: the number heads need their room over the name track",
967
+ suggest: "Draw the chart wider, or remove columnOrder.",
968
+ fix: [{ op: "remove", path: "/options/columnOrder" }]
969
+ }] };
970
+ }
971
+ let sizeHint = minWidth > size.width ? wideHint() : void 0;
864
972
  return {
865
973
  type: "bartable",
866
974
  size,
@@ -888,7 +996,7 @@ function layoutBarTableOnce(authored, options) {
888
996
  a11y: {
889
997
  title: accessibleTitle(options.title, chartString(options, "bartableTitle", { v1: rows.length })),
890
998
  counts: [structureCount("rows", rows.length, void 0, options), structureCount("panels", panels.length, panels.length === 1 ? chartString(options, "barPanelOne") : chartString(options, "barPanels", { v1: panels.length }))],
891
- desc: chartString(options, "bartableDescStart", { v1: rows.length, v2: columns.length ? chartString(options, "tableColumnsClause", { v1: numberTracks.map((track) => track.name).join(", ") }) : "" }) + `${panels.length === 1 ? chartString(options, "barPanelOne") : chartString(options, "barPanels", { v1: panels.length })}, ${panels.map((entry) => entry.head).join("; ")}, ${sharedScale ? chartString(options, "sharedScale") : chartString(options, "ownScale")}. ${cascade ? chartString(options, "cascadeDesc", { v1: showShare ? chartString(options, "shareColumnClause") : "", v2: bracketRows ? chartString(options, "combinedShareBracket", { v1: bracketLabel }) : "", v3: growth ? chartString(options, "lastColumnClause", { v1: growth.head }) : "" }) : ""}` + chartString(options, "segmentsSentence", { v1: segmentNames, v2: cascade ? chartString(options, "cascadeValueLabels") : chartString(options, "barEndTotalRange") + (solved.placed.some((placed) => placed.id.startsWith("part:")) ? chartString(options, "barPartValues") : "") }) + `${ranged ? chartString(options, "rangeBarDesc") : ""}${showTotal ? chartString(options, "tableTotalRow", { v1: totalLabel }) : ""}`
999
+ desc: chartString(options, "bartableDescStart", { v1: rows.length, v2: columns.length ? chartString(options, "tableColumnsClause", { v1: numberTracks.map((track) => track.name).join(", ") }) : "" }) + `${panels.length === 1 ? chartString(options, "barPanelOne") : chartString(options, "barPanels", { v1: panels.length })}, ${panels.map((entry) => entry.head).join("; ")}, ${sharedScale ? chartString(options, "sharedScale") : chartString(options, "ownScale")}. ${cascade ? chartString(options, "cascadeDesc", { v1: showShare ? chartString(options, "shareColumnClause") : "", v2: bracketRows ? chartString(options, "combinedShareBracket", { v1: bracketLabel }) : "", v3: growth ? chartString(options, "lastColumnClause", { v1: growth.head }) : "" }) : ""}` + chartString(options, "segmentsSentence", { v1: segmentNames, v2: valuesPrinted ? cascade ? chartString(options, "cascadeValueLabels") : chartString(options, "barEndTotalRange") + (solved.placed.some((placed) => placed.id.startsWith("part:")) ? chartString(options, "barPartValues") : "") : "" }) + `${ranged ? chartString(options, "rangeBarDesc") : ""}${showTotal ? chartString(options, "tableTotalRow", { v1: totalLabel }) : ""}`
892
1000
  },
893
1001
  warnings,
894
1002
  debug: { occupied: occupied.snapshot(), decisions: solved.decisions }
@@ -903,6 +1011,11 @@ var bartableCore = {
903
1011
  summary: "Table rows with number columns and stacked bars. One panel when the rows compare one measure (impact in $bn, split into Run and Grow); several panels when the same split reads in different units side by side ($bn and % of EBITDA). Each panel has its own scale; the end label is the row total or an authored range, whose bar fills the segments to low and extends lightly to high. variant 'cascade': panels as periods of one total (category share by year).",
904
1012
  aliases: ["bar-table", "table-bars"],
905
1013
  layout: layoutBarTable,
1014
+ finishLayout: (layout) => yieldingWidths("bartable", layout, (data) => [...(data.columns ?? []).map((column) => column.id), ...data.panels.map((panel) => panel.id)], {
1015
+ head: (id) => `head:${id}`,
1016
+ // Only number cells read align. Nothing inside a panel does: its Total and values keep their place.
1017
+ cell: (label, id, data) => (data.columns ?? []).some((column) => column.id === id) && (label.startsWith(`cell:${id}:`) || label === `total:${id}`)
1018
+ }),
906
1019
  categoryLabels: calendarCategories,
907
1020
  defaults: { total: !0 },
908
1021
  annotationKinds: []