@tabler/charts 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/README.md +165 -17
  2. package/dist/{annotations-DdRdeBUB.cjs → annotations--m-HzMBM.cjs} +87 -11
  3. package/dist/annotations--m-HzMBM.cjs.map +1 -0
  4. package/dist/{annotations-B02GR_KU.d.ts → annotations-CCDUC1lW.d.ts} +16 -30
  5. package/dist/{annotations-CHafaGd4.d.cts → annotations-CqZM1z9R.d.cts} +16 -30
  6. package/dist/{annotations-D0YQ0IoA.js → annotations-DGITy6th.js} +87 -11
  7. package/dist/annotations-DGITy6th.js.map +1 -0
  8. package/dist/annotations.cjs +2 -2
  9. package/dist/annotations.d.cts +1 -1
  10. package/dist/annotations.d.ts +1 -1
  11. package/dist/annotations.js +2 -2
  12. package/dist/{area-0-L1bG9B.js → area-BN0uE9R0.js} +4 -3
  13. package/dist/area-BN0uE9R0.js.map +1 -0
  14. package/dist/{area-CJX9219z.d.cts → area-D6LNLk3r.d.cts} +2 -2
  15. package/dist/{area-d11XePuw.d.ts → area-DEFL-Yun.d.ts} +2 -2
  16. package/dist/{area-4eRs3c0K.cjs → area-D_N8b4Ng.cjs} +4 -3
  17. package/dist/area-D_N8b4Ng.cjs.map +1 -0
  18. package/dist/area.cjs +1 -1
  19. package/dist/area.d.cts +1 -1
  20. package/dist/area.d.ts +1 -1
  21. package/dist/area.js +1 -1
  22. package/dist/axis-BzBkkC5X.cjs +305 -0
  23. package/dist/axis-BzBkkC5X.cjs.map +1 -0
  24. package/dist/axis-C5obgdJt.js +240 -0
  25. package/dist/axis-C5obgdJt.js.map +1 -0
  26. package/dist/{bar-Da6dE_nI.cjs → bar-BrmfXugT.cjs} +77 -58
  27. package/dist/bar-BrmfXugT.cjs.map +1 -0
  28. package/dist/{bar-XwzM6Pb0.d.ts → bar-Bs_rPqgR.d.ts} +1 -1
  29. package/dist/{bar-BDLR4p9c.d.cts → bar-CEt8YRxf.d.cts} +2 -2
  30. package/dist/{bar-B5n2oq9-.js → bar-CgpC2EpX.js} +2 -2
  31. package/dist/{bar-B5n2oq9-.js.map → bar-CgpC2EpX.js.map} +1 -1
  32. package/dist/{bar-BNZ3GhIw.js → bar-D_KKd2fL.js} +75 -56
  33. package/dist/bar-D_KKd2fL.js.map +1 -0
  34. package/dist/{bar-LYIF8MEz.cjs → bar-wVykm1us.cjs} +2 -2
  35. package/dist/{bar-LYIF8MEz.cjs.map → bar-wVykm1us.cjs.map} +1 -1
  36. package/dist/bar.cjs +1 -1
  37. package/dist/bar.d.cts +1 -1
  38. package/dist/bar.d.ts +1 -1
  39. package/dist/bar.js +1 -1
  40. package/dist/calendar-B7843sQu.d.cts +106 -0
  41. package/dist/calendar-BG_q_NC_.cjs +507 -0
  42. package/dist/calendar-BG_q_NC_.cjs.map +1 -0
  43. package/dist/calendar-CF3gfDQk.js +502 -0
  44. package/dist/calendar-CF3gfDQk.js.map +1 -0
  45. package/dist/calendar-D10_ki1S.d.ts +106 -0
  46. package/dist/calendar.cjs +3 -0
  47. package/dist/calendar.d.cts +3 -0
  48. package/dist/calendar.d.ts +3 -0
  49. package/dist/calendar.js +1 -0
  50. package/dist/{candlestick-BHQkQfxH.js → candlestick-B1onjo1o.js} +17 -14
  51. package/dist/candlestick-B1onjo1o.js.map +1 -0
  52. package/dist/{candlestick-Dq7qp-F0.d.cts → candlestick-B7YXUVVh.d.cts} +4 -3
  53. package/dist/{candlestick-CYCQXgky.cjs → candlestick-BwrFKak_.cjs} +17 -14
  54. package/dist/candlestick-BwrFKak_.cjs.map +1 -0
  55. package/dist/{candlestick-D0xKkdqd.d.ts → candlestick-XpqJvarq.d.ts} +4 -3
  56. package/dist/candlestick.cjs +3 -3
  57. package/dist/candlestick.d.cts +1 -1
  58. package/dist/candlestick.d.ts +1 -1
  59. package/dist/candlestick.js +3 -3
  60. package/dist/{cartesian-DV02PsBe.cjs → cartesian-B9CrasFJ.cjs} +190 -310
  61. package/dist/cartesian-B9CrasFJ.cjs.map +1 -0
  62. package/dist/{cartesian-CI2x6N7N.js → cartesian-COglz544.js} +161 -251
  63. package/dist/cartesian-COglz544.js.map +1 -0
  64. package/dist/{chart-DWn9v6qw.js → chart-B97FBRCd.js} +114 -72
  65. package/dist/chart-B97FBRCd.js.map +1 -0
  66. package/dist/{chart-QilhWP8Z.d.ts → chart-CE9EVbfV.d.ts} +427 -112
  67. package/dist/{chart-kqFMEwDo.d.cts → chart-Dz4geQZy.d.cts} +427 -112
  68. package/dist/{chart-e2VqomCI.cjs → chart-GUmmjJ7S.cjs} +132 -78
  69. package/dist/chart-GUmmjJ7S.cjs.map +1 -0
  70. package/dist/{core-BKRQvPAT.js → core-7fgM3su0.js} +188 -73
  71. package/dist/core-7fgM3su0.js.map +1 -0
  72. package/dist/{core-DRUCk67j.d.ts → core-BUQzLsRJ.d.ts} +26 -10
  73. package/dist/{core-DIOC61up.cjs → core-BZTrsPxc.cjs} +200 -73
  74. package/dist/core-BZTrsPxc.cjs.map +1 -0
  75. package/dist/{core-PAX5ogLk.d.cts → core-Ck5uHcW8.d.cts} +45 -24
  76. package/dist/core.cjs +45 -31
  77. package/dist/core.d.cts +23 -18
  78. package/dist/core.d.ts +23 -18
  79. package/dist/core.js +28 -23
  80. package/dist/{dates-DurEr9WT.cjs → dates-0YNY49KQ.cjs} +2 -2
  81. package/dist/{dates-DurEr9WT.cjs.map → dates-0YNY49KQ.cjs.map} +1 -1
  82. package/dist/{dates-C2RzY3rE.js → dates-CKDRgpin.js} +2 -2
  83. package/dist/{dates-C2RzY3rE.js.map → dates-CKDRgpin.js.map} +1 -1
  84. package/dist/decimate.cjs +1 -1
  85. package/dist/decimate.js +1 -1
  86. package/dist/{dom-D_g13XWY.cjs → dom-C33zvtPo.cjs} +3 -7
  87. package/dist/dom-C33zvtPo.cjs.map +1 -0
  88. package/dist/{dom-CuceR8gt.js → dom-CTse6Rvd.js} +3 -7
  89. package/dist/dom-CTse6Rvd.js.map +1 -0
  90. package/dist/end-labels-B3oRvjxw.js +114 -0
  91. package/dist/end-labels-B3oRvjxw.js.map +1 -0
  92. package/dist/end-labels-CS-fnpp-.cjs +119 -0
  93. package/dist/end-labels-CS-fnpp-.cjs.map +1 -0
  94. package/dist/end-labels.cjs +11 -0
  95. package/dist/end-labels.cjs.map +1 -0
  96. package/dist/end-labels.d.cts +6 -0
  97. package/dist/end-labels.d.ts +6 -0
  98. package/dist/end-labels.js +11 -0
  99. package/dist/end-labels.js.map +1 -0
  100. package/dist/{export-chart-83UYH48t.js → export-chart-BOH_nfcH.js} +92 -15
  101. package/dist/export-chart-BOH_nfcH.js.map +1 -0
  102. package/dist/{export-chart-mYgEfK-L.cjs → export-chart-Be4T9J3m.cjs} +97 -14
  103. package/dist/export-chart-Be4T9J3m.cjs.map +1 -0
  104. package/dist/export.cjs +5 -3
  105. package/dist/export.cjs.map +1 -1
  106. package/dist/export.d.cts +4 -3
  107. package/dist/export.d.ts +4 -3
  108. package/dist/export.js +5 -4
  109. package/dist/export.js.map +1 -1
  110. package/dist/{fade-GGxcBdss.js → fade-CDrQjnDz.js} +56 -78
  111. package/dist/fade-CDrQjnDz.js.map +1 -0
  112. package/dist/{fade-DVTkhrFU.cjs → fade-CRqcKMWY.cjs} +56 -78
  113. package/dist/fade-CRqcKMWY.cjs.map +1 -0
  114. package/dist/{features-BMxkqCyS.js → features-B55rwpQC.js} +4 -2
  115. package/dist/features-B55rwpQC.js.map +1 -0
  116. package/dist/{features-DCXEvoya.cjs → features-DEDP5CEQ.cjs} +9 -1
  117. package/dist/features-DEDP5CEQ.cjs.map +1 -0
  118. package/dist/fit-BPyPRnsK.js +16 -0
  119. package/dist/fit-BPyPRnsK.js.map +1 -0
  120. package/dist/fit-D4MIIQQz.cjs +21 -0
  121. package/dist/fit-D4MIIQQz.cjs.map +1 -0
  122. package/dist/funnel-B9ridzNx.d.cts +50 -0
  123. package/dist/funnel-CFEEulw_.cjs +244 -0
  124. package/dist/funnel-CFEEulw_.cjs.map +1 -0
  125. package/dist/funnel-CYCv8cq2.js +239 -0
  126. package/dist/funnel-CYCv8cq2.js.map +1 -0
  127. package/dist/funnel-FogM8flk.d.ts +50 -0
  128. package/dist/funnel.cjs +3 -0
  129. package/dist/funnel.d.cts +3 -0
  130. package/dist/funnel.d.ts +3 -0
  131. package/dist/funnel.js +1 -0
  132. package/dist/{gauge-DXkjXNCD.cjs → gauge-6HfDcLMJ.cjs} +28 -28
  133. package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
  134. package/dist/{gauge-BSist7My.d.cts → gauge-BScJ7U6O.d.cts} +2 -2
  135. package/dist/{gauge-0VJuAHWF.d.ts → gauge-D78oq1Lx.d.ts} +2 -2
  136. package/dist/{gauge-ts0kqN1-.js → gauge-DiTk5aWO.js} +28 -28
  137. package/dist/gauge-DiTk5aWO.js.map +1 -0
  138. package/dist/gauge.cjs +1 -1
  139. package/dist/gauge.d.cts +1 -1
  140. package/dist/gauge.d.ts +1 -1
  141. package/dist/gauge.js +1 -1
  142. package/dist/heat-Bsqq4zw9.js +38 -0
  143. package/dist/heat-Bsqq4zw9.js.map +1 -0
  144. package/dist/heat-DYsivvDq.cjs +49 -0
  145. package/dist/heat-DYsivvDq.cjs.map +1 -0
  146. package/dist/{heatmap-CXhlrLTl.cjs → heatmap-Dyzrd4Fd.cjs} +39 -37
  147. package/dist/heatmap-Dyzrd4Fd.cjs.map +1 -0
  148. package/dist/{heatmap-19BGJTKF.js → heatmap-J7fxG7MM.js} +35 -33
  149. package/dist/heatmap-J7fxG7MM.js.map +1 -0
  150. package/dist/{heatmap-Dp_oyEe0.d.cts → heatmap-Jvwo7iFW.d.cts} +2 -2
  151. package/dist/{heatmap-59lmClj9.d.ts → heatmap-mFCnP6aB.d.ts} +2 -2
  152. package/dist/heatmap.cjs +1 -1
  153. package/dist/heatmap.d.cts +1 -1
  154. package/dist/heatmap.d.ts +1 -1
  155. package/dist/heatmap.js +1 -1
  156. package/dist/{hydrate-OA6R2_Pn.js → hydrate-BB3MlR36.js} +2 -2
  157. package/dist/{hydrate-OA6R2_Pn.js.map → hydrate-BB3MlR36.js.map} +1 -1
  158. package/dist/{hydrate-CmN1k8Mo.cjs → hydrate-m0I5m6ue.cjs} +2 -2
  159. package/dist/{hydrate-CmN1k8Mo.cjs.map → hydrate-m0I5m6ue.cjs.map} +1 -1
  160. package/dist/hydrate.cjs +2 -2
  161. package/dist/hydrate.js +2 -2
  162. package/dist/index.cjs +69 -45
  163. package/dist/index.cjs.map +1 -1
  164. package/dist/index.d.cts +24 -19
  165. package/dist/index.d.ts +24 -19
  166. package/dist/index.js +51 -37
  167. package/dist/index.js.map +1 -1
  168. package/dist/interaction-DXYSjgnP.cjs +32 -0
  169. package/dist/interaction-DXYSjgnP.cjs.map +1 -0
  170. package/dist/interaction-En1KlwFO.js +21 -0
  171. package/dist/interaction-En1KlwFO.js.map +1 -0
  172. package/dist/layout-CYerDebD.d.cts +29 -0
  173. package/dist/layout-CYerDebD.d.ts +29 -0
  174. package/dist/{layout-JY2aR-yE.cjs → layout-Cfg9x1k2.cjs} +32 -1
  175. package/dist/layout-Cfg9x1k2.cjs.map +1 -0
  176. package/dist/{layout-DmrrLjwN.js → layout-DqAte3H8.js} +27 -2
  177. package/dist/layout-DqAte3H8.js.map +1 -0
  178. package/dist/{line-DO66LtwH.js → line-CXH0L10d.js} +84 -37
  179. package/dist/line-CXH0L10d.js.map +1 -0
  180. package/dist/{line-_rNdeKmS.d.cts → line-Cu9ctpbv.d.cts} +9 -3
  181. package/dist/{line-Dbt6KFRK.cjs → line-DHbYCQy4.cjs} +84 -37
  182. package/dist/line-DHbYCQy4.cjs.map +1 -0
  183. package/dist/{line-DtSh7HQU.d.ts → line-TkzA7wMK.d.ts} +8 -1
  184. package/dist/line.cjs +3 -3
  185. package/dist/line.d.cts +1 -1
  186. package/dist/line.d.ts +1 -1
  187. package/dist/line.js +3 -3
  188. package/dist/log.cjs +1 -1
  189. package/dist/log.js +1 -1
  190. package/dist/map-BirylCmT.d.cts +156 -0
  191. package/dist/map-CYp6x-uS.js +784 -0
  192. package/dist/map-CYp6x-uS.js.map +1 -0
  193. package/dist/map-ChwSgooH.cjs +795 -0
  194. package/dist/map-ChwSgooH.cjs.map +1 -0
  195. package/dist/map-DNqog2Xs.d.ts +156 -0
  196. package/dist/map.cjs +4 -0
  197. package/dist/map.d.cts +3 -0
  198. package/dist/map.d.ts +3 -0
  199. package/dist/map.js +1 -0
  200. package/dist/maps/world.cjs +875 -0
  201. package/dist/maps/world.cjs.map +1 -0
  202. package/dist/maps/world.d.cts +2 -0
  203. package/dist/maps/world.d.ts +2 -0
  204. package/dist/maps/world.js +874 -0
  205. package/dist/maps/world.js.map +1 -0
  206. package/dist/{morph-9_LJL0ra.cjs → morph-3I1Nf_tR.cjs} +2 -2
  207. package/dist/{morph-9_LJL0ra.cjs.map → morph-3I1Nf_tR.cjs.map} +1 -1
  208. package/dist/{morph-DnRxuwR-.js → morph-GfBab-b3.js} +2 -2
  209. package/dist/{morph-DnRxuwR-.js.map → morph-GfBab-b3.js.map} +1 -1
  210. package/dist/morph.cjs +2 -2
  211. package/dist/morph.js +2 -2
  212. package/dist/others-CuNdpvjd.d.cts +31 -0
  213. package/dist/{others-J7NCAMA0.js → others-DBIGE6jr.js} +11 -3
  214. package/dist/others-DBIGE6jr.js.map +1 -0
  215. package/dist/others-DBO4Kjwl.d.ts +29 -0
  216. package/dist/{others-DWdK7vKp.cjs → others-WfjCsjqT.cjs} +14 -6
  217. package/dist/others-WfjCsjqT.cjs.map +1 -0
  218. package/dist/{parliament-Cru4IcuM.js → parliament-BKN6ikBJ.js} +30 -29
  219. package/dist/parliament-BKN6ikBJ.js.map +1 -0
  220. package/dist/{parliament-CLCI7tUO.d.ts → parliament-CHdf13XU.d.ts} +2 -2
  221. package/dist/{parliament-CgsVnWEe.d.cts → parliament-CsYgh4N2.d.cts} +2 -2
  222. package/dist/{parliament-x5hcFaQ3.cjs → parliament-DhxAaIZ3.cjs} +30 -29
  223. package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
  224. package/dist/parliament.cjs +1 -1
  225. package/dist/parliament.d.cts +1 -1
  226. package/dist/parliament.d.ts +1 -1
  227. package/dist/parliament.js +1 -1
  228. package/dist/{patterns-D3-wQagb.cjs → patterns-BPN1c9qe.cjs} +2 -2
  229. package/dist/{patterns-D3-wQagb.cjs.map → patterns-BPN1c9qe.cjs.map} +1 -1
  230. package/dist/{patterns-CufKZYhm.js → patterns-CVrLrJXg.js} +2 -2
  231. package/dist/{patterns-CufKZYhm.js.map → patterns-CVrLrJXg.js.map} +1 -1
  232. package/dist/patterns.cjs +2 -2
  233. package/dist/patterns.d.cts +1 -1
  234. package/dist/patterns.d.ts +1 -1
  235. package/dist/patterns.js +2 -2
  236. package/dist/{percentage-bar-ybNS3goo.cjs → percentage-bar-BChkTRoz.cjs} +37 -35
  237. package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
  238. package/dist/{percentage-bar-nhTeakD_.d.ts → percentage-bar-CSAbzDOn.d.ts} +11 -15
  239. package/dist/{percentage-bar-B6tNOqNn.js → percentage-bar-CaInxrL8.js} +37 -35
  240. package/dist/percentage-bar-CaInxrL8.js.map +1 -0
  241. package/dist/{percentage-bar-tepMr7Hd.d.cts → percentage-bar-UZHCRvlK.d.cts} +11 -15
  242. package/dist/percentage-bar.cjs +1 -1
  243. package/dist/percentage-bar.d.cts +1 -1
  244. package/dist/percentage-bar.d.ts +1 -1
  245. package/dist/percentage-bar.js +1 -1
  246. package/dist/{pie-BXg2gNpb.d.cts → pie-AFedsDcF.d.cts} +17 -14
  247. package/dist/{pie-CVsc-6qD.js → pie-Ch6Bx0ih.js} +68 -52
  248. package/dist/pie-Ch6Bx0ih.js.map +1 -0
  249. package/dist/{pie-BpjvSPnz.cjs → pie-Cll1OrVZ.cjs} +68 -52
  250. package/dist/pie-Cll1OrVZ.cjs.map +1 -0
  251. package/dist/{pie-CFptILSm.d.ts → pie-Cn2H3pz8.d.ts} +17 -14
  252. package/dist/pie.cjs +1 -1
  253. package/dist/pie.d.cts +1 -1
  254. package/dist/pie.d.ts +1 -1
  255. package/dist/pie.js +1 -1
  256. package/dist/{point-shapes--_gmdTyK.cjs → point-shapes-BRawRM78.cjs} +23 -22
  257. package/dist/point-shapes-BRawRM78.cjs.map +1 -0
  258. package/dist/{point-shapes-DD2Ektzm.js → point-shapes-DI6GhcI7.js} +18 -23
  259. package/dist/point-shapes-DI6GhcI7.js.map +1 -0
  260. package/dist/point-shapes.cjs +6 -4
  261. package/dist/point-shapes.cjs.map +1 -1
  262. package/dist/point-shapes.d.cts +2 -2
  263. package/dist/point-shapes.d.ts +2 -2
  264. package/dist/point-shapes.js +7 -5
  265. package/dist/point-shapes.js.map +1 -1
  266. package/dist/{radar-BR-mumDd.js → radar-Bg-IiIWB.js} +21 -22
  267. package/dist/radar-Bg-IiIWB.js.map +1 -0
  268. package/dist/{radar-BC9Skgpj.d.ts → radar-DEer2jjd.d.ts} +2 -2
  269. package/dist/{radar-D1-lItDy.d.cts → radar-DxmjXhMc.d.cts} +2 -2
  270. package/dist/{radar-HPDrIdzc.cjs → radar-wDyX17S3.cjs} +22 -23
  271. package/dist/radar-wDyX17S3.cjs.map +1 -0
  272. package/dist/radar.cjs +1 -1
  273. package/dist/radar.d.cts +1 -1
  274. package/dist/radar.d.ts +1 -1
  275. package/dist/radar.js +1 -1
  276. package/dist/range-bar-BnKjJP89.cjs +348 -0
  277. package/dist/range-bar-BnKjJP89.cjs.map +1 -0
  278. package/dist/range-bar-C4cRaaQE.d.ts +123 -0
  279. package/dist/range-bar-D32dIQOY.d.cts +123 -0
  280. package/dist/range-bar-Dx6ce0J1.js +343 -0
  281. package/dist/range-bar-Dx6ce0J1.js.map +1 -0
  282. package/dist/range-bar.cjs +3 -0
  283. package/dist/range-bar.d.cts +3 -0
  284. package/dist/range-bar.d.ts +3 -0
  285. package/dist/range-bar.js +1 -0
  286. package/dist/{rect-DSVmUZrD.js → rect-CZTNvMlf.js} +2 -2
  287. package/dist/{rect-DSVmUZrD.js.map → rect-CZTNvMlf.js.map} +1 -1
  288. package/dist/{rect-D6VhynBM.cjs → rect-DPr9QRxl.cjs} +2 -2
  289. package/dist/{rect-D6VhynBM.cjs.map → rect-DPr9QRxl.cjs.map} +1 -1
  290. package/dist/{sankey-fCoo1cpz.cjs → sankey-0CSp_Er9.cjs} +72 -71
  291. package/dist/sankey-0CSp_Er9.cjs.map +1 -0
  292. package/dist/{sankey-Dk7jUt8x.d.cts → sankey-D-8ATwBT.d.cts} +2 -2
  293. package/dist/{sankey-D6JeZfK5.js → sankey-Dp4CuLVe.js} +72 -71
  294. package/dist/sankey-Dp4CuLVe.js.map +1 -0
  295. package/dist/{sankey-D_v7KxnJ.d.ts → sankey-DpYJsOI4.d.ts} +2 -2
  296. package/dist/sankey.cjs +1 -1
  297. package/dist/sankey.d.cts +1 -1
  298. package/dist/sankey.d.ts +1 -1
  299. package/dist/sankey.js +1 -1
  300. package/dist/{scatter-C0TWjFpW.js → scatter-0Z7K_YUz.js} +94 -46
  301. package/dist/scatter-0Z7K_YUz.js.map +1 -0
  302. package/dist/{scatter-CXEsioOJ.d.ts → scatter-BAL5K9_4.d.ts} +28 -9
  303. package/dist/{scatter-DZeEIfyo.d.cts → scatter-BUGbnRzM.d.cts} +28 -9
  304. package/dist/{scatter-DVqB_fP9.cjs → scatter-CZ8do3Up.cjs} +95 -47
  305. package/dist/scatter-CZ8do3Up.cjs.map +1 -0
  306. package/dist/scatter.cjs +1 -1
  307. package/dist/scatter.d.cts +2 -2
  308. package/dist/scatter.d.ts +2 -2
  309. package/dist/scatter.js +1 -1
  310. package/dist/slice-labels-1TBq7p3q.d.cts +28 -0
  311. package/dist/slice-labels-C9ucsBVW.js +88 -0
  312. package/dist/slice-labels-C9ucsBVW.js.map +1 -0
  313. package/dist/slice-labels-CbFiy46l.cjs +93 -0
  314. package/dist/slice-labels-CbFiy46l.cjs.map +1 -0
  315. package/dist/slice-labels-Cm5CyV7B.d.ts +28 -0
  316. package/dist/slice-labels.cjs +11 -0
  317. package/dist/slice-labels.cjs.map +1 -0
  318. package/dist/slice-labels.d.cts +6 -0
  319. package/dist/slice-labels.d.ts +6 -0
  320. package/dist/slice-labels.js +11 -0
  321. package/dist/slice-labels.js.map +1 -0
  322. package/dist/{sparkline-cbvRkWqS.d.ts → sparkline-CtoBJe-a.d.ts} +2 -2
  323. package/dist/{sparkline-B39NA0Mi.cjs → sparkline-DjR-V6BI.cjs} +13 -15
  324. package/dist/sparkline-DjR-V6BI.cjs.map +1 -0
  325. package/dist/{sparkline-DAP6jtzw.d.cts → sparkline-DwHJfeZz.d.cts} +2 -2
  326. package/dist/{sparkline-XO_TqCNP.js → sparkline-_dxwtdli.js} +13 -15
  327. package/dist/sparkline-_dxwtdli.js.map +1 -0
  328. package/dist/sparkline.cjs +1 -1
  329. package/dist/sparkline.d.cts +1 -1
  330. package/dist/sparkline.d.ts +1 -1
  331. package/dist/sparkline.js +1 -1
  332. package/dist/{stack-Dagxq7l2.d.cts → stack-CcmyALx0.d.cts} +1 -1
  333. package/dist/{stack-2H2Gfs1Q.js → stack-CyVlS7Fr.js} +2 -2
  334. package/dist/{stack-2H2Gfs1Q.js.map → stack-CyVlS7Fr.js.map} +1 -1
  335. package/dist/{stack-BgPzoQmv.cjs → stack-DBhmYNat.cjs} +2 -2
  336. package/dist/{stack-BgPzoQmv.cjs.map → stack-DBhmYNat.cjs.map} +1 -1
  337. package/dist/style.css +1 -1
  338. package/dist/{time-axis-BjZ1bYTK.cjs → time-axis-CVKjQKSS.cjs} +4 -3
  339. package/dist/{time-axis-BjZ1bYTK.cjs.map → time-axis-CVKjQKSS.cjs.map} +1 -1
  340. package/dist/{time-axis-FLONo54E.js → time-axis-CkmbAw4Z.js} +3 -2
  341. package/dist/{time-axis-FLONo54E.js.map → time-axis-CkmbAw4Z.js.map} +1 -1
  342. package/dist/time.cjs +3 -3
  343. package/dist/time.js +3 -3
  344. package/dist/{treemap-BAkhmVQc.d.cts → treemap-C2maqerU.d.cts} +37 -5
  345. package/dist/{treemap-BNpxFBao.d.ts → treemap-D_zbubo3.d.ts} +37 -5
  346. package/dist/{treemap-BWpEUlDh.cjs → treemap-PulGXZv0.cjs} +58 -33
  347. package/dist/treemap-PulGXZv0.cjs.map +1 -0
  348. package/dist/{treemap-CQdavQ9u.js → treemap-lbYxb-7h.js} +57 -32
  349. package/dist/treemap-lbYxb-7h.js.map +1 -0
  350. package/dist/treemap.cjs +1 -1
  351. package/dist/treemap.d.cts +1 -1
  352. package/dist/treemap.d.ts +1 -1
  353. package/dist/treemap.js +1 -1
  354. package/dist/{value-labels-BBuSi4i0.js → value-labels-B0VeheyE.js} +29 -8
  355. package/dist/value-labels-B0VeheyE.js.map +1 -0
  356. package/dist/{value-labels-BV9keAuL.cjs → value-labels-Dcyk3GIY.cjs} +29 -8
  357. package/dist/value-labels-Dcyk3GIY.cjs.map +1 -0
  358. package/dist/value-labels.cjs +2 -2
  359. package/dist/value-labels.d.cts +1 -1
  360. package/dist/value-labels.d.ts +1 -1
  361. package/dist/value-labels.js +2 -2
  362. package/dist/zoom.cjs +810 -0
  363. package/dist/zoom.cjs.map +1 -0
  364. package/dist/zoom.d.cts +34 -0
  365. package/dist/zoom.d.ts +34 -0
  366. package/dist/zoom.js +806 -0
  367. package/dist/zoom.js.map +1 -0
  368. package/package.json +120 -235
  369. package/dist/annotations-D0YQ0IoA.js.map +0 -1
  370. package/dist/annotations-DdRdeBUB.cjs.map +0 -1
  371. package/dist/area-0-L1bG9B.js.map +0 -1
  372. package/dist/area-4eRs3c0K.cjs.map +0 -1
  373. package/dist/bar-BNZ3GhIw.js.map +0 -1
  374. package/dist/bar-Da6dE_nI.cjs.map +0 -1
  375. package/dist/candlestick-BHQkQfxH.js.map +0 -1
  376. package/dist/candlestick-CYCQXgky.cjs.map +0 -1
  377. package/dist/cartesian-CI2x6N7N.js.map +0 -1
  378. package/dist/cartesian-DV02PsBe.cjs.map +0 -1
  379. package/dist/chart-DWn9v6qw.js.map +0 -1
  380. package/dist/chart-e2VqomCI.cjs.map +0 -1
  381. package/dist/core-BKRQvPAT.js.map +0 -1
  382. package/dist/core-DIOC61up.cjs.map +0 -1
  383. package/dist/dom-CuceR8gt.js.map +0 -1
  384. package/dist/dom-D_g13XWY.cjs.map +0 -1
  385. package/dist/export-chart-83UYH48t.js.map +0 -1
  386. package/dist/export-chart-mYgEfK-L.cjs.map +0 -1
  387. package/dist/fade-DVTkhrFU.cjs.map +0 -1
  388. package/dist/fade-GGxcBdss.js.map +0 -1
  389. package/dist/features-BMxkqCyS.js.map +0 -1
  390. package/dist/features-DCXEvoya.cjs.map +0 -1
  391. package/dist/gauge-DXkjXNCD.cjs.map +0 -1
  392. package/dist/gauge-ts0kqN1-.js.map +0 -1
  393. package/dist/heatmap-19BGJTKF.js.map +0 -1
  394. package/dist/heatmap-CXhlrLTl.cjs.map +0 -1
  395. package/dist/layout-DmrrLjwN.js.map +0 -1
  396. package/dist/layout-JY2aR-yE.cjs.map +0 -1
  397. package/dist/line-DO66LtwH.js.map +0 -1
  398. package/dist/line-Dbt6KFRK.cjs.map +0 -1
  399. package/dist/others-DWdK7vKp.cjs.map +0 -1
  400. package/dist/others-J7NCAMA0.js.map +0 -1
  401. package/dist/parliament-Cru4IcuM.js.map +0 -1
  402. package/dist/parliament-x5hcFaQ3.cjs.map +0 -1
  403. package/dist/percentage-bar-B6tNOqNn.js.map +0 -1
  404. package/dist/percentage-bar-ybNS3goo.cjs.map +0 -1
  405. package/dist/pie-BpjvSPnz.cjs.map +0 -1
  406. package/dist/pie-CVsc-6qD.js.map +0 -1
  407. package/dist/point-shapes--_gmdTyK.cjs.map +0 -1
  408. package/dist/point-shapes-DD2Ektzm.js.map +0 -1
  409. package/dist/radar-BR-mumDd.js.map +0 -1
  410. package/dist/radar-HPDrIdzc.cjs.map +0 -1
  411. package/dist/sankey-D6JeZfK5.js.map +0 -1
  412. package/dist/sankey-fCoo1cpz.cjs.map +0 -1
  413. package/dist/scatter-C0TWjFpW.js.map +0 -1
  414. package/dist/scatter-DVqB_fP9.cjs.map +0 -1
  415. package/dist/sparkline-B39NA0Mi.cjs.map +0 -1
  416. package/dist/sparkline-XO_TqCNP.js.map +0 -1
  417. package/dist/treemap-BWpEUlDh.cjs.map +0 -1
  418. package/dist/treemap-CQdavQ9u.js.map +0 -1
  419. package/dist/value-labels-BBuSi4i0.js.map +0 -1
  420. package/dist/value-labels-BV9keAuL.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
