@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cartesian-COglz544.js","names":[],"sources":["../src/components/grid.ts","../src/scales/band.ts","../src/scales/linear.ts","../src/charts/cartesian.ts"],"sourcesContent":["import type { Rect } from '../layout.ts'\nimport { round } from '../layout.ts'\nimport { h, type VNode } from '../vnode.ts'\nimport type { Tick } from './axis.ts'\n\nexport interface GridOptions {\n /** `'y'` draws horizontal lines at y ticks, `'x'` vertical lines at x ticks. */\n direction: 'x' | 'y'\n ticks: readonly Tick[]\n area: Rect\n}\n\n/**\n * Render grid lines as `<g class=\"tc-grid tc-grid-{x|y}\">`. The line at\n * value `0` also gets `tc-grid-line-zero`, so the baseline can be emphasized.\n */\nexport function grid(options: GridOptions): VNode {\n const { direction, ticks, area } = options\n return h(\n 'g',\n { key: `grid-${direction}`, class: ['tc-grid', `tc-grid-${direction}`], 'aria-hidden': 'true' },\n ticks.map((tick) => {\n const p = round(tick.position)\n return h('line', {\n key: tick.value,\n class: ['tc-grid-line', tick.value === 0 && 'tc-grid-line-zero'],\n // Positioned with a transitionable transform, so lines glide when the scale changes.\n ...(direction === 'y'\n ? {\n x1: area.x,\n x2: area.x + area.width,\n y1: 0,\n y2: 0,\n style: `transform:translateY(${p}px)`,\n }\n : {\n x1: 0,\n x2: 0,\n y1: area.y,\n y2: area.y + area.height,\n style: `transform:translateX(${p}px)`,\n }),\n })\n }),\n )\n}\n","/** Category identifier used by band and point scales. */\nexport type BandKey = string | number\n\nexport interface BandScaleOptions {\n /** Share of each step left empty between bands, `0…1`. Defaults to `0`. */\n paddingInner?: number\n /** Space before the first and after the last band, in steps. Defaults to `0`. */\n paddingOuter?: number\n /** Where leftover space goes: `0` start, `0.5` center, `1` end. Defaults to `0.5`. */\n align?: number\n}\n\n/** Discrete scale splitting a range into equal bands, one per category. */\nexport interface BandScale {\n /** Start of the band for `key`, or `undefined` for unknown keys. */\n (key: BandKey): number | undefined\n readonly domain: readonly BandKey[]\n readonly range: readonly [number, number]\n /** Width of a single band. */\n readonly bandwidth: number\n /** Distance between the starts of adjacent bands. */\n readonly step: number\n /** Start of the band at `index`. */\n at(index: number): number\n /** Center of the band for `key`. */\n center(key: BandKey): number | undefined\n /** Index of the band nearest to `pixel` (for hit testing), or `-1` when empty. */\n indexAt(pixel: number): number\n}\n\n/**\n * Create a band scale, e.g. for bar charts.\n *\n * ```ts\n * const x = band(['Jan', 'Feb', 'Mar'], [0, 300], { paddingInner: 0.2 })\n * x('Feb') // start of the \"Feb\" band\n * x.bandwidth // bar width\n * ```\n */\nexport function band(\n domain: readonly BandKey[],\n range: readonly [number, number],\n options: BandScaleOptions = {},\n): BandScale {\n const { paddingInner = 0, paddingOuter = 0, align = 0.5 } = options\n const inner = Math.min(1, Math.max(0, paddingInner))\n const n = domain.length\n const [r0, r1] = range\n const reverse = r1 < r0\n const lo = reverse ? r1 : r0\n const hi = reverse ? r0 : r1\n\n const step = (hi - lo) / Math.max(1, n - inner + paddingOuter * 2)\n const start = lo + (hi - lo - step * (n - inner)) * align\n const bandwidth = step * (1 - inner)\n\n const index = new Map<BandKey, number>()\n for (let i = 0; i < n; i++) {\n const key = domain[i] as BandKey\n if (!index.has(key)) index.set(key, i)\n }\n\n const at = (i: number): number => start + step * (reverse ? n - 1 - i : i)\n\n const scale = (key: BandKey): number | undefined => {\n const i = index.get(key)\n return i === undefined ? undefined : at(i)\n }\n\n return Object.assign(scale, {\n domain: domain.slice(),\n range: [r0, r1] as const,\n bandwidth,\n step,\n at,\n center(key: BandKey): number | undefined {\n const px = scale(key)\n return px === undefined ? undefined : px + bandwidth / 2\n },\n indexAt(pixel: number): number {\n if (n === 0) return -1\n const raw = step === 0 ? 0 : Math.round((pixel - start - bandwidth / 2) / step)\n const i = Math.min(n - 1, Math.max(0, raw))\n return reverse ? n - 1 - i : i\n },\n })\n}\n\n/**\n * Create a point scale: a band scale with zero-width bands, placing each\n * category on a single point (e.g. line charts over labels).\n * `padding` is the space before the first and after the last point, in steps.\n */\nexport function point(\n domain: readonly BandKey[],\n range: readonly [number, number],\n options: { padding?: number; align?: number } = {},\n): BandScale {\n const { padding = 0, align } = options\n return band(domain, range, {\n paddingInner: 1,\n paddingOuter: padding,\n ...(align === undefined ? {} : { align }),\n })\n}\n","import { niceDomain, ticks } from './ticks.ts'\n\nexport interface LinearScaleOptions {\n /** Clamp output to the range (and `invert()` output to the domain). */\n clamp?: boolean\n}\n\n/** Continuous scale mapping a numeric domain to a pixel range. */\nexport interface LinearScale {\n (value: number): number\n readonly domain: readonly [number, number]\n readonly range: readonly [number, number]\n /** Map a pixel back to a domain value. */\n invert(pixel: number): number\n /** Nice tick values inside the domain. */\n ticks(count?: number): number[]\n /** A copy of the scale with its domain extended to round values. */\n nice(count?: number): LinearScale\n}\n\n/**\n * Create a linear scale.\n *\n * ```ts\n * const y = linear([0, 120], [300, 0]).nice()\n * y(60) // 150\n * ```\n *\n * A zero-width domain (e.g. a single data point) maps to the middle of the range.\n */\nexport function linear(\n domain: readonly [number, number],\n range: readonly [number, number],\n options: LinearScaleOptions = {},\n): LinearScale {\n const [d0, d1] = domain\n const [r0, r1] = range\n const span = d1 - d0\n const k = span === 0 ? 0 : (r1 - r0) / span\n const mid = (r0 + r1) / 2\n const { clamp = false } = options\n const rMin = Math.min(r0, r1)\n const rMax = Math.max(r0, r1)\n const dMin = Math.min(d0, d1)\n const dMax = Math.max(d0, d1)\n\n const scale = (value: number): number => {\n if (span === 0) return mid\n const px = r0 + (value - d0) * k\n return clamp ? Math.min(rMax, Math.max(rMin, px)) : px\n }\n\n return Object.assign(scale, {\n domain: [d0, d1] as const,\n range: [r0, r1] as const,\n invert(pixel: number): number {\n if (span === 0 || r1 === r0) return d0\n const value = d0 + (pixel - r0) / k\n return clamp ? Math.min(dMax, Math.max(dMin, value)) : value\n },\n ticks(count?: number): number[] {\n return ticks(d0, d1, count)\n },\n nice(count?: number): LinearScale {\n return linear(niceDomain(d0, d1, count), range, options)\n },\n })\n}\n","import type { DataTable, LegendItem, RenderContext, TableContext } from '../chart.ts'\nimport {\n axis,\n axisSize,\n axisTitle,\n axisTitleSize,\n bandTicks,\n linearTicks,\n type Tick,\n thinTicks,\n} from '../components/axis.ts'\nimport { grid } from '../components/grid.ts'\nimport { type Features, feature, features } from '../features.ts'\nimport { formatDetail, formatTicks, type NumberFormat } from '../format.ts'\nimport type { Hit, HitCursor, HitItem, Interaction } from '../interaction.ts'\nimport {\n estimateTextWidth,\n type InsetsInput,\n LINE_HEIGHT,\n type PlotFrame,\n plotFrame,\n type Rect,\n} from '../layout.ts'\nimport { type BandKey, type BandScale, band, point } from '../scales/band.ts'\nimport { extent } from '../scales/extent.ts'\nimport { type LinearScale, linear } from '../scales/linear.ts'\nimport { niceDomain } from '../scales/ticks.ts'\nimport { type ClassValue, h, type Props, type VNode } from '../vnode.ts'\nimport type { Annotation } from './annotations.ts'\nimport { finite } from './clean.ts'\nimport { groupAttrs, keyOf, legendItems } from './named.ts'\nimport type { Zoomable } from './view.ts'\n\n/** Category label on the x axis. */\nexport type Label = string | number | Date\n\n/** A label as a `key` for keyed rendering (dates by their timestamp). */\nexport const labelKey = (label: Label): string | number =>\n label instanceof Date ? label.getTime() : label\n\n/** One data series. `null` values are gaps. */\nexport interface Series {\n /** Display name (legend, tooltip, accessibility). */\n name: string\n /** One value per label; `null`/`undefined` leaves a gap. */\n values: readonly (number | null | undefined)[]\n /** Stable identity for keyed updates. Defaults to `name`. */\n id?: string\n /**\n * Custom color; overrides the palette slot via `--tc-series-color`.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /**\n * Dashed line: dash and gap length in pixels, or a full `stroke-dasharray`\n * such as `'6 3'`. Sets `--tc-series-dash` on the series group; values\n * that could inject CSS are ignored, as for `color`.\n */\n dash?: number | string\n /**\n * Dash the line only from this label on (a forecast, provisional figures):\n * it stays solid up to the label and takes `dash` (`'5 4'` when left out)\n * after it. Line and area charts.\n */\n dashFrom?: Label\n /** Line width in pixels; overrides `--tc-stroke-width` via `--tc-series-width`. */\n width?: number\n /**\n * In a `bar` chart, draw this series as a line or a filled area over the\n * bars instead (it is left out of stacks). Needs the line module\n * (`@tabler/charts/line`, or `@tabler/charts`). Defaults to `'bar'`.\n */\n type?: 'bar' | 'line' | 'area'\n /**\n * Value axis of the series: `'y2'` draws it against the second axis\n * (options in `y2`), on the right of the plot (on the left in a\n * right-to-left chart), and leaves it out of stacks. Line, area and\n * vertical bar charts. Defaults to `'y'`.\n */\n axis?: 'y' | 'y2'\n /** Extra classes on the series group. */\n class?: ClassValue\n /** Start hidden (toggle it back from the legend). */\n hidden?: boolean\n /**\n * Write values on this series' marks, whatever the chart's `valueLabels`\n * says: `true` labels it even when the chart option is off, `false` leaves\n * it out. Needs `@tabler/charts/value-labels` on the core.\n */\n valueLabels?: boolean\n}\n\nexport interface CartesianData {\n /** Categories along x. Defaults to `1…n` for the longest series. */\n labels?: readonly Label[]\n series: readonly Series[]\n}\n\n/** Options for the value (y) axis. */\nexport interface ValueAxisOptions {\n /** Render the axis labels. Defaults to `true`. */\n show?: boolean\n /**\n * Title of the axis (e.g. a unit), beside its labels: turned 90° on the\n * left of the plot, or on the right in a right-to-left chart.\n */\n title?: string\n /** Render horizontal grid lines. Defaults to `true`. */\n grid?: boolean\n /** Fixed lower bound; overrides data and `zero`. */\n min?: number\n /** Fixed upper bound. */\n max?: number\n /** Include zero in the domain. */\n zero?: boolean\n /** Extend the domain to round tick values. Defaults to `true`. */\n nice?: boolean\n /** Approximate tick count. Defaults to one per ~60px of height. */\n ticks?: number\n format?: NumberFormat\n /** `'log'` for a logarithmic axis (positive values only). Defaults to `'linear'`. */\n scale?: 'linear' | 'log'\n}\n\n/** Options for the category (x) axis. */\nexport interface CategoryAxisOptions {\n /** Render the axis labels. Defaults to `true`. */\n show?: boolean\n /** Title of the axis, below its labels. */\n title?: string\n /** Render vertical grid lines. Defaults to `false`. */\n grid?: boolean\n /** Draw the axis line along the bottom edge. Defaults to `false`. */\n line?: boolean\n /** Format a label for display (axis ticks for categories, tooltips and the table). */\n format?: (label: Label, index: number) => string\n /**\n * Turn the labels 90°, reading bottom to top, so that many or long\n * categories all keep their label. Categories along the bottom only: not\n * on a time axis, nor in horizontal bars.\n */\n rotate?: boolean\n /**\n * `'time'` treats labels as dates or timestamps: line and area charts place\n * points at their real distance in time, with calendar-aware ticks.\n * Labels must be in ascending order. Needs `@tabler/charts/time` (included\n * in `@tabler/charts`; candlesticks label dates without it). Defaults to `'category'`.\n */\n type?: 'category' | 'time'\n /** Align time ticks to UTC instead of local time (use it for SSR). */\n utc?: boolean\n /** Run the categories from the right. Defaults to the chart's `rtl`. */\n reverse?: boolean\n}\n\nexport interface CartesianOptions extends Zoomable {\n data: CartesianData\n y?: ValueAxisOptions\n /**\n * The second value axis, for series with `axis: 'y2'` (it is drawn only\n * when a series uses it). Its labels and title stand on the other side of\n * the plot; the grid lines follow `y`.\n */\n y2?: ValueAxisOptions\n x?: CategoryAxisOptions\n /** Reference lines and bands: targets, normal ranges, events and periods. */\n annotations?: readonly Annotation[]\n /** Extra space around the plot area, in pixels. */\n padding?: InsetsInput\n}\n\nexport interface CartesianLayoutOptions {\n /** `point` places categories on points (lines), `band` on bands (bars). */\n scale: 'point' | 'band'\n /** Values spanning the y domain, when they differ from the raw data (stacks). */\n values?: readonly (number | null | undefined)[]\n /** Format of the value axis ticks, when it differs from `y.format` (percent stacks). */\n tickFormat?: NumberFormat\n /** Default for `y.zero`. */\n zero: boolean\n /** Default for `y2.zero`. Defaults to `zero`. */\n zero2?: boolean\n /** Space marks need beyond the plot edge (point radius, stroke). */\n overhang?: number\n /** Band padding for `scale: 'band'`. */\n paddingInner?: number\n paddingOuter?: number\n}\n\nexport interface CartesianLayout {\n area: Rect\n labels: readonly Label[]\n /** Category scale (along x, or along y when `horizontal`). */\n x: BandScale\n /** Value scale (along y, or along x when `horizontal`). */\n y: LinearScale\n /** Scale of the second value axis, when a series uses it. */\n y2?: LinearScale\n /** Whether categories run along y. */\n horizontal: boolean\n xTicks: Tick[]\n yTicks: Tick[]\n /** Ticks of the second value axis (with `y2`). */\n y2Ticks?: Tick[]\n /** Grid lines, drawn below the marks. */\n background: VNode[]\n /** Axes, drawn above the marks. */\n foreground: VNode[]\n /** Clip path definition and its url, for the marks group. */\n clip: { def: VNode; url: string }\n}\n\n/**\n * The options a chart type draws: the ones given, or only the categories of\n * their `view` (`prepare()` of the chart types that can be zoomed).\n */\nexport const windowed = <O extends Zoomable>(options: O): O =>\n options.view || options.zoom ? feature('zoom').window(options) : options\n\nexport const TICK_SPACING = 60\n/** Horizontal value axes need more room per label. */\nexport const TICK_SPACING_X = 80\n/** Minimal margin around the plot, in pixels. */\nexport const EDGE = 8\n\n/** Stable key of a series: its `id`, or its name. */\nexport const seriesKey: (series: Series) => string = keyOf\n\n/**\n * Whether the chart draws a second value axis: a series asks for it with\n * `axis: 'y2'`, and the values run along y (not in horizontal bars).\n */\nexport const hasY2 = (options: CartesianOptions): boolean =>\n (options as { orientation?: unknown }).orientation !== 'horizontal' &&\n options.data.series.some((s) => s.axis === 'y2')\n\n/**\n * The value axis a series is read on: a function giving each series'\n * axis options, and whether it is the second one.\n */\nexport function seriesAxes(\n options: CartesianOptions,\n): (series: Series | undefined) => { second: boolean; axis: ValueAxisOptions } {\n const second = hasY2(options)\n const y = { second: false, axis: options.y ?? {} }\n const y2 = { second: true, axis: options.y2 ?? {} }\n return (series) => (second && series?.axis === 'y2' ? y2 : y)\n}\n\n/** The scale of a series: the second one for series on `y2`. */\nexport const seriesScale = (\n layout: Pick<CartesianLayout, 'y' | 'y2'>,\n series: Series | undefined,\n): LinearScale => (layout.y2 && series?.axis === 'y2' ? layout.y2 : layout.y)\n\n/** Legend entries for series-based charts. */\nexport const seriesLegend = (data: CartesianData): LegendItem[] => legendItems(data.series)\n\n/** Categories from `data.labels`, or `1…n` for the longest series. */\nexport function resolveLabels(data: CartesianData): Label[] {\n if (data.labels) return data.labels.slice()\n const n = Math.max(0, ...data.series.map((s) => s.values.length))\n return Array.from({ length: n }, (_, i) => i + 1)\n}\n\n/**\n * Whether a value can be plotted on the axis: finite, and positive on a log\n * scale (zero and negatives become gaps there).\n */\nexport function plottable(\n value: number | null | undefined,\n axis: ValueAxisOptions | undefined,\n): value is number {\n if (value == null || !Number.isFinite(value)) return false\n return axis?.scale !== 'log' || value > 0\n}\n\n/**\n * Whether the category axis carries time: `x.type === 'time'` and every label\n * is a date, a timestamp or a parseable string. Otherwise the axis falls back\n * to categories instead of producing NaN positions.\n */\nexport const isTimeAxis = (options: CartesianOptions): boolean =>\n options.x?.type === 'time' && resolveLabels(options.data).every((l) => Number.isFinite(toMs(l)))\n\n/** Formatter for category labels in tooltips and tables. */\nexport function labelFormatter(\n options: CartesianOptions,\n ctx: TableContext,\n): (label: Label, index: number) => string {\n if (options.x?.format) return options.x.format\n if (!isTimeAxis(options)) return (label) => String(label)\n return feature('dates')(resolveLabels(options.data), options.x?.utc, ctx.locale)\n}\n\n/** A label as a timestamp: dates, numbers, or parseable strings (ISO); `NaN` otherwise. */\n// Through Date, so timestamps out of its range are NaN too.\nexport const toMs = (label: Label): number => new Date(label).getTime()\n\n/** Value scale for a domain: linear, or logarithmic with positive-only ticks. */\nexport function valueScale(\n domain: [number, number],\n range: [number, number],\n options: ValueAxisOptions,\n): LinearScale {\n return options.scale === 'log' ? feature('log').scale(domain, range) : linear(domain, range)\n}\n\n/** Ticks of a value scale with labels; log scales format each power as is. */\nexport function valueTicks(\n scale: LinearScale,\n options: ValueAxisOptions,\n count: number,\n format: NumberFormat | undefined,\n locale: RenderContext['locale'],\n): Tick[] {\n return options.scale === 'log'\n ? feature('log').ticks(scale, count, format, locale)\n : linearTicks(scale, { count, format, locale })\n}\n\n/** The point shapes of a chart (`shapes`, or with `patterns: true`), if it has them. */\nexport const markerShape = (options: object): NonNullable<Features['point-shapes']> | undefined => {\n const { shapes, patterns } = options as { shapes?: boolean; patterns?: unknown }\n // On the core, the shapes come with their module (like the points of line charts).\n return (shapes ?? patterns === true) ? features['point-shapes'] : undefined\n}\n\n/**\n * A point of the series in color slot `slot`: a circle, or the slot's marker\n * when the chart has point shapes (see `markerShape`).\n */\nexport function pointMark(\n shape: ReturnType<typeof markerShape>,\n slot: number,\n key: string | number,\n cls: ClassValue,\n cx: number,\n cy: number,\n r: number,\n): VNode {\n return shape\n ? h('path', { key, class: [cls, 'tc-marker'], d: shape(slot, cx, cy, r) })\n : h('circle', { key, class: cls, cx, cy, r })\n}\n\n/** The tick count asked for on an axis (a number up to 100), or `auto`. */\nexport const tickCount = (axis: { ticks?: number } | undefined, auto: number): number =>\n Math.min(finite(axis?.ticks) ?? auto, 100)\n\n/** Y domain from the data and axis options. */\nexport function valueDomain(\n data: CartesianData,\n options: ValueAxisOptions,\n zeroDefault: boolean,\n count: number,\n hidden: ReadonlySet<string> = new Set(),\n override?: readonly (number | null | undefined)[],\n extra: readonly number[] = [],\n): [number, number] {\n // (extra: values to include besides the data, e.g. annotation targets)\n const values =\n override ?? data.series.filter((s) => !hidden.has(seriesKey(s))).flatMap((s) => s.values)\n return domainOf(extra.length ? [...values, ...extra] : values, options, zeroDefault, count)\n}\n\n/** A niced numeric domain for `values`, honouring zero, min, max and nice. */\nexport function domainOf(\n values: readonly (number | null | undefined)[],\n options: ValueAxisOptions,\n zeroDefault: boolean,\n count: number,\n): [number, number] {\n if (options.scale === 'log') return feature('log').domain(values, options)\n // Bounds may come from outside: only numbers count.\n const min = finite(options.min)\n const max = finite(options.max)\n let [lo, hi] = extent(values) ?? [0, 1]\n if (options.zero ?? zeroDefault) {\n lo = Math.min(lo, 0)\n hi = Math.max(hi, 0)\n }\n if (lo === hi) {\n // A flat series still needs a visible range.\n if (lo === 0) {\n hi = 1\n } else {\n const pad = Math.abs(lo) * 0.1\n lo -= pad\n hi += pad\n }\n }\n if (min !== null) lo = min\n if (max !== null) hi = max\n if (options.nice !== false) {\n const [nlo, nhi] = niceDomain(lo, hi, count)\n if (min === null) lo = nlo\n if (max === null) hi = nhi\n }\n return [lo, hi]\n}\n\n/** The annotations feature, when the chart has annotations (it then must be registered). */\nexport function notesFeature(\n options: CartesianOptions,\n): NonNullable<Features['annotations']> | undefined {\n return options.annotations?.length ? feature('annotations') : undefined\n}\n\n/**\n * The category axis of a cartesian layout: the labels at its edges (for the\n * margins), its scale over a pixel range, and its ticks on that scale.\n */\nexport interface CategoryAxis {\n edges: readonly string[]\n scale(range: [number, number]): BandScale\n ticks(scale: BandScale): Tick[]\n /** Pixel position of a date, on time axes (after `scale()`). */\n readonly time?: ((date: Date) => number) | undefined\n}\n\n/**\n * The value axis of a cartesian layout, before the plot area is known: its\n * scale over a pixel range, the ticks of that scale, and `probe`, ticks to\n * measure the labels with (their positions mean nothing). `auto` is the\n * tick count the plot has room for, unless the axis asks for its own.\n */\nexport function valueAxis(\n options: CartesianOptions,\n ctx: RenderContext,\n layout: CartesianLayoutOptions,\n auto: number,\n /** Only the series of this axis (`y` or `y2`); every series when not set. */\n which?: 'y' | 'y2',\n): {\n scale(range: [number, number]): LinearScale\n ticks(scale: LinearScale): Tick[]\n probe: Tick[]\n} {\n const second = which === 'y2'\n const axis = (second ? options.y2 : options.y) ?? {}\n const count = tickCount(axis, Math.max(2, auto))\n let domain: [number, number]\n if (second) {\n const own = options.data.series.filter((s) => s.axis === 'y2')\n const shown = own.filter((s) => !ctx.hidden.has(seriesKey(s)))\n // With all its series hidden, the axis keeps its scale instead of jumping to 0…1.\n const values = (shown.length ? shown : own).flatMap((s) => s.values)\n domain = domainOf(values, axis, layout.zero2 ?? layout.zero, count)\n } else {\n const data =\n which === 'y'\n ? { ...options.data, series: options.data.series.filter((s) => s.axis !== 'y2') }\n : options.data\n domain = valueDomain(\n data,\n axis,\n layout.zero,\n count,\n ctx.hidden,\n layout.values,\n notesFeature(options)?.values(options.annotations),\n )\n }\n const format = second ? axis.format : (layout.tickFormat ?? axis.format)\n const scale = (range: [number, number]) => valueScale(domain, range, axis)\n const ticks = (of: LinearScale) => valueTicks(of, axis, count, format, ctx.locale)\n return { scale, ticks, probe: ticks(scale([0, 1])) }\n}\n\n/**\n * Finish a layout that has its plot area, scales and ticks with what is\n * drawn around the marks: grid lines and annotation bands below them,\n * annotation lines and the axes above. Values run along y and categories\n * along x, or the other way round when `horizontal`. The value axis (the\n * category axis when `horizontal`) sits on the start `side`.\n */\nexport function finishLayout(\n options: CartesianOptions,\n ctx: RenderContext,\n side: PlotFrame['side'],\n overhang: number,\n plot: Omit<CartesianLayout, 'background' | 'foreground' | 'clip'>,\n keys: readonly BandKey[],\n time?: (date: Date) => number,\n): CartesianLayout {\n const { area, x, y, xTicks, yTicks, y2Ticks, horizontal: flip } = plot\n const xOptions = options.x ?? {}\n const rotate = turned(options, !flip && !time && xOptions.show !== false)\n // The second value axis stands on the other side.\n const opposite = side === 'left' ? 'right' : 'left'\n // Annotations: bands under the series, lines above them (and below the axes).\n const notes = notesFeature(options)?.layers(options.annotations, {\n area,\n horizontal: flip,\n fontSize: ctx.fontSize,\n value: y,\n band: x,\n keys,\n time,\n })\n const values = options.y?.show !== false && [\n axis({ position: flip ? 'bottom' : side, ticks: yTicks, area }),\n ]\n const categories = ((xOptions.show !== false && plot.labels.length > 0) || xOptions.line) && [\n axis({\n position: flip ? side : 'bottom',\n ticks: xTicks,\n area,\n line: xOptions.line === true,\n rotate,\n }),\n ]\n // Titles stand past the labels of their axis, or at the plot's edge when it is hidden.\n const seconds = !!y2Ticks &&\n options.y2?.show !== false && [axis({ position: opposite, ticks: y2Ticks, area })]\n const title = (\n text: string | undefined,\n position: 'left' | 'right' | 'bottom',\n ticks: readonly Tick[] | false,\n ) =>\n !!text &&\n axisTitle(position, ticks || [], area, text, ctx.fontSize, position === 'bottom' && rotate)\n const titles = [\n title(options.y?.title, flip ? 'bottom' : side, !!values && yTicks),\n title(xOptions.title, flip ? side : 'bottom', xTicks),\n !!y2Ticks && title(options.y2?.title, opposite, !!seconds && y2Ticks),\n ]\n const present = (parts: (VNode | VNode[] | null | false | undefined)[]): VNode[] =>\n parts.flatMap((part) => part || [])\n return {\n ...plot,\n background: present([\n options.y?.grid !== false && grid({ direction: flip ? 'x' : 'y', ticks: yTicks, area }),\n xOptions.grid && grid({ direction: flip ? 'y' : 'x', ticks: xTicks, area }),\n notes?.under,\n ]),\n // The axis on the left first, then the one at the bottom.\n foreground: present([\n notes?.over,\n flip ? categories : values,\n flip ? values : categories,\n seconds,\n ...titles,\n ]),\n clip: plotClip(ctx, area, overhang),\n }\n}\n\n/** Whether the category labels are turned 90° (`x.rotate`), when the axis can take it. */\nconst turned = (options: CartesianOptions, able: boolean): boolean =>\n able && options.x?.rotate === true\n\n/** Compute scales, ticks, grid and axes shared by line, area and bar charts. */\nexport function cartesianLayout(\n options: CartesianOptions,\n ctx: RenderContext,\n layout: CartesianLayoutOptions,\n): CartesianLayout {\n const { data } = options\n const yOptions = options.y ?? {}\n const xOptions = options.x ?? {}\n const { fontSize, locale, width, height } = ctx\n const overhang = layout.overhang ?? 0\n const rtl = ctx.rtl === true\n const reverse = xOptions.reverse ?? rtl\n const labels = resolveLabels(data)\n const format = labelFormatter(options, ctx)\n const showY = yOptions.show !== false\n const showX = xOptions.show !== false && labels.length > 0\n const timed = isTimeAxis(options) && layout.scale === 'point'\n\n const auto = Math.round(height / TICK_SPACING)\n const second = hasY2(options)\n const value = valueAxis(options, ctx, layout, auto, second ? 'y' : undefined)\n const probeY = value.probe\n const y2Options = options.y2 ?? {}\n const value2 = second ? valueAxis(options, ctx, layout, auto, 'y2') : null\n const showY2 = !!value2 && y2Options.show !== false\n const countX = Math.max(2, Math.round(width / TICK_SPACING_X))\n const keys = labels.map(labelKey)\n const labelAt = (i: number) => format(labels[i] as Label, i)\n // Time axes (from the time module) place points by date, with calendar ticks.\n const xAxis: CategoryAxis = timed\n ? feature('time').axis(labels, keys, xOptions, countX, locale)\n : {\n // No labels, no edges: a custom format is not asked about a label that is not there.\n edges: labels.length ? [labelAt(0), labelAt(labels.length - 1)] : [],\n scale: (range) =>\n layout.scale === 'point'\n ? point(keys, range)\n : band(keys, range, {\n paddingInner: layout.paddingInner ?? 0.3,\n paddingOuter: layout.paddingOuter ?? 0.15,\n }),\n ticks: (scale) => bandTicks(scale, (_: BandKey, i) => labelAt(i)),\n }\n const edgeLabels = xAxis.edges\n const rotate = turned(options, showX && !timed)\n // Every label, to measure the longest when they are turned.\n const allX: Tick[] = rotate\n ? labels.map((_, i) => ({ value: i, position: 0, label: labelAt(i) }))\n : []\n\n // Margins: labels outside the plot, half a line above the top tick,\n // half of the first/last x label for point scales.\n const halfLine = Math.ceil((fontSize * LINE_HEIGHT) / 2)\n // The label at the value axis' end of the plot, and the one at the other end.\n const edgeWidth = (last: boolean) =>\n rotate\n ? fontSize * LINE_HEIGHT\n : showX\n ? estimateTextWidth(edgeLabels[last ? edgeLabels.length - 1 : 0] ?? '', fontSize)\n : 0\n const firstLabel = edgeWidth(reverse !== rtl)\n const lastLabel = edgeWidth(reverse === rtl)\n const edgeX = layout.scale === 'point'\n // On bands a label is centered half a step from the edge: only what is wider\n // than that needs margin (long labels on narrow bands, e.g. dates on candles).\n // The step depends on the margins, so they are worked out twice.\n const valueWidth =\n (showY ? axisSize('left', probeY, fontSize) : 0) + axisTitleSize(yOptions.title, fontSize)\n // The second axis takes the end side (measured as the right, then mirrored).\n const value2Width = value2\n ? (showY2 ? axisSize('right', value2.probe, fontSize) : 0) +\n axisTitleSize(y2Options.title, fontSize)\n : 0\n const { area, side, range } = plotFrame(ctx, options.padding, (pad) => {\n const sides = (halfStep: number) => {\n const overflow = (label: number) =>\n edgeX ? Math.ceil(label / 2) : Math.max(0, Math.ceil(label / 2 - halfStep))\n return {\n start: pad.start + Math.max(valueWidth, overflow(firstLabel), overhang, showY ? 0 : EDGE),\n end: pad.end + Math.max(value2Width, overflow(lastLabel), overhang, EDGE),\n }\n }\n const steps = Math.max(1, labels.length) * 2\n let both = sides((width - pad.start - pad.end - valueWidth - value2Width) / steps)\n if (!edgeX) both = sides((width - both.start - both.end) / steps)\n return {\n top: pad.top + Math.max(showY || showY2 ? halfLine : 0, overhang, EDGE / 2),\n bottom:\n pad.bottom +\n Math.max(\n // Without an x axis, the lowest value label still needs half a line.\n (rotate\n ? axisSize('bottom', allX, fontSize, { rotate })\n : showX\n ? axisSize('bottom', [probeY[0] as Tick], fontSize)\n : showY\n ? halfLine\n : 0) + axisTitleSize(xOptions.title, fontSize),\n overhang,\n EDGE / 2,\n ),\n ...both,\n }\n })\n\n const x = xAxis.scale(range(reverse))\n const y = value.scale([area.y + area.height, area.y])\n const y2 = value2?.scale([area.y + area.height, area.y])\n\n // Nice ticks can outnumber the count asked for: on a short plot, thin them\n // like category labels so none overlap (the grid follows the ticks kept).\n const yTicks = thinTicks(value.ticks(y), 'left', fontSize, 4)\n // Turned labels take the height of their letters along the axis, and little air between them.\n const xTicks = showX\n ? rotate\n ? thinTicks(xAxis.ticks(x), 'left', fontSize / LINE_HEIGHT, 2)\n : thinTicks(xAxis.ticks(x), 'bottom', fontSize)\n : []\n const plot: Omit<CartesianLayout, 'background' | 'foreground' | 'clip'> = {\n area,\n labels,\n x,\n y,\n horizontal: false,\n xTicks,\n yTicks,\n }\n if (value2 && y2) {\n plot.y2 = y2\n plot.y2Ticks = thinTicks(value2.ticks(y2), 'right', fontSize, 4)\n }\n\n return finishLayout(options, ctx, side, overhang, plot, keys, xAxis.time)\n}\n\n/** Clip path around the plot area, a little larger so strokes and dots are not cut. */\nexport function plotClip(\n ctx: RenderContext,\n area: Rect,\n overhang: number,\n): CartesianLayout['clip'] {\n const clipId = `${ctx.id}-clip`\n const bleed = overhang + 1\n return {\n def: h(\n 'clipPath',\n { id: clipId },\n h('rect', {\n x: area.x - bleed,\n y: area.y - bleed,\n width: area.width + bleed * 2,\n height: area.height + bleed * 2,\n }),\n ),\n url: `url(#${clipId})`,\n }\n}\n\n/** Attributes shared by every series group. */\nexport function seriesAttrs(series: Series, index: number): Props {\n const { dash, width } = series\n return {\n ...groupAttrs(series, index),\n // A map, so values from data cannot inject CSS (see normalizeStyle).\n style: {\n '--tc-series-color': series.color,\n '--tc-series-dash': Number.isFinite(dash) ? `${dash}px` : dash,\n '--tc-series-width': Number.isFinite(width) ? `${width}px` : undefined,\n },\n }\n}\n\n/** Pixels around the plot area that still count as hovering it. */\nconst HOVER_SLOP = 8\n\n/**\n * Interaction by category: the nearest category to the pointer while it is\n * over the plot area, with every visible series' value there. `anchor`\n * places each value (line point, bar end, and the bar's box); `markAt` names the series of the\n * mark directly under the pointer, if the chart has distinct marks (bars).\n * Labels and values are formatted with `x.format` / `y.format` and the locale.\n */\nexport function categoryInteraction(\n layout: CartesianLayout,\n options: CartesianOptions,\n ctx: RenderContext,\n anchor: (\n seriesIndex: number,\n index: number,\n value: number,\n ) => { x: number; y: number; box?: Rect },\n markAt?: (x: number, y: number, index: number) => number | undefined,\n): Interaction {\n const { area, x, labels, horizontal } = layout\n const { data } = options\n const formatLabel = labelFormatter(options, ctx)\n const axisOf = seriesAxes(options)\n // Each series reads its values like its axis: bounds (log) and format.\n const axes = data.series.map((s) => axisOf(s).axis)\n const formats = axes.map((axis) => formatDetail(axis.format, ctx.locale))\n // The value under the pointer, on the first value axis, a pixel precise.\n const yAxis = options.y ?? {}\n const [d0, d1] = layout.y.domain\n const [r0, r1] = layout.y.range\n const cursorText =\n yAxis.scale === 'log' || r0 === r1\n ? formatDetail(yAxis.format, ctx.locale)\n : formatTicks(Math.abs((d1 - d0) / (r1 - r0)), yAxis.format, ctx.locale)\n const cursorAt = (px: number, py: number): HitCursor | undefined => {\n const position = horizontal ? px : py\n const lo = Math.min(r0, r1)\n const hi = Math.max(r0, r1)\n const value = layout.y.invert(position)\n if (position < lo || position > hi || !Number.isFinite(value)) return undefined\n const cursor: HitCursor = {\n value,\n text: cursorText(value),\n position,\n side: horizontal ? 'bottom' : ctx.rtl ? 'right' : 'left',\n }\n if (yAxis.show === false) cursor.inside = true\n return cursor\n }\n\n const hitAt = (index: number): Hit => {\n const start = x.at(index)\n const center = start + x.bandwidth / 2\n const label = labels[index] as Label\n // Where a missing value is anchored: the category center on its axis.\n const empty = horizontal ? { x: area.x, y: center } : { x: center, y: null }\n const items: HitItem[] = []\n data.series.forEach((series, seriesIndex) => {\n if (ctx.hidden.has(seriesKey(series))) return\n const raw = series.values[index]\n const value = plottable(raw, axes[seriesIndex]) ? raw : null\n const point = value === null ? empty : anchor(seriesIndex, index, value)\n const item: HitItem = {\n name: series.name,\n seriesIndex,\n value,\n text: value === null ? '–' : (formats[seriesIndex] as (v: number) => string)(value),\n ...point,\n }\n if (series.color) item.color = series.color\n items.push(item)\n })\n // Horizontal bars run the categories along y: the hit sits at the plot center on x.\n const hit: Hit = {\n index,\n label: labelKey(label),\n title: formatLabel(label, index),\n x: horizontal ? area.x + area.width / 2 : center,\n area,\n items,\n }\n if (horizontal) {\n hit.y = center\n hit.axis = 'y'\n }\n if (x.bandwidth > 0) {\n hit.highlight = horizontal\n ? { kind: 'band', x: area.x, y: start, width: area.width, height: x.bandwidth }\n : { kind: 'band', x: start, y: area.y, width: x.bandwidth, height: area.height }\n }\n return hit\n }\n\n return {\n count: labels.length,\n reversed: x.range[1] < x.range[0],\n hitTest(px, py) {\n if (labels.length === 0) return null\n if (\n px < area.x - HOVER_SLOP ||\n px > area.x + area.width + HOVER_SLOP ||\n py < area.y - HOVER_SLOP ||\n py > area.y + area.height + HOVER_SLOP\n ) {\n return null\n }\n const index = x.indexAt(horizontal ? py : px)\n const hit = hitAt(index)\n const mark = markAt?.(px, py, index)\n if (mark !== undefined) hit.seriesIndex = mark\n const cursor = cursorAt(px, py)\n if (cursor) hit.cursor = cursor\n return hit\n },\n hitIndex(index, seriesIndex) {\n if (index < 0 || index >= labels.length) return null\n const hit = hitAt(index)\n if (seriesIndex !== undefined && hit.items.some((item) => item.seriesIndex === seriesIndex)) {\n hit.seriesIndex = seriesIndex\n }\n return hit\n },\n }\n}\n\n/** Accessible table of series values: one row per category, one column per visible series. */\nexport function seriesTable(\n options: CartesianOptions,\n ctx: TableContext,\n limit: number = Number.POSITIVE_INFINITY,\n): DataTable {\n const all = resolveLabels(options.data)\n const labels = all.length > limit ? all.slice(0, limit) : all\n const formatLabel = labelFormatter(options, ctx)\n const axisOf = seriesAxes(options)\n const series = options.data.series.filter((s) => !ctx.hidden.has(seriesKey(s)))\n const formats = series.map((s) => formatDetail(axisOf(s).axis.format, ctx.locale))\n return {\n columns: ['', ...series.map((s) => s.name)],\n total: all.length,\n rows: labels.map((label, i) => [\n formatLabel(label, i),\n ...series.map((s, n) => {\n const v = s.values[i]\n return v == null || !Number.isFinite(v) ? '–' : (formats[n] as (v: number) => string)(v)\n }),\n ]),\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,SAAgB,KAAK,SAA6B;CAChD,MAAM,EAAE,WAAW,OAAO,SAAS;CACnC,OAAO,EACL,KACA;EAAE,KAAK,QAAQ;EAAa,OAAO,CAAC,WAAW,WAAW,WAAW;EAAG,eAAe;CAAO,GAC9F,MAAM,KAAK,SAAS;EAClB,MAAM,IAAI,MAAM,KAAK,QAAQ;EAC7B,OAAO,EAAE,QAAQ;GACf,KAAK,KAAK;GACV,OAAO,CAAC,gBAAgB,KAAK,UAAU,KAAK,mBAAmB;GAE/D,GAAI,cAAc,MACd;IACE,IAAI,KAAK;IACT,IAAI,KAAK,IAAI,KAAK;IAClB,IAAI;IACJ,IAAI;IACJ,OAAO,wBAAwB,EAAE;GACnC,IACA;IACE,IAAI;IACJ,IAAI;IACJ,IAAI,KAAK;IACT,IAAI,KAAK,IAAI,KAAK;IAClB,OAAO,wBAAwB,EAAE;GACnC;EACN,CAAC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,IAAI;CAC1D,MAAM,cAAc,eAAe,SAAS,GAAG;CAC/C,MAAM,SAAS,WAAW,OAAO;CACjC,MAAM,SAAS,QAAQ,KAAK,OAAO,QAAQ,MAAM,CAAC,IAAI,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC;CAC9E,MAAM,UAAU,OAAO,KAAK,MAAM,aAAa,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC;CACjF,OAAO;EACL,SAAS,CAAC,IAAI,GAAG,OAAO,KAAK,MAAM,EAAE,IAAI,CAAC;EAC1C,OAAO,IAAI;EACX,MAAM,OAAO,KAAK,OAAO,MAAM,CAC7B,YAAY,OAAO,CAAC,GACpB,GAAG,OAAO,KAAK,GAAG,MAAM;GACtB,MAAM,IAAI,EAAE,OAAO;GACnB,OAAO,KAAK,QAAQ,CAAC,OAAO,SAAS,CAAC,IAAI,MAAO,QAAQ,EAAE,CAA2B,CAAC;EACzF,CAAC,CACH,CAAC;CACH;AACF"}
@@ -1,30 +1,14 @@
1
- import { n as feature, r as features } from "./features-BMxkqCyS.js";
1
+ import { n as feature, r as features } from "./features-B55rwpQC.js";
2
+ import { t as hitKey } from "./interaction-En1KlwFO.js";
2
3
  import { t as h } from "./vnode-_EMUqysL.js";
3
- import { a as render, c as isValidTag, s as isValidAttr } from "./dom-CuceR8gt.js";
4
- // src/interaction.ts
5
- /** Identity of a hit, used to emit hover changes only when it changes. */
6
- function hitKey(hit) {
7
- return hit ? `${hit.index}:${hit.seriesIndex ?? ""}` : "";
8
- }
9
- /**
10
- * Convert a pointer position to chart pixels, accounting for the SVG being
11
- * scaled by CSS (e.g. `max-width: 100%`).
12
- */
13
- function toChartPoint(svg, clientX, clientY, width, height) {
14
- const rect = svg.getBoundingClientRect();
15
- const sx = rect.width > 0 ? width / rect.width : 1;
16
- const sy = rect.height > 0 ? height / rect.height : 1;
17
- return {
18
- x: (clientX - rect.left) * sx,
19
- y: (clientY - rect.top) * sy
20
- };
21
- }
4
+ import { a as render, c as isValidTag, s as isValidAttr } from "./dom-CTse6Rvd.js";
22
5
  // src/legend.ts
23
6
  /**
24
7
  * Legend content: one toggle button per entry. Buttons are native, so they
25
8
  * are focusable and work with Enter/Space; `aria-pressed` reflects visibility.
9
+ * `shape` gives the swatches the point shapes of their slots.
26
10
  */
27
- function legendContent(items, hidden) {
11
+ function legendContent(items, hidden, shape) {
28
12
  return h("div", { class: "tc-legend-items" }, items.map((item) => {
29
13
  const off = hidden.has(item.key);
30
14
  return h("button", {
@@ -36,7 +20,10 @@ function legendContent(items, hidden) {
36
20
  `tc-series-${item.index + 1}`,
37
21
  off && "tc-legend-item-hidden"
38
22
  ],
39
- style: { "--tc-series-color": item.color },
23
+ style: {
24
+ "--tc-series-color": item.color,
25
+ ...shape?.(item.index)
26
+ },
40
27
  "aria-pressed": off ? "false" : "true",
41
28
  "data-key": item.key
42
29
  }, h("span", {
@@ -249,6 +236,8 @@ function flush() {
249
236
  return count;
250
237
  }
251
238
  // src/chart.ts
239
+ /** Whether the chart shows the value under the pointer on its value axis. */
240
+ const cursorValue = (config) => typeof config.crosshair === "object" && config.crosshair?.value === true;
252
241
  const DEFAULT_WIDTH = 600;
253
242
  const DEFAULT_ASPECT_RATIO = 2;
254
243
  const DEFAULT_FONT_SIZE = 12;
@@ -259,32 +248,41 @@ function resolveSize(options, measured) {
259
248
  const measuredWidth = measured?.width ?? 0;
260
249
  const width = Math.max(0, Math.round(Number.isFinite(options.width) ? options.width : measuredWidth > 0 ? measuredWidth : DEFAULT_WIDTH));
261
250
  const ratio = options.aspectRatio && options.aspectRatio > 0 ? options.aspectRatio : DEFAULT_ASPECT_RATIO;
262
- const height = Number.isFinite(options.height) ? options.height : options.height === "container" && (measured?.height ?? 0) > 0 ? measured?.height : width / ratio;
251
+ const height = Number.isFinite(options.height) ? options.height : options.height === "container" && (measured?.height ?? 0) > 0 ? measured?.height : options.type?.height?.(chartModel(options), width) ?? width / ratio;
263
252
  return {
264
253
  width,
265
254
  height: Math.max(0, Math.round(height))
266
255
  };
267
256
  }
268
- /** Run the chart type's `render()` for a config and size. */
269
- function renderContent(config, size, id, onHitTest, hidden, fontSize, rtl) {
270
- let found;
271
- const ctx = renderContext(config, size, id, (interaction) => {
272
- found = interaction;
273
- onHitTest(interaction);
274
- }, hidden, fontSize, rtl);
275
- const content = config.type.render(config, ctx);
276
- return features.post ? features.post(config, content, found, ctx) : content;
257
+ /** Chart models by the config they were worked out from. */
258
+ const models = /* @__PURE__ */ new WeakMap();
259
+ /**
260
+ * The chart model of a config: what its type's `prepare()` works out from
261
+ * it, once per config object, or the config itself for a type without one.
262
+ */
263
+ function chartModel(config) {
264
+ const { prepare } = config.type;
265
+ if (!prepare) return config;
266
+ const model = models.get(config) ?? prepare(config);
267
+ models.set(config, model);
268
+ return model;
269
+ }
270
+ /** Run the chart type's `render()` for a config and context, and the optional steps after it. */
271
+ function renderContent(config, ctx) {
272
+ const out = config.type.render(chartModel(config), ctx);
273
+ const result = out?.content !== void 0 ? out : { content: out };
274
+ if (features.post) result.content = features.post(config, result.content, result.interaction, ctx);
275
+ return result;
277
276
  }
278
- /** Render context for a config and size (also used by plugins such as the data table). */
279
- function renderContext(config, size, id, onHitTest, hidden, measuredFontSize, rtl = config.rtl === true) {
277
+ /** Render context for a config and size. */
278
+ function renderContext(config, { size, id, hidden, fontSize, rtl = config.rtl === true }) {
280
279
  return {
281
280
  rtl,
282
281
  width: size.width,
283
282
  height: size.height,
284
- fontSize: config.fontSize ?? measuredFontSize ?? DEFAULT_FONT_SIZE,
283
+ fontSize: config.fontSize ?? fontSize ?? DEFAULT_FONT_SIZE,
285
284
  locale: config.locale,
286
285
  id,
287
- onHitTest,
288
286
  hidden
289
287
  };
290
288
  }
@@ -301,14 +299,23 @@ function cleanData(config) {
301
299
  function assertType(config) {
302
300
  if (!config.type || typeof config.type.render !== "function") throw new TypeError("@tabler/charts: `type` must be a chart type such as line.");
303
301
  }
302
+ const POSITIONS = [
303
+ "top",
304
+ "bottom",
305
+ "left",
306
+ "right",
307
+ "auto"
308
+ ];
304
309
  /** Legend entries of a config, and whether the legend is shown. */
305
310
  function resolveLegend(config) {
306
- const items = config.type.legend?.(config) ?? [];
311
+ const items = config.type.legend?.(chartModel(config)) ?? [];
307
312
  const option = config.legend;
313
+ const show = option === void 0 ? items.length >= 2 : option !== false && items.length > 0;
314
+ const asked = typeof option === "object" ? option.position : void 0;
308
315
  return {
309
316
  items,
310
- show: option === void 0 ? items.length >= 2 : option !== false && items.length > 0,
311
- position: typeof option === "object" && option.position === "bottom" ? "bottom" : "top"
317
+ show,
318
+ position: asked && POSITIONS.includes(asked) ? asked : "top"
312
319
  };
313
320
  }
314
321
  /**
@@ -319,7 +326,7 @@ function resolveLegend(config) {
319
326
  */
320
327
  function chartLabel(config) {
321
328
  if (config.title) return config.title;
322
- const names = (config.type.legend?.(config) ?? []).map((item) => item.name).filter(Boolean);
329
+ const names = resolveLegend(config).items.map((item) => item.name).filter(Boolean);
323
330
  const shown = names.slice(0, 6).join(", ");
324
331
  return `${config.type.name} chart${names.length ? `: ${shown}${names.length > 6 ? ", …" : ""}` : ""}`;
325
332
  }
@@ -364,16 +371,25 @@ function composeChart(config, size, id, still, content, underlay, overlay, extra
364
371
  }, overlay));
365
372
  }
366
373
  /**
367
- * Build the VNode tree of a chart: a pure function of the config and size,
368
- * shared by the DOM chart and server-side rendering.
374
+ * Build a chart for a size: a pure function of the config and size, shared
375
+ * by the DOM chart and server-side rendering. `buildChart()` keeps the svg.
369
376
  */
370
- function buildChart(config, size, id = config.id ?? "tc", onHitTest = () => {}) {
377
+ function renderChart(config, size, id = config.id ?? "tc") {
371
378
  assertType(config);
372
- config = cleanData(config);
373
- const hidden = defaultHidden(resolveLegend(config).items);
374
- const content = renderContent(config, size, id, onHitTest, hidden);
375
- const base = config;
376
- return composeChart(base, size, id, isStatic(base, content), content);
379
+ const base = cleanData(config);
380
+ const { content, interaction } = renderContent(base, renderContext(base, {
381
+ size,
382
+ id,
383
+ hidden: defaultHidden(resolveLegend(base).items)
384
+ }));
385
+ return {
386
+ svg: composeChart(base, size, id, isStatic(base, content), content),
387
+ interaction
388
+ };
389
+ }
390
+ /** Build the VNode tree of a chart for a size (see `renderChart()`). */
391
+ function buildChart(config, size, id) {
392
+ return renderChart(config, size, id).svg;
377
393
  }
378
394
  /**
379
395
  * Render a chart to an SVG string, e.g. on the server.
@@ -383,7 +399,7 @@ function buildChart(config, size, id = config.id ?? "tc", onHitTest = () => {})
383
399
  * ```
384
400
  */
385
401
  function chartToString(config, size) {
386
- return renderToString(buildChart(config, size));
402
+ return renderToString(renderChart(config, size).svg);
387
403
  }
388
404
  /** The name of every chart event, for adapters that pass them all on. */
389
405
  const chartEvents = [
@@ -392,6 +408,10 @@ const chartEvents = [
392
408
  "legend-toggle",
393
409
  "render"
394
410
  ];
411
+ /** The chart's own svg in its container. */
412
+ const ROOT = ":scope > svg.tc-chart";
413
+ /** The computed style of an element, where there is one (not on the server). */
414
+ const computed = (el) => typeof getComputedStyle === "function" ? getComputedStyle(el) : void 0;
395
415
  /** The chart on each element. */
396
416
  const mounted = /* @__PURE__ */ new WeakMap();
397
417
  /**
@@ -458,11 +478,15 @@ var Chart = class {
458
478
  this.element = element;
459
479
  this.#cfg = cleanData(config);
460
480
  this.id = config.id ?? nextId();
461
- this.#adopt = element.querySelector(":scope > svg.tc-chart");
481
+ this.#adopt = element.querySelector(ROOT);
462
482
  this.#measure();
463
483
  this.#unobserve = observeResize(element, this.#onResize);
464
484
  try {
465
- for (const plugin of [...defaultPlugins, ...config.plugins ?? []]) this.#plugins.push(plugin.install(this));
485
+ for (const plugin of [
486
+ ...defaultPlugins,
487
+ ...config.type.plugins ?? [],
488
+ ...config.plugins ?? []
489
+ ]) this.#plugins.push(plugin.install(this));
466
490
  this.render();
467
491
  } catch (error) {
468
492
  this.destroy();
@@ -476,15 +500,23 @@ var Chart = class {
476
500
  /** Size of the last render. */
477
501
  get size() {
478
502
  let measured = this.#measured;
479
- if (this.#cfg.height === "container" && measured.height) {
480
- let reserved = 0;
481
- for (const plugin of this.#plugins) reserved += plugin.reservedHeight?.() ?? 0;
482
- if (reserved) measured = {
483
- ...measured,
484
- height: measured.height - reserved
485
- };
486
- }
487
- return resolveSize(this.#cfg, measured);
503
+ let beside = 0;
504
+ for (const plugin of this.#plugins) beside += plugin.reservedWidth?.() ?? 0;
505
+ if (beside && measured.width) measured = {
506
+ ...measured,
507
+ width: measured.width - beside
508
+ };
509
+ const { height, legend } = this.#cfg;
510
+ const within = Number.isFinite(height) && typeof legend === "object" && legend?.withinHeight === true;
511
+ let reserved = 0;
512
+ if (within || height === "container" && measured.height) for (const plugin of this.#plugins) reserved += plugin.reservedHeight?.() ?? 0;
513
+ if (reserved && !within) measured = {
514
+ ...measured,
515
+ height: measured.height - reserved
516
+ };
517
+ const size = resolveSize(this.#cfg, measured);
518
+ if (within) size.height = Math.max(0, size.height - Math.round(reserved));
519
+ return size;
488
520
  }
489
521
  /**
490
522
  * Whether the chart is laid out right to left: the `rtl` option, with
@@ -493,7 +525,7 @@ var Chart = class {
493
525
  get rtl() {
494
526
  const cfg = this.#cfg;
495
527
  if (this.#font === void 0) {
496
- this.#rtl = cfg.rtl === "auto" ? typeof getComputedStyle === "function" && getComputedStyle(this.element).direction === "rtl" : cfg.rtl === true;
528
+ this.#rtl = cfg.rtl === "auto" ? computed(this.element)?.direction === "rtl" : cfg.rtl === true;
497
529
  this.#font = cfg.fontSize ?? this.#measureFontSize();
498
530
  }
499
531
  return this.#rtl;
@@ -664,10 +696,15 @@ var Chart = class {
664
696
  const changed = !cache || cache.cfg !== cfg || cache.hidden !== hiddenKey;
665
697
  const stale = changed || cache?.width !== size.width || cache.height !== size.height || cache.fontSize !== fontSize || cache.rtl !== rtl;
666
698
  if (!cache || stale) {
667
- this.#current = void 0;
668
- const content = renderContent(cfg, size, this.id, (interaction) => {
669
- this.#current = interaction;
670
- }, hidden, fontSize, rtl);
699
+ if (cfg.type.sweep) features.sweep = cfg.type.sweep;
700
+ const { content, interaction } = renderContent(cfg, renderContext(cfg, {
701
+ size,
702
+ id: this.id,
703
+ hidden,
704
+ fontSize,
705
+ rtl
706
+ }));
707
+ this.#current = interaction;
671
708
  cache = {
672
709
  cfg,
673
710
  width: size.width,
@@ -748,7 +785,13 @@ var Chart = class {
748
785
  */
749
786
  #setHover(hit, event, force = false, rerender = true) {
750
787
  const key = hitKey(hit);
751
- if (!force && key === this.#hovered) return;
788
+ if (!force && key === this.#hovered) {
789
+ if (hit?.cursor && cursorValue(this.#cfg) && hit.cursor.position !== this.#hit?.cursor?.position) {
790
+ this.#hit = hit;
791
+ if (rerender) this.#schedule();
792
+ }
793
+ return;
794
+ }
752
795
  if (force && key === "" && this.#hovered === "") return;
753
796
  this.#hovered = key;
754
797
  this.#hit = hit;
@@ -765,7 +808,7 @@ var Chart = class {
765
808
  }
766
809
  /** Suspend transitions while the container keeps resizing (see `[data-resizing]` in CSS). */
767
810
  #markResizing() {
768
- const svg = this.element.querySelector(":scope > svg.tc-chart");
811
+ const svg = this.element.querySelector(ROOT);
769
812
  if (!svg) return;
770
813
  svg.setAttribute("data-resizing", "");
771
814
  clearTimeout(this.#resizeTimer);
@@ -776,14 +819,13 @@ var Chart = class {
776
819
  }
777
820
  /** The `--tc-font-size` in effect on the container, in pixels (browser only). */
778
821
  #measureFontSize() {
779
- if (typeof getComputedStyle !== "function") return void 0;
780
- const value = Number.parseFloat(getComputedStyle(this.element).getPropertyValue("--tc-font-size"));
822
+ const value = Number.parseFloat(computed(this.element)?.getPropertyValue("--tc-font-size") ?? "");
781
823
  return Number.isFinite(value) && value > 0 ? value : void 0;
782
824
  }
783
825
  /** Measure the content box, matching what `ResizeObserver` reports. */
784
826
  #measure() {
785
827
  const el = this.element;
786
- const style = typeof getComputedStyle === "function" ? getComputedStyle(el) : void 0;
828
+ const style = computed(el);
787
829
  const px = (value) => Number.parseFloat(value ?? "") || 0;
788
830
  this.#measured = {
789
831
  width: el.clientWidth - px(style?.paddingLeft) - px(style?.paddingRight),
@@ -796,6 +838,6 @@ var Chart = class {
796
838
  if (set) for (const handler of set) handler(event);
797
839
  }
798
840
  };
799
- export { defaultHidden as _, chartToString as a, resolveSize as c, flushHooks as d, run as f, renderToString as g, escapeText as h, chartLabel as i, cancel as l, escapeAttr as m, buildChart as n, renderContext as o, schedule as p, chartEvents as r, resolveLegend as s, Chart as t, flush as u, legendContent as v, toChartPoint as y };
841
+ export { escapeAttr as _, chartModel as a, defaultHidden as b, renderChart as c, resolveSize as d, cancel as f, schedule as g, run as h, chartLabel as i, renderContext as l, flushHooks as m, buildChart as n, chartToString as o, flush as p, chartEvents as r, cursorValue as s, Chart as t, resolveLegend as u, escapeText as v, legendContent as x, renderToString as y };
800
842
 
801
- //# sourceMappingURL=chart-DWn9v6qw.js.map
843
+ //# sourceMappingURL=chart-B97FBRCd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-B97FBRCd.js","names":[],"sources":["../src/legend.ts","../src/render/string.ts","../src/resize.ts","../src/scheduler.ts","../src/chart.ts"],"sourcesContent":["import type { SwatchShape } from './features.ts'\nimport { h, type VNode } from './vnode.ts'\n\n/** One legend entry: a series (or a slice, for part-to-whole charts). */\nexport interface LegendItem {\n /** Stable identity, used to toggle it. */\n key: string\n name: string\n /** Color slot: the entry wears `.tc-series-{index + 1}`. */\n index: number\n /** Custom color overriding the slot. */\n color?: string\n /** Hidden by default (e.g. `series.hidden`). */\n hidden?: boolean\n}\n\nexport interface LegendOptions {\n /**\n * Where the legend goes: above or below the chart, or beside it (`'left'`,\n * `'right'`, mirrored in a right-to-left chart) with its entries stacked\n * and the chart in the remaining width. `'auto'` puts it on the right when\n * the chart keeps two thirds of the container that way, and below\n * otherwise. Defaults to `'top'`.\n */\n position?: 'top' | 'bottom' | 'left' | 'right' | 'auto'\n /**\n * Keep the legend inside the chart's `height`: a legend above or below the\n * chart takes its height from the plot, so a chart with `height: 240` is\n * 240 pixels tall with its legend (cards in a row stay the same size).\n * Only with a `height` in pixels. Defaults to `false`: the legend adds to it.\n */\n withinHeight?: boolean\n}\n\n/**\n * Legend content: one toggle button per entry. Buttons are native, so they\n * are focusable and work with Enter/Space; `aria-pressed` reflects visibility.\n * `shape` gives the swatches the point shapes of their slots.\n */\nexport function legendContent(\n items: readonly LegendItem[],\n hidden: ReadonlySet<string>,\n shape?: SwatchShape,\n): VNode {\n return h(\n 'div',\n { class: 'tc-legend-items' },\n items.map((item) => {\n const off = hidden.has(item.key)\n return h(\n 'button',\n {\n key: item.key,\n type: 'button',\n class: [\n 'tc-legend-item',\n 'tc-series',\n `tc-series-${item.index + 1}`,\n off && 'tc-legend-item-hidden',\n ],\n // A map, so values from data cannot inject CSS (see normalizeStyle).\n style: { '--tc-series-color': item.color, ...shape?.(item.index) },\n 'aria-pressed': off ? 'false' : 'true',\n 'data-key': item.key,\n },\n h('span', { class: 'tc-legend-swatch', 'aria-hidden': 'true' }),\n h('span', { class: 'tc-legend-name' }, item.name),\n )\n }),\n )\n}\n\n/** Keys hidden by default, from the entries' own `hidden` flags. */\nexport function defaultHidden(items: readonly LegendItem[]): Set<string> {\n return new Set(items.filter((item) => item.hidden).map((item) => item.key))\n}\n","import type { Child, VNode } from '../vnode.ts'\nimport { isValidAttr, isValidTag } from './attrs.ts'\n\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\nexport interface RenderToStringOptions {\n /**\n * Add `xmlns` to a root `<svg>` that has none, so the output is a valid\n * standalone `.svg` file. Defaults to `true`.\n */\n xmlns?: boolean\n /**\n * Markup context of the root. By default common HTML elements (`div`,\n * `table`, `button`…) render as HTML and everything else as SVG.\n */\n namespace?: 'svg' | 'html'\n}\n\n/** Root tags treated as HTML when no namespace is given. */\nconst HTML_ROOTS = /* @__PURE__ */ new Set([\n 'a',\n 'b',\n 'button',\n 'caption',\n 'div',\n 'em',\n 'i',\n 'label',\n 'li',\n 'ol',\n 'p',\n 'section',\n 'small',\n 'span',\n 'strong',\n 'table',\n 'tbody',\n 'td',\n 'th',\n 'thead',\n 'tr',\n 'ul',\n])\n\n/** HTML elements that never have content and must not get a closing tag. */\nconst VOID = /* @__PURE__ */ new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'source',\n 'track',\n 'wbr',\n])\n\n/**\n * Serialize a VNode tree to markup (SSR, static export): SVG trees as\n * XML-compatible SVG, HTML trees (legend, table, tooltip) as HTML.\n *\n * Empty elements self-close only inside SVG; in HTML they get an explicit\n * closing tag (`<th></th>`), since `<th/>` would open an element there.\n * Text and attribute values are escaped. Invalid tag or attribute names and\n * inline event handlers (`on*`) are dropped, so data coming from chart\n * options can never inject markup or scripts.\n */\nexport function renderToString(node: Child, options: RenderToStringOptions = {}): string {\n if (typeof node === 'string') return escapeText(node)\n const root =\n options.xmlns !== false && node.tag === 'svg' && node.attrs.xmlns === undefined\n ? { ...node, attrs: { xmlns: SVG_NS, ...node.attrs } }\n : node\n const svg = options.namespace ? options.namespace === 'svg' : !HTML_ROOTS.has(node.tag)\n return renderNode(root, svg)\n}\n\nfunction renderNode(node: VNode, parentInSvg: boolean): string {\n const { tag, attrs, children } = node\n if (!isValidTag(tag)) return ''\n const inSvg = parentInSvg || tag === 'svg'\n\n let out = `<${tag}`\n for (const name in attrs) {\n if (!isValidAttr(name)) continue\n out += ` ${name}=\"${escapeAttr(String(attrs[name]))}\"`\n }\n\n if (children.length === 0) {\n if (inSvg) return `${out}/>`\n if (VOID.has(tag.toLowerCase())) return `${out}>`\n }\n\n out += '>'\n // Content of foreignObject is HTML again.\n const childInSvg = inSvg && tag !== 'foreignObject'\n for (const child of children) {\n out += typeof child === 'string' ? escapeText(child) : renderNode(child, childInSvg)\n }\n return `${out}</${tag}>`\n}\n\nconst TEXT_RE = /[&<>]/\nconst ATTR_RE = /[&\"<>]/\nconst TEXT_RE_G = /[&<>]/g\nconst ATTR_RE_G = /[&\"<>]/g\nconst ENTITIES: Record<string, string> = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;' }\nconst replaceEntity = (char: string): string => ENTITIES[char] as string\n\n/** Escape text content. */\nexport function escapeText(value: string): string {\n return TEXT_RE.test(value) ? value.replace(TEXT_RE_G, replaceEntity) : value\n}\n\n/** Escape a double-quoted attribute value. */\nexport function escapeAttr(value: string): string {\n return ATTR_RE.test(value) ? value.replace(ATTR_RE_G, replaceEntity) : value\n}\n","/** One `ResizeObserver` shared by every chart on the page. */\n\ntype Listener = (width: number, height: number) => void\n\nconst listeners = /* @__PURE__ */ new WeakMap<Element, Listener>()\n/** Elements observed while in the document. */\nconst seen = /* @__PURE__ */ new WeakSet<Element>()\nlet observer: ResizeObserver | undefined\n\nfunction getObserver(): ResizeObserver | undefined {\n if (observer || typeof ResizeObserver !== 'function') return observer\n observer = new ResizeObserver((entries) => {\n for (const { target, contentRect } of entries) {\n if (target.isConnected) {\n seen.add(target)\n listeners.get(target)?.(contentRect.width, contentRect.height)\n } else if (seen.has(target)) {\n // Taken out of the page without destroy(): stop observing, or the\n // observer would keep the element and its chart in memory for good.\n // `chart.resize()` observes it again if it comes back.\n seen.delete(target)\n observer?.unobserve(target)\n }\n }\n })\n return observer\n}\n\n/**\n * Call `listener` with the content size of `el` whenever it changes.\n * Returns a function that stops observing. No-op where `ResizeObserver`\n * is unavailable (SSR, old browsers). Observing again is harmless.\n */\nexport function observeResize(el: Element, listener: Listener): () => void {\n const ro = getObserver()\n if (!ro) return () => {}\n listeners.set(el, listener)\n ro.observe(el)\n return () => {\n if (listeners.get(el) !== listener) return\n listeners.delete(el)\n ro.unobserve(el)\n }\n}\n","/**\n * Batches work from all charts into a single animation frame. Scheduling the\n * same key twice before the flush runs its latest task once.\n */\n\nconst queue = /* @__PURE__ */ new Map<object, () => void>()\nlet pending = false\n\nconst requestFrame = (callback: () => void): void => {\n if (typeof requestAnimationFrame === 'function') requestAnimationFrame(callback)\n else queueMicrotask(callback)\n}\n\n/**\n * Run a task; an error it throws is reported on its own (as an uncaught\n * error, in the console and to `window.onerror`) instead of stopping the\n * tasks of other charts in the same frame.\n */\nexport function run(task: () => void): void {\n try {\n task()\n } catch (error) {\n setTimeout(() => {\n throw error\n })\n }\n}\n\n/** Run `task` in the next frame, replacing any task already queued for `key`. */\nexport function schedule(key: object, task: () => void): void {\n queue.set(key, task)\n if (!pending) {\n pending = true\n requestFrame(flush)\n }\n}\n\n/** Work `flush()` also runs: the idle queue (`idle.ts`), once something uses it. */\nexport const flushHooks: { idle?: () => number } = {}\n\n/** Drop the task queued for `key`, if any. */\nexport function cancel(key: object): void {\n queue.delete(key)\n}\n\n/**\n * Run queued tasks now, idle ones too; returns how many ran. Tasks queued\n * meanwhile run too, but each key only once: a task queued again after it\n * ran (a chart updated from its own `render` handler) waits for the next\n * frame, instead of looping in this one and freezing the page.\n */\nexport function flush(): number {\n pending = false\n let count = 0\n const ran = new Set<object>()\n const later = new Map<object, () => void>()\n // Idle work can schedule frame work in turn.\n do {\n // (A Map also visits what is added while it is walked: tasks queued meanwhile.)\n for (const [key, task] of queue) {\n queue.delete(key)\n if (ran.has(key)) later.set(key, task)\n else {\n ran.add(key)\n run(task)\n count++\n }\n }\n count += flushHooks.idle?.() ?? 0\n } while (queue.size > 0)\n for (const [key, task] of later) schedule(key, task)\n return count\n}\n","import type { DataTable } from './a11y.ts'\nimport type { ValueLabelOptions } from './charts/value-labels.ts'\nimport { type Features, feature, features } from './features.ts'\nimport type { Locale, NumberFormat } from './format.ts'\nimport { type Hit, hitKey, type Interaction } from './interaction.ts'\nimport { defaultHidden, type LegendItem, type LegendOptions } from './legend.ts'\nimport type { ChartPlugin, PluginInstance } from './plugin.ts'\nimport type { DownloadOption } from './plugins/download.ts'\nimport { render } from './render/dom.ts'\nimport { renderToString } from './render/string.ts'\nimport { observeResize } from './resize.ts'\nimport { cancel, schedule } from './scheduler.ts'\nimport type { TooltipOptions } from './tooltip.ts'\nimport { type ChildInput, type ClassValue, h, type Props, type VNode } from './vnode.ts'\n\n/** Size and environment a chart type renders into. */\nexport interface RenderContext {\n width: number\n height: number\n /** Font size used to estimate label sizes. */\n fontSize: number\n locale: Locale\n /** Unique, stable prefix for ids inside this chart. */\n id: string\n /** Keys of legend entries (series) currently hidden. */\n hidden: ReadonlySet<string>\n /** Lay the chart out right to left (the `rtl` option, resolved). */\n rtl?: boolean\n}\n\n/** What a chart type's `table()` sees: no size, since a table has none. */\nexport type TableContext = Pick<RenderContext, 'locale' | 'hidden' | 'rtl'>\n\n/**\n * What a chart type renders for one size: the content of the root `<svg>`,\n * and how pointer and keyboard map to its data (none, when left out).\n */\nexport interface RenderResult {\n content: ChildInput\n interaction?: Interaction\n}\n\n/**\n * A chart type plugin (`line`, `bar`, …). Works out its model from the chart\n * options and renders it into the content of the root `<svg>`.\n *\n * `M` is the chart model, what `prepare()` works out from the options alone\n * (the options themselves for a type without `prepare()`): `render()`,\n * `legend()`, `table()` and `height()` all read it, so a type groups or sorts\n * its data once per config, not once for each of them. `ChartType<never>`\n * stands for any chart type.\n */\nexport interface ChartType<\n O extends object = object,\n M extends object = [O] extends [never] ? object : O,\n> {\n readonly name: string\n /**\n * Clean options that may come from outside (data, annotations, axis\n * bounds from users, APIs, JSON) into the shape `render()` expects; called\n * as the config comes in, before anything reads it.\n */\n clean?(options: O): unknown\n /**\n * The chart model of the (cleaned) options: whatever the legend, the table\n * and every render share. It knows neither the size nor the hidden series\n * (the legend that hides them reads it). Called once per config.\n */\n prepare?(options: O): M\n /** The chart content for a size: bare content, or with its interaction. */\n render(model: M, context: RenderContext): ChildInput | RenderResult\n /**\n * Height in pixels at a width, for a type whose proportions are not one\n * ratio (parts of it keep their size as it narrows). Asked when `height`\n * is not set; `undefined` leaves it to `aspectRatio`.\n */\n height?(model: M, width: number): number | undefined\n /** Entries for the legend (series, slices); charts without it get no legend. */\n legend?(model: M): LegendItem[]\n /**\n * The data as a text table, for screen readers and the visible table\n * option. `limit` is the most rows wanted; report the real count in `total`.\n */\n table?(model: M, context: TableContext, limit: number): DataTable\n /**\n * Whether the chart should be focusable and keyboard-navigable by default\n * (`keyboard` in the config overrides it). Decorative types such as\n * sparklines opt out so a page of stat tiles does not multiply tab stops.\n */\n readonly keyboard?: boolean\n /**\n * How value labels (`valueLabels`) read this chart type, when not as bars\n * or points: `marks: 'slice'` writes each value as its share, inside its\n * slice; `marks: 'cell'` writes it in the middle of its mark. `format`\n * names the number format of the values in the options (by default a label\n * shows the text of the tooltip).\n */\n /**\n * How the chart's marks turn to new data in the DOM, where CSS cannot\n * animate them (arcs sweeping to their new angles). A chart in the page\n * installs it; it is part of the type, not of a module that loads, so it\n * ships only with the types that use it.\n */\n readonly sweep?: Features['sweep']\n readonly valueLabels?: {\n marks?: 'slice' | 'cell'\n format?(model: M): NumberFormat | undefined\n }\n /**\n * Plugins the chart type brings along (the zoom of a map), installed after\n * the default ones when a chart is created with this type.\n */\n readonly plugins?: readonly ChartPlugin[]\n}\n\nexport type { DataTable, LegendItem }\n\nexport interface CrosshairOptions {\n /** A line through the pointer, and the value under it on the value axis. Defaults to `false`. */\n value?: boolean\n}\n\n/** Whether the chart shows the value under the pointer on its value axis. */\nexport const cursorValue = (config: BaseOptions): boolean =>\n typeof config.crosshair === 'object' && config.crosshair?.value === true\n\n/** Options shared by every chart type. */\nexport interface BaseOptions {\n /** Fixed width in pixels. Defaults to the container width. */\n width?: number\n /**\n * Height in pixels, or `'container'` to follow the container's height (the\n * container then needs a height of its own). Defaults to width / aspectRatio.\n */\n height?: number | 'container'\n /** Width to height ratio used when `height` is not set. Defaults to `2`. */\n aspectRatio?: number\n /** Accessible name of the chart. */\n title?: string\n /** Longer accessible description. */\n description?: string\n /** Extra classes on the root `<svg>`. */\n class?: ClassValue\n /** Locale for number and date formatting. Set it explicitly for SSR. */\n locale?: Locale\n /**\n * Mirror the layout for right-to-left pages: the value axis on the right\n * and categories running from the right (`x.reverse` overrides the latter).\n * `'auto'` follows the `direction` of the container (left to right in SSR).\n * The legend, the tooltip and the download menu read right to left with it.\n * Cartesian charts, heatmaps, sparklines, sankey diagrams and percentage\n * bars. Defaults to `false`.\n */\n rtl?: boolean | 'auto'\n /**\n * Font size used to lay out labels. In the browser it is read from the\n * `--tc-font-size` custom property of the container when not set; set it\n * explicitly for SSR so server and client layouts match. Defaults to `12`.\n */\n fontSize?: number\n /** Id prefix; set it explicitly for SSR so server and client ids match. */\n id?: string\n /** Show a tooltip on hover, optionally with custom content. Defaults to `true`. */\n tooltip?: boolean | TooltipOptions\n /**\n * Show a vertical crosshair on hover (point charts). `{ value: true }` also\n * draws a line through the pointer across the plot, with the value there\n * written on the value axis (line, area, bar and candlestick charts; on the\n * first axis of a chart with two). Defaults to `true`.\n */\n crosshair?: boolean | CrosshairOptions\n /**\n * Draw a dot on every value of the hovered category (point charts).\n * `false` leaves the crosshair and the tooltip. Defaults to `true`.\n */\n activePoints?: boolean\n /** Show a legend with toggles. Defaults to showing it for two or more entries. */\n legend?: boolean | LegendOptions\n /**\n * Animate entrances and data updates (reduced motion always wins). By\n * default charts animate unless they draw more than 1000 elements (e.g. a\n * scatter of a thousand points), where transitions cost far more frame\n * time than they show; `true` animates those too.\n */\n animate?: boolean\n /**\n * Fill bars, areas, slices, rings and bubbles with patterns (and dash\n * lines), so series do not depend on color alone: `true` always, `'auto'`\n * (the default) only in forced colors (Windows High Contrast), where the\n * colors are gone, `false` never. Needs `@tabler/charts/patterns` on the\n * core (`@tabler/charts` includes it).\n */\n patterns?: boolean | 'auto'\n /**\n * Write the values on the marks: bars at their end, stacked segments,\n * cells and slices inside (slices show their share), lines and points\n * above their last point (`points: 'all'` for every one). Labels that do\n * not fit are left out (`overMarks: true` keeps the labels of a line\n * where it crosses the bars). A series' own `valueLabels` overrides this for\n * that series, and each label carries its series classes\n * (`tc-series tc-series-{n}`). Needs `@tabler/charts/value-labels` on the\n * core (`@tabler/charts` includes it).\n */\n valueLabels?: boolean | ValueLabelOptions\n /**\n * Share the hover with the other charts of this group: the category under\n * the pointer is highlighted in all of them (matched by label), with its\n * tooltip. Needs the `sync()` plugin (the `Chart` of `@tabler/charts` has it).\n */\n sync?: string\n /**\n * Give the points of each series a shape of their own (circle, square,\n * triangle, diamond…) in line, radar and scatter charts, so they do not\n * depend on color alone. Defaults to `patterns === true`. Needs\n * `@tabler/charts/point-shapes` on the core (`@tabler/charts` includes it).\n */\n shapes?: boolean\n /**\n * Render the data as an HTML table: visually hidden for screen readers\n * (`true`, the default), shown below the chart (`'visible'`), or not at all.\n * An object sets `visible` and `maxRows` (default 1000; longer data is cut\n * and the caption says so).\n */\n table?: boolean | 'visible' | { visible?: boolean; maxRows?: number }\n /** Make the chart focusable and navigable with arrow keys. Defaults to `true`. */\n keyboard?: boolean\n /**\n * A download menu in the chart's corner: `true` offers PNG and SVG, a list\n * picks the formats (`['png', 'svg', 'jpeg', 'webp', 'csv']`), an object also\n * sets the file name and the export options. Needs `@tabler/charts/export`\n * imported, and on the core the `download()` plugin (the `Chart` of\n * `@tabler/charts` has it).\n */\n download?: DownloadOption\n /**\n * Extra plugins, installed when the chart is created. The default `Chart`\n * from `@tabler/charts` already includes the built-in ones; the bare `Chart`\n * from `@tabler/charts/core` only runs these.\n */\n plugins?: readonly ChartPlugin[]\n}\n\n/** Full chart configuration: base options, the chart type and its options. */\nexport type ChartConfig<O extends object = object> = BaseOptions &\n O & { type: ChartType<O, object> }\n\nexport interface Size {\n width: number\n height: number\n}\n\nconst DEFAULT_WIDTH = 600\nconst DEFAULT_ASPECT_RATIO = 2\nconst DEFAULT_FONT_SIZE = 12\n\nlet uid = 0\nconst nextId = (): string => `tc-${++uid}`\n\n/** Resolve the final pixel size from options and the measured container size. */\nexport function resolveSize(options: BaseOptions, measured?: Partial<Size>): Size {\n const measuredWidth = measured?.width ?? 0\n // (Sizes that are not finite numbers count as not set.)\n const width = Math.max(\n 0,\n Math.round(\n Number.isFinite(options.width)\n ? (options.width as number)\n : measuredWidth > 0\n ? measuredWidth\n : DEFAULT_WIDTH,\n ),\n )\n const ratio =\n options.aspectRatio && options.aspectRatio > 0 ? options.aspectRatio : DEFAULT_ASPECT_RATIO\n const height = Number.isFinite(options.height)\n ? (options.height as number)\n : options.height === 'container' && (measured?.height ?? 0) > 0\n ? (measured?.height as number)\n : ((options as Partial<ChartConfig>).type?.height?.(\n chartModel(options as ChartConfig),\n width,\n ) ?? width / ratio)\n return { width, height: Math.max(0, Math.round(height)) }\n}\n\n/** Chart models by the config they were worked out from. */\nconst models = /* @__PURE__ */ new WeakMap<object, object>()\n\n/**\n * The chart model of a config: what its type's `prepare()` works out from\n * it, once per config object, or the config itself for a type without one.\n */\nexport function chartModel(config: ChartConfig<object>): object {\n const { prepare } = config.type\n if (!prepare) return config\n const model = models.get(config) ?? prepare(config)\n models.set(config, model)\n return model\n}\n\n/** Run the chart type's `render()` for a config and context, and the optional steps after it. */\nfunction renderContent(config: ChartConfig<object>, ctx: RenderContext): RenderResult {\n const out = config.type.render(chartModel(config), ctx)\n // Bare content has no `content` of its own (nodes, lists and text do not).\n const result =\n (out as RenderResult | null)?.content !== undefined\n ? (out as RenderResult)\n : { content: out as ChildInput }\n // Optional features finish the content (point shapes, value labels).\n if (features.post) result.content = features.post(config, result.content, result.interaction, ctx)\n return result\n}\n\n/** What a render context is made for, besides the config. */\nexport interface ContextOptions {\n size: Size\n /** Id prefix of the chart. */\n id: string\n hidden: ReadonlySet<string>\n /** Measured font size, used when the config sets none. */\n fontSize?: number\n /** The resolved `rtl` option; by default `rtl: true` in the config. */\n rtl?: boolean\n}\n\n/** Render context for a config and size. */\nexport function renderContext<O extends object>(\n config: ChartConfig<O>,\n { size, id, hidden, fontSize, rtl = config.rtl === true }: ContextOptions,\n): RenderContext {\n return {\n rtl,\n width: size.width,\n height: size.height,\n fontSize: config.fontSize ?? fontSize ?? DEFAULT_FONT_SIZE,\n locale: config.locale,\n id,\n hidden,\n }\n}\n\n/**\n * The config as cleaned by its chart type, without the options that are\n * numbers nothing can be drawn with (NaN, ±Infinity, from a division or a\n * parse gone wrong outside): their defaults apply, as if they were left out.\n */\nfunction cleanData<O extends object>(config: ChartConfig<O>): ChartConfig<O> {\n const out = {\n ...(config.type?.clean ? (config.type.clean(config) as object) : config),\n } as Record<string, unknown>\n for (const key in out) {\n if (typeof out[key] === 'number' && !Number.isFinite(out[key])) delete out[key]\n }\n return out as ChartConfig<O>\n}\n\nfunction assertType(config: ChartConfig<object>): void {\n if (!config.type || typeof config.type.render !== 'function') {\n throw new TypeError('@tabler/charts: `type` must be a chart type such as line.')\n }\n}\n\nconst POSITIONS: readonly unknown[] = ['top', 'bottom', 'left', 'right', 'auto']\n\n/** Legend entries of a config, whether a legend is shown and where. */\nexport interface ResolvedLegend {\n items: LegendItem[]\n show: boolean\n position: NonNullable<LegendOptions['position']>\n}\n\n/** Legend entries of a config, and whether the legend is shown. */\nexport function resolveLegend<O extends object>(config: ChartConfig<O>): ResolvedLegend {\n const items = config.type.legend?.(chartModel(config)) ?? []\n const option = config.legend\n const show = option === undefined ? items.length >= 2 : option !== false && items.length > 0\n const asked = typeof option === 'object' ? option.position : undefined\n const position = asked && POSITIONS.includes(asked) ? asked : 'top'\n return { items, show, position }\n}\n\n/**\n * The chart's accessible name: its `title`, or else the chart type and its\n * legend entries (\"line chart: Visitors, Sign-ups\"), since an image without\n * a name is announced as nothing at all. Set `title` for a name in the\n * page's language.\n */\nexport function chartLabel(config: ChartConfig<object>): string {\n if (config.title) return config.title\n const names = resolveLegend(config)\n .items.map((item) => item.name)\n .filter(Boolean)\n const shown = names.slice(0, 6).join(', ')\n // Screen readers do not care for capitals; a long list of names is cut short.\n return `${config.type.name} chart${names.length ? `: ${shown}${names.length > 6 ? ', …' : ''}` : ''}`\n}\n\n/** Elements beyond which charts skip transitions unless `animate: true`. */\nconst ANIMATION_LIMIT = 1000\n\n/** Number of elements in chart content. */\nconst countNodes = (child: ChildInput): number =>\n Array.isArray(child)\n ? child.reduce((n: number, c: ChildInput) => n + countNodes(c), 0)\n : child && typeof child === 'object'\n ? 1 + countNodes((child as VNode).children)\n : 0\n\n/** Whether a chart renders without transitions: asked to, or too big to animate cheaply. */\nconst isStatic = (config: ChartConfig<object>, content: ChildInput): boolean =>\n config.animate === false || (config.animate !== true && countNodes(content) > ANIMATION_LIMIT)\n\n/** Wrap chart content (and hover layers) in the accessible root `<svg>`. */\nfunction composeChart(\n config: ChartConfig<object>,\n size: Size,\n id: string,\n still: boolean,\n content: ChildInput,\n underlay?: ChildInput,\n overlay?: ChildInput,\n extraAttrs?: Props,\n rtl: boolean = config.rtl === true,\n): VNode {\n const { width, height } = size\n const descId = config.description ? `${id}-desc` : undefined\n const { patterns } = config\n // [class, root style, defs] of the pattern fills, when the chart has them.\n const fills =\n patterns === false\n ? undefined\n : (patterns === true ? feature('patterns') : features.patterns)?.(config, id)\n return h(\n 'svg',\n {\n class: [\n 'tc-chart',\n `tc-chart-${config.type.name}`,\n still && 'tc-static',\n rtl && 'tc-rtl',\n fills?.[0],\n config.class,\n ],\n style: fills?.[1],\n viewBox: `0 0 ${width} ${height}`,\n width,\n height,\n role: 'img',\n // An svg <title> would also show as a native tooltip, so the name is an attribute.\n 'aria-label': chartLabel(config),\n 'aria-describedby': descId,\n ...extraAttrs,\n },\n // Keyed, so their coming and going never shifts the (unkeyed) chart\n // content in the DOM patcher: that would recreate it and restart animations.\n descId && h('desc', { key: 'desc', id: descId }, config.description),\n fills?.[2],\n underlay && h('g', { key: 'hover-under', class: 'tc-hover-layer' }, underlay),\n content,\n overlay && h('g', { key: 'hover-over', class: 'tc-hover-layer' }, overlay),\n )\n}\n\n/** A chart built without the DOM: its root `<svg>`, and how it answers interaction. */\nexport interface BuiltChart {\n svg: VNode\n interaction?: Interaction\n}\n\n/**\n * Build a chart for a size: a pure function of the config and size, shared\n * by the DOM chart and server-side rendering. `buildChart()` keeps the svg.\n */\nexport function renderChart<O extends object>(\n config: ChartConfig<O>,\n size: Size,\n id: string = config.id ?? 'tc',\n): BuiltChart {\n assertType(config)\n const base: ChartConfig<object> = cleanData(config)\n const hidden = defaultHidden(resolveLegend(base).items)\n const { content, interaction } = renderContent(base, renderContext(base, { size, id, hidden }))\n return { svg: composeChart(base, size, id, isStatic(base, content), content), interaction }\n}\n\n/** Build the VNode tree of a chart for a size (see `renderChart()`). */\nexport function buildChart<O extends object>(\n config: ChartConfig<O>,\n size: Size,\n id?: string,\n): VNode {\n return renderChart(config, size, id).svg\n}\n\n/**\n * Render a chart to an SVG string, e.g. on the server.\n *\n * ```ts\n * chartToString({ type: line, data, id: 'sales', locale: 'en-US' }, { width: 600, height: 300 })\n * ```\n */\nexport function chartToString<O extends object>(config: ChartConfig<O>, size: Size): string {\n return renderToString(renderChart(config, size).svg)\n}\n\nexport interface ChartEvents {\n /** A legend entry was toggled (by the user or `toggleSeries()`). */\n 'legend-toggle': { key: string; name: string; index: number; hidden: boolean }\n /** After the chart content rendered into the DOM (not on hover-only updates). */\n render: { size: Size }\n /**\n * The highlighted category (or mark) changed, or its data changed while\n * highlighted. `hit` is `null` when the pointer left the plot.\n */\n hover: { hit: Hit | null; event?: PointerEvent }\n /** A click on the plot. */\n click: { hit: Hit; event: MouseEvent }\n}\n\n/** The name of every chart event, for adapters that pass them all on. */\nexport const chartEvents: readonly (keyof ChartEvents)[] = [\n 'hover',\n 'click',\n 'legend-toggle',\n 'render',\n]\n\ntype Handler<T> = (event: T) => void\n\n/** The handlers of each event: a `Map` that knows which event its key names. */\ninterface Handlers extends Map<keyof ChartEvents, Set<Handler<never>>> {\n get<K extends keyof ChartEvents>(name: K): Set<Handler<ChartEvents[K]>> | undefined\n set<K extends keyof ChartEvents>(name: K, handlers: Set<Handler<ChartEvents[K]>>): this\n}\n\n/** Where the current highlight came from. */\ntype Source =\n | { kind: 'pointer'; x: number; y: number }\n | { kind: 'index'; index: number; seriesIndex?: number }\n\n/** The output of a chart type, with what it was built for. */\ninterface Content<O extends object> {\n cfg: ChartConfig<O>\n width: number\n height: number\n hidden: string\n fontSize: number | undefined\n rtl: boolean\n content: ChildInput\n /** Whether the content renders without transitions. */\n still: boolean\n}\n\n/** The chart's own svg in its container. */\nconst ROOT = ':scope > svg.tc-chart'\n\n/** The computed style of an element, where there is one (not on the server). */\nconst computed = (el: Element): CSSStyleDeclaration | undefined =>\n typeof getComputedStyle === 'function' ? getComputedStyle(el) : undefined\n\n/** The chart on each element. */\nconst mounted = /* @__PURE__ */ new WeakMap<Element, Chart<object>>()\n\n/**\n * A chart bound to a DOM element: measures its container, renders SVG into\n * it and re-renders on `update()` and resize (batched per animation frame).\n * Features such as the tooltip, the legend and pointer input (`hover` /\n * `click` events, from `pointer()`, which the highlight and tooltip plugins\n * turn on themselves) are plugins; the `Chart` exported by `@tabler/charts`\n * installs the built-in ones.\n *\n * ```ts\n * const chart = new Chart('#sales', { type: line, data })\n * chart.update({ data: next })\n * ```\n */\nexport class Chart<O extends object = object> {\n /** Element the chart renders into. */\n readonly element: HTMLElement\n /** Id prefix used for elements inside the chart. */\n readonly id: string\n #cfg: ChartConfig<O>\n /** Container size changes, from the shared ResizeObserver. */\n #onResize = (width: number, height: number): void => {\n // Our own SVG sets the container height unless it follows the container.\n const followsHeight = this.#cfg.height === 'container'\n const changed =\n width !== this.#measured.width || (followsHeight && height !== this.#measured.height)\n this.#measured = { width, height }\n // A hidden container (display: none) measures 0×0: nothing to draw until it shows again.\n if (changed && (width || height)) {\n this.#font = undefined\n this.#markResizing()\n this.#schedule()\n }\n }\n #measured: Partial<Size> = {}\n readonly #handlers = new Map() as Handlers\n #unobserve: () => void\n readonly #plugins: PluginInstance[] = []\n #destroyed = false\n #current: Interaction | undefined\n #source: Source | undefined\n #hovered = ''\n #hit: Hit | null = null\n /** Chart type output of the last render, reused while only the highlight changes. */\n #cache: Content<O> | undefined\n #resizeTimer: ReturnType<typeof setTimeout> | undefined\n /** Visibility set by the user, overriding each entry's default. */\n readonly #toggled = new Map<string, boolean>()\n /** Server-rendered svg to take over on the first render, if any. */\n #adopt: Element | null\n /**\n * The measured `--tc-font-size` (`undefined` reads it again). Reading it\n * forces the browser to restyle the page, so new data alone reuses it.\n */\n #font: number | undefined\n /** The resolved `rtl` option, read with the font size (`'auto'` asks the container). */\n #rtl = false\n\n constructor(\n target: HTMLElement | string,\n config: ChartConfig<O>,\n defaultPlugins: readonly ChartPlugin[] = [],\n ) {\n const element =\n typeof target === 'string' ? document.querySelector<HTMLElement>(target) : target\n if (!element) throw new Error(`@tabler/charts: element \"${String(target)}\" not found.`)\n // One chart per element: a new one replaces the chart already there.\n mounted.get(element)?.destroy()\n mounted.set(element, this)\n this.element = element\n this.#cfg = cleanData(config)\n this.id = config.id ?? nextId()\n this.#adopt = element.querySelector(ROOT)\n this.#measure()\n this.#unobserve = observeResize(element, this.#onResize)\n try {\n for (const plugin of [\n ...defaultPlugins,\n ...(config.type.plugins ?? []),\n ...(config.plugins ?? []),\n ]) {\n this.#plugins.push(plugin.install(this))\n }\n this.render()\n } catch (error) {\n // Nobody gets this chart to destroy it: leave the element as it was found.\n this.destroy()\n throw error\n }\n }\n\n /** Current configuration. */\n get config(): ChartConfig<O> {\n return this.#cfg\n }\n\n /** Size of the last render. */\n get size(): Size {\n // In 'container' height mode, plugins such as the legend take part of the\n // container. Only then: measuring them forces a layout of the page.\n let measured = this.#measured\n // A legend beside the chart takes its width (it reads its own layout only then).\n let beside = 0\n for (const plugin of this.#plugins) beside += plugin.reservedWidth?.() ?? 0\n if (beside && measured.width) measured = { ...measured, width: measured.width - beside }\n const { height, legend } = this.#cfg\n // A height in pixels covers the legend when asked to (`legend.withinHeight`).\n const within =\n Number.isFinite(height) && typeof legend === 'object' && legend?.withinHeight === true\n let reserved = 0\n if (within || (height === 'container' && measured.height)) {\n for (const plugin of this.#plugins) reserved += plugin.reservedHeight?.() ?? 0\n }\n if (reserved && !within) {\n measured = { ...measured, height: (measured.height as number) - reserved }\n }\n const size = resolveSize(this.#cfg, measured)\n if (within) size.height = Math.max(0, size.height - Math.round(reserved))\n return size\n }\n\n /**\n * Whether the chart is laid out right to left: the `rtl` option, with\n * `'auto'` read from the container (together with the font size).\n */\n get rtl(): boolean {\n const cfg = this.#cfg\n if (this.#font === undefined) {\n this.#rtl =\n cfg.rtl === 'auto' ? computed(this.element)?.direction === 'rtl' : cfg.rtl === true\n this.#font = cfg.fontSize ?? this.#measureFontSize()\n }\n return this.#rtl\n }\n\n /** Font size used by the last render (explicit, measured, or the default). */\n get fontSize(): number {\n return this.#cache?.fontSize ?? this.#cfg.fontSize ?? DEFAULT_FONT_SIZE\n }\n\n /** How pointer and keyboard map to data for the current render. */\n get interaction(): Interaction | undefined {\n return this.#current\n }\n\n /** The highlighted category (hover or keyboard), or `null`. */\n get active(): Hit | null {\n return this.#hit\n }\n\n /**\n * The pointer in chart pixels while it drives the highlight (`undefined`\n * for keyboard highlights). `hitAnchor(chart.active, chart.pointer)` gives\n * where a tooltip belongs either way.\n */\n get pointer(): { x: number; y: number } | undefined {\n const source = this.#source\n return this.#hit && source?.kind === 'pointer' ? { x: source.x, y: source.y } : undefined\n }\n\n /** Whether the highlight comes from the pointer or from `highlightIndex()` (keyboard). */\n get highlightSource(): 'pointer' | 'index' | undefined {\n return this.#hit ? this.#source?.kind : undefined\n }\n\n /**\n * Highlight a category by index (and optionally one series in it), as\n * keyboard navigation does. Returns the hit, or `null` for an invalid index.\n */\n highlightIndex(index: number, seriesIndex?: number): Hit | null {\n const hit = this.#current?.hitIndex(index, seriesIndex) ?? null\n if (!hit) return null\n this.#source = { kind: 'index', index, seriesIndex }\n this.#setHover(hit)\n return hit\n }\n\n /**\n * Highlight what lies at a point in chart pixels, as the pointer does (the\n * `pointer()` plugin calls it). Returns the hit, or `null` for none.\n */\n highlightAt(x: number, y: number, event?: PointerEvent): Hit | null {\n const hit = this.hitTest(x, y)\n this.#source = { kind: 'pointer', x, y }\n this.#setHover(hit, event)\n return hit\n }\n\n /** Remove any highlight. */\n clearHighlight(event?: PointerEvent): void {\n this.#source = undefined\n this.#setHover(null, event)\n }\n\n /**\n * Show or hide a legend entry (series) by key, name or index; toggles when\n * `hidden` is omitted. Re-renders in the next frame.\n */\n toggleSeries(target: string | number, hidden?: boolean): this {\n const { items } = resolveLegend(this.#cfg)\n const item =\n typeof target === 'number'\n ? items.find((entry) => entry.index === target)\n : (items.find((entry) => entry.key === target) ??\n items.find((entry) => entry.name === target))\n if (!item) return this\n const next = hidden ?? !this.#hiddenSet(items).has(item.key)\n this.#toggled.set(item.key, next)\n this.emit('legend-toggle', { key: item.key, name: item.name, index: item.index, hidden: next })\n this.#schedule()\n return this\n }\n\n /** Whether a legend entry is hidden. */\n isHidden(key: string): boolean {\n return this.#hiddenSet(resolveLegend(this.#cfg).items).has(key)\n }\n\n /** Merge `options` into the configuration and re-render in the next frame. */\n update(options: Partial<ChartConfig<O>>): this {\n this.#cfg = cleanData({ ...this.#cfg, ...options })\n // Options such as `class` may change the font size; new data does not.\n for (const key in options) if (key !== 'data') this.#font = undefined\n this.#schedule()\n return this\n }\n\n /**\n * Replace the whole configuration and re-render in the next frame: options\n * left out go back to their defaults (`update()` would keep them).\n */\n setConfig(config: ChartConfig<O>): this {\n this.#cfg = cleanData(config)\n this.#font = undefined\n this.#schedule()\n return this\n }\n\n /** Replace the data and re-render in the next frame. */\n setData(data: O extends { data: infer D } ? D : never): this {\n return this.update({ data } as unknown as Partial<ChartConfig<O>>)\n }\n\n /**\n * Re-measure the container and re-render in the next frame. Call it when a\n * container taken out of the page without `destroy()` comes back.\n */\n resize(): this {\n // A container taken out of the page and put back is observed again.\n if (!this.#destroyed) this.#unobserve = observeResize(this.element, this.#onResize)\n this.#measure()\n this.#font = undefined\n this.#schedule()\n return this\n }\n\n /** Render synchronously now. */\n render(): this {\n if (this.#destroyed) return this\n cancel(this)\n const cfg = this.#cfg\n const config: ChartConfig<object> = cfg\n assertType(config)\n const legend = resolveLegend(cfg)\n const hidden = this.#hiddenSet(legend.items)\n for (const plugin of this.#plugins) plugin.beforeRender?.({ config, legend, hidden })\n const size = this.size\n const { content, stale, changed } = this.#content(size, hidden)\n if (stale) this.#refreshHighlight()\n\n const adopted = this.#adopt\n render(this.element, this.#compose(content, size), adopted)\n this.#adopt = null\n // The server markup was hydrated in place: snap it to the real size and\n // data instead of morphing (the server could not measure the container).\n if (adopted) this.#markResizing()\n\n for (const plugin of this.#plugins)\n plugin.afterRender?.({ config, legend, hidden, size, stale, changed })\n if (stale) this.emit('render', { size })\n return this\n }\n\n /**\n * The chart type's output for the current config, size, hidden series and\n * font size: built again when one of them changed (`stale`; `changed` when\n * it is what the chart shows, not only its size), else the one of the last render.\n */\n #content(\n size: Size,\n hidden: ReadonlySet<string>,\n ): { content: Content<O>; stale: boolean; changed: boolean } {\n const cfg = this.#cfg\n const hiddenKey = [...hidden].sort().join('\\u0000')\n const rtl = this.rtl\n const fontSize = cfg.fontSize ?? this.#font\n\n let cache = this.#cache\n const changed = !cache || cache.cfg !== cfg || cache.hidden !== hiddenKey\n const stale =\n changed ||\n cache?.width !== size.width ||\n cache.height !== size.height ||\n cache.fontSize !== fontSize ||\n cache.rtl !== rtl\n if (!cache || stale) {\n if (cfg.type.sweep) features.sweep = cfg.type.sweep\n const { content, interaction } = renderContent(\n cfg,\n renderContext(cfg, { size, id: this.id, hidden, fontSize, rtl }),\n )\n this.#current = interaction\n cache = {\n cfg,\n width: size.width,\n height: size.height,\n hidden: hiddenKey,\n fontSize,\n rtl,\n content,\n still: isStatic(cfg, content),\n }\n this.#cache = cache\n }\n return { content: cache, stale, changed }\n }\n\n /** Keep the highlight (and its consumers, like tooltips) in sync with new data or layout. */\n #refreshHighlight(): void {\n const source = this.#source\n if (!source) return\n const next =\n source.kind === 'pointer'\n ? this.hitTest(source.x, source.y)\n : (this.#current?.hitIndex(source.index, source.seriesIndex) ?? null)\n this.#setHover(next, undefined, true, false)\n }\n\n /** The root svg: the content, with the plugins' hover layers and attributes. */\n #compose(content: Content<O>, size: Size): VNode {\n const config: ChartConfig<object> = this.#cfg\n const hit = this.#hit\n const under: ChildInput[] = []\n const over: ChildInput[] = []\n let attrs: Props | undefined\n for (const plugin of this.#plugins) {\n if (hit && plugin.layers) {\n const layer = plugin.layers(hit, config)\n under.push(layer.under)\n over.push(layer.over)\n }\n const extra = plugin.svgAttrs?.(config)\n if (extra) attrs = { ...attrs, ...extra }\n }\n // Hover layers only while something is highlighted (an empty list would still render).\n return composeChart(\n config,\n size,\n this.id,\n content.still,\n content.content,\n under.length ? under : undefined,\n over.length ? over : undefined,\n attrs,\n content.rtl,\n )\n }\n\n /** What lies at a point in chart pixels, or `null`. */\n hitTest(x: number, y: number): Hit | null {\n return this.#current?.hitTest(x, y) ?? null\n }\n\n /** Subscribe to an event; returns a function that unsubscribes. */\n on<K extends keyof ChartEvents>(name: K, handler: Handler<ChartEvents[K]>): () => void {\n let set = this.#handlers.get(name)\n if (!set) {\n set = new Set()\n this.#handlers.set(name, set)\n }\n set.add(handler)\n return () => {\n set.delete(handler)\n }\n }\n\n /** Remove the chart from the DOM and stop observing its container. */\n destroy(): void {\n if (this.#destroyed) return\n this.#destroyed = true\n if (mounted.get(this.element) === this) mounted.delete(this.element)\n cancel(this)\n clearTimeout(this.#resizeTimer)\n this.#unobserve()\n for (const plugin of this.#plugins) plugin.destroy?.()\n this.#handlers.clear()\n render(this.element, null)\n }\n\n /**\n * Update the highlighted hit: emit `hover` when it changed (or when\n * `force`d after new data) and re-render the hover layers in the next frame.\n */\n #setHover(hit: Hit | null, event?: PointerEvent, force = false, rerender = true): void {\n const key = hitKey(hit)\n if (!force && key === this.#hovered) {\n // The same category, elsewhere along the values: only the value under the pointer moved.\n if (\n hit?.cursor &&\n cursorValue(this.#cfg) &&\n hit.cursor.position !== this.#hit?.cursor?.position\n ) {\n this.#hit = hit\n if (rerender) this.#schedule()\n }\n return\n }\n // After a re-render, only a highlight that is still active is worth repeating.\n if (force && key === '' && this.#hovered === '') return\n this.#hovered = key\n this.#hit = hit\n this.emit('hover', event ? { hit, event } : { hit })\n if (rerender) this.#schedule()\n }\n\n #hiddenSet(items: readonly LegendItem[]): Set<string> {\n const hidden = new Set<string>()\n for (const item of items) {\n if (this.#toggled.get(item.key) ?? item.hidden) hidden.add(item.key)\n }\n return hidden\n }\n\n /** Suspend transitions while the container keeps resizing (see `[data-resizing]` in CSS). */\n #markResizing(): void {\n const svg = this.element.querySelector(ROOT)\n if (!svg) return\n svg.setAttribute('data-resizing', '')\n clearTimeout(this.#resizeTimer)\n this.#resizeTimer = setTimeout(() => svg.removeAttribute('data-resizing'), 200)\n }\n\n #schedule(): void {\n if (!this.#destroyed) schedule(this, () => this.render())\n }\n\n /** The `--tc-font-size` in effect on the container, in pixels (browser only). */\n #measureFontSize(): number | undefined {\n const value = Number.parseFloat(\n computed(this.element)?.getPropertyValue('--tc-font-size') ?? '',\n )\n return Number.isFinite(value) && value > 0 ? value : undefined\n }\n\n /** Measure the content box, matching what `ResizeObserver` reports. */\n #measure(): void {\n const el = this.element\n const style = computed(el)\n const px = (value: string | undefined) => Number.parseFloat(value ?? '') || 0\n this.#measured = {\n width: el.clientWidth - px(style?.paddingLeft) - px(style?.paddingRight),\n height: el.clientHeight - px(style?.paddingTop) - px(style?.paddingBottom),\n }\n }\n\n /** Call the handlers of an event (plugins emit `click`, for instance). */\n emit<K extends keyof ChartEvents>(name: K, event: ChartEvents[K]): void {\n const set = this.#handlers.get(name)\n if (set) for (const handler of set) handler(event)\n }\n}\n"],"mappings":";;;;;;;;;;AAuCA,SAAgB,cACd,OACA,QACA,OACO;CACP,OAAO,EACL,OACA,EAAE,OAAO,kBAAkB,GAC3B,MAAM,KAAK,SAAS;EAClB,MAAM,MAAM,OAAO,IAAI,KAAK,GAAG;EAC/B,OAAO,EACL,UACA;GACE,KAAK,KAAK;GACV,MAAM;GACN,OAAO;IACL;IACA;IACA,aAAa,KAAK,QAAQ;IAC1B,OAAO;GACT;GAEA,OAAO;IAAE,qBAAqB,KAAK;IAAO,GAAG,QAAQ,KAAK,KAAK;GAAE;GACjE,gBAAgB,MAAM,UAAU;GAChC,YAAY,KAAK;EACnB,GACA,EAAE,QAAQ;GAAE,OAAO;GAAoB,eAAe;EAAO,CAAC,GAC9D,EAAE,QAAQ,EAAE,OAAO,iBAA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