boardplot 0.0.0-stage → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (818) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE.md +180 -0
  4. package/README.md +208 -2
  5. package/THIRD_PARTY_NOTICES.md +1110 -0
  6. package/dist/DiagnosticDetails-UNYNYCAH.js +69 -0
  7. package/dist/ReaderBox-VOJSJ66R.js +137 -0
  8. package/dist/annotateEngine-DLMFJZ67.js +30 -0
  9. package/dist/build-identity.json +6 -0
  10. package/dist/chunk-24BHMKDD.js +83 -0
  11. package/dist/chunk-263SZKIL.js +8 -0
  12. package/dist/chunk-27QADBDV.js +211 -0
  13. package/dist/chunk-2CVH5E57.js +128 -0
  14. package/dist/chunk-2DOR5SS6.js +446 -0
  15. package/dist/chunk-2EQE4E3I.js +22 -0
  16. package/dist/chunk-2FNNAPCI.js +24 -0
  17. package/dist/chunk-2L2Q53EP.js +251 -0
  18. package/dist/chunk-2LMCD3ZR.js +6 -0
  19. package/dist/chunk-2ND7ZITT.js +3069 -0
  20. package/dist/chunk-2QT5ZUHO.js +2937 -0
  21. package/dist/chunk-2RSG7JYI.js +24 -0
  22. package/dist/chunk-2V6CLH33.js +1392 -0
  23. package/dist/chunk-2VWJ5BGO.js +566 -0
  24. package/dist/chunk-2WNYRWHG.js +51 -0
  25. package/dist/chunk-323YZWYJ.js +548 -0
  26. package/dist/chunk-33PB4V6K.js +382 -0
  27. package/dist/chunk-33PLBIMA.js +176 -0
  28. package/dist/chunk-3A2IEBCN.js +195 -0
  29. package/dist/chunk-3D3D3D23.js +25 -0
  30. package/dist/chunk-3EZRM4YM.js +92 -0
  31. package/dist/chunk-3H2W76TB.js +2353 -0
  32. package/dist/chunk-3JEQGGVD.js +19 -0
  33. package/dist/chunk-3QWZAEW5.js +26 -0
  34. package/dist/chunk-3SIRPKMP.js +12 -0
  35. package/dist/chunk-3SQCCESO.js +1592 -0
  36. package/dist/chunk-3XHJHQWU.js +42 -0
  37. package/dist/chunk-4G2O2ZPJ.js +83 -0
  38. package/dist/chunk-4JLBVIGW.js +24 -0
  39. package/dist/chunk-4RRNJLCM.js +746 -0
  40. package/dist/chunk-4UVW5WU6.js +76 -0
  41. package/dist/chunk-4X66BTP5.js +344 -0
  42. package/dist/chunk-53OYF4ZT.js +687 -0
  43. package/dist/chunk-57ZGVAU3.js +179 -0
  44. package/dist/chunk-5HECRVXJ.js +62 -0
  45. package/dist/chunk-5LGSRWFC.js +63 -0
  46. package/dist/chunk-5LYXD6ME.js +1112 -0
  47. package/dist/chunk-66RFKRGO.js +28 -0
  48. package/dist/chunk-6KWIQ5KF.js +18 -0
  49. package/dist/chunk-6OCR6ITN.js +72 -0
  50. package/dist/chunk-6RBTTCQD.js +802 -0
  51. package/dist/chunk-6Y7EXYLR.js +563 -0
  52. package/dist/chunk-7CTKTIPF.js +613 -0
  53. package/dist/chunk-7EVIIADO.js +185 -0
  54. package/dist/chunk-7X2ZYVAX.js +89 -0
  55. package/dist/chunk-7X65ZQN4.js +38 -0
  56. package/dist/chunk-A4QZXLXF.js +7 -0
  57. package/dist/chunk-A6CQPJWR.js +49 -0
  58. package/dist/chunk-A7IEVBYI.js +35 -0
  59. package/dist/chunk-ACXX2JNL.js +6 -0
  60. package/dist/chunk-ADKCLH3Z.js +98 -0
  61. package/dist/chunk-ADWSGPH5.js +23 -0
  62. package/dist/chunk-AG2CJ4JY.js +203 -0
  63. package/dist/chunk-AHQ4L3BE.js +30 -0
  64. package/dist/chunk-AOQ6VF5H.js +6 -0
  65. package/dist/chunk-AQROQDLR.js +3303 -0
  66. package/dist/chunk-AWTG3RFF.js +85 -0
  67. package/dist/chunk-B54RN2FD.js +692 -0
  68. package/dist/chunk-B67K6OWJ.js +48 -0
  69. package/dist/chunk-B6GFKYBZ.js +40 -0
  70. package/dist/chunk-BBL3R5YZ.js +186 -0
  71. package/dist/chunk-BBRBCMNR.js +28 -0
  72. package/dist/chunk-BIDIGDGH.js +6 -0
  73. package/dist/chunk-BLFWUMTD.js +12 -0
  74. package/dist/chunk-BM6SFFWF.js +6 -0
  75. package/dist/chunk-BMRD6MAH.js +24 -0
  76. package/dist/chunk-BPKXEMRE.js +197 -0
  77. package/dist/chunk-BUPLB3EX.js +129 -0
  78. package/dist/chunk-BW5VLBSZ.js +15 -0
  79. package/dist/chunk-BWGRWGVA.js +295 -0
  80. package/dist/chunk-BWLOXQDV.js +131 -0
  81. package/dist/chunk-BWTX7LUG.js +203 -0
  82. package/dist/chunk-C54QLNE4.js +69 -0
  83. package/dist/chunk-CAQ5P4VN.js +296 -0
  84. package/dist/chunk-CCCEBIUZ.js +296 -0
  85. package/dist/chunk-CDZHNLO6.js +42 -0
  86. package/dist/chunk-CJGSJKPO.js +25 -0
  87. package/dist/chunk-CN7JRHST.js +25 -0
  88. package/dist/chunk-CNX7EGSU.js +266 -0
  89. package/dist/chunk-COYOTQC2.js +75 -0
  90. package/dist/chunk-CRNMNZJD.js +1161 -0
  91. package/dist/chunk-CUVUDK4O.js +68 -0
  92. package/dist/chunk-CWDHCSL2.js +2919 -0
  93. package/dist/chunk-CYOJZ3GQ.js +631 -0
  94. package/dist/chunk-D4SOADBD.js +19 -0
  95. package/dist/chunk-D7SHZDA3.js +1808 -0
  96. package/dist/chunk-DAVHGK27.js +657 -0
  97. package/dist/chunk-DCCJRLAJ.js +422 -0
  98. package/dist/chunk-DCTCUZ5L.js +51 -0
  99. package/dist/chunk-DDCB7ZA5.js +2511 -0
  100. package/dist/chunk-DDI2W4TR.js +149 -0
  101. package/dist/chunk-DIHUGBZO.js +61 -0
  102. package/dist/chunk-DJHIQWSG.js +25 -0
  103. package/dist/chunk-DO5OZJAO.js +302 -0
  104. package/dist/chunk-DOFYKPTC.js +18 -0
  105. package/dist/chunk-DRTA6JG5.js +160 -0
  106. package/dist/chunk-DRW6KGBK.js +1062 -0
  107. package/dist/chunk-DU4A5AOY.js +1156 -0
  108. package/dist/chunk-DYS7EIXY.js +294 -0
  109. package/dist/chunk-E4IQ6M4S.js +24 -0
  110. package/dist/chunk-EFUWFB64.js +24 -0
  111. package/dist/chunk-EHBB2Z4D.js +290 -0
  112. package/dist/chunk-EHVESNLV.js +30 -0
  113. package/dist/chunk-EJPVVGD7.js +67 -0
  114. package/dist/chunk-EKQK5D6G.js +14 -0
  115. package/dist/chunk-EUADDXAV.js +30 -0
  116. package/dist/chunk-F6CNPC4L.js +47 -0
  117. package/dist/chunk-FBAYZSFC.js +2806 -0
  118. package/dist/chunk-FBB4BWKN.js +30 -0
  119. package/dist/chunk-FF23FYQD.js +1269 -0
  120. package/dist/chunk-FG6EDGMI.js +53 -0
  121. package/dist/chunk-FHA3KMFC.js +43 -0
  122. package/dist/chunk-FIANWJXX.js +19 -0
  123. package/dist/chunk-FIWNDOMO.js +6 -0
  124. package/dist/chunk-FV3VF36K.js +2721 -0
  125. package/dist/chunk-G5FMTRG5.js +37 -0
  126. package/dist/chunk-GCBOHVDZ.js +229 -0
  127. package/dist/chunk-GDOW2KNP.js +19 -0
  128. package/dist/chunk-GTG3IGLF.js +2674 -0
  129. package/dist/chunk-GZTNTHSW.js +21 -0
  130. package/dist/chunk-H4H4O62O.js +46 -0
  131. package/dist/chunk-H5G7T35P.js +24 -0
  132. package/dist/chunk-H63XQ3OO.js +942 -0
  133. package/dist/chunk-H67RTX46.js +43 -0
  134. package/dist/chunk-HA4IPWMM.js +841 -0
  135. package/dist/chunk-HKYTOJLV.js +33 -0
  136. package/dist/chunk-HOAH5XBR.js +542 -0
  137. package/dist/chunk-HTYFQHRC.js +24 -0
  138. package/dist/chunk-HYY5V2KL.js +19 -0
  139. package/dist/chunk-HZI56ASJ.js +79 -0
  140. package/dist/chunk-I6VAWNNU.js +24 -0
  141. package/dist/chunk-IBXXZVG7.js +80 -0
  142. package/dist/chunk-IDDA5INB.js +60 -0
  143. package/dist/chunk-IK4BHOPZ.js +33 -0
  144. package/dist/chunk-IL5T7I2A.js +27 -0
  145. package/dist/chunk-ILSXT6KT.js +24 -0
  146. package/dist/chunk-IV2UXZXX.js +16 -0
  147. package/dist/chunk-IYEFEBRN.js +41 -0
  148. package/dist/chunk-IYMI7YI4.js +829 -0
  149. package/dist/chunk-J6I2YFJH.js +58 -0
  150. package/dist/chunk-JFBEAUJ6.js +24 -0
  151. package/dist/chunk-JR7Y5ONB.js +27 -0
  152. package/dist/chunk-JSEYUJUQ.js +836 -0
  153. package/dist/chunk-JYBT2JNY.js +61 -0
  154. package/dist/chunk-K3HSQPSM.js +24 -0
  155. package/dist/chunk-KAXJFL7N.js +43 -0
  156. package/dist/chunk-KDMKHR5A.js +32 -0
  157. package/dist/chunk-KKWZWP67.js +24 -0
  158. package/dist/chunk-KOJ5QETJ.js +8 -0
  159. package/dist/chunk-KPKXJYQH.js +19 -0
  160. package/dist/chunk-KSJVENRU.js +113 -0
  161. package/dist/chunk-KZJOV4QW.js +33 -0
  162. package/dist/chunk-KZS46KDY.js +58 -0
  163. package/dist/chunk-L3JWM7FR.js +50 -0
  164. package/dist/chunk-L4S6UFTL.js +26 -0
  165. package/dist/chunk-L6DJ4ZY5.js +2008 -0
  166. package/dist/chunk-L7RHB734.js +23 -0
  167. package/dist/chunk-LCWJS34U.js +38 -0
  168. package/dist/chunk-LFTAMH7I.js +24 -0
  169. package/dist/chunk-LFX7W4B7.js +113 -0
  170. package/dist/chunk-LINZPU5D.js +8 -0
  171. package/dist/chunk-LIWLBLCT.js +83 -0
  172. package/dist/chunk-LNKY5Z2X.js +23 -0
  173. package/dist/chunk-LS7HVBI7.js +24 -0
  174. package/dist/chunk-M4EUXOLU.js +170 -0
  175. package/dist/chunk-M4SPKUZE.js +7 -0
  176. package/dist/chunk-M4YLED7M.js +17 -0
  177. package/dist/chunk-MBKZYJRC.js +1424 -0
  178. package/dist/chunk-MCYM3RNF.js +227 -0
  179. package/dist/chunk-MF6IVSBJ.js +48 -0
  180. package/dist/chunk-MIAPBQCA.js +24 -0
  181. package/dist/chunk-MJZHFH5R.js +1075 -0
  182. package/dist/chunk-MQFCG4KS.js +1467 -0
  183. package/dist/chunk-MVV6RQMG.js +128 -0
  184. package/dist/chunk-MYMT5KJL.js +1182 -0
  185. package/dist/chunk-MZL6LGKO.js +587 -0
  186. package/dist/chunk-N23YFPPI.js +47 -0
  187. package/dist/chunk-N3G2FYDL.js +300 -0
  188. package/dist/chunk-N3TPMXS3.js +161 -0
  189. package/dist/chunk-N73IBH55.js +58 -0
  190. package/dist/chunk-N7J7CZS6.js +43 -0
  191. package/dist/chunk-NCB3YLHF.js +28 -0
  192. package/dist/chunk-NHQGRKEA.js +63 -0
  193. package/dist/chunk-NKIYLFXZ.js +2774 -0
  194. package/dist/chunk-NOSDEJ3K.js +25934 -0
  195. package/dist/chunk-NQDVMUHX.js +433 -0
  196. package/dist/chunk-NSSNYY6Y.js +58 -0
  197. package/dist/chunk-NY5NUFDZ.js +117 -0
  198. package/dist/chunk-O3S2KNIW.js +25 -0
  199. package/dist/chunk-O3VN6BTL.js +24 -0
  200. package/dist/chunk-ONZLC47B.js +88 -0
  201. package/dist/chunk-OQEBOVUO.js +30 -0
  202. package/dist/chunk-OUEGGWH7.js +24 -0
  203. package/dist/chunk-OURX73UJ.js +728 -0
  204. package/dist/chunk-P25VEGGX.js +24 -0
  205. package/dist/chunk-P26Z62UV.js +24 -0
  206. package/dist/chunk-P5RNWMZC.js +2984 -0
  207. package/dist/chunk-P6KZIZDV.js +987 -0
  208. package/dist/chunk-PEUSKIFV.js +168 -0
  209. package/dist/chunk-PFVTYFSL.js +24 -0
  210. package/dist/chunk-PWROWDZS.js +137 -0
  211. package/dist/chunk-Q3CV2JJ2.js +3650 -0
  212. package/dist/chunk-QBR6IKIX.js +50 -0
  213. package/dist/chunk-QGCEHR6S.js +13 -0
  214. package/dist/chunk-QHRE2M6V.js +26 -0
  215. package/dist/chunk-QKL7IY42.js +38 -0
  216. package/dist/chunk-QO6HEXIZ.js +272 -0
  217. package/dist/chunk-QOIVXZUF.js +24 -0
  218. package/dist/chunk-QPWRHDLZ.js +17 -0
  219. package/dist/chunk-QSXK6PJL.js +19 -0
  220. package/dist/chunk-QTZVVZ2A.js +54 -0
  221. package/dist/chunk-QWXWVPNE.js +18 -0
  222. package/dist/chunk-QY5ZKUWY.js +383 -0
  223. package/dist/chunk-QZAT46PP.js +95 -0
  224. package/dist/chunk-RA66JA3D.js +24 -0
  225. package/dist/chunk-REOPXBUR.js +600 -0
  226. package/dist/chunk-RGZGLKFB.js +648 -0
  227. package/dist/chunk-RL3NUWMY.js +3378 -0
  228. package/dist/chunk-RNOJSEES.js +16 -0
  229. package/dist/chunk-ROXO4R3J.js +16 -0
  230. package/dist/chunk-RPIW5T55.js +40 -0
  231. package/dist/chunk-RQ5DNYLG.js +10 -0
  232. package/dist/chunk-RZNYW7UP.js +133 -0
  233. package/dist/chunk-S32YYDIB.js +420 -0
  234. package/dist/chunk-S4QSJAGY.js +44 -0
  235. package/dist/chunk-S6UX7KB6.js +335 -0
  236. package/dist/chunk-SDSONLMZ.js +2546 -0
  237. package/dist/chunk-SGD3ZHID.js +250 -0
  238. package/dist/chunk-SKRSCTT5.js +28 -0
  239. package/dist/chunk-SMCDXUIO.js +24 -0
  240. package/dist/chunk-SPTPFY4S.js +528 -0
  241. package/dist/chunk-SREWFAAJ.js +90 -0
  242. package/dist/chunk-SS42FJVN.js +3875 -0
  243. package/dist/chunk-SVZDXFPX.js +891 -0
  244. package/dist/chunk-SZPTTNW7.js +16 -0
  245. package/dist/chunk-T3IGJARD.js +22 -0
  246. package/dist/chunk-TA3TFKYZ.js +86 -0
  247. package/dist/chunk-TBGUEF3M.js +939 -0
  248. package/dist/chunk-TGK6KUGN.js +331 -0
  249. package/dist/chunk-TJSND556.js +1783 -0
  250. package/dist/chunk-TKOJZQAJ.js +24 -0
  251. package/dist/chunk-TM4OC53S.js +97 -0
  252. package/dist/chunk-TNEHPP3H.js +18 -0
  253. package/dist/chunk-TWOREVKJ.js +1760 -0
  254. package/dist/chunk-TXS3U77A.js +60 -0
  255. package/dist/chunk-UB6ODJHO.js +134 -0
  256. package/dist/chunk-UBZXQIDR.js +24 -0
  257. package/dist/chunk-ULTSSIOU.js +38 -0
  258. package/dist/chunk-UMDEWWXT.js +33 -0
  259. package/dist/chunk-V6O6KVOA.js +347 -0
  260. package/dist/chunk-VABRPZVC.js +43 -0
  261. package/dist/chunk-VDAKTZQP.js +18 -0
  262. package/dist/chunk-VDAZPGR2.js +79 -0
  263. package/dist/chunk-VERLFNWR.js +25 -0
  264. package/dist/chunk-VH2UUU7K.js +24 -0
  265. package/dist/chunk-VJ3FCGQF.js +12 -0
  266. package/dist/chunk-VK5ZDV67.js +47 -0
  267. package/dist/chunk-VKQNDOAI.js +40 -0
  268. package/dist/chunk-VTEV3WVF.js +690 -0
  269. package/dist/chunk-VXZFQKBJ.js +21 -0
  270. package/dist/chunk-WI5ITCOH.js +22 -0
  271. package/dist/chunk-WLZ54FWG.js +120 -0
  272. package/dist/chunk-WYJEOMNY.js +31 -0
  273. package/dist/chunk-WZGJSQKN.js +29 -0
  274. package/dist/chunk-WZL4EEBS.js +11 -0
  275. package/dist/chunk-X4YNDLVA.js +54 -0
  276. package/dist/chunk-X6SUFTD7.js +17 -0
  277. package/dist/chunk-XB4KZ6WO.js +81 -0
  278. package/dist/chunk-XJI6SWFS.js +569 -0
  279. package/dist/chunk-XJP5DKIL.js +29 -0
  280. package/dist/chunk-XN4ARQ2W.js +47 -0
  281. package/dist/chunk-XN7MQO45.js +359 -0
  282. package/dist/chunk-XQCQZBGX.js +100 -0
  283. package/dist/chunk-XXOHXA3A.js +69 -0
  284. package/dist/chunk-XZOHR765.js +127 -0
  285. package/dist/chunk-YCNLQYTC.js +133 -0
  286. package/dist/chunk-YCRGWQBS.js +526 -0
  287. package/dist/chunk-YF2PYLC4.js +210 -0
  288. package/dist/chunk-YG5GUELW.js +935 -0
  289. package/dist/chunk-YS6KMYM4.js +91 -0
  290. package/dist/chunk-YWP7XFKD.js +12 -0
  291. package/dist/chunk-Z2MGTKDR.js +20 -0
  292. package/dist/chunk-Z6CL7AR6.js +24 -0
  293. package/dist/chunk-Z7X3RGGA.js +22 -0
  294. package/dist/chunk-ZF43WRG3.js +29 -0
  295. package/dist/chunk-ZMF7WEGG.js +60 -0
  296. package/dist/chunk-ZNHFLJSY.js +375 -0
  297. package/dist/chunk-ZQ4VFQID.js +76 -0
  298. package/dist/chunk-ZQF34VPS.js +72 -0
  299. package/dist/chunk-ZU425HNM.js +24 -0
  300. package/dist/chunk-ZZU5R5UU.js +24 -0
  301. package/dist/cli/index.js +9 -0
  302. package/dist/core-3VCCUFVX.js +32 -0
  303. package/dist/core-4BZQQSHS.js +33 -0
  304. package/dist/core-4VT4MHNB.js +38 -0
  305. package/dist/core-5535KXRD.js +40 -0
  306. package/dist/core-5HQBPCHL.js +35 -0
  307. package/dist/core-6RYHWUJO.js +35 -0
  308. package/dist/core-7BZJCIXN.js +35 -0
  309. package/dist/core-AJTVU6X7.js +37 -0
  310. package/dist/core-C6YUSTZI.js +57 -0
  311. package/dist/core-EEB7HTCL.js +33 -0
  312. package/dist/core-EFMVDWNH.js +38 -0
  313. package/dist/core-ETAGQBZO.js +34 -0
  314. package/dist/core-FVR3WZEC.js +36 -0
  315. package/dist/core-GCTFVYMH.js +29 -0
  316. package/dist/core-GES44OTS.js +33 -0
  317. package/dist/core-GGQREDSI.js +47 -0
  318. package/dist/core-HRYOV6QD.js +38 -0
  319. package/dist/core-IKD3EE3S.js +38 -0
  320. package/dist/core-JM4R426L.js +32 -0
  321. package/dist/core-KKQS3WI2.js +40 -0
  322. package/dist/core-LA6XDYG7.js +40 -0
  323. package/dist/core-MJ7JWQT5.js +37 -0
  324. package/dist/core-MLROKJ2M.js +53 -0
  325. package/dist/core-MR52YBRX.js +31 -0
  326. package/dist/core-NP4VHWXL.js +29 -0
  327. package/dist/core-NQLNZDX5.js +41 -0
  328. package/dist/core-NSIJEKLI.js +44 -0
  329. package/dist/core-OJUQLIQ5.js +35 -0
  330. package/dist/core-PB3VUQSS.js +32 -0
  331. package/dist/core-Q6VLFFYC.js +56 -0
  332. package/dist/core-QY7AVIKZ.js +51 -0
  333. package/dist/core-SBQMHWTA.js +52 -0
  334. package/dist/core-UHECQHJ2.js +38 -0
  335. package/dist/core-V5FV4NWL.js +56 -0
  336. package/dist/core-WGM4XUN3.js +58 -0
  337. package/dist/core-WUQVFARS.js +34 -0
  338. package/dist/core-Z2F3IGSR.js +42 -0
  339. package/dist/dataTable-3CPPIHB3.js +58 -0
  340. package/dist/engine-FXFBCWHB.js +961 -0
  341. package/dist/fixtures.d.ts +1 -0
  342. package/dist/fixtures.js +41 -0
  343. package/dist/fontTables-WYCZNRE7.js +18 -0
  344. package/dist/fonts.d.ts +1 -0
  345. package/dist/fonts.js +19 -0
  346. package/dist/geo/dach.d.ts +1 -0
  347. package/dist/geo/dach.js +14 -0
  348. package/dist/geo/de-states.d.ts +1 -0
  349. package/dist/geo/de-states.js +14 -0
  350. package/dist/geo/eu27.d.ts +1 -0
  351. package/dist/geo/eu27.js +14 -0
  352. package/dist/geo/europe.d.ts +1 -0
  353. package/dist/geo/europe.js +14 -0
  354. package/dist/geo/index.d.ts +1 -0
  355. package/dist/geo/index.js +41 -0
  356. package/dist/geo/us-states.d.ts +1 -0
  357. package/dist/geo/us-states.js +14 -0
  358. package/dist/geo/world.d.ts +1 -0
  359. package/dist/geo/world.js +14 -0
  360. package/dist/index.d.ts +1 -0
  361. package/dist/index.js +364 -0
  362. package/dist/main-YLKBTHJP.js +569 -0
  363. package/dist/mcp/server.js +1025 -0
  364. package/dist/module-SVEW5ZUE.js +137233 -0
  365. package/dist/react/bar.d.ts +1 -0
  366. package/dist/react/bar.js +81 -0
  367. package/dist/react/bartable.d.ts +1 -0
  368. package/dist/react/bartable.js +70 -0
  369. package/dist/react/box.d.ts +1 -0
  370. package/dist/react/box.js +65 -0
  371. package/dist/react/bullet.d.ts +1 -0
  372. package/dist/react/bullet.js +72 -0
  373. package/dist/react/butterfly.d.ts +1 -0
  374. package/dist/react/butterfly.js +66 -0
  375. package/dist/react/choropleth.d.ts +1 -0
  376. package/dist/react/choropleth.js +67 -0
  377. package/dist/react/cohort.d.ts +1 -0
  378. package/dist/react/cohort.js +70 -0
  379. package/dist/react/column.d.ts +1 -0
  380. package/dist/react/column.js +86 -0
  381. package/dist/react/combo.d.ts +1 -0
  382. package/dist/react/combo.js +86 -0
  383. package/dist/react/creative.d.ts +1 -0
  384. package/dist/react/creative.js +61 -0
  385. package/dist/react/diagram.d.ts +1 -0
  386. package/dist/react/diagram.js +60 -0
  387. package/dist/react/dimswitch.d.ts +1 -0
  388. package/dist/react/dimswitch.js +72 -0
  389. package/dist/react/dot.d.ts +1 -0
  390. package/dist/react/dot.js +70 -0
  391. package/dist/react/export.d.ts +1 -0
  392. package/dist/react/export.js +658 -0
  393. package/dist/react/funnel.d.ts +1 -0
  394. package/dist/react/funnel.js +63 -0
  395. package/dist/react/gantt.d.ts +1 -0
  396. package/dist/react/gantt.js +62 -0
  397. package/dist/react/grid.d.ts +1 -0
  398. package/dist/react/grid.js +67 -0
  399. package/dist/react/heatmap.d.ts +1 -0
  400. package/dist/react/heatmap.js +68 -0
  401. package/dist/react/histogram.d.ts +1 -0
  402. package/dist/react/histogram.js +86 -0
  403. package/dist/react/index.d.ts +1 -0
  404. package/dist/react/index.js +504 -0
  405. package/dist/react/kpi.d.ts +1 -0
  406. package/dist/react/kpi.js +67 -0
  407. package/dist/react/likert.d.ts +1 -0
  408. package/dist/react/likert.js +83 -0
  409. package/dist/react/line.d.ts +1 -0
  410. package/dist/react/line.js +81 -0
  411. package/dist/react/mekko.d.ts +1 -0
  412. package/dist/react/mekko.js +71 -0
  413. package/dist/react/pareto.d.ts +1 -0
  414. package/dist/react/pareto.js +90 -0
  415. package/dist/react/pie.d.ts +1 -0
  416. package/dist/react/pie.js +64 -0
  417. package/dist/react/prepare.d.ts +1 -0
  418. package/dist/react/prepare.js +278 -0
  419. package/dist/react/pvm.d.ts +1 -0
  420. package/dist/react/pvm.js +68 -0
  421. package/dist/react/pyramid.d.ts +1 -0
  422. package/dist/react/pyramid.js +67 -0
  423. package/dist/react/sankey.d.ts +1 -0
  424. package/dist/react/sankey.js +59 -0
  425. package/dist/react/scatter.d.ts +1 -0
  426. package/dist/react/scatter.js +63 -0
  427. package/dist/react/slope.d.ts +1 -0
  428. package/dist/react/slope.js +64 -0
  429. package/dist/react/sparkline.d.ts +1 -0
  430. package/dist/react/sparkline.js +59 -0
  431. package/dist/react/spec.d.ts +1 -0
  432. package/dist/react/spec.js +379 -0
  433. package/dist/react/status.d.ts +1 -0
  434. package/dist/react/status.js +64 -0
  435. package/dist/react/story.d.ts +1 -0
  436. package/dist/react/story.js +140 -0
  437. package/dist/react/table.d.ts +1 -0
  438. package/dist/react/table.js +69 -0
  439. package/dist/react/theme.d.ts +1 -0
  440. package/dist/react/theme.js +53 -0
  441. package/dist/react/tilemap.d.ts +1 -0
  442. package/dist/react/tilemap.js +66 -0
  443. package/dist/react/treemap.d.ts +1 -0
  444. package/dist/react/treemap.js +61 -0
  445. package/dist/react/variance.d.ts +1 -0
  446. package/dist/react/variance.js +65 -0
  447. package/dist/react/waffle.d.ts +1 -0
  448. package/dist/react/waffle.js +62 -0
  449. package/dist/react/waterfall.d.ts +1 -0
  450. package/dist/react/waterfall.js +68 -0
  451. package/dist/resvg-ZOVDIZTV.js +23 -0
  452. package/dist/rows.d.ts +1 -0
  453. package/dist/rows.js +23 -0
  454. package/dist/rowsModule-YVLAROIP.js +27 -0
  455. package/dist/schema-2K6C3U24.js +23 -0
  456. package/dist/schema-2KIHLTYI.js +23 -0
  457. package/dist/schema-4HY2MWZC.js +30 -0
  458. package/dist/schema-4S5CXHAO.js +24 -0
  459. package/dist/schema-5BKQV56C.js +27 -0
  460. package/dist/schema-5HA5DSYN.js +24 -0
  461. package/dist/schema-5NKJPSBD.js +23 -0
  462. package/dist/schema-65FOKNHK.js +43 -0
  463. package/dist/schema-6OHZWHUI.js +23 -0
  464. package/dist/schema-6RYJS2GM.js +24 -0
  465. package/dist/schema-6W4M3WJ4.js +23 -0
  466. package/dist/schema-7TLSFG6M.js +24 -0
  467. package/dist/schema-AMFRKUFS.js +27 -0
  468. package/dist/schema-B7CZPPB4.js +28 -0
  469. package/dist/schema-BNRNHGHQ.js +26 -0
  470. package/dist/schema-E4MRCGPZ.js +24 -0
  471. package/dist/schema-F3WYTR65.js +26 -0
  472. package/dist/schema-FA6XIHTW.js +23 -0
  473. package/dist/schema-GZNOW4LX.js +23 -0
  474. package/dist/schema-HEIDGCSL.js +23 -0
  475. package/dist/schema-JB2H6KPA.js +23 -0
  476. package/dist/schema-MPXZNWV3.js +23 -0
  477. package/dist/schema-NHNQK6XO.js +23 -0
  478. package/dist/schema-NN6UPDPW.js +23 -0
  479. package/dist/schema-O4YNAGIY.js +23 -0
  480. package/dist/schema-O7AKK232.js +29 -0
  481. package/dist/schema-OJCML6LV.js +24 -0
  482. package/dist/schema-ORTRMYI6.js +24 -0
  483. package/dist/schema-PJ6P52BC.js +23 -0
  484. package/dist/schema-RTWES6NR.js +24 -0
  485. package/dist/schema-S36SRYGO.js +24 -0
  486. package/dist/schema-S3TCLTYD.js +23 -0
  487. package/dist/schema-SWWMOLOR.js +54 -0
  488. package/dist/schema-WOSEZNKG.js +26 -0
  489. package/dist/schema-Y6KBWUUR.js +23 -0
  490. package/dist/schema-YQYTLKSW.js +23 -0
  491. package/dist/schema-ZUUUY3QS.js +33 -0
  492. package/dist/specValidation-VNWIKLHH.js +49 -0
  493. package/dist/theme.d.ts +1 -0
  494. package/dist/theme.js +24 -0
  495. package/dist/themeShapeRules-2D3KWSPQ.js +11 -0
  496. package/dist/types/core/a11y/accessibility.d.ts +43 -0
  497. package/dist/types/core/a11y/recordsShared.d.ts +44 -0
  498. package/dist/types/core/a11y/structuralRecords.d.ts +6 -0
  499. package/dist/types/core/a11y/types.d.ts +116 -0
  500. package/dist/types/core/annotate.d.ts +300 -0
  501. package/dist/types/core/annotateArms.d.ts +37 -0
  502. package/dist/types/core/annotateFields.d.ts +30 -0
  503. package/dist/types/core/annotateGapBracket.d.ts +66 -0
  504. package/dist/types/core/annotateLinks.d.ts +47 -0
  505. package/dist/types/core/annotateTargets.d.ts +90 -0
  506. package/dist/types/core/axis.d.ts +179 -0
  507. package/dist/types/core/bandSelect.d.ts +10 -0
  508. package/dist/types/core/bands.d.ts +14 -0
  509. package/dist/types/core/calendarLabels.d.ts +101 -0
  510. package/dist/types/core/charts/band/stacks.d.ts +155 -0
  511. package/dist/types/core/charts/bar/fixtures.d.ts +9 -0
  512. package/dist/types/core/charts/bar/layout.d.ts +95 -0
  513. package/dist/types/core/charts/bartable/fixtures.d.ts +4 -0
  514. package/dist/types/core/charts/bartable/types.d.ts +192 -0
  515. package/dist/types/core/charts/box/fixtures.d.ts +12 -0
  516. package/dist/types/core/charts/box/types.d.ts +110 -0
  517. package/dist/types/core/charts/bullet/fixtures.d.ts +11 -0
  518. package/dist/types/core/charts/butterfly/fixtures.d.ts +9 -0
  519. package/dist/types/core/charts/choropleth/fixtures.d.ts +3 -0
  520. package/dist/types/core/charts/choropleth/overlayTypes.d.ts +68 -0
  521. package/dist/types/core/charts/choropleth/types.d.ts +117 -0
  522. package/dist/types/core/charts/cohort/fixtures.d.ts +12 -0
  523. package/dist/types/core/charts/cohort/types.d.ts +165 -0
  524. package/dist/types/core/charts/column/anomaly.d.ts +204 -0
  525. package/dist/types/core/charts/column/fixtures.d.ts +12 -0
  526. package/dist/types/core/charts/column/layout.d.ts +116 -0
  527. package/dist/types/core/charts/column/model.d.ts +295 -0
  528. package/dist/types/core/charts/column/types.d.ts +56 -0
  529. package/dist/types/core/charts/combo/endpoints.d.ts +165 -0
  530. package/dist/types/core/charts/combo/fixtures.d.ts +12 -0
  531. package/dist/types/core/charts/combo/layout.d.ts +48 -0
  532. package/dist/types/core/charts/creative/fixtures.d.ts +4 -0
  533. package/dist/types/core/charts/creative/types.d.ts +73 -0
  534. package/dist/types/core/charts/diagram/fixtures.d.ts +3 -0
  535. package/dist/types/core/charts/dimswitch/compile.d.ts +20 -0
  536. package/dist/types/core/charts/dimswitch/fixtures.d.ts +3 -0
  537. package/dist/types/core/charts/dimswitch/types.d.ts +152 -0
  538. package/dist/types/core/charts/dot/fixtures.d.ts +11 -0
  539. package/dist/types/core/charts/funnel/fixtures.d.ts +11 -0
  540. package/dist/types/core/charts/gantt/fixtures.d.ts +9 -0
  541. package/dist/types/core/charts/gantt/layout.d.ts +63 -0
  542. package/dist/types/core/charts/grid/fixtures.d.ts +3 -0
  543. package/dist/types/core/charts/grid/metricStack.d.ts +108 -0
  544. package/dist/types/core/charts/grid/metricStackSchema.d.ts +74 -0
  545. package/dist/types/core/charts/grid/normalize.d.ts +99 -0
  546. package/dist/types/core/charts/grid/schema.d.ts +168 -0
  547. package/dist/types/core/charts/heatmap/fixtures.d.ts +11 -0
  548. package/dist/types/core/charts/histogram/fixtures.d.ts +15 -0
  549. package/dist/types/core/charts/histogram/types.d.ts +98 -0
  550. package/dist/types/core/charts/kpi/fixtures.d.ts +9 -0
  551. package/dist/types/core/charts/likert/fixtures.d.ts +11 -0
  552. package/dist/types/core/charts/likert/layout.d.ts +111 -0
  553. package/dist/types/core/charts/line/fixtures.d.ts +16 -0
  554. package/dist/types/core/charts/line/types.d.ts +6 -0
  555. package/dist/types/core/charts/mekko/fixtures.d.ts +13 -0
  556. package/dist/types/core/charts/pareto/fixtures.d.ts +5 -0
  557. package/dist/types/core/charts/pareto/layout.d.ts +68 -0
  558. package/dist/types/core/charts/pie/fixtures.d.ts +14 -0
  559. package/dist/types/core/charts/pvm/fixtures.d.ts +13 -0
  560. package/dist/types/core/charts/pvm/types.d.ts +118 -0
  561. package/dist/types/core/charts/pyramid/fixtures.d.ts +4 -0
  562. package/dist/types/core/charts/pyramid/types.d.ts +92 -0
  563. package/dist/types/core/charts/sankey/fixtures.d.ts +4 -0
  564. package/dist/types/core/charts/sankey/types.d.ts +116 -0
  565. package/dist/types/core/charts/scatter/fixtures.d.ts +12 -0
  566. package/dist/types/core/charts/scatter/types.d.ts +58 -0
  567. package/dist/types/core/charts/slope/fixtures.d.ts +13 -0
  568. package/dist/types/core/charts/sparkline/fixtures.d.ts +9 -0
  569. package/dist/types/core/charts/status/fixtures.d.ts +8 -0
  570. package/dist/types/core/charts/status/layout.d.ts +71 -0
  571. package/dist/types/core/charts/table/fitFormats.d.ts +67 -0
  572. package/dist/types/core/charts/table/fixtures.d.ts +7 -0
  573. package/dist/types/core/charts/table/resolve.d.ts +72 -0
  574. package/dist/types/core/charts/table/view.d.ts +156 -0
  575. package/dist/types/core/charts/tilemap/fixtures.d.ts +3 -0
  576. package/dist/types/core/charts/tilemap/types.d.ts +94 -0
  577. package/dist/types/core/charts/treemap/fixtures.d.ts +4 -0
  578. package/dist/types/core/charts/treemap/types.d.ts +78 -0
  579. package/dist/types/core/charts/variance/fixtures.d.ts +12 -0
  580. package/dist/types/core/charts/waffle/fixtures.d.ts +5 -0
  581. package/dist/types/core/charts/waffle/types.d.ts +117 -0
  582. package/dist/types/core/charts/waterfall/fixtures.d.ts +9 -0
  583. package/dist/types/core/claims/browser.d.ts +49 -0
  584. package/dist/types/core/claims/manifest.d.ts +22 -0
  585. package/dist/types/core/dateFormat.d.ts +39 -0
  586. package/dist/types/core/deferred.d.ts +121 -0
  587. package/dist/types/core/diagnostics/describe.d.ts +149 -0
  588. package/dist/types/core/diagnostics/jsonPatch.d.ts +36 -0
  589. package/dist/types/core/doc/bareChart.d.ts +2 -0
  590. package/dist/types/core/doc/diagnostics.d.ts +124 -0
  591. package/dist/types/core/doc/docExpand.d.ts +39 -0
  592. package/dist/types/core/doc/document.d.ts +43 -0
  593. package/dist/types/core/doc/ownedDocumentCopy.d.ts +5 -0
  594. package/dist/types/core/doc/specError.d.ts +6 -0
  595. package/dist/types/core/emptyData.d.ts +27 -0
  596. package/dist/types/core/eventLane.d.ts +208 -0
  597. package/dist/types/core/fontMetrics/index.d.ts +47 -0
  598. package/dist/types/core/fontMetrics/injected.d.ts +40 -0
  599. package/dist/types/core/fontMetrics/tableDocument.d.ts +73 -0
  600. package/dist/types/core/fontMetrics/tables.generated.d.ts +17 -0
  601. package/dist/types/core/footer.d.ts +59 -0
  602. package/dist/types/core/format.d.ts +149 -0
  603. package/dist/types/core/formatPrecision.d.ts +136 -0
  604. package/dist/types/core/formatSpec.d.ts +304 -0
  605. package/dist/types/core/frame.d.ts +583 -0
  606. package/dist/types/core/geo/packs/all.d.ts +7 -0
  607. package/dist/types/core/geo/packs/dach.d.ts +16 -0
  608. package/dist/types/core/geo/packs/de-states.d.ts +16 -0
  609. package/dist/types/core/geo/packs/eu27.d.ts +16 -0
  610. package/dist/types/core/geo/packs/europe.d.ts +16 -0
  611. package/dist/types/core/geo/packs/index.d.ts +22 -0
  612. package/dist/types/core/geo/packs/registry.d.ts +37 -0
  613. package/dist/types/core/geo/packs/us-states.d.ts +16 -0
  614. package/dist/types/core/geo/packs/world.d.ts +16 -0
  615. package/dist/types/core/geo/tiles/eu27.generated.d.ts +412 -0
  616. package/dist/types/core/geo/tiles/europe.generated.d.ts +842 -0
  617. package/dist/types/core/geo/tiles/index.d.ts +8 -0
  618. package/dist/types/core/geo/tiles/types.d.ts +36 -0
  619. package/dist/types/core/geo/tiles/us-states.generated.d.ts +952 -0
  620. package/dist/types/core/geo/tiles/world.generated.d.ts +968 -0
  621. package/dist/types/core/geo/types.d.ts +146 -0
  622. package/dist/types/core/geometry.d.ts +102 -0
  623. package/dist/types/core/grid/sharedScale.d.ts +82 -0
  624. package/dist/types/core/icons.d.ts +227 -0
  625. package/dist/types/core/inputError.d.ts +14 -0
  626. package/dist/types/core/isoDate.d.ts +2 -0
  627. package/dist/types/core/isoTime.d.ts +7 -0
  628. package/dist/types/core/label/categoryRow.d.ts +332 -0
  629. package/dist/types/core/label/occupied.d.ts +41 -0
  630. package/dist/types/core/label/ownership.d.ts +83 -0
  631. package/dist/types/core/label/solver.d.ts +384 -0
  632. package/dist/types/core/label/tickRow.d.ts +78 -0
  633. package/dist/types/core/live/types.d.ts +50 -0
  634. package/dist/types/core/normalize/shared.d.ts +56 -0
  635. package/dist/types/core/notes.d.ts +174 -0
  636. package/dist/types/core/othersShade.d.ts +9 -0
  637. package/dist/types/core/periodYears.d.ts +9 -0
  638. package/dist/types/core/polyline.d.ts +11 -0
  639. package/dist/types/core/rangeRules.d.ts +19 -0
  640. package/dist/types/core/ratioTier.d.ts +120 -0
  641. package/dist/types/core/readerStrings.d.ts +13 -0
  642. package/dist/types/core/reading.d.ts +120 -0
  643. package/dist/types/core/registry.d.ts +178 -0
  644. package/dist/types/core/repaintGeometry.d.ts +19 -0
  645. package/dist/types/core/request.d.ts +124 -0
  646. package/dist/types/core/rows.d.ts +47 -0
  647. package/dist/types/core/scale.d.ts +106 -0
  648. package/dist/types/core/schema/capability.d.ts +229 -0
  649. package/dist/types/core/schema/namedColumns.d.ts +45 -0
  650. package/dist/types/core/schema/reference.d.ts +31 -0
  651. package/dist/types/core/schema/refusals.d.ts +45 -0
  652. package/dist/types/core/schema/unknownKeys.d.ts +45 -0
  653. package/dist/types/core/seriesIdentity.d.ts +120 -0
  654. package/dist/types/core/shareRounding.d.ts +49 -0
  655. package/dist/types/core/sizing.d.ts +330 -0
  656. package/dist/types/core/staticFooter.d.ts +6 -0
  657. package/dist/types/core/story.d.ts +41 -0
  658. package/dist/types/core/structureCounts.d.ts +10 -0
  659. package/dist/types/core/svg/renderSvg.d.ts +51 -0
  660. package/dist/types/core/target.d.ts +89 -0
  661. package/dist/types/core/text.d.ts +113 -0
  662. package/dist/types/core/theme.d.ts +478 -0
  663. package/dist/types/core/themeFields.d.ts +11 -0
  664. package/dist/types/core/themeRules.d.ts +111 -0
  665. package/dist/types/core/themeShape.d.ts +87 -0
  666. package/dist/types/core/themeValidate.d.ts +15 -0
  667. package/dist/types/core/timeAxis.d.ts +106 -0
  668. package/dist/types/core/types/annotations.d.ts +227 -0
  669. package/dist/types/core/types/cell.d.ts +82 -0
  670. package/dist/types/core/types/data.d.ts +314 -0
  671. package/dist/types/core/types/diagram.d.ts +234 -0
  672. package/dist/types/core/types/index.d.ts +8 -0
  673. package/dist/types/core/types/options.d.ts +1583 -0
  674. package/dist/types/core/types/scene.d.ts +990 -0
  675. package/dist/types/core/types/sizing.d.ts +51 -0
  676. package/dist/types/core/types/table.d.ts +873 -0
  677. package/dist/types/core/types/theme.d.ts +806 -0
  678. package/dist/types/core/zoom.d.ts +106 -0
  679. package/dist/types/fixtures/index.d.ts +40 -0
  680. package/dist/types/fixtures/registry.d.ts +15 -0
  681. package/dist/types/fonts.d.ts +10 -0
  682. package/dist/types/index.d.ts +70 -0
  683. package/dist/types/react/BoardplotTheme.d.ts +9 -0
  684. package/dist/types/react/DimSwitchChart.d.ts +36 -0
  685. package/dist/types/react/ScaleGroup.d.ts +31 -0
  686. package/dist/types/react/SceneRenderer.d.ts +23 -0
  687. package/dist/types/react/SizePlaceholder.d.ts +51 -0
  688. package/dist/types/react/StoryFrame.d.ts +42 -0
  689. package/dist/types/react/TableChart.d.ts +220 -0
  690. package/dist/types/react/a11ySurface.d.ts +20 -0
  691. package/dist/types/react/barrelCharts.d.ts +1023 -0
  692. package/dist/types/react/charts/bar.d.ts +28 -0
  693. package/dist/types/react/charts/bartable.d.ts +27 -0
  694. package/dist/types/react/charts/box.d.ts +27 -0
  695. package/dist/types/react/charts/bullet.d.ts +28 -0
  696. package/dist/types/react/charts/butterfly.d.ts +28 -0
  697. package/dist/types/react/charts/choropleth.d.ts +27 -0
  698. package/dist/types/react/charts/cohort.d.ts +52 -0
  699. package/dist/types/react/charts/column.d.ts +27 -0
  700. package/dist/types/react/charts/combo.d.ts +7 -0
  701. package/dist/types/react/charts/creative.d.ts +27 -0
  702. package/dist/types/react/charts/diagram.d.ts +162 -0
  703. package/dist/types/react/charts/dimswitch.d.ts +6 -0
  704. package/dist/types/react/charts/dot.d.ts +28 -0
  705. package/dist/types/react/charts/funnel.d.ts +28 -0
  706. package/dist/types/react/charts/gantt.d.ts +28 -0
  707. package/dist/types/react/charts/grid.d.ts +29 -0
  708. package/dist/types/react/charts/heatmap.d.ts +28 -0
  709. package/dist/types/react/charts/histogram.d.ts +27 -0
  710. package/dist/types/react/charts/kpi.d.ts +28 -0
  711. package/dist/types/react/charts/likert.d.ts +27 -0
  712. package/dist/types/react/charts/line.d.ts +28 -0
  713. package/dist/types/react/charts/mekko.d.ts +28 -0
  714. package/dist/types/react/charts/pareto.d.ts +28 -0
  715. package/dist/types/react/charts/pie.d.ts +28 -0
  716. package/dist/types/react/charts/pvm.d.ts +27 -0
  717. package/dist/types/react/charts/pyramid.d.ts +27 -0
  718. package/dist/types/react/charts/sankey.d.ts +27 -0
  719. package/dist/types/react/charts/scatter.d.ts +28 -0
  720. package/dist/types/react/charts/slope.d.ts +28 -0
  721. package/dist/types/react/charts/sparkline.d.ts +28 -0
  722. package/dist/types/react/charts/status.d.ts +27 -0
  723. package/dist/types/react/charts/table.d.ts +6 -0
  724. package/dist/types/react/charts/tilemap.d.ts +27 -0
  725. package/dist/types/react/charts/treemap.d.ts +27 -0
  726. package/dist/types/react/charts/variance.d.ts +28 -0
  727. package/dist/types/react/charts/waffle.d.ts +28 -0
  728. package/dist/types/react/charts/waterfall.d.ts +28 -0
  729. package/dist/types/react/createChartComponent.d.ts +135 -0
  730. package/dist/types/react/export/clipboard.d.ts +8 -0
  731. package/dist/types/react/export/csv.d.ts +2 -0
  732. package/dist/types/react/export/frame.d.ts +35 -0
  733. package/dist/types/react/export/index.d.ts +7 -0
  734. package/dist/types/react/export/png.d.ts +14 -0
  735. package/dist/types/react/export/svg.d.ts +5 -0
  736. package/dist/types/react/export/types.d.ts +69 -0
  737. package/dist/types/react/export/useExport.d.ts +17 -0
  738. package/dist/types/react/exportLink.d.ts +49 -0
  739. package/dist/types/react/footerFrame.d.ts +25 -0
  740. package/dist/types/react/hover/dataTable.d.ts +13 -0
  741. package/dist/types/react/hover/engine.d.ts +210 -0
  742. package/dist/types/react/hover/keyboard.d.ts +44 -0
  743. package/dist/types/react/hover/labelCard.d.ts +170 -0
  744. package/dist/types/react/hover/placement.d.ts +49 -0
  745. package/dist/types/react/index.d.ts +16 -0
  746. package/dist/types/react/parseChartSpec.d.ts +16 -0
  747. package/dist/types/react/prepare.d.ts +32 -0
  748. package/dist/types/react/prepared.d.ts +53 -0
  749. package/dist/types/react/preparedTable.d.ts +15 -0
  750. package/dist/types/react/rowsInput.d.ts +55 -0
  751. package/dist/types/react/rowsModule.d.ts +18 -0
  752. package/dist/types/react/rowsStore.d.ts +50 -0
  753. package/dist/types/react/scale-group.d.ts +2 -0
  754. package/dist/types/react/scaleGroupContext.d.ts +22 -0
  755. package/dist/types/react/scenePaint.d.ts +10 -0
  756. package/dist/types/react/scrollState.d.ts +26 -0
  757. package/dist/types/react/spec.d.ts +82 -0
  758. package/dist/types/react/specValidation.d.ts +45 -0
  759. package/dist/types/react/story.d.ts +15 -0
  760. package/dist/types/react/theme.d.ts +9 -0
  761. package/dist/types/react/themeContext.d.ts +44 -0
  762. package/dist/types/react/useChartLayout.d.ts +22 -0
  763. package/dist/types/react/useContainerSize.d.ts +57 -0
  764. package/dist/types/react/useHover.d.ts +100 -0
  765. package/dist/types/react/useZoom.d.ts +50 -0
  766. package/dist/types/rows.d.ts +63 -0
  767. package/dist/types/tableLooks.d.ts +6 -0
  768. package/dist/types/theme.d.ts +3 -0
  769. package/dist/types/validate.d.ts +3 -0
  770. package/dist/validate.d.ts +1 -0
  771. package/dist/validate.js +223 -0
  772. package/docs/FONTS.md +68 -0
  773. package/docs/TELEMETRY.md +94 -0
  774. package/docs/manual.md +850 -0
  775. package/docs/reference/bar.md +222 -0
  776. package/docs/reference/bartable.md +143 -0
  777. package/docs/reference/box.md +93 -0
  778. package/docs/reference/bullet.md +118 -0
  779. package/docs/reference/butterfly.md +117 -0
  780. package/docs/reference/choropleth.md +148 -0
  781. package/docs/reference/cohort.md +149 -0
  782. package/docs/reference/column.md +275 -0
  783. package/docs/reference/combo.md +219 -0
  784. package/docs/reference/creative.md +147 -0
  785. package/docs/reference/diagram.md +191 -0
  786. package/docs/reference/dimswitch.md +1395 -0
  787. package/docs/reference/dot.md +117 -0
  788. package/docs/reference/fixtures.md +1089 -0
  789. package/docs/reference/funnel.md +121 -0
  790. package/docs/reference/gantt.md +138 -0
  791. package/docs/reference/grid.md +302 -0
  792. package/docs/reference/heatmap.md +127 -0
  793. package/docs/reference/histogram.md +77 -0
  794. package/docs/reference/kpi.md +115 -0
  795. package/docs/reference/likert.md +113 -0
  796. package/docs/reference/line.md +436 -0
  797. package/docs/reference/mekko.md +114 -0
  798. package/docs/reference/options.md +313 -0
  799. package/docs/reference/pareto.md +102 -0
  800. package/docs/reference/pie.md +114 -0
  801. package/docs/reference/pvm.md +114 -0
  802. package/docs/reference/pyramid.md +99 -0
  803. package/docs/reference/react.md +706 -0
  804. package/docs/reference/reading.md +28 -0
  805. package/docs/reference/sankey.md +110 -0
  806. package/docs/reference/scatter.md +211 -0
  807. package/docs/reference/slope.md +126 -0
  808. package/docs/reference/sparkline.md +74 -0
  809. package/docs/reference/status.md +107 -0
  810. package/docs/reference/table.md +673 -0
  811. package/docs/reference/theme.md +361 -0
  812. package/docs/reference/tilemap.md +121 -0
  813. package/docs/reference/treemap.md +86 -0
  814. package/docs/reference/variance.md +126 -0
  815. package/docs/reference/waffle.md +106 -0
  816. package/docs/reference/waterfall.md +164 -0
  817. package/llms.txt +57 -0
  818. package/package.json +437 -4