- import { n as estimateTextWidth, o as round } from "./layout-DmrrLjwN.js";
1
+ import { n as estimateTextWidth, s as round } from "./layout-DqAte3H8.js";
2
2
  import { t as h } from "./vnode-_EMUqysL.js";
3
- import { g as toMs, o as labelKey } from "./cartesian-CI2x6N7N.js";
3
+ import { o as labelKey, y as toMs } from "./cartesian-COglz544.js";
4
4
  import { d as text, i as finite, o as label, u as records } from "./clean-CkoQobGv.js";
5
5
  // src/charts/annotations.ts
6
6
  /** Pixel span of a category (or a date on a time axis), or `undefined` if it is not on the axis. */
@@ -86,7 +86,19 @@ function annotationLayers(annotations, scales) {
86
86
  vertical
87
87
  };
88
88
  };
89
- const shapes = annotations.map(geometry);
89
+ /** Where a point annotation (a single `x` and a single `y`) lands; `undefined` off the plot. */
90
+ const pointOf = (a) => {
91
+ if (a.x === void 0 || a.y === void 0 || isPair(a.x) || isPair(a.y)) return void 0;
92
+ const along = categorySpan(scales, a.x);
93
+ const v = scales.value(a.y);
94
+ if (!along || !Number.isFinite(v)) return void 0;
95
+ const c = (along[0] + along[1]) / 2;
96
+ const [px, py] = horizontal ? [v, c] : [c, v];
97
+ return inside(px, x0, x1) && inside(py, y0, y1) ? [px, py] : void 0;
98
+ };
99
+ const isPoint = (a) => a.x !== void 0 && a.y !== void 0 && !isPair(a.x) && !isPair(a.y);
100
+ const dots = annotations.map(pointOf);
101
+ const shapes = annotations.map((a) => isPoint(a) ? void 0 : geometry(a));
90
102
  /** Boxes labels keep clear of: the labels placed so far, and every line. */
