boardplot 0.0.0-stage → 0.52.5

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 (817) hide show
  1. package/CHANGELOG.md +18 -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-VUNSFKZY.js +137 -0
  8. package/dist/annotateEngine-H7OW4H3W.js +30 -0
  9. package/dist/build-identity.json +6 -0
  10. package/dist/chunk-24WB3HMB.js +621 -0
  11. package/dist/chunk-263SZKIL.js +8 -0
  12. package/dist/chunk-27QQEWNV.js +18 -0
  13. package/dist/chunk-2AKWCMS4.js +24 -0
  14. package/dist/chunk-2DHJJ2EN.js +24 -0
  15. package/dist/chunk-2EQE4E3I.js +22 -0
  16. package/dist/chunk-2GELJH37.js +88 -0
  17. package/dist/chunk-2JAWQ7VV.js +3874 -0
  18. package/dist/chunk-2LMCD3ZR.js +6 -0
  19. package/dist/chunk-2MTWKMEG.js +841 -0
  20. package/dist/chunk-2SGIHKKU.js +33 -0
  21. package/dist/chunk-2UVTHU7A.js +1146 -0
  22. package/dist/chunk-33CBPK5Q.js +2800 -0
  23. package/dist/chunk-33PLBIMA.js +176 -0
  24. package/dist/chunk-35DZP2R2.js +22 -0
  25. package/dist/chunk-3D3D3D23.js +25 -0
  26. package/dist/chunk-3EZRM4YM.js +92 -0
  27. package/dist/chunk-3GZECHOK.js +802 -0
  28. package/dist/chunk-3HHNQPAH.js +68 -0
  29. package/dist/chunk-3I6RANBJ.js +1058 -0
  30. package/dist/chunk-3SIRPKMP.js +12 -0
  31. package/dist/chunk-3W23F7EY.js +185 -0
  32. package/dist/chunk-3XQ635KD.js +24 -0
  33. package/dist/chunk-3ZCKEANJ.js +24 -0
  34. package/dist/chunk-4DNOEV3Q.js +25857 -0
  35. package/dist/chunk-4GB7TBY7.js +373 -0
  36. package/dist/chunk-4SM2ONUC.js +18 -0
  37. package/dist/chunk-5C7TWNYZ.js +79 -0
  38. package/dist/chunk-5DJXJXDE.js +58 -0
  39. package/dist/chunk-5ENRZX6I.js +687 -0
  40. package/dist/chunk-5KWXRYAT.js +294 -0
  41. package/dist/chunk-5T5YW52S.js +47 -0
  42. package/dist/chunk-627P6T25.js +936 -0
  43. package/dist/chunk-62FR4FYJ.js +23 -0
  44. package/dist/chunk-6JUJ2DU3.js +67 -0
  45. package/dist/chunk-6KWIQ5KF.js +18 -0
  46. package/dist/chunk-6UBEGKIQ.js +25 -0
  47. package/dist/chunk-6XE3GVGU.js +116 -0
  48. package/dist/chunk-76ANFJOI.js +227 -0
  49. package/dist/chunk-7IFLQMJL.js +160 -0
  50. package/dist/chunk-7JVAQX6C.js +28 -0
  51. package/dist/chunk-7QDAHY5M.js +63 -0
  52. package/dist/chunk-7VXZDB45.js +149 -0
  53. package/dist/chunk-7X65ZQN4.js +38 -0
  54. package/dist/chunk-A2FHZH7E.js +1410 -0
  55. package/dist/chunk-A372DLQX.js +54 -0
  56. package/dist/chunk-A3ULWR5N.js +76 -0
  57. package/dist/chunk-A4QZXLXF.js +7 -0
  58. package/dist/chunk-A5JWFZVU.js +1467 -0
  59. package/dist/chunk-A5LZUYK4.js +59 -0
  60. package/dist/chunk-A6XCAQ52.js +89 -0
  61. package/dist/chunk-A7A4PDG5.js +24 -0
  62. package/dist/chunk-A7IEVBYI.js +35 -0
  63. package/dist/chunk-ACXX2JNL.js +6 -0
  64. package/dist/chunk-AFK47A6O.js +25 -0
  65. package/dist/chunk-ALKTNXMR.js +3650 -0
  66. package/dist/chunk-AOQ6VF5H.js +6 -0
  67. package/dist/chunk-ASAON7G4.js +648 -0
  68. package/dist/chunk-ATTE3FYC.js +24 -0
  69. package/dist/chunk-AZOUSKZD.js +728 -0
  70. package/dist/chunk-B2EBEXIS.js +113 -0
  71. package/dist/chunk-B67K5X4M.js +58 -0
  72. package/dist/chunk-BBL3R5YZ.js +186 -0
  73. package/dist/chunk-BIDIGDGH.js +6 -0
  74. package/dist/chunk-BKYMLFUG.js +69 -0
  75. package/dist/chunk-BLFWUMTD.js +12 -0
  76. package/dist/chunk-BM6SFFWF.js +6 -0
  77. package/dist/chunk-BUPLB3EX.js +129 -0
  78. package/dist/chunk-BVWU6GOB.js +47 -0
  79. package/dist/chunk-BW5VLBSZ.js +15 -0
  80. package/dist/chunk-C64FBRJO.js +290 -0
  81. package/dist/chunk-CAE2HK2G.js +295 -0
  82. package/dist/chunk-CCQNL33L.js +446 -0
  83. package/dist/chunk-CDZHNLO6.js +42 -0
  84. package/dist/chunk-COKHNEJP.js +24 -0
  85. package/dist/chunk-COYPDRJK.js +21 -0
  86. package/dist/chunk-CRZKGHZ6.js +1810 -0
  87. package/dist/chunk-CS4DHFNG.js +128 -0
  88. package/dist/chunk-CYDZP5W6.js +1589 -0
  89. package/dist/chunk-D4BIV6WG.js +1072 -0
  90. package/dist/chunk-D4SOADBD.js +19 -0
  91. package/dist/chunk-DCCJRLAJ.js +422 -0
  92. package/dist/chunk-DFKTS6XJ.js +75 -0
  93. package/dist/chunk-DGDOGOTQ.js +25 -0
  94. package/dist/chunk-DLC23CKC.js +53 -0
  95. package/dist/chunk-DRTA6JG5.js +160 -0
  96. package/dist/chunk-DVKBU23L.js +97 -0
  97. package/dist/chunk-E2HEVF23.js +692 -0
  98. package/dist/chunk-EC2NAYPQ.js +24 -0
  99. package/dist/chunk-EKQK5D6G.js +14 -0
  100. package/dist/chunk-EKQMYG2B.js +2353 -0
  101. package/dist/chunk-ELYU6TRQ.js +98 -0
  102. package/dist/chunk-EQT3EPTB.js +203 -0
  103. package/dist/chunk-ERAIVAK5.js +1359 -0
  104. package/dist/chunk-ETHWK2RZ.js +16 -0
  105. package/dist/chunk-EWVKBRLV.js +72 -0
  106. package/dist/chunk-F77BNDAT.js +43 -0
  107. package/dist/chunk-FGAGGPFF.js +566 -0
  108. package/dist/chunk-FIANWJXX.js +19 -0
  109. package/dist/chunk-FIWNDOMO.js +6 -0
  110. package/dist/chunk-FOKEGVPB.js +24 -0
  111. package/dist/chunk-FT3F72C3.js +30 -0
  112. package/dist/chunk-FT47HQ5U.js +47 -0
  113. package/dist/chunk-GDOW2KNP.js +19 -0
  114. package/dist/chunk-GDQ3NGDZ.js +17 -0
  115. package/dist/chunk-GH3ZMBFX.js +563 -0
  116. package/dist/chunk-GQPESFAF.js +3378 -0
  117. package/dist/chunk-GQS46LC3.js +50 -0
  118. package/dist/chunk-GULJ6KVT.js +587 -0
  119. package/dist/chunk-GWQIXU37.js +2774 -0
  120. package/dist/chunk-GZ2VNM4L.js +24 -0
  121. package/dist/chunk-GZ4RHGIW.js +836 -0
  122. package/dist/chunk-H4H4O62O.js +46 -0
  123. package/dist/chunk-H57TJD3B.js +72 -0
  124. package/dist/chunk-H7UZZ7KP.js +24 -0
  125. package/dist/chunk-HAAUJDGB.js +83 -0
  126. package/dist/chunk-HFG76JTS.js +296 -0
  127. package/dist/chunk-HJXXFPOL.js +211 -0
  128. package/dist/chunk-HTYFQHRC.js +24 -0
  129. package/dist/chunk-HUF6TQ2J.js +24 -0
  130. package/dist/chunk-HUFCSX2Y.js +89 -0
  131. package/dist/chunk-HX3MQ3H4.js +26 -0
  132. package/dist/chunk-HZQEQ34U.js +296 -0
  133. package/dist/chunk-I322G5UG.js +888 -0
  134. package/dist/chunk-IDDA5INB.js +60 -0
  135. package/dist/chunk-IDTLHPTK.js +60 -0
  136. package/dist/chunk-II7652VA.js +2918 -0
  137. package/dist/chunk-IN4QT33I.js +38 -0
  138. package/dist/chunk-IV2UXZXX.js +16 -0
  139. package/dist/chunk-IXSZ7OKR.js +133 -0
  140. package/dist/chunk-IYEFEBRN.js +41 -0
  141. package/dist/chunk-IZ35GMGB.js +2543 -0
  142. package/dist/chunk-IZCOG3FS.js +28 -0
  143. package/dist/chunk-JA755JHN.js +379 -0
  144. package/dist/chunk-JETXFF3M.js +33 -0
  145. package/dist/chunk-JFBEAUJ6.js +24 -0
  146. package/dist/chunk-JFG4DHKQ.js +48 -0
  147. package/dist/chunk-JL5BRMDT.js +179 -0
  148. package/dist/chunk-JLCAWQ3H.js +195 -0
  149. package/dist/chunk-JLZM7XMZ.js +525 -0
  150. package/dist/chunk-JMH5MD5A.js +19 -0
  151. package/dist/chunk-JRPI64AQ.js +3066 -0
  152. package/dist/chunk-JSX3C6LL.js +344 -0
  153. package/dist/chunk-JY4R3GML.js +83 -0
  154. package/dist/chunk-JYBT2JNY.js +61 -0
  155. package/dist/chunk-K2HNV4LE.js +2008 -0
  156. package/dist/chunk-KAXJFL7N.js +43 -0
  157. package/dist/chunk-KDMKHR5A.js +32 -0
  158. package/dist/chunk-KFFNCDX6.js +19 -0
  159. package/dist/chunk-KKWZWP67.js +24 -0
  160. package/dist/chunk-KOJ5QETJ.js +8 -0
  161. package/dist/chunk-KPMGGE4W.js +51 -0
  162. package/dist/chunk-KS7DXCXH.js +27 -0
  163. package/dist/chunk-KSYVTEKR.js +24 -0
  164. package/dist/chunk-KU4YS6HN.js +61 -0
  165. package/dist/chunk-KYELSLDJ.js +40 -0
  166. package/dist/chunk-LC3PSQJJ.js +383 -0
  167. package/dist/chunk-LC6DYCTG.js +85 -0
  168. package/dist/chunk-LNKY5Z2X.js +23 -0
  169. package/dist/chunk-LO2DANS6.js +302 -0
  170. package/dist/chunk-M4SPKUZE.js +7 -0
  171. package/dist/chunk-M4YLED7M.js +17 -0
  172. package/dist/chunk-M6KTNAND.js +746 -0
  173. package/dist/chunk-MCOIEWW6.js +54 -0
  174. package/dist/chunk-MDYLOIS2.js +48 -0
  175. package/dist/chunk-MEISCROL.js +24 -0
  176. package/dist/chunk-MFLH5ZDQ.js +69 -0
  177. package/dist/chunk-MIXKQJ64.js +935 -0
  178. package/dist/chunk-MJMJEURO.js +359 -0
  179. package/dist/chunk-MNJ2DHU6.js +526 -0
  180. package/dist/chunk-NEVSQGOI.js +63 -0
  181. package/dist/chunk-NG5IGZXC.js +1179 -0
  182. package/dist/chunk-NLOMCLKI.js +3303 -0
  183. package/dist/chunk-NMCOUVN5.js +24 -0
  184. package/dist/chunk-NT3HAZYT.js +51 -0
  185. package/dist/chunk-NXNQQ3DS.js +382 -0
  186. package/dist/chunk-NYEY6W5R.js +569 -0
  187. package/dist/chunk-OAPCJO6W.js +23 -0
  188. package/dist/chunk-OH7FA4TF.js +251 -0
  189. package/dist/chunk-OLNORNCT.js +331 -0
  190. package/dist/chunk-OQEBOVUO.js +30 -0
  191. package/dist/chunk-ORUJI3VB.js +83 -0
  192. package/dist/chunk-PEN2DK7T.js +49 -0
  193. package/dist/chunk-PGIQMQRU.js +1650 -0
  194. package/dist/chunk-PTVOXB5T.js +39 -0
  195. package/dist/chunk-PUVGWJQ5.js +24 -0
  196. package/dist/chunk-PWROWDZS.js +137 -0
  197. package/dist/chunk-Q6XJOJTY.js +29 -0
  198. package/dist/chunk-QBR6IKIX.js +50 -0
  199. package/dist/chunk-QETGGFH2.js +30 -0
  200. package/dist/chunk-QG6MOQLI.js +2934 -0
  201. package/dist/chunk-QGCEHR6S.js +13 -0
  202. package/dist/chunk-QHFQHQDC.js +43 -0
  203. package/dist/chunk-QHRE2M6V.js +26 -0
  204. package/dist/chunk-QKL7IY42.js +38 -0
  205. package/dist/chunk-QN6JHMGU.js +44 -0
  206. package/dist/chunk-QNHZXFRA.js +347 -0
  207. package/dist/chunk-QPWRHDLZ.js +17 -0
  208. package/dist/chunk-QVABTUDS.js +80 -0
  209. package/dist/chunk-QXILAMAU.js +28 -0
  210. package/dist/chunk-QZAT46PP.js +95 -0
  211. package/dist/chunk-R3WI7ZLE.js +545 -0
  212. package/dist/chunk-R5SWC3EW.js +30 -0
  213. package/dist/chunk-RJQ5YS3Q.js +40 -0
  214. package/dist/chunk-RNOD2UWF.js +613 -0
  215. package/dist/chunk-RNXITK5M.js +24 -0
  216. package/dist/chunk-ROXO4R3J.js +16 -0
  217. package/dist/chunk-RQ5DNYLG.js +10 -0
  218. package/dist/chunk-RSWVH7DB.js +24 -0
  219. package/dist/chunk-RTJXOIIQ.js +12 -0
  220. package/dist/chunk-RZNYW7UP.js +133 -0
  221. package/dist/chunk-S4F27M7N.js +37 -0
  222. package/dist/chunk-S4ONWRJE.js +28 -0
  223. package/dist/chunk-S53OGZL6.js +168 -0
  224. package/dist/chunk-S5ADHIZK.js +2508 -0
  225. package/dist/chunk-S62M63LU.js +19 -0
  226. package/dist/chunk-S7VDRUED.js +62 -0
  227. package/dist/chunk-SGD3ZHID.js +250 -0
  228. package/dist/chunk-SGSPYHFE.js +40 -0
  229. package/dist/chunk-SLTMRTXV.js +597 -0
  230. package/dist/chunk-SXGTRZFN.js +26 -0
  231. package/dist/chunk-SZPTTNW7.js +16 -0
  232. package/dist/chunk-T3IGJARD.js +22 -0
  233. package/dist/chunk-TA3TFKYZ.js +86 -0
  234. package/dist/chunk-TNEHPP3H.js +18 -0
  235. package/dist/chunk-TPYV2FTV.js +25 -0
  236. package/dist/chunk-TPZB2YWR.js +25 -0
  237. package/dist/chunk-TSR5YDPS.js +1266 -0
  238. package/dist/chunk-TTR7EWNH.js +170 -0
  239. package/dist/chunk-TVHLKVUO.js +24 -0
  240. package/dist/chunk-TXINIAFL.js +198 -0
  241. package/dist/chunk-TXZBBZOG.js +58 -0
  242. package/dist/chunk-UEU46Q3D.js +300 -0
  243. package/dist/chunk-UMDEWWXT.js +33 -0
  244. package/dist/chunk-UQSVWO7Z.js +334 -0
  245. package/dist/chunk-UZF3G2FN.js +942 -0
  246. package/dist/chunk-V422EKLW.js +24 -0
  247. package/dist/chunk-V4DYVLOO.js +433 -0
  248. package/dist/chunk-V4VC25UL.js +128 -0
  249. package/dist/chunk-V667FCIJ.js +12 -0
  250. package/dist/chunk-VABRPZVC.js +43 -0
  251. package/dist/chunk-VB2MJLET.js +19 -0
  252. package/dist/chunk-VDAKTZQP.js +18 -0
  253. package/dist/chunk-VDAZPGR2.js +79 -0
  254. package/dist/chunk-VXZFQKBJ.js +21 -0
  255. package/dist/chunk-VYMGZ27S.js +133 -0
  256. package/dist/chunk-W2RGSGRR.js +131 -0
  257. package/dist/chunk-W7UZXD5D.js +1109 -0
  258. package/dist/chunk-WDUNR2VI.js +2718 -0
  259. package/dist/chunk-WHSTEAVP.js +229 -0
  260. package/dist/chunk-WJMUMN3I.js +127 -0
  261. package/dist/chunk-WLZ54FWG.js +120 -0
  262. package/dist/chunk-WMJPFLF3.js +2980 -0
  263. package/dist/chunk-WRHFBCVY.js +24 -0
  264. package/dist/chunk-WVSNSWBJ.js +47 -0
  265. package/dist/chunk-WYJEOMNY.js +31 -0
  266. package/dist/chunk-WYJMV62X.js +24 -0
  267. package/dist/chunk-WZGJSQKN.js +29 -0
  268. package/dist/chunk-WZL4EEBS.js +11 -0
  269. package/dist/chunk-X7TXGKRX.js +272 -0
  270. package/dist/chunk-XB4KZ6WO.js +81 -0
  271. package/dist/chunk-XDLQRSSH.js +266 -0
  272. package/dist/chunk-XDS4UZGR.js +113 -0
  273. package/dist/chunk-XEGRWWNO.js +30 -0
  274. package/dist/chunk-XO5ONLVM.js +420 -0
  275. package/dist/chunk-XPWRD424.js +24 -0
  276. package/dist/chunk-XTNV2YMB.js +50 -0
  277. package/dist/chunk-XW5J5JAX.js +42 -0
  278. package/dist/chunk-XY5O74BH.js +33 -0
  279. package/dist/chunk-XYONCO5Q.js +984 -0
  280. package/dist/chunk-Y4PXIJMD.js +829 -0
  281. package/dist/chunk-YAYRRKC7.js +24 -0
  282. package/dist/chunk-YEDYBMCW.js +210 -0
  283. package/dist/chunk-YFG4E3N2.js +1161 -0
  284. package/dist/chunk-YHTO46W2.js +2670 -0
  285. package/dist/chunk-YI2ZVTCB.js +38 -0
  286. package/dist/chunk-YKO3VCTF.js +24 -0
  287. package/dist/chunk-YP3I6W7T.js +24 -0
  288. package/dist/chunk-YQ2B3YVF.js +687 -0
  289. package/dist/chunk-YS6KMYM4.js +91 -0
  290. package/dist/chunk-YTSSXSZR.js +197 -0
  291. package/dist/chunk-Z256ACGC.js +27 -0
  292. package/dist/chunk-Z2MGTKDR.js +20 -0
  293. package/dist/chunk-Z5VSLLNY.js +23 -0
  294. package/dist/chunk-Z7X3RGGA.js +22 -0
  295. package/dist/chunk-ZF43WRG3.js +29 -0
  296. package/dist/chunk-ZJKOLOVF.js +1754 -0
  297. package/dist/chunk-ZQ4VFQID.js +76 -0
  298. package/dist/chunk-ZSLGN6CO.js +89 -0
  299. package/dist/chunk-ZVTFZF4V.js +542 -0
  300. package/dist/cli/index.js +9 -0
  301. package/dist/core-5Z6UW5DS.js +31 -0
  302. package/dist/core-6ANZ2OWO.js +40 -0
  303. package/dist/core-6LLJNZ4O.js +37 -0
  304. package/dist/core-CPN2HF75.js +33 -0
  305. package/dist/core-CS7AKNME.js +37 -0
  306. package/dist/core-DBRILYNB.js +38 -0
  307. package/dist/core-DU77ZYPR.js +34 -0
  308. package/dist/core-E6YD7VU4.js +32 -0
  309. package/dist/core-EE55P6XK.js +56 -0
  310. package/dist/core-FFLPH5XK.js +41 -0
  311. package/dist/core-IV26EL5C.js +32 -0
  312. package/dist/core-IZVZ2B7Y.js +34 -0
  313. package/dist/core-JQV7STNF.js +34 -0
  314. package/dist/core-KBH3EJZV.js +32 -0
  315. package/dist/core-KFBW5PRT.js +36 -0
  316. package/dist/core-KWGXHBJE.js +37 -0
  317. package/dist/core-MZMR2DF4.js +32 -0
  318. package/dist/core-OK2ZY5OJ.js +29 -0
  319. package/dist/core-OV5MPTZP.js +43 -0
  320. package/dist/core-OW5V74Q4.js +40 -0
  321. package/dist/core-PL64QPOH.js +57 -0
  322. package/dist/core-PVINU5JJ.js +33 -0
  323. package/dist/core-QUYSNTC7.js +34 -0
  324. package/dist/core-RE3L6YCM.js +29 -0
  325. package/dist/core-RUA3EWW3.js +39 -0
  326. package/dist/core-RY6IFRKM.js +35 -0
  327. package/dist/core-SCWEVNUY.js +34 -0
  328. package/dist/core-SE67HHFG.js +55 -0
  329. package/dist/core-T5Q4DSH2.js +32 -0
  330. package/dist/core-TJX3I7KH.js +37 -0
  331. package/dist/core-ULUA5ZB2.js +55 -0
  332. package/dist/core-WLVU2HWX.js +46 -0
  333. package/dist/core-WQPHNVNY.js +51 -0
  334. package/dist/core-XXIOJY2X.js +52 -0
  335. package/dist/core-ZH7XTJTD.js +39 -0
  336. package/dist/core-ZHE7N4NS.js +50 -0
  337. package/dist/core-ZJYLJWZQ.js +38 -0
  338. package/dist/dataTable-IL7HVDHL.js +58 -0
  339. package/dist/engine-MYLZI5VH.js +961 -0
  340. package/dist/fixtures.d.ts +1 -0
  341. package/dist/fixtures.js +40 -0
  342. package/dist/fontTables-ZYBUCJ5N.js +18 -0
  343. package/dist/fonts.d.ts +1 -0
  344. package/dist/fonts.js +19 -0
  345. package/dist/geo/dach.d.ts +1 -0
  346. package/dist/geo/dach.js +14 -0
  347. package/dist/geo/de-states.d.ts +1 -0
  348. package/dist/geo/de-states.js +14 -0
  349. package/dist/geo/eu27.d.ts +1 -0
  350. package/dist/geo/eu27.js +14 -0
  351. package/dist/geo/europe.d.ts +1 -0
  352. package/dist/geo/europe.js +14 -0
  353. package/dist/geo/index.d.ts +1 -0
  354. package/dist/geo/index.js +41 -0
  355. package/dist/geo/us-states.d.ts +1 -0
  356. package/dist/geo/us-states.js +14 -0
  357. package/dist/geo/world.d.ts +1 -0
  358. package/dist/geo/world.js +14 -0
  359. package/dist/index.d.ts +1 -0
  360. package/dist/index.js +363 -0
  361. package/dist/main-ISJ53IS5.js +568 -0
  362. package/dist/mcp/server.js +1023 -0
  363. package/dist/module-SVEW5ZUE.js +137233 -0
  364. package/dist/react/bar.d.ts +1 -0
  365. package/dist/react/bar.js +80 -0
  366. package/dist/react/bartable.d.ts +1 -0
  367. package/dist/react/bartable.js +70 -0
  368. package/dist/react/box.d.ts +1 -0
  369. package/dist/react/box.js +64 -0
  370. package/dist/react/bullet.d.ts +1 -0
  371. package/dist/react/bullet.js +71 -0
  372. package/dist/react/butterfly.d.ts +1 -0
  373. package/dist/react/butterfly.js +65 -0
  374. package/dist/react/choropleth.d.ts +1 -0
  375. package/dist/react/choropleth.js +67 -0
  376. package/dist/react/cohort.d.ts +1 -0
  377. package/dist/react/cohort.js +69 -0
  378. package/dist/react/column.d.ts +1 -0
  379. package/dist/react/column.js +85 -0
  380. package/dist/react/combo.d.ts +1 -0
  381. package/dist/react/combo.js +85 -0
  382. package/dist/react/creative.d.ts +1 -0
  383. package/dist/react/creative.js +61 -0
  384. package/dist/react/diagram.d.ts +1 -0
  385. package/dist/react/diagram.js +60 -0
  386. package/dist/react/dimswitch.d.ts +1 -0
  387. package/dist/react/dimswitch.js +71 -0
  388. package/dist/react/dot.d.ts +1 -0
  389. package/dist/react/dot.js +69 -0
  390. package/dist/react/export.d.ts +1 -0
  391. package/dist/react/export.js +657 -0
  392. package/dist/react/funnel.d.ts +1 -0
  393. package/dist/react/funnel.js +62 -0
  394. package/dist/react/gantt.d.ts +1 -0
  395. package/dist/react/gantt.js +62 -0
  396. package/dist/react/grid.d.ts +1 -0
  397. package/dist/react/grid.js +66 -0
  398. package/dist/react/heatmap.d.ts +1 -0
  399. package/dist/react/heatmap.js +67 -0
  400. package/dist/react/histogram.d.ts +1 -0
  401. package/dist/react/histogram.js +85 -0
  402. package/dist/react/index.d.ts +1 -0
  403. package/dist/react/index.js +503 -0
  404. package/dist/react/kpi.d.ts +1 -0
  405. package/dist/react/kpi.js +67 -0
  406. package/dist/react/likert.d.ts +1 -0
  407. package/dist/react/likert.js +82 -0
  408. package/dist/react/line.d.ts +1 -0
  409. package/dist/react/line.js +80 -0
  410. package/dist/react/mekko.d.ts +1 -0
  411. package/dist/react/mekko.js +70 -0
  412. package/dist/react/pareto.d.ts +1 -0
  413. package/dist/react/pareto.js +89 -0
  414. package/dist/react/pie.d.ts +1 -0
  415. package/dist/react/pie.js +63 -0
  416. package/dist/react/prepare.d.ts +1 -0
  417. package/dist/react/prepare.js +277 -0
  418. package/dist/react/pvm.d.ts +1 -0
  419. package/dist/react/pvm.js +67 -0
  420. package/dist/react/pyramid.d.ts +1 -0
  421. package/dist/react/pyramid.js +66 -0
  422. package/dist/react/sankey.d.ts +1 -0
  423. package/dist/react/sankey.js +59 -0
  424. package/dist/react/scatter.d.ts +1 -0
  425. package/dist/react/scatter.js +62 -0
  426. package/dist/react/slope.d.ts +1 -0
  427. package/dist/react/slope.js +63 -0
  428. package/dist/react/sparkline.d.ts +1 -0
  429. package/dist/react/sparkline.js +59 -0
  430. package/dist/react/spec.d.ts +1 -0
  431. package/dist/react/spec.js +370 -0
  432. package/dist/react/status.d.ts +1 -0
  433. package/dist/react/status.js +64 -0
  434. package/dist/react/story.d.ts +1 -0
  435. package/dist/react/story.js +140 -0
  436. package/dist/react/table.d.ts +1 -0
  437. package/dist/react/table.js +68 -0
  438. package/dist/react/theme.d.ts +1 -0
  439. package/dist/react/theme.js +53 -0
  440. package/dist/react/tilemap.d.ts +1 -0
  441. package/dist/react/tilemap.js +66 -0
  442. package/dist/react/treemap.d.ts +1 -0
  443. package/dist/react/treemap.js +61 -0
  444. package/dist/react/variance.d.ts +1 -0
  445. package/dist/react/variance.js +64 -0
  446. package/dist/react/waffle.d.ts +1 -0
  447. package/dist/react/waffle.js +62 -0
  448. package/dist/react/waterfall.d.ts +1 -0
  449. package/dist/react/waterfall.js +67 -0
  450. package/dist/resvg-ZOVDIZTV.js +23 -0
  451. package/dist/rows.d.ts +1 -0
  452. package/dist/rows.js +23 -0
  453. package/dist/rowsModule-3Y4I3M3E.js +27 -0
  454. package/dist/schema-2BMZOHXI.js +22 -0
  455. package/dist/schema-2GUBWOBC.js +26 -0
  456. package/dist/schema-34ZELWRQ.js +25 -0
  457. package/dist/schema-3BHL2B76.js +22 -0
  458. package/dist/schema-4735XAZX.js +29 -0
  459. package/dist/schema-5YTNQ6JY.js +22 -0
  460. package/dist/schema-7J3NAIN2.js +27 -0
  461. package/dist/schema-AOJJ7JZB.js +22 -0
  462. package/dist/schema-CVMV4LRA.js +22 -0
  463. package/dist/schema-D3RCMN3T.js +22 -0
  464. package/dist/schema-E2ISJ65D.js +23 -0
  465. package/dist/schema-E6YOSOWB.js +28 -0
  466. package/dist/schema-EQQB43AY.js +22 -0
  467. package/dist/schema-EVLLL5UF.js +22 -0
  468. package/dist/schema-EYQ5IBLF.js +23 -0
  469. package/dist/schema-EYZVD73N.js +22 -0
  470. package/dist/schema-G4KFMQBL.js +22 -0
  471. package/dist/schema-GH7IKSOU.js +23 -0
  472. package/dist/schema-IF5N3J56.js +42 -0
  473. package/dist/schema-IG7JIR4H.js +23 -0
  474. package/dist/schema-JJYJOQTT.js +23 -0
  475. package/dist/schema-KFC4WYH4.js +32 -0
  476. package/dist/schema-L7263JMT.js +25 -0
  477. package/dist/schema-MEAFRXVH.js +53 -0
  478. package/dist/schema-P63S63GE.js +23 -0
  479. package/dist/schema-P7LJFJAJ.js +22 -0
  480. package/dist/schema-PA2MXYY4.js +23 -0
  481. package/dist/schema-PDZ6256H.js +23 -0
  482. package/dist/schema-PNC3Z7AH.js +25 -0
  483. package/dist/schema-QEVSIMGO.js +22 -0
  484. package/dist/schema-QJJPRRE7.js +22 -0
  485. package/dist/schema-S3EQKVOT.js +23 -0
  486. package/dist/schema-STGL44TL.js +22 -0
  487. package/dist/schema-T4NE2EAO.js +22 -0
  488. package/dist/schema-TQYTESG3.js +22 -0
  489. package/dist/schema-W376PAJG.js +22 -0
  490. package/dist/schema-XYYDUUHS.js +26 -0
  491. package/dist/specValidation-NVBIZMEE.js +48 -0
  492. package/dist/theme.d.ts +1 -0
  493. package/dist/theme.js +24 -0
  494. package/dist/themeShapeRules-5C2463YH.js +11 -0
  495. package/dist/types/core/a11y/accessibility.d.ts +43 -0
  496. package/dist/types/core/a11y/recordsShared.d.ts +44 -0
  497. package/dist/types/core/a11y/structuralRecords.d.ts +6 -0
  498. package/dist/types/core/a11y/types.d.ts +116 -0
  499. package/dist/types/core/annotate.d.ts +300 -0
  500. package/dist/types/core/annotateArms.d.ts +37 -0
  501. package/dist/types/core/annotateFields.d.ts +30 -0
  502. package/dist/types/core/annotateGapBracket.d.ts +66 -0
  503. package/dist/types/core/annotateLinks.d.ts +47 -0
  504. package/dist/types/core/annotateTargets.d.ts +90 -0
  505. package/dist/types/core/axis.d.ts +179 -0
  506. package/dist/types/core/bandSelect.d.ts +10 -0
  507. package/dist/types/core/bands.d.ts +14 -0
  508. package/dist/types/core/calendarLabels.d.ts +101 -0
  509. package/dist/types/core/charts/band/stacks.d.ts +155 -0
  510. package/dist/types/core/charts/bar/fixtures.d.ts +9 -0
  511. package/dist/types/core/charts/bar/layout.d.ts +95 -0
  512. package/dist/types/core/charts/bartable/fixtures.d.ts +4 -0
  513. package/dist/types/core/charts/bartable/types.d.ts +192 -0
  514. package/dist/types/core/charts/box/fixtures.d.ts +12 -0
  515. package/dist/types/core/charts/box/types.d.ts +110 -0
  516. package/dist/types/core/charts/bullet/fixtures.d.ts +11 -0
  517. package/dist/types/core/charts/butterfly/fixtures.d.ts +9 -0
  518. package/dist/types/core/charts/choropleth/fixtures.d.ts +3 -0
  519. package/dist/types/core/charts/choropleth/overlayTypes.d.ts +68 -0
  520. package/dist/types/core/charts/choropleth/types.d.ts +117 -0
  521. package/dist/types/core/charts/cohort/fixtures.d.ts +12 -0
  522. package/dist/types/core/charts/cohort/types.d.ts +165 -0
  523. package/dist/types/core/charts/column/anomaly.d.ts +204 -0
  524. package/dist/types/core/charts/column/fixtures.d.ts +12 -0
  525. package/dist/types/core/charts/column/layout.d.ts +116 -0
  526. package/dist/types/core/charts/column/model.d.ts +295 -0
  527. package/dist/types/core/charts/column/types.d.ts +56 -0
  528. package/dist/types/core/charts/combo/endpoints.d.ts +165 -0
  529. package/dist/types/core/charts/combo/fixtures.d.ts +12 -0
  530. package/dist/types/core/charts/combo/layout.d.ts +48 -0
  531. package/dist/types/core/charts/creative/fixtures.d.ts +4 -0
  532. package/dist/types/core/charts/creative/types.d.ts +73 -0
  533. package/dist/types/core/charts/diagram/fixtures.d.ts +3 -0
  534. package/dist/types/core/charts/dimswitch/compile.d.ts +20 -0
  535. package/dist/types/core/charts/dimswitch/fixtures.d.ts +3 -0
  536. package/dist/types/core/charts/dimswitch/types.d.ts +152 -0
  537. package/dist/types/core/charts/dot/fixtures.d.ts +11 -0
  538. package/dist/types/core/charts/funnel/fixtures.d.ts +11 -0
  539. package/dist/types/core/charts/gantt/fixtures.d.ts +9 -0
  540. package/dist/types/core/charts/gantt/layout.d.ts +56 -0
  541. package/dist/types/core/charts/grid/fixtures.d.ts +3 -0
  542. package/dist/types/core/charts/grid/metricStack.d.ts +108 -0
  543. package/dist/types/core/charts/grid/metricStackSchema.d.ts +74 -0
  544. package/dist/types/core/charts/grid/normalize.d.ts +99 -0
  545. package/dist/types/core/charts/grid/schema.d.ts +168 -0
  546. package/dist/types/core/charts/heatmap/fixtures.d.ts +11 -0
  547. package/dist/types/core/charts/histogram/fixtures.d.ts +15 -0
  548. package/dist/types/core/charts/histogram/types.d.ts +98 -0
  549. package/dist/types/core/charts/kpi/fixtures.d.ts +9 -0
  550. package/dist/types/core/charts/likert/fixtures.d.ts +11 -0
  551. package/dist/types/core/charts/likert/layout.d.ts +111 -0
  552. package/dist/types/core/charts/line/fixtures.d.ts +16 -0
  553. package/dist/types/core/charts/line/types.d.ts +6 -0
  554. package/dist/types/core/charts/mekko/fixtures.d.ts +13 -0
  555. package/dist/types/core/charts/pareto/fixtures.d.ts +5 -0
  556. package/dist/types/core/charts/pareto/layout.d.ts +68 -0
  557. package/dist/types/core/charts/pie/fixtures.d.ts +14 -0
  558. package/dist/types/core/charts/pvm/fixtures.d.ts +13 -0
  559. package/dist/types/core/charts/pvm/types.d.ts +118 -0
  560. package/dist/types/core/charts/pyramid/fixtures.d.ts +4 -0
  561. package/dist/types/core/charts/pyramid/types.d.ts +92 -0
  562. package/dist/types/core/charts/sankey/fixtures.d.ts +4 -0
  563. package/dist/types/core/charts/sankey/types.d.ts +116 -0
  564. package/dist/types/core/charts/scatter/fixtures.d.ts +12 -0
  565. package/dist/types/core/charts/scatter/types.d.ts +58 -0
  566. package/dist/types/core/charts/slope/fixtures.d.ts +13 -0
  567. package/dist/types/core/charts/sparkline/fixtures.d.ts +9 -0
  568. package/dist/types/core/charts/status/fixtures.d.ts +8 -0
  569. package/dist/types/core/charts/status/layout.d.ts +71 -0
  570. package/dist/types/core/charts/table/fitFormats.d.ts +67 -0
  571. package/dist/types/core/charts/table/fixtures.d.ts +7 -0
  572. package/dist/types/core/charts/table/resolve.d.ts +72 -0
  573. package/dist/types/core/charts/table/view.d.ts +156 -0
  574. package/dist/types/core/charts/tilemap/fixtures.d.ts +3 -0
  575. package/dist/types/core/charts/tilemap/types.d.ts +94 -0
  576. package/dist/types/core/charts/treemap/fixtures.d.ts +4 -0
  577. package/dist/types/core/charts/treemap/types.d.ts +78 -0
  578. package/dist/types/core/charts/variance/fixtures.d.ts +12 -0
  579. package/dist/types/core/charts/waffle/fixtures.d.ts +5 -0
  580. package/dist/types/core/charts/waffle/types.d.ts +117 -0
  581. package/dist/types/core/charts/waterfall/fixtures.d.ts +9 -0
  582. package/dist/types/core/claims/browser.d.ts +49 -0
  583. package/dist/types/core/claims/manifest.d.ts +22 -0
  584. package/dist/types/core/dateFormat.d.ts +39 -0
  585. package/dist/types/core/deferred.d.ts +121 -0
  586. package/dist/types/core/diagnostics/describe.d.ts +149 -0
  587. package/dist/types/core/diagnostics/jsonPatch.d.ts +36 -0
  588. package/dist/types/core/doc/bareChart.d.ts +2 -0
  589. package/dist/types/core/doc/diagnostics.d.ts +124 -0
  590. package/dist/types/core/doc/docExpand.d.ts +39 -0
  591. package/dist/types/core/doc/document.d.ts +43 -0
  592. package/dist/types/core/doc/ownedDocumentCopy.d.ts +5 -0
  593. package/dist/types/core/doc/specError.d.ts +6 -0
  594. package/dist/types/core/emptyData.d.ts +27 -0
  595. package/dist/types/core/eventLane.d.ts +208 -0
  596. package/dist/types/core/fontMetrics/index.d.ts +47 -0
  597. package/dist/types/core/fontMetrics/injected.d.ts +40 -0
  598. package/dist/types/core/fontMetrics/tableDocument.d.ts +73 -0
  599. package/dist/types/core/fontMetrics/tables.generated.d.ts +17 -0
  600. package/dist/types/core/footer.d.ts +59 -0
  601. package/dist/types/core/format.d.ts +149 -0
  602. package/dist/types/core/formatPrecision.d.ts +136 -0
  603. package/dist/types/core/formatSpec.d.ts +302 -0
  604. package/dist/types/core/frame.d.ts +583 -0
  605. package/dist/types/core/geo/packs/all.d.ts +7 -0
  606. package/dist/types/core/geo/packs/dach.d.ts +16 -0
  607. package/dist/types/core/geo/packs/de-states.d.ts +16 -0
  608. package/dist/types/core/geo/packs/eu27.d.ts +16 -0
  609. package/dist/types/core/geo/packs/europe.d.ts +16 -0
  610. package/dist/types/core/geo/packs/index.d.ts +22 -0
  611. package/dist/types/core/geo/packs/registry.d.ts +37 -0
  612. package/dist/types/core/geo/packs/us-states.d.ts +16 -0
  613. package/dist/types/core/geo/packs/world.d.ts +16 -0
  614. package/dist/types/core/geo/tiles/eu27.generated.d.ts +412 -0
  615. package/dist/types/core/geo/tiles/europe.generated.d.ts +842 -0
  616. package/dist/types/core/geo/tiles/index.d.ts +8 -0
  617. package/dist/types/core/geo/tiles/types.d.ts +36 -0
  618. package/dist/types/core/geo/tiles/us-states.generated.d.ts +952 -0
  619. package/dist/types/core/geo/tiles/world.generated.d.ts +968 -0
  620. package/dist/types/core/geo/types.d.ts +146 -0
  621. package/dist/types/core/geometry.d.ts +102 -0
  622. package/dist/types/core/grid/sharedScale.d.ts +82 -0
  623. package/dist/types/core/icons.d.ts +227 -0
  624. package/dist/types/core/inputError.d.ts +14 -0
  625. package/dist/types/core/isoDate.d.ts +2 -0
  626. package/dist/types/core/isoTime.d.ts +7 -0
  627. package/dist/types/core/label/categoryRow.d.ts +332 -0
  628. package/dist/types/core/label/occupied.d.ts +41 -0
  629. package/dist/types/core/label/ownership.d.ts +83 -0
  630. package/dist/types/core/label/solver.d.ts +380 -0
  631. package/dist/types/core/label/tickRow.d.ts +78 -0
  632. package/dist/types/core/live/types.d.ts +50 -0
  633. package/dist/types/core/normalize/shared.d.ts +56 -0
  634. package/dist/types/core/notes.d.ts +174 -0
  635. package/dist/types/core/othersShade.d.ts +9 -0
  636. package/dist/types/core/periodYears.d.ts +9 -0
  637. package/dist/types/core/polyline.d.ts +11 -0
  638. package/dist/types/core/rangeRules.d.ts +19 -0
  639. package/dist/types/core/ratioTier.d.ts +120 -0
  640. package/dist/types/core/readerStrings.d.ts +13 -0
  641. package/dist/types/core/reading.d.ts +120 -0
  642. package/dist/types/core/registry.d.ts +178 -0
  643. package/dist/types/core/repaintGeometry.d.ts +19 -0
  644. package/dist/types/core/request.d.ts +124 -0
  645. package/dist/types/core/rows.d.ts +45 -0
  646. package/dist/types/core/scale.d.ts +106 -0
  647. package/dist/types/core/schema/capability.d.ts +229 -0
  648. package/dist/types/core/schema/namedColumns.d.ts +45 -0
  649. package/dist/types/core/schema/reference.d.ts +31 -0
  650. package/dist/types/core/schema/refusals.d.ts +45 -0
  651. package/dist/types/core/schema/unknownKeys.d.ts +45 -0
  652. package/dist/types/core/seriesIdentity.d.ts +120 -0
  653. package/dist/types/core/shareRounding.d.ts +49 -0
  654. package/dist/types/core/sizing.d.ts +330 -0
  655. package/dist/types/core/staticFooter.d.ts +6 -0
  656. package/dist/types/core/story.d.ts +41 -0
  657. package/dist/types/core/structureCounts.d.ts +10 -0
  658. package/dist/types/core/svg/renderSvg.d.ts +51 -0
  659. package/dist/types/core/target.d.ts +89 -0
  660. package/dist/types/core/text.d.ts +113 -0
  661. package/dist/types/core/theme.d.ts +478 -0
  662. package/dist/types/core/themeFields.d.ts +11 -0
  663. package/dist/types/core/themeRules.d.ts +111 -0
  664. package/dist/types/core/themeShape.d.ts +87 -0
  665. package/dist/types/core/themeValidate.d.ts +15 -0
  666. package/dist/types/core/timeAxis.d.ts +106 -0
  667. package/dist/types/core/types/annotations.d.ts +223 -0
  668. package/dist/types/core/types/cell.d.ts +82 -0
  669. package/dist/types/core/types/data.d.ts +309 -0
  670. package/dist/types/core/types/diagram.d.ts +234 -0
  671. package/dist/types/core/types/index.d.ts +8 -0
  672. package/dist/types/core/types/options.d.ts +1583 -0
  673. package/dist/types/core/types/scene.d.ts +990 -0
  674. package/dist/types/core/types/sizing.d.ts +51 -0
  675. package/dist/types/core/types/table.d.ts +873 -0
  676. package/dist/types/core/types/theme.d.ts +806 -0
  677. package/dist/types/core/zoom.d.ts +106 -0
  678. package/dist/types/fixtures/index.d.ts +40 -0
  679. package/dist/types/fixtures/registry.d.ts +15 -0
  680. package/dist/types/fonts.d.ts +10 -0
  681. package/dist/types/index.d.ts +70 -0
  682. package/dist/types/react/BoardplotTheme.d.ts +9 -0
  683. package/dist/types/react/DimSwitchChart.d.ts +36 -0
  684. package/dist/types/react/ScaleGroup.d.ts +31 -0
  685. package/dist/types/react/SceneRenderer.d.ts +23 -0
  686. package/dist/types/react/SizePlaceholder.d.ts +51 -0
  687. package/dist/types/react/StoryFrame.d.ts +42 -0
  688. package/dist/types/react/TableChart.d.ts +220 -0
  689. package/dist/types/react/a11ySurface.d.ts +20 -0
  690. package/dist/types/react/barrelCharts.d.ts +1023 -0
  691. package/dist/types/react/charts/bar.d.ts +28 -0
  692. package/dist/types/react/charts/bartable.d.ts +27 -0
  693. package/dist/types/react/charts/box.d.ts +27 -0
  694. package/dist/types/react/charts/bullet.d.ts +28 -0
  695. package/dist/types/react/charts/butterfly.d.ts +28 -0
  696. package/dist/types/react/charts/choropleth.d.ts +27 -0
  697. package/dist/types/react/charts/cohort.d.ts +52 -0
  698. package/dist/types/react/charts/column.d.ts +27 -0
  699. package/dist/types/react/charts/combo.d.ts +7 -0
  700. package/dist/types/react/charts/creative.d.ts +27 -0
  701. package/dist/types/react/charts/diagram.d.ts +162 -0
  702. package/dist/types/react/charts/dimswitch.d.ts +6 -0
  703. package/dist/types/react/charts/dot.d.ts +28 -0
  704. package/dist/types/react/charts/funnel.d.ts +28 -0
  705. package/dist/types/react/charts/gantt.d.ts +28 -0
  706. package/dist/types/react/charts/grid.d.ts +29 -0
  707. package/dist/types/react/charts/heatmap.d.ts +28 -0
  708. package/dist/types/react/charts/histogram.d.ts +27 -0
  709. package/dist/types/react/charts/kpi.d.ts +28 -0
  710. package/dist/types/react/charts/likert.d.ts +27 -0
  711. package/dist/types/react/charts/line.d.ts +28 -0
  712. package/dist/types/react/charts/mekko.d.ts +28 -0
  713. package/dist/types/react/charts/pareto.d.ts +28 -0
  714. package/dist/types/react/charts/pie.d.ts +28 -0
  715. package/dist/types/react/charts/pvm.d.ts +27 -0
  716. package/dist/types/react/charts/pyramid.d.ts +27 -0
  717. package/dist/types/react/charts/sankey.d.ts +27 -0
  718. package/dist/types/react/charts/scatter.d.ts +28 -0
  719. package/dist/types/react/charts/slope.d.ts +28 -0
  720. package/dist/types/react/charts/sparkline.d.ts +28 -0
  721. package/dist/types/react/charts/status.d.ts +27 -0
  722. package/dist/types/react/charts/table.d.ts +6 -0
  723. package/dist/types/react/charts/tilemap.d.ts +27 -0
  724. package/dist/types/react/charts/treemap.d.ts +27 -0
  725. package/dist/types/react/charts/variance.d.ts +28 -0
  726. package/dist/types/react/charts/waffle.d.ts +28 -0
  727. package/dist/types/react/charts/waterfall.d.ts +28 -0
  728. package/dist/types/react/createChartComponent.d.ts +135 -0
  729. package/dist/types/react/export/clipboard.d.ts +8 -0
  730. package/dist/types/react/export/csv.d.ts +2 -0
  731. package/dist/types/react/export/frame.d.ts +35 -0
  732. package/dist/types/react/export/index.d.ts +7 -0
  733. package/dist/types/react/export/png.d.ts +14 -0
  734. package/dist/types/react/export/svg.d.ts +5 -0
  735. package/dist/types/react/export/types.d.ts +69 -0
  736. package/dist/types/react/export/useExport.d.ts +17 -0
  737. package/dist/types/react/exportLink.d.ts +49 -0
  738. package/dist/types/react/footerFrame.d.ts +25 -0
  739. package/dist/types/react/hover/dataTable.d.ts +13 -0
  740. package/dist/types/react/hover/engine.d.ts +210 -0
  741. package/dist/types/react/hover/keyboard.d.ts +44 -0
  742. package/dist/types/react/hover/labelCard.d.ts +170 -0
  743. package/dist/types/react/hover/placement.d.ts +49 -0
  744. package/dist/types/react/index.d.ts +16 -0
  745. package/dist/types/react/parseChartSpec.d.ts +16 -0
  746. package/dist/types/react/prepare.d.ts +32 -0
  747. package/dist/types/react/prepared.d.ts +53 -0
  748. package/dist/types/react/preparedTable.d.ts +15 -0
  749. package/dist/types/react/rowsInput.d.ts +55 -0
  750. package/dist/types/react/rowsModule.d.ts +18 -0
  751. package/dist/types/react/rowsStore.d.ts +50 -0
  752. package/dist/types/react/scale-group.d.ts +2 -0
  753. package/dist/types/react/scaleGroupContext.d.ts +22 -0
  754. package/dist/types/react/scenePaint.d.ts +10 -0
  755. package/dist/types/react/scrollState.d.ts +26 -0
  756. package/dist/types/react/spec.d.ts +65 -0
  757. package/dist/types/react/specValidation.d.ts +45 -0
  758. package/dist/types/react/story.d.ts +15 -0
  759. package/dist/types/react/theme.d.ts +9 -0
  760. package/dist/types/react/themeContext.d.ts +44 -0
  761. package/dist/types/react/useChartLayout.d.ts +22 -0
  762. package/dist/types/react/useContainerSize.d.ts +57 -0
  763. package/dist/types/react/useHover.d.ts +100 -0
  764. package/dist/types/react/useZoom.d.ts +50 -0
  765. package/dist/types/rows.d.ts +58 -0
  766. package/dist/types/tableLooks.d.ts +6 -0
  767. package/dist/types/theme.d.ts +3 -0
  768. package/dist/types/validate.d.ts +3 -0
  769. package/dist/validate.d.ts +1 -0
  770. package/dist/validate.js +222 -0
  771. package/docs/FONTS.md +68 -0
  772. package/docs/TELEMETRY.md +94 -0
  773. package/docs/manual.md +838 -0
  774. package/docs/reference/bar.md +222 -0
  775. package/docs/reference/bartable.md +143 -0
  776. package/docs/reference/box.md +93 -0
  777. package/docs/reference/bullet.md +118 -0
  778. package/docs/reference/butterfly.md +117 -0
  779. package/docs/reference/choropleth.md +148 -0
  780. package/docs/reference/cohort.md +149 -0
  781. package/docs/reference/column.md +275 -0
  782. package/docs/reference/combo.md +219 -0
  783. package/docs/reference/creative.md +147 -0
  784. package/docs/reference/diagram.md +191 -0
  785. package/docs/reference/dimswitch.md +1395 -0
  786. package/docs/reference/dot.md +117 -0
  787. package/docs/reference/fixtures.md +1088 -0
  788. package/docs/reference/funnel.md +121 -0
  789. package/docs/reference/gantt.md +132 -0
  790. package/docs/reference/grid.md +302 -0
  791. package/docs/reference/heatmap.md +127 -0
  792. package/docs/reference/histogram.md +77 -0
  793. package/docs/reference/kpi.md +115 -0
  794. package/docs/reference/likert.md +113 -0
  795. package/docs/reference/line.md +436 -0
  796. package/docs/reference/mekko.md +114 -0
  797. package/docs/reference/options.md +313 -0
  798. package/docs/reference/pareto.md +102 -0
  799. package/docs/reference/pie.md +114 -0
  800. package/docs/reference/pvm.md +114 -0
  801. package/docs/reference/pyramid.md +99 -0
  802. package/docs/reference/react.md +703 -0
  803. package/docs/reference/reading.md +28 -0
  804. package/docs/reference/sankey.md +110 -0
  805. package/docs/reference/scatter.md +211 -0
  806. package/docs/reference/slope.md +126 -0
  807. package/docs/reference/sparkline.md +74 -0
  808. package/docs/reference/status.md +107 -0
  809. package/docs/reference/table.md +673 -0
  810. package/docs/reference/theme.md +361 -0
  811. package/docs/reference/tilemap.md +121 -0
  812. package/docs/reference/treemap.md +86 -0
  813. package/docs/reference/variance.md +126 -0
  814. package/docs/reference/waffle.md +106 -0
  815. package/docs/reference/waterfall.md +164 -0
  816. package/llms.txt +57 -0
  817. package/package.json +437 -4