@@ -0,0 +1,1112 @@
1
+ import {
2
+ valueLineExtent
3
+ } from "./chunk-QPWRHDLZ.js";
4
+ import {
5
+ percentLevels,
6
+ runAnnotatePass
7
+ } from "./chunk-KZS46KDY.js";
8
+ import {
9
+ stepDownFont
10
+ } from "./chunk-ZQF34VPS.js";
11
+ import {
12
+ breakUnsupported,
13
+ chartTheme
14
+ } from "./chunk-3QWZAEW5.js";
15
+ import {
16
+ structureCount
17
+ } from "./chunk-LFX7W4B7.js";
18
+ import {
19
+ receivedDescription
20
+ } from "./chunk-RZNYW7UP.js";
21
+ import {
22
+ emptyIdRecord
23
+ } from "./chunk-LINZPU5D.js";
24
+ import {
25
+ applyAxisBounds,
26
+ calendarCategories,
27
+ chartSizing,
28
+ linearScale,
29
+ niceDomain,
30
+ resolveSizing,
31
+ spread1DResult,
32
+ sweepHide,
33
+ warnSpreadOverflow
34
+ } from "./chunk-RL3NUWMY.js";
35
+ import {
36
+ prepareFractionData
37
+ } from "./chunk-3EZRM4YM.js";
38
+ import {
39
+ PRIORITY,
40
+ authoredFootnoteCount,
41
+ authoredNotes,
42
+ clamp,
43
+ createOccupiedIndex,
44
+ cutWithTitle,
45
+ distinguishSeries,
46
+ fitText,
47
+ frameTextOptions,
48
+ labelCtx,
49
+ labelsToNodes,
50
+ lineBox,
51
+ markedLabel,
52
+ normalizeLegendOption,
53
+ plotHeightAfter,
54
+ round2,
55
+ solveFrame,
56
+ solveLabels
57
+ } from "./chunk-SS42FJVN.js";
58
+ import {
59
+ disclosureNote
60
+ } from "./chunk-BPKXEMRE.js";
61
+ import {
62
+ formatterFromExample,
63
+ seriesRasterFormatter
64
+ } from "./chunk-RGZGLKFB.js";
65
+ import {
66
+ autoDecimals,
67
+ chartStrings,
68
+ chartWording,
69
+ formatAuthoredPercent,
70
+ formatAutomaticNumber,
71
+ formatAutomaticPercent,
72
+ numberRange,
73
+ seriesValueFormatter
74
+ } from "./chunk-53OYF4ZT.js";
75
+ import {
76
+ cellMeta,
77
+ cellValue,
78
+ isPctCell
79
+ } from "./chunk-O3VN6BTL.js";
80
+ import {
81
+ canvasMargin,
82
+ colorblindPaint,
83
+ dashToken,
84
+ emphasisWeight,
85
+ labelsOffKeepsNames,
86
+ markRolePaint,
87
+ mutedMarkPaint,
88
+ panelTypeClass,
89
+ resolveSemanticPaletteTheme,
90
+ semanticPalettePaint,
91
+ seriesPaint,
92
+ strokeToken,
93
+ textScaleOf
94
+ } from "./chunk-CWDHCSL2.js";
95
+ import {
96
+ MARK_CONTRAST_FLOOR
97
+ } from "./chunk-HA4IPWMM.js";
98
+ import {
99
+ NormalizeError,
100
+ TARGET_SIZE,
101
+ accessibleTitle,
102
+ normalizeCategory,
103
+ normalizeScenario,
104
+ normalizeSeriesValues,
105
+ resolveHighlight,
106
+ resolveSize
107
+ } from "./chunk-SGD3ZHID.js";
108
+ import {
109
+ maxOf,
110
+ minOf,
111
+ pushAll
112
+ } from "./chunk-WYJEOMNY.js";
113
+ import {
114
+ defaultMeasurer
115
+ } from "./chunk-AG2CJ4JY.js";
116
+
117
+ // src/core/charts/slope/slopeSizing.ts
118
+ var SLOPE_SIZING = { ...chartSizing("slope"), minWidth: 320 };
119
+
120
+ // src/core/strings/slope.ts
121
+ var EN = {
122
+ // reader-facing wording linked only by its consumers.
123
+ slopeDesc: "Slope chart, {v1} series from {v2} to {v3}. ",
124
+ seriesUnchanged: "All series unchanged.",
125
+ slopeTitle: "Slope chart: {v1} series, {v2} to {v3}",
126
+ slopeResponseRest: "{v1} and {v2} do not add to 100: the rest ({v3} per group and period) chose neither answer.",
127
+ slopeNetNote: "Net = {v1} \u2212 {v2} in {v3}; change vs {v4} in brackets.",
128
+ slopeBaseNote: "Hatched: base below {v1} respondents ({v2}); read with care.",
129
+ divergingSlopeDesc: "Diverging slope chart, {v1} series, one panel per group, {v2} above and {v3} below zero, from {v4} to {v5}. ",
130
+ slopeNetRiseDesc: "Net score rose in {v1} of them; highest in {v2}: {v3} {v4}.",
131
+ slopeLowBaseDesc: " Low base: {v1}.",
132
+ divergingSlopeTitle: "Diverging slope chart: {v1} groups, {v2} to {v3}",
133
+ steepestRiser: "Steepest riser: {v1}",
134
+ steepestFaller: "steepest faller: {v1}",
135
+ slopeFoldHead: "{v1}: the {v2} series below {v3} of the endpoint total at both ends ",
136
+ slopeFoldSum: "summed to {v1} at {v2} and ",
137
+ slopeFoldEnd: "{v1} at {v2}.",
138
+ slopeNetLabel: "Net {v1} ({v2})",
139
+ positiveName: "Positive",
140
+ negativeName: "Negative"
141
+ }, DE = {
142
+ // reader-facing wording linked only by its consumers.
143
+ slopeDesc: "Steigungsdiagramm, {v1} {v1|Reihe|Reihen} von {v2} bis {v3}. ",
144
+ seriesUnchanged: "Alle Reihen unver\xE4ndert.",
145
+ slopeTitle: "Steigungsdiagramm: {v1} {v1|Reihe|Reihen}, {v2} bis {v3}",
146
+ slopeResponseRest: "{v1} und {v2} ergeben nicht 100. Der Rest ({v3} je Gruppe und Periode) w\xE4hlte keine dieser Antworten.",
147
+ slopeNetNote: "Netto = {v1} \u2212 {v2} in {v3}; \xC4nderung vs {v4} in Klammern.",
148
+ slopeBaseNote: "Schraffiert: Basis unter {v1} {v1|Antwort|Antworten} ({v2}); vorsichtig lesen.",
149
+ divergingSlopeDesc: "Divergierendes Steigungsdiagramm, {v1} {v1|Reihe|Reihen}, ein Feld je Gruppe, {v2} \xFCber und {v3} unter null, von {v4} bis {v5}. ",
150
+ slopeNetRiseDesc: "Nettowert stieg in {v1} davon; h\xF6chster in {v2}: {v3} {v4}.",
151
+ slopeLowBaseDesc: " Niedrige Basis: {v1}.",
152
+ divergingSlopeTitle: "Divergierendes Steigungsdiagramm: {v1} {v1|Gruppe|Gruppen}, {v2} bis {v3}",
153
+ steepestRiser: "St\xE4rkster Anstieg: {v1}",
154
+ steepestFaller: "st\xE4rkster Abfall: {v1}",
155
+ slopeFoldHead: "{v1}: die {v2} {v2|Reihe|Reihen} unter {v3} der Endpunktsumme an beiden Enden ",
156
+ slopeFoldSum: "zusammen {v1} bei {v2} und ",
157
+ slopeFoldEnd: "{v1} bei {v2}.",
158
+ slopeNetLabel: "Netto {v1} ({v2})",
159
+ positiveName: "Positiv",
160
+ negativeName: "Negativ"
161
+ }, { chartString } = chartStrings(EN, DE);
162
+
163
+ // src/core/charts/slope/fold.ts
164
+ var FOLD_FIELD = ["options", "foldBelowShare"], FOLD_POINTER = "/options/foldBelowShare";
165
+ function round4(value) {
166
+ return Math.round(value * 1e4) / 1e4;
167
+ }
168
+ function sharePercentText(share, language) {
169
+ let percent = share * 100, close = (value) => Math.abs(value - percent) <= Math.abs(percent) * 1e-9, decimals = 0;
170
+ for (; decimals < 12 && !close(Number(percent.toFixed(decimals))); ) decimals++;
171
+ return formatAutomaticPercent(Number(percent.toFixed(decimals)), decimals, !1, language);
172
+ }
173
+ var RAISE_OR_SEPARATE = "Raise foldBelowShare so they stay apart, or give the folded series the same kind.", SMALLEST_STATED_PERCENT = 1e-12;
174
+ function foldShareRefusal(share) {
175
+ if (share === void 0) return null;
176
+ if (Number.isFinite(share) && share > 0 && share * 100 < SMALLEST_STATED_PERCENT)
177
+ return {
178
+ code: "fold-share-out-of-range",
179
+ severity: "error",
180
+ message: `foldBelowShare ${share} is too small to state as a percentage, so no footnote could name the cutoff`,
181
+ suggest: "Write a larger share, such as 0.05 for 5 percent.",
182
+ field: FOLD_FIELD,
183
+ expected: { types: ["number"], minimum: SMALLEST_STATED_PERCENT / 100, maximum: 1, inclusive: !1 },
184
+ received: { type: "number", value: share }
185
+ };
186
+ if (Number.isFinite(share) && share > 0 && share < 1) return null;
187
+ let divided = Number.isFinite(share) && share >= 1 && share < 100 ? Number((share / 100).toPrecision(12)) : null, asShare = divided !== null && divided > 0 && divided < 1 ? divided : null;
188
+ return {
189
+ code: "fold-share-out-of-range",
190
+ severity: "error",
191
+ // One reading, not two. Saying that 5 "reads as 500 percent" and then
192
+ // proposing 0.05 "for 5 percent" puts two numbers in front of the caller
193
+ // and leaves it to guess which one the engine means.
194
+ message: `foldBelowShare is a share of the endpoint total between 0 and 1, and ${share} is not one` + (asShare !== null ? `. Written as a percentage, ${share} percent is ${asShare}` : ""),
195
+ suggest: asShare !== null ? `Write ${asShare} for ${share} percent.` : "Write a number above 0 and below 1, such as 0.05 for 5 percent.",
196
+ field: FOLD_FIELD,
197
+ expected: {
198
+ types: ["number"],
199
+ minimum: 0,
200
+ maximum: 1,
201
+ inclusive: !1,
202
+ condition: "a share of the endpoint total, such as 0.05 for 5 percent"
203
+ },
204
+ received: receivedDescription(share),
205
+ ...asShare !== null ? { fix: [{ op: "replace", path: FOLD_POINTER, value: asShare }] } : {}
206
+ };
207
+ }
208
+ function endpointTotal(series, end) {
209
+ return series.reduce((sum, s) => sum + (s[end].v ?? 0), 0);
210
+ }
211
+ function negativeMember(series) {
212
+ return series.find((s) => (s.a.v ?? 0) < 0 || (s.b.v ?? 0) < 0);
213
+ }
214
+ function otherLineId(taken) {
215
+ let id = "other";
216
+ for (; taken.some((s) => s.id === id); ) id = `_${id}`;
217
+ return id;
218
+ }
219
+ function foldNote(members, values, pct, ctx, share) {
220
+ let percent = sharePercentText(share, ctx.language);
221
+ return disclosureNote(
222
+ chartString({ locale: { language: ctx.language } }, "slopeFoldHead", { v1: ctx.othersLabel, v2: members.length, v3: percent }) + // The note names what it folded, not only how many.
223
+ `(${members.map((member) => member.label).join(", ")}), ` + chartString({ locale: { language: ctx.language } }, "slopeFoldSum", { v1: ctx.format(values.from, pct.from), v2: ctx.categories.from }) + chartString({ locale: { language: ctx.language } }, "slopeFoldEnd", { v1: ctx.format(values.to, pct.to), v2: ctx.categories.to })
224
+ );
225
+ }
226
+ function planSlopeFold(plotted, listed, share, ctx) {
227
+ let negative = negativeMember(plotted), totals = { from: endpointTotal(plotted, "a"), to: endpointTotal(plotted, "b") };
228
+ if (negative || totals.from <= 0 || totals.to <= 0)
229
+ return ctx.warnings.push({
230
+ code: "fold-share-undefined",
231
+ severity: "warn",
232
+ message: negative ? `foldBelowShare needs values at or above zero at both ends, and series '${negative.id}' is negative \u2014 nothing folded` : `foldBelowShare needs a positive total at both ends, and the endpoints sum to ${round2(totals.from)} and ${round2(totals.to)} \u2014 nothing folded`,
233
+ suggest: "Drop foldBelowShare on data that crosses zero, or plot the levels the shares are taken of.",
234
+ field: FOLD_FIELD
235
+ }), null;
236
+ let candidates = plotted.filter(
237
+ (s) => (s.a.v ?? 0) / totals.from < share && (s.b.v ?? 0) / totals.to < share
238
+ ), members = candidates.filter((s) => !ctx.highlights.has(s.id)), kept = candidates.length - members.length;
239
+ return kept > 0 && ctx.warnings.push({
240
+ code: "fold-keeps-highlight",
241
+ severity: "info",
242
+ message: `${kept} highlighted or annotated ${kept === 1 ? "series stays" : "series stay"} under their own name although they are below ${sharePercentText(share, ctx.language)} of the endpoint total`,
243
+ field: FOLD_FIELD
244
+ }), members.length < 2 ? (ctx.warnings.push({
245
+ code: "fold-below-two",
246
+ severity: "info",
247
+ message: members.length === 1 ? `one series is below ${sharePercentText(share, ctx.language)} of the endpoint total at both ends \u2014 nothing folded, because one line named '${ctx.othersLabel}' says less than the line it replaces` : `no series is below ${sharePercentText(share, ctx.language)} of the endpoint total at both ends \u2014 nothing folded`,
248
+ suggest: "Raise foldBelowShare, or leave it out and let every series keep its name.",
249
+ field: FOLD_FIELD
250
+ }), null) : buildFold(members, plotted, listed, totals, share, ctx);
251
+ }
252
+ function buildFold(members, plotted, listed, totals, share, ctx) {
253
+ let memberIds = new Set(members.map((s) => s.id)), values = {
254
+ from: members.reduce((sum, s) => sum + s.a.v, 0),
255
+ to: members.reduce((sum, s) => sum + s.b.v, 0)
256
+ }, scenario = members.every((s) => s.scenario === members[0].scenario) ? members[0].scenario : void 0;
257
+ scenario === void 0 && members.some((s) => s.scenario !== void 0) && ctx.warnings.push({
258
+ code: "fold-mixed-scenarios",
259
+ severity: "warn",
260
+ message: `${ctx.othersLabel} mixes scenarios (${[...new Set(members.map((s) => s.scenario ?? "none"))].sort().join(", ")}) and carries none.`,
261
+ suggest: RAISE_OR_SEPARATE
262
+ });
263
+ let units = [...new Set(members.map((s) => s.unit ?? ctx.chartUnit ?? ""))];
264
+ units.length > 1 && ctx.warnings.push({
265
+ code: "fold-mixed-units",
266
+ severity: "warn",
267
+ message: `${ctx.othersLabel} adds different units (${units.map((unit) => unit || "none").join(", ")}); the sum is in none.`,
268
+ suggest: RAISE_OR_SEPARATE
269
+ });
270
+ for (let end of ["a", "b"]) {
271
+ let pct = members.filter((s) => s[end].isPct).length;
272
+ pct > 0 && pct < members.length && ctx.warnings.push({
273
+ code: "fold-mixed-units",
274
+ severity: "warn",
275
+ message: `${ctx.othersLabel} sums ${pct} percentage and ${members.length - pct} plain endpoints at ${end === "a" ? ctx.categories.from : ctx.categories.to}; shown as a plain number.`,
276
+ suggest: RAISE_OR_SEPARATE
277
+ });
278
+ }
279
+ let other = {
280
+ id: otherLineId(listed),
281
+ label: ctx.othersLabel,
282
+ ...scenario !== void 0 ? { scenario } : {},
283
+ a: { v: values.from, isPct: members.every((s) => s.a.isPct) },
284
+ b: { v: values.to, isPct: members.every((s) => s.b.isPct) }
285
+ }, note = foldNote(members, values, { from: other.a.isPct, to: other.b.isPct }, ctx, share);
286
+ return {
287
+ plotted: [...plotted.filter((s) => !memberIds.has(s.id)), other],
288
+ listed: [...listed.filter((s) => !memberIds.has(s.id)), other],
289
+ legendLabel: `${ctx.othersLabel} (${members.length} series below ${sharePercentText(share, ctx.language)})`,
290
+ record: {
291
+ share,
292
+ otherId: other.id,
293
+ memberIds: members.map((s) => s.id),
294
+ values: { from: round2(values.from), to: round2(values.to) },
295
+ shares: { from: round4(values.from / totals.from), to: round4(values.to / totals.to) },
296
+ totals: { from: round2(totals.from), to: round2(totals.to) },
297
+ note
298
+ }
299
+ };
300
+ }
301
+
302
+ // src/core/charts/slope/diverging.ts
303
+ var MAX_GROUPS = 12, MAX_PER_ROW = 8, MIN_PANEL_W = 88, PANEL_GAP = 16, ROW_GAP = 14, MIN_BAND = 60, NATURAL_SCALE_WIDTH = 640, NATURAL_SCALE_MIN = 1.15, NATURAL_SCALE_MAX = 1.5, DOT_R = 3.5, KEY_GAP = 22, KEY_GAP_MIN = 12, KEY_RUN = 24, KEY_RUN_MIN = 14, HEAD_CLEAR = 6, DEFAULT_MIN_BASE = 30;
304
+ function layoutDivergingSlope(data, options = {}) {
305
+ let warnings = [], theme = resolveSemanticPaletteTheme(
306
+ chartTheme(options),
307
+ options.palette,
308
+ warnings
309
+ ), size = resolveSize(options.size), measure = options.measure ?? defaultMeasurer, opt = options.diverging ?? {}, language = options.locale?.language, fmtVal = (v, isPct, example = options.format) => example ? formatterFromExample(example, options.locale?.language)(v) : isPct ? formatAuthoredPercent(v, language) : formatAutomaticNumber(v, { locale: language, decimals: autoDecimals(v) }), signed = (v) => formatAutomaticNumber(v, { locale: language, signed: !0, decimals: autoDecimals(v) });
310
+ if (!data || !Array.isArray(data.categories) || data.categories.length < 2)
311
+ throw new NormalizeError("empty-data", "categories", "slope variant 'diverging' requires two categories (periods)");
312
+ if (data.categories.length > 2)
313
+ throw new NormalizeError(
314
+ "slope-diverging-too-many-periods",
315
+ "categories",
316
+ `slope variant 'diverging' compares exactly two periods, got ${data.categories.length}: an area between three or more survey waves suggests a path between them`,
317
+ "keep the first and last period here; draw a trend over more waves with type 'line', or one wave's full answer scale with type 'likert'"
318
+ );
319
+ let cats = data.categories.map((c, i) => normalizeCategory(c, i)), [c0, c1] = [cats[0], cats[1]], p1 = c0.label ?? c0.id, p2 = c1.label ?? c1.id, minBase = opt.minBase ?? DEFAULT_MIN_BASE, groups = [];
320
+ if (data.series.forEach((s, si) => {
321
+ if (!s?.id) throw new NormalizeError("missing-id", `series[${si}]`, "series requires an id");
322
+ if (s.role === "reference") return;
323
+ if (!Array.isArray(s.negative))
324
+ throw new NormalizeError(
325
+ "slope-diverging-missing-negative",
326
+ `series[${s.id}].negative`,
327
+ `series '${s.id}' has no negative share: variant 'diverging' draws values as the positive share and negative as the negative share`,
328
+ `add "negative": [<period 1>, <period 2>] to series '${s.id}', as positive numbers`
329
+ );
330
+ let pos = normalizeSeriesValues(s, cats, si), neg = normalizeSeriesValues({ ...s, values: s.negative }, cats, si), pv = pos.map(cellValue), nv = neg.map(cellValue);
331
+ if ([...pv, ...nv].some((v) => v === null)) {
332
+ warnings.push({
333
+ code: "slope-missing-endpoint",
334
+ severity: "warn",
335
+ message: `series '${s.id}': a share is missing in one period \u2014 the group is not drawn`,
336
+ owner: { seriesId: s.id }
337
+ });
338
+ return;
339
+ }
340
+ if ([...pv, ...nv].some((v) => v < 0))
341
+ throw new NormalizeError(
342
+ "slope-diverging-negative-value",
343
+ `series[${s.id}]`,
344
+ `series '${s.id}' has a share below zero: both shares are counts of respondents, so the negative share is drawn downward but given as a positive number`,
345
+ "give every share as a positive number, for example 12 rather than -12"
346
+ );
347
+ let positive = [pv[0], pv[1]], negative = [nv[0], nv[1]], net = [round2(positive[0] - negative[0]), round2(positive[1] - negative[1])], n = s.n === void 0 ? void 0 : typeof s.n == "number" ? [s.n, s.n] : [s.n[0], s.n[s.n.length - 1]];
348
+ groups.push({
349
+ s,
350
+ label: s.label ?? s.id,
351
+ isPct: isPctCell(pos[1]),
352
+ formats: { positive: pos.map((c) => cellMeta(c)?.format), negative: neg.map((c) => cellMeta(c)?.format) },
353
+ g: {
354
+ positive,
355
+ negative,
356
+ net,
357
+ netChange: round2(net[1] - net[0]),
358
+ neither: [round2(100 - positive[0] - negative[0]), round2(100 - positive[1] - negative[1])],
359
+ ...n ? { n } : {},
360
+ lowBase: n !== void 0 && Math.min(...n) < minBase
361
+ }
362
+ });
363
+ }), groups.length === 0) throw new NormalizeError("empty-data", "series", "slope variant 'diverging' requires at least one group with both shares in both periods");
364
+ if (groups.length > MAX_GROUPS)
365
+ throw new NormalizeError(
366
+ "slope-diverging-too-many-groups",
367
+ "series",
368
+ `slope variant 'diverging' draws one panel per group and reads up to ${MAX_GROUPS} groups, got ${groups.length}`,
369
+ "group the series further, or draw the net score per group with type 'likert' (sortBy 'net')"
370
+ );
371
+ for (let { s, g } of groups)
372
+ g.neither.some((v) => v < -0.5) && warnings.push({
373
+ code: "slope-diverging-over-100",
374
+ severity: "warn",
375
+ message: `series '${s.id}': the positive and negative shares add to more than 100 in one period`,
376
+ suggest: "give both shares in percent of the same respondents",
377
+ owner: { seriesId: s.id }
378
+ });
379
+ let sort = opt.sort ?? "positive", order = groups.map((x, i) => ({ x, i }));
380
+ if (sort !== "data") {
381
+ let key = (x) => sort === "net" ? x.g.net[1] : x.g.positive[1];
382
+ order.sort((a, b) => key(b.x) - key(a.x) || a.i - b.i);
383
+ }
384
+ let panels = order.map((o) => o.x), posName = opt.labels?.positive ?? chartString(options, "positiveName"), negName = opt.labels?.negative ?? chartString(options, "negativeName"), showNet = opt.net ?? !0, notes = [...authoredNotes(options)];
385
+ showNet && notes.push(disclosureNote(chartString(options, "slopeNetNote", { v1: posName, v2: negName, v3: p2, v4: p1 })));
386
+ let neitherAll = panels.flatMap((p) => p.g.neither).map((v) => Math.max(0, v));
387
+ if ((opt.neutralNote ?? !0) && neitherAll.some((v) => v > 0.5)) {
388
+ let lo = minOf(neitherAll), hi = maxOf(neitherAll), restFmt = options.format ? (v) => fmtVal(v, !1) : seriesValueFormatter([lo, hi], language), span = lo === hi ? restFmt(lo) : numberRange(restFmt(lo), restFmt(hi));
389
+ notes.push(disclosureNote(chartString(options, "slopeResponseRest", { v1: posName, v2: negName, v3: span })));
390
+ }
391
+ let low = panels.filter((p) => p.g.lowBase);
392
+ low.length > 0 && notes.push(disclosureNote(chartString(options, "slopeBaseNote", { v1: minBase, v2: low.map((p) => `${p.label}: n = ${p.g.n[0]} / ${p.g.n[1]}`).join("; ") })));
393
+ let occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { ...canvasMargin(theme, size.width), ...options.margin };
394
+ options.legend !== void 0 && warnings.push({ code: "slope-diverging-legend-ignored", severity: "info", message: "variant 'diverging' keys its areas and periods in its own key row; legend is ignored", suggest: "remove legend" }), (options.annotations ?? []).length > 0 && warnings.push({ code: "slope-diverging-annotations-ignored", severity: "warn", message: "variant 'diverging' draws no annotations; they are ignored", suggest: "remove annotations, or state the point in the title" });
395
+ let frameResult = solveFrame({ size, margin, ...frameTextOptions(options), footnotes: notes, theme, measure }, occupied), nodes = [...frameResult.nodes], labelFont = { family: theme.type.family, ...theme.type.label }, headFont = { ...labelFont, weight: emphasisWeight(theme) }, netFont = headFont, lineH = labelFont.size * (labelFont.lineHeight ?? 1.2), textH = measure("0", labelFont).height, posSolid = colorblindPaint("good", !0), posFill = { ...posSolid, tint: 0.62 }, negFill = { token: "badFill", tint: 0.62 }, posEdge = colorblindPaint("good"), negEdge = { token: "bad" }, keyInk = { token: "markInk" }, labelRequests = [], fontById = /* @__PURE__ */ new Map(), fixed = (id, kind, owner, lines, font, rects, priority, middle = !0, role) => {
396
+ fontById.set(id, font), labelRequests.push({
397
+ id,
398
+ kind,
399
+ owner,
400
+ text: lines.join(" "),
401
+ lines,
402
+ font,
403
+ priority,
404
+ ...role ? { role } : {},
405
+ ...middle ? { align: "middle" } : {},
406
+ candidates: rects.map((rect, k2) => ({ slot: `seat${k2}`, rect, penalty: k2 }))
407
+ });
408
+ }, plot0 = frameResult.plot, keyRowH = textH + 10, w1 = measure(p1, labelFont).width, w2 = measure(p2, labelFont).width, sw = 10, posW = measure(posName, labelFont).width, negW = measure(negName, labelFont).width, swatchesW = sw + 4 + posW + 12 + sw + 4 + negW, periodW = (run) => w1 + 6 + DOT_R * 2 + run + DOT_R * 2 + 6 + w2, tightRun = Math.min(KEY_RUN, plot0.w - swatchesW - KEY_GAP_MIN - periodW(0)), tight = swatchesW + KEY_GAP + periodW(KEY_RUN) > plot0.w && tightRun >= KEY_RUN_MIN, keyRun = tight ? tightRun : KEY_RUN, areasW = swatchesW + (tight ? KEY_GAP_MIN : KEY_GAP), keyW = periodW(keyRun), keyWraps = areasW + keyW > plot0.w + 1e-6, keyH = keyRowH * (keyWraps ? 2 : 1), keyCy = plot0.y + textH / 2;
409
+ {
410
+ let x = plot0.x;
411
+ for (let [name, fill, w] of [[posName, posFill, posW], [negName, negFill, negW]])
412
+ nodes.push({ t: "rect", id: `legend:area:${name}`, rect: { x, y: keyCy - sw / 2, w: sw, h: sw }, fill, owner: {}, part: "legendKey" }), fixed(`series:${name}`, "series", {}, [name], labelFont, [{ x: x + sw + 4, y: keyCy - textH / 2, w, h: textH }], PRIORITY.reference, !1), x += sw + 4 + w + 12;
413
+ }
414
+ let keyX = keyWraps ? plot0.x : plot0.x + areasW, periodCy = keyWraps ? keyCy + keyRowH : keyCy, k0 = keyX + w1 + 6 + DOT_R, k1 = k0 + DOT_R + keyRun + DOT_R;
415
+ fixed("legend:period:0", "category", { categoryId: c0.id }, [p1], labelFont, [{ x: keyX, y: periodCy - textH / 2, w: w1, h: textH }], PRIORITY.reference, !1), fixed("legend:period:1", "category", { categoryId: c1.id }, [p2], labelFont, [{ x: k1 + DOT_R + 6, y: periodCy - textH / 2, w: w2, h: textH }], PRIORITY.reference, !1), nodes.push(
416
+ { t: "line", id: "legend:period:run", x1: k0, y1: periodCy, x2: k1, y2: periodCy, stroke: keyInk, width: strokeToken(theme, "data"), owner: {}, part: "legendKey" },
417
+ { t: "circle", id: "legend:period:open", cx: k0, cy: periodCy, r: DOT_R, fill: { token: "background" }, stroke: keyInk, strokeWidth: strokeToken(theme, "mark"), owner: { categoryId: c0.id }, part: "legendKey" },
418
+ { t: "circle", id: "legend:period:filled", cx: k1, cy: periodCy, r: DOT_R, fill: keyInk, owner: { categoryId: c1.id }, part: "legendKey" }
419
+ ), occupied.claim({ x: k0 - DOT_R, y: periodCy - DOT_R, w: k1 - k0 + 2 * DOT_R, h: 2 * DOT_R }, "mark", {});
420
+ let gridY = plot0.y + keyH, gridH = plotHeightAfter(frameResult, size.height, plot0.h - keyH), count = panels.length, cols = Math.max(1, Math.min(count, MAX_PER_ROW, Math.floor((plot0.w + PANEL_GAP) / (MIN_PANEL_W + PANEL_GAP)))), rows = Math.ceil(count / cols);
421
+ cols = Math.ceil(count / rows);
422
+ let pw = (plot0.w - (cols - 1) * PANEL_GAP) / cols, groupFmts = /* @__PURE__ */ new Map(), valueText = (v, p, side, e) => {
423
+ let example = p.formats[side][e] ?? p.s.format ?? options.format;
424
+ if (example || p.isPct) return fmtVal(v, p.isPct, example);
425
+ let fmt = groupFmts.get(p);
426
+ return fmt || groupFmts.set(p, fmt = seriesValueFormatter([...p.g.positive, ...p.g.negative], language)), fmt(v);
427
+ }, valueW = maxOf(panels.flatMap((p) => ["positive", "negative"].flatMap((side) => p.g[side].map((v, e) => measure(valueText(v, p, side, e), labelFont).width)))), inset = Math.min(pw / 4, Math.max(6, valueW / 2 + 2)), heads = panels.map((p) => {
428
+ let suffix = markedLabel("", p.s.footnote, p.s.id, { count: authoredFootnoteCount(options), warnings }), fit = fitText(p.label, headFont, pw + PANEL_GAP - HEAD_CLEAR - measure(suffix, headFont).width, 3, measure);
429
+ if (!suffix) return fit;
430
+ let lines = [...fit.lines.slice(0, -1), `${fit.lines[fit.lines.length - 1]}${suffix}`];
431
+ return { ...fit, lines, w: Math.max(...lines.map((l) => measure(l, fit.font).width)) };
432
+ }), headH = maxOf(heads.map((h) => h.lines.length)) * headFont.size * (headFont.lineHeight ?? 1.2), hasN = panels.some((p) => p.g.n !== void 0), footerLines = (showNet ? 1 : 0) + (hasN ? 1 : 0), footerPitch = lineH + 2, footerH = footerLines * footerPitch + (footerLines > 0 ? 4 : 0), rowExt = Array.from({ length: rows }, (_, r) => {
433
+ let members = panels.slice(r * cols, (r + 1) * cols);
434
+ return { pos: maxOf(members.map((p) => Math.max(...p.g.positive))), neg: maxOf(members.map((p) => Math.max(...p.g.negative))) };
435
+ }), sumExt = Math.max(rowExt.reduce((a, e) => a + e.pos + e.neg, 0), 1e-9), bandOffset = headH + 4 + textH + 6, rowFixed = bandOffset + textH + 6 + footerH, k = Math.max((gridH - (rows - 1) * ROW_GAP - rows * rowFixed) / sumExt, 1e-9), maxPos = maxOf(panels.map((p) => Math.max(...p.g.positive))), maxNeg = maxOf(panels.map((p) => Math.max(...p.g.negative))), kMin = MIN_BAND / Math.max(maxPos + maxNeg, 1e-9), kNatural = Math.min(NATURAL_SCALE_MAX, Math.max(NATURAL_SCALE_MIN, size.width / NATURAL_SCALE_WIDTH)), minHeight = Math.ceil(size.height + (frameResult.deficit ?? 0) + (kMin - k) * sumExt - 1e-6), naturalHeight = Math.ceil(size.height + (frameResult.deficit ?? 0) + (kNatural - k) * sumExt - 1e-6);
436
+ k < kMin && (frameResult.frame.plotMinHeight = Math.max(frameResult.frame.plotMinHeight ?? 0, minHeight));
437
+ let rowTop = [], rowHs = [];
438
+ rowExt.reduce((y, e) => {
439
+ let h = rowFixed + k * (e.pos + e.neg);
440
+ return rowTop.push(y), rowHs.push(h), y + h + ROW_GAP;
441
+ }, gridY);
442
+ let marks = { series: [], panels: [] }, fmtN = (v) => Math.round(v * 100) / 100, poly = (pts) => pts.map(([x, y], i) => `${i === 0 ? "M" : "L"}${fmtN(x)} ${fmtN(y)}`).join("") + "Z", line = (pts) => pts.map(([x, y], i) => `${i === 0 ? "M" : "L"}${fmtN(x)} ${fmtN(y)}`).join("");
443
+ panels.forEach((p, i) => {
444
+ let row = Math.floor(i / cols), col = i % cols, px = plot0.x + col * (pw + PANEL_GAP), rowY = rowTop[row], rowH = rowHs[row], zeroY = rowY + bandOffset + rowExt[row].pos * k, x0 = px + inset, x1 = px + pw - inset, id = p.s.id, nid = `${id}:negative`, yP = [zeroY - p.g.positive[0] * k, zeroY - p.g.positive[1] * k], yN = [zeroY + p.g.negative[0] * k, zeroY + p.g.negative[1] * k], hatch = p.g.lowBase ? { pattern: "hatch45" } : {};
445
+ nodes.push(
446
+ { t: "path", id: `area:${id}:positive`, d: poly([[x0, zeroY], [x0, yP[0]], [x1, yP[1]], [x1, zeroY]]), fill: p.g.lowBase ? posSolid : posFill, ...hatch, owner: { seriesId: id }, part: "area" },
447
+ { t: "path", id: `area:${id}:negative`, d: poly([[x0, zeroY], [x0, yN[0]], [x1, yN[1]], [x1, zeroY]]), fill: p.g.lowBase ? { token: "badFill" } : negFill, ...hatch, owner: { seriesId: nid }, part: "area" },
448
+ { t: "line", id: `zero:${id}`, x1: x0, y1: zeroY, x2: x1, y2: zeroY, stroke: { token: "axis" }, width: strokeToken(theme, "rule"), owner: { seriesId: id }, part: "zeroLine" },
449
+ { t: "path", id: `mark:${id}`, d: line([[x0, yP[0]], [x1, yP[1]]]), stroke: posEdge, width: strokeToken(theme, "data"), owner: { seriesId: id }, part: "slope" },
450
+ { t: "path", id: `mark:${id}:negative`, d: line([[x0, yN[0]], [x1, yN[1]]]), stroke: negEdge, width: strokeToken(theme, "data"), owner: { seriesId: nid }, part: "slope" }
451
+ );
452
+ let sides = [
453
+ { side: "positive", ys: yP, vals: p.g.positive, edge: posEdge, sid: id },
454
+ { side: "negative", ys: yN, vals: p.g.negative, edge: negEdge, sid: nid }
455
+ ];
456
+ for (let { side, ys, vals, edge, sid } of sides)
457
+ [0, 1].forEach((e) => {
458
+ let cx = e === 0 ? x0 : x1, cy = ys[e], cat = e === 0 ? c0 : c1, text = valueText(vals[e], p, side, e);
459
+ nodes.push({
460
+ t: "circle",
461
+ id: `dot:${id}:${side}:${cat.id}`,
462
+ cx,
463
+ cy,
464
+ r: DOT_R,
465
+ fill: e === 0 ? { token: "background" } : edge,
466
+ ...e === 0 ? { stroke: edge, strokeWidth: strokeToken(theme, "mark") } : {},
467
+ owner: { seriesId: sid, categoryId: cat.id },
468
+ part: "endpointDot",
469
+ display: { value: text }
470
+ }), occupied.claim({ x: cx - DOT_R, y: cy - DOT_R, w: 2 * DOT_R, h: 2 * DOT_R }, "mark", { seriesId: sid, categoryId: cat.id });
471
+ let w = measure(text, labelFont).width, above = { x: cx - w / 2, y: cy - DOT_R - 3 - textH, w, h: textH }, below = { x: cx - w / 2, y: cy + DOT_R + 3, w, h: textH }, beside = { x: e === 0 ? cx - DOT_R - 3 - w : cx + DOT_R + 3, y: cy - textH / 2, w, h: textH };
472
+ fixed(
473
+ `point:${id}:${side}:${cat.id}`,
474
+ "point",
475
+ { seriesId: sid, categoryId: cat.id },
476
+ [text],
477
+ labelFont,
478
+ side === "positive" ? [above, beside] : [below, beside],
479
+ PRIORITY.endpoint
480
+ );
481
+ });
482
+ let head = heads[i], hh = head.lines.length * headFont.size * (headFont.lineHeight ?? 1.2);
483
+ fixed(`category:${id}`, "category", { seriesId: id }, head.lines, head.font, [{ x: px + pw / 2 - head.w / 2, y: rowY, w: head.w, h: hh }], PRIORITY.reference);
484
+ let fy = rowY + rowH - footerH + 4;
485
+ if (showNet) {
486
+ let text = chartString(options, "slopeNetLabel", { v1: signed(p.g.net[1]), v2: signed(p.g.netChange) }), w = measure(text, netFont).width;
487
+ fixed(`total:${id}:net`, "total", { seriesId: id }, [text], netFont, [{ x: px + pw / 2 - w / 2, y: fy, w, h: textH }], PRIORITY.total, !0, "note"), fy += footerPitch;
488
+ }
489
+ if (p.g.n) {
490
+ let text = `n = ${formatAutomaticNumber(p.g.n[1], { locale: language, decimals: 0 })}`, w = measure(text, labelFont).width;
491
+ fixed(`total:${id}:base`, "total", { seriesId: id }, [text], labelFont, [{ x: px + pw / 2 - w / 2, y: fy, w, h: textH }], PRIORITY.total, !0, "note");
492
+ }
493
+ marks.series.push({ seriesId: id, lineNodeId: `mark:${id}`, from: { x: x0, y: yP[0] }, to: { x: x1, y: yP[1] } }), marks.series.push({ seriesId: nid, lineNodeId: `mark:${id}:negative`, from: { x: x0, y: yN[0] }, to: { x: x1, y: yN[1] } }), marks.panels.push({ seriesId: id, rect: { x: px, y: rowY, w: pw, h: rowH }, zeroY, x0, x1, positiveY: yP, negativeY: yN });
494
+ });
495
+ let solveCtx = labelCtx(theme, size, options, {
496
+ focus: void 0,
497
+ measure,
498
+ plot: plot0,
499
+ labelPad: 1
500
+ }), solved = solveLabels(labelRequests, occupied, solveCtx);
501
+ pushAll(warnings, solved.warnings), pushAll(nodes, labelsToNodes(theme, solved.placed, (l) => fontById.get(l.id) ?? labelFont));
502
+ let changes = emptyIdRecord();
503
+ for (let p of panels) {
504
+ let abs = p.g.positive[1] - p.g.positive[0];
505
+ changes[p.s.id] = { abs: round2(abs), pct: p.g.positive[0] !== 0 ? round2(abs / p.g.positive[0] * 100) : null };
506
+ }
507
+ let rising = panels.filter((p) => p.g.netChange > 0).length, best = [...panels].sort((a, b) => b.g.net[1] - a.g.net[1])[0], desc = chartString(options, "divergingSlopeDesc", { v1: panels.length, v2: posName, v3: negName, v4: p1, v5: p2 }) + chartString(options, "slopeNetRiseDesc", { v1: rising, v2: p2, v3: best.label, v4: signed(best.g.net[1]) }) + (low.length > 0 ? chartString(options, "slopeLowBaseDesc", { v1: low.map((p) => p.label).join(", ") }) : "");
508
+ return {
509
+ type: "slope",
510
+ size,
511
+ plot: plot0,
512
+ scene: nodes,
513
+ labels: solved.placed,
514
+ axes: [],
515
+ annotations: [],
516
+ legend: frameResult.legend,
517
+ frame: frameResult.frame,
518
+ marks,
519
+ derived: {
520
+ changes,
521
+ diverging: {
522
+ order: panels.map((p) => p.s.id),
523
+ groups: Object.fromEntries(panels.map((p) => [p.s.id, p.g]))
524
+ }
525
+ },
526
+ a11y: {
527
+ title: accessibleTitle(options.title, chartString(options, "divergingSlopeTitle", { v1: panels.length, v2: p1, v3: p2 })),
528
+ counts: [structureCount("series", panels.length, void 0, options)],
529
+ desc
530
+ },
531
+ warnings,
532
+ sizing: resolveSizing(SLOPE_SIZING, size, { minHeight, naturalHeight }),
533
+ debug: { occupied: occupied.snapshot(), decisions: solved.decisions }
534
+ };
535
+ }
536
+
537
+ // src/core/charts/slope/layout.ts
538
+ var RAIL_GAP = 8, COMPACT_GAP = 120, NAME_RANK = 1e6, COMPACT_MIN_GAP = 64, WIDE_RAIL_MIN_WIDTH = 600, WIDE_RAIL_BASE = 70, WIDE_RAIL_SHARE = 0.29, MAX_GAP_RATIO = 1.6, RAIL_WASH = 0.75, SPREAD_GAP = 0, TOUCH_TOLERANCE = 1e-6, END_MIN_PITCH = 13, LINE_CLAIM_SEGMENTS = 8, CAGR_ENVELOPE_CLEARANCE = 26, BARE_ANCHOR_KEYS = /* @__PURE__ */ new Set(["at", "from", "to", "vs"]);
539
+ function layoutSlope(data, options = {}) {
540
+ if (options.variant === "diverging") return layoutDivergingSlope(data, options);
541
+ let warnings = [];
542
+ (options.diverging !== void 0 || data?.series?.some((s) => ["negative", "n", "footnote"].some((k) => k in s))) && warnings.push({ code: "slope-diverging-fields-ignored", severity: "warn", message: "diverging, series negative, n and footnote are read by variant 'diverging' only; the plain slope ignores them", suggest: "set options.variant to 'diverging', or remove them" }), breakUnsupported("slope", options, warnings);
543
+ let theme = resolveSemanticPaletteTheme(
544
+ chartTheme(options),
545
+ options.palette,
546
+ warnings
547
+ ), size = resolveSize(options.size), measure = options.measure ?? defaultMeasurer, seriesKeys = /* @__PURE__ */ new Map(), seriesKey = (s) => seriesKeys.get(s) ?? seriesKeys.set(s, { unit: s.unit, values: [s.a, s.b].flatMap((end) => end.isPct || end.v === null ? [] : [end.v]) }).get(s), fmtVal = (v, isPct, example, s) => example ? formatterFromExample(example, options.locale?.language, s.unit ?? options.unit)(v) : isPct ? formatAuthoredPercent(v, options.locale?.language) : formats.forSeries(seriesKey(s))(v), highlights = new Set(resolveHighlight(options.highlight)), density = options.labelDensity ?? "smart";
548
+ if (!data || !Array.isArray(data.categories) || data.categories.length < 2)
549
+ throw new NormalizeError(
550
+ "empty-data",
551
+ "categories",
552
+ "slope requires exactly two categories (time points)"
553
+ );
554
+ if (!Array.isArray(data.series) || data.series.length === 0)
555
+ throw new NormalizeError("empty-data", "series", "slope requires at least one series");
556
+ let allCats = data.categories.map((c, i) => normalizeCategory(c, i));
557
+ allCats.length > 2 && warnings.push({
558
+ code: "slope-too-many-points",
559
+ severity: "error",
560
+ message: `slope requires exactly 2 categories, got ${allCats.length} \u2014 layout uses first and last only`,
561
+ suggest: "use chart type 'line' for more than two time points"
562
+ });
563
+ let i0 = 0, i1 = allCats.length - 1, c0 = allCats[i0], c1 = allCats[i1], toEnd = (cell) => {
564
+ let meta = cellMeta(cell);
565
+ return {
566
+ v: cellValue(cell),
567
+ isPct: isPctCell(cell),
568
+ labelOverride: meta?.label,
569
+ format: meta?.format,
570
+ priority: meta?.priority
571
+ };
572
+ }, seriesNorm = data.series.map((s, si) => {
573
+ if (!s?.id) throw new NormalizeError("missing-id", `series[${si}]`, "series requires an id");
574
+ let cells = normalizeSeriesValues(s, allCats, si);
575
+ return {
576
+ id: s.id,
577
+ label: s.label ?? s.id,
578
+ role: s.role ?? "data",
579
+ scenario: normalizeScenario(s.scenario, `series[${s.id}].scenario`),
580
+ colorRole: s.colorRole,
581
+ fill: s.fill,
582
+ format: s.format,
583
+ // Carried for the fold: a sum of euros and kilograms is not a quantity.
584
+ ...typeof s.unit == "string" ? { unit: s.unit } : {},
585
+ a: toEnd(cells[i0]),
586
+ b: toEnd(cells[i1])
587
+ };
588
+ }).filter((s) => s.role !== "reference").map(({ role: _role, ...rest }) => rest), formats = seriesRasterFormatter(
589
+ options.format,
590
+ seriesNorm.flatMap((s) => [s.a, s.b].flatMap((end) => end.isPct ? [] : [end.v])),
591
+ options.locale?.language,
592
+ options.unit,
593
+ options.target
594
+ );
595
+ if (seriesNorm.length === 0)
596
+ throw new NormalizeError("empty-data", "series", "slope requires at least one data-role series");
597
+ let plottedSeries = seriesNorm.filter((s) => {
598
+ let ok = s.a.v !== null && s.b.v !== null;
599
+ return ok || warnings.push({
600
+ code: "slope-missing-endpoint",
601
+ severity: "warn",
602
+ message: `series '${s.id}': missing endpoint value \u2014 series not plotted`,
603
+ owner: { seriesId: s.id }
604
+ }), ok;
605
+ }), kept = new Set(highlights), collect = (value) => {
606
+ if (Array.isArray(value)) value.forEach(collect);
607
+ else if (value && typeof value == "object")
608
+ for (let [key, inner] of Object.entries(value))
609
+ key === "seriesId" && typeof inner == "string" ? kept.add(inner) : BARE_ANCHOR_KEYS.has(key) && typeof inner == "string" ? inner !== c0.id && inner !== c1.id && kept.add(inner) : collect(inner);
610
+ };
611
+ collect(options.annotations);
612
+ let foldRefusal = foldShareRefusal(options.foldBelowShare);
613
+ foldRefusal && warnings.push(foldRefusal);
614
+ let fold = foldRefusal || options.foldBelowShare === void 0 ? null : planSlopeFold(plottedSeries, seriesNorm, options.foldBelowShare, {
615
+ othersLabel: chartWording(options, "others", "Other"),
616
+ highlights: kept,
617
+ warnings,
618
+ format: (v, isPct) => options.format ? formatterFromExample(options.format, options.locale?.language, options.unit)(v) : isPct ? formatAuthoredPercent(v, options.locale?.language) : formats.fmt(v),
619
+ ...typeof options.unit == "string" ? { chartUnit: options.unit } : {},
620
+ categories: { from: c0.label ?? c0.id, to: c1.label ?? c1.id },
621
+ ...options.locale?.language !== void 0 ? { language: options.locale.language } : {}
622
+ });
623
+ fold && ({ plotted: plottedSeries, listed: seriesNorm } = fold);
624
+ let changes = emptyIdRecord();
625
+ for (let s of plottedSeries) {
626
+ let abs = s.b.v - s.a.v;
627
+ changes[s.id] = {
628
+ abs: round2(abs),
629
+ pct: s.a.v !== 0 ? round2(abs / Math.abs(s.a.v) * 100) : null
630
+ };
631
+ }
632
+ let byChange = (dir) => {
633
+ let best, bestAbs = 0;
634
+ for (let s of plottedSeries) {
635
+ let c = changes[s.id].abs * dir;
636
+ (c > bestAbs || c === bestAbs && c > 0 && best !== void 0 && s.id < best) && (best = s.id, bestAbs = c);
637
+ }
638
+ return bestAbs > 0 ? best : void 0;
639
+ }, steepestUp = byChange(1), steepestDown = byChange(-1), kindSetting = (kind) => {
640
+ let l = options.labels;
641
+ if (l === !1) return kind === "category" && labelsOffKeepsNames(options);
642
+ let v = l?.[kind];
643
+ return v === void 0 ? !0 : v;
644
+ }, endContent = ((kind, dflt) => {
645
+ let s = kindSetting(kind);
646
+ return s === !1 ? null : Array.isArray(s) ? s : dflt;
647
+ })("series", ["series", "absolute"]), composeEndParts = (s, end, cat, side, compact2 = !1) => {
648
+ if (!endContent) return [];
649
+ let content = compact2 && side === "left" && s.b.labelOverride !== !1 ? endContent.filter((c) => c !== "series") : endContent, ordered = side === "left" || plottedSeries.length === 1 ? content : [...content].reverse(), parts = [];
650
+ for (let c of ordered)
651
+ if (c === "absolute" && end.v !== null) {
652
+ let value = fmtVal(end.v, end.isPct, end.format ?? s.format ?? options.format, s);
653
+ parts.push({ text: typeof end.labelOverride == "string" ? end.labelOverride.replace(/\$\{value\}/g, value) : value, isName: !1 });
654
+ } else c === "percent" && changes[s.id]?.pct != null ? parts.push({ text: formatAutomaticPercent(changes[s.id].pct, 1, !0, options.locale?.language), isName: !1 }) : c === "category" ? parts.push({ text: cat.label ?? cat.id, isName: !1 }) : c === "series" && parts.push({ text: s.label, isName: !0 });
655
+ return parts;
656
+ }, composeEnd = (s, end, cat, side, compact2 = !1) => composeEndParts(s, end, cat, side, compact2).map((p) => p.text).join(" "), labelFont = { family: theme.type.family, ...theme.type.label }, hlFont = { ...labelFont, weight: emphasisWeight(theme) }, catFont = { family: theme.type.family, ...theme.type.label }, endFontOf = (s) => highlights.has(s.id) ? hlFont : labelFont, endLineH = labelFont.size * (labelFont.lineHeight ?? 1.2), minPitch = Math.max(END_MIN_PITCH, endLineH), anyHighlight = highlights.size > 0 || seriesNorm.some((s) => !s.fill && s.colorRole === "highlight"), rawLinePaint = (s) => s.fill ? { css: s.fill } : s.colorRole ? markRolePaint(s.colorRole) : highlights.has(s.id) ? semanticPalettePaint(theme, options.palette, "focus") : anyHighlight && (options.palette === void 0 || theme.color.palettes?.[options.palette] === void 0) ? mutedMarkPaint() : semanticPalettePaint(
657
+ theme,
658
+ options.palette,
659
+ anyHighlight ? "neutralLight" : "neutralMark"
660
+ ), keyedPaints = !anyHighlight && options.legend && options.legend !== "none" ? new Map(distinguishSeries(
661
+ seriesNorm.map((s) => ({
662
+ id: s.id,
663
+ label: s.label,
664
+ paint: rawLinePaint(s),
665
+ key: "line",
666
+ ...s.scenario === "FC" ? { dash: dashToken(theme, "reference") } : {}
667
+ })),
668
+ new Set(seriesNorm.filter((s) => s.fill || s.colorRole || highlights.has(s.id)).map((s) => s.id)),
669
+ Array.from({ length: theme.color.series.length }, (_, i) => seriesPaint(i, options.palette)),
670
+ theme
671
+ ).map((identity) => [identity.id, identity.paint])) : void 0, linePaint = (s) => keyedPaints?.get(s.id) ?? rawLinePaint(s), lineWidth = (s) => strokeToken(theme, highlights.has(s.id) ? "focus" : anyHighlight && !s.fill && !s.colorRole ? "mark" : "data"), occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { ...canvasMargin(theme, size.width), ...options.margin }, legendInput;
672
+ if (options.legend && options.legend !== "none" && options.legend !== "auto") {
673
+ let legendOpts = normalizeLegendOption(options.legend), items = seriesNorm.filter((s) => !anyHighlight || highlights.has(s.id) || s.fill || s.colorRole || s.id === fold?.record.otherId).map((s) => ({
674
+ id: s.id,
675
+ label: s.id === fold?.record.otherId ? fold.legendLabel : s.label,
676
+ paint: linePaint(s),
677
+ // Every slope line draws a dot at both ends: its key carries one.
678
+ key: "line",
679
+ width: lineWidth(s),
680
+ marker: { shape: "circle" },
681
+ ...s.scenario === "FC" ? { dash: dashToken(theme, "reference") } : {}
682
+ }));
683
+ if (legendOpts.order) {
684
+ let oi = (id) => {
685
+ let k = legendOpts.order.indexOf(id);
686
+ return k === -1 ? Number.MAX_SAFE_INTEGER : k;
687
+ };
688
+ items = [...items].sort((a, b) => oi(a.id) - oi(b.id));
689
+ }
690
+ legendInput = { options: legendOpts, items };
691
+ }
692
+ let frameResult = solveFrame(
693
+ {
694
+ size,
695
+ margin,
696
+ ...frameTextOptions(options),
697
+ footnotes: [...authoredNotes(options), ...fold ? [fold.record.note] : []],
698
+ legend: legendInput,
699
+ theme,
700
+ measure
701
+ },
702
+ occupied
703
+ ), sideCap = Math.max(40, frameResult.plot.w * 0.35), wrapRoom = plottedSeries.length * (2 * endLineH + SPREAD_GAP) <= frameResult.plot.h * 0.8, mkEndReq = (s, end, cat, side, compact2 = !1, maxSideW = sideCap) => {
704
+ let baseFont = endFontOf(s), text = composeEnd(s, end, cat, side, compact2), fit = typeof end.labelOverride == "string" ? void 0 : fitEndLabel(text, baseFont, { maxSideW, wrapRoom, shrink: stepDownFont(theme, baseFont, "label", options.target, textScaleOf(options)), target: options.target, measure }), font = fit?.font ?? baseFont, lines = fit?.lines ?? [text], tsize = fit?.size ?? measure(text || "0", font), title;
705
+ if (tsize.width > maxSideW && typeof end.labelOverride != "string") {
706
+ let parts = composeEndParts(s, end, cat, side, compact2), nameIdx = parts.findIndex((p) => p.isName);
707
+ if (nameIdx !== -1) {
708
+ let budget = maxSideW - parts.reduce(
709
+ (a, p, k) => k === nameIdx ? a : a + measure(p.text, font).width,
710
+ measure(" ", font).width * (parts.length - 1)
711
+ ), name = parts[nameIdx].text;
712
+ if (measure(name, font).width > budget) {
713
+ let fitted = "", words = name.split(" ");
714
+ for (let k = words.length - 1; k >= 1; k--) {
715
+ let cand = `${words.slice(0, k).join(" ")}\u2026`;
716
+ if (measure(cand, font).width <= budget) {
717
+ fitted = cand;
718
+ break;
719
+ }
720
+ }
721
+ fitted || (fitted = cutWithTitle(name, font, Math.max(budget, 0), measure).text), title = text, parts[nameIdx] = { text: fitted, isName: !0 }, text = parts.map((p) => p.text).join(" "), lines = [text], tsize = measure(text || "0", font);
722
+ }
723
+ }
724
+ }
725
+ let change = changes[s.id]?.abs ?? 0, priority = end.priority ?? PRIORITY.endpoint + Math.min(99, Math.abs(change)) + (highlights.has(s.id) ? PRIORITY.highlightBonus : 0);
726
+ return {
727
+ s,
728
+ text,
729
+ w: tsize.width,
730
+ h: tsize.height,
731
+ priority,
732
+ suppressed: end.labelOverride === !1 || !text,
733
+ ...title !== void 0 ? { title } : {},
734
+ ...font !== baseFont ? { fontStep: font } : {},
735
+ lines
736
+ };
737
+ }, sideMax = (reqs) => reqs.reduce((m, r) => r.suppressed ? m : Math.max(m, r.w), 0), sideDemand = (side) => plottedSeries.reduce((max, s) => {
738
+ let end = side === "left" ? s.a : s.b;
739
+ if (end.labelOverride === !1) return max;
740
+ let text = composeEnd(s, end, side === "left" ? c0 : c1, side);
741
+ if (!text) return max;
742
+ let width = measure(text, endFontOf(s)).width;
743
+ return Math.max(max, typeof end.labelOverride == "string" ? width : Math.min(sideCap, width));
744
+ }, 0), fullLeftReqs = plottedSeries.map((s) => mkEndReq(s, s.a, c0, "left")), fullRightReqs = plottedSeries.map((s) => mkEndReq(s, s.b, c1, "right")), compactable = endContent !== null && options.labels !== !1 && !Array.isArray(options.labels?.series) && plottedSeries.length > 1 && endContent.includes("series") && endContent.length > 1, gapCompact = compactable && frameResult.plot.w - sideDemand("left") - sideDemand("right") - 2 * RAIL_GAP < COMPACT_GAP, cutCompact = compactable && !gapCompact && (fullLeftReqs.some((req) => req.title !== void 0) || fullRightReqs.some((req) => req.title !== void 0)), compactLeftReqs = gapCompact || cutCompact ? plottedSeries.map((s) => mkEndReq(s, s.a, c0, "left", !0)) : [], rightCap = gapCompact || cutCompact ? Math.max(sideCap, frameResult.plot.w - sideMax(compactLeftReqs) - 2 * RAIL_GAP - COMPACT_MIN_GAP) : sideCap, compactRightReqs = gapCompact || cutCompact ? plottedSeries.map((s) => mkEndReq(s, s.b, c1, "right", !0, rightCap)) : [], catH = measure("0", catFont).height, topPad = ((options.annotations ?? []).some((a) => a.kind === "cagr") ? measure("0", { ...labelFont, weight: emphasisWeight(theme) }).height + CAGR_ENVELOPE_CLEARANCE : 0) + catH + 10, plotY = frameResult.plot.y + topPad, plotH = plotHeightAfter(frameResult, size.height, frameResult.plot.h - topPad), wantPlotH = options[TARGET_SIZE]?.fixed.height === !1 && panelTypeClass(options) === void 0 && size.width >= WIDE_RAIL_MIN_WIDTH ? Math.round(WIDE_RAIL_BASE + WIDE_RAIL_SHARE * size.width) : 0;
745
+ wantPlotH > plotH && (frameResult.frame.plotMinHeight = Math.max(frameResult.frame.plotMinHeight ?? 0, Math.ceil(size.height + (frameResult.deficit ?? 0) + wantPlotH - plotH)));
746
+ let lo = valueLineExtent(options.annotations)?.lo ?? 1 / 0, hi = valueLineExtent(options.annotations)?.hi ?? -1 / 0;
747
+ for (let s of plottedSeries)
748
+ lo = Math.min(lo, s.a.v, s.b.v), hi = Math.max(hi, s.a.v, s.b.v);
749
+ Number.isFinite(lo) || (lo = 0, hi = 1);
750
+ let dLo, dHi;
751
+ if (lo === hi)
752
+ [dLo, dHi] = niceDomain(lo === 0 ? -1 : lo - Math.abs(lo) * 0.1, hi === 0 ? 1 : hi + Math.abs(hi) * 0.1, 4);
753
+ else {
754
+ let pad = (hi - lo) * 0.06;
755
+ [dLo, dHi] = niceDomain(lo - pad, hi + pad, 5, {
756
+ dataExtent: [lo, hi],
757
+ preserveDataSideOfZero: !0,
758
+ // Two-sided domain — waste SUM bounded by the 0.80 envelope floor.
759
+ maxWasteFraction: 0.15,
760
+ maxTotalWasteFraction: 0.2
761
+ });
762
+ }
763
+ let va = options.valueAxis ?? {};
764
+ [dLo, dHi] = applyAxisBounds([dLo, dHi], [lo, hi], va, warnings);
765
+ let y = linearScale([dLo, dHi], [plotY + plotH, plotY]), seatSide = (reqs, side, unnamed = /* @__PURE__ */ new Set()) => {
766
+ let rank = (r) => r.priority + (unnamed.size === 0 ? 0 : highlights.has(r.s.id) ? 2 * NAME_RANK : unnamed.has(r.s.id) ? NAME_RANK : 0), active = reqs.filter((r) => !r.suppressed), desiredOf = (r) => y(side === "left" ? r.s.a.v : r.s.b.v), pitch = minPitch, height = (rs, p) => rs.reduce((a, r) => a + Math.max(r.h, p), 0) + SPREAD_GAP * Math.max(0, rs.length - 1), step = stepDownFont(theme, labelFont, "label", options.target, textScaleOf(options));
767
+ if (step && height(active, pitch) > plotH) {
768
+ let small = active.map((r) => {
769
+ if (r.fontStep) return r;
770
+ let font = { ...endFontOf(r.s), size: step.size }, h = measure(r.lines[0] || "0", font).height + (r.lines.length - 1) * lineBox(font);
771
+ return { ...r, fontStep: font, w: Math.max(...r.lines.map((line) => measure(line || "0", font).width)), h };
772
+ }), smallPitch = Math.max(END_MIN_PITCH, step.size * (step.lineHeight ?? 1.2));
773
+ height(small, smallPitch) <= plotH && (active = small, pitch = smallPitch);
774
+ }
775
+ let effH = (r) => Math.max(r.h, pitch), kept2 = [...active], dropped = [];
776
+ if (kept2.length * pitch > plotH) {
777
+ let keepFlags = sweepHide(
778
+ kept2.map((r) => ({
779
+ start: desiredOf(r) - pitch / 2,
780
+ size: pitch,
781
+ priority: rank(r)
782
+ })),
783
+ 0
784
+ );
785
+ pushAll(dropped, kept2.filter((_, i) => !keepFlags[i])), kept2 = kept2.filter((_, i) => keepFlags[i]);
786
+ }
787
+ let needed = () => kept2.reduce((a, r) => a + effH(r), 0) + SPREAD_GAP * Math.max(0, kept2.length - 1);
788
+ for (; kept2.length > 1 && needed() > plotH; ) {
789
+ let worst = 0;
790
+ for (let i = 1; i < kept2.length; i++) {
791
+ let a = kept2[i], b = kept2[worst];
792
+ (rank(a) < rank(b) || rank(a) === rank(b) && a.s.id > b.s.id) && (worst = i);
793
+ }
794
+ dropped.push(...kept2.splice(worst, 1));
795
+ }
796
+ return { kept: kept2, dropped, pitch };
797
+ }, compact = (gapCompact || cutCompact) && seatSide(compactRightReqs, "right").dropped.length === 0, leftReqs = compact ? compactLeftReqs : fullLeftReqs, rightReqs = compact ? compactRightReqs : fullRightReqs, leftMax = endContent ? sideMax(leftReqs) : 0, rightMax = endContent ? sideMax(rightReqs) : 0, railGapOf = (reqs, side) => {
798
+ let active = reqs.filter((r) => !r.suppressed);
799
+ if (!endContent || active.length === 0) return RAIL_GAP;
800
+ let desired = active.map((r) => y(side === "left" ? r.s.a.v : r.s.b.v)), spread = spread1DResult(active.map((r, i) => ({ desired: desired[i], size: Math.max(r.h, minPitch) })), [plotY, plotY + plotH], SPREAD_GAP), shift = Math.max(0, maxOf(spread.positions.map((position, i) => Math.abs(position - desired[i]))));
801
+ return Math.min(48, Math.max(RAIL_GAP, Math.ceil(shift + 0.4 * endLineH + 1)));
802
+ }, railGaps = { left: railGapOf(leftReqs, "left"), right: railGapOf(rightReqs, "right") }, railL = frameResult.plot.x + (leftMax > 0 ? leftMax + railGaps.left : 0), railR = frameResult.plot.x + frameResult.plot.w - (rightMax > 0 ? rightMax + railGaps.right : 0), maxGap = MAX_GAP_RATIO * plotH;
803
+ if (railR - railL > maxGap) {
804
+ let spare = railR - railL - maxGap;
805
+ railL += spare / 2, railR -= spare / 2;
806
+ }
807
+ let plot = { x: railL, y: plotY, w: Math.max(10, railR - railL), h: plotH }, nodes = [...frameResult.nodes], railXs = [plot.x, plot.x + plot.w], railCats = [c0, c1], railPaint = theme.color.reference !== void 0 ? { token: "reference" } : { token: "reference", theme: { kind: "visible-tint", base: { token: "reference" }, amount: RAIL_WASH, floor: MARK_CONTRAST_FLOOR } };
808
+ railCats.forEach((c, k) => {
809
+ let rx = railXs[k];
810
+ nodes.push({
811
+ t: "line",
812
+ id: `rail:${c.id}`,
813
+ x1: rx,
814
+ y1: plot.y,
815
+ x2: rx,
816
+ y2: plot.y + plot.h,
817
+ stroke: railPaint,
818
+ width: strokeToken(theme, "rule"),
819
+ owner: { categoryId: c.id },
820
+ part: "rail"
821
+ }), occupied.claim({ x: rx - 1, y: plot.y, w: 2, h: plot.h }, "axis", { categoryId: c.id });
822
+ });
823
+ let marks = { series: [] };
824
+ for (let s of plottedSeries) {
825
+ let yA = y(s.a.v), yB = y(s.b.v), lineNodeId = `mark:${s.id}`;
826
+ nodes.push({
827
+ t: "line",
828
+ id: lineNodeId,
829
+ x1: railXs[0],
830
+ y1: yA,
831
+ x2: railXs[1],
832
+ y2: yB,
833
+ stroke: linePaint(s),
834
+ width: lineWidth(s),
835
+ ...s.scenario === "FC" ? { dash: dashToken(theme, "reference") } : {},
836
+ owner: { seriesId: s.id },
837
+ part: "slope"
838
+ });
839
+ let w = railXs[1] - railXs[0];
840
+ for (let k = 0; k < LINE_CLAIM_SEGMENTS; k++) {
841
+ let fx0 = k / LINE_CLAIM_SEGMENTS, fx1 = (k + 1) / LINE_CLAIM_SEGMENTS, sy0 = yA + (yB - yA) * fx0, sy1 = yA + (yB - yA) * fx1;
842
+ occupied.claim(
843
+ {
844
+ x: railXs[0] + w * fx0,
845
+ y: Math.min(sy0, sy1) - 1.5,
846
+ w: w * (fx1 - fx0),
847
+ h: Math.abs(sy1 - sy0) + 3
848
+ },
849
+ "mark",
850
+ { seriesId: s.id }
851
+ );
852
+ }
853
+ [[railXs[0], yA, c0], [railXs[1], yB, c1]].forEach(([dx, dy, dc]) => {
854
+ let end = dc.id === c0.id ? s.a : s.b;
855
+ nodes.push({
856
+ t: "circle",
857
+ id: `dot:${s.id}:${dc.id}`,
858
+ cx: dx,
859
+ cy: dy,
860
+ r: 2.5,
861
+ fill: linePaint(s),
862
+ owner: { seriesId: s.id, categoryId: dc.id },
863
+ part: "endpointDot",
864
+ display: { value: fmtVal(end.v, end.isPct, end.format ?? s.format ?? options.format, s) }
865
+ }), occupied.claim({ x: dx - 2.5, y: dy - 2.5, w: 5, h: 5 }, "mark", {
866
+ seriesId: s.id,
867
+ categoryId: dc.id
868
+ });
869
+ }), marks.series.push({
870
+ seriesId: s.id,
871
+ lineNodeId,
872
+ from: { x: railXs[0], y: yA },
873
+ to: { x: railXs[1], y: yB }
874
+ });
875
+ }
876
+ let labelRequests = [], planSide = (reqs, side, unnamed) => {
877
+ if (!endContent) return [];
878
+ let railX = side === "left" ? railXs[0] : railXs[1], cat = side === "left" ? c0 : c1, desiredOf = (r) => y(side === "left" ? r.s.a.v : r.s.b.v), { kept: kept2, dropped, pitch } = seatSide(reqs, side, unnamed), effH = (r) => Math.max(r.h, pitch), spread = spread1DResult(
879
+ kept2.map((r) => ({ desired: desiredOf(r), size: effH(r) })),
880
+ [plot.y, plot.y + plot.h],
881
+ SPREAD_GAP
882
+ );
883
+ warnSpreadOverflow(warnings, spread.fits, `${side} endpoint labels exceed the plot height even after spreading \u2014 labels stay bounded but overlap; reduce series or enlarge the canvas`);
884
+ let centers = spread.positions, slot = side === "left" ? "railLeft" : "railRight", rectFor = (r, centerY) => ({
885
+ x: side === "left" ? railX - railGaps.left - r.w : railX + railGaps.right,
886
+ y: centerY - r.h / 2,
887
+ w: r.w,
888
+ h: r.h
889
+ });
890
+ kept2.forEach((r, i) => {
891
+ labelRequests.push({
892
+ id: `series:${r.s.id}:${cat.id}`,
893
+ kind: "series",
894
+ owner: { seriesId: r.s.id, categoryId: cat.id },
895
+ text: r.text,
896
+ lines: r.lines,
897
+ ...r.title !== void 0 ? { title: r.title } : {},
898
+ ...r.fontStep ? { fontStep: r.fontStep } : {},
899
+ font: endFontOf(r.s),
900
+ priority: r.priority,
901
+ // Spread boxes may touch (SPREAD_GAP), so the solver pads them by 0.
902
+ pad: -TOUCH_TOLERANCE,
903
+ candidates: [{
904
+ slot,
905
+ rect: rectFor(r, centers[i]),
906
+ penalty: 0,
907
+ // Moved off its point: a leader from the rail point to the label.
908
+ ...Math.abs(centers[i] - desiredOf(r)) > 0.5 ? { leaderFrom: { x: railX, y: desiredOf(r) } } : {}
909
+ }]
910
+ });
911
+ });
912
+ for (let r of [...dropped, ...reqs.filter((x) => x.suppressed)]) {
913
+ let desired = desiredOf(r);
914
+ labelRequests.push({
915
+ id: `series:${r.s.id}:${cat.id}`,
916
+ kind: "series",
917
+ owner: { seriesId: r.s.id, categoryId: cat.id },
918
+ text: r.text,
919
+ lines: [r.text],
920
+ font: endFontOf(r.s),
921
+ priority: r.priority,
922
+ redundant: !0,
923
+ // Dropped because the side could not give every end label readable
924
+ // pitch — NOT because the name appears elsewhere. Publishing this as
925
+ // 'redundant' told a reader the omission was free when it was not.
926
+ suppressedAs: "density",
927
+ candidates: [{ slot, rect: rectFor(r, desired), penalty: 0 }]
928
+ });
929
+ }
930
+ return kept2;
931
+ }, leftKept = planSide(leftReqs, "left"), leftNamed = new Set(compact || !endContent?.includes("series") ? [] : leftKept.map((r) => r.s.id));
932
+ planSide(rightReqs, "right", compact || !endContent?.includes("series") ? void 0 : new Set(plottedSeries.filter((s) => !leftNamed.has(s.id)).map((s) => s.id)));
933
+ let catLabelsShown = !1;
934
+ kindSetting("category") !== !1 && (catLabelsShown = !0, railCats.forEach((c, k) => {
935
+ let rx = railXs[k], text = markedLabel(c.label ?? c.id, c.footnote, c.id, { count: authoredFootnoteCount(options), warnings }), tsize = measure(text, catFont), cy = plot.y - catH - 6, centeredX = clamp(rx - tsize.width / 2, 2, size.width - tsize.width - 2), inwardX = k === 0 ? rx + 4 : rx - tsize.width - 4;
936
+ labelRequests.push({
937
+ id: `category:${c.id}`,
938
+ kind: "category",
939
+ owner: { categoryId: c.id },
940
+ text,
941
+ lines: [text],
942
+ font: catFont,
943
+ priority: PRIORITY.endpoint,
944
+ candidates: [
945
+ { slot: "aboveRail", rect: { x: centeredX, y: cy, w: tsize.width, h: catH }, penalty: 0 },
946
+ { slot: "aboveRailInward", rect: { x: inwardX, y: cy, w: tsize.width, h: catH }, penalty: 1 }
947
+ ]
948
+ });
949
+ }));
950
+ let solveCtx = labelCtx(theme, size, options, {
951
+ density,
952
+ measure,
953
+ plot,
954
+ labelPad: 2
955
+ }), solved = solveLabels(labelRequests, occupied, solveCtx);
956
+ pushAll(warnings, solved.warnings);
957
+ let plottedById = new Map(plottedSeries.map((s) => [s.id, s])), endpointOf = (sid, cid) => {
958
+ let s = plottedById.get(sid);
959
+ if (!s) return null;
960
+ let k = cid === c0.id ? 0 : cid === c1.id ? 1 : -1;
961
+ if (k === -1) return null;
962
+ let v = k === 0 ? s.a.v : s.b.v, cat = k === 0 ? c0 : c1;
963
+ return {
964
+ x: railXs[k],
965
+ y: y(v),
966
+ value: v,
967
+ format: s.format,
968
+ date: cat.date,
969
+ owner: { seriesId: sid, categoryId: cat.id }
970
+ };
971
+ }, resolveAnchor = (ref) => {
972
+ if (typeof ref == "string") {
973
+ if (ref === c0.id || ref === c1.id) {
974
+ let sid = plottedSeries[0]?.id;
975
+ return sid ? endpointOf(sid, ref) : null;
976
+ }
977
+ return endpointOf(ref, c1.id);
978
+ }
979
+ if ("categoryId" in ref && ref.seriesId) return endpointOf(ref.seriesId, ref.categoryId);
980
+ if ("categoryId" in ref) {
981
+ let sid = plottedSeries[0]?.id;
982
+ return sid ? endpointOf(sid, ref.categoryId) : null;
983
+ }
984
+ return null;
985
+ }, annResult = runAnnotatePass({
986
+ annotations: options.annotations ?? [],
987
+ resolve: resolveAnchor,
988
+ defaultSpan: plottedSeries.length === 1 ? {
989
+ from: { categoryId: c0.id, seriesId: plottedSeries[0].id },
990
+ to: { categoryId: c1.id, seriesId: plottedSeries[0].id }
991
+ } : void 0,
992
+ occupied,
993
+ plot,
994
+ theme,
995
+ measure,
996
+ format: options.format,
997
+ locale: options.locale?.language,
998
+ strings: options.strings,
999
+ valueLinePercentLevels: options.unit === "%" || percentLevels(plottedSeries.map((series) => ({ vals: [series.a, series.b] }))),
1000
+ solveCtx,
1001
+ yScale: y
1002
+ });
1003
+ pushAll(warnings, annResult.warnings);
1004
+ let allLabels = [...solved.placed, ...annResult.labels], legendNames = legendInput !== void 0 && frameResult.legend !== void 0 ? legendInput.items.map((item) => item.id) : [];
1005
+ pushAll(warnings, unnamedSeriesWarnings(seriesNorm, allLabels, legendNames)), pushAll(nodes, annResult.nodes), pushAll(
1006
+ nodes,
1007
+ labelsToNodes(
1008
+ theme,
1009
+ allLabels,
1010
+ (l) => l.kind === "category" ? catFont : l.kind === "annotation" || l.kind === "valueLine" ? { ...labelFont, weight: emphasisWeight(theme) } : highlights.has(l.owner.seriesId ?? "") ? hlFont : labelFont
1011
+ )
1012
+ // Every leader keeps the thin neutral leader paint; a leader in the
1013
+ // highlight colour reads as a hook in its line.
1014
+ );
1015
+ let axes = [
1016
+ {
1017
+ axis: "x",
1018
+ ticks: railCats.map((c, k) => ({
1019
+ at: c.id,
1020
+ pos: railXs[k],
1021
+ labelId: catLabelsShown ? `category:${c.id}` : void 0
1022
+ }))
1023
+ }
1024
+ ], changeText = (sid) => {
1025
+ let s = plottedById.get(sid), ch = changes[sid], pctPart = ch.pct !== null ? ` (${formatAutomaticPercent(ch.pct, 1, !0, options.locale?.language)})` : "";
1026
+ return `${s.label} ${formatAutomaticNumber(ch.abs, { locale: options.locale?.language, signed: !0, decimals: autoDecimals(ch.abs) })}${pctPart}`;
1027
+ }, steepParts = [];
1028
+ steepestUp && steepParts.push(chartString(options, "steepestRiser", { v1: changeText(steepestUp) })), steepestDown && steepParts.push(chartString(options, "steepestFaller", { v1: changeText(steepestDown) }));
1029
+ let a11yDesc = chartString(options, "slopeDesc", { v1: plottedSeries.length, v2: c0.label ?? c0.id, v3: c1.label ?? c1.id }) + (steepParts.length ? `${steepParts.join("; ")}.` : chartString(options, "seriesUnchanged")) + (fold ? ` ${fold.record.note}` : ""), derived = {
1030
+ changes,
1031
+ ...steepestUp !== void 0 ? { steepestUp } : {},
1032
+ ...steepestDown !== void 0 ? { steepestDown } : {},
1033
+ ...fold ? { folded: fold.record } : {}
1034
+ };
1035
+ return {
1036
+ type: "slope",
1037
+ size,
1038
+ plot,
1039
+ scene: nodes,
1040
+ labels: allLabels,
1041
+ axes,
1042
+ annotations: annResult.placed,
1043
+ legend: frameResult.legend,
1044
+ frame: frameResult.frame,
1045
+ marks,
1046
+ derived,
1047
+ a11y: {
1048
+ title: accessibleTitle(options.title, chartString(options, "slopeTitle", { v1: plottedSeries.length, v2: c0.label ?? c0.id, v3: c1.label ?? c1.id })),
1049
+ counts: [structureCount("series", plottedSeries.length, void 0, options), ...fold ? [structureCount("series", fold.record.memberIds.length, void 0, options)] : []],
1050
+ desc: a11yDesc
1051
+ },
1052
+ warnings,
1053
+ debug: {
1054
+ occupied: occupied.snapshot(),
1055
+ decisions: [...solved.decisions, ...annResult.decisions]
1056
+ }
1057
+ };
1058
+ }
1059
+ function unnamedSeriesWarnings(series, labels, legendNames) {
1060
+ let named = new Set(legendNames);
1061
+ for (let label of labels)
1062
+ label.hidden || label.owner.seriesId !== void 0 && named.add(label.owner.seriesId);
1063
+ let anonymous = series.filter((s) => !named.has(s.id));
1064
+ return anonymous.length === 0 ? [] : [{
1065
+ code: "series-unnamed",
1066
+ severity: "warn",
1067
+ message: `${anonymous.length} of ${series.length} series are named nowhere on the canvas (${anonymous.map((s) => s.label).join(", ")}): both endpoint labels were suppressed and there is no legend`,
1068
+ suggest: "add `legend` so every line keeps an identity, increase the chart height, or reduce the number of series"
1069
+ }];
1070
+ }
1071
+ function fitEndLabel(text, font, opts) {
1072
+ let { measure } = opts, one = measure(text || "0", font);
1073
+ if (one.width <= opts.maxSideW) return { font, lines: [text], size: one };
1074
+ let fonts = opts.shrink && opts.shrink.size < font.size ? [font, opts.shrink] : [font];
1075
+ for (let candidate of fonts) {
1076
+ let single = measure(text || "0", candidate);
1077
+ if (single.width <= opts.maxSideW) return { font: candidate, lines: [text], size: single };
1078
+ if (!opts.wrapRoom) continue;
1079
+ let wrapped = fitText(text, candidate, opts.maxSideW, 2, measure, { target: opts.target, typeRole: "label" });
1080
+ if (wrapped.title === void 0) {
1081
+ let height = measure(wrapped.lines[0] ?? "0", candidate).height + (wrapped.lines.length - 1) * lineBox(candidate);
1082
+ return { font: candidate, lines: wrapped.lines, size: { width: wrapped.w, height } };
1083
+ }
1084
+ }
1085
+ let cutFont = fonts[fonts.length - 1];
1086
+ return { font: cutFont, lines: [text], size: cutFont === font ? one : measure(text || "0", cutFont) };
1087
+ }
1088
+
1089
+ // src/core/charts/slope/core.ts
1090
+ var slopeCore = {
1091
+ type: "slope",
1092
+ sizing: SLOPE_SIZING,
1093
+ title: "Slope",
1094
+ summary: "Two-point slope lines with collision-spread end labels and highlight emphasis. Each end label names its series and prints its value, so the line chart's seriesLabels and valueLabels are refused; labels.series sets the parts",
1095
+ layout: (data, options) => layoutSlope(prepareFractionData(data), options),
1096
+ categoryLabels: calendarCategories,
1097
+ prepare: prepareFractionData,
1098
+ defaults: {},
1099
+ annotationKinds: ["cagr", "diff", "delta", "abs", "note", "callout", "valueLine"],
1100
+ lint: (data) => Array.isArray(data?.categories) && data.categories.length > 2 ? [
1101
+ {
1102
+ code: "slope-too-many-points",
1103
+ severity: "error",
1104
+ message: `slope requires exactly 2 categories, got ${data.categories.length} \u2014 layout uses first and last only`,
1105
+ suggest: "use chart type 'line' for more than two time points"
1106
+ }
1107
+ ] : []
1108
+ };
1109
+
1110
+ export {
1111
+ slopeCore
1112
+ };