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,28 +1,43 @@
1
+ import {
2
+ cohortOptionRefusals
3
+ } from "./chunk-6JXBLQJ2.js";
1
4
  import {
2
5
  layoutHeatmap
3
- } from "./chunk-6MJUW5R5.js";
6
+ } from "./chunk-MKMMQDIY.js";
4
7
  import {
5
- liftOrFallback,
6
- missesSize,
7
- tightSpacingWarning
8
- } from "./chunk-6364WO5D.js";
8
+ hostedLayout
9
+ } from "./chunk-NZ7FX3AE.js";
10
+ import {
11
+ overrideIgnored,
12
+ widthFloored
13
+ } from "./chunk-YGZEG3JV.js";
9
14
  import {
10
15
  fitColumn,
11
16
  fittedLabel,
12
17
  gutterBudget,
13
18
  stepDownFont
14
- } from "./chunk-MPO5TVGF.js";
19
+ } from "./chunk-6ZDSEITW.js";
15
20
  import {
16
21
  chartTheme
17
- } from "./chunk-7DAH2E4T.js";
22
+ } from "./chunk-WFBN2HXR.js";
18
23
  import {
19
24
  AVERAGE_ROW_ID,
20
25
  deriveRetention,
21
26
  missingCohortRate
22
- } from "./chunk-JXBZIJCG.js";
27
+ } from "./chunk-EILNJQMN.js";
28
+ import {
29
+ fitsRoom,
30
+ widthsThatFit,
31
+ withoutWidths
32
+ } from "./chunk-AHIK2N72.js";
23
33
  import {
24
34
  structureCount
25
- } from "./chunk-XCROSJ2Z.js";
35
+ } from "./chunk-KW4JXWHO.js";
36
+ import {
37
+ liftOrFallback,
38
+ missesSize,
39
+ tightSpacingWarning
40
+ } from "./chunk-XWRI3N5O.js";
26
41
  import {
27
42
  fieldHeadFont,
28
43
  fieldHeadText,
@@ -30,10 +45,13 @@ import {
30
45
  headRule,
31
46
  totalGround,
32
47
  totalRule
33
- } from "./chunk-SPSGUFTI.js";
48
+ } from "./chunk-FB6X7QHA.js";
34
49
  import {
35
50
  tableRuleInk
36
51
  } from "./chunk-Z2MGTKDR.js";
52
+ import {
53
+ generatedIdWarnings
54
+ } from "./chunk-SXAZDIGM.js";
37
55
  import {
38
56
  SIZE_TOLERANCE,
39
57
  VERIFY_ADVICE,
@@ -42,14 +60,16 @@ import {
42
60
  heightOmitted,
43
61
  rowDrivenHeight,
44
62
  rowSizing,
63
+ sideKeyGivesWay,
45
64
  spareShare
46
- } from "./chunk-T2CYNDYU.js";
65
+ } from "./chunk-ETRAPN5G.js";
47
66
  import {
67
+ HOST_CLAIMS,
48
68
  PRIORITY,
49
69
  UNIT_LINE,
50
70
  authoredNotes,
51
- clamp,
52
- createOccupiedIndex,
71
+ claimId,
72
+ fitText,
53
73
  frameRendersUnit,
54
74
  frameTextOptions,
55
75
  labelCtx,
@@ -59,17 +79,18 @@ import {
59
79
  solveLabels,
60
80
  subtitleUnitClause,
61
81
  textCarriesCohortUnit,
62
- withAuthoredFootnotes
63
- } from "./chunk-4KQHKPB3.js";
82
+ withAuthoredFootnotes,
83
+ withUnprintedClaims
84
+ } from "./chunk-I5VDW2XZ.js";
64
85
  import {
65
86
  disclosureNote,
66
87
  keepShownNotes,
67
88
  staticFrame
68
- } from "./chunk-SMHZXHHD.js";
89
+ } from "./chunk-DZYTXZNS.js";
69
90
  import {
70
91
  AUTOMATIC_FORMAT,
71
92
  formatterFromExample
72
- } from "./chunk-FFJGC2DX.js";
93
+ } from "./chunk-Z6DUNKFU.js";
73
94
  import {
74
95
  autoDecimals,
75
96
  chartStrings,
@@ -84,6 +105,8 @@ import {
84
105
  } from "./chunk-MSYTF3DZ.js";
85
106
  import {
86
107
  canvasMargin,
108
+ clamp,
109
+ createOccupiedIndex,
87
110
  emphasisInk,
88
111
  emphasisWeight,
89
112
  paintColor,
@@ -94,22 +117,22 @@ import {
94
117
  strokeToken,
95
118
  tableEmphasis,
96
119
  textScaleOf
97
- } from "./chunk-HJRNBKIT.js";
120
+ } from "./chunk-TX5FSNAU.js";
98
121
  import {
99
122
  NormalizeError,
100
123
  TARGET_SIZE,
101
124
  accessibleTitle,
102
125
  resolveSize,
103
126
  resolveSubtitle
104
- } from "./chunk-YOOHNQ3L.js";
127
+ } from "./chunk-RJICOOB3.js";
128
+ import {
129
+ defaultMeasurer
130
+ } from "./chunk-UIHGGWES.js";
105
131
  import {
106
132
  maxOf,
107
133
  minOf,
108
134
  pushAll
109
135
  } from "./chunk-WYJEOMNY.js";
110
- import {
111
- defaultMeasurer
112
- } from "./chunk-SNQ7D5R7.js";
113
136
 
114
137
  // src/core/strings/cohort.ts