91
103
  const placed = [];
92
104
  const obstacles = [];
@@ -105,6 +117,15 @@ function annotationLayers(annotations, scales) {
105
117
  at + 1.5
106
118
  ]]);
107
119
  });
120
+ const DOT = 4;
121
+ dots.forEach((p, i) => {
122
+ if (p) obstacles.push([i, [
123
+ p[0] - DOT,
124
+ p[1] - DOT,
125
+ p[0] + DOT,
126
+ p[1] + DOT
127
+ ]]);
128
+ });
108
129
  const apart = (box, [l, t, r, b]) => box[2] <= l || box[0] >= r || box[3] <= t || box[1] >= b;
109
130
  const clearOfLabels = (box) => placed.every((p) => apart(box, p));
110
131
  const clear = (box, own) => clearOfLabels(box) && obstacles.every(([i, l]) => i === own || apart(box, l));
@@ -114,12 +135,71 @@ function annotationLayers(annotations, scales) {
114
135
  key: part ? `${key}-${part}` : key,
115
136
  class: [
116
137
  "tc-annotation",
117
- a.y !== void 0 ? "tc-annotation-y" : "tc-annotation-x",
138
+ isPoint(a) ? "tc-annotation-point" : a.y !== void 0 ? "tc-annotation-y" : "tc-annotation-x",
118
139
  a.class
119
140
  ],
120
- style: { "--tc-annotation-color": a.color }
141
+ style: {
142
+ "--tc-annotation-color": a.color,
143
+ "--tc-annotation-dash": Number.isFinite(a.dash) ? `${a.dash}px` : a.dash
144
+ }
121
145
  });
