@tabler/charts 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/README.md +92 -4
  2. package/dist/{annotations-Bp7HwtF5.d.ts → annotations-B02GR_KU.d.ts} +3 -8
  3. package/dist/{annotations-BszTTjf9.js → annotations-BQ8l-qHs.js} +6 -7
  4. package/dist/{annotations-BszTTjf9.js.map → annotations-BQ8l-qHs.js.map} +1 -1
  5. package/dist/{annotations-lyt0I3HU.d.cts → annotations-CHafaGd4.d.cts} +3 -8
  6. package/dist/{annotations-DpETO8dE.cjs → annotations-CpCWA29b.cjs} +6 -7
  7. package/dist/{annotations-DpETO8dE.cjs.map → annotations-CpCWA29b.cjs.map} +1 -1
  8. package/dist/annotations.cjs +3 -5
  9. package/dist/annotations.cjs.map +1 -1
  10. package/dist/annotations.d.cts +2 -1
  11. package/dist/annotations.d.ts +2 -1
  12. package/dist/annotations.js +3 -4
  13. package/dist/{arc-a1tRTEw7.js → arc-B3V5IR0w.js} +2 -3
  14. package/dist/{arc-a1tRTEw7.js.map → arc-B3V5IR0w.js.map} +1 -1
  15. package/dist/{arc-BXpLrt9b.cjs → arc-CYhI62kO.cjs} +2 -3
  16. package/dist/{arc-BXpLrt9b.cjs.map → arc-CYhI62kO.cjs.map} +1 -1
  17. package/dist/{area-CF__HOwL.d.ts → area-DEFQm_SQ.d.ts} +3 -6
  18. package/dist/{area-sHCE3pg5.cjs → area-DYdQ_sMV.cjs} +5 -6
  19. package/dist/{area-sHCE3pg5.cjs.map → area-DYdQ_sMV.cjs.map} +1 -1
  20. package/dist/{area-DQsLERhx.js → area-WdtfqvhX.js} +5 -6
  21. package/dist/{area-DQsLERhx.js.map → area-WdtfqvhX.js.map} +1 -1
  22. package/dist/{area-DIxaAbYZ.d.cts → area-h_FvieFb.d.cts} +3 -6
  23. package/dist/area.cjs +1 -1
  24. package/dist/area.d.cts +2 -1
  25. package/dist/area.d.ts +2 -1
  26. package/dist/area.js +1 -2
  27. package/dist/axis-MMaVoSWB.js +235 -0
  28. package/dist/axis-MMaVoSWB.js.map +1 -0
  29. package/dist/axis-YfAerNBA.cjs +300 -0
  30. package/dist/axis-YfAerNBA.cjs.map +1 -0
  31. package/dist/{band-DTcNDAFO.d.ts → band-CNKvdnTC.d.cts} +1 -4
  32. package/dist/{band-DTcNDAFO.d.cts → band-CNKvdnTC.d.ts} +1 -4
  33. package/dist/{bar-jZEoao74.js → bar-BOcRcArc.js} +80 -62
  34. package/dist/bar-BOcRcArc.js.map +1 -0
  35. package/dist/{bar-C-7zR2qp.cjs → bar-CVkOJ7WA.cjs} +82 -64
  36. package/dist/bar-CVkOJ7WA.cjs.map +1 -0
  37. package/dist/{bar-DM16NUvV.js → bar-CgpC2EpX.js} +3 -4
  38. package/dist/{bar-DM16NUvV.js.map → bar-CgpC2EpX.js.map} +1 -1
  39. package/dist/{bar-BBM8RhoL.d.ts → bar-D9B_arKf.d.ts} +4 -7
  40. package/dist/{bar-CRKLDg98.d.cts → bar-DZCQ-kyf.d.cts} +4 -7
  41. package/dist/{bar-DGuUN3nc.cjs → bar-wVykm1us.cjs} +3 -4
  42. package/dist/{bar-DGuUN3nc.cjs.map → bar-wVykm1us.cjs.map} +1 -1
  43. package/dist/bar.cjs +1 -1
  44. package/dist/bar.d.cts +2 -1
  45. package/dist/bar.d.ts +2 -1
  46. package/dist/bar.js +1 -2
  47. package/dist/calendar-BSvO8nRb.d.cts +106 -0
  48. package/dist/calendar-BXgIX5H1.js +502 -0
  49. package/dist/calendar-BXgIX5H1.js.map +1 -0
  50. package/dist/calendar-Bq3vFzPl.d.ts +106 -0
  51. package/dist/calendar-DAFXjV99.cjs +507 -0
  52. package/dist/calendar-DAFXjV99.cjs.map +1 -0
  53. package/dist/calendar.cjs +3 -0
  54. package/dist/calendar.d.cts +3 -0
  55. package/dist/calendar.d.ts +3 -0
  56. package/dist/calendar.js +1 -0
  57. package/dist/{candlestick-D_vV0_XZ.d.ts → candlestick-B3WcLzph.d.ts} +3 -6
  58. package/dist/{candlestick-__pXl_pV.d.cts → candlestick-BcomxeVG.d.cts} +3 -6
  59. package/dist/{candlestick-DuXwAFID.js → candlestick-BtT9glp9.js} +19 -18
  60. package/dist/{candlestick-DuXwAFID.js.map → candlestick-BtT9glp9.js.map} +1 -1
  61. package/dist/{candlestick-B5r1w3kc.cjs → candlestick-CSmRuZ4v.cjs} +19 -18
  62. package/dist/{candlestick-B5r1w3kc.cjs.map → candlestick-CSmRuZ4v.cjs.map} +1 -1
  63. package/dist/candlestick.cjs +4 -5
  64. package/dist/candlestick.d.cts +1 -1
  65. package/dist/candlestick.d.ts +1 -1
  66. package/dist/candlestick.js +4 -6
  67. package/dist/{cartesian-Cr0AF0nG.js → cartesian-BrPqb5Qn.js} +138 -264
  68. package/dist/cartesian-BrPqb5Qn.js.map +1 -0
  69. package/dist/{cartesian-BoDfgBCV.cjs → cartesian-DRSXHxWe.cjs} +162 -324
  70. package/dist/cartesian-DRSXHxWe.cjs.map +1 -0
  71. package/dist/{chart-BF2CK9I_.js → chart-B6TTY4Kr.js} +120 -77
  72. package/dist/chart-B6TTY4Kr.js.map +1 -0
  73. package/dist/{chart-DyN7bcx8.d.ts → chart-CYrrUCi3.d.ts} +222 -102
  74. package/dist/{chart-D7ooEFnk.d.cts → chart-CbPzP5Dp.d.cts} +248 -102
  75. package/dist/{chart-CowF_lWY.cjs → chart-D_lyOy-M.cjs} +132 -83
  76. package/dist/chart-D_lyOy-M.cjs.map +1 -0
  77. package/dist/{circle-BQMuAfls.cjs → circle-Bwxy5j7B.cjs} +2 -3
  78. package/dist/{circle-BQMuAfls.cjs.map → circle-Bwxy5j7B.cjs.map} +1 -1
  79. package/dist/{circle-Z7YfCoCM.js → circle-YRDaOBpk.js} +2 -3
  80. package/dist/{circle-Z7YfCoCM.js.map → circle-YRDaOBpk.js.map} +1 -1
  81. package/dist/{clean-o1vDEhFV.js → clean-CkoQobGv.js} +3 -4
  82. package/dist/{clean-o1vDEhFV.js.map → clean-CkoQobGv.js.map} +1 -1
  83. package/dist/{clean-Byl6kzf0.cjs → clean-Die2iCNc.cjs} +8 -3
  84. package/dist/{clean-Byl6kzf0.cjs.map → clean-Die2iCNc.cjs.map} +1 -1
  85. package/dist/{core-D1vO1LrC.d.cts → core-9BnLEW4K.d.cts} +31 -72
  86. package/dist/{core-DcbemzGf.d.ts → core-C3qEppSm.d.ts} +10 -46
  87. package/dist/{core-CegR_j55.js → core-CQ0FaJ4G.js} +138 -99
  88. package/dist/core-CQ0FaJ4G.js.map +1 -0
  89. package/dist/{core-RzS9IQO5.cjs → core-D2PSked3.cjs} +139 -100
  90. package/dist/core-D2PSked3.cjs.map +1 -0
  91. package/dist/core.cjs +47 -33
  92. package/dist/core.d.cts +26 -21
  93. package/dist/core.d.ts +26 -21
  94. package/dist/core.js +31 -25
  95. package/dist/{dates-CG-FvioW.js → dates-DLe2Ww64.js} +4 -5
  96. package/dist/{dates-CG-FvioW.js.map → dates-DLe2Ww64.js.map} +1 -1
  97. package/dist/{dates-Btm7Zm6W.cjs → dates-DerXTb1J.cjs} +4 -5
  98. package/dist/{dates-Btm7Zm6W.cjs.map → dates-DerXTb1J.cjs.map} +1 -1
  99. package/dist/{decimate-tLhDk1ys.cjs → decimate-BS3x8g-f.cjs} +2 -3
  100. package/dist/{decimate-tLhDk1ys.cjs.map → decimate-BS3x8g-f.cjs.map} +1 -1
  101. package/dist/{decimate-BGg9XgF0.d.ts → decimate-BxxYBJJk.d.cts} +2 -5
  102. package/dist/{decimate-C87cl_Sp.js → decimate-CapfgiDY.js} +2 -3
  103. package/dist/{decimate-C87cl_Sp.js.map → decimate-CapfgiDY.js.map} +1 -1
  104. package/dist/{decimate-CNSpgGa5.d.cts → decimate-Du87fMLG.d.ts} +2 -5
  105. package/dist/decimate.cjs +3 -4
  106. package/dist/decimate.d.cts +1 -1
  107. package/dist/decimate.d.ts +1 -1
  108. package/dist/decimate.js +3 -4
  109. package/dist/{dom-CLF868Qs.cjs → dom-C33zvtPo.cjs} +5 -11
  110. package/dist/dom-C33zvtPo.cjs.map +1 -0
  111. package/dist/{dom-vP3IcMak.js → dom-CTse6Rvd.js} +5 -11
  112. package/dist/dom-CTse6Rvd.js.map +1 -0
  113. package/dist/{export-chart-BhhYgksr.cjs → export-chart-CPtXmZvi.cjs} +18 -14
  114. package/dist/export-chart-CPtXmZvi.cjs.map +1 -0
  115. package/dist/{export-chart-9w8t3rjZ.js → export-chart-DoeiAyR2.js} +18 -14
  116. package/dist/export-chart-DoeiAyR2.js.map +1 -0
  117. package/dist/export.cjs +3 -5
  118. package/dist/export.cjs.map +1 -1
  119. package/dist/export.d.cts +8 -1
  120. package/dist/export.d.ts +8 -1
  121. package/dist/export.js +3 -4
  122. package/dist/{extent-BAMZo0Nq.js → extent-DOV8rs-6.js} +2 -3
  123. package/dist/{extent-BAMZo0Nq.js.map → extent-DOV8rs-6.js.map} +1 -1
  124. package/dist/{extent-DsFWvAHJ.cjs → extent-DuYDcvM9.cjs} +2 -3
  125. package/dist/{extent-DsFWvAHJ.cjs.map → extent-DuYDcvM9.cjs.map} +1 -1
  126. package/dist/{fade-D3NxH5Qg.js → fade-CDrQjnDz.js} +59 -83
  127. package/dist/fade-CDrQjnDz.js.map +1 -0
  128. package/dist/{fade-Cs74puQS.cjs → fade-CRqcKMWY.cjs} +59 -83
  129. package/dist/fade-CRqcKMWY.cjs.map +1 -0
  130. package/dist/{features-wASyHGic.js → features-B55rwpQC.js} +5 -4
  131. package/dist/features-B55rwpQC.js.map +1 -0
  132. package/dist/{features-BclHgg2W.cjs → features-DEDP5CEQ.cjs} +10 -3
  133. package/dist/features-DEDP5CEQ.cjs.map +1 -0
  134. package/dist/fit-BPyPRnsK.js +16 -0
  135. package/dist/fit-BPyPRnsK.js.map +1 -0
  136. package/dist/fit-D4MIIQQz.cjs +21 -0
  137. package/dist/fit-D4MIIQQz.cjs.map +1 -0
  138. package/dist/{format-B0yKXBTH.cjs → format-CAE5ruy6.cjs} +2 -3
  139. package/dist/{format-B0yKXBTH.cjs.map → format-CAE5ruy6.cjs.map} +1 -1
  140. package/dist/{format-lStwuc1L.js → format-it1kepFG.js} +2 -3
  141. package/dist/{format-lStwuc1L.js.map → format-it1kepFG.js.map} +1 -1
  142. package/dist/funnel-BdcfUkb5.d.ts +50 -0
  143. package/dist/funnel-CFEEulw_.cjs +244 -0
  144. package/dist/funnel-CFEEulw_.cjs.map +1 -0
  145. package/dist/funnel-CYCv8cq2.js +239 -0
  146. package/dist/funnel-CYCv8cq2.js.map +1 -0
  147. package/dist/funnel-CarOh8w_.d.cts +50 -0
  148. package/dist/funnel.cjs +3 -0
  149. package/dist/funnel.d.cts +3 -0
  150. package/dist/funnel.d.ts +3 -0
  151. package/dist/funnel.js +1 -0
  152. package/dist/{gauge-D-FYhuds.cjs → gauge-6HfDcLMJ.cjs} +35 -36
  153. package/dist/gauge-6HfDcLMJ.cjs.map +1 -0
  154. package/dist/{gauge-Dh423FHh.js → gauge-DiTk5aWO.js} +35 -36
  155. package/dist/gauge-DiTk5aWO.js.map +1 -0
  156. package/dist/{gauge-zpia05t2.d.ts → gauge-Ds9k1UV2.d.cts} +5 -8
  157. package/dist/{gauge-DP_EB2z3.d.cts → gauge-Zy25jfps.d.ts} +5 -8
  158. package/dist/gauge.cjs +1 -1
  159. package/dist/gauge.d.cts +2 -1
  160. package/dist/gauge.d.ts +2 -1
  161. package/dist/gauge.js +1 -2
  162. package/dist/{heatmap-DSZ2bVIa.js → heatmap-C1v8bwpq.js} +43 -43
  163. package/dist/heatmap-C1v8bwpq.js.map +1 -0
  164. package/dist/{heatmap-BectCEeE.d.ts → heatmap-CJ-0dfhJ.d.cts} +4 -7
  165. package/dist/{heatmap-BK18EBgJ.cjs → heatmap-Dcc_bsoQ.cjs} +47 -47
  166. package/dist/heatmap-Dcc_bsoQ.cjs.map +1 -0
  167. package/dist/{heatmap-CCso6m61.d.cts → heatmap-Jp5sHRTo.d.ts} +4 -7
  168. package/dist/heatmap.cjs +1 -1
  169. package/dist/heatmap.d.cts +2 -1
  170. package/dist/heatmap.d.ts +2 -1
  171. package/dist/heatmap.js +1 -2
  172. package/dist/{hydrate-DDNIHYv_.js → hydrate-BB3MlR36.js} +3 -4
  173. package/dist/{hydrate-DDNIHYv_.js.map → hydrate-BB3MlR36.js.map} +1 -1
  174. package/dist/{hydrate-CzfxLfTv.d.ts → hydrate-BtAZf_5K.d.cts} +2 -5
  175. package/dist/{hydrate-CTTmQy0x.d.cts → hydrate-OjM1pIUG.d.ts} +2 -5
  176. package/dist/{hydrate-CxwTXDqO.cjs → hydrate-m0I5m6ue.cjs} +3 -4
  177. package/dist/hydrate-m0I5m6ue.cjs.map +1 -0
  178. package/dist/hydrate.cjs +3 -4
  179. package/dist/hydrate.cjs.map +1 -1
  180. package/dist/hydrate.d.cts +1 -1
  181. package/dist/hydrate.d.ts +1 -1
  182. package/dist/hydrate.js +3 -4
  183. package/dist/index.cjs +72 -56
  184. package/dist/index.cjs.map +1 -1
  185. package/dist/index.d.cts +28 -28
  186. package/dist/index.d.ts +28 -28
  187. package/dist/index.js +52 -44
  188. package/dist/index.js.map +1 -1
  189. package/dist/interaction-DXYSjgnP.cjs +32 -0
  190. package/dist/interaction-DXYSjgnP.cjs.map +1 -0
  191. package/dist/interaction-En1KlwFO.js +21 -0
  192. package/dist/interaction-En1KlwFO.js.map +1 -0
  193. package/dist/{layout-CtMBhNd9.cjs → layout-Cfg9x1k2.cjs} +45 -3
  194. package/dist/layout-Cfg9x1k2.cjs.map +1 -0
  195. package/dist/{layout-B3hiqVEw.js → layout-DqAte3H8.js} +34 -4
  196. package/dist/layout-DqAte3H8.js.map +1 -0
  197. package/dist/{line-CN4uZ9ZX.d.ts → line-Bpr5uVLQ.d.ts} +4 -7
  198. package/dist/{line-B3Ed6u7j.js → line-CxR4tg1Q.js} +49 -38
  199. package/dist/line-CxR4tg1Q.js.map +1 -0
  200. package/dist/{line-fQbtP_jL.cjs → line-YiCuhVMI.cjs} +49 -38
  201. package/dist/line-YiCuhVMI.cjs.map +1 -0
  202. package/dist/{line-W7VD_qs1.d.cts → line-vyWO030v.d.cts} +4 -7
  203. package/dist/line.cjs +4 -5
  204. package/dist/line.cjs.map +1 -1
  205. package/dist/line.d.cts +1 -1
  206. package/dist/line.d.ts +1 -1
  207. package/dist/line.js +4 -6
  208. package/dist/{log-CaofN3-n.d.ts → log-CI41TmcU.d.cts} +1 -6
  209. package/dist/{log-CaofN3-n.d.cts → log-CI41TmcU.d.ts} +1 -6
  210. package/dist/{log-axis-83rSpvL5.cjs → log-axis-DdRNyAq8.cjs} +6 -8
  211. package/dist/{log-axis-83rSpvL5.cjs.map → log-axis-DdRNyAq8.cjs.map} +1 -1
  212. package/dist/{log-axis-B_uvvOFc.js → log-axis-DhthtHFk.js} +6 -8
  213. package/dist/{log-axis-B_uvvOFc.js.map → log-axis-DhthtHFk.js.map} +1 -1
  214. package/dist/log.cjs +3 -5
  215. package/dist/log.cjs.map +1 -1
  216. package/dist/log.d.cts +1 -1
  217. package/dist/log.d.ts +1 -1
  218. package/dist/log.js +3 -4
  219. package/dist/map-49FcfdmJ.d.cts +156 -0
  220. package/dist/map-BMC61J-P.d.ts +156 -0
  221. package/dist/map-BqrZ80vT.cjs +818 -0
  222. package/dist/map-BqrZ80vT.cjs.map +1 -0
  223. package/dist/map-C15NC7kW.js +807 -0
  224. package/dist/map-C15NC7kW.js.map +1 -0
  225. package/dist/map.cjs +4 -0
  226. package/dist/map.d.cts +3 -0
  227. package/dist/map.d.ts +3 -0
  228. package/dist/map.js +1 -0
  229. package/dist/maps/world.cjs +875 -0
  230. package/dist/maps/world.cjs.map +1 -0
  231. package/dist/maps/world.d.cts +2 -0
  232. package/dist/maps/world.d.ts +2 -0
  233. package/dist/maps/world.js +874 -0
  234. package/dist/maps/world.js.map +1 -0
  235. package/dist/{morph-CqYDu1bY.cjs → morph-3I1Nf_tR.cjs} +4 -5
  236. package/dist/morph-3I1Nf_tR.cjs.map +1 -0
  237. package/dist/{morph-BMxz3X2b.d.ts → morph-Dh7gJkV4.d.cts} +1 -4
  238. package/dist/{morph-BMxz3X2b.d.cts → morph-Dh7gJkV4.d.ts} +1 -4
  239. package/dist/{morph-Bgg-24l8.js → morph-GfBab-b3.js} +4 -5
  240. package/dist/{morph-Bgg-24l8.js.map → morph-GfBab-b3.js.map} +1 -1
  241. package/dist/morph.cjs +3 -4
  242. package/dist/morph.cjs.map +1 -1
  243. package/dist/morph.d.cts +1 -1
  244. package/dist/morph.d.ts +1 -1
  245. package/dist/morph.js +3 -4
  246. package/dist/{named-BWWb5LQJ.cjs → named-BBASc8dW.cjs} +2 -3
  247. package/dist/{named-BWWb5LQJ.cjs.map → named-BBASc8dW.cjs.map} +1 -1
  248. package/dist/{named-DE15TOgh.js → named-BOiBah6I.js} +2 -3
  249. package/dist/{named-DE15TOgh.js.map → named-BOiBah6I.js.map} +1 -1
  250. package/dist/others-DBIGE6jr.js +57 -0
  251. package/dist/others-DBIGE6jr.js.map +1 -0
  252. package/dist/others-DBO4Kjwl.d.ts +29 -0
  253. package/dist/others-WfjCsjqT.cjs +68 -0
  254. package/dist/others-WfjCsjqT.cjs.map +1 -0
  255. package/dist/others-ls5eKtZ4.d.cts +31 -0
  256. package/dist/{parliament-Dw0sOERi.js → parliament-BKN6ikBJ.js} +36 -36
  257. package/dist/parliament-BKN6ikBJ.js.map +1 -0
  258. package/dist/{parliament-1Zv2Xh0D.d.ts → parliament-C7V8UJj1.d.cts} +5 -8
  259. package/dist/{parliament-DdrLVZwt.d.cts → parliament-Cz9n_DoK.d.ts} +5 -8
  260. package/dist/{parliament-CpWnoEvG.cjs → parliament-DhxAaIZ3.cjs} +36 -36
  261. package/dist/parliament-DhxAaIZ3.cjs.map +1 -0
  262. package/dist/parliament.cjs +1 -1
  263. package/dist/parliament.d.cts +2 -1
  264. package/dist/parliament.d.ts +2 -1
  265. package/dist/parliament.js +1 -2
  266. package/dist/{path-CwB28da0.d.ts → path-YeUiOfG8.d.cts} +1 -4
  267. package/dist/{path-CwB28da0.d.cts → path-YeUiOfG8.d.ts} +1 -4
  268. package/dist/{patterns-DtgcnA8o.js → patterns-BMUINoka.js} +4 -5
  269. package/dist/{patterns-DtgcnA8o.js.map → patterns-BMUINoka.js.map} +1 -1
  270. package/dist/{patterns-LfcQAWCy.cjs → patterns-Dw7OMD_2.cjs} +4 -5
  271. package/dist/{patterns-LfcQAWCy.cjs.map → patterns-Dw7OMD_2.cjs.map} +1 -1
  272. package/dist/patterns.cjs +3 -5
  273. package/dist/patterns.cjs.map +1 -1
  274. package/dist/patterns.d.cts +5 -1
  275. package/dist/patterns.d.ts +5 -1
  276. package/dist/patterns.js +3 -4
  277. package/dist/percentage-bar-BChkTRoz.cjs +164 -0
  278. package/dist/percentage-bar-BChkTRoz.cjs.map +1 -0
  279. package/dist/percentage-bar-CaInxrL8.js +159 -0
  280. package/dist/percentage-bar-CaInxrL8.js.map +1 -0
  281. package/dist/percentage-bar-R1--2grK.d.cts +58 -0
  282. package/dist/percentage-bar-cSeiLdwU.d.ts +58 -0
  283. package/dist/percentage-bar.cjs +3 -0
  284. package/dist/percentage-bar.d.cts +3 -0
  285. package/dist/percentage-bar.d.ts +3 -0
  286. package/dist/percentage-bar.js +1 -0
  287. package/dist/{pie-BF9yI5mE.d.cts → pie-BQQkvy1N.d.ts} +11 -11
  288. package/dist/{pie-DzUXDTcn.js → pie-Bd8wyrtY.js} +52 -55
  289. package/dist/pie-Bd8wyrtY.js.map +1 -0
  290. package/dist/{pie-BxTZt6Go.cjs → pie-BseZlCgP.cjs} +52 -55
  291. package/dist/pie-BseZlCgP.cjs.map +1 -0
  292. package/dist/{pie-5z1fDdKO.d.ts → pie-vD5-g8je.d.cts} +11 -11
  293. package/dist/pie.cjs +1 -1
  294. package/dist/pie.d.cts +2 -1
  295. package/dist/pie.d.ts +2 -1
  296. package/dist/pie.js +1 -2
  297. package/dist/{point-shapes-CGl4dugc.cjs → point-shapes-BRawRM78.cjs} +24 -24
  298. package/dist/point-shapes-BRawRM78.cjs.map +1 -0
  299. package/dist/{point-shapes-DI84NNpI.js → point-shapes-DI6GhcI7.js} +19 -25
  300. package/dist/point-shapes-DI6GhcI7.js.map +1 -0
  301. package/dist/point-shapes.cjs +7 -6
  302. package/dist/point-shapes.cjs.map +1 -1
  303. package/dist/point-shapes.d.cts +6 -2
  304. package/dist/point-shapes.d.ts +6 -2
  305. package/dist/point-shapes.js +8 -7
  306. package/dist/point-shapes.js.map +1 -1
  307. package/dist/{radar-1-EryihA.d.ts → radar-7I6hsY_h.d.cts} +4 -7
  308. package/dist/{radar-CYPab_I4.js → radar-D6XqkFWQ.js} +25 -27
  309. package/dist/radar-D6XqkFWQ.js.map +1 -0
  310. package/dist/{radar-CoGUNNSb.cjs → radar-DjISDnSf.cjs} +26 -28
  311. package/dist/radar-DjISDnSf.cjs.map +1 -0
  312. package/dist/{radar-DBW4O0Vt.d.cts → radar-vLxilcr4.d.ts} +4 -7
  313. package/dist/radar.cjs +1 -1
  314. package/dist/radar.d.cts +2 -1
  315. package/dist/radar.d.ts +2 -1
  316. package/dist/radar.js +1 -2
  317. package/dist/rect-CZTNvMlf.js +11 -0
  318. package/dist/rect-CZTNvMlf.js.map +1 -0
  319. package/dist/rect-DPr9QRxl.cjs +16 -0
  320. package/dist/rect-DPr9QRxl.cjs.map +1 -0
  321. package/dist/{sankey-Bacx4fVe.cjs → sankey-0CSp_Er9.cjs} +100 -95
  322. package/dist/sankey-0CSp_Er9.cjs.map +1 -0
  323. package/dist/{sankey-OV_WoPrl.d.ts → sankey-7As41Fo4.d.ts} +4 -7
  324. package/dist/{sankey-B4PNKusJ.js → sankey-Dp4CuLVe.js} +100 -95
  325. package/dist/sankey-Dp4CuLVe.js.map +1 -0
  326. package/dist/{sankey-DuGI3Qc5.d.cts → sankey-DqiuxUx7.d.cts} +4 -7
  327. package/dist/sankey.cjs +1 -1
  328. package/dist/sankey.d.cts +2 -1
  329. package/dist/sankey.d.ts +2 -1
  330. package/dist/sankey.js +1 -2
  331. package/dist/{scatter-DbxLyZX0.d.cts → scatter-BXkXGgM_.d.ts} +14 -9
  332. package/dist/{scatter-DgMN9zRy.cjs → scatter-Bwkblr4L.cjs} +47 -42
  333. package/dist/scatter-Bwkblr4L.cjs.map +1 -0
  334. package/dist/{scatter-kgtgR318.js → scatter-DCMAtt5L.js} +45 -40
  335. package/dist/scatter-DCMAtt5L.js.map +1 -0
  336. package/dist/{scatter-BqzgJqdX.d.ts → scatter-DL0zAV09.d.cts} +14 -9
  337. package/dist/scatter.cjs +1 -1
  338. package/dist/scatter.d.cts +2 -1
  339. package/dist/scatter.d.ts +2 -1
  340. package/dist/scatter.js +1 -2
  341. package/dist/{sparkline-BfyO_oNM.d.ts → sparkline-BElUSd0r.d.ts} +5 -8
  342. package/dist/{sparkline-BS9-hltA.cjs → sparkline-BMSuEPHP.cjs} +22 -23
  343. package/dist/sparkline-BMSuEPHP.cjs.map +1 -0
  344. package/dist/{sparkline-BQzt27Fr.js → sparkline-NDmq90kP.js} +22 -23
  345. package/dist/sparkline-NDmq90kP.js.map +1 -0
  346. package/dist/{sparkline-CWlJDKyh.d.cts → sparkline-RYly7bR0.d.cts} +5 -8
  347. package/dist/sparkline.cjs +1 -1
  348. package/dist/sparkline.d.cts +2 -1
  349. package/dist/sparkline.d.ts +2 -1
  350. package/dist/sparkline.js +1 -2
  351. package/dist/{stack-DVhJWaki.cjs → stack-BO4624CY.cjs} +3 -4
  352. package/dist/{stack-DVhJWaki.cjs.map → stack-BO4624CY.cjs.map} +1 -1
  353. package/dist/{stack-CpR6RGKd.d.ts → stack-BTWYIwLO.d.cts} +2 -4
  354. package/dist/{stack-CpR6RGKd.d.cts → stack-DR0eQTsB.d.ts} +1 -4
  355. package/dist/{stack-DRbwTeF3.js → stack-jVKvg2x_.js} +3 -4
  356. package/dist/{stack-DRbwTeF3.js.map → stack-jVKvg2x_.js.map} +1 -1
  357. package/dist/style.css +1 -1
  358. package/dist/{sweep-CbfR7--d.js → sweep-BpRPlhs6.js} +5 -6
  359. package/dist/{sweep-CbfR7--d.js.map → sweep-BpRPlhs6.js.map} +1 -1
  360. package/dist/{sweep-DaTEDDuC.cjs → sweep-Dnp6LDBz.cjs} +5 -6
  361. package/dist/sweep-Dnp6LDBz.cjs.map +1 -0
  362. package/dist/{time-CNVnt-B2.d.cts → time-B4oxWHQI.d.cts} +2 -7
  363. package/dist/{time-CHjiY9Q4.d.ts → time-DRIDgv2a.d.ts} +2 -7
  364. package/dist/{time-axis-VSX34_Tb.cjs → time-axis-B3VekUfX.cjs} +11 -11
  365. package/dist/{time-axis-VSX34_Tb.cjs.map → time-axis-B3VekUfX.cjs.map} +1 -1
  366. package/dist/{time-axis-Bc9eHX1r.js → time-axis-CLjqOakA.js} +10 -10
  367. package/dist/{time-axis-Bc9eHX1r.js.map → time-axis-CLjqOakA.js.map} +1 -1
  368. package/dist/time.cjs +4 -6
  369. package/dist/time.cjs.map +1 -1
  370. package/dist/time.d.cts +1 -1
  371. package/dist/time.d.ts +1 -1
  372. package/dist/time.js +4 -5
  373. package/dist/treemap-25vHO_UK.d.cts +65 -0
  374. package/dist/treemap-BCXUbixd.d.ts +65 -0
  375. package/dist/treemap-C4glsx-g.js +293 -0
  376. package/dist/treemap-C4glsx-g.js.map +1 -0
  377. package/dist/treemap-CZk8kKFD.cjs +298 -0
  378. package/dist/treemap-CZk8kKFD.cjs.map +1 -0
  379. package/dist/treemap.cjs +3 -0
  380. package/dist/treemap.d.cts +3 -0
  381. package/dist/treemap.d.ts +3 -0
  382. package/dist/treemap.js +1 -0
  383. package/dist/{tween-BCYd0RTY.js → tween-BdQqUmmv.js} +2 -3
  384. package/dist/{tween-BCYd0RTY.js.map → tween-BdQqUmmv.js.map} +1 -1
  385. package/dist/{tween-CIGBlryn.cjs → tween-c3aOmfKE.cjs} +2 -3
  386. package/dist/{tween-CIGBlryn.cjs.map → tween-c3aOmfKE.cjs.map} +1 -1
  387. package/dist/{value-labels-IZIQPhfk.js → value-labels-C7GrhOXJ.js} +30 -10
  388. package/dist/value-labels-C7GrhOXJ.js.map +1 -0
  389. package/dist/{value-labels-B0WJoJ7x.cjs → value-labels-DzaKIWKp.cjs} +30 -10
  390. package/dist/value-labels-DzaKIWKp.cjs.map +1 -0
  391. package/dist/value-labels.cjs +3 -5
  392. package/dist/value-labels.cjs.map +1 -1
  393. package/dist/value-labels.d.cts +5 -1
  394. package/dist/value-labels.d.ts +5 -1
  395. package/dist/value-labels.js +3 -4
  396. package/dist/{vnode-CkQ27Cxe.cjs → vnode-ClAiw28x.cjs} +2 -3
  397. package/dist/{vnode-CkQ27Cxe.cjs.map → vnode-ClAiw28x.cjs.map} +1 -1
  398. package/dist/{vnode-BUflsBsa.d.ts → vnode-Du2cC8Fm.d.cts} +1 -4
  399. package/dist/{vnode-BUflsBsa.d.cts → vnode-Du2cC8Fm.d.ts} +1 -4
  400. package/dist/{vnode-tCWItoUH.js → vnode-_EMUqysL.js} +2 -3
  401. package/dist/{vnode-tCWItoUH.js.map → vnode-_EMUqysL.js.map} +1 -1
  402. package/package.json +94 -214
  403. package/dist/bar-C-7zR2qp.cjs.map +0 -1
  404. package/dist/bar-jZEoao74.js.map +0 -1
  405. package/dist/cartesian-BoDfgBCV.cjs.map +0 -1
  406. package/dist/cartesian-Cr0AF0nG.js.map +0 -1
  407. package/dist/chart-BF2CK9I_.js.map +0 -1
  408. package/dist/chart-CowF_lWY.cjs.map +0 -1
  409. package/dist/core-CegR_j55.js.map +0 -1
  410. package/dist/core-RzS9IQO5.cjs.map +0 -1
  411. package/dist/dom-CLF868Qs.cjs.map +0 -1
  412. package/dist/dom-vP3IcMak.js.map +0 -1
  413. package/dist/export-chart-9w8t3rjZ.js.map +0 -1
  414. package/dist/export-chart-BhhYgksr.cjs.map +0 -1
  415. package/dist/fade-Cs74puQS.cjs.map +0 -1
  416. package/dist/fade-D3NxH5Qg.js.map +0 -1
  417. package/dist/features-BclHgg2W.cjs.map +0 -1
  418. package/dist/features-wASyHGic.js.map +0 -1
  419. package/dist/gauge-D-FYhuds.cjs.map +0 -1
  420. package/dist/gauge-Dh423FHh.js.map +0 -1
  421. package/dist/heatmap-BK18EBgJ.cjs.map +0 -1
  422. package/dist/heatmap-DSZ2bVIa.js.map +0 -1
  423. package/dist/hydrate-CxwTXDqO.cjs.map +0 -1
  424. package/dist/layout-B3hiqVEw.js.map +0 -1
  425. package/dist/layout-CtMBhNd9.cjs.map +0 -1
  426. package/dist/line-B3Ed6u7j.js.map +0 -1
  427. package/dist/line-fQbtP_jL.cjs.map +0 -1
  428. package/dist/morph-CqYDu1bY.cjs.map +0 -1
  429. package/dist/parliament-CpWnoEvG.cjs.map +0 -1
  430. package/dist/parliament-Dw0sOERi.js.map +0 -1
  431. package/dist/pie-BxTZt6Go.cjs.map +0 -1
  432. package/dist/pie-DzUXDTcn.js.map +0 -1
  433. package/dist/point-shapes-CGl4dugc.cjs.map +0 -1
  434. package/dist/point-shapes-DI84NNpI.js.map +0 -1
  435. package/dist/radar-CYPab_I4.js.map +0 -1
  436. package/dist/radar-CoGUNNSb.cjs.map +0 -1
  437. package/dist/sankey-B4PNKusJ.js.map +0 -1
  438. package/dist/sankey-Bacx4fVe.cjs.map +0 -1
  439. package/dist/scatter-DgMN9zRy.cjs.map +0 -1
  440. package/dist/scatter-kgtgR318.js.map +0 -1
  441. package/dist/sparkline-BQzt27Fr.js.map +0 -1
  442. package/dist/sparkline-BS9-hltA.cjs.map +0 -1
  443. package/dist/sweep-DaTEDDuC.cjs.map +0 -1
  444. package/dist/value-labels-B0WJoJ7x.cjs.map +0 -1
  445. package/dist/value-labels-IZIQPhfk.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"dates-Btm7Zm6W.cjs","names":["toMs","formatDate"],"sources":["../src/charts/dates.ts"],"sourcesContent":["import type { Locale } from '../format.ts'\nimport { formatDate } from '../format.ts'\nimport { type Label, toMs } from './cartesian.ts'\n\n/**\n * Formatter for date labels on a time axis (tooltips, tables, band axes):\n * the date, with the time of day when the labels span less than a few days.\n */\nexport function dateLabels(\n labels: readonly Label[],\n utc: boolean | undefined,\n locale: Locale,\n): (label: Label) => string {\n const first = labels[0]\n const last = labels[labels.length - 1]\n const span = first !== undefined && last !== undefined ? Math.abs(toMs(last) - toMs(first)) : 0\n const withTime = span > 0 && span < 3 * 24 * 60 * 60 * 1000\n const fmt = formatDate(\n {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n ...(withTime ? { hour: 'numeric', minute: '2-digit' } : {}),\n ...(utc ? { timeZone: 'UTC' } : {}),\n },\n locale,\n )\n return (label) => (Number.isFinite(toMs(label)) ? fmt(toMs(label)) : String(label))\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,WACd,QACA,KACA,QAC0B;CAC1B,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO,OAAO,SAAS;CACpC,MAAM,OAAO,UAAU,KAAA,KAAa,SAAS,KAAA,IAAY,KAAK,IAAIA,kBAAAA,KAAK,IAAI,IAAIA,kBAAAA,KAAK,KAAK,CAAC,IAAI;CAE9F,MAAM,MAAMC,eAAAA,WACV;EACE,MAAM;EACN,OAAO;EACP,KAAK;EACL,GANa,OAAO,KAAK,OAAO,SAMjB;GAAE,MAAM;GAAW,QAAQ;EAAU,IAAI,CAAC;EACzD,GAAI,MAAM,EAAE,UAAU,MAAM,IAAI,CAAC;CACnC,GACA,MACF;CACA,QAAQ,UAAW,OAAO,SAASD,kBAAAA,KAAK,KAAK,CAAC,IAAI,IAAIA,kBAAAA,KAAK,KAAK,CAAC,IAAI,OAAO,KAAK;AACnF"}