115
138
  var EN = {
@@ -151,6 +174,7 @@ var EN = {
151
174
  valueSupport: "{value} on {count} cohort{count||s}",
152
175
  descStart: "Cohort {measure} triangle, {cohorts} cohorts by {periods} periods since start. {formula} ",
153
176
  descReach: "Period 0 is 100% by construction. The oldest cohort reaches {first}; the newest reaches {last}. ",
177
+ descReachShown: "The oldest cohort reaches {first}; the newest reaches {last}. ",
154
178
  descBlank: "{count} cell{count||s} are blank because those cohorts have not reached that period. ",
155
179
  descAverage: "Weighted averages run from {first} to {last}. ",
156
180
  descBases: "Bases: {first} for the oldest cohort, {last} for the newest.",
@@ -173,9 +197,11 @@ var EN = {
173
197
  high: "High",
174
198
  exhibitTitle: "Cohort {measure} table: {count} cohorts",
175
199
  exhibitDesc: "{measure} table with a separate cohort-size column and periods {periods}. {formula} Empty cells are unobserved{anchor}.{missing}{total}",
200
+ exhibitDescNoSize: "{measure} table with periods {periods}. {formula} Empty cells are unobserved{anchor}.{missing}{total}",
176
201
  exhibitDescAnchor: "; period 0 is 100% by definition",
177
202
  exhibitDescMissing: " A dash marks a missing count, or a rate or total that needs it.",
178
- exhibitDescTotal: " The total row is weighted by {basis}."
203
+ exhibitDescTotal: " The total row is weighted by {basis}.",
204
+ excludedRunning: "Excluded: running period. Cohort {cohort}; last observation of each earlier cohort."
179
205
  }, DE = {
180
206
  measure: "Bindung",
181
207
  title: "Kohorten f\xFCr {measure}: {cohorts} Kohorten \xFCber {periods} Perioden",
@@ -215,6 +241,7 @@ var EN = {
215
241
  valueSupport: "{value} aus {count} {count|Kohorte|Kohorten}",
216
242
  descStart: "Kohorten-Dreieck f\xFCr {measure}, {cohorts} Kohorten nach {periods} Perioden seit Beginn. {formula} ",
217
243
  descReach: "Periode 0 ist definitionsgem\xE4\xDF 100%. Die \xE4lteste Kohorte erreicht {first}; die j\xFCngste erreicht {last}. ",
244
+ descReachShown: "Die \xE4lteste Kohorte erreicht {first}; die j\xFCngste erreicht {last}. ",
218
245
  descBlank: "{count} {count|Zelle ist|Zellen sind} leer, da diese Kohorten die Periode noch nicht erreicht haben. ",
219
246
  descAverage: "Gewichtete Mittelwerte reichen von {first} bis {last}. ",
220
247
  descBases: "Basis: {first} f\xFCr die \xE4lteste Kohorte, {last} f\xFCr die j\xFCngste.",
@@ -237,9 +264,11 @@ var EN = {
237
264
  high: "Hoch",
238
265
  exhibitTitle: "Kohortentabelle f\xFCr {measure}: {count} Kohorten",
239
266
  exhibitDesc: "Tabelle f\xFCr {measure} mit eigener Spalte f\xFCr die Kohortengr\xF6\xDFe und den Perioden {periods}. {formula} Leere Zellen sind unbeobachtet{anchor}.{missing}{total}",
267
+ exhibitDescNoSize: "Tabelle f\xFCr {measure} mit den Perioden {periods}. {formula} Leere Zellen sind unbeobachtet{anchor}.{missing}{total}",
240
268
  exhibitDescAnchor: "; Periode 0 ist per Definition 100%",
241
269
  exhibitDescMissing: " Ein Strich zeigt eine fehlende Anzahl oder eine Quote oder Summe, die diese Anzahl ben\xF6tigt.",
242
- exhibitDescTotal: " Die Summenzeile ist nach {basis} gewichtet."
270
+ exhibitDescTotal: " Die Summenzeile ist nach {basis} gewichtet.",
271
+ excludedRunning: "Ausgeschlossen: laufende Periode. Kohorte {cohort}; letzte Beobachtung jeder fr\xFCheren Kohorte."
243
272
  }, { chartString } = chartStrings(EN, DE);
244
273
 
245
274
  // src/core/charts/cohort/wording.ts
@@ -265,8 +294,23 @@ function cohortFormula(options, basis) {
265
294
  }
266
295
 
267
296
  // src/core/charts/cohort/exhibit.ts
268
- var LABEL_TRACK = 118, SIZE_TRACK = 96, ROW_H = 28, MAX_ROW_GROWTH = 0.8, STANDOFF_BELOW = 12, BASE_LINE_H = 16, HEADER_H = 28, LEGEND_H = 18, BIN_TINTS = [0.94, 0.8, 0.58, 0.3, 0], TIGHT_SPACING = /* @__PURE__ */ Symbol("cohortTightSpacing"), COHORT_LIFT = /* @__PURE__ */ Symbol("cohortZeroLift"), REGULAR_WIDTH = /* @__PURE__ */ Symbol("cohortRegularWidth"), STACKED_TEXT = /* @__PURE__ */ Symbol("cohortStackedText"), HIDDEN_PERIODS = /* @__PURE__ */ Symbol("cohortHiddenPeriods"), PROBE_HEIGHT = 4e3;
297
+ var LABEL_TRACK = 118, SIZE_TRACK = 96, ROW_H = 28, MAX_ROW_GROWTH = 0.8, STANDOFF_BELOW = 12, BASE_LINE_H = 16, HEADER_H = 28, LEGEND_H = 18, BIN_TINTS = [0.94, 0.8, 0.58, 0.3, 0], TIGHT_SPACING = /* @__PURE__ */ Symbol("cohortTightSpacing"), COHORT_LIFT = /* @__PURE__ */ Symbol("cohortZeroLift"), REGULAR_WIDTH = /* @__PURE__ */ Symbol("cohortRegularWidth"), STACKED_TEXT = /* @__PURE__ */ Symbol("cohortStackedText"), HIDDEN_PERIODS = /* @__PURE__ */ Symbol("cohortHiddenPeriods"), DEFAULT_HEAD_ROOM = /* @__PURE__ */ Symbol("cohortDefaultHeadRoom"), PROBE_HEIGHT = 4e3;
269
298
  function layoutCohortExhibit(sourceData, options) {
299
+ if (options.columnOverrides === void 0) return layoutLifted(sourceData, options);
300
+ let pinned = options[TARGET_SIZE]?.fixed.height ?? !heightOmitted(options.size), hidden = (geometry) => geometry.labels.filter((label) => label.hidden !== void 0 && label.hidden !== "redundant" || label.title !== void 0).length, withHeads = (next) => {
301
+ let asked = layoutLifted(sourceData, next);
302
+ if (next.columnOverrides?.label?.label === void 0 && next.columnOverrides?.size?.label === void 0) return asked;
303
+ let room = layoutLifted(sourceData, { ...next, [DEFAULT_HEAD_ROOM]: "wrap" });
304
+ return fitsRoom(asked, pinned) && hidden(asked) === 0 && (asked.derived.visiblePeriods?.length ?? 0) >= (room.derived.visiblePeriods?.length ?? 0) ? asked : fitsRoom(room, pinned) ? room : layoutLifted(sourceData, { ...next, [DEFAULT_HEAD_ROOM]: "oneLine" });
305
+ }, first = withHeads(options), fitted = widthsThatFit(options, (next) => next === options ? first : withHeads(next), pinned, { hidden });
306
+ if (!fitsRoom(fitted, pinned) && fitsRoom(first, pinned) && !first.labels.some((label) => label.hidden !== void 0 && label.hidden !== "redundant")) return first;
307
+ if (!fitted.labels.some((label) => label.hidden !== void 0 && label.hidden !== "redundant")) return fitted;
308
+ let plain = withHeads(withoutWidths(options)), printed = new Set(fitted.labels.filter((label) => label.hidden === void 0).map((label) => label.id));
309
+ if (!fitsRoom(plain, pinned) || !plain.labels.some((label) => label.hidden === void 0 && !printed.has(label.id))) return fitted;
310
+ let narrowed = Object.keys(options.columnOverrides).filter((id) => options.columnOverrides[id].width !== void 0);
311
+ return { ...plain, warnings: [...plain.warnings, ...narrowed.map((id) => widthFloored("cohort", id))] };
312
+ }
313
+ function layoutLifted(sourceData, options) {
270
314
  return options.format || options[COHORT_LIFT] !== void 0 ? layoutCohortExhibitOnce(sourceData, options) : liftOrFallback(
271
315
  (mode) => layoutCohortExhibitOnce(sourceData, mode === "full" ? options : { ...options, [COHORT_LIFT]: mode }),
272
316
  (lifted, plain) => costsWidth(lifted, plain, options)
@@ -283,21 +327,21 @@ function layoutCohortExhibitOnce(sourceData, options) {
283
327
  let warnings = [], data = options.excludeCurrentPeriod ? withoutCurrentPeriod(sourceData) : sourceData, basis = options.basis ?? "cohort", totals = options.total ?? "weighted", result = deriveRetention(data, { basis, averages: !1 });
284
328
  pushAll(warnings, result.warnings);
285
329
  let derived = result.derived, available = Array.from({ length: derived.periodCount }, (_, index) => index), visible = normalizeVisiblePeriods(options.visiblePeriods, available, warnings);
286
- options.designatedPeriod !== void 0 && options.variant === "pure" && !visible.includes(options.designatedPeriod) && warnings.push({
330
+ options.designatedPeriod !== void 0 && options.designatedPeriod !== !1 && options.variant === "pure" && !visible.includes(options.designatedPeriod) && warnings.push({
287
331
  code: "designated-period-out-of-range",
288
332
  severity: "warn",
289
333
  message: `designatedPeriod ${options.designatedPeriod} is not one of the ${visible.length} periods the exhibit shows; no column is emphasised`,
290
334
  suggest: "pick a zero-based period index the exhibit shows"
291
- });
335
+ }), pushAll(warnings, exhibitKeyWarnings(options, totals === "weighted"));
292
336
  let total = totals === "weighted" ? deriveExhibitTotal(derived) : void 0, outputDerived = {
293
337
  ...derived,
294
338
  visiblePeriods: visible,
295
339
  ...total ? { total } : {},
296
340
  ...options.excludeCurrentPeriod ? { excludedCurrentPeriod: !0 } : {}
297
- }, removed = sourceData.cohorts[sourceData.cohorts.length - 1], exclusion = options.excludeCurrentPeriod ? disclosureNote(/^de(?:-|$)/i.test(options.locale?.language ?? "") ? `Ausgeschlossen: laufende Periode. Kohorte ${removed.label ?? removed.id}; letzte Beobachtung jeder fr\xFCheren Kohorte.` : `Excluded: running period. Cohort ${removed.label ?? removed.id}; last observation of each earlier cohort.`) : void 0, full = buildExhibit(data, outputDerived, visible, options, [...warnings], exclusion), misses = missesSize(full, options), { width: missesWidth, height: missesHeight } = misses;
341
+ }, removed = sourceData.cohorts[sourceData.cohorts.length - 1], exclusion = options.excludeCurrentPeriod ? disclosureNote(chartString(options, "excludedRunning", { cohort: removed.label ?? removed.id })) : void 0, full = buildExhibit(data, outputDerived, visible, options, [...warnings], exclusion), misses = missesSize(full, options), { width: missesWidth, height: missesHeight } = misses;
298
342
  if (options.belowMinimum === "refuse" || !full.sizing || !(missesWidth || missesHeight)) return full;
299
- let tightWith = (names) => buildExhibit(data, outputDerived, visible, { ...options, [TIGHT_SPACING]: { columns: missesWidth, rows: missesHeight, names } }, [...warnings], exclusion), tight = tightWith(!1);
300
- if (missesWidth && tight.sizing && tight.size.width + 0.5 < tight.sizing.minWidth && tight.sizing.minWidth - tight.size.width <= 8) {
343
+ let rowsTight = missesHeight, tightWith = (names) => buildExhibit(data, outputDerived, visible, { ...options, [TIGHT_SPACING]: { columns: missesWidth, rows: rowsTight, names } }, [...warnings], exclusion), tight = tightWith(!1), keyed = options.columnOverrides !== void 0 || options.columnHeads === !1 || options.columnVisibility?.size === !1 || options.columnOrder !== void 0;
344
+ if (!rowsTight && keyed && missesSize(tight, options).height && (rowsTight = !0, tight = tightWith(!1)), missesWidth && tight.sizing && tight.size.width + 0.5 < tight.sizing.minWidth && tight.sizing.minWidth - tight.size.width <= 8) {
301
345
  let tighter = tightWith(!0);
302
346
  tighter.labels.some((label) => label.hidden === "collision") || (tight = tighter);
303
347
  }
@@ -307,16 +351,16 @@ function layoutCohortExhibitOnce(sourceData, options) {
307
351
  let hidden = visible.filter((period) => !periods.includes(period)), leftOut = hidden.filter((period) => period !== 0);
308
352
  return buildExhibit(data, { ...outputDerived, visiblePeriods: periods, ...leftOut.length > 0 ? { periodsLeftOut: leftOut } : {} }, periods, {
309
353
  ...options,
310
- [TIGHT_SPACING]: { columns: !0, rows: missesHeight, names: !0 },
354
+ [TIGHT_SPACING]: { columns: !0, rows: rowsTight, names: !0 },
311
355
  [STACKED_TEXT]: !0,
312
356
  ...widthOnly ? { size: { width: full.size.width, height: Math.max(full.size.height, PROBE_HEIGHT) } } : {},
313
357
  ...hidden.length > 0 ? { [HIDDEN_PERIODS]: hidden } : {}
314
358
  }, [...warnings], exclusion);
315
- }, draws = (geometry) => !hides(geometry) && !missesSize(geometry, options).width, columns = visible, anchorFull = visible[0] === 0 && visible.length > 1 && derived.cohorts.every((row) => row.observedPeriods === 0 || row.retention[0] === 1), fits = draws(at(visible, !0));
316
- if (!fits && anchorFull && (columns = visible.slice(1), fits = draws(at(columns, !0))), !fits && options.visiblePeriods === void 0) {
359
+ }, draws = (geometry) => !hides(geometry) && !missesSize(geometry, options).width, columns = visible, anchorFull = visible[0] === 0 && visible.length > 1 && derived.cohorts.every((row) => row.observedPeriods === 0 || row.retention[0] === 1), widthFree = Object.values(options.columnOverrides ?? {}).some((override) => override.width !== void 0) ? layoutCohortExhibitOnce(sourceData, withoutWidths(options)).derived.visiblePeriods : void 0, fits = widthFree !== void 0 || draws(at(visible, !0));
360
+ if (widthFree !== void 0 ? columns = widthFree : !fits && anchorFull && (columns = visible.slice(1), fits = draws(at(columns, !0))), !fits && options.visiblePeriods === void 0) {
317
361
  let candidates = columns, kept = (count) => {
318
362
  let first = candidates.slice(0, count), designated = options.variant === "pure" ? options.designatedPeriod : void 0;
319
- return designated === void 0 || first.includes(designated) || !candidates.includes(designated) ? first : [...first.slice(0, count - 1), designated];
363
+ return designated === void 0 || designated === !1 || first.includes(designated) || !candidates.includes(designated) ? first : [...first.slice(0, count - 1), designated];
320
364
  }, low = 0, high = candidates.length;
321
365
  for (; high - low > 1; ) {
322
366
  let count = Math.floor((low + high) / 2);
@@ -324,7 +368,7 @@ function layoutCohortExhibitOnce(sourceData, options) {
324
368
  }
325
369
  columns = kept(Math.max(1, low));
326
370
  }
327
- if (tight = at(columns), hides(tight) && (missesSize(tight, options).height || (tight.sizing?.naturalHeight ?? 0) > tight.size.height + SIZE_TOLERANCE)) return tight;
371
+ if (tight = at(columns), !rowsTight && keyed && missesSize(tight, options).height && (rowsTight = !0, tight = at(columns)), hides(tight) && (missesSize(tight, options).height || (tight.sizing?.naturalHeight ?? 0) > tight.size.height + SIZE_TOLERANCE)) return tight;
328
372
  }
329
373
  if (hides(tight)) return full;
330
374
  if (compactForm) {
@@ -461,24 +505,54 @@ function retentionFormatter(options, rows, compact) {
461
505
  return `${lift !== "none" && percent !== 0 && Number(roundHalfUp(Math.abs(percent), decimals2)) === 0 && (lift === "compact" || compact?.(text + suffix)) ? numberFormat(options.locale?.language ?? "en-US", { notation: "scientific", maximumSignificantDigits: 1 }).format(percent) : text}${suffix}`;
462
506
  };
463
507
  }
508
+ function exhibitKeyWarnings(options, hasTotal) {
509
+ let parts = exhibitParts(options), overrides = options.columnOverrides ?? {}, shownBlocks = [...parts.showSize ? ["size"] : [], "periods"];
510
+ return [
511
+ ...generatedIdWarnings("cohort", "columnVisibility", options.columnVisibility, ["label", "size"]),
512
+ ...generatedIdWarnings("cohort", "columnOverrides", options.columnOverrides, ["label", ...shownBlocks]),
513
+ ...generatedIdWarnings("cohort", "columnOrder", options.columnOrder, shownBlocks),
514
+ ...parts.showSize ? [] : [{
515
+ code: "cohort-size-hidden",
516
+ severity: "warn",
517
+ field: ["options", "columnVisibility", "size"],
518
+ message: "the size column is hidden, so no row states its cohort size \u2014 a cohort of 40 next to a cohort of 4,000 reads as an equal comparison",
519
+ suggest: "keep the size column, or state the cohort sizes in the subtitle or a note"
520
+ }],
521
+ ...overrides.periods?.label !== void 0 ? [overrideIgnored("periods", "label", "each period keeps its own head")] : [],
522
+ ...parts.heads ? [] : Object.keys(overrides).flatMap((id) => id === "size" && !parts.showSize || !["label", "size", "periods"].includes(id) ? [] : ["headAlign", "label"].filter((field) => overrides[id][field] !== void 0 && !(id === "periods" && field === "label")).map((field) => overrideIgnored(id, field, "columnHeads false draws no head"))),
523
+ ...options.totalPosition !== void 0 && !hasTotal ? [{
524
+ code: "option-ignored",
525
+ severity: "warn",
526
+ field: ["options", "totalPosition"],
527
+ message: "totalPosition has no effect: total is false, so no summary row is drawn",
528
+ suggest: "Remove totalPosition, or remove total: false.",
529
+ fix: [{ op: "remove", path: "/options/totalPosition" }]
530
+ }] : []
531
+ ];
532
+ }
533
+ function exhibitParts(options) {
534
+ let showSize = options.columnVisibility?.size !== !1, firstBlock = options.columnOrder?.find((id) => id === "periods" || id === "size" && showSize);
535
+ return { showSize, sizeAfterPeriods: showSize && firstBlock === "periods", heads: options.columnHeads !== !1 };
536
+ }
537
+ var TEXT_ALIGN = { left: "start", center: "middle", right: "end" }, TRACK_INSET = 4, anchorIn = (align, left, width) => align === "start" ? left + TRACK_INSET : align === "end" ? left + width - TRACK_INSET : left + width / 2, leftOf = (align, x, width) => align === "start" ? x : align === "middle" ? x - width / 2 : x - width, sizeHeadWords = (options) => options.columnOverrides?.size?.label ?? options.cohortSizeLabel ?? chartString(options, "cohortSize"), sizeHeadRoom = (options) => options[DEFAULT_HEAD_ROOM] ? options.cohortSizeLabel ?? chartString(options, "cohortSize") : sizeHeadWords(options);
464
538
  function exhibitTracks(rows, visible, data, options, font, measure, format = retentionFormatter(options, rows), stackFont = font, head) {
465
- let tight = options[TIGHT_SPACING]?.columns === !0, air = options[STACKED_TEXT] ? 6 : 4, width = (text, wrapFont = stackFont) => options[STACKED_TEXT] ? maxOf(twoLines(text, wrapFont, measure).map((line) => measure(line, wrapFont).width)) : measure(text, font).width, label = Math.max(tight ? 0 : LABEL_TRACK, maxOf(rows.map((row) => measure(row.label, font).width + (tight ? 4 : 12)))), sizeHead = Math.max(
466
- width(options.cohortSizeLabel ?? chartString(options, "cohortSize"), font),
539
+ let { showSize, heads } = exhibitParts(options), authored = options.columnOverrides, stopsFigures = options.figures === !1 && options.variant === "stepped", tight = options[TIGHT_SPACING]?.columns === !0, air = options[STACKED_TEXT] ? 6 : 4, width = (text, wrapFont = stackFont) => options[STACKED_TEXT] ? maxOf(twoLines(text, wrapFont, measure).map((line) => measure(line, wrapFont).width)) : measure(text, font).width, label = Math.max(tight ? 0 : LABEL_TRACK, maxOf(rows.map((row) => measure(row.label, font).width + (tight ? 4 : 12)))), sizeHead = heads ? Math.max(
540
+ width(sizeHeadRoom(options), font),
467
541
  head ? options[STACKED_TEXT] ? width(head.text, head.font) : measure(head.text, head.font).width : 0
468
- ), size = Math.max(
542
+ ) : 0, size = showSize ? authored?.size?.width ?? Math.max(
469
543
  tight ? 0 : SIZE_TRACK,
470
544
  sizeHead + (tight ? air : 18),
471
545
  maxOf(rows.map((row) => measure(formatAutomaticNumber(row.base, { locale: options.locale?.language, decimals: 0 }), font).width + (tight ? air : 18)))
472
- ), values = rows.flatMap((row) => visible.flatMap((period) => {
546
+ ) : 0, values = rows.flatMap((row) => visible.flatMap((period) => {
473
547
  let value = row.retention[period];
474
- return period >= row.observedPeriods || value === null || value === void 0 ? [] : [format(value, period)];
548
+ return period >= row.observedPeriods || value === null || value === void 0 || stopsFigures && period !== 0 ? [] : [format(value, period)];
475
549
  })), support = visible.flatMap((period) => {
476
550
  let observed = rows.filter((row) => row.kind !== "total" && period < row.observedPeriods), rates = observed.flatMap((row) => row.retention[period] == null ? [] : [row.retention[period]]);
477
551
  return [
478
552
  ...rows.some((row) => row.kind === "total") && options.basis !== "previous" ? [chartString(options, "baseValue", { value: formatAutomaticNumber(observed.reduce((sum, row) => sum + row.base, 0), { locale: options.locale?.language, decimals: 0 }) })] : [],
479
- ...options.variant === "stepped" && (options.formatScope ?? "column") === "column" ? rates.length ? [numberRange(format(minOf(rates), period), format(maxOf(rates), period))] : [] : []
553
+ ...heads && options.variant === "stepped" && (options.formatScope ?? "column") === "column" ? rates.length ? [numberRange(format(minOf(rates), period), format(maxOf(rates), period))] : [] : []
480
554
  ];
481
- }), month = Math.max(tight ? 0 : 56, maxOf([...visible.map((period) => periodName(data.periodLabel, period, options.locale?.language)), ...values].map((text) => measure(text, font).width + (tight ? air : 16))), maxOf(support.map((text) => width(text) + (tight ? air : 16))));
555
+ }), month = authored?.periods?.width ?? Math.max(tight ? 0 : 56, maxOf([...heads ? visible.map((period) => periodName(data.periodLabel, period, options.locale?.language)) : [], ...values].map((text) => measure(text, font).width + (tight ? air : 16))), maxOf(support.map((text) => width(text) + (tight ? air : 16))));
482
556
  return { label, size, month };
483
557
  }
484
558
  function pureEmphasis(options, period, value) {
@@ -516,7 +590,13 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
516
590
  chartTheme(options),
517
591
  options.palette,
518
592
  warnings
519
- ), size = resolveSize(options.size), tightRows = options[TIGHT_SPACING]?.rows === !0, rowAir = tightRows ? 6 : 8, rowH = Math.max(tightRows ? 0 : ROW_H, theme.type.label.size * (theme.type.label.lineHeight ?? 1.2) + rowAir), headerRowH = Math.max(tightRows ? 0 : HEADER_H, theme.type.axis.size * (theme.type.axis.lineHeight ?? 1.2) + rowAir), baseRowH = Math.max(BASE_LINE_H, theme.type.label.size * (theme.type.label.lineHeight ?? 1.2) + 4), measure = options.measure ?? defaultMeasurer, occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { top: options.exhibitLabel ? 38 : 20, right: 16, bottom: 14, left: canvasMargin(theme, size.width).left, ...options.margin }, methodFootnotes = exhibitNotes(data, derived, options, visible), authored = authoredNotes(options), ownFootnotes = authored.filter((note) => note !== exclusion), frameOptions = ownFootnotes.length === authored.length ? options : withAuthoredFootnotes(options, authored, ownFootnotes), rowData = exhibitRows(data, derived, options).map((row) => style === "stepped" && row.kind === "total" ? { ...row, label: chartString(options, "weightedAverage") } : row), totalId = rowData.find((row) => row.kind === "total")?.id, formatValue = retentionFormatter(options, rowData), measureName = cohortMeasure(options), unit = options.unit?.trim() || "%", carriesUnit = (text) => textCarriesCohortUnit(text, unit), subtitle = resolveSubtitle(options.subtitle), measureHasUnit = subtitle !== void 0 && carriesUnit(subtitle.measure), authoredUnit = options.unit?.trim(), subtitleUnit = measureHasUnit || options[UNIT_LINE] !== void 0 || subtitle !== void 0 && !!authoredUnit && frameRendersUnit({ subtitle, unit: authoredUnit }), footnotes = [...ownFootnotes, ...exclusion ? [exclusion] : [], ...methodFootnotes], ruleOverNotes = staticFrame.pinned && options.source !== void 0 && footnotes.length > 0, frame = solveFrame(
593
+ ), size = resolveSize(options.size), tightRows = options[TIGHT_SPACING]?.rows === !0, rowAir = tightRows ? 6 : 8, rowH = Math.max(tightRows ? 0 : ROW_H, theme.type.label.size * (theme.type.label.lineHeight ?? 1.2) + rowAir), headerRowH = Math.max(tightRows ? 0 : HEADER_H, theme.type.axis.size * (theme.type.axis.lineHeight ?? 1.2) + rowAir), baseRowH = Math.max(BASE_LINE_H, theme.type.label.size * (theme.type.label.lineHeight ?? 1.2) + 4), measure = options.measure ?? defaultMeasurer, occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { top: options.exhibitLabel ? 38 : 20, right: 16, bottom: 14, left: canvasMargin(theme, size.width).left, ...options.margin }, methodFootnotes = exhibitNotes(data, derived, options, visible), authored = authoredNotes(options), ownFootnotes = authored.filter((note) => note !== exclusion), frameOptions = ownFootnotes.length === authored.length ? options : withAuthoredFootnotes(options, authored, ownFootnotes), namedRows = exhibitRows(data, derived, options).map((row) => style === "stepped" && row.kind === "total" ? { ...row, label: chartString(options, "weightedAverage") } : row), totalOnTop = options.totalPosition === "top" && namedRows.at(-1)?.kind === "total", rowData = totalOnTop ? [namedRows.at(-1), ...namedRows.slice(0, -1)] : namedRows, { showSize, sizeAfterPeriods, heads } = exhibitParts(options), overrides = options.columnOverrides, alignOf = (id, fallback) => {
594
+ let align = overrides?.[id]?.align;
595
+ return align === void 0 ? fallback : TEXT_ALIGN[align];
596
+ }, headAlignOf = (id, fallback) => {
597
+ let align = overrides?.[id]?.headAlign;
598
+ return align === void 0 ? alignOf(id, fallback) : TEXT_ALIGN[align];
599
+ }, totalId = rowData.find((row) => row.kind === "total")?.id, formatValue = retentionFormatter(options, rowData), measureName = cohortMeasure(options), unit = options.unit?.trim() || "%", carriesUnit = (text) => textCarriesCohortUnit(text, unit), subtitle = resolveSubtitle(options.subtitle), measureHasUnit = subtitle !== void 0 && carriesUnit(subtitle.measure), authoredUnit = options.unit?.trim(), subtitleUnit = measureHasUnit || options[UNIT_LINE] !== void 0 || subtitle !== void 0 && !!authoredUnit && frameRendersUnit({ subtitle, unit: authoredUnit }), footnotes = [...ownFootnotes, ...exclusion ? [exclusion] : [], ...methodFootnotes], ruleOverNotes = staticFrame.pinned && options.source !== void 0 && footnotes.length > 0, frame = solveFrame(
520
600
  {
521
601
  size,
522
602
  margin,
@@ -527,39 +607,39 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
527
607
  measure
528
608
  },
529
609
  occupied
530
- ), nodes = [...frame.nodes], requests = [], fontById = /* @__PURE__ */ new Map(), labelInk = /* @__PURE__ */ new Map(), cellPaints = /* @__PURE__ */ new Map(), marks = { cells: [], sizeCells: [] }, drawnSubtitle = frame.nodes.flatMap((node) => node.t === "text" && node.id.startsWith("frame:subtitle") ? node.lines : []).join(" "), needsUnit = options.unitShown !== !0 && !carriesUnit(formatValue(1, 0)) && !(subtitleUnit && carriesUnit(drawnSubtitle)), unitCaption = carriesUnit(measureName) ? measureName : `${measureName}${subtitleUnitClause(unit, measureName)}`, totalGap = style === "stepped" && derived.total ? 6 : 0, trackFont = { family: theme.type.family, ...theme.type.label, weight: tableEmphasis(theme) }, headFont = fieldHeadFont(theme), sizeHead = { font: headFont, text: fieldHeadText(options.cohortSizeLabel ?? chartString(options, "cohortSize"), theme) }, stackFont = secondaryFont(theme), tracks = exhibitTracks(rowData, visible, data, options, trackFont, measure, formatValue, stackFont, sizeHead), regularWidth = tracks.label + tracks.size + visible.length * tracks.month, nameFont = { family: theme.type.family, ...theme.type.label }, rowNames = fitColumn(rowData.map((row) => {
531
- let font = row.kind === "total" ? { ...nameFont, weight: tableEmphasis(theme) } : nameFont, cap = Math.max(24, frame.plot.w * 0.3 - 12);
610
+ ), nodes = [...frame.nodes], requests = [], fontById = /* @__PURE__ */ new Map(), labelInk = /* @__PURE__ */ new Map(), cellPaints = /* @__PURE__ */ new Map(), marks = { cells: [], sizeCells: [] }, drawnSubtitle = frame.nodes.flatMap((node) => node.t === "text" && node.id.startsWith("frame:subtitle") ? node.lines : []).join(" "), needsUnit = options.unitShown !== !0 && !carriesUnit(formatValue(1, 0)) && !(subtitleUnit && carriesUnit(drawnSubtitle)), unitCaption = carriesUnit(measureName) ? measureName : `${measureName}${subtitleUnitClause(unit, measureName)}`, totalGap = style === "stepped" && derived.total ? 6 : 0, trackFont = { family: theme.type.family, ...theme.type.label, weight: tableEmphasis(theme) }, headFont = fieldHeadFont(theme), sizeHead = { font: headFont, text: fieldHeadText(sizeHeadRoom(options), theme) }, stackFont = secondaryFont(theme), tracks = exhibitTracks(rowData, visible, data, options, trackFont, measure, formatValue, stackFont, sizeHead), regularWidth = tracks.label + tracks.size + visible.length * tracks.month, nameFont = { family: theme.type.family, ...theme.type.label }, gap = options[TIGHT_SPACING]?.names === !0 ? 4 : 12, labelWidth = overrides?.label?.width, rowNames = fitColumn(rowData.map((row) => {
611
+ let font = row.kind === "total" ? { ...nameFont, weight: tableEmphasis(theme) } : nameFont, cap = labelWidth === void 0 ? Math.max(24, frame.plot.w * 0.3 - 12) : Math.max(1, labelWidth - gap);
532
612
  return {
533
613
  text: row.label,
534
614
  font,
535
615
  maxWidth: cap,
536
616
  maxLines: 2,
537
- wider: gutterBudget(cap, frame.plot.w, tracks.size + visible.length * tracks.month) - 12,
617
+ wider: labelWidth === void 0 ? gutterBudget(cap, frame.plot.w, tracks.size + visible.length * tracks.month) - 12 : cap,
538
618
  shrink: stepDownFont(theme, font, "label", options.target, textScaleOf(options)),
539
619
  target: options.target,
540
620
  textScale: textScaleOf(options),
541
621
  typeRole: "label"
542
622
  };
543
- }), measure), gap = options[TIGHT_SPACING]?.names === !0 ? 4 : 12;
544
- tracks.label = Math.max(measure(chartString(options, "cohort"), nameFont).width + gap, measure(fieldHeadText(chartString(options, "cohort"), theme), headFont).width + gap, maxOf(rowNames.map((name) => name.w + gap))), rowH = Math.max(rowH, maxOf(rowNames.map((name) => name.h + rowAir)));
623
+ }), measure), cornerWords = overrides?.label?.label, cornerText = fieldHeadText(cornerWords ?? chartString(options, "cohort"), theme), cornerShare = cornerWords === void 0 ? 1 / 0 : frame.plot.w * 0.45, cornerRoomWords = options[DEFAULT_HEAD_ROOM] ? chartString(options, "cohort") : cornerWords ?? chartString(options, "cohort"), cornerReserve = heads ? Math.max(measure(cornerRoomWords, nameFont).width + gap, measure(fieldHeadText(cornerRoomWords, theme), headFont).width + gap) : 0;
624
+ tracks.label = labelWidth ?? Math.max(Math.min(cornerReserve, cornerShare), maxOf(rowNames.map((name) => name.w + gap))), rowH = Math.max(rowH, maxOf(rowNames.map((name) => name.h + rowAir)));
545
625
  let fullWidth = tracks.label + tracks.size + visible.length * tracks.month;
546
626
  if (style === "pure" && !options.format && frame.plot.w < fullWidth) {
547
627
  let rateWidth = tracks.month * Math.min(1, frame.plot.w / fullWidth) - 2;
548
628
  formatValue = retentionFormatter(options, rowData, (text) => measure(text, trackFont).width > rateWidth), tracks = { ...exhibitTracks(rowData, visible, data, options, trackFont, measure, formatValue, stackFont, sizeHead), label: tracks.label };
549
629
  }
550
- let showSteppedLegend = style === "stepped" && options.legend !== "none", steps = options.steps ?? DEFAULT_STEPS, caption = options.strings?.cohortMeasure ? `${measureName}${options.unit && !carriesUnit(measureName) ? ` (${options.unit})` : ""}` : options.unit ?? measureName, keyFont = { family: theme.type.family, ...theme.type.axis }, keyFits = (text) => measure(text, keyFont).width + 10 + steppedKeyText(scope, caption, steps, options.locale?.language).labels.reduce((width, label) => width + 16 + (label ? 4 + measure(label, keyFont).width : 0), 0) <= frame.plot.w, keyUnit = !needsUnit || !showSteppedLegend ? void 0 : scope === "column" ? chartString(options, "withinColumnUnit", { unit: unitCaption }) : carriesUnit(caption) ? void 0 : unitCaption, keyCaption = keyUnit !== void 0 && keyFits(keyUnit) ? keyUnit : void 0, keyFlow = showSteppedLegend ? steppedKeyFlow(steppedKeyText(scope, caption, steps, options.locale?.language, keyCaption), keyFont, measure, size.width - frame.plot.x) : void 0, legendOffset = keyFlow ? LEGEND_H + keyFlow.pitch * (keyFlow.rows - 1) + 10 : 0, tableTop = frame.plot.y + legendOffset, desiredWidth = tracks.label + tracks.size + visible.length * tracks.month, scale = Math.min(1, frame.plot.w / desiredWidth), labelW = tracks.label * scale, sizeW = tracks.size * scale, heightFill = options.heightFill !== "none", monthW = style === "stepped" && !heightFill ? tracks.month * scale : (frame.plot.w - labelW - sizeW) / visible.length, tableLeft = frame.plot.x, sizeLeft = tableLeft + labelW, monthLeft = sizeLeft + sizeW, tableRight = monthLeft + visible.length * monthW, averageBases = derived.total && derived.basis !== "previous" ? visible.map((period) => derived.cohorts.reduce((sum, row) => sum + (period < row.observedPeriods ? row.base : 0), 0)) : void 0, columnRanges = scope === "column" ? visible.map((period) => {
630
+ let showSteppedLegend = style === "stepped" && options.legend !== "none", steps = options.steps ?? DEFAULT_STEPS, caption = options.strings?.cohortMeasure ? `${measureName}${options.unit && !carriesUnit(measureName) ? ` (${options.unit})` : ""}` : options.unit ?? measureName, keyFont = { family: theme.type.family, ...theme.type.axis }, keyFits = (text) => measure(text, keyFont).width + 10 + steppedKeyText(scope, caption, steps, options.locale?.language).labels.reduce((width, label) => width + 16 + (label ? 4 + measure(label, keyFont).width : 0), 0) <= frame.plot.w, keyUnit = !needsUnit || !showSteppedLegend ? void 0 : scope === "column" ? chartString(options, "withinColumnUnit", { unit: unitCaption }) : carriesUnit(caption) ? void 0 : unitCaption, keyCaption = keyUnit !== void 0 && keyFits(keyUnit) ? keyUnit : void 0, keyFlow = showSteppedLegend ? steppedKeyFlow(steppedKeyText(scope, caption, steps, options.locale?.language, keyCaption), keyFont, measure, size.width - frame.plot.x) : void 0, legendOffset = keyFlow ? LEGEND_H + keyFlow.pitch * (keyFlow.rows - 1) + 10 : 0, tableTop = frame.plot.y + legendOffset, desiredWidth = tracks.label + tracks.size + visible.length * tracks.month, scale = Math.min(1, frame.plot.w / desiredWidth), labelW = tracks.label * scale, sizeW = tracks.size * scale, heightFill = options.heightFill !== "none", monthW = overrides?.periods?.width !== void 0 || style === "stepped" && !heightFill ? tracks.month * scale : (frame.plot.w - labelW - sizeW) / visible.length, tableLeft = frame.plot.x, sizeLeft = tableLeft + labelW + (sizeAfterPeriods ? visible.length * monthW : 0), monthLeft = tableLeft + labelW + (sizeAfterPeriods ? 0 : sizeW), tableRight = sizeAfterPeriods ? sizeLeft + sizeW : monthLeft + visible.length * monthW, averageBases = derived.total && derived.basis !== "previous" ? visible.map((period) => derived.cohorts.reduce((sum, row) => sum + (period < row.observedPeriods ? row.base : 0), 0)) : void 0, columnRanges = scope === "column" && heads ? visible.map((period) => {
551
631
  let values = derived.cohorts.flatMap((row) => {
552
632
  let value = period < row.observedPeriods ? row.retention[period] : null;
553
633
  return value == null ? [] : [value];
554
634
  });
555
635
  return period === 0 || values.length === 0 ? void 0 : { min: minOf(values), max: maxOf(values) };
556
- }) : void 0, axisFont = options[STACKED_TEXT] ? stackFont : { family: theme.type.family, ...theme.type.axis }, baseFont = options[STACKED_TEXT] ? stackFont : { family: theme.type.family, ...theme.type.label }, lineH = (font) => font.size * (font.lineHeight ?? 1.2), wrapped = (text, font, room) => options[STACKED_TEXT] && measure(text, font).width > room ? twoLines(text, font, measure) : [text], sizeHeader = sizeHead.text, sizeHeaderFont = headFont, sizeHeaderLines = wrapped(sizeHeader, sizeHeaderFont, sizeW - 4), rangeLines = columnRanges?.map((range, column) => {
636
+ }) : void 0, axisFont = options[STACKED_TEXT] ? stackFont : { family: theme.type.family, ...theme.type.axis }, baseFont = options[STACKED_TEXT] ? stackFont : { family: theme.type.family, ...theme.type.label }, lineH = (font) => font.size * (font.lineHeight ?? 1.2), wrapped = (text, font, room) => options[STACKED_TEXT] && measure(text, font).width > room ? twoLines(text, font, measure) : [text], sizeHeader = fieldHeadText(sizeHeadWords(options), theme), sizeHeaderFont = headFont, headFit = (text, room) => text !== "" && measure(text, headFont).width > room ? fitText(text, headFont, Math.max(1, room), tightRows || options[DEFAULT_HEAD_ROOM] === "oneLine" ? 1 : 2, measure, { target: options.target, typeRole: "label" }) : void 0, sizeFit = overrides?.size?.label === void 0 ? void 0 : headFit(sizeHeader, sizeW - 4), sizeHeaderLines = showSize && heads ? sizeFit?.lines ?? wrapped(sizeHeader, sizeHeaderFont, sizeW - 4) : [], sizeEnd = sizeLeft + sizeW - (options[STACKED_TEXT] || sizeAfterPeriods || overrides?.size?.width !== void 0 ? 4 : 18) * scale, sizeAt = (align) => align === "end" ? sizeEnd : anchorIn(align, sizeLeft, sizeW), sizeHeadAlign = headAlignOf("size", "end"), sizeCellAlign = alignOf("size", "end"), sizeHeadWidth = maxOf(sizeHeaderLines.map((line) => measure(line, headFont).width)), cornerRoom = showSize && !sizeAfterPeriods ? leftOf(sizeHeadAlign, sizeAt(sizeHeadAlign), sizeHeadWidth) - 8 - tableLeft : labelW - 8, cornerFit = cornerWords === void 0 || !heads ? void 0 : headFit(cornerText, Math.min(labelW - 4, cornerRoom)), cornerLines = cornerFit?.lines ?? (cornerWords === void 0 ? [] : [cornerText]), rangeLines = columnRanges?.map((range, column) => {
557
637
  if (!range) return [];
558
638
  let [low, high] = [formatValue(range.min, visible[column]), formatValue(range.max, visible[column])];
559
639
  return wrapped(low === high ? low : numberRange(low, high), axisFont, monthW - 4);
560
640
  }), baseLines = averageBases?.map((base) => wrapped(chartString(options, "baseValue", { value: formatAutomaticNumber(base, { locale: options.locale?.language, decimals: 0 }) }), baseFont, monthW - 4)), extraLines = (blocks) => Math.max(0, maxOf((blocks ?? []).map((lines) => lines.length - 1)));
561
- headerRowH = Math.max(headerRowH, sizeHeaderLines.length * lineH(sizeHeaderFont) + rowAir);
562
- let baseLineH = averageBases ? baseRowH + extraLines(baseLines) * lineH(baseFont) : 0, headerH = headerRowH + (columnRanges ? baseRowH + extraLines(rangeLines) * lineH(axisFont) : 0), naturalRowH = rowH, naturalBottom = tableTop + headerH + rowData.length * rowH + totalGap + baseLineH, tableBottom = naturalBottom;
641
+ headerRowH = Math.max(headerRowH, Math.max(1, sizeHeaderLines.length, cornerLines.length) * lineH(sizeHeaderFont) + rowAir);
642
+ let baseLineH = averageBases ? baseRowH + extraLines(baseLines) * lineH(baseFont) : 0, headerH = heads ? headerRowH + (columnRanges ? baseRowH + extraLines(rangeLines) * lineH(axisFont) : 0) : 0, naturalRowH = rowH, headBand = columnRanges && (!showSize || sizeAfterPeriods || overrides !== void 0) ? Math.min(naturalRowH, headerRowH) : naturalRowH, naturalBottom = tableTop + headerH + rowData.length * rowH + totalGap + baseLineH, tableBottom = naturalBottom;
563
643
  {
564
644
  let grow = rowDrivenHeight({
565
645
  options,
@@ -574,15 +654,15 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
574
654
  let extra = spareShare(frame.plot.y + frame.plot.h - naturalBottom - 6 - STANDOFF_BELOW, rowData.length, naturalRowH * MAX_ROW_GROWTH, !0);
575
655
  rowH += extra, tableBottom += rowData.length * extra;
576
656
  }
577
- let headerFont = { family: theme.type.family, ...theme.type.axis }, cellFont = { family: theme.type.family, ...theme.type.label }, strongFont = { ...cellFont, weight: emphasisWeight(theme) }, totalFont = { ...cellFont, weight: tableEmphasis(theme) }, totalPaint = totalGround(theme, options.palette), mutedInk = { token: "inkMuted" }, background = { token: "background" }, designated = options.designatedPeriod ?? 3, binByPeriod = columnBins(derived, visible, scope, steps, totalId), rules = [], addLine = (id, x1, y1, x2, y2, width, stroke, part) => {
657
+ let headerFont = { family: theme.type.family, ...theme.type.axis }, cellFont = { family: theme.type.family, ...theme.type.label }, strongFont = { ...cellFont, weight: emphasisWeight(theme) }, totalFont = { ...cellFont, weight: tableEmphasis(theme) }, totalPaint = totalGround(theme, options.palette), mutedInk = { token: "inkMuted" }, background = { token: "background" }, designated = options.designatedPeriod === !1 ? void 0 : options.designatedPeriod ?? 3, binByPeriod = columnBins(derived, visible, scope, steps, totalId), rules = [], addLine = (id, x1, y1, x2, y2, width, stroke, part) => {
578
658
  rules.push({ t: "line", id, x1, y1, x2, y2, stroke, width, owner: {}, part }), occupied.claim({ x: Math.min(x1, x2), y: Math.min(y1, y2), w: Math.max(1, Math.abs(x2 - x1)), h: Math.max(1, Math.abs(y2 - y1)) }, "axis", {}, part);
579
659
  }, head = headRule(theme);
580
- addLine("cohort-header-bottom", tableLeft, tableTop + headerH, tableRight, tableTop + headerH, head.width, head.stroke, "tableRule");
581
- let addLabel = (id, text, rect, font, ink, owner = {}, kind = "point", insidePaint, fitted, align, claimId) => {
660
+ heads && addLine("cohort-header-bottom", tableLeft, tableTop + headerH, tableRight, tableTop + headerH, head.width, head.stroke, "tableRule");
661
+ let addLabel = (id, text, rect, font, ink, owner = {}, kind = "point", insidePaint, fitted, align, claimId2) => {
582
662
  requests.push({
583
663
  id,
584
664
  kind,
585
- ...claimId ? { claimId } : {},
665
+ ...claimId2 ? { claimIds: [claimId2] } : {},
586
666
  typeRole: kind === "axisTitle" || id.startsWith("cohort-header-range:") ? "axis" : "label",
587
667
  owner,
588
668
  text,
@@ -603,8 +683,8 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
603
683
  w: measured.width,
604
684
  h: measured.height
605
685
  };
606
- }, addBlock = (id, lines, font, x, y, h, align, ink, owner, kind) => {
607
- let w = maxOf(lines.map((line) => measure(line, font).width)), blockH = lines.length === 1 ? measure(lines[0], font).height : lines.length * lineH(font), rect = { x: align === "middle" ? x - w / 2 : x - w, y: y + (h - blockH) / 2, w, h: blockH };
686
+ }, addBlock = (id, lines, font, x, y, h, align, ink, owner, kind, title) => {
687
+ let w = maxOf(lines.map((line) => measure(line, font).width)), blockH = lines.length === 1 ? measure(lines[0], font).height : lines.length * lineH(font), rect = { x: leftOf(align, x, w), y: y + (h - blockH) / 2, w, h: blockH };
608
688
  addLabel(
609
689
  id,
610
690
  lines.join(" "),
@@ -614,67 +694,108 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
614
694
  owner,
615
695
  kind,
616
696
  void 0,
617
- { lines, w, h: blockH, font, ...font === stackFont ? { typeRole: "secondary" } : {} },
618
- lines.length === 1 ? void 0 : align
619
- );
620
- }, keyShowsUnit = showSteppedLegend && (keyCaption !== void 0 || scope === "classic" && carriesUnit(caption)), sizeEnd = sizeLeft + sizeW - (options[STACKED_TEXT] ? 4 : 18) * scale, cornerRoom = sizeEnd - maxOf(sizeHeaderLines.map((line) => measure(line, headFont).width)) - 8 - tableLeft, cornerTexts = [unitCaption, subtitleUnitClause(unit, "").trim(), unit], unitCorner = needsUnit && !keyShowsUnit ? cornerTexts.find((text) => text !== "" && measure(text, headerFont).width <= cornerRoom) : void 0, corner = unitCorner ?? fieldHeadText(chartString(options, "cohort"), theme), cornerFont = unitCorner === void 0 ? headFont : headerFont, headPaint = headInk();
621
- if (addLabel("cohort-header-label", corner, measuredRect(corner, cornerFont, tableLeft, tableTop, "start", naturalRowH), cornerFont, headPaint, {}, "axisTitle"), sizeHeaderLines.length > 1 ? addBlock("cohort-header-size", sizeHeaderLines, headFont, sizeEnd, tableTop, headerRowH, "end", headPaint, {}, "axisTitle") : addLabel("cohort-header-size", sizeHeader, measuredRect(sizeHeader, headFont, sizeEnd, tableTop, "end", naturalRowH), headFont, headPaint, {}, "axisTitle"), visible.forEach((period, column) => {
622
- let text = periodName(data.periodLabel, period, options.locale?.language), ink = style === "pure" && period === designated ? emphasisInk(theme) : headPaint;
623
- addLabel(
624
- `cohort-header-period:${period}`,
625
- text,
626
- measuredRect(text, headerFont, monthLeft + (column + 0.5) * monthW, tableTop, "middle", naturalRowH),
627
- headerFont,
628
- ink,
629
- {},
630
- "axisTitle"
697
+ { lines, w, h: blockH, font, ...title === void 0 ? {} : { title }, ...font === stackFont ? { typeRole: "secondary" } : {} },
698
+ lines.length === 1 || align === "start" ? void 0 : align
631
699
  );
632
- let range = columnRanges?.[column];
633
- if (range && options[STACKED_TEXT])
634
- addBlock(`cohort-header-range:${period}`, rangeLines[column], axisFont, monthLeft + (column + 0.5) * monthW, tableTop + headerRowH - 4, headerH - headerRowH, "middle", mutedInk, { categoryId: `t${period}` }, "point");
635
- else if (range) {
636
- let rangeFont = { family: theme.type.family, ...theme.type.axis }, [low, high] = [formatValue(range.min, period), formatValue(range.max, period)], rangeText = low === high ? low : numberRange(low, high), measured = measure(rangeText, rangeFont);
700
+ }, keyShowsUnit = showSteppedLegend && (keyCaption !== void 0 || scope === "classic" && carriesUnit(caption)), cornerTexts = [unitCaption, subtitleUnitClause(unit, "").trim(), unit], headPaint = headInk(), periodHeadAlign = headAlignOf("periods", "middle"), periodCellAlign = alignOf("periods", "middle"), columnAt = (column, align) => align === "middle" ? monthLeft + (column + 0.5) * monthW : anchorIn(align, monthLeft + column * monthW, monthW), unitInCorner = needsUnit && !keyShowsUnit;
701
+ if (cornerWords !== void 0 && heads && unitInCorner && !carriesUnit(cornerWords) && warnings.push({
702
+ code: "cohort-unit-unprinted",
703
+ severity: "warn",
704
+ field: ["options", "columnOverrides", "label", "label"],
705
+ message: `the corner head was the only place that named the unit (${unit}), and columnOverrides.label.label does not; the rates now print with no unit`,
706
+ suggest: "name the unit in that head, or set unit with a subtitle measure"
707
+ }), !heads) {
708
+ let lost = [
709
+ `the periods (${periodRuns(data.periodLabel, visible, options.locale?.language)})`,
710
+ ...unitInCorner ? [`the unit (${unit})`] : [],
711
+ ...scope === "column" && showSteppedLegend ? ["the numbers behind the key's Low and High"] : []
712
+ ];
713
+ warnings.push({
714
+ code: "cohort-heads-hidden",
715
+ severity: "warn",
716
+ field: ["options", "columnHeads"],
717
+ message: `columnHeads false leaves ${lost.join(", ")} printed nowhere, so the reader cannot tell the columns apart`,
718
+ suggest: "name them in the title, the subtitle or a note, or keep the heads"
719
+ });
720
+ }
721
+ if (heads) {
722
+ if (cornerWords !== "") {
723
+ let cornerAlign = headAlignOf("label", "start"), cornerSpan = Math.min(labelW - gap, cornerRoom), placeCorner = (width) => cornerAlign === "start" || width <= cornerSpan ? { x: cornerAlign === "start" ? tableLeft : cornerAlign === "end" ? tableLeft + cornerSpan : tableLeft + cornerSpan / 2, align: cornerAlign } : (overrides?.label?.headAlign !== void 0 && overrides.label.headAlign !== "left" && warnings.push(overrideIgnored("label", "headAlign", "the head fills its track, so it has no room to align")), { x: tableLeft, align: "start" });
724
+ if (cornerFit) {
725
+ let { x, align } = placeCorner(Math.max(...cornerFit.lines.map((line) => measure(line, headFont).width)));
726
+ addBlock("cohort-header-label", cornerFit.lines, headFont, x, tableTop, headerRowH, align, headPaint, {}, "axisTitle", cornerFit.title);
727
+ } else if (cornerWords !== void 0) {
728
+ let { x, align } = placeCorner(measure(cornerText, headFont).width);
729
+ addLabel("cohort-header-label", cornerText, measuredRect(cornerText, headFont, x, tableTop, align, naturalRowH), headFont, headPaint, {}, "axisTitle");
730
+ } else {
731
+ let unitCorner = unitInCorner ? cornerTexts.find((text) => text !== "" && measure(text, headerFont).width <= cornerRoom) : void 0, corner = unitCorner ?? cornerText, cornerFont = unitCorner === void 0 ? headFont : headerFont, { x, align } = placeCorner(measure(corner, cornerFont).width);
732
+ addLabel("cohort-header-label", corner, measuredRect(corner, cornerFont, x, tableTop, align, naturalRowH), cornerFont, headPaint, {}, "axisTitle");
733
+ }
734
+ }
735
+ showSize && sizeHeader !== "" && (sizeHeaderLines.length > 1 || sizeFit ? addBlock("cohort-header-size", sizeHeaderLines, headFont, sizeAt(sizeHeadAlign), tableTop, headerRowH, sizeHeadAlign, headPaint, {}, "axisTitle", sizeFit?.title) : addLabel("cohort-header-size", sizeHeader, measuredRect(sizeHeader, headFont, sizeAt(sizeHeadAlign), tableTop, sizeHeadAlign, naturalRowH), headFont, headPaint, {}, "axisTitle")), visible.forEach((period, column) => {
736
+ let text = periodName(data.periodLabel, period, options.locale?.language), ink = style === "pure" && period === designated ? emphasisInk(theme) : headPaint;
637
737
  addLabel(
638
- `cohort-header-range:${period}`,
639
- rangeText,
640
- { x: monthLeft + (column + 0.5) * monthW - measured.width / 2, y: tableTop + headerRowH - 4 + (baseRowH - measured.height) / 2, w: measured.width, h: measured.height },
641
- rangeFont,
642
- mutedInk,
643
- { categoryId: `t${period}` },
644
- "point"
738
+ `cohort-header-period:${period}`,
739
+ text,
740
+ measuredRect(text, headerFont, columnAt(column, periodHeadAlign), tableTop, periodHeadAlign, headBand),
741
+ headerFont,
742
+ ink,
743
+ {},
744
+ "axisTitle"
645
745
  );
646
- }
647
- }), rowData.forEach((row, rowIndex) => {
648
- let y = tableTop + headerH + rowIndex * rowH + (row.kind === "total" ? totalGap : 0), rowFont = row.kind === "total" ? totalFont : cellFont;
649
- if (style === "pure" && rowIndex > 0 && row.kind !== "total" && addLine(`cohort-row-rule:${row.id}`, tableLeft, y, tableRight, y, theme.table?.ruleWidths?.row ?? strokeToken(theme, "hair"), tableRuleInk(), "rowRule"), row.kind === "total") {
746
+ let range = columnRanges?.[column];
747
+ if (range && options[STACKED_TEXT])
748
+ addBlock(`cohort-header-range:${period}`, rangeLines[column], axisFont, columnAt(column, periodHeadAlign), tableTop + headerRowH - 4, headerH - headerRowH, periodHeadAlign, mutedInk, { categoryId: `t${period}` }, "point");
749
+ else if (range) {
750
+ let rangeFont = { family: theme.type.family, ...theme.type.axis }, [low, high] = [formatValue(range.min, period), formatValue(range.max, period)], rangeText = low === high ? low : numberRange(low, high), measured = measure(rangeText, rangeFont);
751
+ addLabel(
752
+ `cohort-header-range:${period}`,
753
+ rangeText,
754
+ { x: leftOf(periodHeadAlign, columnAt(column, periodHeadAlign), measured.width), y: tableTop + headerRowH - 4 + (baseRowH - measured.height) / 2, w: measured.width, h: measured.height },
755
+ rangeFont,
756
+ mutedInk,
757
+ { categoryId: `t${period}` },
758
+ "point"
759
+ );
760
+ }
761
+ });
762
+ }
763
+ let nameAlign = alignOf("label", "start"), unprinted = [
764
+ ...derived.cohorts.flatMap((row) => Array.from({ length: row.observedPeriods }, (_, period) => period).filter((period) => !visible.includes(period)).map((period) => claimId("cohort", row.id, `t${period}`))),
765
+ ...derived.total?.retention.flatMap((_, period) => visible.includes(period) ? [] : [claimId("cohort-total", `t${period}`)]) ?? []
766
+ ], cellClaim = (row, period) => row.kind === "total" ? claimId("cohort-total", `t${period}`) : claimId("cohort", row.id, `t${period}`);
767
+ if (rowData.forEach((row, rowIndex) => {
768
+ let y = tableTop + headerH + rowIndex * rowH + (totalOnTop ? row.kind === "total" ? 0 : baseLineH + totalGap : row.kind === "total" ? totalGap : 0), rowFont = row.kind === "total" ? totalFont : cellFont;
769
+ if (style === "pure" && rowIndex > 0 && row.kind !== "total" && rowData[rowIndex - 1].kind !== "total" && addLine(`cohort-row-rule:${row.id}`, tableLeft, y, tableRight, y, theme.table?.ruleWidths?.row ?? strokeToken(theme, "hair"), tableRuleInk(), "rowRule"), row.kind === "total") {
650
770
  let rule = totalRule(theme);
651
- nodes.push({ t: "rect", id: `cohort-total-ground:${row.id}`, rect: { x: tableLeft, y, w: tableRight - tableLeft, h: rowH }, fill: totalPaint, owner: {}, part: "cohortTotalGround" }), addLine(`cohort-total-rule:${row.id}`, tableLeft, y - totalGap / 2, tableRight, y - totalGap / 2, rule.width, rule.stroke, "totalRule"), rules.push({ t: "line", id: `cohort-total-rule-below:${row.id}`, x1: tableLeft, y1: y + rowH, x2: tableRight, y2: y + rowH, stroke: rule.stroke, width: rule.width, owner: {}, part: "totalRule" });
771
+ nodes.push({ t: "rect", id: `cohort-total-ground:${row.id}`, rect: { x: tableLeft, y, w: tableRight - tableLeft, h: rowH }, fill: totalPaint, owner: {}, part: "cohortTotalGround" }), totalOnTop ? heads || rules.push({ t: "line", id: `cohort-total-rule:${row.id}`, x1: tableLeft, y1: y, x2: tableRight, y2: y, stroke: rule.stroke, width: rule.width, owner: {}, part: "totalRule" }) : addLine(`cohort-total-rule:${row.id}`, tableLeft, y - totalGap / 2, tableRight, y - totalGap / 2, rule.width, rule.stroke, "totalRule"), rules.push({ t: "line", id: `cohort-total-rule-below:${row.id}`, x1: tableLeft, y1: y + rowH, x2: tableRight, y2: y + rowH, stroke: rule.stroke, width: rule.width, owner: {}, part: "totalRule" });
652
772
  }
653
- let rowGround = row.kind === "total" ? totalPaint : background;
654
- addLabel(
773
+ let rowGround = row.kind === "total" ? totalPaint : background, sizeText = formatAutomaticNumber(row.base, { locale: options.locale?.language, decimals: 0 }), nameRoom = Math.min(tableLeft + labelW - gap, showSize && !sizeAfterPeriods ? leftOf(sizeCellAlign, sizeAt(sizeCellAlign), measure(sizeText, rowFont).width) - 4 : 1 / 0) - tableLeft - rowNames[rowIndex].w;
774
+ if (addLabel(
655
775
  `cohort-row:${row.id}`,
656
776
  row.label,
657
- { x: tableLeft, y: y + (rowH - rowNames[rowIndex].h) / 2, w: rowNames[rowIndex].w, h: rowNames[rowIndex].h },
777
+ { x: nameAlign === "start" || nameRoom <= 0 ? tableLeft : tableLeft + (nameAlign === "end" ? nameRoom : nameRoom / 2), y: y + (rowH - rowNames[rowIndex].h) / 2, w: rowNames[rowIndex].w, h: rowNames[rowIndex].h },
658
778
  rowFont,
659
779
  { token: "ink" },
660
780
  { seriesId: row.id },
661
781
  "series",
662
782
  void 0,
663
- rowNames[rowIndex]
664
- );
665
- let sizeRect = { x: sizeLeft, y, w: sizeW, h: rowH }, sizeNodeId = `cohort-size:${row.id}`;
666
- nodes.push({ t: "rect", id: sizeNodeId, rect: sizeRect, fill: rowGround, owner: { seriesId: row.id, categoryId: "cohort-size" }, part: "cohortSize", display: { value: formatAutomaticNumber(row.base, { locale: options.locale?.language, decimals: 0 }) } }), occupied.claim(sizeRect, "mark", { seriesId: row.id, categoryId: "cohort-size" }, "cohortSize"), marks.sizeCells.push({ rowId: row.id, rowLabel: row.label, value: row.base, rect: sizeRect, nodeId: sizeNodeId, kind: row.kind });
667
- let sizeText = formatAutomaticNumber(row.base, { locale: options.locale?.language, decimals: 0 });
668
- addLabel(
669
- `cohort-size-label:${row.id}`,
670
- sizeText,
671
- measuredRect(sizeText, rowFont, sizeEnd, y, "end"),
672
- rowFont,
673
- { token: "ink" },
674
- { seriesId: row.id, categoryId: "cohort-size" },
675
- "point",
676
- rowGround
677
- ), visible.forEach((period, column) => {
783
+ rowNames[rowIndex],
784
+ nameAlign === "start" || nameRoom <= 0 ? void 0 : nameAlign
785
+ ), showSize) {
786
+ let sizeRect = { x: sizeLeft, y, w: sizeW, h: rowH }, sizeNodeId = `cohort-size:${row.id}`;
787
+ nodes.push({ t: "rect", id: sizeNodeId, rect: sizeRect, fill: rowGround, owner: { seriesId: row.id, categoryId: "cohort-size" }, part: "cohortSize", display: { value: formatAutomaticNumber(row.base, { locale: options.locale?.language, decimals: 0 }) } }), occupied.claim(sizeRect, "mark", { seriesId: row.id, categoryId: "cohort-size" }, "cohortSize"), marks.sizeCells.push({ rowId: row.id, rowLabel: row.label, value: row.base, rect: sizeRect, nodeId: sizeNodeId, kind: row.kind }), addLabel(
788
+ `cohort-size-label:${row.id}`,
789
+ sizeText,
790
+ measuredRect(sizeText, rowFont, sizeAt(sizeCellAlign), y, sizeCellAlign),
791
+ rowFont,
792
+ { token: "ink" },
793
+ { seriesId: row.id, categoryId: "cohort-size" },
794
+ "point",
795
+ rowGround
796
+ );
797
+ }
798
+ visible.forEach((period, column) => {
678
799
  let retention = period < row.observedPeriods ? row.retention[period] ?? null : null, missing = row.kind === "total" ? derived.cohorts.some((cohort) => missingCohortRate(cohort, period, derived.basis)) : missingCohortRate(derived.cohorts.find((cohort) => cohort.id === row.id), period, derived.basis), rect = {
679
800
  x: monthLeft + column * monthW,
680
801
  y,
@@ -699,12 +820,15 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
699
820
  rect,
700
821
  nodeId,
701
822
  retention
702
- }), retention === null && !missing) return;
823
+ }), retention === null && !missing || options.figures === !1 && style === "stepped" && retention !== null && period !== 0) {
824
+ period < row.observedPeriods && unprinted.push(cellClaim(row, period));
825
+ return;
826
+ }
703
827
  let text = missing ? "\u2014" : formatValue(retention, period), highlighted = style === "pure" && retention !== null && pureEmphasis(options, period, retention), font = row.kind === "total" && style !== "pure" ? totalFont : highlighted ? strongFont : cellFont, ink = period === 0 ? mutedInk : highlighted ? emphasisInk(theme, paint) : style === "stepped" && (bin ?? 0) >= 3 ? { token: "inkInverse" } : { token: "ink" };
704
828
  addLabel(
705
829
  `cohort-cell:${row.id}:t${period}`,
706
830
  text,
707
- measuredRect(text, font, rect.x + rect.w / 2, y, "middle"),
831
+ measuredRect(text, font, periodCellAlign === "middle" ? rect.x + rect.w / 2 : anchorIn(periodCellAlign, rect.x, rect.w), y, periodCellAlign),
708
832
  font,
709
833
  ink,
710
834
  { seriesId: row.id, categoryId: `t${period}` },
@@ -712,21 +836,21 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
712
836
  paint,
713
837
  void 0,
714
838
  void 0,
715
- row.kind === "total" ? void 0 : `cohort:${row.id}:t${period}`
839
+ cellClaim(row, period)
716
840
  );
717
841
  });
718
842
  }), averageBases) {
719
- let y = tableBottom - baseLineH;
843
+ let y = totalOnTop ? tableTop + headerH + rowH : tableBottom - baseLineH;
720
844
  visible.forEach((period, column) => {
721
845
  if (options[STACKED_TEXT]) {
722
- addBlock(`cohort-average-base:t${period}`, baseLines[column], baseFont, monthLeft + (column + 0.5) * monthW, y, baseLineH, "middle", mutedInk, { seriesId: totalId, categoryId: `t${period}` }, "annotation");
846
+ addBlock(`cohort-average-base:t${period}`, baseLines[column], baseFont, columnAt(column, periodCellAlign), y, baseLineH, periodCellAlign, mutedInk, { seriesId: totalId, categoryId: `t${period}` }, "annotation");
723
847
  return;
724
848
  }
725
849
  let text = chartString(options, "baseValue", { value: formatAutomaticNumber(averageBases[column], { locale: options.locale?.language, decimals: 0 }) }), measured = measure(text, baseFont);
726
850
  addLabel(
727
851
  `cohort-average-base:t${period}`,
728
852
  text,
729
- { x: monthLeft + (column + 0.5) * monthW - measured.width / 2, y: y + (baseLineH - measured.height) / 2, w: measured.width, h: measured.height },
853
+ { x: leftOf(periodCellAlign, columnAt(column, periodCellAlign), measured.width), y: y + (baseLineH - measured.height) / 2, w: measured.width, h: measured.height },
730
854
  baseFont,
731
855
  mutedInk,
732
856
  { seriesId: totalId, categoryId: `t${period}` },
@@ -764,7 +888,7 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
764
888
  let warning = warnings.find((w) => w.code === "label-hidden" && w.owner?.seriesId === label.owner.seriesId);
765
889
  warning && (warning.severity = "error");
766
890
  }
767
- return {
891
+ return withUnprintedClaims({
768
892
  type: "cohort",
769
893
  [REGULAR_WIDTH]: regularWidth,
770
894
  size,
@@ -786,11 +910,11 @@ function buildExhibit(data, derived, visible, options, warnings, exclusion) {
786
910
  derived,
787
911
  a11y: {
788
912
  title: accessibleTitle(options.title, chartString(options, "exhibitTitle", { measure: measureName.toLocaleLowerCase(options.locale?.language ?? "en"), count: String(derived.cohorts.length) })),
789
- desc: chartString(options, "exhibitDesc", { measure: measureName, periods: visible.map((period) => periodName(data.periodLabel, period, options.locale?.language)).join(", "), formula: cohortFormula(options, derived.basis), anchor: visible.includes(0) ? chartString(options, "exhibitDescAnchor") : "", missing: derived.cohorts.some((row) => visible.some((period) => missingCohortRate(row, period, derived.basis))) ? chartString(options, "exhibitDescMissing") : "", total: derived.total ? chartString(options, "exhibitDescTotal", { basis: chartString(options, derived.basis === "previous" ? "previousBasis" : "cohortBasis") }) : "" })
913
+ desc: chartString(options, showSize ? "exhibitDesc" : "exhibitDescNoSize", { measure: measureName, periods: visible.map((period) => periodName(data.periodLabel, period, options.locale?.language)).join(", "), formula: cohortFormula(options, derived.basis), anchor: visible.includes(0) ? chartString(options, "exhibitDescAnchor") : "", missing: derived.cohorts.some((row) => visible.some((period) => missingCohortRate(row, period, derived.basis))) ? chartString(options, "exhibitDescMissing") : "", total: derived.total ? chartString(options, "exhibitDescTotal", { basis: chartString(options, derived.basis === "previous" ? "previousBasis" : "cohortBasis") }) : "" })
790
914
  },
791
915
  warnings,
792
916
  debug: { occupied: occupied.snapshot(), decisions: solved.decisions }
793
- };
917
+ }, unprinted);
794
918
  }
795
919
  function columnBins(derived, visible, scope, steps, totalId) {
796
920
  let result = /* @__PURE__ */ new Map();
@@ -890,7 +1014,7 @@ function steppedKeyFlow(text, font, measure, width) {
890
1014
  var ANSWERED_HERE = ["palette", "sort", "valueAxis", "annotations"];
891
1015
  function layoutCohort(data, options = {}) {
892
1016
  let warnings = cohortBasisWarnings(options);
893
- if (options.variant !== void 0 && options.variant !== "heatmap") {
1017
+ if (pushAll(warnings, cohortOptionRefusals(options)), options.variant !== void 0 && options.variant !== "heatmap") {
894
1018
  let geometry = layoutCohortExhibit(data, options);
895
1019
  return options.labels !== void 0 && geometry.warnings.push({
896
1020
  code: "labels-exhibit-unsupported",
@@ -899,7 +1023,7 @@ function layoutCohort(data, options = {}) {
899
1023
  suggest: "drop 'labels', or set variant 'heatmap', which honours it"
900
1024
  }), pushAll(geometry.warnings, warnings), geometry;
901
1025
  }
902
- let basis = options.basis ?? "cohort", averagesMode = options.averages ?? !1, methodNote = options.methodNote === !0;
1026
+ let basis = options.basis ?? "cohort", averagesMode = options.total ?? options.averages ?? !1, methodNote = options.methodNote === !0;
903
1027
  options.sort?.categories !== void 0 && options.sort.categories !== "sheet" && warnings.push({
904
1028
  code: "cohort-sort-ignored",
905
1029
  severity: "warn",
@@ -919,7 +1043,7 @@ function layoutCohort(data, options = {}) {
919
1043
  suggest: "remove options.valueAxis"
920
1044
  });
921
1045
  let {
922
- derived,
1046
+ derived: allPeriods,
923
1047
  warnings: derivedWarnings,
924
1048
  notMeaningful,
925
1049
  unsupportedAveragePeriods
@@ -928,7 +1052,9 @@ function layoutCohort(data, options = {}) {
928
1052
  averages: averagesMode
929
1053
  });
930
1054
  pushAll(warnings, derivedWarnings);
931
- let periodCount = derived.periodCount, periodIds = Array.from({ length: periodCount }, (_, t) => `t${t}`), periodNames = periodLabels(data.periodLabel, periodCount, options), baseSuffix = /* @__PURE__ */ new Map();
1055
+ let periodCount = allPeriods.periodCount, periodIds = Array.from({ length: periodCount }, (_, t) => `t${t}`), periodIndex = /* @__PURE__ */ new Map();
1056
+ periodIds.forEach((id, t) => periodIndex.set(id, t));
1057
+ let periodNames = periodLabels(data.periodLabel, periodCount, options), everyPeriod = periodIds.map((_, t) => t), visible = normalizeVisiblePeriods(options.visiblePeriods, everyPeriod, warnings), shown = new Set(visible), derived = options.visiblePeriods === void 0 ? allPeriods : { ...allPeriods, visiblePeriods: visible }, visibleSpan = (row) => visible.filter((t) => t < row.observedPeriods), baseSuffix = /* @__PURE__ */ new Map();
932
1058
  for (let row of derived.cohorts)
933
1059
  baseSuffix.set(row.id, `(n\xA0=\xA0${formatAutomaticNumber(row.base, { locale: options.locale?.language, decimals: 0 })})`);
934
1060
  let cohortLabel = (index) => `${data.cohorts[index].label ?? data.cohorts[index].id} ${baseSuffix.get(derived.cohorts[index].id)}`, theme = resolveSemanticPaletteTheme(
@@ -942,31 +1068,35 @@ function layoutCohort(data, options = {}) {
942
1068
  if (r === null) return null;
943
1069
  let paint = t === 0 ? ANCHOR_PAINT : average ? averagePaint(r) : cohortPaint(r);
944
1070
  return cellPaint.set(`cell:${rowId}:t${t}`, paint), { pct: r * 100, fill: cssOf(paint), ...options.format ? {} : { [AUTOMATIC_FORMAT]: !0, format: formatAutomaticPercent(1, smallRateDecimals(r * 100), !1, options.locale?.language) } };
945
- }, reverseRows = segmentSort === "reverse", shownSupports = derived.averages?.flatMap((a, t) => derived.cohorts.some((row) => missingCohortRate(row, t, basis)) ? [] : [{ support: a.support, t }]) ?? [], supports = shownSupports.map((a) => a.support), averageSupportSuffix = supports.length === 0 ? "" : supports[0] === supports[supports.length - 1] ? `(${chartString(options, "support", { count: String(supports[0]) })})` : `(${chartString(options, "supportRange", { first: String(supports[0]), last: String(supports[supports.length - 1]) })})`, averageLabel = [chartString(options, "weightedAverage"), averageSupportSuffix].filter(Boolean).join(" "), averageRow = derived.averages ? [
1071
+ }, reverseRows = segmentSort === "reverse", shownSupports = derived.averages?.flatMap((a, t) => !shown.has(t) || derived.cohorts.some((row) => missingCohortRate(row, t, basis)) ? [] : [{ support: a.support, t }]) ?? [], supports = shownSupports.map((a) => a.support), averageSupportSuffix = supports.length === 0 ? "" : supports[0] === supports[supports.length - 1] ? `(${chartString(options, "support", { count: String(supports[0]) })})` : `(${chartString(options, "supportRange", { first: String(supports[0]), last: String(supports[supports.length - 1]) })})`, averageLabel = [chartString(options, "weightedAverage"), averageSupportSuffix].filter(Boolean).join(" "), averageRow = derived.averages ? [
946
1072
  {
947
1073
  id: AVERAGE_ROW_ID,
948
1074
  label: averageLabel,
949
- values: derived.averages.map((a, t) => cellFor(AVERAGE_ROW_ID, t, a.value, !0))
1075
+ values: visible.map((t) => cellFor(AVERAGE_ROW_ID, t, derived.averages[t].value, !0))
950
1076
  }
951
1077
  ] : [], hostData = {
952
- categories: periodIds.map((id, t) => ({ id, label: periodNames[t] })),
1078
+ categories: visible.map((t) => ({ id: periodIds[t], label: periodNames[t] })),
953
1079
  series: [
954
1080
  ...reverseRows ? averageRow : [],
955
1081
  ...derived.cohorts.map((row, index) => ({
956
1082
  id: row.id,
957
1083
  label: cohortLabel(index),
958
- values: Array.from({ length: periodCount }, (_, t) => t >= row.observedPeriods ? null : cellFor(row.id, t, row.retention[t], !1))
1084
+ values: visible.map((t) => t >= row.observedPeriods ? null : cellFor(row.id, t, row.retention[t], !1))
959
1085
  })),
960
1086
  ...reverseRows ? [] : averageRow
961
1087
  ]
962
1088
  }, baseFootnotes = [
963
1089
  ...authoredNotes(options),
964
- ...derived.cohorts.some((row) => row.retention.some((_, t) => missingCohortRate(row, t, basis))) ? [disclosureNote(chartString(options, "hatchMissing"))] : [],
965
- ...cohortNotes(basis, derived.averages, shownSupports, notMeaningful, unsupportedAveragePeriods, periodNames, methodNote, options)
966
- ], build = (extra) => (
967
- // Only the author's own notes keep a number; the rest are derived.
968
- layoutHeatmap(hostData, withAuthoredFootnotes({
1090
+ ...derived.cohorts.some((row) => visibleSpan(row).some((t) => missingCohortRate(row, t, basis))) ? [disclosureNote(chartString(options, "hatchMissing"))] : [],
1091
+ ...cohortNotes(basis, derived.averages, shownSupports, shownNotMeaningful(data, derived, visible, notMeaningful), unsupportedAveragePeriods.filter((t) => shown.has(t)), periodNames, methodNote && shown.has(0), methodNote, options)
1092
+ ], rowById = new Map(derived.cohorts.map((row) => [row.id, row])), hostClaims = ({ kind, owner }) => {
1093
+ let t = periodIndex.get(owner.categoryId ?? "");
1094
+ if (!(kind !== "point" || t === void 0 || owner.seriesId === void 0))
1095
+ return owner.seriesId === AVERAGE_ROW_ID ? derived.averages?.[t] ? [claimId("cohort-average", `t${t}`)] : void 0 : t < (rowById.get(owner.seriesId)?.observedPeriods ?? 0) ? [claimId("cohort", owner.seriesId, `t${t}`)] : void 0;
1096
+ }, build = (extra) => {
1097
+ let inner = withAuthoredFootnotes({
969
1098
  ...stripAnswered(options),
1099
+ [HOST_CLAIMS]: hostClaims,
970
1100
  // One decimal width for every cell. The engine's own default drops the
971
1101
  // decimal on whole numbers, which puts "60%" next to "55.2%" in one column
972
1102
  // and costs the eye the alignment it scans by; integer percentages also
@@ -985,12 +1115,15 @@ function layoutCohort(data, options = {}) {
985
1115
  ...[0, 0.25, 0.5, 0.75, 1].map((r) => ({
986
1116
  id: `scale:${r * 100}`,
987
1117
  // The top swatch also paints cells above their own base.
988
- label: r === 1 && derived.cohorts.some((cohort) => cohort.retention.some((value) => value !== null && value > 1)) ? "100%+" : `${r * 100}%`,
1118
+ label: r === 1 && derived.cohorts.some((cohort) => visibleSpan(cohort).some((t) => {
1119
+ let value = cohort.retention[t];
1120
+ return value != null && value > 1;
1121
+ })) ? "100%+" : `${r * 100}%`,
989
1122
  paint: cohortPaint(r),
990
1123
  ...rampTint(r) >= 0.8 ? { stroke: { token: "neutralMark" } } : {}
991
1124
  })),
992
1125
  // Period 0 is grey, not the ramp's 100%: the key says why.
993
- { id: "scale:base", label: chartString(options, "periodBase", { period: periodNames[0] }), paint: ANCHOR_PAINT },
1126
+ ...shown.has(0) ? [{ id: "scale:base", label: chartString(options, "periodBase", { period: periodNames[0] }), paint: ANCHOR_PAINT }] : [],
994
1127
  // The average row rides its own grey ramp; its swatch shows the
995
1128
  // ramp at 50%, so the key covers every fill drawn.
996
1129
  ...derived.averages ? [{ id: "scale:average", label: chartString(options, "averageGrey"), paint: averagePaint(0.5) }] : []
@@ -1000,22 +1133,21 @@ function layoutCohort(data, options = {}) {
1000
1133
  ...reverseRows ? { sort: { segments: "reverse" } } : {},
1001
1134
  // A row name too long for the band is cut before its base, never the base.
1002
1135
  rowSuffix: Object.fromEntries(baseSuffix)
1003
- }, [...baseFootnotes, ...extra], options.footnotes))
1004
- ), host = build([]), lost = countSuppressed(host, derived, methodNote);
1136
+ }, [...baseFootnotes, ...extra], options.footnotes);
1137
+ return hostedLayout(options, inner, () => sideKeyGivesWay(inner, layoutHeatmap(hostData, inner), (keyAbove) => layoutHeatmap(hostData, keyAbove)));
1138
+ }, host = build([]), lost = countSuppressed(host, derived, methodNote, shown);
1005
1139
  if (lost.total > 0) {
1006
1140
  host = build([disclosureNote(suppressionNote(lost, options))]);
1007
- let second = countSuppressed(host, derived, methodNote);
1141
+ let second = countSuppressed(host, derived, methodNote, shown);
1008
1142
  if (second.total !== lost.total || second.drawn !== lost.drawn) {
1009
1143
  host = build([disclosureNote(suppressionNote(second, options))]);
1010
- let third = countSuppressed(host, derived, methodNote);
1011
- third.total !== second.total || third.drawn !== second.drawn ? (host = build([disclosureNote(chartString(options, "uncountedSuppressed"))]), lost = countSuppressed(host, derived, methodNote)) : lost = third;
1144
+ let third = countSuppressed(host, derived, methodNote, shown);
1145
+ third.total !== second.total || third.drawn !== second.drawn ? (host = build([disclosureNote(chartString(options, "uncountedSuppressed"))]), lost = countSuppressed(host, derived, methodNote, shown)) : lost = third;
1012
1146
  } else
1013
1147
  lost = second;
1014
1148
  }
1015
1149
  let rowIndex = /* @__PURE__ */ new Map();
1016
1150
  derived.cohorts.forEach((row, index) => rowIndex.set(row.id, index));
1017
- let periodIndex = /* @__PURE__ */ new Map();
1018
- periodIds.forEach((id, t) => periodIndex.set(id, t));
1019
1151
  let cells = [], unobserved = 0;
1020
1152
  for (let node of host.scene) {
1021
1153
  if (node.part !== "cell" || node.t !== "rect") continue;
@@ -1073,14 +1205,14 @@ function layoutCohort(data, options = {}) {
1073
1205
  marks: { cells },
1074
1206
  derived,
1075
1207
  a11y: {
1076
- title: accessibleTitle(options.title, chartString(options, "title", { measure: cohortMeasure(options).toLocaleLowerCase(options.locale?.language ?? "en"), cohorts: String(derived.cohorts.length), periods: String(periodCount) })),
1208
+ title: accessibleTitle(options.title, chartString(options, "title", { measure: cohortMeasure(options).toLocaleLowerCase(options.locale?.language ?? "en"), cohorts: String(derived.cohorts.length), periods: String(visible.length) })),
1077
1209
  counts: [
1078
- structureCount("cohorts", derived.cohorts.length),
1079
- structureCount("periods", derived.periodCount),
1210
+ structureCount("cohorts", derived.cohorts.length, void 0, options),
1211
+ structureCount("periods", visible.length, void 0, options),
1080
1212
  structureCount("cells", unobserved, chartString(options, "cells", { count: String(unobserved) })),
1081
- ...derived.averages ? [derived.averages[0], derived.averages[derived.averages.length - 1]].flatMap((a) => a.value === null ? [] : [structureCount("cohorts", a.support, chartString(options, "support", { count: String(a.support) }))]) : []
1213
+ ...derived.averages ? [derived.averages[visible[0]], derived.averages[visible.at(-1)]].flatMap((a) => a.value === null ? [] : [structureCount("cohorts", a.support, chartString(options, "support", { count: String(a.support) }))]) : []
1082
1214
  ],
1083
- desc: describe(derived, periodNames, unobserved, options)
1215
+ desc: describe(derived, periodNames, unobserved, options, visible)
1084
1216
  },
1085
1217
  warnings
1086
1218
  };
@@ -1109,13 +1241,13 @@ function periodLabels(periodLabel, count, options) {
1109
1241
  let initial = (periodLabel ?? "").trim().charAt(0).toUpperCase();
1110
1242
  return Array.from({ length: count }, (_, t) => initial === "" ? chartString(options, "period", { period: String(t) }) : `${initial}${t}`);
1111
1243
  }
1112
- function cohortNotes(basis, averages, shownSupports, notMeaningful, unsupported, periodNames, methodNote, options) {
1244
+ function cohortNotes(basis, averages, shownSupports, notMeaningful, unsupported, periodNames, anchorNote, methodNote, options) {
1113
1245
  let notes = [
1114
1246
  ...methodNote || basis === "previous" ? [chartString(options, "formulaCount", { formula: cohortFormula(options, basis).replace(/[.!?]$/, "") })] : [],
1115
1247
  // The anchor column's value is stated ONCE here rather than repeated in
1116
1248
  // every cell. With the note off the anchor cells count like any other in
1117
1249
  // the suppression note (countSuppressed).
1118
- ...methodNote ? [disclosureNote(chartString(options, "anchorNote", { period: periodNames[0] }))] : []
1250
+ ...anchorNote ? [disclosureNote(chartString(options, "anchorNote", { period: periodNames[0] }))] : []
1119
1251
  ];
1120
1252
  if (notMeaningful.length > 0 && notes.push(disclosureNote(chartString(options, "hatchNm", { periods: notMeaningful.join(", ") }))), averages) {
1121
1253
  notes.push(
@@ -1137,9 +1269,9 @@ function suppressionNote(lost, options) {
1137
1269
  return lost.total >= lost.drawn ? chartString(options, "allSuppressed", { count: String(lost.drawn) }) : chartString(options, "someSuppressed", { count: String(lost.total), total: String(lost.drawn) });
1138
1270
  }
1139
1271
  var NM_PAINT = { token: "neutral", tint: 0.55 };
1140
- function countSuppressed(host, derived, methodNote) {
1272
+ function countSuppressed(host, derived, methodNote, shown) {
1141
1273
  let visible = new Set(host.labels.filter((label) => !label.hidden).map((label) => label.id)), drawnPer = /* @__PURE__ */ new Map(), lostPer = /* @__PURE__ */ new Map(), count = (rowId, t, value) => {
1142
- value !== null && (t === 0 && methodNote || (drawnPer.set(t, (drawnPer.get(t) ?? 0) + 1), visible.has(`point:${rowId}:t${t}`) || lostPer.set(t, (lostPer.get(t) ?? 0) + 1)));
1274
+ value === null || !shown.has(t) || t === 0 && methodNote || (drawnPer.set(t, (drawnPer.get(t) ?? 0) + 1), visible.has(`point:${rowId}:t${t}`) || lostPer.set(t, (lostPer.get(t) ?? 0) + 1));
1143
1275
  };
1144
1276
  for (let row of derived.cohorts)
1145
1277
  for (let t = 0; t < row.observedPeriods; t++) count(row.id, t, row.retention[t] ?? null);
@@ -1157,14 +1289,22 @@ function withAverageRow(highlight, hasAverages) {
1157
1289
  function stripAnswered(options) {
1158
1290
  let rest = { ...options };
1159
1291
  for (let key of ANSWERED_HERE) delete rest[key];
1160
- return delete rest.basis, delete rest.averages, delete rest.methodNote, keepShownNotes(options, rest);
1292
+ return delete rest.basis, delete rest.averages, delete rest.total, delete rest.visiblePeriods, delete rest.methodNote, keepShownNotes(options, rest);
1293
+ }
1294
+ function shownNotMeaningful(data, derived, visible, phrases) {
1295
+ return derived.visiblePeriods === void 0 ? [...phrases] : derived.cohorts.flatMap((row, index) => {
1296
+ let from = visible.find((t) => t < row.observedPeriods && row.retention[t] === null && !missingCohortRate(row, t, derived.basis));
1297
+ return from === void 0 ? [] : [`'${data.cohorts[index].label ?? row.id}' from period ${from}`];
1298
+ });
1161
1299
  }
1162
- function describe(derived, periodNames, unobserved, options) {
1300
+ function describe(derived, periodNames, unobserved, options, visible) {
1163
1301
  let first = derived.cohorts[0], last = derived.cohorts[derived.cohorts.length - 1], pct = (v) => `${formatAutomaticNumber(v * 100, { decimals: autoDecimals(v * 100), locale: options.locale?.language })}%`, at = (index) => {
1164
- let row = derived.cohorts[index], t = row.observedPeriods - 1, r = row.retention[t] ?? null;
1302
+ let row = derived.cohorts[index], t = derived.visiblePeriods === void 0 ? row.observedPeriods - 1 : visible.filter((period) => period < row.observedPeriods).at(-1);
1303
+ if (t === void 0) return chartString(options, "atPeriod", { value: chartString(options, "notReached"), period: periodNames[visible[0]] });
1304
+ let r = row.retention[t] ?? null;
1165
1305
  return r === null ? chartString(options, "atPeriod", { value: chartString(options, missingCohortRate(row, t, derived.basis) ? "missing" : "notMeaningful"), period: periodNames[t] }) : chartString(options, "atPeriod", { value: pct(r), period: periodNames[t] });
1166
1306
  }, average = (a, t) => a.value === null ? derived.cohorts.some((row) => missingCohortRate(row, t, derived.basis)) ? chartString(options, "missingAt", { period: periodNames[t] }) : chartString(options, "blankAverage") : chartString(options, "valueSupport", { value: pct(a.value), count: String(a.support) }), basisWord = cohortFormula(options, derived.basis);
1167
- return chartString(options, "descStart", { measure: cohortMeasure(options).toLocaleLowerCase(options.locale?.language ?? "en"), cohorts: String(derived.cohorts.length), periods: String(derived.periodCount), formula: basisWord }) + chartString(options, "descReach", { first: at(0), last: at(derived.cohorts.length - 1) }) + chartString(options, "descBlank", { count: String(unobserved) }) + (derived.averages ? chartString(options, "descAverage", { first: average(derived.averages[0], 0), last: average(derived.averages[derived.averages.length - 1], derived.averages.length - 1) }) : "") + chartString(options, "descBases", { first: String(first.base), last: String(last.base) });
1307
+ return chartString(options, "descStart", { measure: cohortMeasure(options).toLocaleLowerCase(options.locale?.language ?? "en"), cohorts: String(derived.cohorts.length), periods: String(visible.length), formula: basisWord }) + chartString(options, visible.includes(0) ? "descReach" : "descReachShown", { first: at(0), last: at(derived.cohorts.length - 1) }) + chartString(options, "descBlank", { count: String(unobserved) }) + (derived.averages ? chartString(options, "descAverage", { first: average(derived.averages[visible[0]], visible[0]), last: average(derived.averages[visible.at(-1)], visible.at(-1)) }) : "") + chartString(options, "descBases", { first: String(first.base), last: String(last.base) });
1168
1308
  }
1169
1309
 
1170
1310
  // src/core/charts/cohort/core.ts