146
+ /** The label at a spot ([left edge, baseline]), on its background when asked for. */
147
+ const labelAt = (spot, w) => {
148
+ const size = fontSize * .92;
149
+ const text = h("text", {
150
+ class: "tc-annotation-label",
151
+ x: round(spot[0]),
152
+ y: round(spot[1])
153
+ }, a.label);
154
+ return a.labelBackground ? [h("rect", {
155
+ class: "tc-annotation-label-bg",
156
+ x: round(spot[0] - 3),
157
+ y: round(spot[1] - size),
158
+ width: round(w + 6),
159
+ height: round(size * 1.35),
160
+ rx: 2
161
+ }), text] : [text];
162
+ };
122
163
  const end = a.position !== "start";
164
+ const dot = dots[index];
165
+ if (dot) {
166
+ const [px, py] = dot;
167
+ let text;
168
+ if (a.label) {
169
+ const w = estimateTextWidth(a.label, fontSize * .92);
170
+ const off = 8;
171
+ const mid = py + fontSize * .35;
172
+ const spots = [
173
+ [px + off, mid],
174
+ [px - off - w, mid],
175
+ [px - w / 2, py - off],
176
+ [px - w / 2, py + off + fontSize * .8],
177
+ [px + off, py + off + fontSize * .8],
178
+ [px + off, py - off],
179
+ [px - off - w, py + off + fontSize * .8],
180
+ [px - off - w, py - off]
181
+ ];
182
+ const box = ([x, y]) => [
183
+ x,
184
+ y - fontSize,
185
+ x + w,
186
+ y + fontSize * .25
187
+ ];
188
+ const within = (s) => s[0] >= x0 && s[0] + w <= x1;
189
+ const spot = spots.find((s) => within(s) && clear(box(s), index)) ?? spots.find((s) => within(s) && clearOfLabels(box(s)));
190
+ if (spot) {
191
+ placed.push(box(spot));
192
+ text = labelAt(spot, w);
193
+ }
194
+ }
195
+ lines.push(h("g", attrs(), h("circle", {
196
+ class: "tc-annotation-dot",
197
+ cx: round(px),
198
+ cy: round(py),
199
+ r: DOT
200
+ }), text));
201
+ return;
202
+ }
123
203
  const shape = shapes[index];
124
204
  if (!shape) return;
125
205
  const { a0, a1, vertical } = shape;
@@ -153,11 +233,7 @@ function annotationLayers(annotations, scales) {
153
233
  ];
154
234
  const spot = spots.find((s) => clear(box(s), index)) ?? spots.find((s) => clearOfLabels(box(s))) ?? spots[0];
155
235
  placed.push(box(spot));
156
- label = h("text", {
157
- class: "tc-annotation-label",
158
- x: round(spot[0]),
159
- y: round(spot[1])
160
- }, a.label);
236
+ label = labelAt(spot, w);
161
237
  }