1
+ {"version":3,"file":"dates-DerXTb1J.cjs","names":["toMs","formatDate"],"sources":["../src/charts/dates.ts"],"sourcesContent":["import type { Locale } from '../format.ts'\nimport { formatDate } from '../format.ts'\nimport { type Label, toMs } from './cartesian.ts'\n\n/**\n * Formatter for date labels on a time axis (tooltips, tables, band axes):\n * the date, with the time of day when the labels span less than a few days.\n */\nexport function dateLabels(\n labels: readonly Label[],\n utc: boolean | undefined,\n locale: Locale,\n): (label: Label) => string {\n const first = labels[0]\n const last = labels[labels.length - 1]\n const span = first !== undefined && last !== undefined ? Math.abs(toMs(last) - toMs(first)) : 0\n const withTime = span > 0 && span < 3 * 24 * 60 * 60 * 1000\n const fmt = formatDate(\n {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n ...(withTime ? { hour: 'numeric', minute: '2-digit' } : {}),\n ...(utc ? { timeZone: 'UTC' } : {}),\n },\n locale,\n )\n return (label) => (Number.isFinite(toMs(label)) ? fmt(toMs(label)) : String(label))\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,WACd,QACA,KACA,QAC0B;CAC1B,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO,OAAO,SAAS;CACpC,MAAM,OAAO,UAAU,KAAA,KAAa,SAAS,KAAA,IAAY,KAAK,IAAIA,kBAAAA,KAAK,IAAI,IAAIA,kBAAAA,KAAK,KAAK,CAAC,IAAI;CAE9F,MAAM,MAAMC,eAAAA,WACV;EACE,MAAM;EACN,OAAO;EACP,KAAK;EACL,GANa,OAAO,KAAK,OAAO,SAMjB;GAAE,MAAM;GAAW,QAAQ;EAAU,IAAI,CAAC;EACzD,GAAI,MAAM,EAAE,UAAU,MAAM,IAAI,CAAC;CACnC,GACA,MACF;CACA,QAAQ,UAAW,OAAO,SAASD,kBAAAA,KAAK,KAAK,CAAC,IAAI,IAAIA,kBAAAA,KAAK,KAAK,CAAC,IAAI,OAAO,KAAK;AACnF"}
@@ -1,4 +1,4 @@
1
- //#region src/shapes/decimate.ts
1
+ // src/shapes/decimate.ts
2
2
  /**
3
3
  * Largest-Triangle-Three-Buckets downsampling (Sveinn Steinarsson, 2013):
4
4
  * keep roughly `threshold` points that preserve the visual shape of a line,
@@ -78,7 +78,6 @@ function sampleRun(points, from, to, budget, out) {
78
78
  function lttb(points, threshold) {
79
79
  return lttbIndices(points, threshold).map((i) => points[i]);
80
80
  }
81
- //#endregion
82
81
  Object.defineProperty(exports, "lttb", {
83
82
  enumerable: true,
84
83
  get: function() {
@@ -92,4 +91,4 @@ Object.defineProperty(exports, "lttbIndices", {
92
91
  }
93
92
  });
94
93
 
95
- //# sourceMappingURL=decimate-tLhDk1ys.cjs.map
94
+ //# sourceMappingURL=decimate-BS3x8g-f.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"decimate-tLhDk1ys.cjs","names":[],"sources":["../src/shapes/decimate.ts"],"sourcesContent":["import type { Point } from './path.ts'\n\n/**\n * Largest-Triangle-Three-Buckets downsampling (Sveinn Steinarsson, 2013):\n * keep roughly `threshold` points that preserve the visual shape of a line,\n * including its peaks and valleys.\n *\n * Returns the indices to keep, in order. Gaps (`null` points) are kept as\n * gap markers and every run between gaps is sampled on its own, so the\n * result lines up with any per-index data (e.g. stacked baselines).\n */\nexport function lttbIndices(points: readonly Point[], threshold: number): number[] {\n const n = points.length\n if (!(threshold >= 3) || n <= threshold) return points.map((_, i) => i)\n\n // Split into runs of valid points.\n const runs: [number, number][] = []\n let start = -1\n for (let i = 0; i < n; i++) {\n const valid = points[i] != null\n if (valid && start === -1) start = i\n if (!valid && start !== -1) {\n runs.push([start, i])\n start = -1\n }\n }\n if (start !== -1) runs.push([start, n])\n const valid = runs.reduce((sum, [a, b]) => sum + (b - a), 0)\n\n const out: number[] = []\n let last = 0\n for (const [a, b] of runs) {\n // One gap marker between runs; everything else in the gap is dropped.\n if (a > last) out.push(last)\n // Each run gets a share of the budget (at least its two ends).\n const budget = Math.max(2, Math.round((threshold * (b - a)) / valid))\n sampleRun(points, a, b, budget, out)\n last = b\n }\n if (last < n) out.push(last)\n return out\n}\n\n/** LTTB over `points[from, to)`, pushing kept indices to `out`. */\nfunction sampleRun(\n points: readonly Point[],\n from: number,\n to: number,\n budget: number,\n out: number[],\n): void {\n const n = to - from\n if (n <= budget) {\n for (let i = from; i < to; i++) out.push(i)\n return\n }\n const at = (i: number) => points[i] as readonly [number, number]\n const bucketSize = (n - 2) / (budget - 2)\n let a = from\n out.push(a)\n\n for (let bucket = 0; bucket < budget - 2; bucket++) {\n // Average of the next bucket is the third corner of every candidate triangle.\n const nextStart = from + 1 + Math.floor((bucket + 1) * bucketSize)\n const nextEnd = Math.min(to, from + 1 + Math.floor((bucket + 2) * bucketSize))\n let avgX = 0\n let avgY = 0\n for (let i = nextStart; i < nextEnd; i++) {\n avgX += at(i)[0]\n avgY += at(i)[1]\n }\n const count = Math.max(1, nextEnd - nextStart)\n avgX /= count\n avgY /= count\n\n // The point of this bucket forming the largest triangle with `a` and the average.\n const rangeStart = from + 1 + Math.floor(bucket * bucketSize)\n const rangeEnd = Math.min(to - 1, from + 1 + Math.floor((bucket + 1) * bucketSize))\n const [ax, ay] = at(a)\n let best = rangeStart\n let bestArea = -1\n for (let i = rangeStart; i < rangeEnd; i++) {\n const [x, y] = at(i)\n const area = Math.abs((ax - avgX) * (y - ay) - (ax - x) * (avgY - ay))\n if (area > bestArea) {\n bestArea = area\n best = i\n }\n }\n out.push(best)\n a = best\n }\n out.push(to - 1)\n}\n\n/** The points kept by {@link lttbIndices}, gaps included. */\nexport function lttb(points: readonly Point[], threshold: number): Point[] {\n return lttbIndices(points, threshold).map((i) => points[i])\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,YAAY,QAA0B,WAA6B;CACjF,MAAM,IAAI,OAAO;CACjB,IAAI,EAAE,aAAa,MAAM,KAAK,WAAW,OAAO,OAAO,KAAK,GAAG,MAAM,CAAC;CAGtE,MAAM,OAA2B,CAAC;CAClC,IAAI,QAAQ;CACZ,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;EAC1B,MAAM,QAAQ,OAAO,MAAM;EAC3B,IAAI,SAAS,UAAU,IAAI,QAAQ;EACnC,IAAI,CAAC,SAAS,UAAU,IAAI;GAC1B,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC;GACpB,QAAQ;EACV;CACF;CACA,IAAI,UAAU,IAAI,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC;CACtC,MAAM,QAAQ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AAM,CAAC,IAAI,MAAM,GAAG,CAAC;EACrB,IAAI,OAAO;EACX,IAAI,WAAW;EACf,KAAK,IAAI,IAAI,YAAY,IAAI,UAAU,KAAK;GAC1C,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC;GACnB,MAAM,OAAO,KAAK,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,MAAM,OAAO,GAAG;GACrE,IAAI,OAAO,UAAU;IACnB,WAAW;IACX,OAAO;GACT;EACF;EACA,IAAI,KAAK,IAAI;EACb,IAAI;CACN;CACA,IAAI,KAAK,KAAK,CAAC;AACjB;;AAGA,SAAgB,KAAK,QAA0B,WAA4B;CACzE,OAAO,YAAY,QAAQ,SAAS,CAAC,CAAC,KAAK,MAAM,OAAO,EAAE;AAC5D"}
1
+ {"version":3,"file":"decimate-BS3x8g-f.cjs","names":[],"sources":["../src/shapes/decimate.ts"],"sourcesContent":["import type { Point } from './path.ts'\n\n/**\n * Largest-Triangle-Three-Buckets downsampling (Sveinn Steinarsson, 2013):\n * keep roughly `threshold` points that preserve the visual shape of a line,\n * including its peaks and valleys.\n *\n * Returns the indices to keep, in order. Gaps (`null` points) are kept as\n * gap markers and every run between gaps is sampled on its own, so the\n * result lines up with any per-index data (e.g. stacked baselines).\n */\nexport function lttbIndices(points: readonly Point[], threshold: number): number[] {\n const n = points.length\n if (!(threshold >= 3) || n <= threshold) return points.map((_, i) => i)\n\n // Split into runs of valid points.\n const runs: [number, number][] = []\n let start = -1\n for (let i = 0; i < n; i++) {\n const valid = points[i] != null\n if (valid && start === -1) start = i\n if (!valid && start !== -1) {\n runs.push([start, i])\n start = -1\n }\n }\n if (start !== -1) runs.push([start, n])\n const valid = runs.reduce((sum, [a, b]) => sum + (b - a), 0)\n\n const out: number[] = []\n let last = 0\n for (const [a, b] of runs) {\n // One gap marker between runs; everything else in the gap is dropped.\n if (a > last) out.push(last)\n // Each run gets a share of the budget (at least its two ends).\n const budget = Math.max(2, Math.round((threshold * (b - a)) / valid))\n sampleRun(points, a, b, budget, out)\n last = b\n }\n if (last < n) out.push(last)\n return out\n}\n\n/** LTTB over `points[from, to)`, pushing kept indices to `out`. */\nfunction sampleRun(\n points: readonly Point[],\n from: number,\n to: number,\n budget: number,\n out: number[],\n): void {\n const n = to - from\n if (n <= budget) {\n for (let i = from; i < to; i++) out.push(i)\n return\n }\n const at = (i: number) => points[i] as readonly [number, number]\n const bucketSize = (n - 2) / (budget - 2)\n let a = from\n out.push(a)\n\n for (let bucket = 0; bucket < budget - 2; bucket++) {\n // Average of the next bucket is the third corner of every candidate triangle.\n const nextStart = from + 1 + Math.floor((bucket + 1) * bucketSize)\n const nextEnd = Math.min(to, from + 1 + Math.floor((bucket + 2) * bucketSize))\n let avgX = 0\n let avgY = 0\n for (let i = nextStart; i < nextEnd; i++) {\n avgX += at(i)[0]\n avgY += at(i)[1]\n }\n const count = Math.max(1, nextEnd - nextStart)\n avgX /= count\n avgY /= count\n\n // The point of this bucket forming the largest triangle with `a` and the average.\n const rangeStart = from + 1 + Math.floor(bucket * bucketSize)\n const rangeEnd = Math.min(to - 1, from + 1 + Math.floor((bucket + 1) * bucketSize))\n const [ax, ay] = at(a)\n let best = rangeStart\n let bestArea = -1\n for (let i = rangeStart; i < rangeEnd; i++) {\n const [x, y] = at(i)\n const area = Math.abs((ax - avgX) * (y - ay) - (ax - x) * (avgY - ay))\n if (area > bestArea) {\n bestArea = area\n best = i\n }\n }\n out.push(best)\n a = best\n }\n out.push(to - 1)\n}\n\n/** The points kept by {@link lttbIndices}, gaps included. */\nexport function lttb(points: readonly Point[], threshold: number): Point[] {\n return lttbIndices(points, threshold).map((i) => points[i])\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,YAAY,QAA0B,WAA6B;CACjF,MAAM,IAAI,OAAO;CACjB,IAAI,EAAE,aAAa,MAAM,KAAK,WAAW,OAAO,OAAO,KAAK,GAAG,MAAM,CAAC;CAGtE,MAAM,OAA2B,CAAC;CAClC,IAAI,QAAQ;CACZ,KAAK,I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C,CAAC,CAAC;GACd,QAAQ,GAAG,CAAC,CAAC,CAAC;EAChB;EACA,MAAM,QAAQ,KAAK,IAAI,GAAG,UAAU,SAAS;EAC7C,QAAQ;EACR,QAAQ;EAGR,MAAM,aAAa,OAAO,IAAI,KAAK,MAAM,SAAS,UAAU;EAC5D,MAAM,WAAW,KAAK,IAAI,KAAK,GAAG,OAAO,IAAI,KAAK,OAAO,SAAS,KAAK,UAAU,CAAC;EAClF,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;EACrB,IAAI,OAAO;EACX,IAAI,WAAW;EACf,KAAK,IAAI,IAAI,YAAY,IAAI,UAAU,KAAK;GAC1C,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC;GACnB,MAAM,OAAO,KAAK,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,MAAM,OAAO,GAAG;GACrE,IAAI,OAAO,UAAU;IACnB,WAAW;IACX,OAAO;GACT;EACF;EACA,IAAI,KAAK,IAAI;EACb,IAAI;CACN;CACA,IAAI,KAAK,KAAK,CAAC;AACjB;;AAGA,SAAgB,KAAK,QAA0B,WAA4B;CACzE,OAAO,YAAY,QAAQ,SAAS,CAAC,CAAC,KAAK,MAAM,OAAO,EAAE;AAC5D"}
@@ -1,5 +1,4 @@
1
- import { r as Point } from "./path-CwB28da0.js";
2
- //#region src/shapes/decimate.d.ts
1
+ import { r as Point } from "./path-YeUiOfG8.cjs";
3
2
  /**
4
3
  * Largest-Triangle-Three-Buckets downsampling (Sveinn Steinarsson, 2013):
5
4
  * keep roughly `threshold` points that preserve the visual shape of a line,
@@ -12,6 +11,4 @@ import { r as Point } from "./path-CwB28da0.js";
12
11
  declare function lttbIndices(points: readonly Point[], threshold: number): number[];
13
12
  /** The points kept by {@link lttbIndices}, gaps included. */
14
13
  declare function lttb(points: readonly Point[], threshold: number): Point[];
15
- //#endregion
16
- export { lttbIndices as n, lttb as t };
17
- //# sourceMappingURL=decimate-BGg9XgF0.d.ts.map
14
+ export { lttbIndices as n, lttb as t };
@@ -1,4 +1,4 @@
1
- //#region src/shapes/decimate.ts
1
+ // src/shapes/decimate.ts
2
2
  /**
3
3
  * Largest-Triangle-Three-Buckets downsampling (Sveinn Steinarsson, 2013):
4
4
  * keep roughly `threshold` points that preserve the visual shape of a line,
@@ -78,7 +78,6 @@ function sampleRun(points, from, to, budget, out) {
78
78
  function lttb(points, threshold) {
79
79
  return lttbIndices(points, threshold).map((i) => points[i]);
80
80
  }
81
- //#endregion
82
81
  export { lttbIndices as n, lttb as t };
83
82
 
84
- //# sourceMappingURL=decimate-C87cl_Sp.js.map
83
+ //# sourceMappingURL=decimate-CapfgiDY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decimate-C87cl_Sp.js","names":[],"sources":["../src/shapes/decimate.ts"],"sourcesContent":["import type { Point } from './path.ts'\n\n/**\n * Largest-Triangle-Three-Buckets downsampling (Sveinn Steinarsson, 2013):\n * keep roughly `threshold` points that preserve the visual shape of a line,\n * including its peaks and valleys.\n *\n * Returns the indices to keep, in order. Gaps (`null` points) are kept as\n * gap markers and every run between gaps is sampled on its own, so the\n * result lines up with any per-index data (e.g. stacked baselines).\n */\nexport function lttbIndices(points: readonly Point[], threshold: number): number[] {\n const n = points.length\n if (!(threshold >= 3) || n <= threshold) return points.map((_, i) => i)\n\n // Split into runs of valid points.\n const runs: [number, number][] = []\n let start = -1\n for (let i = 0; i < n; i++) {\n const valid = points[i] != null\n if (valid && start === -1) start = i\n if (!valid && start !== -1) {\n runs.push([start, i])\n start = -1\n }\n }\n if (start !== -1) runs.push([start, n])\n const valid = runs.reduce((sum, [a, b]) => sum + (b - a), 0)\n\n const out: number[] = []\n let last = 0\n for (const [a, b] of runs) {\n // One gap marker between runs; everything else in the gap is dropped.\n if (a > last) out.push(last)\n // Each run gets a share of the budget (at least its two ends).\n const budget = Math.max(2, Math.round((threshold * (b - a)) / valid))\n sampleRun(points, a, b, budget, out)\n last = b\n }\n if (last < n) out.push(last)\n return out\n}\n\n/** LTTB over `points[from, to)`, pushing kept indices to `out`. */\nfunction sampleRun(\n points: readonly Point[],\n from: number,\n to: number,\n budget: number,\n out: number[],\n): void {\n const n = to - from\n if (n <= budget) {\n for (let i = from; i < to; i++) out.push(i)\n return\n }\n const at = (i: number) => points[i] as readonly [number, number]\n const bucketSize = (n - 2) / (budget - 2)\n let a = from\n out.push(a)\n\n for (let bucket = 0; bucket < budget - 2; bucket++) {\n // Average of the next bucket is the third corner of every candidate triangle.\n const nextStart = from + 1 + Math.floor((bucket + 1) * bucketSize)\n const nextEnd = Math.min(to, from + 1 + Math.floor((bucket + 2) * bucketSize))\n let avgX = 0\n let avgY = 0\n for (let i = nextStart; i < nextEnd; i++) {\n avgX += at(i)[0]\n avgY += at(i)[1]\n }\n const count = Math.max(1, nextEnd - nextStart)\n avgX /= count\n avgY /= count\n\n // The point of this bucket forming the largest triangle with `a` and the average.\n const rangeStart = from + 1 + Math.floor(bucket * bucketSize)\n const rangeEnd = Math.min(to - 1, from + 1 + Math.floor((bucket + 1) * bucketSize))\n const [ax, ay] = at(a)\n let best = rangeStart\n let bestArea = -1\n for (let i = rangeStart; i < rangeEnd; i++) {\n const [x, y] = at(i)\n const area = Math.abs((ax - avgX) * (y - ay) - (ax - x) * (avgY - ay))\n if (area > bestArea) {\n bestArea = area\n best = i\n }\n }\n out.push(best)\n a = best\n }\n out.push(to - 1)\n}\n\n/** The points kept by {@link lttbIndices}, gaps included. */\nexport function lttb(points: readonly Point[], threshold: number): Point[] {\n return lttbIndices(points, threshold).map((i) => points[i])\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,YAAY,QAA0B,WAA6B;CACjF,MAAM,IAAI,OAAO;CACjB,IAAI,EAAE,aAAa,MAAM,KAAK,WAAW,OAAO,OAAO,KAAK,GAAG,MAAM,CAAC;CAGtE,MAAM,OAA2B,CAAC;CAClC,IAAI,QAAQ;CACZ,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;EAC1B,MAAM,QAAQ,OAAO,MAAM;E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AAQ,KAAK,IAAI,GAAG,UAAU,SAAS;EAC7C,QAAQ;EACR,QAAQ;EAGR,MAAM,aAAa,OAAO,IAAI,KAAK,MAAM,SAAS,UAAU;EAC5D,MAAM,WAAW,KAAK,IAAI,KAAK,GAAG,OAAO,IAAI,KAAK,OAAO,SAAS,KAAK,UAAU,CAAC;EAClF,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;EACrB,IAAI,OAAO;EACX,IAAI,WAAW;EACf,KAAK,IAAI,IAAI,YAAY,IAAI,UAAU,KAAK;GAC1C,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC;GACnB,MAAM,OAAO,KAAK,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,MAAM,OAAO,GAAG;GACrE,IAAI,OAAO,UAAU;IACnB,WAAW;IACX,OAAO;GACT;EACF;EACA,IAAI,KAAK,IAAI;EACb,IAAI;CACN;CACA,IAAI,KAAK,KAAK,CAAC;AACjB;;AAGA,SAAgB,KAAK,QAA0B,WAA4B;CACzE,OAAO,YAAY,QAAQ,SAAS,CAAC,CAAC,KAAK,MAAM,OAAO,EAAE;AAC5D"}
1
+ {"version":3,"file":"decimate-CapfgiDY.js","names":[],"sources":["../src/shapes/decimate.ts"],"sourcesContent":["import type { Point } from './path.ts'\n\n/**\n * Largest-Triangle-Three-Buckets downsampling (Sveinn Steinarsson, 2013):\n * keep roughly `threshold` points that preserve the visual shape of a line,\n * including its peaks and valleys.\n *\n * Returns the indices to keep, in order. Gaps (`null` points) are kept as\n * gap markers and every run between gaps is sampled on its own, so the\n * result lines up with any per-index data (e.g. stacked baselines).\n */\nexport function lttbIndices(points: readonly Point[], threshold: number): number[] {\n const n = points.length\n if (!(threshold >= 3) || n <= threshold) return points.map((_, i) => i)\n\n // Split into runs of valid points.\n const runs: [number, number][] = []\n let start = -1\n for (let i = 0; i < n; i++) {\n const valid = points[i] != null\n if (valid && start === -1) start = i\n if (!valid && start !== -1) {\n runs.push([start, i])\n start = -1\n }\n }\n if (start !== -1) runs.push([start, n])\n const valid = runs.reduce((sum, [a, b]) => sum + (b - a), 0)\n\n const out: number[] = []\n let last = 0\n for (const [a, b] of runs) {\n // One gap marker between runs; everything else in the gap is dropped.\n if (a > last) out.push(last)\n // Each run gets a share of the budget (at least its two ends).\n const budget = Math.max(2, Math.round((threshold * (b - a)) / valid))\n sampleRun(points, a, b, budget, out)\n last = b\n }\n if (last < n) out.push(last)\n return out\n}\n\n/** LTTB over `points[from, to)`, pushing kept indices to `out`. */\nfunction sampleRun(\n points: readonly Point[],\n from: number,\n to: number,\n budget: number,\n out: number[],\n): void {\n const n = to - from\n if (n <= budget) {\n for (let i = from; i < to; i++) out.push(i)\n return\n }\n const at = (i: number) => points[i] as readonly [number, number]\n const bucketSize = (n - 2) / (budget - 2)\n let a = from\n out.push(a)\n\n for (let bucket = 0; bucket < budget - 2; bucket++) {\n // Average of the next bucket is the third corner of every candidate triangle.\n const nextStart = from + 1 + Math.floor((bucket + 1) * bucketSize)\n const nextEnd = Math.min(to, from + 1 + Math.floor((bucket + 2) * bucketSize))\n let avgX = 0\n let avgY = 0\n for (let i = nextStart; i < nextEnd; i++) {\n avgX += at(i)[0]\n avgY += at(i)[1]\n }\n const count = Math.max(1, nextEnd - nextStart)\n avgX /= count\n avgY /= count\n\n // The point of this bucket forming the largest triangle with `a` and the average.\n const rangeStart = from + 1 + Math.floor(bucket * bucketSize)\n const rangeEnd = Math.min(to - 1, from + 1 + Math.floor((bucket + 1) * bucketSize))\n const [ax, ay] = at(a)\n let best = rangeStart\n let bestArea = -1\n for (let i = rangeStart; i < rangeEnd; i++) {\n const [x, y] = at(i)\n const area = Math.abs((ax - avgX) * (y - ay) - (ax - x) * (avgY - ay))\n if (area > bestArea) {\n bestArea = area\n best = i\n }\n }\n out.push(best)\n a = best\n }\n out.push(to - 1)\n}\n\n/** The points kept by {@link lttbIndices}, gaps included. */\nexport function lttb(points: readonly Point[], threshold: number): Point[] {\n return lttbIndices(points, threshold).map((i) => points[i])\n}\n"],"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AO,SAAS,KAAK,UAAU;EACjE,MAAM,UAAU,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,OAAO,SAAS,KAAK,UAAU,CAAC;EAC7E,IAAI,OAAO;EACX,IAAI,OAAO;EACX,KAAK,IAAI,IAAI,WAAW,IAAI,SAAS,KAAK;GACxC,QAAQ,GAAG,CAAC,CAAC,CAAC;GACd,QAAQ,GAAG,CAAC,CAAC,CAAC;EAChB;EACA,MAAM,QAAQ,KAAK,IAAI,GAAG,UAAU,SAAS;EAC7C,QAAQ;EACR,QAAQ;EAGR,MAAM,aAAa,OAAO,IAAI,KAAK,MAAM,SAAS,UAAU;EAC5D,MAAM,WAAW,KAAK,IAAI,KAAK,GAAG,OAAO,IAAI,KAAK,OAAO,SAAS,KAAK,UAAU,CAAC;EAClF,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;EACrB,IAAI,OAAO;EACX,IAAI,WAAW;EACf,KAAK,IAAI,IAAI,YAAY,IAAI,UAAU,KAAK;GAC1C,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC;GACnB,MAAM,OAAO,KAAK,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,MAAM,OAAO,GAAG;GACrE,IAAI,OAAO,UAAU;IACnB,WAAW;IACX,OAAO;GACT;EACF;EACA,IAAI,KAAK,IAAI;EACb,IAAI;CACN;CACA,IAAI,KAAK,KAAK,CAAC;AACjB;;AAGA,SAAgB,KAAK,QAA0B,WAA4B;CACzE,OAAO,YAAY,QAAQ,SAAS,CAAC,CAAC,KAAK,MAAM,OAAO,EAAE;AAC5D"}
@@ -1,5 +1,4 @@
1
- import { r as Point } from "./path-CwB28da0.cjs";
2
- //#region src/shapes/decimate.d.ts
1
+ import { r as Point } from "./path-YeUiOfG8.js";
3
2
  /**
4
3
  * Largest-Triangle-Three-Buckets downsampling (Sveinn Steinarsson, 2013):
5
4
  * keep roughly `threshold` points that preserve the visual shape of a line,
@@ -12,6 +11,4 @@ import { r as Point } from "./path-CwB28da0.cjs";
12
11
  declare function lttbIndices(points: readonly Point[], threshold: number): number[];
13
12
  /** The points kept by {@link lttbIndices}, gaps included. */
14
13
  declare function lttb(points: readonly Point[], threshold: number): Point[];
15
- //#endregion
16
- export { lttbIndices as n, lttb as t };
17
- //# sourceMappingURL=decimate-CNSpgGa5.d.cts.map
14
+ export { lttbIndices as n, lttb as t };
package/dist/decimate.cjs CHANGED
@@ -1,13 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_features = require("./features-BclHgg2W.cjs");
3
- const require_decimate = require("./decimate-tLhDk1ys.cjs");
4
- //#region src/decimate.ts
2
+ const require_features = require("./features-DEDP5CEQ.cjs");
3
+ const require_decimate = require("./decimate-BS3x8g-f.cjs");
4
+ // src/decimate.ts
5
5
  /**
6
6
  * Registers LTTB downsampling (`decimate: N` on line and area charts):
7
7
  * `import '@tabler/charts/decimate'`. Also exports the algorithm itself.
8
8
  */
9
9
  require_features.register({ decimate: require_decimate.lttbIndices });
10
- //#endregion
11
10
  exports.lttb = require_decimate.lttb;
12
11
  exports.lttbIndices = require_decimate.lttbIndices;
13
12
 
@@ -1,2 +1,2 @@
1
- import { n as lttbIndices, t as lttb } from "./decimate-CNSpgGa5.cjs";
1
+ import { n as lttbIndices, t as lttb } from "./decimate-BxxYBJJk.cjs";
2
2
  export { lttb, lttbIndices };
@@ -1,2 +1,2 @@
1
- import { n as lttbIndices, t as lttb } from "./decimate-BGg9XgF0.js";
1
+ import { n as lttbIndices, t as lttb } from "./decimate-Du87fMLG.js";
2
2
  export { lttb, lttbIndices };
package/dist/decimate.js CHANGED
@@ -1,12 +1,11 @@
1
- import { i as register } from "./features-wASyHGic.js";
2
- import { n as lttbIndices, t as lttb } from "./decimate-C87cl_Sp.js";
3
- //#region src/decimate.ts
1
+ import { i as register } from "./features-B55rwpQC.js";
2
+ import { n as lttbIndices, t as lttb } from "./decimate-CapfgiDY.js";
3
+ // src/decimate.ts
4
4
  /**
5
5
  * Registers LTTB downsampling (`decimate: N` on line and area charts):
6
6
  * `import '@tabler/charts/decimate'`. Also exports the algorithm itself.
7
7
  */
8
8
  register({ decimate: lttbIndices });
9
- //#endregion
10
9
  export { lttb, lttbIndices };
11
10
 
12
11
  //# sourceMappingURL=decimate.js.map
@@ -1,5 +1,5 @@
1
- const require_features = require("./features-BclHgg2W.cjs");
2
- //#region src/render/attrs.ts
1
+ const require_features = require("./features-DEDP5CEQ.cjs");
2
+ // src/render/attrs.ts
3
3
  /** Valid XML-ish tag and attribute names; anything else is skipped by renderers. */
4
4
  const NAME_RE = /^[a-zA-Z_][\w:.-]*$/;
5
5
  /** Inline event handler attributes (`onclick`, `onLoad`…) are never rendered. */
@@ -12,8 +12,7 @@ function isValidTag(name) {
12
12
  function isValidAttr(name) {
13
13
  return NAME_RE.test(name) && !EVENT_RE.test(name);
14
14
  }
15
- //#endregion
16
- //#region src/render/dom.ts
15
+ // src/render/dom.ts
17
16
  const SVG_NS = "http://www.w3.org/2000/svg";
18
17
  const HTML_NS = "http://www.w3.org/1999/xhtml";
19
18
  /** VNode each rendered DOM node was last patched with. */
@@ -59,11 +58,7 @@ function render(container, vnode, replace) {
59
58
  roots.set(container, el);
60
59
  return el;
61
60
  }
62
- function namespaceFor(parent, tag) {
63
- if (tag === "svg") return SVG_NS;
64
- if (parent.namespaceURI === "http://www.w3.org/2000/svg" && parent.localName !== "foreignObject") return SVG_NS;
65
- return HTML_NS;
66
- }
61
+ const namespaceFor = (parent, tag) => tag === "svg" ? SVG_NS : childNamespace(parent);
67
62
  function childNamespace(el) {
68
63
  return el.namespaceURI === "http://www.w3.org/2000/svg" && el.localName !== "foreignObject" ? SVG_NS : HTML_NS;
69
64
  }
@@ -169,7 +164,6 @@ function patchChildren(parent, next) {
169
164
  anchor = node;
170
165
  }
171
166
  }
172
- //#endregion
173
167
  Object.defineProperty(exports, "SVG_NS", {
174
168
  enumerable: true,
175
169
  get: function() {
@@ -219,4 +213,4 @@ Object.defineProperty(exports, "rendered", {
219
213
  }
220
214
  });
221
215
 
222
- //# sourceMappingURL=dom-CLF868Qs.cjs.map
216
+ //# sourceMappingURL=dom-C33zvtPo.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-C33zvtPo.cjs","names":["features"],"sources":["../src/render/attrs.ts","../src/render/dom.ts"],"sourcesContent":["/** Valid XML-ish tag and attribute names; anything else is skipped by renderers. */\nconst NAME_RE = /^[a-zA-Z_][\\w:.-]*$/\n\n/** Inline event handler attributes (`onclick`, `onLoad`…) are never rendered. */\nconst EVENT_RE = /^on/i\n\n/** Whether a tag name is safe to render. */\nexport function isValidTag(name: string): boolean {\n return NAME_RE.test(name)\n}\n\n/** Whether an attribute name is safe to render. */\nexport function isValidAttr(name: string): boolean {\n return NAME_RE.test(name) && !EVENT_RE.test(name)\n}\n","import { features } from '../features.ts'\nimport type { Attrs, Child, VNode } from '../vnode.ts'\nimport { isValidAttr, isValidTag } from './attrs.ts'\n\nexport const SVG_NS = 'http://www.w3.org/2000/svg'\nconst HTML_NS = 'http://www.w3.org/1999/xhtml'\n\n/** VNode each rendered DOM node was last patched with. */\nexport const rendered: WeakMap<Node, Child> = /* @__PURE__ */ new WeakMap<Node, Child>()\n\n/** Root element rendered into each container. */\nconst roots = /* @__PURE__ */ new WeakMap<Element, Element>()\n\n/**\n * Render a VNode tree into `container`.\n *\n * The first call mounts the tree; later calls patch the existing DOM in place,\n * reusing nodes matched by `key` (or by position for unkeyed children), so CSS\n * transitions on changed attributes keep working. Passing `null` unmounts.\n *\n * The rendered root is appended to `container`; other content of the\n * container is left untouched. On the first call, `replace` names an element\n * already in the container (e.g. server-rendered markup) for the root: when\n * it has the root's tag and `@tabler/charts/hydrate` is loaded (it is part\n * of `@tabler/charts`), its nodes are hydrated: reused and patched to the\n * tree, so nothing is re-created and entrance animations do not run again.\n * Otherwise the root takes its place.\n */\nexport function render(\n container: Element,\n vnode: VNode | null,\n replace?: Element | null,\n): Element | null {\n const prev = roots.get(container) ?? (replace?.parentNode === container ? replace : undefined)\n\n if (vnode === null || !isValidTag(vnode.tag)) {\n if (prev) {\n prev.remove()\n roots.delete(container)\n }\n return null\n }\n\n if (prev && canPatch(prev, vnode)) {\n patchElement(prev, vnode)\n roots.set(container, prev)\n return prev\n }\n\n if (prev && features.hydrate?.(prev, vnode, namespaceFor(container, vnode.tag))) {\n roots.set(container, prev)\n return prev\n }\n\n const el = createElement(vnode, namespaceFor(container, vnode.tag), container.ownerDocument)\n if (prev) prev.replaceWith(el)\n else container.appendChild(el)\n roots.set(container, el)\n return el\n}\n\nconst namespaceFor = (parent: Element, tag: string): string =>\n tag === 'svg' ? SVG_NS : childNamespace(parent)\n\nexport function childNamespace(el: Element): string {\n return el.namespaceURI === SVG_NS && el.localName !== 'foreignObject' ? SVG_NS : HTML_NS\n}\n\nexport function createNode(child: Child, ns: string, doc: Document): Node | null {\n if (typeof child === 'string') {\n const text = doc.createTextNode(child)\n rendered.set(text, child)\n return text\n }\n if (!isValidTag(child.tag)) return null\n return createElement(child, child.tag === 'svg' ? SVG_NS : ns, doc)\n}\n\n/**\n * Styles go through the CSSOM: a strict CSP (`style-src` without\n * 'unsafe-inline') blocks style attributes set with setAttribute, not these.\n */\nfunction setAttr(el: Element, name: string, value: string): void {\n if (name === 'style') (el as HTMLElement).style.cssText = value\n else el.setAttribute(name, value)\n}\n\nfunction createElement(vnode: VNode, ns: string, doc: Document): Element {\n const el = doc.createElementNS(ns, vnode.tag)\n const { attrs } = vnode\n for (const name in attrs) {\n if (isValidAttr(name)) setAttr(el, name, String(attrs[name]))\n }\n const childNs = childNamespace(el)\n for (const child of vnode.children) {\n const node = createNode(child, childNs, doc)\n if (node) el.appendChild(node)\n }\n rendered.set(el, vnode)\n return el\n}\n\nfunction canPatch(node: Node, next: Child): boolean {\n const prev = rendered.get(node)\n if (prev === undefined) return false\n if (typeof next === 'string') return typeof prev === 'string'\n return typeof prev !== 'string' && prev.tag === next.tag && prev.key === next.key\n}\n\nfunction patchNode(node: Node, next: Child): void {\n if (typeof next === 'string') {\n if (rendered.get(node) !== next) {\n ;(node as Text).data = next\n rendered.set(node, next)\n }\n return\n }\n patchElement(node as Element, next)\n}\n\nfunction patchElement(el: Element, next: VNode): void {\n const prev = rendered.get(el) as VNode\n if (prev === next) return\n // An arc sweeps to its new angles, setting its `d` itself on the way: the\n // sweep feature then says what is left to patch.\n patchAttrs(el, prev.attrs, features.sweep?.(el, prev, next) ?? next.attrs, true)\n patchChildren(el, next.children)\n rendered.set(el, next)\n}\n\nexport function patchAttrs(el: Element, prev: Attrs, next: Attrs, update = false): void {\n for (const name in next) {\n const value = next[name] as string | number\n if (prev[name] === value || !isValidAttr(name)) continue\n // Where CSS cannot transition `d` (Safari), the morph feature animates it.\n if (update && name === 'd' && features.morph?.(el, String(prev[name] ?? ''), String(value))) {\n continue\n }\n setAttr(el, name, String(value))\n }\n for (const name in prev) {\n if (!(name in next) && isValidAttr(name)) el.removeAttribute(name)\n }\n}\n\nfunction patchChildren(parent: Element, next: Child[]): void {\n if (next.length === 0 && parent.firstChild === null) return\n\n const oldNodes = Array.from(parent.childNodes)\n const keyed = new Map<unknown, Node>()\n const unkeyed: Node[] = []\n\n for (const node of oldNodes) {\n const vnode = rendered.get(node)\n if (vnode === undefined) continue\n if (typeof vnode !== 'string' && vnode.key !== undefined) keyed.set(vnode.key, node)\n else unkeyed.push(node)\n }\n\n // Match new children against existing nodes.\n const matched = new Array<Node | undefined>(next.length)\n const used = new Set<Node>()\n let cursor = 0\n for (let i = 0; i < next.length; i++) {\n const child = next[i] as Child\n let candidate: Node | undefined\n if (typeof child !== 'string' && child.key !== undefined) {\n candidate = keyed.get(child.key)\n } else if (cursor < unkeyed.length) {\n candidate = unkeyed[cursor]\n }\n if (candidate && !used.has(candidate) && canPatch(candidate, child)) {\n matched[i] = candidate\n used.add(candidate)\n if (candidate === unkeyed[cursor]) cursor++\n }\n }\n\n // Remove unmatched nodes first, so placing the rest needs as few moves as possible.\n for (const node of oldNodes) {\n if (!used.has(node)) parent.removeChild(node)\n }\n\n // Patch or create, then place from the end using the next sibling as anchor.\n const ns = childNamespace(parent)\n const doc = parent.ownerDocument\n let anchor: Node | null = null\n for (let i = next.length - 1; i >= 0; i--) {\n const child = next[i] as Child\n let node = matched[i]\n if (node) {\n patchNode(node, child)\n } else {\n node = createNode(child, ns, doc) ?? undefined\n if (!node) continue\n }\n if (node.parentNode !== parent || node.nextSibling !== anchor) {\n parent.insertBefore(node, anchor)\n }\n anchor = node\n }\n}\n"],"mappings":";;;AACA,MAAM,UAAU;;AAGhB,MAAM,WAAW;;AAGjB,SAAgB,WAAW,MAAuB;CAChD,OAAO,QAAQ,KAAK,IAAI;AAC1B;;AAGA,SAAgB,YAAY,MAAuB;CACjD,OAAO,QAAQ,KAAK,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI;AAClD;;ACVA,MAAa,SAAS;AACtB,MAAM,UAAU;;AAGhB,MAAa,2BAAiD,IAAI,QAAqB;;AAGvF,MAAM,wBAAwB,IAAI,QAA0B;;;;;;;;;;;;;;;;AAiB5D,SAAgB,OACd,WACA,OACA,SACgB;CAChB,MAAM,OAAO,MAAM,IAAI,SAAS,MAAM,SAAS,eAAe,YAAY,UAAU,KAAA;CAEpF,IAAI,UAAU,QAAQ,CAAC,WAAW,MAAM,GAAG,GAAG;EAC5C,IAAI,MAAM;GACR,KAAK,OAAO;GACZ,MAAM,OAAO,SAAS;EACxB;EACA,OAAO;CACT;CAEA,IAAI,QAAQ,SAAS,MAAM,KAAK,GAAG;EACjC,aAAa,MAAM,KAAK;EACxB,MAAM,IAAI,WAAW,IAAI;EACzB,OAAO;CACT;CAEA,IAAI,QAAQA,iBAAAA,SAAS,UAAU,MAAM,OAAO,aAAa,WAAW,MAAM,GAAG,CAAC,GAAG;EAC/E,MAAM,IAAI,WAAW,IAAI;EACzB,OAAO;CACT;CAEA,MAAM,KAAK,cAAc,OAAO,aAAa,WAAW,MAAM,GAAG,GAAG,UAAU,aAAa;CAC3F,IAAI,MAAM,KAAK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,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAA,GAAW,MAAM,IAAI,MAAM,KAAK,IAAI;OAC9E,QAAQ,KAAK,IAAI;CACxB;CAGA,MAAM,UAAU,IAAI,MAAwB,KAAK,MAAM;CACvD,MAAM,uBAAO,IAAI,IAAU;CAC3B,IAAI,SAAS;CACb,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,QAAQ,KAAK;EACnB,IAAI;EACJ,IAAI,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAA,GAC7C,YAAY,MAAM,IAAI,MAAM,GAAG;OAC1B,IAAI,SAAS,QAAQ,QAC1B,YAAY,QAAQ;EAEtB,IAAI,aAAa,CAAC,KAAK,IAAI,SAAS,KAAK,SAAS,WAAW,KAAK,GAAG;GACnE,QAAQ,KAAK;GACb,KAAK,IAAI,SAAS;GAClB,IAAI,cAAc,QAAQ,SAAS;EACrC;CACF;CAGA,KAAK,MAAM,QAAQ,UACjB,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG,OAAO,YAAY,IAAI;CAI9C,MAAM,KAAK,eAAe,MAAM;CAChC,MAAM,MAAM,OAAO;CACnB,IAAI,SAAsB;CAC1B,KAAK,IAAI,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK;EACzC,MAAM,QAAQ,KAAK;EACnB,IAAI,OAAO,QAAQ;EACnB,IAAI,MACF,UAAU,MAAM,KAAK;OAChB;GACL,OAAO,WAAW,OAAO,IAAI,GAAG,KAAK,KAAA;GACrC,IAAI,CAAC,MAAM;EACb;EACA,IAAI,KAAK,eAAe,UAAU,KAAK,gBAAgB,QACrD,OAAO,aAAa,MAAM,MAAM;EAElC,SAAS;CACX;AACF"}
@@ -1,5 +1,5 @@
1
- import { r as features } from "./features-wASyHGic.js";
2
- //#region src/render/attrs.ts
1
+ import { r as features } from "./features-B55rwpQC.js";
2
+ // src/render/attrs.ts
3
3
  /** Valid XML-ish tag and attribute names; anything else is skipped by renderers. */
4
4
  const NAME_RE = /^[a-zA-Z_][\w:.-]*$/;
5
5
  /** Inline event handler attributes (`onclick`, `onLoad`…) are never rendered. */
@@ -12,8 +12,7 @@ function isValidTag(name) {
12
12
  function isValidAttr(name) {
13
13
  return NAME_RE.test(name) && !EVENT_RE.test(name);
14
14
  }
15
- //#endregion
16
- //#region src/render/dom.ts
15
+ // src/render/dom.ts
17
16
  const SVG_NS = "http://www.w3.org/2000/svg";
18
17
  const HTML_NS = "http://www.w3.org/1999/xhtml";
19
18
  /** VNode each rendered DOM node was last patched with. */
@@ -59,11 +58,7 @@ function render(container, vnode, replace) {
59
58
  roots.set(container, el);
60
59
  return el;
61
60
  }
62
- function namespaceFor(parent, tag) {
63
- if (tag === "svg") return SVG_NS;
64
- if (parent.namespaceURI === "http://www.w3.org/2000/svg" && parent.localName !== "foreignObject") return SVG_NS;
65
- return HTML_NS;
66
- }
61
+ const namespaceFor = (parent, tag) => tag === "svg" ? SVG_NS : childNamespace(parent);
67
62
  function childNamespace(el) {
68
63
  return el.namespaceURI === "http://www.w3.org/2000/svg" && el.localName !== "foreignObject" ? SVG_NS : HTML_NS;
69
64
  }
@@ -169,7 +164,6 @@ function patchChildren(parent, next) {
169
164
  anchor = node;
170
165
  }
171
166
  }
172
- //#endregion
173
167
  export { render as a, isValidTag as c, patchAttrs as i, childNamespace as n, rendered as o, createNode as r, isValidAttr as s, SVG_NS as t };
174
168
 
175
- //# sourceMappingURL=dom-vP3IcMak.js.map
169
+ //# sourceMappingURL=dom-CTse6Rvd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-CTse6Rvd.js","names":[],"sources":["../src/render/attrs.ts","../src/render/dom.ts"],"sourcesContent":["/** Valid XML-ish tag and attribute names; anything else is skipped by renderers. */\nconst NAME_RE = /^[a-zA-Z_][\\w:.-]*$/\n\n/** Inline event handler attributes (`onclick`, `onLoad`…) are never rendered. */\nconst EVENT_RE = /^on/i\n\n/** Whether a tag name is safe to render. */\nexport function isValidTag(name: string): boolean {\n return NAME_RE.test(name)\n}\n\n/** Whether an attribute name is safe to render. */\nexport function isValidAttr(name: string): boolean {\n return NAME_RE.test(name) && !EVENT_RE.test(name)\n}\n","import { features } from '../features.ts'\nimport type { Attrs, Child, VNode } from '../vnode.ts'\nimport { isValidAttr, isValidTag } from './attrs.ts'\n\nexport const SVG_NS = 'http://www.w3.org/2000/svg'\nconst HTML_NS = 'http://www.w3.org/1999/xhtml'\n\n/** VNode each rendered DOM node was last patched with. */\nexport const rendered: WeakMap<Node, Child> = /* @__PURE__ */ new WeakMap<Node, Child>()\n\n/** Root element rendered into each container. */\nconst roots = /* @__PURE__ */ new WeakMap<Element, Element>()\n\n/**\n * Render a VNode tree into `container`.\n *\n * The first call mounts the tree; later calls patch the existing DOM in place,\n * reusing nodes matched by `key` (or by position for unkeyed children), so CSS\n * transitions on changed attributes keep working. Passing `null` unmounts.\n *\n * The rendered root is appended to `container`; other content of the\n * container is left untouched. On the first call, `replace` names an element\n * already in the container (e.g. server-rendered markup) for the root: when\n * it has the root's tag and `@tabler/charts/hydrate` is loaded (it is part\n * of `@tabler/charts`), its nodes are hydrated: reused and patched to the\n * tree, so nothing is re-created and entrance animations do not run again.\n * Otherwise the root takes its place.\n */\nexport function render(\n container: Element,\n vnode: VNode | null,\n replace?: Element | null,\n): Element | null {\n const prev = roots.get(container) ?? (replace?.parentNode === container ? replace : undefined)\n\n if (vnode === null || !isValidTag(vnode.tag)) {\n if (prev) {\n prev.remove()\n roots.delete(container)\n }\n return null\n }\n\n if (prev && canPatch(prev, vnode)) {\n patchElement(prev, vnode)\n roots.set(container, prev)\n return prev\n }\n\n if (prev && features.hydrate?.(prev, vnode, namespaceFor(container, vnode.tag))) {\n roots.set(container, prev)\n return prev\n }\n\n const el = createElement(vnode, namespaceFor(container, vnode.tag), container.ownerDocument)\n if (prev) prev.replaceWith(el)\n else container.appendChild(el)\n roots.set(container, el)\n return el\n}\n\nconst namespaceFor = (parent: Element, tag: string): string =>\n tag === 'svg' ? SVG_NS : childNamespace(parent)\n\nexport function childNamespace(el: Element): string {\n return el.namespaceURI === SVG_NS && el.localName !== 'foreignObject' ? SVG_NS : HTML_NS\n}\n\nexport function createNode(child: Child, ns: string, doc: Document): Node | null {\n if (typeof child === 'string') {\n const text = doc.createTextNode(child)\n rendered.set(text, child)\n return text\n }\n if (!isValidTag(child.tag)) return null\n return createElement(child, child.tag === 'svg' ? SVG_NS : ns, doc)\n}\n\n/**\n * Styles go through the CSSOM: a strict CSP (`style-src` without\n * 'unsafe-inline') blocks style attributes set with setAttribute, not these.\n */\nfunction setAttr(el: Element, name: string, value: string): void {\n if (name === 'style') (el as HTMLElement).style.cssText = value\n else el.setAttribute(name, value)\n}\n\nfunction createElement(vnode: VNode, ns: string, doc: Document): Element {\n const el = doc.createElementNS(ns, vnode.tag)\n const { attrs } = vnode\n for (const name in attrs) {\n if (isValidAttr(name)) setAttr(el, name, String(attrs[name]))\n }\n const childNs = childNamespace(el)\n for (const child of vnode.children) {\n const node = createNode(child, childNs, doc)\n if (node) el.appendChild(node)\n }\n rendered.set(el, vnode)\n return el\n}\n\nfunction canPatch(node: Node, next: Child): boolean {\n const prev = rendered.get(node)\n if (prev === undefined) return false\n if (typeof next === 'string') return typeof prev === 'string'\n return typeof prev !== 'string' && prev.tag === next.tag && prev.key === next.key\n}\n\nfunction patchNode(node: Node, next: Child): void {\n if (typeof next === 'string') {\n if (rendered.get(node) !== next) {\n ;(node as Text).data = next\n rendered.set(node, next)\n }\n return\n }\n patchElement(node as Element, next)\n}\n\nfunction patchElement(el: Element, next: VNode): void {\n const prev = rendered.get(el) as VNode\n if (prev === next) return\n // An arc sweeps to its new angles, setting its `d` itself on the way: the\n // sweep feature then says what is left to patch.\n patchAttrs(el, prev.attrs, features.sweep?.(el, prev, next) ?? next.attrs, true)\n patchChildren(el, next.children)\n rendered.set(el, next)\n}\n\nexport function patchAttrs(el: Element, prev: Attrs, next: Attrs, update = false): void {\n for (const name in next) {\n const value = next[name] as string | number\n if (prev[name] === value || !isValidAttr(name)) continue\n // Where CSS cannot transition `d` (Safari), the morph feature animates it.\n if (update && name === 'd' && features.morph?.(el, String(prev[name] ?? ''), String(value))) {\n continue\n }\n setAttr(el, name, String(value))\n }\n for (const name in prev) {\n if (!(name in next) && isValidAttr(name)) el.removeAttribute(name)\n }\n}\n\nfunction patchChildren(parent: Element, next: Child[]): void {\n if (next.length === 0 && parent.firstChild === null) return\n\n const oldNodes = Array.from(parent.childNodes)\n const keyed = new Map<unknown, Node>()\n const unkeyed: Node[] = []\n\n for (const node of oldNodes) {\n const vnode = rendered.get(node)\n if (vnode === undefined) continue\n if (typeof vnode !== 'string' && vnode.key !== undefined) keyed.set(vnode.key, node)\n else unkeyed.push(node)\n }\n\n // Match new children against existing nodes.\n const matched = new Array<Node | undefined>(next.length)\n const used = new Set<Node>()\n let cursor = 0\n for (let i = 0; i < next.length; i++) {\n const child = next[i] as Child\n let candidate: Node | undefined\n if (typeof child !== 'string' && child.key !== undefined) {\n candidate = keyed.get(child.key)\n } else if (cursor < unkeyed.length) {\n candidate = unkeyed[cursor]\n }\n if (candidate && !used.has(candidate) && canPatch(candidate, child)) {\n matched[i] = candidate\n used.add(candidate)\n if (candidate === unkeyed[cursor]) cursor++\n }\n }\n\n // Remove unmatched nodes first, so placing the rest needs as few moves as possible.\n for (const node of oldNodes) {\n if (!used.has(node)) parent.removeChild(node)\n }\n\n // Patch or create, then place from the end using the next sibling as anchor.\n const ns = childNamespace(parent)\n const doc = parent.ownerDocument\n let anchor: Node | null = null\n for (let i = next.length - 1; i >= 0; i--) {\n const child = next[i] as Child\n let node = matched[i]\n if (node) {\n patchNode(node, child)\n } else {\n node = createNode(child, ns, doc) ?? undefined\n if (!node) continue\n }\n if (node.parentNode !== parent || node.nextSibling !== anchor) {\n parent.insertBefore(node, anchor)\n }\n anchor = node\n }\n}\n"],"mappings":";;;AACA,MAAM,UAAU;;AAGhB,MAAM,WAAW;;AAGjB,SAAgB,WAAW,MAAuB;CAChD,O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YAAY,QAAQ;EAEtB,IAAI,aAAa,CAAC,KAAK,IAAI,SAAS,KAAK,SAAS,WAAW,KAAK,GAAG;GACnE,QAAQ,KAAK;GACb,KAAK,IAAI,SAAS;GAClB,IAAI,cAAc,QAAQ,SAAS;EACrC;CACF;CAGA,KAAK,MAAM,QAAQ,UACjB,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG,OAAO,YAAY,IAAI;CAI9C,MAAM,KAAK,eAAe,MAAM;CAChC,MAAM,MAAM,OAAO;CACnB,IAAI,SAAsB;CAC1B,KAAK,IAAI,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK;EACzC,MAAM,QAAQ,KAAK;EACnB,IAAI,OAAO,QAAQ;EACnB,IAAI,MACF,UAAU,MAAM,KAAK;OAChB;GACL,OAAO,WAAW,OAAO,IAAI,GAAG,KAAK,KAAA;GACrC,IAAI,CAAC,MAAM;EACb;EACA,IAAI,KAAK,eAAe,UAAU,KAAK,gBAAgB,QACrD,OAAO,aAAa,MAAM,MAAM;EAElC,SAAS;CACX;AACF"}
@@ -1,5 +1,5 @@
1
- const require_layout = require("./layout-CtMBhNd9.cjs");
2
- //#region src/export-chart.ts
1
+ const require_layout = require("./layout-Cfg9x1k2.cjs");
2
+ // src/export-chart.ts
3
3
  const SVG_NS = "http://www.w3.org/2000/svg";
4
4
  /** Properties copied from the computed style, with the values they can be left out at. */
5
5
  const SHAPE = {
@@ -115,13 +115,9 @@ function legendLayer(container) {
115
115
  label.textContent = name.textContent;
116
116
  g.append(dot, label);
117
117
  }
118
- const bottom = legend.getAttribute("data-position") === "bottom";
119
- const margin = Number.parseFloat(getComputedStyle(legend)[bottom ? "marginTop" : "marginBottom"]) || 0;
120
118
  return {
121
119
  svg: g,
122
- height: require_layout.round(box.height + margin),
123
- margin,
124
- bottom
120
+ box
125
121
  };
126
122
  }
127
123
  /**
@@ -149,18 +145,27 @@ function exportSVG(target, options = {}) {
149
145
  const chartStyle = getComputedStyle(svg);
150
146
  const container = svg.parentElement;
151
147
  const legend = options.legend !== false && container ? legendLayer(container) : void 0;
148
+ let totalWidth = width;
152
149
  let total = height;
153
150
  if (legend) {
151
+ const { box } = legend;
152
+ const at = svg.getBoundingClientRect();
153
+ const left = Math.min(at.left, box.left);
154
+ const top = Math.min(at.top, box.top);
154
155
  const wrap = doc.createElementNS(SVG_NS, "g");
155
156
  wrap.append(...Array.from(copy.childNodes));
156
- if (legend.bottom) legend.svg.setAttribute("transform", `translate(0 ${height + legend.margin})`);
157
- else wrap.setAttribute("transform", `translate(0 ${legend.height})`);
157
+ const move = (el, x, y) => {
158
+ if (x || y) el.setAttribute("transform", `translate(${require_layout.round(x)} ${require_layout.round(y)})`);
159
+ };
160
+ move(wrap, at.left - left, at.top - top);
161
+ move(legend.svg, box.left - left, box.top - top);
158
162
  copy.append(wrap, legend.svg);
159
- total = height + legend.height;
163
+ totalWidth = require_layout.round(Math.max(at.left + width, box.right) - left);
164
+ total = require_layout.round(Math.max(at.top + height, box.bottom) - top);
160
165
  }
161
- copy.setAttribute("width", String(width));
166
+ copy.setAttribute("width", String(totalWidth));
162
167
  copy.setAttribute("height", String(total));
163
- copy.setAttribute("viewBox", `0 0 ${width} ${total}`);
168
+ copy.setAttribute("viewBox", `0 0 ${totalWidth} ${total}`);
164
169
  const name = svg.getAttribute("aria-label");
165
170
  if (name) {
166
171
  const title = doc.createElementNS(SVG_NS, "title");
@@ -226,7 +231,6 @@ async function downloadChart(target, options = {}) {
226
231
  link.click();
227
232
  setTimeout(() => URL.revokeObjectURL(link.href), 1e3);
228
233
  }
229
- //#endregion
230
234
  Object.defineProperty(exports, "downloadChart", {
231
235
  enumerable: true,
232
236
  get: function() {
@@ -246,4 +250,4 @@ Object.defineProperty(exports, "exportSVG", {
246
250
  }
247
251
  });
248
252
 
249
- //# sourceMappingURL=export-chart-BhhYgksr.cjs.map
253
+ //# sourceMappingURL=export-chart-CPtXmZvi.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-chart-CPtXmZvi.cjs","names":["round"],"sources":["../src/export-chart.ts"],"sourcesContent":["/**\n * Export a rendered chart as a standalone SVG or an image\n * (`exportSVG()`, `exportImage()`, `downloadChart()` of `@tabler/charts/export`).\n *\n * Charts are styled by CSS, so the export copies the computed styles of\n * every mark into the SVG: the file looks the same anywhere, without the\n * stylesheet or the page's custom properties. Browser only.\n *\n * Kept free of side effects, so `@tabler/charts` can re-export the functions\n * without carrying them into every bundle: the `/export` entry registers the\n * `download` menu's saver on top.\n */\nimport type { Chart } from './chart.ts'\nimport { round } from './layout.ts'\n\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\nexport interface ExportOptions {\n /**\n * Background color, `'auto'` for the chart's surface (`--tc-surface`), or\n * `false` for none (transparent). Defaults to `'auto'`.\n */\n background?: string | false\n /** Draw the legend into the image, as the page shows it. Defaults to `true`. */\n legend?: boolean\n}\n\nexport interface ImageOptions extends ExportOptions {\n /** Image type. Defaults to `'image/png'`. */\n type?: 'image/png' | 'image/jpeg' | 'image/webp'\n /** Pixels per chart pixel. Defaults to `2`. */\n scale?: number\n /** Quality of lossy types, `0…1`. */\n quality?: number\n}\n\nexport interface DownloadOptions extends ImageOptions {\n /** File name without the extension. Defaults to the chart's title, or `chart`. */\n filename?: string\n /** File format. Defaults to `'png'`. */\n format?: 'svg' | 'png' | 'jpeg' | 'webp'\n}\n\n/** A chart, its container, or its root `<svg>`. */\nexport type ExportTarget = Chart<object> | Element\n\n/** Properties copied from the computed style, with the values they can be left out at. */\nconst SHAPE: Record<string, string> = {\n fill: 'rgb(0, 0, 0)',\n 'fill-opacity': '1',\n stroke: 'none',\n 'stroke-width': '1px',\n 'stroke-opacity': '1',\n 'stroke-dasharray': 'none',\n 'stroke-dashoffset': '0px',\n 'stroke-linecap': 'butt',\n 'stroke-linejoin': 'miter',\n 'paint-order': 'normal',\n 'shape-rendering': 'auto',\n 'vector-effect': 'none',\n opacity: '1',\n visibility: 'visible',\n}\nconst TEXT: Record<string, string> = {\n ...SHAPE,\n 'font-family': '',\n 'font-size': '',\n 'font-weight': '400',\n 'font-style': 'normal',\n 'font-variant-numeric': 'normal',\n 'letter-spacing': 'normal',\n}\nconst STOP: Record<string, string> = { 'stop-color': '', 'stop-opacity': '1' }\nconst GROUP: Record<string, string> = { opacity: '1' }\nconst SHAPES = new Set(['path', 'line', 'rect', 'circle', 'ellipse', 'polygon', 'polyline'])\n\nfunction rootOf(target: ExportTarget): SVGSVGElement {\n const el = 'element' in target && !(target instanceof Element) ? target.element : target\n const svg = el.localName === 'svg' ? el : el.querySelector(':scope > svg.tc-chart')\n if (!svg) throw new Error('@tabler/charts: no rendered chart to export.')\n return svg as SVGSVGElement\n}\n\n/** A computed transform as an SVG `transform` attribute, around its origin. */\nfunction transformOf(style: CSSStyleDeclaration): string | undefined {\n const value = style.transform\n if (!value || value === 'none') return undefined\n // Browsers report a matrix; SVG takes the same functions without units.\n const svg = value.replace(/px/g, '')\n if (svg.startsWith('translate')) return svg\n const [ox = 0, oy = 0] = (style.transformOrigin || '0 0').split(' ').map(Number.parseFloat)\n return ox || oy ? `translate(${ox} ${oy}) ${svg} translate(${-ox} ${-oy})` : svg\n}\n\n/** Copy the computed look of `live` onto its clone, recursively. */\nfunction inline(live: Element, copy: Element): boolean {\n const style = getComputedStyle(live)\n if (style.display === 'none') return false\n const tag = live.localName\n const props = tag === 'text' ? TEXT : tag === 'stop' ? STOP : SHAPES.has(tag) ? SHAPE : GROUP\n const declarations: string[] = []\n for (const name in props) {\n const value = style.getPropertyValue(name)\n if (value && value !== props[name]) declarations.push(`${name}:${value}`)\n }\n copy.removeAttribute('style')\n if (declarations.length) copy.setAttribute('style', declarations.join(';'))\n const transform = transformOf(style)\n if (transform) copy.setAttribute('transform', transform)\n\n const liveChildren = Array.from(live.children)\n const copies = Array.from(copy.children)\n liveChildren.forEach((child, i) => {\n const twin = copies[i] as Element\n if (child.classList.contains('tc-hover-layer') || !inline(child, twin)) twin.remove()\n })\n return true\n}\n\n/**\n * The legend as the page lays it out: every entry at its place relative to\n * the legend box, with a swatch (hollow when hidden) and its name.\n */\nfunction legendLayer(container: Element): { svg: Element; box: DOMRect } | undefined {\n const legend = container.querySelector(':scope > .tc-legend')\n const items = legend ? Array.from(legend.querySelectorAll('.tc-legend-item')) : []\n if (!legend || !items.length) return undefined\n const doc = container.ownerDocument\n const patterned = container.querySelector(':scope > svg.tc-patterned')\n const box = legend.getBoundingClientRect()\n const g = doc.createElementNS(SVG_NS, 'g')\n for (const item of items) {\n const swatch = item.querySelector('.tc-legend-swatch')\n const name = item.querySelector('.tc-legend-name')\n if (!swatch || !name) continue\n const s = swatch.getBoundingClientRect()\n const n = name.getBoundingClientRect()\n const color = getComputedStyle(swatch).getPropertyValue('--tc-series-color').trim()\n // A chart that wears its patterns has them in the copied svg: the swatch takes its slot's.\n const slot = /\\btc-series-([1-8])\\b/.exec(item.getAttribute('class') ?? '')?.[1] ?? 'other'\n const fill = patterned\n ? getComputedStyle(patterned).getPropertyValue(`--tc-pattern-${slot}`).trim()\n : ''\n const hidden = item.classList.contains('tc-legend-item-hidden')\n const dot = doc.createElementNS(SVG_NS, 'circle')\n dot.setAttribute('cx', String(round(s.left - box.left + s.width / 2)))\n dot.setAttribute('cy', String(round(s.top - box.top + s.height / 2)))\n dot.setAttribute('r', String(round(s.width / 2 - (hidden ? 0.75 : 0))))\n dot.setAttribute(\n 'style',\n hidden\n ? `fill:none;stroke:${color};stroke-width:1.5px`\n : `fill:${fill.startsWith('url(') ? fill : color}`,\n )\n const text = getComputedStyle(name)\n const label = doc.createElementNS(SVG_NS, 'text')\n label.setAttribute('x', String(round(n.left - box.left)))\n label.setAttribute('y', String(round(n.top - box.top + n.height / 2)))\n label.setAttribute('dy', '0.35em')\n label.setAttribute(\n 'style',\n `fill:${text.color};font-family:${text.fontFamily};font-size:${text.fontSize};font-weight:${text.fontWeight}`,\n )\n label.textContent = name.textContent\n g.append(dot, label)\n }\n return { svg: g, box }\n}\n\n/**\n * The chart as a standalone SVG document: the computed styles are inlined,\n * hover marks left out and running animations finished first.\n *\n * ```ts\n * const svg = exportSVG(chart)\n * ```\n */\nexport function exportSVG(target: ExportTarget, options: ExportOptions = {}): string {\n const svg = rootOf(target)\n // Read the resting state, not a frame in the middle of an entrance or update.\n for (const animation of svg.getAnimations?.({ subtree: true }) ?? []) animation.finish()\n const copy = svg.cloneNode(true) as SVGSVGElement\n inline(svg, copy)\n const doc = svg.ownerDocument\n const width = Number(svg.getAttribute('width'))\n const height = Number(svg.getAttribute('height'))\n copy.setAttribute('xmlns', SVG_NS)\n copy.removeAttribute('class')\n copy.removeAttribute('tabindex')\n copy.removeAttribute('data-resizing')\n copy.removeAttribute('aria-describedby')\n copy.removeAttribute('aria-activedescendant')\n\n const chartStyle = getComputedStyle(svg)\n const container = svg.parentElement\n const legend = options.legend !== false && container ? legendLayer(container) : undefined\n let totalWidth = width\n let total = height\n if (legend) {\n // Chart and legend where the page shows them (above, below or beside),\n // with the gap between them, in one image as large as both.\n const { box } = legend\n const at = svg.getBoundingClientRect()\n const left = Math.min(at.left, box.left)\n const top = Math.min(at.top, box.top)\n const wrap = doc.createElementNS(SVG_NS, 'g')\n wrap.append(...Array.from(copy.childNodes))\n const move = (el: Element, x: number, y: number) => {\n if (x || y) el.setAttribute('transform', `translate(${round(x)} ${round(y)})`)\n }\n move(wrap, at.left - left, at.top - top)\n move(legend.svg, box.left - left, box.top - top)\n copy.append(wrap, legend.svg)\n totalWidth = round(Math.max(at.left + width, box.right) - left)\n total = round(Math.max(at.top + height, box.bottom) - top)\n }\n copy.setAttribute('width', String(totalWidth))\n copy.setAttribute('height', String(total))\n copy.setAttribute('viewBox', `0 0 ${totalWidth} ${total}`)\n\n // A name for the file itself, besides the aria-label.\n const name = svg.getAttribute('aria-label')\n if (name) {\n const title = doc.createElementNS(SVG_NS, 'title')\n title.textContent = name\n copy.prepend(title)\n }\n\n const background =\n options.background === undefined || options.background === 'auto'\n ? chartStyle.getPropertyValue('--tc-surface').trim() || undefined\n : options.background || undefined\n if (background) {\n const rect = doc.createElementNS(SVG_NS, 'rect')\n rect.setAttribute('width', '100%')\n rect.setAttribute('height', '100%')\n rect.setAttribute('fill', background)\n copy.insertBefore(rect, copy.querySelector(':scope > title')?.nextSibling ?? copy.firstChild)\n }\n return new XMLSerializer().serializeToString(copy)\n}\n\n/**\n * The chart as an image (PNG by default), drawn from `exportSVG()` at\n * `scale` pixels per chart pixel.\n *\n * ```ts\n * const blob = await exportImage(chart, { scale: 3 })\n * ```\n */\nexport async function exportImage(target: ExportTarget, options: ImageOptions = {}): Promise<Blob> {\n const { type = 'image/png', scale = 2, quality } = options\n const markup = exportSVG(target, {\n ...options,\n // JPEG has no transparency: without a background it would turn black.\n ...(type === 'image/jpeg' && options.background === false ? { background: '#fff' } : {}),\n })\n const doc = rootOf(target).ownerDocument\n const image = new Image()\n image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(markup)}`\n await image.decode()\n const canvas = doc.createElement('canvas')\n canvas.width = Math.round(image.width * scale)\n canvas.height = Math.round(image.height * scale)\n const context = canvas.getContext('2d')\n if (!context) throw new Error('@tabler/charts: no 2d canvas to draw the image.')\n context.drawImage(image, 0, 0, canvas.width, canvas.height)\n return new Promise((resolve, reject) => {\n canvas.toBlob(\n (blob) => (blob ? resolve(blob) : reject(new Error('@tabler/charts: could not encode.'))),\n type,\n quality,\n )\n })\n}\n\n/**\n * Save the chart as a file: PNG by default, or SVG, JPEG or WebP.\n *\n * ```ts\n * button.onclick = () => downloadChart(chart, { format: 'svg', filename: 'sales' })\n * ```\n */\nexport async function downloadChart(\n target: ExportTarget,\n options: DownloadOptions = {},\n): Promise<void> {\n const { format = 'png' } = options\n const svg = rootOf(target)\n const blob =\n format === 'svg'\n ? new Blob([exportSVG(target, options)], { type: 'image/svg+xml' })\n : await exportImage(target, { ...options, type: `image/${format}` })\n const name = (options.filename ?? svg.getAttribute('aria-label') ?? 'chart')\n .replace(/[\\\\/:*?\"<>|]+/g, '')\n .trim()\n const link = svg.ownerDocument.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.download = `${name || 'chart'}.${format === 'jpeg' ? 'jpg' : format}`\n link.click()\n // Give the browser a moment to start the download before the URL goes.\n setTimeout(() => URL.revokeObjectURL(link.href), 1000)\n}\n"],"mappings":";;AAeA,MAAM,SAAS;;AAgCf,MAAM,QAAgC;CACpC,MAAM;CACN,gBAAgB;CAChB,QAAQ;CACR,gBAAgB;CAChB,kBAAkB;CAClB,oBAAoB;CACpB,qBAAqB;CACrB,kBAAkB;CAClB,mBAAmB;CACnB,eAAe;CACf,mBAAmB;CACnB,iBAAiB;CACjB,SAAS;CACT,YAAY;AACd;AACA,MAAM,OAA+B;CACnC,GAAG;CACH,eAAe;CACf,aAAa;CACb,eAAe;CACf,cAAc;CACd,wBAAwB;CACxB,kBAAkB;AACpB;AACA,MAAM,OAA+B;CAAE,cAAc;CAAI,gBAAgB;AAAI;AAC7E,MAAM,QAAgC,EAAE,SAAS,IAAI;AACrD,MAAM,yBAAS,IAAI,IAAI;CAAC;CAAQ;CAAQ;CAAQ;CAAU;CAAW;CAAW;AAAU,CAAC;AAE3F,SAAS,OAAO,QAAqC;CACnD,MAAM,KAAK,aAAa,UAAU,EAAE,kBAAkB,WAAW,OAAO,UAAU;CAClF,MAAM,MAAM,GAAG,cAAc,QAAQ,KAAK,GAAG,cAAc,uBAAuB;CAClF,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,8CAA8C;CACxE,OAAO;AACT;;AAGA,SAAS,YAAY,OAAgD;CACnE,MAAM,QAAQ,MAAM;CACpB,IAAI,CAAC,SAAS,UAAU,QAAQ,OAAO,KAAA;CAEvC,MAAM,MAAM,MAAM,QAAQ,OAAO,EAAE;CACnC,IAAI,IAAI,WAAW,WAAW,GAAG,OAAO;CACxC,MAAM,CAAC,KAAK,GAAG,KAAK,MAAM,MAAM,mBAAmB,MAAA,CAAO,MAAM,GAAG,CAAC,CAAC,IAAI,OAAO,UAAU;CAC1F,OAAO,MAAM,KAAK,aAAa,G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G,QAAQ,QAAQ,GAAG,WAAW,SAAS,QAAQ;CAClE,KAAK,MAAM;CAEX,iBAAiB,IAAI,gBAAgB,KAAK,IAAI,GAAG,GAAI;AACvD"}
@@ -1,5 +1,5 @@
1
- import { a as round } from "./layout-B3hiqVEw.js";
2
- //#region src/export-chart.ts
1
+ import { s as round } from "./layout-DqAte3H8.js";
2
+ // src/export-chart.ts
3
3
  const SVG_NS = "http://www.w3.org/2000/svg";
4
4
  /** Properties copied from the computed style, with the values they can be left out at. */
5
5
  const SHAPE = {
@@ -115,13 +115,9 @@ function legendLayer(container) {
115
115
  label.textContent = name.textContent;
116
116
  g.append(dot, label);
117
117
  }
118
- const bottom = legend.getAttribute("data-position") === "bottom";
119
- const margin = Number.parseFloat(getComputedStyle(legend)[bottom ? "marginTop" : "marginBottom"]) || 0;
120
118
  return {
121
119
  svg: g,
122
- height: round(box.height + margin),
123
- margin,
124
- bottom
120
+ box
125
121
  };
126
122
  }
127
123
  /**
@@ -149,18 +145,27 @@ function exportSVG(target, options = {}) {
149
145
  const chartStyle = getComputedStyle(svg);
150
146
  const container = svg.parentElement;
151
147
  const legend = options.legend !== false && container ? legendLayer(container) : void 0;
148
+ let totalWidth = width;
152
149
  let total = height;
153
150
  if (legend) {
151
+ const { box } = legend;
152
+ const at = svg.getBoundingClientRect();
153
+ const left = Math.min(at.left, box.left);
154
+ const top = Math.min(at.top, box.top);
154
155
  const wrap = doc.createElementNS(SVG_NS, "g");
155
156
  wrap.append(...Array.from(copy.childNodes));
156
- if (legend.bottom) legend.svg.setAttribute("transform", `translate(0 ${height + legend.margin})`);
157
- else wrap.setAttribute("transform", `translate(0 ${legend.height})`);
157
+ const move = (el, x, y) => {
158
+ if (x || y) el.setAttribute("transform", `translate(${round(x)} ${round(y)})`);
159
+ };
160
+ move(wrap, at.left - left, at.top - top);
161
+ move(legend.svg, box.left - left, box.top - top);
158
162
  copy.append(wrap, legend.svg);
159
- total = height + legend.height;
163
+ totalWidth = round(Math.max(at.left + width, box.right) - left);
164
+ total = round(Math.max(at.top + height, box.bottom) - top);
160
165
  }
161
- copy.setAttribute("width", String(width));
166
+ copy.setAttribute("width", String(totalWidth));
162
167
  copy.setAttribute("height", String(total));
163
- copy.setAttribute("viewBox", `0 0 ${width} ${total}`);
168
+ copy.setAttribute("viewBox", `0 0 ${totalWidth} ${total}`);
164
169
  const name = svg.getAttribute("aria-label");
165
170
  if (name) {
166
171
  const title = doc.createElementNS(SVG_NS, "title");
@@ -226,7 +231,6 @@ async function downloadChart(target, options = {}) {
226
231
  link.click();
227
232
  setTimeout(() => URL.revokeObjectURL(link.href), 1e3);
228
233
  }
229
- //#endregion
230
234
  export { exportImage as n, exportSVG as r, downloadChart as t };
231
235
 
232
- //# sourceMappingURL=export-chart-9w8t3rjZ.js.map
236
+ //# sourceMappingURL=export-chart-DoeiAyR2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-chart-DoeiAyR2.js","names":[],"sources":["../src/export-chart.ts"],"sourcesContent":["/**\n * Export a rendered chart as a standalone SVG or an image\n * (`exportSVG()`, `exportImage()`, `downloadChart()` of `@tabler/charts/export`).\n *\n * Charts are styled by CSS, so the export copies the computed styles of\n * every mark into the SVG: the file looks the same anywhere, without the\n * stylesheet or the page's custom properties. Browser only.\n *\n * Kept free of side effects, so `@tabler/charts` can re-export the functions\n * without carrying them into every bundle: the `/export` entry registers the\n * `download` menu's saver on top.\n */\nimport type { Chart } from './chart.ts'\nimport { round } from './layout.ts'\n\nconst SVG_NS = 'http://www.w3.org/2000/svg'\n\nexport interface ExportOptions {\n /**\n * Background color, `'auto'` for the chart's surface (`--tc-surface`), or\n * `false` for none (transparent). Defaults to `'auto'`.\n */\n background?: string | false\n /** Draw the legend into the image, as the page shows it. Defaults to `true`. */\n legend?: boolean\n}\n\nexport interface ImageOptions extends ExportOptions {\n /** Image type. Defaults to `'image/png'`. */\n type?: 'image/png' | 'image/jpeg' | 'image/webp'\n /** Pixels per chart pixel. Defaults to `2`. */\n scale?: number\n /** Quality of lossy types, `0…1`. */\n quality?: number\n}\n\nexport interface DownloadOptions extends ImageOptions {\n /** File name without the extension. Defaults to the chart's title, or `chart`. */\n filename?: string\n /** File format. Defaults to `'png'`. */\n format?: 'svg' | 'png' | 'jpeg' | 'webp'\n}\n\n/** A chart, its container, or its root `<svg>`. */\nexport type ExportTarget = Chart<object> | Element\n\n/** Properties copied from the computed style, with the values they can be left out at. */\nconst SHAPE: Record<string, string> = {\n fill: 'rgb(0, 0, 0)',\n 'fill-opacity': '1',\n stroke: 'none',\n 'stroke-width': '1px',\n 'stroke-opacity': '1',\n 'stroke-dasharray': 'none',\n 'stroke-dashoffset': '0px',\n 'stroke-linecap': 'butt',\n 'stroke-linejoin': 'miter',\n 'paint-order': 'normal',\n 'shape-rendering': 'auto',\n 'vector-effect': 'none',\n opacity: '1',\n visibility: 'visible',\n}\nconst TEXT: Record<string, string> = {\n ...SHAPE,\n 'font-family': '',\n 'font-size': '',\n 'font-weight': '400',\n 'font-style': 'normal',\n 'font-variant-numeric': 'normal',\n 'letter-spacing': 'normal',\n}\nconst STOP: Record<string, string> = { 'stop-color': '', 'stop-opacity': '1' }\nconst GROUP: Record<string, string> = { opacity: '1' }\nconst SHAPES = new Set(['path', 'line', 'rect', 'circle', 'ellipse', 'polygon', 'polyline'])\n\nfunction rootOf(target: ExportTarget): SVGSVGElement {\n const el = 'element' in target && !(target instanceof Element) ? target.element : target\n const svg = el.localName === 'svg' ? el : el.querySelector(':scope > svg.tc-chart')\n if (!svg) throw new Error('@tabler/charts: no rendered chart to export.')\n return svg as SVGSVGElement\n}\n\n/** A computed transform as an SVG `transform` attribute, around its origin. */\nfunction transformOf(style: CSSStyleDeclaration): string | undefined {\n const value = style.transform\n if (!value || value === 'none') return undefined\n // Browsers report a matrix; SVG takes the same functions without units.\n const svg = value.replace(/px/g, '')\n if (svg.startsWith('translate')) return svg\n const [ox = 0, oy = 0] = (style.transformOrigin || '0 0').split(' ').map(Number.parseFloat)\n return ox || oy ? `translate(${ox} ${oy}) ${svg} translate(${-ox} ${-oy})` : svg\n}\n\n/** Copy the computed look of `live` onto its clone, recursively. */\nfunction inline(live: Element, copy: Element): boolean {\n const style = getComputedStyle(live)\n if (style.display === 'none') return false\n const tag = live.localName\n const props = tag === 'text' ? TEXT : tag === 'stop' ? STOP : SHAPES.has(tag) ? SHAPE : GROUP\n const declarations: string[] = []\n for (const name in props) {\n const value = style.getPropertyValue(name)\n if (value && value !== props[name]) declarations.push(`${name}:${value}`)\n }\n copy.removeAttribute('style')\n if (declarations.length) copy.setAttribute('style', declarations.join(';'))\n const transform = transformOf(style)\n if (transform) copy.setAttribute('transform', transform)\n\n const liveChildren = Array.from(live.children)\n const copies = Array.from(copy.children)\n liveChildren.forEach((child, i) => {\n const twin = copies[i] as Element\n if (child.classList.contains('tc-hover-layer') || !inline(child, twin)) twin.remove()\n })\n return true\n}\n\n/**\n * The legend as the page lays it out: every entry at its place relative to\n * the legend box, with a swatch (hollow when hidden) and its name.\n */\nfunction legendLayer(container: Element): { svg: Element; box: DOMRect } | undefined {\n const legend = container.querySelector(':scope > .tc-legend')\n const items = legend ? Array.from(legend.querySelectorAll('.tc-legend-item')) : []\n if (!legend || !items.length) return undefined\n const doc = container.ownerDocument\n const patterned = container.querySelector(':scope > svg.tc-patterned')\n const box = legend.getBoundingClientRect()\n const g = doc.createElementNS(SVG_NS, 'g')\n for (const item of items) {\n const swatch = item.querySelector('.tc-legend-swatch')\n const name = item.querySelector('.tc-legend-name')\n if (!swatch || !name) continue\n const s = swatch.getBoundingClientRect()\n const n = name.getBoundingClientRect()\n const color = getComputedStyle(swatch).getPropertyValue('--tc-series-color').trim()\n // A chart that wears its patterns has them in the copied svg: the swatch takes its slot's.\n const slot = /\\btc-series-([1-8])\\b/.exec(item.getAttribute('class') ?? '')?.[1] ?? 'other'\n const fill = patterned\n ? getComputedStyle(patterned).getPropertyValue(`--tc-pattern-${slot}`).trim()\n : ''\n const hidden = item.classList.contains('tc-legend-item-hidden')\n const dot = doc.createElementNS(SVG_NS, 'circle')\n dot.setAttribute('cx', String(round(s.left - box.left + s.width / 2)))\n dot.setAttribute('cy', String(round(s.top - box.top + s.height / 2)))\n dot.setAttribute('r', String(round(s.width / 2 - (hidden ? 0.75 : 0))))\n dot.setAttribute(\n 'style',\n hidden\n ? `fill:none;stroke:${color};stroke-width:1.5px`\n : `fill:${fill.startsWith('url(') ? fill : color}`,\n )\n const text = getComputedStyle(name)\n const label = doc.createElementNS(SVG_NS, 'text')\n label.setAttribute('x', String(round(n.left - box.left)))\n label.setAttribute('y', String(round(n.top - box.top + n.height / 2)))\n label.setAttribute('dy', '0.35em')\n label.setAttribute(\n 'style',\n `fill:${text.color};font-family:${text.fontFamily};font-size:${text.fontSize};font-weight:${text.fontWeight}`,\n )\n label.textContent = name.textContent\n g.append(dot, label)\n }\n return { svg: g, box }\n}\n\n/**\n * The chart as a standalone SVG document: the computed styles are inlined,\n * hover marks left out and running animations finished first.\n *\n * ```ts\n * const svg = exportSVG(chart)\n * ```\n */\nexport function exportSVG(target: ExportTarget, options: ExportOptions = {}): string {\n const svg = rootOf(target)\n // Read the resting state, not a frame in the middle of an entrance or update.\n for (const animation of svg.getAnimations?.({ subtree: true }) ?? []) animation.finish()\n const copy = svg.cloneNode(true) as SVGSVGElement\n inline(svg, copy)\n const doc = svg.ownerDocument\n const width = Number(svg.getAttribute('width'))\n const height = Number(svg.getAttribute('height'))\n copy.setAttribute('xmlns', SVG_NS)\n copy.removeAttribute('class')\n copy.removeAttribute('tabindex')\n copy.removeAttribute('data-resizing')\n copy.removeAttribute('aria-describedby')\n copy.removeAttribute('aria-activedescendant')\n\n const chartStyle = getComputedStyle(svg)\n const container = svg.parentElement\n const legend = options.legend !== false && container ? legendLayer(container) : undefined\n let totalWidth = width\n let total = height\n if (legend) {\n // Chart and legend where the page shows them (above, below or beside),\n // with the gap between them, in one image as large as both.\n const { box } = legend\n const at = svg.getBoundingClientRect()\n const left = Math.min(at.left, box.left)\n const top = Math.min(at.top, box.top)\n const wrap = doc.createElementNS(SVG_NS, 'g')\n wrap.append(...Array.from(copy.childNodes))\n const move = (el: Element, x: number, y: number) => {\n if (x || y) el.setAttribute('transform', `translate(${round(x)} ${round(y)})`)\n }\n move(wrap, at.left - left, at.top - top)\n move(legend.svg, box.left - left, box.top - top)\n copy.append(wrap, legend.svg)\n totalWidth = round(Math.max(at.left + width, box.right) - left)\n total = round(Math.max(at.top + height, box.bottom) - top)\n }\n copy.setAttribute('width', String(totalWidth))\n copy.setAttribute('height', String(total))\n copy.setAttribute('viewBox', `0 0 ${totalWidth} ${total}`)\n\n // A name for the file itself, besides the aria-label.\n const name = svg.getAttribute('aria-label')\n if (name) {\n const title = doc.createElementNS(SVG_NS, 'title')\n title.textContent = name\n copy.prepend(title)\n }\n\n const background =\n options.background === undefined || options.background === 'auto'\n ? chartStyle.getPropertyValue('--tc-surface').trim() || undefined\n : options.background || undefined\n if (background) {\n const rect = doc.createElementNS(SVG_NS, 'rect')\n rect.setAttribute('width', '100%')\n rect.setAttribute('height', '100%')\n rect.setAttribute('fill', background)\n copy.insertBefore(rect, copy.querySelector(':scope > title')?.nextSibling ?? copy.firstChild)\n }\n return new XMLSerializer().serializeToString(copy)\n}\n\n/**\n * The chart as an image (PNG by default), drawn from `exportSVG()` at\n * `scale` pixels per chart pixel.\n *\n * ```ts\n * const blob = await exportImage(chart, { scale: 3 })\n * ```\n */\nexport async function exportImage(target: ExportTarget, options: ImageOptions = {}): Promise<Blob> {\n const { type = 'image/png', scale = 2, quality } = options\n const markup = exportSVG(target, {\n ...options,\n // JPEG has no transparency: without a background it would turn black.\n ...(type === 'image/jpeg' && options.background === false ? { background: '#fff' } : {}),\n })\n const doc = rootOf(target).ownerDocument\n const image = new Image()\n image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(markup)}`\n await image.decode()\n const canvas = doc.createElement('canvas')\n canvas.width = Math.round(image.width * scale)\n canvas.height = Math.round(image.height * scale)\n const context = canvas.getContext('2d')\n if (!context) throw new Error('@tabler/charts: no 2d canvas to draw the image.')\n context.drawImage(image, 0, 0, canvas.width, canvas.height)\n return new Promise((resolve, reject) => {\n canvas.toBlob(\n (blob) => (blob ? resolve(blob) : reject(new Error('@tabler/charts: could not encode.'))),\n type,\n quality,\n )\n })\n}\n\n/**\n * Save the chart as a file: PNG by default, or SVG, JPEG or WebP.\n *\n * ```ts\n * button.onclick = () => downloadChart(chart, { format: 'svg', filename: 'sales' })\n * ```\n */\nexport async function downloadChart(\n target: ExportTarget,\n options: DownloadOptions = {},\n): Promise<void> {\n const { format = 'png' } = options\n const svg = rootOf(target)\n const blob =\n format === 'svg'\n ? new Blob([exportSVG(target, options)], { type: 'image/svg+xml' })\n : await exportImage(target, { ...options, type: `image/${format}` })\n const name = (options.filename ?? svg.getAttribute('aria-label') ?? 'chart')\n .replace(/[\\\\/:*?\"<>|]+/g, '')\n .trim()\n const link = svg.ownerDocument.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.download = `${name || 'chart'}.${format === 'jpeg' ? 'jpg' : format}`\n link.click()\n // Give the browser a moment to start the download before the URL goes.\n setTimeout(() => URL.revokeObjectURL(link.href), 1000)\n}\n"],"mappings":";;AAeA,MAAM,SAAS;;AAgCf,MAAM,QAAgC;CACpC,MAAM;CACN,gBAAgB;CAChB,QAAQ;CACR,gBAAgB;CAChB,kBAAkB;CAClB,oBAAoB;CACpB,qBAAqB;CACrB,kBAAkB;CAClB,mBAAmB;CACnB,eAAe;CACf,mBAAmB;CACnB,iBAAiB;CACjB,SAAS;CACT,YAAY;AACd;AACA,MAAM,OAA+B;CACnC,GAAG;CACH,eAAe;CACf,aAAa;CACb,eAAe;CACf,cAAc;CACd,wBAAwB;CACxB,kBAAkB;AACpB;AACA,MAAM,OAA+B;CAAE,cAAc;CAAI,gBAAgB;AAAI;AAC7E,MAAM,QAAgC,EAAE,SAAS,IAAI;AACrD,MAAM,yBAAS,IAAI,IAAI;CAAC;CAAQ;CAAQ;CAAQ;CAAU;CAAW;C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;;;;;;;;AASA,eAAsB,cACpB,QACA,UAA2B,CAAC,GACb;CACf,MAAM,EAAE,SAAS,UAAU;CAC3B,MAAM,MAAM,OAAO,MAAM;CACzB,MAAM,OACJ,WAAW,QACP,IAAI,KAAK,CAAC,UAAU,QAAQ,OAAO,CAAC,GAAG,EAAE,MAAM,gBAAgB,CAAC,IAChE,MAAM,YAAY,QAAQ;EAAE,GAAG;EAAS,MAAM,SAAS;CAAS,CAAC;CACvE,MAAM,QAAQ,QAAQ,YAAY,IAAI,aAAa,YAAY,KAAK,QAAA,CACjE,QAAQ,kBAAkB,EAAE,CAAC,CAC7B,KAAK;CACR,MAAM,OAAO,IAAI,cAAc,cAAc,GAAG;CAChD,KAAK,OAAO,IAAI,gBAAgB,IAAI;CACpC,KAAK,WAAW,GAAG,QAAQ,QAAQ,GAAG,WAAW,SAAS,QAAQ;CAClE,KAAK,MAAM;CAEX,iBAAiB,IAAI,gBAAgB,KAAK,IAAI,GAAG,GAAI;AACvD"}
package/dist/export.cjs CHANGED
@@ -1,7 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_features = require("./features-BclHgg2W.cjs");
3
- const require_export_chart = require("./export-chart-BhhYgksr.cjs");
4
- //#region src/export.ts
2
+ const require_export_chart = require("./export-chart-CPtXmZvi.cjs");
3
+ // src/export.ts
5
4
  /**
6
5
  * Standalone entry: `import { exportSVG, exportImage, downloadChart } from '@tabler/charts/export'`
7
6
  * saves a rendered chart as a standalone SVG or an image. Importing it also
@@ -9,8 +8,7 @@ const require_export_chart = require("./export-chart-BhhYgksr.cjs");
9
8
  * `Chart` of `@tabler/charts`, which has the `download()` plugin, or with the
10
9
  * plugin installed on the core.
11
10
  */
12
- require_features.register({ export: require_export_chart.downloadChart });
13
- //#endregion
11
+ require("./features-DEDP5CEQ.cjs").register({ export: require_export_chart.downloadChart });
14
12
  exports.downloadChart = require_export_chart.downloadChart;
15
13
  exports.exportImage = require_export_chart.exportImage;
16
14
  exports.exportSVG = require_export_chart.exportSVG;
@@ -1 +1 @@
1
- {"version":3,"file":"export.cjs","names":["register","downloadChart"],"sources":["../src/export.ts"],"sourcesContent":["/**\n * Standalone entry: `import { exportSVG, exportImage, downloadChart } from '@tabler/charts/export'`\n * saves a rendered chart as a standalone SVG or an image. Importing it also\n * enables the `download` option (a menu on the chart that saves it): with the\n * `Chart` of `@tabler/charts`, which has the `download()` plugin, or with the\n * plugin installed on the core.\n */\nimport { downloadChart, exportImage, exportSVG } from './export-chart.ts'\nimport { register } from './features.ts'\n\n// Registered here, in the entry itself, so no bundler can shake it away.\nregister({ export: downloadChart })\n\nexport type {\n DownloadOptions,\n ExportOptions,\n ExportTarget,\n ImageOptions,\n} from './export-chart.ts'\nexport { downloadChart, exportImage, exportSVG }\n"],"mappings":";;;;;;;;;;;AAWAA,iBAAAA,SAAS,EAAE,QAAQC,qBAAAA,cAAc,CAAC"}
1
+ {"version":3,"file":"export.cjs","names":["register","downloadChart"],"sources":["../src/export.ts"],"sourcesContent":["/**\n * Standalone entry: `import { exportSVG, exportImage, downloadChart } from '@tabler/charts/export'`\n * saves a rendered chart as a standalone SVG or an image. Importing it also\n * enables the `download` option (a menu on the chart that saves it): with the\n * `Chart` of `@tabler/charts`, which has the `download()` plugin, or with the\n * plugin installed on the core.\n */\nimport { downloadChart, exportImage, exportSVG } from './export-chart.ts'\nimport { register } from './features.ts'\n\n// Registered here, in the entry itself, so no bundler can shake it away.\nregister({ export: downloadChart })\n\nexport type {\n DownloadOptions,\n ExportOptions,\n ExportTarget,\n ImageOptions,\n} from './export-chart.ts'\nexport { downloadChart, exportImage, exportSVG }\n"],"mappings":";;;;;;;;;;A,iCAWAA,CAAAA,CAAAA,SAAS,EAAE,QAAQC,qBAAAA,cAAc,CAAC"}
package/dist/export.d.cts CHANGED
@@ -1,2 +1,9 @@
1
- import { B as downloadChart, H as exportSVG, I as DownloadOptions, L as ExportOptions, R as ExportTarget, V as exportImage, z as ImageOptions } from "./chart-D7ooEFnk.cjs";
1
+ /**
2
+ * Standalone entry: `import { exportSVG, exportImage, downloadChart } from '@tabler/charts/export'`
3
+ * saves a rendered chart as a standalone SVG or an image. Importing it also
4
+ * enables the `download` option (a menu on the chart that saves it): with the
5
+ * `Chart` of `@tabler/charts`, which has the `download()` plugin, or with the
6
+ * plugin installed on the core.
7
+ */
8
+ import { J as ExportTarget, K as DownloadOptions, Q as exportSVG, X as downloadChart, Y as ImageOptions, Z as exportImage, q as ExportOptions } from "./chart-CbPzP5Dp.cjs";
2
9
  export { type DownloadOptions, type ExportOptions, type ExportTarget, type ImageOptions, downloadChart, exportImage, exportSVG };
package/dist/export.d.ts CHANGED
@@ -1,2 +1,9 @@
1
- import { B as downloadChart, H as exportSVG, I as DownloadOptions, L as ExportOptions, R as ExportTarget, V as exportImage, z as ImageOptions } from "./chart-DyN7bcx8.js";
1
+ /**
2
+ * Standalone entry: `import { exportSVG, exportImage, downloadChart } from '@tabler/charts/export'`
3
+ * saves a rendered chart as a standalone SVG or an image. Importing it also
4
+ * enables the `download` option (a menu on the chart that saves it): with the
5
+ * `Chart` of `@tabler/charts`, which has the `download()` plugin, or with the
6
+ * plugin installed on the core.
7
+ */
8
+ import { G as ImageOptions, H as DownloadOptions, J as exportSVG, K as downloadChart, U as ExportOptions, W as ExportTarget, q as exportImage } from "./chart-CYrrUCi3.js";
2
9
  export { type DownloadOptions, type ExportOptions, type ExportTarget, type ImageOptions, downloadChart, exportImage, exportSVG };