boardplot 0.0.0-stage → 0.53.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 (818) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE.md +180 -0
  4. package/README.md +208 -2
  5. package/THIRD_PARTY_NOTICES.md +1110 -0
  6. package/dist/DiagnosticDetails-UNYNYCAH.js +69 -0
  7. package/dist/ReaderBox-VOJSJ66R.js +137 -0
  8. package/dist/annotateEngine-DLMFJZ67.js +30 -0
  9. package/dist/build-identity.json +6 -0
  10. package/dist/chunk-24BHMKDD.js +83 -0
  11. package/dist/chunk-263SZKIL.js +8 -0
  12. package/dist/chunk-27QADBDV.js +211 -0
  13. package/dist/chunk-2CVH5E57.js +128 -0
  14. package/dist/chunk-2DOR5SS6.js +446 -0
  15. package/dist/chunk-2EQE4E3I.js +22 -0
  16. package/dist/chunk-2FNNAPCI.js +24 -0
  17. package/dist/chunk-2L2Q53EP.js +251 -0
  18. package/dist/chunk-2LMCD3ZR.js +6 -0
  19. package/dist/chunk-2ND7ZITT.js +3069 -0
  20. package/dist/chunk-2QT5ZUHO.js +2937 -0
  21. package/dist/chunk-2RSG7JYI.js +24 -0
  22. package/dist/chunk-2V6CLH33.js +1392 -0
  23. package/dist/chunk-2VWJ5BGO.js +566 -0
  24. package/dist/chunk-2WNYRWHG.js +51 -0
  25. package/dist/chunk-323YZWYJ.js +548 -0
  26. package/dist/chunk-33PB4V6K.js +382 -0
  27. package/dist/chunk-33PLBIMA.js +176 -0
  28. package/dist/chunk-3A2IEBCN.js +195 -0
  29. package/dist/chunk-3D3D3D23.js +25 -0
  30. package/dist/chunk-3EZRM4YM.js +92 -0
  31. package/dist/chunk-3H2W76TB.js +2353 -0
  32. package/dist/chunk-3JEQGGVD.js +19 -0
  33. package/dist/chunk-3QWZAEW5.js +26 -0
  34. package/dist/chunk-3SIRPKMP.js +12 -0
  35. package/dist/chunk-3SQCCESO.js +1592 -0
  36. package/dist/chunk-3XHJHQWU.js +42 -0
  37. package/dist/chunk-4G2O2ZPJ.js +83 -0
  38. package/dist/chunk-4JLBVIGW.js +24 -0
  39. package/dist/chunk-4RRNJLCM.js +746 -0
  40. package/dist/chunk-4UVW5WU6.js +76 -0
  41. package/dist/chunk-4X66BTP5.js +344 -0
  42. package/dist/chunk-53OYF4ZT.js +687 -0
  43. package/dist/chunk-57ZGVAU3.js +179 -0
  44. package/dist/chunk-5HECRVXJ.js +62 -0
  45. package/dist/chunk-5LGSRWFC.js +63 -0
  46. package/dist/chunk-5LYXD6ME.js +1112 -0
  47. package/dist/chunk-66RFKRGO.js +28 -0
  48. package/dist/chunk-6KWIQ5KF.js +18 -0
  49. package/dist/chunk-6OCR6ITN.js +72 -0
  50. package/dist/chunk-6RBTTCQD.js +802 -0
  51. package/dist/chunk-6Y7EXYLR.js +563 -0
  52. package/dist/chunk-7CTKTIPF.js +613 -0
  53. package/dist/chunk-7EVIIADO.js +185 -0
  54. package/dist/chunk-7X2ZYVAX.js +89 -0
  55. package/dist/chunk-7X65ZQN4.js +38 -0
  56. package/dist/chunk-A4QZXLXF.js +7 -0
  57. package/dist/chunk-A6CQPJWR.js +49 -0
  58. package/dist/chunk-A7IEVBYI.js +35 -0
  59. package/dist/chunk-ACXX2JNL.js +6 -0
  60. package/dist/chunk-ADKCLH3Z.js +98 -0
  61. package/dist/chunk-ADWSGPH5.js +23 -0
  62. package/dist/chunk-AG2CJ4JY.js +203 -0
  63. package/dist/chunk-AHQ4L3BE.js +30 -0
  64. package/dist/chunk-AOQ6VF5H.js +6 -0
  65. package/dist/chunk-AQROQDLR.js +3303 -0
  66. package/dist/chunk-AWTG3RFF.js +85 -0
  67. package/dist/chunk-B54RN2FD.js +692 -0
  68. package/dist/chunk-B67K6OWJ.js +48 -0
  69. package/dist/chunk-B6GFKYBZ.js +40 -0
  70. package/dist/chunk-BBL3R5YZ.js +186 -0
  71. package/dist/chunk-BBRBCMNR.js +28 -0
  72. package/dist/chunk-BIDIGDGH.js +6 -0
  73. package/dist/chunk-BLFWUMTD.js +12 -0
  74. package/dist/chunk-BM6SFFWF.js +6 -0
  75. package/dist/chunk-BMRD6MAH.js +24 -0
  76. package/dist/chunk-BPKXEMRE.js +197 -0
  77. package/dist/chunk-BUPLB3EX.js +129 -0
  78. package/dist/chunk-BW5VLBSZ.js +15 -0
  79. package/dist/chunk-BWGRWGVA.js +295 -0
  80. package/dist/chunk-BWLOXQDV.js +131 -0
  81. package/dist/chunk-BWTX7LUG.js +203 -0
  82. package/dist/chunk-C54QLNE4.js +69 -0
  83. package/dist/chunk-CAQ5P4VN.js +296 -0
  84. package/dist/chunk-CCCEBIUZ.js +296 -0
  85. package/dist/chunk-CDZHNLO6.js +42 -0
  86. package/dist/chunk-CJGSJKPO.js +25 -0
  87. package/dist/chunk-CN7JRHST.js +25 -0
  88. package/dist/chunk-CNX7EGSU.js +266 -0
  89. package/dist/chunk-COYOTQC2.js +75 -0
  90. package/dist/chunk-CRNMNZJD.js +1161 -0
  91. package/dist/chunk-CUVUDK4O.js +68 -0
  92. package/dist/chunk-CWDHCSL2.js +2919 -0
  93. package/dist/chunk-CYOJZ3GQ.js +631 -0
  94. package/dist/chunk-D4SOADBD.js +19 -0
  95. package/dist/chunk-D7SHZDA3.js +1808 -0
  96. package/dist/chunk-DAVHGK27.js +657 -0
  97. package/dist/chunk-DCCJRLAJ.js +422 -0
  98. package/dist/chunk-DCTCUZ5L.js +51 -0
  99. package/dist/chunk-DDCB7ZA5.js +2511 -0
  100. package/dist/chunk-DDI2W4TR.js +149 -0
  101. package/dist/chunk-DIHUGBZO.js +61 -0
  102. package/dist/chunk-DJHIQWSG.js +25 -0
  103. package/dist/chunk-DO5OZJAO.js +302 -0
  104. package/dist/chunk-DOFYKPTC.js +18 -0
  105. package/dist/chunk-DRTA6JG5.js +160 -0
  106. package/dist/chunk-DRW6KGBK.js +1062 -0
  107. package/dist/chunk-DU4A5AOY.js +1156 -0
  108. package/dist/chunk-DYS7EIXY.js +294 -0
  109. package/dist/chunk-E4IQ6M4S.js +24 -0
  110. package/dist/chunk-EFUWFB64.js +24 -0
  111. package/dist/chunk-EHBB2Z4D.js +290 -0
  112. package/dist/chunk-EHVESNLV.js +30 -0
  113. package/dist/chunk-EJPVVGD7.js +67 -0
  114. package/dist/chunk-EKQK5D6G.js +14 -0
  115. package/dist/chunk-EUADDXAV.js +30 -0
  116. package/dist/chunk-F6CNPC4L.js +47 -0
  117. package/dist/chunk-FBAYZSFC.js +2806 -0
  118. package/dist/chunk-FBB4BWKN.js +30 -0
  119. package/dist/chunk-FF23FYQD.js +1269 -0
  120. package/dist/chunk-FG6EDGMI.js +53 -0
  121. package/dist/chunk-FHA3KMFC.js +43 -0
  122. package/dist/chunk-FIANWJXX.js +19 -0
  123. package/dist/chunk-FIWNDOMO.js +6 -0
  124. package/dist/chunk-FV3VF36K.js +2721 -0
  125. package/dist/chunk-G5FMTRG5.js +37 -0
  126. package/dist/chunk-GCBOHVDZ.js +229 -0
  127. package/dist/chunk-GDOW2KNP.js +19 -0
  128. package/dist/chunk-GTG3IGLF.js +2674 -0
  129. package/dist/chunk-GZTNTHSW.js +21 -0
  130. package/dist/chunk-H4H4O62O.js +46 -0
  131. package/dist/chunk-H5G7T35P.js +24 -0
  132. package/dist/chunk-H63XQ3OO.js +942 -0
  133. package/dist/chunk-H67RTX46.js +43 -0
  134. package/dist/chunk-HA4IPWMM.js +841 -0
  135. package/dist/chunk-HKYTOJLV.js +33 -0
  136. package/dist/chunk-HOAH5XBR.js +542 -0
  137. package/dist/chunk-HTYFQHRC.js +24 -0
  138. package/dist/chunk-HYY5V2KL.js +19 -0
  139. package/dist/chunk-HZI56ASJ.js +79 -0
  140. package/dist/chunk-I6VAWNNU.js +24 -0
  141. package/dist/chunk-IBXXZVG7.js +80 -0
  142. package/dist/chunk-IDDA5INB.js +60 -0
  143. package/dist/chunk-IK4BHOPZ.js +33 -0
  144. package/dist/chunk-IL5T7I2A.js +27 -0
  145. package/dist/chunk-ILSXT6KT.js +24 -0
  146. package/dist/chunk-IV2UXZXX.js +16 -0
  147. package/dist/chunk-IYEFEBRN.js +41 -0
  148. package/dist/chunk-IYMI7YI4.js +829 -0
  149. package/dist/chunk-J6I2YFJH.js +58 -0
  150. package/dist/chunk-JFBEAUJ6.js +24 -0
  151. package/dist/chunk-JR7Y5ONB.js +27 -0
  152. package/dist/chunk-JSEYUJUQ.js +836 -0
  153. package/dist/chunk-JYBT2JNY.js +61 -0
  154. package/dist/chunk-K3HSQPSM.js +24 -0
  155. package/dist/chunk-KAXJFL7N.js +43 -0
  156. package/dist/chunk-KDMKHR5A.js +32 -0
  157. package/dist/chunk-KKWZWP67.js +24 -0
  158. package/dist/chunk-KOJ5QETJ.js +8 -0
  159. package/dist/chunk-KPKXJYQH.js +19 -0
  160. package/dist/chunk-KSJVENRU.js +113 -0
  161. package/dist/chunk-KZJOV4QW.js +33 -0
  162. package/dist/chunk-KZS46KDY.js +58 -0
  163. package/dist/chunk-L3JWM7FR.js +50 -0
  164. package/dist/chunk-L4S6UFTL.js +26 -0
  165. package/dist/chunk-L6DJ4ZY5.js +2008 -0
  166. package/dist/chunk-L7RHB734.js +23 -0
  167. package/dist/chunk-LCWJS34U.js +38 -0
  168. package/dist/chunk-LFTAMH7I.js +24 -0
  169. package/dist/chunk-LFX7W4B7.js +113 -0
  170. package/dist/chunk-LINZPU5D.js +8 -0
  171. package/dist/chunk-LIWLBLCT.js +83 -0
  172. package/dist/chunk-LNKY5Z2X.js +23 -0
  173. package/dist/chunk-LS7HVBI7.js +24 -0
  174. package/dist/chunk-M4EUXOLU.js +170 -0
  175. package/dist/chunk-M4SPKUZE.js +7 -0
  176. package/dist/chunk-M4YLED7M.js +17 -0
  177. package/dist/chunk-MBKZYJRC.js +1424 -0
  178. package/dist/chunk-MCYM3RNF.js +227 -0
  179. package/dist/chunk-MF6IVSBJ.js +48 -0
  180. package/dist/chunk-MIAPBQCA.js +24 -0
  181. package/dist/chunk-MJZHFH5R.js +1075 -0
  182. package/dist/chunk-MQFCG4KS.js +1467 -0
  183. package/dist/chunk-MVV6RQMG.js +128 -0
  184. package/dist/chunk-MYMT5KJL.js +1182 -0
  185. package/dist/chunk-MZL6LGKO.js +587 -0
  186. package/dist/chunk-N23YFPPI.js +47 -0
  187. package/dist/chunk-N3G2FYDL.js +300 -0
  188. package/dist/chunk-N3TPMXS3.js +161 -0
  189. package/dist/chunk-N73IBH55.js +58 -0
  190. package/dist/chunk-N7J7CZS6.js +43 -0
  191. package/dist/chunk-NCB3YLHF.js +28 -0
  192. package/dist/chunk-NHQGRKEA.js +63 -0
  193. package/dist/chunk-NKIYLFXZ.js +2774 -0
  194. package/dist/chunk-NOSDEJ3K.js +25934 -0
  195. package/dist/chunk-NQDVMUHX.js +433 -0
  196. package/dist/chunk-NSSNYY6Y.js +58 -0
  197. package/dist/chunk-NY5NUFDZ.js +117 -0
  198. package/dist/chunk-O3S2KNIW.js +25 -0
  199. package/dist/chunk-O3VN6BTL.js +24 -0
  200. package/dist/chunk-ONZLC47B.js +88 -0
  201. package/dist/chunk-OQEBOVUO.js +30 -0
  202. package/dist/chunk-OUEGGWH7.js +24 -0
  203. package/dist/chunk-OURX73UJ.js +728 -0
  204. package/dist/chunk-P25VEGGX.js +24 -0
  205. package/dist/chunk-P26Z62UV.js +24 -0
  206. package/dist/chunk-P5RNWMZC.js +2984 -0
  207. package/dist/chunk-P6KZIZDV.js +987 -0
  208. package/dist/chunk-PEUSKIFV.js +168 -0
  209. package/dist/chunk-PFVTYFSL.js +24 -0
  210. package/dist/chunk-PWROWDZS.js +137 -0
  211. package/dist/chunk-Q3CV2JJ2.js +3650 -0
  212. package/dist/chunk-QBR6IKIX.js +50 -0
  213. package/dist/chunk-QGCEHR6S.js +13 -0
  214. package/dist/chunk-QHRE2M6V.js +26 -0
  215. package/dist/chunk-QKL7IY42.js +38 -0
  216. package/dist/chunk-QO6HEXIZ.js +272 -0
  217. package/dist/chunk-QOIVXZUF.js +24 -0
  218. package/dist/chunk-QPWRHDLZ.js +17 -0
  219. package/dist/chunk-QSXK6PJL.js +19 -0
  220. package/dist/chunk-QTZVVZ2A.js +54 -0
  221. package/dist/chunk-QWXWVPNE.js +18 -0
  222. package/dist/chunk-QY5ZKUWY.js +383 -0
  223. package/dist/chunk-QZAT46PP.js +95 -0
  224. package/dist/chunk-RA66JA3D.js +24 -0
  225. package/dist/chunk-REOPXBUR.js +600 -0
  226. package/dist/chunk-RGZGLKFB.js +648 -0
  227. package/dist/chunk-RL3NUWMY.js +3378 -0
  228. package/dist/chunk-RNOJSEES.js +16 -0
  229. package/dist/chunk-ROXO4R3J.js +16 -0
  230. package/dist/chunk-RPIW5T55.js +40 -0
  231. package/dist/chunk-RQ5DNYLG.js +10 -0
  232. package/dist/chunk-RZNYW7UP.js +133 -0
  233. package/dist/chunk-S32YYDIB.js +420 -0
  234. package/dist/chunk-S4QSJAGY.js +44 -0
  235. package/dist/chunk-S6UX7KB6.js +335 -0
  236. package/dist/chunk-SDSONLMZ.js +2546 -0
  237. package/dist/chunk-SGD3ZHID.js +250 -0
  238. package/dist/chunk-SKRSCTT5.js +28 -0
  239. package/dist/chunk-SMCDXUIO.js +24 -0
  240. package/dist/chunk-SPTPFY4S.js +528 -0
  241. package/dist/chunk-SREWFAAJ.js +90 -0
  242. package/dist/chunk-SS42FJVN.js +3875 -0
  243. package/dist/chunk-SVZDXFPX.js +891 -0
  244. package/dist/chunk-SZPTTNW7.js +16 -0
  245. package/dist/chunk-T3IGJARD.js +22 -0
  246. package/dist/chunk-TA3TFKYZ.js +86 -0
  247. package/dist/chunk-TBGUEF3M.js +939 -0
  248. package/dist/chunk-TGK6KUGN.js +331 -0
  249. package/dist/chunk-TJSND556.js +1783 -0
  250. package/dist/chunk-TKOJZQAJ.js +24 -0
  251. package/dist/chunk-TM4OC53S.js +97 -0
  252. package/dist/chunk-TNEHPP3H.js +18 -0
  253. package/dist/chunk-TWOREVKJ.js +1760 -0
  254. package/dist/chunk-TXS3U77A.js +60 -0
  255. package/dist/chunk-UB6ODJHO.js +134 -0
  256. package/dist/chunk-UBZXQIDR.js +24 -0
  257. package/dist/chunk-ULTSSIOU.js +38 -0
  258. package/dist/chunk-UMDEWWXT.js +33 -0
  259. package/dist/chunk-V6O6KVOA.js +347 -0
  260. package/dist/chunk-VABRPZVC.js +43 -0
  261. package/dist/chunk-VDAKTZQP.js +18 -0
  262. package/dist/chunk-VDAZPGR2.js +79 -0
  263. package/dist/chunk-VERLFNWR.js +25 -0
  264. package/dist/chunk-VH2UUU7K.js +24 -0
  265. package/dist/chunk-VJ3FCGQF.js +12 -0
  266. package/dist/chunk-VK5ZDV67.js +47 -0
  267. package/dist/chunk-VKQNDOAI.js +40 -0
  268. package/dist/chunk-VTEV3WVF.js +690 -0
  269. package/dist/chunk-VXZFQKBJ.js +21 -0
  270. package/dist/chunk-WI5ITCOH.js +22 -0
  271. package/dist/chunk-WLZ54FWG.js +120 -0
  272. package/dist/chunk-WYJEOMNY.js +31 -0
  273. package/dist/chunk-WZGJSQKN.js +29 -0
  274. package/dist/chunk-WZL4EEBS.js +11 -0
  275. package/dist/chunk-X4YNDLVA.js +54 -0
  276. package/dist/chunk-X6SUFTD7.js +17 -0
  277. package/dist/chunk-XB4KZ6WO.js +81 -0
  278. package/dist/chunk-XJI6SWFS.js +569 -0
  279. package/dist/chunk-XJP5DKIL.js +29 -0
  280. package/dist/chunk-XN4ARQ2W.js +47 -0
  281. package/dist/chunk-XN7MQO45.js +359 -0
  282. package/dist/chunk-XQCQZBGX.js +100 -0
  283. package/dist/chunk-XXOHXA3A.js +69 -0
  284. package/dist/chunk-XZOHR765.js +127 -0
  285. package/dist/chunk-YCNLQYTC.js +133 -0
  286. package/dist/chunk-YCRGWQBS.js +526 -0
  287. package/dist/chunk-YF2PYLC4.js +210 -0
  288. package/dist/chunk-YG5GUELW.js +935 -0
  289. package/dist/chunk-YS6KMYM4.js +91 -0
  290. package/dist/chunk-YWP7XFKD.js +12 -0
  291. package/dist/chunk-Z2MGTKDR.js +20 -0
  292. package/dist/chunk-Z6CL7AR6.js +24 -0
  293. package/dist/chunk-Z7X3RGGA.js +22 -0
  294. package/dist/chunk-ZF43WRG3.js +29 -0
  295. package/dist/chunk-ZMF7WEGG.js +60 -0
  296. package/dist/chunk-ZNHFLJSY.js +375 -0
  297. package/dist/chunk-ZQ4VFQID.js +76 -0
  298. package/dist/chunk-ZQF34VPS.js +72 -0
  299. package/dist/chunk-ZU425HNM.js +24 -0
  300. package/dist/chunk-ZZU5R5UU.js +24 -0
  301. package/dist/cli/index.js +9 -0
  302. package/dist/core-3VCCUFVX.js +32 -0
  303. package/dist/core-4BZQQSHS.js +33 -0
  304. package/dist/core-4VT4MHNB.js +38 -0
  305. package/dist/core-5535KXRD.js +40 -0
  306. package/dist/core-5HQBPCHL.js +35 -0
  307. package/dist/core-6RYHWUJO.js +35 -0
  308. package/dist/core-7BZJCIXN.js +35 -0
  309. package/dist/core-AJTVU6X7.js +37 -0
  310. package/dist/core-C6YUSTZI.js +57 -0
  311. package/dist/core-EEB7HTCL.js +33 -0
  312. package/dist/core-EFMVDWNH.js +38 -0
  313. package/dist/core-ETAGQBZO.js +34 -0
  314. package/dist/core-FVR3WZEC.js +36 -0
  315. package/dist/core-GCTFVYMH.js +29 -0
  316. package/dist/core-GES44OTS.js +33 -0
  317. package/dist/core-GGQREDSI.js +47 -0
  318. package/dist/core-HRYOV6QD.js +38 -0
  319. package/dist/core-IKD3EE3S.js +38 -0
  320. package/dist/core-JM4R426L.js +32 -0
  321. package/dist/core-KKQS3WI2.js +40 -0
  322. package/dist/core-LA6XDYG7.js +40 -0
  323. package/dist/core-MJ7JWQT5.js +37 -0
  324. package/dist/core-MLROKJ2M.js +53 -0
  325. package/dist/core-MR52YBRX.js +31 -0
  326. package/dist/core-NP4VHWXL.js +29 -0
  327. package/dist/core-NQLNZDX5.js +41 -0
  328. package/dist/core-NSIJEKLI.js +44 -0
  329. package/dist/core-OJUQLIQ5.js +35 -0
  330. package/dist/core-PB3VUQSS.js +32 -0
  331. package/dist/core-Q6VLFFYC.js +56 -0
  332. package/dist/core-QY7AVIKZ.js +51 -0
  333. package/dist/core-SBQMHWTA.js +52 -0
  334. package/dist/core-UHECQHJ2.js +38 -0
  335. package/dist/core-V5FV4NWL.js +56 -0
  336. package/dist/core-WGM4XUN3.js +58 -0
  337. package/dist/core-WUQVFARS.js +34 -0
  338. package/dist/core-Z2F3IGSR.js +42 -0
  339. package/dist/dataTable-3CPPIHB3.js +58 -0
  340. package/dist/engine-FXFBCWHB.js +961 -0
  341. package/dist/fixtures.d.ts +1 -0
  342. package/dist/fixtures.js +41 -0
  343. package/dist/fontTables-WYCZNRE7.js +18 -0
  344. package/dist/fonts.d.ts +1 -0
  345. package/dist/fonts.js +19 -0
  346. package/dist/geo/dach.d.ts +1 -0
  347. package/dist/geo/dach.js +14 -0
  348. package/dist/geo/de-states.d.ts +1 -0
  349. package/dist/geo/de-states.js +14 -0
  350. package/dist/geo/eu27.d.ts +1 -0
  351. package/dist/geo/eu27.js +14 -0
  352. package/dist/geo/europe.d.ts +1 -0
  353. package/dist/geo/europe.js +14 -0
  354. package/dist/geo/index.d.ts +1 -0
  355. package/dist/geo/index.js +41 -0
  356. package/dist/geo/us-states.d.ts +1 -0
  357. package/dist/geo/us-states.js +14 -0
  358. package/dist/geo/world.d.ts +1 -0
  359. package/dist/geo/world.js +14 -0
  360. package/dist/index.d.ts +1 -0
  361. package/dist/index.js +364 -0
  362. package/dist/main-YLKBTHJP.js +569 -0
  363. package/dist/mcp/server.js +1025 -0
  364. package/dist/module-SVEW5ZUE.js +137233 -0
  365. package/dist/react/bar.d.ts +1 -0
  366. package/dist/react/bar.js +81 -0
  367. package/dist/react/bartable.d.ts +1 -0
  368. package/dist/react/bartable.js +70 -0
  369. package/dist/react/box.d.ts +1 -0
  370. package/dist/react/box.js +65 -0
  371. package/dist/react/bullet.d.ts +1 -0
  372. package/dist/react/bullet.js +72 -0
  373. package/dist/react/butterfly.d.ts +1 -0
  374. package/dist/react/butterfly.js +66 -0
  375. package/dist/react/choropleth.d.ts +1 -0
  376. package/dist/react/choropleth.js +67 -0
  377. package/dist/react/cohort.d.ts +1 -0
  378. package/dist/react/cohort.js +70 -0
  379. package/dist/react/column.d.ts +1 -0
  380. package/dist/react/column.js +86 -0
  381. package/dist/react/combo.d.ts +1 -0
  382. package/dist/react/combo.js +86 -0
  383. package/dist/react/creative.d.ts +1 -0
  384. package/dist/react/creative.js +61 -0
  385. package/dist/react/diagram.d.ts +1 -0
  386. package/dist/react/diagram.js +60 -0
  387. package/dist/react/dimswitch.d.ts +1 -0
  388. package/dist/react/dimswitch.js +72 -0
  389. package/dist/react/dot.d.ts +1 -0
  390. package/dist/react/dot.js +70 -0
  391. package/dist/react/export.d.ts +1 -0
  392. package/dist/react/export.js +658 -0
  393. package/dist/react/funnel.d.ts +1 -0
  394. package/dist/react/funnel.js +63 -0
  395. package/dist/react/gantt.d.ts +1 -0
  396. package/dist/react/gantt.js +62 -0
  397. package/dist/react/grid.d.ts +1 -0
  398. package/dist/react/grid.js +67 -0
  399. package/dist/react/heatmap.d.ts +1 -0
  400. package/dist/react/heatmap.js +68 -0
  401. package/dist/react/histogram.d.ts +1 -0
  402. package/dist/react/histogram.js +86 -0
  403. package/dist/react/index.d.ts +1 -0
  404. package/dist/react/index.js +504 -0
  405. package/dist/react/kpi.d.ts +1 -0
  406. package/dist/react/kpi.js +67 -0
  407. package/dist/react/likert.d.ts +1 -0
  408. package/dist/react/likert.js +83 -0
  409. package/dist/react/line.d.ts +1 -0
  410. package/dist/react/line.js +81 -0
  411. package/dist/react/mekko.d.ts +1 -0
  412. package/dist/react/mekko.js +71 -0
  413. package/dist/react/pareto.d.ts +1 -0
  414. package/dist/react/pareto.js +90 -0
  415. package/dist/react/pie.d.ts +1 -0
  416. package/dist/react/pie.js +64 -0
  417. package/dist/react/prepare.d.ts +1 -0
  418. package/dist/react/prepare.js +278 -0
  419. package/dist/react/pvm.d.ts +1 -0
  420. package/dist/react/pvm.js +68 -0
  421. package/dist/react/pyramid.d.ts +1 -0
  422. package/dist/react/pyramid.js +67 -0
  423. package/dist/react/sankey.d.ts +1 -0
  424. package/dist/react/sankey.js +59 -0
  425. package/dist/react/scatter.d.ts +1 -0
  426. package/dist/react/scatter.js +63 -0
  427. package/dist/react/slope.d.ts +1 -0
  428. package/dist/react/slope.js +64 -0
  429. package/dist/react/sparkline.d.ts +1 -0
  430. package/dist/react/sparkline.js +59 -0
  431. package/dist/react/spec.d.ts +1 -0
  432. package/dist/react/spec.js +379 -0
  433. package/dist/react/status.d.ts +1 -0
  434. package/dist/react/status.js +64 -0
  435. package/dist/react/story.d.ts +1 -0
  436. package/dist/react/story.js +140 -0
  437. package/dist/react/table.d.ts +1 -0
  438. package/dist/react/table.js +69 -0
  439. package/dist/react/theme.d.ts +1 -0
  440. package/dist/react/theme.js +53 -0
  441. package/dist/react/tilemap.d.ts +1 -0
  442. package/dist/react/tilemap.js +66 -0
  443. package/dist/react/treemap.d.ts +1 -0
  444. package/dist/react/treemap.js +61 -0
  445. package/dist/react/variance.d.ts +1 -0
  446. package/dist/react/variance.js +65 -0
  447. package/dist/react/waffle.d.ts +1 -0
  448. package/dist/react/waffle.js +62 -0
  449. package/dist/react/waterfall.d.ts +1 -0
  450. package/dist/react/waterfall.js +68 -0
  451. package/dist/resvg-ZOVDIZTV.js +23 -0
  452. package/dist/rows.d.ts +1 -0
  453. package/dist/rows.js +23 -0
  454. package/dist/rowsModule-YVLAROIP.js +27 -0
  455. package/dist/schema-2K6C3U24.js +23 -0
  456. package/dist/schema-2KIHLTYI.js +23 -0
  457. package/dist/schema-4HY2MWZC.js +30 -0
  458. package/dist/schema-4S5CXHAO.js +24 -0
  459. package/dist/schema-5BKQV56C.js +27 -0
  460. package/dist/schema-5HA5DSYN.js +24 -0
  461. package/dist/schema-5NKJPSBD.js +23 -0
  462. package/dist/schema-65FOKNHK.js +43 -0
  463. package/dist/schema-6OHZWHUI.js +23 -0
  464. package/dist/schema-6RYJS2GM.js +24 -0
  465. package/dist/schema-6W4M3WJ4.js +23 -0
  466. package/dist/schema-7TLSFG6M.js +24 -0
  467. package/dist/schema-AMFRKUFS.js +27 -0
  468. package/dist/schema-B7CZPPB4.js +28 -0
  469. package/dist/schema-BNRNHGHQ.js +26 -0
  470. package/dist/schema-E4MRCGPZ.js +24 -0
  471. package/dist/schema-F3WYTR65.js +26 -0
  472. package/dist/schema-FA6XIHTW.js +23 -0
  473. package/dist/schema-GZNOW4LX.js +23 -0
  474. package/dist/schema-HEIDGCSL.js +23 -0
  475. package/dist/schema-JB2H6KPA.js +23 -0
  476. package/dist/schema-MPXZNWV3.js +23 -0
  477. package/dist/schema-NHNQK6XO.js +23 -0
  478. package/dist/schema-NN6UPDPW.js +23 -0
  479. package/dist/schema-O4YNAGIY.js +23 -0
  480. package/dist/schema-O7AKK232.js +29 -0
  481. package/dist/schema-OJCML6LV.js +24 -0
  482. package/dist/schema-ORTRMYI6.js +24 -0
  483. package/dist/schema-PJ6P52BC.js +23 -0
  484. package/dist/schema-RTWES6NR.js +24 -0
  485. package/dist/schema-S36SRYGO.js +24 -0
  486. package/dist/schema-S3TCLTYD.js +23 -0
  487. package/dist/schema-SWWMOLOR.js +54 -0
  488. package/dist/schema-WOSEZNKG.js +26 -0
  489. package/dist/schema-Y6KBWUUR.js +23 -0
  490. package/dist/schema-YQYTLKSW.js +23 -0
  491. package/dist/schema-ZUUUY3QS.js +33 -0
  492. package/dist/specValidation-VNWIKLHH.js +49 -0
  493. package/dist/theme.d.ts +1 -0
  494. package/dist/theme.js +24 -0
  495. package/dist/themeShapeRules-2D3KWSPQ.js +11 -0
  496. package/dist/types/core/a11y/accessibility.d.ts +43 -0
  497. package/dist/types/core/a11y/recordsShared.d.ts +44 -0
  498. package/dist/types/core/a11y/structuralRecords.d.ts +6 -0
  499. package/dist/types/core/a11y/types.d.ts +116 -0
  500. package/dist/types/core/annotate.d.ts +300 -0
  501. package/dist/types/core/annotateArms.d.ts +37 -0
  502. package/dist/types/core/annotateFields.d.ts +30 -0
  503. package/dist/types/core/annotateGapBracket.d.ts +66 -0
  504. package/dist/types/core/annotateLinks.d.ts +47 -0
  505. package/dist/types/core/annotateTargets.d.ts +90 -0
  506. package/dist/types/core/axis.d.ts +179 -0
  507. package/dist/types/core/bandSelect.d.ts +10 -0
  508. package/dist/types/core/bands.d.ts +14 -0
  509. package/dist/types/core/calendarLabels.d.ts +101 -0
  510. package/dist/types/core/charts/band/stacks.d.ts +155 -0
  511. package/dist/types/core/charts/bar/fixtures.d.ts +9 -0
  512. package/dist/types/core/charts/bar/layout.d.ts +95 -0
  513. package/dist/types/core/charts/bartable/fixtures.d.ts +4 -0
  514. package/dist/types/core/charts/bartable/types.d.ts +192 -0
  515. package/dist/types/core/charts/box/fixtures.d.ts +12 -0
  516. package/dist/types/core/charts/box/types.d.ts +110 -0
  517. package/dist/types/core/charts/bullet/fixtures.d.ts +11 -0
  518. package/dist/types/core/charts/butterfly/fixtures.d.ts +9 -0
  519. package/dist/types/core/charts/choropleth/fixtures.d.ts +3 -0
  520. package/dist/types/core/charts/choropleth/overlayTypes.d.ts +68 -0
  521. package/dist/types/core/charts/choropleth/types.d.ts +117 -0
  522. package/dist/types/core/charts/cohort/fixtures.d.ts +12 -0
  523. package/dist/types/core/charts/cohort/types.d.ts +165 -0
  524. package/dist/types/core/charts/column/anomaly.d.ts +204 -0
  525. package/dist/types/core/charts/column/fixtures.d.ts +12 -0
  526. package/dist/types/core/charts/column/layout.d.ts +116 -0
  527. package/dist/types/core/charts/column/model.d.ts +295 -0
  528. package/dist/types/core/charts/column/types.d.ts +56 -0
  529. package/dist/types/core/charts/combo/endpoints.d.ts +165 -0
  530. package/dist/types/core/charts/combo/fixtures.d.ts +12 -0
  531. package/dist/types/core/charts/combo/layout.d.ts +48 -0
  532. package/dist/types/core/charts/creative/fixtures.d.ts +4 -0
  533. package/dist/types/core/charts/creative/types.d.ts +73 -0
  534. package/dist/types/core/charts/diagram/fixtures.d.ts +3 -0
  535. package/dist/types/core/charts/dimswitch/compile.d.ts +20 -0
  536. package/dist/types/core/charts/dimswitch/fixtures.d.ts +3 -0
  537. package/dist/types/core/charts/dimswitch/types.d.ts +152 -0
  538. package/dist/types/core/charts/dot/fixtures.d.ts +11 -0
  539. package/dist/types/core/charts/funnel/fixtures.d.ts +11 -0
  540. package/dist/types/core/charts/gantt/fixtures.d.ts +9 -0
  541. package/dist/types/core/charts/gantt/layout.d.ts +63 -0
  542. package/dist/types/core/charts/grid/fixtures.d.ts +3 -0
  543. package/dist/types/core/charts/grid/metricStack.d.ts +108 -0
  544. package/dist/types/core/charts/grid/metricStackSchema.d.ts +74 -0
  545. package/dist/types/core/charts/grid/normalize.d.ts +99 -0
  546. package/dist/types/core/charts/grid/schema.d.ts +168 -0
  547. package/dist/types/core/charts/heatmap/fixtures.d.ts +11 -0
  548. package/dist/types/core/charts/histogram/fixtures.d.ts +15 -0
  549. package/dist/types/core/charts/histogram/types.d.ts +98 -0
  550. package/dist/types/core/charts/kpi/fixtures.d.ts +9 -0
  551. package/dist/types/core/charts/likert/fixtures.d.ts +11 -0
  552. package/dist/types/core/charts/likert/layout.d.ts +111 -0
  553. package/dist/types/core/charts/line/fixtures.d.ts +16 -0
  554. package/dist/types/core/charts/line/types.d.ts +6 -0
  555. package/dist/types/core/charts/mekko/fixtures.d.ts +13 -0
  556. package/dist/types/core/charts/pareto/fixtures.d.ts +5 -0
  557. package/dist/types/core/charts/pareto/layout.d.ts +68 -0
  558. package/dist/types/core/charts/pie/fixtures.d.ts +14 -0
  559. package/dist/types/core/charts/pvm/fixtures.d.ts +13 -0
  560. package/dist/types/core/charts/pvm/types.d.ts +118 -0
  561. package/dist/types/core/charts/pyramid/fixtures.d.ts +4 -0
  562. package/dist/types/core/charts/pyramid/types.d.ts +92 -0
  563. package/dist/types/core/charts/sankey/fixtures.d.ts +4 -0
  564. package/dist/types/core/charts/sankey/types.d.ts +116 -0
  565. package/dist/types/core/charts/scatter/fixtures.d.ts +12 -0
  566. package/dist/types/core/charts/scatter/types.d.ts +58 -0
  567. package/dist/types/core/charts/slope/fixtures.d.ts +13 -0
  568. package/dist/types/core/charts/sparkline/fixtures.d.ts +9 -0
  569. package/dist/types/core/charts/status/fixtures.d.ts +8 -0
  570. package/dist/types/core/charts/status/layout.d.ts +71 -0
  571. package/dist/types/core/charts/table/fitFormats.d.ts +67 -0
  572. package/dist/types/core/charts/table/fixtures.d.ts +7 -0
  573. package/dist/types/core/charts/table/resolve.d.ts +72 -0
  574. package/dist/types/core/charts/table/view.d.ts +156 -0
  575. package/dist/types/core/charts/tilemap/fixtures.d.ts +3 -0
  576. package/dist/types/core/charts/tilemap/types.d.ts +94 -0
  577. package/dist/types/core/charts/treemap/fixtures.d.ts +4 -0
  578. package/dist/types/core/charts/treemap/types.d.ts +78 -0
  579. package/dist/types/core/charts/variance/fixtures.d.ts +12 -0
  580. package/dist/types/core/charts/waffle/fixtures.d.ts +5 -0
  581. package/dist/types/core/charts/waffle/types.d.ts +117 -0
  582. package/dist/types/core/charts/waterfall/fixtures.d.ts +9 -0
  583. package/dist/types/core/claims/browser.d.ts +49 -0
  584. package/dist/types/core/claims/manifest.d.ts +22 -0
  585. package/dist/types/core/dateFormat.d.ts +39 -0
  586. package/dist/types/core/deferred.d.ts +121 -0
  587. package/dist/types/core/diagnostics/describe.d.ts +149 -0
  588. package/dist/types/core/diagnostics/jsonPatch.d.ts +36 -0
  589. package/dist/types/core/doc/bareChart.d.ts +2 -0
  590. package/dist/types/core/doc/diagnostics.d.ts +124 -0
  591. package/dist/types/core/doc/docExpand.d.ts +39 -0
  592. package/dist/types/core/doc/document.d.ts +43 -0
  593. package/dist/types/core/doc/ownedDocumentCopy.d.ts +5 -0
  594. package/dist/types/core/doc/specError.d.ts +6 -0
  595. package/dist/types/core/emptyData.d.ts +27 -0
  596. package/dist/types/core/eventLane.d.ts +208 -0
  597. package/dist/types/core/fontMetrics/index.d.ts +47 -0
  598. package/dist/types/core/fontMetrics/injected.d.ts +40 -0
  599. package/dist/types/core/fontMetrics/tableDocument.d.ts +73 -0
  600. package/dist/types/core/fontMetrics/tables.generated.d.ts +17 -0
  601. package/dist/types/core/footer.d.ts +59 -0
  602. package/dist/types/core/format.d.ts +149 -0
  603. package/dist/types/core/formatPrecision.d.ts +136 -0
  604. package/dist/types/core/formatSpec.d.ts +304 -0
  605. package/dist/types/core/frame.d.ts +583 -0
  606. package/dist/types/core/geo/packs/all.d.ts +7 -0
  607. package/dist/types/core/geo/packs/dach.d.ts +16 -0
  608. package/dist/types/core/geo/packs/de-states.d.ts +16 -0
  609. package/dist/types/core/geo/packs/eu27.d.ts +16 -0
  610. package/dist/types/core/geo/packs/europe.d.ts +16 -0
  611. package/dist/types/core/geo/packs/index.d.ts +22 -0
  612. package/dist/types/core/geo/packs/registry.d.ts +37 -0
  613. package/dist/types/core/geo/packs/us-states.d.ts +16 -0
  614. package/dist/types/core/geo/packs/world.d.ts +16 -0
  615. package/dist/types/core/geo/tiles/eu27.generated.d.ts +412 -0
  616. package/dist/types/core/geo/tiles/europe.generated.d.ts +842 -0
  617. package/dist/types/core/geo/tiles/index.d.ts +8 -0
  618. package/dist/types/core/geo/tiles/types.d.ts +36 -0
  619. package/dist/types/core/geo/tiles/us-states.generated.d.ts +952 -0
  620. package/dist/types/core/geo/tiles/world.generated.d.ts +968 -0
  621. package/dist/types/core/geo/types.d.ts +146 -0
  622. package/dist/types/core/geometry.d.ts +102 -0
  623. package/dist/types/core/grid/sharedScale.d.ts +82 -0
  624. package/dist/types/core/icons.d.ts +227 -0
  625. package/dist/types/core/inputError.d.ts +14 -0
  626. package/dist/types/core/isoDate.d.ts +2 -0
  627. package/dist/types/core/isoTime.d.ts +7 -0
  628. package/dist/types/core/label/categoryRow.d.ts +332 -0
  629. package/dist/types/core/label/occupied.d.ts +41 -0
  630. package/dist/types/core/label/ownership.d.ts +83 -0
  631. package/dist/types/core/label/solver.d.ts +384 -0
  632. package/dist/types/core/label/tickRow.d.ts +78 -0
  633. package/dist/types/core/live/types.d.ts +50 -0
  634. package/dist/types/core/normalize/shared.d.ts +56 -0
  635. package/dist/types/core/notes.d.ts +174 -0
  636. package/dist/types/core/othersShade.d.ts +9 -0
  637. package/dist/types/core/periodYears.d.ts +9 -0
  638. package/dist/types/core/polyline.d.ts +11 -0
  639. package/dist/types/core/rangeRules.d.ts +19 -0
  640. package/dist/types/core/ratioTier.d.ts +120 -0
  641. package/dist/types/core/readerStrings.d.ts +13 -0
  642. package/dist/types/core/reading.d.ts +120 -0
  643. package/dist/types/core/registry.d.ts +178 -0
  644. package/dist/types/core/repaintGeometry.d.ts +19 -0
  645. package/dist/types/core/request.d.ts +124 -0
  646. package/dist/types/core/rows.d.ts +47 -0
  647. package/dist/types/core/scale.d.ts +106 -0
  648. package/dist/types/core/schema/capability.d.ts +229 -0
  649. package/dist/types/core/schema/namedColumns.d.ts +45 -0
  650. package/dist/types/core/schema/reference.d.ts +31 -0
  651. package/dist/types/core/schema/refusals.d.ts +45 -0
  652. package/dist/types/core/schema/unknownKeys.d.ts +45 -0
  653. package/dist/types/core/seriesIdentity.d.ts +120 -0
  654. package/dist/types/core/shareRounding.d.ts +49 -0
  655. package/dist/types/core/sizing.d.ts +330 -0
  656. package/dist/types/core/staticFooter.d.ts +6 -0
  657. package/dist/types/core/story.d.ts +41 -0
  658. package/dist/types/core/structureCounts.d.ts +10 -0
  659. package/dist/types/core/svg/renderSvg.d.ts +51 -0
  660. package/dist/types/core/target.d.ts +89 -0
  661. package/dist/types/core/text.d.ts +113 -0
  662. package/dist/types/core/theme.d.ts +478 -0
  663. package/dist/types/core/themeFields.d.ts +11 -0
  664. package/dist/types/core/themeRules.d.ts +111 -0
  665. package/dist/types/core/themeShape.d.ts +87 -0
  666. package/dist/types/core/themeValidate.d.ts +15 -0
  667. package/dist/types/core/timeAxis.d.ts +106 -0
  668. package/dist/types/core/types/annotations.d.ts +227 -0
  669. package/dist/types/core/types/cell.d.ts +82 -0
  670. package/dist/types/core/types/data.d.ts +314 -0
  671. package/dist/types/core/types/diagram.d.ts +234 -0
  672. package/dist/types/core/types/index.d.ts +8 -0
  673. package/dist/types/core/types/options.d.ts +1583 -0
  674. package/dist/types/core/types/scene.d.ts +990 -0
  675. package/dist/types/core/types/sizing.d.ts +51 -0
  676. package/dist/types/core/types/table.d.ts +873 -0
  677. package/dist/types/core/types/theme.d.ts +806 -0
  678. package/dist/types/core/zoom.d.ts +106 -0
  679. package/dist/types/fixtures/index.d.ts +40 -0
  680. package/dist/types/fixtures/registry.d.ts +15 -0
  681. package/dist/types/fonts.d.ts +10 -0
  682. package/dist/types/index.d.ts +70 -0
  683. package/dist/types/react/BoardplotTheme.d.ts +9 -0
  684. package/dist/types/react/DimSwitchChart.d.ts +36 -0
  685. package/dist/types/react/ScaleGroup.d.ts +31 -0
  686. package/dist/types/react/SceneRenderer.d.ts +23 -0
  687. package/dist/types/react/SizePlaceholder.d.ts +51 -0
  688. package/dist/types/react/StoryFrame.d.ts +42 -0
  689. package/dist/types/react/TableChart.d.ts +220 -0
  690. package/dist/types/react/a11ySurface.d.ts +20 -0
  691. package/dist/types/react/barrelCharts.d.ts +1023 -0
  692. package/dist/types/react/charts/bar.d.ts +28 -0
  693. package/dist/types/react/charts/bartable.d.ts +27 -0
  694. package/dist/types/react/charts/box.d.ts +27 -0
  695. package/dist/types/react/charts/bullet.d.ts +28 -0
  696. package/dist/types/react/charts/butterfly.d.ts +28 -0
  697. package/dist/types/react/charts/choropleth.d.ts +27 -0
  698. package/dist/types/react/charts/cohort.d.ts +52 -0
  699. package/dist/types/react/charts/column.d.ts +27 -0
  700. package/dist/types/react/charts/combo.d.ts +7 -0
  701. package/dist/types/react/charts/creative.d.ts +27 -0
  702. package/dist/types/react/charts/diagram.d.ts +162 -0
  703. package/dist/types/react/charts/dimswitch.d.ts +6 -0
  704. package/dist/types/react/charts/dot.d.ts +28 -0
  705. package/dist/types/react/charts/funnel.d.ts +28 -0
  706. package/dist/types/react/charts/gantt.d.ts +28 -0
  707. package/dist/types/react/charts/grid.d.ts +29 -0
  708. package/dist/types/react/charts/heatmap.d.ts +28 -0
  709. package/dist/types/react/charts/histogram.d.ts +27 -0
  710. package/dist/types/react/charts/kpi.d.ts +28 -0
  711. package/dist/types/react/charts/likert.d.ts +27 -0
  712. package/dist/types/react/charts/line.d.ts +28 -0
  713. package/dist/types/react/charts/mekko.d.ts +28 -0
  714. package/dist/types/react/charts/pareto.d.ts +28 -0
  715. package/dist/types/react/charts/pie.d.ts +28 -0
  716. package/dist/types/react/charts/pvm.d.ts +27 -0
  717. package/dist/types/react/charts/pyramid.d.ts +27 -0
  718. package/dist/types/react/charts/sankey.d.ts +27 -0
  719. package/dist/types/react/charts/scatter.d.ts +28 -0
  720. package/dist/types/react/charts/slope.d.ts +28 -0
  721. package/dist/types/react/charts/sparkline.d.ts +28 -0
  722. package/dist/types/react/charts/status.d.ts +27 -0
  723. package/dist/types/react/charts/table.d.ts +6 -0
  724. package/dist/types/react/charts/tilemap.d.ts +27 -0
  725. package/dist/types/react/charts/treemap.d.ts +27 -0
  726. package/dist/types/react/charts/variance.d.ts +28 -0
  727. package/dist/types/react/charts/waffle.d.ts +28 -0
  728. package/dist/types/react/charts/waterfall.d.ts +28 -0
  729. package/dist/types/react/createChartComponent.d.ts +135 -0
  730. package/dist/types/react/export/clipboard.d.ts +8 -0
  731. package/dist/types/react/export/csv.d.ts +2 -0
  732. package/dist/types/react/export/frame.d.ts +35 -0
  733. package/dist/types/react/export/index.d.ts +7 -0
  734. package/dist/types/react/export/png.d.ts +14 -0
  735. package/dist/types/react/export/svg.d.ts +5 -0
  736. package/dist/types/react/export/types.d.ts +69 -0
  737. package/dist/types/react/export/useExport.d.ts +17 -0
  738. package/dist/types/react/exportLink.d.ts +49 -0
  739. package/dist/types/react/footerFrame.d.ts +25 -0
  740. package/dist/types/react/hover/dataTable.d.ts +13 -0
  741. package/dist/types/react/hover/engine.d.ts +210 -0
  742. package/dist/types/react/hover/keyboard.d.ts +44 -0
  743. package/dist/types/react/hover/labelCard.d.ts +170 -0
  744. package/dist/types/react/hover/placement.d.ts +49 -0
  745. package/dist/types/react/index.d.ts +16 -0
  746. package/dist/types/react/parseChartSpec.d.ts +16 -0
  747. package/dist/types/react/prepare.d.ts +32 -0
  748. package/dist/types/react/prepared.d.ts +53 -0
  749. package/dist/types/react/preparedTable.d.ts +15 -0
  750. package/dist/types/react/rowsInput.d.ts +55 -0
  751. package/dist/types/react/rowsModule.d.ts +18 -0
  752. package/dist/types/react/rowsStore.d.ts +50 -0
  753. package/dist/types/react/scale-group.d.ts +2 -0
  754. package/dist/types/react/scaleGroupContext.d.ts +22 -0
  755. package/dist/types/react/scenePaint.d.ts +10 -0
  756. package/dist/types/react/scrollState.d.ts +26 -0
  757. package/dist/types/react/spec.d.ts +82 -0
  758. package/dist/types/react/specValidation.d.ts +45 -0
  759. package/dist/types/react/story.d.ts +15 -0
  760. package/dist/types/react/theme.d.ts +9 -0
  761. package/dist/types/react/themeContext.d.ts +44 -0
  762. package/dist/types/react/useChartLayout.d.ts +22 -0
  763. package/dist/types/react/useContainerSize.d.ts +57 -0
  764. package/dist/types/react/useHover.d.ts +100 -0
  765. package/dist/types/react/useZoom.d.ts +50 -0
  766. package/dist/types/rows.d.ts +63 -0
  767. package/dist/types/tableLooks.d.ts +6 -0
  768. package/dist/types/theme.d.ts +3 -0
  769. package/dist/types/validate.d.ts +3 -0
  770. package/dist/validate.d.ts +1 -0
  771. package/dist/validate.js +223 -0
  772. package/docs/FONTS.md +68 -0
  773. package/docs/TELEMETRY.md +94 -0
  774. package/docs/manual.md +850 -0
  775. package/docs/reference/bar.md +222 -0
  776. package/docs/reference/bartable.md +143 -0
  777. package/docs/reference/box.md +93 -0
  778. package/docs/reference/bullet.md +118 -0
  779. package/docs/reference/butterfly.md +117 -0
  780. package/docs/reference/choropleth.md +148 -0
  781. package/docs/reference/cohort.md +149 -0
  782. package/docs/reference/column.md +275 -0
  783. package/docs/reference/combo.md +219 -0
  784. package/docs/reference/creative.md +147 -0
  785. package/docs/reference/diagram.md +191 -0
  786. package/docs/reference/dimswitch.md +1395 -0
  787. package/docs/reference/dot.md +117 -0
  788. package/docs/reference/fixtures.md +1089 -0
  789. package/docs/reference/funnel.md +121 -0
  790. package/docs/reference/gantt.md +138 -0
  791. package/docs/reference/grid.md +302 -0
  792. package/docs/reference/heatmap.md +127 -0
  793. package/docs/reference/histogram.md +77 -0
  794. package/docs/reference/kpi.md +115 -0
  795. package/docs/reference/likert.md +113 -0
  796. package/docs/reference/line.md +436 -0
  797. package/docs/reference/mekko.md +114 -0
  798. package/docs/reference/options.md +313 -0
  799. package/docs/reference/pareto.md +102 -0
  800. package/docs/reference/pie.md +114 -0
  801. package/docs/reference/pvm.md +114 -0
  802. package/docs/reference/pyramid.md +99 -0
  803. package/docs/reference/react.md +706 -0
  804. package/docs/reference/reading.md +28 -0
  805. package/docs/reference/sankey.md +110 -0
  806. package/docs/reference/scatter.md +211 -0
  807. package/docs/reference/slope.md +126 -0
  808. package/docs/reference/sparkline.md +74 -0
  809. package/docs/reference/status.md +107 -0
  810. package/docs/reference/table.md +673 -0
  811. package/docs/reference/theme.md +361 -0
  812. package/docs/reference/tilemap.md +121 -0
  813. package/docs/reference/treemap.md +86 -0
  814. package/docs/reference/variance.md +126 -0
  815. package/docs/reference/waffle.md +106 -0
  816. package/docs/reference/waterfall.md +164 -0
  817. package/llms.txt +57 -0
  818. package/package.json +437 -4