162
238
  if (a1 - a0 > .5) {
163
239
  const d = vertical ? `M${round(a0)},${round(y0)}H${round(a1)}V${round(y1)}H${round(a0)}Z` : `M${round(x0)},${round(a0)}H${round(x1)}V${round(a1)}H${round(x0)}Z`;
@@ -198,4 +274,4 @@ function annotationLayers(annotations, scales) {
198
274
  }
199
275
  export { annotationValues as n, annotationLayers as t };
200
276
 
201
- //# sourceMappingURL=annotations-D0YQ0IoA.js.map
277
+ //# sourceMappingURL=annotations-DGITy6th.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations-DGITy6th.js","names":[],"sources":["../src/charts/annotations.ts"],"sourcesContent":["import { estimateTextWidth, type Rect, round } from '../layout.ts'\nimport type { BandKey, BandScale } from '../scales/band.ts'\nimport { type ClassValue, h, type VNode } from '../vnode.ts'\nimport { labelKey, toMs } from './cartesian.ts'\nimport { finite, label, records, text } from './clean.ts'\n\n/** A category label, a number, or a date (on a time axis). */\ntype AnnotationLabel = string | number | Date\n\n/**\n * A reference line or band drawn with the series: a target on the value\n * axis (`y: 99.9`), a normal range (`y: [40, 60]`), an event on the category\n * axis (`x: 'Jun'`, or a date on a time axis) or a period (`x: [from, to]`).\n * With both a single `x` and a single `y` it is a point: a dot at that\n * category and value, with its label beside it.\n */\nexport interface Annotation {\n /** A line at a value, or a band between two values, on the value axis. */\n y?: number | readonly [number, number]\n /** A line at a category (or a date on a time axis), or a band between two, on the category axis. */\n x?: AnnotationLabel | readonly [AnnotationLabel, AnnotationLabel]\n /** Short text next to the line or the point, or inside the band. */\n label?: string\n /** Where the label sits along the line or band. Defaults to `'end'` (right, or top). */\n position?: 'start' | 'end'\n /**\n * Any CSS color; sets `--tc-annotation-color`.\n * Values that could inject CSS (`;`, quotes, `url()` …) are ignored, so colors from user data are safe.\n */\n color?: string\n /**\n * The dashes of the line: dash and gap length in pixels, or a full\n * `stroke-dasharray` such as `'6 3'`; `0` draws it solid. Sets\n * `--tc-annotation-dash`. Defaults to `'4 3'`.\n */\n dash?: number | string\n /**\n * Draw the label on a background (the surface color), so it reads where\n * it crosses lines and points. Defaults to `false`.\n */\n labelBackground?: boolean\n /** Extra classes on the annotation group. */\n class?: ClassValue\n /** Stable identity for keyed updates. Defaults to the position in the list. */\n id?: string\n}\n\n/** How the layout maps data to pixels for annotations. */\nexport interface AnnotationScales {\n area: Rect\n /** Whether categories run along y (horizontal bars). */\n horizontal: boolean\n fontSize: number\n /** Pixel position of a value along the value axis. */\n value: (v: number) => number\n /** The category scale, and the keys of its categories in order. */\n band: BandScale\n keys: readonly BandKey[]\n /** Pixel position of a date, when the category axis is a time axis. */\n time?: ((date: Date) => number) | undefined\n}\n\n/** Pixel span of a category (or a date on a time axis), or `undefined` if it is not on the axis. */\nfunction categorySpan(\n scales: AnnotationScales,\n label: AnnotationLabel,\n): readonly [number, number] | undefined {\n if (scales.time) {\n const p = scales.time(new Date(toMs(label)))\n return Number.isFinite(p) ? [p, p] : undefined\n }\n const i = scales.keys.indexOf(labelKey(label))\n return i < 0 ? undefined : [scales.band.at(i), scales.band.at(i) + scales.band.bandwidth]\n}\n\n/** A value or a [from, to] pair, cleaned by `f`; `null` when anything is off. */\nconst span = <T>(v: unknown, f: (x: unknown) => T | null): T | readonly T[] | null => {\n if (!Array.isArray(v)) return f(v)\n const pair = v.map(f)\n return pair.length === 2 && !pair.includes(null) ? (pair as T[]) : null\n}\n\n/** Annotations from outside: lines or bands at finite values or labels, with text labels. */\nexport const cleanAnnotations = (v: unknown): Annotation[] | undefined =>\n v === undefined\n ? v\n : (records(v, (a) => ({\n ...a,\n y: a.y === undefined ? a.y : span(a.y, finite),\n x: a.x === undefined ? a.x : span(a.x, label),\n label: a.label == null ? undefined : text(a.label),\n color: typeof a.color === 'string' ? a.color : undefined,\n })).filter((a) => a.y !== null && a.x !== null && (a.x ?? a.y) !== undefined) as Annotation[])\n\nconst isPair = <T>(v: T | readonly [T, T]): v is readonly [T, T] => Array.isArray(v)\n\n/** Values the value axis should include so every annotation shows. */\nexport function annotationValues(annotations: readonly Annotation[] | undefined): number[] {\n const out: number[] = []\n for (const a of cleanAnnotations(annotations) ?? []) {\n if (a.y === undefined) continue\n for (const v of isPair(a.y) ? a.y : [a.y]) if (Number.isFinite(v)) out.push(v)\n }\n return out\n}\n\n/**\n * Annotation layers: bands go below the series, lines and labels above\n * them. Annotations outside the plot area are skipped.\n */\nexport function annotationLayers(\n annotations: readonly Annotation[] | undefined,\n scales: AnnotationScales,\n): { under: VNode | null; over: VNode | null } {\n // Annotations may come from outside (thresholds from an API).\n annotations = cleanAnnotations(annotations)\n if (!annotations?.length) return { under: null, over: null }\n const { area, horizontal, fontSize } = scales\n const bands: VNode[] = []\n const lines: VNode[] = []\n // Plot edges: \"across\" is the axis the annotation spans, \"along\" the one it marks.\n const x0 = area.x\n const x1 = area.x + area.width\n const y0 = area.y\n const y1 = area.y + area.height\n const inside = (p: number, lo: number, hi: number) => p >= lo - 0.5 && p <= hi + 0.5\n const pad = 4\n /**\n * Where an annotation lands: the pixel span it covers within the plot, and\n * whether it runs across x (a vertical line); `undefined` when it is off\n * the plot or names nothing on the axes.\n */\n const geometry = (a: Annotation): { a0: number; a1: number; vertical: boolean } | undefined => {\n let span: readonly [number, number]\n let vertical: boolean\n if (a.y !== undefined) {\n const [from, to] = isPair(a.y) ? a.y : [a.y, a.y]\n if (!Number.isFinite(from) || !Number.isFinite(to)) return undefined\n span = [scales.value(from), scales.value(to)]\n vertical = horizontal\n } else if (a.x !== undefined) {\n const [from, to] = isPair(a.x) ? a.x : [a.x, a.x]\n const start = categorySpan(scales, from)\n const stop = categorySpan(scales, to)\n if (!start || !stop) return undefined\n // A single category: its center; a range: from the start of one to the end of the other.\n span = isPair(a.x)\n ? [Math.min(start[0], stop[0]), Math.max(start[1], stop[1])]\n : [(start[0] + start[1]) / 2, (start[0] + start[1]) / 2]\n vertical = !horizontal\n } else {\n return undefined\n }\n const lo = Math.min(span[0], span[1])\n const hi = Math.max(span[0], span[1])\n const [min, max] = vertical ? [x0, x1] : [y0, y1]\n if (!inside(lo, min, max) && !inside(hi, min, max) && !(lo < min && hi > max)) return undefined\n return { a0: Math.max(lo, min), a1: Math.min(hi, max), vertical }\n }\n /** Where a point annotation (a single `x` and a single `y`) lands; `undefined` off the plot. */\n const pointOf = (a: Annotation): readonly [number, number] | undefined => {\n if (a.x === undefined || a.y === undefined || isPair(a.x) || isPair(a.y)) return undefined\n const along = categorySpan(scales, a.x)\n const v = scales.value(a.y)\n if (!along || !Number.isFinite(v)) return undefined\n const c = (along[0] + along[1]) / 2\n const [px, py] = horizontal ? [v, c] : [c, v]\n return inside(px, x0, x1) && inside(py, y0, y1) ? [px, py] : undefined\n }\n const isPoint = (a: Annotation) =>\n a.x !== undefined && a.y !== undefined && !isPair(a.x) && !isPair(a.y)\n const dots = annotations.map(pointOf)\n const shapes = annotations.map((a) => (isPoint(a) ? undefined : geometry(a)))\n\n type Box = [number, number, number, number]\n /** Boxes labels keep clear of: the labels placed so far, and every line. */\n const placed: Box[] = []\n const obstacles: [number, Box][] = []\n shapes.forEach((g, i) => {\n if (!g || g.a1 - g.a0 > 0.5) return\n const at = g.a0\n obstacles.push([i, g.vertical ? [at - 1.5, y0, at + 1.5, y1] : [x0, at - 1.5, x1, at + 1.5]])\n })\n const DOT = 4\n dots.forEach((p, i) => {\n if (p) obstacles.push([i, [p[0] - DOT, p[1] - DOT, p[0] + DOT, p[1] + DOT]])\n })\n const apart = (box: Box, [l, t, r, b]: Box) =>\n box[2] <= l || box[0] >= r || box[3] <= t || box[1] >= b\n const clearOfLabels = (box: Box) => placed.every((p) => apart(box, p))\n const clear = (box: Box, own: number) =>\n clearOfLabels(box) && obstacles.every(([i, l]) => i === own || apart(box, l))\n\n annotations.forEach((a, index) => {\n const key = a.id ?? index\n // Groups are named by axis; the line, band and label inside by what they are.\n const attrs = (part?: string) => ({\n key: part ? `${key}-${part}` : key,\n class: [\n 'tc-annotation',\n isPoint(a)\n ? 'tc-annotation-point'\n : a.y !== undefined\n ? 'tc-annotation-y'\n : 'tc-annotation-x',\n a.class,\n ],\n style: {\n '--tc-annotation-color': a.color,\n '--tc-annotation-dash': Number.isFinite(a.dash) ? `${a.dash}px` : a.dash,\n },\n })\n /** The label at a spot ([left edge, baseline]), on its background when asked for. */\n const labelAt = (spot: [number, number], w: number): VNode[] => {\n const size = fontSize * 0.92\n const text = h(\n 'text',\n { class: 'tc-annotation-label', x: round(spot[0]), y: round(spot[1]) },\n a.label,\n )\n return a.labelBackground\n ? [\n h('rect', {\n class: 'tc-annotation-label-bg',\n x: round(spot[0] - 3),\n y: round(spot[1] - size),\n width: round(w + 6),\n height: round(size * 1.35),\n rx: 2,\n }),\n text,\n ]\n : [text]\n }\n const end = a.position !== 'start'\n\n const dot = dots[index]\n if (dot) {\n const [px, py] = dot\n let text: VNode[] | undefined\n if (a.label) {\n const w = estimateTextWidth(a.label, fontSize * 0.92)\n const off = DOT + pad\n const mid = py + fontSize * 0.35\n // Beside the dot, then above or below it, then at its corners.\n const spots: [number, number][] = [\n [px + off, mid],\n [px - off - w, mid],\n [px - w / 2, py - off],\n [px - w / 2, py + off + fontSize * 0.8],\n [px + off, py + off + fontSize * 0.8],\n [px + off, py - off],\n [px - off - w, py + off + fontSize * 0.8],\n [px - off - w, py - off],\n ]\n const box = ([x, y]: [number, number]): Box => [x, y - fontSize, x + w, y + fontSize * 0.25]\n const within = (s: [number, number]) => s[0] >= x0 && s[0] + w <= x1\n // A label with no room in the plot is left out: the dot stays.\n const spot =\n spots.find((s) => within(s) && clear(box(s), index)) ??\n spots.find((s) => within(s) && clearOfLabels(box(s)))\n if (spot) {\n placed.push(box(spot))\n text = labelAt(spot, w)\n }\n }\n lines.push(\n h(\n 'g',\n attrs(),\n h('circle', { class: 'tc-annotation-dot', cx: round(px), cy: round(py), r: DOT }),\n text,\n ),\n )\n return\n }\n const shape = shapes[index]\n if (!shape) return\n const { a0, a1, vertical } = shape\n\n // Label: candidate spots in order of preference, inside the plot area; the\n // first that covers neither an earlier label nor another line wins (or the first one).\n let label: VNode[] | undefined\n if (a.label) {\n const w = estimateTextWidth(a.label, fontSize * 0.92)\n const line = a1 - a0 <= 0.5\n // [left edge, baseline] of each spot.\n const spots: [number, number][] = []\n if (vertical) {\n // Beside a line or at the start of a band; on the other side if it would\n // run out, and then on the other side anyway, stepping along the line.\n const after = a0 + pad\n const before = line ? a0 - pad - w : Math.max(x0, a1 - pad - w)\n const sides = after + w <= x1 ? [after, before] : [before, after]\n const top = end ? y0 + fontSize : y1 - pad\n const step = (end ? 1 : -1) * fontSize * 1.2\n for (const x of sides) {\n if (x < x0 || x + w > x1) continue\n for (let k = 0; k < 3; k++) spots.push([x, top + k * step])\n }\n if (!spots.length) spots.push([Math.max(x0 + pad, sides[0] as number), top])\n } else {\n // At the preferred end above or below, then at the other end.\n const near = end ? x1 - pad - w : x0 + pad\n const far = end ? x0 + pad : x1 - pad - w\n for (const x of [near, far]) {\n if (line) spots.push([x, a0 - pad], [x, a0 + fontSize])\n else spots.push([x, a0 + fontSize], [x, a1 - pad])\n }\n }\n const box = ([x, y]: [number, number]): Box => [x, y - fontSize, x + w, y + fontSize * 0.25]\n // Nothing free: at least keep off the other labels; a line through text reads better than text on text.\n const spot =\n spots.find((s) => clear(box(s), index)) ??\n spots.find((s) => clearOfLabels(box(s))) ??\n (spots[0] as [number, number])\n placed.push(box(spot))\n label = labelAt(spot, w)\n }\n\n if (a1 - a0 > 0.5) {\n // A band below the series; its label goes with the lines, above them.\n const d = vertical\n ? `M${round(a0)},${round(y0)}H${round(a1)}V${round(y1)}H${round(a0)}Z`\n : `M${round(x0)},${round(a0)}H${round(x1)}V${round(a1)}H${round(x0)}Z`\n bands.push(h('g', attrs(), h('path', { class: 'tc-annotation-band', d })))\n if (label) lines.push(h('g', attrs('label'), label))\n return\n }\n // A line across the plot area.\n const at = round(a0)\n lines.push(\n h(\n 'g',\n attrs(),\n h(\n 'line',\n vertical\n ? { class: 'tc-annotation-line', x1: at, x2: at, y1: round(y0), y2: round(y1) }\n : { class: 'tc-annotation-line', x1: round(x0), x2: round(x1), y1: at, y2: at },\n ),\n label,\n ),\n )\n })\n\n return {\n under: bands.length\n ? h('g', { key: 'annotations-under', class: 'tc-annotations', 'aria-hidden': 'true' }, bands)\n : null,\n over: lines.length\n ? h('g', { key: 'annotations-over', class: 'tc-annotations', 'aria-hidden': 'true' }, lines)\n : null,\n }\n}\n"],"mappings":";;;;;;AA+DA,SAAS,aACP,QACA,OACuC;CACvC,IAAI,OAAO,MAAM;EACf,MAAM,IA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O;GAAsB,IAAI,MAAM,EAAE;GAAG,IAAI,MAAM,EAAE;GAAG,IAAI;GAAI,IAAI;EAAG,CAClF,GACA,KACF,CACF;CACF,CAAC;CAED,OAAO;EACL,OAAO,MAAM,SACT,EAAE,KAAK;GAAE,KAAK;GAAqB,OAAO;GAAkB,eAAe;EAAO,GAAG,KAAK,IAC1F;EACJ,MAAM,MAAM,SACR,EAAE,KAAK;GAAE,KAAK;GAAoB,OAAO;GAAkB,eAAe;EAAO,GAAG,KAAK,IACzF;CACN;AACF"}
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_annotations = require("./annotations-DdRdeBUB.cjs");
2
+ const require_annotations = require("./annotations--m-HzMBM.cjs");
3
3
  // src/annotations.ts
4
4
  /** Standalone entry: `import '@tabler/charts/annotations'` enables `annotations` in cartesian charts. */
5
- require("./features-DCXEvoya.cjs").register({ annotations: {
5
+ require("./features-DEDP5CEQ.cjs").register({ annotations: {
6
6
  layers: require_annotations.annotationLayers,
7
7
  values: require_annotations.annotationValues
8
8
  } });
@@ -1,3 +1,3 @@
1
1
  /** Standalone entry: `import '@tabler/charts/annotations'` enables `annotations` in cartesian charts. */
2
- import { n as annotationLayers, r as annotationValues, t as Annotation } from "./annotations-CHafaGd4.cjs";
2
+ import { n as annotationLayers, r as annotationValues, t as Annotation } from "./annotations-CqZM1z9R.cjs";
3
3
  export { type Annotation, annotationLayers, annotationValues };
@@ -1,3 +1,3 @@
1
1
  /** Standalone entry: `import '@tabler/charts/annotations'` enables `annotations` in cartesian charts. */
2
- import { n as annotationLayers, r as annotationValues, t as Annotation } from "./annotations-B02GR_KU.js";
2
+ import { n as annotationLayers, r as annotationValues, t as Annotation } from "./annotations-CCDUC1lW.js";
3
3
  export { type Annotation, annotationLayers, annotationValues };
@@ -1,5 +1,5 @@
1
- import { n as annotationValues, t as annotationLayers } from "./annotations-D0YQ0IoA.js";
2
- import { i as register } from "./features-BMxkqCyS.js";
1
+ import { n as annotationValues, t as annotationLayers } from "./annotations-DGITy6th.js";
2
+ import { i as register } from "./features-B55rwpQC.js";
3
3
  // src/annotations.ts
4
4
  /** Standalone entry: `import '@tabler/charts/annotations'` enables `annotations` in cartesian charts. */
5
5
  register({ annotations: {
@@ -1,6 +1,6 @@
1
- import { m as seriesTable, p as seriesLegend } from "./cartesian-CI2x6N7N.js";
1
+ import { C as windowed, _ as seriesTable, h as seriesLegend } from "./cartesian-COglz544.js";
2
2
  import { r as cleanSeries, t as cleanData } from "./clean-CkoQobGv.js";
3
- import { n as renderLines } from "./line-DO66LtwH.js";
3
+ import { n as renderLines } from "./line-CXH0L10d.js";
4
4
  // src/charts/area.ts
5
5
  /**
6
6
  * Area chart: filled lines over category labels, with zero in the y domain
@@ -16,10 +16,11 @@ import { n as renderLines } from "./line-DO66LtwH.js";
16
16
  const area = {
17
17
  name: "area",
18
18
  clean: cleanData(cleanSeries),
19
+ prepare: windowed,
19
20
  render: (options, ctx) => renderLines(options, ctx, true),
20
21
  legend: (options) => seriesLegend(options.data),
21
22
  table: (options, ctx, limit) => seriesTable(options, ctx, limit)
22
23
  };
23
24
  export { area as t };
24
25
 
25
- //# sourceMappingURL=area-0-L1bG9B.js.map
26
+ //# sourceMappingURL=area-BN0uE9R0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area-BN0uE9R0.js","names":[],"sources":["../src/charts/area.ts"],"sourcesContent":["import type { ChartType } from '../chart.ts'\nimport { seriesLegend, seriesTable, windowed } from './cartesian.ts'\nimport { cleanData, cleanSeries } from './clean.ts'\nimport { type LineOptions, renderLines } from './line.ts'\n\n/** Options of the area chart: line options with the fill always on. */\nexport type AreaOptions = Omit<LineOptions, 'area'>\n\n/**\n * Area chart: filled lines over category labels, with zero in the y domain\n * by default and a vertical fade (`fill: 'gradient'`).\n *\n * ```ts\n * new Chart('#el', {\n * type: area,\n * data: { labels: ['Jan', 'Feb', 'Mar'], series: [{ name: 'Sales', values: [3, 5, 4] }] },\n * })\n * ```\n */\nexport const area: ChartType<AreaOptions> = {\n name: 'area',\n clean: cleanData(cleanSeries),\n prepare: windowed,\n render: (options, ctx) => renderLines(options, ctx, true),\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) => seriesTable(options, ctx, limit),\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAa,OAA+B;CAC1C,MAAM;CACN,OAAO,UAAU,WAAW;CAC5B,SAAS;CACT,SAAS,SAAS,QAAQ,YAAY,SAAS,KAAK,IAAI;CACxD,SAAS,YAAY,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UAAU,YAAY,SAAS,KAAK,KAAK;AACjE"}
@@ -1,5 +1,5 @@
1
- import { a as ChartType } from "./chart-kqFMEwDo.cjs";
2
- import { t as LineOptions } from "./line-_rNdeKmS.cjs";
1
+ import { o as ChartType } from "./chart-Dz4geQZy.cjs";
2
+ import { t as LineOptions } from "./line-Cu9ctpbv.cjs";
3
3
  /** Options of the area chart: line options with the fill always on. */
4
4
  type AreaOptions = Omit<LineOptions, "area">;
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { a as ChartType } from "./chart-QilhWP8Z.js";
2
- import { t as LineOptions } from "./line-DtSh7HQU.js";
1
+ import { o as ChartType } from "./chart-CE9EVbfV.js";
2
+ import { t as LineOptions } from "./line-TkzA7wMK.js";
3
3
  /** Options of the area chart: line options with the fill always on. */
4
4
  type AreaOptions = Omit<LineOptions, "area">;
5
5
  /**
@@ -1,6 +1,6 @@
1
- const require_cartesian = require("./cartesian-DV02PsBe.cjs");
1
+ const require_cartesian = require("./cartesian-B9CrasFJ.cjs");
2
2
  const require_clean = require("./clean-Die2iCNc.cjs");
3
- const require_line = require("./line-Dbt6KFRK.cjs");
3
+ const require_line = require("./line-DHbYCQy4.cjs");
4
4
  // src/charts/area.ts
5
5
  /**
6
6
  * Area chart: filled lines over category labels, with zero in the y domain
@@ -16,6 +16,7 @@ const require_line = require("./line-Dbt6KFRK.cjs");
16
16
  const area = {
17
17
  name: "area",
18
18
  clean: require_clean.cleanData(require_clean.cleanSeries),
19
+ prepare: require_cartesian.windowed,
19
20
  render: (options, ctx) => require_line.renderLines(options, ctx, true),
20
21
  legend: (options) => require_cartesian.seriesLegend(options.data),
21
22
  table: (options, ctx, limit) => require_cartesian.seriesTable(options, ctx, limit)
@@ -27,4 +28,4 @@ Object.defineProperty(exports, "area", {
27
28
  }
28
29
  });
29
30
 
30
- //# sourceMappingURL=area-4eRs3c0K.cjs.map
31
+ //# sourceMappingURL=area-D_N8b4Ng.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area-D_N8b4Ng.cjs","names":["cleanData","cleanSeries","windowed","renderLines","seriesLegend","seriesTable"],"sources":["../src/charts/area.ts"],"sourcesContent":["import type { ChartType } from '../chart.ts'\nimport { seriesLegend, seriesTable, windowed } from './cartesian.ts'\nimport { cleanData, cleanSeries } from './clean.ts'\nimport { type LineOptions, renderLines } from './line.ts'\n\n/** Options of the area chart: line options with the fill always on. */\nexport type AreaOptions = Omit<LineOptions, 'area'>\n\n/**\n * Area chart: filled lines over category labels, with zero in the y domain\n * by default and a vertical fade (`fill: 'gradient'`).\n *\n * ```ts\n * new Chart('#el', {\n * type: area,\n * data: { labels: ['Jan', 'Feb', 'Mar'], series: [{ name: 'Sales', values: [3, 5, 4] }] },\n * })\n * ```\n */\nexport const area: ChartType<AreaOptions> = {\n name: 'area',\n clean: cleanData(cleanSeries),\n prepare: windowed,\n render: (options, ctx) => renderLines(options, ctx, true),\n legend: (options) => seriesLegend(options.data),\n table: (options, ctx, limit) => seriesTable(options, ctx, limit),\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAa,OAA+B;CAC1C,MAAM;CACN,OAAOA,cAAAA,UAAUC,cAAAA,WAAW;CAC5B,SAASC,kBAAAA;CACT,SAAS,SAAS,QAAQC,aAAAA,YAAY,SAAS,KAAK,IAAI;CACxD,SAAS,YAAYC,kBAAAA,aAAa,QAAQ,IAAI;CAC9C,QAAQ,SAAS,KAAK,UAAUC,kBAAAA,YAAY,SAAS,KAAK,KAAK;AACjE"}
package/dist/area.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_area = require("./area-4eRs3c0K.cjs");
2
+ const require_area = require("./area-D_N8b4Ng.cjs");
3
3
  exports.area = require_area.area;
package/dist/area.d.cts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Standalone entry: `import { area } from '@tabler/charts/area'`. */
2
- import { n as area, t as AreaOptions } from "./area-CJX9219z.cjs";
2
+ import { n as area, t as AreaOptions } from "./area-D6LNLk3r.cjs";
3
3
  export { type AreaOptions, area };
package/dist/area.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Standalone entry: `import { area } from '@tabler/charts/area'`. */
2
- import { n as area, t as AreaOptions } from "./area-d11XePuw.js";
2
+ import { n as area, t as AreaOptions } from "./area-DEFL-Yun.js";
3
3
  export { type AreaOptions, area };
package/dist/area.js CHANGED
@@ -1 +1 @@
1
- export { t as area } from "./area-0-L1bG9B.js";
1
+ export { t as area } from "./area-BN0uE9R0.js";
@@ -0,0 +1,305 @@
1
+ const require_format = require("./format-CAE5ruy6.cjs");
2
+ const require_layout = require("./layout-Cfg9x1k2.cjs");
3
+ const require_vnode = require("./vnode-ClAiw28x.cjs");
4
+ // src/scales/ticks.ts
5
+ const E10 = Math.sqrt(50);
6
+ const E5 = Math.sqrt(10);
7
+ const E2 = Math.sqrt(2);
8
+ /**
9
+ * Integer tick indices `[i1, i2]` and an increment `inc`. A negative `inc`
10
+ * means "divide by -inc", which keeps decimal ticks exact (0.3, not
11
+ * 0.30000000000000004).
12
+ */
13
+ function tickSpec(start, stop, count) {
14
+ const step = (stop - start) / Math.max(0, count);
15
+ const power = Math.floor(Math.log10(step));
16
+ const error = step / 10 ** power;
17
+ const factor = error >= E10 ? 10 : error >= E5 ? 5 : error >= E2 ? 2 : 1;
18
+ let i1;
19
+ let i2;
20
+ let inc;
21
+ if (power < 0) {
22
+ inc = 10 ** -power / factor;
23
+ i1 = Math.round(start * inc);
24
+ i2 = Math.round(stop * inc);
25
+ if (i1 / inc < start) ++i1;
26
+ if (i2 / inc > stop) --i2;
27
+ inc = -inc;
28
+ } else {
29
+ inc = 10 ** power * factor;
30
+ i1 = Math.round(start / inc);
31
+ i2 = Math.round(stop / inc);
32
+ if (i1 * inc < start) ++i1;
33
+ if (i2 * inc > stop) --i2;
34
+ }
35
+ if (i2 < i1 && count >= .5 && count < 2) return tickSpec(start, stop, count * 2);
36
+ return [
37
+ i1,
38
+ i2,
39
+ inc
40
+ ];
41
+ }
42
+ /**
43
+ * Roughly `count` evenly spaced, "nice" values (multiples of 1, 2 or 5 × 10ⁿ)
44
+ * between `start` and `stop`, inclusive. Order follows `start → stop`.
45
+ */
46
+ function ticks(start, stop, count = 5) {
47
+ if (!(count > 0) || !Number.isFinite(start) || !Number.isFinite(stop)) return [];
48
+ if (start === stop) return [start];
49
+ const reverse = stop < start;
50
+ const [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
51
+ if (!(i2 >= i1)) return [];
52
+ const n = i2 - i1 + 1;
53
+ const out = new Array(n);
54
+ for (let i = 0; i < n; i++) {
55
+ const index = reverse ? i2 - i : i1 + i;
56
+ out[i] = inc < 0 ? index / -inc : index * inc;
57
+ }
58
+ return out;
59
+ }
60
+ /**
61
+ * Signed tick increment: positive values are the step, negative values `-k`
62
+ * mean a step of `1 / k`.
63
+ */
64
+ function tickIncrement(start, stop, count) {
65
+ return tickSpec(start, stop, count)[2];
66
+ }
67
+ /** Distance between ticks produced by {@link ticks} for the same arguments. */
68
+ function tickStep(start, stop, count = 5) {
69
+ const reverse = stop < start;
70
+ const inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
71
+ return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
72
+ }
73
+ /**
74
+ * Extend `[start, stop]` to round tick values, e.g. `[0.2, 9.7] → [0, 10]`.
75
+ * Iterates because rounding can change the ideal step; if the step does not
76
+ * settle (e.g. very low `count` around zero keeps doubling the domain), the
77
+ * domain is returned unchanged, matching d3.
78
+ */
79
+ function niceDomain(start, stop, count = 5) {
80
+ if (!Number.isFinite(start) || !Number.isFinite(stop) || start === stop || !(count > 0)) return [start, stop];
81
+ const reverse = stop < start;
82
+ let lo = reverse ? stop : start;
83
+ let hi = reverse ? start : stop;
84
+ let prev;
85
+ for (let i = 0; i < 10; i++) {
86
+ const step = tickIncrement(lo, hi, count);
87
+ if (step === prev) return reverse ? [hi, lo] : [lo, hi];
88
+ if (step > 0) {
89
+ lo = Math.floor(lo / step) * step;
90
+ hi = Math.ceil(hi / step) * step;
91
+ } else if (step < 0) {
92
+ lo = Math.ceil(lo * step) / step;
93
+ hi = Math.floor(hi * step) / step;
94
+ } else break;
95
+ prev = step;
96
+ }
97
+ return [start, stop];
98
+ }
99
+ // src/components/axis.ts
100
+ /** Ticks for a linear scale, labelled with a shared precision. */
101
+ function linearTicks(scale, options = {}) {
102
+ const { count = 5, format, locale } = options;
103
+ const [d0, d1] = scale.domain;
104
+ const fmt = require_format.formatTicks(tickStep(d0, d1, count), format, locale);
105
+ return scale.ticks(count).map((value) => ({
106
+ value,
107
+ position: scale(value),
108
+ label: fmt(value)
109
+ }));
110
+ }
111
+ /** Ticks at the center of every band. */
112
+ function bandTicks(scale, format = String) {
113
+ return scale.domain.map((key, i) => ({
114
+ value: key,
115
+ position: scale.at(i) + scale.bandwidth / 2,
116
+ label: format(key, i)
117
+ }));
118
+ }
119
+ /** Whether labels are laid out along x (horizontal axes). */
120
+ const isHorizontal = (position) => position === "top" || position === "bottom";
121
+ /**
122
+ * Keep every n-th tick (smallest n) so labels do not overlap along the axis.
123
+ * The first and the last tick are always kept: when the last one does not
124
+ * land on the step, it replaces the last kept tick if they would collide.
125
+ */
126
+ function thinTicks(ticks, position, fontSize, gap = 8) {
127
+ if (ticks.length < 2) return ticks.slice();
128
+ const size = (tick) => isHorizontal(position) ? require_layout.estimateTextWidth(tick.label, fontSize) : fontSize * require_layout.LINE_HEIGHT;
129
+ const sizes = ticks.map(size);
130
+ const fitsBetween = (i, j) => Math.abs(ticks[j].position - ticks[i].position) >= (sizes[i] + sizes[j]) / 2 + gap;
131
+ const last = ticks.length - 1;
132
+ const span = Math.abs(ticks[last].position - ticks[0].position);
133
+ const total = sizes.reduce((sum, size) => sum + size + gap, 0);
134
+ const first = span > 0 ? Math.max(1, Math.floor(total / span)) : last;
135
+ for (let step = first; step <= last; step++) {
136
+ let fits = true;
137
+ for (let i = step; i <= last && fits; i += step) fits = fitsBetween(i - step, i);
138
+ if (!fits) continue;
139
+ const kept = [];
140
+ for (let i = 0; i <= last; i += step) kept.push(i);
141
+ const tail = kept[kept.length - 1];
142
+ if (tail !== last) {
143
+ if (fitsBetween(tail, last)) kept.push(last);
144
+ else if (kept.length > 1 && fitsBetween(kept[kept.length - 2], last)) kept[kept.length - 1] = last;
145
+ }
146
+ return kept.map((i) => ticks[i]);
147
+ }
148
+ return ticks.slice(0, 1);
149
+ }
150
+ /** Pixels an axis occupies perpendicular to the plot edge (for margins). */
151
+ function axisSize(position, ticks, fontSize, options = {}) {
152
+ const { tickSize = 0, tickPadding = 8, rotate } = options;
153
+ if (ticks.length === 0) return 0;
154
+ const labels = isHorizontal(position) && !rotate ? fontSize * require_layout.LINE_HEIGHT : ticks.reduce((max, t) => Math.max(max, require_layout.estimateTextWidth(t.label, fontSize)), 0) + 3;
155
+ return Math.ceil(labels + tickSize + tickPadding);
156
+ }
157
+ /** Space between the tick labels and the axis title. */
158
+ const TITLE_GAP = 6;
159
+ /** Pixels an axis title adds to the axis (for margins): none without a title. */
160
+ const axisTitleSize = (title, fontSize) => title ? Math.ceil(fontSize * require_layout.LINE_HEIGHT) + TITLE_GAP : 0;
161
+ /**
162
+ * Render the title of an axis as `<text class="tc-axis-title tc-axis-title-{position}">`,
163
+ * past the labels of `ticks` and centered on the plot: along the axis at the
164
+ * bottom, turned 90° beside the plot to read away from it (bottom to top on
165
+ * the left, top to bottom on the right).
166
+ */
167
+ function axisTitle(position, ticks, area, title, fontSize, rotate) {
168
+ const reach = axisSize(position, ticks, fontSize, { rotate }) + TITLE_GAP;
169
+ const sign = position === "left" ? -1 : 1;
170
+ const side = reach + fontSize * require_layout.LINE_HEIGHT / 2;
171
+ return require_vnode.h("text", {
172
+ key: `axis-title-${position}`,
173
+ class: `tc-axis-title tc-axis-title-${position}`,
174
+ transform: position === "bottom" ? `translate(${require_layout.round(area.x + area.width / 2)},${require_layout.round(area.y + area.height + reach)})` : `translate(${require_layout.round(position === "left" ? area.x - side : area.x + area.width + side)},${require_layout.round(area.y + area.height / 2)}) rotate(${sign * 90})`,
175
+ dy: position === "bottom" ? "0.71em" : "0.32em",
176
+ "text-anchor": "middle",
177
+ "aria-hidden": "true"
178
+ }, title);
179
+ }
180
+ /**
181
+ * Render an axis as `<g class="tc-axis tc-axis-{x|y} tc-axis-{position}">`
182
+ * with one `<g class="tc-tick">` per tick, keyed by value so ticks can
183
+ * transition when the scale changes.
184
+ */
185
+ function axis(options) {
186
+ const { position, ticks, area, tickSize = 0, tickPadding = 8, line = false, rotate } = options;
187
+ const horizontal = isHorizontal(position);
188
+ const sign = position === "top" || position === "left" ? -1 : 1;
189
+ const offset = sign * (tickSize + tickPadding);
190
+ const edge = position === "top" ? area.y : position === "bottom" ? area.y + area.height : position === "left" ? area.x : area.x + area.width;
191
+ const label = rotate ? {
192
+ transform: "rotate(-90)",
193
+ x: -offset,
194
+ dy: "0.32em",
195
+ "text-anchor": "end"
196
+ } : horizontal ? {
197
+ y: offset,
198
+ dy: position === "top" ? "0em" : "0.71em",
199
+ "text-anchor": "middle"
200
+ } : {
201
+ x: offset,
202
+ dy: "0.32em",
203
+ "text-anchor": position === "left" ? "end" : "start"
204
+ };
205
+ const tickLine = horizontal ? { y2: sign * tickSize } : { x2: sign * tickSize };
206
+ return require_vnode.h("g", {
207
+ key: `axis-${position}`,
208
+ class: [
209
+ "tc-axis",
210
+ horizontal ? "tc-axis-x" : "tc-axis-y",
211
+ `tc-axis-${position}`
212
+ ],
213
+ "aria-hidden": "true"
214
+ }, line && require_vnode.h("line", horizontal ? {
215
+ class: "tc-axis-line",
216
+ x1: area.x,
217
+ x2: area.x + area.width,
218
+ y1: edge,
219
+ y2: edge
220
+ } : {
221
+ class: "tc-axis-line",
222
+ x1: edge,
223
+ x2: edge,
224
+ y1: area.y,
225
+ y2: area.y + area.height
226
+ }), ticks.map((tick) => require_vnode.h("g", {
227
+ key: tick.value,
228
+ class: "tc-tick",
229
+ style: horizontal ? `transform:translate(${require_layout.round(tick.position)}px,${require_layout.round(edge)}px)` : `transform:translate(${require_layout.round(edge)}px,${require_layout.round(tick.position)}px)`
230
+ }, tickSize > 0 && require_vnode.h("line", {
231
+ class: "tc-tick-line",
232
+ ...tickLine
233
+ }), require_vnode.h("text", {
234
+ class: "tc-tick-label",
235
+ ...label
236
+ }, tick.label))));
237
+ }
238
+ Object.defineProperty(exports, "axis", {
239
+ enumerable: true,
240
+ get: function() {
241
+ return axis;
242
+ }
243
+ });
244
+ Object.defineProperty(exports, "axisSize", {
245
+ enumerable: true,
246
+ get: function() {
247
+ return axisSize;
248
+ }
249
+ });
250
+ Object.defineProperty(exports, "axisTitle", {
251
+ enumerable: true,
252
+ get: function() {
253
+ return axisTitle;
254
+ }
255
+ });
256
+ Object.defineProperty(exports, "axisTitleSize", {
257
+ enumerable: true,
258
+ get: function() {
259
+ return axisTitleSize;
260
+ }
261
+ });
262
+ Object.defineProperty(exports, "bandTicks", {
263
+ enumerable: true,
264
+ get: function() {
265
+ return bandTicks;
266
+ }
267
+ });
268
+ Object.defineProperty(exports, "linearTicks", {
269
+ enumerable: true,
270
+ get: function() {
271
+ return linearTicks;
272
+ }
273
+ });
274
+ Object.defineProperty(exports, "niceDomain", {
275
+ enumerable: true,
276
+ get: function() {
277
+ return niceDomain;
278
+ }
279
+ });
280
+ Object.defineProperty(exports, "thinTicks", {
281
+ enumerable: true,
282
+ get: function() {
283
+ return thinTicks;
284
+ }
285
+ });
286
+ Object.defineProperty(exports, "tickIncrement", {
287
+ enumerable: true,
288
+ get: function() {
289
+ return tickIncrement;
290
+ }
291
+ });
292
+ Object.defineProperty(exports, "tickStep", {
293
+ enumerable: true,
294
+ get: function() {
295
+ return tickStep;
296
+ }
297
+ });
298
+ Object.defineProperty(exports, "ticks", {
299
+ enumerable: true,
300
+ get: function() {
301
+ return ticks;
302
+ }
303
+ });
304
+
305
+ //# sourceMappingURL=axis-BzBkkC5X.cjs.map