@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-B02GR_KU.js";
1
+ import { i as Rect, n as InsetsInput } from "./layout-CYerDebD.js";
2
2
  import { a as ClassValue, i as ChildInput, l as VNode, n as Attrs, s as Props } from "./vnode-Du2cC8Fm.js";
3
+ import { n as annotationLayers, r as annotationValues, t as Annotation } from "./annotations-CCDUC1lW.js";
3
4
  import { a as timePointScale, c as NumberFormat, i as time, s as Locale } from "./time-DRIDgv2a.js";
4
5
  import { n as BandScale, t as BandKey } from "./band-CNKvdnTC.js";
5
6
  import { n as log, r as LinearScale } from "./log-CI41TmcU.js";
7
+ import { a as linePath, i as areaPath, r as Point } from "./path-YeUiOfG8.js";
8
+ import { n as sliceLabels } from "./slice-labels-Cm5CyV7B.js";
6
9
  import { t as hydrate } from "./hydrate-OjM1pIUG.js";
7
10
  import { t as morph } from "./morph-Dh7gJkV4.js";
8
- import { a as linePath, i as areaPath, r as Point } from "./path-YeUiOfG8.js";
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
  /**
394
644
  * Take `el` from the arc of its last render, `prev`, to the arc of `next`.
395
645
  * Returns the attributes left for the caller to patch (all but `d`, set
@@ -399,7 +649,7 @@ declare function downloadChart(target: ExportTarget, options?: DownloadOptions):
399
649
  declare function sweep(el: Element, prev: VNode, next: VNode): Attrs | undefined;
400
650
  /**
401
651
  * Optional features that chart types look up at render time. Each lives in
402
- * its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers
652
+ * its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`, `/end-labels`, `/slice-labels`, `/zoom`) and registers
403
653
  * itself when imported; `@tabler/charts` registers all of them, while
404
654
  * `@tabler/charts/core` starts empty so unused code never ships.
405
655
  */