@@ -0,0 +1,1182 @@
1
+ import {
2
+ headInk,
3
+ plainInk
4
+ } from "./chunk-QTZVVZ2A.js";
5
+ import {
6
+ marginBracketLayout
7
+ } from "./chunk-XXOHXA3A.js";
8
+ import {
9
+ labelOn
10
+ } from "./chunk-VJ3FCGQF.js";
11
+ import {
12
+ runAnnotatePass
13
+ } from "./chunk-KZS46KDY.js";
14
+ import {
15
+ rowLabelBand
16
+ } from "./chunk-X4YNDLVA.js";
17
+ import {
18
+ GUTTER_MAX_SHARE,
19
+ fittedLabel,
20
+ gutterBudget,
21
+ stepDownFont
22
+ } from "./chunk-ZQF34VPS.js";
23
+ import {
24
+ chartTheme
25
+ } from "./chunk-3QWZAEW5.js";
26
+ import {
27
+ rowDrivenHeight
28
+ } from "./chunk-GZTNTHSW.js";
29
+ import {
30
+ structureCount
31
+ } from "./chunk-LFX7W4B7.js";
32
+ import {
33
+ emptyIdRecord
34
+ } from "./chunk-LINZPU5D.js";
35
+ import {
36
+ HARD_MINIMUM,
37
+ MONTH_START,
38
+ capPitch,
39
+ categoryLineAlign,
40
+ matrixWidths,
41
+ niceBelow,
42
+ niceStep,
43
+ planCategoryRow,
44
+ rotatedClaimRect,
45
+ rowSizing
46
+ } from "./chunk-RL3NUWMY.js";
47
+ import {
48
+ DEFAULT_NOTE_LIMIT,
49
+ HIDDEN_LABEL_LEAD,
50
+ PRIORITY,
51
+ authoredFootnoteCount,
52
+ authoredNotes,
53
+ categoryLabelsAndMarks,
54
+ createOccupiedIndex,
55
+ frameTextOptions,
56
+ labelCtx,
57
+ labelsToNodes,
58
+ legendOff,
59
+ legendRequired,
60
+ normalizeLegendOption,
61
+ plotHeightAfter,
62
+ round2,
63
+ solveFrame,
64
+ solveLabels,
65
+ valueNoteLine
66
+ } from "./chunk-SS42FJVN.js";
67
+ import {
68
+ disclosureNote
69
+ } from "./chunk-BPKXEMRE.js";
70
+ import {
71
+ AUTOMATIC_FORMAT,
72
+ defaultFormatSpec,
73
+ exampleSpec,
74
+ formatNonzeroWithSpec,
75
+ formatterFromExample,
76
+ parseFormatExample,
77
+ rasterDecimals,
78
+ seriesRasterFormatter,
79
+ specUnitKind
80
+ } from "./chunk-RGZGLKFB.js";
81
+ import {
82
+ NOT_AVAILABLE,
83
+ chartStrings,
84
+ defaultNumberDecimals,
85
+ formatAutomaticNumber,
86
+ nonzeroDecimals,
87
+ numberRange
88
+ } from "./chunk-53OYF4ZT.js";
89
+ import {
90
+ cellMeta,
91
+ cellValue,
92
+ isPctCell
93
+ } from "./chunk-O3VN6BTL.js";
94
+ import {
95
+ arrowHeadPath,
96
+ arrowShaftEnd,
97
+ canvasMargin,
98
+ colorblindPaint,
99
+ emphasisWeight,
100
+ harveyWedgePath,
101
+ paintColor,
102
+ panelTypeClass,
103
+ readerFloorPx,
104
+ resolveSemanticPaletteTheme,
105
+ semanticPalettePaint,
106
+ sequentialShare,
107
+ strokeToken,
108
+ textScaleOf
109
+ } from "./chunk-CWDHCSL2.js";
110
+ import {
111
+ DEFAULT_TARGET,
112
+ NormalizeError,
113
+ accessibleTitle,
114
+ normalizeCategory,
115
+ normalizeSeriesValues,
116
+ resolveHighlight,
117
+ resolveSize
118
+ } from "./chunk-SGD3ZHID.js";
119
+ import {
120
+ maxOf,
121
+ minOf,
122
+ pushAll
123
+ } from "./chunk-WYJEOMNY.js";
124
+ import {
125
+ defaultMeasurer,
126
+ wrapText
127
+ } from "./chunk-AG2CJ4JY.js";
128
+
129
+ // src/core/strings/heatmap.ts
130
+ var EN = {
131
+ // reader-facing wording linked only by its consumers.
132
+ noData: "No data",
133
+ hatchedNoData: "Hatched cells: no data.",
134
+ heatmapBaseNote: "Hatched {v1}: base below n = {v2}, read with care.",
135
+ circles: "circles",
136
+ cellsLower: "cells",
137
+ harveyBallName: "Harvey-ball",
138
+ bubbleScaleWord: "bubble{v1}",
139
+ circleAreaSize: " (circle area shows size)",
140
+ discrete: "discrete",
141
+ continuous: "continuous",
142
+ heatmapDescStart: "{v1} matrix, {v2} rows \xD7 {v3} columns. ",
143
+ valuesRange: "Values range {v1} to {v2}. ",
144
+ invertedRowsDesc: "Lower is better for {v1}. ",
145
+ rowMeansSentence: "Row means: {v1}.",
146
+ heatmapTitle: "Heatmap: {v1} \xD7 {v2} matrix",
147
+ // The note under a bubble matrix that prints values in its largest circles only.
148
+ heatmapTopValuesNote: "Values shown in the largest circles.",
149
+ // The callout under a value matrix whose story value has no room in its cell ("Aug low").
150
+ heatmapLeadLow: "{v1} low",
151
+ heatmapLeadHigh: "{v1} high"
152
+ }, DE = {
153
+ // reader-facing wording linked only by its consumers.
154
+ noData: "Keine Daten",
155
+ hatchedNoData: "Schraffierte Zellen: keine Daten.",
156
+ heatmapBaseNote: "Schraffierte {v1}: Basis unter n = {v2}; vorsichtig lesen.",
157
+ circles: "Kreise",
158
+ cellsLower: "Zellen",
159
+ harveyBallName: "Harvey-Ball",
160
+ bubbleScaleWord: "Blasendiagramm{v1}",
161
+ circleAreaSize: " (Kreisfl\xE4che zeigt Gr\xF6\xDFe)",
162
+ discrete: "diskret",
163
+ continuous: "stetig",
164
+ heatmapDescStart: "{v1} Matrix, {v2} {v2|Zeile|Zeilen} \xD7 {v3} {v3|Spalte|Spalten}. ",
165
+ valuesRange: "Wertespanne {v1} bis {v2}. ",
166
+ invertedRowsDesc: "Niedriger ist besser f\xFCr {v1}. ",
167
+ rowMeansSentence: "Zeilenmittel: {v1}.",
168
+ heatmapTitle: "W\xE4rmekarte: {v1} \xD7 {v2} Matrix",
169
+ // The note under a bubble matrix that prints values in its largest circles only.
170
+ heatmapTopValuesNote: "Werte stehen in den gr\xF6\xDFten Kreisen.",
171
+ heatmapLeadLow: "{v1} Tief",
172
+ heatmapLeadHigh: "{v1} Hoch"
173
+ }, { chartString } = chartStrings(EN, DE);
174
+
175
+ // src/core/charts/heatmap/layout.ts
176
+ function withSuffixFloor(widths, width, short) {
177
+ return short > 0 ? { ...widths, minWidth: Math.max(widths.minWidth, width + Math.ceil(short / GUTTER_MAX_SHARE)) } : widths;
178
+ }
179
+ var HARVEY_ROW = 42, HARVEY_ROW_CARD = 36, HARVEY_LIST_ROW = 27, HARVEY_LIST_CELL = 28, HARVEY_HEADER_GAP = 8, HARVEY_BOTTOM_GAP = 12, BASE_CELL_GAP = 2, VALUE_CELL_GAP = 1.5, VALUE_ROW_CARD = 22, VALUE_ROW_NARROW = 26, VALUE_ROW_WIDE = 32.5, VALUE_KEY_GAP = 8, UPRIGHT_TIER_PITCH = 44, ROW_BAND_GAP = 8, HEADER_GAP = 4, CALLOUT_SEAT = 16, CARET_ROOM = 8, NO_DATA_PAINT = { token: "grid" }, BRACKET_CLEAR = 6, TRACK_ROOM = 12, KEY_GAP = 12, KEY_GROUP_GAP = 32, KEY_BAR_H = 10, KEY_DOT_R = 5.5, KEY_TEXT_GAP = 5, KEY_ENTRY_GAP = 14, BUBBLE_AIR = 2, BUBBLE_AIR_TIGHT = 1, VALUE_OVERHANG = 1.5, TIER_GAP = 2, TIER_NAME_GAP = 8, TICK_CLEAR = 4, TURNED = /* @__PURE__ */ Symbol("heatmapTurned");
180
+ function layoutHeatmap(data, options = {}, bracketGutter, valueNote, forceRows = [], compactKey = !1) {
181
+ let warnings = [], theme = resolveSemanticPaletteTheme(
182
+ chartTheme(options),
183
+ options.palette,
184
+ warnings
185
+ ), size = resolveSize(options.size), measure = options.measure ?? defaultMeasurer, scale = options.scale ?? "continuous", glyph = options.variant ?? "value", highlights = new Set(resolveHighlight(options.highlight)), labelOn2 = (kind) => labelOn(options, kind, ["series", "category"]), cellLabelsOn = glyph !== "harvey" && labelOn2("point"), bubble = glyph === "bubble", valueStyle = glyph === "value" && options.heatKey === void 0 && panelTypeClass(options) === void 0, CELL_GAP = valueStyle ? VALUE_CELL_GAP : BASE_CELL_GAP, bubbleStyle = bubble && options.heatKey === void 0 && panelTypeClass(options) === void 0, harveyStyle = glyph === "harvey" && options.heatKey === void 0 && panelTypeClass(options) === void 0, turned = (bubbleStyle || harveyStyle) && options[TURNED] === !0, harveyList = harveyStyle && turned, harveyWide = harveyStyle && !harveyList && size.width >= 720;
186
+ if (!data || !Array.isArray(data.categories) || data.categories.length === 0)
187
+ throw new NormalizeError("empty-data", "categories", "heatmap requires at least one category (column)");
188
+ if (!Array.isArray(data.series) || data.series.length === 0)
189
+ throw new NormalizeError("empty-data", "series", "heatmap requires at least one series (row)");
190
+ let rawCats = data.categories.map((c, i) => normalizeCategory(c, i)), cols = rawCats.map((c) => ({ id: c.id, label: c.label ?? c.id, date: c.date, ...c.footnote === void 0 ? {} : { footnote: c.footnote } })), rows = data.series.map((s, i) => {
191
+ if (!s?.id) throw new NormalizeError("missing-id", `series[${i}]`, "series requires an id");
192
+ let { sizes, bases } = s;
193
+ if ((sizes?.length ?? 0) > rawCats.length || (bases?.length ?? 0) > rawCats.length)
194
+ throw new NormalizeError("length-mismatch", `series[${s.id}]`, `series '${s.id}' has more sizes or bases than the ${rawCats.length} categories`, "give one size and one base per category, in category order");
195
+ let cells = normalizeSeriesValues(s, rawCats, i).map((c, ci) => ({
196
+ v: cellValue(c),
197
+ pct: isPctCell(c),
198
+ meta: cellMeta(c),
199
+ size: sizes?.[ci] ?? null,
200
+ base: bases?.[ci] ?? null
201
+ }));
202
+ return { id: s.id, label: s.label ?? s.id, direction: s.direction, format: s.format, unit: s.unit, cells };
203
+ });
204
+ glyph === "harvey" && rows.forEach((r, si) => r.cells.forEach((cell, ci) => {
205
+ let v = cell.v;
206
+ if (v === null || Number.isInteger(v) && v >= 0 && v <= 4) return;
207
+ let keyed = data.series[si].values.findIndex((raw) => typeof raw == "object" && raw !== null && "categoryId" in raw && raw.categoryId === rawCats[ci].id), vi = keyed >= 0 ? keyed : ci;
208
+ throw new NormalizeError(
209
+ "harvey-ratings",
210
+ `series[${r.id}].values[${vi}]`,
211
+ `a Harvey ball shows a rating 0 to 4; series '${r.id}' holds ${v} for '${rawCats[ci].id}'`,
212
+ "supply ratings 0 to 4 or use numeric cells",
213
+ [{ op: "replace", path: "/options/variant", value: "value" }],
214
+ ["data", "series", si, "values", vi]
215
+ );
216
+ }));
217
+ let levels = options.bubble?.levels, hasSizes = data.series.some((s) => s.sizes !== void 0);
218
+ bubble && levels && rows.forEach((r, si) => r.cells.forEach((cell, ci) => {
219
+ let v = cell.size;
220
+ if (!(v === null || Number.isInteger(v) && v >= 1 && v <= levels.length))
221
+ throw new NormalizeError(
222
+ "bubble-levels",
223
+ `series[${r.id}].sizes[${ci}]`,
224
+ `a bubble size level runs 1 to ${levels.length} (${levels.join(", ")}); series '${r.id}' holds ${v} for '${rawCats[ci].id}'`,
225
+ "supply levels 1 to n or drop options.bubble.levels for a continuous area scale",
226
+ void 0,
227
+ ["data", "series", si, "sizes", ci]
228
+ );
229
+ })), hasSizes && !bubble && warnings.push({ code: "sizes-ignored", severity: "warn", message: "series sizes size the bubble glyph only; this matrix draws no circles", suggest: "set variant 'bubble' or drop sizes", field: ["options", "variant"] }), options.minBase !== void 0 && !data.series.some((s) => s.bases !== void 0) && warnings.push({ code: "min-base-without-bases", severity: "warn", message: "minBase marks low-base cells, but no series supplies bases", suggest: "add series bases or drop minBase", field: ["options", "minBase"] });
230
+ let lowBase = (cell) => options.minBase !== void 0 && cell.base !== null && cell.base < options.minBase, meanOf = (vals) => {
231
+ let known = vals.filter((v) => v !== null);
232
+ return known.length > 0 ? known.reduce((a, b) => a + b, 0) / known.length : null;
233
+ }, colMeanAt = (ci) => meanOf(rows.map((r) => r.cells[ci].v)), rowMeanOf = (r) => meanOf(r.cells.map((c) => c.v)), byMean = (means, direction) => (a, b) => {
234
+ let ma = means[a], mb = means[b];
235
+ return ma === null || mb === null ? +(ma === null) - +(mb === null) || a - b : direction * (ma - mb) || a - b;
236
+ }, catSort = options.sort?.categories ?? "sheet";
237
+ if (catSort !== "sheet") {
238
+ let idx = cols.map((_, i) => i), means = cols.map((_, i) => colMeanAt(i));
239
+ catSort === "asc" ? idx.sort(byMean(means, 1)) : catSort === "desc" ? idx.sort(byMean(means, -1)) : idx.reverse(), cols = idx.map((i) => cols[i]), rows = rows.map((r) => ({ ...r, cells: idx.map((i) => r.cells[i]) }));
240
+ }
241
+ let segSort = options.sort?.segments ?? "sheet";
242
+ if (segSort !== "sheet") {
243
+ let idx = rows.map((_, i) => i), means = rows.map((r) => rowMeanOf(r));
244
+ segSort === "asc" ? idx.sort(byMean(means, 1)) : segSort === "desc" ? idx.sort(byMean(means, -1)) : idx.reverse(), rows = idx.map((i) => rows[i]);
245
+ }
246
+ let allValues = [];
247
+ for (let r of rows) for (let c of r.cells) c.v !== null && allValues.push(c.v);
248
+ let rasterSpec = defaultFormatSpec(options.locale?.language), decimals = rasterDecimals(allValues, rasterSpec), fmt = options.format ? formatterFromExample(options.format, options.locale?.language) : (v) => formatAutomaticNumber(v, { locale: options.locale?.language, decimals: defaultNumberDecimals(v, nonzeroDecimals(v, decimals), options.unit, options.target) }), formats = seriesRasterFormatter(options.format, allValues, options.locale?.language, options.unit, options.target), vMax = allValues.length > 0 ? maxOf(allValues) : 0, vMin = allValues.length > 0 ? minOf(allValues) : 0, posMax = Math.max(0, vMax), negMin = Math.min(0, vMin), pctMatrix = allValues.length > 0 && rows.every((r) => r.cells.every((c) => c.v === null || c.pct)), cap = scale === "continuous" ? pctMatrix ? options.cap?.pct : options.cap?.abs : void 0, valenceSpan = cap ?? Math.max(posMax, -negMin), rowMeans = emptyIdRecord();
249
+ for (let r of rows) rowMeans[r.id] = rowMeanOf(r);
250
+ let colMeans = emptyIdRecord();
251
+ cols.forEach((c, ci) => colMeans[c.id] = colMeanAt(ci));
252
+ let dataRows = rows, dataCols = cols;
253
+ if (turned) {
254
+ let lead2 = rows[0], turnedRows = cols.map((c, ci) => ({ id: c.id, label: c.label, direction: lead2.direction, format: lead2.format, unit: lead2.unit, cells: rows.map((r) => r.cells[ci]) }));
255
+ cols = rows.map((r) => ({ id: r.id, label: r.label })), rows = turnedRows;
256
+ }
257
+ let seriesOf = (r, c) => turned ? c.id : r.id, categoryOf = (r, c) => turned ? r.id : c.id, cellKey = (r, c) => `${seriesOf(r, c)}:${categoryOf(r, c)}`, rowLabelId = (r) => turned ? `category:${r.id}` : `series:${r.id}`, colLabelId = (c) => turned ? `series:${c.id}` : `category:${c.id}`, rowOwner = (r) => turned ? { categoryId: r.id } : { seriesId: r.id }, colOwner = (c) => turned ? { seriesId: c.id } : { categoryId: c.id }, isRatingScale = allValues.every((v) => Number.isInteger(v) && v >= 0 && v <= 4), bins = scale === "discrete" ? options.breaks : void 0;
258
+ options.breaks && !bins && warnings.push({ code: "breaks-ignored", severity: "warn", message: "breaks bin the discrete scale; the continuous scale ignores them", suggest: "set scale 'discrete' or drop breaks", field: ["options", "breaks"] }), bins && allValues.some((v) => v < bins[0] || v > bins.at(-1)) && warnings.push({ code: "value-outside-breaks", severity: "warn", message: `values outside ${numberRange(fmt(bins[0]), fmt(bins.at(-1)))} take the nearest end bin`, suggest: "widen the first or last break", field: ["options", "breaks"] });
259
+ let lower = (s) => s.direction === "lowerIsBetter", flipped = data.series.findIndex((s) => lower(s) !== lower(data.series[0]));
260
+ if ((bins || glyph === "bubble" && scale === "continuous" && data.series.some((s) => s.direction !== void 0)) && options.legend !== "none" && flipped > 0)
261
+ throw new NormalizeError(
262
+ "mixed-directions",
263
+ `series[${data.series[flipped].id}].direction`,
264
+ `series '${data.series[0].id}' and '${data.series[flipped].id}' read the colour key in opposite directions, but one shared colour key cannot show both`,
265
+ "give every row one direction, or split the lowerIsBetter rows into their own chart",
266
+ void 0,
267
+ ["data", "series", flipped, "direction"]
268
+ );
269
+ let binOf = (v) => {
270
+ let i = bins.length - 2;
271
+ for (; i > 0 && v < bins[i]; ) i--;
272
+ return i;
273
+ };
274
+ scale === "discrete" && !bins && !isRatingScale && allValues.length > 0 && warnings.push({
275
+ code: "discrete-quintiles",
276
+ severity: "warn",
277
+ message: `discrete scale expects integer values 0\u20134; values ${numberRange(fmt(vMin), fmt(vMax))} mapped to quintiles`
278
+ });
279
+ let levelOf = (v) => isRatingScale ? v : vMax === vMin ? 2 : Math.min(4, Math.floor((v - vMin) / (vMax - vMin) * 5)), declaredDirections = rows.some((r) => r.direction !== void 0), valence = vMin < 0 || scale === "continuous" && declaredDirections;
280
+ options.cap && (scale === "discrete" || glyph === "harvey") && warnings.push({ code: "cap-ignored", severity: "warn", message: `cap does not apply to ${glyph === "harvey" ? "harvey glyphs" : "the discrete rating ladder"}; it sets where the continuous scale saturates`, suggest: "drop cap", field: ["options", "cap"] }), declaredDirections && (scale === "discrete" && !bins || glyph === "harvey") && warnings.push({
281
+ code: "direction-ignored",
282
+ severity: "warn",
283
+ message: glyph === "harvey" ? "series.direction does not recolor harvey glyphs \u2014 cells stay white and the declared judgment is not painted" : "series.direction does not apply to the discrete rating ladder \u2014 the declared judgment is not painted"
284
+ });
285
+ let LADDER_PAINTS = [
286
+ semanticPalettePaint(theme, options.palette, "neutralMark", 0.85),
287
+ semanticPalettePaint(theme, options.palette, "sequential", 0.72),
288
+ semanticPalettePaint(theme, options.palette, "sequential", 0.48),
289
+ semanticPalettePaint(theme, options.palette, "sequential", 0.24),
290
+ semanticPalettePaint(theme, options.palette, "sequential")
291
+ ], valencePaint = (tone, _large, tint) => options.colorblindSafe ? { ...colorblindPaint(tone, !0), tint } : { token: tone === "good" ? "goodFill" : "badFill", tint }, fillPaint = (v, meta, large, direction) => {
292
+ if (meta?.fill) return { css: meta.fill };
293
+ if (v === null || glyph === "harvey") return { token: "background" };
294
+ if (bins) return binPaint(binOf(v), large, direction);
295
+ if (scale === "discrete")
296
+ return valence ? valencePaint(
297
+ v < 0 ? "bad" : "good",
298
+ large,
299
+ 1 - Math.min(1, Math.ceil(Math.abs(v) / (valenceSpan || 1) * 4) / 4)
300
+ ) : LADDER_PAINTS[Math.max(0, Math.min(4, levelOf(v)))];
301
+ let lowIsGood = direction === "lowerIsBetter";
302
+ if (v >= 0) {
303
+ if (valence) {
304
+ let amount2 = valenceSpan > 0 ? 1 - v / valenceSpan : 1;
305
+ return valencePaint(lowIsGood ? "bad" : "good", large, Math.max(0, Math.min(1, amount2)));
306
+ }
307
+ let tintAmount = Math.max(0, Math.min(1, 1 - (cap === void 0 ? sequentialShare(v, Math.max(0, vMin), posMax) : v / cap)));
308
+ return semanticPalettePaint(theme, options.palette, "sequential", tintAmount);
309
+ }
310
+ let amount = valenceSpan > 0 ? 1 + v / valenceSpan : 1;
311
+ return valencePaint(lowIsGood ? "good" : "bad", large, Math.max(0, Math.min(1, amount)));
312
+ };
313
+ function binPaint(bin, large, direction) {
314
+ let k = bins.length - 1;
315
+ if (!declaredDirections) return semanticPalettePaint(theme, options.palette, "sequential", k > 1 ? 0.75 * (k - 1 - bin) / (k - 1) : 0);
316
+ let s = (k > 1 ? 2 * bin / (k - 1) - 1 : 1) * (direction === "lowerIsBetter" ? -1 : 1);
317
+ return Math.abs(s) < 1e-9 ? semanticPalettePaint(theme, options.palette, "neutralMark", 0.55) : valencePaint(s < 0 ? "bad" : "good", large, 0.6 * (1 - Math.abs(s)));
318
+ }
319
+ let keySeries = rows[0]?.format && rows.every((row) => row.format === rows[0].format) ? rows[0] : void 0, keyLow = cap === void 0 ? vMin : Math.max(valence ? -cap : 0, Math.min(cap, vMin)), keyHigh = cap === void 0 ? vMax : Math.max(valence ? -cap : 0, Math.min(cap, vMax)), keyText = (v) => {
320
+ let value = cap !== void 0 && (v === keyHigh && vMax > cap || v === keyLow && vMin < -cap) && Number.isInteger(v) && !pctMatrix && !options.format && !keySeries?.format ? formatAutomaticNumber(v, { locale: options.locale?.language, decimals: 0 }) : displayFor(v, pctMatrix, null, keySeries);
321
+ return `${cap !== void 0 && v === keyHigh && vMax > cap ? ">=" : cap !== void 0 && v === keyLow && vMin < -cap ? "<=" : ""}${value}`;
322
+ }, annotations = (options.annotations ?? []).map((a, n) => ({
323
+ ...a,
324
+ id: a.id ?? `${a.kind}-${n + 1}`
325
+ })), tickFont = { family: theme.type.family, ...theme.type.axis }, labelFont = { family: theme.type.family, ...theme.type.label }, lineH = tickFont.size * 1.2, valueLabelFont = bubbleStyle ? { ...labelFont, weight: emphasisWeight(theme) } : labelFont, topOnly = bubbleStyle && cellLabelsOn && levels !== void 0 && levels.length >= 2 && rows.some((r) => r.cells.some((c) => c.v !== null && c.size === levels.length)), valueRadius = (text) => {
326
+ let t = measure(text, valueLabelFont);
327
+ return Math.hypot(t.width / 2 + 1, 0.35 * t.height);
328
+ }, topValueR = topOnly ? Math.max(0, maxOf(rows.flatMap((r) => r.cells.flatMap((c) => {
329
+ if (c.v === null || c.size !== levels.length) return [];
330
+ let text = textFor(c.v, c.pct, c.meta, r);
331
+ return text ? [valueRadius(text)] : [];
332
+ })))) : 0, continuousKey = scale === "continuous" && glyph === "value" && !options.heatKey && vMax > vMin && !compactKey && panelTypeClass(options) === void 0 && options.legend !== "none" && !rows.some((r) => r.direction === "lowerIsBetter"), keyRight = normalizeLegendOption(options.legend)?.position === "right", unitRise = continuousKey && !keyRight && options.unit ? Math.max(0, (measure(options.unit, tickFont).height - KEY_BAR_H) / 2) : 0, continuousKeyH = continuousKey && !keyRight ? unitRise + KEY_BAR_H + 6 + measure("0", tickFont).height + (valueStyle ? VALUE_KEY_GAP : KEY_GAP) : 0, keyBottom = normalizeLegendOption(options.legend)?.position === "bottom", occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { ...canvasMargin(theme, size.width), ...options.margin };
333
+ harveyWide && options.margin?.bottom === void 0 && (margin.bottom += HARVEY_BOTTOM_GAP);
334
+ let legend, missingCells = glyph !== "harvey" && options.heatKey === void 0 && rows.some((r) => r.cells.some((c) => c.v === null)), missingLook = options.missing ?? "hatch", hatchMissing = missingCells && missingLook !== "blank", anyLowBase = rows.some((r) => r.cells.some((c) => c.v !== null && lowBase(c))), lowBaseKey = `n < ${formatAutomaticNumber(options.minBase ?? 0, { locale: options.locale?.language })}`, scaleItems = glyph !== "harvey" && !bubble && allValues.length > 0 && panelTypeClass(options) === void 0 ? options.heatKey?.items ?? [...continuousKey ? [] : colourScaleKey(), ...missingCells ? [missingLook === "blank" ? { id: "scale:none", label: chartString(options, "noData"), paint: { token: "background" }, stroke: { token: "grid" } } : { id: "scale:none", label: chartString(options, "noData"), paint: NO_DATA_PAINT, pattern: "hatch45", hatchGround: { token: "background" }, stroke: { token: "grid" } }] : [], ...anyLowBase ? [{ id: "scale:lowBase", label: lowBaseKey, paint: { token: "neutralMark" }, pattern: "hatch45", hatchGround: { token: "background" } }] : []] : void 0, bubbleKeys = bubble && allValues.length > 0 && panelTypeClass(options) === void 0 && options.legend !== "none", derivedNotes = [
335
+ ...topOnly ? [disclosureNote(chartString(options, "heatmapTopValuesNote"))] : [],
336
+ ...valueNote ? [disclosureNote(valueNote)] : [],
337
+ ...bubble && missingCells ? [disclosureNote(missingLook === "blank" ? "Blank cells: no data." : chartString(options, "hatchedNoData"))] : [],
338
+ ...anyLowBase ? [disclosureNote(chartString(options, "heatmapBaseNote", { v1: bubble ? chartString(options, "circles") : chartString(options, "cellsLower"), v2: formatAutomaticNumber(options.minBase, { locale: options.locale?.language }) }))] : []
339
+ ];
340
+ scaleItems && options.legend === "none" && legendOff(warnings, options.heatKey?.chartType ?? "heatmap", scaleItems.map((item) => item.label));
341
+ let scaleKey = options.legend === "none" ? void 0 : scaleItems;
342
+ if (scaleKey?.length)
343
+ legend = {
344
+ options: legendRequired(options.legend, warnings, options.heatKey?.chartType ?? "heatmap", theme, "the shading says how large each value is"),
345
+ items: scaleKey
346
+ };
347
+ else if (glyph === "harvey" && allValues.length > 0) {
348
+ let legendOptions = normalizeLegendOption(options.legend), step = (vMax - vMin) / 5;
349
+ legendOptions && (legend = {
350
+ options: legendOptions,
351
+ items: [0, 1, 2, 3, 4].map((level) => ({
352
+ id: `level:${level}`,
353
+ label: isRatingScale ? String(level) : numberRange(fmt(vMin + level * step), fmt(level === 4 ? vMax : vMin + (level + 1) * step)),
354
+ paint: semanticPalettePaint(theme, options.palette, "sequential"),
355
+ key: "harvey",
356
+ level
357
+ }))
358
+ });
359
+ }
360
+ let frameResult = solveFrame(
361
+ {
362
+ size,
363
+ margin,
364
+ ...frameTextOptions(options),
365
+ ...derivedNotes.length > 0 ? { footnotes: [...authoredNotes(options), ...derivedNotes] } : {},
366
+ legend,
367
+ theme,
368
+ measure
369
+ },
370
+ occupied
371
+ ), keyRightW = continuousKey && keyRight ? KEY_BAR_H + 6 + KEY_GAP + Math.max(...[vMin, vMax, ...cap === void 0 ? [] : [-cap, cap]].map((v) => measure(`>=${displayFor(v, pctMatrix, null, keySeries)}`, tickFont).width)) : 0, plot0 = { ...frameResult.plot, w: Math.max(10, frameResult.plot.w - keyRightW) }, capW = Math.max(24, plot0.w * 0.28), cellHEst = (plot0.h - lineH - HEADER_GAP) / rows.length, card = size.width < 480 && !valueStyle, suffixed = options.rowSuffix && !turned ? rows.map((r) => ({ ...r, suffix: options.rowSuffix[r.id] })) : rows, fitRows = (maxLines, wider) => rowLabelBand(suffixed, tickFont, capW, maxLines, lineH, measure, {
372
+ wider,
373
+ target: options.target,
374
+ textScale: textScaleOf(options),
375
+ typeRole: "axis",
376
+ shrink: stepDownFont(theme, tickFont, "axis", options.target, textScaleOf(options))
377
+ }), rowGutter = bracketGutter ?? 0, naturalWider = gutterBudget(capW, plot0.w, ROW_BAND_GAP + rowGutter + cols.length * 28 + (cols.length - 1) * CELL_GAP), oneLine = card ? void 0 : fitRows(
378
+ cellHEst >= 2 * lineH + 4 && !(valueStyle && size.width < 480) ? 2 : 1,
379
+ Math.max(naturalWider, gutterBudget(capW, plot0.w, ROW_BAND_GAP + rowGutter + cols.length + (cols.length - 1) * CELL_GAP))
380
+ ), fittedRows = oneLine && !oneLine.labels.some((label) => label.title !== void 0) ? oneLine : fitRows(2, naturalWider), rowLines = fittedRows.labels.map((label, ri) => {
381
+ if (!valueStyle || !highlights.has(rows[ri].id)) return label;
382
+ let bold = { ...label.font, weight: emphasisWeight(theme) };
383
+ return { ...label, w: Math.max(label.w, ...label.lines.map((line) => measure(line, bold).width)) };
384
+ }), rowBandW = Math.max(fittedRows.width, maxOf(rowLines.map((label) => label.w))), rowSuffixShort = fittedRows.short, notes = annotations.filter((a) => a.kind === "callout" || a.kind === "note"), noteSize = (a, width = plot0.w, maxLines) => {
385
+ let ref = "at" in a ? a.at : void 0, ci = cols.findIndex((c) => c.id === (typeof ref == "string" ? ref : ref && "categoryId" in ref ? ref.categoryId : void 0)), row = rows.find((r) => typeof ref != "string" && ref && "seriesId" in ref && r.id === ref.seriesId), value = row?.cells[ci]?.v ?? colMeans[cols[ci]?.id ?? ""] ?? 0, body = "text" in a ? a.text ?? "${value}" : "${value}";
386
+ cellLabelsOn && row && (plot0.w - rowBandW - ROW_BAND_GAP) / cols.length > measure(displayFor(value, pctMatrix, null, row), labelFont).width + 6 && (body = body.replace(/:\s*\n\$\{value\}$/, ""));
387
+ let glyphRoom = "icon" in a && a.icon || "status" in a && a.status ? 29 : 0, source = `${"headline" in a && a.headline !== void 0 ? `${a.headline}
388
+ ` : ""}${body}`.replace(/\$\{value\}/g, displayFor(value, pctMatrix, null, row)), wrapped = wrapText(source, { ...labelFont, weight: emphasisWeight(theme) }, Math.max(1, width - glyphRoom), maxLines ?? Math.max(1, source.length), measure), lines = wrapped.lines, w = Math.max(...lines.map((line) => measure(line, { ...labelFont, weight: emphasisWeight(theme) }).width));
389
+ return { w, h: Math.max(glyphRoom ? 22 : 0, measure("0", labelFont).height * lines.length), sideW: w + (glyphRoom ? 38 : CALLOUT_SEAT), truncated: wrapped.truncated };
390
+ }, noteSizes = new Map(notes.map((a) => [a.id, noteSize(a)])), baseGutter = (bracketGutter ?? 0) + (bubble && options.bubble?.track ? TRACK_ROOM : 0), space = plot0.w - rowBandW - ROW_BAND_GAP - baseGutter, sideWrapWidth = Math.max(1, space * 0.15 / 1.15 - CALLOUT_SEAT), sideSizes = new Map(notes.map((a) => [a.id, noteSize(a, sideWrapWidth, 2)])), sideNotes = notes.filter((a) => !forceRows.includes(a.id) && (!("preferSide" in a) || a.preferSide !== "above" && a.preferSide !== "below")), sideWidth = (side) => Math.max(0, maxOf(sideNotes.filter((a) => ("preferSide" in a && a.preferSide === "left") == (side === "left")).map((a) => sideSizes.get(a.id).sideW)));
391
+ for (let pass = 0; pass <= notes.length; pass++) {
392
+ let budget = (space - sideWidth("left") - sideWidth("right")) * 0.15, failing = sideNotes.filter((a) => sideSizes.get(a.id).truncated || sideSizes.get(a.id).sideW > budget);
393
+ if (failing.length === 0) break;
394
+ let widest = failing.reduce((a, b) => noteSizes.get(a.id).sideW >= noteSizes.get(b.id).sideW ? a : b);
395
+ sideNotes = sideNotes.filter((a) => a !== widest);
396
+ }
397
+ let rowNotes = notes.filter((a) => !sideNotes.includes(a));
398
+ for (let a of rowNotes) {
399
+ let ref = "at" in a ? a.at : void 0;
400
+ if (typeof ref == "string" || !ref || !("categoryId" in ref) || !ref.seriesId || !("text" in a)) continue;
401
+ let row = rows.find((r) => r.id === ref.seriesId), col = cols.find((c) => c.id === ref.categoryId), body = valueStyle ? (a.text ?? "${value}").replace(/[ \t]*\n[ \t]*/g, `
402
+ `) : (a.text ?? "${value}").replace(/\s*\n\s*/g, " ");
403
+ if (a.id.startsWith("lead:")) continue;
404
+ let names = [...valueStyle && !("preferSide" in a && a.preferSide === "above") ? [] : [row?.label ?? ref.seriesId], col?.label ?? ref.categoryId].filter((name) => {
405
+ let literal = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
406
+ return !new RegExp(`(?:^|[^\\p{L}\\p{N}])${literal}(?:\\s*:|$)`, "u").test(body);
407
+ });
408
+ a.text = names.length ? `${names.join(" \xB7 ")}: ${body}` : body, noteSizes.set(a.id, noteSize(a));
409
+ }
410
+ let aboveNotes = rowNotes.filter((a) => "preferSide" in a && a.preferSide === "above"), belowNotes = rowNotes.filter((a) => !aboveNotes.includes(a)), rowHeight = (items) => items.reduce((sum, a) => sum + noteSizes.get(a.id).h + 8, 0), caretRoom = valueStyle && belowNotes.length > 0 ? CARET_ROOM : 0, annotationTopH = rowHeight(aboveNotes), annotationBottomH, leftRoom = sideWidth("left"), rightRoom = sideWidth("right"), gutterRight = baseGutter + rightRoom + (rowNotes.length && !valueStyle ? 8 : 0), gridX = harveyList ? plot0.x : plot0.x + rowBandW + ROW_BAND_GAP + leftRoom, gridW = harveyList ? HARVEY_LIST_CELL : Math.max(10, plot0.w - rowBandW - ROW_BAND_GAP - gutterRight - leftRoom), cellW = Math.max(1, (gridW - (cols.length - 1) * CELL_GAP) / cols.length), colStep = cellW + CELL_GAP, colCenter = (ci) => gridX + ci * colStep + cellW / 2, belowRows = [], seatBounds = /* @__PURE__ */ new Map();
411
+ {
412
+ let centreOf = (a) => {
413
+ let ref = "at" in a ? a.at : void 0, ci = cols.findIndex((c) => typeof ref == "object" && ref !== null && "categoryId" in ref && c.id === ref.categoryId);
414
+ return ci < 0 ? void 0 : colCenter(ci);
415
+ }, span = (a, [lo, hi] = seatBounds.get(a.id) ?? [gridX, plot0.x + plot0.w]) => {
416
+ let w = noteSizes.get(a.id).w, cx = centreOf(a), x = cx === void 0 ? lo : Math.max(lo, Math.min(cx - w / 2, hi - w));
417
+ return [x, x + w];
418
+ }, seriesOfNote = (a) => {
419
+ let ref = "at" in a ? a.at : void 0;
420
+ return typeof ref == "object" && ref !== null && "seriesId" in ref ? ref.seriesId : void 0;
421
+ }, seatBeside = (a, group) => {
422
+ let bounds = [gridX, plot0.x + plot0.w], cx = centreOf(a);
423
+ if (cx === void 0 || group.some((b) => seriesOfNote(b) !== seriesOfNote(a))) return;
424
+ for (let b of group) {
425
+ let [b0, b1] = span(b), bx = centreOf(b) ?? b0;
426
+ bounds = cx < bx ? [bounds[0], Math.min(bounds[1], b0 - 12)] : [Math.max(bounds[0], b1 + 12), bounds[1]];
427
+ }
428
+ let [x0, x1] = span(a, bounds);
429
+ return x0 >= bounds[0] - 1e-6 && x1 <= bounds[1] + 1e-6 && x0 <= cx - 4 && x1 >= cx + 4 ? bounds : void 0;
430
+ };
431
+ for (let a of belowNotes) {
432
+ let bounds, seat = valueStyle ? belowRows.find((group) => (bounds = seatBeside(a, group)) !== void 0) : void 0;
433
+ seat ? (seat.push(a), seatBounds.set(a.id, bounds)) : belowRows.push([a]);
434
+ }
435
+ annotationBottomH = belowRows.reduce((sum, group) => sum + maxOf(group.map((a) => noteSizes.get(a.id).h)) + 8, 0) + caretRoom;
436
+ }
437
+ let valueCell = topOnly ? 2 * (topValueR - VALUE_OVERHANG + BUBBLE_AIR_TIGHT) : 0, bubbleLo = Math.max(28, labelFont.size * 1.2 + 8, maxOf(rowLines.map((label) => label.h + 4)), valueCell < 40 && size.width < 720 ? valueCell : 2 * (topValueR - VALUE_OVERHANG + BUBBLE_AIR)), bubbleNaturalH = topOnly ? turned ? bubbleLo : Math.max(bubbleLo, Math.min(cellW, 1.5 * bubbleLo)) : Math.max(cellW, bubbleLo), SIN45 = Math.SQRT1_2, monthColumns = cols.every((c) => MONTH_START.exec(c.label.trim())?.[0] === c.label.trim()), lead = data.series[0], turnable = (bubbleStyle || harveyStyle && rows.length === 1) && !turned && cols.length > rows.length && !options.bubble?.track && annotations.length === 0 && !cols.some((c) => c.footnote !== void 0 || c.date !== void 0) && data.series.every((s) => s.direction === lead.direction && s.format === lead.format && s.unit === lead.unit), headerInput = {
438
+ // A Harvey row plans as before and turns into its list only where its names would rotate.
439
+ rotate: !turnable || harveyStyle,
440
+ ordered: monthColumns,
441
+ plotHeight: plot0.h,
442
+ maxRotatedWidth: Math.min(Math.max(110, plot0.h * 0.3 / SIN45), (colCenter(0) - plot0.x) / SIN45),
443
+ target: options.target,
444
+ textScale: textScaleOf(options),
445
+ ...categoryLabelsAndMarks(cols, { count: authoredFootnoteCount(options), warnings }),
446
+ centers: cols.map((_, ci) => colCenter(ci)),
447
+ step: colStep,
448
+ fonts: [tickFont, { family: theme.type.family, ...theme.type.footnote }],
449
+ measure
450
+ }, headerPlan = planCategoryRow(headerInput);
451
+ if (valueStyle && monthColumns && headerPlan.step !== "fit" && !cols.some((c) => c.footnote !== void 0)) {
452
+ let initials = planCategoryRow({ ...headerInput, labels: cols.map((c) => c.label.trim().charAt(0).toLocaleUpperCase(options.locale?.language)) });
453
+ initials.step === "fit" && (headerPlan = { ...initials, infos: initials.infos.map((info, ci) => ({ ...info, title: info.title ?? cols[ci].label })) });
454
+ }
455
+ monthColumns && headerPlan.step === "stride" && !cols.some((c) => c.footnote !== void 0) && (headerPlan.keep = cols.map((_, ci) => (cols.length - 1 - ci) % headerPlan.stride === 0));
456
+ let flatHeader = (plan) => ["fit", "wrap", "font-down"].includes(plan.step) && plan.rotation === 0 && plan.maxLines <= 2, tierLift = cols.map(() => 0), tierTicks = [], tiered = (oneLine2 = !1) => {
457
+ let font = headerPlan.font.size >= tickFont.size ? headerPlan.font : tickFont, lineHt = font.size * (font.lineHeight ?? 1.2), info = (label, width) => {
458
+ let one = measure(label, font).width;
459
+ if (one <= width && (oneLine2 || one <= colStep + 4 || !/\s/.test(label.trim()))) return { lines: [label], w: one, h: lineHt, truncated: !1 };
460
+ if (one <= width) {
461
+ let narrow = wrapText(label, font, Math.max(colStep + 4, ...label.split(/\s+/).map((word) => measure(word, font).width)), 2, measure), nw = Math.max(1, ...narrow.lines.map((line) => measure(line, font).width));
462
+ return !narrow.truncated && narrow.lines.length === 2 ? { lines: narrow.lines, w: nw, h: 2 * lineHt, truncated: !1 } : { lines: [label], w: one, h: lineHt, truncated: !1 };
463
+ }
464
+ let wrapped = wrapText(label, font, Math.max(1, width), 2, measure), w = Math.max(1, ...wrapped.lines.map((line) => measure(line, font).width));
465
+ return { lines: wrapped.lines, w, h: wrapped.lines.length * lineHt, truncated: wrapped.truncated || w > width + 1e-6 };
466
+ }, twoCols = Math.min(2 * colStep, plot0.w) - 2, centred = (ci) => 2 * Math.min(colStep, colCenter(ci) - plot0.x, plot0.x + plot0.w - colCenter(ci)) - 6, widestWord = (label) => Math.max(1, ...label.split(/\s+/).map((word) => measure(word, font).width));
467
+ for (let up of [0, 1]) {
468
+ let room = (ci) => ci % 2 === up ? [plot0.x, plot0.x + plot0.w] : [ci > 0 ? colCenter(ci - 1) + TICK_CLEAR : plot0.x, ci < cols.length - 1 ? colCenter(ci + 1) - TICK_CLEAR : plot0.x + plot0.w], limitOf = (ci) => Math.max(1, Math.min(twoCols, room(ci)[1] - room(ci)[0])), xsOf = (list) => {
469
+ let xs2 = list.map((item, ci) => Math.max(room(ci)[0], Math.min(room(ci)[1] - item.w, colCenter(ci) - item.w / 2)));
470
+ for (let ci = list.length - 3; ci >= 0; ci--) {
471
+ let limit = xs2[ci + 2] - TIER_NAME_GAP - list[ci].w;
472
+ xs2[ci] > limit && (xs2[ci] = Math.max(room(ci)[0], colCenter(ci) - list[ci].w, limit));
473
+ }
474
+ return xs2;
475
+ }, apartOf = (list, xs2) => list.every((item, ci) => !item.truncated && xs2[ci] >= room(ci)[0] - 1e-6 && xs2[ci] + item.w <= room(ci)[1] + 1e-6 && (ci < 2 || xs2[ci] >= xs2[ci - 2] + list[ci - 2].w + TIER_NAME_GAP)), infos = cols.map((c, ci) => info(c.label, limitOf(ci))), xs = xsOf(infos);
476
+ if (apartOf(infos, xs) || (infos = cols.map((c, ci) => {
477
+ let near = info(c.label, Math.min(limitOf(ci), Math.max(centred(ci), Math.min(twoCols, widestWord(c.label)))));
478
+ return near.truncated ? info(c.label, limitOf(ci)) : near;
479
+ }), xs = xsOf(infos)), apartOf(infos, xs) && infos.every((info2) => !info2.truncated && (!oneLine2 || info2.lines.length === 1))) {
480
+ let upper = (ci) => ci % 2 === up, tierH = [!0, !1].map((top) => maxOf(infos.filter((_, ci) => upper(ci) === top).map((info2) => info2.h)));
481
+ cols.forEach((_, ci) => tierLift[ci] = upper(ci) ? tierH[1] + TIER_GAP : 0), tierTicks = cols.map((_, ci) => ci).filter(upper);
482
+ let finalXs = xs;
483
+ return headerPlan = {
484
+ ...headerPlan,
485
+ font,
486
+ infos,
487
+ keep: cols.map(() => !0),
488
+ stride: 1,
489
+ rotation: 0,
490
+ warnings: [],
491
+ step: "wrap",
492
+ maxLines: maxOf(infos.map((info2) => info2.lines.length)),
493
+ rowHeight: tierH[0] + TIER_GAP + tierH[1],
494
+ x: (ci) => finalXs[ci]
495
+ }, !0;
496
+ }
497
+ }
498
+ return !1;
499
+ }, keepUpright = bubbleStyle && turnable && !flatHeader(headerPlan) && cols.length >= 2 && colStep >= UPRIGHT_TIER_PITCH && tiered(!0);
500
+ if (turnable && !flatHeader(headerPlan) && !keepUpright)
501
+ return layoutHeatmap(data, { ...options, [TURNED]: !0 }, bracketGutter, valueNote, forceRows, compactKey);
502
+ if (turned && !flatHeader(headerPlan) && cols.length >= 2 && tiered(), harveyList) {
503
+ let lineHt = tickFont.size * (tickFont.lineHeight ?? 1.2), infos = cols.map((c) => ({ lines: [c.label], w: measure(c.label, tickFont).width, h: lineHt, truncated: !1 }));
504
+ headerPlan = {
505
+ ...headerPlan,
506
+ font: tickFont,
507
+ infos,
508
+ keep: cols.map(() => !0),
509
+ stride: 1,
510
+ rotation: 0,
511
+ warnings: [],
512
+ step: "fit",
513
+ maxLines: 1,
514
+ rowHeight: lineHt,
515
+ x: () => plot0.x
516
+ };
517
+ }
518
+ let headerRotated = headerPlan.rotation !== 0, colLines = headerPlan.infos, headerFont = headerPlan.font, headerLines = headerPlan.maxLines, showHeaderRow = labelOn2("category") && cols.length > 0;
519
+ showHeaderRow && pushAll(warnings, headerPlan.warnings);
520
+ let headerH = showHeaderRow ? headerPlan.rowHeight + HEADER_GAP : 0, headerKeep = headerPlan.keep, keyFont = { family: theme.type.family, ...theme.type.axis }, keyLineH = keyFont.size * 1.2, keyTitled = options.bubble?.sizeLabel !== void 0 || options.bubble?.colorLabel !== void 0, styledKey = bubbleKeys && bubbleStyle ? planStyledBubbleKey() : void 0, keyH = styledKey ? styledKey.height + KEY_GAP : bubbleKeys ? (keyTitled ? keyLineH + 4 : 0) + Math.max(hasSizes ? cellW / 2 : 0, KEY_BAR_H) + 3 + keyLineH + KEY_GAP : 0, headerGap = harveyWide ? HARVEY_HEADER_GAP : 0, headTop = plot0.y + headerGap + keyH + annotationTopH + (keyBottom ? 0 : continuousKeyH), gridY = headTop + headerH, gridH = plotHeightAfter(frameResult, size.height, plot0.h - headerGap - headerH - keyH - continuousKeyH - annotationTopH - annotationBottomH);
521
+ if (continuousKey && !keyRight && !valueStyle && cellW < 2 * measure("0", labelFont).height)
522
+ return layoutHeatmap(data, options, bracketGutter, valueNote, forceRows, !0);
523
+ let fillH = Math.max(1, (gridH - (rows.length - 1) * CELL_GAP) / rows.length), cellH = glyph === "harvey" ? capPitch(fillH, 1, 2 * 0.68 * cellW) : bubble ? capPitch(fillH, 1, 1.5 * cellW) : fillH, rowStep = cellH + CELL_GAP, rowCenter = (ri) => gridY + ri * rowStep + cellH / 2, plot = { x: gridX, y: gridY, w: gridW, h: gridH }, rowFloor = valueStyle && size.width < 720 ? size.width < 480 ? VALUE_ROW_CARD : VALUE_ROW_NARROW : valueStyle && size.width >= 960 ? VALUE_ROW_WIDE : 28, valueLineH = valueStyle && cellLabelsOn && !rows.some((r) => measureRowLabels(
524
+ r.cells,
525
+ (v, pct, meta) => textFor(v, pct, meta, r),
526
+ { ...labelFont, size: readerFloorPx(options.target ?? DEFAULT_TARGET, "label", textScaleOf(options)) },
527
+ measure,
528
+ cellW,
529
+ 1 / 0,
530
+ 4
531
+ ).some((value) => value?.fits)) ? 0 : labelFont.size * 1.2 + 8, harveyRow = harveyList ? HARVEY_LIST_ROW : size.width >= 720 ? HARVEY_ROW : HARVEY_ROW_CARD, naturalCellH = bubbleStyle ? bubbleNaturalH : harveyStyle ? Math.max(harveyRow, maxOf(rowLines.map((label) => label.h + 4))) : Math.max(
532
+ bubble ? cellW : 0,
533
+ Math.max(rowFloor, valueLineH, maxOf(rowLines.map((label) => label.h + 4)))
534
+ ), keyShare = ((frameResult.legendBand ?? 0) + continuousKeyH + annotationTopH + annotationBottomH) / Math.max(1, rows.length), hard = options[HARD_MINIMUM] === !0, minRowH = Math.max(measure("0", labelFont).height + 2, hard ? 0 : 28 - keyShare);
535
+ {
536
+ let grow = rowDrivenHeight({
537
+ options,
538
+ width: size.width,
539
+ height: size.height,
540
+ chromeH: size.height - gridH,
541
+ rowsH: rows.length * naturalCellH + (rows.length - 1) * CELL_GAP
542
+ });
543
+ if (grow !== void 0) return layoutHeatmap(data, { ...options, size: { width: size.width, height: grow } }, bracketGutter, valueNote, forceRows, compactKey);
544
+ }
545
+ let nodes = [...frameResult.nodes];
546
+ continuousKey && drawContinuousKey();
547
+ let marks = { cells: [] }, labelRequests = [], anchorCell = /* @__PURE__ */ new Map(), cellBoxes = /* @__PURE__ */ new Map(), highlightWash = {
548
+ token: "focus",
549
+ theme: { kind: "visible-tint", base: { token: "focus" }, amount: "surface-anchor", floor: 1.2, roundStep: !0 }
550
+ }, barHighlight = glyph !== "harvey", outlines = [];
551
+ cols.forEach((c, ci) => {
552
+ if (!highlights.has(c.id)) return;
553
+ let nodeId = `colTint:${c.id}`;
554
+ if (barHighlight) {
555
+ outlines.push({ id: nodeId, rect: { x: gridX + ci * colStep, y: gridY, w: cellW, h: gridH }, owner: colOwner(c), part: "colTint" });
556
+ return;
557
+ }
558
+ nodes.push({
559
+ t: "rect",
560
+ id: nodeId,
561
+ rect: { x: gridX + ci * colStep - 2, y: headTop, w: cellW + 4, h: headerH + gridH },
562
+ fill: highlightWash,
563
+ owner: { categoryId: c.id },
564
+ part: "colTint"
565
+ });
566
+ }), rows.forEach((r, ri) => {
567
+ if (!highlights.has(r.id)) return;
568
+ let nodeId = `rowTint:${r.id}`;
569
+ if (barHighlight) {
570
+ outlines.push({ id: nodeId, rect: { x: gridX, y: gridY + ri * rowStep, w: gridW, h: cellH }, owner: rowOwner(r), part: "rowTint" });
571
+ return;
572
+ }
573
+ nodes.push({
574
+ t: "rect",
575
+ id: nodeId,
576
+ rect: { x: plot0.x, y: gridY + ri * rowStep - 2, w: rowBandW + ROW_BAND_GAP + gridW, h: cellH + 4 },
577
+ fill: highlightWash,
578
+ owner: { seriesId: r.id },
579
+ part: "rowTint"
580
+ });
581
+ });
582
+ let extremeMax = allValues.length > 0 ? vMax : null, extremeMin = allValues.length > 0 ? vMin : null, bonus = (rowId, colId) => highlights.has(rowId) || highlights.has(colId) ? PRIORITY.highlightBonus : 0, harveyR = harveyStyle && !harveyList ? Math.min(cellW * 0.34, cellH * 0.286) : Math.min(cellW, cellH) * 0.34, bubbleR = bubbleStyle ? Math.max(1.5, Math.min(cellW, cellH) / 2 - (Math.min(cellW, cellH) < 40 ? BUBBLE_AIR_TIGHT : BUBBLE_AIR)) : Math.min(cellW, cellH) / 2, sizeMax = Math.max(0, maxOf(rows.flatMap((r) => r.cells.map((c) => c.size ?? 0)))), areaShare = (size2) => hasSizes ? size2 === null ? 0 : levels ? size2 / levels.length : sizeMax > 0 ? size2 / sizeMax : 0 : 1, radiusOf = (size2) => {
583
+ if (bubbleStyle && levels && size2 !== null) return size2 > 0 ? Math.max(1.5, bubbleR * (size2 + 1) / (levels.length + 1)) : 0;
584
+ let share = areaShare(size2);
585
+ return share > 0 ? Math.max(1.5, bubbleR * Math.sqrt(share)) : 0;
586
+ }, bubbleNodes = [], missingSizes = 0, valueCellW = 0, omittedValues = 0, hiddenCells = [], rowValues = (font) => rows.map((r) => cellLabelsOn && !bubble ? measureRowLabels(r.cells, (v, pct, meta) => textFor(v, pct, meta, r), font, measure, cellW, cellH, 4) : []), valueFloor = readerFloorPx(options.target ?? DEFAULT_TARGET, "label", textScaleOf(options)), valueFont = labelFont, fitted = rowValues(valueFont);
587
+ for (; valueFont.size > valueFloor && !fitted.every((values) => values.every((value) => value === null || value.fits)); )
588
+ valueFont = { ...valueFont, size: Math.max(valueFloor, valueFont.size - 1) }, fitted = rowValues(valueFont);
589
+ if (rows.forEach((r, ri) => {
590
+ let values = fitted[ri];
591
+ for (let value of values) value && (valueCellW = Math.max(valueCellW, value.size.width + 4));
592
+ cols.forEach((c, ci) => {
593
+ let cell = r.cells[ci], rect = { x: gridX + ci * colStep, y: gridY + ri * rowStep, w: cellW, h: cellH }, nodeId = `cell:${cellKey(r, c)}`, owner = { seriesId: seriesOf(r, c), categoryId: categoryOf(r, c) }, needsStroke = glyph === "harvey" && !(harveyStyle && cell.v !== null) || cell.v === null, valuePaint = fillPaint(cell.v, cell.meta, cellW > 12 && cellH > 12, r.direction), paint = bubble && !cell.meta?.fill ? { token: "background" } : valuePaint, css = paintColor(theme, paint), insidePaint = paint;
594
+ !barHighlight && "token" in paint && paint.token === "background" && !paint.tint && (highlights.has(r.id) || highlights.has(c.id)) && (paint = highlightWash);
595
+ let noData = hatchMissing && cell.v === null && !cell.meta?.fill, blankCell = missingLook === "blank" && cell.v === null && !cell.meta?.fill && missingCells, low = !bubble && cell.v !== null && lowBase(cell);
596
+ if (nodes.push({
597
+ t: "rect",
598
+ id: nodeId,
599
+ rect,
600
+ fill: noData ? NO_DATA_PAINT : blankCell ? { token: "background" } : paint,
601
+ ...noData || low ? { pattern: "hatch45", hatchGround: { token: "background" } } : {},
602
+ ...needsStroke ? { stroke: { token: "grid" }, strokeWidth: strokeToken(theme, "hair") } : {},
603
+ owner,
604
+ part: "cell",
605
+ display: cell.v === null ? { state: "No data" } : { value: displayFor(cell.v, cell.pct, cell.meta, r) }
606
+ }), occupied.claim(rect, "mark", owner), marks.cells.push({ seriesId: seriesOf(r, c), categoryId: categoryOf(r, c), rect, nodeId, value: cell.v }), cellBoxes.set(`${categoryOf(r, c)}:${seriesOf(r, c)}`, rect), cell.v !== null && anchorCell.set(`${categoryOf(r, c)}:${seriesOf(r, c)}`, {
607
+ x: rect.x + rect.w / 2,
608
+ y: rect.y + rect.h / 2,
609
+ value: cell.v,
610
+ format: r.format,
611
+ date: c.date,
612
+ label: c.label,
613
+ owner,
614
+ // A comparison between cells of one row is a bracket beside that row.
615
+ row: { y: rect.y, h: rect.h, end: gridX + gridW }
616
+ }), glyph === "harvey" && cell.v !== null) {
617
+ let q = Math.max(0, Math.min(4, Math.round(levelOf(cell.v)))), cx = rect.x + rect.w / 2, cy = rect.y + rect.h / 2;
618
+ nodes.push({
619
+ t: "circle",
620
+ id: `harveyRing:${r.id}:${c.id}`,
621
+ cx,
622
+ cy,
623
+ r: harveyR,
624
+ fill: { token: "background" },
625
+ // The styled ring takes the fill's colour.
626
+ stroke: harveyStyle ? semanticPalettePaint(theme, options.palette, "sequential") : { token: "neutralMark" },
627
+ strokeWidth: strokeToken(theme, "mark"),
628
+ owner,
629
+ part: "harveyRing"
630
+ }), q >= 4 ? nodes.push({
631
+ t: "circle",
632
+ id: `harveyFill:${r.id}:${c.id}`,
633
+ cx,
634
+ cy,
635
+ r: harveyR,
636
+ fill: semanticPalettePaint(theme, options.palette, "sequential"),
637
+ owner,
638
+ part: "harveyFill"
639
+ }) : q > 0 && nodes.push({
640
+ t: "path",
641
+ id: `harveyFill:${r.id}:${c.id}`,
642
+ d: harveyWedgePath(cx, cy, harveyR, q),
643
+ fill: semanticPalettePaint(theme, options.palette, "sequential"),
644
+ owner,
645
+ part: "harveyFill"
646
+ });
647
+ }
648
+ if (bubble) {
649
+ bubbleCell(r, c, cell, rect, owner, valuePaint, css);
650
+ return;
651
+ }
652
+ let value = values[ci];
653
+ if (value?.fits) {
654
+ let { text, size: tsize } = value, basePriority = cell.v !== null && (cell.v === extremeMax || cell.v === extremeMin) ? PRIORITY.extreme : PRIORITY.interior + Math.min(99, Math.abs(cell.v ?? 0));
655
+ labelRequests.push({
656
+ id: `point:${r.id}:${c.id}`,
657
+ kind: "point",
658
+ typeRole: "label",
659
+ owner,
660
+ text,
661
+ lines: [text],
662
+ font: valueFont,
663
+ ...valueFont !== labelFont ? { fontStep: valueFont } : {},
664
+ priority: cell.meta?.priority ?? basePriority + bonus(r.id, c.id),
665
+ candidates: [
666
+ {
667
+ slot: "insideCenter",
668
+ rect: {
669
+ x: rect.x + rect.w / 2 - tsize.width / 2,
670
+ y: rect.y + rect.h / 2 - tsize.height / 2,
671
+ w: tsize.width,
672
+ h: tsize.height
673
+ },
674
+ penalty: 0,
675
+ insideFill: low ? paintColor(theme, { token: "background" }) : css,
676
+ insidePaint: low ? { token: "background" } : insidePaint
677
+ }
678
+ ]
679
+ });
680
+ } else cellLabelsOn && cell.v !== null && (omittedValues++, hiddenCells.push({ r, c, v: cell.v }));
681
+ });
682
+ }), missingSizes > 0 && warnings.push({ code: "bubble-size-missing", severity: "warn", message: `${missingSizes} cell${missingSizes === 1 ? " has" : "s have"} a value but no size, so no circle is drawn`, suggest: "give every cell with a value a size" }), bubble && options.bubble?.track) {
683
+ let tip = gridX + gridW + TRACK_ROOM - 1;
684
+ rows.forEach((r, ri) => {
685
+ let y = round2(rowCenter(ri)), owner = { seriesId: r.id };
686
+ nodes.push({ t: "line", id: `track:${r.id}`, x1: round2(colCenter(0)), y1: y, x2: round2(tip - 5), y2: y, stroke: { token: "neutralMark", tint: 0.5 }, width: strokeToken(theme, "rule"), owner, part: "track" }), nodes.push({ t: "path", id: `trackArrow:${r.id}`, d: arrowHeadPath({ x: tip, y }, 0, 6), fill: { token: "neutralMark", tint: 0.5 }, owner, part: "track" });
687
+ });
688
+ }
689
+ if (pushAll(nodes, bubbleNodes), styledKey ? nodes.push(...styledKey.draw()) : bubbleKeys && nodes.push(...bubbleKeyNodes()), bubbleStyle || harveyStyle) {
690
+ let bottom = gridY + rows.length * rowStep - CELL_GAP;
691
+ for (let [id, y] of [["rule:top", gridY - 1], ["rule:bottom", bottom + 1]])
692
+ nodes.push({ t: "line", id, x1: round2(plot0.x), y1: round2(y), x2: round2(plot0.x + plot0.w), y2: round2(y), stroke: { token: "grid" }, width: strokeToken(theme, "rule"), owner: {}, part: "gridline" });
693
+ for (let ci of tierTicks) {
694
+ let x = round2(colCenter(ci));
695
+ nodes.push({ t: "line", id: `tierTick:${cols[ci].id}`, x1: x, y1: round2(headTop + headerH - HEADER_GAP - tierLift[ci] + 1), x2: x, y2: round2(gridY - 2), stroke: { token: "leader", tint: 0.5 }, width: strokeToken(theme, "hair"), owner: colOwner(cols[ci]), part: "gridline" });
696
+ }
697
+ }
698
+ if (options.heatKey === void 0 && omittedValues > 0 && valueNote === void 0) {
699
+ let lead2 = valueStyle ? leadCallout() : void 0, next = lead2 ? { ...options, annotations: [...options.annotations ?? [], lead2] } : options;
700
+ return layoutHeatmap(data, next, bracketGutter, hiddenValuesNote(lead2), forceRows, compactKey);
701
+ }
702
+ function rowFont(id) {
703
+ return valueStyle && id !== void 0 && highlights.has(id) ? { ...tickFont, weight: emphasisWeight(theme) } : tickFont;
704
+ }
705
+ labelOn2("series") && rows.forEach((r, ri) => {
706
+ let rl = rowLines[ri];
707
+ labelRequests.push({
708
+ id: rowLabelId(r),
709
+ kind: turned ? "category" : "series",
710
+ owner: rowOwner(r),
711
+ text: r.label,
712
+ ...fittedLabel(rl, tickFont),
713
+ font: rowFont(r.id),
714
+ priority: PRIORITY.endpoint + (highlights.has(r.id) ? PRIORITY.highlightBonus : 0),
715
+ candidates: [
716
+ {
717
+ slot: "left",
718
+ // The bubble matrix sets its row names at the plot edge.
719
+ rect: { x: harveyList ? gridX + gridW + KEY_TEXT_GAP + 5 : bubbleStyle || harveyStyle ? plot0.x : plot0.x + rowBandW - rl.w, y: rowCenter(ri) - rl.h / 2, w: rl.w, h: rl.h },
720
+ penalty: 0
721
+ }
722
+ ]
723
+ });
724
+ }), showHeaderRow && cols.forEach((c, ci) => {
725
+ let cl = colLines[ci];
726
+ labelRequests.push({
727
+ id: colLabelId(c),
728
+ kind: turned ? "series" : "category",
729
+ typeRole: "axis",
730
+ owner: colOwner(c),
731
+ text: c.label,
732
+ lines: cl.lines,
733
+ ...categoryLineAlign(headerPlan, ci),
734
+ ...cl.title !== void 0 ? { title: cl.title } : {},
735
+ font: headerFont,
736
+ priority: PRIORITY.endpoint + (highlights.has(c.id) ? PRIORITY.highlightBonus : 0),
737
+ redundant: !headerKeep[ci],
738
+ ...headerRotated ? { rotate: 45 } : {},
739
+ candidates: headerRotated ? [{ slot: "top", rect: rotatedClaimRect(colCenter(ci), headTop + headerH - HEADER_GAP - headerFont.size * (headerFont.lineHeight ?? 1.2) * (1 - SIN45 / 2), headerFont.size * (headerFont.lineHeight ?? 1.2)), penalty: 0 }] : [
740
+ {
741
+ slot: "top",
742
+ rect: {
743
+ x: harveyList ? plot0.x : headerPlan.x(ci),
744
+ y: headTop + headerH - HEADER_GAP - cl.h - tierLift[ci],
745
+ w: cl.w,
746
+ h: cl.h
747
+ },
748
+ penalty: 0
749
+ }
750
+ ]
751
+ });
752
+ });
753
+ let outlineW = valueStyle ? size.width < 400 ? 1.25 : strokeToken(theme, "mark") : strokeToken(theme, "hair");
754
+ for (let outline of outlines) {
755
+ let { x, y, w, h } = outline.rect, t = valueStyle ? outlineW / 2 + 0.75 : outlineW / 2, e = outlineW / 2, [x0, y0, x1, y1] = [Math.max(e, x - t), Math.max(e, y - t), Math.min(size.width - e, x + w + t), Math.min(size.height - e, y + h + t)].map((v) => Math.round(v * 100) / 100);
756
+ nodes.push({
757
+ t: "path",
758
+ id: outline.id,
759
+ d: `M${x0} ${y0}H${x1}V${y1}H${x0}Z`,
760
+ stroke: { token: "focus" },
761
+ width: outlineW,
762
+ owner: outline.owner,
763
+ part: outline.part
764
+ });
765
+ }
766
+ let solveCtx = labelCtx(theme, size, options, {
767
+ measure,
768
+ plot,
769
+ labelPad: 2
770
+ }), solved = solveLabels(labelRequests, occupied, solveCtx);
771
+ pushAll(warnings, solved.warnings);
772
+ let resolve = (ref) => {
773
+ let norm = typeof ref == "string" ? { categoryId: ref, edge: "total" } : ref;
774
+ if (!("categoryId" in norm)) return null;
775
+ if (norm.seriesId) {
776
+ let cell = anchorCell.get(`${norm.categoryId}:${norm.seriesId}`), printed = solved.placed.find((label) => label.id === `point:${norm.seriesId}:${norm.categoryId}` && !label.hidden);
777
+ return cell && printed ? { ...cell, printed: { text: printed.text, box: cellBoxes.get(`${norm.categoryId}:${norm.seriesId}`) } } : cell ?? null;
778
+ }
779
+ let ci = cols.findIndex((c) => c.id === norm.categoryId), mean = colMeans[norm.categoryId];
780
+ return ci < 0 || mean === null || mean === void 0 ? null : {
781
+ x: colCenter(ci),
782
+ y: gridY,
783
+ value: mean,
784
+ date: cols[ci].date,
785
+ label: cols[ci].label,
786
+ owner: { categoryId: norm.categoryId }
787
+ };
788
+ }, brackets = marginBracketLayout(theme, { right: gridX + gridW + BRACKET_CLEAR }), calloutRows = /* @__PURE__ */ new Map();
789
+ for (let [groups, start] of [[aboveNotes.map((a) => [a]), plot0.y + keyH + (keyBottom ? 0 : continuousKeyH)], [belowRows, gridY + gridH + caretRoom]]) {
790
+ let y = start + 4;
791
+ for (let group of groups) {
792
+ let h = maxOf(group.map((a) => noteSizes.get(a.id).h));
793
+ for (let a of group) {
794
+ let [lo, hi] = seatBounds.get(a.id) ?? [gridX, plot0.x + plot0.w];
795
+ calloutRows.set(a.id, valueStyle ? { x: lo, y, w: hi - lo, h } : { x: plot0.x, y, w: plot0.w, h });
796
+ }
797
+ y += h + 8;
798
+ }
799
+ }
800
+ let annResult = runAnnotatePass({
801
+ annotations,
802
+ resolve,
803
+ defaultSpan: cols.length >= 2 ? { from: cols[0].id, to: cols[cols.length - 1].id } : void 0,
804
+ comparisonLayout: brackets,
805
+ occupied,
806
+ plot: { x: gridX, y: gridY, w: gridW + gutterRight, h: gridH },
807
+ gridCallouts: { rows: calloutRows, widths: new Map(sideNotes.map((a) => [a.id, sideWrapWidth])), bounds: { ...plot0 }, grid: plot, sideLimit: gridW * 0.15 },
808
+ theme,
809
+ measure,
810
+ format: options.format,
811
+ locale: options.locale?.language,
812
+ strings: options.strings,
813
+ solveCtx
814
+ }), failedSideNotes = sideNotes.filter((a) => annResult.labels.some((l) => l.owner.annotationId === a.id && l.hidden !== void 0));
815
+ if (failedSideNotes.length) return layoutHeatmap(data, options, bracketGutter, valueNote, [...forceRows, ...failedSideNotes.map((a) => a.id)], compactKey);
816
+ pushAll(warnings, annResult.warnings);
817
+ for (let a of rowNotes) {
818
+ let label = annResult.labels.find((l) => l.owner.annotationId === a.id && !l.hidden), ref = "at" in a ? a.at : void 0;
819
+ if (!label || typeof ref == "string" || !ref || !("categoryId" in ref) || !ref.seriesId) continue;
820
+ let cell = cellBoxes.get(`${ref.categoryId}:${ref.seriesId}`);
821
+ if (!cell) continue;
822
+ let above = label.rect.y < gridY;
823
+ if (valueStyle && !above) {
824
+ let cx = round2(cell.x + cell.w / 2), cy = round2(gridY + gridH + 3);
825
+ annResult.nodes.push({ t: "path", id: `ann:${a.id}:caret`, d: `M${cx} ${cy}l-3.5 5h7z`, fill: { token: "ink" }, owner: { annotationId: a.id }, part: "calloutArrow" }), annResult.placed.find((p) => p.id === a.id)?.nodeIds.push(`ann:${a.id}:caret`), delete label.leader;
826
+ continue;
827
+ }
828
+ let routeX = gridX + gridW + 4, tailX = label.rect.x + label.rect.w / 2, tailY = above ? label.rect.y + label.rect.h + 4 : label.rect.y - 4, edge = { x: cell.x + cell.w, y: cell.y + cell.h };
829
+ if ("arrow" in a && a.arrow && !("icon" in a && a.icon) && !("status" in a && a.status)) {
830
+ let tip = { x: edge.x + 4, y: edge.y }, endX = tip.x + arrowShaftEnd(4, strokeToken(theme, "rule")), ids = new Set(annResult.placed.find((p) => p.id === a.id)?.nodeIds ?? []);
831
+ annResult.nodes = annResult.nodes.filter((n) => !ids.has(n.id));
832
+ let owner = { annotationId: a.id };
833
+ annResult.nodes.push(
834
+ { t: "path", id: `ann:${a.id}:rowArrow`, d: `M${tailX} ${tailY}L${routeX} ${tailY}L${routeX} ${edge.y}L${endX} ${edge.y}`, stroke: { token: "ink" }, width: strokeToken(theme, "rule"), owner, part: "calloutArrow" },
835
+ { t: "path", id: `ann:${a.id}:rowHead`, d: arrowHeadPath(tip, Math.PI, 4), fill: { token: "ink" }, owner, part: "calloutArrow" }
836
+ );
837
+ let placed = annResult.placed.find((p) => p.id === a.id);
838
+ placed.nodeIds = [`ann:${a.id}:rowArrow`, `ann:${a.id}:rowHead`];
839
+ for (let [a2, b] of [[{ x: tailX, y: tailY }, { x: routeX, y: tailY }], [{ x: routeX, y: tailY }, { x: routeX, y: edge.y }], [{ x: routeX, y: edge.y }, { x: endX, y: edge.y }]])
840
+ occupied.claim({ x: Math.min(a2.x, b.x) - 0.5, y: Math.min(a2.y, b.y) - 0.5, w: Math.abs(a2.x - b.x) + 1, h: Math.abs(a2.y - b.y) + 1 }, "annotation", owner, "calloutArrow");
841
+ delete label.leader;
842
+ } else
843
+ delete label.leader;
844
+ }
845
+ if (valueStyle) for (let a of sideNotes) {
846
+ let label = annResult.labels.find((l) => l.owner.annotationId === a.id && !l.hidden), ref = "at" in a ? a.at : void 0;
847
+ if (!label || typeof ref == "string" || !ref || !("categoryId" in ref) || !ref.seriesId || "arrow" in a && a.arrow) continue;
848
+ let cell = cellBoxes.get(`${ref.categoryId}:${ref.seriesId}`);
849
+ if (!cell) continue;
850
+ let y = round2(cell.y + cell.h / 2), right = label.rect.x >= cell.x + cell.w, x1 = round2(right ? cell.x + cell.w : cell.x), x2 = round2(right ? label.rect.x - 4 : label.rect.x + label.rect.w + 4);
851
+ Math.abs(x2 - x1) >= 4 && label.rect.y <= y && label.rect.y + label.rect.h >= y && (label.leader = { d: `M${x1} ${y}H${x2}`, curved: !1 }, label.halo = !1);
852
+ }
853
+ let reach = brackets.need().right > 0 ? BRACKET_CLEAR + brackets.need().right : 0;
854
+ if (bracketGutter === void 0 && reach > gutterRight + 0.5)
855
+ return layoutHeatmap(data, options, Math.ceil(Math.min(reach, plot0.w * 0.35)), valueNote, forceRows, compactKey);
856
+ let allLabels = [...solved.placed, ...annResult.labels];
857
+ pushAll(nodes, annResult.nodes);
858
+ let nullCellLabels = new Set(rows.flatMap((r) => r.cells.flatMap((cell, ci) => cell.v === null ? [`label:point:${cellKey(r, cols[ci])}`] : []))), rowNoteAlign = /* @__PURE__ */ new Map();
859
+ if (valueStyle) for (let a of belowNotes) {
860
+ let label = annResult.labels.find((l) => l.owner.annotationId === a.id && !l.hidden && l.rect.y >= gridY + gridH);
861
+ if (!label || label.lines.length < 2) continue;
862
+ let { x, w } = label.rect, align = x + w >= plot0.x + plot0.w - 0.5 ? "end" : x <= gridX + 0.5 ? "start" : "middle";
863
+ rowNoteAlign.set(`label:${label.id}`, { align, x: round2(align === "end" ? x + w : align === "start" ? x : x + w / 2) });
864
+ }
865
+ let namedRows = /* @__PURE__ */ new Set();
866
+ if (valueStyle) for (let group of belowRows) {
867
+ let ref = group.map((a) => "at" in a ? a.at : void 0).find((r) => typeof r == "object" && r !== null && "seriesId" in r && r.seriesId !== void 0), row = ref && rows.find((r) => r.id === ref.seriesId), top = minOf(group.flatMap((a) => annResult.labels.filter((l) => l.owner.annotationId === a.id && !l.hidden).map((l) => l.rect.y)));
868
+ !row || !Number.isFinite(top) || namedRows.has(row.id) || (namedRows.add(row.id), !highlights.has(row.id) && nodes.push({ t: "text", id: `noteRow:${row.id}`, x: round2(plot0.x + rowBandW), y: round2(top), lines: [row.label], align: "end", font: labelFont, ink: { token: "inkMuted" }, typeRole: "label", owner: { seriesId: row.id }, part: "annotation" }));
869
+ }
870
+ let labelRects = new Map(allLabels.map((label) => [`label:${label.id}`, label.rect])), rowBandIds = new Set(rows.map((r) => rowLabelId(r))), headerIds = new Set(cols.map((c) => colLabelId(c))), headInk2 = headInk(), headCols = new Map(cols.map((c) => [colLabelId(c), c.id]));
871
+ for (let label of allLabels) {
872
+ let col = headCols.get(label.id);
873
+ col !== void 0 && !highlights.has(col) && !label.emphasis && plainInk(label.ink) && (label.ink = headInk2);
874
+ }
875
+ pushAll(nodes, labelsToNodes(
876
+ theme,
877
+ allLabels,
878
+ (l) => headerIds.has(l.id) ? headerFont : rowBandIds.has(l.id) ? rowFont(l.owner.seriesId) : l.kind === "point" && bubbleStyle ? valueLabelFont : l.owner.annotationId && annotations.some((a) => a.id === l.owner.annotationId && (a.kind === "cagr" || a.kind === "diff")) ? { ...labelFont, weight: emphasisWeight(theme) } : labelFont,
879
+ nodes
880
+ ).map((node) => node.t === "text" && !bubbleStyle && !harveyStyle && node.part === "series" && node.lines.length > 1 && node.align === "start" ? { ...node, align: "end", x: labelRects.get(node.id).x + labelRects.get(node.id).w } : node.t === "text" && rowNoteAlign.has(node.id) ? { ...node, ...rowNoteAlign.get(node.id) } : node.t === "text" && node.part === "point" && node.lines.length === 1 && node.lines[0] === "\u2013" && nullCellLabels.has(node.id) ? { ...node, ink: { token: "inkMuted" } } : node));
881
+ let placedAnnotations = annResult.placed, scaleWord = glyph === "harvey" ? chartString(options, "harveyBallName") : bubble ? chartString(options, "bubbleScaleWord", { v1: hasSizes ? chartString(options, "circleAreaSize") : "" }) : scale === "discrete" ? chartString(options, "discrete") : chartString(options, "continuous"), invertedRows = valence || bins && declaredDirections ? dataRows.filter((r) => r.direction === "lowerIsBetter") : [], a11yDesc = chartString(options, "heatmapDescStart", { v1: scaleWord, v2: dataRows.length, v3: dataCols.length }) + (allValues.length > 0 ? chartString(options, "valuesRange", { v1: fmt(vMin), v2: fmt(vMax) }) : "") + (invertedRows.length > 0 ? chartString(options, "invertedRowsDesc", { v1: invertedRows.map((r) => r.label).join(", ") }) : "") + chartString(options, "rowMeansSentence", { v1: dataRows.map((r) => {
882
+ let mean = rowMeans[r.id];
883
+ return `${r.label} ${mean == null ? NOT_AVAILABLE : fmt(mean)}`;
884
+ }).join(", ") }) + (hiddenCells.length > 0 && options.heatKey === void 0 ? ` ${options.strings?.hiddenLabels ?? HIDDEN_LABEL_LEAD}: ${hiddenCells.map(hiddenItem).join(", ")}.` : "");
885
+ return {
886
+ type: "heatmap",
887
+ size,
888
+ sizing: rowSizing("heatmap", size, {
889
+ chromeH: size.height - gridH,
890
+ minimumRowsH: rows.length * Math.max(minRowH, maxOf(rowLines.map((label) => label.h))) + (rows.length - 1) * CELL_GAP,
891
+ naturalRowsH: rows.length * naturalCellH + (rows.length - 1) * CELL_GAP,
892
+ ...withSuffixFloor(
893
+ // A staggered header name spans two columns.
894
+ // The Harvey list needs its ball column and its widest name beside it.
895
+ harveyList ? (() => {
896
+ let w = size.width - plot0.w + gridW + KEY_TEXT_GAP + 5 + Math.max(0, maxOf(rowLines.map((label) => label.w)), maxOf(colLines.map((label) => label.w - gridW - KEY_TEXT_GAP - 5)));
897
+ return { minWidth: w, naturalWidth: w };
898
+ })() : matrixWidths(size.width - gridW, cols.length, CELL_GAP, colLines.map((label) => tierTicks.length ? label.w / 2 : label.w), valueCellW),
899
+ size.width,
900
+ rowSuffixShort
901
+ )
902
+ }),
903
+ plot,
904
+ scene: nodes,
905
+ labels: allLabels,
906
+ axes: [
907
+ {
908
+ axis: "x",
909
+ ticks: cols.map((c, ci) => ({ at: c.id, pos: colCenter(ci), labelId: colLabelId(c) }))
910
+ },
911
+ {
912
+ axis: "y",
913
+ ticks: rows.map((r, ri) => ({ at: r.id, pos: rowCenter(ri), labelId: rowLabelId(r) }))
914
+ }
915
+ ],
916
+ annotations: placedAnnotations,
917
+ frame: frameResult.frame,
918
+ ...frameResult.legend ? { legend: frameResult.legend } : {},
919
+ marks,
920
+ derived: {
921
+ max: round2(vMax),
922
+ min: round2(vMin),
923
+ rowMeans,
924
+ colMeans,
925
+ ...showHeaderRow ? {
926
+ tickBand: {
927
+ reserved: headerH,
928
+ measuredLines: headerLines,
929
+ lineHeight: headerFont.size * 1.2,
930
+ extra: headerPlan.rowHeight - headerLines * headerFont.size * 1.2,
931
+ dateNumeric: headerPlan.dateNumeric,
932
+ position: "above"
933
+ }
934
+ } : {}
935
+ },
936
+ a11y: {
937
+ title: accessibleTitle(options.title, chartString(options, "heatmapTitle", { v1: dataRows.length, v2: dataCols.length })),
938
+ counts: [structureCount("rows", dataRows.length, void 0, options), structureCount("columns", dataCols.length, void 0, options)],
939
+ desc: a11yDesc
940
+ },
941
+ warnings,
942
+ debug: {
943
+ occupied: occupied.snapshot(),
944
+ decisions: [...solved.decisions, ...annResult.decisions]
945
+ }
946
+ };
947
+ function leadCallout() {
948
+ let marked = rows.filter((r) => highlights.has(r.id));
949
+ if (marked.length !== 1 || turned) return;
950
+ let row = marked[0], best;
951
+ if (row.cells.forEach((cell, ci) => {
952
+ cell.v !== null && (best === void 0 || Math.abs(cell.v) > Math.abs(best.v)) && (best = { ci, v: cell.v });
953
+ }), !best) return;
954
+ let col = cols[best.ci];
955
+ if (!hiddenCells.some((h) => h.r === row && h.c === col) || annotations.some((a) => "at" in a && typeof a.at == "object" && a.at !== null && "seriesId" in a.at && a.at.seriesId === row.id && "categoryId" in a.at && a.at.categoryId === col.id)) return;
956
+ let known = row.cells.flatMap((cell) => cell.v === null ? [] : [cell.v]), low = best.v === minOf(known);
957
+ return {
958
+ kind: "callout",
959
+ id: `lead:${row.id}:${col.id}`,
960
+ at: { seriesId: row.id, categoryId: col.id },
961
+ headline: "${value}",
962
+ text: chartString(options, low ? "heatmapLeadLow" : "heatmapLeadHigh", { v1: col.label }),
963
+ preferSide: "below"
964
+ };
965
+ }
966
+ function hiddenItem(h) {
967
+ let cell = h.r.cells[cols.indexOf(h.c)];
968
+ return `${h.r.label} ${h.c.label} ${textFor(h.v, cell.pct, cell.meta, h.r) ?? displayFor(h.v, cell.pct, cell.meta, h.r)}`;
969
+ }
970
+ function hiddenValuesNote(lead2) {
971
+ let heading = options.strings?.hiddenLabels ?? HIDDEN_LABEL_LEAD, leadAt = lead2 && "at" in lead2 && typeof lead2.at == "object" && "seriesId" in lead2.at ? lead2.at : void 0, unprinted = hiddenCells.filter((h) => !(leadAt && h.r.id === leadAt.seriesId && h.c.id === leadAt.categoryId)), leads = unprinted.length <= DEFAULT_NOTE_LIMIT ? [] : [vMin, vMax].flatMap((extreme) => unprinted.filter((cell) => cell.v === extreme).slice(0, 1));
972
+ return valueNoteLine(heading, [.../* @__PURE__ */ new Set([...leads, ...unprinted])].map(hiddenItem), options, allValues.length)[0] ?? "";
973
+ }
974
+ function drawContinuousKey() {
975
+ let low = keyLow, high = keyHigh, short = !keyRight, step = short ? keyStep((high - low) / 4 || 1) : niceStep((high - low) / 3 || 1), ticks = [low];
976
+ for (let v = Math.ceil(low / step) * step; v < high - step * 1e-9; v += step)
977
+ (short ? v - low > step / 3 && high - v > step / 3 : v > low + step * 1e-9) && ticks.push(Number(v.toPrecision(12)));
978
+ high > low && ticks.push(high);
979
+ let textOf = short ? (v) => {
980
+ let text = keyText(v).replace(/^>=/, "\u2265").replace(/^<=/, "\u2264");
981
+ return v === 0 && !pctMatrix && !options.format && !keySeries?.format ? formatAutomaticNumber(0, { locale: options.locale?.language, decimals: 0 }) : valence && v > 0 ? text.replace(/^(≥?)(?![+≥])/, "$1+") : text;
982
+ } : keyText, font = tickFont, left = short ? 0 : measure(textOf(low), font).width / 2, right = short ? 0 : measure(textOf(high), font).width / 2, unitText = short && options.unit ? options.unit : void 0, unitW = unitText ? measure(unitText, font).width + 8 : 0, x = keyRight ? plot0.x + plot0.w + KEY_GAP : plot0.x + left, y = keyRight ? plot0.y + measure(textOf(high), font).height / 2 : (keyBottom ? plot0.y + plot0.h - continuousKeyH + KEY_GAP : plot0.y) + unitRise, w = keyRight ? KEY_BAR_H : short ? Math.max(1, Math.min(plot0.w - unitW, 240, Math.max(168, plot0.w * 0.45))) : Math.max(1, plot0.w - left - right), h = keyRight ? Math.max(1, plot0.h - measure(textOf(high), font).height) : KEY_BAR_H, length = keyRight ? h : w, at = (v) => (keyRight ? y + h : x) + (high > low ? (v - low) / (high - low) * length : length / 2) * (keyRight ? -1 : 1), slices = Math.max(1, Math.ceil(length / 2));
983
+ for (let i = 0; i < slices; i++) nodes.push({
984
+ t: "rect",
985
+ id: `scale:ramp:${i}`,
986
+ rect: keyRight ? { x, y: y + h - (i + 1) * h / slices, w, h: h / slices + (i < slices - 1 ? 0.5 : 0) } : { x: x + i * w / slices, y, w: w / slices + (i < slices - 1 ? 0.5 : 0), h },
987
+ fill: fillPaint(low + (high - low) * (i + 0.5) / slices, null, !0),
988
+ owner: {},
989
+ part: "swatch"
990
+ });
991
+ let requests = ticks.map((v, i) => {
992
+ let text = textOf(v), size2 = measure(text, font), pos = at(v);
993
+ return nodes.push({
994
+ t: "line",
995
+ id: `scale:tick:${i}`,
996
+ ...keyRight ? { x1: x + w, x2: x + w + 3, y1: pos, y2: pos } : { x1: pos, x2: pos, y1: y + h, y2: y + h + 3 },
997
+ stroke: { token: "inkMuted" },
998
+ width: strokeToken(theme, "hair"),
999
+ owner: {},
1000
+ part: "legendTick"
1001
+ }), {
1002
+ id: `scale:tickLabel:${i}`,
1003
+ kind: "scale",
1004
+ owner: {},
1005
+ text,
1006
+ lines: [text],
1007
+ typeRole: "axis",
1008
+ font,
1009
+ fontStep: font,
1010
+ priority: i === 0 || i === ticks.length - 1 ? PRIORITY.reference : PRIORITY.endpoint,
1011
+ candidates: [{ slot: "key", penalty: 0, rect: keyRight ? { x: x + w + 6, y: pos - size2.height / 2, w: size2.width, h: size2.height } : { x: short && i === 0 ? pos : short && i === ticks.length - 1 ? pos - size2.width : pos - size2.width / 2, y: y + h + 6, w: size2.width, h: size2.height } }]
1012
+ };
1013
+ });
1014
+ unitText && nodes.push({ t: "text", id: "scale:unit", x: round2(x + w + 8), y: round2(y + h / 2 - measure(unitText, font).height / 2), lines: [unitText], align: "start", font, ink: { token: "ink" }, typeRole: "axis", owner: {}, part: "legendHeading" });
1015
+ let keyRect = keyRight ? { x: x - KEY_GAP, y: plot0.y, w: keyRightW, h: plot0.h } : { x: plot0.x, y: y - unitRise, w: plot0.w, h: continuousKeyH - KEY_GAP }, keyClaims = createOccupiedIndex(keyRect), solvedKey = solveLabels(requests, keyClaims, { measure, density: "full", pins: {}, plot: keyRect, labelPad: 2 });
1016
+ nodes.push(...labelsToNodes(theme, solvedKey.placed, () => font).map((n) => n.t === "text" ? { ...n, part: "legendLabel" } : n)), occupied.claim(keyRect, "legend", {});
1017
+ let items = solvedKey.placed.filter((l) => !l.hidden).map((l) => ({ id: l.id, swatchNodeId: "scale:ramp:0", labelId: `label:${l.id}` }));
1018
+ frameResult.legend ? frameResult.legend.items.push(...items) : frameResult.legend = { rect: keyRect, items };
1019
+ }
1020
+ function keyStep(raw) {
1021
+ if (!(raw > 0) || !Number.isFinite(raw)) return 1;
1022
+ let base = Math.pow(10, Math.floor(Math.log10(raw))), m = raw / base;
1023
+ return (m <= 1 + 1e-9 ? 1 : m <= 2 + 1e-9 ? 2 : m <= 2.5 + 1e-9 ? 2.5 : m <= 5 + 1e-9 ? 5 : 10) * base;
1024
+ }
1025
+ function colourScaleKey() {
1026
+ let pale = (paint) => "tint" in paint && (paint.tint ?? 0) >= 0.8 || "token" in paint && paint.token === "background" ? { stroke: { token: "neutralMark" } } : {}, item = (id, label, paint) => ({ id: `scale:${id}`, label, paint, ...pale(paint) }), keyFormat = (value) => displayFor(value, pctMatrix, null, keySeries);
1027
+ if (bins)
1028
+ return bins.slice(1).map((hi, i) => item(String(i), numberRange(keyFormat(bins[i]), keyFormat(hi)), binPaint(i, !0, rows[0]?.direction)));
1029
+ if (scale === "discrete") {
1030
+ if (valence) return [-valenceSpan, -valenceSpan / 2, 0, valenceSpan / 2, valenceSpan].map((v, i) => item(String(i), keyFormat(v), fillPaint(v, null, !0)));
1031
+ let step = (vMax - vMin) / 5;
1032
+ return LADDER_PAINTS.map((paint, level) => item(
1033
+ String(level),
1034
+ isRatingScale ? keyFormat(level) : numberRange(keyFormat(vMin + level * step), keyFormat(level === 4 ? vMax : vMin + (level + 1) * step)),
1035
+ paint
1036
+ ));
1037
+ }
1038
+ if (valence && rows.some((r) => r.direction === "lowerIsBetter"))
1039
+ return [item("worse", "Worse", valencePaint("bad", !0, 0)), item("even", "Even", fillPaint(0, null, !0)), item("better", "Better", valencePaint("good", !0, 0))];
1040
+ let between = (from, to, step) => {
1041
+ let out = [];
1042
+ for (let k = Math.ceil(from / step); k * step < to; k++) {
1043
+ let v = Number((k * step).toPrecision(12));
1044
+ v - from > step / 3 && to - v > step / 3 && out.push(v);
1045
+ }
1046
+ return out;
1047
+ }, signedStep = niceStep(Math.max(-negMin, posMax) / 2), stops = cap !== void 0 ? [.../* @__PURE__ */ new Set([keyLow, ...keyLow < 0 && keyHigh > 0 ? [0] : [], keyHigh])] : valence ? [...negMin < 0 ? [negMin, ...between(negMin, 0, signedStep)] : [], 0, ...posMax > 0 ? [...between(0, posMax, signedStep), posMax] : []] : [vMin, ...between(vMin, vMax, niceStep((vMax - vMin) / 3)), vMax], seen = /* @__PURE__ */ new Set();
1048
+ return stops.flatMap((v, i) => {
1049
+ let label = keyText(v);
1050
+ return seen.has(label) ? [] : (seen.add(label), [item(String(i), label, fillPaint(v, null, !0))]);
1051
+ });
1052
+ }
1053
+ function bubbleCell(r, c, cell, rect, owner, paint, css) {
1054
+ if (cell.v === null) return;
1055
+ let radius = radiusOf(cell.size);
1056
+ if (radius === 0) {
1057
+ hasSizes && cell.size === null && missingSizes++;
1058
+ return;
1059
+ }
1060
+ let cx = round2(rect.x + rect.w / 2), cy = round2(rect.y + rect.h / 2), rr = round2(radius), low = lowBase(cell);
1061
+ if (bubbleNodes.push(low ? { t: "path", id: `bubble:${cellKey(r, c)}`, d: `M${round2(cx - rr)} ${cy}A${rr} ${rr} 0 1 0 ${round2(cx + rr)} ${cy}A${rr} ${rr} 0 1 0 ${round2(cx - rr)} ${cy}Z`, fill: paint, pattern: "hatch45", stroke: paint, width: strokeToken(theme, "mark"), owner, part: "bubble" } : { t: "circle", id: `bubble:${cellKey(r, c)}`, cx, cy, r: rr, fill: paint, owner, part: "bubble" }), !cellLabelsOn || topOnly && cell.size !== levels.length) return;
1062
+ let text = textFor(cell.v, cell.pct, cell.meta, r);
1063
+ if (!text) return;
1064
+ let tsize = measure(text, valueLabelFont), inside = bubbleStyle ? valueRadius(text) <= radius + VALUE_OVERHANG : Math.hypot(tsize.width / 2 + 1, tsize.height / 2 + 1) <= radius, besideX = cx + radius + 2, beside = !inside && besideX + tsize.width <= rect.x + rect.w && tsize.height <= rect.h;
1065
+ if (!inside && !beside) {
1066
+ omittedValues++, hiddenCells.push({ r, c, v: cell.v });
1067
+ return;
1068
+ }
1069
+ let insideFill = low ? paintColor(theme, { token: "background" }) : css;
1070
+ labelRequests.push({
1071
+ id: `point:${cellKey(r, c)}`,
1072
+ kind: "point",
1073
+ typeRole: "label",
1074
+ owner,
1075
+ text,
1076
+ lines: [text],
1077
+ font: valueLabelFont,
1078
+ priority: cell.meta?.priority ?? (cell.v === extremeMax || cell.v === extremeMin ? PRIORITY.extreme : PRIORITY.interior + Math.min(99, Math.abs(cell.v))) + bonus(r.id, c.id),
1079
+ candidates: [inside ? { slot: "insideCenter", rect: { x: cx - tsize.width / 2, y: cy - tsize.height / 2, w: tsize.width, h: tsize.height }, penalty: 0, insideFill, insidePaint: low ? { token: "background" } : paint } : { slot: "right", rect: { x: besideX, y: cy - tsize.height / 2, w: tsize.width, h: tsize.height }, penalty: 0 }]
1080
+ });
1081
+ }
1082
+ function continuousStops() {
1083
+ let step = niceStep((vMax - vMin) / 3 || 1), stops = [vMin];
1084
+ for (let k = Math.ceil(vMin / step); k * step < vMax; k++) {
1085
+ let v = Number((k * step).toPrecision(12));
1086
+ v - vMin > step / 3 && vMax - v > step / 3 && stops.push(v);
1087
+ }
1088
+ vMax > vMin && stops.push(vMax);
1089
+ let seen = /* @__PURE__ */ new Set();
1090
+ return stops.filter((v) => !seen.has(keyText(v)) && !!seen.add(keyText(v)));
1091
+ }
1092
+ function planStyledBubbleKey() {
1093
+ let sizeLabel = options.bubble?.sizeLabel, colorLabel = options.bubble?.colorLabel, ink = { token: "inkMuted" }, textW = (t) => measure(t, keyFont).width, keyFormat = (value) => displayFor(value, pctMatrix, null, keySeries), direction = rows[0]?.direction, range = (lo, hi) => {
1094
+ let [a, b] = [keyFormat(lo), keyFormat(hi)];
1095
+ return numberRange(a.endsWith("%") && b.endsWith("%") ? a.slice(0, -1) : a, b);
1096
+ }, colours = bins ? bins.slice(1).map((hi, i) => ({
1097
+ id: `scale:bin:${i}`,
1098
+ label: bins.length === 2 ? range(bins[0], hi) : i === 0 ? `<${keyFormat(hi)}` : i === bins.length - 2 ? `\u2265${keyFormat(bins[i])}` : range(bins[i], hi),
1099
+ paint: binPaint(i, !0, direction)
1100
+ })) : continuousStops().map((v, i) => ({ id: `scale:bin:${i}`, label: keyText(v), paint: fillPaint(v, null, !0, direction) }));
1101
+ anyLowBase && colours.push({ id: "scale:lowBase", label: lowBaseKey, paint: semanticPalettePaint(theme, options.palette, "neutralMark", 0.55), hatch: !0 });
1102
+ let rEst = Math.max(1.5, Math.min(cellW, bubbleNaturalH) / 2 - (Math.min(cellW, bubbleNaturalH) < 40 ? BUBBLE_AIR_TIGHT : BUBBLE_AIR)), largest = Math.max(0, maxOf(rows.flatMap((r) => r.cells.map((c) => c.size ?? 0)))), sizeEntries = hasSizes ? levels ? levels.map((label, i) => ({ label, level: i + 1, r: Math.max(1.5, rEst * (i + 2) / (levels.length + 1)) })) : (() => {
1103
+ let sizeMax2 = largest, large = niceBelow(sizeMax2)[0];
1104
+ return [large === void 0 ? void 0 : niceBelow(large / 4)[0], large].filter((v) => v !== void 0 && v > 0).map((v) => ({ label: formatAutomaticNumber(v, { locale: options.locale?.language }), level: v, r: Math.max(1.5, rEst * Math.sqrt(sizeMax2 > 0 ? v / sizeMax2 : 0)) }));
1105
+ })() : [], headH = keyTitled ? keyLineH + 4 : 0, colourEntryW = colours.map((c) => 2 * KEY_DOT_R + KEY_TEXT_GAP + textW(c.label)), colourW = Math.max(colorLabel ? textW(colorLabel) : 0, colourEntryW.reduce((a, w) => a + w, 0) + KEY_ENTRY_GAP * Math.max(0, colours.length - 1)), colourH = Math.max(2 * KEY_DOT_R, keyLineH), sizeEntryW = sizeEntries.map((e) => 2 * e.r + KEY_TEXT_GAP + textW(e.label)), sizeW = sizeEntries.length ? Math.max(sizeLabel ? textW(sizeLabel) : 0, sizeEntryW.reduce((a, w) => a + w, 0) + KEY_ENTRY_GAP * Math.max(0, sizeEntries.length - 1)) : 0, sizeH = sizeEntries.length ? Math.max(keyLineH, ...sizeEntries.map((e) => 2 * e.r)) : 0, beside = sizeEntries.length === 0 || colourW + KEY_GROUP_GAP + sizeW <= plot0.w, height = beside ? headH + Math.max(colourH, sizeH) : headH + colourH + 8 + headH + sizeH;
1106
+ return { height, draw: () => {
1107
+ let out = [], top = plot0.y + annotationTopH, text = (id, line, tx, cy2) => ({ t: "text", id, x: round2(tx), y: round2(cy2 - keyLineH / 2), lines: [line], align: "start", font: keyFont, ink, typeRole: "axis", owner: { seriesId: id }, part: id.endsWith("Title") ? "legendHeading" : "legendLabel" }), circle = (id, cx, cy2, rr, paint, hatch, stroke) => hatch ? { t: "path", id, d: `M${round2(cx - rr)} ${round2(cy2)}A${round2(rr)} ${round2(rr)} 0 1 0 ${round2(cx + rr)} ${round2(cy2)}A${round2(rr)} ${round2(rr)} 0 1 0 ${round2(cx - rr)} ${round2(cy2)}Z`, fill: paint, pattern: "hatch45", stroke: paint, width: strokeToken(theme, "mark"), owner: { seriesId: id }, part: "swatch" } : { t: "circle", id, cx: round2(cx), cy: round2(cy2), r: round2(rr), fill: paint, ...stroke ? { stroke, strokeWidth: strokeToken(theme, "hair") } : {}, owner: { seriesId: id }, part: "swatch" };
1108
+ colorLabel && out.push(text("scale:colorTitle", colorLabel, plot0.x, top + keyLineH / 2));
1109
+ let colourRowH = beside ? Math.max(colourH, sizeH) : colourH, cy = top + headH + colourRowH / 2, x = plot0.x;
1110
+ if (colours.forEach((c, i) => {
1111
+ out.push(circle(c.id, x + KEY_DOT_R, cy, KEY_DOT_R, c.paint, c.hatch, c.stroke)), out.push(text(`scale:label:${c.id.replace(/^scale:/, "")}`, c.label, x + 2 * KEY_DOT_R + KEY_TEXT_GAP, cy)), x += colourEntryW[i] + KEY_ENTRY_GAP;
1112
+ }), sizeEntries.length) {
1113
+ let sx = beside ? plot0.x + colourW + KEY_GROUP_GAP : plot0.x, sTop = beside ? top : top + headH + colourH + 8;
1114
+ sizeLabel && out.push(text("scale:sizeTitle", sizeLabel, sx, sTop + keyLineH / 2)), cy = sTop + headH + (beside ? colourRowH : sizeH) / 2, x = sx;
1115
+ let neutral = semanticPalettePaint(theme, options.palette, "neutralMark", 0.55);
1116
+ sizeEntries.forEach((e, i) => {
1117
+ let rr = Math.min(e.r, radiusOf(e.level));
1118
+ out.push(circle(`scale:size:${i}`, x + e.r, cy, rr, neutral)), out.push(text(`scale:sizeLabel:${i}`, e.label, x + 2 * e.r + KEY_TEXT_GAP, cy)), x += sizeEntryW[i] + KEY_ENTRY_GAP;
1119
+ });
1120
+ }
1121
+ return occupied.claim({ x: plot0.x, y: top, w: plot0.w, h: height }, "legend", {}), out;
1122
+ } };
1123
+ }
1124
+ function bubbleKeyNodes() {
1125
+ let out = [], titleFont = { ...keyFont }, titleH = keyTitled ? keyLineH + 4 : 0, sizeLabel = options.bubble?.sizeLabel, colorLabel = options.bubble?.colorLabel, sizeEntries = hasSizes ? levels ? levels.map((label, i) => ({ label, r: radiusOf(i + 1) })) : (() => {
1126
+ let large = niceBelow(sizeMax)[0];
1127
+ return [large === void 0 ? void 0 : niceBelow(large / 4)[0], large].filter((v) => v !== void 0 && v > 0).map((v) => ({ label: formatAutomaticNumber(v, { locale: options.locale?.language }), r: radiusOf(v) }));
1128
+ })() : [], rKey = Math.max(0, ...sizeEntries.map((e) => e.r)), baseline = headTop - KEY_GAP - 3 - keyLineH, top = baseline - Math.max(rKey, KEY_BAR_H) - titleH, widths = sizeEntries.map((e) => Math.max(2 * e.r, measure(e.label, keyFont).width)), sizeW = Math.max(widths.reduce((a, w) => a + w, 0) + 12 * Math.max(0, widths.length - 1), sizeLabel ? measure(sizeLabel, titleFont).width : 0), edges = bins ?? [0, 1, 2, 3, 4, 5].map((k) => vMin + (vMax - vMin) * k / 5), span = edges.at(-1) - edges[0] || 1, shown = bins ?? [vMin, vMax], edgeText = shown.map((v) => displayFor(v, pctMatrix, null, keySeries)), barW = Math.max(120, Math.min(200, cellW * 3)), colorW = Math.max(barW + measure(edgeText[0], keyFont).width / 2 + measure(edgeText.at(-1), keyFont).width / 2, colorLabel ? measure(colorLabel, titleFont).width : 0), lowR = 6, lowW = anyLowBase ? 16 + 2 * lowR + 4 + measure(lowBaseKey, keyFont).width : 0, total = (sizeEntries.length > 0 ? sizeW + KEY_GROUP_GAP : 0) + Math.max(colorW, barW + measure(edgeText[0], keyFont).width / 2 + measure(edgeText.at(-1), keyFont).width / 2 + lowW), x = Math.max(plot0.x, gridX + gridW - total), text = (id, line, tx, ty, align, font, part) => ({ t: "text", id, x: round2(tx), y: round2(ty), lines: [line], align, font, ink: { token: "ink" }, typeRole: "axis", owner: { seriesId: id }, part });
1129
+ if (sizeEntries.length > 0) {
1130
+ sizeLabel && out.push(text("scale:sizeTitle", sizeLabel, x, top, "start", titleFont, "legendHeading"));
1131
+ let ex = x;
1132
+ sizeEntries.forEach((e, i) => {
1133
+ let cx = ex + widths[i] / 2, rr = round2(e.r);
1134
+ out.push({ t: "path", id: `scale:size:${i}`, d: `M${round2(cx - rr)} ${round2(baseline)}A${rr} ${rr} 0 0 1 ${round2(cx + rr)} ${round2(baseline)}Z`, fill: { token: "neutralMark", tint: 0.4 }, owner: { seriesId: `scale:size:${i}` }, part: "swatch" }), out.push(text(`scale:sizeLabel:${i}`, e.label, cx, baseline + 3, "middle", keyFont, "legendLabel")), ex += widths[i] + 12;
1135
+ }), x += sizeW + KEY_GROUP_GAP;
1136
+ }
1137
+ colorLabel && out.push(text("scale:colorTitle", colorLabel, x, top, "start", titleFont, "legendHeading"));
1138
+ let barX = x + measure(edgeText[0], keyFont).width / 2, at = (v) => barX + (v - edges[0]) / span * barW;
1139
+ edges.slice(1).forEach((hi, i) => {
1140
+ let lo = edges[i];
1141
+ out.push({
1142
+ t: "rect",
1143
+ id: `scale:bin:${i}`,
1144
+ rect: { x: round2(at(lo)), y: round2(baseline - KEY_BAR_H), w: round2(at(hi) - at(lo)), h: KEY_BAR_H },
1145
+ fill: bins ? binPaint(i, !0, rows[0]?.direction) : fillPaint((lo + hi) / 2, null, !0, rows[0]?.direction),
1146
+ owner: { seriesId: `scale:bin:${i}` },
1147
+ part: "swatch"
1148
+ });
1149
+ });
1150
+ let lastRight = -1 / 0;
1151
+ if (shown.forEach((v, i) => {
1152
+ let w = measure(edgeText[i], keyFont).width, left = at(v) - w / 2;
1153
+ left < lastRight + 4 && i !== shown.length - 1 || (out.push(text(`scale:break:${i}`, edgeText[i], at(v), baseline + 3, "middle", keyFont, "legendLabel")), lastRight = left + w);
1154
+ }), anyLowBase) {
1155
+ let lx = barX + barW + measure(edgeText.at(-1), keyFont).width / 2 + 16 + lowR, ly = round2(baseline - KEY_BAR_H / 2);
1156
+ out.push({ t: "path", id: "scale:lowBase", d: `M${round2(lx - lowR)} ${ly}A${lowR} ${lowR} 0 1 0 ${round2(lx + lowR)} ${ly}A${lowR} ${lowR} 0 1 0 ${round2(lx - lowR)} ${ly}Z`, fill: { token: "neutralMark" }, pattern: "hatch45", stroke: { token: "neutralMark" }, width: strokeToken(theme, "mark"), owner: { seriesId: "scale:lowBase" }, part: "swatch" }), out.push(text("scale:lowBaseLabel", lowBaseKey, lx + lowR + 4, ly - keyLineH / 2, "start", keyFont, "legendLabel"));
1157
+ }
1158
+ return occupied.claim({ x: Math.max(plot0.x, gridX + gridW - total), y: top, w: total, h: headTop - KEY_GAP - top }, "legend", {}), out;
1159
+ }
1160
+ function textFor(v, pct, meta, series) {
1161
+ if (meta?.label === !1) return null;
1162
+ let base = displayFor(v, pct, meta, series);
1163
+ return typeof meta?.label == "string" ? meta.label.replace(/\$\{value\}/g, base) : base;
1164
+ }
1165
+ function displayFor(v, pct, meta, series) {
1166
+ if (meta?.format) return meta[AUTOMATIC_FORMAT] ? formatNonzeroWithSpec(v, { ...exampleSpec(meta.format, options.locale?.language), automatic: !0 }) : formatterFromExample(meta.format, options.locale?.language)(v);
1167
+ let text = (series?.format || series?.unit ? formats.forSeries(series) : fmt)(v), example = series?.format ?? options.format;
1168
+ return pct && (!example || specUnitKind(parseFormatExample(example)) === "number") ? `${text}%` : text;
1169
+ }
1170
+ }
1171
+ function measureRowLabels(cells, textFor, font, measure, width, height, air = 2) {
1172
+ return cells.map((cell) => {
1173
+ let text = cell.meta?.label === !1 ? null : cell.v === null ? "\u2013" : textFor(cell.v, cell.pct, cell.meta);
1174
+ if (!text) return null;
1175
+ let size = measure(text, font);
1176
+ return { text, size, fits: size.width + air <= width && size.height + 2 <= height };
1177
+ });
1178
+ }
1179
+
1180
+ export {
1181
+ layoutHeatmap
1182
+ };