@tabler/charts 0.1.0 → 0.3.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 (445) hide show
  1. package/README.md +92 -4
  2. package/dist/{annotations-Bp7HwtF5.d.ts → annotations-B02GR_KU.d.ts} +3 -8
  3. package/dist/{annotations-BszTTjf9.js → annotations-BQ8l-qHs.js} +6 -7
  4. package/dist/{annotations-BszTTjf9.js.map → annotations-BQ8l-qHs.js.map} +1 -1
  5. package/dist/{annotations-lyt0I3HU.d.cts → annotations-CHafaGd4.d.cts} +3 -8
  6. package/dist/{annotations-DpETO8dE.cjs → annotations-CpCWA29b.cjs} +6 -7
  7. package/dist/{annotations-DpETO8dE.cjs.map → annotations-CpCWA29b.cjs.map} +1 -1
  8. package/dist/annotations.cjs +3 -5
  9. package/dist/annotations.cjs.map +1 -1
  10. package/dist/annotations.d.cts +2 -1
  11. package/dist/annotations.d.ts +2 -1
  12. package/dist/annotations.js +3 -4
  13. package/dist/{arc-a1tRTEw7.js → arc-B3V5IR0w.js} +2 -3
  14. package/dist/{arc-a1tRTEw7.js.map → arc-B3V5IR0w.js.map} +1 -1
  15. package/dist/{arc-BXpLrt9b.cjs → arc-CYhI62kO.cjs} +2 -3
  16. package/dist/{arc-BXpLrt9b.cjs.map → arc-CYhI62kO.cjs.map} +1 -1
  17. package/dist/{area-CF__HOwL.d.ts → area-DEFQm_SQ.d.ts} +3 -6
  18. package/dist/{area-sHCE3pg5.cjs → area-DYdQ_sMV.cjs} +5 -6
  19. package/dist/{area-sHCE3pg5.cjs.map → area-DYdQ_sMV.cjs.map} +1 -1
  20. package/dist/{area-DQsLERhx.js → area-WdtfqvhX.js} +5 -6
  21. package/dist/{area-DQsLERhx.js.map → area-WdtfqvhX.js.map} +1 -1
  22. package/dist/{area-DIxaAbYZ.d.cts → area-h_FvieFb.d.cts} +3 -6
  23. package/dist/area.cjs +1 -1
  24. package/dist/area.d.cts +2 -1
  25. package/dist/area.d.ts +2 -1
  26. package/dist/area.js +1 -2
  27. package/dist/axis-MMaVoSWB.js +235 -0
  28. package/dist/axis-MMaVoSWB.js.map +1 -0
  29. package/dist/axis-YfAerNBA.cjs +300 -0
  30. package/dist/axis-YfAerNBA.cjs.map +1 -0
  31. package/dist/{band-DTcNDAFO.d.ts → band-CNKvdnTC.d.cts} +1 -4
  32. package/dist/{band-DTcNDAFO.d.cts → band-CNKvdnTC.d.ts} +1 -4
  33. package/dist/{bar-jZEoao74.js → bar-BOcRcArc.js} +80 -62
  34. package/dist/bar-BOcRcArc.js.map +1 -0
  35. package/dist/{bar-C-7zR2qp.cjs → bar-CVkOJ7WA.cjs} +82 -64
  36. package/dist/bar-CVkOJ7WA.cjs.map +1 -0
  37. package/dist/{bar-DM16NUvV.js → bar-CgpC2EpX.js} +3 -4
  38. package/dist/{bar-DM16NUvV.js.map → bar-CgpC2EpX.js.map} +1 -1
  39. package/dist/{bar-BBM8RhoL.d.ts → bar-D9B_arKf.d.ts} +4 -7
  40. package/dist/{bar-CRKLDg98.d.cts → bar-DZCQ-kyf.d.cts} +4 -7
  41. package/dist/{bar-DGuUN3nc.cjs → bar-wVykm1us.cjs} +3 -4
  42. package/dist/{bar-DGuUN3nc.cjs.map → bar-wVykm1us.cjs.map} +1 -1
  43. package/dist/bar.cjs +1 -1
  44. package/dist/bar.d.cts +2 -1
  45. package/dist/bar.d.ts +2 -1
  46. package/dist/bar.js +1 -2
  47. package/dist/calendar-BSvO8nRb.d.cts +106 -0
  48. package/dist/calendar-BXgIX5H1.js +502 -0
  49. package/dist/calendar-BXgIX5H1.js.map +1 -0
  50. package/dist/calendar-Bq3vFzPl.d.ts +106 -0
  51. package/dist/calendar-DAFXjV99.cjs +507 -0
  52. package/dist/calendar-DAFXjV99.cjs.map +1 -0
  53. package/dist/calendar.cjs +3 -0
  54. package/dist/calendar.d.cts +3 -0
  55. package/dist/calendar.d.ts +3 -0
  56. package/dist/calendar.js +1 -0
  57. package/dist/{candlestick-D_vV0_XZ.d.ts → candlestick-B3WcLzph.d.ts} +3 -6
  58. package/dist/{candlestick-__pXl_pV.d.cts → candlestick-BcomxeVG.d.cts} +3 -6
  59. package/dist/{candlestick-DuXwAFID.js → candlestick-BtT9glp9.js} +19 -18
  60. package/dist/{candlestick-DuXwAFID.js.map → candlestick-BtT9glp9.js.map} +1 -1
  61. package/dist/{candlestick-B5r1w3kc.cjs → candlestick-CSmRuZ4v.cjs} +19 -18
  62. package/dist/{candlestick-B5r1w3kc.cjs.map → candlestick-CSmRuZ4v.cjs.map} +1 -1
  63. package/dist/candlestick.cjs +4 -5
  64. package/dist/candlestick.d.cts +1 -1
  65. package/dist/candlestick.d.ts +1 -1
  66. package/dist/candlestick.js +4 -6
  67. package/dist/{cartesian-Cr0AF0nG.js → cartesian-BrPqb5Qn.js} +138 -264
  68. package/dist/cartesian-BrPqb5Qn.js.map +1 -0
  69. package/dist/{cartesian-BoDfgBCV.cjs → cartesian-DRSXHxWe.cjs} +162 -324
  70. package/dist/cartesian-DRSXHxWe.cjs.map +1 -0
  71. package/dist/{chart-BF2CK9I_.js → chart-B6TTY4Kr.js} +120 -77
  72. package/dist/chart-B6TTY4Kr.js.map +1 -0
  73. package/dist/{chart-DyN7bcx8.d.ts → chart-CYrrUCi3.d.ts} +222 -102
  74. package/dist/{chart-D7ooEFnk.d.cts → chart-CbPzP5Dp.d.cts} +248 -102
  75. package/dist/{chart-CowF_lWY.cjs → chart-D_lyOy-M.cjs} +132 -83
  76. package/dist/chart-D_lyOy-M.cjs.map +1 -0
  77. package/dist/{circle-BQMuAfls.cjs → circle-Bwxy5j7B.cjs} +2 -3
  78. package/dist/{circle-BQMuAfls.cjs.map → circle-Bwxy5j7B.cjs.map} +1 -1
  79. package/dist/{circle-Z7YfCoCM.js → circle-YRDaOBpk.js} +2 -3
  80. package/dist/{circle-Z7YfCoCM.js.map → circle-YRDaOBpk.js.map} +1 -1
  81. package/dist/{clean-o1vDEhFV.js → clean-CkoQobGv.js} +3 -4
  82. package/dist/{clean-o1vDEhFV.js.map → clean-CkoQobGv.js.map} +1 -1
  83. package/dist/{clean-Byl6kzf0.cjs → clean-Die2iCNc.cjs} +8 -3
  84. package/dist/{clean-Byl6kzf0.cjs.map → clean-Die2iCNc.cjs.map} +1 -1
  85. package/dist/{core-D1vO1LrC.d.cts → core-9BnLEW4K.d.cts} +31 -72
  86. package/dist/{core-DcbemzGf.d.ts → core-C3qEppSm.d.ts} +10 -46
  87. package/dist/{core-CegR_j55.js → core-CQ0FaJ4G.js} +138 -99
  88. package/dist/core-CQ0FaJ4G.js.map +1 -0
  89. package/dist/{core-RzS9IQO5.cjs → core-D2PSked3.cjs} +139 -100
  90. package/dist/core-D2PSked3.cjs.map +1 -0
  91. package/dist/core.cjs +47 -33
  92. package/dist/core.d.cts +26 -21
  93. package/dist/core.d.ts +26 -21
  94. package/dist/core.js +31 -25
  95. package/dist/{dates-CG-FvioW.js → dates-DLe2Ww64.js} +4 -5
  96. package/dist/{dates-CG-FvioW.js.map → dates-DLe2Ww64.js.map} +1 -1
  97. package/dist/{dates-Btm7Zm6W.cjs → dates-DerXTb1J.cjs} +4 -5
  98. package/dist/{dates-Btm7Zm6W.cjs.map → dates-DerXTb1J.cjs.map} +1 -1
  99. package/dist/{decimate-tLhDk1ys.cjs → decimate-BS3x8g-f.cjs} +2 -3
  100. package/dist/{decimate-tLhDk1ys.cjs.map → decimate-BS3x8g-f.cjs.map} +1 -1
  101. package/dist/{decimate-BGg9XgF0.d.ts → decimate-BxxYBJJk.d.cts} +2 -5
  102. package/dist/{decimate-C87cl_Sp.js → decimate-CapfgiDY.js} +2 -3
  103. package/dist/{decimate-C87cl_Sp.js.map → decimate-CapfgiDY.js.map} +1 -1
  104. package/dist/{decimate-CNSpgGa5.d.cts → decimate-Du87fMLG.d.ts} +2 -5
  105. package/dist/decimate.cjs +3 -4
  106. package/dist/decimate.d.cts +1 -1
  107. package/dist/decimate.d.ts +1 -1
  108. package/dist/decimate.js +3 -4
  109. package/dist/{dom-CLF868Qs.cjs → dom-C33zvtPo.cjs} +5 -11
  110. package/dist/dom-C33zvtPo.cjs.map +1 -0
  111. package/dist/{dom-vP3IcMak.js → dom-CTse6Rvd.js} +5 -11
  112. package/dist/dom-CTse6Rvd.js.map +1 -0
  113. package/dist/{export-chart-BhhYgksr.cjs → export-chart-CPtXmZvi.cjs} +18 -14
  114. package/dist/export-chart-CPtXmZvi.cjs.map +1 -0
  115. package/dist/{export-chart-9w8t3rjZ.js → export-chart-DoeiAyR2.js} +18 -14
  116. package/dist/export-chart-DoeiAyR2.js.map +1 -0
  117. package/dist/export.cjs +3 -5
  118. package/dist/export.cjs.map +1 -1
  119. package/dist/export.d.cts +8 -1
  120. package/dist/export.d.ts +8 -1
  121. package/dist/export.js +3 -4
  122. package/dist/{extent-BAMZo0Nq.js → extent-DOV8rs-6.js} +2 -3
  123. package/dist/{extent-BAMZo0Nq.js.map → extent-DOV8rs-6.js.map} +1 -1
  124. package/dist/{extent-DsFWvAHJ.cjs → extent-DuYDcvM9.cjs} +2 -3
  125. package/dist/{extent-DsFWvAHJ.cjs.map → extent-DuYDcvM9.cjs.map} +1 -1
  126. package/dist/{fade-D3NxH5Qg.js → fade-CDrQjnDz.js} +59 -83
  127. package/dist/fade-CDrQjnDz.js.map +1 -0
  128. package/dist/{fade-Cs74puQS.cjs → fade-CRqcKMWY.cjs} +59 -83
  129. package/dist/fade-CRqcKMWY.cjs.map +1 -0
  130. package/dist/{features-wASyHGic.js → features-B55rwpQC.js} +5 -4
  131. package/dist/features-B55rwpQC.js.map +1 -0
  132. package/dist/{features-BclHgg2W.cjs → features-DEDP5CEQ.cjs} +10 -3
  133. package/dist/features-DEDP5CEQ.cjs.map +1 -0
  134. package/dist/fit-BPyPRnsK.js +16 -0
  135. package/dist/fit-BPyPRnsK.js.map +1 -0
  136. package/dist/fit-D4MIIQQz.cjs +21 -0
  137. package/dist/fit-D4MIIQQz.cjs.map +1 -0
  138. package/dist/{format-B0yKXBTH.cjs → format-CAE5ruy6.cjs} +2 -3
  139. package/dist/{format-B0yKXBTH.cjs.map → format-CAE5ruy6.cjs.map} +1 -1
  140. package/dist/{format-lStwuc1L.js → format-it1kepFG.js} +2 -3
  141. package/dist/{format-lStwuc1L.js.map → format-it1kepFG.js.map} +1 -1
  142. package/dist/funnel-BdcfUkb5.d.ts +50 -0
  143. package/dist/funnel-CFEEulw_.cjs +244 -0
  144. package/dist/funnel-CFEEulw_.cjs.map +1 -0
  145. package/dist/funnel-CYCv8cq2.js +239 -0
  146. package/dist/funnel-CYCv8cq2.js.map +1 -0
  147. package/dist/funnel-CarOh8w_.d.cts +50 -0
  148. package/dist/funnel.cjs +3 -0
  149. package/dist/funnel.d.cts +3 -0
  150. package/dist/funnel.d.ts +3 -0
  151. package/dist/funnel.js +1 -0
  152. package/dist/{gauge-D-FYhuds.cjs → gauge-6HfDcLMJ.cjs} +35 -36
  153. package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
  154. package/dist/{gauge-Dh423FHh.js → gauge-DiTk5aWO.js} +35 -36
  155. package/dist/gauge-DiTk5aWO.js.map +1 -0
  156. package/dist/{gauge-zpia05t2.d.ts → gauge-Ds9k1UV2.d.cts} +5 -8
  157. package/dist/{gauge-DP_EB2z3.d.cts → gauge-Zy25jfps.d.ts} +5 -8
  158. package/dist/gauge.cjs +1 -1
  159. package/dist/gauge.d.cts +2 -1
  160. package/dist/gauge.d.ts +2 -1
  161. package/dist/gauge.js +1 -2
  162. package/dist/{heatmap-DSZ2bVIa.js → heatmap-C1v8bwpq.js} +43 -43
  163. package/dist/heatmap-C1v8bwpq.js.map +1 -0
  164. package/dist/{heatmap-BectCEeE.d.ts → heatmap-CJ-0dfhJ.d.cts} +4 -7
  165. package/dist/{heatmap-BK18EBgJ.cjs → heatmap-Dcc_bsoQ.cjs} +47 -47
  166. package/dist/heatmap-Dcc_bsoQ.cjs.map +1 -0
  167. package/dist/{heatmap-CCso6m61.d.cts → heatmap-Jp5sHRTo.d.ts} +4 -7
  168. package/dist/heatmap.cjs +1 -1
  169. package/dist/heatmap.d.cts +2 -1
  170. package/dist/heatmap.d.ts +2 -1
  171. package/dist/heatmap.js +1 -2
  172. package/dist/{hydrate-DDNIHYv_.js → hydrate-BB3MlR36.js} +3 -4
  173. package/dist/{hydrate-DDNIHYv_.js.map → hydrate-BB3MlR36.js.map} +1 -1
  174. package/dist/{hydrate-CzfxLfTv.d.ts → hydrate-BtAZf_5K.d.cts} +2 -5
  175. package/dist/{hydrate-CTTmQy0x.d.cts → hydrate-OjM1pIUG.d.ts} +2 -5
  176. package/dist/{hydrate-CxwTXDqO.cjs → hydrate-m0I5m6ue.cjs} +3 -4
  177. package/dist/hydrate-m0I5m6ue.cjs.map +1 -0
  178. package/dist/hydrate.cjs +3 -4
  179. package/dist/hydrate.cjs.map +1 -1
  180. package/dist/hydrate.d.cts +1 -1
  181. package/dist/hydrate.d.ts +1 -1
  182. package/dist/hydrate.js +3 -4
  183. package/dist/index.cjs +72 -56
  184. package/dist/index.cjs.map +1 -1
  185. package/dist/index.d.cts +28 -28
  186. package/dist/index.d.ts +28 -28
  187. package/dist/index.js +52 -44
  188. package/dist/index.js.map +1 -1
  189. package/dist/interaction-DXYSjgnP.cjs +32 -0
  190. package/dist/interaction-DXYSjgnP.cjs.map +1 -0
  191. package/dist/interaction-En1KlwFO.js +21 -0
  192. package/dist/interaction-En1KlwFO.js.map +1 -0
  193. package/dist/{layout-CtMBhNd9.cjs → layout-Cfg9x1k2.cjs} +45 -3
  194. package/dist/layout-Cfg9x1k2.cjs.map +1 -0
  195. package/dist/{layout-B3hiqVEw.js → layout-DqAte3H8.js} +34 -4
  196. package/dist/layout-DqAte3H8.js.map +1 -0
  197. package/dist/{line-CN4uZ9ZX.d.ts → line-Bpr5uVLQ.d.ts} +4 -7
  198. package/dist/{line-B3Ed6u7j.js → line-CxR4tg1Q.js} +49 -38
  199. package/dist/line-CxR4tg1Q.js.map +1 -0
  200. package/dist/{line-fQbtP_jL.cjs → line-YiCuhVMI.cjs} +49 -38
  201. package/dist/line-YiCuhVMI.cjs.map +1 -0
  202. package/dist/{line-W7VD_qs1.d.cts → line-vyWO030v.d.cts} +4 -7
  203. package/dist/line.cjs +4 -5
  204. package/dist/line.cjs.map +1 -1
  205. package/dist/line.d.cts +1 -1
  206. package/dist/line.d.ts +1 -1
  207. package/dist/line.js +4 -6
  208. package/dist/{log-CaofN3-n.d.ts → log-CI41TmcU.d.cts} +1 -6
  209. package/dist/{log-CaofN3-n.d.cts → log-CI41TmcU.d.ts} +1 -6
  210. package/dist/{log-axis-83rSpvL5.cjs → log-axis-DdRNyAq8.cjs} +6 -8
  211. package/dist/{log-axis-83rSpvL5.cjs.map → log-axis-DdRNyAq8.cjs.map} +1 -1
  212. package/dist/{log-axis-B_uvvOFc.js → log-axis-DhthtHFk.js} +6 -8
  213. package/dist/{log-axis-B_uvvOFc.js.map → log-axis-DhthtHFk.js.map} +1 -1
  214. package/dist/log.cjs +3 -5
  215. package/dist/log.cjs.map +1 -1
  216. package/dist/log.d.cts +1 -1
  217. package/dist/log.d.ts +1 -1
  218. package/dist/log.js +3 -4
  219. package/dist/map-49FcfdmJ.d.cts +156 -0
  220. package/dist/map-BMC61J-P.d.ts +156 -0
  221. package/dist/map-BqrZ80vT.cjs +818 -0
  222. package/dist/map-BqrZ80vT.cjs.map +1 -0
  223. package/dist/map-C15NC7kW.js +807 -0
  224. package/dist/map-C15NC7kW.js.map +1 -0
  225. package/dist/map.cjs +4 -0
  226. package/dist/map.d.cts +3 -0
  227. package/dist/map.d.ts +3 -0
  228. package/dist/map.js +1 -0
  229. package/dist/maps/world.cjs +875 -0
  230. package/dist/maps/world.cjs.map +1 -0
  231. package/dist/maps/world.d.cts +2 -0
  232. package/dist/maps/world.d.ts +2 -0
  233. package/dist/maps/world.js +874 -0
  234. package/dist/maps/world.js.map +1 -0
  235. package/dist/{morph-CqYDu1bY.cjs → morph-3I1Nf_tR.cjs} +4 -5
  236. package/dist/morph-3I1Nf_tR.cjs.map +1 -0
  237. package/dist/{morph-BMxz3X2b.d.ts → morph-Dh7gJkV4.d.cts} +1 -4
  238. package/dist/{morph-BMxz3X2b.d.cts → morph-Dh7gJkV4.d.ts} +1 -4
  239. package/dist/{morph-Bgg-24l8.js → morph-GfBab-b3.js} +4 -5
  240. package/dist/{morph-Bgg-24l8.js.map → morph-GfBab-b3.js.map} +1 -1
  241. package/dist/morph.cjs +3 -4
  242. package/dist/morph.cjs.map +1 -1
  243. package/dist/morph.d.cts +1 -1
  244. package/dist/morph.d.ts +1 -1
  245. package/dist/morph.js +3 -4
  246. package/dist/{named-BWWb5LQJ.cjs → named-BBASc8dW.cjs} +2 -3
  247. package/dist/{named-BWWb5LQJ.cjs.map → named-BBASc8dW.cjs.map} +1 -1
  248. package/dist/{named-DE15TOgh.js → named-BOiBah6I.js} +2 -3
  249. package/dist/{named-DE15TOgh.js.map → named-BOiBah6I.js.map} +1 -1
  250. package/dist/others-DBIGE6jr.js +57 -0
  251. package/dist/others-DBIGE6jr.js.map +1 -0
  252. package/dist/others-DBO4Kjwl.d.ts +29 -0
  253. package/dist/others-WfjCsjqT.cjs +68 -0
  254. package/dist/others-WfjCsjqT.cjs.map +1 -0
  255. package/dist/others-ls5eKtZ4.d.cts +31 -0
  256. package/dist/{parliament-Dw0sOERi.js → parliament-BKN6ikBJ.js} +36 -36
  257. package/dist/parliament-BKN6ikBJ.js.map +1 -0
  258. package/dist/{parliament-1Zv2Xh0D.d.ts → parliament-C7V8UJj1.d.cts} +5 -8
  259. package/dist/{parliament-DdrLVZwt.d.cts → parliament-Cz9n_DoK.d.ts} +5 -8
  260. package/dist/{parliament-CpWnoEvG.cjs → parliament-DhxAaIZ3.cjs} +36 -36
  261. package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
  262. package/dist/parliament.cjs +1 -1
  263. package/dist/parliament.d.cts +2 -1
  264. package/dist/parliament.d.ts +2 -1
  265. package/dist/parliament.js +1 -2
  266. package/dist/{path-CwB28da0.d.ts → path-YeUiOfG8.d.cts} +1 -4
  267. package/dist/{path-CwB28da0.d.cts → path-YeUiOfG8.d.ts} +1 -4
  268. package/dist/{patterns-DtgcnA8o.js → patterns-BMUINoka.js} +4 -5
  269. package/dist/{patterns-DtgcnA8o.js.map → patterns-BMUINoka.js.map} +1 -1
  270. package/dist/{patterns-LfcQAWCy.cjs → patterns-Dw7OMD_2.cjs} +4 -5
  271. package/dist/{patterns-LfcQAWCy.cjs.map → patterns-Dw7OMD_2.cjs.map} +1 -1
  272. package/dist/patterns.cjs +3 -5
  273. package/dist/patterns.cjs.map +1 -1
  274. package/dist/patterns.d.cts +5 -1
  275. package/dist/patterns.d.ts +5 -1
  276. package/dist/patterns.js +3 -4
  277. package/dist/percentage-bar-BChkTRoz.cjs +164 -0
  278. package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
  279. package/dist/percentage-bar-CaInxrL8.js +159 -0
  280. package/dist/percentage-bar-CaInxrL8.js.map +1 -0
  281. package/dist/percentage-bar-R1--2grK.d.cts +58 -0
  282. package/dist/percentage-bar-cSeiLdwU.d.ts +58 -0
  283. package/dist/percentage-bar.cjs +3 -0
  284. package/dist/percentage-bar.d.cts +3 -0
  285. package/dist/percentage-bar.d.ts +3 -0
  286. package/dist/percentage-bar.js +1 -0
  287. package/dist/{pie-BF9yI5mE.d.cts → pie-BQQkvy1N.d.ts} +11 -11
  288. package/dist/{pie-DzUXDTcn.js → pie-Bd8wyrtY.js} +52 -55
  289. package/dist/pie-Bd8wyrtY.js.map +1 -0
  290. package/dist/{pie-BxTZt6Go.cjs → pie-BseZlCgP.cjs} +52 -55
  291. package/dist/pie-BseZlCgP.cjs.map +1 -0
  292. package/dist/{pie-5z1fDdKO.d.ts → pie-vD5-g8je.d.cts} +11 -11
  293. package/dist/pie.cjs +1 -1
  294. package/dist/pie.d.cts +2 -1
  295. package/dist/pie.d.ts +2 -1
  296. package/dist/pie.js +1 -2
  297. package/dist/{point-shapes-CGl4dugc.cjs → point-shapes-BRawRM78.cjs} +24 -24
  298. package/dist/point-shapes-BRawRM78.cjs.map +1 -0
  299. package/dist/{point-shapes-DI84NNpI.js → point-shapes-DI6GhcI7.js} +19 -25
  300. package/dist/point-shapes-DI6GhcI7.js.map +1 -0
  301. package/dist/point-shapes.cjs +7 -6
  302. package/dist/point-shapes.cjs.map +1 -1
  303. package/dist/point-shapes.d.cts +6 -2
  304. package/dist/point-shapes.d.ts +6 -2
  305. package/dist/point-shapes.js +8 -7
  306. package/dist/point-shapes.js.map +1 -1
  307. package/dist/{radar-1-EryihA.d.ts → radar-7I6hsY_h.d.cts} +4 -7
  308. package/dist/{radar-CYPab_I4.js → radar-D6XqkFWQ.js} +25 -27
  309. package/dist/radar-D6XqkFWQ.js.map +1 -0
  310. package/dist/{radar-CoGUNNSb.cjs → radar-DjISDnSf.cjs} +26 -28
  311. package/dist/radar-DjISDnSf.cjs.map +1 -0
  312. package/dist/{radar-DBW4O0Vt.d.cts → radar-vLxilcr4.d.ts} +4 -7
  313. package/dist/radar.cjs +1 -1
  314. package/dist/radar.d.cts +2 -1
  315. package/dist/radar.d.ts +2 -1
  316. package/dist/radar.js +1 -2
  317. package/dist/rect-CZTNvMlf.js +11 -0
  318. package/dist/rect-CZTNvMlf.js.map +1 -0
  319. package/dist/rect-DPr9QRxl.cjs +16 -0
  320. package/dist/rect-DPr9QRxl.cjs.map +1 -0
  321. package/dist/{sankey-Bacx4fVe.cjs → sankey-0CSp_Er9.cjs} +100 -95
  322. package/dist/sankey-0CSp_Er9.cjs.map +1 -0
  323. package/dist/{sankey-OV_WoPrl.d.ts → sankey-7As41Fo4.d.ts} +4 -7
  324. package/dist/{sankey-B4PNKusJ.js → sankey-Dp4CuLVe.js} +100 -95
  325. package/dist/sankey-Dp4CuLVe.js.map +1 -0
  326. package/dist/{sankey-DuGI3Qc5.d.cts → sankey-DqiuxUx7.d.cts} +4 -7
  327. package/dist/sankey.cjs +1 -1
  328. package/dist/sankey.d.cts +2 -1
  329. package/dist/sankey.d.ts +2 -1
  330. package/dist/sankey.js +1 -2
  331. package/dist/{scatter-DbxLyZX0.d.cts → scatter-BXkXGgM_.d.ts} +14 -9
  332. package/dist/{scatter-DgMN9zRy.cjs → scatter-Bwkblr4L.cjs} +47 -42
  333. package/dist/scatter-Bwkblr4L.cjs.map +1 -0
  334. package/dist/{scatter-kgtgR318.js → scatter-DCMAtt5L.js} +45 -40
  335. package/dist/scatter-DCMAtt5L.js.map +1 -0
  336. package/dist/{scatter-BqzgJqdX.d.ts → scatter-DL0zAV09.d.cts} +14 -9
  337. package/dist/scatter.cjs +1 -1
  338. package/dist/scatter.d.cts +2 -1
  339. package/dist/scatter.d.ts +2 -1
  340. package/dist/scatter.js +1 -2
  341. package/dist/{sparkline-BfyO_oNM.d.ts → sparkline-BElUSd0r.d.ts} +5 -8
  342. package/dist/{sparkline-BS9-hltA.cjs → sparkline-BMSuEPHP.cjs} +22 -23
  343. package/dist/sparkline-BMSuEPHP.cjs.map +1 -0
  344. package/dist/{sparkline-BQzt27Fr.js → sparkline-NDmq90kP.js} +22 -23
  345. package/dist/sparkline-NDmq90kP.js.map +1 -0
  346. package/dist/{sparkline-CWlJDKyh.d.cts → sparkline-RYly7bR0.d.cts} +5 -8
  347. package/dist/sparkline.cjs +1 -1
  348. package/dist/sparkline.d.cts +2 -1
  349. package/dist/sparkline.d.ts +2 -1
  350. package/dist/sparkline.js +1 -2
  351. package/dist/{stack-DVhJWaki.cjs → stack-BO4624CY.cjs} +3 -4
  352. package/dist/{stack-DVhJWaki.cjs.map → stack-BO4624CY.cjs.map} +1 -1
  353. package/dist/{stack-CpR6RGKd.d.ts → stack-BTWYIwLO.d.cts} +2 -4
  354. package/dist/{stack-CpR6RGKd.d.cts → stack-DR0eQTsB.d.ts} +1 -4
  355. package/dist/{stack-DRbwTeF3.js → stack-jVKvg2x_.js} +3 -4
  356. package/dist/{stack-DRbwTeF3.js.map → stack-jVKvg2x_.js.map} +1 -1
  357. package/dist/style.css +1 -1
  358. package/dist/{sweep-CbfR7--d.js → sweep-BpRPlhs6.js} +5 -6
  359. package/dist/{sweep-CbfR7--d.js.map → sweep-BpRPlhs6.js.map} +1 -1
  360. package/dist/{sweep-DaTEDDuC.cjs → sweep-Dnp6LDBz.cjs} +5 -6
  361. package/dist/sweep-Dnp6LDBz.cjs.map +1 -0
  362. package/dist/{time-CNVnt-B2.d.cts → time-B4oxWHQI.d.cts} +2 -7
  363. package/dist/{time-CHjiY9Q4.d.ts → time-DRIDgv2a.d.ts} +2 -7
  364. package/dist/{time-axis-VSX34_Tb.cjs → time-axis-B3VekUfX.cjs} +11 -11
  365. package/dist/{time-axis-VSX34_Tb.cjs.map → time-axis-B3VekUfX.cjs.map} +1 -1
  366. package/dist/{time-axis-Bc9eHX1r.js → time-axis-CLjqOakA.js} +10 -10
  367. package/dist/{time-axis-Bc9eHX1r.js.map → time-axis-CLjqOakA.js.map} +1 -1
  368. package/dist/time.cjs +4 -6
  369. package/dist/time.cjs.map +1 -1
  370. package/dist/time.d.cts +1 -1
  371. package/dist/time.d.ts +1 -1
  372. package/dist/time.js +4 -5
  373. package/dist/treemap-25vHO_UK.d.cts +65 -0
  374. package/dist/treemap-BCXUbixd.d.ts +65 -0
  375. package/dist/treemap-C4glsx-g.js +293 -0
  376. package/dist/treemap-C4glsx-g.js.map +1 -0
  377. package/dist/treemap-CZk8kKFD.cjs +298 -0
  378. package/dist/treemap-CZk8kKFD.cjs.map +1 -0
  379. package/dist/treemap.cjs +3 -0
  380. package/dist/treemap.d.cts +3 -0
  381. package/dist/treemap.d.ts +3 -0
  382. package/dist/treemap.js +1 -0
  383. package/dist/{tween-BCYd0RTY.js → tween-BdQqUmmv.js} +2 -3
  384. package/dist/{tween-BCYd0RTY.js.map → tween-BdQqUmmv.js.map} +1 -1
  385. package/dist/{tween-CIGBlryn.cjs → tween-c3aOmfKE.cjs} +2 -3
  386. package/dist/{tween-CIGBlryn.cjs.map → tween-c3aOmfKE.cjs.map} +1 -1
  387. package/dist/{value-labels-IZIQPhfk.js → value-labels-C7GrhOXJ.js} +30 -10
  388. package/dist/value-labels-C7GrhOXJ.js.map +1 -0
  389. package/dist/{value-labels-B0WJoJ7x.cjs → value-labels-DzaKIWKp.cjs} +30 -10
  390. package/dist/value-labels-DzaKIWKp.cjs.map +1 -0
  391. package/dist/value-labels.cjs +3 -5
  392. package/dist/value-labels.cjs.map +1 -1
  393. package/dist/value-labels.d.cts +5 -1
  394. package/dist/value-labels.d.ts +5 -1
  395. package/dist/value-labels.js +3 -4
  396. package/dist/{vnode-CkQ27Cxe.cjs → vnode-ClAiw28x.cjs} +2 -3
  397. package/dist/{vnode-CkQ27Cxe.cjs.map → vnode-ClAiw28x.cjs.map} +1 -1
  398. package/dist/{vnode-BUflsBsa.d.ts → vnode-Du2cC8Fm.d.cts} +1 -4
  399. package/dist/{vnode-BUflsBsa.d.cts → vnode-Du2cC8Fm.d.ts} +1 -4
  400. package/dist/{vnode-tCWItoUH.js → vnode-_EMUqysL.js} +2 -3
  401. package/dist/{vnode-tCWItoUH.js.map → vnode-_EMUqysL.js.map} +1 -1
  402. package/package.json +94 -214
  403. package/dist/bar-C-7zR2qp.cjs.map +0 -1
  404. package/dist/bar-jZEoao74.js.map +0 -1
  405. package/dist/cartesian-BoDfgBCV.cjs.map +0 -1
  406. package/dist/cartesian-Cr0AF0nG.js.map +0 -1
  407. package/dist/chart-BF2CK9I_.js.map +0 -1
  408. package/dist/chart-CowF_lWY.cjs.map +0 -1
  409. package/dist/core-CegR_j55.js.map +0 -1
  410. package/dist/core-RzS9IQO5.cjs.map +0 -1
  411. package/dist/dom-CLF868Qs.cjs.map +0 -1
  412. package/dist/dom-vP3IcMak.js.map +0 -1
  413. package/dist/export-chart-9w8t3rjZ.js.map +0 -1
  414. package/dist/export-chart-BhhYgksr.cjs.map +0 -1
  415. package/dist/fade-Cs74puQS.cjs.map +0 -1
  416. package/dist/fade-D3NxH5Qg.js.map +0 -1
  417. package/dist/features-BclHgg2W.cjs.map +0 -1
  418. package/dist/features-wASyHGic.js.map +0 -1
  419. package/dist/gauge-D-FYhuds.cjs.map +0 -1
  420. package/dist/gauge-Dh423FHh.js.map +0 -1
  421. package/dist/heatmap-BK18EBgJ.cjs.map +0 -1
  422. package/dist/heatmap-DSZ2bVIa.js.map +0 -1
  423. package/dist/hydrate-CxwTXDqO.cjs.map +0 -1
  424. package/dist/layout-B3hiqVEw.js.map +0 -1
  425. package/dist/layout-CtMBhNd9.cjs.map +0 -1
  426. package/dist/line-B3Ed6u7j.js.map +0 -1
  427. package/dist/line-fQbtP_jL.cjs.map +0 -1
  428. package/dist/morph-CqYDu1bY.cjs.map +0 -1
  429. package/dist/parliament-CpWnoEvG.cjs.map +0 -1
  430. package/dist/parliament-Dw0sOERi.js.map +0 -1
  431. package/dist/pie-BxTZt6Go.cjs.map +0 -1
  432. package/dist/pie-DzUXDTcn.js.map +0 -1
  433. package/dist/point-shapes-CGl4dugc.cjs.map +0 -1
  434. package/dist/point-shapes-DI84NNpI.js.map +0 -1
  435. package/dist/radar-CYPab_I4.js.map +0 -1
  436. package/dist/radar-CoGUNNSb.cjs.map +0 -1
  437. package/dist/sankey-B4PNKusJ.js.map +0 -1
  438. package/dist/sankey-Bacx4fVe.cjs.map +0 -1
  439. package/dist/scatter-DgMN9zRy.cjs.map +0 -1
  440. package/dist/scatter-kgtgR318.js.map +0 -1
  441. package/dist/sparkline-BQzt27Fr.js.map +0 -1
  442. package/dist/sparkline-BS9-hltA.cjs.map +0 -1
  443. package/dist/sweep-DaTEDDuC.cjs.map +0 -1
  444. package/dist/value-labels-B0WJoJ7x.cjs.map +0 -1
  445. package/dist/value-labels-IZIQPhfk.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cartesian-DRSXHxWe.cjs","names":["h","round","ticks","niceDomain","keyOf","legendItems","feature","linearTicks","features","h","finite","extent","niceDomain","axis","axisTitle","bandTicks","LINE_HEIGHT","estimateTextWidth","axisSize","axisTitleSize","plotFrame","thinTicks","groupAttrs","formatDetail"],"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, type NumberFormat } from '../format.ts'\nimport type { Hit, 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'\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 /** 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 * `'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 {\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\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 // 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({ position: flip ? side : 'bottom', ticks: xTicks, area, line: xOptions.line === true }),\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 ) => !!text && axisTitle(position, ticks || [], area, text, ctx.fontSize)\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/** 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\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 showX ? estimateTextWidth(edgeLabels[last ? edgeLabels.length - 1 : 0] ?? '', fontSize) : 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 (showX ? axisSize('bottom', [probeY[0] as Tick], fontSize) : showY ? halfLine : 0) +\n 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 const xTicks = showX ? thinTicks(xAxis.ticks(x), 'bottom', fontSize) : []\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\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 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,OAAOA,cAAAA,EACL,KACA;EAAE,KAAK,QAAQ;EAAa,OAAO,CAAC,WAAW,WAAW,WAAW;EAAG,eAAe;CAAO,GAC9F,MAAM,KAAK,SAAS;EAClB,MAAM,IAAIC,eAAAA,MAAM,KAAK,QAAQ;EAC7B,OAAOD,cAAAA,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;CACH,CAAC,CACH;AACF;;;;;;;;;;;ACNA,SAAgB,KACd,QACA,OACA,UAA4B,CAAC,GAClB;CACX,MAAM,EAAE,eAAe,GAAG,eAAe,GAAG,QAAQ,OAAQ;CAC5D,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,YAAY,CAAC;CACnD,MAAM,IAAI,OAAO;CACjB,MAAM,CAAC,IAAI,MAAM;CACjB,MAAM,UAAU,KAAK;CACrB,MAAM,KAAK,UAAU,KAAK;CAC1B,MAAM,KAAK,UAAU,KAAK;CAE1B,MAAM,QAAQ,KAAK,MAAM,KAAK,IAAI,GAAG,IAAI,QAAQ,eAAe,CAAC;CACjE,MAAM,QAAQ,MAAM,KAAK,KAAK,QAAQ,IAAI,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,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,31 +1,14 @@
1
- import { t as h } from "./vnode-tCWItoUH.js";
2
- import { n as feature, r as features } from "./features-wASyHGic.js";
3
- import { a as render, c as isValidTag, s as isValidAttr } from "./dom-vP3IcMak.js";
4
- //#region 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
- }
22
- //#endregion
23
- //#region src/legend.ts
1
+ import { n as feature, r as features } from "./features-B55rwpQC.js";
2
+ import { t as hitKey } from "./interaction-En1KlwFO.js";
3
+ import { t as h } from "./vnode-_EMUqysL.js";
4
+ import { a as render, c as isValidTag, s as isValidAttr } from "./dom-CTse6Rvd.js";
5
+ // src/legend.ts
24
6
  /**
25
7
  * Legend content: one toggle button per entry. Buttons are native, so they
26
8
  * are focusable and work with Enter/Space; `aria-pressed` reflects visibility.
9
+ * `shape` gives the swatches the point shapes of their slots.
27
10
  */
28
- function legendContent(items, hidden) {
11
+ function legendContent(items, hidden, shape) {
29
12
  return h("div", { class: "tc-legend-items" }, items.map((item) => {
30
13
  const off = hidden.has(item.key);
31
14
  return h("button", {
@@ -37,7 +20,10 @@ function legendContent(items, hidden) {
37
20
  `tc-series-${item.index + 1}`,
38
21
  off && "tc-legend-item-hidden"
39
22
  ],
40
- style: { "--tc-series-color": item.color },
23
+ style: {
24
+ "--tc-series-color": item.color,
25
+ ...shape?.(item.index)
26
+ },
41
27
  "aria-pressed": off ? "false" : "true",
42
28
  "data-key": item.key
43
29
  }, h("span", {
@@ -50,8 +36,7 @@ function legendContent(items, hidden) {
50
36
  function defaultHidden(items) {
51
37
  return new Set(items.filter((item) => item.hidden).map((item) => item.key));
52
38
  }
53
- //#endregion
54
- //#region src/render/string.ts
39
+ // src/render/string.ts
55
40
  const SVG_NS = "http://www.w3.org/2000/svg";
56
41
  /** Root tags treated as HTML when no namespace is given. */
57
42
  const HTML_ROOTS = /* @__PURE__ */ new Set([
@@ -151,8 +136,7 @@ function escapeText(value) {
151
136
  function escapeAttr(value) {
152
137
  return ATTR_RE.test(value) ? value.replace(ATTR_RE_G, replaceEntity) : value;
153
138
  }
154
- //#endregion
155
- //#region src/resize.ts
139
+ // src/resize.ts
156
140
  const listeners = /* @__PURE__ */ new WeakMap();
157
141
  /** Elements observed while in the document. */
158
142
  const seen = /* @__PURE__ */ new WeakSet();
@@ -186,8 +170,7 @@ function observeResize(el, listener) {
186
170
  ro.unobserve(el);
187
171
  };
188
172
  }
189
- //#endregion
190
- //#region src/scheduler.ts
173
+ // src/scheduler.ts
191
174
  /**
192
175
  * Batches work from all charts into a single animation frame. Scheduling the
193
176
  * same key twice before the flush runs its latest task once.
@@ -252,8 +235,7 @@ function flush() {
252
235
  for (const [key, task] of later) schedule(key, task);
253
236
  return count;
254
237
  }
255
- //#endregion
256
- //#region src/chart.ts
238
+ // src/chart.ts
257
239
  const DEFAULT_WIDTH = 600;
258
240
  const DEFAULT_ASPECT_RATIO = 2;
259
241
  const DEFAULT_FONT_SIZE = 12;
@@ -264,31 +246,41 @@ function resolveSize(options, measured) {
264
246
  const measuredWidth = measured?.width ?? 0;
265
247
  const width = Math.max(0, Math.round(Number.isFinite(options.width) ? options.width : measuredWidth > 0 ? measuredWidth : DEFAULT_WIDTH));
266
248
  const ratio = options.aspectRatio && options.aspectRatio > 0 ? options.aspectRatio : DEFAULT_ASPECT_RATIO;
267
- const height = Number.isFinite(options.height) ? options.height : options.height === "container" && (measured?.height ?? 0) > 0 ? measured?.height : width / ratio;
249
+ 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;
268
250
  return {
269
251
  width,
270
252
  height: Math.max(0, Math.round(height))
271
253
  };
272
254
  }
273
- /** Run the chart type's `render()` for a config and size. */
274
- function renderContent(config, size, id, onHitTest, hidden, fontSize) {
275
- let found;
276
- const ctx = renderContext(config, size, id, (interaction) => {
277
- found = interaction;
278
- onHitTest(interaction);
279
- }, hidden, fontSize);
280
- const content = config.type.render(config, ctx);
281
- return features.post ? features.post(config, content, found, ctx) : content;
255
+ /** Chart models by the config they were worked out from. */
256
+ const models = /* @__PURE__ */ new WeakMap();
257
+ /**
258
+ * The chart model of a config: what its type's `prepare()` works out from
259
+ * it, once per config object, or the config itself for a type without one.
260
+ */
261
+ function chartModel(config) {
262
+ const { prepare } = config.type;
263
+ if (!prepare) return config;
264
+ const model = models.get(config) ?? prepare(config);
265
+ models.set(config, model);
266
+ return model;
267
+ }
268
+ /** Run the chart type's `render()` for a config and context, and the optional steps after it. */
269
+ function renderContent(config, ctx) {
270
+ const out = config.type.render(chartModel(config), ctx);
271
+ const result = out?.content !== void 0 ? out : { content: out };
272
+ if (features.post) result.content = features.post(config, result.content, result.interaction, ctx);
273
+ return result;
282
274
  }
283
- /** Render context for a config and size (also used by plugins such as the data table). */
284
- function renderContext(config, size, id, onHitTest, hidden, measuredFontSize) {
275
+ /** Render context for a config and size. */
276
+ function renderContext(config, { size, id, hidden, fontSize, rtl = config.rtl === true }) {
285
277
  return {
278
+ rtl,
286
279
  width: size.width,
287
280
  height: size.height,
288
- fontSize: config.fontSize ?? measuredFontSize ?? DEFAULT_FONT_SIZE,
281
+ fontSize: config.fontSize ?? fontSize ?? DEFAULT_FONT_SIZE,
289
282
  locale: config.locale,
290
283
  id,
291
- onHitTest,
292
284
  hidden
293
285
  };
294
286
  }
@@ -305,14 +297,23 @@ function cleanData(config) {
305
297
  function assertType(config) {
306
298
  if (!config.type || typeof config.type.render !== "function") throw new TypeError("@tabler/charts: `type` must be a chart type such as line.");
307
299
  }
300
+ const POSITIONS = [
301
+ "top",
302
+ "bottom",
303
+ "left",
304
+ "right",
305
+ "auto"
306
+ ];
308
307
  /** Legend entries of a config, and whether the legend is shown. */
309
308
  function resolveLegend(config) {
310
- const items = config.type.legend?.(config) ?? [];
309
+ const items = config.type.legend?.(chartModel(config)) ?? [];
311
310
  const option = config.legend;
311
+ const show = option === void 0 ? items.length >= 2 : option !== false && items.length > 0;
312
+ const asked = typeof option === "object" ? option.position : void 0;
312
313
  return {
313
314
  items,
314
- show: option === void 0 ? items.length >= 2 : option !== false && items.length > 0,
315
- position: typeof option === "object" && option.position === "bottom" ? "bottom" : "top"
315
+ show,
316
+ position: asked && POSITIONS.includes(asked) ? asked : "top"
316
317
  };
317
318
  }
318
319
  /**
@@ -323,7 +324,7 @@ function resolveLegend(config) {
323
324
  */
324
325
  function chartLabel(config) {
325
326
  if (config.title) return config.title;
326
- const names = (config.type.legend?.(config) ?? []).map((item) => item.name).filter(Boolean);
327
+ const names = resolveLegend(config).items.map((item) => item.name).filter(Boolean);
327
328
  const shown = names.slice(0, 6).join(", ");
328
329
  return `${config.type.name} chart${names.length ? `: ${shown}${names.length > 6 ? ", …" : ""}` : ""}`;
329
330
  }
@@ -334,7 +335,7 @@ const countNodes = (child) => Array.isArray(child) ? child.reduce((n, c) => n +
334
335
  /** Whether a chart renders without transitions: asked to, or too big to animate cheaply. */
335
336
  const isStatic = (config, content) => config.animate === false || config.animate !== true && countNodes(content) > ANIMATION_LIMIT;
336
337
  /** Wrap chart content (and hover layers) in the accessible root `<svg>`. */
337
- function composeChart(config, size, id, still, content, underlay, overlay, extraAttrs) {
338
+ function composeChart(config, size, id, still, content, underlay, overlay, extraAttrs, rtl = config.rtl === true) {
338
339
  const { width, height } = size;
339
340
  const descId = config.description ? `${id}-desc` : void 0;
340
341
  const { patterns } = config;
@@ -344,6 +345,7 @@ function composeChart(config, size, id, still, content, underlay, overlay, extra
344
345
  "tc-chart",
345
346
  `tc-chart-${config.type.name}`,
346
347
  still && "tc-static",
348
+ rtl && "tc-rtl",
347
349
  fills?.[0],
348
350
  config.class
349
351
  ],
@@ -367,16 +369,25 @@ function composeChart(config, size, id, still, content, underlay, overlay, extra
367
369
  }, overlay));
368
370
  }
369
371
  /**
370
- * Build the VNode tree of a chart: a pure function of the config and size,
371
- * shared by the DOM chart and server-side rendering.
372
+ * Build a chart for a size: a pure function of the config and size, shared
373
+ * by the DOM chart and server-side rendering. `buildChart()` keeps the svg.
372
374
  */
373
- function buildChart(config, size, id = config.id ?? "tc", onHitTest = () => {}) {
375
+ function renderChart(config, size, id = config.id ?? "tc") {
374
376
  assertType(config);
375
- config = cleanData(config);
376
- const hidden = defaultHidden(resolveLegend(config).items);
377
- const content = renderContent(config, size, id, onHitTest, hidden);
378
- const base = config;
379
- return composeChart(base, size, id, isStatic(base, content), content);
377
+ const base = cleanData(config);
378
+ const { content, interaction } = renderContent(base, renderContext(base, {
379
+ size,
380
+ id,
381
+ hidden: defaultHidden(resolveLegend(base).items)
382
+ }));
383
+ return {
384
+ svg: composeChart(base, size, id, isStatic(base, content), content),
385
+ interaction
386
+ };
387
+ }
388
+ /** Build the VNode tree of a chart for a size (see `renderChart()`). */
389
+ function buildChart(config, size, id) {
390
+ return renderChart(config, size, id).svg;
380
391
  }
381
392
  /**
382
393
  * Render a chart to an SVG string, e.g. on the server.
@@ -386,7 +397,7 @@ function buildChart(config, size, id = config.id ?? "tc", onHitTest = () => {})
386
397
  * ```
387
398
  */
388
399
  function chartToString(config, size) {
389
- return renderToString(buildChart(config, size));
400
+ return renderToString(renderChart(config, size).svg);
390
401
  }
391
402
  /** The name of every chart event, for adapters that pass them all on. */
392
403
  const chartEvents = [
@@ -395,6 +406,10 @@ const chartEvents = [
395
406
  "legend-toggle",
396
407
  "render"
397
408
  ];
409
+ /** The chart's own svg in its container. */
410
+ const ROOT = ":scope > svg.tc-chart";
411
+ /** The computed style of an element, where there is one (not on the server). */
412
+ const computed = (el) => typeof getComputedStyle === "function" ? getComputedStyle(el) : void 0;
398
413
  /** The chart on each element. */
399
414
  const mounted = /* @__PURE__ */ new WeakMap();
400
415
  /**
@@ -451,6 +466,8 @@ var Chart = class {
451
466
  * forces the browser to restyle the page, so new data alone reuses it.
452
467
  */
453
468
  #font;
469
+ /** The resolved `rtl` option, read with the font size (`'auto'` asks the container). */
470
+ #rtl = false;
454
471
  constructor(target, config, defaultPlugins = []) {
455
472
  const element = typeof target === "string" ? document.querySelector(target) : target;
456
473
  if (!element) throw new Error(`@tabler/charts: element "${String(target)}" not found.`);
@@ -459,11 +476,15 @@ var Chart = class {
459
476
  this.element = element;
460
477
  this.#cfg = cleanData(config);
461
478
  this.id = config.id ?? nextId();
462
- this.#adopt = element.querySelector(":scope > svg.tc-chart");
479
+ this.#adopt = element.querySelector(ROOT);
463
480
  this.#measure();
464
481
  this.#unobserve = observeResize(element, this.#onResize);
465
482
  try {
466
- for (const plugin of [...defaultPlugins, ...config.plugins ?? []]) this.#plugins.push(plugin.install(this));
483
+ for (const plugin of [
484
+ ...defaultPlugins,
485
+ ...config.type.plugins ?? [],
486
+ ...config.plugins ?? []
487
+ ]) this.#plugins.push(plugin.install(this));
467
488
  this.render();
468
489
  } catch (error) {
469
490
  this.destroy();
@@ -477,6 +498,12 @@ var Chart = class {
477
498
  /** Size of the last render. */
478
499
  get size() {
479
500
  let measured = this.#measured;
501
+ let beside = 0;
502
+ for (const plugin of this.#plugins) beside += plugin.reservedWidth?.() ?? 0;
503
+ if (beside && measured.width) measured = {
504
+ ...measured,
505
+ width: measured.width - beside
506
+ };
480
507
  if (this.#cfg.height === "container" && measured.height) {
481
508
  let reserved = 0;
482
509
  for (const plugin of this.#plugins) reserved += plugin.reservedHeight?.() ?? 0;
@@ -487,6 +514,18 @@ var Chart = class {
487
514
  }
488
515
  return resolveSize(this.#cfg, measured);
489
516
  }
517
+ /**
518
+ * Whether the chart is laid out right to left: the `rtl` option, with
519
+ * `'auto'` read from the container (together with the font size).
520
+ */
521
+ get rtl() {
522
+ const cfg = this.#cfg;
523
+ if (this.#font === void 0) {
524
+ this.#rtl = cfg.rtl === "auto" ? computed(this.element)?.direction === "rtl" : cfg.rtl === true;
525
+ this.#font = cfg.fontSize ?? this.#measureFontSize();
526
+ }
527
+ return this.#rtl;
528
+ }
490
529
  /** Font size used by the last render (explicit, measured, or the default). */
491
530
  get fontSize() {
492
531
  return this.#cache?.fontSize ?? this.#cfg.fontSize ?? DEFAULT_FONT_SIZE;
@@ -647,22 +686,28 @@ var Chart = class {
647
686
  #content(size, hidden) {
648
687
  const cfg = this.#cfg;
649
688
  const hiddenKey = [...hidden].sort().join("\0");
650
- this.#font ??= cfg.fontSize ?? this.#measureFontSize();
689
+ const rtl = this.rtl;
651
690
  const fontSize = cfg.fontSize ?? this.#font;
652
691
  let cache = this.#cache;
653
692
  const changed = !cache || cache.cfg !== cfg || cache.hidden !== hiddenKey;
654
- const stale = changed || cache?.width !== size.width || cache.height !== size.height || cache.fontSize !== fontSize;
693
+ const stale = changed || cache?.width !== size.width || cache.height !== size.height || cache.fontSize !== fontSize || cache.rtl !== rtl;
655
694
  if (!cache || stale) {
656
- this.#current = void 0;
657
- const content = renderContent(cfg, size, this.id, (interaction) => {
658
- this.#current = interaction;
659
- }, hidden, fontSize);
695
+ if (cfg.type.sweep) features.sweep = cfg.type.sweep;
696
+ const { content, interaction } = renderContent(cfg, renderContext(cfg, {
697
+ size,
698
+ id: this.id,
699
+ hidden,
700
+ fontSize,
701
+ rtl
702
+ }));
703
+ this.#current = interaction;
660
704
  cache = {
661
705
  cfg,
662
706
  width: size.width,
663
707
  height: size.height,
664
708
  hidden: hiddenKey,
665
709
  fontSize,
710
+ rtl,
666
711
  content,
667
712
  still: isStatic(cfg, content)
668
713
  };
@@ -700,7 +745,7 @@ var Chart = class {
700
745
  ...extra
701
746
  };
702
747
  }
703
- return composeChart(config, size, this.id, content.still, content.content, under.length ? under : void 0, over.length ? over : void 0, attrs);
748
+ return composeChart(config, size, this.id, content.still, content.content, under.length ? under : void 0, over.length ? over : void 0, attrs, content.rtl);
704
749
  }
705
750
  /** What lies at a point in chart pixels, or `null`. */
706
751
  hitTest(x, y) {
@@ -753,7 +798,7 @@ var Chart = class {
753
798
  }
754
799
  /** Suspend transitions while the container keeps resizing (see `[data-resizing]` in CSS). */
755
800
  #markResizing() {
756
- const svg = this.element.querySelector(":scope > svg.tc-chart");
801
+ const svg = this.element.querySelector(ROOT);
757
802
  if (!svg) return;
758
803
  svg.setAttribute("data-resizing", "");
759
804
  clearTimeout(this.#resizeTimer);
@@ -764,14 +809,13 @@ var Chart = class {
764
809
  }
765
810
  /** The `--tc-font-size` in effect on the container, in pixels (browser only). */
766
811
  #measureFontSize() {
767
- if (typeof getComputedStyle !== "function") return void 0;
768
- const value = Number.parseFloat(getComputedStyle(this.element).getPropertyValue("--tc-font-size"));
812
+ const value = Number.parseFloat(computed(this.element)?.getPropertyValue("--tc-font-size") ?? "");
769
813
  return Number.isFinite(value) && value > 0 ? value : void 0;
770
814
  }
771
815
  /** Measure the content box, matching what `ResizeObserver` reports. */
772
816
  #measure() {
773
817
  const el = this.element;
774
- const style = typeof getComputedStyle === "function" ? getComputedStyle(el) : void 0;
818
+ const style = computed(el);
775
819
  const px = (value) => Number.parseFloat(value ?? "") || 0;
776
820
  this.#measured = {
777
821
  width: el.clientWidth - px(style?.paddingLeft) - px(style?.paddingRight),
@@ -784,7 +828,6 @@ var Chart = class {
784
828
  if (set) for (const handler of set) handler(event);
785
829
  }
786
830
  };
787
- //#endregion
788
- 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 };
831
+ export { escapeText as _, chartModel as a, legendContent as b, renderContext as c, cancel as d, flush as f, escapeAttr as g, schedule as h, chartLabel as i, resolveLegend as l, run as m, buildChart as n, chartToString as o, flushHooks as p, chartEvents as r, renderChart as s, Chart as t, resolveSize as u, renderToString as v, defaultHidden as y };
789
832
 
790
- //# sourceMappingURL=chart-BF2CK9I_.js.map
833
+ //# sourceMappingURL=chart-B6TTY4Kr.js.map