@@ -427,7 +677,7 @@ interface Features {
427
677
  hydrate?: typeof hydrate;
428
678
  /** Path morphing on data updates where CSS cannot transition `d` (Safari). */
429
679
  morph?: typeof morph;
430
- /** Arcs turning to their new angles on data updates (set by pie, donut and gauge). */
680
+ /** Arcs turning to their new angles on data updates (installed by a chart whose type has `sweep`). */
431
681
  sweep?: typeof sweep;
432
682
  /** Line and area paths behind `series.type: 'line' | 'area'` in bar charts. */
433
683
  line?: {
@@ -439,6 +689,10 @@ interface Features {
439
689
  layers: typeof annotationLayers;
440
690
  values: typeof annotationValues;
441
691
  };
692
+ /** Names and last values at the end of lines, behind `endLabels`. */
693
+ "end-labels"?: typeof endLabels;
694
+ /** Names beside the slices of a pie, behind its `labels`. */
695
+ "slice-labels"?: typeof sliceLabels;
442
696
  /** Pattern fills behind `patterns` (and forced colors, with `'auto'`). */
443
697
  patterns?: typeof patternFills;
444
698
  /**
@@ -448,12 +702,27 @@ interface Features {
448
702
  post?: PostStep;
449
703
  /** Point shapes by color slot, behind `shapes`. */
450
704
  "point-shapes"?: typeof markerPath;
705
+ /** The same shapes for legend and tooltip swatches, as CSS shapes. */
706
+ swatch?: typeof markerClip;
707
+ /**
708
+ * Behind `view` and `zoom` in cartesian charts: the window of categories a
709
+ * chart type draws, and what the `zoom()` plugin installs on a chart.
710
+ */
711
+ zoom?: {
712
+ window: typeof viewWindow;
713
+ install: ChartPlugin["install"];
714
+ };
451
715
  /** Saving a chart as a file, behind the `download` menu. */
452
716
  export?: typeof downloadChart;
453
717
  }
454
718
  declare const features: Features;
455
719
  /** Register optional features (idempotent). */
456
720
  declare function register(added: Features): void;
721
+ /**
722
+ * Inline style that gives the swatch of a legend or tooltip entry the point
723
+ * shape of its color slot (the stylesheet applies it when points are drawn).
724
+ */
725
+ type SwatchShape = (slot: number) => Record<string, string | number> | undefined;
457
726
  /** A step that finishes rendered chart content, e.g. by adding value labels. */
458
727
  type PostStep = (config: ChartConfig<object>, content: ChildInput, interaction: Interaction | undefined, ctx: RenderContext) => ChildInput;
459
728
  /** The registered feature, or a helpful error naming the import that provides it. */
@@ -463,58 +732,19 @@ interface ValueLabelOptions {
463
732
  format?: NumberFormat;
464
733
  /** Which points of lines, areas and scatters get a label. Defaults to `'last'`. */
465
734
  points?: "last" | "all";
735
+ /**
736
+ * Let the label of a point lie over a bar or a cell when it has no free
737
+ * place (a line over bars): every point keeps its label. Labels still
738
+ * never cover each other. Defaults to `false`.
739
+ */
740
+ overMarks?: boolean;
466
741
  }
467
742
  /** The labels layer of a chart, or `null` when nothing gets one. */
468
743
  declare function valueLabels(config: ChartConfig<object>, interaction: Interaction, ctx: RenderContext): VNode | null;
469
744
  /** The step that adds the labels over the content of charts with `valueLabels`. */
470
745
  declare const labelsStep: PostStep;
471
- /** What a plugin sees before the chart measures itself and renders. */
472
- interface BeforeRenderState {
473
- config: ChartConfig<object>;
474
- legend: ResolvedLegend;
475
- hidden: ReadonlySet<string>;
476
- }
477
- /** What a plugin sees after the chart rendered into the DOM. */
478
- interface AfterRenderState extends BeforeRenderState {
479
- size: Size;
480
- /** Whether the chart content was rebuilt (config, size or hidden series changed). */
481
- stale: boolean;
482
- /** Whether the config or the hidden series changed (`stale` also covers size and font). */
483
- changed: boolean;
484
- }
485
- /** Hooks of an installed plugin; every one is optional. */
486
- interface PluginInstance {
487
- /** Runs first on every render, e.g. to render a legend that takes up space. */
488
- beforeRender?(state: BeforeRenderState): void;
489
- /** Vertical space the plugin takes from the container in `height: 'container'` mode. */
490
- reservedHeight?(): number;
491
- /** Extra attributes for the root `<svg>`. */
492
- svgAttrs?(config: ChartConfig<object>): Props | undefined;
493
- /** SVG drawn below (`under`) and above (`over`) the chart content for the active hit. */
494
- layers?(hit: Hit, config: ChartConfig<object>): {
495
- under?: ChildInput;
496
- over?: ChildInput;
497
- };
498
- /** Runs after the SVG is in the DOM, e.g. to place a tooltip. */
499
- afterRender?(state: AfterRenderState): void;
500
- /** Clean up DOM and listeners. */
501
- destroy?(): void;
502
- }
503
- /**
504
- * A chart feature that can be left out of the bundle: tooltip, legend, data
505
- * table, keyboard navigation, hover highlight. `install` runs once per chart.
506
- *
507
- * ```ts
508
- * import { Chart, tooltip } from '@tabler/charts/core'
509
- * new Chart(el, { type: line, data, plugins: [tooltip()] })
510
- * ```
511
- */
512
- interface ChartPlugin {
513
- readonly name: string;
514
- install(chart: Chart<object>): PluginInstance;
515
- }
516
746
  /** A file format of the download menu. */
517
- type DownloadFormat = "png" | "svg" | "jpeg" | "webp";
747
+ type DownloadFormat = "png" | "svg" | "jpeg" | "webp" | "csv";
518
748
  /** The `download` option as an object. */
519
749
  interface DownloadMenuOptions {
520
750
  /** Formats offered, in this order. Defaults to `['png', 'svg']`. */
@@ -532,13 +762,15 @@ interface DownloadMenuOptions {
532
762
  legend?: boolean;
533
763
  /** Pixels per chart pixel in images. Defaults to `2`. */
534
764
  scale?: number;
765
+ /** Separator of the values in a CSV file. Defaults to `','`. */
766
+ delimiter?: string;
535
767
  }
536
768
  /** The `download` option: on, a list of formats, or the options. */
537
769
  type DownloadOption = boolean | readonly DownloadFormat[] | DownloadMenuOptions;
538
770
  /**
539
771
  * A download menu in the chart's corner (`.tc-download`): a button that opens
540
- * a list of file formats, PNG and SVG by default. Shown with the `download`
541
- * option. The files come from `@tabler/charts/export`, which must be imported
772
+ * a list of file formats, PNG and SVG by default (`'csv'` adds the data as a
773
+ * CSV file). Shown with the `download` option. The files come from `@tabler/charts/export`, which must be imported
542
774
  * (the chart says so otherwise): that way charts without a download never
543
775
  * carry the export code.
544
776
  */
@@ -569,8 +801,11 @@ interface TooltipOptions {
569
801
  /** Extra content below the default rows (e.g. a total), in `.tc-tooltip-footer`. */
570
802
  footer?: (hit: Hit) => ChildInput;
571
803
  }
572
- /** Default tooltip content: the category title and one row per series. */
573
- declare function tooltipContent(hit: Hit, options?: TooltipOptions): VNode;
804
+ /**
805
+ * Default tooltip content: the category title and one row per series
806
+ * (`shape` gives their swatches the point shapes of their slots).
807
+ */
808
+ declare function tooltipContent(hit: Hit, options?: TooltipOptions, shape?: SwatchShape): VNode;
574
809
  interface TooltipPlacement {
575
810
  x: number;
576
811
  y: number;
@@ -603,18 +838,32 @@ interface RenderContext {
603
838
  locale: Locale;
604
839
  /** Unique, stable prefix for ids inside this chart. */
605
840
  id: string;
606
- /** Register how pointer and keyboard map to data (ignored in SSR). */
607
- onHitTest(interaction: Interaction): void;
608
841
  /** Keys of legend entries (series) currently hidden. */
609
842
  hidden: ReadonlySet<string>;
610
843
  /** Lay the chart out right to left (the `rtl` option, resolved). */
611
844
  rtl?: boolean;
612
845
  }
846
+ /** What a chart type's `table()` sees: no size, since a table has none. */
847
+ type TableContext = Pick<RenderContext, "locale" | "hidden" | "rtl">;
848
+ /**
849
+ * What a chart type renders for one size: the content of the root `<svg>`,
850
+ * and how pointer and keyboard map to its data (none, when left out).
851
+ */
852
+ interface RenderResult {
853
+ content: ChildInput;
854
+ interaction?: Interaction;
855
+ }
613
856
  /**
614
- * A chart type plugin (`line`, `bar`, …). Receives the chart options and
615
- * returns the content of the root `<svg>`.
857
+ * A chart type plugin (`line`, `bar`, …). Works out its model from the chart
858
+ * options and renders it into the content of the root `<svg>`.
859
+ *
860
+ * `M` is the chart model, what `prepare()` works out from the options alone
861
+ * (the options themselves for a type without `prepare()`): `render()`,
862
+ * `legend()`, `table()` and `height()` all read it, so a type groups or sorts
863
+ * its data once per config, not once for each of them. `ChartType<never>`
864
+ * stands for any chart type.
616
865
  */
617
- interface ChartType<O extends object = object> {
866
+ interface ChartType<O extends object = object, M extends object = [O] extends [never] ? object : O> {
618
867
  readonly name: string;
619
868
  /**
620
869
  * Clean options that may come from outside (data, annotations, axis
@@ -622,14 +871,27 @@ interface ChartType<O extends object = object> {
622
871
  * as the config comes in, before anything reads it.
623
872
  */
624
873
  clean?(options: O): unknown;
625
- render(options: O, context: RenderContext): ChildInput;
874
+ /**
875
+ * The chart model of the (cleaned) options: whatever the legend, the table
876
+ * and every render share. It knows neither the size nor the hidden series
877
+ * (the legend that hides them reads it). Called once per config.
878
+ */
879
+ prepare?(options: O): M;
880
+ /** The chart content for a size: bare content, or with its interaction. */
881
+ render(model: M, context: RenderContext): ChildInput | RenderResult;
882
+ /**
883
+ * Height in pixels at a width, for a type whose proportions are not one
884
+ * ratio (parts of it keep their size as it narrows). Asked when `height`
885
+ * is not set; `undefined` leaves it to `aspectRatio`.
886
+ */
887
+ height?(model: M, width: number): number | undefined;
626
888
  /** Entries for the legend (series, slices); charts without it get no legend. */
627
- legend?(options: O): LegendItem[];
889
+ legend?(model: M): LegendItem[];
628
890
  /**
629
891
  * The data as a text table, for screen readers and the visible table
630
892
  * option. `limit` is the most rows wanted; report the real count in `total`.
631
893
  */
632
- table?(options: O, context: RenderContext, limit: number): DataTable;
894
+ table?(model: M, context: TableContext, limit: number): DataTable;
633
895
  /**
634
896
  * Whether the chart should be focusable and keyboard-navigable by default
635
897
  * (`keyboard` in the config overrides it). Decorative types such as
@@ -643,10 +905,26 @@ interface ChartType<O extends object = object> {
643
905
  * names the number format of the values in the options (by default a label
644
906
  * shows the text of the tooltip).
645
907
  */
908
+ /**
909
+ * How the chart's marks turn to new data in the DOM, where CSS cannot
910
+ * animate them (arcs sweeping to their new angles). A chart in the page
911
+ * installs it; it is part of the type, not of a module that loads, so it
912
+ * ships only with the types that use it.
913
+ */
914
+ readonly sweep?: Features["sweep"];
646
915
  readonly valueLabels?: {
647
916
  marks?: "slice" | "cell";
648
- format?(options: O): NumberFormat | undefined;
917
+ format?(model: M): NumberFormat | undefined;
649
918
  };
919
+ /**
920
+ * Plugins the chart type brings along (the zoom of a map), installed after
921
+ * the default ones when a chart is created with this type.
922
+ */
923
+ readonly plugins?: readonly ChartPlugin[];
924
+ }
925
+ interface CrosshairOptions {
926
+ /** A line through the pointer, and the value under it on the value axis. Defaults to `false`. */
927
+ value?: boolean;
650
928
  }
651
929
  /** Options shared by every chart type. */
652
930
  interface BaseOptions {
@@ -672,7 +950,8 @@ interface BaseOptions {
672
950
  * and categories running from the right (`x.reverse` overrides the latter).
673
951
  * `'auto'` follows the `direction` of the container (left to right in SSR).
674
952
  * The legend, the tooltip and the download menu read right to left with it.
675
- * Cartesian charts, heatmaps, sparklines and sankey diagrams. Defaults to `false`.
953
+ * Cartesian charts, heatmaps, sparklines, sankey diagrams and percentage
954
+ * bars. Defaults to `false`.
676
955
  */
677
956
  rtl?: boolean | "auto";
678
957
  /**
@@ -685,8 +964,18 @@ interface BaseOptions {
685
964
  id?: string;
686
965
  /** Show a tooltip on hover, optionally with custom content. Defaults to `true`. */
687
966
  tooltip?: boolean | TooltipOptions;
688
- /** Show a vertical crosshair on hover (point charts). Defaults to `true`. */
689
- crosshair?: boolean;
967
+ /**
968
+ * Show a vertical crosshair on hover (point charts). `{ value: true }` also
969
+ * draws a line through the pointer across the plot, with the value there
970
+ * written on the value axis (line, area, bar and candlestick charts; on the
971
+ * first axis of a chart with two). Defaults to `true`.
972
+ */
973
+ crosshair?: boolean | CrosshairOptions;
974
+ /**
975
+ * Draw a dot on every value of the hovered category (point charts).
976
+ * `false` leaves the crosshair and the tooltip. Defaults to `true`.
977
+ */
978
+ activePoints?: boolean;
690
979
  /** Show a legend with toggles. Defaults to showing it for two or more entries. */
691
980
  legend?: boolean | LegendOptions;
692
981
  /**
@@ -708,8 +997,11 @@ interface BaseOptions {
708
997
  * Write the values on the marks: bars at their end, stacked segments,
709
998
  * cells and slices inside (slices show their share), lines and points
710
999
  * above their last point (`points: 'all'` for every one). Labels that do
711
- * not fit are left out. Needs `@tabler/charts/value-labels` on the core
712
- * (`@tabler/charts` includes it).
1000
+ * not fit are left out (`overMarks: true` keeps the labels of a line
1001
+ * where it crosses the bars). A series' own `valueLabels` overrides this for
1002
+ * that series, and each label carries its series classes
1003
+ * (`tc-series tc-series-{n}`). Needs `@tabler/charts/value-labels` on the
1004
+ * core (`@tabler/charts` includes it).
713
1005
  */
714
1006
  valueLabels?: boolean | ValueLabelOptions;
715
1007
  /**
@@ -739,7 +1031,7 @@ interface BaseOptions {
739
1031
  keyboard?: boolean;
740
1032
  /**
741
1033
  * A download menu in the chart's corner: `true` offers PNG and SVG, a list
742
- * picks the formats (`['png', 'svg', 'jpeg', 'webp']`), an object also
1034
+ * picks the formats (`['png', 'svg', 'jpeg', 'webp', 'csv']`), an object also
743
1035
  * sets the file name and the export options. Needs `@tabler/charts/export`
744
1036
  * imported, and on the core the `download()` plugin (the `Chart` of
745
1037
  * `@tabler/charts` has it).
@@ -754,7 +1046,7 @@ interface BaseOptions {
754
1046
  }
755
1047
  /** Full chart configuration: base options, the chart type and its options. */
756
1048
  type ChartConfig<O extends object = object> = BaseOptions & O & {
757
- type: ChartType<O>;
1049
+ type: ChartType<O, object>;
758
1050
  };
759
1051
  interface Size {
760
1052
  width: number;
@@ -762,13 +1054,29 @@ interface Size {
762
1054
  }
763
1055
  /** Resolve the final pixel size from options and the measured container size. */
764
1056
  declare function resolveSize(options: BaseOptions, measured?: Partial<Size>): Size;
765
- /** Render context for a config and size (also used by plugins such as the data table). */
766
- 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;
1057
+ /**
1058
+ * The chart model of a config: what its type's `prepare()` works out from
1059
+ * it, once per config object, or the config itself for a type without one.
1060
+ */
1061
+ declare function chartModel(config: ChartConfig<object>): object;
1062
+ /** What a render context is made for, besides the config. */
1063
+ interface ContextOptions {
1064
+ size: Size;
1065
+ /** Id prefix of the chart. */
1066
+ id: string;
1067
+ hidden: ReadonlySet<string>;
1068
+ /** Measured font size, used when the config sets none. */
1069
+ fontSize?: number;
1070
+ /** The resolved `rtl` option; by default `rtl: true` in the config. */
1071
+ rtl?: boolean;
1072
+ }
1073
+ /** Render context for a config and size. */
1074
+ declare function renderContext<O extends object>(config: ChartConfig<O>, { size, id, hidden, fontSize, rtl }: ContextOptions): RenderContext;
767
1075
  /** Legend entries of a config, whether a legend is shown and where. */
768
1076
  interface ResolvedLegend {
769
1077
  items: LegendItem[];
770
1078
  show: boolean;
771
- position: "top" | "bottom";
1079
+ position: NonNullable<LegendOptions["position"]>;
772
1080
  }
773
1081
  /** Legend entries of a config, and whether the legend is shown. */
774
1082
  declare function resolveLegend<O extends object>(config: ChartConfig<O>): ResolvedLegend;
@@ -779,11 +1087,18 @@ declare function resolveLegend<O extends object>(config: ChartConfig<O>): Resolv
779
1087
  * page's language.
780
1088
  */
781
1089
  declare function chartLabel(config: ChartConfig<object>): string;
1090
+ /** A chart built without the DOM: its root `<svg>`, and how it answers interaction. */
1091
+ interface BuiltChart {
1092
+ svg: VNode;
1093
+ interaction?: Interaction;
1094
+ }
782
1095
  /**
783
- * Build the VNode tree of a chart: a pure function of the config and size,
784
- * shared by the DOM chart and server-side rendering.
1096
+ * Build a chart for a size: a pure function of the config and size, shared
1097
+ * by the DOM chart and server-side rendering. `buildChart()` keeps the svg.
785
1098
  */
786
- declare function buildChart<O extends object>(config: ChartConfig<O>, size: Size, id?: string, onHitTest?: (interaction: Interaction) => void): VNode;
1099
+ declare function renderChart<O extends object>(config: ChartConfig<O>, size: Size, id?: string): BuiltChart;
1100
+ /** Build the VNode tree of a chart for a size (see `renderChart()`). */
1101
+ declare function buildChart<O extends object>(config: ChartConfig<O>, size: Size, id?: string): VNode;
787
1102
  /**
788
1103
  * Render a chart to an SVG string, e.g. on the server.
789
1104
  *
@@ -837,10 +1152,10 @@ type Handler<T> = (event: T) => void;
837
1152
  declare class Chart<O extends object = object> {
838
1153
  #private;
839
1154
  /** Element the chart renders into. */
840
- readonly element: Element;
1155
+ readonly element: HTMLElement;
841
1156
  /** Id prefix used for elements inside the chart. */
842
1157
  readonly id: string;
843
- constructor(target: Element | string, config: ChartConfig<O>, defaultPlugins?: readonly ChartPlugin[]);
1158
+ constructor(target: HTMLElement | string, config: ChartConfig<O>, defaultPlugins?: readonly ChartPlugin[]);
844
1159
  /** Current configuration. */
845
1160
  get config(): ChartConfig<O>;
846
1161
  /** Size of the last render. */
@@ -913,4 +1228,4 @@ declare class Chart<O extends object = object> {
913
1228
  /** Call the handlers of an event (plugins emit `click`, for instance). */
914
1229
  emit<K extends keyof ChartEvents>(name: K, event: ChartEvents[K]): void;
915
1230
  }
916
- export { CartesianOptions as $, labelsStep as A, downloadChart as B, DownloadOption as C, HitTester as Ct, ChartPlugin as D, BeforeRenderState as E, register as F, patternDefs as G, exportSVG as H, DownloadOptions as I, LegendItem as J, patternFills as K, ExportOptions as L, Features as M, feature as N, PluginInstance as O, features as P, CartesianData as Q, ExportTarget as R, DownloadMenuOptions as S, HitItem as St, AfterRenderState as T, markerPath as U, exportImage as V, shapesStep as W, defaultHidden as X, LegendOptions as Y, legendContent as Z, TooltipPlacement as _, thinTicks as _t, ChartType as a, domainOf as at, tooltipContent as b, tableContent as bt, Size as c, seriesTable as ct, chartLabel as d, LinearTicksOptions as dt, CategoryAxisOptions as et, chartToString as f, Tick as ft, TooltipOptions as g, linearTicks as gt, resolveSize as h, bandTicks as ht, ChartEvents as i, categoryInteraction as it, valueLabels as j, ValueLabelOptions as k, buildChart as l, AxisOptions as lt, resolveLegend as m, axisSize as mt, Chart as n, Series as nt, RenderContext as o, seriesKey as ot, renderContext as p, axis as pt, patternVars as q, ChartConfig as r, ValueAxisOptions as rt, ResolvedLegend as s, seriesLegend as st, BaseOptions as t, Label as tt, chartEvents as u, AxisPosition as ut, hitAnchor as v, DataTable as vt, download as w, Interaction as wt, DownloadFormat as x, Hit as xt, placeTooltip as y, describeHit as yt, ImageOptions as z };
1231
+ export { markerPath as $, DownloadOption as A, axis as At, BeforeRenderState as B, HitCursor as Bt, TooltipOptions as C, Zoomable as Ct, tooltipContent as D, AxisPosition as Dt, placeTooltip as E, AxisOptions as Et, Features as F, DataTable as Ft, ExportOptions as G, PluginInstance as H, HitTester as Ht, feature as I, describeHit as It, downloadChart as J, ExportTarget as K, features as L, tableContent as Lt, ValueLabelOptions as M, bandTicks as Mt, labelsStep as N, linearTicks as Nt, DownloadFormat as O, LinearTicksOptions as Ot, valueLabels as P, thinTicks as Pt, markerClip as Q, register as R, Highlight as Rt, resolveSize as S, ZoomOptions as St, hitAnchor as T, viewWindow as Tt, CSVOptions as U, Interaction as Ut, ChartPlugin as V, HitItem as Vt, DownloadOptions as W, exportImage as X, exportCSV as Y, exportSVG as Z, chartModel as _, domainOf as _t, ChartEvents as a, LegendOptions as at, renderContext as b, seriesTable as bt, CrosshairOptions as c, EndLabelOptions as ct, ResolvedLegend as d, CartesianOptions as dt, shapesStep as et, Size as f, CategoryAxisOptions as ft, chartLabel as g, categoryInteraction as gt, chartEvents as h, ValueAxisOptions as ht, ChartConfig as i, LegendItem as it, download as j, axisSize as jt, DownloadMenuOptions as k, Tick as kt, RenderContext as l, endLabels as lt, buildChart as m, Series as mt, BuiltChart as n, patternFills as nt, ChartType as o, defaultHidden as ot, TableContext as p, Label as pt, ImageOptions as q, Chart as r, patternVars as rt, ContextOptions as s, legendContent as st, BaseOptions as t, patternDefs as tt, RenderResult as u, CartesianData as ut, chartToString as v, seriesKey as vt, TooltipPlacement as w, viewRange as wt, resolveLegend as x, ViewWindow as xt, renderChart as y, seriesLegend as yt, AfterRenderState as z, Hit as zt };