@tabler/charts 0.2.0 → 0.4.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 (420) hide show
  1. package/README.md +165 -17
  2. package/dist/{annotations-DdRdeBUB.cjs → annotations--m-HzMBM.cjs} +87 -11
  3. package/dist/annotations--m-HzMBM.cjs.map +1 -0
  4. package/dist/{annotations-B02GR_KU.d.ts → annotations-CCDUC1lW.d.ts} +16 -30
  5. package/dist/{annotations-CHafaGd4.d.cts → annotations-CqZM1z9R.d.cts} +16 -30
  6. package/dist/{annotations-D0YQ0IoA.js → annotations-DGITy6th.js} +87 -11
  7. package/dist/annotations-DGITy6th.js.map +1 -0
  8. package/dist/annotations.cjs +2 -2
  9. package/dist/annotations.d.cts +1 -1
  10. package/dist/annotations.d.ts +1 -1
  11. package/dist/annotations.js +2 -2
  12. package/dist/{area-0-L1bG9B.js → area-BN0uE9R0.js} +4 -3
  13. package/dist/area-BN0uE9R0.js.map +1 -0
  14. package/dist/{area-CJX9219z.d.cts → area-D6LNLk3r.d.cts} +2 -2
  15. package/dist/{area-d11XePuw.d.ts → area-DEFL-Yun.d.ts} +2 -2
  16. package/dist/{area-4eRs3c0K.cjs → area-D_N8b4Ng.cjs} +4 -3
  17. package/dist/area-D_N8b4Ng.cjs.map +1 -0
  18. package/dist/area.cjs +1 -1
  19. package/dist/area.d.cts +1 -1
  20. package/dist/area.d.ts +1 -1
  21. package/dist/area.js +1 -1
  22. package/dist/axis-BzBkkC5X.cjs +305 -0
  23. package/dist/axis-BzBkkC5X.cjs.map +1 -0
  24. package/dist/axis-C5obgdJt.js +240 -0
  25. package/dist/axis-C5obgdJt.js.map +1 -0
  26. package/dist/{bar-Da6dE_nI.cjs → bar-BrmfXugT.cjs} +77 -58
  27. package/dist/bar-BrmfXugT.cjs.map +1 -0
  28. package/dist/{bar-XwzM6Pb0.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
  29. package/dist/{bar-BDLR4p9c.d.cts → bar-CEt8YRxf.d.cts} +2 -2
  30. package/dist/{bar-B5n2oq9-.js → bar-CgpC2EpX.js} +2 -2
  31. package/dist/{bar-B5n2oq9-.js.map → bar-CgpC2EpX.js.map} +1 -1
  32. package/dist/{bar-BNZ3GhIw.js → bar-D_KKd2fL.js} +75 -56
  33. package/dist/bar-D_KKd2fL.js.map +1 -0
  34. package/dist/{bar-LYIF8MEz.cjs → bar-wVykm1us.cjs} +2 -2
  35. package/dist/{bar-LYIF8MEz.cjs.map → bar-wVykm1us.cjs.map} +1 -1
  36. package/dist/bar.cjs +1 -1
  37. package/dist/bar.d.cts +1 -1
  38. package/dist/bar.d.ts +1 -1
  39. package/dist/bar.js +1 -1
  40. package/dist/calendar-B7843sQu.d.cts +106 -0
  41. package/dist/calendar-BG_q_NC_.cjs +507 -0
  42. package/dist/calendar-BG_q_NC_.cjs.map +1 -0
  43. package/dist/calendar-CF3gfDQk.js +502 -0
  44. package/dist/calendar-CF3gfDQk.js.map +1 -0
  45. package/dist/calendar-D10_ki1S.d.ts +106 -0
  46. package/dist/calendar.cjs +3 -0
  47. package/dist/calendar.d.cts +3 -0
  48. package/dist/calendar.d.ts +3 -0
  49. package/dist/calendar.js +1 -0
  50. package/dist/{candlestick-BHQkQfxH.js → candlestick-B1onjo1o.js} +17 -14
  51. package/dist/candlestick-B1onjo1o.js.map +1 -0
  52. package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
  53. package/dist/{candlestick-CYCQXgky.cjs → candlestick-BwrFKak_.cjs} +17 -14
  54. package/dist/candlestick-BwrFKak_.cjs.map +1 -0
  55. package/dist/{candlestick-D0xKkdqd.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
  56. package/dist/candlestick.cjs +3 -3
  57. package/dist/candlestick.d.cts +1 -1
  58. package/dist/candlestick.d.ts +1 -1
  59. package/dist/candlestick.js +3 -3
  60. package/dist/{cartesian-DV02PsBe.cjs → cartesian-B9CrasFJ.cjs} +190 -310
  61. package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
  62. package/dist/{cartesian-CI2x6N7N.js → cartesian-COglz544.js} +161 -251
  63. package/dist/cartesian-COglz544.js.map +1 -0
  64. package/dist/{chart-DWn9v6qw.js → chart-B97FBRCd.js} +114 -72
  65. package/dist/chart-B97FBRCd.js.map +1 -0
  66. package/dist/{chart-QilhWP8Z.d.ts → chart-CE9EVbfV.d.ts} +427 -112
  67. package/dist/{chart-kqFMEwDo.d.cts → chart-Dz4geQZy.d.cts} +427 -112
  68. package/dist/{chart-e2VqomCI.cjs → chart-GUmmjJ7S.cjs} +132 -78
  69. package/dist/chart-GUmmjJ7S.cjs.map +1 -0
  70. package/dist/{core-BKRQvPAT.js → core-7fgM3su0.js} +188 -73
  71. package/dist/core-7fgM3su0.js.map +1 -0
  72. package/dist/{core-DRUCk67j.d.ts → core-BUQzLsRJ.d.ts} +26 -10
  73. package/dist/{core-DIOC61up.cjs → core-BZTrsPxc.cjs} +200 -73
  74. package/dist/core-BZTrsPxc.cjs.map +1 -0
  75. package/dist/{core-PAX5ogLk.d.cts → core-Ck5uHcW8.d.cts} +45 -24
  76. package/dist/core.cjs +45 -31
  77. package/dist/core.d.cts +23 -18
  78. package/dist/core.d.ts +23 -18
  79. package/dist/core.js +28 -23
  80. package/dist/{dates-DurEr9WT.cjs → dates-0YNY49KQ.cjs} +2 -2
  81. package/dist/{dates-DurEr9WT.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
  82. package/dist/{dates-C2RzY3rE.js → dates-CKDRgpin.js} +2 -2
  83. package/dist/{dates-C2RzY3rE.js.map → dates-CKDRgpin.js.map} +1 -1
  84. package/dist/decimate.cjs +1 -1
  85. package/dist/decimate.js +1 -1
  86. package/dist/{dom-D_g13XWY.cjs → dom-C33zvtPo.cjs} +3 -7
  87. package/dist/dom-C33zvtPo.cjs.map +1 -0
  88. package/dist/{dom-CuceR8gt.js → dom-CTse6Rvd.js} +3 -7
  89. package/dist/dom-CTse6Rvd.js.map +1 -0
  90. package/dist/end-labels-B3oRvjxw.js +114 -0
  91. package/dist/end-labels-B3oRvjxw.js.map +1 -0
  92. package/dist/end-labels-CS-fnpp-.cjs +119 -0
  93. package/dist/end-labels-CS-fnpp-.cjs.map +1 -0
  94. package/dist/end-labels.cjs +11 -0
  95. package/dist/end-labels.cjs.map +1 -0
  96. package/dist/end-labels.d.cts +6 -0
  97. package/dist/end-labels.d.ts +6 -0
  98. package/dist/end-labels.js +11 -0
  99. package/dist/end-labels.js.map +1 -0
  100. package/dist/{export-chart-83UYH48t.js → export-chart-BOH_nfcH.js} +92 -15
  101. package/dist/export-chart-BOH_nfcH.js.map +1 -0
  102. package/dist/{export-chart-mYgEfK-L.cjs → export-chart-Be4T9J3m.cjs} +97 -14
  103. package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
  104. package/dist/export.cjs +5 -3
  105. package/dist/export.cjs.map +1 -1
  106. package/dist/export.d.cts +4 -3
  107. package/dist/export.d.ts +4 -3
  108. package/dist/export.js +5 -4
  109. package/dist/export.js.map +1 -1
  110. package/dist/{fade-GGxcBdss.js → fade-CDrQjnDz.js} +56 -78
  111. package/dist/fade-CDrQjnDz.js.map +1 -0
  112. package/dist/{fade-DVTkhrFU.cjs → fade-CRqcKMWY.cjs} +56 -78
  113. package/dist/fade-CRqcKMWY.cjs.map +1 -0
  114. package/dist/{features-BMxkqCyS.js → features-B55rwpQC.js} +4 -2
  115. package/dist/features-B55rwpQC.js.map +1 -0
  116. package/dist/{features-DCXEvoya.cjs → features-DEDP5CEQ.cjs} +9 -1
  117. package/dist/features-DEDP5CEQ.cjs.map +1 -0
  118. package/dist/fit-BPyPRnsK.js +16 -0
  119. package/dist/fit-BPyPRnsK.js.map +1 -0
  120. package/dist/fit-D4MIIQQz.cjs +21 -0
  121. package/dist/fit-D4MIIQQz.cjs.map +1 -0
  122. package/dist/funnel-B9ridzNx.d.cts +50 -0
  123. package/dist/funnel-CFEEulw_.cjs +244 -0
  124. package/dist/funnel-CFEEulw_.cjs.map +1 -0
  125. package/dist/funnel-CYCv8cq2.js +239 -0
  126. package/dist/funnel-CYCv8cq2.js.map +1 -0
  127. package/dist/funnel-FogM8flk.d.ts +50 -0
  128. package/dist/funnel.cjs +3 -0
  129. package/dist/funnel.d.cts +3 -0
  130. package/dist/funnel.d.ts +3 -0
  131. package/dist/funnel.js +1 -0
  132. package/dist/{gauge-DXkjXNCD.cjs → gauge-6HfDcLMJ.cjs} +28 -28
  133. package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
  134. package/dist/{gauge-BSist7My.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
  135. package/dist/{gauge-0VJuAHWF.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
  136. package/dist/{gauge-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
  137. package/dist/gauge-DiTk5aWO.js.map +1 -0
  138. package/dist/gauge.cjs +1 -1
  139. package/dist/gauge.d.cts +1 -1
  140. package/dist/gauge.d.ts +1 -1
  141. package/dist/gauge.js +1 -1
  142. package/dist/heat-Bsqq4zw9.js +38 -0
  143. package/dist/heat-Bsqq4zw9.js.map +1 -0
  144. package/dist/heat-DYsivvDq.cjs +49 -0
  145. package/dist/heat-DYsivvDq.cjs.map +1 -0
  146. package/dist/{heatmap-CXhlrLTl.cjs → heatmap-Dyzrd4Fd.cjs} +39 -37
  147. package/dist/heatmap-Dyzrd4Fd.cjs.map +1 -0
  148. package/dist/{heatmap-19BGJTKF.js → heatmap-J7fxG7MM.js} +35 -33
  149. package/dist/heatmap-J7fxG7MM.js.map +1 -0
  150. package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
  151. package/dist/{heatmap-59lmClj9.d.ts → heatmap-mFCnP6aB.d.ts} +2 -2
  152. package/dist/heatmap.cjs +1 -1
  153. package/dist/heatmap.d.cts +1 -1
  154. package/dist/heatmap.d.ts +1 -1
  155. package/dist/heatmap.js +1 -1
  156. package/dist/{hydrate-OA6R2_Pn.js → hydrate-BB3MlR36.js} +2 -2
  157. package/dist/{hydrate-OA6R2_Pn.js.map → hydrate-BB3MlR36.js.map} +1 -1
  158. package/dist/{hydrate-CmN1k8Mo.cjs → hydrate-m0I5m6ue.cjs} +2 -2
  159. package/dist/{hydrate-CmN1k8Mo.cjs.map → hydrate-m0I5m6ue.cjs.map} +1 -1
  160. package/dist/hydrate.cjs +2 -2
  161. package/dist/hydrate.js +2 -2
  162. package/dist/index.cjs +69 -45
  163. package/dist/index.cjs.map +1 -1
  164. package/dist/index.d.cts +24 -19
  165. package/dist/index.d.ts +24 -19
  166. package/dist/index.js +51 -37
  167. package/dist/index.js.map +1 -1
  168. package/dist/interaction-DXYSjgnP.cjs +32 -0
  169. package/dist/interaction-DXYSjgnP.cjs.map +1 -0
  170. package/dist/interaction-En1KlwFO.js +21 -0
  171. package/dist/interaction-En1KlwFO.js.map +1 -0
  172. package/dist/layout-CYerDebD.d.cts +29 -0
  173. package/dist/layout-CYerDebD.d.ts +29 -0
  174. package/dist/{layout-JY2aR-yE.cjs → layout-Cfg9x1k2.cjs} +32 -1
  175. package/dist/layout-Cfg9x1k2.cjs.map +1 -0
  176. package/dist/{layout-DmrrLjwN.js → layout-DqAte3H8.js} +27 -2
  177. package/dist/layout-DqAte3H8.js.map +1 -0
  178. package/dist/{line-DO66LtwH.js → line-CXH0L10d.js} +84 -37
  179. package/dist/line-CXH0L10d.js.map +1 -0
  180. package/dist/{line-_rNdeKmS.d.cts → line-Cu9ctpbv.d.cts} +9 -3
  181. package/dist/{line-Dbt6KFRK.cjs → line-DHbYCQy4.cjs} +84 -37
  182. package/dist/line-DHbYCQy4.cjs.map +1 -0
  183. package/dist/{line-DtSh7HQU.d.ts → line-TkzA7wMK.d.ts} +8 -1
  184. package/dist/line.cjs +3 -3
  185. package/dist/line.d.cts +1 -1
  186. package/dist/line.d.ts +1 -1
  187. package/dist/line.js +3 -3
  188. package/dist/log.cjs +1 -1
  189. package/dist/log.js +1 -1
  190. package/dist/map-BirylCmT.d.cts +156 -0
  191. package/dist/map-CYp6x-uS.js +784 -0
  192. package/dist/map-CYp6x-uS.js.map +1 -0
  193. package/dist/map-ChwSgooH.cjs +795 -0
  194. package/dist/map-ChwSgooH.cjs.map +1 -0
  195. package/dist/map-DNqog2Xs.d.ts +156 -0
  196. package/dist/map.cjs +4 -0
  197. package/dist/map.d.cts +3 -0
  198. package/dist/map.d.ts +3 -0
  199. package/dist/map.js +1 -0
  200. package/dist/maps/world.cjs +875 -0
  201. package/dist/maps/world.cjs.map +1 -0
  202. package/dist/maps/world.d.cts +2 -0
  203. package/dist/maps/world.d.ts +2 -0
  204. package/dist/maps/world.js +874 -0
  205. package/dist/maps/world.js.map +1 -0
  206. package/dist/{morph-9_LJL0ra.cjs → morph-3I1Nf_tR.cjs} +2 -2
  207. package/dist/{morph-9_LJL0ra.cjs.map → morph-3I1Nf_tR.cjs.map} +1 -1
  208. package/dist/{morph-DnRxuwR-.js → morph-GfBab-b3.js} +2 -2
  209. package/dist/{morph-DnRxuwR-.js.map → morph-GfBab-b3.js.map} +1 -1
  210. package/dist/morph.cjs +2 -2
  211. package/dist/morph.js +2 -2
  212. package/dist/others-CuNdpvjd.d.cts +31 -0
  213. package/dist/{others-J7NCAMA0.js → others-DBIGE6jr.js} +11 -3
  214. package/dist/others-DBIGE6jr.js.map +1 -0
  215. package/dist/others-DBO4Kjwl.d.ts +29 -0
  216. package/dist/{others-DWdK7vKp.cjs → others-WfjCsjqT.cjs} +14 -6
  217. package/dist/others-WfjCsjqT.cjs.map +1 -0
  218. package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
  219. package/dist/parliament-BKN6ikBJ.js.map +1 -0
  220. package/dist/{parliament-CLCI7tUO.d.ts → parliament-CHdf13XU.d.ts} +2 -2
  221. package/dist/{parliament-CgsVnWEe.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
  222. package/dist/{parliament-x5hcFaQ3.cjs → parliament-DhxAaIZ3.cjs} +30 -29
  223. package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
  224. package/dist/parliament.cjs +1 -1
  225. package/dist/parliament.d.cts +1 -1
  226. package/dist/parliament.d.ts +1 -1
  227. package/dist/parliament.js +1 -1
  228. package/dist/{patterns-D3-wQagb.cjs → patterns-BPN1c9qe.cjs} +2 -2
  229. package/dist/{patterns-D3-wQagb.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
  230. package/dist/{patterns-CufKZYhm.js → patterns-CVrLrJXg.js} +2 -2
  231. package/dist/{patterns-CufKZYhm.js.map → patterns-CVrLrJXg.js.map} +1 -1
  232. package/dist/patterns.cjs +2 -2
  233. package/dist/patterns.d.cts +1 -1
  234. package/dist/patterns.d.ts +1 -1
  235. package/dist/patterns.js +2 -2
  236. package/dist/{percentage-bar-ybNS3goo.cjs → percentage-bar-BChkTRoz.cjs} +37 -35
  237. package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
  238. package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-CSAbzDOn.d.ts} +11 -15
  239. package/dist/{percentage-bar-B6tNOqNn.js → percentage-bar-CaInxrL8.js} +37 -35
  240. package/dist/percentage-bar-CaInxrL8.js.map +1 -0
  241. package/dist/{percentage-bar-tepMr7Hd.d.cts → percentage-bar-UZHCRvlK.d.cts} +11 -15
  242. package/dist/percentage-bar.cjs +1 -1
  243. package/dist/percentage-bar.d.cts +1 -1
  244. package/dist/percentage-bar.d.ts +1 -1
  245. package/dist/percentage-bar.js +1 -1
  246. package/dist/{pie-BXg2gNpb.d.cts → pie-AFedsDcF.d.cts} +17 -14
  247. package/dist/{pie-CVsc-6qD.js → pie-Ch6Bx0ih.js} +68 -52
  248. package/dist/pie-Ch6Bx0ih.js.map +1 -0
  249. package/dist/{pie-BpjvSPnz.cjs → pie-Cll1OrVZ.cjs} +68 -52
  250. package/dist/pie-Cll1OrVZ.cjs.map +1 -0
  251. package/dist/{pie-CFptILSm.d.ts → pie-Cn2H3pz8.d.ts} +17 -14
  252. package/dist/pie.cjs +1 -1
  253. package/dist/pie.d.cts +1 -1
  254. package/dist/pie.d.ts +1 -1
  255. package/dist/pie.js +1 -1
  256. package/dist/{point-shapes--_gmdTyK.cjs → point-shapes-BRawRM78.cjs} +23 -22
  257. package/dist/point-shapes-BRawRM78.cjs.map +1 -0
  258. package/dist/{point-shapes-DD2Ektzm.js → point-shapes-DI6GhcI7.js} +18 -23
  259. package/dist/point-shapes-DI6GhcI7.js.map +1 -0
  260. package/dist/point-shapes.cjs +6 -4
  261. package/dist/point-shapes.cjs.map +1 -1
  262. package/dist/point-shapes.d.cts +2 -2
  263. package/dist/point-shapes.d.ts +2 -2
  264. package/dist/point-shapes.js +7 -5
  265. package/dist/point-shapes.js.map +1 -1
  266. package/dist/{radar-BR-mumDd.js → radar-Bg-IiIWB.js} +21 -22
  267. package/dist/radar-Bg-IiIWB.js.map +1 -0
  268. package/dist/{radar-BC9Skgpj.d.ts → radar-DEer2jjd.d.ts} +2 -2
  269. package/dist/{radar-D1-lItDy.d.cts → radar-DxmjXhMc.d.cts} +2 -2
  270. package/dist/{radar-HPDrIdzc.cjs → radar-wDyX17S3.cjs} +22 -23
  271. package/dist/radar-wDyX17S3.cjs.map +1 -0
  272. package/dist/radar.cjs +1 -1
  273. package/dist/radar.d.cts +1 -1
  274. package/dist/radar.d.ts +1 -1
  275. package/dist/radar.js +1 -1
  276. package/dist/range-bar-BnKjJP89.cjs +348 -0
  277. package/dist/range-bar-BnKjJP89.cjs.map +1 -0
  278. package/dist/range-bar-C4cRaaQE.d.ts +123 -0
  279. package/dist/range-bar-D32dIQOY.d.cts +123 -0
  280. package/dist/range-bar-Dx6ce0J1.js +343 -0
  281. package/dist/range-bar-Dx6ce0J1.js.map +1 -0
  282. package/dist/range-bar.cjs +3 -0
  283. package/dist/range-bar.d.cts +3 -0
  284. package/dist/range-bar.d.ts +3 -0
  285. package/dist/range-bar.js +1 -0
  286. package/dist/{rect-DSVmUZrD.js → rect-CZTNvMlf.js} +2 -2
  287. package/dist/{rect-DSVmUZrD.js.map → rect-CZTNvMlf.js.map} +1 -1
  288. package/dist/{rect-D6VhynBM.cjs → rect-DPr9QRxl.cjs} +2 -2
  289. package/dist/{rect-D6VhynBM.cjs.map → rect-DPr9QRxl.cjs.map} +1 -1
  290. package/dist/{sankey-fCoo1cpz.cjs → sankey-0CSp_Er9.cjs} +72 -71
  291. package/dist/sankey-0CSp_Er9.cjs.map +1 -0
  292. package/dist/{sankey-Dk7jUt8x.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
  293. package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
  294. package/dist/sankey-Dp4CuLVe.js.map +1 -0
  295. package/dist/{sankey-D_v7KxnJ.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
  296. package/dist/sankey.cjs +1 -1
  297. package/dist/sankey.d.cts +1 -1
  298. package/dist/sankey.d.ts +1 -1
  299. package/dist/sankey.js +1 -1
  300. package/dist/{scatter-C0TWjFpW.js → scatter-0Z7K_YUz.js} +94 -46
  301. package/dist/scatter-0Z7K_YUz.js.map +1 -0
  302. package/dist/{scatter-CXEsioOJ.d.ts → scatter-BAL5K9_4.d.ts} +28 -9
  303. package/dist/{scatter-DZeEIfyo.d.cts → scatter-BUGbnRzM.d.cts} +28 -9
  304. package/dist/{scatter-DVqB_fP9.cjs → scatter-CZ8do3Up.cjs} +95 -47
  305. package/dist/scatter-CZ8do3Up.cjs.map +1 -0
  306. package/dist/scatter.cjs +1 -1
  307. package/dist/scatter.d.cts +2 -2
  308. package/dist/scatter.d.ts +2 -2
  309. package/dist/scatter.js +1 -1
  310. package/dist/slice-labels-1TBq7p3q.d.cts +28 -0
  311. package/dist/slice-labels-C9ucsBVW.js +88 -0
  312. package/dist/slice-labels-C9ucsBVW.js.map +1 -0
  313. package/dist/slice-labels-CbFiy46l.cjs +93 -0
  314. package/dist/slice-labels-CbFiy46l.cjs.map +1 -0
  315. package/dist/slice-labels-Cm5CyV7B.d.ts +28 -0
  316. package/dist/slice-labels.cjs +11 -0
  317. package/dist/slice-labels.cjs.map +1 -0
  318. package/dist/slice-labels.d.cts +6 -0
  319. package/dist/slice-labels.d.ts +6 -0
  320. package/dist/slice-labels.js +11 -0
  321. package/dist/slice-labels.js.map +1 -0
  322. package/dist/{sparkline-cbvRkWqS.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
  323. package/dist/{sparkline-B39NA0Mi.cjs → sparkline-DjR-V6BI.cjs} +13 -15
  324. package/dist/sparkline-DjR-V6BI.cjs.map +1 -0
  325. package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
  326. package/dist/{sparkline-XO_TqCNP.js → sparkline-_dxwtdli.js} +13 -15
  327. package/dist/sparkline-_dxwtdli.js.map +1 -0
  328. package/dist/sparkline.cjs +1 -1
  329. package/dist/sparkline.d.cts +1 -1
  330. package/dist/sparkline.d.ts +1 -1
  331. package/dist/sparkline.js +1 -1
  332. package/dist/{stack-Dagxq7l2.d.cts → stack-CcmyALx0.d.cts} +1 -1
  333. package/dist/{stack-2H2Gfs1Q.js → stack-CyVlS7Fr.js} +2 -2
  334. package/dist/{stack-2H2Gfs1Q.js.map → stack-CyVlS7Fr.js.map} +1 -1
  335. package/dist/{stack-BgPzoQmv.cjs → stack-DBhmYNat.cjs} +2 -2
  336. package/dist/{stack-BgPzoQmv.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
  337. package/dist/style.css +1 -1
  338. package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-CVKjQKSS.cjs} +4 -3
  339. package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
  340. package/dist/{time-axis-FLONo54E.js → time-axis-CkmbAw4Z.js} +3 -2
  341. package/dist/{time-axis-FLONo54E.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
  342. package/dist/time.cjs +3 -3
  343. package/dist/time.js +3 -3
  344. package/dist/{treemap-BAkhmVQc.d.cts → treemap-C2maqerU.d.cts} +37 -5
  345. package/dist/{treemap-BNpxFBao.d.ts → treemap-D_zbubo3.d.ts} +37 -5
  346. package/dist/{treemap-BWpEUlDh.cjs → treemap-PulGXZv0.cjs} +58 -33
  347. package/dist/treemap-PulGXZv0.cjs.map +1 -0
  348. package/dist/{treemap-CQdavQ9u.js → treemap-lbYxb-7h.js} +57 -32
  349. package/dist/treemap-lbYxb-7h.js.map +1 -0
  350. package/dist/treemap.cjs +1 -1
  351. package/dist/treemap.d.cts +1 -1
  352. package/dist/treemap.d.ts +1 -1
  353. package/dist/treemap.js +1 -1
  354. package/dist/{value-labels-BBuSi4i0.js → value-labels-B0VeheyE.js} +29 -8
  355. package/dist/value-labels-B0VeheyE.js.map +1 -0
  356. package/dist/{value-labels-BV9keAuL.cjs → value-labels-Dcyk3GIY.cjs} +29 -8
  357. package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
  358. package/dist/value-labels.cjs +2 -2
  359. package/dist/value-labels.d.cts +1 -1
  360. package/dist/value-labels.d.ts +1 -1
  361. package/dist/value-labels.js +2 -2
  362. package/dist/zoom.cjs +810 -0
  363. package/dist/zoom.cjs.map +1 -0
  364. package/dist/zoom.d.cts +34 -0
  365. package/dist/zoom.d.ts +34 -0
  366. package/dist/zoom.js +806 -0
  367. package/dist/zoom.js.map +1 -0
  368. package/package.json +120 -235
  369. package/dist/annotations-D0YQ0IoA.js.map +0 -1
  370. package/dist/annotations-DdRdeBUB.cjs.map +0 -1
  371. package/dist/area-0-L1bG9B.js.map +0 -1
  372. package/dist/area-4eRs3c0K.cjs.map +0 -1
  373. package/dist/bar-BNZ3GhIw.js.map +0 -1
  374. package/dist/bar-Da6dE_nI.cjs.map +0 -1
  375. package/dist/candlestick-BHQkQfxH.js.map +0 -1
  376. package/dist/candlestick-CYCQXgky.cjs.map +0 -1
  377. package/dist/cartesian-CI2x6N7N.js.map +0 -1
  378. package/dist/cartesian-DV02PsBe.cjs.map +0 -1
  379. package/dist/chart-DWn9v6qw.js.map +0 -1
  380. package/dist/chart-e2VqomCI.cjs.map +0 -1
  381. package/dist/core-BKRQvPAT.js.map +0 -1
  382. package/dist/core-DIOC61up.cjs.map +0 -1
  383. package/dist/dom-CuceR8gt.js.map +0 -1
  384. package/dist/dom-D_g13XWY.cjs.map +0 -1
  385. package/dist/export-chart-83UYH48t.js.map +0 -1
  386. package/dist/export-chart-mYgEfK-L.cjs.map +0 -1
  387. package/dist/fade-DVTkhrFU.cjs.map +0 -1
  388. package/dist/fade-GGxcBdss.js.map +0 -1
  389. package/dist/features-BMxkqCyS.js.map +0 -1
  390. package/dist/features-DCXEvoya.cjs.map +0 -1
  391. package/dist/gauge-DXkjXNCD.cjs.map +0 -1
  392. package/dist/gauge-ts0kqN1-.js.map +0 -1
  393. package/dist/heatmap-19BGJTKF.js.map +0 -1
  394. package/dist/heatmap-CXhlrLTl.cjs.map +0 -1
  395. package/dist/layout-DmrrLjwN.js.map +0 -1
  396. package/dist/layout-JY2aR-yE.cjs.map +0 -1
  397. package/dist/line-DO66LtwH.js.map +0 -1
  398. package/dist/line-Dbt6KFRK.cjs.map +0 -1
  399. package/dist/others-DWdK7vKp.cjs.map +0 -1
  400. package/dist/others-J7NCAMA0.js.map +0 -1
  401. package/dist/parliament-Cru4IcuM.js.map +0 -1
  402. package/dist/parliament-x5hcFaQ3.cjs.map +0 -1
  403. package/dist/percentage-bar-B6tNOqNn.js.map +0 -1
  404. package/dist/percentage-bar-ybNS3goo.cjs.map +0 -1
  405. package/dist/pie-BpjvSPnz.cjs.map +0 -1
  406. package/dist/pie-CVsc-6qD.js.map +0 -1
  407. package/dist/point-shapes--_gmdTyK.cjs.map +0 -1
  408. package/dist/point-shapes-DD2Ektzm.js.map +0 -1
  409. package/dist/radar-BR-mumDd.js.map +0 -1
  410. package/dist/radar-HPDrIdzc.cjs.map +0 -1
  411. package/dist/sankey-D6JeZfK5.js.map +0 -1
  412. package/dist/sankey-fCoo1cpz.cjs.map +0 -1
  413. package/dist/scatter-C0TWjFpW.js.map +0 -1
  414. package/dist/scatter-DVqB_fP9.cjs.map +0 -1
  415. package/dist/sparkline-B39NA0Mi.cjs.map +0 -1
  416. package/dist/sparkline-XO_TqCNP.js.map +0 -1
  417. package/dist/treemap-BWpEUlDh.cjs.map +0 -1
  418. package/dist/treemap-CQdavQ9u.js.map +0 -1
  419. package/dist/value-labels-BBuSi4i0.js.map +0 -1
  420. package/dist/value-labels-BV9keAuL.cjs.map +0 -1
@@ -1,11 +1,13 @@
1
- import { a as InsetsInput, n as annotationLayers, r as annotationValues, s as Rect, t as Annotation } from "./annotations-CHafaGd4.cjs";
1
+ import { i as Rect, n as InsetsInput } from "./layout-CYerDebD.cjs";
2
2
  import { a as ClassValue, i as ChildInput, l as VNode, n as Attrs, s as Props } from "./vnode-Du2cC8Fm.cjs";
3
+ import { n as annotationLayers, r as annotationValues, t as Annotation } from "./annotations-CqZM1z9R.cjs";
3
4
  import { a as timePointScale, c as NumberFormat, i as time, s as Locale } from "./time-B4oxWHQI.cjs";
4
5
  import { n as BandScale, t as BandKey } from "./band-CNKvdnTC.cjs";
5
6
  import { n as log, r as LinearScale } from "./log-CI41TmcU.cjs";
7
+ import { a as linePath, i as areaPath, r as Point } from "./path-YeUiOfG8.cjs";
8
+ import { n as sliceLabels } from "./slice-labels-1TBq7p3q.cjs";
6
9
  import { t as hydrate } from "./hydrate-BtAZf_5K.cjs";
7
10
  import { t as morph } from "./morph-Dh7gJkV4.cjs";
8
- import { a as linePath, i as areaPath, r as Point } from "./path-YeUiOfG8.cjs";
9
11
  /** One series' value at a hovered position. */
10
12
  interface HitItem {
11
13
  /** Series name. */
@@ -39,37 +41,63 @@ interface Hit {
39
41
  axis?: "x" | "y";
40
42
  /** Center of the category along y, when categories run along y. */
41
43
  y?: number;
42
- /** The category's band in chart pixels, for band scales (bars). */
43
- band?: {
44
- x: number;
45
- y: number;
46
- width: number;
47
- height: number;
48
- };
49
44
  /** Every series' value at this category. */
50
45
  items: HitItem[];
51
46
  /** Series of the mark directly under the pointer (e.g. a bar), if any. */
52
47
  seriesIndex?: number;
48
+ /** The shape that marks the hit; a crosshair when left out. */
49
+ highlight?: Highlight;
53
50
  /**
54
- * The crosshair segment, when it is not vertical across the plot (a radar
55
- * spoke). Tooltips from the keyboard then anchor on the value itself.
51
+ * The value under the pointer on the value axis (cartesian charts, for a
52
+ * hit from the pointer): what `crosshair: { value: true }` shows.
56
53
  */
57
- guide?: {
58
- x1: number;
59
- y1: number;
60
- x2: number;
61
- y2: number;
62
- };
63
- /**
64
- * A shape to highlight instead of a crosshair or band (e.g. a halo around a
65
- * pie slice): path data `d`, drawn translated by `x` / `y`.
66
- */
67
- mark?: {
68
- d: string;
69
- x: number;
70
- y: number;
71
- };
54
+ cursor?: HitCursor;
55
+ }
56
+ /** The value under the pointer, read off the value axis. */
57
+ interface HitCursor {
58
+ value: number;
59
+ /** The value formatted like the axis, with the precision of a pixel. */
60
+ text: string;
61
+ /** Where the pointer is along the value axis, in chart pixels. */
62
+ position: number;
63
+ /** The side of the plot the value axis is on. */
64
+ side: "left" | "right" | "bottom";
65
+ /** The axis is hidden (`y.show: false`): the value is written inside the plot. */
66
+ inside?: boolean;
72
67
  }
68
+ /**
69
+ * The one shape drawn to mark a hit, in chart pixels:
70
+ *
71
+ * - `crosshair`: a vertical line through the category across the plot, and
72
+ * a dot on every value (point charts);
73
+ * - `band`: the category's band behind the series (bars);
74
+ * - `spoke`: a line from `x1, y1` to `x2, y2` (a radar spoke), and a dot on
75
+ * every value; keyboard tooltips anchor on the value itself;
76
+ * - `halo`: path data `d` drawn translated by `x` / `y` in the color of the
77
+ * hit's series (a ring around a pie slice); `under` draws it below the
78
+ * chart instead of above, so it never covers the labels.
79
+ */
80
+ type Highlight = {
81
+ kind: "crosshair";
82
+ } | {
83
+ kind: "band";
84
+ x: number;
85
+ y: number;
86
+ width: number;
87
+ height: number;
88
+ } | {
89
+ kind: "spoke";
90
+ x1: number;
91
+ y1: number;
92
+ x2: number;
93
+ y2: number;
94
+ } | {
95
+ kind: "halo";
96
+ d: string;
97
+ x?: number;
98
+ y?: number;
99
+ under?: boolean;
100
+ };
73
101
  /** Maps a point in chart pixels to what lies there. */
74
102
  type HitTester = (x: number, y: number) => Hit | null;
75
103
  /** How a rendered chart answers pointer and keyboard interaction. */
@@ -80,6 +108,11 @@ interface Interaction {
80
108
  hitIndex(index: number, seriesIndex?: number): Hit | null;
81
109
  /** Number of categories. */
82
110
  count: number;
111
+ /**
112
+ * Categories fill a grid column by column, this many to a column (the days
113
+ * of a calendar in weeks): left and right move by a column, up and down by one.
114
+ */
115
+ rows?: number;
83
116
  /** Categories run from the right: the left arrow key goes to the next one. */
84
117
  reversed?: boolean;
85
118
  }
@@ -133,11 +166,14 @@ interface AxisOptions {
133
166
  tickPadding?: number;
134
167
  /** Draw the axis line along the plot edge. Defaults to `false`. */
135
168
  line?: boolean;
169
+ /** Turn the labels of an axis below the plot 90°, reading bottom to top. */
170
+ rotate?: boolean;
136
171
  }
137
172
  /** Pixels an axis occupies perpendicular to the plot edge (for margins). */
138
173
  declare function axisSize(position: AxisPosition, ticks: readonly Tick[], fontSize: number, options?: {
139
174
  tickSize?: number;
140
175
  tickPadding?: number;
176
+ rotate?: boolean;
141
177
  }): number;
142
178
  /**
143
179
  * Render an axis as `<g class="tc-axis tc-axis-{x|y} tc-axis-{position}">`
@@ -145,6 +181,70 @@ declare function axisSize(position: AxisPosition, ticks: readonly Tick[], fontSi
145
181
  * transition when the scale changes.
146
182
  */
147
183
  declare function axis(options: AxisOptions): VNode;
184
+ /**
185
+ * The categories a chart shows, as indexes into its labels, both included.
186
+ * A side left out runs to that end of the data.
187
+ */
188
+ interface ViewWindow {
189
+ /** Index of the first category shown. Defaults to `0`. */
190
+ start?: number;
191
+ /** Index of the last category shown. Defaults to the last one. */
192
+ end?: number;
193
+ }
194
+ interface ZoomOptions {
195
+ /** Zoom with the wheel (and a pinch on a trackpad). Defaults to `true`. */
196
+ wheel?: boolean;
197
+ /** Show the zoom in, zoom out and reset buttons. Defaults to `true`. */
198
+ controls?: boolean;
199
+ /** The fewest categories a reader can zoom in to. Defaults to `2`. */
200
+ min?: number;
201
+ /** Names of the buttons, for a page in another language. */
202
+ labels?: {
203
+ in?: string;
204
+ out?: string;
205
+ reset?: string;
206
+ };
207
+ }
208
+ /** The options of a chart that can show a window of its categories. */
209
+ interface Zoomable {
210
+ /**
211
+ * Let the reader zoom along the categories: with the wheel, by dragging
212
+ * over a range, with a pinch, the buttons or the `+`, `-` and `0` keys;
213
+ * Shift with a drag, the wheel or an arrow key moves the range. The range
214
+ * shown lives in `view`. Needs `import '@tabler/charts/zoom'`.
215
+ */
216
+ zoom?: boolean | ZoomOptions;
217
+ /**
218
+ * The range of categories shown; the value axis follows the values in it.
219
+ * Set it to show a part of the data, read it from `chart.config.view`
220
+ * after a zoom. Needs `import '@tabler/charts/zoom'`.
221
+ */
222
+ view?: ViewWindow | undefined;
223
+ /**
224
+ * Make the chart a brush: it shows all its data with a range marked on
225
+ * it, which the reader moves, resizes by its ends or draws again, and
226
+ * which charts in the same `sync` group take as their `view` (matched by
227
+ * label). Zooming one of them moves the range too. The range lives in
228
+ * `selection`. `min` is the fewest categories it can cover (2 by
229
+ * default). The brush and the charts of its group add to their
230
+ * `padding` so that their plots start and end together; `align: false`
231
+ * leaves them as they are. Needs `import '@tabler/charts/zoom'`.
232
+ */
233
+ brush?: boolean | {
234
+ min?: number;
235
+ align?: boolean;
236
+ };
237
+ /** The range marked on a brush; everything when left out. */
238
+ selection?: ViewWindow | undefined;
239
+ }
240
+ /** The first and last index of a view over `count` categories, within the data. */
241
+ declare function viewRange(view: ViewWindow | undefined, count: number): [number, number];
242
+ /**
243
+ * The options of a chart with only the categories of its `view`: the chart
244
+ * type then draws them like any other data, so axes, stacks, tooltips and
245
+ * the table all follow the range shown.
246
+ */
247
+ declare function viewWindow<O extends object>(options: O): O;
148
248
  /** Category label on the x axis. */
149
249
  type Label = string | number | Date;
150
250
  /** One data series. `null` values are gaps. */
@@ -166,6 +266,12 @@ interface Series {
166
266
  * that could inject CSS are ignored, as for `color`.
167
267
  */
168
268
  dash?: number | string;
269
+ /**
270
+ * Dash the line only from this label on (a forecast, provisional figures):
271
+ * it stays solid up to the label and takes `dash` (`'5 4'` when left out)
272
+ * after it. Line and area charts.
273
+ */
274
+ dashFrom?: Label;
169
275
  /** Line width in pixels; overrides `--tc-stroke-width` via `--tc-series-width`. */
170
276
  width?: number;
171
277
  /**
@@ -174,10 +280,23 @@ interface Series {
174
280
  * (`@tabler/charts/line`, or `@tabler/charts`). Defaults to `'bar'`.
175
281
  */
176
282
  type?: "bar" | "line" | "area";
283
+ /**
284
+ * Value axis of the series: `'y2'` draws it against the second axis
285
+ * (options in `y2`), on the right of the plot (on the left in a
286
+ * right-to-left chart), and leaves it out of stacks. Line, area and
287
+ * vertical bar charts. Defaults to `'y'`.
288
+ */
289
+ axis?: "y" | "y2";
177
290
  /** Extra classes on the series group. */
178
291
  class?: ClassValue;
179
292
  /** Start hidden (toggle it back from the legend). */
180
293
  hidden?: boolean;
294
+ /**
295
+ * Write values on this series' marks, whatever the chart's `valueLabels`
296
+ * says: `true` labels it even when the chart option is off, `false` leaves
297
+ * it out. Needs `@tabler/charts/value-labels` on the core.
298
+ */
299
+ valueLabels?: boolean;
181
300
  }
182
301
  interface CartesianData {
183
302
  /** Categories along x. Defaults to `1…n` for the longest series. */
@@ -188,6 +307,11 @@ interface CartesianData {
188
307
  interface ValueAxisOptions {
189
308
  /** Render the axis labels. Defaults to `true`. */
190
309
  show?: boolean;
310
+ /**
311
+ * Title of the axis (e.g. a unit), beside its labels: turned 90° on the
312
+ * left of the plot, or on the right in a right-to-left chart.
313
+ */
314
+ title?: string;
191
315
  /** Render horizontal grid lines. Defaults to `true`. */
192
316
  grid?: boolean;
193
317
  /** Fixed lower bound; overrides data and `zero`. */
@@ -208,12 +332,20 @@ interface ValueAxisOptions {
208
332
  interface CategoryAxisOptions {
209
333
  /** Render the axis labels. Defaults to `true`. */
210
334
  show?: boolean;
335
+ /** Title of the axis, below its labels. */
336
+ title?: string;
211
337
  /** Render vertical grid lines. Defaults to `false`. */
212
338
  grid?: boolean;
213
339
  /** Draw the axis line along the bottom edge. Defaults to `false`. */
214
340
  line?: boolean;
215
341
  /** Format a label for display (axis ticks for categories, tooltips and the table). */
216
342
  format?: (label: Label, index: number) => string;
343
+ /**
344
+ * Turn the labels 90°, reading bottom to top, so that many or long
345
+ * categories all keep their label. Categories along the bottom only: not
346
+ * on a time axis, nor in horizontal bars.
347
+ */
348
+ rotate?: boolean;
217
349
  /**
218
350
  * `'time'` treats labels as dates or timestamps: line and area charts place
219
351
  * points at their real distance in time, with calendar-aware ticks.
@@ -226,9 +358,15 @@ interface CategoryAxisOptions {
226
358
  /** Run the categories from the right. Defaults to the chart's `rtl`. */
227
359
  reverse?: boolean;
228
360
  }
229
- interface CartesianOptions {
361
+ interface CartesianOptions extends Zoomable {
230
362
  data: CartesianData;
231
363
  y?: ValueAxisOptions;
364
+ /**
365
+ * The second value axis, for series with `axis: 'y2'` (it is drawn only
366
+ * when a series uses it). Its labels and title stand on the other side of
367
+ * the plot; the grid lines follow `y`.
368
+ */
369
+ y2?: ValueAxisOptions;
232
370
  x?: CategoryAxisOptions;
233
371
  /** Reference lines and bands: targets, normal ranges, events and periods. */
234
372
  annotations?: readonly Annotation[];
@@ -242,10 +380,14 @@ interface CartesianLayout {
242
380
  x: BandScale;
243
381
  /** Value scale (along y, or along x when `horizontal`). */
244
382
  y: LinearScale;
383
+ /** Scale of the second value axis, when a series uses it. */
384
+ y2?: LinearScale;
245
385
  /** Whether categories run along y. */
246
386
  horizontal: boolean;
247
387
  xTicks: Tick[];
248
388
  yTicks: Tick[];
389
+ /** Ticks of the second value axis (with `y2`). */
390
+ y2Ticks?: Tick[];
249
391
  /** Grid lines, drawn below the marks. */
250
392
  background: VNode[];
251
393
  /** Axes, drawn above the marks. */
@@ -286,12 +428,31 @@ declare function categoryInteraction(layout: CartesianLayout, options: Cartesian
286
428
  box?: Rect;
287
429
  }, markAt?: (x: number, y: number, index: number) => number | undefined): Interaction;
288
430
  /** Accessible table of series values: one row per category, one column per visible series. */
289
- declare function seriesTable(options: CartesianOptions, ctx: RenderContext, limit?: number): DataTable;
431
+ declare function seriesTable(options: CartesianOptions, ctx: TableContext, limit?: number): DataTable;
290
432
  /**
291
433
  * Formatter for date labels on a time axis (tooltips, tables, band axes):
292
434
  * the date, with the time of day when the labels span less than a few days.
293
435
  */
294
436
  declare function dateLabels(labels: readonly Label[], utc: boolean | undefined, locale: Locale): (label: Label) => string;
437
+ interface EndLabelOptions {
438
+ /** Format of the values. Defaults to the format of the series' value axis. */
439
+ format?: NumberFormat;
440
+ /** Write the last value after the name. Defaults to `true`. */
441
+ value?: boolean;
442
+ }
443
+ type Options = CartesianOptions & {
444
+ endLabels?: boolean | EndLabelOptions;
445
+ };
446
+ /**
447
+ * The end labels of a line chart: its `options` with room for the labels
448
+ * beside the plot (on the side the lines end at), and the `layer` that
449
+ * draws them once the points of every series (`null` for gaps) and the plot
450
+ * area are known. `overhang` is what the marks take beyond the plot's edge.
451
+ */
452
+ declare function endLabels<O extends Options>(options: O, ctx: RenderContext, overhang: number): {
453
+ options: O;
454
+ layer: (points: readonly (readonly Point[])[], area: Rect) => VNode | null;
455
+ };
295
456
  /** Domain of a log axis: positive values only, niced to whole powers of ten. */
296
457
  declare function logDomain(values: readonly (number | null | undefined)[], options: ValueAxisOptions): [number, number];
297
458
  /** Ticks of a log axis, each power formatted as is. */
@@ -309,14 +470,28 @@ interface LegendItem {
309
470
  hidden?: boolean;
310
471
  }
311
472
  interface LegendOptions {
312
- /** Place the legend above or below the chart. Defaults to `'top'`. */
313
- position?: "top" | "bottom";
473
+ /**
474
+ * Where the legend goes: above or below the chart, or beside it (`'left'`,
475
+ * `'right'`, mirrored in a right-to-left chart) with its entries stacked
476
+ * and the chart in the remaining width. `'auto'` puts it on the right when
477
+ * the chart keeps two thirds of the container that way, and below
478
+ * otherwise. Defaults to `'top'`.
479
+ */
480
+ position?: "top" | "bottom" | "left" | "right" | "auto";
481
+ /**
482
+ * Keep the legend inside the chart's `height`: a legend above or below the
483
+ * chart takes its height from the plot, so a chart with `height: 240` is
484
+ * 240 pixels tall with its legend (cards in a row stay the same size).
485
+ * Only with a `height` in pixels. Defaults to `false`: the legend adds to it.
486
+ */
487
+ withinHeight?: boolean;
314
488
  }
315
489
  /**
316
490
  * Legend content: one toggle button per entry. Buttons are native, so they
317
491
  * are focusable and work with Enter/Space; `aria-pressed` reflects visibility.
492
+ * `shape` gives the swatches the point shapes of their slots.
318
493
  */
319
- declare function legendContent(items: readonly LegendItem[], hidden: ReadonlySet<string>): VNode;
494
+ declare function legendContent(items: readonly LegendItem[], hidden: ReadonlySet<string>, shape?: SwatchShape): VNode;
320
495
  /** Keys hidden by default, from the entries' own `hidden` flags. */
321
496
  declare function defaultHidden(items: readonly LegendItem[]): Set<string>;
322
497
  /** `<pattern>` elements for the legend entries of a chart. */
@@ -332,7 +507,16 @@ declare function patternVars(items: readonly LegendItem[], id: string): Record<s
332
507
  declare function patternFills(config: ChartConfig<object>, id: string): [string, Record<string, string>, VNode] | undefined;
333
508
  /** The path of slot `slot`'s marker of radius `r` around (`x`, `y`). */
334
509
  declare function markerPath(slot: number, x: number, y: number, r: number): string;
335
- /** The step that gives the points of charts with `shapes` (or `patterns: true`) their shapes. */
510
+ /**
511
+ * Inline style for the legend or tooltip swatch of slot `slot`: its marker as
512
+ * a CSS shape (`--tc-shape`, a `clip-path`) in a box without rounded corners;
513
+ * `undefined` for the slots that stay a circle.
514
+ */
515
+ declare function markerClip(slot: number): Record<string, string | number> | undefined;
516
+ /**
517
+ * @deprecated Points are drawn in their shapes as the chart renders: this
518
+ * step leaves the content as it is. It will be removed in the next major.
519
+ */
336
520
  declare const shapesStep: PostStep;
337
521
  /**
338
522
  * A time category axis: points at their real distance in time, ticks on
@@ -356,11 +540,15 @@ interface ImageOptions extends ExportOptions {
356
540
  /** Quality of lossy types, `0…1`. */
357
541
  quality?: number;
358
542
  }
359
- interface DownloadOptions extends ImageOptions {
543
+ interface CSVOptions {
544
+ /** Separator of the values. Defaults to `','`. */
545
+ delimiter?: string;
546
+ }
547
+ interface DownloadOptions extends ImageOptions, CSVOptions {
360
548
  /** File name without the extension. Defaults to the chart's title, or `chart`. */
361
549
  filename?: string;
362
550
  /** File format. Defaults to `'png'`. */
363
- format?: "svg" | "png" | "jpeg" | "webp";
551
+ format?: "svg" | "png" | "jpeg" | "webp" | "csv";
364
552
  }
365
553
  /** A chart, its container, or its root `<svg>`. */
366
554
  type ExportTarget = Chart<object> | Element;
@@ -383,13 +571,75 @@ declare function exportSVG(target: ExportTarget, options?: ExportOptions): strin
383
571
  */
384
572
  declare function exportImage(target: ExportTarget, options?: ImageOptions): Promise<Blob>;
385
573
  /**
386
- * Save the chart as a file: PNG by default, or SVG, JPEG or WebP.
574
+ * The chart's data as CSV (RFC 4180): one row per category with a column per
575
+ * visible series, as in the chart's data table but with every row. Line,
576
+ * area, bar, heatmap and radar charts give plain values (numbers without
577
+ * their format, dates in ISO 8601, gaps empty); the other types give the
578
+ * text of their table. Text that a spreadsheet would run as a formula (`=`,
579
+ * `+`, `-` or `@` first) is prefixed with `'`. Takes the rendered chart
580
+ * itself, not its element.
581
+ *
582
+ * ```ts
583
+ * const csv = exportCSV(chart)
584
+ * ```
585
+ */
586
+ declare function exportCSV(chart: Chart<object>, options?: CSVOptions): string;
587
+ /**
588
+ * Save the chart as a file: PNG by default, SVG, JPEG or WebP, or its data
589
+ * as CSV (which needs the chart itself, not its element).
387
590
  *
388
591
  * ```ts
389
592
  * button.onclick = () => downloadChart(chart, { format: 'svg', filename: 'sales' })
390
593
  * ```
391
594
  */
392
595
  declare function downloadChart(target: ExportTarget, options?: DownloadOptions): Promise<void>;
596
+ /** What a plugin sees before the chart measures itself and renders. */
597
+ interface BeforeRenderState {
598
+ config: ChartConfig<object>;
599
+ legend: ResolvedLegend;
600
+ hidden: ReadonlySet<string>;
601
+ }
602
+ /** What a plugin sees after the chart rendered into the DOM. */
603
+ interface AfterRenderState extends BeforeRenderState {
604
+ size: Size;
605
+ /** Whether the chart content was rebuilt (config, size or hidden series changed). */
606
+ stale: boolean;
607
+ /** Whether the config or the hidden series changed (`stale` also covers size and font). */
608
+ changed: boolean;
609
+ }
610
+ /** Hooks of an installed plugin; every one is optional. */
611
+ interface PluginInstance {
612
+ /** Runs first on every render, e.g. to render a legend that takes up space. */
613
+ beforeRender?(state: BeforeRenderState): void;
614
+ /** Vertical space the plugin takes from the container in `height: 'container'` mode. */
615
+ reservedHeight?(): number;
616
+ /** Horizontal space the plugin takes from the container, e.g. a legend beside the chart. */
617
+ reservedWidth?(): number;
618
+ /** Extra attributes for the root `<svg>`. */
619
+ svgAttrs?(config: ChartConfig<object>): Props | undefined;
620
+ /** SVG drawn below (`under`) and above (`over`) the chart content for the active hit. */
621
+ layers?(hit: Hit, config: ChartConfig<object>): {
622
+ under?: ChildInput;
623
+ over?: ChildInput;
624
+ };
625
+ /** Runs after the SVG is in the DOM, e.g. to place a tooltip. */
626
+ afterRender?(state: AfterRenderState): void;
627
+ /** Clean up DOM and listeners. */
628
+ destroy?(): void;
629
+ }
630
+ /**
631
+ * A chart feature that can be left out of the bundle: tooltip, legend, data
632
+ * table, keyboard navigation, hover highlight. `install` runs once per chart.
633
+ *
634
+ * ```ts
635
+ * import { Chart, tooltip } from '@tabler/charts/core'
636
+ * new Chart(el, { type: line, data, plugins: [tooltip()] })
637
+ * ```
638
+ */
639
+ interface ChartPlugin {
640
+ readonly name: string;
641
+ install(chart: Chart<object>): PluginInstance;
642
+ }
393
643
  interface ArcOptions {
394
644
  innerRadius: number;
395
645
  outerRadius: number;
@@ -425,7 +675,7 @@ declare function arcPathStable(options: ArcOptions): string;
425
675
  declare function sweep(el: Element, prev: VNode, next: VNode): Attrs | undefined;
426
676
  /**
427
677
  * Optional features that chart types look up at render time. Each lives in
428
- * its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers
678
+ * its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`, `/end-labels`, `/slice-labels`, `/zoom`) and registers
429
679
  * itself when imported; `@tabler/charts` registers all of them, while
430
680
  * `@tabler/charts/core` starts empty so unused code never ships.
431
681
  */
@@ -453,7 +703,7 @@ interface Features {
453
703
  hydrate?: typeof hydrate;
454
704
  /** Path morphing on data updates where CSS cannot transition `d` (Safari). */
455
705
  morph?: typeof morph;
456
- /** Arcs turning to their new angles on data updates (set by pie, donut and gauge). */
706
+ /** Arcs turning to their new angles on data updates (installed by a chart whose type has `sweep`). */
457
707
  sweep?: typeof sweep;
458
708
  /** Line and area paths behind `series.type: 'line' | 'area'` in bar charts. */
459
709
  line?: {
@@ -465,6 +715,10 @@ interface Features {
465
715
  layers: typeof annotationLayers;
466
716
  values: typeof annotationValues;
467
717
  };
718
+ /** Names and last values at the end of lines, behind `endLabels`. */
719
+ "end-labels"?: typeof endLabels;
720
+ /** Names beside the slices of a pie, behind its `labels`. */
721
+ "slice-labels"?: typeof sliceLabels;
468
722
  /** Pattern fills behind `patterns` (and forced colors, with `'auto'`). */
469
723
  patterns?: typeof patternFills;
470
724
  /**
@@ -474,12 +728,27 @@ interface Features {
474
728
  post?: PostStep;
475
729
  /** Point shapes by color slot, behind `shapes`. */
476
730
  "point-shapes"?: typeof markerPath;
731
+ /** The same shapes for legend and tooltip swatches, as CSS shapes. */
732
+ swatch?: typeof markerClip;
733
+ /**
734
+ * Behind `view` and `zoom` in cartesian charts: the window of categories a
735
+ * chart type draws, and what the `zoom()` plugin installs on a chart.
736
+ */
737
+ zoom?: {
738
+ window: typeof viewWindow;
739
+ install: ChartPlugin["install"];
740
+ };
477
741
  /** Saving a chart as a file, behind the `download` menu. */
478
742
  export?: typeof downloadChart;
479
743
  }
480
744
  declare const features: Features;
481
745
  /** Register optional features (idempotent). */
482
746
  declare function register(added: Features): void;
747
+ /**
748
+ * Inline style that gives the swatch of a legend or tooltip entry the point
749
+ * shape of its color slot (the stylesheet applies it when points are drawn).
750
+ */
751
+ type SwatchShape = (slot: number) => Record<string, string | number> | undefined;
483
752
  /** A step that finishes rendered chart content, e.g. by adding value labels. */
484
753
  type PostStep = (config: ChartConfig<object>, content: ChildInput, interaction: Interaction | undefined, ctx: RenderContext) => ChildInput;
485
754
  /** The registered feature, or a helpful error naming the import that provides it. */
@@ -489,58 +758,19 @@ interface ValueLabelOptions {
489
758
  format?: NumberFormat;
490
759
  /** Which points of lines, areas and scatters get a label. Defaults to `'last'`. */
491
760
  points?: "last" | "all";
761
+ /**
762
+ * Let the label of a point lie over a bar or a cell when it has no free
763
+ * place (a line over bars): every point keeps its label. Labels still
764
+ * never cover each other. Defaults to `false`.
765
+ */
766
+ overMarks?: boolean;
492
767
  }
493
768
  /** The labels layer of a chart, or `null` when nothing gets one. */
494
769
  declare function valueLabels(config: ChartConfig<object>, interaction: Interaction, ctx: RenderContext): VNode | null;
495
770
  /** The step that adds the labels over the content of charts with `valueLabels`. */
496
771
  declare const labelsStep: PostStep;
497
- /** What a plugin sees before the chart measures itself and renders. */
498
- interface BeforeRenderState {
499
- config: ChartConfig<object>;
500
- legend: ResolvedLegend;
501
- hidden: ReadonlySet<string>;
502
- }
503
- /** What a plugin sees after the chart rendered into the DOM. */
504
- interface AfterRenderState extends BeforeRenderState {
505
- size: Size;
506
- /** Whether the chart content was rebuilt (config, size or hidden series changed). */
507
- stale: boolean;
508
- /** Whether the config or the hidden series changed (`stale` also covers size and font). */
509
- changed: boolean;
510
- }
511
- /** Hooks of an installed plugin; every one is optional. */
512
- interface PluginInstance {
513
- /** Runs first on every render, e.g. to render a legend that takes up space. */
514
- beforeRender?(state: BeforeRenderState): void;
515
- /** Vertical space the plugin takes from the container in `height: 'container'` mode. */
516
- reservedHeight?(): number;
517
- /** Extra attributes for the root `<svg>`. */
518
- svgAttrs?(config: ChartConfig<object>): Props | undefined;
519
- /** SVG drawn below (`under`) and above (`over`) the chart content for the active hit. */
520
- layers?(hit: Hit, config: ChartConfig<object>): {
521
- under?: ChildInput;
522
- over?: ChildInput;
523
- };
524
- /** Runs after the SVG is in the DOM, e.g. to place a tooltip. */
525
- afterRender?(state: AfterRenderState): void;
526
- /** Clean up DOM and listeners. */
527
- destroy?(): void;
528
- }
529
- /**
530
- * A chart feature that can be left out of the bundle: tooltip, legend, data
531
- * table, keyboard navigation, hover highlight. `install` runs once per chart.
532
- *
533
- * ```ts
534
- * import { Chart, tooltip } from '@tabler/charts/core'
535
- * new Chart(el, { type: line, data, plugins: [tooltip()] })
536
- * ```
537
- */
538
- interface ChartPlugin {
539
- readonly name: string;
540
- install(chart: Chart<object>): PluginInstance;
541
- }
542
772
  /** A file format of the download menu. */
543
- type DownloadFormat = "png" | "svg" | "jpeg" | "webp";
773
+ type DownloadFormat = "png" | "svg" | "jpeg" | "webp" | "csv";
544
774
  /** The `download` option as an object. */
545
775
  interface DownloadMenuOptions {
546
776
  /** Formats offered, in this order. Defaults to `['png', 'svg']`. */
@@ -558,13 +788,15 @@ interface DownloadMenuOptions {
558
788
  legend?: boolean;
559
789
  /** Pixels per chart pixel in images. Defaults to `2`. */
560
790
  scale?: number;
791
+ /** Separator of the values in a CSV file. Defaults to `','`. */
792
+ delimiter?: string;
561
793
  }
562
794
  /** The `download` option: on, a list of formats, or the options. */
563
795
  type DownloadOption = boolean | readonly DownloadFormat[] | DownloadMenuOptions;
564
796
  /**
565
797
  * A download menu in the chart's corner (`.tc-download`): a button that opens
566
- * a list of file formats, PNG and SVG by default. Shown with the `download`
567
- * option. The files come from `@tabler/charts/export`, which must be imported
798
+ * a list of file formats, PNG and SVG by default (`'csv'` adds the data as a
799
+ * CSV file). Shown with the `download` option. The files come from `@tabler/charts/export`, which must be imported
568
800
  * (the chart says so otherwise): that way charts without a download never
569
801
  * carry the export code.
570
802
  */
@@ -595,8 +827,11 @@ interface TooltipOptions {
595
827
  /** Extra content below the default rows (e.g. a total), in `.tc-tooltip-footer`. */
596
828
  footer?: (hit: Hit) => ChildInput;
597
829
  }
598
- /** Default tooltip content: the category title and one row per series. */
599
- declare function tooltipContent(hit: Hit, options?: TooltipOptions): VNode;
830
+ /**
831
+ * Default tooltip content: the category title and one row per series
832
+ * (`shape` gives their swatches the point shapes of their slots).
833
+ */
834
+ declare function tooltipContent(hit: Hit, options?: TooltipOptions, shape?: SwatchShape): VNode;
600
835
  interface TooltipPlacement {
601
836
  x: number;
602
837
  y: number;
@@ -629,18 +864,32 @@ interface RenderContext {
629
864
  locale: Locale;
630
865
  /** Unique, stable prefix for ids inside this chart. */
631
866
  id: string;
632
- /** Register how pointer and keyboard map to data (ignored in SSR). */
633
- onHitTest(interaction: Interaction): void;
634
867
  /** Keys of legend entries (series) currently hidden. */
635
868
  hidden: ReadonlySet<string>;
636
869
  /** Lay the chart out right to left (the `rtl` option, resolved). */
637
870
  rtl?: boolean;
638
871
  }
872
+ /** What a chart type's `table()` sees: no size, since a table has none. */
873
+ type TableContext = Pick<RenderContext, "locale" | "hidden" | "rtl">;
874
+ /**
875
+ * What a chart type renders for one size: the content of the root `<svg>`,
876
+ * and how pointer and keyboard map to its data (none, when left out).
877
+ */
878
+ interface RenderResult {
879
+ content: ChildInput;
880
+ interaction?: Interaction;
881
+ }
639
882
  /**
640
- * A chart type plugin (`line`, `bar`, …). Receives the chart options and
641
- * returns the content of the root `<svg>`.
883
+ * A chart type plugin (`line`, `bar`, …). Works out its model from the chart
884
+ * options and renders it into the content of the root `<svg>`.
885
+ *
886
+ * `M` is the chart model, what `prepare()` works out from the options alone
887
+ * (the options themselves for a type without `prepare()`): `render()`,
888
+ * `legend()`, `table()` and `height()` all read it, so a type groups or sorts
889
+ * its data once per config, not once for each of them. `ChartType<never>`
890
+ * stands for any chart type.
642
891
  */
643
- interface ChartType<O extends object = object> {
892
+ interface ChartType<O extends object = object, M extends object = [O] extends [never] ? object : O> {
644
893
  readonly name: string;
645
894
  /**
646
895
  * Clean options that may come from outside (data, annotations, axis
@@ -648,14 +897,27 @@ interface ChartType<O extends object = object> {
648
897
  * as the config comes in, before anything reads it.
649
898
  */
650
899
  clean?(options: O): unknown;
651
- render(options: O, context: RenderContext): ChildInput;
900
+ /**
901
+ * The chart model of the (cleaned) options: whatever the legend, the table
902
+ * and every render share. It knows neither the size nor the hidden series
903
+ * (the legend that hides them reads it). Called once per config.
904
+ */
905
+ prepare?(options: O): M;
906
+ /** The chart content for a size: bare content, or with its interaction. */
907
+ render(model: M, context: RenderContext): ChildInput | RenderResult;
908
+ /**
909
+ * Height in pixels at a width, for a type whose proportions are not one
910
+ * ratio (parts of it keep their size as it narrows). Asked when `height`
911
+ * is not set; `undefined` leaves it to `aspectRatio`.
912
+ */
913
+ height?(model: M, width: number): number | undefined;
652
914
  /** Entries for the legend (series, slices); charts without it get no legend. */
653
- legend?(options: O): LegendItem[];
915
+ legend?(model: M): LegendItem[];
654
916
  /**
655
917
  * The data as a text table, for screen readers and the visible table
656
918
  * option. `limit` is the most rows wanted; report the real count in `total`.
657
919
  */
658
- table?(options: O, context: RenderContext, limit: number): DataTable;
920
+ table?(model: M, context: TableContext, limit: number): DataTable;
659
921
  /**
660
922
  * Whether the chart should be focusable and keyboard-navigable by default
661
923
  * (`keyboard` in the config overrides it). Decorative types such as
@@ -669,10 +931,26 @@ interface ChartType<O extends object = object> {
669
931
  * names the number format of the values in the options (by default a label
670
932
  * shows the text of the tooltip).
671
933
  */
934
+ /**
935
+ * How the chart's marks turn to new data in the DOM, where CSS cannot
936
+ * animate them (arcs sweeping to their new angles). A chart in the page
937
+ * installs it; it is part of the type, not of a module that loads, so it
938
+ * ships only with the types that use it.
939
+ */
940
+ readonly sweep?: Features["sweep"];
672
941
  readonly valueLabels?: {
673
942
  marks?: "slice" | "cell";
674
- format?(options: O): NumberFormat | undefined;
943
+ format?(model: M): NumberFormat | undefined;
675
944
  };
945
+ /**
946
+ * Plugins the chart type brings along (the zoom of a map), installed after
947
+ * the default ones when a chart is created with this type.
948
+ */
949
+ readonly plugins?: readonly ChartPlugin[];
950
+ }
951
+ interface CrosshairOptions {
952
+ /** A line through the pointer, and the value under it on the value axis. Defaults to `false`. */
953
+ value?: boolean;
676
954
  }
677
955
  /** Options shared by every chart type. */
678
956
  interface BaseOptions {
@@ -698,7 +976,8 @@ interface BaseOptions {
698
976
  * and categories running from the right (`x.reverse` overrides the latter).
699
977
  * `'auto'` follows the `direction` of the container (left to right in SSR).
700
978
  * The legend, the tooltip and the download menu read right to left with it.
701
- * Cartesian charts, heatmaps, sparklines and sankey diagrams. Defaults to `false`.
979
+ * Cartesian charts, heatmaps, sparklines, sankey diagrams and percentage
980
+ * bars. Defaults to `false`.
702
981
  */
703
982
  rtl?: boolean | "auto";
704
983
  /**
@@ -711,8 +990,18 @@ interface BaseOptions {
711
990
  id?: string;
712
991
  /** Show a tooltip on hover, optionally with custom content. Defaults to `true`. */
713
992
  tooltip?: boolean | TooltipOptions;
714
- /** Show a vertical crosshair on hover (point charts). Defaults to `true`. */
715
- crosshair?: boolean;
993
+ /**
994
+ * Show a vertical crosshair on hover (point charts). `{ value: true }` also
995
+ * draws a line through the pointer across the plot, with the value there
996
+ * written on the value axis (line, area, bar and candlestick charts; on the
997
+ * first axis of a chart with two). Defaults to `true`.
998
+ */
999
+ crosshair?: boolean | CrosshairOptions;
1000
+ /**
1001
+ * Draw a dot on every value of the hovered category (point charts).
1002
+ * `false` leaves the crosshair and the tooltip. Defaults to `true`.
1003
+ */
1004
+ activePoints?: boolean;
716
1005
  /** Show a legend with toggles. Defaults to showing it for two or more entries. */
717
1006
  legend?: boolean | LegendOptions;
718
1007
  /**
@@ -734,8 +1023,11 @@ interface BaseOptions {
734
1023
  * Write the values on the marks: bars at their end, stacked segments,
735
1024
  * cells and slices inside (slices show their share), lines and points
736
1025
  * above their last point (`points: 'all'` for every one). Labels that do
737
- * not fit are left out. Needs `@tabler/charts/value-labels` on the core
738
- * (`@tabler/charts` includes it).
1026
+ * not fit are left out (`overMarks: true` keeps the labels of a line
1027
+ * where it crosses the bars). A series' own `valueLabels` overrides this for
1028
+ * that series, and each label carries its series classes
1029
+ * (`tc-series tc-series-{n}`). Needs `@tabler/charts/value-labels` on the
1030
+ * core (`@tabler/charts` includes it).
739
1031
  */
740
1032
  valueLabels?: boolean | ValueLabelOptions;
741
1033
  /**
@@ -765,7 +1057,7 @@ interface BaseOptions {
765
1057
  keyboard?: boolean;
766
1058
  /**
767
1059
  * A download menu in the chart's corner: `true` offers PNG and SVG, a list
768
- * picks the formats (`['png', 'svg', 'jpeg', 'webp']`), an object also
1060
+ * picks the formats (`['png', 'svg', 'jpeg', 'webp', 'csv']`), an object also
769
1061
  * sets the file name and the export options. Needs `@tabler/charts/export`
770
1062
  * imported, and on the core the `download()` plugin (the `Chart` of
771
1063
  * `@tabler/charts` has it).
@@ -780,7 +1072,7 @@ interface BaseOptions {
780
1072
  }
781
1073
  /** Full chart configuration: base options, the chart type and its options. */
782
1074
  type ChartConfig<O extends object = object> = BaseOptions & O & {
783
- type: ChartType<O>;
1075
+ type: ChartType<O, object>;
784
1076
  };
785
1077
  interface Size {
786
1078
  width: number;
@@ -788,13 +1080,29 @@ interface Size {
788
1080
  }
789
1081
  /** Resolve the final pixel size from options and the measured container size. */
790
1082
  declare function resolveSize(options: BaseOptions, measured?: Partial<Size>): Size;
791
- /** Render context for a config and size (also used by plugins such as the data table). */
792
- declare function renderContext<O extends object>(config: ChartConfig<O>, size: Size, id: string, onHitTest: (interaction: Interaction) => void, hidden: ReadonlySet<string>, measuredFontSize?: number, rtl?: boolean): RenderContext;
1083
+ /**
1084
+ * The chart model of a config: what its type's `prepare()` works out from
1085
+ * it, once per config object, or the config itself for a type without one.
1086
+ */
1087
+ declare function chartModel(config: ChartConfig<object>): object;
1088
+ /** What a render context is made for, besides the config. */
1089
+ interface ContextOptions {
1090
+ size: Size;
1091
+ /** Id prefix of the chart. */
1092
+ id: string;
1093
+ hidden: ReadonlySet<string>;
1094
+ /** Measured font size, used when the config sets none. */
1095
+ fontSize?: number;
1096
+ /** The resolved `rtl` option; by default `rtl: true` in the config. */
1097
+ rtl?: boolean;
1098
+ }
1099
+ /** Render context for a config and size. */
1100
+ declare function renderContext<O extends object>(config: ChartConfig<O>, { size, id, hidden, fontSize, rtl }: ContextOptions): RenderContext;
793
1101
  /** Legend entries of a config, whether a legend is shown and where. */
794
1102
  interface ResolvedLegend {
795
1103
  items: LegendItem[];
796
1104
  show: boolean;
797
- position: "top" | "bottom";
1105
+ position: NonNullable<LegendOptions["position"]>;
798
1106
  }
799
1107
  /** Legend entries of a config, and whether the legend is shown. */
800
1108
  declare function resolveLegend<O extends object>(config: ChartConfig<O>): ResolvedLegend;
@@ -805,11 +1113,18 @@ declare function resolveLegend<O extends object>(config: ChartConfig<O>): Resolv
805
1113
  * page's language.
806
1114
  */
807
1115
  declare function chartLabel(config: ChartConfig<object>): string;
1116
+ /** A chart built without the DOM: its root `<svg>`, and how it answers interaction. */
1117
+ interface BuiltChart {
1118
+ svg: VNode;
1119
+ interaction?: Interaction;
1120
+ }
808
1121
  /**
809
- * Build the VNode tree of a chart: a pure function of the config and size,
810
- * shared by the DOM chart and server-side rendering.
1122
+ * Build a chart for a size: a pure function of the config and size, shared
1123
+ * by the DOM chart and server-side rendering. `buildChart()` keeps the svg.
811
1124
  */
812
- declare function buildChart<O extends object>(config: ChartConfig<O>, size: Size, id?: string, onHitTest?: (interaction: Interaction) => void): VNode;
1125
+ declare function renderChart<O extends object>(config: ChartConfig<O>, size: Size, id?: string): BuiltChart;
1126
+ /** Build the VNode tree of a chart for a size (see `renderChart()`). */
1127
+ declare function buildChart<O extends object>(config: ChartConfig<O>, size: Size, id?: string): VNode;
813
1128
  /**
814
1129
  * Render a chart to an SVG string, e.g. on the server.
815
1130
  *
@@ -863,10 +1178,10 @@ type Handler<T> = (event: T) => void;
863
1178
  declare class Chart<O extends object = object> {
864
1179
  #private;
865
1180
  /** Element the chart renders into. */
866
- readonly element: Element;
1181
+ readonly element: HTMLElement;
867
1182
  /** Id prefix used for elements inside the chart. */
868
1183
  readonly id: string;
869
- constructor(target: Element | string, config: ChartConfig<O>, defaultPlugins?: readonly ChartPlugin[]);
1184
+ constructor(target: HTMLElement | string, config: ChartConfig<O>, defaultPlugins?: readonly ChartPlugin[]);
870
1185
  /** Current configuration. */
871
1186
  get config(): ChartConfig<O>;
872
1187
  /** Size of the last render. */
@@ -939,4 +1254,4 @@ declare class Chart<O extends object = object> {
939
1254
  /** Call the handlers of an event (plugins emit `click`, for instance). */
940
1255
  emit<K extends keyof ChartEvents>(name: K, event: ChartEvents[K]): void;
941
1256
  }
942
- export { LegendOptions as $, labelsStep as A, DownloadOptions as B, DownloadOption as C, describeHit as Ct, ChartPlugin as D, HitTester as Dt, BeforeRenderState as E, HitItem as Et, register as F, exportImage as G, ExportTarget as H, ArcOptions as I, shapesStep as J, exportSVG as K, arcCentroid as L, Features as M, feature as N, PluginInstance as O, Interaction as Ot, features as P, LegendItem as Q, arcPathStable as R, DownloadMenuOptions as S, DataTable as St, AfterRenderState as T, Hit as Tt, ImageOptions as U, ExportOptions as V, downloadChart as W, patternFills as X, patternDefs as Y, patternVars as Z, TooltipPlacement as _, axis as _t, ChartType as a, Label as at, tooltipContent as b, linearTicks as bt, Size as c, categoryInteraction as ct, chartLabel as d, seriesLegend as dt, defaultHidden as et, chartToString as f, seriesTable as ft, TooltipOptions as g, Tick as gt, resolveSize as h, LinearTicksOptions as ht, ChartEvents as i, CategoryAxisOptions as it, valueLabels as j, ValueLabelOptions as k, buildChart as l, domainOf as lt, resolveLegend as m, AxisPosition as mt, Chart as n, CartesianData as nt, RenderContext as o, Series as ot, renderContext as p, AxisOptions as pt, markerPath as q, ChartConfig as r, CartesianOptions as rt, ResolvedLegend as s, ValueAxisOptions as st, BaseOptions as t, legendContent as tt, chartEvents as u, seriesKey as ut, hitAnchor as v, axisSize as vt, download as w, tableContent as wt, DownloadFormat as x, thinTicks as xt, placeTooltip as y, bandTicks as yt, padAngleForGap as z };
1257
+ export { exportCSV as $, DownloadOption as A, AxisOptions as At, arcCentroid as B, describeHit as Bt, TooltipOptions as C, seriesLegend as Ct, tooltipContent as D, Zoomable as Dt, placeTooltip as E, ZoomOptions as Et, Features as F, axisSize as Ft, ChartPlugin as G, HitItem as Gt, padAngleForGap as H, Highlight as Ht, feature as I, bandTicks as It, DownloadOptions as J, PluginInstance as K, HitTester as Kt, features as L, linearTicks as Lt, ValueLabelOptions as M, LinearTicksOptions as Mt, labelsStep as N, Tick as Nt, DownloadFormat as O, viewRange as Ot, valueLabels as P, axis as Pt, downloadChart as Q, register as R, thinTicks as Rt, resolveSize as S, seriesKey as St, hitAnchor as T, ViewWindow as Tt, AfterRenderState as U, Hit as Ut, arcPathStable as V, tableContent as Vt, BeforeRenderState as W, HitCursor as Wt, ExportTarget as X, ExportOptions as Y, ImageOptions as Z, chartModel as _, Label as _t, ChartEvents as a, patternDefs as at, renderContext as b, categoryInteraction as bt, CrosshairOptions as c, LegendItem as ct, ResolvedLegend as d, legendContent as dt, exportImage as et, Size as f, EndLabelOptions as ft, chartLabel as g, CategoryAxisOptions as gt, chartEvents as h, CartesianOptions as ht, ChartConfig as i, shapesStep as it, download as j, AxisPosition as jt, DownloadMenuOptions as k, viewWindow as kt, RenderContext as l, LegendOptions as lt, buildChart as m, CartesianData as mt, BuiltChart as n, markerClip as nt, ChartType as o, patternFills as ot, TableContext as p, endLabels as pt, CSVOptions as q, Interaction as qt, Chart as r, markerPath as rt, ContextOptions as s, patternVars as st, BaseOptions as t, exportSVG as tt, RenderResult as u, defaultHidden as ut, chartToString as v, Series as vt, TooltipPlacement as w, seriesTable as wt, resolveLegend as x, domainOf as xt, renderChart as y, ValueAxisOptions as yt, ArcOptions as z, DataTable as zt };