@tabler/charts 0.0.1-alpha.0 → 0.2.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 (377) hide show
  1. package/README.md +33 -5
  2. package/dist/{annotations-Bp7HwtF5.d.ts → annotations-B02GR_KU.d.ts} +3 -8
  3. package/dist/{annotations-lyt0I3HU.d.cts → annotations-CHafaGd4.d.cts} +3 -8
  4. package/dist/{annotations-BszTTjf9.js → annotations-D0YQ0IoA.js} +6 -7
  5. package/dist/{annotations-BszTTjf9.js.map → annotations-D0YQ0IoA.js.map} +1 -1
  6. package/dist/{annotations-DpETO8dE.cjs → annotations-DdRdeBUB.cjs} +6 -7
  7. package/dist/{annotations-DpETO8dE.cjs.map → annotations-DdRdeBUB.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/{sweep-WSgn2etB.js → arc-B3V5IR0w.js} +3 -60
  14. package/dist/arc-B3V5IR0w.js.map +1 -0
  15. package/dist/{sweep-Duowaput.cjs → arc-CYhI62kO.cjs} +2 -71
  16. package/dist/arc-CYhI62kO.cjs.map +1 -0
  17. package/dist/{area-DQsLERhx.js → area-0-L1bG9B.js} +5 -6
  18. package/dist/{area-DQsLERhx.js.map → area-0-L1bG9B.js.map} +1 -1
  19. package/dist/{area-sHCE3pg5.cjs → area-4eRs3c0K.cjs} +5 -6
  20. package/dist/{area-sHCE3pg5.cjs.map → area-4eRs3c0K.cjs.map} +1 -1
  21. package/dist/{area-DaO4MQl4.d.ts → area-CJX9219z.d.cts} +3 -6
  22. package/dist/{area-BFvkc-ZM.d.cts → area-d11XePuw.d.ts} +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/{band-DTcNDAFO.d.ts → band-CNKvdnTC.d.cts} +1 -4
  28. package/dist/{band-DTcNDAFO.d.cts → band-CNKvdnTC.d.ts} +1 -4
  29. package/dist/{bar-DM16NUvV.js → bar-B5n2oq9-.js} +3 -4
  30. package/dist/{bar-DM16NUvV.js.map → bar-B5n2oq9-.js.map} +1 -1
  31. package/dist/{bar-DdsDxk3W.d.ts → bar-BDLR4p9c.d.cts} +4 -7
  32. package/dist/{bar-jZEoao74.js → bar-BNZ3GhIw.js} +20 -20
  33. package/dist/bar-BNZ3GhIw.js.map +1 -0
  34. package/dist/{bar-C-7zR2qp.cjs → bar-Da6dE_nI.cjs} +20 -20
  35. package/dist/bar-Da6dE_nI.cjs.map +1 -0
  36. package/dist/{bar-DGuUN3nc.cjs → bar-LYIF8MEz.cjs} +3 -4
  37. package/dist/{bar-DGuUN3nc.cjs.map → bar-LYIF8MEz.cjs.map} +1 -1
  38. package/dist/{bar-a0h9KC8A.d.cts → bar-XwzM6Pb0.d.ts} +4 -7
  39. package/dist/bar.cjs +1 -1
  40. package/dist/bar.d.cts +2 -1
  41. package/dist/bar.d.ts +2 -1
  42. package/dist/bar.js +1 -2
  43. package/dist/{candlestick-DuXwAFID.js → candlestick-BHQkQfxH.js} +6 -7
  44. package/dist/{candlestick-DuXwAFID.js.map → candlestick-BHQkQfxH.js.map} +1 -1
  45. package/dist/{candlestick-B5r1w3kc.cjs → candlestick-CYCQXgky.cjs} +6 -7
  46. package/dist/{candlestick-B5r1w3kc.cjs.map → candlestick-CYCQXgky.cjs.map} +1 -1
  47. package/dist/{candlestick-BnUG1SGi.d.ts → candlestick-D0xKkdqd.d.ts} +3 -6
  48. package/dist/{candlestick-BKdPyorY.d.cts → candlestick-Dq7qp-F0.d.cts} +3 -6
  49. package/dist/candlestick.cjs +4 -5
  50. package/dist/candlestick.d.cts +1 -1
  51. package/dist/candlestick.d.ts +1 -1
  52. package/dist/candlestick.js +4 -6
  53. package/dist/{cartesian-Cr0AF0nG.js → cartesian-CI2x6N7N.js} +27 -27
  54. package/dist/cartesian-CI2x6N7N.js.map +1 -0
  55. package/dist/{cartesian-BoDfgBCV.cjs → cartesian-DV02PsBe.cjs} +27 -27
  56. package/dist/cartesian-DV02PsBe.cjs.map +1 -0
  57. package/dist/{chart-BF2CK9I_.js → chart-DWn9v6qw.js} +35 -24
  58. package/dist/chart-DWn9v6qw.js.map +1 -0
  59. package/dist/{chart-iJGxMz9z.d.ts → chart-QilhWP8Z.d.ts} +38 -49
  60. package/dist/{chart-CowF_lWY.cjs → chart-e2VqomCI.cjs} +35 -24
  61. package/dist/chart-e2VqomCI.cjs.map +1 -0
  62. package/dist/{chart-Qa417fJo.d.cts → chart-kqFMEwDo.d.cts} +64 -49
  63. package/dist/{circle-BQMuAfls.cjs → circle-Bwxy5j7B.cjs} +2 -3
  64. package/dist/{circle-BQMuAfls.cjs.map → circle-Bwxy5j7B.cjs.map} +1 -1
  65. package/dist/{circle-Z7YfCoCM.js → circle-YRDaOBpk.js} +2 -3
  66. package/dist/{circle-Z7YfCoCM.js.map → circle-YRDaOBpk.js.map} +1 -1
  67. package/dist/{clean-o1vDEhFV.js → clean-CkoQobGv.js} +3 -4
  68. package/dist/{clean-o1vDEhFV.js.map → clean-CkoQobGv.js.map} +1 -1
  69. package/dist/{clean-Byl6kzf0.cjs → clean-Die2iCNc.cjs} +8 -3
  70. package/dist/{clean-Byl6kzf0.cjs.map → clean-Die2iCNc.cjs.map} +1 -1
  71. package/dist/{core-plobgBC7.js → core-BKRQvPAT.js} +47 -46
  72. package/dist/core-BKRQvPAT.js.map +1 -0
  73. package/dist/{core-C7fPm6t7.cjs → core-DIOC61up.cjs} +47 -46
  74. package/dist/core-DIOC61up.cjs.map +1 -0
  75. package/dist/{core-CjgbhS_v.d.ts → core-DRUCk67j.d.ts} +6 -42
  76. package/dist/{core-CnGFKojH.d.cts → core-PAX5ogLk.d.cts} +24 -68
  77. package/dist/core.cjs +32 -26
  78. package/dist/core.d.cts +23 -20
  79. package/dist/core.d.ts +23 -20
  80. package/dist/core.js +27 -24
  81. package/dist/{dates-CG-FvioW.js → dates-C2RzY3rE.js} +4 -5
  82. package/dist/{dates-CG-FvioW.js.map → dates-C2RzY3rE.js.map} +1 -1
  83. package/dist/{dates-Btm7Zm6W.cjs → dates-DurEr9WT.cjs} +4 -5
  84. package/dist/{dates-Btm7Zm6W.cjs.map → dates-DurEr9WT.cjs.map} +1 -1
  85. package/dist/{decimate-tLhDk1ys.cjs → decimate-BS3x8g-f.cjs} +2 -3
  86. package/dist/{decimate-tLhDk1ys.cjs.map → decimate-BS3x8g-f.cjs.map} +1 -1
  87. package/dist/{decimate-BGg9XgF0.d.ts → decimate-BxxYBJJk.d.cts} +2 -5
  88. package/dist/{decimate-C87cl_Sp.js → decimate-CapfgiDY.js} +2 -3
  89. package/dist/{decimate-C87cl_Sp.js.map → decimate-CapfgiDY.js.map} +1 -1
  90. package/dist/{decimate-CNSpgGa5.d.cts → decimate-Du87fMLG.d.ts} +2 -5
  91. package/dist/decimate.cjs +3 -4
  92. package/dist/decimate.d.cts +1 -1
  93. package/dist/decimate.d.ts +1 -1
  94. package/dist/decimate.js +3 -4
  95. package/dist/{dom-vP3IcMak.js → dom-CuceR8gt.js} +4 -6
  96. package/dist/{dom-vP3IcMak.js.map → dom-CuceR8gt.js.map} +1 -1
  97. package/dist/{dom-CLF868Qs.cjs → dom-D_g13XWY.cjs} +4 -6
  98. package/dist/{dom-CLF868Qs.cjs.map → dom-D_g13XWY.cjs.map} +1 -1
  99. package/dist/{export-chart-9w8t3rjZ.js → export-chart-83UYH48t.js} +3 -4
  100. package/dist/{export-chart-9w8t3rjZ.js.map → export-chart-83UYH48t.js.map} +1 -1
  101. package/dist/{export-chart-BhhYgksr.cjs → export-chart-mYgEfK-L.cjs} +3 -4
  102. package/dist/{export-chart-BhhYgksr.cjs.map → export-chart-mYgEfK-L.cjs.map} +1 -1
  103. package/dist/export.cjs +3 -5
  104. package/dist/export.cjs.map +1 -1
  105. package/dist/export.d.cts +8 -1
  106. package/dist/export.d.ts +8 -1
  107. package/dist/export.js +3 -4
  108. package/dist/{extent-BAMZo0Nq.js → extent-DOV8rs-6.js} +2 -3
  109. package/dist/{extent-BAMZo0Nq.js.map → extent-DOV8rs-6.js.map} +1 -1
  110. package/dist/{extent-DsFWvAHJ.cjs → extent-DuYDcvM9.cjs} +2 -3
  111. package/dist/{extent-DsFWvAHJ.cjs.map → extent-DuYDcvM9.cjs.map} +1 -1
  112. package/dist/{fade-Cs74puQS.cjs → fade-DVTkhrFU.cjs} +4 -6
  113. package/dist/{fade-Cs74puQS.cjs.map → fade-DVTkhrFU.cjs.map} +1 -1
  114. package/dist/{fade-D3NxH5Qg.js → fade-GGxcBdss.js} +4 -6
  115. package/dist/{fade-D3NxH5Qg.js.map → fade-GGxcBdss.js.map} +1 -1
  116. package/dist/{features-wASyHGic.js → features-BMxkqCyS.js} +2 -3
  117. package/dist/{features-wASyHGic.js.map → features-BMxkqCyS.js.map} +1 -1
  118. package/dist/{features-BclHgg2W.cjs → features-DCXEvoya.cjs} +2 -3
  119. package/dist/{features-BclHgg2W.cjs.map → features-DCXEvoya.cjs.map} +1 -1
  120. package/dist/{format-B0yKXBTH.cjs → format-CAE5ruy6.cjs} +2 -3
  121. package/dist/{format-B0yKXBTH.cjs.map → format-CAE5ruy6.cjs.map} +1 -1
  122. package/dist/{format-lStwuc1L.js → format-it1kepFG.js} +2 -3
  123. package/dist/{format-lStwuc1L.js.map → format-it1kepFG.js.map} +1 -1
  124. package/dist/{gauge-Cu9jttC0.d.ts → gauge-0VJuAHWF.d.ts} +5 -8
  125. package/dist/{gauge-Cu_OFxBd.d.cts → gauge-BSist7My.d.cts} +5 -8
  126. package/dist/{gauge-CEfkWXSu.cjs → gauge-DXkjXNCD.cjs} +14 -14
  127. package/dist/gauge-DXkjXNCD.cjs.map +1 -0
  128. package/dist/{gauge-_ljQHrMN.js → gauge-ts0kqN1-.js} +10 -10
  129. package/dist/{gauge-_ljQHrMN.js.map → gauge-ts0kqN1-.js.map} +1 -1
  130. package/dist/gauge.cjs +1 -1
  131. package/dist/gauge.d.cts +2 -1
  132. package/dist/gauge.d.ts +2 -1
  133. package/dist/gauge.js +1 -2
  134. package/dist/{heatmap-DSZ2bVIa.js → heatmap-19BGJTKF.js} +20 -22
  135. package/dist/heatmap-19BGJTKF.js.map +1 -0
  136. package/dist/{heatmap-PhLPXIg1.d.ts → heatmap-59lmClj9.d.ts} +4 -7
  137. package/dist/{heatmap-BK18EBgJ.cjs → heatmap-CXhlrLTl.cjs} +20 -22
  138. package/dist/heatmap-CXhlrLTl.cjs.map +1 -0
  139. package/dist/{heatmap-BwS-y0c6.d.cts → heatmap-Dp_oyEe0.d.cts} +4 -7
  140. package/dist/heatmap.cjs +1 -1
  141. package/dist/heatmap.d.cts +2 -1
  142. package/dist/heatmap.d.ts +2 -1
  143. package/dist/heatmap.js +1 -2
  144. package/dist/{hydrate-CzfxLfTv.d.ts → hydrate-BtAZf_5K.d.cts} +2 -5
  145. package/dist/{hydrate-CxwTXDqO.cjs → hydrate-CmN1k8Mo.cjs} +3 -4
  146. package/dist/hydrate-CmN1k8Mo.cjs.map +1 -0
  147. package/dist/{hydrate-DDNIHYv_.js → hydrate-OA6R2_Pn.js} +3 -4
  148. package/dist/{hydrate-DDNIHYv_.js.map → hydrate-OA6R2_Pn.js.map} +1 -1
  149. package/dist/{hydrate-CTTmQy0x.d.cts → hydrate-OjM1pIUG.d.ts} +2 -5
  150. package/dist/hydrate.cjs +3 -4
  151. package/dist/hydrate.cjs.map +1 -1
  152. package/dist/hydrate.d.cts +1 -1
  153. package/dist/hydrate.d.ts +1 -1
  154. package/dist/hydrate.js +3 -4
  155. package/dist/index.cjs +54 -48
  156. package/dist/index.cjs.map +1 -1
  157. package/dist/index.d.cts +24 -26
  158. package/dist/index.d.ts +24 -26
  159. package/dist/index.js +45 -42
  160. package/dist/index.js.map +1 -1
  161. package/dist/{layout-B3hiqVEw.js → layout-DmrrLjwN.js} +9 -4
  162. package/dist/layout-DmrrLjwN.js.map +1 -0
  163. package/dist/{layout-CtMBhNd9.cjs → layout-JY2aR-yE.cjs} +14 -3
  164. package/dist/layout-JY2aR-yE.cjs.map +1 -0
  165. package/dist/{line-B3Ed6u7j.js → line-DO66LtwH.js} +9 -10
  166. package/dist/{line-B3Ed6u7j.js.map → line-DO66LtwH.js.map} +1 -1
  167. package/dist/{line-fQbtP_jL.cjs → line-Dbt6KFRK.cjs} +9 -10
  168. package/dist/{line-fQbtP_jL.cjs.map → line-Dbt6KFRK.cjs.map} +1 -1
  169. package/dist/{line-CMDGH6q5.d.cts → line-DtSh7HQU.d.ts} +4 -7
  170. package/dist/{line-D5kb8e6w.d.ts → line-_rNdeKmS.d.cts} +5 -7
  171. package/dist/line.cjs +4 -5
  172. package/dist/line.cjs.map +1 -1
  173. package/dist/line.d.cts +1 -1
  174. package/dist/line.d.ts +1 -1
  175. package/dist/line.js +4 -6
  176. package/dist/{log-CaofN3-n.d.ts → log-CI41TmcU.d.cts} +1 -6
  177. package/dist/{log-CaofN3-n.d.cts → log-CI41TmcU.d.ts} +1 -6
  178. package/dist/{log-axis-83rSpvL5.cjs → log-axis-DdRNyAq8.cjs} +6 -8
  179. package/dist/{log-axis-83rSpvL5.cjs.map → log-axis-DdRNyAq8.cjs.map} +1 -1
  180. package/dist/{log-axis-B_uvvOFc.js → log-axis-DhthtHFk.js} +6 -8
  181. package/dist/{log-axis-B_uvvOFc.js.map → log-axis-DhthtHFk.js.map} +1 -1
  182. package/dist/log.cjs +3 -5
  183. package/dist/log.cjs.map +1 -1
  184. package/dist/log.d.cts +1 -1
  185. package/dist/log.d.ts +1 -1
  186. package/dist/log.js +3 -4
  187. package/dist/{morph-CqYDu1bY.cjs → morph-9_LJL0ra.cjs} +4 -5
  188. package/dist/morph-9_LJL0ra.cjs.map +1 -0
  189. package/dist/{morph-BMxz3X2b.d.ts → morph-Dh7gJkV4.d.cts} +1 -4
  190. package/dist/{morph-BMxz3X2b.d.cts → morph-Dh7gJkV4.d.ts} +1 -4
  191. package/dist/{morph-Bgg-24l8.js → morph-DnRxuwR-.js} +4 -5
  192. package/dist/{morph-Bgg-24l8.js.map → morph-DnRxuwR-.js.map} +1 -1
  193. package/dist/morph.cjs +3 -4
  194. package/dist/morph.cjs.map +1 -1
  195. package/dist/morph.d.cts +1 -1
  196. package/dist/morph.d.ts +1 -1
  197. package/dist/morph.js +3 -4
  198. package/dist/{named-BWWb5LQJ.cjs → named-BBASc8dW.cjs} +2 -3
  199. package/dist/{named-BWWb5LQJ.cjs.map → named-BBASc8dW.cjs.map} +1 -1
  200. package/dist/{named-DE15TOgh.js → named-BOiBah6I.js} +2 -3
  201. package/dist/{named-DE15TOgh.js.map → named-BOiBah6I.js.map} +1 -1
  202. package/dist/others-DWdK7vKp.cjs +60 -0
  203. package/dist/others-DWdK7vKp.cjs.map +1 -0
  204. package/dist/others-J7NCAMA0.js +49 -0
  205. package/dist/others-J7NCAMA0.js.map +1 -0
  206. package/dist/parliament-CLCI7tUO.d.ts +66 -0
  207. package/dist/parliament-CgsVnWEe.d.cts +66 -0
  208. package/dist/parliament-Cru4IcuM.js +302 -0
  209. package/dist/parliament-Cru4IcuM.js.map +1 -0
  210. package/dist/parliament-x5hcFaQ3.cjs +307 -0
  211. package/dist/parliament-x5hcFaQ3.cjs.map +1 -0
  212. package/dist/parliament.cjs +3 -0
  213. package/dist/parliament.d.cts +3 -0
  214. package/dist/parliament.d.ts +3 -0
  215. package/dist/parliament.js +1 -0
  216. package/dist/{path-CwB28da0.d.ts → path-YeUiOfG8.d.cts} +1 -4
  217. package/dist/{path-CwB28da0.d.cts → path-YeUiOfG8.d.ts} +1 -4
  218. package/dist/{patterns-DtgcnA8o.js → patterns-CufKZYhm.js} +4 -5
  219. package/dist/{patterns-DtgcnA8o.js.map → patterns-CufKZYhm.js.map} +1 -1
  220. package/dist/{patterns-LfcQAWCy.cjs → patterns-D3-wQagb.cjs} +4 -5
  221. package/dist/{patterns-LfcQAWCy.cjs.map → patterns-D3-wQagb.cjs.map} +1 -1
  222. package/dist/patterns.cjs +3 -5
  223. package/dist/patterns.cjs.map +1 -1
  224. package/dist/patterns.d.cts +5 -1
  225. package/dist/patterns.d.ts +5 -1
  226. package/dist/patterns.js +3 -4
  227. package/dist/percentage-bar-B6tNOqNn.js +157 -0
  228. package/dist/percentage-bar-B6tNOqNn.js.map +1 -0
  229. package/dist/percentage-bar-nhTeakD_.d.ts +62 -0
  230. package/dist/percentage-bar-tepMr7Hd.d.cts +62 -0
  231. package/dist/percentage-bar-ybNS3goo.cjs +162 -0
  232. package/dist/percentage-bar-ybNS3goo.cjs.map +1 -0
  233. package/dist/percentage-bar.cjs +3 -0
  234. package/dist/percentage-bar.d.cts +3 -0
  235. package/dist/percentage-bar.d.ts +3 -0
  236. package/dist/percentage-bar.js +1 -0
  237. package/dist/{pie-B8UlOZiq.d.ts → pie-BXg2gNpb.d.cts} +14 -8
  238. package/dist/{pie-C1Pa6W_l.cjs → pie-BpjvSPnz.cjs} +19 -22
  239. package/dist/pie-BpjvSPnz.cjs.map +1 -0
  240. package/dist/{pie-DnQQmxkk.d.cts → pie-CFptILSm.d.ts} +14 -8
  241. package/dist/{pie-RnMTQWMS.js → pie-CVsc-6qD.js} +13 -16
  242. package/dist/pie-CVsc-6qD.js.map +1 -0
  243. package/dist/pie.cjs +1 -1
  244. package/dist/pie.d.cts +2 -1
  245. package/dist/pie.d.ts +2 -1
  246. package/dist/pie.js +1 -2
  247. package/dist/{point-shapes-CGl4dugc.cjs → point-shapes--_gmdTyK.cjs} +3 -4
  248. package/dist/{point-shapes-CGl4dugc.cjs.map → point-shapes--_gmdTyK.cjs.map} +1 -1
  249. package/dist/{point-shapes-DI84NNpI.js → point-shapes-DD2Ektzm.js} +3 -4
  250. package/dist/{point-shapes-DI84NNpI.js.map → point-shapes-DD2Ektzm.js.map} +1 -1
  251. package/dist/point-shapes.cjs +3 -4
  252. package/dist/point-shapes.d.cts +5 -1
  253. package/dist/point-shapes.d.ts +5 -1
  254. package/dist/point-shapes.js +3 -4
  255. package/dist/{radar-pFI6fvOq.d.ts → radar-BC9Skgpj.d.ts} +4 -7
  256. package/dist/{radar-CYPab_I4.js → radar-BR-mumDd.js} +7 -8
  257. package/dist/{radar-CYPab_I4.js.map → radar-BR-mumDd.js.map} +1 -1
  258. package/dist/{radar-BB13CGmq.d.cts → radar-D1-lItDy.d.cts} +4 -7
  259. package/dist/{radar-CoGUNNSb.cjs → radar-HPDrIdzc.cjs} +7 -8
  260. package/dist/{radar-CoGUNNSb.cjs.map → radar-HPDrIdzc.cjs.map} +1 -1
  261. package/dist/radar.cjs +1 -1
  262. package/dist/radar.d.cts +2 -1
  263. package/dist/radar.d.ts +2 -1
  264. package/dist/radar.js +1 -2
  265. package/dist/rect-D6VhynBM.cjs +16 -0
  266. package/dist/rect-D6VhynBM.cjs.map +1 -0
  267. package/dist/rect-DSVmUZrD.js +11 -0
  268. package/dist/rect-DSVmUZrD.js.map +1 -0
  269. package/dist/{sankey-B4PNKusJ.js → sankey-D6JeZfK5.js} +33 -29
  270. package/dist/sankey-D6JeZfK5.js.map +1 -0
  271. package/dist/{sankey-Bm518bqL.d.ts → sankey-D_v7KxnJ.d.ts} +4 -7
  272. package/dist/{sankey-B9JYnx7e.d.cts → sankey-Dk7jUt8x.d.cts} +4 -7
  273. package/dist/{sankey-Bacx4fVe.cjs → sankey-fCoo1cpz.cjs} +33 -29
  274. package/dist/sankey-fCoo1cpz.cjs.map +1 -0
  275. package/dist/sankey.cjs +1 -1
  276. package/dist/sankey.d.cts +2 -1
  277. package/dist/sankey.d.ts +2 -1
  278. package/dist/sankey.js +1 -2
  279. package/dist/{scatter-kgtgR318.js → scatter-C0TWjFpW.js} +21 -18
  280. package/dist/scatter-C0TWjFpW.js.map +1 -0
  281. package/dist/{scatter-Bl7nasE6.d.ts → scatter-CXEsioOJ.d.ts} +8 -9
  282. package/dist/{scatter-DgMN9zRy.cjs → scatter-DVqB_fP9.cjs} +21 -18
  283. package/dist/scatter-DVqB_fP9.cjs.map +1 -0
  284. package/dist/{scatter-DrJ8xYz4.d.cts → scatter-DZeEIfyo.d.cts} +8 -9
  285. package/dist/scatter.cjs +1 -1
  286. package/dist/scatter.d.cts +2 -1
  287. package/dist/scatter.d.ts +2 -1
  288. package/dist/scatter.js +1 -2
  289. package/dist/{sparkline-BS9-hltA.cjs → sparkline-B39NA0Mi.cjs} +14 -13
  290. package/dist/sparkline-B39NA0Mi.cjs.map +1 -0
  291. package/dist/{sparkline-BG13V4Pz.d.cts → sparkline-DAP6jtzw.d.cts} +5 -8
  292. package/dist/{sparkline-BQzt27Fr.js → sparkline-XO_TqCNP.js} +14 -13
  293. package/dist/sparkline-XO_TqCNP.js.map +1 -0
  294. package/dist/{sparkline-iWuXbKpd.d.ts → sparkline-cbvRkWqS.d.ts} +5 -8
  295. package/dist/sparkline.cjs +1 -1
  296. package/dist/sparkline.d.cts +2 -1
  297. package/dist/sparkline.d.ts +2 -1
  298. package/dist/sparkline.js +1 -2
  299. package/dist/{stack-DRbwTeF3.js → stack-2H2Gfs1Q.js} +3 -4
  300. package/dist/{stack-DRbwTeF3.js.map → stack-2H2Gfs1Q.js.map} +1 -1
  301. package/dist/{stack-DVhJWaki.cjs → stack-BgPzoQmv.cjs} +3 -4
  302. package/dist/{stack-DVhJWaki.cjs.map → stack-BgPzoQmv.cjs.map} +1 -1
  303. package/dist/{stack-CpR6RGKd.d.ts → stack-DR0eQTsB.d.ts} +1 -4
  304. package/dist/{stack-CpR6RGKd.d.cts → stack-Dagxq7l2.d.cts} +2 -4
  305. package/dist/style.css +1 -1
  306. package/dist/sweep-BpRPlhs6.js +59 -0
  307. package/dist/sweep-BpRPlhs6.js.map +1 -0
  308. package/dist/sweep-Dnp6LDBz.cjs +70 -0
  309. package/dist/sweep-Dnp6LDBz.cjs.map +1 -0
  310. package/dist/{time-CNVnt-B2.d.cts → time-B4oxWHQI.d.cts} +2 -7
  311. package/dist/{time-CHjiY9Q4.d.ts → time-DRIDgv2a.d.ts} +2 -7
  312. package/dist/{time-axis-VSX34_Tb.cjs → time-axis-BjZ1bYTK.cjs} +9 -10
  313. package/dist/{time-axis-VSX34_Tb.cjs.map → time-axis-BjZ1bYTK.cjs.map} +1 -1
  314. package/dist/{time-axis-Bc9eHX1r.js → time-axis-FLONo54E.js} +9 -10
  315. package/dist/{time-axis-Bc9eHX1r.js.map → time-axis-FLONo54E.js.map} +1 -1
  316. package/dist/time.cjs +4 -6
  317. package/dist/time.cjs.map +1 -1
  318. package/dist/time.d.cts +1 -1
  319. package/dist/time.d.ts +1 -1
  320. package/dist/time.js +4 -5
  321. package/dist/treemap-BAkhmVQc.d.cts +55 -0
  322. package/dist/treemap-BNpxFBao.d.ts +55 -0
  323. package/dist/treemap-BWpEUlDh.cjs +303 -0
  324. package/dist/treemap-BWpEUlDh.cjs.map +1 -0
  325. package/dist/treemap-CQdavQ9u.js +298 -0
  326. package/dist/treemap-CQdavQ9u.js.map +1 -0
  327. package/dist/treemap.cjs +3 -0
  328. package/dist/treemap.d.cts +3 -0
  329. package/dist/treemap.d.ts +3 -0
  330. package/dist/treemap.js +1 -0
  331. package/dist/{tween-BCYd0RTY.js → tween-BdQqUmmv.js} +2 -3
  332. package/dist/{tween-BCYd0RTY.js.map → tween-BdQqUmmv.js.map} +1 -1
  333. package/dist/{tween-CIGBlryn.cjs → tween-c3aOmfKE.cjs} +2 -3
  334. package/dist/{tween-CIGBlryn.cjs.map → tween-c3aOmfKE.cjs.map} +1 -1
  335. package/dist/{value-labels-IZIQPhfk.js → value-labels-BBuSi4i0.js} +7 -7
  336. package/dist/value-labels-BBuSi4i0.js.map +1 -0
  337. package/dist/{value-labels-B0WJoJ7x.cjs → value-labels-BV9keAuL.cjs} +7 -7
  338. package/dist/value-labels-BV9keAuL.cjs.map +1 -0
  339. package/dist/value-labels.cjs +3 -5
  340. package/dist/value-labels.cjs.map +1 -1
  341. package/dist/value-labels.d.cts +5 -1
  342. package/dist/value-labels.d.ts +5 -1
  343. package/dist/value-labels.js +3 -4
  344. package/dist/{vnode-CkQ27Cxe.cjs → vnode-ClAiw28x.cjs} +2 -3
  345. package/dist/{vnode-CkQ27Cxe.cjs.map → vnode-ClAiw28x.cjs.map} +1 -1
  346. package/dist/{vnode-BUflsBsa.d.ts → vnode-Du2cC8Fm.d.cts} +1 -4
  347. package/dist/{vnode-BUflsBsa.d.cts → vnode-Du2cC8Fm.d.ts} +1 -4
  348. package/dist/{vnode-tCWItoUH.js → vnode-_EMUqysL.js} +2 -3
  349. package/dist/{vnode-tCWItoUH.js.map → vnode-_EMUqysL.js.map} +1 -1
  350. package/package.json +31 -1
  351. package/dist/bar-C-7zR2qp.cjs.map +0 -1
  352. package/dist/bar-jZEoao74.js.map +0 -1
  353. package/dist/cartesian-BoDfgBCV.cjs.map +0 -1
  354. package/dist/cartesian-Cr0AF0nG.js.map +0 -1
  355. package/dist/chart-BF2CK9I_.js.map +0 -1
  356. package/dist/chart-CowF_lWY.cjs.map +0 -1
  357. package/dist/core-C7fPm6t7.cjs.map +0 -1
  358. package/dist/core-plobgBC7.js.map +0 -1
  359. package/dist/gauge-CEfkWXSu.cjs.map +0 -1
  360. package/dist/heatmap-BK18EBgJ.cjs.map +0 -1
  361. package/dist/heatmap-DSZ2bVIa.js.map +0 -1
  362. package/dist/hydrate-CxwTXDqO.cjs.map +0 -1
  363. package/dist/layout-B3hiqVEw.js.map +0 -1
  364. package/dist/layout-CtMBhNd9.cjs.map +0 -1
  365. package/dist/morph-CqYDu1bY.cjs.map +0 -1
  366. package/dist/pie-C1Pa6W_l.cjs.map +0 -1
  367. package/dist/pie-RnMTQWMS.js.map +0 -1
  368. package/dist/sankey-B4PNKusJ.js.map +0 -1
  369. package/dist/sankey-Bacx4fVe.cjs.map +0 -1
  370. package/dist/scatter-DgMN9zRy.cjs.map +0 -1
  371. package/dist/scatter-kgtgR318.js.map +0 -1
  372. package/dist/sparkline-BQzt27Fr.js.map +0 -1
  373. package/dist/sparkline-BS9-hltA.cjs.map +0 -1
  374. package/dist/sweep-Duowaput.cjs.map +0 -1
  375. package/dist/sweep-WSgn2etB.js.map +0 -1
  376. package/dist/value-labels-B0WJoJ7x.cjs.map +0 -1
  377. package/dist/value-labels-IZIQPhfk.js.map +0 -1
@@ -1,4 +1,4 @@
1
- //#region src/scales/extent.ts
1
+ // src/scales/extent.ts
2
2
  /**
3
3
  * Minimum and maximum of `values`, skipping `null`, `undefined` and
4
4
  * non-finite numbers. Returns `undefined` when nothing is left.
@@ -13,7 +13,6 @@ function extent(values) {
13
13
  }
14
14
  return min <= max ? [min, max] : void 0;
15
15
  }
16
- //#endregion
17
16
  Object.defineProperty(exports, "extent", {
18
17
  enumerable: true,
19
18
  get: function() {
@@ -21,4 +20,4 @@ Object.defineProperty(exports, "extent", {
21
20
  }
22
21
  });
23
22
 
24
- //# sourceMappingURL=extent-DsFWvAHJ.cjs.map
23
+ //# sourceMappingURL=extent-DuYDcvM9.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"extent-DsFWvAHJ.cjs","names":[],"sources":["../src/scales/extent.ts"],"sourcesContent":["/**\n * Minimum and maximum of `values`, skipping `null`, `undefined` and\n * non-finite numbers. Returns `undefined` when nothing is left.\n */\nexport function extent(values: Iterable<number | null | undefined>): [number, number] | undefined {\n let min = Number.POSITIVE_INFINITY\n let max = Number.NEGATIVE_INFINITY\n for (const value of values) {\n if (value == null || !Number.isFinite(value)) continue\n if (value < min) min = value\n if (value > max) max = value\n }\n return min <= max ? [min, max] : undefined\n}\n"],"mappings":";;;;;AAIA,SAAgB,OAAO,QAA2E;CAChG,IAAI,MAAM,OAAO;CACjB,IAAI,MAAM,OAAO;CACjB,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,SAAS,QAAQ,CAAC,OAAO,SAAS,KAAK,GAAG;EAC9C,IAAI,QAAQ,KAAK,MAAM;EACvB,IAAI,QAAQ,KAAK,MAAM;CACzB;CACA,OAAO,OAAO,MAAM,CAAC,KAAK,GAAG,IAAI,KAAA;AACnC"}
1
+ {"version":3,"file":"extent-DuYDcvM9.cjs","names":[],"sources":["../src/scales/extent.ts"],"sourcesContent":["/**\n * Minimum and maximum of `values`, skipping `null`, `undefined` and\n * non-finite numbers. Returns `undefined` when nothing is left.\n */\nexport function extent(values: Iterable<number | null | undefined>): [number, number] | undefined {\n let min = Number.POSITIVE_INFINITY\n let max = Number.NEGATIVE_INFINITY\n for (const value of values) {\n if (value == null || !Number.isFinite(value)) continue\n if (value < min) min = value\n if (value > max) max = value\n }\n return min <= max ? [min, max] : undefined\n}\n"],"mappings":";;;;;AAIA,SAAgB,OAAO,QAA2E;CAChG,IAAI,MAAM,OAAO;CACjB,IAAI,MAAM,OAAO;CACjB,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,SAAS,QAAQ,CAAC,OAAO,SAAS,KAAK,GAAG;EAC9C,IAAI,QAAQ,KAAK,MAAM;EACvB,IAAI,QAAQ,KAAK,MAAM;CACzB;CACA,OAAO,OAAO,MAAM,CAAC,KAAK,GAAG,IAAI,KAAA;AACnC"}
@@ -1,5 +1,5 @@
1
- const require_vnode = require("./vnode-CkQ27Cxe.cjs");
2
- //#region src/shapes/path.ts
1
+ const require_vnode = require("./vnode-ClAiw28x.cjs");
2
+ // src/shapes/path.ts
3
3
  /** Accumulates SVG path commands with rounded coordinates. */
4
4
  var PathBuilder = class {
5
5
  d = "";
@@ -165,8 +165,7 @@ function areaPath(points, baseline, options = {}) {
165
165
  }
166
166
  return path.d;
167
167
  }
168
- //#endregion
169
- //#region src/components/fade.ts
168
+ // src/components/fade.ts
170
169
  /**
171
170
  * A vertical luminance mask shared by all gradient areas of a chart (line, area, sparkline). Areas keep their
172
171
  * series color from CSS; the mask only fades them, with stop opacities read
@@ -194,7 +193,6 @@ function fadeMask(id) {
194
193
  fill: `url(#${id}-gradient)`
195
194
  }));
196
195
  }
197
- //#endregion
198
196
  Object.defineProperty(exports, "areaPath", {
199
197
  enumerable: true,
200
198
  get: function() {
@@ -214,4 +212,4 @@ Object.defineProperty(exports, "linePath", {
214
212
  }
215
213
  });
216
214
 
217
- //# sourceMappingURL=fade-Cs74puQS.cjs.map
215
+ //# sourceMappingURL=fade-DVTkhrFU.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fade-Cs74puQS.cjs","names":["h"],"sources":["../src/shapes/path.ts","../src/components/fade.ts"],"sourcesContent":["/** A point in pixels; `null` (or a non-finite coordinate) marks a gap. */\nexport type Point = readonly [x: number, y: number] | null | undefined\n\n/** Curve used to connect consecutive points. */\nexport type Curve = 'linear' | 'monotone' | 'step' | 'step-before' | 'step-after'\n\nexport interface PathOptions {\n /** Interpolation between points. Defaults to `'linear'`. */\n curve?: Curve\n /** Decimal places kept in the path data. Defaults to `2`. */\n precision?: number\n}\n\ntype Pt = readonly [number, number]\n\n/** Accumulates SVG path commands with rounded coordinates. */\nclass PathBuilder {\n d = ''\n readonly #k: number\n\n constructor(precision: number) {\n this.#k = 10 ** Math.max(0, Math.min(12, Math.floor(precision)))\n }\n\n #n(value: number): string {\n const rounded = Math.round(value * this.#k) / this.#k\n return String(rounded === 0 ? 0 : rounded)\n }\n\n #xy(x: number, y: number): string {\n return `${this.#n(x)},${this.#n(y)}`\n }\n\n moveTo(x: number, y: number): void {\n this.d += `M${this.#xy(x, y)}`\n }\n\n lineTo(x: number, y: number): void {\n this.d += `L${this.#xy(x, y)}`\n }\n\n curveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this.d += `C${this.#xy(x1, y1)},${this.#xy(x2, y2)},${this.#xy(x, y)}`\n }\n\n close(): void {\n this.d += 'Z'\n }\n}\n\n/**\n * Emit `points` with a curve. The first point is a `moveTo` when `move` is\n * true, otherwise a `lineTo` (continuing an existing subpath). Returns the\n * number of points drawn.\n */\nfunction emit(path: PathBuilder, input: readonly Pt[], curve: Curve, move: boolean): number {\n // Monotone tangents break on zero-length segments, so drop coincident points.\n const points = curve === 'monotone' ? dedupe(input) : input\n const first = points[0]\n if (!first) return 0\n if (move) path.moveTo(first[0], first[1])\n else path.lineTo(first[0], first[1])\n\n switch (curve) {\n case 'monotone':\n monotone(path, points)\n break\n case 'step':\n step(path, points, 0.5)\n break\n case 'step-before':\n step(path, points, 0)\n break\n case 'step-after':\n step(path, points, 1)\n break\n default:\n for (let i = 1; i < points.length; i++) {\n const p = points[i] as Pt\n path.lineTo(p[0], p[1])\n }\n }\n return points.length\n}\n\nfunction dedupe(points: readonly Pt[]): readonly Pt[] {\n return points.filter((p, i) => {\n const prev = points[i - 1]\n return !prev || p[0] !== prev[0] || p[1] !== prev[1]\n })\n}\n\nfunction step(path: PathBuilder, points: readonly Pt[], t: number): void {\n for (let i = 1; i < points.length; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n if (t <= 0) {\n path.lineTo(x0, y1)\n path.lineTo(x1, y1)\n } else if (t >= 1) {\n path.lineTo(x1, y0)\n path.lineTo(x1, y1)\n } else {\n const xm = x0 * (1 - t) + x1 * t\n path.lineTo(xm, y0)\n path.lineTo(xm, y1)\n // The next horizontal run continues from here, so only the last point is needed.\n if (i === points.length - 1) path.lineTo(x1, y1)\n }\n }\n}\n\nconst sign = (x: number): number => (x < 0 ? -1 : 1)\n\n/**\n * Monotone cubic interpolation in x (Steffen, 1990), as in d3's\n * `curveMonotoneX`: smooth, but never overshoots the data.\n */\nfunction monotone(path: PathBuilder, points: readonly Pt[]): void {\n const n = points.length\n if (n < 2) return\n if (n === 2) {\n const p = points[1] as Pt\n path.lineTo(p[0], p[1])\n return\n }\n\n const tangents = new Array<number>(n)\n for (let i = 1; i < n - 1; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n const [x2, y2] = points[i + 1] as Pt\n const h0 = x1 - x0\n const h1 = x2 - x1\n const s0 = (y1 - y0) / (h0 || (h1 < 0 ? -0 : 0))\n const s1 = (y2 - y1) / (h1 || (h0 < 0 ? -0 : 0))\n const p = (s0 * h1 + s1 * h0) / (h0 + h1)\n tangents[i] =\n (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0\n }\n tangents[0] = endTangent(points[0] as Pt, points[1] as Pt, tangents[1] as number)\n tangents[n - 1] = endTangent(points[n - 2] as Pt, points[n - 1] as Pt, tangents[n - 2] as number)\n\n for (let i = 1; i < n; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n const dx = (x1 - x0) / 3\n path.curveTo(\n x0 + dx,\n y0 + dx * (tangents[i - 1] as number),\n x1 - dx,\n y1 - dx * (tangents[i] as number),\n x1,\n y1,\n )\n }\n}\n\n/** One-sided tangent for the first/last point from the neighbour's tangent. */\nfunction endTangent(a: Pt, b: Pt, t: number): number {\n const h = b[0] - a[0]\n return h ? (3 * (b[1] - a[1])) / h / 2 - t / 2 : t\n}\n\nconst isValid = (p: Point): p is Pt => p != null && Number.isFinite(p[0]) && Number.isFinite(p[1])\n\n/** Split points into runs of consecutive valid points, keeping their indices. */\nfunction runs(points: readonly Point[], valid: (i: number) => boolean = () => true): number[][] {\n const out: number[][] = []\n let current: number[] | undefined\n for (let i = 0; i < points.length; i++) {\n if (isValid(points[i]) && valid(i)) {\n if (!current) {\n current = []\n out.push(current)\n }\n current.push(i)\n } else {\n current = undefined\n }\n }\n return out\n}\n\n/**\n * Build the `d` attribute of a line through `points`. Gaps (`null`/`NaN`)\n * start a new subpath; a lone point renders as `M x,y Z`.\n *\n * ```ts\n * linePath([[0, 10], [50, 40], null, [100, 20]], { curve: 'monotone' })\n * ```\n */\nexport function linePath(points: readonly Point[], options: PathOptions = {}): string {\n const { curve = 'linear', precision = 2 } = options\n const path = new PathBuilder(precision)\n for (const run of runs(points)) {\n const drawn = emit(\n path,\n run.map((i) => points[i] as Pt),\n curve,\n true,\n )\n if (drawn === 1) path.close()\n }\n return path.d\n}\n\n/**\n * Build the `d` attribute of an area between `points` and a `baseline`:\n * a constant y (e.g. the zero line) or one y per point (stacked areas).\n * Each run of valid points becomes a closed subpath.\n */\nexport function areaPath(\n points: readonly Point[],\n baseline: number | readonly (number | null | undefined)[],\n options: PathOptions = {},\n): string {\n const { curve = 'linear', precision = 2 } = options\n const path = new PathBuilder(precision)\n const baseAt = (i: number): number =>\n typeof baseline === 'number' ? baseline : (baseline[i] ?? Number.NaN)\n\n for (const run of runs(points, (i) => Number.isFinite(baseAt(i)))) {\n emit(\n path,\n run.map((i) => points[i] as Pt),\n curve,\n true,\n )\n\n const bottom = run.map((i) => [(points[i] as Pt)[0], baseAt(i)] as const).reverse()\n // Walking backwards mirrors step curves, so stacked steps line up. A flat\n // baseline takes the same curve (it stays straight) so that the path keeps\n // its commands between flat and stacked, and CSS can morph one into the other.\n const back =\n curve === 'step-before' ? 'step-after' : curve === 'step-after' ? 'step-before' : curve\n emit(path, bottom, back, false)\n path.close()\n }\n return path.d\n}\n","import { h, type VNode } from '../vnode.ts'\n\n/**\n * A vertical luminance mask shared by all gradient areas of a chart (line, area, sparkline). Areas keep their\n * series color from CSS; the mask only fades them, with stop opacities read\n * from `--tc-area-gradient-start` / `--tc-area-gradient-end`.\n */\nexport function fadeMask(id: string): VNode {\n return h(\n 'mask',\n { id, maskContentUnits: 'objectBoundingBox' },\n h(\n 'linearGradient',\n { id: `${id}-gradient`, x1: 0, y1: 0, x2: 0, y2: 1 },\n h('stop', { class: 'tc-fade-start', offset: 0 }),\n h('stop', { class: 'tc-fade-end', offset: 1 }),\n ),\n h('rect', { width: 1, height: 1, fill: `url(#${id}-gradient)` }),\n )\n}\n"],"mappings":";;;AAgBA,IAAM,cAAN,MAAkB;CAChB,IAAI;CACJ;CAEA,YAAY,WAAmB;EAC7B,KAAK,KAAK,MAAM,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,MAAM,SAAS,CAAC,CAAC;CACjE;CAEA,GAAG,OAAuB;EACxB,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,EAAE,IAAI,KAAK;EACnD,OAAO,OAAO,YAAY,IAAI,IAA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cjs","names":["h"],"sources":["../src/shapes/path.ts","../src/components/fade.ts"],"sourcesContent":["/** A point in pixels; `null` (or a non-finite coordinate) marks a gap. */\nexport type Point = readonly [x: number, y: number] | null | undefined\n\n/** Curve used to connect consecutive points. */\nexport type Curve = 'linear' | 'monotone' | 'step' | 'step-before' | 'step-after'\n\nexport interface PathOptions {\n /** Interpolation between points. Defaults to `'linear'`. */\n curve?: Curve\n /** Decimal places kept in the path data. Defaults to `2`. */\n precision?: number\n}\n\ntype Pt = readonly [number, number]\n\n/** Accumulates SVG path commands with rounded coordinates. */\nclass PathBuilder {\n d = ''\n readonly #k: number\n\n constructor(precision: number) {\n this.#k = 10 ** Math.max(0, Math.min(12, Math.floor(precision)))\n }\n\n #n(value: number): string {\n const rounded = Math.round(value * this.#k) / this.#k\n return String(rounded === 0 ? 0 : rounded)\n }\n\n #xy(x: number, y: number): string {\n return `${this.#n(x)},${this.#n(y)}`\n }\n\n moveTo(x: number, y: number): void {\n this.d += `M${this.#xy(x, y)}`\n }\n\n lineTo(x: number, y: number): void {\n this.d += `L${this.#xy(x, y)}`\n }\n\n curveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this.d += `C${this.#xy(x1, y1)},${this.#xy(x2, y2)},${this.#xy(x, y)}`\n }\n\n close(): void {\n this.d += 'Z'\n }\n}\n\n/**\n * Emit `points` with a curve. The first point is a `moveTo` when `move` is\n * true, otherwise a `lineTo` (continuing an existing subpath). Returns the\n * number of points drawn.\n */\nfunction emit(path: PathBuilder, input: readonly Pt[], curve: Curve, move: boolean): number {\n // Monotone tangents break on zero-length segments, so drop coincident points.\n const points = curve === 'monotone' ? dedupe(input) : input\n const first = points[0]\n if (!first) return 0\n if (move) path.moveTo(first[0], first[1])\n else path.lineTo(first[0], first[1])\n\n switch (curve) {\n case 'monotone':\n monotone(path, points)\n break\n case 'step':\n step(path, points, 0.5)\n break\n case 'step-before':\n step(path, points, 0)\n break\n case 'step-after':\n step(path, points, 1)\n break\n default:\n for (let i = 1; i < points.length; i++) {\n const p = points[i] as Pt\n path.lineTo(p[0], p[1])\n }\n }\n return points.length\n}\n\nfunction dedupe(points: readonly Pt[]): readonly Pt[] {\n return points.filter((p, i) => {\n const prev = points[i - 1]\n return !prev || p[0] !== prev[0] || p[1] !== prev[1]\n })\n}\n\nfunction step(path: PathBuilder, points: readonly Pt[], t: number): void {\n for (let i = 1; i < points.length; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n if (t <= 0) {\n path.lineTo(x0, y1)\n path.lineTo(x1, y1)\n } else if (t >= 1) {\n path.lineTo(x1, y0)\n path.lineTo(x1, y1)\n } else {\n const xm = x0 * (1 - t) + x1 * t\n path.lineTo(xm, y0)\n path.lineTo(xm, y1)\n // The next horizontal run continues from here, so only the last point is needed.\n if (i === points.length - 1) path.lineTo(x1, y1)\n }\n }\n}\n\nconst sign = (x: number): number => (x < 0 ? -1 : 1)\n\n/**\n * Monotone cubic interpolation in x (Steffen, 1990), as in d3's\n * `curveMonotoneX`: smooth, but never overshoots the data.\n */\nfunction monotone(path: PathBuilder, points: readonly Pt[]): void {\n const n = points.length\n if (n < 2) return\n if (n === 2) {\n const p = points[1] as Pt\n path.lineTo(p[0], p[1])\n return\n }\n\n const tangents = new Array<number>(n)\n for (let i = 1; i < n - 1; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n const [x2, y2] = points[i + 1] as Pt\n const h0 = x1 - x0\n const h1 = x2 - x1\n const s0 = (y1 - y0) / (h0 || (h1 < 0 ? -0 : 0))\n const s1 = (y2 - y1) / (h1 || (h0 < 0 ? -0 : 0))\n const p = (s0 * h1 + s1 * h0) / (h0 + h1)\n tangents[i] =\n (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0\n }\n tangents[0] = endTangent(points[0] as Pt, points[1] as Pt, tangents[1] as number)\n tangents[n - 1] = endTangent(points[n - 2] as Pt, points[n - 1] as Pt, tangents[n - 2] as number)\n\n for (let i = 1; i < n; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n const dx = (x1 - x0) / 3\n path.curveTo(\n x0 + dx,\n y0 + dx * (tangents[i - 1] as number),\n x1 - dx,\n y1 - dx * (tangents[i] as number),\n x1,\n y1,\n )\n }\n}\n\n/** One-sided tangent for the first/last point from the neighbour's tangent. */\nfunction endTangent(a: Pt, b: Pt, t: number): number {\n const h = b[0] - a[0]\n return h ? (3 * (b[1] - a[1])) / h / 2 - t / 2 : t\n}\n\nconst isValid = (p: Point): p is Pt => p != null && Number.isFinite(p[0]) && Number.isFinite(p[1])\n\n/** Split points into runs of consecutive valid points, keeping their indices. */\nfunction runs(points: readonly Point[], valid: (i: number) => boolean = () => true): number[][] {\n const out: number[][] = []\n let current: number[] | undefined\n for (let i = 0; i < points.length; i++) {\n if (isValid(points[i]) && valid(i)) {\n if (!current) {\n current = []\n out.push(current)\n }\n current.push(i)\n } else {\n current = undefined\n }\n }\n return out\n}\n\n/**\n * Build the `d` attribute of a line through `points`. Gaps (`null`/`NaN`)\n * start a new subpath; a lone point renders as `M x,y Z`.\n *\n * ```ts\n * linePath([[0, 10], [50, 40], null, [100, 20]], { curve: 'monotone' })\n * ```\n */\nexport function linePath(points: readonly Point[], options: PathOptions = {}): string {\n const { curve = 'linear', precision = 2 } = options\n const path = new PathBuilder(precision)\n for (const run of runs(points)) {\n const drawn = emit(\n path,\n run.map((i) => points[i] as Pt),\n curve,\n true,\n )\n if (drawn === 1) path.close()\n }\n return path.d\n}\n\n/**\n * Build the `d` attribute of an area between `points` and a `baseline`:\n * a constant y (e.g. the zero line) or one y per point (stacked areas).\n * Each run of valid points becomes a closed subpath.\n */\nexport function areaPath(\n points: readonly Point[],\n baseline: number | readonly (number | null | undefined)[],\n options: PathOptions = {},\n): string {\n const { curve = 'linear', precision = 2 } = options\n const path = new PathBuilder(precision)\n const baseAt = (i: number): number =>\n typeof baseline === 'number' ? baseline : (baseline[i] ?? Number.NaN)\n\n for (const run of runs(points, (i) => Number.isFinite(baseAt(i)))) {\n emit(\n path,\n run.map((i) => points[i] as Pt),\n curve,\n true,\n )\n\n const bottom = run.map((i) => [(points[i] as Pt)[0], baseAt(i)] as const).reverse()\n // Walking backwards mirrors step curves, so stacked steps line up. A flat\n // baseline takes the same curve (it stays straight) so that the path keeps\n // its commands between flat and stacked, and CSS can morph one into the other.\n const back =\n curve === 'step-before' ? 'step-after' : curve === 'step-after' ? 'step-before' : curve\n emit(path, bottom, back, false)\n path.close()\n }\n return path.d\n}\n","import { h, type VNode } from '../vnode.ts'\n\n/**\n * A vertical luminance mask shared by all gradient areas of a chart (line, area, sparkline). Areas keep their\n * series color from CSS; the mask only fades them, with stop opacities read\n * from `--tc-area-gradient-start` / `--tc-area-gradient-end`.\n */\nexport function fadeMask(id: string): VNode {\n return h(\n 'mask',\n { id, maskContentUnits: 'objectBoundingBox' },\n h(\n 'linearGradient',\n { id: `${id}-gradient`, x1: 0, y1: 0, x2: 0, y2: 1 },\n h('stop', { class: 'tc-fade-start', offset: 0 }),\n h('stop', { class: 'tc-fade-end', offset: 1 }),\n ),\n h('rect', { width: 1, height: 1, fill: `url(#${id}-gradient)` }),\n )\n}\n"],"mappings":";;;AAgBA,IAAM,cAAN,MAAkB;CAChB,IAAI;CACK;CAET,YAAY,WAAmB;EAC7B,KAAK,KAAK,MAAM,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,MAAM,SAAS,CAAC,CAAC;CACjE;CAEA,GAAG,OAAuB;EACxB,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,EAAE,IAAI,KAAK;EACnD,OAAO,OAAO,YAAY,IAAI,IAAI,OAAO;CAC3C;CAEA,IAAI,GAAW,GAAmB;EAChC,OAAO,GAAG,KAAK,GAAG,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;CACnC;CAEA,OAAO,GAAW,GAAiB;EACjC,KAAK,KAAK,IAAI,KAAK,IA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AK,MAAM;CAE9B,OAAO,KAAK;AACd;;;;;;AAOA,SAAgB,SACd,QACA,UACA,UAAuB,CAAC,GAChB;CACR,MAAM,EAAE,QAAQ,UAAU,YAAY,MAAM;CAC5C,MAAM,OAAO,IAAI,YAAY,SAAS;CACtC,MAAM,UAAU,MACd,OAAO,aAAa,WAAW,WAAY,SAAS,MAAM;CAE5D,KAAK,MAAM,OAAO,KAAK,SAAS,MAAM,OAAO,SAAS,OAAO,CAAC,CAAC,CAAC,GAAG;EACjE,KACE,MACA,IAAI,KAAK,MAAM,OAAO,EAAQ,GAC9B,OACA,IACF;EAQA,KAAK,MANU,IAAI,KAAK,MAAM,CAAE,OAAO,EAAE,CAAQ,IAAI,OAAO,CAAC,CAAC,CAAU,CAAC,CAAC,QAM1D,GADd,UAAU,gBAAgB,eAAe,UAAU,eAAe,gBAAgB,OAC3D,KAAK;EAC9B,KAAK,MAAM;CACb;CACA,OAAO,KAAK;AACd;;;;;;;ACzOA,SAAgB,SAAS,IAAmB;CAC1C,OAAOA,cAAAA,EACL,QACA;EAAE;EAAI,kBAAkB;CAAoB,GAC5CA,cAAAA,EACE,kBACA;EAAE,IAAI,GAAG,GAAG;EAAY,IAAI;EAAG,IAAI;EAAG,IAAI;EAAG,IAAI;CAAE,GACnDA,cAAAA,EAAE,QAAQ;EAAE,OAAO;EAAiB,QAAQ;CAAE,CAAC,GAC/CA,cAAAA,EAAE,QAAQ;EAAE,OAAO;EAAe,QAAQ;CAAE,CAAC,CAC/C,GACAA,cAAAA,EAAE,QAAQ;EAAE,OAAO;EAAG,QAAQ;EAAG,MAAM,QAAQ,GAAG;CAAY,CAAC,CACjE;AACF"}
@@ -1,5 +1,5 @@
1
- import { t as h } from "./vnode-tCWItoUH.js";
2
- //#region src/shapes/path.ts
1
+ import { t as h } from "./vnode-_EMUqysL.js";
2
+ // src/shapes/path.ts
3
3
  /** Accumulates SVG path commands with rounded coordinates. */
4
4
  var PathBuilder = class {
5
5
  d = "";
@@ -165,8 +165,7 @@ function areaPath(points, baseline, options = {}) {
165
165
  }
166
166
  return path.d;
167
167
  }
168
- //#endregion
169
- //#region src/components/fade.ts
168
+ // src/components/fade.ts
170
169
  /**
171
170
  * A vertical luminance mask shared by all gradient areas of a chart (line, area, sparkline). Areas keep their
172
171
  * series color from CSS; the mask only fades them, with stop opacities read
@@ -194,7 +193,6 @@ function fadeMask(id) {
194
193
  fill: `url(#${id}-gradient)`
195
194
  }));
196
195
  }
197
- //#endregion
198
196
  export { areaPath as n, linePath as r, fadeMask as t };
199
197
 
200
- //# sourceMappingURL=fade-D3NxH5Qg.js.map
198
+ //# sourceMappingURL=fade-GGxcBdss.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fade-D3NxH5Qg.js","names":[],"sources":["../src/shapes/path.ts","../src/components/fade.ts"],"sourcesContent":["/** A point in pixels; `null` (or a non-finite coordinate) marks a gap. */\nexport type Point = readonly [x: number, y: number] | null | undefined\n\n/** Curve used to connect consecutive points. */\nexport type Curve = 'linear' | 'monotone' | 'step' | 'step-before' | 'step-after'\n\nexport interface PathOptions {\n /** Interpolation between points. Defaults to `'linear'`. */\n curve?: Curve\n /** Decimal places kept in the path data. Defaults to `2`. */\n precision?: number\n}\n\ntype Pt = readonly [number, number]\n\n/** Accumulates SVG path commands with rounded coordinates. */\nclass PathBuilder {\n d = ''\n readonly #k: number\n\n constructor(precision: number) {\n this.#k = 10 ** Math.max(0, Math.min(12, Math.floor(precision)))\n }\n\n #n(value: number): string {\n const rounded = Math.round(value * this.#k) / this.#k\n return String(rounded === 0 ? 0 : rounded)\n }\n\n #xy(x: number, y: number): string {\n return `${this.#n(x)},${this.#n(y)}`\n }\n\n moveTo(x: number, y: number): void {\n this.d += `M${this.#xy(x, y)}`\n }\n\n lineTo(x: number, y: number): void {\n this.d += `L${this.#xy(x, y)}`\n }\n\n curveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this.d += `C${this.#xy(x1, y1)},${this.#xy(x2, y2)},${this.#xy(x, y)}`\n }\n\n close(): void {\n this.d += 'Z'\n }\n}\n\n/**\n * Emit `points` with a curve. The first point is a `moveTo` when `move` is\n * true, otherwise a `lineTo` (continuing an existing subpath). Returns the\n * number of points drawn.\n */\nfunction emit(path: PathBuilder, input: readonly Pt[], curve: Curve, move: boolean): number {\n // Monotone tangents break on zero-length segments, so drop coincident points.\n const points = curve === 'monotone' ? dedupe(input) : input\n const first = points[0]\n if (!first) return 0\n if (move) path.moveTo(first[0], first[1])\n else path.lineTo(first[0], first[1])\n\n switch (curve) {\n case 'monotone':\n monotone(path, points)\n break\n case 'step':\n step(path, points, 0.5)\n break\n case 'step-before':\n step(path, points, 0)\n break\n case 'step-after':\n step(path, points, 1)\n break\n default:\n for (let i = 1; i < points.length; i++) {\n const p = points[i] as Pt\n path.lineTo(p[0], p[1])\n }\n }\n return points.length\n}\n\nfunction dedupe(points: readonly Pt[]): readonly Pt[] {\n return points.filter((p, i) => {\n const prev = points[i - 1]\n return !prev || p[0] !== prev[0] || p[1] !== prev[1]\n })\n}\n\nfunction step(path: PathBuilder, points: readonly Pt[], t: number): void {\n for (let i = 1; i < points.length; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n if (t <= 0) {\n path.lineTo(x0, y1)\n path.lineTo(x1, y1)\n } else if (t >= 1) {\n path.lineTo(x1, y0)\n path.lineTo(x1, y1)\n } else {\n const xm = x0 * (1 - t) + x1 * t\n path.lineTo(xm, y0)\n path.lineTo(xm, y1)\n // The next horizontal run continues from here, so only the last point is needed.\n if (i === points.length - 1) path.lineTo(x1, y1)\n }\n }\n}\n\nconst sign = (x: number): number => (x < 0 ? -1 : 1)\n\n/**\n * Monotone cubic interpolation in x (Steffen, 1990), as in d3's\n * `curveMonotoneX`: smooth, but never overshoots the data.\n */\nfunction monotone(path: PathBuilder, points: readonly Pt[]): void {\n const n = points.length\n if (n < 2) return\n if (n === 2) {\n const p = points[1] as Pt\n path.lineTo(p[0], p[1])\n return\n }\n\n const tangents = new Array<number>(n)\n for (let i = 1; i < n - 1; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n const [x2, y2] = points[i + 1] as Pt\n const h0 = x1 - x0\n const h1 = x2 - x1\n const s0 = (y1 - y0) / (h0 || (h1 < 0 ? -0 : 0))\n const s1 = (y2 - y1) / (h1 || (h0 < 0 ? -0 : 0))\n const p = (s0 * h1 + s1 * h0) / (h0 + h1)\n tangents[i] =\n (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0\n }\n tangents[0] = endTangent(points[0] as Pt, points[1] as Pt, tangents[1] as number)\n tangents[n - 1] = endTangent(points[n - 2] as Pt, points[n - 1] as Pt, tangents[n - 2] as number)\n\n for (let i = 1; i < n; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n const dx = (x1 - x0) / 3\n path.curveTo(\n x0 + dx,\n y0 + dx * (tangents[i - 1] as number),\n x1 - dx,\n y1 - dx * (tangents[i] as number),\n x1,\n y1,\n )\n }\n}\n\n/** One-sided tangent for the first/last point from the neighbour's tangent. */\nfunction endTangent(a: Pt, b: Pt, t: number): number {\n const h = b[0] - a[0]\n return h ? (3 * (b[1] - a[1])) / h / 2 - t / 2 : t\n}\n\nconst isValid = (p: Point): p is Pt => p != null && Number.isFinite(p[0]) && Number.isFinite(p[1])\n\n/** Split points into runs of consecutive valid points, keeping their indices. */\nfunction runs(points: readonly Point[], valid: (i: number) => boolean = () => true): number[][] {\n const out: number[][] = []\n let current: number[] | undefined\n for (let i = 0; i < points.length; i++) {\n if (isValid(points[i]) && valid(i)) {\n if (!current) {\n current = []\n out.push(current)\n }\n current.push(i)\n } else {\n current = undefined\n }\n }\n return out\n}\n\n/**\n * Build the `d` attribute of a line through `points`. Gaps (`null`/`NaN`)\n * start a new subpath; a lone point renders as `M x,y Z`.\n *\n * ```ts\n * linePath([[0, 10], [50, 40], null, [100, 20]], { curve: 'monotone' })\n * ```\n */\nexport function linePath(points: readonly Point[], options: PathOptions = {}): string {\n const { curve = 'linear', precision = 2 } = options\n const path = new PathBuilder(precision)\n for (const run of runs(points)) {\n const drawn = emit(\n path,\n run.map((i) => points[i] as Pt),\n curve,\n true,\n )\n if (drawn === 1) path.close()\n }\n return path.d\n}\n\n/**\n * Build the `d` attribute of an area between `points` and a `baseline`:\n * a constant y (e.g. the zero line) or one y per point (stacked areas).\n * Each run of valid points becomes a closed subpath.\n */\nexport function areaPath(\n points: readonly Point[],\n baseline: number | readonly (number | null | undefined)[],\n options: PathOptions = {},\n): string {\n const { curve = 'linear', precision = 2 } = options\n const path = new PathBuilder(precision)\n const baseAt = (i: number): number =>\n typeof baseline === 'number' ? baseline : (baseline[i] ?? Number.NaN)\n\n for (const run of runs(points, (i) => Number.isFinite(baseAt(i)))) {\n emit(\n path,\n run.map((i) => points[i] as Pt),\n curve,\n true,\n )\n\n const bottom = run.map((i) => [(points[i] as Pt)[0], baseAt(i)] as const).reverse()\n // Walking backwards mirrors step curves, so stacked steps line up. A flat\n // baseline takes the same curve (it stays straight) so that the path keeps\n // its commands between flat and stacked, and CSS can morph one into the other.\n const back =\n curve === 'step-before' ? 'step-after' : curve === 'step-after' ? 'step-before' : curve\n emit(path, bottom, back, false)\n path.close()\n }\n return path.d\n}\n","import { h, type VNode } from '../vnode.ts'\n\n/**\n * A vertical luminance mask shared by all gradient areas of a chart (line, area, sparkline). Areas keep their\n * series color from CSS; the mask only fades them, with stop opacities read\n * from `--tc-area-gradient-start` / `--tc-area-gradient-end`.\n */\nexport function fadeMask(id: string): VNode {\n return h(\n 'mask',\n { id, maskContentUnits: 'objectBoundingBox' },\n h(\n 'linearGradient',\n { id: `${id}-gradient`, x1: 0, y1: 0, x2: 0, y2: 1 },\n h('stop', { class: 'tc-fade-start', offset: 0 }),\n h('stop', { class: 'tc-fade-end', offset: 1 }),\n ),\n h('rect', { width: 1, height: 1, fill: `url(#${id}-gradient)` }),\n )\n}\n"],"m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AAE,QAAQ;EAAE,OAAO;EAAiB,QAAQ;CAAE,CAAC,GAC/C,EAAE,QAAQ;EAAE,OAAO;EAAe,QAAQ;CAAE,CAAC,CAC/C,GACA,EAAE,QAAQ;EAAE,OAAO;EAAG,QAAQ;EAAG,MAAM,QAAQ,GAAG;CAAY,CAAC,CACjE;AACF"}
1
+ {"version":3,"file":"fade-GGxcBdss.js","names":[],"sources":["../src/shapes/path.ts","../src/components/fade.ts"],"sourcesContent":["/** A point in pixels; `null` (or a non-finite coordinate) marks a gap. */\nexport type Point = readonly [x: number, y: number] | null | undefined\n\n/** Curve used to connect consecutive points. */\nexport type Curve = 'linear' | 'monotone' | 'step' | 'step-before' | 'step-after'\n\nexport interface PathOptions {\n /** Interpolation between points. Defaults to `'linear'`. */\n curve?: Curve\n /** Decimal places kept in the path data. Defaults to `2`. */\n precision?: number\n}\n\ntype Pt = readonly [number, number]\n\n/** Accumulates SVG path commands with rounded coordinates. */\nclass PathBuilder {\n d = ''\n readonly #k: number\n\n constructor(precision: number) {\n this.#k = 10 ** Math.max(0, Math.min(12, Math.floor(precision)))\n }\n\n #n(value: number): string {\n const rounded = Math.round(value * this.#k) / this.#k\n return String(rounded === 0 ? 0 : rounded)\n }\n\n #xy(x: number, y: number): string {\n return `${this.#n(x)},${this.#n(y)}`\n }\n\n moveTo(x: number, y: number): void {\n this.d += `M${this.#xy(x, y)}`\n }\n\n lineTo(x: number, y: number): void {\n this.d += `L${this.#xy(x, y)}`\n }\n\n curveTo(x1: number, y1: number, x2: number, y2: number, x: number, y: number): void {\n this.d += `C${this.#xy(x1, y1)},${this.#xy(x2, y2)},${this.#xy(x, y)}`\n }\n\n close(): void {\n this.d += 'Z'\n }\n}\n\n/**\n * Emit `points` with a curve. The first point is a `moveTo` when `move` is\n * true, otherwise a `lineTo` (continuing an existing subpath). Returns the\n * number of points drawn.\n */\nfunction emit(path: PathBuilder, input: readonly Pt[], curve: Curve, move: boolean): number {\n // Monotone tangents break on zero-length segments, so drop coincident points.\n const points = curve === 'monotone' ? dedupe(input) : input\n const first = points[0]\n if (!first) return 0\n if (move) path.moveTo(first[0], first[1])\n else path.lineTo(first[0], first[1])\n\n switch (curve) {\n case 'monotone':\n monotone(path, points)\n break\n case 'step':\n step(path, points, 0.5)\n break\n case 'step-before':\n step(path, points, 0)\n break\n case 'step-after':\n step(path, points, 1)\n break\n default:\n for (let i = 1; i < points.length; i++) {\n const p = points[i] as Pt\n path.lineTo(p[0], p[1])\n }\n }\n return points.length\n}\n\nfunction dedupe(points: readonly Pt[]): readonly Pt[] {\n return points.filter((p, i) => {\n const prev = points[i - 1]\n return !prev || p[0] !== prev[0] || p[1] !== prev[1]\n })\n}\n\nfunction step(path: PathBuilder, points: readonly Pt[], t: number): void {\n for (let i = 1; i < points.length; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n if (t <= 0) {\n path.lineTo(x0, y1)\n path.lineTo(x1, y1)\n } else if (t >= 1) {\n path.lineTo(x1, y0)\n path.lineTo(x1, y1)\n } else {\n const xm = x0 * (1 - t) + x1 * t\n path.lineTo(xm, y0)\n path.lineTo(xm, y1)\n // The next horizontal run continues from here, so only the last point is needed.\n if (i === points.length - 1) path.lineTo(x1, y1)\n }\n }\n}\n\nconst sign = (x: number): number => (x < 0 ? -1 : 1)\n\n/**\n * Monotone cubic interpolation in x (Steffen, 1990), as in d3's\n * `curveMonotoneX`: smooth, but never overshoots the data.\n */\nfunction monotone(path: PathBuilder, points: readonly Pt[]): void {\n const n = points.length\n if (n < 2) return\n if (n === 2) {\n const p = points[1] as Pt\n path.lineTo(p[0], p[1])\n return\n }\n\n const tangents = new Array<number>(n)\n for (let i = 1; i < n - 1; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n const [x2, y2] = points[i + 1] as Pt\n const h0 = x1 - x0\n const h1 = x2 - x1\n const s0 = (y1 - y0) / (h0 || (h1 < 0 ? -0 : 0))\n const s1 = (y2 - y1) / (h1 || (h0 < 0 ? -0 : 0))\n const p = (s0 * h1 + s1 * h0) / (h0 + h1)\n tangents[i] =\n (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0\n }\n tangents[0] = endTangent(points[0] as Pt, points[1] as Pt, tangents[1] as number)\n tangents[n - 1] = endTangent(points[n - 2] as Pt, points[n - 1] as Pt, tangents[n - 2] as number)\n\n for (let i = 1; i < n; i++) {\n const [x0, y0] = points[i - 1] as Pt\n const [x1, y1] = points[i] as Pt\n const dx = (x1 - x0) / 3\n path.curveTo(\n x0 + dx,\n y0 + dx * (tangents[i - 1] as number),\n x1 - dx,\n y1 - dx * (tangents[i] as number),\n x1,\n y1,\n )\n }\n}\n\n/** One-sided tangent for the first/last point from the neighbour's tangent. */\nfunction endTangent(a: Pt, b: Pt, t: number): number {\n const h = b[0] - a[0]\n return h ? (3 * (b[1] - a[1])) / h / 2 - t / 2 : t\n}\n\nconst isValid = (p: Point): p is Pt => p != null && Number.isFinite(p[0]) && Number.isFinite(p[1])\n\n/** Split points into runs of consecutive valid points, keeping their indices. */\nfunction runs(points: readonly Point[], valid: (i: number) => boolean = () => true): number[][] {\n const out: number[][] = []\n let current: number[] | undefined\n for (let i = 0; i < points.length; i++) {\n if (isValid(points[i]) && valid(i)) {\n if (!current) {\n current = []\n out.push(current)\n }\n current.push(i)\n } else {\n current = undefined\n }\n }\n return out\n}\n\n/**\n * Build the `d` attribute of a line through `points`. Gaps (`null`/`NaN`)\n * start a new subpath; a lone point renders as `M x,y Z`.\n *\n * ```ts\n * linePath([[0, 10], [50, 40], null, [100, 20]], { curve: 'monotone' })\n * ```\n */\nexport function linePath(points: readonly Point[], options: PathOptions = {}): string {\n const { curve = 'linear', precision = 2 } = options\n const path = new PathBuilder(precision)\n for (const run of runs(points)) {\n const drawn = emit(\n path,\n run.map((i) => points[i] as Pt),\n curve,\n true,\n )\n if (drawn === 1) path.close()\n }\n return path.d\n}\n\n/**\n * Build the `d` attribute of an area between `points` and a `baseline`:\n * a constant y (e.g. the zero line) or one y per point (stacked areas).\n * Each run of valid points becomes a closed subpath.\n */\nexport function areaPath(\n points: readonly Point[],\n baseline: number | readonly (number | null | undefined)[],\n options: PathOptions = {},\n): string {\n const { curve = 'linear', precision = 2 } = options\n const path = new PathBuilder(precision)\n const baseAt = (i: number): number =>\n typeof baseline === 'number' ? baseline : (baseline[i] ?? Number.NaN)\n\n for (const run of runs(points, (i) => Number.isFinite(baseAt(i)))) {\n emit(\n path,\n run.map((i) => points[i] as Pt),\n curve,\n true,\n )\n\n const bottom = run.map((i) => [(points[i] as Pt)[0], baseAt(i)] as const).reverse()\n // Walking backwards mirrors step curves, so stacked steps line up. A flat\n // baseline takes the same curve (it stays straight) so that the path keeps\n // its commands between flat and stacked, and CSS can morph one into the other.\n const back =\n curve === 'step-before' ? 'step-after' : curve === 'step-after' ? 'step-before' : curve\n emit(path, bottom, back, false)\n path.close()\n }\n return path.d\n}\n","import { h, type VNode } from '../vnode.ts'\n\n/**\n * A vertical luminance mask shared by all gradient areas of a chart (line, area, sparkline). Areas keep their\n * series color from CSS; the mask only fades them, with stop opacities read\n * from `--tc-area-gradient-start` / `--tc-area-gradient-end`.\n */\nexport function fadeMask(id: string): VNode {\n return h(\n 'mask',\n { id, maskContentUnits: 'objectBoundingBox' },\n h(\n 'linearGradient',\n { id: `${id}-gradient`, x1: 0, y1: 0, x2: 0, y2: 1 },\n h('stop', { class: 'tc-fade-start', offset: 0 }),\n h('stop', { class: 'tc-fade-end', offset: 1 }),\n ),\n h('rect', { width: 1, height: 1, fill: `url(#${id}-gradient)` }),\n )\n}\n"],"mappings":";;;AAgBA,IAAM,cAAN,MAAkB;CAChB,IAAI;CACK;CAET,YAAY,WAAmB;EAC7B,KAAK,KAAK,MAAM,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,MAAM,SAAS,CAAC,CAAC;CACjE;CAEA,GAAG,OAAuB;EACxB,MAAM,UAAU,KAAK,MAAM,Q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1,4 @@
1
- //#region src/features.ts
1
+ // src/features.ts
2
2
  const features = {};
3
3
  /** Register optional features (idempotent). */
4
4
  function register(added) {
@@ -19,7 +19,6 @@ function feature(name) {
19
19
  if (!found) throw new Error(`@tabler/charts: Import "@tabler/charts/${name === "dates" ? "time" : name}" for ${name}.`);
20
20
  return found;
21
21
  }
22
- //#endregion
23
22
  export { register as i, feature as n, features as r, addPost as t };
24
23
 
25
- //# sourceMappingURL=features-wASyHGic.js.map
24
+ //# sourceMappingURL=features-BMxkqCyS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"features-wASyHGic.js","names":[],"sources":["../src/features.ts"],"sourcesContent":["import type { ChartConfig, RenderContext } from './chart.ts'\nimport type { annotationLayers, annotationValues } from './charts/annotations.ts'\nimport type { dateLabels } from './charts/dates.ts'\nimport type { logDomain, logTicks } from './charts/log-axis.ts'\nimport type { patternFills } from './charts/patterns.ts'\nimport type { markerPath } from './charts/point-shapes.ts'\nimport type { timeAxis } from './charts/time-axis.ts'\nimport type { downloadChart } from './export-chart.ts'\nimport type { Interaction } from './interaction.ts'\nimport type { hydrate } from './render/hydrate.ts'\nimport type { morph } from './render/morph.ts'\nimport type { sweep } from './render/sweep.ts'\nimport type { log } from './scales/log.ts'\nimport type { time, timePointScale } from './scales/time.ts'\nimport type { areaPath, linePath, Point } from './shapes/path.ts'\nimport type { ChildInput } from './vnode.ts'\n\n/**\n * Optional features that chart types look up at render time. Each lives in\n * its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers\n * itself when imported; `@tabler/charts` registers all of them, while\n * `@tabler/charts/core` starts empty so unused code never ships.\n */\nexport interface Features {\n /** Time scale (and the point scale over it) behind `x: { type: 'time' }`. */\n time?: { scale: typeof time; points: typeof timePointScale; axis: typeof timeAxis }\n /** Date labels behind `x: { type: 'time' }` (also registered by `@tabler/charts/candlestick`). */\n dates?: typeof dateLabels\n /** Log scale and axis behind `scale: 'log'`. */\n log?: { scale: typeof log; domain: typeof logDomain; ticks: typeof logTicks }\n /** Downsampling behind `decimate: N`: indices of the points to keep. */\n decimate?: (points: readonly Point[], threshold: number) => number[]\n /**\n * Taking over server-rendered markup node by node (without it, the server\n * svg is replaced on the first render).\n */\n hydrate?: typeof hydrate\n /** Path morphing on data updates where CSS cannot transition `d` (Safari). */\n morph?: typeof morph\n /** Arcs turning to their new angles on data updates (set by pie, donut and gauge). */\n sweep?: typeof sweep\n /** Line and area paths behind `series.type: 'line' | 'area'` in bar charts. */\n line?: { linePath: typeof linePath; areaPath: typeof areaPath }\n /** Reference lines and bands behind `annotations` in cartesian charts. */\n annotations?: { layers: typeof annotationLayers; values: typeof annotationValues }\n /** Pattern fills behind `patterns` (and forced colors, with `'auto'`). */\n patterns?: typeof patternFills\n /**\n * Steps that finish a chart's rendered content (see `addPost`): point\n * shapes, value labels.\n */\n post?: PostStep\n /** Point shapes by color slot, behind `shapes`. */\n 'point-shapes'?: typeof markerPath\n /** Saving a chart as a file, behind the `download` menu. */\n export?: typeof downloadChart\n}\n\nexport const features: Features = {}\n\n/** Register optional features (idempotent). */\nexport function register(added: Features): void {\n Object.assign(features, added)\n}\n\n/** A step that finishes rendered chart content, e.g. by adding value labels. */\nexport type PostStep = (\n config: ChartConfig<object>,\n content: ChildInput,\n interaction: Interaction | undefined,\n ctx: RenderContext,\n) => ChildInput\n\nconst steps = /* @__PURE__ */ new Set<PostStep>()\n\n/** Add a step that finishes rendered content, once, in the order added. */\nexport function addPost(step: PostStep): void {\n steps.add(step)\n features.post = (config, content, interaction, ctx) => {\n for (const each of steps) content = each(config, content, interaction, ctx)\n return content\n }\n}\n\n/** The registered feature, or a helpful error naming the import that provides it. */\nexport function feature<K extends keyof Features>(name: K): NonNullable<Features[K]> {\n const found = features[name]\n if (!found) {\n throw new Error(\n `@tabler/charts: Import \"@tabler/charts/${name === 'dates' ? 'time' : name}\" for ${name}.`,\n )\n }\n return found\n}\n"],"mappings":";AA0DA,MAAa,WAAqB,CAAC;;AAGnC,SAAgB,SAAS,OAAuB;CAC9C,OAAO,OAAO,UAAU,KAAK;AAC/B;AAUA,MAAM,wBAAwB,IAAI,IAAc;;AAGhD,SAAgB,QAAQ,MAAsB;CAC5C,MAAM,IAAI,IAAI;CACd,SAAS,QAAQ,QAAQ,SAAS,aAAa,QAAQ;EACrD,KAAK,MAAM,QAAQ,OAAO,UAAU,KAAK,QAAQ,SAAS,aAAa,GAAG;EAC1E,OAAO;CACT;AACF;;AAGA,SAAgB,QAAkC,MAAmC;CACnF,MAAM,QAAQ,SAAS;CACvB,IAAI,CAAC,OACH,MAAM,IAAI,MACR,0CAA0C,SAAS,UAAU,SAAS,KAAK,QAAQ,KAAK,EAC1F;CAEF,OAAO;AACT"}
1
+ {"version":3,"file":"features-BMxkqCyS.js","names":[],"sources":["../src/features.ts"],"sourcesContent":["import type { ChartConfig, RenderContext } from './chart.ts'\nimport type { annotationLayers, annotationValues } from './charts/annotations.ts'\nimport type { dateLabels } from './charts/dates.ts'\nimport type { logDomain, logTicks } from './charts/log-axis.ts'\nimport type { patternFills } from './charts/patterns.ts'\nimport type { markerPath } from './charts/point-shapes.ts'\nimport type { timeAxis } from './charts/time-axis.ts'\nimport type { downloadChart } from './export-chart.ts'\nimport type { Interaction } from './interaction.ts'\nimport type { hydrate } from './render/hydrate.ts'\nimport type { morph } from './render/morph.ts'\nimport type { sweep } from './render/sweep.ts'\nimport type { log } from './scales/log.ts'\nimport type { time, timePointScale } from './scales/time.ts'\nimport type { areaPath, linePath, Point } from './shapes/path.ts'\nimport type { ChildInput } from './vnode.ts'\n\n/**\n * Optional features that chart types look up at render time. Each lives in\n * its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers\n * itself when imported; `@tabler/charts` registers all of them, while\n * `@tabler/charts/core` starts empty so unused code never ships.\n */\nexport interface Features {\n /** Time scale (and the point scale over it) behind `x: { type: 'time' }`. */\n time?: { scale: typeof time; points: typeof timePointScale; axis: typeof timeAxis }\n /** Date labels behind `x: { type: 'time' }` (also registered by `@tabler/charts/candlestick`). */\n dates?: typeof dateLabels\n /** Log scale and axis behind `scale: 'log'`. */\n log?: { scale: typeof log; domain: typeof logDomain; ticks: typeof logTicks }\n /** Downsampling behind `decimate: N`: indices of the points to keep. */\n decimate?: (points: readonly Point[], threshold: number) => number[]\n /**\n * Taking over server-rendered markup node by node (without it, the server\n * svg is replaced on the first render).\n */\n hydrate?: typeof hydrate\n /** Path morphing on data updates where CSS cannot transition `d` (Safari). */\n morph?: typeof morph\n /** Arcs turning to their new angles on data updates (set by pie, donut and gauge). */\n sweep?: typeof sweep\n /** Line and area paths behind `series.type: 'line' | 'area'` in bar charts. */\n line?: { linePath: typeof linePath; areaPath: typeof areaPath }\n /** Reference lines and bands behind `annotations` in cartesian charts. */\n annotations?: { layers: typeof annotationLayers; values: typeof annotationValues }\n /** Pattern fills behind `patterns` (and forced colors, with `'auto'`). */\n patterns?: typeof patternFills\n /**\n * Steps that finish a chart's rendered content (see `addPost`): point\n * shapes, value labels.\n */\n post?: PostStep\n /** Point shapes by color slot, behind `shapes`. */\n 'point-shapes'?: typeof markerPath\n /** Saving a chart as a file, behind the `download` menu. */\n export?: typeof downloadChart\n}\n\nexport const features: Features = {}\n\n/** Register optional features (idempotent). */\nexport function register(added: Features): void {\n Object.assign(features, added)\n}\n\n/** A step that finishes rendered chart content, e.g. by adding value labels. */\nexport type PostStep = (\n config: ChartConfig<object>,\n content: ChildInput,\n interaction: Interaction | undefined,\n ctx: RenderContext,\n) => ChildInput\n\nconst steps = /* @__PURE__ */ new Set<PostStep>()\n\n/** Add a step that finishes rendered content, once, in the order added. */\nexport function addPost(step: PostStep): void {\n steps.add(step)\n features.post = (config, content, interaction, ctx) => {\n for (const each of steps) content = each(config, content, interaction, ctx)\n return content\n }\n}\n\n/** The registered feature, or a helpful error naming the import that provides it. */\nexport function feature<K extends keyof Features>(name: K): NonNullable<Features[K]> {\n const found = features[name]\n if (!found) {\n throw new Error(\n `@tabler/charts: Import \"@tabler/charts/${name === 'dates' ? 'time' : name}\" for ${name}.`,\n )\n }\n return found\n}\n"],"mappings":";AA0DA,MAAa,WAAqB,CAAC;;AAGnC,SAAgB,SAAS,OAAuB;CAC9C,OAAO,OAAO,UAAU,KAAK;AAC/B;AAUA,MAAM,wBAAwB,IAAI,IAAc;;AAGhD,SAAgB,QAAQ,MAAsB;CAC5C,MAAM,IAAI,IAAI;CACd,SAAS,QAAQ,QAAQ,SAAS,aAAa,QAAQ;EACrD,KAAK,MAAM,QAAQ,OAAO,UAAU,KAAK,QAAQ,SAAS,aAAa,GAAG;EAC1E,OAAO;CACT;AACF;;AAGA,SAAgB,QAAkC,MAAmC;CACnF,MAAM,QAAQ,SAAS;CACvB,IAAI,CAAC,OACH,MAAM,IAAI,MACR,0CAA0C,SAAS,UAAU,SAAS,KAAK,QAAQ,KAAK,EAC1F;CAEF,OAAO;AACT"}
@@ -1,4 +1,4 @@
1
- //#region src/features.ts
1
+ // src/features.ts
2
2
  const features = {};
3
3
  /** Register optional features (idempotent). */
4
4
  function register(added) {
@@ -19,7 +19,6 @@ function feature(name) {
19
19
  if (!found) throw new Error(`@tabler/charts: Import "@tabler/charts/${name === "dates" ? "time" : name}" for ${name}.`);
20
20
  return found;
21
21
  }
22
- //#endregion
23
22
  Object.defineProperty(exports, "addPost", {
24
23
  enumerable: true,
25
24
  get: function() {
@@ -45,4 +44,4 @@ Object.defineProperty(exports, "register", {
45
44
  }
46
45
  });
47
46
 
48
- //# sourceMappingURL=features-BclHgg2W.cjs.map
47
+ //# sourceMappingURL=features-DCXEvoya.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"features-BclHgg2W.cjs","names":[],"sources":["../src/features.ts"],"sourcesContent":["import type { ChartConfig, RenderContext } from './chart.ts'\nimport type { annotationLayers, annotationValues } from './charts/annotations.ts'\nimport type { dateLabels } from './charts/dates.ts'\nimport type { logDomain, logTicks } from './charts/log-axis.ts'\nimport type { patternFills } from './charts/patterns.ts'\nimport type { markerPath } from './charts/point-shapes.ts'\nimport type { timeAxis } from './charts/time-axis.ts'\nimport type { downloadChart } from './export-chart.ts'\nimport type { Interaction } from './interaction.ts'\nimport type { hydrate } from './render/hydrate.ts'\nimport type { morph } from './render/morph.ts'\nimport type { sweep } from './render/sweep.ts'\nimport type { log } from './scales/log.ts'\nimport type { time, timePointScale } from './scales/time.ts'\nimport type { areaPath, linePath, Point } from './shapes/path.ts'\nimport type { ChildInput } from './vnode.ts'\n\n/**\n * Optional features that chart types look up at render time. Each lives in\n * its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers\n * itself when imported; `@tabler/charts` registers all of them, while\n * `@tabler/charts/core` starts empty so unused code never ships.\n */\nexport interface Features {\n /** Time scale (and the point scale over it) behind `x: { type: 'time' }`. */\n time?: { scale: typeof time; points: typeof timePointScale; axis: typeof timeAxis }\n /** Date labels behind `x: { type: 'time' }` (also registered by `@tabler/charts/candlestick`). */\n dates?: typeof dateLabels\n /** Log scale and axis behind `scale: 'log'`. */\n log?: { scale: typeof log; domain: typeof logDomain; ticks: typeof logTicks }\n /** Downsampling behind `decimate: N`: indices of the points to keep. */\n decimate?: (points: readonly Point[], threshold: number) => number[]\n /**\n * Taking over server-rendered markup node by node (without it, the server\n * svg is replaced on the first render).\n */\n hydrate?: typeof hydrate\n /** Path morphing on data updates where CSS cannot transition `d` (Safari). */\n morph?: typeof morph\n /** Arcs turning to their new angles on data updates (set by pie, donut and gauge). */\n sweep?: typeof sweep\n /** Line and area paths behind `series.type: 'line' | 'area'` in bar charts. */\n line?: { linePath: typeof linePath; areaPath: typeof areaPath }\n /** Reference lines and bands behind `annotations` in cartesian charts. */\n annotations?: { layers: typeof annotationLayers; values: typeof annotationValues }\n /** Pattern fills behind `patterns` (and forced colors, with `'auto'`). */\n patterns?: typeof patternFills\n /**\n * Steps that finish a chart's rendered content (see `addPost`): point\n * shapes, value labels.\n */\n post?: PostStep\n /** Point shapes by color slot, behind `shapes`. */\n 'point-shapes'?: typeof markerPath\n /** Saving a chart as a file, behind the `download` menu. */\n export?: typeof downloadChart\n}\n\nexport const features: Features = {}\n\n/** Register optional features (idempotent). */\nexport function register(added: Features): void {\n Object.assign(features, added)\n}\n\n/** A step that finishes rendered chart content, e.g. by adding value labels. */\nexport type PostStep = (\n config: ChartConfig<object>,\n content: ChildInput,\n interaction: Interaction | undefined,\n ctx: RenderContext,\n) => ChildInput\n\nconst steps = /* @__PURE__ */ new Set<PostStep>()\n\n/** Add a step that finishes rendered content, once, in the order added. */\nexport function addPost(step: PostStep): void {\n steps.add(step)\n features.post = (config, content, interaction, ctx) => {\n for (const each of steps) content = each(config, content, interaction, ctx)\n return content\n }\n}\n\n/** The registered feature, or a helpful error naming the import that provides it. */\nexport function feature<K extends keyof Features>(name: K): NonNullable<Features[K]> {\n const found = features[name]\n if (!found) {\n throw new Error(\n `@tabler/charts: Import \"@tabler/charts/${name === 'dates' ? 'time' : name}\" for ${name}.`,\n )\n }\n return found\n}\n"],"mappings":";AA0DA,MAAa,WAAqB,CAAC;;AAGnC,SAAgB,SAAS,OAAuB;CAC9C,OAAO,OAAO,UAAU,KAAK;AAC/B;AAUA,MAAM,wBAAwB,IAAI,IAAc;;AAGhD,SAAgB,QAAQ,MAAsB;CAC5C,MAAM,IAAI,IAAI;CACd,SAAS,QAAQ,QAAQ,SAAS,aAAa,QAAQ;EACrD,KAAK,MAAM,QAAQ,OAAO,UAAU,KAAK,QAAQ,SAAS,aAAa,GAAG;EAC1E,OAAO;CACT;AACF;;AAGA,SAAgB,QAAkC,MAAmC;CACnF,MAAM,QAAQ,SAAS;CACvB,IAAI,CAAC,OACH,MAAM,IAAI,MACR,0CAA0C,SAAS,UAAU,SAAS,KAAK,QAAQ,KAAK,EAC1F;CAEF,OAAO;AACT"}
1
+ {"version":3,"file":"features-DCXEvoya.cjs","names":[],"sources":["../src/features.ts"],"sourcesContent":["import type { ChartConfig, RenderContext } from './chart.ts'\nimport type { annotationLayers, annotationValues } from './charts/annotations.ts'\nimport type { dateLabels } from './charts/dates.ts'\nimport type { logDomain, logTicks } from './charts/log-axis.ts'\nimport type { patternFills } from './charts/patterns.ts'\nimport type { markerPath } from './charts/point-shapes.ts'\nimport type { timeAxis } from './charts/time-axis.ts'\nimport type { downloadChart } from './export-chart.ts'\nimport type { Interaction } from './interaction.ts'\nimport type { hydrate } from './render/hydrate.ts'\nimport type { morph } from './render/morph.ts'\nimport type { sweep } from './render/sweep.ts'\nimport type { log } from './scales/log.ts'\nimport type { time, timePointScale } from './scales/time.ts'\nimport type { areaPath, linePath, Point } from './shapes/path.ts'\nimport type { ChildInput } from './vnode.ts'\n\n/**\n * Optional features that chart types look up at render time. Each lives in\n * its own module (`@tabler/charts/time`, `/log`, `/decimate`, `/line`, `/annotations`) and registers\n * itself when imported; `@tabler/charts` registers all of them, while\n * `@tabler/charts/core` starts empty so unused code never ships.\n */\nexport interface Features {\n /** Time scale (and the point scale over it) behind `x: { type: 'time' }`. */\n time?: { scale: typeof time; points: typeof timePointScale; axis: typeof timeAxis }\n /** Date labels behind `x: { type: 'time' }` (also registered by `@tabler/charts/candlestick`). */\n dates?: typeof dateLabels\n /** Log scale and axis behind `scale: 'log'`. */\n log?: { scale: typeof log; domain: typeof logDomain; ticks: typeof logTicks }\n /** Downsampling behind `decimate: N`: indices of the points to keep. */\n decimate?: (points: readonly Point[], threshold: number) => number[]\n /**\n * Taking over server-rendered markup node by node (without it, the server\n * svg is replaced on the first render).\n */\n hydrate?: typeof hydrate\n /** Path morphing on data updates where CSS cannot transition `d` (Safari). */\n morph?: typeof morph\n /** Arcs turning to their new angles on data updates (set by pie, donut and gauge). */\n sweep?: typeof sweep\n /** Line and area paths behind `series.type: 'line' | 'area'` in bar charts. */\n line?: { linePath: typeof linePath; areaPath: typeof areaPath }\n /** Reference lines and bands behind `annotations` in cartesian charts. */\n annotations?: { layers: typeof annotationLayers; values: typeof annotationValues }\n /** Pattern fills behind `patterns` (and forced colors, with `'auto'`). */\n patterns?: typeof patternFills\n /**\n * Steps that finish a chart's rendered content (see `addPost`): point\n * shapes, value labels.\n */\n post?: PostStep\n /** Point shapes by color slot, behind `shapes`. */\n 'point-shapes'?: typeof markerPath\n /** Saving a chart as a file, behind the `download` menu. */\n export?: typeof downloadChart\n}\n\nexport const features: Features = {}\n\n/** Register optional features (idempotent). */\nexport function register(added: Features): void {\n Object.assign(features, added)\n}\n\n/** A step that finishes rendered chart content, e.g. by adding value labels. */\nexport type PostStep = (\n config: ChartConfig<object>,\n content: ChildInput,\n interaction: Interaction | undefined,\n ctx: RenderContext,\n) => ChildInput\n\nconst steps = /* @__PURE__ */ new Set<PostStep>()\n\n/** Add a step that finishes rendered content, once, in the order added. */\nexport function addPost(step: PostStep): void {\n steps.add(step)\n features.post = (config, content, interaction, ctx) => {\n for (const each of steps) content = each(config, content, interaction, ctx)\n return content\n }\n}\n\n/** The registered feature, or a helpful error naming the import that provides it. */\nexport function feature<K extends keyof Features>(name: K): NonNullable<Features[K]> {\n const found = features[name]\n if (!found) {\n throw new Error(\n `@tabler/charts: Import \"@tabler/charts/${name === 'dates' ? 'time' : name}\" for ${name}.`,\n )\n }\n return found\n}\n"],"mappings":";AA0DA,MAAa,WAAqB,CAAC;;AAGnC,SAAgB,SAAS,OAAuB;CAC9C,OAAO,OAAO,UAAU,KAAK;AAC/B;AAUA,MAAM,wBAAwB,IAAI,IAAc;;AAGhD,SAAgB,QAAQ,MAAsB;CAC5C,MAAM,IAAI,IAAI;CACd,SAAS,QAAQ,QAAQ,SAAS,aAAa,QAAQ;EACrD,KAAK,MAAM,QAAQ,OAAO,UAAU,KAAK,QAAQ,SAAS,aAAa,GAAG;EAC1E,OAAO;CACT;AACF;;AAGA,SAAgB,QAAkC,MAAmC;CACnF,MAAM,QAAQ,SAAS;CACvB,IAAI,CAAC,OACH,MAAM,IAAI,MACR,0CAA0C,SAAS,UAAU,SAAS,KAAK,QAAQ,KAAK,EAC1F;CAEF,OAAO;AACT"}
@@ -1,4 +1,4 @@
1
- //#region src/format.ts
1
+ // src/format.ts
2
2
  const MAX_CACHE = 64;
3
3
  const numberCache = /* @__PURE__ */ new Map();
4
4
  const dateCache = /* @__PURE__ */ new Map();
@@ -136,7 +136,6 @@ function formatDate(format, locale) {
136
136
  const df = getDateFormat(locale, format);
137
137
  return (value) => df.format(value);
138
138
  }
139
- //#endregion
140
139
  Object.defineProperty(exports, "formatDate", {
141
140
  enumerable: true,
142
141
  get: function() {
@@ -180,4 +179,4 @@ Object.defineProperty(exports, "stepPrecision", {
180
179
  }
181
180
  });
182
181
 
183
- //# sourceMappingURL=format-B0yKXBTH.cjs.map
182
+ //# sourceMappingURL=format-CAE5ruy6.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"format-B0yKXBTH.cjs","names":[],"sources":["../src/format.ts"],"sourcesContent":["/**\n * Number and date formatting built on `Intl` — locale aware, zero bytes of\n * locale data shipped.\n *\n * Formats are plain data (`Intl` options) or functions, so chart configs stay\n * serializable (JSON attributes, SSR). Pass an explicit `locale` when\n * rendering on the server, otherwise server and browser may disagree.\n */\n\n/** Locale(s) passed to `Intl`; `undefined` uses the runtime default. */\nexport type Locale = string | readonly string[] | undefined\n\n/** `Intl.NumberFormat` options, plus suffixes of our own for compact notation. */\nexport interface NumberFormatOptions extends Intl.NumberFormatOptions {\n /**\n * Compact notation with these suffixes for thousands, millions, billions…\n * instead of the locale's words: `['k', 'M', 'G']` writes 1500 as \"1.5k\",\n * or \"1,5k\" in Polish, where the locale itself writes \"1,5 tys.\". `true`\n * stands for `['K', 'M', 'B', 'T']`. Larger numbers keep the last suffix.\n */\n compactSymbols?: boolean | readonly string[]\n}\n\n/** Number format options or a custom formatter. */\nexport type NumberFormat = NumberFormatOptions | ((value: number) => string)\n\n/** `Intl.DateTimeFormat` options or a custom formatter. */\nexport type DateFormat = Intl.DateTimeFormatOptions | ((value: Date) => string)\n\nconst MAX_CACHE = 64\nconst numberCache = /* @__PURE__ */ new Map<string, Intl.NumberFormat>()\nconst dateCache = /* @__PURE__ */ new Map<string, Intl.DateTimeFormat>()\n\nfunction cached<T>(cache: Map<string, T>, key: string, create: () => T): T {\n let value = cache.get(key)\n if (value === undefined) {\n if (cache.size >= MAX_CACHE) cache.clear()\n value = create()\n cache.set(key, value)\n }\n return value\n}\n\nfunction cacheKey(locale: Locale, options: object): string {\n return `${JSON.stringify(locale ?? null)}|${JSON.stringify(options)}`\n}\n\n/** Shared, cached `Intl.NumberFormat` instance. */\nexport function getNumberFormat(\n locale?: Locale,\n options: Intl.NumberFormatOptions = {},\n): Intl.NumberFormat {\n return cached(\n numberCache,\n cacheKey(locale, options),\n () => new Intl.NumberFormat(locale as string | string[] | undefined, options),\n )\n}\n\n/** Shared, cached `Intl.DateTimeFormat` instance. */\nexport function getDateFormat(\n locale?: Locale,\n options: Intl.DateTimeFormatOptions = {},\n): Intl.DateTimeFormat {\n return cached(\n dateCache,\n cacheKey(locale, options),\n () => new Intl.DateTimeFormat(locale as string | string[] | undefined, options),\n )\n}\n\n/** Avoid `-0` rendering as \"-0\". */\nconst unsignedZero = (value: number): number => (value === 0 ? 0 : value)\n\n/**\n * Create a number formatter.\n *\n * ```ts\n * formatNumber({ style: 'currency', currency: 'PLN' }, 'pl-PL')(1234.5) // \"1234,50 zł\"\n * ```\n */\nexport function formatNumber(format?: NumberFormat, locale?: Locale): (value: number) => string {\n if (typeof format === 'function') return format\n const { compactSymbols, ...options } = format ?? {}\n if (compactSymbols) {\n return formatCompact(compactSymbols === true ? SYMBOLS : compactSymbols, options, locale)\n }\n const nf = getNumberFormat(locale, options)\n return (value) => nf.format(unsignedZero(value))\n}\n\nconst SYMBOLS = ['K', 'M', 'B', 'T']\n\n/**\n * Compact notation with the given suffixes: the value divided by its power\n * of a thousand, formatted by `Intl` (separators, currency, sign) with the\n * suffix after the digits. Without digits of its own it rounds like `Intl`'s\n * compact notation: two significant digits below 10, whole numbers above.\n */\nfunction formatCompact(\n symbols: readonly string[],\n // `notation` and `compactDisplay` are taken out: the suffixes replace them.\n { notation, compactDisplay, ...options }: Intl.NumberFormatOptions,\n locale: Locale,\n): (value: number) => string {\n const own = digitsOf(options)\n const small = getNumberFormat(locale, own ? options : { ...options, maximumSignificantDigits: 2 })\n const large = own ? small : getNumberFormat(locale, { ...options, maximumFractionDigits: 0 })\n return (value) => {\n for (let exp = 0; ; exp++) {\n const scaled = unsignedZero(value / 1000 ** exp)\n const parts = (Math.abs(scaled) < 10 ? small : large).formatToParts(scaled)\n let digits = ''\n let last: Intl.NumberFormatPart | undefined\n for (const part of parts) {\n if (part.type === 'integer') digits += part.value\n if (part.type === 'integer' || part.type === 'fraction') last = part\n }\n // Four digits or more: a thousand times smaller, with the next suffix\n // (so 999 950 rounds up to \"1M\", not \"1000K\").\n if (digits.length < 4 || exp >= symbols.length) {\n if (exp && last) last.value += symbols[exp - 1]\n return parts.map((part) => part.value).join('')\n }\n }\n }\n}\n\n/** Whether number options write compact numbers (\"25K\"). */\nconst compactOf = (o: NumberFormatOptions): boolean =>\n o.notation === 'compact' || !!o.compactSymbols\n\n/** Whether number options set their digits (fraction or significant). */\nconst digitsOf = (o: Intl.NumberFormatOptions): boolean =>\n (o.minimumFractionDigits ??\n o.maximumFractionDigits ??\n o.minimumSignificantDigits ??\n o.maximumSignificantDigits) !== undefined\n\n/**\n * A formatter for values read one at a time (tooltips, data tables) in an\n * axis format. Compact notation suits ticks (\"$25K\") but hides the\n * difference between values: unless the format sets its own precision, it\n * keeps three significant digits (\"$24.8K\").\n */\nexport function formatDetail(format?: NumberFormat, locale?: Locale): (value: number) => string {\n return formatNumber(\n typeof format === 'object' && compactOf(format) && !digitsOf(format)\n ? { ...format, maximumSignificantDigits: 3 }\n : format,\n locale,\n )\n}\n/**\n * Number of fraction digits needed to tell apart ticks `step` apart,\n * e.g. `1 → 0`, `0.2 → 1`, `0.05 → 2`.\n */\nexport function stepPrecision(step: number): number {\n const abs = Math.abs(step)\n if (!Number.isFinite(abs) || abs === 0) return 0\n return Math.max(0, -Math.floor(Math.log10(abs) + 1e-9))\n}\n\nfunction hasPrecision(options: NumberFormatOptions): boolean {\n return (\n digitsOf(options) || !!options.compactSymbols || (options.notation ?? 'standard') !== 'standard'\n )\n}\n/**\n * Create a formatter for axis ticks `step` apart. Unless `format` sets its\n * own precision, every tick gets the same number of fraction digits, derived\n * from the step (`0, 0.5, 1` → `0.0, 0.5, 1.0`).\n */\nexport function formatTicks(\n step: number,\n format?: NumberFormat,\n locale?: Locale,\n): (value: number) => string {\n if (typeof format === 'function') return format\n const options = format ?? {}\n if (hasPrecision(options)) return formatNumber(options, locale)\n\n let digits = stepPrecision(step)\n if (options.style === 'percent') digits = Math.max(0, digits - 2)\n const fmt = formatNumber(\n { ...options, minimumFractionDigits: digits, maximumFractionDigits: digits },\n locale,\n )\n // Values within floating point noise of zero (e.g. 1e-17) print as zero.\n const epsilon = Math.abs(step) * 1e-9\n return (value) => fmt(Math.abs(value) < epsilon ? 0 : value)\n}\n\n/**\n * Create a date formatter accepting `Date` objects or timestamps.\n *\n * ```ts\n * formatDate({ month: 'short', day: 'numeric' }, 'en-US')(new Date(2026, 0, 5)) // \"Jan 5\"\n * ```\n */\nexport function formatDate(format?: DateFormat, locale?: Locale): (value: Date | number) => string {\n if (typeof format === 'function') {\n return (value) => format(typeof value === 'number' ? new Date(value) : value)\n }\n const df = getDateFormat(locale, format)\n return (value) => df.format(value)\n}\n"],"mappings":";AA6BA,MAAM,YAAY;AAClB,MAAM,8BAA8B,IAAI,IAA+B;AACvE,MAAM,4BAA4B,IAAI,IAAiC;AAEvE,SAAS,OAAU,OAAuB,KAAa,QAAoB;CACzE,IAAI,QAAQ,MAAM,IAAI,GAAG;CACzB,IAAI,UAAU,KAAA,GAAW;EACvB,IAAI,MAAM,QAAQ,WAAW,MAAM,MAAM;EACzC,QAAQ,OAAO;EACf,MAAM,IAAI,KAAK,KAAK;CACtB;CACA,OAAO;AACT;AAEA,SAAS,SAAS,QAAgB,SAAyB;CACzD,OAAO,GAAG,KAAK,UAAU,UAAU,IAAI,EAAE,GAAG,KAAK,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BAAuB;CAAO,GAC3E,MACF;CAEA,MAAM,UAAU,KAAK,IAAI,IAAI,IAAI;CACjC,QAAQ,UAAU,IAAI,KAAK,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK;AAC7D;;;;;;;;AASA,SAAgB,WAAW,QAAqB,QAAmD;CACjG,IAAI,OAAO,WAAW,YACpB,QAAQ,UAAU,OAAO,OAAO,UAAU,WAAW,IAAI,KAAK,KAAK,IAAI,KAAK;CAE9E,MAAM,KAAK,cAAc,QAAQ,MAAM;CACvC,QAAQ,UAAU,GAAG,OAAO,KAAK;AACnC"}
1
+ {"version":3,"file":"format-CAE5ruy6.cjs","names":[],"sources":["../src/format.ts"],"sourcesContent":["/**\n * Number and date formatting built on `Intl` — locale aware, zero bytes of\n * locale data shipped.\n *\n * Formats are plain data (`Intl` options) or functions, so chart configs stay\n * serializable (JSON attributes, SSR). Pass an explicit `locale` when\n * rendering on the server, otherwise server and browser may disagree.\n */\n\n/** Locale(s) passed to `Intl`; `undefined` uses the runtime default. */\nexport type Locale = string | readonly string[] | undefined\n\n/** `Intl.NumberFormat` options, plus suffixes of our own for compact notation. */\nexport interface NumberFormatOptions extends Intl.NumberFormatOptions {\n /**\n * Compact notation with these suffixes for thousands, millions, billions…\n * instead of the locale's words: `['k', 'M', 'G']` writes 1500 as \"1.5k\",\n * or \"1,5k\" in Polish, where the locale itself writes \"1,5 tys.\". `true`\n * stands for `['K', 'M', 'B', 'T']`. Larger numbers keep the last suffix.\n */\n compactSymbols?: boolean | readonly string[]\n}\n\n/** Number format options or a custom formatter. */\nexport type NumberFormat = NumberFormatOptions | ((value: number) => string)\n\n/** `Intl.DateTimeFormat` options or a custom formatter. */\nexport type DateFormat = Intl.DateTimeFormatOptions | ((value: Date) => string)\n\nconst MAX_CACHE = 64\nconst numberCache = /* @__PURE__ */ new Map<string, Intl.NumberFormat>()\nconst dateCache = /* @__PURE__ */ new Map<string, Intl.DateTimeFormat>()\n\nfunction cached<T>(cache: Map<string, T>, key: string, create: () => T): T {\n let value = cache.get(key)\n if (value === undefined) {\n if (cache.size >= MAX_CACHE) cache.clear()\n value = create()\n cache.set(key, value)\n }\n return value\n}\n\nfunction cacheKey(locale: Locale, options: object): string {\n return `${JSON.stringify(locale ?? null)}|${JSON.stringify(options)}`\n}\n\n/** Shared, cached `Intl.NumberFormat` instance. */\nexport function getNumberFormat(\n locale?: Locale,\n options: Intl.NumberFormatOptions = {},\n): Intl.NumberFormat {\n return cached(\n numberCache,\n cacheKey(locale, options),\n () => new Intl.NumberFormat(locale as string | string[] | undefined, options),\n )\n}\n\n/** Shared, cached `Intl.DateTimeFormat` instance. */\nexport function getDateFormat(\n locale?: Locale,\n options: Intl.DateTimeFormatOptions = {},\n): Intl.DateTimeFormat {\n return cached(\n dateCache,\n cacheKey(locale, options),\n () => new Intl.DateTimeFormat(locale as string | string[] | undefined, options),\n )\n}\n\n/** Avoid `-0` rendering as \"-0\". */\nconst unsignedZero = (value: number): number => (value === 0 ? 0 : value)\n\n/**\n * Create a number formatter.\n *\n * ```ts\n * formatNumber({ style: 'currency', currency: 'PLN' }, 'pl-PL')(1234.5) // \"1234,50 zł\"\n * ```\n */\nexport function formatNumber(format?: NumberFormat, locale?: Locale): (value: number) => string {\n if (typeof format === 'function') return format\n const { compactSymbols, ...options } = format ?? {}\n if (compactSymbols) {\n return formatCompact(compactSymbols === true ? SYMBOLS : compactSymbols, options, locale)\n }\n const nf = getNumberFormat(locale, options)\n return (value) => nf.format(unsignedZero(value))\n}\n\nconst SYMBOLS = ['K', 'M', 'B', 'T']\n\n/**\n * Compact notation with the given suffixes: the value divided by its power\n * of a thousand, formatted by `Intl` (separators, currency, sign) with the\n * suffix after the digits. Without digits of its own it rounds like `Intl`'s\n * compact notation: two significant digits below 10, whole numbers above.\n */\nfunction formatCompact(\n symbols: readonly string[],\n // `notation` and `compactDisplay` are taken out: the suffixes replace them.\n { notation, compactDisplay, ...options }: Intl.NumberFormatOptions,\n locale: Locale,\n): (value: number) => string {\n const own = digitsOf(options)\n const small = getNumberFormat(locale, own ? options : { ...options, maximumSignificantDigits: 2 })\n const large = own ? small : getNumberFormat(locale, { ...options, maximumFractionDigits: 0 })\n return (value) => {\n for (let exp = 0; ; exp++) {\n const scaled = unsignedZero(value / 1000 ** exp)\n const parts = (Math.abs(scaled) < 10 ? small : large).formatToParts(scaled)\n let digits = ''\n let last: Intl.NumberFormatPart | undefined\n for (const part of parts) {\n if (part.type === 'integer') digits += part.value\n if (part.type === 'integer' || part.type === 'fraction') last = part\n }\n // Four digits or more: a thousand times smaller, with the next suffix\n // (so 999 950 rounds up to \"1M\", not \"1000K\").\n if (digits.length < 4 || exp >= symbols.length) {\n if (exp && last) last.value += symbols[exp - 1]\n return parts.map((part) => part.value).join('')\n }\n }\n }\n}\n\n/** Whether number options write compact numbers (\"25K\"). */\nconst compactOf = (o: NumberFormatOptions): boolean =>\n o.notation === 'compact' || !!o.compactSymbols\n\n/** Whether number options set their digits (fraction or significant). */\nconst digitsOf = (o: Intl.NumberFormatOptions): boolean =>\n (o.minimumFractionDigits ??\n o.maximumFractionDigits ??\n o.minimumSignificantDigits ??\n o.maximumSignificantDigits) !== undefined\n\n/**\n * A formatter for values read one at a time (tooltips, data tables) in an\n * axis format. Compact notation suits ticks (\"$25K\") but hides the\n * difference between values: unless the format sets its own precision, it\n * keeps three significant digits (\"$24.8K\").\n */\nexport function formatDetail(format?: NumberFormat, locale?: Locale): (value: number) => string {\n return formatNumber(\n typeof format === 'object' && compactOf(format) && !digitsOf(format)\n ? { ...format, maximumSignificantDigits: 3 }\n : format,\n locale,\n )\n}\n/**\n * Number of fraction digits needed to tell apart ticks `step` apart,\n * e.g. `1 → 0`, `0.2 → 1`, `0.05 → 2`.\n */\nexport function stepPrecision(step: number): number {\n const abs = Math.abs(step)\n if (!Number.isFinite(abs) || abs === 0) return 0\n return Math.max(0, -Math.floor(Math.log10(abs) + 1e-9))\n}\n\nfunction hasPrecision(options: NumberFormatOptions): boolean {\n return (\n digitsOf(options) || !!options.compactSymbols || (options.notation ?? 'standard') !== 'standard'\n )\n}\n/**\n * Create a formatter for axis ticks `step` apart. Unless `format` sets its\n * own precision, every tick gets the same number of fraction digits, derived\n * from the step (`0, 0.5, 1` → `0.0, 0.5, 1.0`).\n */\nexport function formatTicks(\n step: number,\n format?: NumberFormat,\n locale?: Locale,\n): (value: number) => string {\n if (typeof format === 'function') return format\n const options = format ?? {}\n if (hasPrecision(options)) return formatNumber(options, locale)\n\n let digits = stepPrecision(step)\n if (options.style === 'percent') digits = Math.max(0, digits - 2)\n const fmt = formatNumber(\n { ...options, minimumFractionDigits: digits, maximumFractionDigits: digits },\n locale,\n )\n // Values within floating point noise of zero (e.g. 1e-17) print as zero.\n const epsilon = Math.abs(step) * 1e-9\n return (value) => fmt(Math.abs(value) < epsilon ? 0 : value)\n}\n\n/**\n * Create a date formatter accepting `Date` objects or timestamps.\n *\n * ```ts\n * formatDate({ month: 'short', day: 'numeric' }, 'en-US')(new Date(2026, 0, 5)) // \"Jan 5\"\n * ```\n */\nexport function formatDate(format?: DateFormat, locale?: Locale): (value: Date | number) => string {\n if (typeof format === 'function') {\n return (value) => format(typeof value === 'number' ? new Date(value) : value)\n }\n const df = getDateFormat(locale, format)\n return (value) => df.format(value)\n}\n"],"mappings":";AA6BA,MAAM,YAAY;AAClB,MAAM,8BAA8B,IAAI,IAA+B;AACvE,MAAM,4BAA4B,IAAI,IAAiC;AAEvE,SAAS,OAAU,OAAuB,KAAa,QAAoB;CACzE,IAAI,QAAQ,MAAM,IAAI,GAAG;CACzB,IAAI,UAAU,KAAA,GAAW;EACvB,IAAI,MAAM,QAAQ,WAAW,MAAM,MAAM;EACzC,QAAQ,OAAO;EACf,MAAM,IAAI,KAAK,KAAK;CACtB;CACA,OAAO;AACT;AAEA,SAAS,SAAS,QAAgB,SAAyB;CACzD,OAAO,GAAG,KAAK,UAAU,UAAU,IAAI,EAAE,GAAG,KAAK,UAAU,OAAO;AACpE;;AAGA,SAAgB,gBACd,QACA,UAAo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,IAAI,IAAI,IAAI;CACjC,QAAQ,UAAU,IAAI,KAAK,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK;AAC7D;;;;;;;;AASA,SAAgB,WAAW,QAAqB,QAAmD;CACjG,IAAI,OAAO,WAAW,YACpB,QAAQ,UAAU,OAAO,OAAO,UAAU,WAAW,IAAI,KAAK,KAAK,IAAI,KAAK;CAE9E,MAAM,KAAK,cAAc,QAAQ,MAAM;CACvC,QAAQ,UAAU,GAAG,OAAO,KAAK;AACnC"}
@@ -1,4 +1,4 @@
1
- //#region src/format.ts
1
+ // src/format.ts
2
2
  const MAX_CACHE = 64;
3
3
  const numberCache = /* @__PURE__ */ new Map();
4
4
  const dateCache = /* @__PURE__ */ new Map();
@@ -136,7 +136,6 @@ function formatDate(format, locale) {
136
136
  const df = getDateFormat(locale, format);
137
137
  return (value) => df.format(value);
138
138
  }
139
- //#endregion
140
139
  export { getDateFormat as a, formatTicks as i, formatDetail as n, getNumberFormat as o, formatNumber as r, stepPrecision as s, formatDate as t };
141
140
 
142
- //# sourceMappingURL=format-lStwuc1L.js.map
141
+ //# sourceMappingURL=format-it1kepFG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"format-lStwuc1L.js","names":[],"sources":["../src/format.ts"],"sourcesContent":["/**\n * Number and date formatting built on `Intl` — locale aware, zero bytes of\n * locale data shipped.\n *\n * Formats are plain data (`Intl` options) or functions, so chart configs stay\n * serializable (JSON attributes, SSR). Pass an explicit `locale` when\n * rendering on the server, otherwise server and browser may disagree.\n */\n\n/** Locale(s) passed to `Intl`; `undefined` uses the runtime default. */\nexport type Locale = string | readonly string[] | undefined\n\n/** `Intl.NumberFormat` options, plus suffixes of our own for compact notation. */\nexport interface NumberFormatOptions extends Intl.NumberFormatOptions {\n /**\n * Compact notation with these suffixes for thousands, millions, billions…\n * instead of the locale's words: `['k', 'M', 'G']` writes 1500 as \"1.5k\",\n * or \"1,5k\" in Polish, where the locale itself writes \"1,5 tys.\". `true`\n * stands for `['K', 'M', 'B', 'T']`. Larger numbers keep the last suffix.\n */\n compactSymbols?: boolean | readonly string[]\n}\n\n/** Number format options or a custom formatter. */\nexport type NumberFormat = NumberFormatOptions | ((value: number) => string)\n\n/** `Intl.DateTimeFormat` options or a custom formatter. */\nexport type DateFormat = Intl.DateTimeFormatOptions | ((value: Date) => string)\n\nconst MAX_CACHE = 64\nconst numberCache = /* @__PURE__ */ new Map<string, Intl.NumberFormat>()\nconst dateCache = /* @__PURE__ */ new Map<string, Intl.DateTimeFormat>()\n\nfunction cached<T>(cache: Map<string, T>, key: string, create: () => T): T {\n let value = cache.get(key)\n if (value === undefined) {\n if (cache.size >= MAX_CACHE) cache.clear()\n value = create()\n cache.set(key, value)\n }\n return value\n}\n\nfunction cacheKey(locale: Locale, options: object): string {\n return `${JSON.stringify(locale ?? null)}|${JSON.stringify(options)}`\n}\n\n/** Shared, cached `Intl.NumberFormat` instance. */\nexport function getNumberFormat(\n locale?: Locale,\n options: Intl.NumberFormatOptions = {},\n): Intl.NumberFormat {\n return cached(\n numberCache,\n cacheKey(locale, options),\n () => new Intl.NumberFormat(locale as string | string[] | undefined, options),\n )\n}\n\n/** Shared, cached `Intl.DateTimeFormat` instance. */\nexport function getDateFormat(\n locale?: Locale,\n options: Intl.DateTimeFormatOptions = {},\n): Intl.DateTimeFormat {\n return cached(\n dateCache,\n cacheKey(locale, options),\n () => new Intl.DateTimeFormat(locale as string | string[] | undefined, options),\n )\n}\n\n/** Avoid `-0` rendering as \"-0\". */\nconst unsignedZero = (value: number): number => (value === 0 ? 0 : value)\n\n/**\n * Create a number formatter.\n *\n * ```ts\n * formatNumber({ style: 'currency', currency: 'PLN' }, 'pl-PL')(1234.5) // \"1234,50 zł\"\n * ```\n */\nexport function formatNumber(format?: NumberFormat, locale?: Locale): (value: number) => string {\n if (typeof format === 'function') return format\n const { compactSymbols, ...options } = format ?? {}\n if (compactSymbols) {\n return formatCompact(compactSymbols === true ? SYMBOLS : compactSymbols, options, locale)\n }\n const nf = getNumberFormat(locale, options)\n return (value) => nf.format(unsignedZero(value))\n}\n\nconst SYMBOLS = ['K', 'M', 'B', 'T']\n\n/**\n * Compact notation with the given suffixes: the value divided by its power\n * of a thousand, formatted by `Intl` (separators, currency, sign) with the\n * suffix after the digits. Without digits of its own it rounds like `Intl`'s\n * compact notation: two significant digits below 10, whole numbers above.\n */\nfunction formatCompact(\n symbols: readonly string[],\n // `notation` and `compactDisplay` are taken out: the suffixes replace them.\n { notation, compactDisplay, ...options }: Intl.NumberFormatOptions,\n locale: Locale,\n): (value: number) => string {\n const own = digitsOf(options)\n const small = getNumberFormat(locale, own ? options : { ...options, maximumSignificantDigits: 2 })\n const large = own ? small : getNumberFormat(locale, { ...options, maximumFractionDigits: 0 })\n return (value) => {\n for (let exp = 0; ; exp++) {\n const scaled = unsignedZero(value / 1000 ** exp)\n const parts = (Math.abs(scaled) < 10 ? small : large).formatToParts(scaled)\n let digits = ''\n let last: Intl.NumberFormatPart | undefined\n for (const part of parts) {\n if (part.type === 'integer') digits += part.value\n if (part.type === 'integer' || part.type === 'fraction') last = part\n }\n // Four digits or more: a thousand times smaller, with the next suffix\n // (so 999 950 rounds up to \"1M\", not \"1000K\").\n if (digits.length < 4 || exp >= symbols.length) {\n if (exp && last) last.value += symbols[exp - 1]\n return parts.map((part) => part.value).join('')\n }\n }\n }\n}\n\n/** Whether number options write compact numbers (\"25K\"). */\nconst compactOf = (o: NumberFormatOptions): boolean =>\n o.notation === 'compact' || !!o.compactSymbols\n\n/** Whether number options set their digits (fraction or significant). */\nconst digitsOf = (o: Intl.NumberFormatOptions): boolean =>\n (o.minimumFractionDigits ??\n o.maximumFractionDigits ??\n o.minimumSignificantDigits ??\n o.maximumSignificantDigits) !== undefined\n\n/**\n * A formatter for values read one at a time (tooltips, data tables) in an\n * axis format. Compact notation suits ticks (\"$25K\") but hides the\n * difference between values: unless the format sets its own precision, it\n * keeps three significant digits (\"$24.8K\").\n */\nexport function formatDetail(format?: NumberFormat, locale?: Locale): (value: number) => string {\n return formatNumber(\n typeof format === 'object' && compactOf(format) && !digitsOf(format)\n ? { ...format, maximumSignificantDigits: 3 }\n : format,\n locale,\n )\n}\n/**\n * Number of fraction digits needed to tell apart ticks `step` apart,\n * e.g. `1 → 0`, `0.2 → 1`, `0.05 → 2`.\n */\nexport function stepPrecision(step: number): number {\n const abs = Math.abs(step)\n if (!Number.isFinite(abs) || abs === 0) return 0\n return Math.max(0, -Math.floor(Math.log10(abs) + 1e-9))\n}\n\nfunction hasPrecision(options: NumberFormatOptions): boolean {\n return (\n digitsOf(options) || !!options.compactSymbols || (options.notation ?? 'standard') !== 'standard'\n )\n}\n/**\n * Create a formatter for axis ticks `step` apart. Unless `format` sets its\n * own precision, every tick gets the same number of fraction digits, derived\n * from the step (`0, 0.5, 1` → `0.0, 0.5, 1.0`).\n */\nexport function formatTicks(\n step: number,\n format?: NumberFormat,\n locale?: Locale,\n): (value: number) => string {\n if (typeof format === 'function') return format\n const options = format ?? {}\n if (hasPrecision(options)) return formatNumber(options, locale)\n\n let digits = stepPrecision(step)\n if (options.style === 'percent') digits = Math.max(0, digits - 2)\n const fmt = formatNumber(\n { ...options, minimumFractionDigits: digits, maximumFractionDigits: digits },\n locale,\n )\n // Values within floating point noise of zero (e.g. 1e-17) print as zero.\n const epsilon = Math.abs(step) * 1e-9\n return (value) => fmt(Math.abs(value) < epsilon ? 0 : value)\n}\n\n/**\n * Create a date formatter accepting `Date` objects or timestamps.\n *\n * ```ts\n * formatDate({ month: 'short', day: 'numeric' }, 'en-US')(new Date(2026, 0, 5)) // \"Jan 5\"\n * ```\n */\nexport function formatDate(format?: DateFormat, locale?: Locale): (value: Date | number) => string {\n if (typeof format === 'function') {\n return (value) => format(typeof value === 'number' ? new Date(value) : value)\n }\n const df = getDateFormat(locale, format)\n return (value) => df.format(value)\n}\n"],"mappings":";AA6BA,MAAM,YAAY;AAClB,MAAM,8BAA8B,IAAI,IAA+B;AACvE,MAAM,4BAA4B,IAAI,IAAiC;AAEvE,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gB,YACd,MACA,QACA,QAC2B;CAC3B,IAAI,OAAO,WAAW,YAAY,OAAO;CACzC,MAAM,UAAU,UAAU,CAAC;CAC3B,IAAI,aAAa,OAAO,GAAG,OAAO,aAAa,SAAS,MAAM;CAE9D,IAAI,SAAS,cAAc,IAAI;CAC/B,IAAI,QAAQ,UAAU,WAAW,SAAS,KAAK,IAAI,GAAG,SAAS,CAAC;CAChE,MAAM,MAAM,aACV;EAAE,GAAG;EAAS,uBAAuB;EAAQ,uBAAuB;CAAO,GAC3E,MACF;CAEA,MAAM,UAAU,KAAK,IAAI,IAAI,IAAI;CACjC,QAAQ,UAAU,IAAI,KAAK,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK;AAC7D;;;;;;;;AASA,SAAgB,WAAW,QAAqB,QAAmD;CACjG,IAAI,OAAO,WAAW,YACpB,QAAQ,UAAU,OAAO,OAAO,UAAU,WAAW,IAAI,KAAK,KAAK,IAAI,KAAK;CAE9E,MAAM,KAAK,cAAc,QAAQ,MAAM;CACvC,QAAQ,UAAU,GAAG,OAAO,KAAK;AACnC"}
1
+ {"version":3,"file":"format-it1kepFG.js","names":[],"sources":["../src/format.ts"],"sourcesContent":["/**\n * Number and date formatting built on `Intl` — locale aware, zero bytes of\n * locale data shipped.\n *\n * Formats are plain data (`Intl` options) or functions, so chart configs stay\n * serializable (JSON attributes, SSR). Pass an explicit `locale` when\n * rendering on the server, otherwise server and browser may disagree.\n */\n\n/** Locale(s) passed to `Intl`; `undefined` uses the runtime default. */\nexport type Locale = string | readonly string[] | undefined\n\n/** `Intl.NumberFormat` options, plus suffixes of our own for compact notation. */\nexport interface NumberFormatOptions extends Intl.NumberFormatOptions {\n /**\n * Compact notation with these suffixes for thousands, millions, billions…\n * instead of the locale's words: `['k', 'M', 'G']` writes 1500 as \"1.5k\",\n * or \"1,5k\" in Polish, where the locale itself writes \"1,5 tys.\". `true`\n * stands for `['K', 'M', 'B', 'T']`. Larger numbers keep the last suffix.\n */\n compactSymbols?: boolean | readonly string[]\n}\n\n/** Number format options or a custom formatter. */\nexport type NumberFormat = NumberFormatOptions | ((value: number) => string)\n\n/** `Intl.DateTimeFormat` options or a custom formatter. */\nexport type DateFormat = Intl.DateTimeFormatOptions | ((value: Date) => string)\n\nconst MAX_CACHE = 64\nconst numberCache = /* @__PURE__ */ new Map<string, Intl.NumberFormat>()\nconst dateCache = /* @__PURE__ */ new Map<string, Intl.DateTimeFormat>()\n\nfunction cached<T>(cache: Map<string, T>, key: string, create: () => T): T {\n let value = cache.get(key)\n if (value === undefined) {\n if (cache.size >= MAX_CACHE) cache.clear()\n value = create()\n cache.set(key, value)\n }\n return value\n}\n\nfunction cacheKey(locale: Locale, options: object): string {\n return `${JSON.stringify(locale ?? null)}|${JSON.stringify(options)}`\n}\n\n/** Shared, cached `Intl.NumberFormat` instance. */\nexport function getNumberFormat(\n locale?: Locale,\n options: Intl.NumberFormatOptions = {},\n): Intl.NumberFormat {\n return cached(\n numberCache,\n cacheKey(locale, options),\n () => new Intl.NumberFormat(locale as string | string[] | undefined, options),\n )\n}\n\n/** Shared, cached `Intl.DateTimeFormat` instance. */\nexport function getDateFormat(\n locale?: Locale,\n options: Intl.DateTimeFormatOptions = {},\n): Intl.DateTimeFormat {\n return cached(\n dateCache,\n cacheKey(locale, options),\n () => new Intl.DateTimeFormat(locale as string | string[] | undefined, options),\n )\n}\n\n/** Avoid `-0` rendering as \"-0\". */\nconst unsignedZero = (value: number): number => (value === 0 ? 0 : value)\n\n/**\n * Create a number formatter.\n *\n * ```ts\n * formatNumber({ style: 'currency', currency: 'PLN' }, 'pl-PL')(1234.5) // \"1234,50 zł\"\n * ```\n */\nexport function formatNumber(format?: NumberFormat, locale?: Locale): (value: number) => string {\n if (typeof format === 'function') return format\n const { compactSymbols, ...options } = format ?? {}\n if (compactSymbols) {\n return formatCompact(compactSymbols === true ? SYMBOLS : compactSymbols, options, locale)\n }\n const nf = getNumberFormat(locale, options)\n return (value) => nf.format(unsignedZero(value))\n}\n\nconst SYMBOLS = ['K', 'M', 'B', 'T']\n\n/**\n * Compact notation with the given suffixes: the value divided by its power\n * of a thousand, formatted by `Intl` (separators, currency, sign) with the\n * suffix after the digits. Without digits of its own it rounds like `Intl`'s\n * compact notation: two significant digits below 10, whole numbers above.\n */\nfunction formatCompact(\n symbols: readonly string[],\n // `notation` and `compactDisplay` are taken out: the suffixes replace them.\n { notation, compactDisplay, ...options }: Intl.NumberFormatOptions,\n locale: Locale,\n): (value: number) => string {\n const own = digitsOf(options)\n const small = getNumberFormat(locale, own ? options : { ...options, maximumSignificantDigits: 2 })\n const large = own ? small : getNumberFormat(locale, { ...options, maximumFractionDigits: 0 })\n return (value) => {\n for (let exp = 0; ; exp++) {\n const scaled = unsignedZero(value / 1000 ** exp)\n const parts = (Math.abs(scaled) < 10 ? small : large).formatToParts(scaled)\n let digits = ''\n let last: Intl.NumberFormatPart | undefined\n for (const part of parts) {\n if (part.type === 'integer') digits += part.value\n if (part.type === 'integer' || part.type === 'fraction') last = part\n }\n // Four digits or more: a thousand times smaller, with the next suffix\n // (so 999 950 rounds up to \"1M\", not \"1000K\").\n if (digits.length < 4 || exp >= symbols.length) {\n if (exp && last) last.value += symbols[exp - 1]\n return parts.map((part) => part.value).join('')\n }\n }\n }\n}\n\n/** Whether number options write compact numbers (\"25K\"). */\nconst compactOf = (o: NumberFormatOptions): boolean =>\n o.notation === 'compact' || !!o.compactSymbols\n\n/** Whether number options set their digits (fraction or significant). */\nconst digitsOf = (o: Intl.NumberFormatOptions): boolean =>\n (o.minimumFractionDigits ??\n o.maximumFractionDigits ??\n o.minimumSignificantDigits ??\n o.maximumSignificantDigits) !== undefined\n\n/**\n * A formatter for values read one at a time (tooltips, data tables) in an\n * axis format. Compact notation suits ticks (\"$25K\") but hides the\n * difference between values: unless the format sets its own precision, it\n * keeps three significant digits (\"$24.8K\").\n */\nexport function formatDetail(format?: NumberFormat, locale?: Locale): (value: number) => string {\n return formatNumber(\n typeof format === 'object' && compactOf(format) && !digitsOf(format)\n ? { ...format, maximumSignificantDigits: 3 }\n : format,\n locale,\n )\n}\n/**\n * Number of fraction digits needed to tell apart ticks `step` apart,\n * e.g. `1 → 0`, `0.2 → 1`, `0.05 → 2`.\n */\nexport function stepPrecision(step: number): number {\n const abs = Math.abs(step)\n if (!Number.isFinite(abs) || abs === 0) return 0\n return Math.max(0, -Math.floor(Math.log10(abs) + 1e-9))\n}\n\nfunction hasPrecision(options: NumberFormatOptions): boolean {\n return (\n digitsOf(options) || !!options.compactSymbols || (options.notation ?? 'standard') !== 'standard'\n )\n}\n/**\n * Create a formatter for axis ticks `step` apart. Unless `format` sets its\n * own precision, every tick gets the same number of fraction digits, derived\n * from the step (`0, 0.5, 1` → `0.0, 0.5, 1.0`).\n */\nexport function formatTicks(\n step: number,\n format?: NumberFormat,\n locale?: Locale,\n): (value: number) => string {\n if (typeof format === 'function') return format\n const options = format ?? {}\n if (hasPrecision(options)) return formatNumber(options, locale)\n\n let digits = stepPrecision(step)\n if (options.style === 'percent') digits = Math.max(0, digits - 2)\n const fmt = formatNumber(\n { ...options, minimumFractionDigits: digits, maximumFractionDigits: digits },\n locale,\n )\n // Values within floating point noise of zero (e.g. 1e-17) print as zero.\n const epsilon = Math.abs(step) * 1e-9\n return (value) => fmt(Math.abs(value) < epsilon ? 0 : value)\n}\n\n/**\n * Create a date formatter accepting `Date` objects or timestamps.\n *\n * ```ts\n * formatDate({ month: 'short', day: 'numeric' }, 'en-US')(new Date(2026, 0, 5)) // \"Jan 5\"\n * ```\n */\nexport function formatDate(format?: DateFormat, locale?: Locale): (value: Date | number) => string {\n if (typeof format === 'function') {\n return (value) => format(typeof value === 'number' ? new Date(value) : value)\n }\n const df = getDateFormat(locale, format)\n return (value) => df.format(value)\n}\n"],"mappings":";AA6BA,MAAM,YAAY;AAClB,MAAM,8BAA8B,IAAI,IAA+B;AACvE,MAAM,4BAA4B,IAAI,IAAiC;AAEvE,SAAS,OAAU,OAAuB,KAAa,QAAoB;CACzE,IAAI,QAAQ,M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AY,OAAO;CACzC,MAAM,UAAU,UAAU,CAAC;CAC3B,IAAI,aAAa,OAAO,GAAG,OAAO,aAAa,SAAS,MAAM;CAE9D,IAAI,SAAS,cAAc,IAAI;CAC/B,IAAI,QAAQ,UAAU,WAAW,SAAS,KAAK,IAAI,GAAG,SAAS,CAAC;CAChE,MAAM,MAAM,aACV;EAAE,GAAG;EAAS,uBAAuB;EAAQ,uBAAuB;CAAO,GAC3E,MACF;CAEA,MAAM,UAAU,KAAK,IAAI,IAAI,IAAI;CACjC,QAAQ,UAAU,IAAI,KAAK,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK;AAC7D;;;;;;;;AASA,SAAgB,WAAW,QAAqB,QAAmD;CACjG,IAAI,OAAO,WAAW,YACpB,QAAQ,UAAU,OAAO,OAAO,UAAU,WAAW,IAAI,KAAK,KAAK,IAAI,KAAK;CAE9E,MAAM,KAAK,cAAc,QAAQ,MAAM;CACvC,QAAQ,UAAU,GAAG,OAAO,KAAK;AACnC"}
@@ -1,8 +1,7 @@
1
- import { a as InsetsInput } from "./annotations-Bp7HwtF5.js";
2
- import { a as ClassValue } from "./vnode-BUflsBsa.js";
3
- import { a as ChartType } from "./chart-iJGxMz9z.js";
4
- import { c as NumberFormat } from "./time-CHjiY9Q4.js";
5
- //#region src/charts/gauge.d.ts
1
+ import { a as ChartType } from "./chart-QilhWP8Z.js";
2
+ import { c as NumberFormat } from "./time-DRIDgv2a.js";
3
+ import { a as InsetsInput } from "./annotations-B02GR_KU.js";
4
+ import { a as ClassValue } from "./vnode-Du2cC8Fm.js";
6
5
  /** One ring of a gauge. */
7
6
  interface GaugeRing {
8
7
  name: string;
@@ -60,6 +59,4 @@ interface GaugeOptions {
60
59
  * ```
61
60
  */
62
61
  declare const gauge: ChartType<GaugeOptions>;
63
- //#endregion
64
- export { GaugeRing as n, gauge as r, GaugeOptions as t };
65
- //# sourceMappingURL=gauge-Cu9jttC0.d.ts.map
62
+ export { GaugeRing as n, gauge as r, GaugeOptions as t };
@@ -1,8 +1,7 @@
1
- import { a as InsetsInput } from "./annotations-lyt0I3HU.cjs";
2
- import { a as ClassValue } from "./vnode-BUflsBsa.cjs";
3
- import { a as ChartType } from "./chart-Qa417fJo.cjs";
4
- import { c as NumberFormat } from "./time-CNVnt-B2.cjs";
5
- //#region src/charts/gauge.d.ts
1
+ import { a as ChartType } from "./chart-kqFMEwDo.cjs";
2
+ import { c as NumberFormat } from "./time-B4oxWHQI.cjs";
3
+ import { a as InsetsInput } from "./annotations-CHafaGd4.cjs";
4
+ import { a as ClassValue } from "./vnode-Du2cC8Fm.cjs";
6
5
  /** One ring of a gauge. */
7
6
  interface GaugeRing {
8
7
  name: string;
@@ -60,6 +59,4 @@ interface GaugeOptions {
60
59
  * ```
61
60
  */
62
61
  declare const gauge: ChartType<GaugeOptions>;
63
- //#endregion
64
- export { GaugeRing as n, gauge as r, GaugeOptions as t };
65
- //# sourceMappingURL=gauge-Cu_OFxBd.d.cts.map
62
+ export { GaugeRing as n, gauge as r, GaugeOptions as t };
@@ -1,11 +1,12 @@
1
- const require_layout = require("./layout-CtMBhNd9.cjs");
2
- const require_vnode = require("./vnode-CkQ27Cxe.cjs");
3
- const require_format = require("./format-B0yKXBTH.cjs");
4
- const require_features = require("./features-BclHgg2W.cjs");
5
- const require_clean = require("./clean-Byl6kzf0.cjs");
6
- const require_named = require("./named-BWWb5LQJ.cjs");
7
- const require_sweep = require("./sweep-Duowaput.cjs");
8
- //#region src/charts/gauge.ts
1
+ const require_features = require("./features-DCXEvoya.cjs");
2
+ const require_format = require("./format-CAE5ruy6.cjs");
3
+ const require_layout = require("./layout-JY2aR-yE.cjs");
4
+ const require_sweep = require("./sweep-Dnp6LDBz.cjs");
5
+ const require_arc = require("./arc-CYhI62kO.cjs");
6
+ const require_vnode = require("./vnode-ClAiw28x.cjs");
7
+ const require_clean = require("./clean-Die2iCNc.cjs");
8
+ const require_named = require("./named-BBASc8dW.cjs");
9
+ // src/charts/gauge.ts
9
10
  /** Space kept around the gauge for the hover halo. */
10
11
  const HALF_PI = Math.PI / 2;
11
12
  function ringsOf(options) {
@@ -84,8 +85,8 @@ function renderGauge(options, ctx) {
84
85
  bottom: pad.bottom + 8,
85
86
  left: pad.left + 8
86
87
  });
87
- const start = (options.startAngle ?? 0) * require_sweep.DEG;
88
- const sweep = Math.min(360, Math.max(0, options.angle ?? 360)) * require_sweep.DEG;
88
+ const start = (options.startAngle ?? 0) * require_arc.DEG;
89
+ const sweep = Math.min(360, Math.max(0, options.angle ?? 360)) * require_arc.DEG;
89
90
  const rings = layoutRings(options, ctx.hidden);
90
91
  const center = options.center;
91
92
  const first = rings[0];
@@ -112,7 +113,7 @@ function renderGauge(options, ctx) {
112
113
  cornerRadius
113
114
  });
114
115
  const hitFor = (ring) => {
115
- const [x, y] = require_sweep.arcCentroid(geometry(ring));
116
+ const [x, y] = require_arc.arcCentroid(geometry(ring));
116
117
  const item = {
117
118
  name: ring.data.name,
118
119
  seriesIndex: ring.index,
@@ -136,7 +137,7 @@ function renderGauge(options, ctx) {
136
137
  items: [item],
137
138
  seriesIndex: ring.index,
138
139
  mark: {
139
- d: require_sweep.arcPathStable(geometry(ring, 2)),
140
+ d: require_arc.arcPathStable(geometry(ring, 2)),
140
141
  x: cx,
141
142
  y: cy
142
143
  }
@@ -224,7 +225,6 @@ const gauge = {
224
225
  legend: (options) => require_named.legendItems(ringsOf(options)),
225
226
  table: gaugeTable
226
227
  };
227
- //#endregion
228
228
  Object.defineProperty(exports, "gauge", {
229
229
  enumerable: true,
230
230
  get: function() {
@@ -232,4 +232,4 @@ Object.defineProperty(exports, "gauge", {
232
232
  }
233
233
  });
234
234
 
235
- //# sourceMappingURL=gauge-CEfkWXSu.cjs.map
235
+ //# sourceMappingURL=gauge-DXkjXNCD.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gauge-DXkjXNCD.cjs","names":["keyOf","insets","innerRect","DEG","formatNumber","getNumberFormat","arcCentroid","arcPathStable","h","groupAttrs","arcNode","cleanData","cleanItems","isRecord","features","sweepArcs","legendItems"],"sources":["../src/charts/gauge.ts"],"sourcesContent":["import type { DataTable } from '../a11y.ts'\nimport type { ChartType, RenderContext } from '../chart.ts'\nimport { features } from '../features.ts'\nimport { formatNumber, getNumberFormat, type NumberFormat } from '../format.ts'\nimport type { Hit, HitItem, Interaction } from '../interaction.ts'\nimport { type InsetsInput, innerRect, insets } from '../layout.ts'\nimport { arcNode, sweep as sweepArcs } from '../render/sweep.ts'\nimport { arcCentroid, arcPathStable, DEG, HALO } from '../shapes/arc.ts'\nimport { type ChildInput, type ClassValue, h } from '../vnode.ts'\nimport { cleanData, cleanItems, isRecord } from './clean.ts'\nimport { groupAttrs, keyOf, legendItems } from './named.ts'\n\n/** One ring of a gauge. */\nexport interface GaugeRing {\n name: string\n /** Current value, clamped to `0…max`. */\n value: number\n /** Full-ring value of this ring; overrides `GaugeOptions.max`. */\n max?: number\n /** Stable identity for keyed updates and legend toggles. 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 /** Extra classes on the ring group. */\n class?: ClassValue\n /** Start hidden (toggle it back from the legend). */\n hidden?: boolean\n}\n\nexport interface GaugeOptions {\n /** A single value, one ring, or concentric rings (outermost first). */\n data: number | GaugeRing | readonly GaugeRing[]\n /** Full-ring value. Defaults to `100`. */\n max?: number\n /** Where the arc starts, in degrees clockwise from 12 o'clock. Defaults to `0`. */\n startAngle?: number\n /** Degrees the full ring spans, `0…360`. Defaults to `360`; use e.g. `270` for a dial. */\n angle?: number\n /** Ring thickness in pixels. Defaults to `12`. */\n thickness?: number\n /** Space between rings in pixels. Defaults to `4`. */\n gap?: number\n /** Corner radius of the arcs. Defaults to half the thickness (round caps). */\n cornerRadius?: number\n /** Format of the values (tooltip, table). */\n format?: NumberFormat\n /**\n * Text in the middle: the first ring's share of `max` and its name by\n * default; `false` hides it, or give your own `value` / `label`.\n */\n center?: false | { value?: string; label?: string }\n /** Extra space around the gauge, in pixels. */\n padding?: InsetsInput\n}\n\n/** Space kept around the gauge for the hover halo. */\nconst HALF_PI = Math.PI / 2\n\ninterface Ring {\n data: GaugeRing\n index: number\n value: number\n max: number\n /** Slot among the visible rings, from the outside in. */\n position: number\n}\n\nfunction ringsOf(options: GaugeOptions): GaugeRing[] {\n const { data } = options\n if (typeof data === 'number') return [{ name: '', value: data }]\n return Array.isArray(data) ? (data as GaugeRing[]) : [data as GaugeRing]\n}\n\n/** The visible rings with clamped values. */\nfunction layoutRings(options: GaugeOptions, hidden: ReadonlySet<string>): Ring[] {\n const max = options.max ?? 100\n return ringsOf(options)\n .map((data, index) => ({ data, index, max: data.max ?? max }))\n .filter((ring) => !hidden.has(keyOf(ring.data)))\n .map((ring, position) => ({\n ...ring,\n position,\n value: Math.min(ring.max, Math.max(0, ring.data.value || 0)),\n }))\n}\n\n/**\n * Radius and center that fit the swept ring (plus the text in the middle)\n * into `area`: a dial or half ring is centered by its own outline, not by\n * the full circle it is cut from.\n */\nfunction fitGauge(\n area: { x: number; y: number; width: number; height: number },\n start: number,\n sweep: number,\n textTop: number,\n textBottom: number,\n): { outer: number; cx: number; cy: number } {\n // Points of the outline, in units of the outer radius: both ends of the arc\n // and every axis extreme it passes; the origin covers the inner edge.\n const unit: [number, number][] = [[0, 0]]\n const end = start + sweep\n unit.push([Math.sin(start), -Math.cos(start)], [Math.sin(end), -Math.cos(end)])\n // (At most a full turn of them: a huge start angle is beyond what adding a quarter turn changes.)\n for (let a = Math.ceil(start / HALF_PI) * HALF_PI, n = 0; n < 5 && a <= end + 1e-9; n++) {\n unit.push([Math.sin(a), -Math.cos(a)])\n a += HALF_PI\n }\n let outer = Math.min(area.width, area.height) / 2\n let box = { x0: 0, y0: 0, x1: 0, y1: 0 }\n // The text does not scale with the radius, so converge in a few rounds.\n for (let i = 0; i < 4; i++) {\n box = { x0: 0, y0: textTop, x1: 0, y1: textBottom }\n for (const [x, y] of unit) {\n box.x0 = Math.min(box.x0, x * outer)\n box.x1 = Math.max(box.x1, x * outer)\n box.y0 = Math.min(box.y0, y * outer)\n box.y1 = Math.max(box.y1, y * outer)\n }\n const scale = Math.min(area.width / (box.x1 - box.x0), area.height / (box.y1 - box.y0))\n if (Math.abs(scale - 1) < 1e-3) break\n outer = Math.max(0, outer * scale)\n }\n return {\n outer,\n cx: area.x + (area.width - (box.x1 - box.x0)) / 2 - box.x0,\n cy: area.y + (area.height - (box.y1 - box.y0)) / 2 - box.y0,\n }\n}\n\nfunction renderGauge(options: GaugeOptions, ctx: RenderContext): ChildInput {\n const { width, height, locale } = ctx\n const thickness = Math.max(1, options.thickness ?? 12)\n const gap = Math.max(0, options.gap ?? 4)\n const cornerRadius = options.cornerRadius ?? thickness / 2\n const pad = insets(options.padding, 0)\n const area = innerRect(width, height, {\n top: pad.top + HALO,\n right: pad.right + HALO,\n bottom: pad.bottom + HALO,\n left: pad.left + HALO,\n })\n const start = (options.startAngle ?? 0) * DEG\n const sweep = Math.min(360, Math.max(0, options.angle ?? 360)) * DEG\n const rings = layoutRings(options, ctx.hidden)\n const center = options.center\n const first = rings[0]\n const showCenter = center !== false && first !== undefined\n const centerLabel = showCenter ? (center?.label ?? (first.data.name || undefined)) : undefined\n const { outer, cx, cy } = fitGauge(\n area,\n start,\n sweep,\n showCenter ? -1.4 * ctx.fontSize : 0,\n showCenter ? (centerLabel ? 2 : 0.7) * ctx.fontSize : 0,\n )\n const value = formatNumber(options.format, locale)\n const share = getNumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 })\n\n const radii = (ring: Ring, grow = 0) => {\n const r1 = Math.max(0, outer - ring.position * (thickness + gap))\n return { innerRadius: Math.max(0, r1 - thickness - grow), outerRadius: r1 + grow }\n }\n const fraction = (ring: Ring) => (ring.max > 0 ? ring.value / ring.max : 0)\n const geometry = (ring: Ring, grow = 0) => ({\n ...radii(ring, grow),\n startAngle: start,\n endAngle: start + sweep * fraction(ring),\n cornerRadius,\n })\n\n const hitFor = (ring: Ring): Hit => {\n const [x, y] = arcCentroid(geometry(ring))\n const item: HitItem = {\n name: ring.data.name,\n seriesIndex: ring.index,\n value: ring.value,\n text: `${value(ring.value)} (${share.format(fraction(ring))})`,\n x: cx + x,\n y: cy + y,\n }\n if (ring.data.color) item.color = ring.data.color\n return {\n index: ring.position,\n label: ring.data.name,\n title: '',\n x: cx + x,\n area: { x: cx - outer, y: cy - outer, width: outer * 2, height: outer * 2 },\n items: [item],\n seriesIndex: ring.index,\n // The value arc, slightly enlarged.\n mark: { d: arcPathStable(geometry(ring, 2)), x: cx, y: cy },\n }\n }\n\n const interaction: Interaction = {\n count: rings.length,\n hitIndex: (position) => {\n const ring = rings[position]\n return ring ? hitFor(ring) : null\n },\n hitTest(px, py) {\n const r = Math.hypot(px - cx, py - cy)\n const ring = rings.find((ring) => {\n const { innerRadius, outerRadius } = radii(ring, 2)\n return r >= innerRadius && r <= outerRadius\n })\n return ring ? hitFor(ring) : null\n },\n }\n ctx.onHitTest(interaction)\n\n const groups = rings.map((ring) =>\n h(\n 'g',\n groupAttrs(ring.data, ring.index),\n // Each path keeps its arc, so a new value (or a new shape of the gauge)\n // sweeps it around the center (see `sweep`).\n arcNode('tc-gauge-track', { ...geometry(ring), endAngle: start + sweep }),\n arcNode('tc-gauge-arc', geometry(ring)),\n ),\n )\n\n const centerValue = showCenter ? (center?.value ?? share.format(fraction(first))) : ''\n\n return [\n // Rings sit in their own group: the entrance animation transforms it, not the translated parent.\n h(\n 'g',\n { class: 'tc-gauge', style: `transform:translate(${cx}px,${cy}px)` },\n h('g', { class: 'tc-gauge-rings' }, groups),\n ),\n showCenter &&\n h(\n 'g',\n { class: 'tc-gauge-center', 'aria-hidden': 'true' },\n h(\n 'text',\n {\n class: 'tc-gauge-value',\n x: cx,\n y: cy,\n dy: centerLabel ? '0' : '0.35em',\n 'text-anchor': 'middle',\n },\n centerValue,\n ),\n centerLabel &&\n h(\n 'text',\n { class: 'tc-gauge-label', x: cx, y: cy, dy: '1.6em', 'text-anchor': 'middle' },\n centerLabel,\n ),\n ),\n ]\n}\n\nfunction gaugeTable(options: GaugeOptions, ctx: RenderContext): DataTable {\n const value = formatNumber(options.format, ctx.locale)\n const share = getNumberFormat(ctx.locale, { style: 'percent', maximumFractionDigits: 1 })\n return {\n columns: ['', 'Value', 'Share'],\n rows: layoutRings(options, ctx.hidden).map((ring) => [\n ring.data.name,\n value(ring.value),\n share.format(ring.max > 0 ? ring.value / ring.max : 0),\n ]),\n }\n}\n\n/**\n * Gauge (radial bar): progress towards a maximum as an arc on a track, with\n * the share in the middle. Several rings nest from the outside in.\n *\n * ```ts\n * new Chart('#el', { type: gauge, data: 58 })\n * new Chart('#el', { type: gauge, data: { name: 'completed', value: 1392, max: 2400 } })\n * ```\n */\nexport const gauge: ChartType<GaugeOptions> = {\n name: 'gauge',\n clean: cleanData((data) =>\n cleanItems(\n typeof data === 'number' ? [{ name: '', value: data }] : isRecord(data) ? [data] : data,\n ),\n ),\n render: (options, ctx): ChildInput => {\n // Set here, not as the module loads (see pie).\n features.sweep = sweepArcs\n return renderGauge(options, ctx)\n },\n legend: (options) => legendItems(ringsOf(options)),\n table: gaugeTable,\n}\n"],"mappings":";;;;;;;;;;AA2DA,MAAM,UAAU,KAAK,KAAK;AAW1B,SAAS,QAAQ,SAAoC;CACnD,MAAM,EAAE,SAAS;CACjB,IAAI,OAAO,SAAS,UAAU,OAAO,CAAC;EAAE,MAAM;EAAI,OAAO;CAAK,CAAC;CAC/D,OAAO,MAAM,QAAQ,IAAI,IAAK,OAAuB,CAAC,IAAiB;AACzE;;AAGA,SAAS,YAAY,SAAuB,QAAqC;CAC/E,MAAM,MAAM,QAAQ,OAAO;CAC3B,OAAO,QAAQ,OAAO,CAAC,CACpB,KAAK,MAAM,WAAW;EAAE;EAAM;EAAO,KAAK,KAAK,OAAO;CAAI,EAAE,CAAC,CAC7D,QAAQ,SAAS,CAAC,OAAO,IAAIA,cAAAA,MAAM,KAAK,IAAI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