@@ -0,0 +1,1179 @@
1
+ import {
2
+ headInk,
3
+ plainInk
4
+ } from "./chunk-MCOIEWW6.js";
5
+ import {
6
+ marginBracketLayout
7
+ } from "./chunk-MFLH5ZDQ.js";
8
+ import {
9
+ labelOn
10
+ } from "./chunk-V667FCIJ.js";
11
+ import {
12
+ runAnnotatePass
13
+ } from "./chunk-GQS46LC3.js";
14
+ import {
15
+ rowLabelBand
16
+ } from "./chunk-A372DLQX.js";
17
+ import {
18
+ GUTTER_MAX_SHARE,
19
+ fittedLabel,
20
+ gutterBudget,
21
+ stepDownFont
22
+ } from "./chunk-EWVKBRLV.js";
23
+ import {
24
+ chartTheme
25
+ } from "./chunk-SXGTRZFN.js";
26
+ import {
27
+ rowDrivenHeight
28
+ } from "./chunk-COYPDRJK.js";
29
+ import {
30
+ structureCount
31
+ } from "./chunk-B2EBEXIS.js";
32
+ import {
33
+ HARD_MINIMUM,
34
+ MONTH_START,
35
+ capPitch,
36
+ categoryLineAlign,
37
+ matrixWidths,
38
+ niceBelow,
39
+ niceStep,
40
+ planCategoryRow,
41
+ rotatedClaimRect,
42
+ rowSizing
43
+ } from "./chunk-GQPESFAF.js";
44
+ import {
45
+ DEFAULT_NOTE_LIMIT,
46
+ HIDDEN_LABEL_LEAD,
47
+ PRIORITY,
48
+ authoredFootnoteCount,
49
+ authoredNotes,
50
+ categoryLabelsAndMarks,
51
+ createOccupiedIndex,
52
+ frameTextOptions,
53
+ labelCtx,
54
+ labelsToNodes,
55
+ legendOff,
56
+ legendRequired,
57
+ normalizeLegendOption,
58
+ plotHeightAfter,
59
+ round2,
60
+ solveFrame,
61
+ solveLabels,
62
+ valueNoteLine
63
+ } from "./chunk-2JAWQ7VV.js";
64
+ import {
65
+ disclosureNote
66
+ } from "./chunk-YTSSXSZR.js";
67
+ import {
68
+ AUTOMATIC_FORMAT,
69
+ defaultFormatSpec,
70
+ exampleSpec,
71
+ formatNonzeroWithSpec,
72
+ formatterFromExample,
73
+ parseFormatExample,
74
+ rasterDecimals,
75
+ seriesRasterFormatter,
76
+ specUnitKind
77
+ } from "./chunk-ASAON7G4.js";
78
+ import {
79
+ NOT_AVAILABLE,
80
+ chartStrings,
81
+ defaultNumberDecimals,
82
+ formatAutomaticNumber,
83
+ nonzeroDecimals,
84
+ numberRange
85
+ } from "./chunk-YQ2B3YVF.js";
86
+ import {
87
+ cellMeta,
88
+ cellValue,
89
+ isPctCell
90
+ } from "./chunk-OAPCJO6W.js";
91
+ import {
92
+ arrowHeadPath,
93
+ arrowShaftEnd,
94
+ canvasMargin,
95
+ colorblindPaint,
96
+ emphasisWeight,
97
+ harveyWedgePath,
98
+ paintColor,
99
+ panelTypeClass,
100
+ readerFloorPx,
101
+ resolveSemanticPaletteTheme,
102
+ semanticPalettePaint,
103
+ sequentialShare,
104
+ strokeToken,
105
+ textScaleOf
106
+ } from "./chunk-II7652VA.js";
107
+ import {
108
+ DEFAULT_TARGET,
109
+ NormalizeError,
110
+ accessibleTitle,
111
+ normalizeCategory,
112
+ normalizeSeriesValues,
113
+ resolveHighlight,
114
+ resolveSize
115
+ } from "./chunk-SGD3ZHID.js";
116
+ import {
117
+ maxOf,
118
+ minOf,
119
+ pushAll
120
+ } from "./chunk-WYJEOMNY.js";
121
+ import {
122
+ defaultMeasurer,
123
+ wrapText
124
+ } from "./chunk-TXINIAFL.js";
125
+
126
+ // src/core/strings/heatmap.ts
127
+ var EN = {
128
+ // reader-facing wording linked only by its consumers.
129
+ noData: "No data",
130
+ hatchedNoData: "Hatched cells: no data.",
131
+ heatmapBaseNote: "Hatched {v1}: base below n = {v2}, read with care.",
132
+ circles: "circles",
133
+ cellsLower: "cells",
134
+ harveyBallName: "Harvey-ball",
135
+ bubbleScaleWord: "bubble{v1}",
136
+ circleAreaSize: " (circle area shows size)",
137
+ discrete: "discrete",
138
+ continuous: "continuous",
139
+ heatmapDescStart: "{v1} matrix, {v2} rows \xD7 {v3} columns. ",
140
+ valuesRange: "Values range {v1} to {v2}. ",
141
+ invertedRowsDesc: "Lower is better for {v1}. ",
142
+ rowMeansSentence: "Row means: {v1}.",
143
+ heatmapTitle: "Heatmap: {v1} \xD7 {v2} matrix",
144
+ // The note under a bubble matrix that prints values in its largest circles only.
145
+ heatmapTopValuesNote: "Values shown in the largest circles.",
146
+ // The callout under a value matrix whose story value has no room in its cell ("Aug low").
147
+ heatmapLeadLow: "{v1} low",
148
+ heatmapLeadHigh: "{v1} high"
149
+ }, DE = {
150
+ // reader-facing wording linked only by its consumers.
151
+ noData: "Keine Daten",
152
+ hatchedNoData: "Schraffierte Zellen: keine Daten.",
153
+ heatmapBaseNote: "Schraffierte {v1}: Basis unter n = {v2}; vorsichtig lesen.",
154
+ circles: "Kreise",
155
+ cellsLower: "Zellen",
156
+ harveyBallName: "Harvey-Ball",
157
+ bubbleScaleWord: "Blasendiagramm{v1}",
158
+ circleAreaSize: " (Kreisfl\xE4che zeigt Gr\xF6\xDFe)",
159
+ discrete: "diskret",
160
+ continuous: "stetig",
161
+ heatmapDescStart: "{v1} Matrix, {v2} {v2|Zeile|Zeilen} \xD7 {v3} {v3|Spalte|Spalten}. ",
162
+ valuesRange: "Wertespanne {v1} bis {v2}. ",
163
+ invertedRowsDesc: "Niedriger ist besser f\xFCr {v1}. ",
164
+ rowMeansSentence: "Zeilenmittel: {v1}.",
165
+ heatmapTitle: "W\xE4rmekarte: {v1} \xD7 {v2} Matrix",
166
+ // The note under a bubble matrix that prints values in its largest circles only.
167
+ heatmapTopValuesNote: "Werte stehen in den gr\xF6\xDFten Kreisen.",
168
+ heatmapLeadLow: "{v1} Tief",
169
+ heatmapLeadHigh: "{v1} Hoch"
170
+ }, { chartString } = chartStrings(EN, DE);
171
+
172
+ // src/core/charts/heatmap/layout.ts
173
+ function withSuffixFloor(widths, width, short) {
174
+ return short > 0 ? { ...widths, minWidth: Math.max(widths.minWidth, width + Math.ceil(short / GUTTER_MAX_SHARE)) } : widths;
175
+ }
176
+ 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");
177
+ function layoutHeatmap(data, options = {}, bracketGutter, valueNote, forceRows = [], compactKey = !1) {
178
+ let warnings = [], theme = resolveSemanticPaletteTheme(
179
+ chartTheme(options),
180
+ options.palette,
181
+ warnings
182
+ ), 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;
183
+ if (!data || !Array.isArray(data.categories) || data.categories.length === 0)
184
+ throw new NormalizeError("empty-data", "categories", "heatmap requires at least one category (column)");
185
+ if (!Array.isArray(data.series) || data.series.length === 0)
186
+ throw new NormalizeError("empty-data", "series", "heatmap requires at least one series (row)");
187
+ 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) => {
188
+ if (!s?.id) throw new NormalizeError("missing-id", `series[${i}]`, "series requires an id");
189
+ let { sizes, bases } = s;
190
+ if ((sizes?.length ?? 0) > rawCats.length || (bases?.length ?? 0) > rawCats.length)
191
+ 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");
192
+ let cells = normalizeSeriesValues(s, rawCats, i).map((c, ci) => ({
193
+ v: cellValue(c),
194
+ pct: isPctCell(c),
195
+ meta: cellMeta(c),
196
+ size: sizes?.[ci] ?? null,
197
+ base: bases?.[ci] ?? null
198
+ }));
199
+ return { id: s.id, label: s.label ?? s.id, direction: s.direction, format: s.format, unit: s.unit, cells };
200
+ });
201
+ glyph === "harvey" && rows.forEach((r, si) => r.cells.forEach((cell, ci) => {
202
+ let v = cell.v;
203
+ if (v === null || Number.isInteger(v) && v >= 0 && v <= 4) return;
204
+ 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;
205
+ throw new NormalizeError(
206
+ "harvey-ratings",
207
+ `series[${r.id}].values[${vi}]`,
208
+ `a Harvey ball shows a rating 0 to 4; series '${r.id}' holds ${v} for '${rawCats[ci].id}'`,
209
+ "supply ratings 0 to 4 or use numeric cells",
210
+ [{ op: "replace", path: "/options/variant", value: "value" }],
211
+ ["data", "series", si, "values", vi]
212
+ );
213
+ }));
214
+ let levels = options.bubble?.levels, hasSizes = data.series.some((s) => s.sizes !== void 0);
215
+ bubble && levels && rows.forEach((r, si) => r.cells.forEach((cell, ci) => {
216
+ let v = cell.size;
217
+ if (!(v === null || Number.isInteger(v) && v >= 1 && v <= levels.length))
218
+ throw new NormalizeError(
219
+ "bubble-levels",
220
+ `series[${r.id}].sizes[${ci}]`,
221
+ `a bubble size level runs 1 to ${levels.length} (${levels.join(", ")}); series '${r.id}' holds ${v} for '${rawCats[ci].id}'`,
222
+ "supply levels 1 to n or drop options.bubble.levels for a continuous area scale",
223
+ void 0,
224
+ ["data", "series", si, "sizes", ci]
225
+ );
226
+ })), 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"] });
227
+ let lowBase = (cell) => options.minBase !== void 0 && cell.base !== null && cell.base < options.minBase, meanOf = (vals) => {
228
+ let known = vals.filter((v) => v !== null);
229
+ return known.length > 0 ? known.reduce((a, b) => a + b, 0) / known.length : null;
230
+ }, colMeanAt = (ci) => meanOf(rows.map((r) => r.cells[ci].v)), rowMeanOf = (r) => meanOf(r.cells.map((c) => c.v)), byMean = (means, direction) => (a, b) => {
231
+ let ma = means[a], mb = means[b];
232
+ return ma === null || mb === null ? +(ma === null) - +(mb === null) || a - b : direction * (ma - mb) || a - b;
233
+ }, catSort = options.sort?.categories ?? "sheet";
234
+ if (catSort !== "sheet") {
235
+ let idx = cols.map((_, i) => i), means = cols.map((_, i) => colMeanAt(i));
236
+ 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]) }));
237
+ }
238
+ let segSort = options.sort?.segments ?? "sheet";
239
+ if (segSort !== "sheet") {
240
+ let idx = rows.map((_, i) => i), means = rows.map((r) => rowMeanOf(r));
241
+ segSort === "asc" ? idx.sort(byMean(means, 1)) : segSort === "desc" ? idx.sort(byMean(means, -1)) : idx.reverse(), rows = idx.map((i) => rows[i]);
242
+ }
243
+ let allValues = [];
244
+ for (let r of rows) for (let c of r.cells) c.v !== null && allValues.push(c.v);
245
+ 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 = {};
246
+ for (let r of rows) rowMeans[r.id] = rowMeanOf(r);
247
+ let colMeans = {};
248
+ cols.forEach((c, ci) => colMeans[c.id] = colMeanAt(ci));
249
+ let dataRows = rows, dataCols = cols;
250
+ if (turned) {
251
+ 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]) }));
252
+ cols = rows.map((r) => ({ id: r.id, label: r.label })), rows = turnedRows;
253
+ }
254
+ 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;
255
+ 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"] });
256
+ let lower = (s) => s.direction === "lowerIsBetter", flipped = data.series.findIndex((s) => lower(s) !== lower(data.series[0]));
257
+ if ((bins || glyph === "bubble" && scale === "continuous" && data.series.some((s) => s.direction !== void 0)) && options.legend !== "none" && flipped > 0)
258
+ throw new NormalizeError(
259
+ "mixed-directions",
260
+ `series[${data.series[flipped].id}].direction`,
261
+ `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`,
262
+ "give every row one direction, or split the lowerIsBetter rows into their own chart",
263
+ void 0,
264
+ ["data", "series", flipped, "direction"]
265
+ );
266
+ let binOf = (v) => {
267
+ let i = bins.length - 2;
268
+ for (; i > 0 && v < bins[i]; ) i--;
269
+ return i;
270
+ };
271
+ scale === "discrete" && !bins && !isRatingScale && allValues.length > 0 && warnings.push({
272
+ code: "discrete-quintiles",
273
+ severity: "warn",
274
+ message: `discrete scale expects integer values 0\u20134; values ${numberRange(fmt(vMin), fmt(vMax))} mapped to quintiles`
275
+ });
276
+ 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;
277
+ 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({
278
+ code: "direction-ignored",
279
+ severity: "warn",
280
+ 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"
281
+ });
282
+ let LADDER_PAINTS = [
283
+ semanticPalettePaint(theme, options.palette, "neutralMark", 0.85),
284
+ semanticPalettePaint(theme, options.palette, "sequential", 0.72),
285
+ semanticPalettePaint(theme, options.palette, "sequential", 0.48),
286
+ semanticPalettePaint(theme, options.palette, "sequential", 0.24),
287
+ semanticPalettePaint(theme, options.palette, "sequential")
288
+ ], valencePaint = (tone, _large, tint) => options.colorblindSafe ? { ...colorblindPaint(tone, !0), tint } : { token: tone === "good" ? "goodFill" : "badFill", tint }, fillPaint = (v, meta, large, direction) => {
289
+ if (meta?.fill) return { css: meta.fill };
290
+ if (v === null || glyph === "harvey") return { token: "background" };
291
+ if (bins) return binPaint(binOf(v), large, direction);
292
+ if (scale === "discrete")
293
+ return valence ? valencePaint(
294
+ v < 0 ? "bad" : "good",
295
+ large,
296
+ 1 - Math.min(1, Math.ceil(Math.abs(v) / (valenceSpan || 1) * 4) / 4)
297
+ ) : LADDER_PAINTS[Math.max(0, Math.min(4, levelOf(v)))];
298
+ let lowIsGood = direction === "lowerIsBetter";
299
+ if (v >= 0) {
300
+ if (valence) {
301
+ let amount2 = valenceSpan > 0 ? 1 - v / valenceSpan : 1;
302
+ return valencePaint(lowIsGood ? "bad" : "good", large, Math.max(0, Math.min(1, amount2)));
303
+ }
304
+ let tintAmount = Math.max(0, Math.min(1, 1 - (cap === void 0 ? sequentialShare(v, Math.max(0, vMin), posMax) : v / cap)));
305
+ return semanticPalettePaint(theme, options.palette, "sequential", tintAmount);
306
+ }
307
+ let amount = valenceSpan > 0 ? 1 + v / valenceSpan : 1;
308
+ return valencePaint(lowIsGood ? "good" : "bad", large, Math.max(0, Math.min(1, amount)));
309
+ };
310
+ function binPaint(bin, large, direction) {
311
+ let k = bins.length - 1;
312
+ if (!declaredDirections) return semanticPalettePaint(theme, options.palette, "sequential", k > 1 ? 0.75 * (k - 1 - bin) / (k - 1) : 0);
313
+ let s = (k > 1 ? 2 * bin / (k - 1) - 1 : 1) * (direction === "lowerIsBetter" ? -1 : 1);
314
+ 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)));
315
+ }
316
+ 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) => {
317
+ 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);
318
+ return `${cap !== void 0 && v === keyHigh && vMax > cap ? ">=" : cap !== void 0 && v === keyLow && vMin < -cap ? "<=" : ""}${value}`;
319
+ }, annotations = (options.annotations ?? []).map((a, n) => ({
320
+ ...a,
321
+ id: a.id ?? `${a.kind}-${n + 1}`
322
+ })), 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) => {
323
+ let t = measure(text, valueLabelFont);
324
+ return Math.hypot(t.width / 2 + 1, 0.35 * t.height);
325
+ }, topValueR = topOnly ? Math.max(0, maxOf(rows.flatMap((r) => r.cells.flatMap((c) => {
326
+ if (c.v === null || c.size !== levels.length) return [];
327
+ let text = textFor(c.v, c.pct, c.meta, r);
328
+ return text ? [valueRadius(text)] : [];
329
+ })))) : 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 };
330
+ harveyWide && options.margin?.bottom === void 0 && (margin.bottom += HARVEY_BOTTOM_GAP);
331
+ 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 = [
332
+ ...topOnly ? [disclosureNote(chartString(options, "heatmapTopValuesNote"))] : [],
333
+ ...valueNote ? [disclosureNote(valueNote)] : [],
334
+ ...bubble && missingCells ? [disclosureNote(missingLook === "blank" ? "Blank cells: no data." : chartString(options, "hatchedNoData"))] : [],
335
+ ...anyLowBase ? [disclosureNote(chartString(options, "heatmapBaseNote", { v1: bubble ? chartString(options, "circles") : chartString(options, "cellsLower"), v2: formatAutomaticNumber(options.minBase, { locale: options.locale?.language }) }))] : []
336
+ ];
337
+ scaleItems && options.legend === "none" && legendOff(warnings, options.heatKey?.chartType ?? "heatmap", scaleItems.map((item) => item.label));
338
+ let scaleKey = options.legend === "none" ? void 0 : scaleItems;
339
+ if (scaleKey?.length)
340
+ legend = {
341
+ options: legendRequired(options.legend, warnings, options.heatKey?.chartType ?? "heatmap", theme, "the shading says how large each value is"),
342
+ items: scaleKey
343
+ };
344
+ else if (glyph === "harvey" && allValues.length > 0) {
345
+ let legendOptions = normalizeLegendOption(options.legend), step = (vMax - vMin) / 5;
346
+ legendOptions && (legend = {
347
+ options: legendOptions,
348
+ items: [0, 1, 2, 3, 4].map((level) => ({
349
+ id: `level:${level}`,
350
+ label: isRatingScale ? String(level) : numberRange(fmt(vMin + level * step), fmt(level === 4 ? vMax : vMin + (level + 1) * step)),
351
+ paint: semanticPalettePaint(theme, options.palette, "sequential"),
352
+ key: "harvey",
353
+ level
354
+ }))
355
+ });
356
+ }
357
+ let frameResult = solveFrame(
358
+ {
359
+ size,
360
+ margin,
361
+ ...frameTextOptions(options),
362
+ ...derivedNotes.length > 0 ? { footnotes: [...authoredNotes(options), ...derivedNotes] } : {},
363
+ legend,
364
+ theme,
365
+ measure
366
+ },
367
+ occupied
368
+ ), 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, {
369
+ wider,
370
+ target: options.target,
371
+ textScale: textScaleOf(options),
372
+ typeRole: "axis",
373
+ shrink: stepDownFont(theme, tickFont, "axis", options.target, textScaleOf(options))
374
+ }), 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(
375
+ cellHEst >= 2 * lineH + 4 && !(valueStyle && size.width < 480) ? 2 : 1,
376
+ Math.max(naturalWider, gutterBudget(capW, plot0.w, ROW_BAND_GAP + rowGutter + cols.length + (cols.length - 1) * CELL_GAP))
377
+ ), fittedRows = oneLine && !oneLine.labels.some((label) => label.title !== void 0) ? oneLine : fitRows(2, naturalWider), rowLines = fittedRows.labels.map((label, ri) => {
378
+ if (!valueStyle || !highlights.has(rows[ri].id)) return label;
379
+ let bold = { ...label.font, weight: emphasisWeight(theme) };
380
+ return { ...label, w: Math.max(label.w, ...label.lines.map((line) => measure(line, bold).width)) };
381
+ }), 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) => {
382
+ 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}";
383
+ 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\}$/, ""));
384
+ let glyphRoom = "icon" in a && a.icon || "status" in a && a.status ? 29 : 0, source = `${"headline" in a && a.headline !== void 0 ? `${a.headline}
385
+ ` : ""}${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));
386
+ return { w, h: Math.max(glyphRoom ? 22 : 0, measure("0", labelFont).height * lines.length), sideW: w + (glyphRoom ? 38 : CALLOUT_SEAT), truncated: wrapped.truncated };
387
+ }, 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)));
388
+ for (let pass = 0; pass <= notes.length; pass++) {
389
+ let budget = (space - sideWidth("left") - sideWidth("right")) * 0.15, failing = sideNotes.filter((a) => sideSizes.get(a.id).truncated || sideSizes.get(a.id).sideW > budget);
390
+ if (failing.length === 0) break;
391
+ let widest = failing.reduce((a, b) => noteSizes.get(a.id).sideW >= noteSizes.get(b.id).sideW ? a : b);
392
+ sideNotes = sideNotes.filter((a) => a !== widest);
393
+ }
394
+ let rowNotes = notes.filter((a) => !sideNotes.includes(a));
395
+ for (let a of rowNotes) {
396
+ let ref = "at" in a ? a.at : void 0;
397
+ if (typeof ref == "string" || !ref || !("categoryId" in ref) || !ref.seriesId || !("text" in a)) continue;
398
+ 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, `
399
+ `) : (a.text ?? "${value}").replace(/\s*\n\s*/g, " ");
400
+ if (a.id.startsWith("lead:")) continue;
401
+ let names = [...valueStyle && !("preferSide" in a && a.preferSide === "above") ? [] : [row?.label ?? ref.seriesId], col?.label ?? ref.categoryId].filter((name) => {
402
+ let literal = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
403
+ return !new RegExp(`(?:^|[^\\p{L}\\p{N}])${literal}(?:\\s*:|$)`, "u").test(body);
404
+ });
405
+ a.text = names.length ? `${names.join(" \xB7 ")}: ${body}` : body, noteSizes.set(a.id, noteSize(a));
406
+ }
407
+ 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 = rowHeight(belowNotes) + caretRoom, 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();
408
+ {
409
+ let centreOf = (a) => {
410
+ 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);
411
+ return ci < 0 ? void 0 : colCenter(ci);
412
+ }, span = (a, [lo, hi] = seatBounds.get(a.id) ?? [gridX, plot0.x + plot0.w]) => {
413
+ 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));
414
+ return [x, x + w];
415
+ }, seriesOfNote = (a) => {
416
+ let ref = "at" in a ? a.at : void 0;
417
+ return typeof ref == "object" && ref !== null && "seriesId" in ref ? ref.seriesId : void 0;
418
+ }, seatBeside = (a, group) => {
419
+ let bounds = [gridX, plot0.x + plot0.w], cx = centreOf(a);
420
+ if (cx === void 0 || group.some((b) => seriesOfNote(b) !== seriesOfNote(a))) return;
421
+ for (let b of group) {
422
+ let [b0, b1] = span(b), bx = centreOf(b) ?? b0;
423
+ bounds = cx < bx ? [bounds[0], Math.min(bounds[1], b0 - 12)] : [Math.max(bounds[0], b1 + 12), bounds[1]];
424
+ }
425
+ let [x0, x1] = span(a, bounds);
426
+ return x0 >= bounds[0] - 1e-6 && x1 <= bounds[1] + 1e-6 && x0 <= cx - 4 && x1 >= cx + 4 ? bounds : void 0;
427
+ };
428
+ for (let a of belowNotes) {
429
+ let bounds, seat = valueStyle ? belowRows.find((group) => (bounds = seatBeside(a, group)) !== void 0) : void 0;
430
+ seat ? (seat.push(a), seatBounds.set(a.id, bounds)) : belowRows.push([a]);
431
+ }
432
+ annotationBottomH = belowRows.reduce((sum, group) => sum + maxOf(group.map((a) => noteSizes.get(a.id).h)) + 8, 0) + caretRoom;
433
+ }
434
+ 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 = {
435
+ // A Harvey row plans as before and turns into its list only where its names would rotate.
436
+ rotate: !turnable || harveyStyle,
437
+ ordered: monthColumns,
438
+ plotHeight: plot0.h,
439
+ maxRotatedWidth: Math.min(Math.max(110, plot0.h * 0.3 / SIN45), (colCenter(0) - plot0.x) / SIN45),
440
+ target: options.target,
441
+ textScale: textScaleOf(options),
442
+ ...categoryLabelsAndMarks(cols, { count: authoredFootnoteCount(options), warnings }),
443
+ centers: cols.map((_, ci) => colCenter(ci)),
444
+ step: colStep,
445
+ fonts: [tickFont, { family: theme.type.family, ...theme.type.footnote }],
446
+ measure
447
+ }, headerPlan = planCategoryRow(headerInput);
448
+ if (valueStyle && monthColumns && headerPlan.step !== "fit" && !cols.some((c) => c.footnote !== void 0)) {
449
+ let initials = planCategoryRow({ ...headerInput, labels: cols.map((c) => c.label.trim().charAt(0).toLocaleUpperCase(options.locale?.language)) });
450
+ initials.step === "fit" && (headerPlan = { ...initials, infos: initials.infos.map((info, ci) => ({ ...info, title: info.title ?? cols[ci].label })) });
451
+ }
452
+ monthColumns && headerPlan.step === "stride" && !cols.some((c) => c.footnote !== void 0) && (headerPlan.keep = cols.map((_, ci) => (cols.length - 1 - ci) % headerPlan.stride === 0));
453
+ let flatHeader = (plan) => ["fit", "wrap", "font-down"].includes(plan.step) && plan.rotation === 0 && plan.maxLines <= 2, tierLift = cols.map(() => 0), tierTicks = [], tiered = (oneLine2 = !1) => {
454
+ let font = headerPlan.font.size >= tickFont.size ? headerPlan.font : tickFont, lineHt = font.size * (font.lineHeight ?? 1.2), info = (label, width) => {
455
+ let one = measure(label, font).width;
456
+ if (one <= width && (oneLine2 || one <= colStep + 4 || !/\s/.test(label.trim()))) return { lines: [label], w: one, h: lineHt, truncated: !1 };
457
+ if (one <= width) {
458
+ 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));
459
+ 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 };
460
+ }
461
+ let wrapped = wrapText(label, font, Math.max(1, width), 2, measure), w = Math.max(1, ...wrapped.lines.map((line) => measure(line, font).width));
462
+ return { lines: wrapped.lines, w, h: wrapped.lines.length * lineHt, truncated: wrapped.truncated || w > width + 1e-6 };
463
+ }, 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));
464
+ for (let up of [0, 1]) {
465
+ 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) => {
466
+ let xs2 = list.map((item, ci) => Math.max(room(ci)[0], Math.min(room(ci)[1] - item.w, colCenter(ci) - item.w / 2)));
467
+ for (let ci = list.length - 3; ci >= 0; ci--) {
468
+ let limit = xs2[ci + 2] - TIER_NAME_GAP - list[ci].w;
469
+ xs2[ci] > limit && (xs2[ci] = Math.max(room(ci)[0], colCenter(ci) - list[ci].w, limit));
470
+ }
471
+ return xs2;
472
+ }, 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);
473
+ if (apartOf(infos, xs) || (infos = cols.map((c, ci) => {
474
+ let near = info(c.label, Math.min(limitOf(ci), Math.max(centred(ci), Math.min(twoCols, widestWord(c.label)))));
475
+ return near.truncated ? info(c.label, limitOf(ci)) : near;
476
+ }), xs = xsOf(infos)), apartOf(infos, xs) && infos.every((info2) => !info2.truncated && (!oneLine2 || info2.lines.length === 1))) {
477
+ let upper = (ci) => ci % 2 === up, tierH = [!0, !1].map((top) => maxOf(infos.filter((_, ci) => upper(ci) === top).map((info2) => info2.h)));
478
+ cols.forEach((_, ci) => tierLift[ci] = upper(ci) ? tierH[1] + TIER_GAP : 0), tierTicks = cols.map((_, ci) => ci).filter(upper);
479
+ let finalXs = xs;
480
+ return headerPlan = {
481
+ ...headerPlan,
482
+ font,
483
+ infos,
484
+ keep: cols.map(() => !0),
485
+ stride: 1,
486
+ rotation: 0,
487
+ warnings: [],
488
+ step: "wrap",
489
+ maxLines: maxOf(infos.map((info2) => info2.lines.length)),
490
+ rowHeight: tierH[0] + TIER_GAP + tierH[1],
491
+ x: (ci) => finalXs[ci]
492
+ }, !0;
493
+ }
494
+ }
495
+ return !1;
496
+ }, keepUpright = bubbleStyle && turnable && !flatHeader(headerPlan) && cols.length >= 2 && colStep >= UPRIGHT_TIER_PITCH && tiered(!0);
497
+ if (turnable && !flatHeader(headerPlan) && !keepUpright)
498
+ return layoutHeatmap(data, { ...options, [TURNED]: !0 }, bracketGutter, valueNote, forceRows, compactKey);
499
+ if (turned && !flatHeader(headerPlan) && cols.length >= 2 && tiered(), harveyList) {
500
+ 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 }));
501
+ headerPlan = {
502
+ ...headerPlan,
503
+ font: tickFont,
504
+ infos,
505
+ keep: cols.map(() => !0),
506
+ stride: 1,
507
+ rotation: 0,
508
+ warnings: [],
509
+ step: "fit",
510
+ maxLines: 1,
511
+ rowHeight: lineHt,
512
+ x: () => plot0.x
513
+ };
514
+ }
515
+ let headerRotated = headerPlan.rotation !== 0, colLines = headerPlan.infos, headerFont = headerPlan.font, headerLines = headerPlan.maxLines, showHeaderRow = labelOn2("category") && cols.length > 0;
516
+ showHeaderRow && pushAll(warnings, headerPlan.warnings);
517
+ 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);
518
+ if (continuousKey && !keyRight && !valueStyle && cellW < 2 * measure("0", labelFont).height)
519
+ return layoutHeatmap(data, options, bracketGutter, valueNote, forceRows, !0);
520
+ 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(
521
+ r.cells,
522
+ (v, pct, meta) => textFor(v, pct, meta, r),
523
+ { ...labelFont, size: readerFloorPx(options.target ?? DEFAULT_TARGET, "label", textScaleOf(options)) },
524
+ measure,
525
+ cellW,
526
+ 1 / 0,
527
+ 4
528
+ ).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(
529
+ bubble ? cellW : 0,
530
+ Math.max(rowFloor, valueLineH, maxOf(rowLines.map((label) => label.h + 4)))
531
+ ), 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);
532
+ {
533
+ let grow = rowDrivenHeight({
534
+ options,
535
+ width: size.width,
536
+ height: size.height,
537
+ chromeH: size.height - gridH,
538
+ rowsH: rows.length * naturalCellH + (rows.length - 1) * CELL_GAP
539
+ });
540
+ if (grow !== void 0) return layoutHeatmap(data, { ...options, size: { width: size.width, height: grow } }, bracketGutter, valueNote, forceRows, compactKey);
541
+ }
542
+ let nodes = [...frameResult.nodes];
543
+ continuousKey && drawContinuousKey();
544
+ let marks = { cells: [] }, labelRequests = [], anchorCell = /* @__PURE__ */ new Map(), cellBoxes = /* @__PURE__ */ new Map(), highlightWash = {
545
+ token: "focus",
546
+ theme: { kind: "visible-tint", base: { token: "focus" }, amount: "surface-anchor", floor: 1.2, roundStep: !0 }
547
+ }, barHighlight = glyph !== "harvey", outlines = [];
548
+ cols.forEach((c, ci) => {
549
+ if (!highlights.has(c.id)) return;
550
+ let nodeId = `colTint:${c.id}`;
551
+ if (barHighlight) {
552
+ outlines.push({ id: nodeId, rect: { x: gridX + ci * colStep, y: gridY, w: cellW, h: gridH }, owner: colOwner(c), part: "colTint" });
553
+ return;
554
+ }
555
+ nodes.push({
556
+ t: "rect",
557
+ id: nodeId,
558
+ rect: { x: gridX + ci * colStep - 2, y: headTop, w: cellW + 4, h: headerH + gridH },
559
+ fill: highlightWash,
560
+ owner: { categoryId: c.id },
561
+ part: "colTint"
562
+ });
563
+ }), rows.forEach((r, ri) => {
564
+ if (!highlights.has(r.id)) return;
565
+ let nodeId = `rowTint:${r.id}`;
566
+ if (barHighlight) {
567
+ outlines.push({ id: nodeId, rect: { x: gridX, y: gridY + ri * rowStep, w: gridW, h: cellH }, owner: rowOwner(r), part: "rowTint" });
568
+ return;
569
+ }
570
+ nodes.push({
571
+ t: "rect",
572
+ id: nodeId,
573
+ rect: { x: plot0.x, y: gridY + ri * rowStep - 2, w: rowBandW + ROW_BAND_GAP + gridW, h: cellH + 4 },
574
+ fill: highlightWash,
575
+ owner: { seriesId: r.id },
576
+ part: "rowTint"
577
+ });
578
+ });
579
+ 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) => {
580
+ if (bubbleStyle && levels && size2 !== null) return size2 > 0 ? Math.max(1.5, bubbleR * (size2 + 1) / (levels.length + 1)) : 0;
581
+ let share = areaShare(size2);
582
+ return share > 0 ? Math.max(1.5, bubbleR * Math.sqrt(share)) : 0;
583
+ }, 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);
584
+ for (; valueFont.size > valueFloor && !fitted.every((values) => values.every((value) => value === null || value.fits)); )
585
+ valueFont = { ...valueFont, size: Math.max(valueFloor, valueFont.size - 1) }, fitted = rowValues(valueFont);
586
+ if (rows.forEach((r, ri) => {
587
+ let values = fitted[ri];
588
+ for (let value of values) value && (valueCellW = Math.max(valueCellW, value.size.width + 4));
589
+ cols.forEach((c, ci) => {
590
+ 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;
591
+ !barHighlight && "token" in paint && paint.token === "background" && !paint.tint && (highlights.has(r.id) || highlights.has(c.id)) && (paint = highlightWash);
592
+ 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);
593
+ if (nodes.push({
594
+ t: "rect",
595
+ id: nodeId,
596
+ rect,
597
+ fill: noData ? NO_DATA_PAINT : blankCell ? { token: "background" } : paint,
598
+ ...noData || low ? { pattern: "hatch45", hatchGround: { token: "background" } } : {},
599
+ ...needsStroke ? { stroke: { token: "grid" }, strokeWidth: strokeToken(theme, "hair") } : {},
600
+ owner,
601
+ part: "cell",
602
+ display: cell.v === null ? { state: "No data" } : { value: displayFor(cell.v, cell.pct, cell.meta, r) }
603
+ }), 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)}`, {
604
+ x: rect.x + rect.w / 2,
605
+ y: rect.y + rect.h / 2,
606
+ value: cell.v,
607
+ format: r.format,
608
+ date: c.date,
609
+ label: c.label,
610
+ owner,
611
+ // A comparison between cells of one row is a bracket beside that row.
612
+ row: { y: rect.y, h: rect.h, end: gridX + gridW }
613
+ }), glyph === "harvey" && cell.v !== null) {
614
+ 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;
615
+ nodes.push({
616
+ t: "circle",
617
+ id: `harveyRing:${r.id}:${c.id}`,
618
+ cx,
619
+ cy,
620
+ r: harveyR,
621
+ fill: { token: "background" },
622
+ // The styled ring takes the fill's colour.
623
+ stroke: harveyStyle ? semanticPalettePaint(theme, options.palette, "sequential") : { token: "neutralMark" },
624
+ strokeWidth: strokeToken(theme, "mark"),
625
+ owner,
626
+ part: "harveyRing"
627
+ }), q >= 4 ? nodes.push({
628
+ t: "circle",
629
+ id: `harveyFill:${r.id}:${c.id}`,
630
+ cx,
631
+ cy,
632
+ r: harveyR,
633
+ fill: semanticPalettePaint(theme, options.palette, "sequential"),
634
+ owner,
635
+ part: "harveyFill"
636
+ }) : q > 0 && nodes.push({
637
+ t: "path",
638
+ id: `harveyFill:${r.id}:${c.id}`,
639
+ d: harveyWedgePath(cx, cy, harveyR, q),
640
+ fill: semanticPalettePaint(theme, options.palette, "sequential"),
641
+ owner,
642
+ part: "harveyFill"
643
+ });
644
+ }
645
+ if (bubble) {
646
+ bubbleCell(r, c, cell, rect, owner, valuePaint, css);
647
+ return;
648
+ }
649
+ let value = values[ci];
650
+ if (value?.fits) {
651
+ 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));
652
+ labelRequests.push({
653
+ id: `point:${r.id}:${c.id}`,
654
+ kind: "point",
655
+ typeRole: "label",
656
+ owner,
657
+ text,
658
+ lines: [text],
659
+ font: valueFont,
660
+ ...valueFont !== labelFont ? { fontStep: valueFont } : {},
661
+ priority: cell.meta?.priority ?? basePriority + bonus(r.id, c.id),
662
+ candidates: [
663
+ {
664
+ slot: "insideCenter",
665
+ rect: {
666
+ x: rect.x + rect.w / 2 - tsize.width / 2,
667
+ y: rect.y + rect.h / 2 - tsize.height / 2,
668
+ w: tsize.width,
669
+ h: tsize.height
670
+ },
671
+ penalty: 0,
672
+ insideFill: low ? paintColor(theme, { token: "background" }) : css,
673
+ insidePaint: low ? { token: "background" } : insidePaint
674
+ }
675
+ ]
676
+ });
677
+ } else cellLabelsOn && cell.v !== null && (omittedValues++, hiddenCells.push({ r, c, v: cell.v }));
678
+ });
679
+ }), 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) {
680
+ let tip = gridX + gridW + TRACK_ROOM - 1;
681
+ rows.forEach((r, ri) => {
682
+ let y = round2(rowCenter(ri)), owner = { seriesId: r.id };
683
+ 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" });
684
+ });
685
+ }
686
+ if (pushAll(nodes, bubbleNodes), styledKey ? nodes.push(...styledKey.draw()) : bubbleKeys && nodes.push(...bubbleKeyNodes()), bubbleStyle || harveyStyle) {
687
+ let bottom = gridY + rows.length * rowStep - CELL_GAP;
688
+ for (let [id, y] of [["rule:top", gridY - 1], ["rule:bottom", bottom + 1]])
689
+ 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" });
690
+ for (let ci of tierTicks) {
691
+ let x = round2(colCenter(ci));
692
+ 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" });
693
+ }
694
+ }
695
+ if (options.heatKey === void 0 && omittedValues > 0 && valueNote === void 0) {
696
+ let lead2 = valueStyle ? leadCallout() : void 0, next = lead2 ? { ...options, annotations: [...options.annotations ?? [], lead2] } : options;
697
+ return layoutHeatmap(data, next, bracketGutter, hiddenValuesNote(lead2), forceRows, compactKey);
698
+ }
699
+ function rowFont(id) {
700
+ return valueStyle && id !== void 0 && highlights.has(id) ? { ...tickFont, weight: emphasisWeight(theme) } : tickFont;
701
+ }
702
+ labelOn2("series") && rows.forEach((r, ri) => {
703
+ let rl = rowLines[ri];
704
+ labelRequests.push({
705
+ id: rowLabelId(r),
706
+ kind: turned ? "category" : "series",
707
+ owner: rowOwner(r),
708
+ text: r.label,
709
+ ...fittedLabel(rl, tickFont),
710
+ font: rowFont(r.id),
711
+ priority: PRIORITY.endpoint + (highlights.has(r.id) ? PRIORITY.highlightBonus : 0),
712
+ candidates: [
713
+ {
714
+ slot: "left",
715
+ // The bubble matrix sets its row names at the plot edge.
716
+ 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 },
717
+ penalty: 0
718
+ }
719
+ ]
720
+ });
721
+ }), showHeaderRow && cols.forEach((c, ci) => {
722
+ let cl = colLines[ci];
723
+ labelRequests.push({
724
+ id: colLabelId(c),
725
+ kind: turned ? "series" : "category",
726
+ typeRole: "axis",
727
+ owner: colOwner(c),
728
+ text: c.label,
729
+ lines: cl.lines,
730
+ ...categoryLineAlign(headerPlan, ci),
731
+ ...cl.title !== void 0 ? { title: cl.title } : {},
732
+ font: headerFont,
733
+ priority: PRIORITY.endpoint + (highlights.has(c.id) ? PRIORITY.highlightBonus : 0),
734
+ redundant: !headerKeep[ci],
735
+ ...headerRotated ? { rotate: 45 } : {},
736
+ 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 }] : [
737
+ {
738
+ slot: "top",
739
+ rect: {
740
+ x: harveyList ? plot0.x : headerPlan.x(ci),
741
+ y: headTop + headerH - HEADER_GAP - cl.h - tierLift[ci],
742
+ w: cl.w,
743
+ h: cl.h
744
+ },
745
+ penalty: 0
746
+ }
747
+ ]
748
+ });
749
+ });
750
+ let outlineW = valueStyle ? size.width < 400 ? 1.25 : strokeToken(theme, "mark") : strokeToken(theme, "hair");
751
+ for (let outline of outlines) {
752
+ 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);
753
+ nodes.push({
754
+ t: "path",
755
+ id: outline.id,
756
+ d: `M${x0} ${y0}H${x1}V${y1}H${x0}Z`,
757
+ stroke: { token: "focus" },
758
+ width: outlineW,
759
+ owner: outline.owner,
760
+ part: outline.part
761
+ });
762
+ }
763
+ let solveCtx = labelCtx(theme, size, options, {
764
+ measure,
765
+ plot,
766
+ labelPad: 2
767
+ }), solved = solveLabels(labelRequests, occupied, solveCtx);
768
+ pushAll(warnings, solved.warnings);
769
+ let resolve = (ref) => {
770
+ let norm = typeof ref == "string" ? { categoryId: ref, edge: "total" } : ref;
771
+ if (!("categoryId" in norm)) return null;
772
+ if (norm.seriesId) {
773
+ let cell = anchorCell.get(`${norm.categoryId}:${norm.seriesId}`), printed = solved.placed.find((label) => label.id === `point:${norm.seriesId}:${norm.categoryId}` && !label.hidden);
774
+ return cell && printed ? { ...cell, printed: { text: printed.text, box: cellBoxes.get(`${norm.categoryId}:${norm.seriesId}`) } } : cell ?? null;
775
+ }
776
+ let ci = cols.findIndex((c) => c.id === norm.categoryId), mean = colMeans[norm.categoryId];
777
+ return ci < 0 || mean === null || mean === void 0 ? null : {
778
+ x: colCenter(ci),
779
+ y: gridY,
780
+ value: mean,
781
+ date: cols[ci].date,
782
+ label: cols[ci].label,
783
+ owner: { categoryId: norm.categoryId }
784
+ };
785
+ }, brackets = marginBracketLayout(theme, { right: gridX + gridW + BRACKET_CLEAR }), calloutRows = /* @__PURE__ */ new Map();
786
+ for (let [groups, start] of [[aboveNotes.map((a) => [a]), plot0.y + keyH + (keyBottom ? 0 : continuousKeyH)], [belowRows, gridY + gridH + caretRoom]]) {
787
+ let y = start + 4;
788
+ for (let group of groups) {
789
+ let h = maxOf(group.map((a) => noteSizes.get(a.id).h));
790
+ for (let a of group) {
791
+ let [lo, hi] = seatBounds.get(a.id) ?? [gridX, plot0.x + plot0.w];
792
+ calloutRows.set(a.id, valueStyle ? { x: lo, y, w: hi - lo, h } : { x: plot0.x, y, w: plot0.w, h });
793
+ }
794
+ y += h + 8;
795
+ }
796
+ }
797
+ let annResult = runAnnotatePass({
798
+ annotations,
799
+ resolve,
800
+ defaultSpan: cols.length >= 2 ? { from: cols[0].id, to: cols[cols.length - 1].id } : void 0,
801
+ comparisonLayout: brackets,
802
+ occupied,
803
+ plot: { x: gridX, y: gridY, w: gridW + gutterRight, h: gridH },
804
+ gridCallouts: { rows: calloutRows, widths: new Map(sideNotes.map((a) => [a.id, sideWrapWidth])), bounds: { ...plot0 }, grid: plot, sideLimit: gridW * 0.15 },
805
+ theme,
806
+ measure,
807
+ format: options.format,
808
+ locale: options.locale?.language,
809
+ strings: options.strings,
810
+ solveCtx
811
+ }), failedSideNotes = sideNotes.filter((a) => annResult.labels.some((l) => l.owner.annotationId === a.id && l.hidden !== void 0));
812
+ if (failedSideNotes.length) return layoutHeatmap(data, options, bracketGutter, valueNote, [...forceRows, ...failedSideNotes.map((a) => a.id)], compactKey);
813
+ pushAll(warnings, annResult.warnings);
814
+ for (let a of rowNotes) {
815
+ let label = annResult.labels.find((l) => l.owner.annotationId === a.id && !l.hidden), ref = "at" in a ? a.at : void 0;
816
+ if (!label || typeof ref == "string" || !ref || !("categoryId" in ref) || !ref.seriesId) continue;
817
+ let cell = cellBoxes.get(`${ref.categoryId}:${ref.seriesId}`);
818
+ if (!cell) continue;
819
+ let above = label.rect.y < gridY;
820
+ if (valueStyle && !above) {
821
+ let cx = round2(cell.x + cell.w / 2), cy = round2(gridY + gridH + 3);
822
+ 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;
823
+ continue;
824
+ }
825
+ 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 };
826
+ if ("arrow" in a && a.arrow && !("icon" in a && a.icon) && !("status" in a && a.status)) {
827
+ 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 ?? []);
828
+ annResult.nodes = annResult.nodes.filter((n) => !ids.has(n.id));
829
+ let owner = { annotationId: a.id };
830
+ annResult.nodes.push(
831
+ { 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" },
832
+ { t: "path", id: `ann:${a.id}:rowHead`, d: arrowHeadPath(tip, Math.PI, 4), fill: { token: "ink" }, owner, part: "calloutArrow" }
833
+ );
834
+ let placed = annResult.placed.find((p) => p.id === a.id);
835
+ placed.nodeIds = [`ann:${a.id}:rowArrow`, `ann:${a.id}:rowHead`];
836
+ 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 }]])
837
+ 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");
838
+ delete label.leader;
839
+ } else
840
+ delete label.leader;
841
+ }
842
+ if (valueStyle) for (let a of sideNotes) {
843
+ let label = annResult.labels.find((l) => l.owner.annotationId === a.id && !l.hidden), ref = "at" in a ? a.at : void 0;
844
+ if (!label || typeof ref == "string" || !ref || !("categoryId" in ref) || !ref.seriesId || "arrow" in a && a.arrow) continue;
845
+ let cell = cellBoxes.get(`${ref.categoryId}:${ref.seriesId}`);
846
+ if (!cell) continue;
847
+ 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);
848
+ 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);
849
+ }
850
+ let reach = brackets.need().right > 0 ? BRACKET_CLEAR + brackets.need().right : 0;
851
+ if (bracketGutter === void 0 && reach > gutterRight + 0.5)
852
+ return layoutHeatmap(data, options, Math.ceil(Math.min(reach, plot0.w * 0.35)), valueNote, forceRows, compactKey);
853
+ let allLabels = [...solved.placed, ...annResult.labels];
854
+ pushAll(nodes, annResult.nodes);
855
+ 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();
856
+ if (valueStyle) for (let a of belowNotes) {
857
+ let label = annResult.labels.find((l) => l.owner.annotationId === a.id && !l.hidden && l.rect.y >= gridY + gridH);
858
+ if (!label || label.lines.length < 2) continue;
859
+ let { x, w } = label.rect, align = x + w >= plot0.x + plot0.w - 0.5 ? "end" : x <= gridX + 0.5 ? "start" : "middle";
860
+ rowNoteAlign.set(`label:${label.id}`, { align, x: round2(align === "end" ? x + w : align === "start" ? x : x + w / 2) });
861
+ }
862
+ let namedRows = /* @__PURE__ */ new Set();
863
+ if (valueStyle) for (let group of belowRows) {
864
+ 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)));
865
+ !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" }));
866
+ }
867
+ 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]));
868
+ for (let label of allLabels) {
869
+ let col = headCols.get(label.id);
870
+ col !== void 0 && !highlights.has(col) && !label.emphasis && plainInk(label.ink) && (label.ink = headInk2);
871
+ }
872
+ pushAll(nodes, labelsToNodes(
873
+ theme,
874
+ allLabels,
875
+ (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,
876
+ nodes
877
+ ).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));
878
+ 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) => {
879
+ let mean = rowMeans[r.id];
880
+ return `${r.label} ${mean == null ? NOT_AVAILABLE : fmt(mean)}`;
881
+ }).join(", ") }) + (hiddenCells.length > 0 && options.heatKey === void 0 ? ` ${options.strings?.hiddenLabels ?? HIDDEN_LABEL_LEAD}: ${hiddenCells.map(hiddenItem).join(", ")}.` : "");
882
+ return {
883
+ type: "heatmap",
884
+ size,
885
+ sizing: rowSizing("heatmap", size, {
886
+ chromeH: size.height - gridH,
887
+ minimumRowsH: rows.length * Math.max(minRowH, maxOf(rowLines.map((label) => label.h))) + (rows.length - 1) * CELL_GAP,
888
+ naturalRowsH: rows.length * naturalCellH + (rows.length - 1) * CELL_GAP,
889
+ ...withSuffixFloor(
890
+ // A staggered header name spans two columns.
891
+ // The Harvey list needs its ball column and its widest name beside it.
892
+ harveyList ? (() => {
893
+ 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)));
894
+ return { minWidth: w, naturalWidth: w };
895
+ })() : matrixWidths(size.width - gridW, cols.length, CELL_GAP, colLines.map((label) => tierTicks.length ? label.w / 2 : label.w), valueCellW),
896
+ size.width,
897
+ rowSuffixShort
898
+ )
899
+ }),
900
+ plot,
901
+ scene: nodes,
902
+ labels: allLabels,
903
+ axes: [
904
+ {
905
+ axis: "x",
906
+ ticks: cols.map((c, ci) => ({ at: c.id, pos: colCenter(ci), labelId: colLabelId(c) }))
907
+ },
908
+ {
909
+ axis: "y",
910
+ ticks: rows.map((r, ri) => ({ at: r.id, pos: rowCenter(ri), labelId: rowLabelId(r) }))
911
+ }
912
+ ],
913
+ annotations: placedAnnotations,
914
+ frame: frameResult.frame,
915
+ ...frameResult.legend ? { legend: frameResult.legend } : {},
916
+ marks,
917
+ derived: {
918
+ max: round2(vMax),
919
+ min: round2(vMin),
920
+ rowMeans,
921
+ colMeans,
922
+ ...showHeaderRow ? {
923
+ tickBand: {
924
+ reserved: headerH,
925
+ measuredLines: headerLines,
926
+ lineHeight: headerFont.size * 1.2,
927
+ extra: headerPlan.rowHeight - headerLines * headerFont.size * 1.2,
928
+ dateNumeric: headerPlan.dateNumeric,
929
+ position: "above"
930
+ }
931
+ } : {}
932
+ },
933
+ a11y: {
934
+ title: accessibleTitle(options.title, chartString(options, "heatmapTitle", { v1: dataRows.length, v2: dataCols.length })),
935
+ counts: [structureCount("rows", dataRows.length, void 0, options), structureCount("columns", dataCols.length, void 0, options)],
936
+ desc: a11yDesc
937
+ },
938
+ warnings,
939
+ debug: {
940
+ occupied: occupied.snapshot(),
941
+ decisions: [...solved.decisions, ...annResult.decisions]
942
+ }
943
+ };
944
+ function leadCallout() {
945
+ let marked = rows.filter((r) => highlights.has(r.id));
946
+ if (marked.length !== 1 || turned) return;
947
+ let row = marked[0], best;
948
+ if (row.cells.forEach((cell, ci) => {
949
+ cell.v !== null && (best === void 0 || Math.abs(cell.v) > Math.abs(best.v)) && (best = { ci, v: cell.v });
950
+ }), !best) return;
951
+ let col = cols[best.ci];
952
+ 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;
953
+ let known = row.cells.flatMap((cell) => cell.v === null ? [] : [cell.v]), low = best.v === minOf(known);
954
+ return {
955
+ kind: "callout",
956
+ id: `lead:${row.id}:${col.id}`,
957
+ at: { seriesId: row.id, categoryId: col.id },
958
+ headline: "${value}",
959
+ text: chartString(options, low ? "heatmapLeadLow" : "heatmapLeadHigh", { v1: col.label }),
960
+ preferSide: "below"
961
+ };
962
+ }
963
+ function hiddenItem(h) {
964
+ let cell = h.r.cells[cols.indexOf(h.c)];
965
+ 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)}`;
966
+ }
967
+ function hiddenValuesNote(lead2) {
968
+ 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));
969
+ return valueNoteLine(heading, [.../* @__PURE__ */ new Set([...leads, ...unprinted])].map(hiddenItem), options, allValues.length)[0] ?? "";
970
+ }
971
+ function drawContinuousKey() {
972
+ let low = keyLow, high = keyHigh, short = !keyRight, step = short ? keyStep((high - low) / 4 || 1) : niceStep((high - low) / 3 || 1), ticks = [low];
973
+ for (let v = Math.ceil(low / step) * step; v < high - step * 1e-9; v += step)
974
+ (short ? v - low > step / 3 && high - v > step / 3 : v > low + step * 1e-9) && ticks.push(Number(v.toPrecision(12)));
975
+ high > low && ticks.push(high);
976
+ let textOf = short ? (v) => {
977
+ let text = keyText(v).replace(/^>=/, "\u2265").replace(/^<=/, "\u2264");
978
+ return v === 0 && !pctMatrix && !options.format && !keySeries?.format ? formatAutomaticNumber(0, { locale: options.locale?.language, decimals: 0 }) : valence && v > 0 ? text.replace(/^(≥?)(?![+≥])/, "$1+") : text;
979
+ } : 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));
980
+ for (let i = 0; i < slices; i++) nodes.push({
981
+ t: "rect",
982
+ id: `scale:ramp:${i}`,
983
+ 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 },
984
+ fill: fillPaint(low + (high - low) * (i + 0.5) / slices, null, !0),
985
+ owner: {},
986
+ part: "swatch"
987
+ });
988
+ let requests = ticks.map((v, i) => {
989
+ let text = textOf(v), size2 = measure(text, font), pos = at(v);
990
+ return nodes.push({
991
+ t: "line",
992
+ id: `scale:tick:${i}`,
993
+ ...keyRight ? { x1: x + w, x2: x + w + 3, y1: pos, y2: pos } : { x1: pos, x2: pos, y1: y + h, y2: y + h + 3 },
994
+ stroke: { token: "inkMuted" },
995
+ width: strokeToken(theme, "hair"),
996
+ owner: {},
997
+ part: "legendTick"
998
+ }), {
999
+ id: `scale:tickLabel:${i}`,
1000
+ kind: "scale",
1001
+ owner: {},
1002
+ text,
1003
+ lines: [text],
1004
+ typeRole: "axis",
1005
+ font,
1006
+ fontStep: font,
1007
+ priority: i === 0 || i === ticks.length - 1 ? PRIORITY.reference : PRIORITY.endpoint,
1008
+ 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 } }]
1009
+ };
1010
+ });
1011
+ 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" });
1012
+ 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 });
1013
+ nodes.push(...labelsToNodes(theme, solvedKey.placed, () => font).map((n) => n.t === "text" ? { ...n, part: "legendLabel" } : n)), occupied.claim(keyRect, "legend", {});
1014
+ let items = solvedKey.placed.filter((l) => !l.hidden).map((l) => ({ id: l.id, swatchNodeId: "scale:ramp:0", labelId: `label:${l.id}` }));
1015
+ frameResult.legend ? frameResult.legend.items.push(...items) : frameResult.legend = { rect: keyRect, items };
1016
+ }
1017
+ function keyStep(raw) {
1018
+ if (!(raw > 0) || !Number.isFinite(raw)) return 1;
1019
+ let base = Math.pow(10, Math.floor(Math.log10(raw))), m = raw / base;
1020
+ 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;
1021
+ }
1022
+ function colourScaleKey() {
1023
+ 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);
1024
+ if (bins)
1025
+ return bins.slice(1).map((hi, i) => item(String(i), numberRange(keyFormat(bins[i]), keyFormat(hi)), binPaint(i, !0, rows[0]?.direction)));
1026
+ if (scale === "discrete") {
1027
+ if (valence) return [-valenceSpan, -valenceSpan / 2, 0, valenceSpan / 2, valenceSpan].map((v, i) => item(String(i), keyFormat(v), fillPaint(v, null, !0)));
1028
+ let step = (vMax - vMin) / 5;
1029
+ return LADDER_PAINTS.map((paint, level) => item(
1030
+ String(level),
1031
+ isRatingScale ? keyFormat(level) : numberRange(keyFormat(vMin + level * step), keyFormat(level === 4 ? vMax : vMin + (level + 1) * step)),
1032
+ paint
1033
+ ));
1034
+ }
1035
+ if (valence && rows.some((r) => r.direction === "lowerIsBetter"))
1036
+ return [item("worse", "Worse", valencePaint("bad", !0, 0)), item("even", "Even", fillPaint(0, null, !0)), item("better", "Better", valencePaint("good", !0, 0))];
1037
+ let between = (from, to, step) => {
1038
+ let out = [];
1039
+ for (let k = Math.ceil(from / step); k * step < to; k++) {
1040
+ let v = Number((k * step).toPrecision(12));
1041
+ v - from > step / 3 && to - v > step / 3 && out.push(v);
1042
+ }
1043
+ return out;
1044
+ }, 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();
1045
+ return stops.flatMap((v, i) => {
1046
+ let label = keyText(v);
1047
+ return seen.has(label) ? [] : (seen.add(label), [item(String(i), label, fillPaint(v, null, !0))]);
1048
+ });
1049
+ }
1050
+ function bubbleCell(r, c, cell, rect, owner, paint, css) {
1051
+ if (cell.v === null) return;
1052
+ let radius = radiusOf(cell.size);
1053
+ if (radius === 0) {
1054
+ hasSizes && cell.size === null && missingSizes++;
1055
+ return;
1056
+ }
1057
+ let cx = round2(rect.x + rect.w / 2), cy = round2(rect.y + rect.h / 2), rr = round2(radius), low = lowBase(cell);
1058
+ 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;
1059
+ let text = textFor(cell.v, cell.pct, cell.meta, r);
1060
+ if (!text) return;
1061
+ 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;
1062
+ if (!inside && !beside) {
1063
+ omittedValues++, hiddenCells.push({ r, c, v: cell.v });
1064
+ return;
1065
+ }
1066
+ let insideFill = low ? paintColor(theme, { token: "background" }) : css;
1067
+ labelRequests.push({
1068
+ id: `point:${cellKey(r, c)}`,
1069
+ kind: "point",
1070
+ typeRole: "label",
1071
+ owner,
1072
+ text,
1073
+ lines: [text],
1074
+ font: valueLabelFont,
1075
+ 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),
1076
+ 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 }]
1077
+ });
1078
+ }
1079
+ function continuousStops() {
1080
+ let step = niceStep((vMax - vMin) / 3 || 1), stops = [vMin];
1081
+ for (let k = Math.ceil(vMin / step); k * step < vMax; k++) {
1082
+ let v = Number((k * step).toPrecision(12));
1083
+ v - vMin > step / 3 && vMax - v > step / 3 && stops.push(v);
1084
+ }
1085
+ vMax > vMin && stops.push(vMax);
1086
+ let seen = /* @__PURE__ */ new Set();
1087
+ return stops.filter((v) => !seen.has(keyText(v)) && !!seen.add(keyText(v)));
1088
+ }
1089
+ function planStyledBubbleKey() {
1090
+ 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) => {
1091
+ let [a, b] = [keyFormat(lo), keyFormat(hi)];
1092
+ return numberRange(a.endsWith("%") && b.endsWith("%") ? a.slice(0, -1) : a, b);
1093
+ }, colours = bins ? bins.slice(1).map((hi, i) => ({
1094
+ id: `scale:bin:${i}`,
1095
+ label: bins.length === 2 ? range(bins[0], hi) : i === 0 ? `<${keyFormat(hi)}` : i === bins.length - 2 ? `\u2265${keyFormat(bins[i])}` : range(bins[i], hi),
1096
+ paint: binPaint(i, !0, direction)
1097
+ })) : continuousStops().map((v, i) => ({ id: `scale:bin:${i}`, label: keyText(v), paint: fillPaint(v, null, !0, direction) }));
1098
+ anyLowBase && colours.push({ id: "scale:lowBase", label: lowBaseKey, paint: semanticPalettePaint(theme, options.palette, "neutralMark", 0.55), hatch: !0 });
1099
+ 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)) })) : (() => {
1100
+ let sizeMax2 = largest, large = niceBelow(sizeMax2)[0];
1101
+ 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)) }));
1102
+ })() : [], 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;
1103
+ return { height, draw: () => {
1104
+ 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" };
1105
+ colorLabel && out.push(text("scale:colorTitle", colorLabel, plot0.x, top + keyLineH / 2));
1106
+ let colourRowH = beside ? Math.max(colourH, sizeH) : colourH, cy = top + headH + colourRowH / 2, x = plot0.x;
1107
+ if (colours.forEach((c, i) => {
1108
+ 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;
1109
+ }), sizeEntries.length) {
1110
+ let sx = beside ? plot0.x + colourW + KEY_GROUP_GAP : plot0.x, sTop = beside ? top : top + headH + colourH + 8;
1111
+ sizeLabel && out.push(text("scale:sizeTitle", sizeLabel, sx, sTop + keyLineH / 2)), cy = sTop + headH + (beside ? colourRowH : sizeH) / 2, x = sx;
1112
+ let neutral = semanticPalettePaint(theme, options.palette, "neutralMark", 0.55);
1113
+ sizeEntries.forEach((e, i) => {
1114
+ let rr = Math.min(e.r, radiusOf(e.level));
1115
+ 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;
1116
+ });
1117
+ }
1118
+ return occupied.claim({ x: plot0.x, y: top, w: plot0.w, h: height }, "legend", {}), out;
1119
+ } };
1120
+ }
1121
+ function bubbleKeyNodes() {
1122
+ 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) })) : (() => {
1123
+ let large = niceBelow(sizeMax)[0];
1124
+ 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) }));
1125
+ })() : [], 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 });
1126
+ if (sizeEntries.length > 0) {
1127
+ sizeLabel && out.push(text("scale:sizeTitle", sizeLabel, x, top, "start", titleFont, "legendHeading"));
1128
+ let ex = x;
1129
+ sizeEntries.forEach((e, i) => {
1130
+ let cx = ex + widths[i] / 2, rr = round2(e.r);
1131
+ 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;
1132
+ }), x += sizeW + KEY_GROUP_GAP;
1133
+ }
1134
+ colorLabel && out.push(text("scale:colorTitle", colorLabel, x, top, "start", titleFont, "legendHeading"));
1135
+ let barX = x + measure(edgeText[0], keyFont).width / 2, at = (v) => barX + (v - edges[0]) / span * barW;
1136
+ edges.slice(1).forEach((hi, i) => {
1137
+ let lo = edges[i];
1138
+ out.push({
1139
+ t: "rect",
1140
+ id: `scale:bin:${i}`,
1141
+ rect: { x: round2(at(lo)), y: round2(baseline - KEY_BAR_H), w: round2(at(hi) - at(lo)), h: KEY_BAR_H },
1142
+ fill: bins ? binPaint(i, !0, rows[0]?.direction) : fillPaint((lo + hi) / 2, null, !0, rows[0]?.direction),
1143
+ owner: { seriesId: `scale:bin:${i}` },
1144
+ part: "swatch"
1145
+ });
1146
+ });
1147
+ let lastRight = -1 / 0;
1148
+ if (shown.forEach((v, i) => {
1149
+ let w = measure(edgeText[i], keyFont).width, left = at(v) - w / 2;
1150
+ 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);
1151
+ }), anyLowBase) {
1152
+ let lx = barX + barW + measure(edgeText.at(-1), keyFont).width / 2 + 16 + lowR, ly = round2(baseline - KEY_BAR_H / 2);
1153
+ 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"));
1154
+ }
1155
+ return occupied.claim({ x: Math.max(plot0.x, gridX + gridW - total), y: top, w: total, h: headTop - KEY_GAP - top }, "legend", {}), out;
1156
+ }
1157
+ function textFor(v, pct, meta, series) {
1158
+ if (meta?.label === !1) return null;
1159
+ let base = displayFor(v, pct, meta, series);
1160
+ return typeof meta?.label == "string" ? meta.label.replace(/\$\{value\}/g, base) : base;
1161
+ }
1162
+ function displayFor(v, pct, meta, series) {
1163
+ if (meta?.format) return meta[AUTOMATIC_FORMAT] ? formatNonzeroWithSpec(v, { ...exampleSpec(meta.format, options.locale?.language), automatic: !0 }) : formatterFromExample(meta.format, options.locale?.language)(v);
1164
+ let text = (series?.format || series?.unit ? formats.forSeries(series) : fmt)(v), example = series?.format ?? options.format;
1165
+ return pct && (!example || specUnitKind(parseFormatExample(example)) === "number") ? `${text}%` : text;
1166
+ }
1167
+ }
1168
+ function measureRowLabels(cells, textFor, font, measure, width, height, air = 2) {
1169
+ return cells.map((cell) => {
1170
+ let text = cell.meta?.label === !1 ? null : cell.v === null ? "\u2013" : textFor(cell.v, cell.pct, cell.meta);
1171
+ if (!text) return null;
1172
+ let size = measure(text, font);
1173
+ return { text, size, fits: size.width + air <= width && size.height + 2 <= height };
1174
+ });
1175
+ }
1176
+
1177
+ export {
1178
+ layoutHeatmap
1179
+ };